dattatable 2.9.56 → 2.9.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/build/dashboard/accordion.d.ts +1 -0
  2. package/build/dashboard/accordion.js +2 -0
  3. package/build/dashboard/index.d.ts +2 -0
  4. package/build/dashboard/tiles.d.ts +1 -0
  5. package/build/dashboard/tiles.js +13 -12
  6. package/dist/dattatable.js +2 -2
  7. package/dist/dattatable.min.js +1 -1
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/Accordion.html +2 -2
  10. package/docs/classes/AuditLog.html +2 -2
  11. package/docs/classes/CanvasForm.html +2 -2
  12. package/docs/classes/Comments.html +2 -2
  13. package/docs/classes/Dashboard.html +4 -4
  14. package/docs/classes/DataTable.html +3 -3
  15. package/docs/classes/Documents.html +6 -6
  16. package/docs/classes/FilterSlideout.html +2 -2
  17. package/docs/classes/Footer.html +2 -2
  18. package/docs/classes/Header.html +2 -2
  19. package/docs/classes/InstallationRequired.html +2 -2
  20. package/docs/classes/ItemForm.html +4 -4
  21. package/docs/classes/List.html +4 -4
  22. package/docs/classes/ListSecurity.html +2 -2
  23. package/docs/classes/LoadingDialog.html +2 -2
  24. package/docs/classes/Modal.html +2 -2
  25. package/docs/classes/Navigation.html +3 -3
  26. package/docs/classes/Tiles.html +2 -2
  27. package/docs/classes/Timeout.html +2 -2
  28. package/docs/enums/ActionButtonTypes.html +2 -2
  29. package/docs/functions/formatBytes.html +1 -1
  30. package/docs/functions/formatDateValue.html +1 -1
  31. package/docs/functions/formatTimeValue.html +1 -1
  32. package/docs/functions/getContextInfo.html +1 -1
  33. package/docs/functions/getFileExt.html +1 -1
  34. package/docs/functions/waitForTheme.html +1 -1
  35. package/docs/interfaces/IAccordion.html +2 -2
  36. package/docs/interfaces/IAccordionProps.html +3 -2
  37. package/docs/interfaces/IAuditLogItem.html +2 -2
  38. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  39. package/docs/interfaces/IAuditLogProps.html +2 -2
  40. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  41. package/docs/interfaces/ICommentsItem.html +2 -2
  42. package/docs/interfaces/IDashboardProps.html +2 -2
  43. package/docs/interfaces/IDataTable.html +2 -2
  44. package/docs/interfaces/IDataTableProps.html +2 -2
  45. package/docs/interfaces/IDocumentsProps.html +2 -2
  46. package/docs/interfaces/IFilterItem.html +2 -2
  47. package/docs/interfaces/IFilterProps.html +2 -2
  48. package/docs/interfaces/IFooterProps.html +2 -2
  49. package/docs/interfaces/IHeaderProps.html +2 -2
  50. package/docs/interfaces/IInstallProps.html +2 -2
  51. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  52. package/docs/interfaces/IItemFormEditProps.html +2 -2
  53. package/docs/interfaces/IItemFormTab.html +2 -2
  54. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  55. package/docs/interfaces/IItemFormViewProps.html +2 -2
  56. package/docs/interfaces/IListProps.html +2 -2
  57. package/docs/interfaces/IListSecurity.html +2 -2
  58. package/docs/interfaces/IListSecurityItem.html +2 -2
  59. package/docs/interfaces/IShowDialogProps.html +2 -2
  60. package/docs/interfaces/ITiles.html +2 -2
  61. package/docs/interfaces/ITilesProps.html +3 -2
  62. package/docs/variables/DattaTable.html +1 -1
  63. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  64. package/package.json +1 -1
@@ -9,6 +9,7 @@ export interface IAccordionProps {
9
9
  items: any[];
10
10
  onItemClick?: (el?: HTMLElement, item?: any) => void;
11
11
  onItemRender?: (el?: HTMLElement, item?: any) => void;
12
+ onPaginationRender?: (el?: HTMLElement) => void;
12
13
  paginationLimit?: number;
13
14
  titleField?: string;
14
15
  }
@@ -205,6 +205,8 @@ var Accordion = /** @class */ (function () {
205
205
  elItems[lastIdx < elItems.length ? lastIdx : elItems.length - 1].classList.add("last-item");
206
206
  }
207
207
  });
