dattatable 2.9.32 → 2.9.33

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 (65) hide show
  1. package/build/common/itemForm.d.ts +1 -0
  2. package/build/common/itemForm.js +27 -20
  3. package/build/common/list.d.ts +1 -2
  4. package/build/common/list.js +17 -33
  5. package/build/common/listSecurity.d.ts +0 -1
  6. package/build/common/listSecurity.js +4 -22
  7. package/build/common/methods.d.ts +1 -0
  8. package/build/common/methods.js +21 -1
  9. package/build/lib.d.ts +1 -0
  10. package/dist/dattatable.js +707 -707
  11. package/dist/dattatable.min.js +1 -1
  12. package/docs/assets/navigation.js +1 -1
  13. package/docs/assets/search.js +1 -1
  14. package/docs/classes/AuditLog.html +2 -2
  15. package/docs/classes/CanvasForm.html +2 -2
  16. package/docs/classes/Comments.html +2 -2
  17. package/docs/classes/Dashboard.html +4 -4
  18. package/docs/classes/DataTable.html +3 -3
  19. package/docs/classes/Documents.html +6 -6
  20. package/docs/classes/FilterSlideout.html +2 -2
  21. package/docs/classes/Footer.html +2 -2
  22. package/docs/classes/Header.html +2 -2
  23. package/docs/classes/InstallationRequired.html +2 -2
  24. package/docs/classes/ItemForm.html +5 -4
  25. package/docs/classes/List.html +4 -5
  26. package/docs/classes/ListSecurity.html +2 -3
  27. package/docs/classes/LoadingDialog.html +2 -2
  28. package/docs/classes/Modal.html +2 -2
  29. package/docs/classes/Navigation.html +3 -3
  30. package/docs/classes/Timeout.html +2 -2
  31. package/docs/enums/ActionButtonTypes.html +2 -2
  32. package/docs/functions/formatBytes.html +1 -1
  33. package/docs/functions/formatDateValue.html +1 -1
  34. package/docs/functions/formatTimeValue.html +1 -1
  35. package/docs/functions/getContextInfo.html +1 -0
  36. package/docs/functions/getFileExt.html +1 -1
  37. package/docs/functions/waitForTheme.html +1 -1
  38. package/docs/interfaces/IAuditLogItem.html +2 -2
  39. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  40. package/docs/interfaces/IAuditLogProps.html +2 -2
  41. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  42. package/docs/interfaces/ICommentsItem.html +2 -2
  43. package/docs/interfaces/IDashboardProps.html +2 -2
  44. package/docs/interfaces/IDataTable.html +2 -2
  45. package/docs/interfaces/IDataTableProps.html +2 -2
  46. package/docs/interfaces/IDocumentsProps.html +2 -2
  47. package/docs/interfaces/IFilterItem.html +2 -2
  48. package/docs/interfaces/IFilterProps.html +2 -2
  49. package/docs/interfaces/IFooterProps.html +2 -2
  50. package/docs/interfaces/IHeaderProps.html +2 -2
  51. package/docs/interfaces/IInstallProps.html +2 -2
  52. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  53. package/docs/interfaces/IItemFormEditProps.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/IListProps.html +2 -2
  58. package/docs/interfaces/IListSecurity.html +2 -2
  59. package/docs/interfaces/IListSecurityItem.html +2 -2
  60. package/docs/interfaces/IShowDialogProps.html +2 -2
  61. package/docs/modules.html +1 -0
  62. package/docs/variables/DattaTable.html +1 -1
  63. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  64. package/package.json +2 -2
  65. package/pnpm-lock.yaml +10 -10
