dattatable 2.9.84 → 2.9.86

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 (62) hide show
  1. package/build/dashboard/accordion.d.ts +3 -0
  2. package/build/dashboard/accordion.js +76 -73
  3. package/build/dashboard/index.d.ts +2 -0
  4. package/dist/dattatable.js +457 -457
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Accordion.html +3 -2
  8. package/docs/classes/AuditLog.html +2 -2
  9. package/docs/classes/CanvasForm.html +2 -2
  10. package/docs/classes/Comments.html +2 -2
  11. package/docs/classes/Dashboard.html +4 -4
  12. package/docs/classes/DataTable.html +3 -3
  13. package/docs/classes/Documents.html +6 -6
  14. package/docs/classes/FilterSlideout.html +2 -2
  15. package/docs/classes/Footer.html +2 -2
  16. package/docs/classes/Header.html +2 -2
  17. package/docs/classes/InstallationRequired.html +2 -2
  18. package/docs/classes/ItemForm.html +4 -4
  19. package/docs/classes/List.html +4 -4
  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 +4 -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/IDashboardProps.html +2 -2
  41. package/docs/interfaces/IDataTable.html +2 -2
  42. package/docs/interfaces/IDataTableProps.html +2 -2
  43. package/docs/interfaces/IDocumentsProps.html +2 -2
  44. package/docs/interfaces/IFilterItem.html +2 -2
  45. package/docs/interfaces/IFilterProps.html +2 -2
  46. package/docs/interfaces/IFooterProps.html +2 -2
  47. package/docs/interfaces/IHeaderProps.html +2 -2
  48. package/docs/interfaces/IInstallProps.html +2 -2
  49. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  50. package/docs/interfaces/IItemFormEditProps.html +2 -2
  51. package/docs/interfaces/IItemFormTab.html +2 -2
  52. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  53. package/docs/interfaces/IItemFormViewProps.html +2 -2
  54. package/docs/interfaces/IListProps.html +2 -2
  55. package/docs/interfaces/IListSecurity.html +2 -2
  56. package/docs/interfaces/IListSecurityItem.html +2 -2
  57. package/docs/interfaces/IShowDialogProps.html +2 -2
  58. package/docs/interfaces/ITiles.html +2 -2
  59. package/docs/interfaces/ITilesProps.html +2 -2
  60. package/docs/variables/DattaTable.html +1 -1
  61. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  62. package/package.json +2 -2
