dattatable 2.11.88 → 2.11.90

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 (69) hide show
  1. package/build/dashboard/filter.d.ts +1 -1
  2. package/build/dashboard/filter.js +4 -4
  3. package/build/dashboard/table.js +1 -1
  4. package/dist/dattatable.js +2 -2
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +3 -3
  12. package/docs/classes/Documents.html +6 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -2
  17. package/docs/classes/ItemForm.html +5 -5
  18. package/docs/classes/List.html +4 -4
  19. package/docs/classes/ListConfig.html +2 -2
  20. package/docs/classes/ListSecurity.html +2 -2
  21. package/docs/classes/LoadingDialog.html +2 -2
  22. package/docs/classes/Modal.html +2 -2
  23. package/docs/classes/Navigation.html +3 -3
  24. package/docs/classes/Tiles.html +2 -2
  25. package/docs/classes/Timeout.html +2 -2
  26. package/docs/enums/ActionButtonTypes.html +2 -2
  27. package/docs/functions/formatBytes.html +1 -1
  28. package/docs/functions/formatDateValue.html +1 -1
  29. package/docs/functions/formatTimeValue.html +1 -1
  30. package/docs/functions/getContextInfo.html +1 -1
  31. package/docs/functions/getFileExt.html +1 -1
  32. package/docs/functions/waitForTheme.html +1 -1
  33. package/docs/interfaces/IAccordion.html +2 -2
  34. package/docs/interfaces/IAccordionProps.html +2 -2
  35. package/docs/interfaces/IAuditLogItem.html +2 -2
  36. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  37. package/docs/interfaces/IAuditLogProps.html +2 -2
  38. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  39. package/docs/interfaces/ICommentsItem.html +2 -2
  40. package/docs/interfaces/ICreateLookupData.html +2 -2
  41. package/docs/interfaces/IDashboardProps.html +2 -2
  42. package/docs/interfaces/IDataTable.html +2 -2
  43. package/docs/interfaces/IDataTableProps.html +2 -2
  44. package/docs/interfaces/IDocumentsProps.html +2 -2
  45. package/docs/interfaces/IFilterItem.html +2 -2
  46. package/docs/interfaces/IFilterProps.html +2 -2
  47. package/docs/interfaces/IFooterProps.html +2 -2
  48. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  49. package/docs/interfaces/IHeaderProps.html +2 -2
  50. package/docs/interfaces/IInstallProps.html +2 -2
  51. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  52. package/docs/interfaces/IItemFormEditProps.html +2 -2
  53. package/docs/interfaces/IItemFormSaveProps.html +2 -2
  54. package/docs/interfaces/IItemFormTab.html +2 -2
  55. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  56. package/docs/interfaces/IItemFormViewProps.html +2 -2
  57. package/docs/interfaces/IListConfig.html +2 -2
  58. package/docs/interfaces/IListConfigProps.html +2 -2
  59. package/docs/interfaces/IListProps.html +2 -2
  60. package/docs/interfaces/IListSecurity.html +2 -2
  61. package/docs/interfaces/IListSecurityItem.html +2 -2
  62. package/docs/interfaces/ILookupData.html +2 -2
  63. package/docs/interfaces/IShowDialogProps.html +2 -2
  64. package/docs/interfaces/ITiles.html +2 -2
  65. package/docs/interfaces/ITilesProps.html +2 -2
  66. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  67. package/docs/variables/DattaTable.html +1 -1
  68. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  69. package/package.json +1 -1
@@ -6,7 +6,7 @@ export interface IFilterItem {
6
6
  header: string;
7
7
  items: Components.ICheckboxGroupItem[];
8
8
  multi?: boolean;
9
- onFilter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
9
+ onFilter?: (value: string | string[], item?: Components.ICheckboxGroupItem, selectedItems?: Components.ICheckboxGroupItem[]) => void;
10
10
  onSetFilterValue?: (value?: string | string[], item?: Components.ICheckboxGroupItem | Components.ICheckboxGroupItem[]) => string | string[];
11
11
  }
