dattatable 2.10.54 → 2.10.55

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 (64) hide show
  1. package/build/common/list.js +1 -1
  2. package/build/common/listCfg.js +1 -1
  3. package/dist/dattatable.js +2 -2
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/classes/Accordion.html +2 -2
  6. package/docs/classes/AuditLog.html +2 -2
  7. package/docs/classes/CanvasForm.html +2 -2
  8. package/docs/classes/Comments.html +2 -2
  9. package/docs/classes/Dashboard.html +4 -4
  10. package/docs/classes/DataTable.html +3 -3
  11. package/docs/classes/Documents.html +6 -6
  12. package/docs/classes/FilterSlideout.html +2 -2
  13. package/docs/classes/Footer.html +2 -2
  14. package/docs/classes/Header.html +2 -2
  15. package/docs/classes/InstallationRequired.html +2 -2
  16. package/docs/classes/ItemForm.html +4 -4
  17. package/docs/classes/List.html +4 -4
  18. package/docs/classes/ListConfig.html +2 -2
  19. package/docs/classes/ListSecurity.html +2 -2
  20. package/docs/classes/LoadingDialog.html +2 -2
  21. package/docs/classes/Modal.html +2 -2
  22. package/docs/classes/Navigation.html +3 -3
  23. package/docs/classes/Tiles.html +2 -2
  24. package/docs/classes/Timeout.html +2 -2
  25. package/docs/enums/ActionButtonTypes.html +2 -2
  26. package/docs/functions/formatBytes.html +1 -1
  27. package/docs/functions/formatDateValue.html +1 -1
  28. package/docs/functions/formatTimeValue.html +1 -1
  29. package/docs/functions/getContextInfo.html +1 -1
  30. package/docs/functions/getFileExt.html +1 -1
  31. package/docs/functions/waitForTheme.html +1 -1
  32. package/docs/interfaces/IAccordion.html +2 -2
  33. package/docs/interfaces/IAccordionProps.html +2 -2
  34. package/docs/interfaces/IAuditLogItem.html +2 -2
  35. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  36. package/docs/interfaces/IAuditLogProps.html +2 -2
  37. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  38. package/docs/interfaces/ICommentsItem.html +2 -2
  39. package/docs/interfaces/IDashboardProps.html +2 -2
  40. package/docs/interfaces/IDataTable.html +2 -2
  41. package/docs/interfaces/IDataTableProps.html +2 -2
  42. package/docs/interfaces/IDocumentsProps.html +2 -2
  43. package/docs/interfaces/IFilterItem.html +2 -2
  44. package/docs/interfaces/IFilterProps.html +2 -2
  45. package/docs/interfaces/IFooterProps.html +2 -2
  46. package/docs/interfaces/IHeaderProps.html +2 -2
  47. package/docs/interfaces/IInstallProps.html +2 -2
  48. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  49. package/docs/interfaces/IItemFormEditProps.html +2 -2
  50. package/docs/interfaces/IItemFormTab.html +2 -2
  51. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  52. package/docs/interfaces/IItemFormViewProps.html +2 -2
  53. package/docs/interfaces/IListConfig.html +2 -2
  54. package/docs/interfaces/IListConfigProps.html +2 -2
  55. package/docs/interfaces/IListProps.html +2 -2
  56. package/docs/interfaces/IListSecurity.html +2 -2
  57. package/docs/interfaces/IListSecurityItem.html +2 -2
  58. package/docs/interfaces/IShowDialogProps.html +2 -2
  59. package/docs/interfaces/ITiles.html +2 -2
  60. package/docs/interfaces/ITilesProps.html +2 -2
  61. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  62. package/docs/variables/DattaTable.html +1 -1
  63. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  64. package/package.json +1 -1
@@ -301,7 +301,7 @@ var List = /** @class */ (function () {
301
301
  }, true);
302
302
  // Query the content types
