dattatable 1.8.6 → 1.8.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 (41) hide show
  1. package/build/comments.d.ts +31 -0
  2. package/build/comments.js +293 -0
  3. package/build/index.d.ts +1 -0
  4. package/build/index.js +3 -0
  5. package/dist/dattatable.js +12 -1
  6. package/dist/dattatable.min.js +1 -1
  7. package/docs/assets/main.js +2 -2
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/CanvasForm.html +1 -1
  10. package/docs/classes/Comments.html +3 -0
  11. package/docs/classes/Dashboard.html +2 -2
  12. package/docs/classes/DataTable.html +2 -2
  13. package/docs/classes/Documents.html +5 -5
  14. package/docs/classes/FilterSlideout.html +1 -1
  15. package/docs/classes/Footer.html +1 -1
  16. package/docs/classes/Header.html +1 -1
  17. package/docs/classes/InstallationRequired.html +1 -1
  18. package/docs/classes/ItemForm.html +3 -3
  19. package/docs/classes/LoadingDialog.html +1 -1
  20. package/docs/classes/Modal.html +1 -1
  21. package/docs/classes/Navigation.html +1 -1
  22. package/docs/enums/ActionButtonTypes.html +1 -1
  23. package/docs/index.html +1 -1
  24. package/docs/interfaces/ICommentsItem.html +1 -0
  25. package/docs/interfaces/IDashboardProps.html +1 -1
  26. package/docs/interfaces/IDataTable.html +1 -1
  27. package/docs/interfaces/IDataTableProps.html +1 -1
  28. package/docs/interfaces/IDocumentsProps.html +1 -1
  29. package/docs/interfaces/IFilterItem.html +1 -1
  30. package/docs/interfaces/IFilterProps.html +1 -1
  31. package/docs/interfaces/IFooterProps.html +1 -1
  32. package/docs/interfaces/IHeaderProps.html +1 -1
  33. package/docs/interfaces/IItemFormCreateProps.html +1 -1
  34. package/docs/interfaces/IItemFormEditProps.html +1 -1
  35. package/docs/interfaces/IItemFormTab.html +1 -1
  36. package/docs/interfaces/IItemFormTabInfo.html +1 -1
  37. package/docs/interfaces/IItemFormViewProps.html +1 -1
  38. package/docs/interfaces/IShowDialogProps.html +1 -1
  39. package/docs/modules.html +1 -1
  40. package/package.json +5 -5
  41. package/pnpm-lock.yaml +371 -418
