dattatable 2.10.14 → 2.10.16

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 (61) hide show
  1. package/build/common/canvas.js +5 -1
  2. package/build/common/documents.js +1 -1
  3. package/build/common/modal.js +5 -1
  4. package/dist/dattatable.js +3 -3
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  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 -2
  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/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/IListProps.html +2 -2
  54. package/docs/interfaces/IListSecurity.html +2 -2
  55. package/docs/interfaces/IListSecurityItem.html +2 -2
  56. package/docs/interfaces/IShowDialogProps.html +2 -2
  57. package/docs/interfaces/ITiles.html +2 -2
  58. package/docs/interfaces/ITilesProps.html +2 -2
  59. package/docs/variables/DattaTable.html +1 -1
  60. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  61. package/package.json +1 -1
@@ -86,7 +86,11 @@ var CanvasForm = /** @class */ (function () {
86
86
  // Sets the auto close flag
87
87
  CanvasForm.setAutoClose = function (value) { this._canvas.setAutoClose(value); };
88
88
  // Sets the close event
89
- CanvasForm.setCloseEvent = function (event) { this._onCloseEvent = event; };
89
+ CanvasForm.setCloseEvent = function (event) {
90
+ var _this = this;
91
+ // Set the event in its own thread
92
+ setTimeout(function () { _this._onCloseEvent = event; }, 10);
93
+ };
90
94
  // Sets the body
91
95
  CanvasForm.setBody = function (content) {
92
96
  // Clear the body
@@ -1083,7 +1083,7 @@ var Documents = /** @class */ (function () {
1083
1083
  var navProps = {
1084
1084
  el: this._el,
1085
1085
  brand: "Documents",
1086
- className: "mt-3 rounded",
1086
+ className: "rounded",
1087
1087
  itemsEnd: itemsEnd,
1088
1088
  type: gd_sprest_bs_1.Components.NavbarTypes.Primary,
1089
1089
  searchBox: this._props.enableSearch ? {
@@ -129,7 +129,11 @@ var Modal = /** @class */ (function () {
129
129
  // Sets the close button visibility
130
130
  Modal.setCloseButtonVisibility = function (showFl) { this._modal.setCloseButtonVisibility(showFl); };
131
131
  // Sets the close event
132
- Modal.setCloseEvent = function (event) { this._onCloseEvent = event; };
132
+ Modal.setCloseEvent = function (event) {
133
+ var _this = this;
134
+ // Set the event in its own thread
135
+ setTimeout(function () { _this._onCloseEvent = event; }, 10);
136
+ };
133
137
  // Sets the flag to hide the empty footer
134
138
  Modal.setHideEmptyFooter = function (value) { this._hideEmptyFooter = value; };
135
139
  // Sets the flag to hide the empty header
@@ -38,7 +38,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
38
38
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
39
39
 
40
40
  "use strict";
41
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CanvasForm = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Canvas Form\r\n */\r\nvar CanvasForm = /** @class */ (function () {\r\n // Constructor\r\n function CanvasForm() {\r\n // Render the canvas\r\n CanvasForm.render();\r\n }\r\n Object.defineProperty(CanvasForm, \"BodyElement\", {\r\n get: function () { return this._elBody; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(CanvasForm, \"HeaderElement\", {\r\n get: function () { return this._elHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Clears the canvas form\r\n CanvasForm.clear = function () {\r\n // Clear the header and body\r\n this.setHeader(\"\");\r\n this.setBody(\"\");\r\n // Set the default properties\r\n this.setAutoClose(true);\r\n this.setCloseEvent(null);\r\n this.setSize(0);\r\n this.setType(gd_sprest_bs_1.Components.OffcanvasTypes.End);\r\n // Ensure the header and body are visible\r\n this._elBody.classList.remove(\"d-none\");\r\n this._elHeader.classList.remove(\"d-none\");\r\n };\r\n Object.defineProperty(CanvasForm, \"el\", {\r\n // Element\r\n get: function () { return this._canvas.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Hides the canvas\r\n CanvasForm.hide = function () {\r\n this._canvas.hide();\r\n // Call the close event\r\n this._onCloseEvent ? this._onCloseEvent() : null;\r\n };\r\n // Renders the canvas\r\n CanvasForm.render = function () {\r\n var _this = this;\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n el.id = \"core-canvas\";\r\n // Ensure the body exists\r\n if (document.body) {\r\n // Append the element\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n // Create an event\r\n window.addEventListener(\"load\", function () {\r\n // Append the element\r\n document.body.appendChild(el);\r\n });\r\n }\r\n // Render the canvas\r\n this._canvas = gd_sprest_bs_1.Components.Offcanvas({\r\n el: el,\r\n options: {\r\n autoClose: true,\r\n backdrop: true,\r\n focus: true,\r\n keyboard: true,\r\n scroll: true\r\n },\r\n onRenderBody: function (el) { _this._elBody = el; },\r\n onRenderHeader: function (el) { _this._elHeader = el; },\r\n onClose: function () {\r\n // Call the close event\r\n _this._onCloseEvent ? _this._onCloseEvent() : null;\r\n }\r\n });\r\n };\r\n // Sets the auto close flag\r\n CanvasForm.setAutoClose = function (value) { this._canvas.setAutoClose(value); };\r\n // Sets the close event\r\n CanvasForm.setCloseEvent = function (event) { this._onCloseEvent = event; };\r\n // Sets the body\r\n CanvasForm.setBody = function (content) {\r\n // Clear the body\r\n while (this._elBody.firstChild) {\r\n this._elBody.removeChild(this._elBody.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elBody.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elBody.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the header\r\n CanvasForm.setHeader = function (content) {\r\n // Clear the body\r\n while (this._elHeader.firstChild) {\r\n this._elHeader.removeChild(this._elHeader.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elHeader.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elHeader.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the modal size\r\n CanvasForm.setSize = function (size) { this._canvas.setSize(size); };\r\n // Sets the modal type\r\n CanvasForm.setType = function (type) { this._canvas.setType(type); };\r\n // Shows the canvas\r\n CanvasForm.show = function () { this._canvas.show(); };\r\n CanvasForm._canvas = null;\r\n CanvasForm._onCloseEvent = null;\r\n // Modal Body\r\n CanvasForm._elBody = null;\r\n // Modal Header\r\n CanvasForm._elHeader = null;\r\n return CanvasForm;\r\n}());\r\nexports.CanvasForm = CanvasForm;\r\n// Create an instance of the canvas form\r\nnew CanvasForm();\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/canvas.js?");
41
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CanvasForm = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Canvas Form\r\n */\r\nvar CanvasForm = /** @class */ (function () {\r\n // Constructor\r\n function CanvasForm() {\r\n // Render the canvas\r\n CanvasForm.render();\r\n }\r\n Object.defineProperty(CanvasForm, \"BodyElement\", {\r\n get: function () { return this._elBody; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(CanvasForm, \"HeaderElement\", {\r\n get: function () { return this._elHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Clears the canvas form\r\n CanvasForm.clear = function () {\r\n // Clear the header and body\r\n this.setHeader(\"\");\r\n this.setBody(\"\");\r\n // Set the default properties\r\n this.setAutoClose(true);\r\n this.setCloseEvent(null);\r\n this.setSize(0);\r\n this.setType(gd_sprest_bs_1.Components.OffcanvasTypes.End);\r\n // Ensure the header and body are visible\r\n this._elBody.classList.remove(\"d-none\");\r\n this._elHeader.classList.remove(\"d-none\");\r\n };\r\n Object.defineProperty(CanvasForm, \"el\", {\r\n // Element\r\n get: function () { return this._canvas.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Hides the canvas\r\n CanvasForm.hide = function () {\r\n this._canvas.hide();\r\n // Call the close event\r\n this._onCloseEvent ? this._onCloseEvent() : null;\r\n };\r\n // Renders the canvas\r\n CanvasForm.render = function () {\r\n var _this = this;\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n el.id = \"core-canvas\";\r\n // Ensure the body exists\r\n if (document.body) {\r\n // Append the element\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n // Create an event\r\n window.addEventListener(\"load\", function () {\r\n // Append the element\r\n document.body.appendChild(el);\r\n });\r\n }\r\n // Render the canvas\r\n this._canvas = gd_sprest_bs_1.Components.Offcanvas({\r\n el: el,\r\n options: {\r\n autoClose: true,\r\n backdrop: true,\r\n focus: true,\r\n keyboard: true,\r\n scroll: true\r\n },\r\n onRenderBody: function (el) { _this._elBody = el; },\r\n onRenderHeader: function (el) { _this._elHeader = el; },\r\n onClose: function () {\r\n // Call the close event\r\n _this._onCloseEvent ? _this._onCloseEvent() : null;\r\n }\r\n });\r\n };\r\n // Sets the auto close flag\r\n CanvasForm.setAutoClose = function (value) { this._canvas.setAutoClose(value); };\r\n // Sets the close event\r\n CanvasForm.setCloseEvent = function (event) {\r\n var _this = this;\r\n // Set the event in its own thread\r\n setTimeout(function () { _this._onCloseEvent = event; }, 10);\r\n };\r\n // Sets the body\r\n CanvasForm.setBody = function (content) {\r\n // Clear the body\r\n while (this._elBody.firstChild) {\r\n this._elBody.removeChild(this._elBody.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elBody.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elBody.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the header\r\n CanvasForm.setHeader = function (content) {\r\n // Clear the body\r\n while (this._elHeader.firstChild) {\r\n this._elHeader.removeChild(this._elHeader.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elHeader.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elHeader.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the modal size\r\n CanvasForm.setSize = function (size) { this._canvas.setSize(size); };\r\n // Sets the modal type\r\n CanvasForm.setType = function (type) { this._canvas.setType(type); };\r\n // Shows the canvas\r\n CanvasForm.show = function () { this._canvas.show(); };\r\n CanvasForm._canvas = null;\r\n CanvasForm._onCloseEvent = null;\r\n // Modal Body\r\n CanvasForm._elBody = null;\r\n // Modal Header\r\n CanvasForm._elHeader = null;\r\n return CanvasForm;\r\n}());\r\nexports.CanvasForm = CanvasForm;\r\n// Create an instance of the canvas form\r\nnew CanvasForm();\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/canvas.js?");
42
42
 
43
43
  /***/ }),
44
44
 
@@ -60,7 +60,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
60
60
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
61
61
 
62
62
  "use strict";
63
- eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Documents = exports.ActionButtonTypes = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\nvar jQuery = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\nvar moment = __webpack_require__(/*! moment */ \"./node_modules/.pnpm/moment@2.29.4/node_modules/moment/moment.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar methods_1 = __webpack_require__(/*! ./methods */ \"./build/common/methods.js\");\r\nvar table_1 = __webpack_require__(/*! ../dashboard/table */ \"./build/dashboard/table.js\");\r\nvar itemForm_1 = __webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\");\r\n/** Icons */\r\nvar fileEarmark_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmark */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmark.js\");\r\nvar fileEarmarkArrowDown_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkArrowDown */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkArrowDown.js\");\r\nvar fileEarmarkArrowUp_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkArrowUp */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkArrowUp.js\");\r\nvar fileEarmarkBarGraph_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkBarGraph */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkBarGraph.js\");\r\nvar fileEarmarkBinary_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkBinary */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkBinary.js\");\r\nvar fileEarmarkCode_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkCode */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkCode.js\");\r\nvar fileEarmarkExcel_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkExcel */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkExcel.js\");\r\nvar fileEarmarkImage_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkImage */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkImage.js\");\r\nvar fileEarmarkMusic_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkMusic */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkMusic.js\");\r\nvar fileEarmarkPdf_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPdf */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPdf.js\");\r\nvar fileEarmarkPlus_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPlus */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPlus.js\");\r\nvar fileEarmarkPpt_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPpt */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPpt.js\");\r\nvar fileEarmarkPlay_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPlay */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPlay.js\");\r\nvar fileEarmarkRichtext_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkRichtext */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkRichtext.js\");\r\nvar fileEarmarkSpreadsheet_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkSpreadsheet */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkSpreadsheet.js\");\r\nvar fileEarmarkText_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkText */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkText.js\");\r\nvar fileEarmarkWord_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkWord */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkWord.js\");\r\nvar fileEarmarkZip_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkZip */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkZip.js\");\r\nvar filterSquare_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/filterSquare */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/filterSquare.js\");\r\nvar front_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/front */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/front.js\");\r\nvar inputCursorText_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/inputCursorText */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/inputCursorText.js\");\r\nvar layoutTextSidebar_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/layoutTextSidebar */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/layoutTextSidebar.js\");\r\nvar x_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/x */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/x.js\");\r\n/** Action Button Types */\r\nvar ActionButtonTypes;\r\n(function (ActionButtonTypes) {\r\n ActionButtonTypes[ActionButtonTypes[\"Delete\"] = 1] = \"Delete\";\r\n ActionButtonTypes[ActionButtonTypes[\"Download\"] = 2] = \"Download\";\r\n ActionButtonTypes[ActionButtonTypes[\"Edit\"] = 3] = \"Edit\";\r\n ActionButtonTypes[ActionButtonTypes[\"Properties\"] = 4] = \"Properties\";\r\n ActionButtonTypes[ActionButtonTypes[\"View\"] = 5] = \"View\";\r\n})(ActionButtonTypes = exports.ActionButtonTypes || (exports.ActionButtonTypes = {}));\r\n/**\r\n * Documents\r\n * Renders a data table containing the contents of a document library.\r\n */\r\nvar Documents = /** @class */ (function () {\r\n // Constructor\r\n function Documents(props) {\r\n this._el = null;\r\n this._props = null;\r\n this._tblProps = null;\r\n /** The list item attachments */\r\n this._attachments = null;\r\n /** The data table */\r\n this._dt = null;\r\n // Can delete documents\r\n this._canDelete = true;\r\n // Can edit documents\r\n this._canEdit = true;\r\n // Can view documents\r\n this._canView = true;\r\n // The navigation component\r\n this._navbar = null;\r\n // The root folder of the library\r\n this._rootFolder = null;\r\n // The template files\r\n this._templatesFiles = null;\r\n // The template folders\r\n this._templateFolders = null;\r\n // Save the properties\r\n this._props = props;\r\n // Default the permissions\r\n this._canDelete = typeof (this._props.canDelete) === \"boolean\" ? this._props.canDelete : true;\r\n this._canEdit = typeof (this._props.canEdit) === \"boolean\" ? this._props.canEdit : true;\r\n this._canView = typeof (this._props.canView) === \"boolean\" ? this._props.canView : true;\r\n // Create the element\r\n this._el = document.createElement(\"div\");\r\n this._props.el ? this._props.el.appendChild(this._el) : null;\r\n // Generate the table properties\r\n this.generateTableProps();\r\n // Render the component\r\n this.render();\r\n }\r\n Object.defineProperty(Documents.prototype, \"Attachments\", {\r\n get: function () { return this._attachments; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"DataTable\", {\r\n get: function () { return this._dt; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanDelete\", {\r\n get: function () { return this._canDelete; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanEdit\", {\r\n get: function () { return this._canEdit; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanView\", {\r\n get: function () { return this._canView; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"Files\", {\r\n // The files\r\n get: function () {\r\n // Default the files to the root folder\r\n var files = this.RootFolder.Files.results;\r\n // Parse the folders\r\n var formsFl = false;\r\n for (var i = 0; i < this.RootFolder.Folders.results.length; i++) {\r\n var folder = this.RootFolder.Folders.results[i];\r\n // Skip the internal forms folder\r\n if (!formsFl && folder.Name == \"Forms\") {\r\n // Set the flag and skip this folder\r\n formsFl = true;\r\n continue;\r\n }\r\n // Append files\r\n files = files.concat(folder.Files.results);\r\n }\r\n // Return the files\r\n return files;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"IsAttachment\", {\r\n // Type of object we are dealing with\r\n get: function () { return this._props.itemId > 0; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"IsDocSet\", {\r\n get: function () { return this._props.docSetId > 0; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"Navigation\", {\r\n get: function () { return this._navbar; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"NavigationElement\", {\r\n // The navigation element\r\n get: function () { return this.Navigation.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"RootFolder\", {\r\n get: function () { return this._rootFolder; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TableElement\", {\r\n // The table element\r\n get: function () { return this.DataTable.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TemplateFiles\", {\r\n get: function () { return this._templatesFiles; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TemplateFolders\", {\r\n get: function () { return this._templateFolders; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Copies a file to a folder to the library\r\n * @param item The dropdown item containing the file/folder to copy.\r\n */\r\n Documents.prototype.copyFile = function (item) {\r\n var _this = this;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Initializing the Transfer\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Copying the file(s) to the workspace...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // See if this is a folder\r\n if (item.data.Files) {\r\n // Parse the files\r\n var folder = item.data;\r\n gd_sprest_bs_1.Helper.Executor(folder.Files.results, function (file) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the file contents\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFileByServerRelativeUrl(file.ServerRelativeUrl).content().execute(function (data) {\r\n // Copy the file\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file.Name, true, data).execute(resolve, resolve);\r\n });\r\n });\r\n }).then(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n });\r\n }\r\n else {\r\n // Copy the file\r\n var file_1 = item.data;\r\n file_1.content().execute(function (data) {\r\n // Copy the file\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file_1.Name, true, data).execute(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n });\r\n });\r\n }\r\n };\r\n // Generates the table columns\r\n Documents.prototype.generateColumns = function () {\r\n // See if the columns were provided\r\n if (this._props.table && this._props.table.columns) {\r\n return this._props.table.columns;\r\n }\r\n // See if we are dealing w/ attachments\r\n if (this.IsAttachment) {\r\n // Return the default columns\r\n return [\r\n {\r\n name: \"Type\",\r\n title: \"Type\"\r\n },\r\n {\r\n name: \"FileName\",\r\n title: \"Name\"\r\n },\r\n {\r\n className: \"text-end text-nowrap\",\r\n name: \"Actions\",\r\n title: \"\"\r\n }\r\n ];\r\n }\r\n // Return the default columns\r\n return [\r\n {\r\n name: \"Type\",\r\n title: \"Type\",\r\n },\r\n {\r\n name: \"Name\",\r\n title: \"Name\"\r\n },\r\n {\r\n name: \"Title\",\r\n title: \"Description\"\r\n },\r\n {\r\n name: \"FileSize\",\r\n title: \"File Size\"\r\n },\r\n {\r\n name: \"Created\",\r\n title: \"Created\"\r\n },\r\n {\r\n name: \"Author\",\r\n title: \"Created By\"\r\n },\r\n {\r\n name: \"Modified\",\r\n title: \"Modified\"\r\n },\r\n {\r\n name: \"ModifiedBy\",\r\n title: \"Modified By\"\r\n },\r\n {\r\n className: \"text-end text-nowrap\",\r\n name: \"Actions\",\r\n title: \"\"\r\n }\r\n ];\r\n };\r\n // Generates the template files/folders dropdown items\r\n Documents.prototype.generateItems = function () {\r\n var _this = this;\r\n var items = [];\r\n // Parse the template folders\r\n for (var i = 0; i < this.TemplateFolders.length; i++) {\r\n var folder = this.TemplateFolders[i];\r\n // Skip the internal forms folder\r\n if (folder.Name == \"Forms\") {\r\n continue;\r\n }\r\n // Add a dropdown item\r\n items.push({\r\n text: folder.Name,\r\n data: folder,\r\n value: folder.ServerRelativeUrl,\r\n onClick: function (item) { _this.copyFile(item); }\r\n });\r\n }\r\n // Parse the template files\r\n for (var i = 0; i < this.TemplateFiles.length; i++) {\r\n var file = this.TemplateFiles[i];\r\n // Add a dropdown item\r\n items.push({\r\n text: file.Name,\r\n data: file,\r\n value: file.ServerRelativeUrl,\r\n onClick: function (item) { _this.copyFile(item); }\r\n });\r\n }\r\n // Return the dropdown items\r\n return items.sort(function (a, b) {\r\n if (a.text < b.text) {\r\n return -1;\r\n }\r\n if (a.text > b.text) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n };\r\n // Generates the table properties\r\n Documents.prototype.generateTableProps = function () {\r\n var _this = this;\r\n // Default the indexes for the type and action buttons\r\n var idxActions = this.IsAttachment ? 2 : 8;\r\n // See if custom columns are defined\r\n if (this._props.table && this._props.table.columns) {\r\n // Clear the indexes\r\n idxActions = -1;\r\n // Parse the columns\r\n for (var i = 0; i < this._props.table.columns.length; i++) {\r\n // Update the index based on the value\r\n switch (this._props.table.columns[i].name) {\r\n // Actions\r\n case \"Actions\":\r\n idxActions = i;\r\n break;\r\n }\r\n }\r\n }\r\n // See if the column definitions are not defined\r\n var columnDefs = this._props.table ? this._props.table.dtProps : null;\r\n if (columnDefs == null) {\r\n columnDefs = [];\r\n // Add the default options for the Actions and Type\r\n idxActions >= 0 ? columnDefs.push({ targets: idxActions, orderable: false, searchable: false }) : null;\r\n }\r\n // Create the table properties\r\n this._tblProps = {\r\n el: null,\r\n dtProps: this._props.table && this._props.table.dtProps ? this._props.table.dtProps : {\r\n dom: 'rt<\"row\"<\"col-sm-4\"l><\"col-sm-4\"i><\"col-sm-4\"p>>',\r\n columnDefs: columnDefs,\r\n createdRow: function (row, data, index) {\r\n jQuery('td', row).addClass('align-middle');\r\n },\r\n // Add some classes to the dataTable elements\r\n drawCallback: function (settings) {\r\n var api = new jQuery.fn.dataTable.Api(settings);\r\n var div = api.table().container();\r\n var table = api.table().node();\r\n div.querySelector(\".dataTables_info\").classList.add(\"text-center\");\r\n div.querySelector(\".dataTables_length\").classList.add(\"pt-2\");\r\n div.querySelector(\".dataTables_paginate\").classList.add(\"pt-03\");\r\n table.classList.remove(\"no-footer\");\r\n table.classList.add(\"tbl-footer\");\r\n table.classList.add(\"table-striped\");\r\n },\r\n headerCallback: function (thead, data, start, end, display) {\r\n jQuery('th', thead).addClass('align-middle');\r\n },\r\n // Order by the 1st column by default; ascending\r\n order: [[1, \"asc\"]]\r\n },\r\n columns: this.generateColumns()\r\n };\r\n // Parse the columns\r\n gd_sprest_bs_1.Helper.Executor(this._tblProps.columns, function (col) {\r\n var customEvent = col.onRenderCell;\r\n // See if this is the type column\r\n if (col.name == \"Type\") {\r\n // Set the event to render an icon\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the file\r\n _this.renderFileIcon(el, _this.getFileName(file));\r\n // Set the filter/sort value\r\n el.setAttribute(\"data-filter\", (0, methods_1.getFileExt)(_this.getFileName(file)));\r\n el.setAttribute(\"data-sort\", (0, methods_1.getFileExt)(_this.getFileName(file)));\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is the file size\r\n else if (col.name == \"FileSize\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the file size value\r\n el.innerHTML = (0, methods_1.formatBytes)(file.Length);\r\n // Set the sort value\r\n el.setAttribute(\"data-sort\", file.Length.toString());\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is a date/time field\r\n else if (col.name == \"Created\" || col.name == \"Modified\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the date/time value\r\n var value = col.name == \"Created\" ? file.TimeCreated : file.TimeLastModified;\r\n el.innerHTML = (0, methods_1.formatTimeValue)(value);\r\n // Set the date/time filter/sort values\r\n el.setAttribute(\"data-filter\", moment(value).format(\"dddd MMMM DD YYYY\"));\r\n el.setAttribute(\"data-sort\", value);\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is a user field\r\n else if (col.name == \"Author\" || col.name == \"ModifiedBy\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the Person field Title\r\n el.innerHTML = (file[col.name] ? file[col.name][\"Title\"] : null) || \"\";\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is the \"actions\" buttons\r\n else if (col.name == \"Actions\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the action buttons\r\n _this.renderActionButtons(el, file);\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n _this._props.onActionsRendered ? _this._props.onActionsRendered(el, col, file) : null;\r\n };\r\n }\r\n else {\r\n // Set the default render event\r\n col.onRenderCell = function (el, col, file) {\r\n // Set the value\r\n el.innerHTML = file[col.name] ||\r\n (file.ListItemAllFields && file.ListItemAllFields.FieldValuesAsText[col.name]) || \"\";\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n });\r\n };\r\n // Gets the file name\r\n Documents.prototype.getFileName = function (file) {\r\n // Return the file name\r\n return file.Name || file.FileName;\r\n };\r\n // Determines if the document can be viewed in office online servers\r\n Documents.isWopi = function (filename) {\r\n switch ((0, methods_1.getFileExt)(filename)) {\r\n // Excel\r\n case \"csv\":\r\n case \"doc\":\r\n case \"docx\":\r\n case \"dot\":\r\n case \"dotx\":\r\n case \"pot\":\r\n case \"potx\":\r\n case \"pps\":\r\n case \"ppsx\":\r\n case \"ppt\":\r\n case \"pptx\":\r\n case \"xls\":\r\n case \"xlsx\":\r\n case \"xlt\":\r\n case \"xltx\":\r\n return true;\r\n // Default\r\n default: {\r\n return false;\r\n }\r\n }\r\n };\r\n // Loads the data\r\n Documents.prototype.load = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var web = (0, gd_sprest_bs_1.Web)(_this._props.webUrl);\r\n // Clear the properties\r\n _this._rootFolder = null;\r\n _this._templateFolders = null;\r\n _this._templatesFiles = null;\r\n // See if the templates library was set\r\n if (_this._props.templatesUrl) {\r\n // Load the files and folders\r\n web.getFolderByServerRelativeUrl(_this._props.templatesUrl).query({\r\n Expand: [\"Folders/Files\", \"Files\"]\r\n }).execute(\r\n // Templates folder exists\r\n function (folder) {\r\n // Set the template files\r\n _this._templatesFiles = folder.Files.results;\r\n // Set the template folders\r\n _this._templateFolders = folder.Folders.results;\r\n }, \r\n // Error loading the templates folder\r\n function () {\r\n // Log\r\n console.error(\"[Dattatable] Document's template folder failed to be loaded.\", _this._props.templatesUrl);\r\n });\r\n }\r\n // Set the query\r\n var query = _this._props.query || {};\r\n query.Expand = (query.Expand ? query.Expand : []).concat([\r\n \"Folders/Files\", \"Folders/Files/Author\",\r\n \"Folders/Files/ListItemAllFields\", \"Folders/Files/ListItemAllFields/FieldValuesAsText\",\r\n \"Folders/Files/ModifiedBy\", \"Files\", \"Files/Author\", \"Files/ListItemAllFields\",\r\n \"Files/ListItemAllFields/FieldValuesAsText\", \"Files/ModifiedBy\"\r\n ]);\r\n // See if we are targeting a document set folder\r\n if (_this.IsDocSet) {\r\n web.Lists(_this._props.listName).Items(_this._props.docSetId).Folder().query(query).execute(function (folder) {\r\n // Set the root folder\r\n _this._rootFolder = folder;\r\n }, reject);\r\n }\r\n // Else, see if we are targeting list item attachments\r\n else if (_this.IsAttachment) {\r\n web.Lists(_this._props.listName).Items(_this._props.itemId).AttachmentFiles().execute(function (attachments) {\r\n // Set the attachments\r\n _this._attachments = attachments.results;\r\n }, reject);\r\n }\r\n // Else, it's a library\r\n else {\r\n // Load library information\r\n web.Lists(_this._props.listName).RootFolder().query(query).execute(function (folder) {\r\n // Set the root folder\r\n _this._rootFolder = folder;\r\n }, reject);\r\n }\r\n // Wait for the requests to complete\r\n web.done(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Renders the component\r\n Documents.prototype.render = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Load the data\r\n _this.load().then(function () {\r\n // Render the navigation\r\n _this.renderNavigation();\r\n // Render the table\r\n _this.renderTable();\r\n // Call the render event\r\n _this._props.onRendered ? _this._props.onRendered(_this._el) : null;\r\n // Resolve the promise\r\n resolve();\r\n }, reject);\r\n });\r\n };\r\n // Renders the file actions\r\n Documents.prototype.renderActionButtons = function (el, file) {\r\n // Create a span to wrap the icons in\r\n var span = document.createElement(\"span\");\r\n span.className = \"bg-white d-inline-flex ms-2 rounded\";\r\n var spanEdit = span.cloneNode();\r\n var spanProps = span.cloneNode();\r\n var spanDownload = span.cloneNode();\r\n var spanDel = span.cloneNode();\r\n spanDel.classList.add(\"me-1\");\r\n // Add the icons\r\n el.appendChild(span);\r\n el.appendChild(spanEdit);\r\n this.IsAttachment ? null : el.appendChild(spanProps);\r\n el.appendChild(spanDownload);\r\n el.appendChild(spanDel);\r\n // Render the buttons\r\n span.appendChild(this.generateButton(ActionButtonTypes.View, file));\r\n spanEdit.appendChild(this.generateButton(ActionButtonTypes.Edit, file));\r\n this.IsAttachment ? null : spanProps.appendChild(this.generateButton(ActionButtonTypes.Properties, file));\r\n spanDownload.appendChild(this.generateButton(ActionButtonTypes.Download, file));\r\n spanDel.appendChild(this.generateButton(ActionButtonTypes.Delete, file));\r\n };\r\n Documents.prototype.generateButton = function (btnType, file) {\r\n var _this = this;\r\n var isWopi = Documents.isWopi(this.getFileName(file));\r\n // Render the button based on the type\r\n switch (btnType) {\r\n case ActionButtonTypes.Delete:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Delete\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-delete\",\r\n iconType: x_1.x,\r\n iconSize: 24,\r\n isDisabled: !this.CanDelete,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanDelete) {\r\n // Confirm we want to delete the item\r\n if (confirm(\"Are you sure you want to delete this document?\")) {\r\n // Display a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Deleting Document\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Deleting Document: \" + _this.getFileName(file) + \". This will close afterwards.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Delete the document\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFileByServerRelativeUrl(file.ServerRelativeUrl).delete().execute(\r\n // Success\r\n function () {\r\n // close dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page \r\n _this.refresh();\r\n }, \r\n // Error\r\n function (err) {\r\n // TODO\r\n });\r\n }\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Download:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Download\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-download\",\r\n iconType: fileEarmarkArrowDown_1.fileEarmarkArrowDown,\r\n iconSize: 24,\r\n isDisabled: !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanView) {\r\n window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/download.aspx?SourceUrl=\" + file.ServerRelativeUrl, \"_blank\");\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Edit:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Edit\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-edit\",\r\n iconType: inputCursorText_1.inputCursorText,\r\n iconSize: 24,\r\n isDisabled: (!isWopi || !this.CanEdit),\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (isWopi && _this.CanEdit) {\r\n // Open the file in a new tab\r\n window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/WopiFrame.aspx?sourcedoc=\" + file.ServerRelativeUrl + \"&action=edit\");\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Properties:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Properties\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-properties\",\r\n iconType: layoutTextSidebar_1.layoutTextSidebar,\r\n iconSize: 24,\r\n isDisabled: !this.CanEdit && !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n // Set the item form properties\r\n itemForm_1.ItemForm.ListName = _this._props.listName;\r\n itemForm_1.ItemForm.UseModal = false;\r\n // Ensure the user can edit the item\r\n if (_this.CanEdit) {\r\n // Define the properties\r\n var editProps = __assign(__assign({}, (_this._props.onItemFormEditing || {})), {\r\n // Set the item id\r\n itemId: file.ListItemAllFields[\"Id\"],\r\n // Set the edit form properties\r\n onCreateEditForm: function (props) {\r\n // Set the rendering event\r\n props.onControlRendering = function (ctrl, field) {\r\n if (field.InternalName == \"FileLeafRef\") {\r\n // Validate the name of the file\r\n ctrl.onValidate = function (ctrl, results) {\r\n var _a;\r\n // Ensure the value is less than 128 characters\r\n if (((_a = results.value) === null || _a === void 0 ? void 0 : _a.length) > 128) {\r\n // Return an error message\r\n results.invalidMessage = \"The file name must be less than 128 characters.\";\r\n results.isValid = false;\r\n }\r\n // Return the results\r\n return results;\r\n };\r\n }\r\n else if (field.InternalName == \"Title\") {\r\n // Update the label of the Title field\r\n ctrl.label = \"Description\";\r\n }\r\n };\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onCreateEditForm) {\r\n // Return the properties\r\n return _this._props.onItemFormEditing.onCreateEditForm(props);\r\n }\r\n // Return the properties\r\n return props;\r\n },\r\n // Update the footer\r\n onSetFooter: function (el) {\r\n var updateBtn = el.querySelector('[role=\"group\"]').firstChild;\r\n updateBtn.classList.remove(\"btn-outline-primary\");\r\n updateBtn.classList.add(\"btn-primary\");\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onSetFooter) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onSetFooter(el);\r\n }\r\n },\r\n // Update the header\r\n onSetHeader: function (el) {\r\n // Update the header\r\n el.querySelector(\"h5\").innerHTML = \"Properties\";\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onSetHeader) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onSetHeader(el);\r\n }\r\n },\r\n // Refresh the view when updates occur\r\n onUpdate: function (item) {\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onUpdate) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onUpdate(item);\r\n }\r\n else {\r\n // Refresh the data table\r\n _this.refresh();\r\n }\r\n }\r\n });\r\n // Show the edit form\r\n itemForm_1.ItemForm.edit(editProps);\r\n }\r\n else {\r\n // View the form\r\n itemForm_1.ItemForm.view(__assign(__assign({}, (_this._props.onItemFormViewing || {})), {\r\n itemId: file.ListItemAllFields[\"Id\"],\r\n // Set the view form properties\r\n onCreateViewForm: function (props) {\r\n // Set the rendering event\r\n props.onControlRendering = function (ctrl, field) {\r\n if (field.InternalName == \"Title\") {\r\n // Update the label of the Title field\r\n ctrl.label = \"Description\";\r\n }\r\n };\r\n // See if a custom event exists\r\n if (_this._props.onItemFormViewing && _this._props.onItemFormViewing.onCreateViewForm) {\r\n // Return the properties\r\n return _this._props.onItemFormViewing.onCreateViewForm(props);\r\n }\r\n // Return the properties\r\n return props;\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n }).el;\r\n case ActionButtonTypes.View:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"View\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"img-flip-x p-1 btn-actions-view\",\r\n iconType: front_1.front,\r\n iconSize: 24,\r\n isDisabled: !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanView) {\r\n // Open the file in a new tab\r\n window.open(isWopi ? gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/WopiFrame.aspx?sourcedoc=\" + file.ServerRelativeUrl + \"&action=view\" : file.ServerRelativeUrl, \"_blank\");\r\n }\r\n }\r\n },\r\n }).el;\r\n }\r\n };\r\n // Renders the file icon\r\n Documents.prototype.renderFileIcon = function (el, fileName) {\r\n // Render the icon wrapper\r\n var span = document.createElement(\"span\");\r\n span.className = \"text-body\";\r\n el.appendChild(span);\r\n // Render the icon\r\n var size = 28;\r\n switch ((0, methods_1.getFileExt)(fileName)) {\r\n // Power BI\r\n case \"pbix\":\r\n span.appendChild((0, fileEarmarkBarGraph_1.fileEarmarkBarGraph)(size));\r\n span.title = \"Power BI Report\";\r\n break;\r\n // Binary\r\n case \"bin\":\r\n case \"blg\":\r\n case \"dat\":\r\n case \"dmg\":\r\n case \"dmp\":\r\n case \"log\":\r\n case \"pbi\":\r\n span.appendChild((0, fileEarmarkBinary_1.fileEarmarkBinary)(size));\r\n span.title = \"Binary File\";\r\n break;\r\n // Code\r\n case \"app\":\r\n case \"asp\":\r\n case \"aspx\":\r\n case \"css\":\r\n case \"hta\":\r\n case \"htm\":\r\n case \"html\":\r\n case \"js\":\r\n case \"json\":\r\n case \"mht\":\r\n case \"mhtml\":\r\n case \"scss\":\r\n case \"sppkg\":\r\n case \"wsp\":\r\n case \"xml\":\r\n case \"yaml\":\r\n span.appendChild((0, fileEarmarkCode_1.fileEarmarkCode)(size));\r\n span.title = \"Code\";\r\n break;\r\n // Excel\r\n case \"csv\":\r\n case \"ods\":\r\n case \"xls\":\r\n case \"xlsx\":\r\n case \"xlt\":\r\n case \"xltx\":\r\n span.appendChild((0, fileEarmarkExcel_1.fileEarmarkExcel)(size));\r\n span.title = \"Excel Spreadsheet\";\r\n break;\r\n // Image\r\n case \"ai\":\r\n case \"bmp\":\r\n case \"eps\":\r\n case \"gif\":\r\n case \"heic\":\r\n case \"heif\":\r\n case \"jpe\":\r\n case \"jpeg\":\r\n case \"jpg\":\r\n case \"png\":\r\n case \"psd\":\r\n case \"svg\":\r\n case \"tif\":\r\n case \"tiff\":\r\n case \"webp\":\r\n span.appendChild((0, fileEarmarkImage_1.fileEarmarkImage)(size));\r\n span.title = \"Image\";\r\n break;\r\n // Audio\r\n case \"aac\":\r\n case \"aiff\":\r\n case \"alac\":\r\n case \"flac\":\r\n case \"m4a\":\r\n case \"m4p\":\r\n case \"mka\":\r\n case \"mp3\":\r\n case \"mp4a\":\r\n case \"wav\":\r\n case \"wma\":\r\n span.appendChild((0, fileEarmarkMusic_1.fileEarmarkMusic)(size));\r\n span.title = \"Audio File\";\r\n break;\r\n // PDF\r\n case \"pdf\":\r\n span.appendChild((0, fileEarmarkPdf_1.fileEarmarkPdf)(size));\r\n span.title = \"Adobe PDF\";\r\n break;\r\n // PowerPoint\r\n case \"odp\":\r\n case \"pot\":\r\n case \"potx\":\r\n case \"pps\":\r\n case \"ppsx\":\r\n case \"ppt\":\r\n case \"pptx\":\r\n span.appendChild((0, fileEarmarkPpt_1.fileEarmarkPpt)(size));\r\n span.title = \"PowerPoint Presentation\";\r\n break;\r\n // Media\r\n case \"avi\":\r\n case \"flv\":\r\n case \"m2ts\":\r\n case \"mkv\":\r\n case \"mov\":\r\n case \"m4p\":\r\n case \"m4v\":\r\n case \"mp4\":\r\n case \"mpe\":\r\n case \"mpeg\":\r\n case \"mpg\":\r\n case \"mpv\":\r\n case \"qt\":\r\n case \"ts\":\r\n case \"vob\":\r\n case \"webm\":\r\n case \"wmv\":\r\n span.appendChild((0, fileEarmarkPlay_1.fileEarmarkPlay)(size));\r\n span.title = \"Media File\";\r\n break;\r\n // Rich Text\r\n case \"rtf\":\r\n span.appendChild((0, fileEarmarkRichtext_1.fileEarmarkRichtext)(size));\r\n span.title = \"Rich Text\";\r\n break;\r\n // Database\r\n case \"ldf\":\r\n case \"mdb\":\r\n case \"mdf\":\r\n span.appendChild((0, fileEarmarkSpreadsheet_1.fileEarmarkSpreadsheet)(size));\r\n span.title = \"Database\";\r\n break;\r\n // Text\r\n case \"md\":\r\n case \"text\":\r\n case \"txt\":\r\n span.appendChild((0, fileEarmarkText_1.fileEarmarkText)(size));\r\n span.title = \"Text\";\r\n break;\r\n // Word\r\n case \"doc\":\r\n case \"docx\":\r\n case \"dot\":\r\n case \"dotx\":\r\n case \"odt\":\r\n case \"wpd\":\r\n span.appendChild((0, fileEarmarkWord_1.fileEarmarkWord)(size));\r\n span.title = \"Word Document\";\r\n break;\r\n // Compressed\r\n case \"7z\":\r\n case \"cab\":\r\n case \"gz\":\r\n case \"iso\":\r\n case \"rar\":\r\n case \"tgz\":\r\n case \"zip\":\r\n span.appendChild((0, fileEarmarkZip_1.fileEarmarkZip)(size));\r\n span.title = \"Compressed Folder\";\r\n break;\r\n // Default\r\n default: {\r\n span.appendChild((0, fileEarmark_1.fileEarmark)(size));\r\n span.title = \"File\";\r\n }\r\n }\r\n };\r\n // Renders the navigation\r\n Documents.prototype.renderNavigation = function () {\r\n var _this = this;\r\n var itemsEnd = [];\r\n // See if templates exist\r\n if (this.TemplateFiles && this.TemplateFolders) {\r\n // Add the item\r\n itemsEnd.push({\r\n text: \"Templates\",\r\n className: \"btn btn-sm btn-outline-secondary\",\r\n classNameItem: \"bg-white\",\r\n iconClassName: \"btn-icon-sm\",\r\n iconSize: 20,\r\n iconType: fileEarmarkPlus_1.fileEarmarkPlus,\r\n isButton: true,\r\n items: this.generateItems()\r\n });\r\n }\r\n // Add the upload button\r\n itemsEnd.push({\r\n text: \"Upload\",\r\n onRender: function (el, item) {\r\n // Clear the existing button\r\n el.innerHTML = \"\";\r\n // Create a span to wrap the icon in\r\n var span = document.createElement(\"span\");\r\n span.className = \"bg-white d-inline-flex ms-2 rounded\";\r\n el.appendChild(span);\r\n // Render a tooltip\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: span,\r\n content: item.text,\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1\",\r\n iconType: fileEarmarkArrowUp_1.fileEarmarkArrowUp,\r\n iconSize: 24,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n // Show the file upload dialog\r\n gd_sprest_bs_1.Helper.ListForm.showFileDialog(_this._props.fileExtensions).then(function (fileInfo) {\r\n // Code to run after the event\r\n var onCompleted = function (fileInfo) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Uploading File\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Saving the file you selected. Please wait...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Upload the file\r\n _this.uploadFile(fileInfo).then(\r\n // Success\r\n function (file) {\r\n // Call the event\r\n _this._props.onFileAdded ? _this._props.onFileAdded(file) : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n }, \r\n // Error\r\n function (err) {\r\n // Call the event\r\n _this._props.onFileError ? _this._props.onFileError(err) : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n };\r\n // Call the file adding event\r\n var returnVal = _this._props.onFileAdding ? _this._props.onFileAdding(fileInfo) : null;\r\n if (typeof (returnVal) === \"boolean\") {\r\n // Add the file\r\n returnVal ? onCompleted(fileInfo) : null;\r\n }\r\n // Else, see if it doesn't exist\r\n else if (returnVal == null) {\r\n // Add the file\r\n onCompleted(fileInfo);\r\n }\r\n else if (returnVal.then) {\r\n // Wait for the event to complete\r\n returnVal.then(function (addFile) {\r\n // Add the file\r\n addFile ? onCompleted(fileInfo) : null;\r\n });\r\n }\r\n });\r\n }\r\n },\r\n });\r\n }\r\n });\r\n // Set the default properties\r\n var navProps = {\r\n el: this._el,\r\n brand: \"Documents\",\r\n className: \"mt-3 rounded\",\r\n itemsEnd: itemsEnd,\r\n type: gd_sprest_bs_1.Components.NavbarTypes.Primary,\r\n searchBox: this._props.enableSearch ? {\r\n hideButton: true,\r\n onChange: function (value) {\r\n // Search the data table\r\n _this._dt.search(value);\r\n },\r\n onSearch: function (value) {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n } : null\r\n };\r\n // Call the rendering event\r\n this._props.onNavigationRendering ? this._props.onNavigationRendering(navProps) : null;\r\n // Create the navbar\r\n this._navbar = gd_sprest_bs_1.Components.Navbar(navProps);\r\n /* Fix the padding on the left & right of the nav */\r\n this._navbar.el.querySelector(\"div.container-fluid\").classList.add(\"ps-75\");\r\n this._navbar.el.querySelector(\"div.container-fluid\").classList.add(\"pe-2\");\r\n // See if we are showing the filter\r\n if (this._props.onShowFilter) {\r\n // Render the filter icon\r\n var icon = document.createElement(\"div\");\r\n icon.classList.add(\"filter-icon\");\r\n icon.classList.add(\"nav-link\");\r\n icon.classList.add(\"text-dark\");\r\n icon.style.cursor = \"pointer\";\r\n icon.appendChild((0, filterSquare_1.filterSquare)());\r\n this._props.onShowFilter ? icon.addEventListener(\"click\", this._props.onShowFilter) : null;\r\n this._navbar.el.firstElementChild.appendChild(icon);\r\n // Call the render event\r\n this._props.onFilterRendered ? this._props.onFilterRendered(icon) : null;\r\n }\r\n // Call the render events\r\n this._props.onSearchRendered ? this._props.onSearchRendered(this._navbar.el.querySelector(\"input[type='search']\")) : null;\r\n this._props.onNavigationRendered ? this._props.onNavigationRendered(this.Navigation) : null;\r\n };\r\n // Renders the datatable with the file information\r\n Documents.prototype.renderTable = function () {\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n this._el.appendChild(el);\r\n this._tblProps.el = el;\r\n // Set the data\r\n this._tblProps.rows = this.Attachments || this.Files;\r\n // Call the rendering event\r\n this._props.table && this._props.table.onRendering ? this._props.table.onRendering(this._tblProps) : null;\r\n // Render the table\r\n this._dt = new table_1.DataTable(this._tblProps);\r\n // Call the rendered event\r\n this._tblProps.onRendered ? this._tblProps.onRendered(el, this._dt.datatable) : null;\r\n };\r\n // Uploads a file\r\n Documents.prototype.uploadFile = function (fileInfo) {\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.List)(_this._props.listName);\r\n // See if this is an attachment\r\n if (_this.IsAttachment) {\r\n // Upload the attachment\r\n list.Items(_this._props.itemId).AttachmentFiles().add(fileInfo.name, fileInfo.data).execute(resolve, reject);\r\n }\r\n else {\r\n // Upload the file to the objective folder\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(fileInfo.name, true, fileInfo.data).execute(resolve, reject);\r\n }\r\n });\r\n };\r\n /** Public Methods */\r\n // Generates an action button\r\n Documents.prototype.generateActionButton = function (btnType, file) {\r\n // Return the button\r\n return this.generateButton(btnType, file);\r\n };\r\n // Refreshes the documents\r\n Documents.prototype.refresh = function () {\r\n var _this = this;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Reloading Workspace\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Reloading the workspace data. This will close afterwards.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Clear the element\r\n while (this._el.firstChild) {\r\n this._el.removeChild(this._el.firstChild);\r\n }\r\n // Render the component\r\n this.render().then(function () {\r\n // Call the event\r\n _this._props.onRefresh ? _this._props.onRefresh() : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n };\r\n // Searches the data table\r\n Documents.prototype.search = function (value) {\r\n // Search the table data\r\n this._dt.search(value);\r\n };\r\n return Documents;\r\n}());\r\nexports.Documents = Documents;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/documents.js?");
63
+ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Documents = exports.ActionButtonTypes = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\nvar jQuery = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\nvar moment = __webpack_require__(/*! moment */ \"./node_modules/.pnpm/moment@2.29.4/node_modules/moment/moment.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar methods_1 = __webpack_require__(/*! ./methods */ \"./build/common/methods.js\");\r\nvar table_1 = __webpack_require__(/*! ../dashboard/table */ \"./build/dashboard/table.js\");\r\nvar itemForm_1 = __webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\");\r\n/** Icons */\r\nvar fileEarmark_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmark */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmark.js\");\r\nvar fileEarmarkArrowDown_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkArrowDown */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkArrowDown.js\");\r\nvar fileEarmarkArrowUp_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkArrowUp */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkArrowUp.js\");\r\nvar fileEarmarkBarGraph_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkBarGraph */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkBarGraph.js\");\r\nvar fileEarmarkBinary_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkBinary */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkBinary.js\");\r\nvar fileEarmarkCode_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkCode */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkCode.js\");\r\nvar fileEarmarkExcel_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkExcel */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkExcel.js\");\r\nvar fileEarmarkImage_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkImage */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkImage.js\");\r\nvar fileEarmarkMusic_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkMusic */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkMusic.js\");\r\nvar fileEarmarkPdf_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPdf */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPdf.js\");\r\nvar fileEarmarkPlus_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPlus */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPlus.js\");\r\nvar fileEarmarkPpt_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPpt */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPpt.js\");\r\nvar fileEarmarkPlay_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkPlay */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkPlay.js\");\r\nvar fileEarmarkRichtext_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkRichtext */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkRichtext.js\");\r\nvar fileEarmarkSpreadsheet_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkSpreadsheet */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkSpreadsheet.js\");\r\nvar fileEarmarkText_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkText */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkText.js\");\r\nvar fileEarmarkWord_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkWord */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkWord.js\");\r\nvar fileEarmarkZip_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/fileEarmarkZip */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/fileEarmarkZip.js\");\r\nvar filterSquare_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/filterSquare */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/filterSquare.js\");\r\nvar front_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/front */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/front.js\");\r\nvar inputCursorText_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/inputCursorText */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/inputCursorText.js\");\r\nvar layoutTextSidebar_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/layoutTextSidebar */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/layoutTextSidebar.js\");\r\nvar x_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/x */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/icons/svgs/x.js\");\r\n/** Action Button Types */\r\nvar ActionButtonTypes;\r\n(function (ActionButtonTypes) {\r\n ActionButtonTypes[ActionButtonTypes[\"Delete\"] = 1] = \"Delete\";\r\n ActionButtonTypes[ActionButtonTypes[\"Download\"] = 2] = \"Download\";\r\n ActionButtonTypes[ActionButtonTypes[\"Edit\"] = 3] = \"Edit\";\r\n ActionButtonTypes[ActionButtonTypes[\"Properties\"] = 4] = \"Properties\";\r\n ActionButtonTypes[ActionButtonTypes[\"View\"] = 5] = \"View\";\r\n})(ActionButtonTypes = exports.ActionButtonTypes || (exports.ActionButtonTypes = {}));\r\n/**\r\n * Documents\r\n * Renders a data table containing the contents of a document library.\r\n */\r\nvar Documents = /** @class */ (function () {\r\n // Constructor\r\n function Documents(props) {\r\n this._el = null;\r\n this._props = null;\r\n this._tblProps = null;\r\n /** The list item attachments */\r\n this._attachments = null;\r\n /** The data table */\r\n this._dt = null;\r\n // Can delete documents\r\n this._canDelete = true;\r\n // Can edit documents\r\n this._canEdit = true;\r\n // Can view documents\r\n this._canView = true;\r\n // The navigation component\r\n this._navbar = null;\r\n // The root folder of the library\r\n this._rootFolder = null;\r\n // The template files\r\n this._templatesFiles = null;\r\n // The template folders\r\n this._templateFolders = null;\r\n // Save the properties\r\n this._props = props;\r\n // Default the permissions\r\n this._canDelete = typeof (this._props.canDelete) === \"boolean\" ? this._props.canDelete : true;\r\n this._canEdit = typeof (this._props.canEdit) === \"boolean\" ? this._props.canEdit : true;\r\n this._canView = typeof (this._props.canView) === \"boolean\" ? this._props.canView : true;\r\n // Create the element\r\n this._el = document.createElement(\"div\");\r\n this._props.el ? this._props.el.appendChild(this._el) : null;\r\n // Generate the table properties\r\n this.generateTableProps();\r\n // Render the component\r\n this.render();\r\n }\r\n Object.defineProperty(Documents.prototype, \"Attachments\", {\r\n get: function () { return this._attachments; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"DataTable\", {\r\n get: function () { return this._dt; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanDelete\", {\r\n get: function () { return this._canDelete; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanEdit\", {\r\n get: function () { return this._canEdit; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"CanView\", {\r\n get: function () { return this._canView; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"Files\", {\r\n // The files\r\n get: function () {\r\n // Default the files to the root folder\r\n var files = this.RootFolder.Files.results;\r\n // Parse the folders\r\n var formsFl = false;\r\n for (var i = 0; i < this.RootFolder.Folders.results.length; i++) {\r\n var folder = this.RootFolder.Folders.results[i];\r\n // Skip the internal forms folder\r\n if (!formsFl && folder.Name == \"Forms\") {\r\n // Set the flag and skip this folder\r\n formsFl = true;\r\n continue;\r\n }\r\n // Append files\r\n files = files.concat(folder.Files.results);\r\n }\r\n // Return the files\r\n return files;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"IsAttachment\", {\r\n // Type of object we are dealing with\r\n get: function () { return this._props.itemId > 0; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"IsDocSet\", {\r\n get: function () { return this._props.docSetId > 0; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"Navigation\", {\r\n get: function () { return this._navbar; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"NavigationElement\", {\r\n // The navigation element\r\n get: function () { return this.Navigation.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"RootFolder\", {\r\n get: function () { return this._rootFolder; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TableElement\", {\r\n // The table element\r\n get: function () { return this.DataTable.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TemplateFiles\", {\r\n get: function () { return this._templatesFiles; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Documents.prototype, \"TemplateFolders\", {\r\n get: function () { return this._templateFolders; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Copies a file to a folder to the library\r\n * @param item The dropdown item containing the file/folder to copy.\r\n */\r\n Documents.prototype.copyFile = function (item) {\r\n var _this = this;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Initializing the Transfer\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Copying the file(s) to the workspace...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // See if this is a folder\r\n if (item.data.Files) {\r\n // Parse the files\r\n var folder = item.data;\r\n gd_sprest_bs_1.Helper.Executor(folder.Files.results, function (file) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the file contents\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFileByServerRelativeUrl(file.ServerRelativeUrl).content().execute(function (data) {\r\n // Copy the file\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file.Name, true, data).execute(resolve, resolve);\r\n });\r\n });\r\n }).then(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n });\r\n }\r\n else {\r\n // Copy the file\r\n var file_1 = item.data;\r\n file_1.content().execute(function (data) {\r\n // Copy the file\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(file_1.Name, true, data).execute(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n });\r\n });\r\n }\r\n };\r\n // Generates the table columns\r\n Documents.prototype.generateColumns = function () {\r\n // See if the columns were provided\r\n if (this._props.table && this._props.table.columns) {\r\n return this._props.table.columns;\r\n }\r\n // See if we are dealing w/ attachments\r\n if (this.IsAttachment) {\r\n // Return the default columns\r\n return [\r\n {\r\n name: \"Type\",\r\n title: \"Type\"\r\n },\r\n {\r\n name: \"FileName\",\r\n title: \"Name\"\r\n },\r\n {\r\n className: \"text-end text-nowrap\",\r\n name: \"Actions\",\r\n title: \"\"\r\n }\r\n ];\r\n }\r\n // Return the default columns\r\n return [\r\n {\r\n name: \"Type\",\r\n title: \"Type\",\r\n },\r\n {\r\n name: \"Name\",\r\n title: \"Name\"\r\n },\r\n {\r\n name: \"Title\",\r\n title: \"Description\"\r\n },\r\n {\r\n name: \"FileSize\",\r\n title: \"File Size\"\r\n },\r\n {\r\n name: \"Created\",\r\n title: \"Created\"\r\n },\r\n {\r\n name: \"Author\",\r\n title: \"Created By\"\r\n },\r\n {\r\n name: \"Modified\",\r\n title: \"Modified\"\r\n },\r\n {\r\n name: \"ModifiedBy\",\r\n title: \"Modified By\"\r\n },\r\n {\r\n className: \"text-end text-nowrap\",\r\n name: \"Actions\",\r\n title: \"\"\r\n }\r\n ];\r\n };\r\n // Generates the template files/folders dropdown items\r\n Documents.prototype.generateItems = function () {\r\n var _this = this;\r\n var items = [];\r\n // Parse the template folders\r\n for (var i = 0; i < this.TemplateFolders.length; i++) {\r\n var folder = this.TemplateFolders[i];\r\n // Skip the internal forms folder\r\n if (folder.Name == \"Forms\") {\r\n continue;\r\n }\r\n // Add a dropdown item\r\n items.push({\r\n text: folder.Name,\r\n data: folder,\r\n value: folder.ServerRelativeUrl,\r\n onClick: function (item) { _this.copyFile(item); }\r\n });\r\n }\r\n // Parse the template files\r\n for (var i = 0; i < this.TemplateFiles.length; i++) {\r\n var file = this.TemplateFiles[i];\r\n // Add a dropdown item\r\n items.push({\r\n text: file.Name,\r\n data: file,\r\n value: file.ServerRelativeUrl,\r\n onClick: function (item) { _this.copyFile(item); }\r\n });\r\n }\r\n // Return the dropdown items\r\n return items.sort(function (a, b) {\r\n if (a.text < b.text) {\r\n return -1;\r\n }\r\n if (a.text > b.text) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n };\r\n // Generates the table properties\r\n Documents.prototype.generateTableProps = function () {\r\n var _this = this;\r\n // Default the indexes for the type and action buttons\r\n var idxActions = this.IsAttachment ? 2 : 8;\r\n // See if custom columns are defined\r\n if (this._props.table && this._props.table.columns) {\r\n // Clear the indexes\r\n idxActions = -1;\r\n // Parse the columns\r\n for (var i = 0; i < this._props.table.columns.length; i++) {\r\n // Update the index based on the value\r\n switch (this._props.table.columns[i].name) {\r\n // Actions\r\n case \"Actions\":\r\n idxActions = i;\r\n break;\r\n }\r\n }\r\n }\r\n // See if the column definitions are not defined\r\n var columnDefs = this._props.table ? this._props.table.dtProps : null;\r\n if (columnDefs == null) {\r\n columnDefs = [];\r\n // Add the default options for the Actions and Type\r\n idxActions >= 0 ? columnDefs.push({ targets: idxActions, orderable: false, searchable: false }) : null;\r\n }\r\n // Create the table properties\r\n this._tblProps = {\r\n el: null,\r\n dtProps: this._props.table && this._props.table.dtProps ? this._props.table.dtProps : {\r\n dom: 'rt<\"row\"<\"col-sm-4\"l><\"col-sm-4\"i><\"col-sm-4\"p>>',\r\n columnDefs: columnDefs,\r\n createdRow: function (row, data, index) {\r\n jQuery('td', row).addClass('align-middle');\r\n },\r\n // Add some classes to the dataTable elements\r\n drawCallback: function (settings) {\r\n var api = new jQuery.fn.dataTable.Api(settings);\r\n var div = api.table().container();\r\n var table = api.table().node();\r\n div.querySelector(\".dataTables_info\").classList.add(\"text-center\");\r\n div.querySelector(\".dataTables_length\").classList.add(\"pt-2\");\r\n div.querySelector(\".dataTables_paginate\").classList.add(\"pt-03\");\r\n table.classList.remove(\"no-footer\");\r\n table.classList.add(\"tbl-footer\");\r\n table.classList.add(\"table-striped\");\r\n },\r\n headerCallback: function (thead, data, start, end, display) {\r\n jQuery('th', thead).addClass('align-middle');\r\n },\r\n // Order by the 1st column by default; ascending\r\n order: [[1, \"asc\"]]\r\n },\r\n columns: this.generateColumns()\r\n };\r\n // Parse the columns\r\n gd_sprest_bs_1.Helper.Executor(this._tblProps.columns, function (col) {\r\n var customEvent = col.onRenderCell;\r\n // See if this is the type column\r\n if (col.name == \"Type\") {\r\n // Set the event to render an icon\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the file\r\n _this.renderFileIcon(el, _this.getFileName(file));\r\n // Set the filter/sort value\r\n el.setAttribute(\"data-filter\", (0, methods_1.getFileExt)(_this.getFileName(file)));\r\n el.setAttribute(\"data-sort\", (0, methods_1.getFileExt)(_this.getFileName(file)));\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is the file size\r\n else if (col.name == \"FileSize\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the file size value\r\n el.innerHTML = (0, methods_1.formatBytes)(file.Length);\r\n // Set the sort value\r\n el.setAttribute(\"data-sort\", file.Length.toString());\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is a date/time field\r\n else if (col.name == \"Created\" || col.name == \"Modified\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the date/time value\r\n var value = col.name == \"Created\" ? file.TimeCreated : file.TimeLastModified;\r\n el.innerHTML = (0, methods_1.formatTimeValue)(value);\r\n // Set the date/time filter/sort values\r\n el.setAttribute(\"data-filter\", moment(value).format(\"dddd MMMM DD YYYY\"));\r\n el.setAttribute(\"data-sort\", value);\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is a user field\r\n else if (col.name == \"Author\" || col.name == \"ModifiedBy\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the Person field Title\r\n el.innerHTML = (file[col.name] ? file[col.name][\"Title\"] : null) || \"\";\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n // Else, see if this is the \"actions\" buttons\r\n else if (col.name == \"Actions\") {\r\n // Set the event to render the size\r\n col.onRenderCell = function (el, col, file) {\r\n // Render the action buttons\r\n _this.renderActionButtons(el, file);\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n _this._props.onActionsRendered ? _this._props.onActionsRendered(el, col, file) : null;\r\n };\r\n }\r\n else {\r\n // Set the default render event\r\n col.onRenderCell = function (el, col, file) {\r\n // Set the value\r\n el.innerHTML = file[col.name] ||\r\n (file.ListItemAllFields && file.ListItemAllFields.FieldValuesAsText[col.name]) || \"\";\r\n // Call the custom event\r\n customEvent ? customEvent(el, col, file) : null;\r\n };\r\n }\r\n });\r\n };\r\n // Gets the file name\r\n Documents.prototype.getFileName = function (file) {\r\n // Return the file name\r\n return file.Name || file.FileName;\r\n };\r\n // Determines if the document can be viewed in office online servers\r\n Documents.isWopi = function (filename) {\r\n switch ((0, methods_1.getFileExt)(filename)) {\r\n // Excel\r\n case \"csv\":\r\n case \"doc\":\r\n case \"docx\":\r\n case \"dot\":\r\n case \"dotx\":\r\n case \"pot\":\r\n case \"potx\":\r\n case \"pps\":\r\n case \"ppsx\":\r\n case \"ppt\":\r\n case \"pptx\":\r\n case \"xls\":\r\n case \"xlsx\":\r\n case \"xlt\":\r\n case \"xltx\":\r\n return true;\r\n // Default\r\n default: {\r\n return false;\r\n }\r\n }\r\n };\r\n // Loads the data\r\n Documents.prototype.load = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var web = (0, gd_sprest_bs_1.Web)(_this._props.webUrl);\r\n // Clear the properties\r\n _this._rootFolder = null;\r\n _this._templateFolders = null;\r\n _this._templatesFiles = null;\r\n // See if the templates library was set\r\n if (_this._props.templatesUrl) {\r\n // Load the files and folders\r\n web.getFolderByServerRelativeUrl(_this._props.templatesUrl).query({\r\n Expand: [\"Folders/Files\", \"Files\"]\r\n }).execute(\r\n // Templates folder exists\r\n function (folder) {\r\n // Set the template files\r\n _this._templatesFiles = folder.Files.results;\r\n // Set the template folders\r\n _this._templateFolders = folder.Folders.results;\r\n }, \r\n // Error loading the templates folder\r\n function () {\r\n // Log\r\n console.error(\"[Dattatable] Document's template folder failed to be loaded.\", _this._props.templatesUrl);\r\n });\r\n }\r\n // Set the query\r\n var query = _this._props.query || {};\r\n query.Expand = (query.Expand ? query.Expand : []).concat([\r\n \"Folders/Files\", \"Folders/Files/Author\",\r\n \"Folders/Files/ListItemAllFields\", \"Folders/Files/ListItemAllFields/FieldValuesAsText\",\r\n \"Folders/Files/ModifiedBy\", \"Files\", \"Files/Author\", \"Files/ListItemAllFields\",\r\n \"Files/ListItemAllFields/FieldValuesAsText\", \"Files/ModifiedBy\"\r\n ]);\r\n // See if we are targeting a document set folder\r\n if (_this.IsDocSet) {\r\n web.Lists(_this._props.listName).Items(_this._props.docSetId).Folder().query(query).execute(function (folder) {\r\n // Set the root folder\r\n _this._rootFolder = folder;\r\n }, reject);\r\n }\r\n // Else, see if we are targeting list item attachments\r\n else if (_this.IsAttachment) {\r\n web.Lists(_this._props.listName).Items(_this._props.itemId).AttachmentFiles().execute(function (attachments) {\r\n // Set the attachments\r\n _this._attachments = attachments.results;\r\n }, reject);\r\n }\r\n // Else, it's a library\r\n else {\r\n // Load library information\r\n web.Lists(_this._props.listName).RootFolder().query(query).execute(function (folder) {\r\n // Set the root folder\r\n _this._rootFolder = folder;\r\n }, reject);\r\n }\r\n // Wait for the requests to complete\r\n web.done(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Renders the component\r\n Documents.prototype.render = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Load the data\r\n _this.load().then(function () {\r\n // Render the navigation\r\n _this.renderNavigation();\r\n // Render the table\r\n _this.renderTable();\r\n // Call the render event\r\n _this._props.onRendered ? _this._props.onRendered(_this._el) : null;\r\n // Resolve the promise\r\n resolve();\r\n }, reject);\r\n });\r\n };\r\n // Renders the file actions\r\n Documents.prototype.renderActionButtons = function (el, file) {\r\n // Create a span to wrap the icons in\r\n var span = document.createElement(\"span\");\r\n span.className = \"bg-white d-inline-flex ms-2 rounded\";\r\n var spanEdit = span.cloneNode();\r\n var spanProps = span.cloneNode();\r\n var spanDownload = span.cloneNode();\r\n var spanDel = span.cloneNode();\r\n spanDel.classList.add(\"me-1\");\r\n // Add the icons\r\n el.appendChild(span);\r\n el.appendChild(spanEdit);\r\n this.IsAttachment ? null : el.appendChild(spanProps);\r\n el.appendChild(spanDownload);\r\n el.appendChild(spanDel);\r\n // Render the buttons\r\n span.appendChild(this.generateButton(ActionButtonTypes.View, file));\r\n spanEdit.appendChild(this.generateButton(ActionButtonTypes.Edit, file));\r\n this.IsAttachment ? null : spanProps.appendChild(this.generateButton(ActionButtonTypes.Properties, file));\r\n spanDownload.appendChild(this.generateButton(ActionButtonTypes.Download, file));\r\n spanDel.appendChild(this.generateButton(ActionButtonTypes.Delete, file));\r\n };\r\n Documents.prototype.generateButton = function (btnType, file) {\r\n var _this = this;\r\n var isWopi = Documents.isWopi(this.getFileName(file));\r\n // Render the button based on the type\r\n switch (btnType) {\r\n case ActionButtonTypes.Delete:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Delete\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-delete\",\r\n iconType: x_1.x,\r\n iconSize: 24,\r\n isDisabled: !this.CanDelete,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanDelete) {\r\n // Confirm we want to delete the item\r\n if (confirm(\"Are you sure you want to delete this document?\")) {\r\n // Display a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Deleting Document\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Deleting Document: \" + _this.getFileName(file) + \". This will close afterwards.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Delete the document\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFileByServerRelativeUrl(file.ServerRelativeUrl).delete().execute(\r\n // Success\r\n function () {\r\n // close dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page \r\n _this.refresh();\r\n }, \r\n // Error\r\n function (err) {\r\n // TODO\r\n });\r\n }\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Download:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Download\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-download\",\r\n iconType: fileEarmarkArrowDown_1.fileEarmarkArrowDown,\r\n iconSize: 24,\r\n isDisabled: !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanView) {\r\n window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/download.aspx?SourceUrl=\" + file.ServerRelativeUrl, \"_blank\");\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Edit:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Edit\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-edit\",\r\n iconType: inputCursorText_1.inputCursorText,\r\n iconSize: 24,\r\n isDisabled: (!isWopi || !this.CanEdit),\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (isWopi && _this.CanEdit) {\r\n // Open the file in a new tab\r\n window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/WopiFrame.aspx?sourcedoc=\" + file.ServerRelativeUrl + \"&action=edit\");\r\n }\r\n }\r\n },\r\n }).el;\r\n case ActionButtonTypes.Properties:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"Properties\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1 btn-actions-properties\",\r\n iconType: layoutTextSidebar_1.layoutTextSidebar,\r\n iconSize: 24,\r\n isDisabled: !this.CanEdit && !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n // Set the item form properties\r\n itemForm_1.ItemForm.ListName = _this._props.listName;\r\n itemForm_1.ItemForm.UseModal = false;\r\n // Ensure the user can edit the item\r\n if (_this.CanEdit) {\r\n // Define the properties\r\n var editProps = __assign(__assign({}, (_this._props.onItemFormEditing || {})), {\r\n // Set the item id\r\n itemId: file.ListItemAllFields[\"Id\"],\r\n // Set the edit form properties\r\n onCreateEditForm: function (props) {\r\n // Set the rendering event\r\n props.onControlRendering = function (ctrl, field) {\r\n if (field.InternalName == \"FileLeafRef\") {\r\n // Validate the name of the file\r\n ctrl.onValidate = function (ctrl, results) {\r\n var _a;\r\n // Ensure the value is less than 128 characters\r\n if (((_a = results.value) === null || _a === void 0 ? void 0 : _a.length) > 128) {\r\n // Return an error message\r\n results.invalidMessage = \"The file name must be less than 128 characters.\";\r\n results.isValid = false;\r\n }\r\n // Return the results\r\n return results;\r\n };\r\n }\r\n else if (field.InternalName == \"Title\") {\r\n // Update the label of the Title field\r\n ctrl.label = \"Description\";\r\n }\r\n };\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onCreateEditForm) {\r\n // Return the properties\r\n return _this._props.onItemFormEditing.onCreateEditForm(props);\r\n }\r\n // Return the properties\r\n return props;\r\n },\r\n // Update the footer\r\n onSetFooter: function (el) {\r\n var updateBtn = el.querySelector('[role=\"group\"]').firstChild;\r\n updateBtn.classList.remove(\"btn-outline-primary\");\r\n updateBtn.classList.add(\"btn-primary\");\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onSetFooter) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onSetFooter(el);\r\n }\r\n },\r\n // Update the header\r\n onSetHeader: function (el) {\r\n // Update the header\r\n el.querySelector(\"h5\").innerHTML = \"Properties\";\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onSetHeader) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onSetHeader(el);\r\n }\r\n },\r\n // Refresh the view when updates occur\r\n onUpdate: function (item) {\r\n // See if a custom event exists\r\n if (_this._props.onItemFormEditing && _this._props.onItemFormEditing.onUpdate) {\r\n // Execute the event\r\n _this._props.onItemFormEditing.onUpdate(item);\r\n }\r\n else {\r\n // Refresh the data table\r\n _this.refresh();\r\n }\r\n }\r\n });\r\n // Show the edit form\r\n itemForm_1.ItemForm.edit(editProps);\r\n }\r\n else {\r\n // View the form\r\n itemForm_1.ItemForm.view(__assign(__assign({}, (_this._props.onItemFormViewing || {})), {\r\n itemId: file.ListItemAllFields[\"Id\"],\r\n // Set the view form properties\r\n onCreateViewForm: function (props) {\r\n // Set the rendering event\r\n props.onControlRendering = function (ctrl, field) {\r\n if (field.InternalName == \"Title\") {\r\n // Update the label of the Title field\r\n ctrl.label = \"Description\";\r\n }\r\n };\r\n // See if a custom event exists\r\n if (_this._props.onItemFormViewing && _this._props.onItemFormViewing.onCreateViewForm) {\r\n // Return the properties\r\n return _this._props.onItemFormViewing.onCreateViewForm(props);\r\n }\r\n // Return the properties\r\n return props;\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n }).el;\r\n case ActionButtonTypes.View:\r\n return gd_sprest_bs_1.Components.Tooltip({\r\n content: \"View\",\r\n btnProps: {\r\n // Render the icon button\r\n className: \"img-flip-x p-1 btn-actions-view\",\r\n iconType: front_1.front,\r\n iconSize: 24,\r\n isDisabled: !this.CanView,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n if (_this.CanView) {\r\n // Open the file in a new tab\r\n window.open(isWopi ? gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + \"/_layouts/15/WopiFrame.aspx?sourcedoc=\" + file.ServerRelativeUrl + \"&action=view\" : file.ServerRelativeUrl, \"_blank\");\r\n }\r\n }\r\n },\r\n }).el;\r\n }\r\n };\r\n // Renders the file icon\r\n Documents.prototype.renderFileIcon = function (el, fileName) {\r\n // Render the icon wrapper\r\n var span = document.createElement(\"span\");\r\n span.className = \"text-body\";\r\n el.appendChild(span);\r\n // Render the icon\r\n var size = 28;\r\n switch ((0, methods_1.getFileExt)(fileName)) {\r\n // Power BI\r\n case \"pbix\":\r\n span.appendChild((0, fileEarmarkBarGraph_1.fileEarmarkBarGraph)(size));\r\n span.title = \"Power BI Report\";\r\n break;\r\n // Binary\r\n case \"bin\":\r\n case \"blg\":\r\n case \"dat\":\r\n case \"dmg\":\r\n case \"dmp\":\r\n case \"log\":\r\n case \"pbi\":\r\n span.appendChild((0, fileEarmarkBinary_1.fileEarmarkBinary)(size));\r\n span.title = \"Binary File\";\r\n break;\r\n // Code\r\n case \"app\":\r\n case \"asp\":\r\n case \"aspx\":\r\n case \"css\":\r\n case \"hta\":\r\n case \"htm\":\r\n case \"html\":\r\n case \"js\":\r\n case \"json\":\r\n case \"mht\":\r\n case \"mhtml\":\r\n case \"scss\":\r\n case \"sppkg\":\r\n case \"wsp\":\r\n case \"xml\":\r\n case \"yaml\":\r\n span.appendChild((0, fileEarmarkCode_1.fileEarmarkCode)(size));\r\n span.title = \"Code\";\r\n break;\r\n // Excel\r\n case \"csv\":\r\n case \"ods\":\r\n case \"xls\":\r\n case \"xlsx\":\r\n case \"xlt\":\r\n case \"xltx\":\r\n span.appendChild((0, fileEarmarkExcel_1.fileEarmarkExcel)(size));\r\n span.title = \"Excel Spreadsheet\";\r\n break;\r\n // Image\r\n case \"ai\":\r\n case \"bmp\":\r\n case \"eps\":\r\n case \"gif\":\r\n case \"heic\":\r\n case \"heif\":\r\n case \"jpe\":\r\n case \"jpeg\":\r\n case \"jpg\":\r\n case \"png\":\r\n case \"psd\":\r\n case \"svg\":\r\n case \"tif\":\r\n case \"tiff\":\r\n case \"webp\":\r\n span.appendChild((0, fileEarmarkImage_1.fileEarmarkImage)(size));\r\n span.title = \"Image\";\r\n break;\r\n // Audio\r\n case \"aac\":\r\n case \"aiff\":\r\n case \"alac\":\r\n case \"flac\":\r\n case \"m4a\":\r\n case \"m4p\":\r\n case \"mka\":\r\n case \"mp3\":\r\n case \"mp4a\":\r\n case \"wav\":\r\n case \"wma\":\r\n span.appendChild((0, fileEarmarkMusic_1.fileEarmarkMusic)(size));\r\n span.title = \"Audio File\";\r\n break;\r\n // PDF\r\n case \"pdf\":\r\n span.appendChild((0, fileEarmarkPdf_1.fileEarmarkPdf)(size));\r\n span.title = \"Adobe PDF\";\r\n break;\r\n // PowerPoint\r\n case \"odp\":\r\n case \"pot\":\r\n case \"potx\":\r\n case \"pps\":\r\n case \"ppsx\":\r\n case \"ppt\":\r\n case \"pptx\":\r\n span.appendChild((0, fileEarmarkPpt_1.fileEarmarkPpt)(size));\r\n span.title = \"PowerPoint Presentation\";\r\n break;\r\n // Media\r\n case \"avi\":\r\n case \"flv\":\r\n case \"m2ts\":\r\n case \"mkv\":\r\n case \"mov\":\r\n case \"m4p\":\r\n case \"m4v\":\r\n case \"mp4\":\r\n case \"mpe\":\r\n case \"mpeg\":\r\n case \"mpg\":\r\n case \"mpv\":\r\n case \"qt\":\r\n case \"ts\":\r\n case \"vob\":\r\n case \"webm\":\r\n case \"wmv\":\r\n span.appendChild((0, fileEarmarkPlay_1.fileEarmarkPlay)(size));\r\n span.title = \"Media File\";\r\n break;\r\n // Rich Text\r\n case \"rtf\":\r\n span.appendChild((0, fileEarmarkRichtext_1.fileEarmarkRichtext)(size));\r\n span.title = \"Rich Text\";\r\n break;\r\n // Database\r\n case \"ldf\":\r\n case \"mdb\":\r\n case \"mdf\":\r\n span.appendChild((0, fileEarmarkSpreadsheet_1.fileEarmarkSpreadsheet)(size));\r\n span.title = \"Database\";\r\n break;\r\n // Text\r\n case \"md\":\r\n case \"text\":\r\n case \"txt\":\r\n span.appendChild((0, fileEarmarkText_1.fileEarmarkText)(size));\r\n span.title = \"Text\";\r\n break;\r\n // Word\r\n case \"doc\":\r\n case \"docx\":\r\n case \"dot\":\r\n case \"dotx\":\r\n case \"odt\":\r\n case \"wpd\":\r\n span.appendChild((0, fileEarmarkWord_1.fileEarmarkWord)(size));\r\n span.title = \"Word Document\";\r\n break;\r\n // Compressed\r\n case \"7z\":\r\n case \"cab\":\r\n case \"gz\":\r\n case \"iso\":\r\n case \"rar\":\r\n case \"tgz\":\r\n case \"zip\":\r\n span.appendChild((0, fileEarmarkZip_1.fileEarmarkZip)(size));\r\n span.title = \"Compressed Folder\";\r\n break;\r\n // Default\r\n default: {\r\n span.appendChild((0, fileEarmark_1.fileEarmark)(size));\r\n span.title = \"File\";\r\n }\r\n }\r\n };\r\n // Renders the navigation\r\n Documents.prototype.renderNavigation = function () {\r\n var _this = this;\r\n var itemsEnd = [];\r\n // See if templates exist\r\n if (this.TemplateFiles && this.TemplateFolders) {\r\n // Add the item\r\n itemsEnd.push({\r\n text: \"Templates\",\r\n className: \"btn btn-sm btn-outline-secondary\",\r\n classNameItem: \"bg-white\",\r\n iconClassName: \"btn-icon-sm\",\r\n iconSize: 20,\r\n iconType: fileEarmarkPlus_1.fileEarmarkPlus,\r\n isButton: true,\r\n items: this.generateItems()\r\n });\r\n }\r\n // Add the upload button\r\n itemsEnd.push({\r\n text: \"Upload\",\r\n onRender: function (el, item) {\r\n // Clear the existing button\r\n el.innerHTML = \"\";\r\n // Create a span to wrap the icon in\r\n var span = document.createElement(\"span\");\r\n span.className = \"bg-white d-inline-flex ms-2 rounded\";\r\n el.appendChild(span);\r\n // Render a tooltip\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: span,\r\n content: item.text,\r\n btnProps: {\r\n // Render the icon button\r\n className: \"p-1\",\r\n iconType: fileEarmarkArrowUp_1.fileEarmarkArrowUp,\r\n iconSize: 24,\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,\r\n onClick: function () {\r\n // Show the file upload dialog\r\n gd_sprest_bs_1.Helper.ListForm.showFileDialog(_this._props.fileExtensions).then(function (fileInfo) {\r\n // Code to run after the event\r\n var onCompleted = function (fileInfo) {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Uploading File\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Saving the file you selected. Please wait...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Upload the file\r\n _this.uploadFile(fileInfo).then(\r\n // Success\r\n function (file) {\r\n // Call the event\r\n _this._props.onFileAdded ? _this._props.onFileAdded(file) : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Refresh the page\r\n _this.refresh();\r\n }, \r\n // Error\r\n function (err) {\r\n // Call the event\r\n _this._props.onFileError ? _this._props.onFileError(err) : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n };\r\n // Call the file adding event\r\n var returnVal = _this._props.onFileAdding ? _this._props.onFileAdding(fileInfo) : null;\r\n if (typeof (returnVal) === \"boolean\") {\r\n // Add the file\r\n returnVal ? onCompleted(fileInfo) : null;\r\n }\r\n // Else, see if it doesn't exist\r\n else if (returnVal == null) {\r\n // Add the file\r\n onCompleted(fileInfo);\r\n }\r\n else if (returnVal.then) {\r\n // Wait for the event to complete\r\n returnVal.then(function (addFile) {\r\n // Add the file\r\n addFile ? onCompleted(fileInfo) : null;\r\n });\r\n }\r\n });\r\n }\r\n },\r\n });\r\n }\r\n });\r\n // Set the default properties\r\n var navProps = {\r\n el: this._el,\r\n brand: \"Documents\",\r\n className: \"rounded\",\r\n itemsEnd: itemsEnd,\r\n type: gd_sprest_bs_1.Components.NavbarTypes.Primary,\r\n searchBox: this._props.enableSearch ? {\r\n hideButton: true,\r\n onChange: function (value) {\r\n // Search the data table\r\n _this._dt.search(value);\r\n },\r\n onSearch: function (value) {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n } : null\r\n };\r\n // Call the rendering event\r\n this._props.onNavigationRendering ? this._props.onNavigationRendering(navProps) : null;\r\n // Create the navbar\r\n this._navbar = gd_sprest_bs_1.Components.Navbar(navProps);\r\n /* Fix the padding on the left & right of the nav */\r\n this._navbar.el.querySelector(\"div.container-fluid\").classList.add(\"ps-75\");\r\n this._navbar.el.querySelector(\"div.container-fluid\").classList.add(\"pe-2\");\r\n // See if we are showing the filter\r\n if (this._props.onShowFilter) {\r\n // Render the filter icon\r\n var icon = document.createElement(\"div\");\r\n icon.classList.add(\"filter-icon\");\r\n icon.classList.add(\"nav-link\");\r\n icon.classList.add(\"text-dark\");\r\n icon.style.cursor = \"pointer\";\r\n icon.appendChild((0, filterSquare_1.filterSquare)());\r\n this._props.onShowFilter ? icon.addEventListener(\"click\", this._props.onShowFilter) : null;\r\n this._navbar.el.firstElementChild.appendChild(icon);\r\n // Call the render event\r\n this._props.onFilterRendered ? this._props.onFilterRendered(icon) : null;\r\n }\r\n // Call the render events\r\n this._props.onSearchRendered ? this._props.onSearchRendered(this._navbar.el.querySelector(\"input[type='search']\")) : null;\r\n this._props.onNavigationRendered ? this._props.onNavigationRendered(this.Navigation) : null;\r\n };\r\n // Renders the datatable with the file information\r\n Documents.prototype.renderTable = function () {\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n this._el.appendChild(el);\r\n this._tblProps.el = el;\r\n // Set the data\r\n this._tblProps.rows = this.Attachments || this.Files;\r\n // Call the rendering event\r\n this._props.table && this._props.table.onRendering ? this._props.table.onRendering(this._tblProps) : null;\r\n // Render the table\r\n this._dt = new table_1.DataTable(this._tblProps);\r\n // Call the rendered event\r\n this._tblProps.onRendered ? this._tblProps.onRendered(el, this._dt.datatable) : null;\r\n };\r\n // Uploads a file\r\n Documents.prototype.uploadFile = function (fileInfo) {\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.List)(_this._props.listName);\r\n // See if this is an attachment\r\n if (_this.IsAttachment) {\r\n // Upload the attachment\r\n list.Items(_this._props.itemId).AttachmentFiles().add(fileInfo.name, fileInfo.data).execute(resolve, reject);\r\n }\r\n else {\r\n // Upload the file to the objective folder\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).getFolderByServerRelativeUrl(_this._rootFolder.ServerRelativeUrl).Files().add(fileInfo.name, true, fileInfo.data).execute(resolve, reject);\r\n }\r\n });\r\n };\r\n /** Public Methods */\r\n // Generates an action button\r\n Documents.prototype.generateActionButton = function (btnType, file) {\r\n // Return the button\r\n return this.generateButton(btnType, file);\r\n };\r\n // Refreshes the documents\r\n Documents.prototype.refresh = function () {\r\n var _this = this;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Reloading Workspace\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Reloading the workspace data. This will close afterwards.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Clear the element\r\n while (this._el.firstChild) {\r\n this._el.removeChild(this._el.firstChild);\r\n }\r\n // Render the component\r\n this.render().then(function () {\r\n // Call the event\r\n _this._props.onRefresh ? _this._props.onRefresh() : null;\r\n // Hide the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n };\r\n // Searches the data table\r\n Documents.prototype.search = function (value) {\r\n // Search the table data\r\n this._dt.search(value);\r\n };\r\n return Documents;\r\n}());\r\nexports.Documents = Documents;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/documents.js?");
64
64
 
65
65
  /***/ }),
66
66
 
@@ -148,7 +148,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
148
148
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
149
149
 
150
150
  "use strict";
151
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Modal = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Modal\r\n */\r\nvar Modal = /** @class */ (function () {\r\n // Constructor\r\n function Modal() {\r\n // Render the canvas\r\n Modal.render();\r\n }\r\n Object.defineProperty(Modal, \"BodyElement\", {\r\n get: function () { return this._elBody; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"FooterElement\", {\r\n get: function () { return this._elFooter; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HeaderElement\", {\r\n get: function () { return this._elHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HideEmptyFooter\", {\r\n get: function () { return this._hideEmptyFooter; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HideEmptyHeader\", {\r\n get: function () { return this._hideEmptyHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Clears the canvas form\r\n Modal.clear = function () {\r\n // Clear the header, body and footer\r\n this.setHeader(\"\");\r\n this.setBody(\"\");\r\n this.setFooter(\"\");\r\n // Set the default properties\r\n this.setAutoClose(false);\r\n this.setBackdrop(true);\r\n this.setCloseButtonVisibility(true);\r\n this.setCloseEvent(null);\r\n this.setHideEmptyFooter(true);\r\n this.setHideEmptyHeader(false);\r\n this.setFocus(false);\r\n this.setIsCentered(true);\r\n this.setKeyboard(true);\r\n this.setScrollable(false);\r\n this.setType(gd_sprest_bs_1.Components.ModalTypes.Large);\r\n // Ensure the header, body and footer are visible\r\n this._elBody.classList.remove(\"d-none\");\r\n this._elFooter.classList.remove(\"d-none\");\r\n this._elHeader.classList.remove(\"d-none\");\r\n };\r\n // Hides the modal\r\n Modal.hide = function () {\r\n // Hide the modal\r\n this._modal.hide();\r\n // Call the close event\r\n this._onCloseEvent ? this._onCloseEvent() : null;\r\n };\r\n // Renders the canvas\r\n Modal.render = function () {\r\n var _this = this;\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n el.id = \"core-modal\";\r\n // Ensure the body exists\r\n if (document.body) {\r\n // Append the element\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n // Create an event\r\n window.addEventListener(\"load\", function () {\r\n // Append the element\r\n document.body.appendChild(el);\r\n });\r\n }\r\n // Render the modal\r\n this._modal = gd_sprest_bs_1.Components.Modal({\r\n el: el,\r\n type: gd_sprest_bs_1.Components.ModalTypes.Large,\r\n options: {\r\n autoClose: false,\r\n backdrop: true,\r\n centered: true,\r\n keyboard: true\r\n },\r\n onRenderBody: function (el) { _this._elBody = el; },\r\n onRenderFooter: function (el) { _this._elFooter = el; },\r\n onRenderHeader: function (el) { _this._elHeader = el.querySelector(\".modal-title\"); ; },\r\n onClose: function () {\r\n // Call the close event\r\n _this._onCloseEvent ? _this._onCloseEvent() : null;\r\n }\r\n });\r\n };\r\n // Sets the auto close flag\r\n Modal.setAutoClose = function (value) { this._modal.setAutoClose(value); };\r\n // Sets the backdrop option\r\n Modal.setBackdrop = function (value) { this._modal.setBackdrop(value); };\r\n // Sets the body\r\n Modal.setBody = function (content) {\r\n // Clear the body\r\n while (this._elBody.firstChild) {\r\n this._elBody.removeChild(this._elBody.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elBody.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elBody.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the close button visibility\r\n Modal.setCloseButtonVisibility = function (showFl) { this._modal.setCloseButtonVisibility(showFl); };\r\n // Sets the close event\r\n Modal.setCloseEvent = function (event) { this._onCloseEvent = event; };\r\n // Sets the flag to hide the empty footer\r\n Modal.setHideEmptyFooter = function (value) { this._hideEmptyFooter = value; };\r\n // Sets the flag to hide the empty header\r\n Modal.setHideEmptyHeader = function (value) { this._hideEmptyHeader = value; };\r\n // Sets the focus option\r\n Modal.setFocus = function (value) { this._modal.setFocus(value); };\r\n // Sets the footer\r\n Modal.setFooter = function (content) {\r\n // Clear the body\r\n while (this._elFooter.firstChild) {\r\n this._elFooter.removeChild(this._elFooter.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elFooter.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elFooter.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the header\r\n Modal.setHeader = function (content) {\r\n // Clear the body\r\n while (this._elHeader.firstChild) {\r\n this._elHeader.removeChild(this._elHeader.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elHeader.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elHeader.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the center option\r\n Modal.setIsCentered = function (value) { this._modal.setIsCentered(value); };\r\n // Sets the keyboard option\r\n Modal.setKeyboard = function (value) { this._modal.setKeyboard(value); };\r\n // Sets the scrollable option\r\n Modal.setScrollable = function (value) { this._modal.setScrollable(value); };\r\n // Sets the modal type\r\n Modal.setType = function (type) { this._modal.setType(type); };\r\n // Shows the modal\r\n Modal.show = function () {\r\n // See if we are hiding the header\r\n if (this.HideEmptyHeader && this.HeaderElement.innerText.trim().length == 0) {\r\n // Hide the header\r\n this.HeaderElement.classList.add(\"d-none\");\r\n }\r\n // See if we are hiding the footer\r\n if (this.HideEmptyFooter && this.FooterElement.innerText.trim().length == 0) {\r\n // Hide the footer\r\n this.FooterElement.classList.add(\"d-none\");\r\n }\r\n // Show the modal\r\n this._modal.show();\r\n };\r\n Modal._modal = null;\r\n Modal._onCloseEvent = null;\r\n // Modal Body\r\n Modal._elBody = null;\r\n // Modal Footer\r\n Modal._elFooter = null;\r\n // Modal Header\r\n Modal._elHeader = null;\r\n // Hides the footer if it's empty\r\n Modal._hideEmptyFooter = true;\r\n // Hides the header if it's empty\r\n Modal._hideEmptyHeader = false;\r\n return Modal;\r\n}());\r\nexports.Modal = Modal;\r\n// Create an instance of the modal\r\nnew Modal();\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/modal.js?");
151
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Modal = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.57/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Modal\r\n */\r\nvar Modal = /** @class */ (function () {\r\n // Constructor\r\n function Modal() {\r\n // Render the canvas\r\n Modal.render();\r\n }\r\n Object.defineProperty(Modal, \"BodyElement\", {\r\n get: function () { return this._elBody; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"FooterElement\", {\r\n get: function () { return this._elFooter; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HeaderElement\", {\r\n get: function () { return this._elHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HideEmptyFooter\", {\r\n get: function () { return this._hideEmptyFooter; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Modal, \"HideEmptyHeader\", {\r\n get: function () { return this._hideEmptyHeader; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Clears the canvas form\r\n Modal.clear = function () {\r\n // Clear the header, body and footer\r\n this.setHeader(\"\");\r\n this.setBody(\"\");\r\n this.setFooter(\"\");\r\n // Set the default properties\r\n this.setAutoClose(false);\r\n this.setBackdrop(true);\r\n this.setCloseButtonVisibility(true);\r\n this.setCloseEvent(null);\r\n this.setHideEmptyFooter(true);\r\n this.setHideEmptyHeader(false);\r\n this.setFocus(false);\r\n this.setIsCentered(true);\r\n this.setKeyboard(true);\r\n this.setScrollable(false);\r\n this.setType(gd_sprest_bs_1.Components.ModalTypes.Large);\r\n // Ensure the header, body and footer are visible\r\n this._elBody.classList.remove(\"d-none\");\r\n this._elFooter.classList.remove(\"d-none\");\r\n this._elHeader.classList.remove(\"d-none\");\r\n };\r\n // Hides the modal\r\n Modal.hide = function () {\r\n // Hide the modal\r\n this._modal.hide();\r\n // Call the close event\r\n this._onCloseEvent ? this._onCloseEvent() : null;\r\n };\r\n // Renders the canvas\r\n Modal.render = function () {\r\n var _this = this;\r\n // Create the element\r\n var el = document.createElement(\"div\");\r\n el.id = \"core-modal\";\r\n // Ensure the body exists\r\n if (document.body) {\r\n // Append the element\r\n document.body.appendChild(el);\r\n }\r\n else {\r\n // Create an event\r\n window.addEventListener(\"load\", function () {\r\n // Append the element\r\n document.body.appendChild(el);\r\n });\r\n }\r\n // Render the modal\r\n this._modal = gd_sprest_bs_1.Components.Modal({\r\n el: el,\r\n type: gd_sprest_bs_1.Components.ModalTypes.Large,\r\n options: {\r\n autoClose: false,\r\n backdrop: true,\r\n centered: true,\r\n keyboard: true\r\n },\r\n onRenderBody: function (el) { _this._elBody = el; },\r\n onRenderFooter: function (el) { _this._elFooter = el; },\r\n onRenderHeader: function (el) { _this._elHeader = el.querySelector(\".modal-title\"); ; },\r\n onClose: function () {\r\n // Call the close event\r\n _this._onCloseEvent ? _this._onCloseEvent() : null;\r\n }\r\n });\r\n };\r\n // Sets the auto close flag\r\n Modal.setAutoClose = function (value) { this._modal.setAutoClose(value); };\r\n // Sets the backdrop option\r\n Modal.setBackdrop = function (value) { this._modal.setBackdrop(value); };\r\n // Sets the body\r\n Modal.setBody = function (content) {\r\n // Clear the body\r\n while (this._elBody.firstChild) {\r\n this._elBody.removeChild(this._elBody.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elBody.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elBody.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the close button visibility\r\n Modal.setCloseButtonVisibility = function (showFl) { this._modal.setCloseButtonVisibility(showFl); };\r\n // Sets the close event\r\n Modal.setCloseEvent = function (event) {\r\n var _this = this;\r\n // Set the event in its own thread\r\n setTimeout(function () { _this._onCloseEvent = event; }, 10);\r\n };\r\n // Sets the flag to hide the empty footer\r\n Modal.setHideEmptyFooter = function (value) { this._hideEmptyFooter = value; };\r\n // Sets the flag to hide the empty header\r\n Modal.setHideEmptyHeader = function (value) { this._hideEmptyHeader = value; };\r\n // Sets the focus option\r\n Modal.setFocus = function (value) { this._modal.setFocus(value); };\r\n // Sets the footer\r\n Modal.setFooter = function (content) {\r\n // Clear the body\r\n while (this._elFooter.firstChild) {\r\n this._elFooter.removeChild(this._elFooter.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elFooter.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elFooter.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the header\r\n Modal.setHeader = function (content) {\r\n // Clear the body\r\n while (this._elHeader.firstChild) {\r\n this._elHeader.removeChild(this._elHeader.firstChild);\r\n }\r\n // See if content exists\r\n if (content) {\r\n // See if this is text\r\n if (typeof (content) == \"string\") {\r\n // Set the html\r\n this._elHeader.innerHTML = content;\r\n }\r\n else {\r\n // Append the element\r\n this._elHeader.appendChild(content);\r\n }\r\n }\r\n };\r\n // Sets the center option\r\n Modal.setIsCentered = function (value) { this._modal.setIsCentered(value); };\r\n // Sets the keyboard option\r\n Modal.setKeyboard = function (value) { this._modal.setKeyboard(value); };\r\n // Sets the scrollable option\r\n Modal.setScrollable = function (value) { this._modal.setScrollable(value); };\r\n // Sets the modal type\r\n Modal.setType = function (type) { this._modal.setType(type); };\r\n // Shows the modal\r\n Modal.show = function () {\r\n // See if we are hiding the header\r\n if (this.HideEmptyHeader && this.HeaderElement.innerText.trim().length == 0) {\r\n // Hide the header\r\n this.HeaderElement.classList.add(\"d-none\");\r\n }\r\n // See if we are hiding the footer\r\n if (this.HideEmptyFooter && this.FooterElement.innerText.trim().length == 0) {\r\n // Hide the footer\r\n this.FooterElement.classList.add(\"d-none\");\r\n }\r\n // Show the modal\r\n this._modal.show();\r\n };\r\n Modal._modal = null;\r\n Modal._onCloseEvent = null;\r\n // Modal Body\r\n Modal._elBody = null;\r\n // Modal Footer\r\n Modal._elFooter = null;\r\n // Modal Header\r\n Modal._elHeader = null;\r\n // Hides the footer if it's empty\r\n Modal._hideEmptyFooter = true;\r\n // Hides the header if it's empty\r\n Modal._hideEmptyHeader = false;\r\n return Modal;\r\n}());\r\nexports.Modal = Modal;\r\n// Create an instance of the modal\r\nnew Modal();\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/modal.js?");
152
152
 
153
153
  /***/ }),
154
154