dattatable 2.11.26 → 2.11.28
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/build/common/list.d.ts +6 -1
- package/build/common/list.js +50 -1
- package/dist/dattatable.js +848 -848
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Accordion.html +2 -2
- package/docs/classes/AuditLog.html +2 -2
- package/docs/classes/CanvasForm.html +2 -2
- package/docs/classes/Comments.html +2 -2
- package/docs/classes/Dashboard.html +4 -4
- package/docs/classes/DataTable.html +3 -3
- package/docs/classes/Documents.html +6 -6
- package/docs/classes/FilterSlideout.html +2 -2
- package/docs/classes/Footer.html +2 -2
- package/docs/classes/Header.html +2 -2
- package/docs/classes/InstallationRequired.html +2 -2
- package/docs/classes/ItemForm.html +4 -4
- package/docs/classes/List.html +10 -5
- package/docs/classes/ListConfig.html +2 -2
- package/docs/classes/ListSecurity.html +2 -2
- package/docs/classes/LoadingDialog.html +2 -2
- package/docs/classes/Modal.html +2 -2
- package/docs/classes/Navigation.html +3 -3
- package/docs/classes/Tiles.html +2 -2
- package/docs/classes/Timeout.html +2 -2
- package/docs/enums/ActionButtonTypes.html +2 -2
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getContextInfo.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/functions/waitForTheme.html +1 -1
- package/docs/interfaces/IAccordion.html +2 -2
- package/docs/interfaces/IAccordionProps.html +2 -2
- package/docs/interfaces/IAuditLogItem.html +2 -2
- package/docs/interfaces/IAuditLogItemCreation.html +2 -2
- package/docs/interfaces/IAuditLogProps.html +2 -2
- package/docs/interfaces/IAuditLogViewProps.html +2 -2
- package/docs/interfaces/ICommentsItem.html +2 -2
- package/docs/interfaces/ICreateLookupData.html +2 -2
- package/docs/interfaces/IDashboardProps.html +2 -2
- package/docs/interfaces/IDataTable.html +2 -2
- package/docs/interfaces/IDataTableProps.html +2 -2
- package/docs/interfaces/IDocumentsProps.html +2 -2
- package/docs/interfaces/IFilterItem.html +2 -2
- package/docs/interfaces/IFilterProps.html +2 -2
- package/docs/interfaces/IFooterProps.html +2 -2
- package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
- package/docs/interfaces/IHeaderProps.html +2 -2
- package/docs/interfaces/IInstallProps.html +2 -2
- package/docs/interfaces/IItemFormCreateProps.html +2 -2
- package/docs/interfaces/IItemFormEditProps.html +2 -2
- package/docs/interfaces/IItemFormSaveProps.html +2 -2
- package/docs/interfaces/IItemFormTab.html +2 -2
- package/docs/interfaces/IItemFormTabInfo.html +2 -2
- package/docs/interfaces/IItemFormViewProps.html +2 -2
- package/docs/interfaces/IListConfig.html +2 -2
- package/docs/interfaces/IListConfigProps.html +2 -2
- package/docs/interfaces/IListProps.html +2 -2
- package/docs/interfaces/IListSecurity.html +2 -2
- package/docs/interfaces/IListSecurityItem.html +2 -2
- package/docs/interfaces/ILookupData.html +2 -2
- package/docs/interfaces/IShowDialogProps.html +2 -2
- package/docs/interfaces/ITiles.html +2 -2
- package/docs/interfaces/ITilesProps.html +2 -2
- package/docs/interfaces/IValidateLookupsProps.html +2 -2
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +2 -2
package/build/common/list.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export declare class List<T = Types.SP.ListItem> {
|
|
|
23
23
|
/** Public Properties */
|
|
24
24
|
private _camlQuery;
|
|
25
25
|
get CAMLQuery(): string;
|
|
26
|
+
get CanAddEditItems(): boolean;
|
|
27
|
+
get CanDeleteItems(): boolean;
|
|
28
|
+
get CanViewItems(): boolean;
|
|
26
29
|
get EditForm(): import("gd-sprest-bs/src/components/components").IListFormEdit;
|
|
27
30
|
get EditForms(): import("gd-sprest-bs/src/components/components").IListFormEdit[];
|
|
28
31
|
private _listContentTypes;
|
|
@@ -53,6 +56,7 @@ export declare class List<T = Types.SP.ListItem> {
|
|
|
53
56
|
private _webUrl;
|
|
54
57
|
get WebUrl(): string;
|
|
55
58
|
/** Private Properties */
|
|
59
|
+
private _basePermissions;
|
|
56
60
|
private _onInitError;
|
|
57
61
|
private _onInitialized?;
|
|
58
62
|
private _onItemLoading?;
|
|
@@ -66,10 +70,11 @@ export declare class List<T = Types.SP.ListItem> {
|
|
|
66
70
|
createItem(values: any): PromiseLike<T>;
|
|
67
71
|
deleteItem(itemId: number): PromiseLike<void>;
|
|
68
72
|
editForm(props: IItemFormEditProps): void;
|
|
69
|
-
getChanges(id: number): PromiseLike<any>;
|
|
73
|
+
getChanges(id: number, defaultFields?: string[]): PromiseLike<any>;
|
|
70
74
|
getField(name: string): any;
|
|
71
75
|
getFieldById(id?: string): Types.SP.Field;
|
|
72
76
|
getItem(id: number): T;
|
|
77
|
+
hasPermissions(permissions: number | number[]): boolean;
|
|
73
78
|
private init;
|
|
74
79
|
private loadItem;
|
|
75
80
|
private loadItems;
|
package/build/common/list.js
CHANGED
|
@@ -38,6 +38,8 @@ var List = /** @class */ (function () {
|
|
|
38
38
|
// Web Url
|
|
39
39
|
this._webUrl = null;
|
|
40
40
|
/** Private Properties */
|
|
41
|
+
// Base Permissions
|
|
42
|
+
this._basePermissions = null;
|
|
41
43
|
// Error event when loading the items fail
|
|
42
44
|
this._onInitError = null;
|
|
43
45
|
// Event triggered when the component is initialized
|
|
@@ -109,6 +111,33 @@ var List = /** @class */ (function () {
|
|
|
109
111
|
enumerable: false,
|
|
110
112
|
configurable: true
|
|
111
113
|
});
|
|
114
|
+
Object.defineProperty(List.prototype, "CanAddEditItems", {
|
|
115
|
+
// Flag to determine if the user can add/edit items to the list
|
|
116
|
+
get: function () {
|
|
117
|
+
return this.hasPermissions([
|
|
118
|
+
gd_sprest_bs_1.SPTypes.BasePermissionTypes.AddListItems,
|
|
119
|
+
gd_sprest_bs_1.SPTypes.BasePermissionTypes.EditListItems
|
|
120
|
+
]);
|
|
121
|
+
},
|
|
122
|
+
enumerable: false,
|
|
123
|
+
configurable: true
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(List.prototype, "CanDeleteItems", {
|
|
126
|
+
// Flag to determine if the user can delete items to the list
|
|
127
|
+
get: function () {
|
|
128
|
+
return this.hasPermissions(gd_sprest_bs_1.SPTypes.BasePermissionTypes.DeleteListItems);
|
|
129
|
+
},
|
|
130
|
+
enumerable: false,
|
|
131
|
+
configurable: true
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(List.prototype, "CanViewItems", {
|
|
134
|
+
// Flag to determine if the user can view items to the list
|
|
135
|
+
get: function () {
|
|
136
|
+
return this.hasPermissions(gd_sprest_bs_1.SPTypes.BasePermissionTypes.ViewListItems);
|
|
137
|
+
},
|
|
138
|
+
enumerable: false,
|
|
139
|
+
configurable: true
|
|
140
|
+
});
|
|
112
141
|
Object.defineProperty(List.prototype, "EditForm", {
|
|
113
142
|
// Reference to the edit form
|
|
114
143
|
get: function () { return _1.ItemForm.EditForm; },
|
|
@@ -248,8 +277,9 @@ var List = /** @class */ (function () {
|
|
|
248
277
|
_1.ItemForm.edit(props).then(null, this._onLoadFormError);
|
|
249
278
|
};
|
|
250
279
|
// Gets the changes for a list item's version history
|
|
251
|
-
List.prototype.getChanges = function (id) {
|
|
280
|
+
List.prototype.getChanges = function (id, defaultFields) {
|
|
252
281
|
var _this = this;
|
|
282
|
+
if (defaultFields === void 0) { defaultFields = []; }
|
|
253
283
|
// Return a promise
|
|
254
284
|
return new Promise(function (resolve, reject) {
|
|
255
285
|
var changes = {};
|
|
@@ -265,11 +295,21 @@ var List = /** @class */ (function () {
|
|
|
265
295
|
var versionId = version.VersionLabel;
|
|
266
296
|
// Set the change object
|
|
267
297
|
changes[versionId] = {};
|
|
298
|
+
// Set the default properties
|
|
299
|
+
for (var i_1 = 0; i_1 < defaultFields.length; i_1++) {
|
|
300
|
+
var defaultField = defaultFields[i_1];
|
|
301
|
+
// Set the default value
|
|
302
|
+
changes[versionId][defaultField] = version[defaultField];
|
|
303
|
+
}
|
|
268
304
|
// Parse the list fields
|
|
269
305
|
for (var j = 0; j < _this.ListFields.length; j++) {
|
|
270
306
|
var field = _this.ListFields[j];
|
|
271
307
|
var value = version[field.InternalName] || version[field.InternalName + "Id"];
|
|
272
308
|
var prevValue = prevVersion[field.InternalName] || prevVersion[field.InternalName + "Id"];
|
|
309
|
+
// Skip the default properties
|
|
310
|
+
if (defaultFields.indexOf(field.InternalName) >= 0) {
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
273
313
|
// Skip functions
|
|
274
314
|
if (typeof (value) === "function") {
|
|
275
315
|
continue;
|
|
@@ -341,6 +381,11 @@ var List = /** @class */ (function () {
|
|
|
341
381
|
// Not found
|
|
342
382
|
return null;
|
|
343
383
|
};
|
|
384
|
+
// Determines if the user has permissions to the list
|
|
385
|
+
List.prototype.hasPermissions = function (permissions) {
|
|
386
|
+
// See if the user has permissions
|
|
387
|
+
return gd_sprest_bs_1.Helper.hasPermissions(this._basePermissions, permissions);
|
|
388
|
+
};
|
|
344
389
|
// Initializes the list component
|
|
345
390
|
List.prototype.init = function () {
|
|
346
391
|
var _this = this;
|
|
@@ -368,6 +413,10 @@ var List = /** @class */ (function () {
|
|
|
368
413
|
// Reject the request
|
|
369
414
|
reject.apply(void 0, args);
|
|
370
415
|
});
|
|
416
|
+
// Get the user permissions for this list
|
|
417
|
+
list.getUserEffectivePermissions(gd_sprest_bs_1.ContextInfo.userEmail).execute(function (basePermissions) {
|
|
418
|
+
_this._basePermissions = basePermissions.GetUserEffectivePermissions;
|
|
419
|
+
});
|
|
371
420
|
// Get the root folder
|
|
372
421
|
list.RootFolder().execute(function (folder) {
|
|
373
422
|
// Set the url
|