@@ -9,7 +9,9 @@ export interface IAccordionProps {
9
9
  el: HTMLElement;
10
10
  filterFields?: [string];
11
11
  items: any[];
12
+ onItemBodyRender?: (el?: HTMLElement, item?: any) => void;
12
13
  onItemClick?: (el?: HTMLElement, item?: any) => void;
14
+ onItemHeaderRender?: (el?: HTMLElement, item?: any) => void;
13
15
  onItemRender?: (el?: HTMLElement, item?: any) => void;
14
16
  onPaginationRender?: (el?: HTMLElement) => void;
15
17
  paginationLimit?: number;
@@ -29,6 +31,7 @@ export declare class Accordion implements IAccordion {
29
31
  constructor(props: IAccordionProps);
30
32
  private clearItem;
31
33
  filter(values?: string[]): void;
34
+ private generateItem;
32
35
  private render;
33
36
  private renderAccordion;
34
37
  private renderItems;
@@ -39,6 +39,78 @@ var Accordion = /** @class */ (function () {
39
39
  // Render the items
40
40
  this.renderItems();
41
41
  };
42
+ // Generates the accordion item
43
+ Accordion.prototype.generateItem = function (item) {
44
+ var _this = this;
45
+ var filterValues = [];
46
+ // See if the filter field is specified
47
+ if (this._props.filterFields) {
48
+ // Parse the fields
49
+ for (var i = 0; i < this._props.filterFields.length; i++) {
50
+ var filterField = this._props.filterFields[i];
51
+ // Get the filter values
52
+ var filters = item[filterField] || [];
53
+ filters = filters["results"] || [filters];
54
+ // Append the values
55
+ filterValues = filterValues.concat(filters);
56
+ }
57
+ }
58
+ // See if the body fields exist
59
+ var bodyContent = this._props.bodyTemplate || "";
60
+ if (this._props.bodyFields) {
61
+ // Parse the fields
62
+ for (var i = 0; i < this._props.bodyFields.length; i++) {
63
+ var field = this._props.bodyFields[i];
64
+ var value = item[field] || "";
65
+ // See if there is a template
66
+ if (this._props.bodyTemplate) {
67
+ // Replace the values
68
+ var pattern = new RegExp("({" + field + "})", "g");
69
+ bodyContent = bodyContent.replace(pattern, value);
70
+ }
71
+ else {
72
+ // Append the value
73
+ bodyContent += value;
74
+ }
75
+ }
76
+ }
77
+ // See if the sub-title fields exist
78
+ var titleContent = this._props.titleTemplate || "";
79
+ if (this._props.titleFields) {
80
+ // Parse the fields
81
+ for (var i = 0; i < this._props.titleFields.length; i++) {
82
+ var field = this._props.titleFields[i];
83
+ var value = item[field] || "";
84
+ // See if there is a template
85
+ if (this._props.titleTemplate) {
86
+ // Replace the values
87
+ var pattern = new RegExp("({" + field + "})", "g");
88
+ titleContent = titleContent.replace(pattern, value);
89
+ }
90
+ else {
91
+ // Append the value
92
+ titleContent += value;
93
+ }
94
+ }
95
+ }
96
+ // Return the item
97
+ return {
98
+ content: bodyContent,
99
+ header: titleContent,
100
+ onClick: this._props.onItemClick,
101
+ onRenderBody: this._props.onItemBodyRender,
102
+ onRenderHeader: this._props.onItemHeaderRender,
103
+ onRender: function (el, item) {
104
+ // See if filters exist
105
+ if (filterValues && filterValues.length > 0) {
106
+ // Set the data filter value
107
+ el.setAttribute("data-filter", filterValues.join('|'));
108
+ }
109
+ // Call the event
110
+ _this._props.onItemRender ? _this._props.onItemRender(el, item) : null;
111
+ }
112
+ };
113
+ };
42
114
  // Renders the dashboard
43
115
  Accordion.prototype.render = function () {
44
116
  // Render the accordion
@@ -48,82 +120,13 @@ var Accordion = /** @class */ (function () {
48
120
  };
49
121
  // Renders the accordion
50
122
  Accordion.prototype.renderAccordion = function () {
51
- var _this = this;
52
123
  // Parse the items
53
124
  var accordionItems = [];
54
- var _loop_1 = function (i) {
55
- var item = this_1._props.items[i];
56
- var filterValues = [];
57
- // See if the filter field is specified
58
- if (this_1._props.filterFields) {
59
- // Parse the fields
60
- for (var i_1 = 0; i_1 < this_1._props.filterFields.length; i_1++) {
61
- var filterField = this_1._props.filterFields[i_1];
62
- // Get the filter values
63
- var filters = item[filterField] || [];
64
- filters = filters["results"] || [filters];
65
- // Append the values
66
- filterValues = filterValues.concat(filters);
67
- }
68
- }
69
- // See if the body fields exist
70
- var bodyContent = this_1._props.bodyTemplate || "";
71
- if (this_1._props.bodyFields) {
72
- // Parse the fields
73
- for (var i_2 = 0; i_2 < this_1._props.bodyFields.length; i_2++) {
74
- var field = this_1._props.bodyFields[i_2];
75
- var value = item[field] || "";
76
- // See if there is a template
77
- if (this_1._props.bodyTemplate) {
78
- // Replace the values
79
- var pattern = new RegExp("({" + field + "})", "g");
80
- bodyContent = bodyContent.replace(pattern, value);
81
- }
82
- else {
83
- // Append the value
84
- bodyContent += value;
85
- }
86
- }
87
- }
88
- // See if the sub-title fields exist
89
- var titleContent = this_1._props.titleTemplate || "";
90
- if (this_1._props.titleFields) {
91
- // Parse the fields
92
- for (var i_3 = 0; i_3 < this_1._props.titleFields.length; i_3++) {
93
- var field = this_1._props.titleFields[i_3];
94
- var value = item[field] || "";
95
- // See if there is a template
96
- if (this_1._props.titleTemplate) {
97
- // Replace the values
98
- var pattern = new RegExp("({" + field + "})", "g");
99
- titleContent = titleContent.replace(pattern, value);
100
- }
101
- else {
102
- // Append the value
103
- titleContent += value;
104
- }
105
- }
106
- }
107
- // Add an accordion item
108
- accordionItems.push({
109
- content: bodyContent,
110
- header: titleContent,
111
- onClick: this_1._props.onItemClick,
112
- onRender: function (el, item) {
113
- // See if filters exist
114
- if (filterValues && filterValues.length > 0) {
115
- // Set the data filter value
116
- el.setAttribute("data-filter", filterValues.join('|'));
117
- }
118
- // Call the event
119
- _this._props.onItemRender ? _this._props.onItemRender(el, item) : null;
120
- },
121
- showFl: i == 0,
122
- });
123
- };
124
- var this_1 = this;
125
125
  for (var i = 0; i < this._props.items.length; i++) {
126
- _loop_1(i);
126
+ var item = this.generateItem(this._props.items[i]);
127
+ item.showFl = i == 0;
128
+ // Add an accordion item
129
+ accordionItems.push(item);
127
130
  }
128
131
  // Render the accordion
129
132
  this._accordion = gd_sprest_bs_1.Components.Accordion({
@@ -15,7 +15,9 @@ export interface IDashboardProps {
15
15
  bodyTemplate?: string;
16
16
  filterFields?: [string];
17
17
  items: any[];
18
+ onItemBodyRender?: (el?: HTMLElement, item?: any) => void;
18
19
  onItemClick?: (el?: HTMLElement, item?: any) => void;
20
+ onItemHeaderRender?: (el?: HTMLElement, item?: any) => void;
19
21
  onItemRender?: (el?: HTMLElement, item?: any) => void;
20
22
  onPaginationRender?: (el?: HTMLElement) => void;
21
23
  paginationLimit?: number;