dattatable 2.9.34 → 2.9.36

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 (56) hide show
  1. package/build/common/installRequired.d.ts +0 -1
  2. package/build/common/installRequired.js +0 -10
  3. package/build/dashboard/table.js +5 -2
  4. package/dist/dattatable.js +2 -2
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +3 -3
  12. package/docs/classes/Documents.html +6 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -3
  17. package/docs/classes/ItemForm.html +4 -4
  18. package/docs/classes/List.html +4 -4
  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/Timeout.html +2 -2
  24. package/docs/enums/ActionButtonTypes.html +2 -2
  25. package/docs/functions/formatBytes.html +1 -1
  26. package/docs/functions/formatDateValue.html +1 -1
  27. package/docs/functions/formatTimeValue.html +1 -1
  28. package/docs/functions/getContextInfo.html +1 -1
  29. package/docs/functions/getFileExt.html +1 -1
  30. package/docs/functions/waitForTheme.html +1 -1
  31. package/docs/interfaces/IAuditLogItem.html +2 -2
  32. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  33. package/docs/interfaces/IAuditLogProps.html +2 -2
  34. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  35. package/docs/interfaces/ICommentsItem.html +2 -2
  36. package/docs/interfaces/IDashboardProps.html +2 -2
  37. package/docs/interfaces/IDataTable.html +2 -2
  38. package/docs/interfaces/IDataTableProps.html +2 -2
  39. package/docs/interfaces/IDocumentsProps.html +2 -2
  40. package/docs/interfaces/IFilterItem.html +2 -2
  41. package/docs/interfaces/IFilterProps.html +2 -2
  42. package/docs/interfaces/IFooterProps.html +2 -2
  43. package/docs/interfaces/IHeaderProps.html +2 -2
  44. package/docs/interfaces/IInstallProps.html +2 -2
  45. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  46. package/docs/interfaces/IItemFormEditProps.html +2 -2
  47. package/docs/interfaces/IItemFormTab.html +2 -2
  48. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  49. package/docs/interfaces/IItemFormViewProps.html +2 -2
  50. package/docs/interfaces/IListProps.html +2 -2
  51. package/docs/interfaces/IListSecurity.html +2 -2
  52. package/docs/interfaces/IListSecurityItem.html +2 -2
  53. package/docs/interfaces/IShowDialogProps.html +2 -2
  54. package/docs/variables/DattaTable.html +1 -1
  55. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  56. package/package.json +1 -1
@@ -29,5 +29,4 @@ export declare class InstallationRequired {
29
29
  static requiresInstall(props: IInstallProps): PromiseLike<boolean>;
30
30
  static showDialog(props?: IShowDialogProps): void;
31
31
  private static showErrorDialog;
32
- private static showNoAccessDialog;
33
32
  }
