dattatable 2.11.73 → 2.11.75

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.
Files changed (69) hide show
  1. package/build/dashboard/table.d.ts +3 -0
  2. package/build/dashboard/table.js +48 -40
  3. package/dist/dattatable.js +902 -902
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +5 -3
  12. package/docs/classes/Documents.html +6 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -2
  17. package/docs/classes/ItemForm.html +5 -5
  18. package/docs/classes/List.html +4 -4
  19. package/docs/classes/ListConfig.html +2 -2
  20. package/docs/classes/ListSecurity.html +2 -2
  21. package/docs/classes/LoadingDialog.html +2 -2
  22. package/docs/classes/Modal.html +2 -2
  23. package/docs/classes/Navigation.html +3 -3
  24. package/docs/classes/Tiles.html +2 -2
  25. package/docs/classes/Timeout.html +2 -2
  26. package/docs/enums/ActionButtonTypes.html +2 -2
  27. package/docs/functions/formatBytes.html +1 -1
  28. package/docs/functions/formatDateValue.html +1 -1
  29. package/docs/functions/formatTimeValue.html +1 -1
  30. package/docs/functions/getContextInfo.html +1 -1
  31. package/docs/functions/getFileExt.html +1 -1
  32. package/docs/functions/waitForTheme.html +1 -1
  33. package/docs/interfaces/IAccordion.html +2 -2
  34. package/docs/interfaces/IAccordionProps.html +2 -2
  35. package/docs/interfaces/IAuditLogItem.html +14 -14
  36. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  37. package/docs/interfaces/IAuditLogProps.html +2 -2
  38. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  39. package/docs/interfaces/ICommentsItem.html +2 -2
  40. package/docs/interfaces/ICreateLookupData.html +2 -2
  41. package/docs/interfaces/IDashboardProps.html +2 -2
  42. package/docs/interfaces/IDataTable.html +3 -2
  43. package/docs/interfaces/IDataTableProps.html +2 -2
  44. package/docs/interfaces/IDocumentsProps.html +2 -2
  45. package/docs/interfaces/IFilterItem.html +2 -2
  46. package/docs/interfaces/IFilterProps.html +2 -2
  47. package/docs/interfaces/IFooterProps.html +2 -2
  48. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  49. package/docs/interfaces/IHeaderProps.html +2 -2
  50. package/docs/interfaces/IInstallProps.html +2 -2
  51. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  52. package/docs/interfaces/IItemFormEditProps.html +2 -2
  53. package/docs/interfaces/IItemFormSaveProps.html +2 -2
  54. package/docs/interfaces/IItemFormTab.html +2 -2
  55. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  56. package/docs/interfaces/IItemFormViewProps.html +2 -2
  57. package/docs/interfaces/IListConfig.html +2 -2
  58. package/docs/interfaces/IListConfigProps.html +2 -2
  59. package/docs/interfaces/IListProps.html +2 -2
  60. package/docs/interfaces/IListSecurity.html +2 -2
  61. package/docs/interfaces/IListSecurityItem.html +2 -2
  62. package/docs/interfaces/ILookupData.html +2 -2
  63. package/docs/interfaces/IShowDialogProps.html +2 -2
  64. package/docs/interfaces/ITiles.html +2 -2
  65. package/docs/interfaces/ITilesProps.html +2 -2
  66. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  67. package/docs/variables/DattaTable.html +1 -1
  68. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  69. package/package.json +1 -1