12
12
  /**
@@ -98,16 +98,16 @@ var FilterSlideout = /** @class */ (function () {
98
98
  }
99
99
  // Execute the events
100
100
  values = filter.onSetFilterValue ? filter.onSetFilterValue(values, selectedCheckboxes) : values;
101
- filter.onFilter ? filter.onFilter(values, item) : null;
102
- _this._onFilter ? _this._onFilter(values, item) : null;
101
+ filter.onFilter ? filter.onFilter(values, item, selectedCheckboxes) : null;
102
+ _this._onFilter ? _this._onFilter(values, item, selectedCheckboxes) : null;
103
103
  }
104
104
  else {
105
105
  var item_1 = selectedCheckboxes;
106
106
  var filterValue = item_1 ? item_1.label : "";
107
107
  // Execute the events
108
108
  filterValue = filter.onSetFilterValue ? filter.onSetFilterValue(filterValue, selectedCheckboxes) : filterValue;
109
- filter.onFilter ? filter.onFilter(filterValue, item_1) : null;
110
- _this._onFilter ? _this._onFilter(filterValue, item_1) : null;
109
+ filter.onFilter ? filter.onFilter(filterValue, item_1, [item_1]) : null;
110
+ _this._onFilter ? _this._onFilter(filterValue, item_1, [item_1]) : null;
111
111
  }
112
112
  }
113
113
  }));