@@ -76,6 +76,7 @@ export declare class ItemForm {
76
76
  private static _onShowForm?;
77
77
  private static _onSave;
78
78
  private static _onValidation;
79
+ private static _requestDigest;
79
80
  private static _tabInfo;
80
81
  private static _updateEvent;
81
82
  static set AutoClose(value: boolean);
@@ -185,28 +185,34 @@ var ItemForm = /** @class */ (function () {
185
185
  // Resolve the request
186
186
  resolve(null);
187
187
  };
188
- // See if the info already exists
189
- if (_this._info) {
190
- // Form information is already loaded
191
- onComplete();
192
- }
193
- else {
194
- // Set the list form properties
195
- var listProps = {
196
- listName: _this.ListName,
197
- itemId: itemId,
198
- webUrl: webUrl
199
- };
200
- // Call the event
201
- listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
202
- // Load the form info
203
- gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
204
- // Save the information
205
- _this._info = info;
188
+ // Get the context information
189
+ (0, _1.getContextInfo)(webUrl).then(function (requestDigest) {
190
+ // Set the request digest
191
+ _this._requestDigest = requestDigest;
192
+ // See if the info already exists
193
+ if (_this._info) {
206
194
  // Form information is already loaded
207
195
  onComplete();
208
- }, reject);
209
- }
196
+ }
197
+ else {
198
+ // Set the list form properties
199
+ var listProps = {
200
+ listName: _this.ListName,
201
+ itemId: itemId,
202
+ requestDigest: requestDigest,
203
+ webUrl: webUrl
204
+ };
205
+ // Call the event
206
+ listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
207
+ // Load the form info
208
+ gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
209
+ // Save the information
210
+ _this._info = info;
211
+ // Form information is already loaded
212
+ onComplete();
213
+ }, reject);
214
+ }
215
+ });
210
216
  });
211
217
  };
212
218
  // Renders the display form
