dattatable 2.9.64 → 2.9.66
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/accordion.d.ts +2 -1
- package/build/dashboard/filter.d.ts +2 -2
- package/build/dashboard/filter.js +4 -4
- package/build/dashboard/index.js +4 -4
- package/build/dashboard/tiles.d.ts +2 -1
- package/build/dashboard/tiles.js +60 -47
- package/dist/dattatable.js +457 -457
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/navigation.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 +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 +3 -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 +2 -2
- package/pnpm-lock.yaml +0 -3420
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Components } from "gd-sprest-bs";
|
|
1
2
|
export interface IAccordion {
|
|
2
|
-
filter?: (
|
|
3
|
+
filter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
|
|
3
4
|
search?: (value: string) => void;
|
|
4
5
|
}
|
|
5
6
|
export interface IAccordionProps {
|
|
@@ -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[]) => void;
|
|
9
|
+
onFilter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Properties
|
|
@@ -14,7 +14,7 @@ export interface IFilterItem {
|
|
|
14
14
|
export interface IFilterProps {
|
|
15
15
|
filters: IFilterItem[];
|
|
16
16
|
onClear?: () => void;
|
|
17
|
-
onFilter?: (value: string | string[]) => void;
|
|
17
|
+
onFilter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
|
|
18
18
|
onRendered?: (el: HTMLElement) => void;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -93,14 +93,14 @@ var FilterSlideout = /** @class */ (function () {
|
|
|
93
93
|
values.push(items[i].label);
|
|
94
94
|
}
|
|
95
95
|
// Execute the event
|
|
96
|
-
filter.onFilter ? filter.onFilter(values) : null;
|
|
97
|
-
_this._onFilter ? _this._onFilter(values) : null;
|
|
96
|
+
filter.onFilter ? filter.onFilter(values, item) : null;
|
|
97
|
+
_this._onFilter ? _this._onFilter(values, item) : null;
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
100
|
var item_1 = value;
|
|
101
101
|
// Execute the event
|
|
102
|
-
filter.onFilter ? filter.onFilter(item_1 ? item_1.label : "") : null;
|
|
103
|
-
_this._onFilter ? _this._onFilter(item_1 ? item_1.label : "") : null;
|
|
102
|
+
filter.onFilter ? filter.onFilter(item_1 ? item_1.label : "", item_1) : null;
|
|
103
|
+
_this._onFilter ? _this._onFilter(item_1 ? item_1.label : "", item_1) : null;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}));
|
package/build/dashboard/index.js
CHANGED
|
@@ -119,10 +119,10 @@ var Dashboard = /** @class */ (function () {
|
|
|
119
119
|
filters: this._props.filters ? this._props.filters.items : [],
|
|
120
120
|
onClear: this._props.filters ? this._props.filters.onClear : null,
|
|
121
121
|
onRendered: this._props.filters ? this._props.filters.onRendered : null,
|
|
122
|
-
onFilter: this.IsAccordion ? function (value) {
|
|
123
|
-
_this._accordion.filter(value);
|
|
124
|
-
} : (this.IsTiles ? function (value) {
|
|
125
|
-
_this._tiles.filter(value);
|
|
122
|
+
onFilter: this.IsAccordion ? function (value, item) {
|
|
123
|
+
_this._accordion.filter(value, item);
|
|
124
|
+
} : (this.IsTiles ? function (value, item) {
|
|
125
|
+
_this._tiles.filter(value, item);
|
|
126
126
|
} : null)
|
|
127
127
|
});
|
|
128
128
|
// Render the template
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Components } from "gd-sprest-bs";
|
|
2
2
|
export interface ITiles {
|
|
3
|
-
filter?: (
|
|
3
|
+
filter?: (value: string | string[], item?: Components.ICheckboxGroupItem) => void;
|
|
4
4
|
search?: (value: string) => void;
|
|
5
5
|
}
|
|
6
6
|
export interface ITilesProps {
|
|
@@ -35,6 +35,7 @@ export declare class Tiles implements ITiles {
|
|
|
35
35
|
constructor(props: ITilesProps);
|
|
36
36
|
filter(value: string): void;
|
|
37
37
|
private render;
|
|
38
|
+
private generateCard;
|
|
38
39
|
private renderTiles;
|
|
39
40
|
private updateTiles;
|
|
40
41
|
search(value: string): void;
|
package/build/dashboard/tiles.js
CHANGED
|
@@ -37,60 +37,73 @@ var Tiles = /** @class */ (function () {
|
|
|
37
37
|
// Update the tiles
|
|
38
38
|
this.updateTiles();
|
|
39
39
|
};
|
|
40
|
+
// Generate the card properties
|
|
41
|
+
Tiles.prototype.generateCard = function (item) {
|
|
42
|
+
var _this = this;
|
|
43
|
+
var itemClassNames = [];
|
|
44
|
+
// Get the filters
|
|
45
|
+
var filters = item[this._props.filterField] || [];
|
|
46
|
+
filters = filters["results"] || [filters];
|
|
47
|
+
// See if the filter field is specified
|
|
48
|
+
if (this._props.filterField) {
|
|
49
|
+
// Parse the selected filters
|
|
50
|
+
for (var j = 0; j < filters.length; j++) {
|
|
51
|
+
var filter = filters[j].toLowerCase().replace(/ /g, '-');
|
|
52
|
+
// Add the filter as a class name
|
|
53
|
+
if (filter) {
|
|
54
|
+
itemClassNames.push(filter);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Set the card props
|
|
59
|
+
var cardProps = {
|
|
60
|
+
className: itemClassNames.join(" "),
|
|
61
|
+
onRender: this._props.onCardRendered,
|
|
62
|
+
body: [{
|
|
63
|
+
content: (this._props.bodyField ? item[this._props.bodyField || "Description"] : null) || "",
|
|
64
|
+
data: item,
|
|
65
|
+
subTitle: item[this._props.subTitleField] || "",
|
|
66
|
+
title: item[this._props.titleField || "Title"] || "",
|
|
67
|
+
onRender: function (el, card) {
|
|
68
|
+
var item = card.data;
|
|
69
|
+
// Call the events
|
|
70
|
+
_this._props.onTitleRendered ? _this._props.onTitleRendered(el.querySelector(".card-title"), item) : null;
|
|
71
|
+
_this._props.onSubTitleRendered ? _this._props.onSubTitleRendered(el.querySelector(".card-subtitle"), item) : null;
|
|
72
|
+
_this._props.onBodyRendered ? _this._props.onBodyRendered(el, item) : null;
|
|
73
|
+
}
|
|
74
|
+
}]
|
|
75
|
+
};
|
|
76
|
+
// See if we are showing the header
|
|
77
|
+
var showHeader = typeof (this._props.showHeader) === "boolean" ? this._props.showHeader : true;
|
|
78
|
+
if (showHeader) {
|
|
79
|
+
cardProps.header = {
|
|
80
|
+
onRender: function (el) {
|
|
81
|
+
_this._props.onHeaderRendered ? _this._props.onHeaderRendered(el, item) : null;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// See if we are showing the footer
|
|
86
|
+
var showFooter = typeof (this._props.showFooter) === "boolean" ? this._props.showFooter : true;
|
|
87
|
+
if (showFooter) {
|
|
88
|
+
cardProps.footer = {
|
|
89
|
+
onRender: function (el) {
|
|
90
|
+
_this._props.onFooterRendered ? _this._props.onFooterRendered(el, item) : null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// Call the event
|
|
95
|
+
this._props.onCardRendering ? this._props.onCardRendering(cardProps) : null;
|
|
96
|
+
// Return the card properties
|
|
97
|
+
return cardProps;
|
|
98
|
+
};
|
|
40
99
|
// Renders the tiles
|
|
41
100
|
Tiles.prototype.renderTiles = function () {
|
|
42
|
-
var _this = this;
|
|
43
101
|
// Parse the items
|
|
44
102
|
var cards = [];
|
|
45
103
|
for (var i = 0; i < this._props.items.length; i++) {
|
|
46
104
|
var item = this._props.items[i];
|
|
47
|
-
var itemClassNames = [];
|
|
48
|
-
// Get the filters
|
|
49
|
-
var filters = item[this._props.filterField] || [];
|
|
50
|
-
filters = filters["results"] || [filters];
|
|
51
|
-
// See if the filter field is specified
|
|
52
|
-
if (this._props.filterField) {
|
|
53
|
-
// Parse the selected filters
|
|
54
|
-
for (var j = 0; j < filters.length; j++) {
|
|
55
|
-
var filter = filters[j].toLowerCase().replace(/ /g, '-');
|
|
56
|
-
// Add the filter as a class name
|
|
57
|
-
if (filter) {
|
|
58
|
-
itemClassNames.push(filter);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Set the card props
|
|
63
|
-
var cardProps = {
|
|
64
|
-
className: itemClassNames.join(" "),
|
|
65
|
-
onRender: this._props.onCardRendered,
|
|
66
|
-
body: [{
|
|
67
|
-
content: (this._props.bodyField ? item[this._props.bodyField || "Description"] : null) || "",
|
|
68
|
-
data: item,
|
|
69
|
-
subTitle: item[this._props.subTitleField] || "",
|
|
70
|
-
title: item[this._props.titleField || "Title"] || "",
|
|
71
|
-
onRender: function (el, card) {
|
|
72
|
-
var item = card.data;
|
|
73
|
-
// Call the events
|
|
74
|
-
_this._props.onTitleRendered ? _this._props.onTitleRendered(el.querySelector(".card-title"), item) : null;
|
|
75
|
-
_this._props.onSubTitleRendered ? _this._props.onSubTitleRendered(el.querySelector(".card-subtitle"), item) : null;
|
|
76
|
-
_this._props.onBodyRendered ? _this._props.onBodyRendered(el, item) : null;
|
|
77
|
-
}
|
|
78
|
-
}]
|
|
79
|
-
};
|
|
80
|
-
// See if we are showing the header
|
|
81
|
-
var showHeader = typeof (this._props.showHeader) === "boolean" ? this._props.showHeader : true;
|
|
82
|
-
if (showHeader) {
|
|
83
|
-
cardProps.header = { onRender: this._props.onHeaderRendered };
|
|
84
|
-
}
|
|
85
|
-
// See if we are showing the footer
|
|
86
|
-
var showFooter = typeof (this._props.showFooter) === "boolean" ? this._props.showFooter : true;
|
|
87
|
-
if (showFooter) {
|
|
88
|
-
cardProps.footer = { onRender: this._props.onFooterRendered };
|
|
89
|
-
}
|
|
90
|
-
// Call the event
|
|
91
|
-
this._props.onCardRendering ? this._props.onCardRendering(cardProps) : null;
|
|
92
105
|
// Add an tile
|
|
93
|
-
cards.push(
|
|
106
|
+
cards.push(this.generateCard(item));
|
|
94
107
|
}
|
|
95
108
|
// Render the tiles
|
|
96
109
|
this._tiles = gd_sprest_bs_1.Components.CardGroup({
|