@@ -47,7 +47,7 @@ var DataTable = /** @class */ (function () {
47
47
  DataTable.prototype.applyPlugin = function (table) {
48
48
  var _this = this;
49
49
  // Call the rendering event
50
- this._props.dtProps = this.getDefaultProperties(this._props.dtProps);
50
+ this._props.dtProps = this.getDefaultProperties(this._props);
51
51
  this._props.dtProps = this._props.onRendering ? this._props.onRendering(this._props.dtProps) : this._props.dtProps;
52
52
  // Render the datatable
53
53
  this._datatable = new datatables_net_1.DataTable(table.el, this._props.dtProps);
@@ -192,7 +192,7 @@ eval("{\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\
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.15.92_@popperjs+core@2.11.8/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.15.92_@popperjs+core@2.11.8/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?\n}");
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.15.92_@popperjs+core@2.11.8/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.15.92_@popperjs+core@2.11.8/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, selectedCheckboxes) : null;\r\n _this._onFilter ? _this._onFilter(values, item, selectedCheckboxes) : 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, [item_1]) : null;\r\n _this._onFilter ? _this._onFilter(filterValue, item_1, [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?\n}");
196
196
 
197
197
  /***/ },
198
198
 
@@ -247,7 +247,7 @@ eval("{\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\
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 datatables_net_1 = __webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@3.0.0/node_modules/datatables.net/js/dataTables.min.js\");\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.15.92_@popperjs+core@2.11.8/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@3.0.0/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._addRowItems = [];\r\n this._datatable = null;\r\n this._props = null;\r\n this._table = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Adds row(s) to the table\r\n DataTable.prototype.addRow = function (row) {\r\n var _this = this;\r\n // Set the rows array\r\n (typeof (row.length) === \"number\" ? row : [row]).forEach(function (row) {\r\n var newRow = [];\r\n // Parse the columns\r\n for (var i = 0; i < _this._props.columns.length; i++) {\r\n var column = _this._props.columns[i];\r\n var value = typeof (row[column.name]) != \"undefined\" ? row[column.name] : \"\";\r\n // Append the value\r\n newRow.push(value);\r\n }\r\n // Save a reference to the original data for the event\r\n var uniqueId = Date.now();\r\n newRow.push(uniqueId);\r\n _this._addRowItems.push({ rowId: uniqueId, row: row });\r\n // Add the row\r\n _this._datatable.row.add(newRow);\r\n });\r\n // Refresh the table\r\n this._datatable.draw(false);\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.getDefaultProperties(this._props.dtProps);\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 = new datatables_net_1.DataTable(table.el, 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 DataTable.prototype.getDefaultProperties = function (props) {\r\n var _this = this;\r\n // Return the default properties\r\n return (props === null || props === void 0 ? void 0 : props.dtProps) || {\r\n columnDefs: [{\r\n targets: \"_all\",\r\n render: function (data, type, row, meta) {\r\n // See if we are sorting\r\n if (type == \"sort\") {\r\n // Get the cell element\r\n var elCell = meta.settings.data[meta.row].cells ? meta.settings.data[meta.row].cells[meta.col] : null;\r\n if (elCell) {\r\n // Return the order/sort attribute, inner html or data value\r\n return elCell.getAttribute(\"data-order\") || elCell.getAttribute(\"data-sort\") || elCell.innerText || data;\r\n }\r\n }\r\n return data;\r\n }\r\n }],\r\n // This will call the render event if the addRow method is used\r\n createdRow: function (row, data, dataIndex) {\r\n // Get the row\r\n var rowId = data[data.length - 1];\r\n var rowItem = null;\r\n for (var i = 0; i < _this._addRowItems.length; i++) {\r\n // See if this is the target row\r\n if (_this._addRowItems[i].rowId == rowId) {\r\n // Remove it from the array\r\n rowItem = _this._addRowItems.splice(i, 1)[0].row;\r\n break;\r\n }\r\n }\r\n // See if the row item was found, otherwise it wasn't rendered from the addRows function\r\n if (rowItem) {\r\n var colIdx = 0;\r\n // Parse the columns\r\n for (var i = 0; i < _this._props.columns.length; i++) {\r\n var column = _this._props.columns[i];\r\n // Skip if this column is hidden\r\n if (_this._datatable.column(i).visible() === false) {\r\n continue;\r\n }\r\n // See if an event exists\r\n if (column.onRenderCell) {\r\n // Call it\r\n column.onRenderCell(row.children[colIdx], column, rowItem || data, dataIndex);\r\n }\r\n // Increment the column index\r\n // Hidden columns will not have a child reference\r\n colIdx++;\r\n }\r\n }\r\n },\r\n drawCallback: function (settings) {\r\n // Get the table element\r\n var elTable = settings.api.context[0].table;\r\n if (elTable) {\r\n // Styling option for striped rows\r\n elTable.classList.add('table-striped');\r\n }\r\n // Get the table wrapper element\r\n var elTableWrapper = settings.api.context[0].tableWrapper;\r\n if (elTableWrapper) {\r\n // Align the text to be centered\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('col-md');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('d-md-flex');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('justify-content-between');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('align-items-center');\r\n elTableWrapper.querySelector('.dt-info').classList.add('text-center');\r\n // Remove the label spacing to align with paging\r\n elTableWrapper.querySelector('.dt-length label').classList.add('d-none');\r\n // Push paging to the end\r\n elTableWrapper.querySelector('.dt-paging').classList.add('d-flex');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('justify-content-end');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('mx-0');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('px-0');\r\n // Add spacing for the footer\r\n elTableWrapper.querySelector('.row :last-child').classList.add('mb-1');\r\n }\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 };\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 // Filters multiple values against the status\r\n DataTable.prototype.filterMultiExact = 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._datatable.column(idx).search(\"^(\" + values.join('|') + \")$\", true, false).draw();\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 this._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(this._table);\r\n };\r\n // Removes a row by index\r\n DataTable.prototype.removeRow = function (rowIdx) {\r\n // Remove the row by index\r\n this._datatable.row(rowIdx).draw(false);\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 // Updates a cell in the datatable\r\n DataTable.prototype.updateCell = function (row, column, value) {\r\n // Update the cell\r\n var elCell = this._datatable.cell({ row: row, column: column }).node();\r\n if (elCell) {\r\n // Update the cell\r\n this._table.updateColumn(elCell, column, value);\r\n }\r\n else {\r\n // Update the cell\r\n this._datatable.cell({ row: row, column: column }).data(value).draw(false);\r\n }\r\n };\r\n // Updates a row in the datatable\r\n DataTable.prototype.updateRow = function (rowIdx, data) {\r\n var _this = this;\r\n // Update the row\r\n var elRow = this._datatable.row(rowIdx).node();\r\n if (elRow) {\r\n // Set the hidden columns\r\n var hiddenColIndexes_1 = [];\r\n this._datatable.columns().every(function (idx) {\r\n // See if the column is hidden\r\n if (_this._datatable.column(idx).visible() === false) {\r\n // Add the index\r\n hiddenColIndexes_1.push(idx);\r\n }\r\n });\r\n // Update the row\r\n this._table.updateRow(elRow, data, hiddenColIndexes_1);\r\n // Update the datatable\r\n this._datatable.draw(false);\r\n }\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?\n}");
250
+ eval("{\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataTable = void 0;\r\nvar datatables_net_1 = __webpack_require__(/*! datatables.net */ \"./node_modules/.pnpm/datatables.net@3.0.0/node_modules/datatables.net/js/dataTables.min.js\");\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.15.92_@popperjs+core@2.11.8/node_modules/gd-sprest-bs/build/index.js\");\r\n// DataTables.net\r\n__webpack_require__(/*! datatables.net-bs5 */ \"./node_modules/.pnpm/datatables.net-bs5@3.0.0/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._addRowItems = [];\r\n this._datatable = null;\r\n this._props = null;\r\n this._table = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the table\r\n this.refresh(props.rows);\r\n }\r\n // Adds row(s) to the table\r\n DataTable.prototype.addRow = function (row) {\r\n var _this = this;\r\n // Set the rows array\r\n (typeof (row.length) === \"number\" ? row : [row]).forEach(function (row) {\r\n var newRow = [];\r\n // Parse the columns\r\n for (var i = 0; i < _this._props.columns.length; i++) {\r\n var column = _this._props.columns[i];\r\n var value = typeof (row[column.name]) != \"undefined\" ? row[column.name] : \"\";\r\n // Append the value\r\n newRow.push(value);\r\n }\r\n // Save a reference to the original data for the event\r\n var uniqueId = Date.now();\r\n newRow.push(uniqueId);\r\n _this._addRowItems.push({ rowId: uniqueId, row: row });\r\n // Add the row\r\n _this._datatable.row.add(newRow);\r\n });\r\n // Refresh the table\r\n this._datatable.draw(false);\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.getDefaultProperties(this._props);\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 = new datatables_net_1.DataTable(table.el, 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 DataTable.prototype.getDefaultProperties = function (props) {\r\n var _this = this;\r\n // Return the default properties\r\n return (props === null || props === void 0 ? void 0 : props.dtProps) || {\r\n columnDefs: [{\r\n targets: \"_all\",\r\n render: function (data, type, row, meta) {\r\n // See if we are sorting\r\n if (type == \"sort\") {\r\n // Get the cell element\r\n var elCell = meta.settings.data[meta.row].cells ? meta.settings.data[meta.row].cells[meta.col] : null;\r\n if (elCell) {\r\n // Return the order/sort attribute, inner html or data value\r\n return elCell.getAttribute(\"data-order\") || elCell.getAttribute(\"data-sort\") || elCell.innerText || data;\r\n }\r\n }\r\n return data;\r\n }\r\n }],\r\n // This will call the render event if the addRow method is used\r\n createdRow: function (row, data, dataIndex) {\r\n // Get the row\r\n var rowId = data[data.length - 1];\r\n var rowItem = null;\r\n for (var i = 0; i < _this._addRowItems.length; i++) {\r\n // See if this is the target row\r\n if (_this._addRowItems[i].rowId == rowId) {\r\n // Remove it from the array\r\n rowItem = _this._addRowItems.splice(i, 1)[0].row;\r\n break;\r\n }\r\n }\r\n // See if the row item was found, otherwise it wasn't rendered from the addRows function\r\n if (rowItem) {\r\n var colIdx = 0;\r\n // Parse the columns\r\n for (var i = 0; i < _this._props.columns.length; i++) {\r\n var column = _this._props.columns[i];\r\n // Skip if this column is hidden\r\n if (_this._datatable.column(i).visible() === false) {\r\n continue;\r\n }\r\n // See if an event exists\r\n if (column.onRenderCell) {\r\n // Call it\r\n column.onRenderCell(row.children[colIdx], column, rowItem || data, dataIndex);\r\n }\r\n // Increment the column index\r\n // Hidden columns will not have a child reference\r\n colIdx++;\r\n }\r\n }\r\n },\r\n drawCallback: function (settings) {\r\n // Get the table element\r\n var elTable = settings.api.context[0].table;\r\n if (elTable) {\r\n // Styling option for striped rows\r\n elTable.classList.add('table-striped');\r\n }\r\n // Get the table wrapper element\r\n var elTableWrapper = settings.api.context[0].tableWrapper;\r\n if (elTableWrapper) {\r\n // Align the text to be centered\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('col-md');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('d-md-flex');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('justify-content-between');\r\n elTableWrapper.querySelector('.dt-info').parentElement.classList.remove('align-items-center');\r\n elTableWrapper.querySelector('.dt-info').classList.add('text-center');\r\n // Remove the label spacing to align with paging\r\n elTableWrapper.querySelector('.dt-length label').classList.add('d-none');\r\n // Push paging to the end\r\n elTableWrapper.querySelector('.dt-paging').classList.add('d-flex');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('justify-content-end');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('mx-0');\r\n elTableWrapper.querySelector('.dt-paging').classList.add('px-0');\r\n // Add spacing for the footer\r\n elTableWrapper.querySelector('.row :last-child').classList.add('mb-1');\r\n }\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 };\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 // Filters multiple values against the status\r\n DataTable.prototype.filterMultiExact = 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._datatable.column(idx).search(\"^(\" + values.join('|') + \")$\", true, false).draw();\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 this._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(this._table);\r\n };\r\n // Removes a row by index\r\n DataTable.prototype.removeRow = function (rowIdx) {\r\n // Remove the row by index\r\n this._datatable.row(rowIdx).draw(false);\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 // Updates a cell in the datatable\r\n DataTable.prototype.updateCell = function (row, column, value) {\r\n // Update the cell\r\n var elCell = this._datatable.cell({ row: row, column: column }).node();\r\n if (elCell) {\r\n // Update the cell\r\n this._table.updateColumn(elCell, column, value);\r\n }\r\n else {\r\n // Update the cell\r\n this._datatable.cell({ row: row, column: column }).data(value).draw(false);\r\n }\r\n };\r\n // Updates a row in the datatable\r\n DataTable.prototype.updateRow = function (rowIdx, data) {\r\n var _this = this;\r\n // Update the row\r\n var elRow = this._datatable.row(rowIdx).node();\r\n if (elRow) {\r\n // Set the hidden columns\r\n var hiddenColIndexes_1 = [];\r\n this._datatable.columns().every(function (idx) {\r\n // See if the column is hidden\r\n if (_this._datatable.column(idx).visible() === false) {\r\n // Add the index\r\n hiddenColIndexes_1.push(idx);\r\n }\r\n });\r\n // Update the row\r\n this._table.updateRow(elRow, data, hiddenColIndexes_1);\r\n // Update the datatable\r\n this._datatable.draw(false);\r\n }\r\n };\r\n return DataTable;\r\n}());\r\nexports.DataTable = DataTable;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/table.js?\n}");
251
251
 
252
252
  /***/ },
253
253