dattatable 2.3.7 → 2.3.9

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 (46) hide show
  1. package/build/auditLog/index.d.ts +1 -0
  2. package/build/auditLog/index.js +83 -0
  3. package/dist/dattatable.js +1 -1
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/AuditLog.html +40 -12
  7. package/docs/classes/CanvasForm.html +17 -17
  8. package/docs/classes/Comments.html +12 -12
  9. package/docs/classes/Dashboard.html +17 -17
  10. package/docs/classes/DataTable.html +11 -11
  11. package/docs/classes/Documents.html +45 -45
  12. package/docs/classes/FilterSlideout.html +14 -14
  13. package/docs/classes/Footer.html +4 -4
  14. package/docs/classes/Header.html +4 -4
  15. package/docs/classes/InstallationRequired.html +12 -12
  16. package/docs/classes/ItemForm.html +47 -47
  17. package/docs/classes/List.html +36 -36
  18. package/docs/classes/LoadingDialog.html +12 -12
  19. package/docs/classes/Modal.html +26 -26
  20. package/docs/classes/Navigation.html +6 -6
  21. package/docs/enums/ActionButtonTypes.html +6 -6
  22. package/docs/functions/formatBytes.html +1 -1
  23. package/docs/functions/formatDateValue.html +1 -1
  24. package/docs/functions/formatTimeValue.html +1 -1
  25. package/docs/functions/getFileExt.html +1 -1
  26. package/docs/interfaces/IAuditLogItem.html +8 -8
  27. package/docs/interfaces/IAuditLogItemCreation.html +7 -7
  28. package/docs/interfaces/IAuditLogProps.html +5 -5
  29. package/docs/interfaces/ICommentsItem.html +6 -6
  30. package/docs/interfaces/IDashboardProps.html +14 -14
  31. package/docs/interfaces/IDataTable.html +7 -7
  32. package/docs/interfaces/IDataTableProps.html +6 -6
  33. package/docs/interfaces/IDocumentsProps.html +25 -25
  34. package/docs/interfaces/IFilterItem.html +5 -5
  35. package/docs/interfaces/IFilterProps.html +4 -4
  36. package/docs/interfaces/IFooterProps.html +6 -6
  37. package/docs/interfaces/IHeaderProps.html +5 -5
  38. package/docs/interfaces/IItemFormCreateProps.html +14 -14
  39. package/docs/interfaces/IItemFormEditProps.html +15 -15
  40. package/docs/interfaces/IItemFormTab.html +7 -7
  41. package/docs/interfaces/IItemFormTabInfo.html +3 -3
  42. package/docs/interfaces/IItemFormViewProps.html +12 -12
  43. package/docs/interfaces/IListProps.html +9 -9
  44. package/docs/interfaces/IShowDialogProps.html +5 -5
  45. package/docs/variables/DattaTable.html +1 -1
  46. package/package.json +1 -1
@@ -36,4 +36,5 @@ export declare class AuditLog {
36
36
  install(): PromiseLike<void>;
37
37
  logItem(values: IAuditLogItemCreation): PromiseLike<IAuditLogItem>;
38
38
  uninstall(): PromiseLike<void>;
39
+ viewLog(itemId: number, onQuery?: (query: Types.IODataQuery) => Types.IODataQuery): void;
39
40
  }
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuditLog = void 0;
4
+ var gd_sprest_bs_1 = require("gd-sprest-bs");
5
+ var jQuery = require("jquery");
6
+ var modal_1 = require("../common/modal");
4
7
  var list_1 = require("../common/list");
8
+ var loadingDialog_1 = require("../common/loadingDialog");
9
+ var table_1 = require("../dashboard/table");
5
10
  var cfg_1 = require("./cfg");
