dattatable 2.10.46 → 2.10.47

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 (69) hide show
  1. package/build/common/index.d.ts +1 -0
  2. package/build/common/index.js +1 -0
  3. package/build/common/list-cfg.d.ts +12 -0
  4. package/build/common/list-cfg.js +246 -0
  5. package/build/lib.d.ts +1 -0
  6. package/dist/dattatable.js +12 -1
  7. package/dist/dattatable.min.js +1 -1
  8. package/docs/assets/navigation.js +1 -1
  9. package/docs/assets/search.js +1 -1
  10. package/docs/classes/Accordion.html +2 -2
  11. package/docs/classes/AuditLog.html +2 -2
  12. package/docs/classes/CanvasForm.html +2 -2
  13. package/docs/classes/Comments.html +2 -2
  14. package/docs/classes/Dashboard.html +4 -4
  15. package/docs/classes/DataTable.html +3 -3
  16. package/docs/classes/Documents.html +6 -6
  17. package/docs/classes/FilterSlideout.html +2 -2
  18. package/docs/classes/Footer.html +2 -2
  19. package/docs/classes/Header.html +2 -2
  20. package/docs/classes/InstallationRequired.html +2 -2
  21. package/docs/classes/ItemForm.html +4 -4
  22. package/docs/classes/List.html +4 -4
  23. package/docs/classes/ListConfig.html +5 -0
  24. package/docs/classes/ListSecurity.html +2 -2
  25. package/docs/classes/LoadingDialog.html +2 -2
  26. package/docs/classes/Modal.html +2 -2
  27. package/docs/classes/Navigation.html +3 -3
  28. package/docs/classes/Tiles.html +2 -2
  29. package/docs/classes/Timeout.html +2 -2
  30. package/docs/enums/ActionButtonTypes.html +2 -2
  31. package/docs/functions/formatBytes.html +1 -1
  32. package/docs/functions/formatDateValue.html +1 -1
  33. package/docs/functions/formatTimeValue.html +1 -1
  34. package/docs/functions/getContextInfo.html +1 -1
  35. package/docs/functions/getFileExt.html +1 -1
  36. package/docs/functions/waitForTheme.html +1 -1
  37. package/docs/index.html +1 -1
  38. package/docs/interfaces/IAccordion.html +2 -2
  39. package/docs/interfaces/IAccordionProps.html +2 -2
  40. package/docs/interfaces/IAuditLogItem.html +3 -3
  41. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  42. package/docs/interfaces/IAuditLogProps.html +2 -2
  43. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  44. package/docs/interfaces/ICommentsItem.html +2 -2
  45. package/docs/interfaces/IDashboardProps.html +2 -2
  46. package/docs/interfaces/IDataTable.html +2 -2
  47. package/docs/interfaces/IDataTableProps.html +2 -2
  48. package/docs/interfaces/IDocumentsProps.html +2 -2
  49. package/docs/interfaces/IFilterItem.html +2 -2
  50. package/docs/interfaces/IFilterProps.html +2 -2
  51. package/docs/interfaces/IFooterProps.html +2 -2
  52. package/docs/interfaces/IHeaderProps.html +2 -2
  53. package/docs/interfaces/IInstallProps.html +2 -2
  54. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  55. package/docs/interfaces/IItemFormEditProps.html +2 -2
  56. package/docs/interfaces/IItemFormTab.html +2 -2
  57. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  58. package/docs/interfaces/IItemFormViewProps.html +2 -2
  59. package/docs/interfaces/IListConfig.html +3 -0
  60. package/docs/interfaces/IListProps.html +2 -2
  61. package/docs/interfaces/IListSecurity.html +2 -2
  62. package/docs/interfaces/IListSecurityItem.html +2 -2
  63. package/docs/interfaces/IShowDialogProps.html +2 -2
  64. package/docs/interfaces/ITiles.html +2 -2
  65. package/docs/interfaces/ITilesProps.html +2 -2
  66. package/docs/modules.html +3 -1
  67. package/docs/variables/DattaTable.html +1 -1
  68. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  69. package/package.json +1 -1
@@ -5,6 +5,7 @@ export * from "./documents";
5
5
  export * from "./installRequired";
6
6
  export * from "./itemForm";
7
7
  export * from "./list";
8
+ export * from "./list-cfg";
8
9
  export * from "./listSecurity";
9
10
  export * from "./loadingDialog";
10
11
  export * from "./methods";
