dattatable 2.2.7 → 2.2.8
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/auditLog/cfg.d.ts +2 -0
- package/build/auditLog/cfg.js +57 -0
- package/build/auditLog/index.d.ts +35 -0
- package/build/auditLog/index.js +91 -0
- package/build/{comments.d.ts → common/comments.d.ts} +0 -0
- package/build/{comments.js → common/comments.js} +3 -3
- package/build/{documents.d.ts → common/documents.d.ts} +1 -1
- package/build/{documents.js → common/documents.js} +3 -3
- package/build/common/index.d.ts +4 -0
- package/build/common/index.js +4 -0
- package/build/{itemForm.d.ts → common/itemForm.d.ts} +4 -4
- package/build/{itemForm.js → common/itemForm.js} +60 -59
- package/build/common/list.d.ts +34 -0
- package/build/common/list.js +123 -0
- package/build/dashboard/index.js +2 -2
- package/build/index.d.ts +2 -5
- package/build/index.js +4 -18
- package/build/lib.d.ts +28 -0
- package/build/lib.js +37 -0
- package/build/styles.js +1 -1
- package/dist/dattatable.js +78 -46
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +238 -0
- package/docs/classes/CanvasForm.html +19 -19
- package/docs/classes/Comments.html +14 -14
- package/docs/classes/Dashboard.html +21 -21
- package/docs/classes/DataTable.html +13 -13
- package/docs/classes/Documents.html +50 -50
- package/docs/classes/FilterSlideout.html +16 -16
- package/docs/classes/Footer.html +6 -6
- package/docs/classes/Header.html +6 -6
- package/docs/classes/InstallationRequired.html +14 -14
- package/docs/classes/ItemForm.html +60 -60
- package/docs/classes/List.html +312 -0
- package/docs/classes/LoadingDialog.html +14 -14
- package/docs/classes/Modal.html +28 -28
- package/docs/classes/Navigation.html +8 -8
- package/docs/enums/ActionButtonTypes.html +6 -6
- package/docs/functions/formatBytes.html +9 -3
- package/docs/functions/formatDateValue.html +9 -3
- package/docs/functions/formatTimeValue.html +9 -3
- package/docs/functions/getFileExt.html +9 -3
- package/docs/index.html +8 -2
- package/docs/interfaces/IAuditLogItem.html +1061 -0
- package/docs/interfaces/IAuditLogItemCreation.html +105 -0
- package/docs/interfaces/ICommentsItem.html +6 -6
- package/docs/interfaces/IDashboardProps.html +14 -14
- package/docs/interfaces/IDataTable.html +8 -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 +17 -17
- package/docs/interfaces/IItemFormEditProps.html +18 -18
- package/docs/interfaces/IItemFormTab.html +7 -7
- package/docs/interfaces/IItemFormTabInfo.html +3 -3
- package/docs/interfaces/IItemFormViewProps.html +15 -15
- package/docs/interfaces/IListProps.html +140 -0
- package/docs/interfaces/IShowDialogProps.html +5 -5
- package/docs/modules.html +17 -2
- package/docs/variables/DattaTable.html +146 -0
- package/package.json +3 -3
- package/pnpm-lock.yaml +9 -9
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Configuration = void 0;
|
|
4
|
+
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
5
|
+
// Configuration
|
|
6
|
+
exports.Configuration = gd_sprest_bs_1.Helper.SPConfig({
|
|
7
|
+
ListCfg: [{
|
|
8
|
+
ListInformation: {
|
|
9
|
+
Title: "Audit Log",
|
|
10
|
+
Hidden: true,
|
|
11
|
+
NoCrawl: true
|
|
12
|
+
},
|
|
13
|
+
TitleFieldIndexed: true,
|
|
14
|
+
ContentTypes: [{
|
|
15
|
+
Name: "Item",
|
|
16
|
+
FieldRefs: [
|
|
17
|
+
"Title",
|
|
18
|
+
]
|
|
19
|
+
}],
|
|
20
|
+
CustomFields: [
|
|
21
|
+
{
|
|
22
|
+
name: "ParentItemId",
|
|
23
|
+
title: "Parent Item Id",
|
|
24
|
+
description: "The list item id linked to this item.",
|
|
25
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.Number,
|
|
26
|
+
indexed: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "ParentListName",
|
|
30
|
+
title: "Parent List Name",
|
|
31
|
+
description: "The list name linked to this item.",
|
|
32
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.Text,
|
|
33
|
+
indexed: true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "LogComment",
|
|
37
|
+
title: "LogComment",
|
|
38
|
+
description: "The comment to write to the audit log.",
|
|
39
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,
|
|
40
|
+
noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "LogData",
|
|
44
|
+
title: "Log Data",
|
|
45
|
+
description: "The data to write to the audit log.",
|
|
46
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,
|
|
47
|
+
noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "LogUser",
|
|
51
|
+
title: "Log User",
|
|
52
|
+
description: "The user who is associated with this log entry.",
|
|
53
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.User
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}]
|
|
57
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Helper, Types } from "gd-sprest-bs";
|
|
2
|
+
export interface IAuditLogItemCreation {
|
|
3
|
+
LogComment?: string;
|
|
4
|
+
LogData?: string;
|
|
5
|
+
ParentItemId: number;
|
|
6
|
+
ParentListName: string;
|
|
7
|
+
LogUserId: number;
|
|
8
|
+
Title: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IAuditLogItem extends IAuditLogItemCreation, Types.SP.IListItem {
|
|
11
|
+
LogUser?: {
|
|
12
|
+
EMail: string;
|
|
13
|
+
Id: number;
|
|
14
|
+
LoginName: string;
|
|
15
|
+
Title: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Audit Log
|
|
20
|
+
*/
|
|
21
|
+
export declare class AuditLog<T = IAuditLogItem> {
|
|
22
|
+
private _cfg;
|
|
23
|
+
get Configuration(): Helper.ISPConfig;
|
|
24
|
+
get AuditListName(): string;
|
|
25
|
+
private _listName;
|
|
26
|
+
get ListName(): string;
|
|
27
|
+
private _webUrl;
|
|
28
|
+
get WebUrl(): string;
|
|
29
|
+
set WebUrl(value: string);
|
|
30
|
+
constructor(listName: string);
|
|
31
|
+
getItems(itemId: number, onQuery?: (query: Types.IODataQuery) => Types.IODataQuery): Promise<unknown>;
|
|
32
|
+
logItem(values: IAuditLogItemCreation): PromiseLike<T>;
|
|
33
|
+
install(): PromiseLike<void>;
|
|
34
|
+
uninstall(): PromiseLike<void>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditLog = void 0;
|
|
4
|
+
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
5
|
+
var cfg_1 = require("./cfg");
|
|
6
|
+
/**
|
|
7
|
+
* Audit Log
|
|
8
|
+
*/
|
|
9
|
+
var AuditLog = /** @class */ (function () {
|
|
10
|
+
// Constructor
|
|
11
|
+
function AuditLog(listName) {
|
|
12
|
+
// Configuration
|
|
13
|
+
this._cfg = null;
|
|
14
|
+
// List name
|
|
15
|
+
this._listName = null;
|
|
16
|
+
// Web url
|
|
17
|
+
this._webUrl = null;
|
|
18
|
+
// Save the associated list
|
|
19
|
+
this._listName = listName;
|
|
20
|
+
// Set the configuration
|
|
21
|
+
this._cfg = cfg_1.Configuration;
|
|
22
|
+
// Default the web url
|
|
23
|
+
this.WebUrl = gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(AuditLog.prototype, "Configuration", {
|
|
26
|
+
get: function () { return this._cfg; },
|
|
27
|
+
enumerable: false,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(AuditLog.prototype, "AuditListName", {
|
|
31
|
+
get: function () {
|
|
32
|
+
// Return the list name
|
|
33
|
+
return this.Configuration._configuration.ListCfg[0].ListInformation.Title;
|
|
34
|
+
},
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(AuditLog.prototype, "ListName", {
|
|
39
|
+
get: function () { return this._listName; },
|
|
40
|
+
enumerable: false,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(AuditLog.prototype, "WebUrl", {
|
|
44
|
+
get: function () { return this._webUrl; },
|
|
45
|
+
set: function (value) { this._webUrl = value; },
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
// Gets data for an associated item
|
|
50
|
+
AuditLog.prototype.getItems = function (itemId, onQuery) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
// Return a promise
|
|
53
|
+
return new Promise(function (resolve, reject) {
|
|
54
|
+
// Set the odata query
|
|
55
|
+
var odata = {
|
|
56
|
+
Expand: ["LogUser"],
|
|
57
|
+
Filter: "ParentListName eq '".concat(_this.ListName, "' and ParentItemId eq ").concat(itemId),
|
|
58
|
+
OrderBy: ["Created desc"],
|
|
59
|
+
Select: ["*", "LogUser/EMail", "LogUser/Id", "LogUser/LoginName", "LogUser/Title"]
|
|
60
|
+
};
|
|
61
|
+
// Call the event
|
|
62
|
+
odata = onQuery ? onQuery(odata) : odata;
|
|
63
|
+
// Get the list data
|
|
64
|
+
(0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.AuditListName).Items().query(odata).execute(function (items) {
|
|
65
|
+
// Resolve the request
|
|
66
|
+
resolve(items.results);
|
|
67
|
+
}, reject);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
// Logs an item to the audit log
|
|
71
|
+
AuditLog.prototype.logItem = function (values) {
|
|
72
|
+
var _this = this;
|
|
73
|
+
// Return a promise
|
|
74
|
+
return new Promise(function (resolve, reject) {
|
|
75
|
+
// Create the item
|
|
76
|
+
(0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.AuditListName).Items().add(values).execute(resolve, reject);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
// Installs the list
|
|
80
|
+
AuditLog.prototype.install = function () {
|
|
81
|
+
// Installs the list
|
|
82
|
+
return this.Configuration.install();
|
|
83
|
+
};
|
|
84
|
+
// Removes the audit log list
|
|
85
|
+
AuditLog.prototype.uninstall = function () {
|
|
86
|
+
// Remove the audit log list
|
|
87
|
+
return this.Configuration.uninstall();
|
|
88
|
+
};
|
|
89
|
+
return AuditLog;
|
|
90
|
+
}());
|
|
91
|
+
exports.AuditLog = AuditLog;
|
|
File without changes
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Comments = void 0;
|
|
4
4
|
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
5
5
|
var moment = require("moment");
|
|
6
|
-
var canvas_1 = require("./
|
|
7
|
-
var loadingDialog_1 = require("./
|
|
8
|
-
var modal_1 = require("./
|
|
6
|
+
var canvas_1 = require("./canvas");
|
|
7
|
+
var loadingDialog_1 = require("./loadingDialog");
|
|
8
|
+
var modal_1 = require("./modal");
|
|
9
9
|
// List Name
|
|
10
10
|
var LIST_NAME = "Comments";
|
|
11
11
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Components, Helper, Types } from "gd-sprest-bs";
|
|
2
|
-
import { DataTable, IDataTableProps } from "
|
|
2
|
+
import { DataTable, IDataTableProps } from "../dashboard/table";
|
|
3
3
|
/** Action Button Types */
|
|
4
4
|
export declare enum ActionButtonTypes {
|
|
5
5
|
Delete = 1,
|
|
@@ -15,9 +15,9 @@ exports.Documents = exports.ActionButtonTypes = void 0;
|
|
|
15
15
|
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
16
16
|
var jQuery = require("jquery");
|
|
17
17
|
var moment = require("moment");
|
|
18
|
-
var loadingDialog_1 = require("./
|
|
19
|
-
var methods_1 = require("./
|
|
20
|
-
var table_1 = require("
|
|
18
|
+
var loadingDialog_1 = require("./loadingDialog");
|
|
19
|
+
var methods_1 = require("./methods");
|
|
20
|
+
var table_1 = require("../dashboard/table");
|
|
21
21
|
var itemForm_1 = require("./itemForm");
|
|
22
22
|
/** Icons */
|
|
23
23
|
var fileEarmark_1 = require("gd-sprest-bs/build/icons/svgs/fileEarmark");
|
package/build/common/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** Common Components */
|
|
2
2
|
export * from "./canvas";
|
|
3
|
+
export * from "./comments";
|
|
4
|
+
export * from "./documents";
|
|
3
5
|
export * from "./installRequired";
|
|
6
|
+
export * from "./itemForm";
|
|
7
|
+
export * from "./list";
|
|
4
8
|
export * from "./loadingDialog";
|
|
5
9
|
export * from "./methods";
|
|
6
10
|
export * from "./modal";
|
package/build/common/index.js
CHANGED
|
@@ -16,7 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
__exportStar(require("./canvas"), exports);
|
|
19
|
+
__exportStar(require("./comments"), exports);
|
|
20
|
+
__exportStar(require("./documents"), exports);
|
|
19
21
|
__exportStar(require("./installRequired"), exports);
|
|
22
|
+
__exportStar(require("./itemForm"), exports);
|
|
23
|
+
__exportStar(require("./list"), exports);
|
|
20
24
|
__exportStar(require("./loadingDialog"), exports);
|
|
21
25
|
__exportStar(require("./methods"), exports);
|
|
22
26
|
__exportStar(require("./modal"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Components, Helper } from "gd-sprest-bs";
|
|
2
|
-
import { CanvasForm, Modal } from "
|
|
2
|
+
import { CanvasForm, Modal } from ".";
|
|
3
3
|
/** Tab */
|
|
4
4
|
export interface IItemFormTab {
|
|
5
5
|
title: string;
|
|
@@ -100,10 +100,10 @@ export declare class ItemForm {
|
|
|
100
100
|
static setSize(value: number): void;
|
|
101
101
|
/** Public Methods */
|
|
102
102
|
static close(): void;
|
|
103
|
-
static create(props?: IItemFormCreateProps): void
|
|
104
|
-
static edit(props: IItemFormEditProps): void
|
|
103
|
+
static create(props?: IItemFormCreateProps): PromiseLike<void>;
|
|
104
|
+
static edit(props: IItemFormEditProps): PromiseLike<void>;
|
|
105
105
|
static loadFormInfo(props: Helper.IListFormProps): PromiseLike<void>;
|
|
106
|
-
static view(props: IItemFormViewProps): void
|
|
106
|
+
static view(props: IItemFormViewProps): PromiseLike<void>;
|
|
107
107
|
/** Private Methods */
|
|
108
108
|
private static load;
|
|
109
109
|
private static renderDisplayForm;
|
|
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.ItemForm = void 0;
|
|
15
15
|
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
16
|
-
var
|
|
16
|
+
var _1 = require(".");
|
|
17
17
|
/**
|
|
18
18
|
* Item Form
|
|
19
19
|
*/
|
|
@@ -24,7 +24,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
24
24
|
// Auto Close Flag
|
|
25
25
|
set: function (value) {
|
|
26
26
|
// Update the flag
|
|
27
|
-
this.UseModal ?
|
|
27
|
+
this.UseModal ? _1.Modal.setAutoClose(value) : _1.CanvasForm.setAutoClose(value);
|
|
28
28
|
},
|
|
29
29
|
enumerable: false,
|
|
30
30
|
configurable: true
|
|
@@ -89,12 +89,12 @@ var ItemForm = /** @class */ (function () {
|
|
|
89
89
|
// Sets the size of the modal or canvas
|
|
90
90
|
ItemForm.setSize = function (value) {
|
|
91
91
|
// Set the modal type or offcanvas size
|
|
92
|
-
this._useModal ?
|
|
92
|
+
this._useModal ? _1.Modal.setType(value) : _1.CanvasForm.setSize(value);
|
|
93
93
|
};
|
|
94
94
|
/** Public Methods */
|
|
95
95
|
// Closes the item form
|
|
96
96
|
ItemForm.close = function () {
|
|
97
|
-
this._useModal ?
|
|
97
|
+
this._useModal ? _1.Modal.hide() : _1.CanvasForm.hide();
|
|
98
98
|
};
|
|
99
99
|
// Creates a new task
|
|
100
100
|
ItemForm.create = function (props) {
|
|
@@ -114,7 +114,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
114
114
|
this._updateEvent = props.onUpdate;
|
|
115
115
|
typeof (props.useModal) === "boolean" ? this._useModal = props.useModal : false;
|
|
116
116
|
// Load the item
|
|
117
|
-
this.load(props.webUrl);
|
|
117
|
+
return this.load(props.webUrl);
|
|
118
118
|
};
|
|
119
119
|
// Edits a task
|
|
120
120
|
ItemForm.edit = function (props) {
|
|
@@ -133,7 +133,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
133
133
|
this._updateEvent = props.onUpdate;
|
|
134
134
|
typeof (props.useModal) === "boolean" ? this._useModal = props.useModal : false;
|
|
135
135
|
// Load the form
|
|
136
|
-
this.load(props.webUrl, props.itemId);
|
|
136
|
+
return this.load(props.webUrl, props.itemId);
|
|
137
137
|
};
|
|
138
138
|
// Loads the form information
|
|
139
139
|
ItemForm.loadFormInfo = function (props) {
|
|
@@ -163,7 +163,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
163
163
|
this._tabInfo = props.tabInfo;
|
|
164
164
|
typeof (props.useModal) === "boolean" ? this._useModal = props.useModal : false;
|
|
165
165
|
// Load the form
|
|
166
|
-
this.load(props.webUrl, props.itemId);
|
|
166
|
+
return this.load(props.webUrl, props.itemId);
|
|
167
167
|
};
|
|
168
168
|
/** Private Methods */
|
|
169
169
|
// Load the form information
|
|
@@ -173,39 +173,40 @@ var ItemForm = /** @class */ (function () {
|
|
|
173
173
|
this._displayForms = [];
|
|
174
174
|
this._editForms = [];
|
|
175
175
|
// Show a loading dialog
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
//
|
|
180
|
-
(function () {
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
176
|
+
_1.LoadingDialog.setHeader("Loading the Item");
|
|
177
|
+
_1.LoadingDialog.setBody("This will close after the form is loaded...");
|
|
178
|
+
_1.LoadingDialog.show();
|
|
179
|
+
// Return a promise
|
|
180
|
+
return new Promise(function (resolve, reject) {
|
|
181
|
+
// Code to run after the data is loaded
|
|
182
|
+
var onComplete = function () {
|
|
183
|
+
// Render the form
|
|
184
|
+
_this.renderForm();
|
|
185
|
+
// Resolve the request
|
|
186
|
+
resolve(null);
|
|
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;
|
|
206
|
+
// Form information is already loaded
|
|
207
|
+
onComplete();
|
|
208
|
+
}, reject);
|
|
209
|
+
}
|
|
209
210
|
});
|
|
210
211
|
};
|
|
211
212
|
// Renders the display form
|
|
@@ -284,7 +285,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
284
285
|
elButtons.style.padding = "1rem 0";
|
|
285
286
|
}
|
|
286
287
|
// Append the create/update button
|
|
287
|
-
this._useModal ?
|
|
288
|
+
this._useModal ? _1.Modal.setFooter(elButtons) : _1.CanvasForm.BodyElement.appendChild(elButtons);
|
|
288
289
|
// See if we are rendering a display form
|
|
289
290
|
if (this.IsDisplay) {
|
|
290
291
|
// Call the item form button rendering event
|
|
@@ -311,16 +312,16 @@ var ItemForm = /** @class */ (function () {
|
|
|
311
312
|
}) : null;
|
|
312
313
|
}
|
|
313
314
|
// Call the footer event
|
|
314
|
-
this._onSetFooter ? this._onSetFooter(this._useModal ?
|
|
315
|
+
this._onSetFooter ? this._onSetFooter(this._useModal ? _1.Modal.FooterElement : elButtons) : null;
|
|
315
316
|
};
|
|
316
317
|
// Renders the form
|
|
317
318
|
ItemForm.renderForm = function () {
|
|
318
319
|
// Clear the form
|
|
319
|
-
(this._useModal ?
|
|
320
|
+
(this._useModal ? _1.Modal : _1.CanvasForm).clear();
|
|
320
321
|
// Set the header
|
|
321
|
-
(this._useModal ?
|
|
322
|
+
(this._useModal ? _1.Modal : _1.CanvasForm).setHeader('<h5 class="m-0">' + (this._info.item ? this._info.item.Title : "Create Item") + '</h5>');
|
|
322
323
|
// Call the header event
|
|
323
|
-
this._onSetHeader ? this._onSetHeader(this._useModal ?
|
|
324
|
+
this._onSetHeader ? this._onSetHeader(this._useModal ? _1.Modal.HeaderElement : _1.CanvasForm.HeaderElement) : null;
|
|
324
325
|
// See if we are rendering tabs
|
|
325
326
|
if (this._tabInfo) {
|
|
326
327
|
// Render the tabs
|
|
@@ -330,16 +331,16 @@ var ItemForm = /** @class */ (function () {
|
|
|
330
331
|
// Render the form based on the type
|
|
331
332
|
var elForm = this.IsDisplay ? this.renderDisplayForm() : this.renderEditForm();
|
|
332
333
|
// Update the body
|
|
333
|
-
(this._useModal ?
|
|
334
|
+
(this._useModal ? _1.Modal : _1.CanvasForm).setBody(elForm);
|
|
334
335
|
}
|
|
335
336
|
// Render the footer
|
|
336
337
|
this.renderFooter();
|
|
337
338
|
// Call the event
|
|
338
|
-
this._onShowForm ? this._onShowForm(this._useModal ?
|
|
339
|
+
this._onShowForm ? this._onShowForm(this._useModal ? _1.Modal : _1.CanvasForm) : null;
|
|
339
340
|
// Close the dialog
|
|
340
|
-
|
|
341
|
+
_1.LoadingDialog.hide();
|
|
341
342
|
// Show the form
|
|
342
|
-
(this._useModal ?
|
|
343
|
+
(this._useModal ? _1.Modal : _1.CanvasForm).show();
|
|
343
344
|
};
|
|
344
345
|
// Generates a tab
|
|
345
346
|
ItemForm.renderTabs = function () {
|
|
@@ -370,7 +371,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
370
371
|
}
|
|
371
372
|
// Render the tabs
|
|
372
373
|
this._tabs = gd_sprest_bs_1.Components.ListGroup({
|
|
373
|
-
el: this.UseModal ?
|
|
374
|
+
el: this.UseModal ? _1.Modal.BodyElement : _1.CanvasForm.BodyElement,
|
|
374
375
|
colWidth: this._tabInfo.isVertical ? 4 : 12,
|
|
375
376
|
isTabs: true,
|
|
376
377
|
isHorizontal: this._tabInfo.isVertical != true,
|
|
@@ -386,9 +387,9 @@ var ItemForm = /** @class */ (function () {
|
|
|
386
387
|
// Default the form
|
|
387
388
|
var forms = form ? [form] : this._editForms;
|
|
388
389
|
// Display a loading dialog
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
_1.LoadingDialog.setHeader("Validation");
|
|
391
|
+
_1.LoadingDialog.setBody("Validating the form...");
|
|
392
|
+
_1.LoadingDialog.show();
|
|
392
393
|
// Validate the forms
|
|
393
394
|
var isValid = true;
|
|
394
395
|
var counter = 0;
|
|
@@ -423,8 +424,8 @@ var ItemForm = /** @class */ (function () {
|
|
|
423
424
|
// See if the form(s) are valid
|
|
424
425
|
if (isValid) {
|
|
425
426
|
// Update the loading dialog
|
|
426
|
-
|
|
427
|
-
|
|
427
|
+
_1.LoadingDialog.setHeader("Saving the Item");
|
|
428
|
+
_1.LoadingDialog.setBody((_this.IsNew ? "Creating" : "Updating") + " the Item");
|
|
428
429
|
// Saves the item
|
|
429
430
|
var saveItem_1 = function (values) {
|
|
430
431
|
// If values is null then do nothing. This would happen when the
|
|
@@ -435,8 +436,8 @@ var ItemForm = /** @class */ (function () {
|
|
|
435
436
|
// Call the update event
|
|
436
437
|
_this._updateEvent ? _this._updateEvent(item) : null;
|
|
437
438
|
// Close the dialogs
|
|
438
|
-
(_this._useModal ?
|
|
439
|
-
|
|
439
|
+
(_this._useModal ? _1.Modal : _1.CanvasForm).hide();
|
|
440
|
+
_1.LoadingDialog.hide();
|
|
440
441
|
});
|
|
441
442
|
}
|
|
442
443
|
};
|
|
@@ -457,13 +458,13 @@ var ItemForm = /** @class */ (function () {
|
|
|
457
458
|
}
|
|
458
459
|
else {
|
|
459
460
|
// Close the dialog
|
|
460
|
-
|
|
461
|
+
_1.LoadingDialog.hide();
|
|
461
462
|
}
|
|
462
463
|
},
|
|
463
464
|
// Not Valid
|
|
464
465
|
function () {
|
|
465
466
|
// Close the dialog
|
|
466
|
-
|
|
467
|
+
_1.LoadingDialog.hide();
|
|
467
468
|
});
|
|
468
469
|
});
|
|
469
470
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Helper, Types } from "gd-sprest-bs";
|
|
2
|
+
import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from "../common";
|
|
3
|
+
/** List Properties */
|
|
4
|
+
export interface IListProps {
|
|
5
|
+
itemQuery?: Types.IODataQuery;
|
|
6
|
+
listName: string;
|
|
7
|
+
onItemsLoaded?: () => void;
|
|
8
|
+
onLoadItemsError?: (...args: any[]) => void;
|
|
9
|
+
onLoadFormError?: (...args: any[]) => void;
|
|
10
|
+
webUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* List
|
|
14
|
+
*/
|
|
15
|
+
export declare class List<T = Types.SP.ListItem> {
|
|
16
|
+
private _formInfo;
|
|
17
|
+
get FormInfo(): Helper.IListFormResult;
|
|
18
|
+
private _items;
|
|
19
|
+
get Items(): T[];
|
|
20
|
+
private _listName;
|
|
21
|
+
get ListName(): string;
|
|
22
|
+
private _webUrl;
|
|
23
|
+
get WebUrl(): string;
|
|
24
|
+
private _onItemsLoaded?;
|
|
25
|
+
private _onLoadFormError;
|
|
26
|
+
private _onLoadItemsError;
|
|
27
|
+
constructor(props: IListProps);
|
|
28
|
+
private clear;
|
|
29
|
+
load(query?: Types.IODataQuery): PromiseLike<T[]>;
|
|
30
|
+
createItem(props: IItemFormCreateProps): void;
|
|
31
|
+
editItem(props: IItemFormEditProps): void;
|
|
32
|
+
reset(query?: Types.IODataQuery): PromiseLike<T[]>;
|
|
33
|
+
viewItem(props: IItemFormViewProps): void;
|
|
34
|
+
}
|