dattatable 2.3.2 → 2.3.4
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 +9 -3
- package/build/common/list.js +52 -6
- package/dist/dattatable.js +1 -1
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +14 -14
- package/docs/classes/CanvasForm.html +17 -17
- package/docs/classes/Comments.html +12 -12
- package/docs/classes/Dashboard.html +17 -17
- package/docs/classes/DataTable.html +11 -11
- package/docs/classes/Documents.html +45 -45
- package/docs/classes/FilterSlideout.html +14 -14
- package/docs/classes/Footer.html +4 -4
- package/docs/classes/Header.html +4 -4
- package/docs/classes/InstallationRequired.html +12 -12
- package/docs/classes/ItemForm.html +47 -47
- package/docs/classes/List.html +92 -41
- package/docs/classes/LoadingDialog.html +12 -12
- package/docs/classes/Modal.html +26 -26
- package/docs/classes/Navigation.html +6 -6
- package/docs/enums/ActionButtonTypes.html +6 -6
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/interfaces/IAuditLogItem.html +8 -8
- package/docs/interfaces/IAuditLogItemCreation.html +7 -7
- package/docs/interfaces/ICommentsItem.html +6 -6
- package/docs/interfaces/IDashboardProps.html +14 -14
- package/docs/interfaces/IDataTable.html +7 -7
- package/docs/interfaces/IDataTableProps.html +6 -6
- package/docs/interfaces/IDocumentsProps.html +25 -25
- package/docs/interfaces/IFilterItem.html +5 -5
- package/docs/interfaces/IFilterProps.html +4 -4
- package/docs/interfaces/IFooterProps.html +6 -6
- package/docs/interfaces/IHeaderProps.html +5 -5
- package/docs/interfaces/IItemFormCreateProps.html +14 -14
- package/docs/interfaces/IItemFormEditProps.html +15 -15
- package/docs/interfaces/IItemFormTab.html +7 -7
- package/docs/interfaces/IItemFormTabInfo.html +3 -3
- package/docs/interfaces/IItemFormViewProps.html +12 -12
- package/docs/interfaces/IListProps.html +7 -7
- package/docs/interfaces/IShowDialogProps.html +5 -5
- package/docs/variables/DattaTable.html +1 -1
- package/package.json +1 -1
package/build/common/list.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from "gd-sprest-bs";
|
|
2
2
|
import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from "../common";
|
|
3
3
|
/** List Properties */
|
|
4
4
|
export interface IListProps {
|
|
@@ -15,8 +15,14 @@ export interface IListProps {
|
|
|
15
15
|
export declare class List<T = Types.SP.ListItem> {
|
|
16
16
|
get EditForm(): import("gd-sprest-bs/src/components/components").IListFormEdit;
|
|
17
17
|
get EditForms(): import("gd-sprest-bs/src/components/components").IListFormEdit[];
|
|
18
|
-
private
|
|
19
|
-
get
|
|
18
|
+
private _listContentTypes;
|
|
19
|
+
get ListContentTypes(): Types.SP.ContentTypeOData[];
|
|
20
|
+
private _listFields;
|
|
21
|
+
get ListFields(): Types.SP.Field[];
|
|
22
|
+
private _listInfo;
|
|
23
|
+
get ListInfo(): Types.SP.List;
|
|
24
|
+
private _listViews;
|
|
25
|
+
get ListViews(): Types.SP.ViewOData[];
|
|
20
26
|
private _items;
|
|
21
27
|
get Items(): T[];
|
|
22
28
|
private _listName;
|
package/build/common/list.js
CHANGED
|
@@ -10,8 +10,14 @@ var List = /** @class */ (function () {
|
|
|
10
10
|
// Constructor
|
|
11
11
|
function List(props) {
|
|
12
12
|
var _this = this;
|
|
13
|
-
//
|
|
14
|
-
this.
|
|
13
|
+
// List Content Types Information
|
|
14
|
+
this._listContentTypes = null;
|
|
15
|
+
// List Fields Information
|
|
16
|
+
this._listFields = null;
|
|
17
|
+
// List Information
|
|
18
|
+
this._listInfo = null;
|
|
19
|
+
// List Views Information
|
|
20
|
+
this._listViews = null;
|
|
15
21
|
// Items
|
|
16
22
|
this._items = null;
|
|
17
23
|
// List Name
|
|
@@ -53,8 +59,23 @@ var List = /** @class */ (function () {
|
|
|
53
59
|
enumerable: false,
|
|
54
60
|
configurable: true
|
|
55
61
|
});
|
|
56
|
-
Object.defineProperty(List.prototype, "
|
|
57
|
-
get: function () { return this.
|
|
62
|
+
Object.defineProperty(List.prototype, "ListContentTypes", {
|
|
63
|
+
get: function () { return this._listContentTypes; },
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(List.prototype, "ListFields", {
|
|
68
|
+
get: function () { return this._listFields; },
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(List.prototype, "ListInfo", {
|
|
73
|
+
get: function () { return this._listInfo; },
|
|
74
|
+
enumerable: false,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(List.prototype, "ListViews", {
|
|
78
|
+
get: function () { return this._listViews; },
|
|
58
79
|
enumerable: false,
|
|
59
80
|
configurable: true
|
|
60
81
|
});
|
|
@@ -103,12 +124,37 @@ var List = /** @class */ (function () {
|
|
|
103
124
|
if (query === void 0) { query = this.OData; }
|
|
104
125
|
// Return a promise
|
|
105
126
|
return new Promise(function (resolve, reject) {
|
|
127
|
+
var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName);
|
|
106
128
|
// See if the items exist
|
|
107
129
|
if (_this._items) {
|
|
108
130
|
return _this._items;
|
|
109
131
|
}
|
|
132
|
+
// Query the list content types
|
|
133
|
+
list.execute(function (list) {
|
|
134
|
+
// Save the list information
|
|
135
|
+
_this._listInfo = list;
|
|
136
|
+
}, reject);
|
|
137
|
+
// Query the content types
|
|
138
|
+
list.ContentTypes().query({
|
|
139
|
+
Expand: ["FieldLinks", "Fields"]
|
|
140
|
+
}).execute(function (cts) {
|
|
141
|
+
// Save the content types
|
|
142
|
+
_this._listContentTypes = cts.results;
|
|
143
|
+
}, true);
|
|
144
|
+
// Query the list fields
|
|
145
|
+
list.Fields().execute(function (fields) {
|
|
146
|
+
// Save the fields
|
|
147
|
+
_this._listFields = fields.results;
|
|
148
|
+
}, true);
|
|
149
|
+
// Query the list views
|
|
150
|
+
list.Views().query({
|
|
151
|
+
Expand: ["FieldLinks", "Fields"]
|
|
152
|
+
}).execute(function (views) {
|
|
153
|
+
// Save the views
|
|
154
|
+
_this._listViews = views.results;
|
|
155
|
+
}, true);
|
|
110
156
|
// Query the items
|
|
111
|
-
|
|
157
|
+
list.Items().query(query).execute(function (items) {
|
|
112
158
|
// Save the items
|
|
113
159
|
_this._items = items.results;
|
|
114
160
|
// Resolve the request
|
|
@@ -122,7 +168,7 @@ var List = /** @class */ (function () {
|
|
|
122
168
|
_this._onLoadItemsError ? _this._onLoadItemsError.apply(_this, args) : null;
|
|
123
169
|
// Reject the request
|
|
124
170
|
reject.apply(void 0, args);
|
|
125
|
-
});
|
|
171
|
+
}, true);
|
|
126
172
|
});
|
|
127
173
|
};
|
|
128
174
|
// Displays the new form
|
package/dist/dattatable.js
CHANGED
|
@@ -104,7 +104,7 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
|
|
|
104
104
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
105
105
|
|
|
106
106
|
"use strict";
|
|
107
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.List = 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 common_1 = __webpack_require__(/*! ../common */ \"./build/common/index.js\");\r\n/**\r\n * List\r\n */\r\nvar List = /** @class */ (function () {\r\n // Constructor\r\n function List(props) {\r\n var _this = this;\r\n //
|
|
107
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.List = 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 common_1 = __webpack_require__(/*! ../common */ \"./build/common/index.js\");\r\n/**\r\n * List\r\n */\r\nvar List = /** @class */ (function () {\r\n // Constructor\r\n function List(props) {\r\n var _this = this;\r\n // List Content Types Information\r\n this._listContentTypes = null;\r\n // List Fields Information\r\n this._listFields = null;\r\n // List Information\r\n this._listInfo = null;\r\n // List Views Information\r\n this._listViews = null;\r\n // Items\r\n this._items = null;\r\n // List Name\r\n this._listName = null;\r\n // OData query\r\n this._odata = null;\r\n // Web Url\r\n this._webUrl = null;\r\n // Items loaded event\r\n this._onItemsLoaded = null;\r\n // Error event when loading a form\r\n this._onLoadFormError = null;\r\n // Error event when loading the items fail\r\n this._onLoadItemsError = null;\r\n // Save the properties\r\n this._listName = props.listName;\r\n this._odata = props.itemQuery;\r\n this._onItemsLoaded = props.onItemsLoaded;\r\n this._onLoadFormError = props.onLoadFormError;\r\n this._onLoadItemsError = props.onLoadItemsError;\r\n this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;\r\n // Load the data\r\n this.load().then(function (items) {\r\n // Set the items\r\n _this._items = items;\r\n // Call the items loaded event\r\n _this._onItemsLoaded ? _this._onItemsLoaded() : null;\r\n });\r\n }\r\n Object.defineProperty(List.prototype, \"EditForm\", {\r\n // Reference to the edit form\r\n get: function () { return common_1.ItemForm.EditForm; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"EditForms\", {\r\n // Reference to the edit forms, if tabs are used\r\n get: function () { return common_1.ItemForm.EditForms; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListContentTypes\", {\r\n get: function () { return this._listContentTypes; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListFields\", {\r\n get: function () { return this._listFields; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListInfo\", {\r\n get: function () { return this._listInfo; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListViews\", {\r\n get: function () { return this._listViews; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"Items\", {\r\n get: function () { return this._items; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListName\", {\r\n get: function () { return this._listName; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"OData\", {\r\n get: function () { return this._odata; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewForm\", {\r\n // Reference to the display form\r\n get: function () { return common_1.ItemForm.DisplayForm; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewForms\", {\r\n // Reference to the display forms, if tabs are used\r\n get: function () { return common_1.ItemForm.DisplayForms; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"WebUrl\", {\r\n get: function () { return this._webUrl; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Clears the modal or canvas\r\n List.prototype.clear = function () {\r\n // Clear the modal/form\r\n common_1.ItemForm.UseModal ? common_1.Modal.clear() : common_1.CanvasForm.clear();\r\n // Set the list name\r\n common_1.ItemForm.ListName = this.ListName;\r\n };\r\n // Loads the items\r\n List.prototype.load = function (query) {\r\n var _this = this;\r\n if (query === void 0) { query = this.OData; }\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName);\r\n // See if the items exist\r\n if (_this._items) {\r\n return _this._items;\r\n }\r\n // Query the list content types\r\n list.execute(function (list) {\r\n // Save the list information\r\n _this._listInfo = list;\r\n }, reject);\r\n // Query the content types\r\n list.ContentTypes().query({\r\n Expand: [\"FieldLinks\", \"Fields\"]\r\n }).execute(function (cts) {\r\n // Save the content types\r\n _this._listContentTypes = cts.results;\r\n }, true);\r\n // Query the list fields\r\n list.Fields().execute(function (fields) {\r\n // Save the fields\r\n _this._listFields = fields.results;\r\n }, true);\r\n // Query the list views\r\n list.Views().query({\r\n Expand: [\"FieldLinks\", \"Fields\"]\r\n }).execute(function (views) {\r\n // Save the views\r\n _this._listViews = views.results;\r\n }, true);\r\n // Query the items\r\n list.Items().query(query).execute(function (items) {\r\n // Save the items\r\n _this._items = items.results;\r\n // Resolve the request\r\n resolve(_this._items);\r\n }, function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n // Call the event\r\n _this._onLoadItemsError ? _this._onLoadItemsError.apply(_this, args) : null;\r\n // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Displays the new form\r\n List.prototype.createItem = function (props) {\r\n // Clear the modal/canvas\r\n this.clear();\r\n // Display the form\r\n common_1.ItemForm.create(props).then(null, this._onLoadFormError);\r\n };\r\n // Displays the edit form\r\n List.prototype.editItem = function (props) {\r\n // Clear the modal/canvas\r\n this.clear();\r\n // Display the form\r\n common_1.ItemForm.edit(props).then(null, this._onLoadFormError);\r\n };\r\n // Refresh the data\r\n List.prototype.refresh = function (query) {\r\n if (query === void 0) { query = this.OData; }\r\n // Clear the items\r\n this._items = null;\r\n // Load the data\r\n return this.load(query);\r\n };\r\n // Displays the view form\r\n List.prototype.viewItem = function (props) {\r\n // Clear the modal/canvas\r\n this.clear();\r\n // Display the form\r\n common_1.ItemForm.view(props).then(null, this._onLoadFormError);\r\n };\r\n return List;\r\n}());\r\nexports.List = List;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/list.js?");
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|