303
303
  list.ContentTypes().query({
304
- Expand: ["FieldLinks", "Fields"]
304
+ Expand: ["FieldLinks", "Fields", "Parent"]
305
305
  }).execute(function (cts) {
306
306
  // Save the content types
307
307
  _this._listContentTypes = cts.results;
@@ -26,7 +26,7 @@ var ListConfig = /** @class */ (function () {
26
26
  var list = new list_1.List({
27
27
  listName: props.srcList.Title,
28
28
  webUrl: props.srcWebUrl,
29
- itemQuery: { Expand: ["ContentTypes/Parent"], Filter: "Id eq 0" },
29
+ itemQuery: { Filter: "Id eq 0" },
30
30
  onInitError: function () {
31
31
  // Reject the request
32
32
  reject("Error loading the list information. Please check your permission to the source list.");
@@ -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.11.82/node_modules/gd-sprest-bs/build/index.js\");\r\nvar _1 = __webpack_require__(/*! . */ \"./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 /** Public Properties */\r\n // CAML query\r\n this._camlQuery = null;\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 Url\r\n this._listUrl = 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 // View name\r\n this._viewName = null;\r\n // View Xml\r\n this._viewXml = null;\r\n // Web Url\r\n this._webUrl = null;\r\n /** Private Properties */\r\n // Error event when loading the items fail\r\n this._onInitError = null;\r\n // Event triggered when the component is initialized\r\n this._onInitialized = null;\r\n // Items loading event\r\n this._onItemLoading = 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 // Refresh event when refreshing the items\r\n this._onRefreshItems = null;\r\n // Event triggered when the form is reset\r\n this._onResetForm = null;\r\n // The request digest value of the target site\r\n this._requestDigest = null;\r\n // Save the properties\r\n this._camlQuery = props.camlQuery;\r\n this._listName = props.listName;\r\n this._odata = props.itemQuery;\r\n this._onInitError = props.onInitError;\r\n this._onInitialized = props.onInitialized;\r\n this._onItemLoading = props.onItemLoading;\r\n this._onItemsLoaded = props.onItemsLoaded;\r\n this._onLoadFormError = props.onLoadFormError;\r\n this._onRefreshItems = props.onRefreshItems;\r\n this._onResetForm = props.onResetForm;\r\n this._viewName = props.viewName;\r\n this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;\r\n // Set the context information\r\n (0, _1.getContextInfo)(props.webUrl).then(function (requestDigest) {\r\n _this._requestDigest = requestDigest;\r\n // Load the list information\r\n _this.init().then(function () {\r\n // Load the items\r\n _this.loadItems().then(function () {\r\n // Call the event\r\n _this._onInitialized ? _this._onInitialized() : null;\r\n // Call the items loaded event\r\n _this._onItemsLoaded ? _this._onItemsLoaded(_this.Items) : null;\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\r\n }\r\n Object.defineProperty(List.prototype, \"CAMLQuery\", {\r\n get: function () { return this._camlQuery; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"EditForm\", {\r\n // Reference to the edit form\r\n get: function () { return _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 _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, \"ListSettingsUrl\", {\r\n // List Settings Url\r\n get: function () { return \"\".concat(this.WebUrl, \"/\").concat(gd_sprest_bs_1.ContextInfo.layoutsUrl, \"/listedit.aspx?List=\").concat(this.ListInfo.Id); },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListUrl\", {\r\n get: function () { return this._listUrl; },\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 _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 _1.ItemForm.DisplayForms; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewName\", {\r\n get: function () { return this._viewName; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewXml\", {\r\n get: function () { return this._viewXml; },\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 (props) {\r\n // Ensure we are not rendering to a specified element\r\n if (props.elForm == null) {\r\n // Clear the modal/form\r\n var useModal = typeof (props.useModal) === \"boolean\" ? props.useModal : _1.ItemForm.UseModal;\r\n useModal ? _1.Modal.clear() : _1.CanvasForm.clear();\r\n }\r\n // Set the list name\r\n _1.ItemForm.ListName = this.ListName;\r\n // Call the event\r\n this._onResetForm ? this._onResetForm() : null;\r\n };\r\n // Reference to the create item method\r\n List.prototype.createItem = function (values) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Create the item\r\n _this.ListInfo.Items().add(values).execute(resolve, reject);\r\n });\r\n };\r\n // Deletes the item and removes it from the internal items array\r\n List.prototype.deleteItem = function (itemId) {\r\n var _this = this;\r\n // Parse the items\r\n for (var i = 0; i < this.Items.length; i++) {\r\n var item = this.Items[i];\r\n // See if this is the target item\r\n if (item[\"Id\"] == itemId || item[\"ID\"] == itemId) {\r\n // Remove the item\r\n this.Items.splice(i, 1);\r\n break;\r\n }\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Delete the item\r\n _this.ListInfo.Items(itemId).delete().execute(resolve, reject);\r\n });\r\n };\r\n // Displays the edit form\r\n List.prototype.editForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _1.ItemForm.edit(props).then(null, this._onLoadFormError);\r\n };\r\n // Gets a list field by internal or title\r\n List.prototype.getField = function (name) {\r\n var titleField = null;\r\n // Parse the fields\r\n for (var i = 0; i < this.ListFields.length; i++) {\r\n var field = this.ListFields[i];\r\n // Try to find the field by internal name first\r\n if (field.InternalName == name) {\r\n // Return the field if we match by internal\r\n return field;\r\n }\r\n // Else, see if the title field matches and save a reference\r\n else if (field.Title == name) {\r\n // Save the field reference\r\n titleField = field;\r\n }\r\n }\r\n // Return the title field if it was found\r\n return titleField;\r\n };\r\n // Gets a list item by id\r\n List.prototype.getItem = function (id) {\r\n // Parse the items\r\n for (var i = 0; i < this.Items.length; i++) {\r\n var item = this.Items[i];\r\n // See if this is the target item\r\n if (item[\"Id\"] == id || item[\"ID\"] == id) {\r\n // Return the item\r\n return item;\r\n }\r\n }\r\n // Not found\r\n return null;\r\n };\r\n // Initializes the list component\r\n List.prototype.init = function () {\r\n var _this = this;\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, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName);\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 }, 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 // Reject the request\r\n reject.apply(void 0, args);\r\n });\r\n // Get the root folder\r\n list.RootFolder().execute(function (folder) {\r\n // Set the url\r\n _this._listUrl = folder.ServerRelativeUrl;\r\n }, true);\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: [\"ViewFields\"]\r\n }).execute(function (views) {\r\n // Save the views\r\n _this._listViews = views.results;\r\n }, true);\r\n // Wait for the requests to complete\r\n list.done(function () {\r\n // See if the view name is specified\r\n if (_this.ViewName) {\r\n // Parse the views\r\n for (var i = 0; i < _this.ListViews.length; i++) {\r\n var view = _this.ListViews[i];\r\n if (view.Title.toLowerCase() == _this.ViewName.toLowerCase()) {\r\n // Set the view xml\r\n _this._viewXml = view.ListViewXml;\r\n }\r\n }\r\n }\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Loads the items\r\n List.prototype.loadItem = function (itemId, 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 // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).Items(itemId).query({\r\n Custom: query ? query.Custom : null,\r\n Expand: query ? query.Expand : null,\r\n Select: query ? query.Select : null\r\n }).execute(function (newItem) {\r\n var itemFound = false;\r\n // Parse the items\r\n for (var i = 0; i < _this._items.length; i++) {\r\n var item = _this._items[i];\r\n // See if this is the item\r\n if (itemId == item.Id) {\r\n // Call the event\r\n _this._onItemLoading ? _this._onItemLoading(newItem) : null;\r\n // Replace the item\r\n _this._items[i] = newItem;\r\n // Set the flag and break from the loop\r\n itemFound = true;\r\n break;\r\n }\r\n }\r\n // See if the item wasn't found\r\n if (!itemFound) {\r\n // Append the item\r\n _this._items.push(newItem);\r\n }\r\n // Resolve the request\r\n resolve(newItem);\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items\r\n List.prototype.loadItems = function (query) {\r\n // See if the caml query exists\r\n if (this.CAMLQuery) {\r\n return this.loadItemsByCAMLQuery();\r\n }\r\n // Else, see if the view xml exists\r\n else if (this.ViewXml) {\r\n // Get the items by the view name\r\n return this.loadItemsByView();\r\n }\r\n else {\r\n // Get the items by odata\r\n return this.loadItemsByQuery(query);\r\n }\r\n };\r\n // Loads the items by CAML query\r\n List.prototype.loadItemsByCAMLQuery = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the items already exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).getItemsByQuery(_this.CAMLQuery).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items by odata query\r\n List.prototype.loadItemsByQuery = 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 // See if the items exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items().query(query).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items by view name\r\n List.prototype.loadItemsByView = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the items already exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // 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.newForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _1.ItemForm.create(props).then(null, this._onLoadFormError);\r\n };\r\n // Refresh the data\r\n List.prototype.refresh = function (query) {\r\n var _this = this;\r\n if (query === void 0) { query = this.OData; }\r\n // Clear the items\r\n this._items = null;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Refresh the context information\r\n _this.refreshContextInfo().then(function () {\r\n // Load the data\r\n _this.loadItems(query).then(function (items) {\r\n // Call the event\r\n var callback = _this._onRefreshItems ? _this._onRefreshItems(items) : null;\r\n if (callback && typeof (callback.then) === \"function\") {\r\n // Wait for the request to complete\r\n callback.then(resolve, reject);\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(items);\r\n }\r\n }, reject);\r\n }, reject);\r\n });\r\n };\r\n // Refreshes the context information\r\n List.prototype.refreshContextInfo = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the request digest is set\r\n if (_this._requestDigest) {\r\n // Get the context information\r\n (0, _1.getContextInfo)(_this.WebUrl).then(function (requestDigest) {\r\n // Save the value and resolve the request\r\n _this._requestDigest = requestDigest;\r\n resolve();\r\n }, reject);\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Refresh the data\r\n List.prototype.refreshItem = function (itemId, query) {\r\n if (query === void 0) { query = this.OData; }\r\n // Load the item\r\n return this.loadItem(itemId, query);\r\n };\r\n // Updates an item\r\n List.prototype.updateItem = function (itemId, values) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Create the item\r\n _this.ListInfo.Items(itemId).update(values).execute(resolve, reject);\r\n });\r\n };\r\n // Displays the view form\r\n List.prototype.viewForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _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?");
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.11.82/node_modules/gd-sprest-bs/build/index.js\");\r\nvar _1 = __webpack_require__(/*! . */ \"./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 /** Public Properties */\r\n // CAML query\r\n this._camlQuery = null;\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 Url\r\n this._listUrl = 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 // View name\r\n this._viewName = null;\r\n // View Xml\r\n this._viewXml = null;\r\n // Web Url\r\n this._webUrl = null;\r\n /** Private Properties */\r\n // Error event when loading the items fail\r\n this._onInitError = null;\r\n // Event triggered when the component is initialized\r\n this._onInitialized = null;\r\n // Items loading event\r\n this._onItemLoading = 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 // Refresh event when refreshing the items\r\n this._onRefreshItems = null;\r\n // Event triggered when the form is reset\r\n this._onResetForm = null;\r\n // The request digest value of the target site\r\n this._requestDigest = null;\r\n // Save the properties\r\n this._camlQuery = props.camlQuery;\r\n this._listName = props.listName;\r\n this._odata = props.itemQuery;\r\n this._onInitError = props.onInitError;\r\n this._onInitialized = props.onInitialized;\r\n this._onItemLoading = props.onItemLoading;\r\n this._onItemsLoaded = props.onItemsLoaded;\r\n this._onLoadFormError = props.onLoadFormError;\r\n this._onRefreshItems = props.onRefreshItems;\r\n this._onResetForm = props.onResetForm;\r\n this._viewName = props.viewName;\r\n this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;\r\n // Set the context information\r\n (0, _1.getContextInfo)(props.webUrl).then(function (requestDigest) {\r\n _this._requestDigest = requestDigest;\r\n // Load the list information\r\n _this.init().then(function () {\r\n // Load the items\r\n _this.loadItems().then(function () {\r\n // Call the event\r\n _this._onInitialized ? _this._onInitialized() : null;\r\n // Call the items loaded event\r\n _this._onItemsLoaded ? _this._onItemsLoaded(_this.Items) : null;\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\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 init error event\r\n _this._onInitError ? _this._onInitError.apply(_this, args) : null;\r\n });\r\n }\r\n Object.defineProperty(List.prototype, \"CAMLQuery\", {\r\n get: function () { return this._camlQuery; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"EditForm\", {\r\n // Reference to the edit form\r\n get: function () { return _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 _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, \"ListSettingsUrl\", {\r\n // List Settings Url\r\n get: function () { return \"\".concat(this.WebUrl, \"/\").concat(gd_sprest_bs_1.ContextInfo.layoutsUrl, \"/listedit.aspx?List=\").concat(this.ListInfo.Id); },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ListUrl\", {\r\n get: function () { return this._listUrl; },\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 _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 _1.ItemForm.DisplayForms; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewName\", {\r\n get: function () { return this._viewName; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(List.prototype, \"ViewXml\", {\r\n get: function () { return this._viewXml; },\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 (props) {\r\n // Ensure we are not rendering to a specified element\r\n if (props.elForm == null) {\r\n // Clear the modal/form\r\n var useModal = typeof (props.useModal) === \"boolean\" ? props.useModal : _1.ItemForm.UseModal;\r\n useModal ? _1.Modal.clear() : _1.CanvasForm.clear();\r\n }\r\n // Set the list name\r\n _1.ItemForm.ListName = this.ListName;\r\n // Call the event\r\n this._onResetForm ? this._onResetForm() : null;\r\n };\r\n // Reference to the create item method\r\n List.prototype.createItem = function (values) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Create the item\r\n _this.ListInfo.Items().add(values).execute(resolve, reject);\r\n });\r\n };\r\n // Deletes the item and removes it from the internal items array\r\n List.prototype.deleteItem = function (itemId) {\r\n var _this = this;\r\n // Parse the items\r\n for (var i = 0; i < this.Items.length; i++) {\r\n var item = this.Items[i];\r\n // See if this is the target item\r\n if (item[\"Id\"] == itemId || item[\"ID\"] == itemId) {\r\n // Remove the item\r\n this.Items.splice(i, 1);\r\n break;\r\n }\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Delete the item\r\n _this.ListInfo.Items(itemId).delete().execute(resolve, reject);\r\n });\r\n };\r\n // Displays the edit form\r\n List.prototype.editForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _1.ItemForm.edit(props).then(null, this._onLoadFormError);\r\n };\r\n // Gets a list field by internal or title\r\n List.prototype.getField = function (name) {\r\n var titleField = null;\r\n // Parse the fields\r\n for (var i = 0; i < this.ListFields.length; i++) {\r\n var field = this.ListFields[i];\r\n // Try to find the field by internal name first\r\n if (field.InternalName == name) {\r\n // Return the field if we match by internal\r\n return field;\r\n }\r\n // Else, see if the title field matches and save a reference\r\n else if (field.Title == name) {\r\n // Save the field reference\r\n titleField = field;\r\n }\r\n }\r\n // Return the title field if it was found\r\n return titleField;\r\n };\r\n // Gets a list item by id\r\n List.prototype.getItem = function (id) {\r\n // Parse the items\r\n for (var i = 0; i < this.Items.length; i++) {\r\n var item = this.Items[i];\r\n // See if this is the target item\r\n if (item[\"Id\"] == id || item[\"ID\"] == id) {\r\n // Return the item\r\n return item;\r\n }\r\n }\r\n // Not found\r\n return null;\r\n };\r\n // Initializes the list component\r\n List.prototype.init = function () {\r\n var _this = this;\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, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName);\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 }, 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 // Reject the request\r\n reject.apply(void 0, args);\r\n });\r\n // Get the root folder\r\n list.RootFolder().execute(function (folder) {\r\n // Set the url\r\n _this._listUrl = folder.ServerRelativeUrl;\r\n }, true);\r\n // Query the content types\r\n list.ContentTypes().query({\r\n Expand: [\"FieldLinks\", \"Fields\", \"Parent\"]\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: [\"ViewFields\"]\r\n }).execute(function (views) {\r\n // Save the views\r\n _this._listViews = views.results;\r\n }, true);\r\n // Wait for the requests to complete\r\n list.done(function () {\r\n // See if the view name is specified\r\n if (_this.ViewName) {\r\n // Parse the views\r\n for (var i = 0; i < _this.ListViews.length; i++) {\r\n var view = _this.ListViews[i];\r\n if (view.Title.toLowerCase() == _this.ViewName.toLowerCase()) {\r\n // Set the view xml\r\n _this._viewXml = view.ListViewXml;\r\n }\r\n }\r\n }\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Loads the items\r\n List.prototype.loadItem = function (itemId, 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 // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).Items(itemId).query({\r\n Custom: query ? query.Custom : null,\r\n Expand: query ? query.Expand : null,\r\n Select: query ? query.Select : null\r\n }).execute(function (newItem) {\r\n var itemFound = false;\r\n // Parse the items\r\n for (var i = 0; i < _this._items.length; i++) {\r\n var item = _this._items[i];\r\n // See if this is the item\r\n if (itemId == item.Id) {\r\n // Call the event\r\n _this._onItemLoading ? _this._onItemLoading(newItem) : null;\r\n // Replace the item\r\n _this._items[i] = newItem;\r\n // Set the flag and break from the loop\r\n itemFound = true;\r\n break;\r\n }\r\n }\r\n // See if the item wasn't found\r\n if (!itemFound) {\r\n // Append the item\r\n _this._items.push(newItem);\r\n }\r\n // Resolve the request\r\n resolve(newItem);\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items\r\n List.prototype.loadItems = function (query) {\r\n // See if the caml query exists\r\n if (this.CAMLQuery) {\r\n return this.loadItemsByCAMLQuery();\r\n }\r\n // Else, see if the view xml exists\r\n else if (this.ViewXml) {\r\n // Get the items by the view name\r\n return this.loadItemsByView();\r\n }\r\n else {\r\n // Get the items by odata\r\n return this.loadItemsByQuery(query);\r\n }\r\n };\r\n // Loads the items by CAML query\r\n List.prototype.loadItemsByCAMLQuery = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the items already exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).getItemsByQuery(_this.CAMLQuery).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items by odata query\r\n List.prototype.loadItemsByQuery = 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 // See if the items exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items().query(query).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // Reject the request\r\n reject.apply(void 0, args);\r\n }, true);\r\n });\r\n };\r\n // Loads the items by view name\r\n List.prototype.loadItemsByView = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the items already exist\r\n if (_this._items) {\r\n resolve(_this._items);\r\n return;\r\n }\r\n // Query the items\r\n (0, gd_sprest_bs_1.Web)(_this.WebUrl, {\r\n disableCache: true,\r\n requestDigest: _this._requestDigest\r\n }).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {\r\n // See if the event exists\r\n if (_this._onItemLoading) {\r\n // Parse the items\r\n for (var i = 0; i < items.results.length; i++) {\r\n // Call the event\r\n _this._onItemLoading(items.results[i]);\r\n }\r\n }\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 // 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.newForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _1.ItemForm.create(props).then(null, this._onLoadFormError);\r\n };\r\n // Refresh the data\r\n List.prototype.refresh = function (query) {\r\n var _this = this;\r\n if (query === void 0) { query = this.OData; }\r\n // Clear the items\r\n this._items = null;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Refresh the context information\r\n _this.refreshContextInfo().then(function () {\r\n // Load the data\r\n _this.loadItems(query).then(function (items) {\r\n // Call the event\r\n var callback = _this._onRefreshItems ? _this._onRefreshItems(items) : null;\r\n if (callback && typeof (callback.then) === \"function\") {\r\n // Wait for the request to complete\r\n callback.then(resolve, reject);\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(items);\r\n }\r\n }, reject);\r\n }, reject);\r\n });\r\n };\r\n // Refreshes the context information\r\n List.prototype.refreshContextInfo = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if the request digest is set\r\n if (_this._requestDigest) {\r\n // Get the context information\r\n (0, _1.getContextInfo)(_this.WebUrl).then(function (requestDigest) {\r\n // Save the value and resolve the request\r\n _this._requestDigest = requestDigest;\r\n resolve();\r\n }, reject);\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Refresh the data\r\n List.prototype.refreshItem = function (itemId, query) {\r\n if (query === void 0) { query = this.OData; }\r\n // Load the item\r\n return this.loadItem(itemId, query);\r\n };\r\n // Updates an item\r\n List.prototype.updateItem = function (itemId, values) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Create the item\r\n _this.ListInfo.Items(itemId).update(values).execute(resolve, reject);\r\n });\r\n };\r\n // Displays the view form\r\n List.prototype.viewForm = function (props) {\r\n // Clear the modal/canvas\r\n this.clear(props);\r\n // Display the form\r\n _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
 
@@ -115,7 +115,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
115
115
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
116
116
 
117
117
  "use strict";
118
- 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 (props) {\r\n var _this = this;\r\n // See if we are showing a loading dialog\r\n if (props.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: props.srcList.Title,\r\n webUrl: props.srcWebUrl,\r\n itemQuery: { Expand: [\"ContentTypes/Parent\"], 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: props.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.Parent.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)(props.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 props.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 // Validates the lookup fields\r\n ListConfig.validateLookups = function (props) {\r\n var _this = this;\r\n // See if we are showing a loading dialog\r\n if (props.showDialog) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Validating Lookup Lists\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Validating the required lookup lists have been added...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n }\r\n // Keep track of the lookup lists we are searching for\r\n var lookupLists = {};\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Parse the lookup fields\r\n gd_sprest_bs_1.Helper.Executor(props.lookupFields, function (lookupField) {\r\n var _a;\r\n // Ensure this lookup isn't to the source list\r\n if (((_a = lookupField.LookupList) === null || _a === void 0 ? void 0 : _a.indexOf(props.srcList.Id)) >= 0) {\r\n return;\r\n }\r\n // See if we have already checked this list\r\n var listId = (lookupField.LookupList || \"\").replace(/{|}/g, '');\r\n if (lookupLists[listId]) {\r\n return;\r\n }\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Getting the lookup list for: \" + lookupField.InternalName) : null;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Get the source list\r\n (0, gd_sprest_bs_1.Web)(props.srcWebUrl).Lists().getById(lookupField.LookupList).execute(function (list) {\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Checking the destination web for: \" + list.Title) : null;\r\n // Ensure the list exists in the destination\r\n (0, gd_sprest_bs_1.Web)(props.dstUrl).Lists(list.Title).execute(function () {\r\n // Set the flag\r\n lookupLists[list.Id] = true;\r\n // Check the next list\r\n resolve(null);\r\n }, function () {\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Generating the configuration for: \" + list.Title) : null;\r\n // Generate the lookup list configuration\r\n _this.generate({\r\n srcList: list,\r\n srcWebUrl: props.srcWebUrl,\r\n showDialog: false\r\n }).then(\r\n // Success\r\n function (cfg) {\r\n // Set the flag\r\n lookupLists[list.Id] = true;\r\n // Append the list configuration\r\n props.cfg.ListCfg.push(cfg.cfg.ListCfg[0]);\r\n // Check the next list\r\n resolve(null);\r\n }, \r\n // Error\r\n function () {\r\n // Reject the reqeust\r\n reject(\"Lookup list '\" + list.Title + \"' for field '\" + lookupField.InternalName + \"' does not exist in the configuration. Please add the lists in the appropriate order.\");\r\n });\r\n });\r\n }, function () {\r\n // Reject the reqeust\r\n reject(\"Lookup list for field '\" + lookupField.InternalName + \"' does not exist in the source web. Please review the source list for any issues.\");\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(props.cfg);\r\n }, reject);\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/listCfg.js?");
118
+ 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 (props) {\r\n var _this = this;\r\n // See if we are showing a loading dialog\r\n if (props.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: props.srcList.Title,\r\n webUrl: props.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: props.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.Parent.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)(props.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 props.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 // Validates the lookup fields\r\n ListConfig.validateLookups = function (props) {\r\n var _this = this;\r\n // See if we are showing a loading dialog\r\n if (props.showDialog) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Validating Lookup Lists\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Validating the required lookup lists have been added...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n }\r\n // Keep track of the lookup lists we are searching for\r\n var lookupLists = {};\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Parse the lookup fields\r\n gd_sprest_bs_1.Helper.Executor(props.lookupFields, function (lookupField) {\r\n var _a;\r\n // Ensure this lookup isn't to the source list\r\n if (((_a = lookupField.LookupList) === null || _a === void 0 ? void 0 : _a.indexOf(props.srcList.Id)) >= 0) {\r\n return;\r\n }\r\n // See if we have already checked this list\r\n var listId = (lookupField.LookupList || \"\").replace(/{|}/g, '');\r\n if (lookupLists[listId]) {\r\n return;\r\n }\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Getting the lookup list for: \" + lookupField.InternalName) : null;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Get the source list\r\n (0, gd_sprest_bs_1.Web)(props.srcWebUrl).Lists().getById(lookupField.LookupList).execute(function (list) {\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Checking the destination web for: \" + list.Title) : null;\r\n // Ensure the list exists in the destination\r\n (0, gd_sprest_bs_1.Web)(props.dstUrl).Lists(list.Title).execute(function () {\r\n // Set the flag\r\n lookupLists[list.Id] = true;\r\n // Check the next list\r\n resolve(null);\r\n }, function () {\r\n // Updated the loading dialog\r\n props.showDialog ? loadingDialog_1.LoadingDialog.setBody(\"Generating the configuration for: \" + list.Title) : null;\r\n // Generate the lookup list configuration\r\n _this.generate({\r\n srcList: list,\r\n srcWebUrl: props.srcWebUrl,\r\n showDialog: false\r\n }).then(\r\n // Success\r\n function (cfg) {\r\n // Set the flag\r\n lookupLists[list.Id] = true;\r\n // Append the list configuration\r\n props.cfg.ListCfg.push(cfg.cfg.ListCfg[0]);\r\n // Check the next list\r\n resolve(null);\r\n }, \r\n // Error\r\n function () {\r\n // Reject the reqeust\r\n reject(\"Lookup list '\" + list.Title + \"' for field '\" + lookupField.InternalName + \"' does not exist in the configuration. Please add the lists in the appropriate order.\");\r\n });\r\n });\r\n }, function () {\r\n // Reject the reqeust\r\n reject(\"Lookup list for field '\" + lookupField.InternalName + \"' does not exist in the source web. Please review the source list for any issues.\");\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(props.cfg);\r\n }, reject);\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/listCfg.js?");
119
119
 
120
120
  /***/ }),
121
121