6
11
  /**
7
12
  * Audit Log
@@ -76,6 +81,84 @@ var AuditLog = /** @class */ (function () {
76
81
  // Remove the audit log list
77
82
  return this.Configuration.uninstall();
78
83
  };
84
+ // Method to view the audit log information for an item
85
+ AuditLog.prototype.viewLog = function (itemId, onQuery) {
86
+ // Display a loading dialog
87
+ loadingDialog_1.LoadingDialog.setHeader("Loading Audit History");
88
+ loadingDialog_1.LoadingDialog.setBody("This will close after the information is loaded...");
89
+ loadingDialog_1.LoadingDialog.show();
90
+ // Load the information
91
+ this.getItems(itemId, onQuery).then(function (items) {
92
+ // Clear the modal
93
+ modal_1.Modal.clear();
94
+ // Set the size
95
+ modal_1.Modal.setType(gd_sprest_bs_1.Components.ModalTypes.Large);
96
+ // Set the header
97
+ modal_1.Modal.setHeader("Audit History");
98
+ // Render the table
99
+ new table_1.DataTable({
100
+ el: modal_1.Modal.BodyElement,
101
+ rows: items,
102
+ dtProps: {
103
+ dom: 'rt<"row"<"col-sm-4"l><"col-sm-4"i><"col-sm-4"p>>',
104
+ columnDefs: [
105
+ {
106
+ "targets": 4,
107
+ "orderable": false,
108
+ "searchable": false
109
+ }
110
+ ],
111
+ createdRow: function (row, data, index) {
112
+ jQuery('td', row).addClass('align-middle');
113
+ },
114
+ drawCallback: function (settings) {
115
+ var api = new jQuery.fn.dataTable.Api(settings);
116
+ jQuery(api.context[0].nTable).removeClass('no-footer');
117
+ jQuery(api.context[0].nTable).addClass('tbl-footer');
118
+ jQuery(api.context[0].nTable).addClass('table-striped');
119
+ jQuery(api.context[0].nTableWrapper).find('.dataTables_info').addClass('text-center');
120
+ jQuery(api.context[0].nTableWrapper).find('.dataTables_length').addClass('pt-2');
121
+ jQuery(api.context[0].nTableWrapper).find('.dataTables_paginate').addClass('pt-03');
122
+ },
123
+ headerCallback: function (thead, data, start, end, display) {
124
+ jQuery('th', thead).addClass('align-middle');
125
+ },
126
+ // Order by the 1st column by default; ascending
127
+ order: [[0, "desc"]]
128
+ },
129
+ columns: [
130
+ {
131
+ name: "Created",
132
+ title: "Created"
133
+ },
134
+ {
135
+ name: "Title",
136
+ title: "Title"
137
+ },
138
+ {
139
+ name: "",
140
+ title: "User",
141
+ onRenderCell: function (el, col, item) {
142
+ // Render the user information
143
+ item.LogUser ? el.innerHTML = item.LogUser.Title : null;
144
+ }
145
+ },
146
+ {
147
+ name: "LogComment",
148
+ title: "Comment"
149
+ },
150
+ {
151
+ name: "LogData",
152
+ title: "Data"
153
+ }
154
+ ]
155
+ });
156
+ // Hide the loading dialog
157
+ loadingDialog_1.LoadingDialog.hide();
158
+ // Show the modal
159
+ modal_1.Modal.show();
160
+ });
161
+ };
79
162
  return AuditLog;
80
163
  }());
81
164
  exports.AuditLog = AuditLog;
@@ -27,7 +27,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
27
27
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
28
28
 
29
29
  "use strict";