@@ -21,6 +21,7 @@ __exportStar(require("./documents"), exports);
21
21
  __exportStar(require("./installRequired"), exports);
22
22
  __exportStar(require("./itemForm"), exports);
23
23
  __exportStar(require("./list"), exports);
24
+ __exportStar(require("./list-cfg"), exports);
24
25
  __exportStar(require("./listSecurity"), exports);
25
26
  __exportStar(require("./loadingDialog"), exports);
26
27
  __exportStar(require("./methods"), exports);
@@ -0,0 +1,12 @@
1
+ import { Helper, Types } from "gd-sprest-bs";
2
+ export interface IListConfig {
3
+ cfg: Helper.ISPConfigProps;
4
+ lookupFields: Types.SP.FieldLookup[];
5
+ }
6
+ /**
7
+ * List Configuration Generator
8
+ */
9
+ export declare class ListConfig {
10
+ private static InternalFields;
11
+ static generate(srcWebUrl: string, srcList: Types.SP.List, showDialog?: boolean): PromiseLike<IListConfig>;
12
+ }
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListConfig = void 0;
4
+ var gd_sprest_bs_1 = require("gd-sprest-bs");
5
+ var loadingDialog_1 = require("./loadingDialog");
6
+ var list_1 = require("./list");
7
+ /**
8
+ * List Configuration Generator
9
+ */
10
+ var ListConfig = /** @class */ (function () {
11
+ function ListConfig() {
12
+ }
13
+ // Generates the list configuration
14
+ ListConfig.generate = function (srcWebUrl, srcList, showDialog) {
15
+ var _this = this;
16
+ if (showDialog === void 0) { showDialog = true; }
17
+ // See if we are showing a loading dialog
18
+ if (showDialog) {
19
+ // Show a loading dialog
20
+ loadingDialog_1.LoadingDialog.setHeader("Loading List");
21
+ loadingDialog_1.LoadingDialog.setBody("Getting the source list configuration...");
22
+ loadingDialog_1.LoadingDialog.show();
23
+ }
24
+ // Return a promise
25
+ return new Promise(function (resolve, reject) {
26
+ // Get the list information
27
+ var list = new list_1.List({
28
+ listName: srcList.Title,
29
+ webUrl: srcWebUrl,
30
+ itemQuery: { Filter: "Id eq 0" },
31
+ onInitError: function () {
32
+ // Reject the request
33
+ reject("Error loading the list information. Please check your permission to the source list.");
34
+ },
35
+ onInitialized: function () {
36
+ var calcFields = [];
37
+ var fields = {};
38
+ var lookupFields = [];
39
+ // Update the loading dialog
40
+ loadingDialog_1.LoadingDialog.setBody("Analyzing the list information...");
41
+ // Create the configuration
42
+ var cfgProps = {
43
+ ListCfg: [{
44
+ ListInformation: {
45
+ AllowContentTypes: list.ListInfo.AllowContentTypes,
46
+ BaseTemplate: list.ListInfo.BaseTemplate,
47
+ ContentTypesEnabled: list.ListInfo.ContentTypesEnabled,
48
+ Title: srcList.Title,
49
+ Hidden: list.ListInfo.Hidden,
50
+ NoCrawl: list.ListInfo.NoCrawl
51
+ },
52
+ ContentTypes: [],
53
+ CustomFields: [],
54
+ ViewInformation: []
55
+ }]
56
+ };
57
+ // Parse the content types
58
+ for (var i = 0; i < list.ListContentTypes.length; i++) {
59
+ var ct = list.ListContentTypes[i];
60
+ // Skip sealed content types
61
+ if (ct.Sealed) {
62
+ continue;
63
+ }
64
+ // Parse the content type fields
65
+ var fieldRefs = [];
66
+ for (var j = 0; j < ct.FieldLinks.results.length; j++) {
67
+ var fldInfo = list.getField(ct.FieldLinks.results[j].Name);
68
+ // See if this is a lookup field
69
+ if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {
70
+ // Ensure this isn't an associated lookup field
71
+ if (fldInfo.IsDependentLookup != true) {
72
+ // Append the field ref
73
+ fieldRefs.push(fldInfo.InternalName);
74
+ }
75
+ }
76
+ else {
77
+ // Append the field ref
78
+ fieldRefs.push(fldInfo.InternalName);
79
+ }
80
+ // Skip internal fields
81
+ if (_this.InternalFields.indexOf(fldInfo.InternalName) >= 0) {
82
+ continue;
83
+ }
84
+ // See if this is a calculated field
85
+ if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Calculated) {
86
+ // Add the field and continue the loop
87
+ calcFields.push(fldInfo);
88
+ }
89
+ // Else, see if this is a lookup field
90
+ else if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {
91
+ // Add the field
92
+ lookupFields.push(fldInfo);
93
+ }
94
+ // Else, ensure the field hasn't been added
95
+ else if (fields[fldInfo.InternalName] == null) {
96
+ // Add the field information
97
+ fields[fldInfo.InternalName] = true;
98
+ cfgProps.ListCfg[0].CustomFields.push({
99
+ name: fldInfo.InternalName,
100
+ schemaXml: fldInfo.SchemaXml
101
+ });
102
+ }
103
+ }
104
+ // Add the list content type
105
+ cfgProps.ListCfg[0].ContentTypes.push({
106
+ Name: ct.Name,
107
+ Description: ct.Description,
108
+ ParentName: ct.Name,
109
+ FieldRefs: fieldRefs
110
+ });
111
+ }
112
+ // Parse the views
113
+ for (var i = 0; i < list.ListViews.length; i++) {
114
+ var viewInfo = list.ListViews[i];
115
+ // Skip hidden views
116
+ if (viewInfo.Hidden) {
117
+ continue;
118
+ }
119
+ // Parse the fields
120
+ for (var j = 0; j < viewInfo.ViewFields.Items.results.length; j++) {
121
+ var field = list.getField(viewInfo.ViewFields.Items.results[j]);
122
+ // Ensure the field exists
123
+ if (fields[field.InternalName] == null) {
124
+ // See if this is a calculated field
125
+ if (field.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Calculated) {
126
+ // Add the field and continue the loop
127
+ calcFields.push(field);
128
+ }
129
+ // Else, see if this is a lookup field
130
+ else if (field.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {
131
+ // Add the field
132
+ lookupFields.push(field);
133
+ }
134
+ else {
135
+ // Append the field
136
+ fields[field.InternalName] = true;
137
+ cfgProps.ListCfg[0].CustomFields.push({
138
+ name: field.InternalName,
139
+ schemaXml: field.SchemaXml
140
+ });
141
+ }
142
+ }
143
+ }
144
+ // Add the view
145
+ cfgProps.ListCfg[0].ViewInformation.push({
146
+ Default: viewInfo.DefaultView,
147
+ Hidden: viewInfo.Hidden,
148
+ JSLink: viewInfo.JSLink,
149
+ MobileDefaultView: viewInfo.MobileDefaultView,
150
+ MobileView: viewInfo.MobileView,
151
+ RowLimit: viewInfo.RowLimit,
152
+ Tabular: viewInfo.TabularView,
153
+ ViewName: viewInfo.Title,
154
+ ViewFields: viewInfo.ViewFields.Items.results,
155
+ ViewQuery: viewInfo.ViewQuery
156
+ });
157
+ }
158
+ // Update the loading dialog
159
+ loadingDialog_1.LoadingDialog.setBody("Analyzing the lookup fields...");
160
+ // Parse the lookup fields
161
+ gd_sprest_bs_1.Helper.Executor(lookupFields, function (lookupField) {
162
+ // Skip the field, if it was already added
163
+ if (fields[lookupField.InternalName]) {
164
+ return;
165
+ }
166
+ // Return a promise
167
+ return new Promise(function (resolve) {
168
+ // Get the lookup list
169
+ (0, gd_sprest_bs_1.Web)(srcWebUrl).Lists().getById(lookupField.LookupList).execute(function (list) {
170
+ // Add the lookup list field
171
+ fields[lookupField.InternalName] = true;
172
+ cfgProps.ListCfg[0].CustomFields.push({
173
+ description: lookupField.Description,
174
+ fieldRef: lookupField.PrimaryFieldId,
175
+ hidden: lookupField.Hidden,
176
+ id: lookupField.Id,
177
+ indexed: lookupField.Indexed,
178
+ listName: list.Title,
179
+ multi: lookupField.AllowMultipleValues,
180
+ name: lookupField.InternalName,
181
+ readOnly: lookupField.ReadOnlyField,
182
+ relationshipBehavior: lookupField.RelationshipDeleteBehavior,
183
+ required: lookupField.Required,
184
+ showField: lookupField.LookupField,
185
+ title: lookupField.Title,
186
+ type: gd_sprest_bs_1.Helper.SPCfgFieldType.Lookup
187
+ });
188
+ // Check the next field
189
+ resolve(null);
190
+ }, function (err) {
191
+ // Broken lookup field, don't add it
192
+ console.log("Error trying to find lookup list for field '" + lookupField.InternalName + "' with id: " + lookupField.LookupList);
193
+ resolve(null);
194
+ });
195
+ });
196
+ }).then(function () {
197
+ // Update the loading dialog
198
+ loadingDialog_1.LoadingDialog.setBody("Analyzing the calculated fields...");
199
+ // Parse the calculated fields
200
+ for (var i = 0; i < calcFields.length; i++) {
201
+ var calcField = calcFields[i];
202
+ if (fields[calcField.InternalName] == null) {
203
+ var parser = new DOMParser();
204
+ var schemaXml = parser.parseFromString(calcField.SchemaXml, "application/xml");
205
+ // Get the formula
206
+ var formula = schemaXml.querySelector("Formula");
207
+ // Parse the field refs
208
+ var fieldRefs = schemaXml.querySelectorAll("FieldRef");
209
+ for (var j = 0; j < fieldRefs.length; j++) {
210
+ var fieldRef = fieldRefs[j].getAttribute("Name");
211
+ // Ensure the field exists
212
+ var field = list.getField(fieldRef);
213
+ if (field) {
214
+ // Calculated formulas are supposed to contain the display name
215
+ // Replace any instance of the internal field w/ the correct format
216
+ var regexp = new RegExp(fieldRef, "g");
217
+ formula.innerHTML = formula.innerHTML.replace(regexp, "[" + field.Title + "]");
218
+ }
219
+ }
220
+ // Append the field
221
+ fields[calcField.InternalName] = true;
222
+ cfgProps.ListCfg[0].CustomFields.push({
223
+ name: calcField.InternalName,
224
+ schemaXml: schemaXml.querySelector("Field").outerHTML
225
+ });
226
+ }
227
+ }
228
+ // Hide the loading dialog
229
+ showDialog ? loadingDialog_1.LoadingDialog.hide() : null;
230
+ // Resolve the request
231
+ resolve({
232
+ cfg: cfgProps,
233
+ lookupFields: lookupFields
234
+ });
235
+ });
236
+ }
237
+ });
238
+ });
239
+ };
240
+ // Internal Fields
241
+ ListConfig.InternalFields = [
242
+ "ContentType", "TaxCatchAll", "TaxCatchAllLabel", "Title"
243
+ ];
244
+ return ListConfig;
245
+ }());
246
+ exports.ListConfig = ListConfig;
package/build/lib.d.ts CHANGED
@@ -21,6 +21,7 @@ export declare const DattaTable: {
21
21
  InstallationRequired: typeof Common.InstallationRequired;
22
22
  ItemForm: typeof Common.ItemForm;
23
23
  List: typeof Common.List;
24
+ ListConfig: typeof Common.ListConfig;
24
25
  ListSecurityDefaultGroups: {
25
26
  Members: string;
26
27
  Owners: string;
@@ -71,7 +71,7 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
71
71
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
72
72
 
73
73
  "use strict";
74
- eval("\r\n/** Common Components */\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\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./listSecurity */ \"./build/common/listSecurity.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./methods */ \"./build/common/methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modal */ \"./build/common/modal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./timeout */ \"./build/common/timeout.js\"), exports);\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/index.js?");
74
+ eval("\r\n/** Common Components */\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\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list-cfg */ \"./build/common/list-cfg.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./listSecurity */ \"./build/common/listSecurity.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./methods */ \"./build/common/methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modal */ \"./build/common/modal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./timeout */ \"./build/common/timeout.js\"), exports);\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/index.js?");
75
75
 
76
76
  /***/ }),
