dattatable 2.11.63 → 2.11.64
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/index.d.ts +1 -1
- package/build/dashboard/index.js +3 -0
- package/dist/dattatable.js +1 -1
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.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 +5 -5
- 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/ListConfig.html +2 -2
- 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/ICreateLookupData.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/IGenerateLookupDataProps.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/IItemFormSaveProps.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/IListConfig.html +2 -2
- package/docs/interfaces/IListConfigProps.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/ILookupData.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/interfaces/IValidateLookupsProps.html +2 -2
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +1 -1
|
@@ -161,5 +161,5 @@ export declare class Dashboard {
|
|
|
161
161
|
setFilterValue(key: string, value?: string | string[]): void;
|
|
162
162
|
showFilter(): void;
|
|
163
163
|
updateCell(row: number, column: number, value: any): void;
|
|
164
|
-
updateRow
|
|
164
|
+
updateRow(rowIdx: number, data: any): void;
|
|
165
165
|
}
|
package/build/dashboard/index.js
CHANGED
|
@@ -438,6 +438,9 @@ var Dashboard = /** @class */ (function () {
|
|
|
438
438
|
Dashboard.prototype.showFilter = function () { this._filters.show(); };
|
|
439
439
|
// Updates a cell in the data table
|
|
440
440
|
Dashboard.prototype.updateCell = function (row, column, value) { var _a; (_a = this._dt) === null || _a === void 0 ? void 0 : _a.updateCell(row, column, value); };
|
|
441
|
+
// Updates a row in the data table
|
|
442
|
+
Dashboard.prototype.updateRow = function (rowIdx, data) { var _a; (_a = this._dt) === null || _a === void 0 ? void 0 : _a.updateRow(rowIdx, data); };
|
|
443
|
+
;
|
|
441
444
|
return Dashboard;
|
|
442
445
|
}());
|
|
443
446
|
exports.Dashboard = Dashboard;
|
package/dist/dattatable.js
CHANGED
|
@@ -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.15.59_@popperjs+core@2.11.8/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);\r\n }\r\n else {\r\n // Filter the tiles\r\n _this._tiles.filter(values);\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, useAndOperator) {\r\n if (useAndOperator === void 0) { useAndOperator = false; }\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, useAndOperator);\r\n }\r\n };\r\n // Filter the table by multiple values\r\n Dashboard.prototype.filterMulti = function (idx, values, exactMatchFl) {\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 exactMatchFl && values.length > 0 ? this._dt.filterMultiExact(idx, values) : this._dt.filterMulti(idx, values);\r\n }\r\n };\r\n // Filter the tiles\r\n Dashboard.prototype.filterTiles = function (values, useAndOperator) {\r\n if (useAndOperator === void 0) { useAndOperator = false; }\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, useAndOperator);\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 // Updates a cell in the data table\r\n Dashboard.prototype.updateCell = function (row, column, value) { var _a; (_a = this._dt) === null || _a === void 0 ? void 0 : _a.updateCell(row, column, value); };\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.15.59_@popperjs+core@2.11.8/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);\r\n }\r\n else {\r\n // Filter the tiles\r\n _this._tiles.filter(values);\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, useAndOperator) {\r\n if (useAndOperator === void 0) { useAndOperator = false; }\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, useAndOperator);\r\n }\r\n };\r\n // Filter the table by multiple values\r\n Dashboard.prototype.filterMulti = function (idx, values, exactMatchFl) {\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 exactMatchFl && values.length > 0 ? this._dt.filterMultiExact(idx, values) : this._dt.filterMulti(idx, values);\r\n }\r\n };\r\n // Filter the tiles\r\n Dashboard.prototype.filterTiles = function (values, useAndOperator) {\r\n if (useAndOperator === void 0) { useAndOperator = false; }\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, useAndOperator);\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 // Updates a cell in the data table\r\n Dashboard.prototype.updateCell = function (row, column, value) { var _a; (_a = this._dt) === null || _a === void 0 ? void 0 : _a.updateCell(row, column, value); };\r\n // Updates a row in the data table\r\n Dashboard.prototype.updateRow = function (rowIdx, data) { var _a; (_a = this._dt) === null || _a === void 0 ? void 0 : _a.updateRow(rowIdx, data); };\r\n ;\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
|
|