primereact 7.0.1 → 7.1.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/README.md +1 -1
- package/accordion/accordion.cjs.js +12 -6
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +5 -2
- package/accordion/accordion.esm.js +12 -6
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +12 -6
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +2 -0
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +30 -30
- package/api/api.esm.js +2 -0
- package/api/api.esm.min.js +1 -1
- package/api/api.js +2 -0
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +4 -4
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +9 -4
- package/autocomplete/autocomplete.esm.js +4 -4
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +4 -4
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.d.ts +1 -1
- package/blockui/blockui.cjs.js +12 -5
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +12 -5
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +12 -5
- package/blockui/blockui.min.js +1 -1
- package/button/button.d.ts +1 -1
- package/calendar/calendar.cjs.js +22 -3
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +3 -2
- package/calendar/calendar.esm.js +22 -3
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +22 -3
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +8 -9
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +8 -9
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +8 -9
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +1 -1
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +1 -1
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +1 -1
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/chip/chip.d.ts +1 -1
- package/colorpicker/colorpicker.cjs.js +1 -1
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +19 -5
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +1 -1
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +1 -1
- package/confirmdialog/confirmdialog.d.ts +1 -1
- package/confirmpopup/confirmpopup.cjs.js +2 -2
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +3 -2
- package/confirmpopup/confirmpopup.esm.js +2 -2
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -2
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +1 -1
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +1 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +1 -1
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +185 -68
- package/core/core.min.js +9 -9
- package/csstransition/csstransition.cjs.js +49 -19
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +48 -19
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +49 -21
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datatable/datatable.cjs.js +238 -186
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +25 -11
- package/datatable/datatable.esm.js +238 -186
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +238 -186
- package/datatable/datatable.min.js +1 -1
- package/dialog/dialog.cjs.js +2 -8
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -1
- package/dialog/dialog.esm.js +2 -8
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +2 -8
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +14 -4
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +14 -4
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +14 -4
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +6 -2
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +6 -2
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +6 -2
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fileupload/fileupload.d.ts +1 -1
- package/galleria/galleria.cjs.js +1 -2
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +1 -2
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +1 -2
- package/galleria/galleria.min.js +1 -1
- package/inputmask/inputmask.cjs.js +2 -2
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +2 -2
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +2 -2
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +10 -5
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +10 -5
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +10 -5
- package/inputnumber/inputnumber.min.js +1 -1
- package/mention/mention.cjs.js +1 -1
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -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 +1 -1
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +2 -1
- package/menu/menu.esm.js +1 -1
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +1 -1
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.min.css +1 -1
- package/messages/messages.d.ts +2 -1
- package/multiselect/multiselect.cjs.js +2 -2
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +3 -2
- package/multiselect/multiselect.esm.js +2 -2
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +2 -2
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +1 -1
- package/organizationchart/organizationchart.min.css +1 -1
- package/overlaypanel/overlaypanel.cjs.js +3 -7
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +2 -1
- package/overlaypanel/overlaypanel.esm.js +3 -7
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +3 -7
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -2
- package/panel/panel.cjs.js +3 -2
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +4 -3
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +3 -2
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/password/password.cjs.js +1 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +2 -1
- package/password/password.esm.js +1 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +1 -1
- package/password/password.min.js +1 -1
- package/portal/portal.cjs.js +2 -6
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +2 -6
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +3 -8
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +850 -630
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +850 -630
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +850 -630
- package/primereact.all.min.js +1 -1
- package/resources/primereact.css +356 -354
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +4 -0
- package/resources/themes/arya-green/theme.css +4 -0
- package/resources/themes/arya-orange/theme.css +4 -0
- package/resources/themes/arya-purple/theme.css +4 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +4 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +4 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +4 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +4 -0
- package/resources/themes/fluent-light/theme.css +4 -0
- package/resources/themes/lara-dark-blue/theme.css +26 -22
- package/resources/themes/lara-dark-indigo/theme.css +26 -22
- package/resources/themes/lara-dark-purple/theme.css +26 -22
- package/resources/themes/lara-dark-teal/theme.css +26 -22
- package/resources/themes/lara-light-blue/theme.css +4 -0
- package/resources/themes/lara-light-indigo/theme.css +4 -0
- package/resources/themes/lara-light-purple/theme.css +4 -0
- package/resources/themes/lara-light-teal/theme.css +4 -0
- package/resources/themes/luna-amber/theme.css +4 -0
- package/resources/themes/luna-blue/theme.css +4 -0
- package/resources/themes/luna-green/theme.css +4 -0
- package/resources/themes/luna-pink/theme.css +4 -0
- package/resources/themes/md-dark-deeppurple/theme.css +4 -0
- package/resources/themes/md-dark-indigo/theme.css +4 -0
- package/resources/themes/md-light-deeppurple/theme.css +4 -0
- package/resources/themes/md-light-indigo/theme.css +4 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +4 -0
- package/resources/themes/mdc-dark-indigo/theme.css +4 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +4 -0
- package/resources/themes/mdc-light-indigo/theme.css +4 -0
- package/resources/themes/nova/theme.css +4 -0
- package/resources/themes/nova-accent/theme.css +4 -0
- package/resources/themes/nova-alt/theme.css +4 -0
- package/resources/themes/rhea/theme.css +4 -0
- package/resources/themes/saga-blue/theme.css +4 -0
- package/resources/themes/saga-green/theme.css +4 -0
- package/resources/themes/saga-orange/theme.css +4 -0
- package/resources/themes/saga-purple/theme.css +4 -0
- package/resources/themes/tailwind-light/theme.css +4 -0
- package/resources/themes/vela-blue/theme.css +4 -0
- package/resources/themes/vela-green/theme.css +4 -0
- package/resources/themes/vela-orange/theme.css +4 -0
- package/resources/themes/vela-purple/theme.css +4 -0
- package/scrolltop/scrolltop.d.ts +3 -2
- package/selectitem/selectitem.d.ts +1 -1
- package/sidebar/sidebar.d.ts +2 -1
- package/slidemenu/slidemenu.cjs.js +1 -1
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +1 -1
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +1 -1
- package/slidemenu/slidemenu.min.js +1 -1
- package/speeddial/speeddial.d.ts +1 -1
- package/splitbutton/splitbutton.cjs.js +7 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +5 -2
- package/splitbutton/splitbutton.esm.js +7 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +7 -3
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabview/tabview.cjs.js +21 -4
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +8 -0
- package/tabview/tabview.esm.js +21 -4
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +21 -4
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.d.ts +1 -1
- package/tieredmenu/tieredmenu.cjs.js +1 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +1 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +1 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.d.ts +2 -1
- package/togglebutton/togglebutton.d.ts +1 -1
- package/tooltip/tooltip.cjs.js +32 -6
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +32 -6
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +32 -6
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.d.ts +8 -4
- package/treenode/treenode.d.ts +1 -1
- package/treeselect/treeselect.cjs.js +1 -1
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +2 -1
- package/treeselect/treeselect.esm.js +1 -1
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +1 -1
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +48 -1
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +1 -1
- package/treetable/treetable.esm.js +48 -1
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +48 -1
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +48 -1
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +1 -0
- package/utils/utils.esm.js +48 -1
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +48 -1
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +27 -17
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +27 -17
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +27 -17
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
- package/util.d.ts +0 -1
|
@@ -1050,26 +1050,7 @@ var BodyCell = /*#__PURE__*/function (_Component) {
|
|
|
1050
1050
|
props: this.props.tableProps
|
|
1051
1051
|
}));
|
|
1052
1052
|
|
|
1053
|
-
if (
|
|
1054
|
-
content = body ? ObjectUtils.getJSXElement(body, this.props.rowData, {
|
|
1055
|
-
column: this.props.column,
|
|
1056
|
-
field: this.field,
|
|
1057
|
-
rowIndex: this.props.rowIndex,
|
|
1058
|
-
frozenRow: this.props.frozenRow,
|
|
1059
|
-
props: this.props.tableProps
|
|
1060
|
-
}) : value;
|
|
1061
|
-
} else if (editor && this.state.editing) {
|
|
1062
|
-
content = ObjectUtils.getJSXElement(editor, {
|
|
1063
|
-
rowData: this.state.editingRowData,
|
|
1064
|
-
value: this.resolveFieldData(this.state.editingRowData),
|
|
1065
|
-
column: this.props.column,
|
|
1066
|
-
field: this.field,
|
|
1067
|
-
rowIndex: this.props.rowIndex,
|
|
1068
|
-
frozenRow: this.props.frozenRow,
|
|
1069
|
-
props: this.props.tableProps,
|
|
1070
|
-
editorCallback: this.editorCallback
|
|
1071
|
-
});
|
|
1072
|
-
} else if (selectionMode) {
|
|
1053
|
+
if (selectionMode) {
|
|
1073
1054
|
var showSelection = this.props.showSelectionElement ? this.props.showSelectionElement(this.props.rowData, {
|
|
1074
1055
|
rowIndex: this.props.rowIndex,
|
|
1075
1056
|
props: this.props.tableProps
|
|
@@ -1180,6 +1161,25 @@ var BodyCell = /*#__PURE__*/function (_Component) {
|
|
|
1180
1161
|
rowEditor: rowEditorProps
|
|
1181
1162
|
});
|
|
1182
1163
|
}
|
|
1164
|
+
} else if (body && !this.state.editing) {
|
|
1165
|
+
content = body ? ObjectUtils.getJSXElement(body, this.props.rowData, {
|
|
1166
|
+
column: this.props.column,
|
|
1167
|
+
field: this.field,
|
|
1168
|
+
rowIndex: this.props.rowIndex,
|
|
1169
|
+
frozenRow: this.props.frozenRow,
|
|
1170
|
+
props: this.props.tableProps
|
|
1171
|
+
}) : value;
|
|
1172
|
+
} else if (editor && this.state.editing) {
|
|
1173
|
+
content = ObjectUtils.getJSXElement(editor, {
|
|
1174
|
+
rowData: this.state.editingRowData,
|
|
1175
|
+
value: this.resolveFieldData(this.state.editingRowData),
|
|
1176
|
+
column: this.props.column,
|
|
1177
|
+
field: this.field,
|
|
1178
|
+
rowIndex: this.props.rowIndex,
|
|
1179
|
+
frozenRow: this.props.frozenRow,
|
|
1180
|
+
props: this.props.tableProps,
|
|
1181
|
+
editorCallback: this.editorCallback
|
|
1182
|
+
});
|
|
1183
1183
|
} else {
|
|
1184
1184
|
content = value;
|
|
1185
1185
|
}
|
|
@@ -1823,7 +1823,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
1823
1823
|
}, {
|
|
1824
1824
|
key: "equals",
|
|
1825
1825
|
value: function equals(data1, data2) {
|
|
1826
|
-
if (this.allowCellSelection()) return (data1.rowIndex === data2.rowIndex || data1.rowData === data2.rowData) && (data1.field === data2.field || data1.cellIndex === data2.cellIndex);else return this.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
1826
|
+
if (this.allowCellSelection()) return (data1.rowIndex === data2.rowIndex || data1.rowData === data2.rowData) && (data1.field === data2.field || data1.cellIndex === data2.cellIndex);else return this.props.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
1827
1827
|
}
|
|
1828
1828
|
}, {
|
|
1829
1829
|
key: "isSubheaderGrouping",
|
|
@@ -2092,7 +2092,8 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2092
2092
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2093
2093
|
this.props.onSelectionChange({
|
|
2094
2094
|
originalEvent: originalEvent,
|
|
2095
|
-
value: selection
|
|
2095
|
+
value: selection,
|
|
2096
|
+
type: type
|
|
2096
2097
|
});
|
|
2097
2098
|
}
|
|
2098
2099
|
}
|
|
@@ -2148,13 +2149,14 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2148
2149
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2149
2150
|
this.props.onSelectionChange({
|
|
2150
2151
|
originalEvent: originalEvent,
|
|
2151
|
-
value: selection
|
|
2152
|
+
value: selection,
|
|
2153
|
+
type: type
|
|
2152
2154
|
});
|
|
2153
2155
|
}
|
|
2154
2156
|
}
|
|
2155
2157
|
}, {
|
|
2156
2158
|
key: "onRangeSelection",
|
|
2157
|
-
value: function onRangeSelection(event) {
|
|
2159
|
+
value: function onRangeSelection(event, type) {
|
|
2158
2160
|
DomHandler.clearSelection();
|
|
2159
2161
|
this.rangeRowIndex = this.allowCellSelection() ? event.rowIndex : event.index;
|
|
2160
2162
|
var selectionInRange = this.selectRange(event);
|
|
@@ -2163,7 +2165,8 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2163
2165
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2164
2166
|
this.props.onSelectionChange({
|
|
2165
2167
|
originalEvent: event.originalEvent,
|
|
2166
|
-
value: selection
|
|
2168
|
+
value: selection,
|
|
2169
|
+
type: type
|
|
2167
2170
|
});
|
|
2168
2171
|
}
|
|
2169
2172
|
|
|
@@ -2323,7 +2326,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2323
2326
|
|
|
2324
2327
|
if (this.allowRowSelection()) {
|
|
2325
2328
|
if (this.allowRangeSelection(event)) {
|
|
2326
|
-
this.onRangeSelection(event);
|
|
2329
|
+
this.onRangeSelection(event, 'row');
|
|
2327
2330
|
} else {
|
|
2328
2331
|
var toggleable = this.isRadioSelectionModeInColumn() || this.isCheckboxSelectionModeInColumn() || this.allowMetaKeySelection(event);
|
|
2329
2332
|
this.anchorRowIndex = event.index;
|
|
@@ -2409,7 +2412,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2409
2412
|
var isSameRow = event.index === this.anchorRowIndex;
|
|
2410
2413
|
|
|
2411
2414
|
if (this.allowRowDrag(event) && !isSameRow) {
|
|
2412
|
-
this.onRangeSelection(event);
|
|
2415
|
+
this.onRangeSelection(event, 'row');
|
|
2413
2416
|
}
|
|
2414
2417
|
}
|
|
2415
2418
|
}, {
|
|
@@ -2612,7 +2615,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2612
2615
|
|
|
2613
2616
|
if (this.allowCellSelection()) {
|
|
2614
2617
|
if (this.allowRangeSelection(event)) {
|
|
2615
|
-
this.onRangeSelection(event);
|
|
2618
|
+
this.onRangeSelection(event, 'cell');
|
|
2616
2619
|
} else {
|
|
2617
2620
|
var toggleable = this.allowMetaKeySelection(event);
|
|
2618
2621
|
|
|
@@ -2661,7 +2664,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2661
2664
|
var isSameCell = event.rowIndex === this.anchorRowIndex && event.cellIndex === this.anchorCellIndex;
|
|
2662
2665
|
|
|
2663
2666
|
if (this.allowCellDrag(event) && !isSameCell) {
|
|
2664
|
-
this.onRangeSelection(event);
|
|
2667
|
+
this.onRangeSelection(event, 'cell');
|
|
2665
2668
|
}
|
|
2666
2669
|
}
|
|
2667
2670
|
}, {
|
|
@@ -3151,7 +3154,7 @@ var HeaderCheckbox = /*#__PURE__*/function (_Component) {
|
|
|
3151
3154
|
});
|
|
3152
3155
|
this.props.onChange({
|
|
3153
3156
|
originalEvent: event,
|
|
3154
|
-
checked: this.props.checked
|
|
3157
|
+
checked: !this.props.checked
|
|
3155
3158
|
});
|
|
3156
3159
|
}
|
|
3157
3160
|
}
|
|
@@ -3297,7 +3300,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3297
3300
|
}, {
|
|
3298
3301
|
key: "isRowMatchModeSelected",
|
|
3299
3302
|
value: function isRowMatchModeSelected(matchMode) {
|
|
3300
|
-
return this.filterModel.matchMode === matchMode;
|
|
3303
|
+
return this.filterModel && this.filterModel.matchMode === matchMode;
|
|
3301
3304
|
}
|
|
3302
3305
|
}, {
|
|
3303
3306
|
key: "showMenuButton",
|
|
@@ -3590,7 +3593,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3590
3593
|
filters[this.field].constraints.push(newConstraint);
|
|
3591
3594
|
filterConstraintAddCallback && filterConstraintAddCallback({
|
|
3592
3595
|
field: this.field,
|
|
3593
|
-
|
|
3596
|
+
constraint: newConstraint
|
|
3594
3597
|
});
|
|
3595
3598
|
this.props.onFilterChange(filters);
|
|
3596
3599
|
|
|
@@ -3608,7 +3611,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3608
3611
|
var removedConstraint = filters[this.field].constraints.splice(index, 1);
|
|
3609
3612
|
filterConstraintRemoveCallback && filterConstraintRemoveCallback({
|
|
3610
3613
|
field: this.field,
|
|
3611
|
-
|
|
3614
|
+
constraint: removedConstraint
|
|
3612
3615
|
});
|
|
3613
3616
|
this.props.onFilterChange(filters);
|
|
3614
3617
|
|
|
@@ -3742,7 +3745,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3742
3745
|
|
|
3743
3746
|
if (!this.resizeListener) {
|
|
3744
3747
|
this.resizeListener = function () {
|
|
3745
|
-
if (_this5.state.overlayVisible) {
|
|
3748
|
+
if (_this5.state.overlayVisible && !DomHandler.isTouchDevice()) {
|
|
3746
3749
|
_this5.hide();
|
|
3747
3750
|
}
|
|
3748
3751
|
};
|
|
@@ -3850,16 +3853,17 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3850
3853
|
value: function renderFilterElement(model, index) {
|
|
3851
3854
|
var _this6 = this;
|
|
3852
3855
|
|
|
3856
|
+
var value = model ? model.value : null;
|
|
3853
3857
|
return this.getColumnProp('filterElement') ? ObjectUtils.getJSXElement(this.getColumnProp('filterElement'), {
|
|
3854
3858
|
field: this.field,
|
|
3855
3859
|
index: index,
|
|
3856
3860
|
filterModel: model,
|
|
3857
|
-
value:
|
|
3861
|
+
value: value,
|
|
3858
3862
|
filterApplyCallback: this.filterApplyCallback,
|
|
3859
3863
|
filterCallback: this.filterCallback
|
|
3860
3864
|
}) : /*#__PURE__*/React.createElement(InputText, {
|
|
3861
3865
|
type: this.getColumnProp('filterType'),
|
|
3862
|
-
value:
|
|
3866
|
+
value: value || '',
|
|
3863
3867
|
onChange: function onChange(e) {
|
|
3864
3868
|
return _this6.onInputChange(e, index);
|
|
3865
3869
|
},
|
|
@@ -4523,7 +4527,7 @@ var HeaderCell = /*#__PURE__*/function (_Component) {
|
|
|
4523
4527
|
}, {
|
|
4524
4528
|
key: "renderCheckbox",
|
|
4525
4529
|
value: function renderCheckbox() {
|
|
4526
|
-
if (this.getColumnProp('selectionMode') === 'multiple' && this.props.filterDisplay !== 'row') {
|
|
4530
|
+
if (this.props.showSelectAll && this.getColumnProp('selectionMode') === 'multiple' && this.props.filterDisplay !== 'row') {
|
|
4527
4531
|
var allRowsSelected = this.props.allRowsSelected(this.props.value);
|
|
4528
4532
|
return /*#__PURE__*/React.createElement(HeaderCheckbox, {
|
|
4529
4533
|
checked: allRowsSelected,
|
|
@@ -4745,6 +4749,7 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4745
4749
|
onColumnResizeStart: _this3.props.onColumnResizeStart,
|
|
4746
4750
|
onColumnResizerClick: _this3.props.onColumnResizerClick,
|
|
4747
4751
|
onColumnResizerDoubleClick: _this3.props.onColumnResizerDoubleClick,
|
|
4752
|
+
showSelectAll: _this3.props.showSelectAll,
|
|
4748
4753
|
allRowsSelected: _this3.props.allRowsSelected,
|
|
4749
4754
|
onColumnCheckboxChange: _this3.onCheckboxChange,
|
|
4750
4755
|
reorderableColumns: _this3.props.reorderableColumns,
|
|
@@ -4752,6 +4757,36 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4752
4757
|
});
|
|
4753
4758
|
});
|
|
4754
4759
|
}
|
|
4760
|
+
}, {
|
|
4761
|
+
key: "renderCheckbox",
|
|
4762
|
+
value: function renderCheckbox(selectionMode) {
|
|
4763
|
+
if (this.props.showSelectAll && selectionMode === 'multiple') {
|
|
4764
|
+
var allRowsSelected = this.props.allRowsSelected(this.props.value);
|
|
4765
|
+
return /*#__PURE__*/React.createElement(HeaderCheckbox, {
|
|
4766
|
+
checked: allRowsSelected,
|
|
4767
|
+
onChange: this.onCheckboxChange,
|
|
4768
|
+
disabled: this.props.empty
|
|
4769
|
+
});
|
|
4770
|
+
}
|
|
4771
|
+
|
|
4772
|
+
return null;
|
|
4773
|
+
}
|
|
4774
|
+
}, {
|
|
4775
|
+
key: "renderFilter",
|
|
4776
|
+
value: function renderFilter(column, filter) {
|
|
4777
|
+
if (filter) {
|
|
4778
|
+
return /*#__PURE__*/React.createElement(ColumnFilter, {
|
|
4779
|
+
display: "row",
|
|
4780
|
+
column: column,
|
|
4781
|
+
filters: this.props.filters,
|
|
4782
|
+
filtersStore: this.props.filtersStore,
|
|
4783
|
+
onFilterChange: this.props.onFilterChange,
|
|
4784
|
+
onFilterApply: this.props.onFilterApply
|
|
4785
|
+
});
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
return null;
|
|
4789
|
+
}
|
|
4755
4790
|
}, {
|
|
4756
4791
|
key: "renderFilterCells",
|
|
4757
4792
|
value: function renderFilterCells() {
|
|
@@ -4779,24 +4814,15 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4779
4814
|
});
|
|
4780
4815
|
var colKey = columnKey || field || i;
|
|
4781
4816
|
|
|
4782
|
-
var
|
|
4817
|
+
var checkbox = _this4.renderCheckbox(selectionMode);
|
|
4818
|
+
|
|
4819
|
+
var filterRow = _this4.renderFilter(col, filter);
|
|
4783
4820
|
|
|
4784
4821
|
return /*#__PURE__*/React.createElement("th", {
|
|
4785
4822
|
key: colKey,
|
|
4786
4823
|
style: colStyle,
|
|
4787
4824
|
className: colClassName
|
|
4788
|
-
},
|
|
4789
|
-
checked: allRowsSelected,
|
|
4790
|
-
onChange: _this4.onCheckboxChange,
|
|
4791
|
-
disabled: _this4.props.empty
|
|
4792
|
-
}), filter && /*#__PURE__*/React.createElement(ColumnFilter, {
|
|
4793
|
-
display: "row",
|
|
4794
|
-
column: col,
|
|
4795
|
-
filters: _this4.props.filters,
|
|
4796
|
-
filtersStore: _this4.props.filtersStore,
|
|
4797
|
-
onFilterChange: _this4.props.onFilterChange,
|
|
4798
|
-
onFilterApply: _this4.props.onFilterApply
|
|
4799
|
-
}));
|
|
4825
|
+
}, checkbox, filterRow);
|
|
4800
4826
|
}
|
|
4801
4827
|
|
|
4802
4828
|
return null;
|
|
@@ -4880,10 +4906,6 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
4880
4906
|
_this.state.filters = props.filters;
|
|
4881
4907
|
}
|
|
4882
4908
|
|
|
4883
|
-
if (_this.isStateful()) {
|
|
4884
|
-
_this.restoreState(_this.state);
|
|
4885
|
-
}
|
|
4886
|
-
|
|
4887
4909
|
_this.attributeSelector = UniqueComponentId(); // header
|
|
4888
4910
|
|
|
4889
4911
|
_this.onSortChange = _this.onSortChange.bind(_assertThisInitialized(_this));
|
|
@@ -4919,6 +4941,11 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
4919
4941
|
value: function isVirtualScrollerDisabled() {
|
|
4920
4942
|
return ObjectUtils.isEmpty(this.props.virtualScrollerOptions) || !this.props.scrollable;
|
|
4921
4943
|
}
|
|
4944
|
+
}, {
|
|
4945
|
+
key: "isEquals",
|
|
4946
|
+
value: function isEquals(data1, data2) {
|
|
4947
|
+
return this.props.compareSelectionBy === 'equals' ? data1 === data2 : ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
4948
|
+
}
|
|
4922
4949
|
}, {
|
|
4923
4950
|
key: "hasFilter",
|
|
4924
4951
|
value: function hasFilter() {
|
|
@@ -5126,7 +5153,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5126
5153
|
};
|
|
5127
5154
|
};
|
|
5128
5155
|
|
|
5129
|
-
this.props.onPage(getOnPageParams(restoredState.first, restoredState.rows));
|
|
5156
|
+
this.props.onPage(this.createEvent(getOnPageParams(restoredState.first, restoredState.rows)));
|
|
5130
5157
|
} else {
|
|
5131
5158
|
state.first = restoredState.first;
|
|
5132
5159
|
state.rows = restoredState.rows;
|
|
@@ -5135,10 +5162,10 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5135
5162
|
|
|
5136
5163
|
if (restoredState.sortField) {
|
|
5137
5164
|
if (this.props.onSort) {
|
|
5138
|
-
this.props.onSort({
|
|
5165
|
+
this.props.onSort(this.createEvent({
|
|
5139
5166
|
sortField: restoredState.sortField,
|
|
5140
5167
|
sortOrder: restoredState.sortOrder
|
|
5141
|
-
});
|
|
5168
|
+
}));
|
|
5142
5169
|
} else {
|
|
5143
5170
|
state.sortField = restoredState.sortField;
|
|
5144
5171
|
state.sortOrder = restoredState.sortOrder;
|
|
@@ -5147,9 +5174,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5147
5174
|
|
|
5148
5175
|
if (restoredState.multiSortMeta) {
|
|
5149
5176
|
if (this.props.onSort) {
|
|
5150
|
-
this.props.onSort({
|
|
5177
|
+
this.props.onSort(this.createEvent({
|
|
5151
5178
|
multiSortMeta: restoredState.multiSortMeta
|
|
5152
|
-
});
|
|
5179
|
+
}));
|
|
5153
5180
|
} else {
|
|
5154
5181
|
state.multiSortMeta = restoredState.multiSortMeta;
|
|
5155
5182
|
}
|
|
@@ -5159,9 +5186,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5159
5186
|
state.d_filters = this.cloneFilters(restoredState.filters);
|
|
5160
5187
|
|
|
5161
5188
|
if (this.props.onFilter) {
|
|
5162
|
-
this.props.onFilter({
|
|
5189
|
+
this.props.onFilter(this.createEvent({
|
|
5163
5190
|
filters: restoredState.filters
|
|
5164
|
-
});
|
|
5191
|
+
}));
|
|
5165
5192
|
} else {
|
|
5166
5193
|
state.filters = this.cloneFilters(restoredState.filters);
|
|
5167
5194
|
}
|
|
@@ -5264,15 +5291,23 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5264
5291
|
value: function allRowsSelected(processedData) {
|
|
5265
5292
|
var _this5 = this;
|
|
5266
5293
|
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5294
|
+
if (this.props.onSelectAllChange) {
|
|
5295
|
+
return this.props.selectAll;
|
|
5296
|
+
} else {
|
|
5297
|
+
var data = this.props.selectionPageOnly ? this.dataToRender(processedData) : processedData;
|
|
5298
|
+
var val = this.props.frozenValue ? [].concat(_toConsumableArray(this.props.frozenValue), _toConsumableArray(data)) : data;
|
|
5299
|
+
var selectableVal = this.props.showSelectionElement ? val.filter(function (data, index) {
|
|
5300
|
+
return _this5.props.showSelectionElement(data, {
|
|
5301
|
+
rowIndex: index,
|
|
5302
|
+
props: _this5.props
|
|
5303
|
+
});
|
|
5304
|
+
}) : val;
|
|
5305
|
+
return selectableVal && this.props.selection && selectableVal.every(function (sv) {
|
|
5306
|
+
return _this5.props.selection.some(function (s) {
|
|
5307
|
+
return _this5.isEquals(s, sv);
|
|
5308
|
+
});
|
|
5272
5309
|
});
|
|
5273
|
-
}
|
|
5274
|
-
var length = this.props.lazy ? this.props.totalRecords : selectableVal ? selectableVal.length : 0;
|
|
5275
|
-
return selectableVal && length > 0 && this.props.selection && this.props.selection.length > 0 && this.props.selection.length === length;
|
|
5310
|
+
}
|
|
5276
5311
|
}
|
|
5277
5312
|
}, {
|
|
5278
5313
|
key: "getSelectionModeInColumn",
|
|
@@ -5473,37 +5508,46 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5473
5508
|
value: function onColumnHeaderCheckboxChange(e, processedData) {
|
|
5474
5509
|
var _this8 = this;
|
|
5475
5510
|
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
var selection;
|
|
5479
|
-
|
|
5480
|
-
if (!checked) {
|
|
5481
|
-
selection = this.props.frozenValue ? [].concat(_toConsumableArray(this.props.frozenValue), _toConsumableArray(processedData)) : processedData;
|
|
5482
|
-
selection = this.props.showSelectionElement ? selection.filter(function (data, index) {
|
|
5483
|
-
return _this8.props.showSelectionElement(data, {
|
|
5484
|
-
rowIndex: index,
|
|
5485
|
-
props: _this8.props
|
|
5486
|
-
});
|
|
5487
|
-
}) : selection;
|
|
5488
|
-
this.props.onAllRowsSelect && this.props.onAllRowsSelect({
|
|
5489
|
-
originalEvent: originalEvent,
|
|
5490
|
-
data: selection,
|
|
5491
|
-
type: 'all'
|
|
5492
|
-
});
|
|
5511
|
+
if (this.props.onSelectAllChange) {
|
|
5512
|
+
this.props.onSelectAllChange(e);
|
|
5493
5513
|
} else {
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5514
|
+
var originalEvent = e.originalEvent,
|
|
5515
|
+
checked = e.checked;
|
|
5516
|
+
var data = this.props.selectionPageOnly ? this.dataToRender(processedData) : processedData;
|
|
5517
|
+
var selection = this.props.selectionPageOnly && this.props.selection ? this.props.selection.filter(function (s) {
|
|
5518
|
+
return !data.some(function (d) {
|
|
5519
|
+
return _this8.isEquals(s, d);
|
|
5520
|
+
});
|
|
5521
|
+
}) : [];
|
|
5522
|
+
|
|
5523
|
+
if (checked) {
|
|
5524
|
+
selection = this.props.frozenValue ? [].concat(_toConsumableArray(selection), _toConsumableArray(this.props.frozenValue), _toConsumableArray(data)) : [].concat(_toConsumableArray(selection), _toConsumableArray(data));
|
|
5525
|
+
selection = this.props.showSelectionElement ? selection.filter(function (data, index) {
|
|
5526
|
+
return _this8.props.showSelectionElement(data, {
|
|
5527
|
+
rowIndex: index,
|
|
5528
|
+
props: _this8.props
|
|
5529
|
+
});
|
|
5530
|
+
}) : selection;
|
|
5531
|
+
this.props.onAllRowsSelect && this.props.onAllRowsSelect({
|
|
5532
|
+
originalEvent: originalEvent,
|
|
5533
|
+
data: selection,
|
|
5534
|
+
type: 'all'
|
|
5535
|
+
});
|
|
5536
|
+
} else {
|
|
5537
|
+
this.props.onAllRowsUnselect && this.props.onAllRowsUnselect({
|
|
5538
|
+
originalEvent: originalEvent,
|
|
5539
|
+
data: selection,
|
|
5540
|
+
type: 'all'
|
|
5541
|
+
});
|
|
5542
|
+
}
|
|
5501
5543
|
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5544
|
+
if (this.props.onSelectionChange) {
|
|
5545
|
+
this.props.onSelectionChange({
|
|
5546
|
+
originalEvent: originalEvent,
|
|
5547
|
+
value: selection,
|
|
5548
|
+
type: 'all'
|
|
5549
|
+
});
|
|
5550
|
+
}
|
|
5507
5551
|
}
|
|
5508
5552
|
}
|
|
5509
5553
|
}, {
|
|
@@ -5636,15 +5680,13 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5636
5680
|
}, {
|
|
5637
5681
|
key: "createStyleElement",
|
|
5638
5682
|
value: function createStyleElement() {
|
|
5639
|
-
this.styleElement =
|
|
5640
|
-
document.head.appendChild(this.styleElement);
|
|
5683
|
+
this.styleElement = DomHandler.createInlineStyle();
|
|
5641
5684
|
}
|
|
5642
5685
|
}, {
|
|
5643
5686
|
key: "createResponsiveStyle",
|
|
5644
5687
|
value: function createResponsiveStyle() {
|
|
5645
5688
|
if (!this.responsiveStyleElement) {
|
|
5646
|
-
this.responsiveStyleElement =
|
|
5647
|
-
document.head.appendChild(this.responsiveStyleElement);
|
|
5689
|
+
this.responsiveStyleElement = DomHandler.createInlineStyle();
|
|
5648
5690
|
var innerHTML = "\n@media screen and (max-width: ".concat(this.props.breakpoint, ") {\n .p-datatable[").concat(this.attributeSelector, "] .p-datatable-thead > tr > th,\n .p-datatable[").concat(this.attributeSelector, "] .p-datatable-tfoot > tr > td {\n display: none !important;\n }\n\n .p-datatable[").concat(this.attributeSelector, "] .p-datatable-tbody > tr > td {\n display: flex;\n width: 100% !important;\n align-items: center;\n justify-content: space-between;\n }\n\n .p-datatable[").concat(this.attributeSelector, "] .p-datatable-tbody > tr > td:not(:last-child) {\n border: 0 none;\n }\n\n .p-datatable[").concat(this.attributeSelector, "].p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {\n border-top: 0;\n border-right: 0;\n border-left: 0;\n }\n\n .p-datatable[").concat(this.attributeSelector, "] .p-datatable-tbody > tr > td > .p-column-title {\n display: block;\n }\n}\n");
|
|
5649
5691
|
this.responsiveStyleElement.innerHTML = innerHTML;
|
|
5650
5692
|
}
|
|
@@ -5652,24 +5694,18 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5652
5694
|
}, {
|
|
5653
5695
|
key: "destroyResponsiveStyle",
|
|
5654
5696
|
value: function destroyResponsiveStyle() {
|
|
5655
|
-
|
|
5656
|
-
document.head.removeChild(this.responsiveStyleElement);
|
|
5657
|
-
this.responsiveStyleElement = null;
|
|
5658
|
-
}
|
|
5697
|
+
this.responsiveStyleElement = DomHandler.removeInlineStyle(this.responsiveStyleElement);
|
|
5659
5698
|
}
|
|
5660
5699
|
}, {
|
|
5661
5700
|
key: "destroyStyleElement",
|
|
5662
5701
|
value: function destroyStyleElement() {
|
|
5663
|
-
|
|
5664
|
-
document.head.removeChild(this.styleElement);
|
|
5665
|
-
this.styleElement = null;
|
|
5666
|
-
}
|
|
5702
|
+
this.styleElement = DomHandler.removeInlineStyle(this.styleElement);
|
|
5667
5703
|
}
|
|
5668
5704
|
}, {
|
|
5669
5705
|
key: "onPageChange",
|
|
5670
5706
|
value: function onPageChange(e) {
|
|
5671
5707
|
this.clearEditingMetaData();
|
|
5672
|
-
if (this.props.onPage) this.props.onPage(e);else this.setState({
|
|
5708
|
+
if (this.props.onPage) this.props.onPage(this.createEvent(e));else this.setState({
|
|
5673
5709
|
first: e.first,
|
|
5674
5710
|
rows: e.rows
|
|
5675
5711
|
});
|
|
@@ -5733,7 +5769,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5733
5769
|
}
|
|
5734
5770
|
|
|
5735
5771
|
if (this.props.onSort) {
|
|
5736
|
-
this.props.onSort(eventMeta);
|
|
5772
|
+
this.props.onSort(this.createEvent(eventMeta));
|
|
5737
5773
|
} else {
|
|
5738
5774
|
eventMeta.first = 0;
|
|
5739
5775
|
this.setState(eventMeta);
|
|
@@ -5752,6 +5788,15 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5752
5788
|
value: function getCalculatedSortOrder(currentOrder) {
|
|
5753
5789
|
return this.props.removableSort ? this.props.defaultSortOrder === currentOrder ? currentOrder * -1 : 0 : currentOrder * -1;
|
|
5754
5790
|
}
|
|
5791
|
+
}, {
|
|
5792
|
+
key: "compareValuesOnSort",
|
|
5793
|
+
value: function compareValuesOnSort(value1, value2) {
|
|
5794
|
+
var result = null;
|
|
5795
|
+
if (value1 == null && value2 != null) result = -1;else if (value1 != null && value2 == null) result = 1;else if (value1 == null && value2 == null) result = 0;else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, {
|
|
5796
|
+
numeric: true
|
|
5797
|
+
});else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
5798
|
+
return result;
|
|
5799
|
+
}
|
|
5755
5800
|
}, {
|
|
5756
5801
|
key: "addSortMeta",
|
|
5757
5802
|
value: function addSortMeta(meta, multiSortMeta) {
|
|
@@ -5776,6 +5821,8 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5776
5821
|
}, {
|
|
5777
5822
|
key: "sortSingle",
|
|
5778
5823
|
value: function sortSingle(data, field, order) {
|
|
5824
|
+
var _this10 = this;
|
|
5825
|
+
|
|
5779
5826
|
if (this.props.groupRowsBy && this.props.groupRowsBy === this.props.sortField) {
|
|
5780
5827
|
var multiSortMeta = [{
|
|
5781
5828
|
field: this.props.sortField,
|
|
@@ -5799,10 +5846,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5799
5846
|
value.sort(function (data1, data2) {
|
|
5800
5847
|
var value1 = ObjectUtils.resolveFieldData(data1, field);
|
|
5801
5848
|
var value2 = ObjectUtils.resolveFieldData(data2, field);
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
});else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
5849
|
+
|
|
5850
|
+
var result = _this10.compareValuesOnSort(value1, value2);
|
|
5851
|
+
|
|
5806
5852
|
return order * result;
|
|
5807
5853
|
});
|
|
5808
5854
|
}
|
|
@@ -5812,7 +5858,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5812
5858
|
}, {
|
|
5813
5859
|
key: "sortMultiple",
|
|
5814
5860
|
value: function sortMultiple(data) {
|
|
5815
|
-
var
|
|
5861
|
+
var _this11 = this;
|
|
5816
5862
|
|
|
5817
5863
|
var multiSortMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
5818
5864
|
|
|
@@ -5829,7 +5875,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5829
5875
|
|
|
5830
5876
|
if (this.columnSortable && this.columnSortFunction) {
|
|
5831
5877
|
var meta = multiSortMeta.find(function (meta) {
|
|
5832
|
-
return meta.field ===
|
|
5878
|
+
return meta.field === _this11.columnField;
|
|
5833
5879
|
});
|
|
5834
5880
|
var field = this.columnField;
|
|
5835
5881
|
var order = meta ? meta.order : this.defaultSortOrder;
|
|
@@ -5839,7 +5885,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5839
5885
|
});
|
|
5840
5886
|
} else {
|
|
5841
5887
|
value.sort(function (data1, data2) {
|
|
5842
|
-
return
|
|
5888
|
+
return _this11.multisortField(data1, data2, multiSortMeta, 0);
|
|
5843
5889
|
});
|
|
5844
5890
|
}
|
|
5845
5891
|
|
|
@@ -5850,22 +5896,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5850
5896
|
value: function multisortField(data1, data2, multiSortMeta, index) {
|
|
5851
5897
|
var value1 = ObjectUtils.resolveFieldData(data1, multiSortMeta[index].field);
|
|
5852
5898
|
var value2 = ObjectUtils.resolveFieldData(data2, multiSortMeta[index].field);
|
|
5853
|
-
var result = null;
|
|
5854
|
-
|
|
5855
|
-
if (typeof value1 === 'string' || value1 instanceof String) {
|
|
5856
|
-
if (value1.localeCompare && value1 !== value2) {
|
|
5857
|
-
return multiSortMeta[index].order * value1.localeCompare(value2, undefined, {
|
|
5858
|
-
numeric: true
|
|
5859
|
-
});
|
|
5860
|
-
}
|
|
5861
|
-
} else {
|
|
5862
|
-
result = value1 < value2 ? -1 : 1;
|
|
5863
|
-
}
|
|
5864
5899
|
|
|
5865
5900
|
if (value1 === value2) {
|
|
5866
5901
|
return multiSortMeta.length - 1 > index ? this.multisortField(data1, data2, multiSortMeta, index + 1) : 0;
|
|
5867
5902
|
}
|
|
5868
5903
|
|
|
5904
|
+
var result = this.compareValuesOnSort(value1, value2);
|
|
5869
5905
|
return multiSortMeta[index].order * result;
|
|
5870
5906
|
}
|
|
5871
5907
|
}, {
|
|
@@ -5879,25 +5915,25 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5879
5915
|
}, {
|
|
5880
5916
|
key: "onFilterApply",
|
|
5881
5917
|
value: function onFilterApply() {
|
|
5882
|
-
var
|
|
5918
|
+
var _this12 = this;
|
|
5883
5919
|
|
|
5884
5920
|
clearTimeout(this.filterTimeout);
|
|
5885
5921
|
this.filterTimeout = setTimeout(function () {
|
|
5886
|
-
var filters =
|
|
5922
|
+
var filters = _this12.cloneFilters(_this12.state.d_filters);
|
|
5887
5923
|
|
|
5888
|
-
if (
|
|
5889
|
-
|
|
5924
|
+
if (_this12.props.onFilter) {
|
|
5925
|
+
_this12.props.onFilter(_this12.createEvent({
|
|
5890
5926
|
filters: filters
|
|
5891
|
-
});
|
|
5927
|
+
}));
|
|
5892
5928
|
} else {
|
|
5893
|
-
|
|
5929
|
+
_this12.setState({
|
|
5894
5930
|
first: 0,
|
|
5895
5931
|
filters: filters
|
|
5896
5932
|
});
|
|
5897
5933
|
}
|
|
5898
5934
|
|
|
5899
|
-
if (
|
|
5900
|
-
|
|
5935
|
+
if (_this12.props.onValueChange) {
|
|
5936
|
+
_this12.props.onValueChange(_this12.processedData({
|
|
5901
5937
|
filters: filters
|
|
5902
5938
|
}));
|
|
5903
5939
|
}
|
|
@@ -5995,7 +6031,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5995
6031
|
}, {
|
|
5996
6032
|
key: "cloneFilters",
|
|
5997
6033
|
value: function cloneFilters(filters) {
|
|
5998
|
-
var
|
|
6034
|
+
var _this13 = this;
|
|
5999
6035
|
|
|
6000
6036
|
filters = filters || this.props.filters;
|
|
6001
6037
|
var cloned = {};
|
|
@@ -6016,34 +6052,31 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6016
6052
|
} else {
|
|
6017
6053
|
var columns = this.getColumns();
|
|
6018
6054
|
cloned = columns.reduce(function (_filters, col) {
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
};
|
|
6028
|
-
|
|
6029
|
-
if (filterFunction) {
|
|
6030
|
-
FilterService.register("custom_".concat(field), function () {
|
|
6031
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6032
|
-
args[_key] = arguments[_key];
|
|
6033
|
-
}
|
|
6055
|
+
var field = col.props.filterField || col.props.field;
|
|
6056
|
+
var filterFunction = col.props.filterFunction;
|
|
6057
|
+
var dataType = col.props.dataType;
|
|
6058
|
+
var matchMode = col.props.filterMatchMode || (PrimeReact.filterMatchModeOptions[dataType] ? PrimeReact.filterMatchModeOptions[dataType][0] : FilterMatchMode$1.STARTS_WITH);
|
|
6059
|
+
var constraint = {
|
|
6060
|
+
value: null,
|
|
6061
|
+
matchMode: matchMode
|
|
6062
|
+
};
|
|
6034
6063
|
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6064
|
+
if (filterFunction) {
|
|
6065
|
+
FilterService.register("custom_".concat(field), function () {
|
|
6066
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6067
|
+
args[_key] = arguments[_key];
|
|
6068
|
+
}
|
|
6040
6069
|
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
}
|
|
6070
|
+
return filterFunction.apply(void 0, args.concat([{
|
|
6071
|
+
column: col
|
|
6072
|
+
}]));
|
|
6073
|
+
});
|
|
6045
6074
|
}
|
|
6046
6075
|
|
|
6076
|
+
_filters[field] = _this13.props.filterDisplay === 'menu' ? {
|
|
6077
|
+
operator: FilterOperator.AND,
|
|
6078
|
+
constraints: [constraint]
|
|
6079
|
+
} : constraint;
|
|
6047
6080
|
return _filters;
|
|
6048
6081
|
}, {});
|
|
6049
6082
|
}
|
|
@@ -6119,7 +6152,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6119
6152
|
}, {
|
|
6120
6153
|
key: "exportCSV",
|
|
6121
6154
|
value: function exportCSV(options) {
|
|
6122
|
-
var
|
|
6155
|
+
var _this14 = this;
|
|
6123
6156
|
|
|
6124
6157
|
var data;
|
|
6125
6158
|
var csv = "\uFEFF";
|
|
@@ -6142,7 +6175,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6142
6175
|
csv += '"' + (header || field) + '"';
|
|
6143
6176
|
|
|
6144
6177
|
if (i < columns.length - 1) {
|
|
6145
|
-
csv +=
|
|
6178
|
+
csv += _this14.props.csvSeparator;
|
|
6146
6179
|
}
|
|
6147
6180
|
}
|
|
6148
6181
|
}); //body
|
|
@@ -6158,7 +6191,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6158
6191
|
var cellData = ObjectUtils.resolveFieldData(record, field);
|
|
6159
6192
|
|
|
6160
6193
|
if (cellData != null) {
|
|
6161
|
-
cellData =
|
|
6194
|
+
cellData = _this14.props.exportFunction ? _this14.props.exportFunction({
|
|
6162
6195
|
data: cellData,
|
|
6163
6196
|
field: field,
|
|
6164
6197
|
rowData: record,
|
|
@@ -6169,7 +6202,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6169
6202
|
csv += '"' + cellData + '"';
|
|
6170
6203
|
|
|
6171
6204
|
if (i < columns.length - 1) {
|
|
6172
|
-
csv +=
|
|
6205
|
+
csv += _this14.props.csvSeparator;
|
|
6173
6206
|
}
|
|
6174
6207
|
}
|
|
6175
6208
|
});
|
|
@@ -6183,6 +6216,18 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6183
6216
|
document.body.click();
|
|
6184
6217
|
}
|
|
6185
6218
|
}
|
|
6219
|
+
}, {
|
|
6220
|
+
key: "createEvent",
|
|
6221
|
+
value: function createEvent(event) {
|
|
6222
|
+
return _objectSpread({
|
|
6223
|
+
first: this.getFirst(),
|
|
6224
|
+
rows: this.getRows(),
|
|
6225
|
+
sortField: this.getSortField(),
|
|
6226
|
+
sortOrder: this.getSortOrder(),
|
|
6227
|
+
multiSortMeta: this.getMultiSortMeta(),
|
|
6228
|
+
filters: this.getFilters()
|
|
6229
|
+
}, event);
|
|
6230
|
+
}
|
|
6186
6231
|
}, {
|
|
6187
6232
|
key: "processedData",
|
|
6188
6233
|
value: function processedData(localState) {
|
|
@@ -6226,8 +6271,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6226
6271
|
this.createResponsiveStyle();
|
|
6227
6272
|
}
|
|
6228
6273
|
|
|
6229
|
-
if (this.isStateful()
|
|
6230
|
-
this.
|
|
6274
|
+
if (this.isStateful()) {
|
|
6275
|
+
this.setState(this.restoreState(this.state));
|
|
6276
|
+
|
|
6277
|
+
if (this.props.resizableColumns) {
|
|
6278
|
+
this.restoreColumnWidths();
|
|
6279
|
+
}
|
|
6231
6280
|
}
|
|
6232
6281
|
}
|
|
6233
6282
|
}, {
|
|
@@ -6327,6 +6376,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6327
6376
|
filtersStore: filtersStore,
|
|
6328
6377
|
onFilterChange: this.onFilterChange,
|
|
6329
6378
|
onFilterApply: this.onFilterApply,
|
|
6379
|
+
showSelectAll: this.props.showSelectAll,
|
|
6330
6380
|
allRowsSelected: this.allRowsSelected,
|
|
6331
6381
|
onColumnCheckboxChange: this.onColumnHeaderCheckboxChange,
|
|
6332
6382
|
onColumnMouseDown: this.onColumnHeaderMouseDown,
|
|
@@ -6494,7 +6544,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6494
6544
|
}, {
|
|
6495
6545
|
key: "renderContent",
|
|
6496
6546
|
value: function renderContent(processedData, columns, selectionModeInColumn, empty) {
|
|
6497
|
-
var
|
|
6547
|
+
var _this15 = this;
|
|
6498
6548
|
|
|
6499
6549
|
if (!columns) return;
|
|
6500
6550
|
var isVirtualScrollerDisabled = this.isVirtualScrollerDisabled();
|
|
@@ -6507,29 +6557,27 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6507
6557
|
}, /*#__PURE__*/React.createElement(VirtualScroller, _extends({}, virtualScrollerOptions, {
|
|
6508
6558
|
items: processedData,
|
|
6509
6559
|
columns: columns,
|
|
6510
|
-
|
|
6511
|
-
height: this.props.scrollHeight
|
|
6512
|
-
},
|
|
6560
|
+
scrollHeight: this.props.scrollHeight,
|
|
6513
6561
|
disabled: isVirtualScrollerDisabled,
|
|
6514
6562
|
loaderDisabled: true,
|
|
6515
6563
|
showSpacer: false,
|
|
6516
6564
|
contentTemplate: function contentTemplate(options) {
|
|
6517
6565
|
var ref = function ref(el) {
|
|
6518
|
-
|
|
6566
|
+
_this15.table = el;
|
|
6519
6567
|
options.spacerRef && options.spacerRef(el);
|
|
6520
6568
|
};
|
|
6521
6569
|
|
|
6522
|
-
var tableClassName = classNames('p-datatable-table',
|
|
6570
|
+
var tableClassName = classNames('p-datatable-table', _this15.props.tableClassName);
|
|
6523
6571
|
|
|
6524
|
-
var tableHeader =
|
|
6572
|
+
var tableHeader = _this15.renderTableHeader(options, empty);
|
|
6525
6573
|
|
|
6526
|
-
var tableBody =
|
|
6574
|
+
var tableBody = _this15.renderTableBody(options, selectionModeInColumn, empty, isVirtualScrollerDisabled);
|
|
6527
6575
|
|
|
6528
|
-
var tableFooter =
|
|
6576
|
+
var tableFooter = _this15.renderTableFooter(options);
|
|
6529
6577
|
|
|
6530
6578
|
return /*#__PURE__*/React.createElement("table", {
|
|
6531
6579
|
ref: ref,
|
|
6532
|
-
style:
|
|
6580
|
+
style: _this15.props.tableStyle,
|
|
6533
6581
|
className: tableClassName,
|
|
6534
6582
|
role: "table"
|
|
6535
6583
|
}, tableHeader, tableBody, tableFooter);
|
|
@@ -6591,12 +6639,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6591
6639
|
}, {
|
|
6592
6640
|
key: "renderResizeHelper",
|
|
6593
6641
|
value: function renderResizeHelper() {
|
|
6594
|
-
var
|
|
6642
|
+
var _this16 = this;
|
|
6595
6643
|
|
|
6596
6644
|
if (this.props.resizableColumns) {
|
|
6597
6645
|
return /*#__PURE__*/React.createElement("div", {
|
|
6598
6646
|
ref: function ref(el) {
|
|
6599
|
-
return
|
|
6647
|
+
return _this16.resizeHelper = el;
|
|
6600
6648
|
},
|
|
6601
6649
|
className: "p-column-resizer-helper",
|
|
6602
6650
|
style: {
|
|
@@ -6610,7 +6658,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6610
6658
|
}, {
|
|
6611
6659
|
key: "renderReorderIndicators",
|
|
6612
6660
|
value: function renderReorderIndicators() {
|
|
6613
|
-
var
|
|
6661
|
+
var _this17 = this;
|
|
6614
6662
|
|
|
6615
6663
|
if (this.props.reorderableColumns) {
|
|
6616
6664
|
var style = {
|
|
@@ -6619,13 +6667,13 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6619
6667
|
};
|
|
6620
6668
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
6621
6669
|
ref: function ref(el) {
|
|
6622
|
-
return
|
|
6670
|
+
return _this17.reorderIndicatorUp = el;
|
|
6623
6671
|
},
|
|
6624
6672
|
className: "pi pi-arrow-down p-datatable-reorder-indicator-up",
|
|
6625
6673
|
style: style
|
|
6626
6674
|
}), /*#__PURE__*/React.createElement("span", {
|
|
6627
6675
|
ref: function ref(el) {
|
|
6628
|
-
return
|
|
6676
|
+
return _this17.reorderIndicatorDown = el;
|
|
6629
6677
|
},
|
|
6630
6678
|
className: "pi pi-arrow-up p-datatable-reorder-indicator-down",
|
|
6631
6679
|
style: style
|
|
@@ -6637,7 +6685,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6637
6685
|
}, {
|
|
6638
6686
|
key: "render",
|
|
6639
6687
|
value: function render() {
|
|
6640
|
-
var
|
|
6688
|
+
var _this18 = this;
|
|
6641
6689
|
|
|
6642
6690
|
var processedData = this.processedData();
|
|
6643
6691
|
var columns = this.getColumns();
|
|
@@ -6673,7 +6721,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6673
6721
|
var reorderIndicators = this.renderReorderIndicators();
|
|
6674
6722
|
return /*#__PURE__*/React.createElement("div", {
|
|
6675
6723
|
ref: function ref(el) {
|
|
6676
|
-
return
|
|
6724
|
+
return _this18.el = el;
|
|
6677
6725
|
},
|
|
6678
6726
|
id: this.props.id,
|
|
6679
6727
|
className: className,
|
|
@@ -6740,6 +6788,10 @@ _defineProperty(DataTable, "defaultProps", {
|
|
|
6740
6788
|
dataKey: null,
|
|
6741
6789
|
metaKeySelection: true,
|
|
6742
6790
|
selectOnEdit: true,
|
|
6791
|
+
selectionPageOnly: false,
|
|
6792
|
+
showSelectAll: true,
|
|
6793
|
+
selectAll: false,
|
|
6794
|
+
onSelectAllChange: null,
|
|
6743
6795
|
headerColumnGroup: null,
|
|
6744
6796
|
footerColumnGroup: null,
|
|
6745
6797
|
rowExpansionTemplate: null,
|