77
77
 
@@ -97,6 +97,17 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
97
97
 
98
98
  /***/ }),
99
99
 
100
+ /***/ "./build/common/list-cfg.js":
101
+ /*!**********************************!*\
102
+ !*** ./build/common/list-cfg.js ***!
103
+ \**********************************/
104
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
105
+
106
+ "use strict";
107
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ListConfig = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.82/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar list_1 = __webpack_require__(/*! ./list */ \"./build/common/list.js\");\r\n/**\r\n * List Configuration Generator\r\n */\r\nvar ListConfig = /** @class */ (function () {\r\n function ListConfig() {\r\n }\r\n // Generates the list configuration\r\n ListConfig.generate = function (srcWebUrl, srcList, showDialog) {\r\n var _this = this;\r\n if (showDialog === void 0) { showDialog = true; }\r\n // See if we are showing a loading dialog\r\n if (showDialog) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading List\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Getting the source list configuration...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Get the list information\r\n var list = new list_1.List({\r\n listName: srcList.Title,\r\n webUrl: srcWebUrl,\r\n itemQuery: { Filter: \"Id eq 0\" },\r\n onInitError: function () {\r\n // Reject the request\r\n reject(\"Error loading the list information. Please check your permission to the source list.\");\r\n },\r\n onInitialized: function () {\r\n var calcFields = [];\r\n var fields = {};\r\n var lookupFields = [];\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Analyzing the list information...\");\r\n // Create the configuration\r\n var cfgProps = {\r\n ListCfg: [{\r\n ListInformation: {\r\n AllowContentTypes: list.ListInfo.AllowContentTypes,\r\n BaseTemplate: list.ListInfo.BaseTemplate,\r\n ContentTypesEnabled: list.ListInfo.ContentTypesEnabled,\r\n Title: srcList.Title,\r\n Hidden: list.ListInfo.Hidden,\r\n NoCrawl: list.ListInfo.NoCrawl\r\n },\r\n ContentTypes: [],\r\n CustomFields: [],\r\n ViewInformation: []\r\n }]\r\n };\r\n // Parse the content types\r\n for (var i = 0; i < list.ListContentTypes.length; i++) {\r\n var ct = list.ListContentTypes[i];\r\n // Skip sealed content types\r\n if (ct.Sealed) {\r\n continue;\r\n }\r\n // Parse the content type fields\r\n var fieldRefs = [];\r\n for (var j = 0; j < ct.FieldLinks.results.length; j++) {\r\n var fldInfo = list.getField(ct.FieldLinks.results[j].Name);\r\n // See if this is a lookup field\r\n if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {\r\n // Ensure this isn't an associated lookup field\r\n if (fldInfo.IsDependentLookup != true) {\r\n // Append the field ref\r\n fieldRefs.push(fldInfo.InternalName);\r\n }\r\n }\r\n else {\r\n // Append the field ref\r\n fieldRefs.push(fldInfo.InternalName);\r\n }\r\n // Skip internal fields\r\n if (_this.InternalFields.indexOf(fldInfo.InternalName) >= 0) {\r\n continue;\r\n }\r\n // See if this is a calculated field\r\n if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Calculated) {\r\n // Add the field and continue the loop\r\n calcFields.push(fldInfo);\r\n }\r\n // Else, see if this is a lookup field\r\n else if (fldInfo.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {\r\n // Add the field\r\n lookupFields.push(fldInfo);\r\n }\r\n // Else, ensure the field hasn't been added\r\n else if (fields[fldInfo.InternalName] == null) {\r\n // Add the field information\r\n fields[fldInfo.InternalName] = true;\r\n cfgProps.ListCfg[0].CustomFields.push({\r\n name: fldInfo.InternalName,\r\n schemaXml: fldInfo.SchemaXml\r\n });\r\n }\r\n }\r\n // Add the list content type\r\n cfgProps.ListCfg[0].ContentTypes.push({\r\n Name: ct.Name,\r\n Description: ct.Description,\r\n ParentName: ct.Name,\r\n FieldRefs: fieldRefs\r\n });\r\n }\r\n // Parse the views\r\n for (var i = 0; i < list.ListViews.length; i++) {\r\n var viewInfo = list.ListViews[i];\r\n // Skip hidden views\r\n if (viewInfo.Hidden) {\r\n continue;\r\n }\r\n // Parse the fields\r\n for (var j = 0; j < viewInfo.ViewFields.Items.results.length; j++) {\r\n var field = list.getField(viewInfo.ViewFields.Items.results[j]);\r\n // Ensure the field exists\r\n if (fields[field.InternalName] == null) {\r\n // See if this is a calculated field\r\n if (field.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Calculated) {\r\n // Add the field and continue the loop\r\n calcFields.push(field);\r\n }\r\n // Else, see if this is a lookup field\r\n else if (field.FieldTypeKind == gd_sprest_bs_1.SPTypes.FieldType.Lookup) {\r\n // Add the field\r\n lookupFields.push(field);\r\n }\r\n else {\r\n // Append the field\r\n fields[field.InternalName] = true;\r\n cfgProps.ListCfg[0].CustomFields.push({\r\n name: field.InternalName,\r\n schemaXml: field.SchemaXml\r\n });\r\n }\r\n }\r\n }\r\n // Add the view\r\n cfgProps.ListCfg[0].ViewInformation.push({\r\n Default: viewInfo.DefaultView,\r\n Hidden: viewInfo.Hidden,\r\n JSLink: viewInfo.JSLink,\r\n MobileDefaultView: viewInfo.MobileDefaultView,\r\n MobileView: viewInfo.MobileView,\r\n RowLimit: viewInfo.RowLimit,\r\n Tabular: viewInfo.TabularView,\r\n ViewName: viewInfo.Title,\r\n ViewFields: viewInfo.ViewFields.Items.results,\r\n ViewQuery: viewInfo.ViewQuery\r\n });\r\n }\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Analyzing the lookup fields...\");\r\n // Parse the lookup fields\r\n gd_sprest_bs_1.Helper.Executor(lookupFields, function (lookupField) {\r\n // Skip the field, if it was already added\r\n if (fields[lookupField.InternalName]) {\r\n return;\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the lookup list\r\n (0, gd_sprest_bs_1.Web)(srcWebUrl).Lists().getById(lookupField.LookupList).execute(function (list) {\r\n // Add the lookup list field\r\n fields[lookupField.InternalName] = true;\r\n cfgProps.ListCfg[0].CustomFields.push({\r\n description: lookupField.Description,\r\n fieldRef: lookupField.PrimaryFieldId,\r\n hidden: lookupField.Hidden,\r\n id: lookupField.Id,\r\n indexed: lookupField.Indexed,\r\n listName: list.Title,\r\n multi: lookupField.AllowMultipleValues,\r\n name: lookupField.InternalName,\r\n readOnly: lookupField.ReadOnlyField,\r\n relationshipBehavior: lookupField.RelationshipDeleteBehavior,\r\n required: lookupField.Required,\r\n showField: lookupField.LookupField,\r\n title: lookupField.Title,\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Lookup\r\n });\r\n // Check the next field\r\n resolve(null);\r\n }, function (err) {\r\n // Broken lookup field, don't add it\r\n console.log(\"Error trying to find lookup list for field '\" + lookupField.InternalName + \"' with id: \" + lookupField.LookupList);\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Analyzing the calculated fields...\");\r\n // Parse the calculated fields\r\n for (var i = 0; i < calcFields.length; i++) {\r\n var calcField = calcFields[i];\r\n if (fields[calcField.InternalName] == null) {\r\n var parser = new DOMParser();\r\n var schemaXml = parser.parseFromString(calcField.SchemaXml, \"application/xml\");\r\n // Get the formula\r\n var formula = schemaXml.querySelector(\"Formula\");\r\n // Parse the field refs\r\n var fieldRefs = schemaXml.querySelectorAll(\"FieldRef\");\r\n for (var j = 0; j < fieldRefs.length; j++) {\r\n var fieldRef = fieldRefs[j].getAttribute(\"Name\");\r\n // Ensure the field exists\r\n var field = list.getField(fieldRef);\r\n if (field) {\r\n // Calculated formulas are supposed to contain the display name\r\n // Replace any instance of the internal field w/ the correct format\r\n var regexp = new RegExp(fieldRef, \"g\");\r\n formula.innerHTML = formula.innerHTML.replace(regexp, \"[\" + field.Title + \"]\");\r\n }\r\n }\r\n // Append the field\r\n fields[calcField.InternalName] = true;\r\n cfgProps.ListCfg[0].CustomFields.push({\r\n name: calcField.InternalName,\r\n schemaXml: schemaXml.querySelector(\"Field\").outerHTML\r\n });\r\n }\r\n }\r\n // Hide the loading dialog\r\n showDialog ? loadingDialog_1.LoadingDialog.hide() : null;\r\n // Resolve the request\r\n resolve({\r\n cfg: cfgProps,\r\n lookupFields: lookupFields\r\n });\r\n });\r\n }\r\n });\r\n });\r\n };\r\n // Internal Fields\r\n ListConfig.InternalFields = [\r\n \"ContentType\", \"TaxCatchAll\", \"TaxCatchAllLabel\", \"Title\"\r\n ];\r\n return ListConfig;\r\n}());\r\nexports.ListConfig = ListConfig;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/list-cfg.js?");
108
+
109
+ /***/ }),
110
+
100
111
  /***/ "./build/common/list.js":
101
112
  /*!******************************!*\
102
113
  !*** ./build/common/list.js ***!