208
+ // Call the event
209
+ this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;
208
210
  };
209
211
  // Searches the accordion
210
212
  Accordion.prototype.search = function (value) {
@@ -16,6 +16,7 @@ export interface IDashboardProps {
16
16
  items: any[];
17
17
  onItemClick?: (el?: HTMLElement, item?: any) => void;
18
18
  onItemRender?: (el?: HTMLElement, item?: any) => void;
19
+ onPaginationRender?: (el?: HTMLElement) => void;
19
20
  paginationLimit?: number;
20
21
  titleField?: string;
21
22
  };
@@ -78,6 +79,7 @@ export interface IDashboardProps {
78
79
  items: any[];
79
80
  onBodyRender?: (el?: HTMLElement, item?: any) => void;
80
81
  onCardRender?: (el?: HTMLElement, item?: any) => void;
82
+ onPaginationRender?: (el?: HTMLElement) => void;
81
83
  onSubTitleRender?: (el?: HTMLElement, item?: any) => void;
82
84
  onTitleRender?: (el?: HTMLElement, item?: any) => void;
83
85
  paginationLimit?: number;
@@ -10,6 +10,7 @@ export interface ITilesProps {
10
10
  items: any[];
11
11
  onBodyRender?: (el?: HTMLElement, item?: any) => void;
12
12
  onCardRender?: (el?: HTMLElement, item?: any) => void;
13
+ onPaginationRender?: (el?: HTMLElement) => void;
13
14
  onSubTitleRender?: (el?: HTMLElement, item?: any) => void;
14
15
  onTitleRender?: (el?: HTMLElement, item?: any) => void;
15
16
  paginationLimit?: number;
@@ -21,12 +21,11 @@ var Tiles = /** @class */ (function () {
21
21
  Tiles.prototype.filter = function (value) {
22
22
  var className = value ? value.toLowerCase().replace(/ /g, "-") : null;
23
23
  this._activeFilterClass = className;
24
- // Parse all tile items
25
- var items = this._props.el.querySelectorAll(".card");
26
- for (var i = 0; i < items.length; i++) {
27
- var elItem = items[i];
28
- // Hide the item
29
- elItem.classList.add("d-none");
24
+ // Parse all tile
25
+ var tiles = this._props.el.querySelectorAll(".card");
26
+ for (var i = 0; i < tiles.length; i++) {
27
+ // Hide the tile
28
+ tiles[i].parentElement.classList.add("d-none");
30
29
  }
31
30
  // Update the tiles
32
31
  this.updateTiles();
@@ -74,7 +73,7 @@ var Tiles = /** @class */ (function () {
74
73
  _this._props.onTitleRender ? _this._props.onTitleRender(el.querySelector(".card-title"), item) : null;
75
74
  _this._props.onSubTitleRender ? _this._props.onSubTitleRender(el.querySelector(".card-subtitle"), item) : null;
76
75
  _this._props.onBodyRender ? _this._props.onBodyRender(el.querySelector(".card-text"), item) : null;
77
- _this._props.onCardRender ? _this._props.onCardRender(el.querySelector(".card-body"), item) : null;
76
+ _this._props.onCardRender ? _this._props.onCardRender(el, item) : null;
78
77
  }
79
78
  }]
80
79
  });
@@ -113,7 +112,7 @@ var Tiles = /** @class */ (function () {
113
112
  // See if the item doesn't contains the search value
114
113
  if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {
115
114
  // Hide the item
116
- elItem.classList.add("d-none");
115
+ elItem.parentElement.classList.add("d-none");
117
116
  // Exclude the item from the array
118
117
  elItems.splice(i, 1);
119
118
  }
@@ -125,7 +124,7 @@ var Tiles = /** @class */ (function () {
125
124
  // Ensure the item exists
126
125
  if (elItem) {
127
126
  // Show the item
128
- elItem.classList.remove("d-none");
127
+ elItem.parentElement.classList.remove("d-none");
129
128
  }
130
129
  else {
131
130
  // Break from the loop
@@ -136,7 +135,7 @@ var Tiles = /** @class */ (function () {
136
135
  for (var i = paginationLimit; i < elItems.length; i++) {
137
136
  var elItem = elItems[i];
138
137
  // Hide the item
139
- elItem.classList.add("d-none");
138
+ elItem.parentElement.classList.add("d-none");
140
139
  }
141
140
  // Render the pagination
142
141
  this._pagination = gd_sprest_bs_1.Components.Pagination({
@@ -148,17 +147,19 @@ var Tiles = /** @class */ (function () {
148
147
  for (var i = 0; i < elItems.length; i++) {
149
148
  var elItem = elItems[i];
150
149
  // Hide the item
151
- elItem.classList.add("d-none");
150
+ elItem.parentElement.classList.add("d-none");
152
151
  }
153
152
  // Parse the items to show
154
153
  var startIdx = (pageNumber - 1) * paginationLimit;
155
154
  for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {
156
155
  var elItem = elItems[i];
157
156
  // Show the item
158
- elItem.classList.remove("d-none");
157
+ elItem.parentElement.classList.remove("d-none");
159
158
  }
160
159
  }
161
160
  });
161
+ // Call the event
162
+ this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;
162
163
  };
163
164
  // Searches the tile
164
165
  Tiles.prototype.search = function (value) {
@@ -170,7 +170,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
170
170
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
171
171
 
172
172
  "use strict";
173
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Accordion = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.0/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Accordion\r\n */\r\nvar Accordion = /** @class */ (function () {\r\n // Constructor\r\n function Accordion(props) {\r\n this._accordion = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the accordion\r\n this.render();\r\n }\r\n // Clears an item\r\n Accordion.prototype.clearItem = function (elItem) {\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n // Remove the first/last item classes\r\n elItem.classList.remove(\"first-item\");\r\n elItem.classList.remove(\"last-item\");\r\n };\r\n // Filters the accordion\r\n Accordion.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all accordion items\r\n var items = this._props.el.querySelectorAll(\".accordion-item\");\r\n for (var i = 0; i < items.length; i++) {\r\n var elItem = items[i];\r\n // Clear the item\r\n this.clearItem(elItem);\r\n }\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the dashboard\r\n Accordion.prototype.render = function () {\r\n // Render the accordion\r\n this.renderAccordion();\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the accordion\r\n Accordion.prototype.renderAccordion = function () {\r\n // Parse the items\r\n var accordionItems = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an accordion item\r\n accordionItems.push({\r\n className: itemClassNames.join(\" \"),\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n header: item[this._props.titleField || \"Title\"] || \"\",\r\n onClick: this._props.onItemClick,\r\n onRender: this._props.onItemRender,\r\n showFl: i == 0,\r\n });\r\n }\r\n // Render the accordion\r\n this._accordion = gd_sprest_bs_1.Components.Accordion({\r\n el: this._props.el,\r\n id: \"accordion-list\",\r\n items: accordionItems\r\n });\r\n };\r\n // Renders the items\r\n Accordion.prototype.renderItems = function () {\r\n var _this = this;\r\n var paginationLimit = this._props.paginationLimit || 10;\r\n // Get the pagination element\r\n var elPagination = this._props.el.querySelector(\".accordion-pagination\");\r\n if (elPagination) {\r\n // Clear the element\r\n while (elPagination.firstChild) {\r\n elPagination.removeChild(elPagination.firstChild);\r\n }\r\n }\r\n else {\r\n // Create the element\r\n elPagination = document.createElement(\"div\");\r\n elPagination.classList.add(\"accordion-pagination\");\r\n this._props.el.appendChild(elPagination);\r\n }\r\n // Get the elements as an array\r\n var elItems = Array.from(this._accordion.el.querySelectorAll(this._activeFilterClass ? \".\" + this._activeFilterClass : \".accordion-item\"));\r\n // See if a search value exists\r\n if (this._activeSearchFilter) {\r\n // Parse the items\r\n for (var i = elItems.length - 1; i >= 0; i--) {\r\n var elItem = elItems[i];\r\n var elContent = elItem.querySelector(\".accordion-body\");\r\n // See if this item is expanded\r\n if (elItem.querySelector(\".accordion-collapse.show\")) {\r\n // Collapse the item\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0 &&\r\n elContent.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {\r\n // Clear the item\r\n this.clearItem(elItem);\r\n // Exclude the item from the array\r\n elItems.splice(i, 1);\r\n }\r\n }\r\n }\r\n // Parse the active items to show\r\n for (var i = 0; i < paginationLimit; i++) {\r\n var elItem = elItems[i];\r\n // Ensure the item exists\r\n if (elItem) {\r\n // Clear the item\r\n this.clearItem(elItem);\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n // See if this is the first item\r\n if (i == 0) {\r\n elItem.classList.add(\"first-item\");\r\n }\r\n }\r\n else {\r\n // Set the class for the last item\r\n if (elItems[i - 1]) {\r\n elItems[i - 1].classList.add(\"last-item\");\r\n }\r\n // Break from the loop\r\n break;\r\n }\r\n }\r\n // Parse the active items to hide\r\n for (var i = paginationLimit; i < elItems.length; i++) {\r\n // Clear the item\r\n this.clearItem(elItems[i]);\r\n }\r\n // Ensure items exist\r\n if (elItems.length > 0) {\r\n // Ensure the first item is expanded\r\n if (elItems[0].querySelector(\".accordion-collapse.show\") == null) {\r\n // Hide the button\r\n var btn = elItems[0].querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // Set the first item class\r\n elItems[0].classList.add(\"first-item\");\r\n // Set the last item class\r\n var lastIdx = paginationLimit - 1;\r\n elItems[lastIdx < elItems.length ? lastIdx : elItems.length - 1].classList.add(\"last-item\");\r\n }\r\n // Render the pagination\r\n this._pagination = gd_sprest_bs_1.Components.Pagination({\r\n el: elPagination,\r\n className: \"d-flex justify-content-end pt-2\",\r\n numberOfPages: Math.ceil(elItems.length / paginationLimit),\r\n onClick: function (pageNumber) {\r\n // Parse the items\r\n for (var i = 0; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // See if this item is expanded\r\n if (elItem.querySelector(\".accordion-collapse.show\")) {\r\n // Hide the button\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // Clear the item\r\n _this.clearItem(elItem);\r\n }\r\n // Parse the items to show\r\n var startIdx = (pageNumber - 1) * paginationLimit;\r\n for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n // See if this is the first item\r\n if (i == startIdx) {\r\n // Set the first item class\r\n elItem.classList.add(\"first-item\");\r\n // Expand the item\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n }\r\n // Set the last item class\r\n var lastIdx = startIdx + paginationLimit - 1;\r\n elItems[lastIdx < elItems.length ? lastIdx : elItems.length - 1].classList.add(\"last-item\");\r\n }\r\n });\r\n };\r\n // Searches the accordion\r\n Accordion.prototype.search = function (value) {\r\n // Set the search value\r\n this._activeSearchFilter = (value || \"\").toLowerCase();\r\n // Render the items\r\n this.renderItems();\r\n };\r\n return Accordion;\r\n}());\r\nexports.Accordion = Accordion;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/accordion.js?");
173
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Accordion = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.0/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Accordion\r\n */\r\nvar Accordion = /** @class */ (function () {\r\n // Constructor\r\n function Accordion(props) {\r\n this._accordion = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the accordion\r\n this.render();\r\n }\r\n // Clears an item\r\n Accordion.prototype.clearItem = function (elItem) {\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n // Remove the first/last item classes\r\n elItem.classList.remove(\"first-item\");\r\n elItem.classList.remove(\"last-item\");\r\n };\r\n // Filters the accordion\r\n Accordion.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all accordion items\r\n var items = this._props.el.querySelectorAll(\".accordion-item\");\r\n for (var i = 0; i < items.length; i++) {\r\n var elItem = items[i];\r\n // Clear the item\r\n this.clearItem(elItem);\r\n }\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the dashboard\r\n Accordion.prototype.render = function () {\r\n // Render the accordion\r\n this.renderAccordion();\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the accordion\r\n Accordion.prototype.renderAccordion = function () {\r\n // Parse the items\r\n var accordionItems = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an accordion item\r\n accordionItems.push({\r\n className: itemClassNames.join(\" \"),\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n header: item[this._props.titleField || \"Title\"] || \"\",\r\n onClick: this._props.onItemClick,\r\n onRender: this._props.onItemRender,\r\n showFl: i == 0,\r\n });\r\n }\r\n // Render the accordion\r\n this._accordion = gd_sprest_bs_1.Components.Accordion({\r\n el: this._props.el,\r\n id: \"accordion-list\",\r\n items: accordionItems\r\n });\r\n };\r\n // Renders the items\r\n Accordion.prototype.renderItems = function () {\r\n var _this = this;\r\n var paginationLimit = this._props.paginationLimit || 10;\r\n // Get the pagination element\r\n var elPagination = this._props.el.querySelector(\".accordion-pagination\");\r\n if (elPagination) {\r\n // Clear the element\r\n while (elPagination.firstChild) {\r\n elPagination.removeChild(elPagination.firstChild);\r\n }\r\n }\r\n else {\r\n // Create the element\r\n elPagination = document.createElement(\"div\");\r\n elPagination.classList.add(\"accordion-pagination\");\r\n this._props.el.appendChild(elPagination);\r\n }\r\n // Get the elements as an array\r\n var elItems = Array.from(this._accordion.el.querySelectorAll(this._activeFilterClass ? \".\" + this._activeFilterClass : \".accordion-item\"));\r\n // See if a search value exists\r\n if (this._activeSearchFilter) {\r\n // Parse the items\r\n for (var i = elItems.length - 1; i >= 0; i--) {\r\n var elItem = elItems[i];\r\n var elContent = elItem.querySelector(\".accordion-body\");\r\n // See if this item is expanded\r\n if (elItem.querySelector(\".accordion-collapse.show\")) {\r\n // Collapse the item\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0 &&\r\n elContent.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {\r\n // Clear the item\r\n this.clearItem(elItem);\r\n // Exclude the item from the array\r\n elItems.splice(i, 1);\r\n }\r\n }\r\n }\r\n // Parse the active items to show\r\n for (var i = 0; i < paginationLimit; i++) {\r\n var elItem = elItems[i];\r\n // Ensure the item exists\r\n if (elItem) {\r\n // Clear the item\r\n this.clearItem(elItem);\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n // See if this is the first item\r\n if (i == 0) {\r\n elItem.classList.add(\"first-item\");\r\n }\r\n }\r\n else {\r\n // Set the class for the last item\r\n if (elItems[i - 1]) {\r\n elItems[i - 1].classList.add(\"last-item\");\r\n }\r\n // Break from the loop\r\n break;\r\n }\r\n }\r\n // Parse the active items to hide\r\n for (var i = paginationLimit; i < elItems.length; i++) {\r\n // Clear the item\r\n this.clearItem(elItems[i]);\r\n }\r\n // Ensure items exist\r\n if (elItems.length > 0) {\r\n // Ensure the first item is expanded\r\n if (elItems[0].querySelector(\".accordion-collapse.show\") == null) {\r\n // Hide the button\r\n var btn = elItems[0].querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // Set the first item class\r\n elItems[0].classList.add(\"first-item\");\r\n // Set the last item class\r\n var lastIdx = paginationLimit - 1;\r\n elItems[lastIdx < elItems.length ? lastIdx : elItems.length - 1].classList.add(\"last-item\");\r\n }\r\n // Render the pagination\r\n this._pagination = gd_sprest_bs_1.Components.Pagination({\r\n el: elPagination,\r\n className: \"d-flex justify-content-end pt-2\",\r\n numberOfPages: Math.ceil(elItems.length / paginationLimit),\r\n onClick: function (pageNumber) {\r\n // Parse the items\r\n for (var i = 0; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // See if this item is expanded\r\n if (elItem.querySelector(\".accordion-collapse.show\")) {\r\n // Hide the button\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n // Clear the item\r\n _this.clearItem(elItem);\r\n }\r\n // Parse the items to show\r\n var startIdx = (pageNumber - 1) * paginationLimit;\r\n for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n // See if this is the first item\r\n if (i == startIdx) {\r\n // Set the first item class\r\n elItem.classList.add(\"first-item\");\r\n // Expand the item\r\n var btn = elItem.querySelector(\".accordion-button\");\r\n btn === null || btn === void 0 ? void 0 : btn.click();\r\n }\r\n }\r\n // Set the last item class\r\n var lastIdx = startIdx + paginationLimit - 1;\r\n elItems[lastIdx < elItems.length ? lastIdx : elItems.length - 1].classList.add(\"last-item\");\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;\r\n };\r\n // Searches the accordion\r\n Accordion.prototype.search = function (value) {\r\n // Set the search value\r\n this._activeSearchFilter = (value || \"\").toLowerCase();\r\n // Render the items\r\n this.renderItems();\r\n };\r\n return Accordion;\r\n}());\r\nexports.Accordion = Accordion;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/accordion.js?");
174
174
 
175
175
  /***/ }),
176
176
 
@@ -247,7 +247,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
247
247
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
248
248
 
249
249
  "use strict";
250
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tiles = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.0/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Tiles\r\n */\r\nvar Tiles = /** @class */ (function () {\r\n // Constructor\r\n function Tiles(props) {\r\n this._tiles = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the tile\r\n this.render();\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all tile items\r\n var items = this._props.el.querySelectorAll(\".card\");\r\n for (var i = 0; i < items.length; i++) {\r\n var elItem = items[i];\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n }\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function () {\r\n // Render the tile\r\n this.renderTiles();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function () {\r\n var _this = this;\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // Get the filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an tile\r\n cards.push({\r\n className: itemClassNames.join(\" \"),\r\n body: [{\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n data: item,\r\n subTitle: item[this._props.subTitleField] || \"\",\r\n title: item[this._props.titleField || \"Title\"] || \"\",\r\n onRender: function (el, card) {\r\n var item = card.data;\r\n // Call the events\r\n _this._props.onTitleRender ? _this._props.onTitleRender(el.querySelector(\".card-title\"), item) : null;\r\n _this._props.onSubTitleRender ? _this._props.onSubTitleRender(el.querySelector(\".card-subtitle\"), item) : null;\r\n _this._props.onBodyRender ? _this._props.onBodyRender(el.querySelector(\".card-text\"), item) : null;\r\n _this._props.onCardRender ? _this._props.onCardRender(el.querySelector(\".card-body\"), item) : null;\r\n }\r\n }]\r\n });\r\n }\r\n // Render the tiles\r\n this._tiles = gd_sprest_bs_1.Components.CardGroup({\r\n el: this._props.el,\r\n cards: cards,\r\n colSize: this._props.colSize\r\n });\r\n };\r\n // Updates the visibility of the tiles\r\n Tiles.prototype.updateTiles = function () {\r\n var paginationLimit = this._props.paginationLimit || 10;\r\n // Get the pagination element\r\n var elPagination = this._props.el.querySelector(\".tiles-pagination\");\r\n if (elPagination) {\r\n // Clear the element\r\n while (elPagination.firstChild) {\r\n elPagination.removeChild(elPagination.firstChild);\r\n }\r\n }\r\n else {\r\n // Create the element\r\n elPagination = document.createElement(\"div\");\r\n elPagination.classList.add(\"tiles-pagination\");\r\n this._props.el.appendChild(elPagination);\r\n }\r\n // Get the elements as an array\r\n var elItems = Array.from(this._tiles.el.querySelectorAll(this._activeFilterClass ? \".\" + this._activeFilterClass : \".card\"));\r\n // See if a search value exists\r\n if (this._activeSearchFilter) {\r\n // Parse the items\r\n for (var i = elItems.length - 1; i >= 0; i--) {\r\n var elItem = elItems[i];\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n // Exclude the item from the array\r\n elItems.splice(i, 1);\r\n }\r\n }\r\n }\r\n // Parse the active items to show\r\n for (var i = 0; i < paginationLimit; i++) {\r\n var elItem = elItems[i];\r\n // Ensure the item exists\r\n if (elItem) {\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n else {\r\n // Break from the loop\r\n break;\r\n }\r\n }\r\n // Parse the active items to hide\r\n for (var i = paginationLimit; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n }\r\n // Render the pagination\r\n this._pagination = gd_sprest_bs_1.Components.Pagination({\r\n el: elPagination,\r\n className: \"d-flex justify-content-end pt-2\",\r\n numberOfPages: Math.ceil(elItems.length / paginationLimit),\r\n onClick: function (pageNumber) {\r\n // Parse the items\r\n for (var i = 0; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n }\r\n // Parse the items to show\r\n var startIdx = (pageNumber - 1) * paginationLimit;\r\n for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n }\r\n });\r\n };\r\n // Searches the tile\r\n Tiles.prototype.search = function (value) {\r\n // Set the search value\r\n this._activeSearchFilter = (value || \"\").toLowerCase();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n return Tiles;\r\n}());\r\nexports.Tiles = Tiles;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/tiles.js?");
250
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tiles = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.0/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Tiles\r\n */\r\nvar Tiles = /** @class */ (function () {\r\n // Constructor\r\n function Tiles(props) {\r\n this._tiles = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the tile\r\n this.render();\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all tile\r\n var tiles = this._props.el.querySelectorAll(\".card\");\r\n for (var i = 0; i < tiles.length; i++) {\r\n // Hide the tile\r\n tiles[i].parentElement.classList.add(\"d-none\");\r\n }\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function () {\r\n // Render the tile\r\n this.renderTiles();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function () {\r\n var _this = this;\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // Get the filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an tile\r\n cards.push({\r\n className: itemClassNames.join(\" \"),\r\n body: [{\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n data: item,\r\n subTitle: item[this._props.subTitleField] || \"\",\r\n title: item[this._props.titleField || \"Title\"] || \"\",\r\n onRender: function (el, card) {\r\n var item = card.data;\r\n // Call the events\r\n _this._props.onTitleRender ? _this._props.onTitleRender(el.querySelector(\".card-title\"), item) : null;\r\n _this._props.onSubTitleRender ? _this._props.onSubTitleRender(el.querySelector(\".card-subtitle\"), item) : null;\r\n _this._props.onBodyRender ? _this._props.onBodyRender(el.querySelector(\".card-text\"), item) : null;\r\n _this._props.onCardRender ? _this._props.onCardRender(el, item) : null;\r\n }\r\n }]\r\n });\r\n }\r\n // Render the tiles\r\n this._tiles = gd_sprest_bs_1.Components.CardGroup({\r\n el: this._props.el,\r\n cards: cards,\r\n colSize: this._props.colSize\r\n });\r\n };\r\n // Updates the visibility of the tiles\r\n Tiles.prototype.updateTiles = function () {\r\n var paginationLimit = this._props.paginationLimit || 10;\r\n // Get the pagination element\r\n var elPagination = this._props.el.querySelector(\".tiles-pagination\");\r\n if (elPagination) {\r\n // Clear the element\r\n while (elPagination.firstChild) {\r\n elPagination.removeChild(elPagination.firstChild);\r\n }\r\n }\r\n else {\r\n // Create the element\r\n elPagination = document.createElement(\"div\");\r\n elPagination.classList.add(\"tiles-pagination\");\r\n this._props.el.appendChild(elPagination);\r\n }\r\n // Get the elements as an array\r\n var elItems = Array.from(this._tiles.el.querySelectorAll(this._activeFilterClass ? \".\" + this._activeFilterClass : \".card\"));\r\n // See if a search value exists\r\n if (this._activeSearchFilter) {\r\n // Parse the items\r\n for (var i = elItems.length - 1; i >= 0; i--) {\r\n var elItem = elItems[i];\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {\r\n // Hide the item\r\n elItem.parentElement.classList.add(\"d-none\");\r\n // Exclude the item from the array\r\n elItems.splice(i, 1);\r\n }\r\n }\r\n }\r\n // Parse the active items to show\r\n for (var i = 0; i < paginationLimit; i++) {\r\n var elItem = elItems[i];\r\n // Ensure the item exists\r\n if (elItem) {\r\n // Show the item\r\n elItem.parentElement.classList.remove(\"d-none\");\r\n }\r\n else {\r\n // Break from the loop\r\n break;\r\n }\r\n }\r\n // Parse the active items to hide\r\n for (var i = paginationLimit; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Hide the item\r\n elItem.parentElement.classList.add(\"d-none\");\r\n }\r\n // Render the pagination\r\n this._pagination = gd_sprest_bs_1.Components.Pagination({\r\n el: elPagination,\r\n className: \"d-flex justify-content-end pt-2\",\r\n numberOfPages: Math.ceil(elItems.length / paginationLimit),\r\n onClick: function (pageNumber) {\r\n // Parse the items\r\n for (var i = 0; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Hide the item\r\n elItem.parentElement.classList.add(\"d-none\");\r\n }\r\n // Parse the items to show\r\n var startIdx = (pageNumber - 1) * paginationLimit;\r\n for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Show the item\r\n elItem.parentElement.classList.remove(\"d-none\");\r\n }\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;\r\n };\r\n // Searches the tile\r\n Tiles.prototype.search = function (value) {\r\n // Set the search value\r\n this._activeSearchFilter = (value || \"\").toLowerCase();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n return Tiles;\r\n}());\r\nexports.Tiles = Tiles;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/tiles.js?");
251
251
 
252
252
  /***/ }),
253
253