dattatable 2.10.90 → 2.10.91

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 (78) hide show
  1. package/build/dashboard/accordion.d.ts +1 -0
  2. package/build/dashboard/accordion.js +1 -0
  3. package/build/dashboard/filter.d.ts +2 -0
  4. package/build/dashboard/filter.js +3 -0
  5. package/build/dashboard/header.d.ts +1 -0
  6. package/build/dashboard/header.js +1 -1
  7. package/build/dashboard/index.d.ts +7 -0
  8. package/build/dashboard/index.js +7 -2
  9. package/build/dashboard/table.d.ts +1 -0
  10. package/build/dashboard/table.js +1 -0
  11. package/build/dashboard/tiles.d.ts +1 -0
  12. package/build/dashboard/tiles.js +1 -0
  13. package/dist/dattatable.js +6 -6
  14. package/dist/dattatable.min.js +1 -1
  15. package/docs/assets/search.js +1 -1
  16. package/docs/classes/Accordion.html +2 -2
  17. package/docs/classes/AuditLog.html +2 -2
  18. package/docs/classes/CanvasForm.html +2 -2
  19. package/docs/classes/Comments.html +2 -2
  20. package/docs/classes/Dashboard.html +4 -4
  21. package/docs/classes/DataTable.html +3 -3
  22. package/docs/classes/Documents.html +6 -6
  23. package/docs/classes/FilterSlideout.html +3 -2
  24. package/docs/classes/Footer.html +2 -2
  25. package/docs/classes/Header.html +2 -2
  26. package/docs/classes/InstallationRequired.html +2 -2
  27. package/docs/classes/ItemForm.html +4 -4
  28. package/docs/classes/List.html +4 -4
  29. package/docs/classes/ListConfig.html +2 -2
  30. package/docs/classes/ListSecurity.html +2 -2
  31. package/docs/classes/LoadingDialog.html +2 -2
  32. package/docs/classes/Modal.html +2 -2
  33. package/docs/classes/Navigation.html +3 -3
  34. package/docs/classes/Tiles.html +2 -2
  35. package/docs/classes/Timeout.html +2 -2
  36. package/docs/enums/ActionButtonTypes.html +2 -2
  37. package/docs/functions/formatBytes.html +1 -1
  38. package/docs/functions/formatDateValue.html +1 -1
  39. package/docs/functions/formatTimeValue.html +1 -1
  40. package/docs/functions/getContextInfo.html +1 -1
  41. package/docs/functions/getFileExt.html +1 -1
  42. package/docs/functions/waitForTheme.html +1 -1
  43. package/docs/interfaces/IAccordion.html +2 -2
  44. package/docs/interfaces/IAccordionProps.html +3 -2
  45. package/docs/interfaces/IAuditLogItem.html +2 -2
  46. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  47. package/docs/interfaces/IAuditLogProps.html +2 -2
  48. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  49. package/docs/interfaces/ICommentsItem.html +2 -2
  50. package/docs/interfaces/ICreateLookupData.html +2 -2
  51. package/docs/interfaces/IDashboardProps.html +2 -2
  52. package/docs/interfaces/IDataTable.html +2 -2
  53. package/docs/interfaces/IDataTableProps.html +3 -2
  54. package/docs/interfaces/IDocumentsProps.html +2 -2
  55. package/docs/interfaces/IFilterItem.html +2 -2
  56. package/docs/interfaces/IFilterProps.html +3 -2
  57. package/docs/interfaces/IFooterProps.html +2 -2
  58. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  59. package/docs/interfaces/IHeaderProps.html +3 -2
  60. package/docs/interfaces/IInstallProps.html +2 -2
  61. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  62. package/docs/interfaces/IItemFormEditProps.html +2 -2
  63. package/docs/interfaces/IItemFormTab.html +2 -2
  64. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  65. package/docs/interfaces/IItemFormViewProps.html +2 -2
  66. package/docs/interfaces/IListConfig.html +2 -2
  67. package/docs/interfaces/IListConfigProps.html +2 -2
  68. package/docs/interfaces/IListProps.html +2 -2
  69. package/docs/interfaces/IListSecurity.html +2 -2
  70. package/docs/interfaces/IListSecurityItem.html +2 -2
  71. package/docs/interfaces/ILookupData.html +2 -2
  72. package/docs/interfaces/IShowDialogProps.html +2 -2
  73. package/docs/interfaces/ITiles.html +2 -2
  74. package/docs/interfaces/ITilesProps.html +3 -2
  75. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  76. package/docs/variables/DattaTable.html +1 -1
  77. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  78. package/package.json +1 -1