@@ -516,6 +522,7 @@ var ItemForm = /** @class */ (function () {
516
522
  ItemForm._onShowForm = null;
517
523
  ItemForm._onSave = null;
518
524
  ItemForm._onValidation = null;
525
+ ItemForm._requestDigest = null;
519
526
  ItemForm._tabInfo = null;
520
527
  ItemForm._updateEvent = null;
521
528
  // Display Form
@@ -1,5 +1,5 @@
1
1
  import { Types } from "gd-sprest-bs";
2
- import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from "../common";
2
+ import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from ".";
3
3
  /** List Properties */
4
4
  export interface IListProps<T = Types.SP.ListItem> {
5
5
  itemQuery?: Types.IODataQuery;
@@ -55,7 +55,6 @@ export declare class List<T = Types.SP.ListItem> {
55
55
  constructor(props: IListProps<T>);
56
56
  private clear;
57
57
  createItem(values: any): PromiseLike<T>;
58
- private getContextInfo;
59
58
  newForm(props: IItemFormCreateProps): void;
60
59
  editForm(props: IItemFormEditProps): void;
61
60
  private init;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.List = void 0;
4
4
  var gd_sprest_bs_1 = require("gd-sprest-bs");
5
- var common_1 = require("../common");
5
+ var _1 = require(".");
6
6
  /**
7
7
  * List
8
8
  */
@@ -59,7 +59,8 @@ var List = /** @class */ (function () {
59
59
  this._viewName = props.viewName;
60
60
  this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;
61
61
  // Set the context information
62
- this.getContextInfo(props.webUrl).then(function () {
62
+ (0, _1.getContextInfo)(props.webUrl).then(function (requestDigest) {
63
+ _this._requestDigest = requestDigest;
63
64
  // Load the list information
64
65
  _this.init().then(function () {
65
66
  // Load the items
@@ -96,13 +97,13 @@ var List = /** @class */ (function () {
96
97
  Object.defineProperty(List.prototype, "EditForm", {
97
98
  /** Public Properties */
98
99
  // Reference to the edit form
99
- get: function () { return common_1.ItemForm.EditForm; },
100
+ get: function () { return _1.ItemForm.EditForm; },
100
101
  enumerable: false,
101
102
  configurable: true
102
103
  });
103
104
  Object.defineProperty(List.prototype, "EditForms", {
104
105
  // Reference to the edit forms, if tabs are used
105
- get: function () { return common_1.ItemForm.EditForms; },
106
+ get: function () { return _1.ItemForm.EditForms; },
106
107
  enumerable: false,
107
108
  configurable: true
108
109
  });
@@ -148,13 +149,13 @@ var List = /** @class */ (function () {
148
149
  });
149
150
  Object.defineProperty(List.prototype, "ViewForm", {
150
151
  // Reference to the display form
151
- get: function () { return common_1.ItemForm.DisplayForm; },
152
+ get: function () { return _1.ItemForm.DisplayForm; },
152
153
  enumerable: false,
153
154
  configurable: true
154
155
  });
155
156
  Object.defineProperty(List.prototype, "ViewForms", {
156
157
  // Reference to the display forms, if tabs are used
157
- get: function () { return common_1.ItemForm.DisplayForms; },
158
+ get: function () { return _1.ItemForm.DisplayForms; },
158
159
  enumerable: false,
159
160
  configurable: true
160
161
  });
@@ -176,9 +177,9 @@ var List = /** @class */ (function () {
176
177
  // Clears the modal or canvas
177
178
  List.prototype.clear = function () {
178
179
  // Clear the modal/form
179
- common_1.ItemForm.UseModal ? common_1.Modal.clear() : common_1.CanvasForm.clear();
180
+ _1.ItemForm.UseModal ? _1.Modal.clear() : _1.CanvasForm.clear();
180
181
  // Set the list name
181
- common_1.ItemForm.ListName = this.ListName;
182
+ _1.ItemForm.ListName = this.ListName;
182
183
  // Call the event
183
184
  this._onResetForm ? this._onResetForm() : null;
184
185
  };
@@ -191,40 +192,19 @@ var List = /** @class */ (function () {
191
192
  _this.ListInfo.Items().add(values).execute(resolve, reject);
192
193
  });
193
194
  };
194
- // Gets the context information of the target site
195
- List.prototype.getContextInfo = function (webUrl) {
196
- var _this = this;
197
- // Return a promise
198
- return new Promise(function (resolve, reject) {
199
- // See if the web url exists
200
- if (webUrl) {
201
- // Get the context info of the site
202
- gd_sprest_bs_1.ContextInfo.getWeb(webUrl).execute(function (info) {
203
- // Set the context info
204
- _this._requestDigest = info.GetContextWebInformation.FormDigestValue;
205
- // Resolve the request
206
- resolve();
207
- }, reject);
208
- }
209
- else {
210
- // Resolve the request
211
- resolve();
212
- }
213
- });
214
- };
215
195
  // Displays the new form
216
196
  List.prototype.newForm = function (props) {
217
197
  // Clear the modal/canvas
218
198
  this.clear();
219
199
  // Display the form
220
- common_1.ItemForm.create(props).then(null, this._onLoadFormError);
200
+ _1.ItemForm.create(props).then(null, this._onLoadFormError);
221
201
  };
222
202
  // Displays the edit form
223
203
  List.prototype.editForm = function (props) {
224
204
  // Clear the modal/canvas
225
205
  this.clear();
226
206
  // Display the form
227
- common_1.ItemForm.edit(props).then(null, this._onLoadFormError);
207
+ _1.ItemForm.edit(props).then(null, this._onLoadFormError);
228
208
  };
229
209
  // Initializes the list component
230
210
  List.prototype.init = function () {
@@ -427,7 +407,11 @@ var List = /** @class */ (function () {
427
407
  // See if the request digest is set
428
408
  if (_this._requestDigest) {
429
409
  // Get the context information
430
- _this.getContextInfo(_this.WebUrl).then(resolve, reject);
410
+ (0, _1.getContextInfo)(_this.WebUrl).then(function (requestDigest) {
411
+ // Save the value and resolve the request
412
+ _this._requestDigest = requestDigest;
413
+ resolve();
414
+ }, reject);
431
415
  }
432
416
  else {
433
417
  // Resolve the request
@@ -455,7 +439,7 @@ var List = /** @class */ (function () {
455
439
  // Clear the modal/canvas
456
440
  this.clear();
457
441
  // Display the form
458
- common_1.ItemForm.view(props).then(null, this._onLoadFormError);
442
+ _1.ItemForm.view(props).then(null, this._onLoadFormError);
459
443
  };
460
444
  return List;
461
445
  }());
@@ -42,7 +42,6 @@ export declare class ListSecurity {
42
42
  private configureList;
43
43
  private configureLists;
44
44
  private createGroups;
45
- private getContextInfo;
46
45
  private getGroupId;
47
46
  private getPermissionTypes;
48
47
  isInGroup(userId: number, groupName: string): boolean;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListSecurity = exports.ListSecurityDefaultGroups = void 0;
4
4
  var gd_sprest_bs_1 = require("gd-sprest-bs");
5
5
  var loadingDialog_1 = require("./loadingDialog");
6
+ var methods_1 = require("./methods");
6
7
  var modal_1 = require("./modal");
7
8
  // List Security Default Groups
8
9
  exports.ListSecurityDefaultGroups = {
@@ -31,7 +32,9 @@ var ListSecurity = /** @class */ (function () {
31
32
  // Save the properties
32
33
  this._props = props;
33
34
  // Get the context information
34
- this.getContextInfo(this._props.webUrl).then(function () {
35
+ (0, methods_1.getContextInfo)(this._props.webUrl).then(function (requestDigest) {
36
+ // Set the request digest value
37
+ _this._requestDigest = requestDigest;
35
38
  // Get the current user information
36
39
  _this.loadCurrentUser();
37
40
  // Get the permission types
@@ -218,27 +221,6 @@ var ListSecurity = /** @class */ (function () {
218
221
  }).then(resolve, reject);
219
222
  });
220
223
  };
221
- // Gets the context information of the target site
222
- ListSecurity.prototype.getContextInfo = function (webUrl) {
223
- var _this = this;
224
- // Return a promise
225
- return new Promise(function (resolve, reject) {
226
- // See if the web url exists
227
- if (webUrl) {
228
- // Get the context info of the site
229
- gd_sprest_bs_1.ContextInfo.getWeb(webUrl).execute(function (info) {
230
- // Set the context info
231
- _this._requestDigest = info.GetContextWebInformation.FormDigestValue;
232
- // Resolve the request
233
- resolve();
234
- }, reject);
235
- }
236
- else {
237
- // Resolve the request
238
- resolve();
239
- }
240
- });
241
- };
242
224
  // Gets the group id
243
225
  ListSecurity.prototype.getGroupId = function (groupName) {
244
226
  var _this = this;
@@ -1,4 +1,5 @@
1
1
  export declare const formatBytes: (bytes: number, decimals?: number) => string;
2
2
  export declare const formatDateValue: (value: string, format?: string) => string;
3
3
  export declare const formatTimeValue: (value: string, format?: string) => string;
4
+ export declare const getContextInfo: (webUrl: string) => PromiseLike<string>;
4
5
  export declare const getFileExt: (fileName?: string) => string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFileExt = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
3
+ exports.getFileExt = exports.getContextInfo = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
4
+ var gd_sprest_bs_1 = require("gd-sprest-bs");
4
5
  var moment = require("moment");
5
6
  // Formats file size into human readable form
6
7
  var formatBytes = function (bytes, decimals) {
@@ -39,6 +40,25 @@ var formatTimeValue = function (value, format) {
39
40
  return "";
40
41
  };
41
42
  exports.formatTimeValue = formatTimeValue;
43
+ // Gets the context information of the target site
44
+ var getContextInfo = function (webUrl) {
45
+ // Return a promise
46
+ return new Promise(function (resolve, reject) {
47
+ // See if the web url exists
48
+ if (webUrl) {
49
+ // Get the context info of the site
50
+ gd_sprest_bs_1.ContextInfo.getWeb(webUrl).execute(function (info) {
51
+ // Resolve the request
52
+ resolve(info.GetContextWebInformation.FormDigestValue);
53
+ }, reject);
54
+ }
55
+ else {
56
+ // Resolve the request
57
+ resolve(null);
58
+ }
59
+ });
60
+ };
61
+ exports.getContextInfo = getContextInfo;
42
62
  // Returns the extension of a file name
43
63
  var getFileExt = function (fileName) {
44
64
  if (fileName === void 0) { fileName = ""; }
package/build/lib.d.ts CHANGED
@@ -29,6 +29,7 @@ export declare const DattaTable: {
29
29
  formatBytes: (bytes: number, decimals?: number) => string;
30
30
  formatDateValue: (value: string, format?: string) => string;
31
31
  formatTimeValue: (value: string, format?: string) => string;
32
+ getContextInfo: (webUrl: string) => PromiseLike<string>;
32
33
  getFileExt: (fileName?: string) => string;
33
34
  Modal: typeof Common.Modal;
34
35
  Timeout: typeof Common.Timeout;