dattatable 2.1.9 → 2.2.1

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 (42) hide show
  1. package/build/dashboard/filter.d.ts +1 -1
  2. package/build/dashboard/filter.js +16 -22
  3. package/build/dashboard/index.d.ts +1 -0
  4. package/build/dashboard/index.js +7 -7
  5. package/dist/dattatable.js +682 -682
  6. package/dist/dattatable.min.js +1 -1
  7. package/docs/assets/search.js +1 -1
  8. package/docs/classes/CanvasForm.html +17 -17
  9. package/docs/classes/Comments.html +12 -12
  10. package/docs/classes/Dashboard.html +27 -17
  11. package/docs/classes/DataTable.html +11 -11
  12. package/docs/classes/Documents.html +45 -45
  13. package/docs/classes/FilterSlideout.html +24 -21
  14. package/docs/classes/Footer.html +4 -4
  15. package/docs/classes/Header.html +4 -4
  16. package/docs/classes/InstallationRequired.html +12 -12
  17. package/docs/classes/ItemForm.html +47 -47
  18. package/docs/classes/LoadingDialog.html +12 -12
  19. package/docs/classes/Modal.html +26 -26
  20. package/docs/classes/Navigation.html +4 -4
  21. package/docs/enums/ActionButtonTypes.html +6 -6
  22. package/docs/functions/formatBytes.html +1 -1
  23. package/docs/functions/formatDateValue.html +1 -1
  24. package/docs/functions/formatTimeValue.html +1 -1
  25. package/docs/functions/getFileExt.html +1 -1
  26. package/docs/interfaces/ICommentsItem.html +6 -6
  27. package/docs/interfaces/IDashboardProps.html +14 -14
  28. package/docs/interfaces/IDataTable.html +7 -7
  29. package/docs/interfaces/IDataTableProps.html +6 -6
  30. package/docs/interfaces/IDocumentsProps.html +25 -25
  31. package/docs/interfaces/IFilterItem.html +5 -5
  32. package/docs/interfaces/IFilterProps.html +4 -4
  33. package/docs/interfaces/IFooterProps.html +6 -6
  34. package/docs/interfaces/IHeaderProps.html +5 -5
  35. package/docs/interfaces/IItemFormCreateProps.html +14 -14
  36. package/docs/interfaces/IItemFormEditProps.html +15 -15
  37. package/docs/interfaces/IItemFormTab.html +6 -6
  38. package/docs/interfaces/IItemFormTabInfo.html +3 -3
  39. package/docs/interfaces/IItemFormViewProps.html +12 -12
  40. package/docs/interfaces/IShowDialogProps.html +5 -5
  41. package/package.json +2 -2
  42. package/pnpm-lock.yaml +10 -10
@@ -21,7 +21,6 @@ export interface IFilterProps {
21
21
  */
22
22
  export declare class FilterSlideout {
23
23
  private _cbs;
24
- private _clearFl;
25
24
  private _el;
26
25
  private _filters;
27
26
  private _items;
@@ -29,6 +28,7 @@ export declare class FilterSlideout {
29
28
  constructor(props: IFilterProps);
30
29
  private generateFilters;
31
30
  private generateItem;
31
+ clear(): void;
32
32
  getFilter(key: string): Components.ICheckboxGroup;
33
33
  setFilterValue(key: string, value: string | string[]): void;
34
34
  hide(): void;
@@ -9,7 +9,6 @@ var canvas_1 = require("../common/canvas");
9
9
  var FilterSlideout = /** @class */ (function () {
10
10
  function FilterSlideout(props) {
11
11
  this._cbs = null;
12
- this._clearFl = false;
13
12
  this._el = null;
14
13
  this._filters = null;
15
14
  this._items = null;
@@ -36,17 +35,8 @@ var FilterSlideout = /** @class */ (function () {
36
35
  text: "Clear Filters",
37
36
  type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,
38
37
  onClick: function () {
39
- // Set the flag
40
- _this._clearFl = true;
41
- // Parse the filters
42
- for (var i = 0; i < _this._cbs.length; i++) {
43
- // Clear the filter
44
- _this._cbs[i].setValue("");
45
- }
46
- // Clear the flag
47
- _this._clearFl = false;
48
- // Execute the event
49
- _this._onClear ? _this._onClear() : null;
38
+ // Clear the filters
39
+ _this.clear();
50
40
  }
51
41
  });
52
42
  // Parse the filters
@@ -86,19 +76,13 @@ var FilterSlideout = /** @class */ (function () {
86
76
  // Append the value
87
77
  values.push(items[i].label);
88
78
  }
89
- // Ensure the clear button wasn't clicked
90
- if (!_this._clearFl) {
91
- // Execute the event
92
- filter.onFilter ? filter.onFilter(values) : null;
93
- }
79
+ // Execute the event
80
+ filter.onFilter ? filter.onFilter(values) : null;
94
81
  }
95
82
  else {
96
83
  var item_1 = value;
97
- // Ensure the clear button wasn't clicked
98
- if (!_this._clearFl) {
99
- // Execute the event
100
- filter.onFilter ? filter.onFilter(item_1 ? item_1.label : "") : null;
101
- }
84
+ // Execute the event
85
+ filter.onFilter ? filter.onFilter(item_1 ? item_1.label : "") : null;
102
86
  }
103
87
  }
104
88
  }));
@@ -107,6 +91,16 @@ var FilterSlideout = /** @class */ (function () {
107
91
  // Return the item
108
92
  return item;
109
93
  };
94
+ // Clears the filters
95
+ FilterSlideout.prototype.clear = function () {
96
+ // Parse the filters
97
+ for (var i = 0; i < this._cbs.length; i++) {
98
+ // Clear the filter
99
+ this._cbs[i].setValue("");
100
+ }
101
+ // Execute the event
102
+ this._onClear ? this._onClear() : null;
103
+ };
110
104
  // Gets a checkbox group by its name
111
105
  FilterSlideout.prototype.getFilter = function (key) {
112
106
  // Parse the items
@@ -72,6 +72,7 @@ export declare class Dashboard {
72
72
  /**
73
73
  * Public Interface
74
74
  */
75
+ clearFilter(): void;
75
76
  filter(idx: number, value?: string): void;
76
77
  filterMulti(idx: number, values?: string[]): void;
77
78
  getFilter(key: string): Components.ICheckboxGroup;
@@ -56,13 +56,8 @@ var Dashboard = /** @class */ (function () {
56
56
  // Create the filters
57
57
  this._filters = new filter_1.FilterSlideout({
58
58
  filters: this._props.filters ? this._props.filters.items : [],
59
- onRendered: this._props.filters ? this._props.filters.onRendered : null,
60
- onClear: function () {
61
- // Clear the filters
62
- _this._dt.datatable.columns().search('').draw();
63
- // Call the event
64
- _this._props.filters ? _this._props.filters.onClear : null;
65
- }
59
+ onClear: this._props.filters ? this._props.filters.onClear : null,
60
+ onRendered: this._props.filters ? this._props.filters.onRendered : null
66
61
  });
67
62
  // Render the template
68
63
  var elTemplate = document.createElement("div");
@@ -204,6 +199,11 @@ var Dashboard = /** @class */ (function () {
204
199
  /**
205
200
  * Public Interface
206
201
  */
202
+ // Clears the filters
203
+ Dashboard.prototype.clearFilter = function () {
204
+ // Clear the filters
205
+ this._filters.clear();
206
+ };
207
207
  // Filter the table
208
208
  Dashboard.prototype.filter = function (idx, value) {
209
209
  // Filter the table