@@ -7,6 +7,7 @@ export interface IAccordion {
7
7
  export interface IAccordionProps {
8
8
  bodyFields?: string[];
9
9
  bodyTemplate?: string;
10
+ className?: string;
10
11
  el: HTMLElement;
11
12
  filterFields?: string[];
12
13
  items: any[];
@@ -138,6 +138,7 @@ var Accordion = /** @class */ (function () {
138
138
  // Render the accordion
139
139
  this._accordion = gd_sprest_bs_1.Components.Accordion({
140
140
  el: this._props.el,
141
+ className: this._props.className,
141
142
  id: "accordion-list",
142
143
  items: accordionItems
143
144
  });
@@ -13,6 +13,7 @@ export interface IFilterItem {
13
13
  * Properties
14
14
  */
15
15
  export interface IFilterProps {
16
+ className?: string;
16
17
  filters: IFilterItem[];
17
18
  onClear?: () => void;
18
19
  onFilter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
@@ -24,6 +25,7 @@ export interface IFilterProps {
24
25
  */
25
26
  export declare class FilterSlideout {
26
27
  private _cbs;
28
+ private _className;
27
29
  private _el;
28
30
  private _filters;
29
31
  private _items;
@@ -10,10 +10,12 @@ var canvas_1 = require("../common/canvas");
10
10
  var FilterSlideout = /** @class */ (function () {
11
11
  function FilterSlideout(props) {
12
12
  this._cbs = null;
13
+ this._className = null;
13
14
  this._el = null;
14
15
  this._filters = null;
15
16
  this._items = null;
16
17
  // Save the properties
18
+ this._className = props.className;
17
19
  this._filters = props.filters || [];
18
20
  this._onClear = props.onClear;
19
21
  this._onFilter = props.onFilter;
@@ -47,6 +49,7 @@ var FilterSlideout = /** @class */ (function () {
47
49
  // Render a clear button
48
50
  gd_sprest_bs_1.Components.Tooltip({
49
51
  el: this._el,
52
+ className: this._className,
50
53
  content: "Reset Filters",
51
54
  placement: gd_sprest_bs_1.Components.TooltipPlacements.Left,
52
55
  btnProps: {
@@ -3,6 +3,7 @@ import { Components } from "gd-sprest-bs";
3
3
  * Header
4
4
  */
5
5
  export interface IHeaderProps {
6
+ className?: string;
6
7
  el: HTMLElement;
7
8
  onRendering?: (props: Components.IJumbotronProps) => void;
8
9
  onRendered?: (el: HTMLElement) => void;
@@ -21,7 +21,7 @@ var Header = /** @class */ (function () {
21
21
  // Define the default props
22
22
  var props = {
23
23
  el: this._props.el,
24
- className: "header",
24
+ className: "header" + (this._props.className ? " " : "") + this._props.className,
25
25
  lead: this._props.title
26
26
  };
27
27
  // Call the rendering event
@@ -28,18 +28,21 @@ export interface IDashboardProps {
28
28
  };
29
29
  el: HTMLElement;
30
30
  footer?: {
31
+ className?: string;
31
32
  items?: Components.INavbarItem[];
32
33
  itemsEnd?: Components.INavbarItem[];
33
34
  onRendering?: (props: Components.INavbarProps) => void;
34
35
  onRendered?: (el?: HTMLElement) => void;
35
36
  };
36
37
  filters?: {
38
+ className?: string;
37
39
  items: IFilterItem[];
38
40
  onClear?: () => void;
39
41
  onRendered?: (el?: HTMLElement) => void;
40
42
  onShowFilter?: () => void;
41
43
  };
42
44
  header?: {
45
+ className?: string;
43
46
  onRendering?: (props: Components.IJumbotronProps) => void;
44
47
  onRendered?: (el?: HTMLElement) => void;
45
48
  title?: string;
@@ -49,6 +52,7 @@ export interface IDashboardProps {
49
52
  hideNavigation?: boolean;
50
53
  hideSubNavigation?: boolean;
51
54
  navigation?: {
55
+ className?: string;
52
56
  searchPlaceholder?: string;
53
57
  showFilter?: boolean;
54
58
  showSearch?: boolean;
@@ -62,6 +66,7 @@ export interface IDashboardProps {
62
66
  onShowFilter?: () => void;
63
67
  };
64
68
  subNavigation?: {
69
+ className?: string;
65
70
  showFilter?: boolean;
66
71
  showSearch?: boolean;
67
72
  title?: string | HTMLElement;
@@ -74,6 +79,7 @@ export interface IDashboardProps {
74
79
  onShowFilter?: () => void;
75
80
  };
76
81
  table?: {
82
+ className?: string;
77
83
  columns: Components.ITableColumn[];
78
84
  dtProps?: any;
79
85
  onRendering?: (dtProps: any) => any;
@@ -83,6 +89,7 @@ export interface IDashboardProps {
83
89
  tiles?: {
84
90
  bodyFields?: string[];
85
91
  bodyTemplate?: string;
92
+ className?: string;
86
93
  colSize?: number;
87
94
  filterFields?: string[];
88
95
  items: any[];
@@ -116,6 +116,7 @@ var Dashboard = /** @class */ (function () {
116
116
  var _this = this;
117
117
  // Create the filters
118
118
  this._filters = new filter_1.FilterSlideout({
119
+ className: this._props.filters ? this._props.filters.className : null,
119
120
  filters: this._props.filters ? this._props.filters.items : [],
120
121
  onClear: this._props.filters ? this._props.filters.onClear : null,
121
122
  onRendered: this._props.filters ? this._props.filters.onRendered : null,
@@ -151,6 +152,7 @@ var Dashboard = /** @class */ (function () {
151
152
  // Render the navigation
152
153
  var navProps_1 = this._props.navigation || {};
153
154
  this._navigation = new navigation_1.Navigation({
155
+ className: navProps_1.className,
154
156
  el: this._props.el.querySelector("#navigation"),
155
157
  hideFilter: navProps_1.showFilter != null ? !navProps_1.showFilter : false,
156
158
  hideSearch: navProps_1.showSearch != null ? !navProps_1.showSearch : false,
@@ -203,6 +205,7 @@ var Dashboard = /** @class */ (function () {
203
205
  // Render the header
204
206
  var header = this._props.header || {};
205
207
  new header_1.Header({
208
+ className: header.className,
206
209
  el: elHeader,
207
210
  onRendering: this._props.header ? this._props.header.onRendering : null,
208
211
  onRendered: this._props.header ? this._props.header.onRendered : null,
@@ -230,9 +233,11 @@ var Dashboard = /** @class */ (function () {
230
233
  else {
231
234
  // Render the navigation
232
235
  var navProps_2 = this._props.subNavigation || {};
236
+ var className = (headerIsVisible || navIsVisible ? null : "sub-nav-border") +
237
+ (navProps_2.className ? " " : "") + navProps_2.className;
233
238
  new navigation_1.Navigation({
234
239
  el: this._props.el.querySelector("#sub-navigation"),
235
- className: headerIsVisible || navIsVisible ? null : "sub-nav-border",
240
+ className: className,
236
241
  hideFilter: navProps_2.showFilter != null ? !navProps_2.showFilter : true,
237
242
  hideSearch: navProps_2.showSearch != null ? !navProps_2.showSearch : true,
238
243
  items: navProps_2.items,
@@ -294,7 +299,7 @@ var Dashboard = /** @class */ (function () {
294
299
  // Render the footer
295
300
  var footer = this._props.footer || {};
296
301
  new footer_1.Footer({
297
- className: "bg-sharepoint rounded-bottom",
302
+ className: "bg-sharepoint rounded-bottom" + (footer.className ? " " : "") + footer.className,
298
303
  el: this._props.el.querySelector("#footer"),
299
304
  items: footer.items,
300
305
  itemsEnd: footer.itemsEnd,
@@ -18,6 +18,7 @@ export interface IDataTable {
18
18
  * Properties
19
19
  */
20
20
  export interface IDataTableProps {
21
+ className?: string;
21
22
  columns: Components.ITableColumn[];
22
23
  dtProps?: any;
23
24
  el: HTMLElement;
@@ -121,6 +121,7 @@ var DataTable = /** @class */ (function () {
121
121
  }
122
122
  // Render the data table
123
123
  var table = gd_sprest_bs_1.Components.Table({
124
+ className: this._props.className,
124
125
  el: this._props.el,
125
126
  rows: rows,
126
127
  columns: this._props.columns
@@ -7,6 +7,7 @@ export interface ITiles {
7
7
  export interface ITilesProps {
8
8
  bodyFields?: string[];
9
9
  bodyTemplate?: string;
10
+ className?: string;
10
11
  colSize?: number;
11
12
  el: HTMLElement;
12
13
  filterFields?: string[];
@@ -184,6 +184,7 @@ var Tiles = /** @class */ (function () {
184
184
  this._tiles = gd_sprest_bs_1.Components.CardGroup({
185
185
  el: this._props.el,
186
186
  cards: cards,
187
+ className: this._props.className,
187
188
  colSize: this._props.colSize || 4,
188
189
  onColRender: this._props.onColumnRendered
189
190
  });
@@ -181,7 +181,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
181
181
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
182
182
 
183
183
  "use strict";
184
- 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.96/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._activeFilterValue = null;\r\n this._activeSearchValue = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the accordion\r\n this.refresh(this._props.items);\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 (values) {\r\n this._activeFilterValue = values ? values.join('|') : \"\";\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 // Generates the accordion item\r\n Accordion.prototype.generateItem = function (item) {\r\n var _this = this;\r\n var filterValues = [];\r\n // See if the filter field is specified\r\n if (this._props.filterFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.filterFields.length; i++) {\r\n var filterField = this._props.filterFields[i];\r\n // Get the filter values\r\n var filters = item[filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // Append the values\r\n filterValues = filterValues.concat(filters);\r\n }\r\n }\r\n // See if the body fields exist\r\n var bodyContent = this._props.bodyTemplate || \"\";\r\n if (this._props.bodyFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.bodyFields.length; i++) {\r\n var field = this._props.bodyFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.bodyTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n bodyContent = bodyContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n bodyContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var titleContent = this._props.titleTemplate || \"\";\r\n if (this._props.titleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.titleFields.length; i++) {\r\n var field = this._props.titleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.titleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n titleContent = titleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n titleContent += value;\r\n }\r\n }\r\n }\r\n // Return the item\r\n return {\r\n content: bodyContent,\r\n header: titleContent,\r\n onClick: this._props.onItemClick,\r\n onRenderBody: this._props.onItemBodyRender,\r\n onRenderHeader: this._props.onItemHeaderRender,\r\n onRender: function (el, item) {\r\n // See if filters exist\r\n if (filterValues && filterValues.length > 0) {\r\n // Set the data filter value\r\n el.setAttribute(\"data-filter\", filterValues.join('|'));\r\n }\r\n // Call the event\r\n _this._props.onItemRender ? _this._props.onItemRender(el, item) : null;\r\n }\r\n };\r\n };\r\n // Method to reload the data\r\n Accordion.prototype.refresh = function (items) {\r\n if (items === void 0) { items = []; }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the accordion\r\n this.render(items);\r\n };\r\n // Renders the dashboard\r\n Accordion.prototype.render = function (items) {\r\n // Render the accordion\r\n this.renderAccordion(items);\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the accordion\r\n Accordion.prototype.renderAccordion = function (items) {\r\n // Parse the items\r\n var accordionItems = [];\r\n for (var i = 0; i < items.length; i++) {\r\n // Add an accordion item\r\n accordionItems.push(this.generateItem(items[i]));\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(\".accordion-item\"));\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 there is an active filter\r\n if (this._activeFilterValue) {\r\n var filterValues = (elItem.dataset.filter || \"\").split('|');\r\n // Parse the active filters\r\n var activeFilters = this._activeFilterValue.split('|');\r\n var showItem = false;\r\n for (var j = 0; j < activeFilters.length; j++) {\r\n // See if the item contains the filter value\r\n if (filterValues.indexOf(activeFilters[j]) >= 0) {\r\n // Set the flag and break from the loop\r\n showItem = true;\r\n break;\r\n }\r\n }\r\n // See if we are hiding the item\r\n if (!showItem) {\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 // Continue the loop\r\n continue;\r\n }\r\n }\r\n // See if a search value exists\r\n if (this._activeSearchValue) {\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchValue) < 0 &&\r\n elContent.innerText.toLowerCase().indexOf(this._activeSearchValue) < 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 // Continue the loop\r\n continue;\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 // See if we are showing pagination\r\n var showPagination = typeof (this._props.showPagination) === \"boolean\" ? this._props.showPagination : true;\r\n if (showPagination) {\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 // Call the event\r\n _this._props.onPaginationClick ? _this._props.onPaginationClick(pageNumber) : null;\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;\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._activeSearchValue = (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?");
184
+ 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.96/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._activeFilterValue = null;\r\n this._activeSearchValue = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the accordion\r\n this.refresh(this._props.items);\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 (values) {\r\n this._activeFilterValue = values ? values.join('|') : \"\";\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 // Generates the accordion item\r\n Accordion.prototype.generateItem = function (item) {\r\n var _this = this;\r\n var filterValues = [];\r\n // See if the filter field is specified\r\n if (this._props.filterFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.filterFields.length; i++) {\r\n var filterField = this._props.filterFields[i];\r\n // Get the filter values\r\n var filters = item[filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // Append the values\r\n filterValues = filterValues.concat(filters);\r\n }\r\n }\r\n // See if the body fields exist\r\n var bodyContent = this._props.bodyTemplate || \"\";\r\n if (this._props.bodyFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.bodyFields.length; i++) {\r\n var field = this._props.bodyFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.bodyTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n bodyContent = bodyContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n bodyContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var titleContent = this._props.titleTemplate || \"\";\r\n if (this._props.titleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.titleFields.length; i++) {\r\n var field = this._props.titleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.titleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n titleContent = titleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n titleContent += value;\r\n }\r\n }\r\n }\r\n // Return the item\r\n return {\r\n content: bodyContent,\r\n header: titleContent,\r\n onClick: this._props.onItemClick,\r\n onRenderBody: this._props.onItemBodyRender,\r\n onRenderHeader: this._props.onItemHeaderRender,\r\n onRender: function (el, item) {\r\n // See if filters exist\r\n if (filterValues && filterValues.length > 0) {\r\n // Set the data filter value\r\n el.setAttribute(\"data-filter\", filterValues.join('|'));\r\n }\r\n // Call the event\r\n _this._props.onItemRender ? _this._props.onItemRender(el, item) : null;\r\n }\r\n };\r\n };\r\n // Method to reload the data\r\n Accordion.prototype.refresh = function (items) {\r\n if (items === void 0) { items = []; }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the accordion\r\n this.render(items);\r\n };\r\n // Renders the dashboard\r\n Accordion.prototype.render = function (items) {\r\n // Render the accordion\r\n this.renderAccordion(items);\r\n // Render the items\r\n this.renderItems();\r\n };\r\n // Renders the accordion\r\n Accordion.prototype.renderAccordion = function (items) {\r\n // Parse the items\r\n var accordionItems = [];\r\n for (var i = 0; i < items.length; i++) {\r\n // Add an accordion item\r\n accordionItems.push(this.generateItem(items[i]));\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 className: this._props.className,\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(\".accordion-item\"));\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 there is an active filter\r\n if (this._activeFilterValue) {\r\n var filterValues = (elItem.dataset.filter || \"\").split('|');\r\n // Parse the active filters\r\n var activeFilters = this._activeFilterValue.split('|');\r\n var showItem = false;\r\n for (var j = 0; j < activeFilters.length; j++) {\r\n // See if the item contains the filter value\r\n if (filterValues.indexOf(activeFilters[j]) >= 0) {\r\n // Set the flag and break from the loop\r\n showItem = true;\r\n break;\r\n }\r\n }\r\n // See if we are hiding the item\r\n if (!showItem) {\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 // Continue the loop\r\n continue;\r\n }\r\n }\r\n // See if a search value exists\r\n if (this._activeSearchValue) {\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchValue) < 0 &&\r\n elContent.innerText.toLowerCase().indexOf(this._activeSearchValue) < 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 // Continue the loop\r\n continue;\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 // See if we are showing pagination\r\n var showPagination = typeof (this._props.showPagination) === \"boolean\" ? this._props.showPagination : true;\r\n if (showPagination) {\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 // Call the event\r\n _this._props.onPaginationClick ? _this._props.onPaginationClick(pageNumber) : null;\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRender ? this._props.onPaginationRender(elPagination) : null;\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._activeSearchValue = (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?");
185
185
 
186
186
  /***/ }),
187
187
 
@@ -192,7 +192,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
192
192
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
193
193
 
194
194
  "use strict";
195
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FilterSlideout = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar filter_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/filter */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/icons/svgs/filter.js\");\r\nvar canvas_1 = __webpack_require__(/*! ../common/canvas */ \"./build/common/canvas.js\");\r\n/**\r\n * Filter Slideout\r\n */\r\nvar FilterSlideout = /** @class */ (function () {\r\n function FilterSlideout(props) {\r\n this._cbs = null;\r\n this._el = null;\r\n this._filters = null;\r\n this._items = null;\r\n // Save the properties\r\n this._filters = props.filters || [];\r\n this._onClear = props.onClear;\r\n this._onFilter = props.onFilter;\r\n this._onShowFilter = props.onShowFilter;\r\n // Initialize the variables\r\n this._cbs = [];\r\n this._items = [];\r\n // Generate the items\r\n this.generateFilters();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(this._el) : null;\r\n }\r\n // Generates the filters\r\n FilterSlideout.prototype.generateFilters = function () {\r\n var _this = this;\r\n // Create the filters element\r\n this._el = document.createElement(\"div\");\r\n // Parse the filters\r\n for (var i = 0; i < this._filters.length; i++) {\r\n var fltr = this._filters[i];\r\n // Add the filter\r\n this._items.push(this.generateItem(fltr));\r\n }\r\n // Default the first filter to be displayed\r\n this._items.length > 0 ? this._items[0].showFl = true : null;\r\n // Render an accordion\r\n gd_sprest_bs_1.Components.Accordion({\r\n el: this._el,\r\n items: this._items\r\n });\r\n // Render a clear button\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: this._el,\r\n content: \"Reset Filters\",\r\n placement: gd_sprest_bs_1.Components.TooltipPlacements.Left,\r\n btnProps: {\r\n className: \"float-end mt-3 p-1 pe-2\",\r\n iconClassName: \"me-1\",\r\n iconType: filter_1.filter,\r\n iconSize: 24,\r\n isSmall: true,\r\n text: \"Reset\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Clear the filters\r\n _this.clear();\r\n }\r\n }\r\n });\r\n // Add the dark class if theme is inverted\r\n if (gd_sprest_bs_1.ThemeManager.IsInverted) {\r\n this._el.querySelectorAll(\"div.form-check.form-switch input[type=checkbox].form-check-input\").forEach(function (el) {\r\n el.classList.add(\"dark\");\r\n });\r\n }\r\n };\r\n // Generates the navigation dropdown items\r\n FilterSlideout.prototype.generateItem = function (filter) {\r\n var _this = this;\r\n // Create the item\r\n var item = {\r\n header: filter.header,\r\n onRenderBody: function (el) {\r\n // Render the checkbox group\r\n _this._cbs.push(gd_sprest_bs_1.Components.CheckboxGroup({\r\n el: el,\r\n items: filter.items,\r\n multi: filter.multi,\r\n type: gd_sprest_bs_1.Components.CheckboxGroupTypes.Switch,\r\n onChange: function (selectedCheckboxes) {\r\n // See if this is a single item\r\n if (filter.multi) {\r\n var values = [];\r\n // Parse the items\r\n var items = (selectedCheckboxes || []);\r\n for (var i = 0; i < items.length; i++) {\r\n // Append the value\r\n values.push(items[i].label);\r\n }\r\n // Execute the events\r\n values = filter.onSetFilterValue ? filter.onSetFilterValue(values, selectedCheckboxes) : values;\r\n filter.onFilter ? filter.onFilter(values, item) : null;\r\n _this._onFilter ? _this._onFilter(values, item) : null;\r\n }\r\n else {\r\n var item_1 = selectedCheckboxes;\r\n var filterValue = item_1 ? item_1.label : \"\";\r\n // Execute the events\r\n filterValue = filter.onSetFilterValue ? filter.onSetFilterValue(filterValue, selectedCheckboxes) : filterValue;\r\n filter.onFilter ? filter.onFilter(filterValue, item_1) : null;\r\n _this._onFilter ? _this._onFilter(filterValue, item_1) : null;\r\n }\r\n }\r\n }));\r\n }\r\n };\r\n // Return the item\r\n return item;\r\n };\r\n // Clears the filters\r\n FilterSlideout.prototype.clear = function () {\r\n // Parse the filters\r\n for (var i = 0; i < this._cbs.length; i++) {\r\n // Clear the filter\r\n this._cbs[i].setValue(\"\");\r\n }\r\n // Execute the event\r\n this._onClear ? this._onClear() : null;\r\n };\r\n // Gets a checkbox group by its name\r\n FilterSlideout.prototype.getFilter = function (key) {\r\n // Parse the items\r\n for (var i = 0; i < this._items.length; i++) {\r\n var item = this._items[i];\r\n // See if this is the target\r\n if (item.header == key) {\r\n // Return the checkbox\r\n return this._cbs[i];\r\n }\r\n }\r\n // Not found\r\n return null;\r\n };\r\n // Sets a checkbox group filter\r\n FilterSlideout.prototype.setFilterValue = function (key, value) {\r\n // Get the filter\r\n var filter = this.getFilter(key);\r\n if (filter) {\r\n // Set the value\r\n filter.setValue(value);\r\n }\r\n };\r\n // Hides the filter\r\n FilterSlideout.prototype.hide = function () { canvas_1.CanvasForm.hide(); };\r\n // Shows the filters\r\n FilterSlideout.prototype.show = function () {\r\n // Set the header and body\r\n canvas_1.CanvasForm.setHeader('<h5 class=\"m-0\">Filters</h5>');\r\n canvas_1.CanvasForm.setBody(this._el || \"<p>Loading the Filters...</p>\");\r\n // Call the event\r\n this._onShowFilter ? this._onShowFilter() : null;\r\n // Show the filters\r\n canvas_1.CanvasForm.show();\r\n };\r\n return FilterSlideout;\r\n}());\r\nexports.FilterSlideout = FilterSlideout;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/filter.js?");
195
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FilterSlideout = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar filter_1 = __webpack_require__(/*! gd-sprest-bs/build/icons/svgs/filter */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/icons/svgs/filter.js\");\r\nvar canvas_1 = __webpack_require__(/*! ../common/canvas */ \"./build/common/canvas.js\");\r\n/**\r\n * Filter Slideout\r\n */\r\nvar FilterSlideout = /** @class */ (function () {\r\n function FilterSlideout(props) {\r\n this._cbs = null;\r\n this._className = null;\r\n this._el = null;\r\n this._filters = null;\r\n this._items = null;\r\n // Save the properties\r\n this._className = props.className;\r\n this._filters = props.filters || [];\r\n this._onClear = props.onClear;\r\n this._onFilter = props.onFilter;\r\n this._onShowFilter = props.onShowFilter;\r\n // Initialize the variables\r\n this._cbs = [];\r\n this._items = [];\r\n // Generate the items\r\n this.generateFilters();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(this._el) : null;\r\n }\r\n // Generates the filters\r\n FilterSlideout.prototype.generateFilters = function () {\r\n var _this = this;\r\n // Create the filters element\r\n this._el = document.createElement(\"div\");\r\n // Parse the filters\r\n for (var i = 0; i < this._filters.length; i++) {\r\n var fltr = this._filters[i];\r\n // Add the filter\r\n this._items.push(this.generateItem(fltr));\r\n }\r\n // Default the first filter to be displayed\r\n this._items.length > 0 ? this._items[0].showFl = true : null;\r\n // Render an accordion\r\n gd_sprest_bs_1.Components.Accordion({\r\n el: this._el,\r\n items: this._items\r\n });\r\n // Render a clear button\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: this._el,\r\n className: this._className,\r\n content: \"Reset Filters\",\r\n placement: gd_sprest_bs_1.Components.TooltipPlacements.Left,\r\n btnProps: {\r\n className: \"float-end mt-3 p-1 pe-2\",\r\n iconClassName: \"me-1\",\r\n iconType: filter_1.filter,\r\n iconSize: 24,\r\n isSmall: true,\r\n text: \"Reset\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Clear the filters\r\n _this.clear();\r\n }\r\n }\r\n });\r\n // Add the dark class if theme is inverted\r\n if (gd_sprest_bs_1.ThemeManager.IsInverted) {\r\n this._el.querySelectorAll(\"div.form-check.form-switch input[type=checkbox].form-check-input\").forEach(function (el) {\r\n el.classList.add(\"dark\");\r\n });\r\n }\r\n };\r\n // Generates the navigation dropdown items\r\n FilterSlideout.prototype.generateItem = function (filter) {\r\n var _this = this;\r\n // Create the item\r\n var item = {\r\n header: filter.header,\r\n onRenderBody: function (el) {\r\n // Render the checkbox group\r\n _this._cbs.push(gd_sprest_bs_1.Components.CheckboxGroup({\r\n el: el,\r\n items: filter.items,\r\n multi: filter.multi,\r\n type: gd_sprest_bs_1.Components.CheckboxGroupTypes.Switch,\r\n onChange: function (selectedCheckboxes) {\r\n // See if this is a single item\r\n if (filter.multi) {\r\n var values = [];\r\n // Parse the items\r\n var items = (selectedCheckboxes || []);\r\n for (var i = 0; i < items.length; i++) {\r\n // Append the value\r\n values.push(items[i].label);\r\n }\r\n // Execute the events\r\n values = filter.onSetFilterValue ? filter.onSetFilterValue(values, selectedCheckboxes) : values;\r\n filter.onFilter ? filter.onFilter(values, item) : null;\r\n _this._onFilter ? _this._onFilter(values, item) : null;\r\n }\r\n else {\r\n var item_1 = selectedCheckboxes;\r\n var filterValue = item_1 ? item_1.label : \"\";\r\n // Execute the events\r\n filterValue = filter.onSetFilterValue ? filter.onSetFilterValue(filterValue, selectedCheckboxes) : filterValue;\r\n filter.onFilter ? filter.onFilter(filterValue, item_1) : null;\r\n _this._onFilter ? _this._onFilter(filterValue, item_1) : null;\r\n }\r\n }\r\n }));\r\n }\r\n };\r\n // Return the item\r\n return item;\r\n };\r\n // Clears the filters\r\n FilterSlideout.prototype.clear = function () {\r\n // Parse the filters\r\n for (var i = 0; i < this._cbs.length; i++) {\r\n // Clear the filter\r\n this._cbs[i].setValue(\"\");\r\n }\r\n // Execute the event\r\n this._onClear ? this._onClear() : null;\r\n };\r\n // Gets a checkbox group by its name\r\n FilterSlideout.prototype.getFilter = function (key) {\r\n // Parse the items\r\n for (var i = 0; i < this._items.length; i++) {\r\n var item = this._items[i];\r\n // See if this is the target\r\n if (item.header == key) {\r\n // Return the checkbox\r\n return this._cbs[i];\r\n }\r\n }\r\n // Not found\r\n return null;\r\n };\r\n // Sets a checkbox group filter\r\n FilterSlideout.prototype.setFilterValue = function (key, value) {\r\n // Get the filter\r\n var filter = this.getFilter(key);\r\n if (filter) {\r\n // Set the value\r\n filter.setValue(value);\r\n }\r\n };\r\n // Hides the filter\r\n FilterSlideout.prototype.hide = function () { canvas_1.CanvasForm.hide(); };\r\n // Shows the filters\r\n FilterSlideout.prototype.show = function () {\r\n // Set the header and body\r\n canvas_1.CanvasForm.setHeader('<h5 class=\"m-0\">Filters</h5>');\r\n canvas_1.CanvasForm.setBody(this._el || \"<p>Loading the Filters...</p>\");\r\n // Call the event\r\n this._onShowFilter ? this._onShowFilter() : null;\r\n // Show the filters\r\n canvas_1.CanvasForm.show();\r\n };\r\n return FilterSlideout;\r\n}());\r\nexports.FilterSlideout = FilterSlideout;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/filter.js?");
196
196
 
197
197
  /***/ }),
198
198
 
@@ -214,7 +214,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
214
214
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
215
215
 
216
216
  "use strict";
217
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Header = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Header\r\n */\r\nvar Header = /** @class */ (function () {\r\n // Constructor\r\n function Header(props) {\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the header\r\n this.render();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(this._props.el) : null;\r\n }\r\n // Renders the component\r\n Header.prototype.render = function () {\r\n // Define the default props\r\n var props = {\r\n el: this._props.el,\r\n className: \"header\",\r\n lead: this._props.title\r\n };\r\n // Call the rendering event\r\n this._props.onRendering ? this._props.onRendering(props) : null;\r\n // Render a jumbotron\r\n gd_sprest_bs_1.Components.Jumbotron(props);\r\n };\r\n return Header;\r\n}());\r\nexports.Header = Header;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/header.js?");
217
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Header = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Header\r\n */\r\nvar Header = /** @class */ (function () {\r\n // Constructor\r\n function Header(props) {\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the header\r\n this.render();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(this._props.el) : null;\r\n }\r\n // Renders the component\r\n Header.prototype.render = function () {\r\n // Define the default props\r\n var props = {\r\n el: this._props.el,\r\n className: \"header\" + (this._props.className ? \" \" : \"\") + this._props.className,\r\n lead: this._props.title\r\n };\r\n // Call the rendering event\r\n this._props.onRendering ? this._props.onRendering(props) : null;\r\n // Render a jumbotron\r\n gd_sprest_bs_1.Components.Jumbotron(props);\r\n };\r\n return Header;\r\n}());\r\nexports.Header = Header;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/header.js?");
218
218
 
219
219
  /***/ }),
220
220
 
@@ -225,7 +225,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
225
225
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
226
226
 
227
227
  "use strict";
228
- 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\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Dashboard = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./build/common/index.js\");\r\nvar accordion_1 = __webpack_require__(/*! ./accordion */ \"./build/dashboard/accordion.js\");\r\nvar filter_1 = __webpack_require__(/*! ./filter */ \"./build/dashboard/filter.js\");\r\nvar footer_1 = __webpack_require__(/*! ./footer */ \"./build/dashboard/footer.js\");\r\nvar header_1 = __webpack_require__(/*! ./header */ \"./build/dashboard/header.js\");\r\nvar navigation_1 = __webpack_require__(/*! ./navigation */ \"./build/dashboard/navigation.js\");\r\nvar table_1 = __webpack_require__(/*! ./table */ \"./build/dashboard/table.js\");\r\nvar tiles_1 = __webpack_require__(/*! ./tiles */ \"./build/dashboard/tiles.js\");\r\n// Export the components\r\n__exportStar(__webpack_require__(/*! ./accordion */ \"./build/dashboard/accordion.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./filter */ \"./build/dashboard/filter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./footer */ \"./build/dashboard/footer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./header */ \"./build/dashboard/header.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./navigation */ \"./build/dashboard/navigation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./table */ \"./build/dashboard/table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tiles */ \"./build/dashboard/tiles.js\"), exports);\r\n/**\r\n * Dashboard\r\n */\r\nvar Dashboard = /** @class */ (function () {\r\n // Constructor\r\n function Dashboard(props) {\r\n var _this = this;\r\n this._accordion = null;\r\n this._dt = null;\r\n this._filters = null;\r\n this._navigation = null;\r\n this._props = null;\r\n this._tiles = null;\r\n // Set the properties\r\n this._props = props;\r\n // Set the flag\r\n typeof (props.useModal) === \"boolean\" ? common_1.ItemForm.UseModal = props.useModal : null;\r\n // Render the dashboard\r\n this.render();\r\n // Let the object get instaniated before calling the event\r\n setTimeout(function () {\r\n // Apply the filters\r\n _this.applyFilters();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(_this._props.el) : null;\r\n }, 10);\r\n }\r\n Object.defineProperty(Dashboard.prototype, \"IsAccordion\", {\r\n // Determines if we are rendering an accordion\r\n get: function () { return this._props.accordion ? true : false; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"IsTiles\", {\r\n // Determines if we are rendering tiles\r\n get: function () { return this._props.tiles ? true : false; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Applies the default active filters\r\n Dashboard.prototype.applyFilters = function () {\r\n var _a;\r\n // See if filters exist\r\n if ((_a = this._props.filters) === null || _a === void 0 ? void 0 : _a.items) {\r\n // Parse the filters\r\n for (var i = 0; i < this._props.filters.items.length; i++) {\r\n var applyFilter = false;\r\n var filter = this._props.filters.items[i];\r\n var value = filter.multi ? [] : \"\";\r\n // Parse the items\r\n for (var j = 0; j < (filter === null || filter === void 0 ? void 0 : filter.items.length); j++) {\r\n var item = filter.items[j];\r\n // See if this one is active\r\n if (item.isSelected) {\r\n // Set the flag\r\n applyFilter = true;\r\n // Set the value\r\n filter.multi ? value.push(item.label) : value = item.label;\r\n }\r\n }\r\n // See if we are applying the filter\r\n if (applyFilter) {\r\n // Apply the filter\r\n filter.onFilter(value);\r\n }\r\n }\r\n }\r\n };\r\n // Renders the component\r\n Dashboard.prototype.render = function () {\r\n var _this = this;\r\n // Create the filters\r\n this._filters = new filter_1.FilterSlideout({\r\n filters: this._props.filters ? this._props.filters.items : [],\r\n onClear: this._props.filters ? this._props.filters.onClear : null,\r\n onRendered: this._props.filters ? this._props.filters.onRendered : null,\r\n onShowFilter: this._props.filters ? this._props.filters.onShowFilter : null,\r\n onFilter: this.IsAccordion || this.IsTiles ? function (value, item) {\r\n var values = typeof (value) === \"string\" ? [value] : value;\r\n // See if this is an accordion\r\n if (_this.IsAccordion) {\r\n // Filter the accordion\r\n _this._accordion.filter(values, item);\r\n }\r\n else {\r\n // Filter the tiles\r\n _this._tiles.filter(values, item);\r\n }\r\n } : null\r\n });\r\n // Render the template\r\n var elTemplate = document.createElement(\"div\");\r\n elTemplate.classList.add(\"dashboard\");\r\n elTemplate.innerHTML = \"\\n <div class=\\\"row\\\">\\n <div id=\\\"navigation\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"header\\\" class=\\\"col mx-75\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"sub-navigation\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"\".concat(this.IsAccordion ? \"accordion\" : (this.IsTiles ? \"tiles\" : \"datatable\"), \"\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"footer\\\" class=\\\"col\\\"></div>\\n </div>\").trim();\r\n this._props.el.appendChild(elTemplate);\r\n // Set/Default the visibility flags\r\n var headerIsVisible = typeof (this._props.hideHeader) === \"boolean\" ? !this._props.hideHeader : (this._props.header == null ? false : true);\r\n var navIsVisible = typeof (this._props.hideNavigation) === \"boolean\" ? !this._props.hideNavigation : true;\r\n var subNavIsVisible = typeof (this._props.hideSubNavigation) === \"boolean\" ? !this._props.hideSubNavigation : (this._props.subNavigation == null ? false : true);\r\n // See if we are hiding the navigation\r\n if (!navIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#navigation\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the navigation\r\n var navProps_1 = this._props.navigation || {};\r\n this._navigation = new navigation_1.Navigation({\r\n el: this._props.el.querySelector(\"#navigation\"),\r\n hideFilter: navProps_1.showFilter != null ? !navProps_1.showFilter : false,\r\n hideSearch: navProps_1.showSearch != null ? !navProps_1.showSearch : false,\r\n items: navProps_1.items,\r\n itemsEnd: navProps_1.itemsEnd,\r\n title: navProps_1.title,\r\n onFilterRendered: navProps_1.onFilterRendered,\r\n onRendering: function (props) {\r\n // Set the default classname\r\n props.className = props.className || (\"bg-sharepoint rounded\" + (headerIsVisible || subNavIsVisible ? \"-top\" : \"\"));\r\n // Set the default type\r\n props.type = typeof (props.type) === \"number\" ? props.type : gd_sprest_bs_1.Components.NavbarTypes.Dark;\r\n // Call the rendering event if it exists\r\n navProps_1.onRendering ? navProps_1.onRendering(props) : null;\r\n },\r\n onRendered: navProps_1.onRendered,\r\n onSearch: function (value) {\r\n // See if we are rendering an accordion\r\n if (_this.IsAccordion) {\r\n // Search the accordion\r\n _this._accordion.search(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (_this.IsTiles) {\r\n // Search the tiles\r\n _this._tiles.search(value);\r\n }\r\n else {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n },\r\n onSearchRendered: navProps_1.onSearchRendered,\r\n onShowFilter: function () {\r\n // Show the filter\r\n _this._filters.show();\r\n // Call the event\r\n navProps_1.onShowFilter ? navProps_1.onShowFilter() : null;\r\n },\r\n searchPlaceholder: navProps_1.searchPlaceholder\r\n });\r\n }\r\n // See if we are hiding the header\r\n if (!headerIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#header\").classList.add(\"d-none\");\r\n }\r\n else {\r\n var elHeader = this._props.el.querySelector(\"#header\");\r\n // Render the header\r\n var header = this._props.header || {};\r\n new header_1.Header({\r\n el: elHeader,\r\n onRendering: this._props.header ? this._props.header.onRendering : null,\r\n onRendered: this._props.header ? this._props.header.onRendered : null,\r\n title: header.title\r\n });\r\n // See if the sub-nav is not visible\r\n if (!navIsVisible && !subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded\");\r\n }\r\n else if (navIsVisible && !subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded-bottom\");\r\n }\r\n else if (!navIsVisible && subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded-top\");\r\n }\r\n }\r\n // See if we are hiding the sub-navigation\r\n if (!subNavIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#sub-navigation\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the navigation\r\n var navProps_2 = this._props.subNavigation || {};\r\n new navigation_1.Navigation({\r\n el: this._props.el.querySelector(\"#sub-navigation\"),\r\n className: headerIsVisible || navIsVisible ? null : \"sub-nav-border\",\r\n hideFilter: navProps_2.showFilter != null ? !navProps_2.showFilter : true,\r\n hideSearch: navProps_2.showSearch != null ? !navProps_2.showSearch : true,\r\n items: navProps_2.items,\r\n itemsEnd: navProps_2.itemsEnd,\r\n title: navProps_2.title,\r\n onFilterRendered: navProps_2.onFilterRendered,\r\n onRendering: function (props) {\r\n // Set the default classname\r\n props.className = props.className || (\"rounded\" + (!headerIsVisible && !navIsVisible ? \"\" : \"-bottom\"));\r\n props.className = \"sub-nav \" + props.className;\r\n // Set the default type\r\n props.type = typeof (props.type) === \"number\" ? props.type : gd_sprest_bs_1.Components.NavbarTypes.Light;\r\n // Call the rendering event if it exists\r\n navProps_2.onRendering ? navProps_2.onRendering(props) : null;\r\n },\r\n onRendered: navProps_2.onRendered,\r\n onSearch: function (value) {\r\n // See if we are rendering an accordion\r\n if (_this.IsAccordion) {\r\n // Search the accordion\r\n _this._accordion.search(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (_this.IsTiles) {\r\n // Search the tiles\r\n _this._tiles.search(value);\r\n }\r\n else {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n },\r\n onShowFilter: function () {\r\n // Show the filter\r\n _this._filters.show();\r\n },\r\n });\r\n }\r\n // See if we are rendering an accordion\r\n if (this.IsAccordion) {\r\n // Render the accordion\r\n this._accordion = new accordion_1.Accordion(__assign({ el: this._props.el.querySelector(\"#accordion\") }, this._props.accordion));\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (this.IsTiles) {\r\n // Render the tiles\r\n this._tiles = new tiles_1.Tiles(__assign({ el: this._props.el.querySelector(\"#tiles\") }, this._props.tiles));\r\n }\r\n else {\r\n // Render the data table\r\n this._dt = new table_1.DataTable(__assign({ el: this._props.el.querySelector(\"#datatable\") }, this._props.table));\r\n }\r\n // See if we are hiding the footer\r\n if (this._props.hideFooter) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#footer\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the footer\r\n var footer = this._props.footer || {};\r\n new footer_1.Footer({\r\n className: \"bg-sharepoint rounded-bottom\",\r\n el: this._props.el.querySelector(\"#footer\"),\r\n items: footer.items,\r\n itemsEnd: footer.itemsEnd,\r\n onRendering: footer.onRendering,\r\n onRendered: footer.onRendered\r\n });\r\n }\r\n };\r\n Object.defineProperty(Dashboard.prototype, \"Datatable\", {\r\n /**\r\n * Component References\r\n */\r\n get: function () { return this._dt; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"Filters\", {\r\n get: function () { return this._filters; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"Navigation\", {\r\n get: function () { return this._navigation; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Public Interface\r\n */\r\n // Clears the filters\r\n Dashboard.prototype.clearFilter = function () {\r\n // Clear the filters\r\n this._filters.clear();\r\n };\r\n // Filter the table\r\n Dashboard.prototype.filter = function (idx, value, exactMatchFl) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(value);\r\n }\r\n else {\r\n // If no value is specified, then we don't want to filter by exact value\r\n exactMatchFl && value ? this._dt.filterExact(idx, value) : this._dt.filter(idx, value);\r\n }\r\n };\r\n // Filter the accordion\r\n Dashboard.prototype.filterAccordion = function (values) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(typeof (values) === \"string\" ? [values] : values);\r\n }\r\n };\r\n // Filter the table by multiple values\r\n Dashboard.prototype.filterMulti = function (idx, values) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(values);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(values);\r\n }\r\n else {\r\n // Filter the table\r\n this._dt.filterMulti(idx, values);\r\n }\r\n };\r\n // Filter the tiles\r\n Dashboard.prototype.filterTiles = function (values) {\r\n // See if we have tiles\r\n if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(typeof (values) === \"string\" ? [values] : values);\r\n }\r\n };\r\n // Returns a filter checkbox group by its key\r\n Dashboard.prototype.getFilter = function (key) { return this._filters.getFilter(key); };\r\n // Returns the current search value\r\n Dashboard.prototype.getSearchValue = function () { return this._navigation ? this._navigation.getSearchValue() : \"\"; };\r\n // Hides the filter\r\n Dashboard.prototype.hideFilter = function () { this._filters.hide(); };\r\n // Refresh the table\r\n Dashboard.prototype.refresh = function (rows) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Refresh the table\r\n this._accordion.refresh(rows);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Refresh the table\r\n this._tiles.refresh(rows);\r\n }\r\n else {\r\n // Refresh the table\r\n this._dt.refresh(rows);\r\n }\r\n // See if a search value exists\r\n var searchValue = this._navigation ? this._navigation.getSearchValue() : \"\";\r\n if (searchValue) {\r\n // Apply the search value\r\n this.search(searchValue);\r\n }\r\n };\r\n // Search the table\r\n Dashboard.prototype.search = function (value) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Search the accordion\r\n this._accordion.search(value);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Search the tiles\r\n this._tiles.search(value);\r\n }\r\n else {\r\n // Search the table\r\n this._dt.search(value);\r\n }\r\n };\r\n // Sets a filter checkbox group value\r\n Dashboard.prototype.setFilterValue = function (key, value) { return this._filters.setFilterValue(key, value); };\r\n // Shows the filter\r\n Dashboard.prototype.showFilter = function () { this._filters.show(); };\r\n return Dashboard;\r\n}());\r\nexports.Dashboard = Dashboard;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/index.js?");
228
+ 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\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Dashboard = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./build/common/index.js\");\r\nvar accordion_1 = __webpack_require__(/*! ./accordion */ \"./build/dashboard/accordion.js\");\r\nvar filter_1 = __webpack_require__(/*! ./filter */ \"./build/dashboard/filter.js\");\r\nvar footer_1 = __webpack_require__(/*! ./footer */ \"./build/dashboard/footer.js\");\r\nvar header_1 = __webpack_require__(/*! ./header */ \"./build/dashboard/header.js\");\r\nvar navigation_1 = __webpack_require__(/*! ./navigation */ \"./build/dashboard/navigation.js\");\r\nvar table_1 = __webpack_require__(/*! ./table */ \"./build/dashboard/table.js\");\r\nvar tiles_1 = __webpack_require__(/*! ./tiles */ \"./build/dashboard/tiles.js\");\r\n// Export the components\r\n__exportStar(__webpack_require__(/*! ./accordion */ \"./build/dashboard/accordion.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./filter */ \"./build/dashboard/filter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./footer */ \"./build/dashboard/footer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./header */ \"./build/dashboard/header.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./navigation */ \"./build/dashboard/navigation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./table */ \"./build/dashboard/table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tiles */ \"./build/dashboard/tiles.js\"), exports);\r\n/**\r\n * Dashboard\r\n */\r\nvar Dashboard = /** @class */ (function () {\r\n // Constructor\r\n function Dashboard(props) {\r\n var _this = this;\r\n this._accordion = null;\r\n this._dt = null;\r\n this._filters = null;\r\n this._navigation = null;\r\n this._props = null;\r\n this._tiles = null;\r\n // Set the properties\r\n this._props = props;\r\n // Set the flag\r\n typeof (props.useModal) === \"boolean\" ? common_1.ItemForm.UseModal = props.useModal : null;\r\n // Render the dashboard\r\n this.render();\r\n // Let the object get instaniated before calling the event\r\n setTimeout(function () {\r\n // Apply the filters\r\n _this.applyFilters();\r\n // Call the render event\r\n props.onRendered ? props.onRendered(_this._props.el) : null;\r\n }, 10);\r\n }\r\n Object.defineProperty(Dashboard.prototype, \"IsAccordion\", {\r\n // Determines if we are rendering an accordion\r\n get: function () { return this._props.accordion ? true : false; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"IsTiles\", {\r\n // Determines if we are rendering tiles\r\n get: function () { return this._props.tiles ? true : false; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Applies the default active filters\r\n Dashboard.prototype.applyFilters = function () {\r\n var _a;\r\n // See if filters exist\r\n if ((_a = this._props.filters) === null || _a === void 0 ? void 0 : _a.items) {\r\n // Parse the filters\r\n for (var i = 0; i < this._props.filters.items.length; i++) {\r\n var applyFilter = false;\r\n var filter = this._props.filters.items[i];\r\n var value = filter.multi ? [] : \"\";\r\n // Parse the items\r\n for (var j = 0; j < (filter === null || filter === void 0 ? void 0 : filter.items.length); j++) {\r\n var item = filter.items[j];\r\n // See if this one is active\r\n if (item.isSelected) {\r\n // Set the flag\r\n applyFilter = true;\r\n // Set the value\r\n filter.multi ? value.push(item.label) : value = item.label;\r\n }\r\n }\r\n // See if we are applying the filter\r\n if (applyFilter) {\r\n // Apply the filter\r\n filter.onFilter(value);\r\n }\r\n }\r\n }\r\n };\r\n // Renders the component\r\n Dashboard.prototype.render = function () {\r\n var _this = this;\r\n // Create the filters\r\n this._filters = new filter_1.FilterSlideout({\r\n className: this._props.filters ? this._props.filters.className : null,\r\n filters: this._props.filters ? this._props.filters.items : [],\r\n onClear: this._props.filters ? this._props.filters.onClear : null,\r\n onRendered: this._props.filters ? this._props.filters.onRendered : null,\r\n onShowFilter: this._props.filters ? this._props.filters.onShowFilter : null,\r\n onFilter: this.IsAccordion || this.IsTiles ? function (value, item) {\r\n var values = typeof (value) === \"string\" ? [value] : value;\r\n // See if this is an accordion\r\n if (_this.IsAccordion) {\r\n // Filter the accordion\r\n _this._accordion.filter(values, item);\r\n }\r\n else {\r\n // Filter the tiles\r\n _this._tiles.filter(values, item);\r\n }\r\n } : null\r\n });\r\n // Render the template\r\n var elTemplate = document.createElement(\"div\");\r\n elTemplate.classList.add(\"dashboard\");\r\n elTemplate.innerHTML = \"\\n <div class=\\\"row\\\">\\n <div id=\\\"navigation\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"header\\\" class=\\\"col mx-75\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"sub-navigation\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"\".concat(this.IsAccordion ? \"accordion\" : (this.IsTiles ? \"tiles\" : \"datatable\"), \"\\\" class=\\\"col\\\"></div>\\n </div>\\n <div class=\\\"row\\\">\\n <div id=\\\"footer\\\" class=\\\"col\\\"></div>\\n </div>\").trim();\r\n this._props.el.appendChild(elTemplate);\r\n // Set/Default the visibility flags\r\n var headerIsVisible = typeof (this._props.hideHeader) === \"boolean\" ? !this._props.hideHeader : (this._props.header == null ? false : true);\r\n var navIsVisible = typeof (this._props.hideNavigation) === \"boolean\" ? !this._props.hideNavigation : true;\r\n var subNavIsVisible = typeof (this._props.hideSubNavigation) === \"boolean\" ? !this._props.hideSubNavigation : (this._props.subNavigation == null ? false : true);\r\n // See if we are hiding the navigation\r\n if (!navIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#navigation\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the navigation\r\n var navProps_1 = this._props.navigation || {};\r\n this._navigation = new navigation_1.Navigation({\r\n className: navProps_1.className,\r\n el: this._props.el.querySelector(\"#navigation\"),\r\n hideFilter: navProps_1.showFilter != null ? !navProps_1.showFilter : false,\r\n hideSearch: navProps_1.showSearch != null ? !navProps_1.showSearch : false,\r\n items: navProps_1.items,\r\n itemsEnd: navProps_1.itemsEnd,\r\n title: navProps_1.title,\r\n onFilterRendered: navProps_1.onFilterRendered,\r\n onRendering: function (props) {\r\n // Set the default classname\r\n props.className = props.className || (\"bg-sharepoint rounded\" + (headerIsVisible || subNavIsVisible ? \"-top\" : \"\"));\r\n // Set the default type\r\n props.type = typeof (props.type) === \"number\" ? props.type : gd_sprest_bs_1.Components.NavbarTypes.Dark;\r\n // Call the rendering event if it exists\r\n navProps_1.onRendering ? navProps_1.onRendering(props) : null;\r\n },\r\n onRendered: navProps_1.onRendered,\r\n onSearch: function (value) {\r\n // See if we are rendering an accordion\r\n if (_this.IsAccordion) {\r\n // Search the accordion\r\n _this._accordion.search(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (_this.IsTiles) {\r\n // Search the tiles\r\n _this._tiles.search(value);\r\n }\r\n else {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n },\r\n onSearchRendered: navProps_1.onSearchRendered,\r\n onShowFilter: function () {\r\n // Show the filter\r\n _this._filters.show();\r\n // Call the event\r\n navProps_1.onShowFilter ? navProps_1.onShowFilter() : null;\r\n },\r\n searchPlaceholder: navProps_1.searchPlaceholder\r\n });\r\n }\r\n // See if we are hiding the header\r\n if (!headerIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#header\").classList.add(\"d-none\");\r\n }\r\n else {\r\n var elHeader = this._props.el.querySelector(\"#header\");\r\n // Render the header\r\n var header = this._props.header || {};\r\n new header_1.Header({\r\n className: header.className,\r\n el: elHeader,\r\n onRendering: this._props.header ? this._props.header.onRendering : null,\r\n onRendered: this._props.header ? this._props.header.onRendered : null,\r\n title: header.title\r\n });\r\n // See if the sub-nav is not visible\r\n if (!navIsVisible && !subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded\");\r\n }\r\n else if (navIsVisible && !subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded-bottom\");\r\n }\r\n else if (!navIsVisible && subNavIsVisible) {\r\n // Set the class name\r\n elHeader.classList.add(\"rounded-top\");\r\n }\r\n }\r\n // See if we are hiding the sub-navigation\r\n if (!subNavIsVisible) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#sub-navigation\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the navigation\r\n var navProps_2 = this._props.subNavigation || {};\r\n var className = (headerIsVisible || navIsVisible ? null : \"sub-nav-border\") +\r\n (navProps_2.className ? \" \" : \"\") + navProps_2.className;\r\n new navigation_1.Navigation({\r\n el: this._props.el.querySelector(\"#sub-navigation\"),\r\n className: className,\r\n hideFilter: navProps_2.showFilter != null ? !navProps_2.showFilter : true,\r\n hideSearch: navProps_2.showSearch != null ? !navProps_2.showSearch : true,\r\n items: navProps_2.items,\r\n itemsEnd: navProps_2.itemsEnd,\r\n title: navProps_2.title,\r\n onFilterRendered: navProps_2.onFilterRendered,\r\n onRendering: function (props) {\r\n // Set the default classname\r\n props.className = props.className || (\"rounded\" + (!headerIsVisible && !navIsVisible ? \"\" : \"-bottom\"));\r\n props.className = \"sub-nav \" + props.className;\r\n // Set the default type\r\n props.type = typeof (props.type) === \"number\" ? props.type : gd_sprest_bs_1.Components.NavbarTypes.Light;\r\n // Call the rendering event if it exists\r\n navProps_2.onRendering ? navProps_2.onRendering(props) : null;\r\n },\r\n onRendered: navProps_2.onRendered,\r\n onSearch: function (value) {\r\n // See if we are rendering an accordion\r\n if (_this.IsAccordion) {\r\n // Search the accordion\r\n _this._accordion.search(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (_this.IsTiles) {\r\n // Search the tiles\r\n _this._tiles.search(value);\r\n }\r\n else {\r\n // Search the data table\r\n _this._dt.search(value);\r\n }\r\n },\r\n onShowFilter: function () {\r\n // Show the filter\r\n _this._filters.show();\r\n },\r\n });\r\n }\r\n // See if we are rendering an accordion\r\n if (this.IsAccordion) {\r\n // Render the accordion\r\n this._accordion = new accordion_1.Accordion(__assign({ el: this._props.el.querySelector(\"#accordion\") }, this._props.accordion));\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (this.IsTiles) {\r\n // Render the tiles\r\n this._tiles = new tiles_1.Tiles(__assign({ el: this._props.el.querySelector(\"#tiles\") }, this._props.tiles));\r\n }\r\n else {\r\n // Render the data table\r\n this._dt = new table_1.DataTable(__assign({ el: this._props.el.querySelector(\"#datatable\") }, this._props.table));\r\n }\r\n // See if we are hiding the footer\r\n if (this._props.hideFooter) {\r\n // Hide the element\r\n this._props.el.querySelector(\"#footer\").classList.add(\"d-none\");\r\n }\r\n else {\r\n // Render the footer\r\n var footer = this._props.footer || {};\r\n new footer_1.Footer({\r\n className: \"bg-sharepoint rounded-bottom\" + (footer.className ? \" \" : \"\") + footer.className,\r\n el: this._props.el.querySelector(\"#footer\"),\r\n items: footer.items,\r\n itemsEnd: footer.itemsEnd,\r\n onRendering: footer.onRendering,\r\n onRendered: footer.onRendered\r\n });\r\n }\r\n };\r\n Object.defineProperty(Dashboard.prototype, \"Datatable\", {\r\n /**\r\n * Component References\r\n */\r\n get: function () { return this._dt; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"Filters\", {\r\n get: function () { return this._filters; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Dashboard.prototype, \"Navigation\", {\r\n get: function () { return this._navigation; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Public Interface\r\n */\r\n // Clears the filters\r\n Dashboard.prototype.clearFilter = function () {\r\n // Clear the filters\r\n this._filters.clear();\r\n };\r\n // Filter the table\r\n Dashboard.prototype.filter = function (idx, value, exactMatchFl) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(value);\r\n }\r\n // Else, see if we are rendering tiles\r\n else if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(value);\r\n }\r\n else {\r\n // If no value is specified, then we don't want to filter by exact value\r\n exactMatchFl && value ? this._dt.filterExact(idx, value) : this._dt.filter(idx, value);\r\n }\r\n };\r\n // Filter the accordion\r\n Dashboard.prototype.filterAccordion = function (values) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(typeof (values) === \"string\" ? [values] : values);\r\n }\r\n };\r\n // Filter the table by multiple values\r\n Dashboard.prototype.filterMulti = function (idx, values) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Filter the accordion\r\n this._accordion.filter(values);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(values);\r\n }\r\n else {\r\n // Filter the table\r\n this._dt.filterMulti(idx, values);\r\n }\r\n };\r\n // Filter the tiles\r\n Dashboard.prototype.filterTiles = function (values) {\r\n // See if we have tiles\r\n if (this.IsTiles) {\r\n // Filter the tiles\r\n this._tiles.filter(typeof (values) === \"string\" ? [values] : values);\r\n }\r\n };\r\n // Returns a filter checkbox group by its key\r\n Dashboard.prototype.getFilter = function (key) { return this._filters.getFilter(key); };\r\n // Returns the current search value\r\n Dashboard.prototype.getSearchValue = function () { return this._navigation ? this._navigation.getSearchValue() : \"\"; };\r\n // Hides the filter\r\n Dashboard.prototype.hideFilter = function () { this._filters.hide(); };\r\n // Refresh the table\r\n Dashboard.prototype.refresh = function (rows) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Refresh the table\r\n this._accordion.refresh(rows);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Refresh the table\r\n this._tiles.refresh(rows);\r\n }\r\n else {\r\n // Refresh the table\r\n this._dt.refresh(rows);\r\n }\r\n // See if a search value exists\r\n var searchValue = this._navigation ? this._navigation.getSearchValue() : \"\";\r\n if (searchValue) {\r\n // Apply the search value\r\n this.search(searchValue);\r\n }\r\n };\r\n // Search the table\r\n Dashboard.prototype.search = function (value) {\r\n // See if we have an accordion\r\n if (this.IsAccordion) {\r\n // Search the accordion\r\n this._accordion.search(value);\r\n }\r\n // Else, see if we have tiles\r\n else if (this.IsTiles) {\r\n // Search the tiles\r\n this._tiles.search(value);\r\n }\r\n else {\r\n // Search the table\r\n this._dt.search(value);\r\n }\r\n };\r\n // Sets a filter checkbox group value\r\n Dashboard.prototype.setFilterValue = function (key, value) { return this._filters.setFilterValue(key, value); };\r\n // Shows the filter\r\n Dashboard.prototype.showFilter = function () { this._filters.show(); };\r\n return Dashboard;\r\n}());\r\nexports.Dashboard = Dashboard;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/index.js?");
229
229
 
230
230
  /***/ }),
231
231
 
@@ -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.DataTable = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\nvar $ = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\n__webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@2.1.3/node_modules/datatables.net/js/dataTables.min.js\");\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@2.1.3/node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js\");\r\n/**\r\n * Data Table\r\n */\r\nvar DataTable = /** @class */ (function () {\r\n // Constructor\r\n function DataTable(props) {\r\n this._datatable = null;\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Set the default properties\r\n this._props.dtProps = this._props.dtProps || {\r\n drawCallback: function (settings) {\r\n var api = new $.fn.dataTable.Api(settings);\r\n // Styling option for striped rows\r\n $(api.context[0].nTable).addClass('table-striped');\r\n // Align the text to be centered\r\n $(api.context[0].nTableWrapper).find('.dt-info').parent().removeClass('col-md d-md-flex justify-content-between align-items-center');\r\n $(api.context[0].nTableWrapper).find('.dt-info').addClass('text-center');\r\n // Remove the label spacing to align with paging\r\n $(api.context[0].nTableWrapper).find('.dt-length label').addClass('d-none');\r\n // Push paging to the end\r\n $(api.context[0].nTableWrapper).find('.dt-paging').addClass('d-flex justify-content-end mx-0 px-0');\r\n // Add spacing for the footer\r\n $(api.context[0].nTableWrapper).find('.row:last-child').addClass('mb-1');\r\n },\r\n language: {\r\n lengthMenu: \"_MENU_\",\r\n paginate: {\r\n first: \"First\",\r\n last: \"Last\",\r\n next: \"Next\",\r\n previous: \"Previous\"\r\n }\r\n },\r\n layout: {\r\n top: null,\r\n topStart: null,\r\n topEnd: null,\r\n bottom: \"info\",\r\n bottomStart: \"pageLength\",\r\n bottomEnd: {\r\n paging: {\r\n type: \"full_numbers\"\r\n }\r\n }\r\n }\r\n };\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Applies the datatables.net plugin\r\n DataTable.prototype.applyPlugin = function (table) {\r\n var _this = this;\r\n // Call the rendering event\r\n this._props.dtProps = this._props.onRendering ? this._props.onRendering(this._props.dtProps) : this._props.dtProps;\r\n // Render the datatable\r\n this._datatable = $(table.el).DataTable(this._props.dtProps);\r\n // Call the rendered event in a separate thread to ensure the dashboard object is created\r\n setTimeout(function () {\r\n _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;\r\n }, 50);\r\n };\r\n Object.defineProperty(DataTable.prototype, \"datatable\", {\r\n /** Public Interface */\r\n // Datatables.net object\r\n get: function () { return this._datatable; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTable.prototype, \"el\", {\r\n // The data table element\r\n get: function () { return this._props.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Filters the status\r\n DataTable.prototype.filter = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&'), true, false).draw();\r\n };\r\n // Filters the status\r\n DataTable.prototype.filterExact = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(\"^\" + value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&') + \"$\", true, false).draw();\r\n };\r\n // Filters multiple values against the status\r\n DataTable.prototype.filterMulti = function (idx, values) {\r\n if (values === void 0) { values = []; }\r\n // Parse the values\r\n for (var i = 0; i < values.length; i++) {\r\n // Update the value\r\n values[i] = values[i].replace(/\\|/g, '\\\\$&');\r\n }\r\n // Filter the values\r\n this.filter(idx, values.join('|'));\r\n };\r\n // Method to reload the data\r\n DataTable.prototype.refresh = function (rows) {\r\n if (rows === void 0) { rows = []; }\r\n // See if the datatable exists\r\n if (this._datatable != null) {\r\n // Clear the datatable\r\n this._datatable.clear();\r\n this._datatable.destroy();\r\n this._datatable = null;\r\n }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the data table\r\n var table = gd_sprest_bs_1.Components.Table({\r\n el: this._props.el,\r\n rows: rows,\r\n columns: this._props.columns\r\n });\r\n // Apply the plugin\r\n this.applyPlugin(table);\r\n };\r\n // Searches the datatable\r\n DataTable.prototype.search = function (value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Search the table\r\n this._datatable.search(value).draw();\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?");
250
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTable = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.11.96/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\nvar $ = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.7.1/node_modules/jquery/dist/jquery.min.js\");\r\n__webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@2.1.3/node_modules/datatables.net/js/dataTables.min.js\");\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@2.1.3/node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js\");\r\n/**\r\n * Data Table\r\n */\r\nvar DataTable = /** @class */ (function () {\r\n // Constructor\r\n function DataTable(props) {\r\n this._datatable = null;\r\n this._props = null;\r\n // Save the properties\r\n this._props = props;\r\n // Set the default properties\r\n this._props.dtProps = this._props.dtProps || {\r\n drawCallback: function (settings) {\r\n var api = new $.fn.dataTable.Api(settings);\r\n // Styling option for striped rows\r\n $(api.context[0].nTable).addClass('table-striped');\r\n // Align the text to be centered\r\n $(api.context[0].nTableWrapper).find('.dt-info').parent().removeClass('col-md d-md-flex justify-content-between align-items-center');\r\n $(api.context[0].nTableWrapper).find('.dt-info').addClass('text-center');\r\n // Remove the label spacing to align with paging\r\n $(api.context[0].nTableWrapper).find('.dt-length label').addClass('d-none');\r\n // Push paging to the end\r\n $(api.context[0].nTableWrapper).find('.dt-paging').addClass('d-flex justify-content-end mx-0 px-0');\r\n // Add spacing for the footer\r\n $(api.context[0].nTableWrapper).find('.row:last-child').addClass('mb-1');\r\n },\r\n language: {\r\n lengthMenu: \"_MENU_\",\r\n paginate: {\r\n first: \"First\",\r\n last: \"Last\",\r\n next: \"Next\",\r\n previous: \"Previous\"\r\n }\r\n },\r\n layout: {\r\n top: null,\r\n topStart: null,\r\n topEnd: null,\r\n bottom: \"info\",\r\n bottomStart: \"pageLength\",\r\n bottomEnd: {\r\n paging: {\r\n type: \"full_numbers\"\r\n }\r\n }\r\n }\r\n };\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Applies the datatables.net plugin\r\n DataTable.prototype.applyPlugin = function (table) {\r\n var _this = this;\r\n // Call the rendering event\r\n this._props.dtProps = this._props.onRendering ? this._props.onRendering(this._props.dtProps) : this._props.dtProps;\r\n // Render the datatable\r\n this._datatable = $(table.el).DataTable(this._props.dtProps);\r\n // Call the rendered event in a separate thread to ensure the dashboard object is created\r\n setTimeout(function () {\r\n _this._props.onRendered ? _this._props.onRendered(_this._props.el, _this._datatable) : null;\r\n }, 50);\r\n };\r\n Object.defineProperty(DataTable.prototype, \"datatable\", {\r\n /** Public Interface */\r\n // Datatables.net object\r\n get: function () { return this._datatable; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTable.prototype, \"el\", {\r\n // The data table element\r\n get: function () { return this._props.el; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Filters the status\r\n DataTable.prototype.filter = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&'), true, false).draw();\r\n };\r\n // Filters the status\r\n DataTable.prototype.filterExact = function (idx, value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Set the filter\r\n this._datatable.column(idx).search(\"^\" + value.replace(/[-[/\\]{}()*+?.,\\\\^$#\\s]/g, '\\\\$&') + \"$\", true, false).draw();\r\n };\r\n // Filters multiple values against the status\r\n DataTable.prototype.filterMulti = function (idx, values) {\r\n if (values === void 0) { values = []; }\r\n // Parse the values\r\n for (var i = 0; i < values.length; i++) {\r\n // Update the value\r\n values[i] = values[i].replace(/\\|/g, '\\\\$&');\r\n }\r\n // Filter the values\r\n this.filter(idx, values.join('|'));\r\n };\r\n // Method to reload the data\r\n DataTable.prototype.refresh = function (rows) {\r\n if (rows === void 0) { rows = []; }\r\n // See if the datatable exists\r\n if (this._datatable != null) {\r\n // Clear the datatable\r\n this._datatable.clear();\r\n this._datatable.destroy();\r\n this._datatable = null;\r\n }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the data table\r\n var table = gd_sprest_bs_1.Components.Table({\r\n className: this._props.className,\r\n el: this._props.el,\r\n rows: rows,\r\n columns: this._props.columns\r\n });\r\n // Apply the plugin\r\n this.applyPlugin(table);\r\n };\r\n // Searches the datatable\r\n DataTable.prototype.search = function (value) {\r\n if (value === void 0) { value = \"\"; }\r\n // Search the table\r\n this._datatable.search(value).draw();\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?");
251
251
 
252
252
  /***/ }),
253
253
 
@@ -258,7 +258,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
258
258
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
259
259
 
260
260
  "use strict";
261
- 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.96/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._activeFilterValue = null;\r\n this._activeSearchValue = 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(this._props.items);\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (values) {\r\n this._activeFilterValue = values ? values.join('|') : \"\";\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 // Generate the card properties\r\n Tiles.prototype.generateCard = function (item) {\r\n var _this = this;\r\n var filterValues = [];\r\n // See if the filter field is specified\r\n if (this._props.filterFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.filterFields.length; i++) {\r\n var filterField = this._props.filterFields[i];\r\n // Get the filter values\r\n var filters = item[filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // Append the values\r\n filterValues = filterValues.concat(filters);\r\n }\r\n }\r\n // See if the body fields exist\r\n var bodyContent = this._props.bodyTemplate || \"\";\r\n if (this._props.bodyFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.bodyFields.length; i++) {\r\n var field = this._props.bodyFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.bodyTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n bodyContent = bodyContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n bodyContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var subTitleContent = this._props.subTitleTemplate || \"\";\r\n if (this._props.subTitleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.subTitleFields.length; i++) {\r\n var field = this._props.subTitleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.subTitleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n subTitleContent = subTitleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n subTitleContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var titleContent = this._props.titleTemplate || \"\";\r\n if (this._props.titleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.titleFields.length; i++) {\r\n var field = this._props.titleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.titleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n titleContent = titleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n titleContent += value;\r\n }\r\n }\r\n }\r\n // Set the card props\r\n var cardProps = {\r\n onRender: function (el, card) {\r\n // See if filters exist\r\n if (filterValues && filterValues.length > 0) {\r\n // Set the data filter value\r\n el.setAttribute(\"data-filter\", filterValues.join('|'));\r\n }\r\n // Call the event\r\n _this._props.onCardRendered ? _this._props.onCardRendered(el, card) : null;\r\n },\r\n body: [{\r\n content: bodyContent,\r\n data: item,\r\n subTitle: subTitleContent,\r\n title: titleContent,\r\n onClick: function (card, ev) {\r\n // Call the event\r\n _this._props.onClick ? _this._props.onClick(ev.currentTarget, card) : null;\r\n },\r\n onRender: function (el, card) {\r\n var item = card.data;\r\n // Call the events\r\n _this._props.onTitleRendered ? _this._props.onTitleRendered(el.querySelector(\".card-title\"), item) : null;\r\n _this._props.onSubTitleRendered ? _this._props.onSubTitleRendered(el.querySelector(\".card-subtitle\"), item) : null;\r\n _this._props.onBodyRendered ? _this._props.onBodyRendered(el, item) : null;\r\n }\r\n }]\r\n };\r\n // See if we are showing the header\r\n var showHeader = typeof (this._props.showHeader) === \"boolean\" ? this._props.showHeader : true;\r\n if (showHeader) {\r\n cardProps.header = {\r\n onRender: function (el) {\r\n _this._props.onHeaderRendered ? _this._props.onHeaderRendered(el, item) : null;\r\n }\r\n };\r\n }\r\n // See if we are showing the footer\r\n var showFooter = typeof (this._props.showFooter) === \"boolean\" ? this._props.showFooter : true;\r\n if (showFooter) {\r\n cardProps.footer = {\r\n onRender: function (el) {\r\n _this._props.onFooterRendered ? _this._props.onFooterRendered(el, item) : null;\r\n }\r\n };\r\n }\r\n // Call the event\r\n this._props.onCardRendering ? this._props.onCardRendering(cardProps) : null;\r\n // Return the card properties\r\n return cardProps;\r\n };\r\n // Method to reload the data\r\n Tiles.prototype.refresh = function (items) {\r\n if (items === void 0) { items = []; }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the accordion\r\n this.render(items);\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function (items) {\r\n // Render the tile\r\n this.renderTiles(items);\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function (items) {\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < items.length; i++) {\r\n var item = items[i];\r\n // Add an tile\r\n cards.push(this.generateCard(item));\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 || 4,\r\n onColRender: this._props.onColumnRendered\r\n });\r\n };\r\n // Updates the visibility of the tiles\r\n Tiles.prototype.updateTiles = 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(\".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(\".card\"));\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 a filter value exists\r\n if (this._activeFilterValue) {\r\n var filterValues = (elItem.dataset.filter || \"\").split('|');\r\n // Parse the active filters\r\n var activeFilters = this._activeFilterValue.split('|');\r\n var showItem = false;\r\n for (var j = 0; j < activeFilters.length; j++) {\r\n // See if the item contains the filter value\r\n if (filterValues.indexOf(activeFilters[j]) >= 0) {\r\n // Set the flag and break from the loop\r\n showItem = true;\r\n break;\r\n }\r\n }\r\n // See if we are hiding the item\r\n if (!showItem) {\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 // Continue the loop\r\n continue;\r\n }\r\n }\r\n // See if a search value exists\r\n if (this._activeSearchValue) {\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchValue.toLowerCase()) < 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 // Continue the loop\r\n continue;\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 // See if we are showing pagination\r\n var showPagination = typeof (this._props.showPagination) === \"boolean\" ? this._props.showPagination : true;\r\n if (showPagination) {\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 // Call the event\r\n _this._props.onPaginationClick ? _this._props.onPaginationClick(pageNumber) : null;\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRendered ? this._props.onPaginationRendered(elPagination) : null;\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._activeSearchValue = value || \"\";\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?");
261
+ 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.96/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._activeFilterValue = null;\r\n this._activeSearchValue = 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(this._props.items);\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (values) {\r\n this._activeFilterValue = values ? values.join('|') : \"\";\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 // Generate the card properties\r\n Tiles.prototype.generateCard = function (item) {\r\n var _this = this;\r\n var filterValues = [];\r\n // See if the filter field is specified\r\n if (this._props.filterFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.filterFields.length; i++) {\r\n var filterField = this._props.filterFields[i];\r\n // Get the filter values\r\n var filters = item[filterField] || [];\r\n filters = filters[\"results\"] || [filters];\r\n // Append the values\r\n filterValues = filterValues.concat(filters);\r\n }\r\n }\r\n // See if the body fields exist\r\n var bodyContent = this._props.bodyTemplate || \"\";\r\n if (this._props.bodyFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.bodyFields.length; i++) {\r\n var field = this._props.bodyFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.bodyTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n bodyContent = bodyContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n bodyContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var subTitleContent = this._props.subTitleTemplate || \"\";\r\n if (this._props.subTitleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.subTitleFields.length; i++) {\r\n var field = this._props.subTitleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.subTitleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n subTitleContent = subTitleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n subTitleContent += value;\r\n }\r\n }\r\n }\r\n // See if the sub-title fields exist\r\n var titleContent = this._props.titleTemplate || \"\";\r\n if (this._props.titleFields) {\r\n // Parse the fields\r\n for (var i = 0; i < this._props.titleFields.length; i++) {\r\n var field = this._props.titleFields[i];\r\n var value = item[field] || \"\";\r\n // See if there is a template\r\n if (this._props.titleTemplate) {\r\n // Replace the values\r\n var pattern = new RegExp(\"({\" + field + \"})\", \"g\");\r\n titleContent = titleContent.replace(pattern, value);\r\n }\r\n else {\r\n // Append the value\r\n titleContent += value;\r\n }\r\n }\r\n }\r\n // Set the card props\r\n var cardProps = {\r\n onRender: function (el, card) {\r\n // See if filters exist\r\n if (filterValues && filterValues.length > 0) {\r\n // Set the data filter value\r\n el.setAttribute(\"data-filter\", filterValues.join('|'));\r\n }\r\n // Call the event\r\n _this._props.onCardRendered ? _this._props.onCardRendered(el, card) : null;\r\n },\r\n body: [{\r\n content: bodyContent,\r\n data: item,\r\n subTitle: subTitleContent,\r\n title: titleContent,\r\n onClick: function (card, ev) {\r\n // Call the event\r\n _this._props.onClick ? _this._props.onClick(ev.currentTarget, card) : null;\r\n },\r\n onRender: function (el, card) {\r\n var item = card.data;\r\n // Call the events\r\n _this._props.onTitleRendered ? _this._props.onTitleRendered(el.querySelector(\".card-title\"), item) : null;\r\n _this._props.onSubTitleRendered ? _this._props.onSubTitleRendered(el.querySelector(\".card-subtitle\"), item) : null;\r\n _this._props.onBodyRendered ? _this._props.onBodyRendered(el, item) : null;\r\n }\r\n }]\r\n };\r\n // See if we are showing the header\r\n var showHeader = typeof (this._props.showHeader) === \"boolean\" ? this._props.showHeader : true;\r\n if (showHeader) {\r\n cardProps.header = {\r\n onRender: function (el) {\r\n _this._props.onHeaderRendered ? _this._props.onHeaderRendered(el, item) : null;\r\n }\r\n };\r\n }\r\n // See if we are showing the footer\r\n var showFooter = typeof (this._props.showFooter) === \"boolean\" ? this._props.showFooter : true;\r\n if (showFooter) {\r\n cardProps.footer = {\r\n onRender: function (el) {\r\n _this._props.onFooterRendered ? _this._props.onFooterRendered(el, item) : null;\r\n }\r\n };\r\n }\r\n // Call the event\r\n this._props.onCardRendering ? this._props.onCardRendering(cardProps) : null;\r\n // Return the card properties\r\n return cardProps;\r\n };\r\n // Method to reload the data\r\n Tiles.prototype.refresh = function (items) {\r\n if (items === void 0) { items = []; }\r\n // Clear the datatable element\r\n while (this._props.el.firstChild) {\r\n this._props.el.removeChild(this._props.el.firstChild);\r\n }\r\n // Render the accordion\r\n this.render(items);\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function (items) {\r\n // Render the tile\r\n this.renderTiles(items);\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function (items) {\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < items.length; i++) {\r\n var item = items[i];\r\n // Add an tile\r\n cards.push(this.generateCard(item));\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 className: this._props.className,\r\n colSize: this._props.colSize || 4,\r\n onColRender: this._props.onColumnRendered\r\n });\r\n };\r\n // Updates the visibility of the tiles\r\n Tiles.prototype.updateTiles = 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(\".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(\".card\"));\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 a filter value exists\r\n if (this._activeFilterValue) {\r\n var filterValues = (elItem.dataset.filter || \"\").split('|');\r\n // Parse the active filters\r\n var activeFilters = this._activeFilterValue.split('|');\r\n var showItem = false;\r\n for (var j = 0; j < activeFilters.length; j++) {\r\n // See if the item contains the filter value\r\n if (filterValues.indexOf(activeFilters[j]) >= 0) {\r\n // Set the flag and break from the loop\r\n showItem = true;\r\n break;\r\n }\r\n }\r\n // See if we are hiding the item\r\n if (!showItem) {\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 // Continue the loop\r\n continue;\r\n }\r\n }\r\n // See if a search value exists\r\n if (this._activeSearchValue) {\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchValue.toLowerCase()) < 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 // Continue the loop\r\n continue;\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 // See if we are showing pagination\r\n var showPagination = typeof (this._props.showPagination) === \"boolean\" ? this._props.showPagination : true;\r\n if (showPagination) {\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 // Call the event\r\n _this._props.onPaginationClick ? _this._props.onPaginationClick(pageNumber) : null;\r\n }\r\n });\r\n // Call the event\r\n this._props.onPaginationRendered ? this._props.onPaginationRendered(elPagination) : null;\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._activeSearchValue = value || \"\";\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?");
262
262
 
263
263
  /***/ }),
264
264