dattatable 2.9.50 → 2.9.51
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.
- package/build/dashboard/tiles.js +7 -6
- package/dist/dattatable.js +1 -1
- package/dist/dattatable.min.js +1 -1
- package/docs/classes/Accordion.html +2 -2
- package/docs/classes/AuditLog.html +2 -2
- package/docs/classes/CanvasForm.html +2 -2
- package/docs/classes/Comments.html +2 -2
- package/docs/classes/Dashboard.html +4 -4
- package/docs/classes/DataTable.html +3 -3
- package/docs/classes/Documents.html +6 -6
- package/docs/classes/FilterSlideout.html +2 -2
- package/docs/classes/Footer.html +2 -2
- package/docs/classes/Header.html +2 -2
- package/docs/classes/InstallationRequired.html +2 -2
- package/docs/classes/ItemForm.html +4 -4
- package/docs/classes/List.html +4 -4
- package/docs/classes/ListSecurity.html +2 -2
- package/docs/classes/LoadingDialog.html +2 -2
- package/docs/classes/Modal.html +2 -2
- package/docs/classes/Navigation.html +3 -3
- package/docs/classes/Tiles.html +2 -2
- package/docs/classes/Timeout.html +2 -2
- package/docs/enums/ActionButtonTypes.html +2 -2
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getContextInfo.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/functions/waitForTheme.html +1 -1
- package/docs/interfaces/IAccordion.html +2 -2
- package/docs/interfaces/IAccordionProps.html +2 -2
- package/docs/interfaces/IAuditLogItem.html +2 -2
- package/docs/interfaces/IAuditLogItemCreation.html +2 -2
- package/docs/interfaces/IAuditLogProps.html +2 -2
- package/docs/interfaces/IAuditLogViewProps.html +2 -2
- package/docs/interfaces/ICommentsItem.html +2 -2
- package/docs/interfaces/IDashboardProps.html +2 -2
- package/docs/interfaces/IDataTable.html +2 -2
- package/docs/interfaces/IDataTableProps.html +2 -2
- package/docs/interfaces/IDocumentsProps.html +2 -2
- package/docs/interfaces/IFilterItem.html +2 -2
- package/docs/interfaces/IFilterProps.html +2 -2
- package/docs/interfaces/IFooterProps.html +2 -2
- package/docs/interfaces/IHeaderProps.html +2 -2
- package/docs/interfaces/IInstallProps.html +2 -2
- package/docs/interfaces/IItemFormCreateProps.html +2 -2
- package/docs/interfaces/IItemFormEditProps.html +2 -2
- package/docs/interfaces/IItemFormTab.html +2 -2
- package/docs/interfaces/IItemFormTabInfo.html +2 -2
- package/docs/interfaces/IItemFormViewProps.html +2 -2
- package/docs/interfaces/IListProps.html +2 -2
- package/docs/interfaces/IListSecurity.html +2 -2
- package/docs/interfaces/IListSecurityItem.html +2 -2
- package/docs/interfaces/IShowDialogProps.html +2 -2
- package/docs/interfaces/ITiles.html +2 -2
- package/docs/interfaces/ITilesProps.html +2 -2
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +1 -1
package/build/dashboard/tiles.js
CHANGED
|
@@ -65,15 +65,16 @@ var Tiles = /** @class */ (function () {
|
|
|
65
65
|
className: itemClassNames.join(" "),
|
|
66
66
|
body: [{
|
|
67
67
|
content: (this._props.bodyField ? item[this._props.bodyField || "Description"] : null) || "",
|
|
68
|
-
data:
|
|
68
|
+
data: item,
|
|
69
69
|
subTitle: item[this._props.subTitleField] || "",
|
|
70
70
|
title: item[this._props.titleField || "Title"] || "",
|
|
71
|
-
onRender: function (el) {
|
|
71
|
+
onRender: function (el, card) {
|
|
72
|
+
var item = card.data;
|
|
72
73
|
// Call the events
|
|
73
|
-
_this._props.
|
|
74
|
-
_this._props.
|
|
75
|
-
_this._props.
|
|
76
|
-
_this._props.
|
|
74
|
+
_this._props.onTitleRender ? _this._props.onTitleRender(el.querySelector(".card-title"), item) : null;
|
|
75
|
+
_this._props.onSubTitleRender ? _this._props.onSubTitleRender(el.querySelector(".card-subtitle"), item) : null;
|
|
76
|
+
_this._props.onBodyRender ? _this._props.onBodyRender(el.querySelector(".card-text"), item) : null;
|
|
77
|
+
_this._props.onCardRender ? _this._props.onCardRender(el.querySelector(".card-body"), item) : null;
|
|
77
78
|
}
|
|
78
79
|
}]
|
|
79
80
|
});
|
package/dist/dattatable.js
CHANGED
|
@@ -247,7 +247,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
247
247
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
248
248
|
|
|
249
249
|
"use strict";
|
|
250
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tiles = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.99/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Tiles\r\n */\r\nvar Tiles = /** @class */ (function () {\r\n // Constructor\r\n function Tiles(props) {\r\n this._tiles = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the tile\r\n this.render();\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all tile items\r\n var items = this._props.el.querySelectorAll(\".card\");\r\n for (var i = 0; i < items.length; i++) {\r\n var elItem = items[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function () {\r\n // Render the tile\r\n this.renderTiles();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function () {\r\n var _this = this;\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // Get the filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || filters;\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an tile\r\n cards.push({\r\n className: itemClassNames.join(\" \"),\r\n body: [{\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n data:
|
|
250
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tiles = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.99/node_modules/gd-sprest-bs/build/index.js\");\r\n/**\r\n * Tiles\r\n */\r\nvar Tiles = /** @class */ (function () {\r\n // Constructor\r\n function Tiles(props) {\r\n this._tiles = null;\r\n this._activeFilterClass = null;\r\n this._activeSearchFilter = null;\r\n this._pagination = null;\r\n // Save the properties\r\n this._props = props;\r\n // Render the tile\r\n this.render();\r\n }\r\n // Filters the tile\r\n Tiles.prototype.filter = function (value) {\r\n var className = value ? value.toLowerCase().replace(/ /g, \"-\") : null;\r\n this._activeFilterClass = className;\r\n // Parse all tile items\r\n var items = this._props.el.querySelectorAll(\".card\");\r\n for (var i = 0; i < items.length; i++) {\r\n var elItem = items[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the dashboard\r\n Tiles.prototype.render = function () {\r\n // Render the tile\r\n this.renderTiles();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n // Renders the tiles\r\n Tiles.prototype.renderTiles = function () {\r\n var _this = this;\r\n // Parse the items\r\n var cards = [];\r\n for (var i = 0; i < this._props.items.length; i++) {\r\n var item = this._props.items[i];\r\n var itemClassNames = [];\r\n // Get the filters\r\n var filters = item[this._props.filterField] || [];\r\n filters = filters[\"results\"] || filters;\r\n // See if the filter field is specified\r\n if (this._props.filterField) {\r\n // Parse the selected filters\r\n for (var j = 0; j < filters.length; j++) {\r\n var filter = filters[j].toLowerCase().replace(/ /g, '-');\r\n // Add the filter as a class name\r\n if (filter) {\r\n itemClassNames.push(filter);\r\n }\r\n }\r\n }\r\n // Add an tile\r\n cards.push({\r\n className: itemClassNames.join(\" \"),\r\n body: [{\r\n content: (this._props.bodyField ? item[this._props.bodyField || \"Description\"] : null) || \"\",\r\n data: item,\r\n subTitle: item[this._props.subTitleField] || \"\",\r\n title: item[this._props.titleField || \"Title\"] || \"\",\r\n onRender: function (el, card) {\r\n var item = card.data;\r\n // Call the events\r\n _this._props.onTitleRender ? _this._props.onTitleRender(el.querySelector(\".card-title\"), item) : null;\r\n _this._props.onSubTitleRender ? _this._props.onSubTitleRender(el.querySelector(\".card-subtitle\"), item) : null;\r\n _this._props.onBodyRender ? _this._props.onBodyRender(el.querySelector(\".card-text\"), item) : null;\r\n _this._props.onCardRender ? _this._props.onCardRender(el.querySelector(\".card-body\"), item) : null;\r\n }\r\n }]\r\n });\r\n }\r\n // Render the tiles\r\n this._tiles = gd_sprest_bs_1.Components.CardGroup({\r\n el: this._props.el,\r\n cards: cards\r\n });\r\n };\r\n // Updates the visibility of the tiles\r\n Tiles.prototype.updateTiles = function () {\r\n var paginationLimit = this._props.paginationLimit || 10;\r\n // Get the pagination element\r\n var elPagination = this._props.el.querySelector(\".tiles-pagination\");\r\n if (elPagination) {\r\n // Clear the element\r\n while (elPagination.firstChild) {\r\n elPagination.removeChild(elPagination.firstChild);\r\n }\r\n }\r\n else {\r\n // Create the element\r\n elPagination = document.createElement(\"div\");\r\n elPagination.classList.add(\"tiles-pagination\");\r\n this._props.el.appendChild(elPagination);\r\n }\r\n // Get the elements as an array\r\n var elItems = Array.from(this._tiles.el.querySelectorAll(this._activeFilterClass ? \".\" + this._activeFilterClass : \".card\"));\r\n // See if a search value exists\r\n if (this._activeSearchFilter) {\r\n // Parse the items\r\n for (var i = elItems.length - 1; i >= 0; i--) {\r\n var elItem = elItems[i];\r\n // See if the item doesn't contains the search value\r\n if (elItem.innerText.toLowerCase().indexOf(this._activeSearchFilter) < 0) {\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n // Exclude the item from the array\r\n elItems.splice(i, 1);\r\n }\r\n }\r\n }\r\n // Parse the active items to show\r\n for (var i = 0; i < paginationLimit; i++) {\r\n var elItem = elItems[i];\r\n // Ensure the item exists\r\n if (elItem) {\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n else {\r\n // 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 var elItem = elItems[i];\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n }\r\n // Render the pagination\r\n this._pagination = gd_sprest_bs_1.Components.Pagination({\r\n el: elPagination,\r\n className: \"d-flex justify-content-end pt-2\",\r\n numberOfPages: Math.ceil(elItems.length / paginationLimit),\r\n onClick: function (pageNumber) {\r\n // Parse the items\r\n for (var i = 0; i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Hide the item\r\n elItem.classList.add(\"d-none\");\r\n }\r\n // Parse the items to show\r\n var startIdx = (pageNumber - 1) * paginationLimit;\r\n for (var i = startIdx; i < startIdx + paginationLimit && i < elItems.length; i++) {\r\n var elItem = elItems[i];\r\n // Show the item\r\n elItem.classList.remove(\"d-none\");\r\n }\r\n }\r\n });\r\n };\r\n // Searches the tile\r\n Tiles.prototype.search = function (value) {\r\n // Set the search value\r\n this._activeSearchFilter = (value || \"\").toLowerCase();\r\n // Update the tiles\r\n this.updateTiles();\r\n };\r\n return Tiles;\r\n}());\r\nexports.Tiles = Tiles;\r\n\n\n//# sourceURL=webpack://dattatable/./build/dashboard/tiles.js?");
|
|
251
251
|
|
|
252
252
|
/***/ }),
|
|
253
253
|
|