30
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AuditLog = void 0;\r\nvar list_1 = __webpack_require__(/*! ../common/list */ \"./build/common/list.js\");\r\nvar cfg_1 = __webpack_require__(/*! ./cfg */ \"./build/auditLog/cfg.js\");\r\n/**\r\n * Audit Log\r\n */\r\nvar AuditLog = /** @class */ (function () {\r\n // Constructor\r\n function AuditLog(props) {\r\n // Configuration\r\n this._cfg = null;\r\n // List\r\n this._list = null;\r\n // Set the configuration\r\n this._cfg = cfg_1.Configuration;\r\n // Update the list name\r\n var listName = props.listName ? props.listName : this._cfg._configuration.ListCfg[0].ListInformation.Title;\r\n props.listName ? this._cfg._configuration.ListCfg[0].ListInformation.Title = listName : null;\r\n // Create the list component\r\n this._list = new list_1.List({\r\n listName: listName,\r\n webUrl: props.webUrl,\r\n onInitError: props.onInitError,\r\n onInitialized: props.onInitialized,\r\n itemQuery: {\r\n Filter: \"Id eq 0\"\r\n }\r\n });\r\n }\r\n Object.defineProperty(AuditLog.prototype, \"Configuration\", {\r\n get: function () { return this._cfg; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"AuditListName\", {\r\n get: function () {\r\n // Return the list name\r\n return this.Configuration._configuration.ListCfg[0].ListInformation.Title;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"List\", {\r\n get: function () { return this._list; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Gets data for an associated item\r\n AuditLog.prototype.getItems = function (itemId, onQuery) {\r\n // Set the odata query\r\n var odata = {\r\n Expand: [\"LogUser\"],\r\n Filter: \"ParentListName eq '\".concat(this.List.ListName, \"' and ParentItemId eq \").concat(itemId),\r\n OrderBy: [\"Created desc\"],\r\n Select: [\"*\", \"LogUser/EMail\", \"LogUser/Id\", \"LogUser/LoginName\", \"LogUser/Title\"]\r\n };\r\n // Call the event\r\n odata = onQuery ? onQuery(odata) : odata;\r\n // Get the list data\r\n return this.List.refresh(odata);\r\n };\r\n // Installs the list\r\n AuditLog.prototype.install = function () {\r\n // Installs the list\r\n return this.Configuration.install();\r\n };\r\n // Logs an item to the audit log\r\n AuditLog.prototype.logItem = function (values) {\r\n // Create the item\r\n return this.List.createItem(values);\r\n };\r\n // Removes the audit log list\r\n AuditLog.prototype.uninstall = function () {\r\n // Remove the audit log list\r\n return this.Configuration.uninstall();\r\n };\r\n return AuditLog;\r\n}());\r\nexports.AuditLog = AuditLog;\r\n\n\n//# sourceURL=webpack://dattatable/./build/auditLog/index.js?");
30
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AuditLog = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.4/node_modules/gd-sprest-bs/build/index.js\");\r\nvar jQuery = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.6.1/node_modules/jquery/dist/jquery.min.js\");\r\nvar modal_1 = __webpack_require__(/*! ../common/modal */ \"./build/common/modal.js\");\r\nvar list_1 = __webpack_require__(/*! ../common/list */ \"./build/common/list.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ../common/loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar table_1 = __webpack_require__(/*! ../dashboard/table */ \"./build/dashboard/table.js\");\r\nvar cfg_1 = __webpack_require__(/*! ./cfg */ \"./build/auditLog/cfg.js\");\r\n/**\r\n * Audit Log\r\n */\r\nvar AuditLog = /** @class */ (function () {\r\n // Constructor\r\n function AuditLog(props) {\r\n // Configuration\r\n this._cfg = null;\r\n // List\r\n this._list = null;\r\n // Set the configuration\r\n this._cfg = cfg_1.Configuration;\r\n // Update the list name\r\n var listName = props.listName ? props.listName : this._cfg._configuration.ListCfg[0].ListInformation.Title;\r\n props.listName ? this._cfg._configuration.ListCfg[0].ListInformation.Title = listName : null;\r\n // Create the list component\r\n this._list = new list_1.List({\r\n listName: listName,\r\n webUrl: props.webUrl,\r\n onInitError: props.onInitError,\r\n onInitialized: props.onInitialized,\r\n itemQuery: {\r\n Filter: \"Id eq 0\"\r\n }\r\n });\r\n }\r\n Object.defineProperty(AuditLog.prototype, \"Configuration\", {\r\n get: function () { return this._cfg; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"AuditListName\", {\r\n get: function () {\r\n // Return the list name\r\n return this.Configuration._configuration.ListCfg[0].ListInformation.Title;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"List\", {\r\n get: function () { return this._list; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Gets data for an associated item\r\n AuditLog.prototype.getItems = function (itemId, onQuery) {\r\n // Set the odata query\r\n var odata = {\r\n Expand: [\"LogUser\"],\r\n Filter: \"ParentListName eq '\".concat(this.List.ListName, \"' and ParentItemId eq \").concat(itemId),\r\n OrderBy: [\"Created desc\"],\r\n Select: [\"*\", \"LogUser/EMail\", \"LogUser/Id\", \"LogUser/LoginName\", \"LogUser/Title\"]\r\n };\r\n // Call the event\r\n odata = onQuery ? onQuery(odata) : odata;\r\n // Get the list data\r\n return this.List.refresh(odata);\r\n };\r\n // Installs the list\r\n AuditLog.prototype.install = function () {\r\n // Installs the list\r\n return this.Configuration.install();\r\n };\r\n // Logs an item to the audit log\r\n AuditLog.prototype.logItem = function (values) {\r\n // Create the item\r\n return this.List.createItem(values);\r\n };\r\n // Removes the audit log list\r\n AuditLog.prototype.uninstall = function () {\r\n // Remove the audit log list\r\n return this.Configuration.uninstall();\r\n };\r\n // Method to view the audit log information for an item\r\n AuditLog.prototype.viewLog = function (itemId, onQuery) {\r\n // Display a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading Audit History\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the information is loaded...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Load the information\r\n this.getItems(itemId, onQuery).then(function (items) {\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Set the size\r\n modal_1.Modal.setType(gd_sprest_bs_1.Components.ModalTypes.Large);\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Audit History\");\r\n // Render the table\r\n new table_1.DataTable({\r\n el: modal_1.Modal.BodyElement,\r\n rows: items,\r\n dtProps: {\r\n dom: 'rt<\"row\"<\"col-sm-4\"l><\"col-sm-4\"i><\"col-sm-4\"p>>',\r\n columnDefs: [\r\n {\r\n \"targets\": 4,\r\n \"orderable\": false,\r\n \"searchable\": false\r\n }\r\n ],\r\n createdRow: function (row, data, index) {\r\n jQuery('td', row).addClass('align-middle');\r\n },\r\n drawCallback: function (settings) {\r\n var api = new jQuery.fn.dataTable.Api(settings);\r\n jQuery(api.context[0].nTable).removeClass('no-footer');\r\n jQuery(api.context[0].nTable).addClass('tbl-footer');\r\n jQuery(api.context[0].nTable).addClass('table-striped');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_info').addClass('text-center');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_length').addClass('pt-2');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_paginate').addClass('pt-03');\r\n },\r\n headerCallback: function (thead, data, start, end, display) {\r\n jQuery('th', thead).addClass('align-middle');\r\n },\r\n // Order by the 1st column by default; ascending\r\n order: [[0, \"desc\"]]\r\n },\r\n columns: [\r\n {\r\n name: \"Created\",\r\n title: \"Created\"\r\n },\r\n {\r\n name: \"Title\",\r\n title: \"Title\"\r\n },\r\n {\r\n name: \"\",\r\n title: \"User\",\r\n onRenderCell: function (el, col, item) {\r\n // Render the user information\r\n item.LogUser ? el.innerHTML = item.LogUser.Title : null;\r\n }\r\n },\r\n {\r\n name: \"LogComment\",\r\n title: \"Comment\"\r\n },\r\n {\r\n name: \"LogData\",\r\n title: \"Data\"\r\n }\r\n ]\r\n });\r\n // Hide the loading dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Show the modal\r\n modal_1.Modal.show();\r\n });\r\n };\r\n return AuditLog;\r\n}());\r\nexports.AuditLog = AuditLog;\r\n\n\n//# sourceURL=webpack://dattatable/./build/auditLog/index.js?");
31
31
 
32
32
  /***/ }),
33
33