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
|
@@ -1059,26 +1059,7 @@ var BodyCell = /*#__PURE__*/function (_Component) {
|
|
|
1059
1059
|
props: this.props.tableProps
|
|
1060
1060
|
}));
|
|
1061
1061
|
|
|
1062
|
-
if (
|
|
1063
|
-
content = body ? utils.ObjectUtils.getJSXElement(body, this.props.rowData, {
|
|
1064
|
-
column: this.props.column,
|
|
1065
|
-
field: this.field,
|
|
1066
|
-
rowIndex: this.props.rowIndex,
|
|
1067
|
-
frozenRow: this.props.frozenRow,
|
|
1068
|
-
props: this.props.tableProps
|
|
1069
|
-
}) : value;
|
|
1070
|
-
} else if (editor && this.state.editing) {
|
|
1071
|
-
content = utils.ObjectUtils.getJSXElement(editor, {
|
|
1072
|
-
rowData: this.state.editingRowData,
|
|
1073
|
-
value: this.resolveFieldData(this.state.editingRowData),
|
|
1074
|
-
column: this.props.column,
|
|
1075
|
-
field: this.field,
|
|
1076
|
-
rowIndex: this.props.rowIndex,
|
|
1077
|
-
frozenRow: this.props.frozenRow,
|
|
1078
|
-
props: this.props.tableProps,
|
|
1079
|
-
editorCallback: this.editorCallback
|
|
1080
|
-
});
|
|
1081
|
-
} else if (selectionMode) {
|
|
1062
|
+
if (selectionMode) {
|
|
1082
1063
|
var showSelection = this.props.showSelectionElement ? this.props.showSelectionElement(this.props.rowData, {
|
|
1083
1064
|
rowIndex: this.props.rowIndex,
|
|
1084
1065
|
props: this.props.tableProps
|
|
@@ -1189,6 +1170,25 @@ var BodyCell = /*#__PURE__*/function (_Component) {
|
|
|
1189
1170
|
rowEditor: rowEditorProps
|
|
1190
1171
|
});
|
|
1191
1172
|
}
|
|
1173
|
+
} else if (body && !this.state.editing) {
|
|
1174
|
+
content = body ? utils.ObjectUtils.getJSXElement(body, this.props.rowData, {
|
|
1175
|
+
column: this.props.column,
|
|
1176
|
+
field: this.field,
|
|
1177
|
+
rowIndex: this.props.rowIndex,
|
|
1178
|
+
frozenRow: this.props.frozenRow,
|
|
1179
|
+
props: this.props.tableProps
|
|
1180
|
+
}) : value;
|
|
1181
|
+
} else if (editor && this.state.editing) {
|
|
1182
|
+
content = utils.ObjectUtils.getJSXElement(editor, {
|
|
1183
|
+
rowData: this.state.editingRowData,
|
|
1184
|
+
value: this.resolveFieldData(this.state.editingRowData),
|
|
1185
|
+
column: this.props.column,
|
|
1186
|
+
field: this.field,
|
|
1187
|
+
rowIndex: this.props.rowIndex,
|
|
1188
|
+
frozenRow: this.props.frozenRow,
|
|
1189
|
+
props: this.props.tableProps,
|
|
1190
|
+
editorCallback: this.editorCallback
|
|
1191
|
+
});
|
|
1192
1192
|
} else {
|
|
1193
1193
|
content = value;
|
|
1194
1194
|
}
|
|
@@ -1832,7 +1832,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
1832
1832
|
}, {
|
|
1833
1833
|
key: "equals",
|
|
1834
1834
|
value: function equals(data1, data2) {
|
|
1835
|
-
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 : utils.ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
1835
|
+
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 : utils.ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
1836
1836
|
}
|
|
1837
1837
|
}, {
|
|
1838
1838
|
key: "isSubheaderGrouping",
|
|
@@ -2101,7 +2101,8 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2101
2101
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2102
2102
|
this.props.onSelectionChange({
|
|
2103
2103
|
originalEvent: originalEvent,
|
|
2104
|
-
value: selection
|
|
2104
|
+
value: selection,
|
|
2105
|
+
type: type
|
|
2105
2106
|
});
|
|
2106
2107
|
}
|
|
2107
2108
|
}
|
|
@@ -2157,13 +2158,14 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2157
2158
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2158
2159
|
this.props.onSelectionChange({
|
|
2159
2160
|
originalEvent: originalEvent,
|
|
2160
|
-
value: selection
|
|
2161
|
+
value: selection,
|
|
2162
|
+
type: type
|
|
2161
2163
|
});
|
|
2162
2164
|
}
|
|
2163
2165
|
}
|
|
2164
2166
|
}, {
|
|
2165
2167
|
key: "onRangeSelection",
|
|
2166
|
-
value: function onRangeSelection(event) {
|
|
2168
|
+
value: function onRangeSelection(event, type) {
|
|
2167
2169
|
utils.DomHandler.clearSelection();
|
|
2168
2170
|
this.rangeRowIndex = this.allowCellSelection() ? event.rowIndex : event.index;
|
|
2169
2171
|
var selectionInRange = this.selectRange(event);
|
|
@@ -2172,7 +2174,8 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2172
2174
|
if (this.props.onSelectionChange && selection !== this.props.selection) {
|
|
2173
2175
|
this.props.onSelectionChange({
|
|
2174
2176
|
originalEvent: event.originalEvent,
|
|
2175
|
-
value: selection
|
|
2177
|
+
value: selection,
|
|
2178
|
+
type: type
|
|
2176
2179
|
});
|
|
2177
2180
|
}
|
|
2178
2181
|
|
|
@@ -2332,7 +2335,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2332
2335
|
|
|
2333
2336
|
if (this.allowRowSelection()) {
|
|
2334
2337
|
if (this.allowRangeSelection(event)) {
|
|
2335
|
-
this.onRangeSelection(event);
|
|
2338
|
+
this.onRangeSelection(event, 'row');
|
|
2336
2339
|
} else {
|
|
2337
2340
|
var toggleable = this.isRadioSelectionModeInColumn() || this.isCheckboxSelectionModeInColumn() || this.allowMetaKeySelection(event);
|
|
2338
2341
|
this.anchorRowIndex = event.index;
|
|
@@ -2418,7 +2421,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2418
2421
|
var isSameRow = event.index === this.anchorRowIndex;
|
|
2419
2422
|
|
|
2420
2423
|
if (this.allowRowDrag(event) && !isSameRow) {
|
|
2421
|
-
this.onRangeSelection(event);
|
|
2424
|
+
this.onRangeSelection(event, 'row');
|
|
2422
2425
|
}
|
|
2423
2426
|
}
|
|
2424
2427
|
}, {
|
|
@@ -2621,7 +2624,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2621
2624
|
|
|
2622
2625
|
if (this.allowCellSelection()) {
|
|
2623
2626
|
if (this.allowRangeSelection(event)) {
|
|
2624
|
-
this.onRangeSelection(event);
|
|
2627
|
+
this.onRangeSelection(event, 'cell');
|
|
2625
2628
|
} else {
|
|
2626
2629
|
var toggleable = this.allowMetaKeySelection(event);
|
|
2627
2630
|
|
|
@@ -2670,7 +2673,7 @@ var TableBody = /*#__PURE__*/function (_Component) {
|
|
|
2670
2673
|
var isSameCell = event.rowIndex === this.anchorRowIndex && event.cellIndex === this.anchorCellIndex;
|
|
2671
2674
|
|
|
2672
2675
|
if (this.allowCellDrag(event) && !isSameCell) {
|
|
2673
|
-
this.onRangeSelection(event);
|
|
2676
|
+
this.onRangeSelection(event, 'cell');
|
|
2674
2677
|
}
|
|
2675
2678
|
}
|
|
2676
2679
|
}, {
|
|
@@ -3160,7 +3163,7 @@ var HeaderCheckbox = /*#__PURE__*/function (_Component) {
|
|
|
3160
3163
|
});
|
|
3161
3164
|
this.props.onChange({
|
|
3162
3165
|
originalEvent: event,
|
|
3163
|
-
checked: this.props.checked
|
|
3166
|
+
checked: !this.props.checked
|
|
3164
3167
|
});
|
|
3165
3168
|
}
|
|
3166
3169
|
}
|
|
@@ -3306,7 +3309,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3306
3309
|
}, {
|
|
3307
3310
|
key: "isRowMatchModeSelected",
|
|
3308
3311
|
value: function isRowMatchModeSelected(matchMode) {
|
|
3309
|
-
return this.filterModel.matchMode === matchMode;
|
|
3312
|
+
return this.filterModel && this.filterModel.matchMode === matchMode;
|
|
3310
3313
|
}
|
|
3311
3314
|
}, {
|
|
3312
3315
|
key: "showMenuButton",
|
|
@@ -3599,7 +3602,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3599
3602
|
filters[this.field].constraints.push(newConstraint);
|
|
3600
3603
|
filterConstraintAddCallback && filterConstraintAddCallback({
|
|
3601
3604
|
field: this.field,
|
|
3602
|
-
|
|
3605
|
+
constraint: newConstraint
|
|
3603
3606
|
});
|
|
3604
3607
|
this.props.onFilterChange(filters);
|
|
3605
3608
|
|
|
@@ -3617,7 +3620,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3617
3620
|
var removedConstraint = filters[this.field].constraints.splice(index, 1);
|
|
3618
3621
|
filterConstraintRemoveCallback && filterConstraintRemoveCallback({
|
|
3619
3622
|
field: this.field,
|
|
3620
|
-
|
|
3623
|
+
constraint: removedConstraint
|
|
3621
3624
|
});
|
|
3622
3625
|
this.props.onFilterChange(filters);
|
|
3623
3626
|
|
|
@@ -3751,7 +3754,7 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3751
3754
|
|
|
3752
3755
|
if (!this.resizeListener) {
|
|
3753
3756
|
this.resizeListener = function () {
|
|
3754
|
-
if (_this5.state.overlayVisible) {
|
|
3757
|
+
if (_this5.state.overlayVisible && !utils.DomHandler.isTouchDevice()) {
|
|
3755
3758
|
_this5.hide();
|
|
3756
3759
|
}
|
|
3757
3760
|
};
|
|
@@ -3859,16 +3862,17 @@ var ColumnFilter = /*#__PURE__*/function (_Component) {
|
|
|
3859
3862
|
value: function renderFilterElement(model, index) {
|
|
3860
3863
|
var _this6 = this;
|
|
3861
3864
|
|
|
3865
|
+
var value = model ? model.value : null;
|
|
3862
3866
|
return this.getColumnProp('filterElement') ? utils.ObjectUtils.getJSXElement(this.getColumnProp('filterElement'), {
|
|
3863
3867
|
field: this.field,
|
|
3864
3868
|
index: index,
|
|
3865
3869
|
filterModel: model,
|
|
3866
|
-
value:
|
|
3870
|
+
value: value,
|
|
3867
3871
|
filterApplyCallback: this.filterApplyCallback,
|
|
3868
3872
|
filterCallback: this.filterCallback
|
|
3869
3873
|
}) : /*#__PURE__*/React__default["default"].createElement(inputtext.InputText, {
|
|
3870
3874
|
type: this.getColumnProp('filterType'),
|
|
3871
|
-
value:
|
|
3875
|
+
value: value || '',
|
|
3872
3876
|
onChange: function onChange(e) {
|
|
3873
3877
|
return _this6.onInputChange(e, index);
|
|
3874
3878
|
},
|
|
@@ -4532,7 +4536,7 @@ var HeaderCell = /*#__PURE__*/function (_Component) {
|
|
|
4532
4536
|
}, {
|
|
4533
4537
|
key: "renderCheckbox",
|
|
4534
4538
|
value: function renderCheckbox() {
|
|
4535
|
-
if (this.getColumnProp('selectionMode') === 'multiple' && this.props.filterDisplay !== 'row') {
|
|
4539
|
+
if (this.props.showSelectAll && this.getColumnProp('selectionMode') === 'multiple' && this.props.filterDisplay !== 'row') {
|
|
4536
4540
|
var allRowsSelected = this.props.allRowsSelected(this.props.value);
|
|
4537
4541
|
return /*#__PURE__*/React__default["default"].createElement(HeaderCheckbox, {
|
|
4538
4542
|
checked: allRowsSelected,
|
|
@@ -4754,6 +4758,7 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4754
4758
|
onColumnResizeStart: _this3.props.onColumnResizeStart,
|
|
4755
4759
|
onColumnResizerClick: _this3.props.onColumnResizerClick,
|
|
4756
4760
|
onColumnResizerDoubleClick: _this3.props.onColumnResizerDoubleClick,
|
|
4761
|
+
showSelectAll: _this3.props.showSelectAll,
|
|
4757
4762
|
allRowsSelected: _this3.props.allRowsSelected,
|
|
4758
4763
|
onColumnCheckboxChange: _this3.onCheckboxChange,
|
|
4759
4764
|
reorderableColumns: _this3.props.reorderableColumns,
|
|
@@ -4761,6 +4766,36 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4761
4766
|
});
|
|
4762
4767
|
});
|
|
4763
4768
|
}
|
|
4769
|
+
}, {
|
|
4770
|
+
key: "renderCheckbox",
|
|
4771
|
+
value: function renderCheckbox(selectionMode) {
|
|
4772
|
+
if (this.props.showSelectAll && selectionMode === 'multiple') {
|
|
4773
|
+
var allRowsSelected = this.props.allRowsSelected(this.props.value);
|
|
4774
|
+
return /*#__PURE__*/React__default["default"].createElement(HeaderCheckbox, {
|
|
4775
|
+
checked: allRowsSelected,
|
|
4776
|
+
onChange: this.onCheckboxChange,
|
|
4777
|
+
disabled: this.props.empty
|
|
4778
|
+
});
|
|
4779
|
+
}
|
|
4780
|
+
|
|
4781
|
+
return null;
|
|
4782
|
+
}
|
|
4783
|
+
}, {
|
|
4784
|
+
key: "renderFilter",
|
|
4785
|
+
value: function renderFilter(column, filter) {
|
|
4786
|
+
if (filter) {
|
|
4787
|
+
return /*#__PURE__*/React__default["default"].createElement(ColumnFilter, {
|
|
4788
|
+
display: "row",
|
|
4789
|
+
column: column,
|
|
4790
|
+
filters: this.props.filters,
|
|
4791
|
+
filtersStore: this.props.filtersStore,
|
|
4792
|
+
onFilterChange: this.props.onFilterChange,
|
|
4793
|
+
onFilterApply: this.props.onFilterApply
|
|
4794
|
+
});
|
|
4795
|
+
}
|
|
4796
|
+
|
|
4797
|
+
return null;
|
|
4798
|
+
}
|
|
4764
4799
|
}, {
|
|
4765
4800
|
key: "renderFilterCells",
|
|
4766
4801
|
value: function renderFilterCells() {
|
|
@@ -4788,24 +4823,15 @@ var TableHeader = /*#__PURE__*/function (_Component) {
|
|
|
4788
4823
|
});
|
|
4789
4824
|
var colKey = columnKey || field || i;
|
|
4790
4825
|
|
|
4791
|
-
var
|
|
4826
|
+
var checkbox = _this4.renderCheckbox(selectionMode);
|
|
4827
|
+
|
|
4828
|
+
var filterRow = _this4.renderFilter(col, filter);
|
|
4792
4829
|
|
|
4793
4830
|
return /*#__PURE__*/React__default["default"].createElement("th", {
|
|
4794
4831
|
key: colKey,
|
|
4795
4832
|
style: colStyle,
|
|
4796
4833
|
className: colClassName
|
|
4797
|
-
},
|
|
4798
|
-
checked: allRowsSelected,
|
|
4799
|
-
onChange: _this4.onCheckboxChange,
|
|
4800
|
-
disabled: _this4.props.empty
|
|
4801
|
-
}), filter && /*#__PURE__*/React__default["default"].createElement(ColumnFilter, {
|
|
4802
|
-
display: "row",
|
|
4803
|
-
column: col,
|
|
4804
|
-
filters: _this4.props.filters,
|
|
4805
|
-
filtersStore: _this4.props.filtersStore,
|
|
4806
|
-
onFilterChange: _this4.props.onFilterChange,
|
|
4807
|
-
onFilterApply: _this4.props.onFilterApply
|
|
4808
|
-
}));
|
|
4834
|
+
}, checkbox, filterRow);
|
|
4809
4835
|
}
|
|
4810
4836
|
|
|
4811
4837
|
return null;
|
|
@@ -4889,10 +4915,6 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
4889
4915
|
_this.state.filters = props.filters;
|
|
4890
4916
|
}
|
|
4891
4917
|
|
|
4892
|
-
if (_this.isStateful()) {
|
|
4893
|
-
_this.restoreState(_this.state);
|
|
4894
|
-
}
|
|
4895
|
-
|
|
4896
4918
|
_this.attributeSelector = utils.UniqueComponentId(); // header
|
|
4897
4919
|
|
|
4898
4920
|
_this.onSortChange = _this.onSortChange.bind(_assertThisInitialized(_this));
|
|
@@ -4928,6 +4950,11 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
4928
4950
|
value: function isVirtualScrollerDisabled() {
|
|
4929
4951
|
return utils.ObjectUtils.isEmpty(this.props.virtualScrollerOptions) || !this.props.scrollable;
|
|
4930
4952
|
}
|
|
4953
|
+
}, {
|
|
4954
|
+
key: "isEquals",
|
|
4955
|
+
value: function isEquals(data1, data2) {
|
|
4956
|
+
return this.props.compareSelectionBy === 'equals' ? data1 === data2 : utils.ObjectUtils.equals(data1, data2, this.props.dataKey);
|
|
4957
|
+
}
|
|
4931
4958
|
}, {
|
|
4932
4959
|
key: "hasFilter",
|
|
4933
4960
|
value: function hasFilter() {
|
|
@@ -5135,7 +5162,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5135
5162
|
};
|
|
5136
5163
|
};
|
|
5137
5164
|
|
|
5138
|
-
this.props.onPage(getOnPageParams(restoredState.first, restoredState.rows));
|
|
5165
|
+
this.props.onPage(this.createEvent(getOnPageParams(restoredState.first, restoredState.rows)));
|
|
5139
5166
|
} else {
|
|
5140
5167
|
state.first = restoredState.first;
|
|
5141
5168
|
state.rows = restoredState.rows;
|
|
@@ -5144,10 +5171,10 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5144
5171
|
|
|
5145
5172
|
if (restoredState.sortField) {
|
|
5146
5173
|
if (this.props.onSort) {
|
|
5147
|
-
this.props.onSort({
|
|
5174
|
+
this.props.onSort(this.createEvent({
|
|
5148
5175
|
sortField: restoredState.sortField,
|
|
5149
5176
|
sortOrder: restoredState.sortOrder
|
|
5150
|
-
});
|
|
5177
|
+
}));
|
|
5151
5178
|
} else {
|
|
5152
5179
|
state.sortField = restoredState.sortField;
|
|
5153
5180
|
state.sortOrder = restoredState.sortOrder;
|
|
@@ -5156,9 +5183,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5156
5183
|
|
|
5157
5184
|
if (restoredState.multiSortMeta) {
|
|
5158
5185
|
if (this.props.onSort) {
|
|
5159
|
-
this.props.onSort({
|
|
5186
|
+
this.props.onSort(this.createEvent({
|
|
5160
5187
|
multiSortMeta: restoredState.multiSortMeta
|
|
5161
|
-
});
|
|
5188
|
+
}));
|
|
5162
5189
|
} else {
|
|
5163
5190
|
state.multiSortMeta = restoredState.multiSortMeta;
|
|
5164
5191
|
}
|
|
@@ -5168,9 +5195,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5168
5195
|
state.d_filters = this.cloneFilters(restoredState.filters);
|
|
5169
5196
|
|
|
5170
5197
|
if (this.props.onFilter) {
|
|
5171
|
-
this.props.onFilter({
|
|
5198
|
+
this.props.onFilter(this.createEvent({
|
|
5172
5199
|
filters: restoredState.filters
|
|
5173
|
-
});
|
|
5200
|
+
}));
|
|
5174
5201
|
} else {
|
|
5175
5202
|
state.filters = this.cloneFilters(restoredState.filters);
|
|
5176
5203
|
}
|
|
@@ -5273,15 +5300,23 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5273
5300
|
value: function allRowsSelected(processedData) {
|
|
5274
5301
|
var _this5 = this;
|
|
5275
5302
|
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5303
|
+
if (this.props.onSelectAllChange) {
|
|
5304
|
+
return this.props.selectAll;
|
|
5305
|
+
} else {
|
|
5306
|
+
var data = this.props.selectionPageOnly ? this.dataToRender(processedData) : processedData;
|
|
5307
|
+
var val = this.props.frozenValue ? [].concat(_toConsumableArray(this.props.frozenValue), _toConsumableArray(data)) : data;
|
|
5308
|
+
var selectableVal = this.props.showSelectionElement ? val.filter(function (data, index) {
|
|
5309
|
+
return _this5.props.showSelectionElement(data, {
|
|
5310
|
+
rowIndex: index,
|
|
5311
|
+
props: _this5.props
|
|
5312
|
+
});
|
|
5313
|
+
}) : val;
|
|
5314
|
+
return selectableVal && this.props.selection && selectableVal.every(function (sv) {
|
|
5315
|
+
return _this5.props.selection.some(function (s) {
|
|
5316
|
+
return _this5.isEquals(s, sv);
|
|
5317
|
+
});
|
|
5281
5318
|
});
|
|
5282
|
-
}
|
|
5283
|
-
var length = this.props.lazy ? this.props.totalRecords : selectableVal ? selectableVal.length : 0;
|
|
5284
|
-
return selectableVal && length > 0 && this.props.selection && this.props.selection.length > 0 && this.props.selection.length === length;
|
|
5319
|
+
}
|
|
5285
5320
|
}
|
|
5286
5321
|
}, {
|
|
5287
5322
|
key: "getSelectionModeInColumn",
|
|
@@ -5482,37 +5517,46 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5482
5517
|
value: function onColumnHeaderCheckboxChange(e, processedData) {
|
|
5483
5518
|
var _this8 = this;
|
|
5484
5519
|
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
var selection;
|
|
5488
|
-
|
|
5489
|
-
if (!checked) {
|
|
5490
|
-
selection = this.props.frozenValue ? [].concat(_toConsumableArray(this.props.frozenValue), _toConsumableArray(processedData)) : processedData;
|
|
5491
|
-
selection = this.props.showSelectionElement ? selection.filter(function (data, index) {
|
|
5492
|
-
return _this8.props.showSelectionElement(data, {
|
|
5493
|
-
rowIndex: index,
|
|
5494
|
-
props: _this8.props
|
|
5495
|
-
});
|
|
5496
|
-
}) : selection;
|
|
5497
|
-
this.props.onAllRowsSelect && this.props.onAllRowsSelect({
|
|
5498
|
-
originalEvent: originalEvent,
|
|
5499
|
-
data: selection,
|
|
5500
|
-
type: 'all'
|
|
5501
|
-
});
|
|
5520
|
+
if (this.props.onSelectAllChange) {
|
|
5521
|
+
this.props.onSelectAllChange(e);
|
|
5502
5522
|
} else {
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5523
|
+
var originalEvent = e.originalEvent,
|
|
5524
|
+
checked = e.checked;
|
|
5525
|
+
var data = this.props.selectionPageOnly ? this.dataToRender(processedData) : processedData;
|
|
5526
|
+
var selection = this.props.selectionPageOnly && this.props.selection ? this.props.selection.filter(function (s) {
|
|
5527
|
+
return !data.some(function (d) {
|
|
5528
|
+
return _this8.isEquals(s, d);
|
|
5529
|
+
});
|
|
5530
|
+
}) : [];
|
|
5531
|
+
|
|
5532
|
+
if (checked) {
|
|
5533
|
+
selection = this.props.frozenValue ? [].concat(_toConsumableArray(selection), _toConsumableArray(this.props.frozenValue), _toConsumableArray(data)) : [].concat(_toConsumableArray(selection), _toConsumableArray(data));
|
|
5534
|
+
selection = this.props.showSelectionElement ? selection.filter(function (data, index) {
|
|
5535
|
+
return _this8.props.showSelectionElement(data, {
|
|
5536
|
+
rowIndex: index,
|
|
5537
|
+
props: _this8.props
|
|
5538
|
+
});
|
|
5539
|
+
}) : selection;
|
|
5540
|
+
this.props.onAllRowsSelect && this.props.onAllRowsSelect({
|
|
5541
|
+
originalEvent: originalEvent,
|
|
5542
|
+
data: selection,
|
|
5543
|
+
type: 'all'
|
|
5544
|
+
});
|
|
5545
|
+
} else {
|
|
5546
|
+
this.props.onAllRowsUnselect && this.props.onAllRowsUnselect({
|
|
5547
|
+
originalEvent: originalEvent,
|
|
5548
|
+
data: selection,
|
|
5549
|
+
type: 'all'
|
|
5550
|
+
});
|
|
5551
|
+
}
|
|
5510
5552
|
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5553
|
+
if (this.props.onSelectionChange) {
|
|
5554
|
+
this.props.onSelectionChange({
|
|
5555
|
+
originalEvent: originalEvent,
|
|
5556
|
+
value: selection,
|
|
5557
|
+
type: 'all'
|
|
5558
|
+
});
|
|
5559
|
+
}
|
|
5516
5560
|
}
|
|
5517
5561
|
}
|
|
5518
5562
|
}, {
|
|
@@ -5645,15 +5689,13 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5645
5689
|
}, {
|
|
5646
5690
|
key: "createStyleElement",
|
|
5647
5691
|
value: function createStyleElement() {
|
|
5648
|
-
this.styleElement =
|
|
5649
|
-
document.head.appendChild(this.styleElement);
|
|
5692
|
+
this.styleElement = utils.DomHandler.createInlineStyle();
|
|
5650
5693
|
}
|
|
5651
5694
|
}, {
|
|
5652
5695
|
key: "createResponsiveStyle",
|
|
5653
5696
|
value: function createResponsiveStyle() {
|
|
5654
5697
|
if (!this.responsiveStyleElement) {
|
|
5655
|
-
this.responsiveStyleElement =
|
|
5656
|
-
document.head.appendChild(this.responsiveStyleElement);
|
|
5698
|
+
this.responsiveStyleElement = utils.DomHandler.createInlineStyle();
|
|
5657
5699
|
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");
|
|
5658
5700
|
this.responsiveStyleElement.innerHTML = innerHTML;
|
|
5659
5701
|
}
|
|
@@ -5661,24 +5703,18 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5661
5703
|
}, {
|
|
5662
5704
|
key: "destroyResponsiveStyle",
|
|
5663
5705
|
value: function destroyResponsiveStyle() {
|
|
5664
|
-
|
|
5665
|
-
document.head.removeChild(this.responsiveStyleElement);
|
|
5666
|
-
this.responsiveStyleElement = null;
|
|
5667
|
-
}
|
|
5706
|
+
this.responsiveStyleElement = utils.DomHandler.removeInlineStyle(this.responsiveStyleElement);
|
|
5668
5707
|
}
|
|
5669
5708
|
}, {
|
|
5670
5709
|
key: "destroyStyleElement",
|
|
5671
5710
|
value: function destroyStyleElement() {
|
|
5672
|
-
|
|
5673
|
-
document.head.removeChild(this.styleElement);
|
|
5674
|
-
this.styleElement = null;
|
|
5675
|
-
}
|
|
5711
|
+
this.styleElement = utils.DomHandler.removeInlineStyle(this.styleElement);
|
|
5676
5712
|
}
|
|
5677
5713
|
}, {
|
|
5678
5714
|
key: "onPageChange",
|
|
5679
5715
|
value: function onPageChange(e) {
|
|
5680
5716
|
this.clearEditingMetaData();
|
|
5681
|
-
if (this.props.onPage) this.props.onPage(e);else this.setState({
|
|
5717
|
+
if (this.props.onPage) this.props.onPage(this.createEvent(e));else this.setState({
|
|
5682
5718
|
first: e.first,
|
|
5683
5719
|
rows: e.rows
|
|
5684
5720
|
});
|
|
@@ -5742,7 +5778,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5742
5778
|
}
|
|
5743
5779
|
|
|
5744
5780
|
if (this.props.onSort) {
|
|
5745
|
-
this.props.onSort(eventMeta);
|
|
5781
|
+
this.props.onSort(this.createEvent(eventMeta));
|
|
5746
5782
|
} else {
|
|
5747
5783
|
eventMeta.first = 0;
|
|
5748
5784
|
this.setState(eventMeta);
|
|
@@ -5761,6 +5797,15 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5761
5797
|
value: function getCalculatedSortOrder(currentOrder) {
|
|
5762
5798
|
return this.props.removableSort ? this.props.defaultSortOrder === currentOrder ? currentOrder * -1 : 0 : currentOrder * -1;
|
|
5763
5799
|
}
|
|
5800
|
+
}, {
|
|
5801
|
+
key: "compareValuesOnSort",
|
|
5802
|
+
value: function compareValuesOnSort(value1, value2) {
|
|
5803
|
+
var result = null;
|
|
5804
|
+
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, {
|
|
5805
|
+
numeric: true
|
|
5806
|
+
});else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
5807
|
+
return result;
|
|
5808
|
+
}
|
|
5764
5809
|
}, {
|
|
5765
5810
|
key: "addSortMeta",
|
|
5766
5811
|
value: function addSortMeta(meta, multiSortMeta) {
|
|
@@ -5785,6 +5830,8 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5785
5830
|
}, {
|
|
5786
5831
|
key: "sortSingle",
|
|
5787
5832
|
value: function sortSingle(data, field, order) {
|
|
5833
|
+
var _this10 = this;
|
|
5834
|
+
|
|
5788
5835
|
if (this.props.groupRowsBy && this.props.groupRowsBy === this.props.sortField) {
|
|
5789
5836
|
var multiSortMeta = [{
|
|
5790
5837
|
field: this.props.sortField,
|
|
@@ -5808,10 +5855,9 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5808
5855
|
value.sort(function (data1, data2) {
|
|
5809
5856
|
var value1 = utils.ObjectUtils.resolveFieldData(data1, field);
|
|
5810
5857
|
var value2 = utils.ObjectUtils.resolveFieldData(data2, field);
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
});else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
5858
|
+
|
|
5859
|
+
var result = _this10.compareValuesOnSort(value1, value2);
|
|
5860
|
+
|
|
5815
5861
|
return order * result;
|
|
5816
5862
|
});
|
|
5817
5863
|
}
|
|
@@ -5821,7 +5867,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5821
5867
|
}, {
|
|
5822
5868
|
key: "sortMultiple",
|
|
5823
5869
|
value: function sortMultiple(data) {
|
|
5824
|
-
var
|
|
5870
|
+
var _this11 = this;
|
|
5825
5871
|
|
|
5826
5872
|
var multiSortMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
5827
5873
|
|
|
@@ -5838,7 +5884,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5838
5884
|
|
|
5839
5885
|
if (this.columnSortable && this.columnSortFunction) {
|
|
5840
5886
|
var meta = multiSortMeta.find(function (meta) {
|
|
5841
|
-
return meta.field ===
|
|
5887
|
+
return meta.field === _this11.columnField;
|
|
5842
5888
|
});
|
|
5843
5889
|
var field = this.columnField;
|
|
5844
5890
|
var order = meta ? meta.order : this.defaultSortOrder;
|
|
@@ -5848,7 +5894,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5848
5894
|
});
|
|
5849
5895
|
} else {
|
|
5850
5896
|
value.sort(function (data1, data2) {
|
|
5851
|
-
return
|
|
5897
|
+
return _this11.multisortField(data1, data2, multiSortMeta, 0);
|
|
5852
5898
|
});
|
|
5853
5899
|
}
|
|
5854
5900
|
|
|
@@ -5859,22 +5905,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5859
5905
|
value: function multisortField(data1, data2, multiSortMeta, index) {
|
|
5860
5906
|
var value1 = utils.ObjectUtils.resolveFieldData(data1, multiSortMeta[index].field);
|
|
5861
5907
|
var value2 = utils.ObjectUtils.resolveFieldData(data2, multiSortMeta[index].field);
|
|
5862
|
-
var result = null;
|
|
5863
|
-
|
|
5864
|
-
if (typeof value1 === 'string' || value1 instanceof String) {
|
|
5865
|
-
if (value1.localeCompare && value1 !== value2) {
|
|
5866
|
-
return multiSortMeta[index].order * value1.localeCompare(value2, undefined, {
|
|
5867
|
-
numeric: true
|
|
5868
|
-
});
|
|
5869
|
-
}
|
|
5870
|
-
} else {
|
|
5871
|
-
result = value1 < value2 ? -1 : 1;
|
|
5872
|
-
}
|
|
5873
5908
|
|
|
5874
5909
|
if (value1 === value2) {
|
|
5875
5910
|
return multiSortMeta.length - 1 > index ? this.multisortField(data1, data2, multiSortMeta, index + 1) : 0;
|
|
5876
5911
|
}
|
|
5877
5912
|
|
|
5913
|
+
var result = this.compareValuesOnSort(value1, value2);
|
|
5878
5914
|
return multiSortMeta[index].order * result;
|
|
5879
5915
|
}
|
|
5880
5916
|
}, {
|
|
@@ -5888,25 +5924,25 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
5888
5924
|
}, {
|
|
5889
5925
|
key: "onFilterApply",
|
|
5890
5926
|
value: function onFilterApply() {
|
|
5891
|
-
var
|
|
5927
|
+
var _this12 = this;
|
|
5892
5928
|
|
|
5893
5929
|
clearTimeout(this.filterTimeout);
|
|
5894
5930
|
this.filterTimeout = setTimeout(function () {
|
|
5895
|
-
var filters =
|
|
5931
|
+
var filters = _this12.cloneFilters(_this12.state.d_filters);
|
|
5896
5932
|
|
|
5897
|
-
if (
|
|
5898
|
-
|
|
5933
|
+
if (_this12.props.onFilter) {
|
|
5934
|
+
_this12.props.onFilter(_this12.createEvent({
|
|
5899
5935
|
filters: filters
|
|
5900
|
-
});
|
|
5936
|
+
}));
|
|
5901
5937
|
} else {
|
|
5902
|
-
|
|
5938
|
+
_this12.setState({
|
|
5903
5939
|
first: 0,
|
|
5904
5940
|
filters: filters
|
|
5905
5941
|
});
|
|
5906
5942
|
}
|
|
5907
5943
|
|
|
5908
|
-
if (
|
|
5909
|
-
|
|
5944
|
+
if (_this12.props.onValueChange) {
|
|
5945
|
+
_this12.props.onValueChange(_this12.processedData({
|
|
5910
5946
|
filters: filters
|
|
5911
5947
|
}));
|
|
5912
5948
|
}
|
|
@@ -6004,7 +6040,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6004
6040
|
}, {
|
|
6005
6041
|
key: "cloneFilters",
|
|
6006
6042
|
value: function cloneFilters(filters) {
|
|
6007
|
-
var
|
|
6043
|
+
var _this13 = this;
|
|
6008
6044
|
|
|
6009
6045
|
filters = filters || this.props.filters;
|
|
6010
6046
|
var cloned = {};
|
|
@@ -6025,34 +6061,31 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6025
6061
|
} else {
|
|
6026
6062
|
var columns = this.getColumns();
|
|
6027
6063
|
cloned = columns.reduce(function (_filters, col) {
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
};
|
|
6037
|
-
|
|
6038
|
-
if (filterFunction) {
|
|
6039
|
-
PrimeReact.FilterService.register("custom_".concat(field), function () {
|
|
6040
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6041
|
-
args[_key] = arguments[_key];
|
|
6042
|
-
}
|
|
6064
|
+
var field = col.props.filterField || col.props.field;
|
|
6065
|
+
var filterFunction = col.props.filterFunction;
|
|
6066
|
+
var dataType = col.props.dataType;
|
|
6067
|
+
var matchMode = col.props.filterMatchMode || (PrimeReact__default["default"].filterMatchModeOptions[dataType] ? PrimeReact__default["default"].filterMatchModeOptions[dataType][0] : PrimeReact.FilterMatchMode.STARTS_WITH);
|
|
6068
|
+
var constraint = {
|
|
6069
|
+
value: null,
|
|
6070
|
+
matchMode: matchMode
|
|
6071
|
+
};
|
|
6043
6072
|
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6073
|
+
if (filterFunction) {
|
|
6074
|
+
PrimeReact.FilterService.register("custom_".concat(field), function () {
|
|
6075
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6076
|
+
args[_key] = arguments[_key];
|
|
6077
|
+
}
|
|
6049
6078
|
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
}
|
|
6079
|
+
return filterFunction.apply(void 0, args.concat([{
|
|
6080
|
+
column: col
|
|
6081
|
+
}]));
|
|
6082
|
+
});
|
|
6054
6083
|
}
|
|
6055
6084
|
|
|
6085
|
+
_filters[field] = _this13.props.filterDisplay === 'menu' ? {
|
|
6086
|
+
operator: PrimeReact.FilterOperator.AND,
|
|
6087
|
+
constraints: [constraint]
|
|
6088
|
+
} : constraint;
|
|
6056
6089
|
return _filters;
|
|
6057
6090
|
}, {});
|
|
6058
6091
|
}
|
|
@@ -6128,7 +6161,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6128
6161
|
}, {
|
|
6129
6162
|
key: "exportCSV",
|
|
6130
6163
|
value: function exportCSV(options) {
|
|
6131
|
-
var
|
|
6164
|
+
var _this14 = this;
|
|
6132
6165
|
|
|
6133
6166
|
var data;
|
|
6134
6167
|
var csv = "\uFEFF";
|
|
@@ -6151,7 +6184,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6151
6184
|
csv += '"' + (header || field) + '"';
|
|
6152
6185
|
|
|
6153
6186
|
if (i < columns.length - 1) {
|
|
6154
|
-
csv +=
|
|
6187
|
+
csv += _this14.props.csvSeparator;
|
|
6155
6188
|
}
|
|
6156
6189
|
}
|
|
6157
6190
|
}); //body
|
|
@@ -6167,7 +6200,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6167
6200
|
var cellData = utils.ObjectUtils.resolveFieldData(record, field);
|
|
6168
6201
|
|
|
6169
6202
|
if (cellData != null) {
|
|
6170
|
-
cellData =
|
|
6203
|
+
cellData = _this14.props.exportFunction ? _this14.props.exportFunction({
|
|
6171
6204
|
data: cellData,
|
|
6172
6205
|
field: field,
|
|
6173
6206
|
rowData: record,
|
|
@@ -6178,7 +6211,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6178
6211
|
csv += '"' + cellData + '"';
|
|
6179
6212
|
|
|
6180
6213
|
if (i < columns.length - 1) {
|
|
6181
|
-
csv +=
|
|
6214
|
+
csv += _this14.props.csvSeparator;
|
|
6182
6215
|
}
|
|
6183
6216
|
}
|
|
6184
6217
|
});
|
|
@@ -6192,6 +6225,18 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6192
6225
|
document.body.click();
|
|
6193
6226
|
}
|
|
6194
6227
|
}
|
|
6228
|
+
}, {
|
|
6229
|
+
key: "createEvent",
|
|
6230
|
+
value: function createEvent(event) {
|
|
6231
|
+
return _objectSpread({
|
|
6232
|
+
first: this.getFirst(),
|
|
6233
|
+
rows: this.getRows(),
|
|
6234
|
+
sortField: this.getSortField(),
|
|
6235
|
+
sortOrder: this.getSortOrder(),
|
|
6236
|
+
multiSortMeta: this.getMultiSortMeta(),
|
|
6237
|
+
filters: this.getFilters()
|
|
6238
|
+
}, event);
|
|
6239
|
+
}
|
|
6195
6240
|
}, {
|
|
6196
6241
|
key: "processedData",
|
|
6197
6242
|
value: function processedData(localState) {
|
|
@@ -6235,8 +6280,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6235
6280
|
this.createResponsiveStyle();
|
|
6236
6281
|
}
|
|
6237
6282
|
|
|
6238
|
-
if (this.isStateful()
|
|
6239
|
-
this.
|
|
6283
|
+
if (this.isStateful()) {
|
|
6284
|
+
this.setState(this.restoreState(this.state));
|
|
6285
|
+
|
|
6286
|
+
if (this.props.resizableColumns) {
|
|
6287
|
+
this.restoreColumnWidths();
|
|
6288
|
+
}
|
|
6240
6289
|
}
|
|
6241
6290
|
}
|
|
6242
6291
|
}, {
|
|
@@ -6336,6 +6385,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6336
6385
|
filtersStore: filtersStore,
|
|
6337
6386
|
onFilterChange: this.onFilterChange,
|
|
6338
6387
|
onFilterApply: this.onFilterApply,
|
|
6388
|
+
showSelectAll: this.props.showSelectAll,
|
|
6339
6389
|
allRowsSelected: this.allRowsSelected,
|
|
6340
6390
|
onColumnCheckboxChange: this.onColumnHeaderCheckboxChange,
|
|
6341
6391
|
onColumnMouseDown: this.onColumnHeaderMouseDown,
|
|
@@ -6503,7 +6553,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6503
6553
|
}, {
|
|
6504
6554
|
key: "renderContent",
|
|
6505
6555
|
value: function renderContent(processedData, columns, selectionModeInColumn, empty) {
|
|
6506
|
-
var
|
|
6556
|
+
var _this15 = this;
|
|
6507
6557
|
|
|
6508
6558
|
if (!columns) return;
|
|
6509
6559
|
var isVirtualScrollerDisabled = this.isVirtualScrollerDisabled();
|
|
@@ -6516,29 +6566,27 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6516
6566
|
}, /*#__PURE__*/React__default["default"].createElement(virtualscroller.VirtualScroller, _extends({}, virtualScrollerOptions, {
|
|
6517
6567
|
items: processedData,
|
|
6518
6568
|
columns: columns,
|
|
6519
|
-
|
|
6520
|
-
height: this.props.scrollHeight
|
|
6521
|
-
},
|
|
6569
|
+
scrollHeight: this.props.scrollHeight,
|
|
6522
6570
|
disabled: isVirtualScrollerDisabled,
|
|
6523
6571
|
loaderDisabled: true,
|
|
6524
6572
|
showSpacer: false,
|
|
6525
6573
|
contentTemplate: function contentTemplate(options) {
|
|
6526
6574
|
var ref = function ref(el) {
|
|
6527
|
-
|
|
6575
|
+
_this15.table = el;
|
|
6528
6576
|
options.spacerRef && options.spacerRef(el);
|
|
6529
6577
|
};
|
|
6530
6578
|
|
|
6531
|
-
var tableClassName = utils.classNames('p-datatable-table',
|
|
6579
|
+
var tableClassName = utils.classNames('p-datatable-table', _this15.props.tableClassName);
|
|
6532
6580
|
|
|
6533
|
-
var tableHeader =
|
|
6581
|
+
var tableHeader = _this15.renderTableHeader(options, empty);
|
|
6534
6582
|
|
|
6535
|
-
var tableBody =
|
|
6583
|
+
var tableBody = _this15.renderTableBody(options, selectionModeInColumn, empty, isVirtualScrollerDisabled);
|
|
6536
6584
|
|
|
6537
|
-
var tableFooter =
|
|
6585
|
+
var tableFooter = _this15.renderTableFooter(options);
|
|
6538
6586
|
|
|
6539
6587
|
return /*#__PURE__*/React__default["default"].createElement("table", {
|
|
6540
6588
|
ref: ref,
|
|
6541
|
-
style:
|
|
6589
|
+
style: _this15.props.tableStyle,
|
|
6542
6590
|
className: tableClassName,
|
|
6543
6591
|
role: "table"
|
|
6544
6592
|
}, tableHeader, tableBody, tableFooter);
|
|
@@ -6600,12 +6648,12 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6600
6648
|
}, {
|
|
6601
6649
|
key: "renderResizeHelper",
|
|
6602
6650
|
value: function renderResizeHelper() {
|
|
6603
|
-
var
|
|
6651
|
+
var _this16 = this;
|
|
6604
6652
|
|
|
6605
6653
|
if (this.props.resizableColumns) {
|
|
6606
6654
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6607
6655
|
ref: function ref(el) {
|
|
6608
|
-
return
|
|
6656
|
+
return _this16.resizeHelper = el;
|
|
6609
6657
|
},
|
|
6610
6658
|
className: "p-column-resizer-helper",
|
|
6611
6659
|
style: {
|
|
@@ -6619,7 +6667,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6619
6667
|
}, {
|
|
6620
6668
|
key: "renderReorderIndicators",
|
|
6621
6669
|
value: function renderReorderIndicators() {
|
|
6622
|
-
var
|
|
6670
|
+
var _this17 = this;
|
|
6623
6671
|
|
|
6624
6672
|
if (this.props.reorderableColumns) {
|
|
6625
6673
|
var style = {
|
|
@@ -6628,13 +6676,13 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6628
6676
|
};
|
|
6629
6677
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
6630
6678
|
ref: function ref(el) {
|
|
6631
|
-
return
|
|
6679
|
+
return _this17.reorderIndicatorUp = el;
|
|
6632
6680
|
},
|
|
6633
6681
|
className: "pi pi-arrow-down p-datatable-reorder-indicator-up",
|
|
6634
6682
|
style: style
|
|
6635
6683
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
6636
6684
|
ref: function ref(el) {
|
|
6637
|
-
return
|
|
6685
|
+
return _this17.reorderIndicatorDown = el;
|
|
6638
6686
|
},
|
|
6639
6687
|
className: "pi pi-arrow-up p-datatable-reorder-indicator-down",
|
|
6640
6688
|
style: style
|
|
@@ -6646,7 +6694,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6646
6694
|
}, {
|
|
6647
6695
|
key: "render",
|
|
6648
6696
|
value: function render() {
|
|
6649
|
-
var
|
|
6697
|
+
var _this18 = this;
|
|
6650
6698
|
|
|
6651
6699
|
var processedData = this.processedData();
|
|
6652
6700
|
var columns = this.getColumns();
|
|
@@ -6682,7 +6730,7 @@ var DataTable = /*#__PURE__*/function (_Component) {
|
|
|
6682
6730
|
var reorderIndicators = this.renderReorderIndicators();
|
|
6683
6731
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6684
6732
|
ref: function ref(el) {
|
|
6685
|
-
return
|
|
6733
|
+
return _this18.el = el;
|
|
6686
6734
|
},
|
|
6687
6735
|
id: this.props.id,
|
|
6688
6736
|
className: className,
|
|
@@ -6749,6 +6797,10 @@ _defineProperty(DataTable, "defaultProps", {
|
|
|
6749
6797
|
dataKey: null,
|
|
6750
6798
|
metaKeySelection: true,
|
|
6751
6799
|
selectOnEdit: true,
|
|
6800
|
+
selectionPageOnly: false,
|
|
6801
|
+
showSelectAll: true,
|
|
6802
|
+
selectAll: false,
|
|
6803
|
+
onSelectAllChange: null,
|
|
6752
6804
|
headerColumnGroup: null,
|
|
6753
6805
|
footerColumnGroup: null,
|
|
6754
6806
|
rowExpansionTemplate: null,
|