@@ -0,0 +1,31 @@
1
+ import { Helper } from "gd-sprest-bs";
2
+ export interface ICommentsItem {
3
+ AuthorId: number;
4
+ Author: {
5
+ Id: number;
6
+ EMail: string;
7
+ Title: string;
8
+ };
9
+ Comment: string;
10
+ Created: string;
11
+ Title: string;
12
+ }
13
+ /**
14
+ * Comments
15
+ */
16
+ export declare class Comments {
17
+ private static _listId;
18
+ private static _webUrl;
19
+ private static _commentsListId;
20
+ static get CommentsListId(): string;
21
+ static add(item: any, comment: string): PromiseLike<void>;
22
+ static configuration(cfg?: Helper.ISPConfig): Helper.ISPConfig;
23
+ static init(listName: string, webUrl?: string): PromiseLike<void>;
24
+ private static load;
25
+ static new(item: any): void;
26
+ static security(cfg: {
27
+ principalId: number;
28
+ roleDefId: number;
29
+ }[], webUrl?: string): PromiseLike<void>;
30
+ static view(item: any): void;
31
+ }
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Comments = void 0;
4
+ var gd_sprest_bs_1 = require("gd-sprest-bs");
5
+ var moment = require("moment");
6
+ var canvas_1 = require("./common/canvas");
7
+ var loadingDialog_1 = require("./common/loadingDialog");
8
+ var modal_1 = require("./common/modal");
9
+ // List Name
10
+ var LIST_NAME = "Comments";
11
+ /**
12
+ * Comments
13
+ */
14
+ var Comments = /** @class */ (function () {
15
+ function Comments() {
16
+ }
17
+ Object.defineProperty(Comments, "CommentsListId", {
18
+ get: function () { return this._commentsListId; },
19
+ enumerable: false,
20
+ configurable: true
21
+ });
22
+ // Adds a comment to an item
23
+ Comments.add = function (item, comment) {
24
+ var _this = this;
25
+ // Return a promise
26
+ return new Promise(function (resolve, reject) {
27
+ // Ensure a comment exists
28
+ if (comment) {
29
+ // Show a loading dialog
30
+ loadingDialog_1.LoadingDialog.setHeader("Adding Comment");
31
+ loadingDialog_1.LoadingDialog.setBody("This dialog will close after the comment is added.");
32
+ loadingDialog_1.LoadingDialog.show();
33
+ // Add the item
34
+ (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).Items().add({
35
+ Comment: comment,
36
+ Title: _this._listId + "|" + item.Id
37
+ }).execute(function () {
38
+ // Hide the loading dialog
39
+ loadingDialog_1.LoadingDialog.hide();
40
+ // Resolve the request
41
+ resolve();
42
+ }, reject);
43
+ }
44
+ else {
45
+ // Resolve the request
46
+ resolve();
47
+ }
48
+ });
49
+ };
50
+ // Configuration
51
+ Comments.configuration = function (cfg) {
52
+ var commentsCfg = gd_sprest_bs_1.Helper.SPConfig({
53
+ ListCfg: [
54
+ {
55
+ ListInformation: {
56
+ Title: LIST_NAME,
57
+ BaseTemplate: gd_sprest_bs_1.SPTypes.ListTemplateType.GenericList,
58
+ Hidden: true,
59
+ NoCrawl: true
60
+ },
61
+ TitleFieldDisplayName: "Comment ID",
62
+ TitleFieldIndexed: true,
63
+ CustomFields: [
64
+ {
65
+ name: "Comment",
66
+ title: "Comment",
67
+ type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,
68
+ noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly
69
+ }
70
+ ],
71
+ ViewInformation: [
72
+ {
73
+ ViewName: "All Items",
74
+ ViewQuery: "Author eq [Me]",
75
+ ViewFields: ["LinkTitle", "Comment", "Author", "Created"]
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ });
81
+ // Append the comments to the configuration if it exists
82
+ if (cfg && cfg._configuration.ListCfg && cfg._configuration.ListCfg.length > 0) {
83
+ // Append the list configuration
84
+ cfg._configuration.ListCfg = cfg._configuration.ListCfg.concat(commentsCfg._configuration.ListCfg);
85
+ }
86
+ // Return the configuration
87
+ return cfg || commentsCfg;
88
+ };
89
+ // Initialization of the component
90
+ Comments.init = function (listName, webUrl) {
91
+ var _this = this;
92
+ // Save the web url
93
+ this._webUrl = webUrl;
94
+ // Return a promise
95
+ return new Promise(function (resolve, reject) {
96
+ // Load the list id
97
+ (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).query({
98
+ Select: ["Id"]
99
+ }).execute(function (list) {
100
+ // Set the list id
101
+ _this._commentsListId = list.Id;
102
+ }, reject);
103
+ // Load the List Information
104
+ (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(listName).execute(function (list) {
105
+ // Set the list id
106
+ _this._listId = list.Id;
107
+ // Resolve the request
108
+ resolve();
109
+ }, reject);
110
+ });
111
+ };
112
+ // Loads the comments for the item
113
+ Comments.load = function (item) {
114
+ var _this = this;
115
+ // Return a promise
116
+ return new Promise(function (resolve, reject) {
117
+ // Ensure a list id exists
118
+ if (_this._listId) {
119
+ // Load the comments for this item
120
+ (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).Items().query({
121
+ Expand: ["Author"],
122
+ Filter: "Title eq '" + _this._listId + "|" + item.Id + "'",
123
+ OrderBy: ["Created desc"],
124
+ Select: ["Id", "Comment", "Created", "Title", "Author/Id", "Author/EMail", "Author/Title"]
125
+ }).execute(function (items) {
126
+ // Resolve the request
127
+ resolve(items.results);
128
+ }, reject);
129
+ }
130
+ else {
131
+ // Reject the request
132
+ reject("The target list doesn't exist. Please initialize the component before using it.");
133
+ }
134
+ });
135
+ };
136
+ // Displays the new comment form
137
+ Comments.new = function (item) {
138
+ var _this = this;
139
+ // Clear the modal dialog
140
+ modal_1.Modal.clear();
141
+ // Hide the close button
142
+ modal_1.Modal.setCloseButtonVisibility(false);
143
+ // Set the header
144
+ modal_1.Modal.setHeader("Add Comment");
145
+ // Create the form
146
+ var form = gd_sprest_bs_1.Components.Form({
147
+ el: modal_1.Modal.BodyElement,
148
+ controls: [{
149
+ name: "comment",
150
+ label: "Comment",
151
+ type: gd_sprest_bs_1.Components.FormControlTypes.TextArea,
152
+ rows: 10,
153
+ required: true,
154
+ errorMessage: "A value is required"
155
+ }]
156
+ });
157
+ // Set the footer
158
+ gd_sprest_bs_1.Components.TooltipGroup({
159
+ el: modal_1.Modal.FooterElement,
160
+ tooltips: [
161
+ {
162
+ content: "Click to add a comment to the request.",
163
+ btnProps: {
164
+ text: "Add",
165
+ type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,
166
+ onClick: function () {
167
+ // Ensure the form is valid
168
+ if (form.isValid()) {
169
+ // Hide the modal
170
+ modal_1.Modal.hide();
171
+ // Add the comment
172
+ _this.add(item, form.getValues()["comment"]).then(function () {
173
+ // View the comments
174
+ _this.view(item);
175
+ });
176
+ }
177
+ }
178
+ }
179
+ },
180
+ {
181
+ content: "Closes this dialog and views the comments",
182
+ btnProps: {
183
+ text: "Close",
184
+ type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,
185
+ onClick: function () {
186
+ // Hide the modal
187
+ modal_1.Modal.hide();
188
+ // Show the canvas form
189
+ canvas_1.CanvasForm.show();
190
+ }
191
+ }
192
+ }
193
+ ]
194
+ });
195
+ // Show the form
196
+ modal_1.Modal.show();
197
+ };
198
+ // Security configuration
199
+ Comments.security = function (cfg, webUrl) {
200
+ // Resets the list permissions
201
+ var resetPermissions = function () {
202
+ return new Promise(function (resolve) {
203
+ var list = (0, gd_sprest_bs_1.Web)(webUrl).Lists(LIST_NAME);
204
+ // Reset the inheritance
205
+ list.resetRoleInheritance().execute();
206
+ // Clear the permissions
207
+ list.breakRoleInheritance(false, true).execute(resolve, true);
208
+ });
209
+ };
210
+ // Return a promise
211
+ return new Promise(function (resolve) {
212
+ var list = (0, gd_sprest_bs_1.Web)(webUrl).Lists(LIST_NAME);
213
+ // Ensure a configuration exists
214
+ if (cfg && cfg.length > 0) {
215
+ // Reset the list permissions
216
+ resetPermissions().then(function () {
217
+ var _loop_1 = function (i) {
218
+ var principalId = cfg[i].principalId;
219
+ var roleDefId = cfg[i].roleDefId;
220
+ // Update the list settings
221
+ list.RoleAssignments().addRoleAssignment(principalId, roleDefId).execute(function () {
222
+ // Log
223
+ console.log("[Comments List] The user/group (" + principalId + ") was added successfully.");
224
+ });
225
+ };
226
+ // Parse the configuration
227
+ for (var i = 0; i < cfg.length; i++) {
228
+ _loop_1(i);
229
+ }
230
+ // Wait for the requests to complete
231
+ list.done(resolve);
232
+ });
233
+ }
234
+ else {
235
+ // Resolve the request
236
+ resolve();
237
+ }
238
+ });
239
+ };
240
+ // Displays the comments in a canvas form
241
+ Comments.view = function (item) {
242
+ var _this = this;
243
+ // Display a loading dialog
244
+ loadingDialog_1.LoadingDialog.setHeader("Loading Comments");
245
+ loadingDialog_1.LoadingDialog.setBody("This dialog will close after the comments are loaded.");
246
+ loadingDialog_1.LoadingDialog.show();
247
+ // Load the items
248
+ this.load(item).then(function (comments) {
249
+ // Clear the form
250
+ canvas_1.CanvasForm.clear();
251
+ // Set the header
252
+ canvas_1.CanvasForm.setHeader("<h5>Comments</h5>");
253
+ // Render a nav
254
+ gd_sprest_bs_1.Components.Navbar({
255
+ el: canvas_1.CanvasForm.BodyElement,
256
+ itemsEnd: [{
257
+ text: "+ Add Comment",
258
+ onClick: function () {
259
+ // Hide the form
260
+ canvas_1.CanvasForm.hide();
261
+ // Display a modal to add the comment
262
+ _this.new(item);
263
+ }
264
+ }]
265
+ });
266
+ // Parse the comments
267
+ for (var i = 0; i < comments.length; i++) {
268
+ var comment = comments[i];
269
+ // Render a toast
270
+ gd_sprest_bs_1.Components.Toast({
271
+ el: canvas_1.CanvasForm.BodyElement,
272
+ headerText: comment.Author.Title,
273
+ mutedText: moment(new Date(comment.Created)).toString(),
274
+ body: (comment.Comment || "").replace(/\r?\n/g, '<br />'),
275
+ options: {
276
+ animation: true,
277
+ autohide: false
278
+ }
279
+ });
280
+ }
281
+ // Hide the dialog
282
+ loadingDialog_1.LoadingDialog.hide();
283
+ // Show the canvas form
284
+ canvas_1.CanvasForm.show();
285
+ });
286
+ };
287
+ Comments._listId = null;
288
+ Comments._webUrl = null;
289
+ // Comment's List Id
290
+ Comments._commentsListId = null;
291
+ return Comments;
292
+ }());
293
+ exports.Comments = Comments;
package/build/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./common";
2
+ export * from "./comments";
2
3
  export * from "./dashboard";
3
4
  export * from "./documents";
4
5
  export * from "./itemForm";
package/build/index.js CHANGED
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var Common = require("./common");
18
18
  __exportStar(require("./common"), exports);
19
+ var comments_1 = require("./comments");
20
+ __exportStar(require("./comments"), exports);
19
21
  var dashboard_1 = require("./dashboard");
20
22
  __exportStar(require("./dashboard"), exports);
21
23
  var documents_1 = require("./documents");
@@ -28,6 +30,7 @@ require("./styles");
28
30
  window["DattaTable"] = {
29
31
  ActionButtonTypes: documents_1.ActionButtonTypes,
30
32
  Common: Common,
33
+ Comments: comments_1.Comments,
31
34
  Dashboard: dashboard_1.Dashboard,
32
35
  Documents: documents_1.Documents,
33
36
  ItemForm: itemForm_1.ItemForm
@@ -9,6 +9,17 @@
9
9
  /******/ (() => { // webpackBootstrap
10
10
  /******/ var __webpack_modules__ = ({
11
11
 
12
+ /***/ "./build/comments.js":
13
+ /*!***************************!*\
14
+ !*** ./build/comments.js ***!
15
+ \***************************/
16
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
17
+
18
+ "use strict";
19
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Comments = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@9.6.0/node_modules/gd-sprest-bs/build/index.js\");\r\nvar moment = __webpack_require__(/*! moment */ \"./node_modules/.pnpm/moment@2.29.3/node_modules/moment/moment.js\");\r\nvar canvas_1 = __webpack_require__(/*! ./common/canvas */ \"./build/common/canvas.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./common/loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./common/modal */ \"./build/common/modal.js\");\r\n// List Name\r\nvar LIST_NAME = \"Comments\";\r\n/**\r\n * Comments\r\n */\r\nvar Comments = /** @class */ (function () {\r\n function Comments() {\r\n }\r\n Object.defineProperty(Comments, \"CommentsListId\", {\r\n get: function () { return this._commentsListId; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Adds a comment to an item\r\n Comments.add = function (item, comment) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Ensure a comment exists\r\n if (comment) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Adding Comment\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This dialog will close after the comment is added.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Add the item\r\n (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).Items().add({\r\n Comment: comment,\r\n Title: _this._listId + \"|\" + item.Id\r\n }).execute(function () {\r\n // Hide the loading dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Resolve the request\r\n resolve();\r\n }, reject);\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Configuration\r\n Comments.configuration = function (cfg) {\r\n var commentsCfg = gd_sprest_bs_1.Helper.SPConfig({\r\n ListCfg: [\r\n {\r\n ListInformation: {\r\n Title: LIST_NAME,\r\n BaseTemplate: gd_sprest_bs_1.SPTypes.ListTemplateType.GenericList,\r\n Hidden: true,\r\n NoCrawl: true\r\n },\r\n TitleFieldDisplayName: \"Comment ID\",\r\n TitleFieldIndexed: true,\r\n CustomFields: [\r\n {\r\n name: \"Comment\",\r\n title: \"Comment\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,\r\n noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly\r\n }\r\n ],\r\n ViewInformation: [\r\n {\r\n ViewName: \"All Items\",\r\n ViewQuery: \"Author eq [Me]\",\r\n ViewFields: [\"LinkTitle\", \"Comment\", \"Author\", \"Created\"]\r\n }\r\n ]\r\n }\r\n ]\r\n });\r\n // Append the comments to the configuration if it exists\r\n if (cfg && cfg._configuration.ListCfg && cfg._configuration.ListCfg.length > 0) {\r\n // Append the list configuration\r\n cfg._configuration.ListCfg = cfg._configuration.ListCfg.concat(commentsCfg._configuration.ListCfg);\r\n }\r\n // Return the configuration\r\n return cfg || commentsCfg;\r\n };\r\n // Initialization of the component\r\n Comments.init = function (listName, webUrl) {\r\n var _this = this;\r\n // Save the web url\r\n this._webUrl = webUrl;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Load the list id\r\n (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).query({\r\n Select: [\"Id\"]\r\n }).execute(function (list) {\r\n // Set the list id\r\n _this._commentsListId = list.Id;\r\n }, reject);\r\n // Load the List Information\r\n (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(listName).execute(function (list) {\r\n // Set the list id\r\n _this._listId = list.Id;\r\n // Resolve the request\r\n resolve();\r\n }, reject);\r\n });\r\n };\r\n // Loads the comments for the item\r\n Comments.load = function (item) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Ensure a list id exists\r\n if (_this._listId) {\r\n // Load the comments for this item\r\n (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(LIST_NAME).Items().query({\r\n Expand: [\"Author\"],\r\n Filter: \"Title eq '\" + _this._listId + \"|\" + item.Id + \"'\",\r\n OrderBy: [\"Created desc\"],\r\n Select: [\"Id\", \"Comment\", \"Created\", \"Title\", \"Author/Id\", \"Author/EMail\", \"Author/Title\"]\r\n }).execute(function (items) {\r\n // Resolve the request\r\n resolve(items.results);\r\n }, reject);\r\n }\r\n else {\r\n // Reject the request\r\n reject(\"The target list doesn't exist. Please initialize the component before using it.\");\r\n }\r\n });\r\n };\r\n // Displays the new comment form\r\n Comments.new = function (item) {\r\n var _this = this;\r\n // Clear the modal dialog\r\n modal_1.Modal.clear();\r\n // Hide the close button\r\n modal_1.Modal.setCloseButtonVisibility(false);\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Add Comment\");\r\n // Create the form\r\n var form = gd_sprest_bs_1.Components.Form({\r\n el: modal_1.Modal.BodyElement,\r\n controls: [{\r\n name: \"comment\",\r\n label: \"Comment\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.TextArea,\r\n rows: 10,\r\n required: true,\r\n errorMessage: \"A value is required\"\r\n }]\r\n });\r\n // Set the footer\r\n gd_sprest_bs_1.Components.TooltipGroup({\r\n el: modal_1.Modal.FooterElement,\r\n tooltips: [\r\n {\r\n content: \"Click to add a comment to the request.\",\r\n btnProps: {\r\n text: \"Add\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,\r\n onClick: function () {\r\n // Ensure the form is valid\r\n if (form.isValid()) {\r\n // Hide the modal\r\n modal_1.Modal.hide();\r\n // Add the comment\r\n _this.add(item, form.getValues()[\"comment\"]).then(function () {\r\n // View the comments\r\n _this.view(item);\r\n });\r\n }\r\n }\r\n }\r\n },\r\n {\r\n content: \"Closes this dialog and views the comments\",\r\n btnProps: {\r\n text: \"Close\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,\r\n onClick: function () {\r\n // Hide the modal\r\n modal_1.Modal.hide();\r\n // Show the canvas form\r\n canvas_1.CanvasForm.show();\r\n }\r\n }\r\n }\r\n ]\r\n });\r\n // Show the form\r\n modal_1.Modal.show();\r\n };\r\n // Security configuration\r\n Comments.security = function (cfg, webUrl) {\r\n // Resets the list permissions\r\n var resetPermissions = function () {\r\n return new Promise(function (resolve) {\r\n var list = (0, gd_sprest_bs_1.Web)(webUrl).Lists(LIST_NAME);\r\n // Reset the inheritance\r\n list.resetRoleInheritance().execute();\r\n // Clear the permissions\r\n list.breakRoleInheritance(false, true).execute(resolve, true);\r\n });\r\n };\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n var list = (0, gd_sprest_bs_1.Web)(webUrl).Lists(LIST_NAME);\r\n // Ensure a configuration exists\r\n if (cfg && cfg.length > 0) {\r\n // Reset the list permissions\r\n resetPermissions().then(function () {\r\n var _loop_1 = function (i) {\r\n var principalId = cfg[i].principalId;\r\n var roleDefId = cfg[i].roleDefId;\r\n // Update the list settings\r\n list.RoleAssignments().addRoleAssignment(principalId, roleDefId).execute(function () {\r\n // Log\r\n console.log(\"[Comments List] The user/group (\" + principalId + \") was added successfully.\");\r\n });\r\n };\r\n // Parse the configuration\r\n for (var i = 0; i < cfg.length; i++) {\r\n _loop_1(i);\r\n }\r\n // Wait for the requests to complete\r\n list.done(resolve);\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Displays the comments in a canvas form\r\n Comments.view = function (item) {\r\n var _this = this;\r\n // Display a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading Comments\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This dialog will close after the comments are loaded.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Load the items\r\n this.load(item).then(function (comments) {\r\n // Clear the form\r\n canvas_1.CanvasForm.clear();\r\n // Set the header\r\n canvas_1.CanvasForm.setHeader(\"<h5>Comments</h5>\");\r\n // Render a nav\r\n gd_sprest_bs_1.Components.Navbar({\r\n el: canvas_1.CanvasForm.BodyElement,\r\n itemsEnd: [{\r\n text: \"+ Add Comment\",\r\n onClick: function () {\r\n // Hide the form\r\n canvas_1.CanvasForm.hide();\r\n // Display a modal to add the comment\r\n _this.new(item);\r\n }\r\n }]\r\n });\r\n // Parse the comments\r\n for (var i = 0; i < comments.length; i++) {\r\n var comment = comments[i];\r\n // Render a toast\r\n gd_sprest_bs_1.Components.Toast({\r\n el: canvas_1.CanvasForm.BodyElement,\r\n headerText: comment.Author.Title,\r\n mutedText: moment(new Date(comment.Created)).toString(),\r\n body: (comment.Comment || \"\").replace(/\\r?\\n/g, '<br />'),\r\n options: {\r\n animation: true,\r\n autohide: false\r\n }\r\n });\r\n }\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Show the canvas form\r\n canvas_1.CanvasForm.show();\r\n });\r\n };\r\n Comments._listId = null;\r\n Comments._webUrl = null;\r\n // Comment's List Id\r\n Comments._commentsListId = null;\r\n return Comments;\r\n}());\r\nexports.Comments = Comments;\r\n\n\n//# sourceURL=webpack://dattatable/./build/comments.js?");
20
+
21
+ /***/ }),
22
+
12
23
  /***/ "./build/common/canvas.js":
13
24
  /*!********************************!*\
14
25
  !*** ./build/common/canvas.js ***!
@@ -159,7 +170,7 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
159
170
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
160
171
 
161
172
  "use strict";
162
- eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nvar Common = __webpack_require__(/*! ./common */ \"./build/common/index.js\");\r\n__exportStar(__webpack_require__(/*! ./common */ \"./build/common/index.js\"), exports);\r\nvar dashboard_1 = __webpack_require__(/*! ./dashboard */ \"./build/dashboard/index.js\");\r\n__exportStar(__webpack_require__(/*! ./dashboard */ \"./build/dashboard/index.js\"), exports);\r\nvar documents_1 = __webpack_require__(/*! ./documents */ \"./build/documents.js\");\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/documents.js\"), exports);\r\nvar itemForm_1 = __webpack_require__(/*! ./itemForm */ \"./build/itemForm.js\");\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/itemForm.js\"), exports);\r\n/** Styling */\r\n__webpack_require__(/*! ./styles */ \"./build/styles.js\");\r\n/** Global Variable */\r\nwindow[\"DattaTable\"] = {\r\n ActionButtonTypes: documents_1.ActionButtonTypes,\r\n Common: Common,\r\n Dashboard: dashboard_1.Dashboard,\r\n Documents: documents_1.Documents,\r\n ItemForm: itemForm_1.ItemForm\r\n};\r\n\n\n//# sourceURL=webpack://dattatable/./build/index.js?");
173
+ eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nvar Common = __webpack_require__(/*! ./common */ \"./build/common/index.js\");\r\n__exportStar(__webpack_require__(/*! ./common */ \"./build/common/index.js\"), exports);\r\nvar comments_1 = __webpack_require__(/*! ./comments */ \"./build/comments.js\");\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/comments.js\"), exports);\r\nvar dashboard_1 = __webpack_require__(/*! ./dashboard */ \"./build/dashboard/index.js\");\r\n__exportStar(__webpack_require__(/*! ./dashboard */ \"./build/dashboard/index.js\"), exports);\r\nvar documents_1 = __webpack_require__(/*! ./documents */ \"./build/documents.js\");\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/documents.js\"), exports);\r\nvar itemForm_1 = __webpack_require__(/*! ./itemForm */ \"./build/itemForm.js\");\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/itemForm.js\"), exports);\r\n/** Styling */\r\n__webpack_require__(/*! ./styles */ \"./build/styles.js\");\r\n/** Global Variable */\r\nwindow[\"DattaTable\"] = {\r\n ActionButtonTypes: documents_1.ActionButtonTypes,\r\n Common: Common,\r\n Comments: comments_1.Comments,\r\n Dashboard: dashboard_1.Dashboard,\r\n Documents: documents_1.Documents,\r\n ItemForm: itemForm_1.ItemForm\r\n};\r\n\n\n//# sourceURL=webpack://dattatable/./build/index.js?");
163
174
 
164
175
  /***/ }),
165
176