@@ -14,6 +14,7 @@ export interface IDataTable {
14
14
  onRendering?: (dtProps: any) => any;
15
15
  onRendered?: (el?: HTMLElement, dt?: any) => void;
16
16
  refresh: (rows: any[]) => void;
17
+ removeRow: (rowIdx: number) => void;
17
18
  search: (value?: string) => void;
18
19
  updateCell: (row: number, column: number, value: any) => void;
19
20
  updateRow: (rowIdx: number, data: any) => void;
@@ -41,6 +42,7 @@ export declare class DataTable implements IDataTable {
41
42
  constructor(props: IDataTableProps);
42
43
  addRow(row: any): void;
43
44
  private applyPlugin;
45
+ private getDefaultProperties;
44
46
  /** Public Interface */
45
47
  get datatable(): any;
46
48
  get el(): HTMLElement;
@@ -49,6 +51,7 @@ export declare class DataTable implements IDataTable {
49
51
  filterMulti(idx: number, values?: string[]): void;
50
52
  filterMultiExact(idx: number, values?: string[]): void;
51
53
  refresh(rows?: any[]): void;
54
+ removeRow(rowIdx: number): void;
52
55
  search(value?: string): void;
53
56
  updateCell(row: number, column: number, value: any): void;
54
57
  updateRow(rowIdx: number, data: any): void;
@@ -12,15 +12,55 @@ require("datatables.net-bs5");
12
12
  var DataTable = /** @class */ (function () {
13
13
  // Constructor
14
14
  function DataTable(props) {
15
- var _this = this;
16
15
  this._addRowItems = [];
17
16
  this._datatable = null;
18
17
  this._props = null;
19
18
  this._table = null;
20
19
  // Save the properties
21
20
  this._props = props;
22
- // Set the default properties
23
- this._props.dtProps = this._props.dtProps || {
21
+ // Render the table
22
+ this.refresh(props.rows);
23
+ }
24
+ // Adds row(s) to the table
25
+ DataTable.prototype.addRow = function (row) {
26
+ var _this = this;
27
+ // Set the rows array
28
+ (typeof (row.length) === "number" ? row : [row]).forEach(function (row) {
29
+ var newRow = [];
30
+ // Parse the columns
31
+ for (var i = 0; i < _this._props.columns.length; i++) {
32
+ var column = _this._props.columns[i];
33
+ var value = typeof (row[column.name]) != "undefined" ? row[column.name] : "";
34
+ // Append the value
35
+ newRow.push(value);
36
+ }
37
+ // Save a reference to the original data for the event
38
+ var uniqueId = Date.now();
39
+ newRow.push(uniqueId);
40
+ _this._addRowItems.push({ rowId: uniqueId, row: row });
41
+ // Add the row
42
+ _this._datatable.row.add(newRow);
43
+ });
44
+ // Refresh the table
45
+ this._datatable.draw(false);
46
+ };
47
+ // Applies the datatables.net plugin
48
+ DataTable.prototype.applyPlugin = function (table) {
49
+ var _this = this;
50
+ // Call the rendering event
51
+ this._props.dtProps = this.getDefaultProperties(this._props.dtProps);
52
+ this._props.dtProps = this._props.onRendering ? this._props.onRendering(this._props.dtProps) : this._props.dtProps;
53
+ // Render the datatable
54
+ this._datatable = $(table.el).DataTable(this._props.dtProps);
55
+ // Call the rendered event in a separate thread to ensure the dashboard object is created
56
+ setTimeout(function () {
57
+ _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;
58
+ }, 50);
59
+ };
60
+ DataTable.prototype.getDefaultProperties = function (props) {
61
+ var _this = this;
62
+ // Return the default properties
63
+ return (props === null || props === void 0 ? void 0 : props.dtProps) || {
24
64
  columnDefs: [{
25
65
  targets: "_all",
26
66
  render: function (data, type, row, meta) {
@@ -98,43 +138,6 @@ var DataTable = /** @class */ (function () {
98
138
  }
99
139
  }
100
140
  };
101
- // Render the table
102
- this.refresh(props.rows);
103
- }
104
- // Adds row(s) to the table
105
- DataTable.prototype.addRow = function (row) {
106
- var _this = this;
107
- // Set the rows array
108
- (typeof (row.length) === "number" ? row : [row]).forEach(function (row) {
109
- var newRow = [];
110
- // Parse the columns
111
- for (var i = 0; i < _this._props.columns.length; i++) {
112
- var column = _this._props.columns[i];
113
- var value = typeof (row[column.name]) != "undefined" ? row[column.name] : "";
114
- // Append the value
115
- newRow.push(value);
116
- }
117
- // Save a reference to the original data for the event
118
- var uniqueId = Date.now();
119
- newRow.push(uniqueId);
120
- _this._addRowItems.push({ rowId: uniqueId, row: row });
121
- // Add the row
122
- _this._datatable.row.add(newRow);
123
- });
124
- // Refresh the table
125
- this._datatable.draw(false);
126
- };
127
- // Applies the datatables.net plugin
128
- DataTable.prototype.applyPlugin = function (table) {
129
- var _this = this;
130
- // Call the rendering event
131
- this._props.dtProps = this._props.onRendering ? this._props.onRendering(this._props.dtProps) : this._props.dtProps;
132
- // Render the datatable
133
- this._datatable = $(table.el).DataTable(this._props.dtProps);
134
- // Call the rendered event in a separate thread to ensure the dashboard object is created
135
- setTimeout(function () {
136
- _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;
137
- }, 50);
138
141
  };
139
142
  Object.defineProperty(DataTable.prototype, "datatable", {
140
143
  /** Public Interface */
@@ -207,6 +210,11 @@ var DataTable = /** @class */ (function () {
207
210
  // Apply the plugin
208
211
  this.applyPlugin(this._table);
209
212
  };
213
+ // Removes a row by index
214
+ DataTable.prototype.removeRow = function (rowIdx) {
215
+ // Remove the row by index
216
+ this._datatable.row(rowIdx).draw(false);
217
+ };
210
218
  // Searches the datatable
211
219
  DataTable.prototype.search = function (value) {
212
220
  if (value === void 0) { value = ""; }