@@ -217,8 +217,6 @@ var InstallationRequired = /** @class */ (function () {
217
217
  _this.isOwnerOrAdmin().then(function (hasPermissions) {
218
218
  // See if they are not an owner or admin
219
219
  if (!hasPermissions) {
220
- // Show the dialog
221
- _this.showNoAccessDialog();
222
220
  // Reject the request
223
221
  reject();
224
222
  return;
@@ -373,14 +371,6 @@ var InstallationRequired = /** @class */ (function () {
373
371
  // Show the dialog
374
372
  modal_1.Modal.show();
375
373
  };
376
- InstallationRequired.showNoAccessDialog = function () {
377
- // Set the header
378
- modal_1.Modal.setHeader("Access Denied");
379
- // Set the body
380
- modal_1.Modal.setBody("The component has not been configured or you do not have permissions to view the application. Please contact your administrator for additional help.");
381
- // Show the dialog
382
- modal_1.Modal.show();
383
- };
384
374
  InstallationRequired._cfg = null;
385
375
  InstallationRequired._report = null;
386
376
  // Custom Actions exists
@@ -21,10 +21,13 @@ var DataTable = /** @class */ (function () {
21
21
  }
22
22
  // Applies the datatables.net plugin
23
23
  DataTable.prototype.applyPlugin = function (table) {
24
+ var _this = this;
24
25
  // Render the datatable
25
26
  this._datatable = $(table.el).DataTable(this._props.dtProps);
26
- // Call the render event
27
- this._props.onRendered ? this._props.onRendered(this._props.el, this._datatable) : null;
27
+ // Call the render event in a separate thread to ensure the dashboard object is created
28
+ setTimeout(function () {
29
+ _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;
30
+ }, 50);
28
31
  };
29
32
  Object.defineProperty(DataTable.prototype, "datatable", {
30
33
  /** Public Interface */
@@ -82,7 +82,7 @@ eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__crea
82
82
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
83
83
 
84
84
  "use strict";
85
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InstallationRequired = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n/**\r\n * Installation Required\r\n * Checks the SharePoint configuration file to see if an install is required.\r\n */\r\nvar InstallationRequired = /** @class */ (function () {\r\n function InstallationRequired() {\r\n }\r\n Object.defineProperty(InstallationRequired, \"CustomActionsExist\", {\r\n get: function () { return this._customActionsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the custom actions\r\n InstallationRequired.checkCustomActions = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._customActionsExist = true;\r\n // Method to check the web custom actions\r\n var checkWeb = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Web == null || cfg._configuration.CustomActionCfg.Web.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the web custom actions\r\n var web = (0, gd_sprest_bs_1.Web)();\r\n web.UserCustomActions().execute(function (webCustomActions) {\r\n // Parse the web custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Web.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Web[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < webCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == webCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Web Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Method to check the site custom actions\r\n var checkSite = function () {\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Site == null || cfg._configuration.CustomActionCfg.Site.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the site custom actions\r\n (0, gd_sprest_bs_1.Site)().UserCustomActions().execute(function (siteCustomActions) {\r\n // Parse the site custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Site.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Site[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < siteCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == siteCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Site Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Check the site & web\r\n Promise.all([\r\n checkSite(),\r\n checkWeb()\r\n ]).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Determines if the user is an owner or admin\r\n InstallationRequired.isOwnerOrAdmin = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the current user\r\n (0, gd_sprest_bs_1.Web)().CurrentUser().execute(function (user) {\r\n // See if they are an admin\r\n if (user.IsSiteAdmin) {\r\n // Resolve the request\r\n resolve(true);\r\n }\r\n else {\r\n // See if the user is part of the owner's group\r\n (0, gd_sprest_bs_1.Web)().AssociatedOwnerGroup().Users().getById(user.Id).execute(\r\n // Is an owner\r\n function () {\r\n // Resolve the request\r\n resolve(true);\r\n }, \r\n // Not an owner\r\n function () {\r\n // Resolve the request\r\n resolve(false);\r\n });\r\n }\r\n }, function () {\r\n // Resolve the request\r\n resolve(false);\r\n });\r\n });\r\n };\r\n Object.defineProperty(InstallationRequired, \"ListsExist\", {\r\n get: function () { return this._listsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the lists\r\n InstallationRequired.checkLists = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._listsExist = true;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure lists exist\r\n if (cfg._configuration.ListCfg == null || cfg._configuration.ListCfg.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(cfg._configuration.ListCfg, function (listCfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the list\r\n (0, gd_sprest_bs_1.Web)().Lists(listCfg.ListInformation.Title).query({\r\n Expand: [\"Fields\"]\r\n }).execute(\r\n // Success\r\n function (list) {\r\n // Parse the custom fields\r\n gd_sprest_bs_1.Helper.Executor(listCfg.CustomFields, function (cfg) {\r\n var exists = false;\r\n // Parse the list fields\r\n for (var i = 0; i < list.Fields.results.length; i++) {\r\n // See if the field exists\r\n if (list.Fields.results[i].InternalName == cfg.name) {\r\n // Set the flag\r\n exists = true;\r\n break;\r\n }\r\n }\r\n // See if the field doesn't exist\r\n if (!exists) {\r\n // Field doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' is missing a field: \" + cfg.name);\r\n }\r\n }).then(function () {\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // List doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' does not exist\");\r\n // Set the flag\r\n _this._listsExist = false;\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Checks the configuration to see if an installation is required\r\n InstallationRequired.requiresInstall = function (props) {\r\n var _this = this;\r\n // Save the configuration\r\n this._cfg = props.cfg;\r\n // Clear the report\r\n this._report = [];\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Ensure this is an admin or owner\r\n _this.isOwnerOrAdmin().then(function (hasPermissions) {\r\n // See if they are not an owner or admin\r\n if (!hasPermissions) {\r\n // Show the dialog\r\n _this.showNoAccessDialog();\r\n // Reject the request\r\n reject();\r\n return;\r\n }\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n var numbOfErrors = _this._report.length;\r\n // Check the configuration\r\n Promise.all([\r\n // Check the custom actions\r\n _this.checkCustomActions(cfg),\r\n // Check the lists\r\n _this.checkLists(cfg)\r\n ]).then(function () {\r\n // See if there are errors\r\n if (_this._report.length > numbOfErrors) {\r\n // Execute the event\r\n props.onError ? props.onError(cfg) : null;\r\n }\r\n // Execute the event and see if a promise was returned\r\n var returnVal = props.onCompleted ? props.onCompleted() : null;\r\n if (returnVal && typeof (returnVal[\"then\"]) === \"function\") {\r\n // Wait for the request to complete\r\n returnVal.then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n }\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n });\r\n });\r\n };\r\n InstallationRequired.showDialog = function (props) {\r\n var _this = this;\r\n if (props === void 0) { props = {}; }\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Ensure the configuration exists\r\n if (this._cfg == null || this._report == null) {\r\n // Show the error dialog\r\n this.showErrorDialog();\r\n return;\r\n }\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Installation Required\");\r\n // Set the body\r\n modal_1.Modal.setBody(gd_sprest_bs_1.Components.Card({\r\n body: [\r\n {\r\n text: this._report.length > 0 || (props.errors && props.errors.length > 0) ?\r\n \"An installation is required. The following were missing in your environment:\" :\r\n \"No errors were detected.\"\r\n },\r\n {\r\n onRender: function (el) {\r\n var items = props.errors || [];\r\n // Parse the report\r\n for (var i = 0; i < _this._report.length; i++) {\r\n // Add the item\r\n items.push({ content: _this._report[i] });\r\n }\r\n // Render a list\r\n gd_sprest_bs_1.Components.ListGroup({\r\n el: el,\r\n items: items\r\n });\r\n }\r\n }\r\n ]\r\n }).el);\r\n // Render the install button\r\n var btnInstall = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Installs the SharePoint Assets\",\r\n btnProps: {\r\n assignTo: function (btn) { btnInstall = btn; },\r\n text: \"Install\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,\r\n onClick: function () {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Installing the Solution\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the assets are installed.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n cfg.install().then(function () {\r\n // Hide the button\r\n btnInstall.hide();\r\n // Show the refresh button\r\n btnRefresh.show();\r\n // Call the event\r\n props.onInstalled ? props.onInstalled(cfg) : null;\r\n // Check the next configuration\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Call the event\r\n props.onCompleted ? props.onCompleted() : null;\r\n });\r\n }\r\n }\r\n });\r\n // Render the refresh button\r\n var btnRefresh = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Refresh the Page\",\r\n btnProps: {\r\n assignTo: function (btn) { btnRefresh = btn; },\r\n className: \"d-none\",\r\n text: \"Refresh\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Refresh the page\r\n window.location.reload();\r\n }\r\n }\r\n });\r\n // Call the events\r\n props.onHeaderRendered ? props.onHeaderRendered(modal_1.Modal.HeaderElement) : null;\r\n props.onBodyRendered ? props.onBodyRendered(modal_1.Modal.BodyElement) : null;\r\n props.onFooterRendered ? props.onFooterRendered(modal_1.Modal.FooterElement) : null;\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired.showErrorDialog = function () {\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Not Configured\");\r\n // Set the body\r\n modal_1.Modal.setBody(\"The component has not been configured. The SPConfiguration definition hasn't been initialized.\");\r\n // Show the dialog\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired.showNoAccessDialog = function () {\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Access Denied\");\r\n // Set the body\r\n modal_1.Modal.setBody(\"The component has not been configured or you do not have permissions to view the application. Please contact your administrator for additional help.\");\r\n // Show the dialog\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired._cfg = null;\r\n InstallationRequired._report = null;\r\n // Custom Actions exists\r\n InstallationRequired._customActionsExist = null;\r\n // Lists exists\r\n InstallationRequired._listsExist = null;\r\n return InstallationRequired;\r\n}());\r\nexports.InstallationRequired = InstallationRequired;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/installRequired.js?");
85
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InstallationRequired = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n/**\r\n * Installation Required\r\n * Checks the SharePoint configuration file to see if an install is required.\r\n */\r\nvar InstallationRequired = /** @class */ (function () {\r\n function InstallationRequired() {\r\n }\r\n Object.defineProperty(InstallationRequired, \"CustomActionsExist\", {\r\n get: function () { return this._customActionsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the custom actions\r\n InstallationRequired.checkCustomActions = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._customActionsExist = true;\r\n // Method to check the web custom actions\r\n var checkWeb = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Web == null || cfg._configuration.CustomActionCfg.Web.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the web custom actions\r\n var web = (0, gd_sprest_bs_1.Web)();\r\n web.UserCustomActions().execute(function (webCustomActions) {\r\n // Parse the web custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Web.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Web[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < webCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == webCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Web Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Method to check the site custom actions\r\n var checkSite = function () {\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Site == null || cfg._configuration.CustomActionCfg.Site.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the site custom actions\r\n (0, gd_sprest_bs_1.Site)().UserCustomActions().execute(function (siteCustomActions) {\r\n // Parse the site custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Site.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Site[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < siteCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == siteCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Site Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Check the site & web\r\n Promise.all([\r\n checkSite(),\r\n checkWeb()\r\n ]).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Determines if the user is an owner or admin\r\n InstallationRequired.isOwnerOrAdmin = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the current user\r\n (0, gd_sprest_bs_1.Web)().CurrentUser().execute(function (user) {\r\n // See if they are an admin\r\n if (user.IsSiteAdmin) {\r\n // Resolve the request\r\n resolve(true);\r\n }\r\n else {\r\n // See if the user is part of the owner's group\r\n (0, gd_sprest_bs_1.Web)().AssociatedOwnerGroup().Users().getById(user.Id).execute(\r\n // Is an owner\r\n function () {\r\n // Resolve the request\r\n resolve(true);\r\n }, \r\n // Not an owner\r\n function () {\r\n // Resolve the request\r\n resolve(false);\r\n });\r\n }\r\n }, function () {\r\n // Resolve the request\r\n resolve(false);\r\n });\r\n });\r\n };\r\n Object.defineProperty(InstallationRequired, \"ListsExist\", {\r\n get: function () { return this._listsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the lists\r\n InstallationRequired.checkLists = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._listsExist = true;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure lists exist\r\n if (cfg._configuration.ListCfg == null || cfg._configuration.ListCfg.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(cfg._configuration.ListCfg, function (listCfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the list\r\n (0, gd_sprest_bs_1.Web)().Lists(listCfg.ListInformation.Title).query({\r\n Expand: [\"Fields\"]\r\n }).execute(\r\n // Success\r\n function (list) {\r\n // Parse the custom fields\r\n gd_sprest_bs_1.Helper.Executor(listCfg.CustomFields, function (cfg) {\r\n var exists = false;\r\n // Parse the list fields\r\n for (var i = 0; i < list.Fields.results.length; i++) {\r\n // See if the field exists\r\n if (list.Fields.results[i].InternalName == cfg.name) {\r\n // Set the flag\r\n exists = true;\r\n break;\r\n }\r\n }\r\n // See if the field doesn't exist\r\n if (!exists) {\r\n // Field doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' is missing a field: \" + cfg.name);\r\n }\r\n }).then(function () {\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // List doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' does not exist\");\r\n // Set the flag\r\n _this._listsExist = false;\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Checks the configuration to see if an installation is required\r\n InstallationRequired.requiresInstall = function (props) {\r\n var _this = this;\r\n // Save the configuration\r\n this._cfg = props.cfg;\r\n // Clear the report\r\n this._report = [];\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Ensure this is an admin or owner\r\n _this.isOwnerOrAdmin().then(function (hasPermissions) {\r\n // See if they are not an owner or admin\r\n if (!hasPermissions) {\r\n // Reject the request\r\n reject();\r\n return;\r\n }\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n var numbOfErrors = _this._report.length;\r\n // Check the configuration\r\n Promise.all([\r\n // Check the custom actions\r\n _this.checkCustomActions(cfg),\r\n // Check the lists\r\n _this.checkLists(cfg)\r\n ]).then(function () {\r\n // See if there are errors\r\n if (_this._report.length > numbOfErrors) {\r\n // Execute the event\r\n props.onError ? props.onError(cfg) : null;\r\n }\r\n // Execute the event and see if a promise was returned\r\n var returnVal = props.onCompleted ? props.onCompleted() : null;\r\n if (returnVal && typeof (returnVal[\"then\"]) === \"function\") {\r\n // Wait for the request to complete\r\n returnVal.then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n }\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n });\r\n });\r\n };\r\n InstallationRequired.showDialog = function (props) {\r\n var _this = this;\r\n if (props === void 0) { props = {}; }\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Ensure the configuration exists\r\n if (this._cfg == null || this._report == null) {\r\n // Show the error dialog\r\n this.showErrorDialog();\r\n return;\r\n }\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Installation Required\");\r\n // Set the body\r\n modal_1.Modal.setBody(gd_sprest_bs_1.Components.Card({\r\n body: [\r\n {\r\n text: this._report.length > 0 || (props.errors && props.errors.length > 0) ?\r\n \"An installation is required. The following were missing in your environment:\" :\r\n \"No errors were detected.\"\r\n },\r\n {\r\n onRender: function (el) {\r\n var items = props.errors || [];\r\n // Parse the report\r\n for (var i = 0; i < _this._report.length; i++) {\r\n // Add the item\r\n items.push({ content: _this._report[i] });\r\n }\r\n // Render a list\r\n gd_sprest_bs_1.Components.ListGroup({\r\n el: el,\r\n items: items\r\n });\r\n }\r\n }\r\n ]\r\n }).el);\r\n // Render the install button\r\n var btnInstall = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Installs the SharePoint Assets\",\r\n btnProps: {\r\n assignTo: function (btn) { btnInstall = btn; },\r\n text: \"Install\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,\r\n onClick: function () {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Installing the Solution\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the assets are installed.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n cfg.install().then(function () {\r\n // Hide the button\r\n btnInstall.hide();\r\n // Show the refresh button\r\n btnRefresh.show();\r\n // Call the event\r\n props.onInstalled ? props.onInstalled(cfg) : null;\r\n // Check the next configuration\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Call the event\r\n props.onCompleted ? props.onCompleted() : null;\r\n });\r\n }\r\n }\r\n });\r\n // Render the refresh button\r\n var btnRefresh = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Refresh the Page\",\r\n btnProps: {\r\n assignTo: function (btn) { btnRefresh = btn; },\r\n className: \"d-none\",\r\n text: \"Refresh\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Refresh the page\r\n window.location.reload();\r\n }\r\n }\r\n });\r\n // Call the events\r\n props.onHeaderRendered ? props.onHeaderRendered(modal_1.Modal.HeaderElement) : null;\r\n props.onBodyRendered ? props.onBodyRendered(modal_1.Modal.BodyElement) : null;\r\n props.onFooterRendered ? props.onFooterRendered(modal_1.Modal.FooterElement) : null;\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired.showErrorDialog = function () {\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Not Configured\");\r\n // Set the body\r\n modal_1.Modal.setBody(\"The component has not been configured. The SPConfiguration definition hasn't been initialized.\");\r\n // Show the dialog\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired._cfg = null;\r\n InstallationRequired._report = null;\r\n // Custom Actions exists\r\n InstallationRequired._customActionsExist = null;\r\n // Lists exists\r\n InstallationRequired._listsExist = null;\r\n return InstallationRequired;\r\n}());\r\nexports.InstallationRequired = InstallationRequired;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/installRequired.js?");
86
86
 
87
87
  /***/ }),
88
88
 
@@ -225,7 +225,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
225
225
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
226
226
 
227
227
  "use strict";
228
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTable = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.96/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\nvar $ = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\n__webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@1.13.7/node_modules/datatables.net/js/jquery.dataTables.min.js\");\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@1.13.7/node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js\");\r\n/**\r\n * Data Table\r\n */\r\nvar DataTable = /** @class */ (function () {\r\n // Constructor\r\n function DataTable(props) {\r\n this._datatable = null;\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Applies the datatables.net plugin\r\n DataTable.prototype.applyPlugin = function (table) {\r\n // Render the datatable\r\n this._datatable = $(table.el).DataTable(this._props.dtProps);\r\n // Call the render event\r\n this._props.onRendered ? this._props.onRendered(this._props.el, this._datatable) : null;\r\n };\r\n Object.defineProperty(DataTable.prototype, \"datatable\", {\r\n /** Public Interface */\r\n // Datatables.net object\r\n get: function () { return this._datatable; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTable.prototype, \"el\", {\r\n // The data table element\r\n get: function () { return this._props.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Filters the status\r\n DataTable.prototype.filter = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&'), true, false).draw();\r\n };\r\n // Filters the status\r\n DataTable.prototype.filterExact = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(\"^\" + value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&') + \"$\", true, false).draw();\r\n };\r\n // Filters multiple values against the status\r\n DataTable.prototype.filterMulti = function (idx, values) {\r\n if (values === void 0) { values = []; }\r\n // Parse the values\r\n for (var i = 0; i < values.length; i++) {\r\n // Update the value\r\n values[i] = values[i].replace(/\\|/g, '\\\\$&');\r\n }\r\n // Filter the values\r\n this.filter(idx, values.join('|'));\r\n };\r\n // Method to reload the data\r\n DataTable.prototype.refresh = function (rows) {\r\n if (rows === void 0) { rows = []; }\r\n // See if the datatable exists\r\n if (this._datatable != null) {\r\n // Clear the datatable\r\n this._datatable.clear();\r\n this._datatable.destroy();\r\n this._datatable = null;\r\n }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the data table\r\n var table = gd_sprest_bs_1.Components.Table({\r\n el: this._props.el,\r\n rows: rows,\r\n columns: this._props.columns\r\n });\r\n // Apply the plugin\r\n this.applyPlugin(table);\r\n };\r\n // Searches the datatable\r\n DataTable.prototype.search = function (value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Search the table\r\n this._datatable.search(value).draw();\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?");
228
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTable = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.96/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\nvar $ = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\n__webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@1.13.7/node_modules/datatables.net/js/jquery.dataTables.min.js\");\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@1.13.7/node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js\");\r\n/**\r\n * Data Table\r\n */\r\nvar DataTable = /** @class */ (function () {\r\n // Constructor\r\n function DataTable(props) {\r\n this._datatable = null;\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Applies the datatables.net plugin\r\n DataTable.prototype.applyPlugin = function (table) {\r\n var _this = this;\r\n // Render the datatable\r\n this._datatable = $(table.el).DataTable(this._props.dtProps);\r\n // Call the render event in a separate thread to ensure the dashboard object is created\r\n setTimeout(function () {\r\n _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;\r\n }, 50);\r\n };\r\n Object.defineProperty(DataTable.prototype, \"datatable\", {\r\n /** Public Interface */\r\n // Datatables.net object\r\n get: function () { return this._datatable; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTable.prototype, \"el\", {\r\n // The data table element\r\n get: function () { return this._props.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Filters the status\r\n DataTable.prototype.filter = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&'), true, false).draw();\r\n };\r\n // Filters the status\r\n DataTable.prototype.filterExact = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(\"^\" + value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&') + \"$\", true, false).draw();\r\n };\r\n // Filters multiple values against the status\r\n DataTable.prototype.filterMulti = function (idx, values) {\r\n if (values === void 0) { values = []; }\r\n // Parse the values\r\n for (var i = 0; i < values.length; i++) {\r\n // Update the value\r\n values[i] = values[i].replace(/\\|/g, '\\\\$&');\r\n }\r\n // Filter the values\r\n this.filter(idx, values.join('|'));\r\n };\r\n // Method to reload the data\r\n DataTable.prototype.refresh = function (rows) {\r\n if (rows === void 0) { rows = []; }\r\n // See if the datatable exists\r\n if (this._datatable != null) {\r\n // Clear the datatable\r\n this._datatable.clear();\r\n this._datatable.destroy();\r\n this._datatable = null;\r\n }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the data table\r\n var table = gd_sprest_bs_1.Components.Table({\r\n el: this._props.el,\r\n rows: rows,\r\n columns: this._props.columns\r\n });\r\n // Apply the plugin\r\n this.applyPlugin(table);\r\n };\r\n // Searches the datatable\r\n DataTable.prototype.search = function (value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Search the table\r\n this._datatable.search(value).draw();\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?");
229
229
 
230
230
  /***/ }),
231
231