dattatable 0.8.8 → 0.9.2

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 (48) hide show
  1. package/README.md +36 -2
  2. package/build/common/canvas.d.ts +15 -17
  3. package/build/common/canvas.js +23 -21
  4. package/build/common/installRequired.d.ts +6 -8
  5. package/build/common/installRequired.js +10 -10
  6. package/build/common/loadingDialog.d.ts +11 -12
  7. package/build/common/loadingDialog.js +18 -17
  8. package/build/common/modal.d.ts +19 -21
  9. package/build/common/modal.js +28 -26
  10. package/build/dashboard/filter.js +5 -5
  11. package/build/index.js +7 -0
  12. package/build/itemForm.d.ts +35 -37
  13. package/build/itemForm.js +42 -42
  14. package/build/styles.js +1 -1
  15. package/clean.js +9 -0
  16. package/dist/dattatable.js +360 -360
  17. package/dist/dattatable.min.js +1 -1
  18. package/docs/assets/highlight.css +22 -0
  19. package/docs/assets/icons.css +1043 -0
  20. package/docs/assets/icons.png +0 -0
  21. package/docs/assets/icons@2x.png +0 -0
  22. package/docs/assets/main.js +52 -0
  23. package/docs/assets/search.js +1 -0
  24. package/docs/assets/style.css +1341 -0
  25. package/docs/assets/widgets.png +0 -0
  26. package/docs/assets/widgets@2x.png +0 -0
  27. package/docs/classes/CanvasForm.html +3 -0
  28. package/docs/classes/Dashboard.html +5 -0
  29. package/docs/classes/DataTable.html +5 -0
  30. package/docs/classes/FilterSlideout.html +3 -0
  31. package/docs/classes/Footer.html +3 -0
  32. package/docs/classes/Header.html +3 -0
  33. package/docs/classes/InstallationRequired.html +4 -0
  34. package/docs/classes/ItemForm.html +7 -0
  35. package/docs/classes/LoadingDialog.html +3 -0
  36. package/docs/classes/Modal.html +3 -0
  37. package/docs/classes/Navigation.html +3 -0
  38. package/docs/index.html +54 -0
  39. package/docs/interfaces/IDashboardProps.html +1 -0
  40. package/docs/interfaces/IDataTable.html +3 -0
  41. package/docs/interfaces/IDataTableProps.html +3 -0
  42. package/docs/interfaces/IFilterItem.html +3 -0
  43. package/docs/interfaces/IFilterProps.html +3 -0
  44. package/docs/interfaces/IFooterProps.html +3 -0
  45. package/docs/interfaces/IHeaderProps.html +3 -0
  46. package/docs/modules.html +3 -0
  47. package/package.json +7 -5
  48. package/pnpm-lock.yaml +198 -138
package/README.md CHANGED
@@ -1,2 +1,36 @@
1
- # Datta Table
2
- This is a basic solution displaying data stored in a SharePoint list in a table using the datatables.net library.
1
+ # DattaTable Library
2
+
3
+ This library will help generate a dashboard or an interactive [datatables.net](https://datatables.net/) table referencing data from a SharePoint list.
4
+
5
+ ## Supported Environments
6
+
7
+ * SharePoint On-Premise Environments 2013+
8
+ * SharePoint Online (Classic/Modern)
9
+
10
+ ## How to Use
11
+
12
+ Follow this [code walkthrough](https://github.com/gunjandatta/sp-dashboard/wiki) to build a basic example of this solution.
13
+
14
+ ## [Documentation](https://datta-framework.github.io/dattatable/)
15
+
16
+ ### Common Methods
17
+
18
+ * [formatDateTimeValue](https://datta-framework.github.io/dattatable/modules.html#formatDateTimeValue)
19
+ * [formatDateValue](https://datta-framework.github.io/dattatable/modules.html#formatDateValue)
20
+
21
+ ### Components
22
+
23
+ * [Canvas Form](https://datta-framework.github.io/dattatable/classes/CanvasForm.html)
24
+ * [Dashboard](https://datta-framework.github.io/dattatable/classes/Dashboard.html)
25
+ * [Installation Required](https://datta-framework.github.io/dattatable/classes/InstallationRequired.html)
26
+ * [Item Form](https://datta-framework.github.io/dattatable/classes/ItemForm.html)
27
+ * [Loading Dialog](https://datta-framework.github.io/dattatable/classes/LoadingDialog.html)
28
+ * [Modal](https://datta-framework.github.io/dattatable/classes/Modal.html)
29
+
30
+ ### Dashboard Components
31
+
32
+ * [DataTable](https://datta-framework.github.io/dattatable/classes/DataTable.html)
33
+ * [FilterSlideout](https://datta-framework.github.io/dattatable/classes/FilterSlideout.html)
34
+ * [Footer](https://datta-framework.github.io/dattatable/classes/Footer.html)
35
+ * [Header](https://datta-framework.github.io/dattatable/classes/Header.html)
36
+ * [Navigation](https://datta-framework.github.io/dattatable/classes/Navigation.html)
@@ -1,22 +1,20 @@
1
1
  /**
2
2
  * Canvas Form
3
3
  */
4
- declare class _CanvasForm {
5
- private _canvas;
6
- private _elBody;
7
- get BodyElement(): HTMLElement;
8
- private _elHeader;
9
- get HeaderElement(): HTMLElement;
4
+ export declare class CanvasForm {
5
+ private static _canvas;
6
+ private static _elBody;
7
+ static get BodyElement(): HTMLElement;
8
+ private static _elHeader;
9
+ static get HeaderElement(): HTMLElement;
10
10
  constructor();
11
- clear(): void;
12
- get el(): HTMLElement;
13
- hide(): void;
14
- private render;
15
- setAutoClose(value: boolean): void;
16
- setBody(content: any): void;
17
- setHeader(content: any): void;
18
- setType(type: any): void;
19
- show(): void;
11
+ static clear(): void;
12
+ static get el(): HTMLElement;
13
+ static hide(): void;
14
+ private static render;
15
+ static setAutoClose(value: boolean): void;
16
+ static setBody(content: any): void;
17
+ static setHeader(content: any): void;
18
+ static setType(type: any): void;
19
+ static show(): void;
20
20
  }
21
- export declare const CanvasForm: _CanvasForm;
22
- export {};
@@ -5,43 +5,38 @@ var gd_sprest_bs_1 = require("gd-sprest-bs");
5
5
  /**
6
6
  * Canvas Form
7
7
  */
8
- var _CanvasForm = /** @class */ (function () {
8
+ var CanvasForm = /** @class */ (function () {
9
9
  // Constructor
10
- function _CanvasForm() {
11
- this._canvas = null;
12
- // Modal Body
13
- this._elBody = null;
14
- // Modal Header
15
- this._elHeader = null;
10
+ function CanvasForm() {
16
11
  // Render the canvas
17
- this.render();
12
+ CanvasForm.render();
18
13
  }
19
- Object.defineProperty(_CanvasForm.prototype, "BodyElement", {
14
+ Object.defineProperty(CanvasForm, "BodyElement", {
20
15
  get: function () { return this._elBody; },
21
16
  enumerable: false,
22
17
  configurable: true
23
18
  });
24
- Object.defineProperty(_CanvasForm.prototype, "HeaderElement", {
19
+ Object.defineProperty(CanvasForm, "HeaderElement", {
25
20
  get: function () { return this._elHeader; },
26
21
  enumerable: false,
27
22
  configurable: true
28
23
  });
29
24
  // Clears the canvas form
30
- _CanvasForm.prototype.clear = function () {
25
+ CanvasForm.clear = function () {
31
26
  // Clear the header and body
32
27
  this.setHeader("");
33
28
  this.setBody("");
34
29
  };
35
- Object.defineProperty(_CanvasForm.prototype, "el", {
30
+ Object.defineProperty(CanvasForm, "el", {
36
31
  // Element
37
32
  get: function () { return this._canvas.el; },
38
33
  enumerable: false,
39
34
  configurable: true
40
35
  });
41
36
  // Hides the canvas
42
- _CanvasForm.prototype.hide = function () { this._canvas.hide(); };
37
+ CanvasForm.hide = function () { this._canvas.hide(); };
43
38
  // Renders the canvas
44
- _CanvasForm.prototype.render = function () {
39
+ CanvasForm.render = function () {
45
40
  var _this = this;
46
41
  // Create the element
47
42
  var el = document.createElement("div");
@@ -73,9 +68,9 @@ var _CanvasForm = /** @class */ (function () {
73
68
  });
74
69
  };
75
70
  // Sets the auto close flag
76
- _CanvasForm.prototype.setAutoClose = function (value) { this._canvas.setAutoClose(value); };
71
+ CanvasForm.setAutoClose = function (value) { this._canvas.setAutoClose(value); };
77
72
  // Sets the body
78
- _CanvasForm.prototype.setBody = function (content) {
73
+ CanvasForm.setBody = function (content) {
79
74
  // Clear the body
80
75
  while (this._elBody.firstChild) {
81
76
  this._elBody.removeChild(this._elBody.firstChild);
@@ -94,7 +89,7 @@ var _CanvasForm = /** @class */ (function () {
94
89
  }
95
90
  };
96
91
  // Sets the header
97
- _CanvasForm.prototype.setHeader = function (content) {
92
+ CanvasForm.setHeader = function (content) {
98
93
  // Clear the body
99
94
  while (this._elHeader.firstChild) {
100
95
  this._elHeader.removeChild(this._elHeader.firstChild);
@@ -113,9 +108,16 @@ var _CanvasForm = /** @class */ (function () {
113
108
  }
114
109
  };
115
110
  // Sets the modal type
116
- _CanvasForm.prototype.setType = function (type) { this._canvas.setType(type); };
111
+ CanvasForm.setType = function (type) { this._canvas.setType(type); };
117
112
  // Shows the canvas
118
- _CanvasForm.prototype.show = function () { this._canvas.show(); };
119
- return _CanvasForm;
113
+ CanvasForm.show = function () { this._canvas.show(); };
114
+ CanvasForm._canvas = null;
115
+ // Modal Body
116
+ CanvasForm._elBody = null;
117
+ // Modal Header
118
+ CanvasForm._elHeader = null;
119
+ return CanvasForm;
120
120
  }());
121
- exports.CanvasForm = new _CanvasForm();
121
+ exports.CanvasForm = CanvasForm;
122
+ // Create an instance of the canvas form
123
+ new CanvasForm();
@@ -3,12 +3,10 @@ import { Helper } from "gd-sprest-bs";
3
3
  * Installation Required
4
4
  * Checks the SharePoint configuration file to see if an install is required.
5
5
  */
6
- declare class _InstallationRequired {
7
- private _cfg;
8
- private _report;
9
- private checkLists;
10
- requiresInstall(cfg: Helper.ISPConfig): PromiseLike<boolean>;
11
- showDialog(): void;
6
+ export declare class InstallationRequired {
7
+ private static _cfg;
8
+ private static _report;
9
+ private static checkLists;
10
+ static requiresInstall(cfg: Helper.ISPConfig): PromiseLike<boolean>;
11
+ static showDialog(): void;
12
12
  }
13
- export declare const InstallationRequired: _InstallationRequired;
14
- export {};
@@ -8,13 +8,11 @@ var modal_1 = require("./modal");
8
8
  * Installation Required
9
9
  * Checks the SharePoint configuration file to see if an install is required.
10
10
  */
11
- var _InstallationRequired = /** @class */ (function () {
12
- function _InstallationRequired() {
13
- this._cfg = null;
14
- this._report = null;
11
+ var InstallationRequired = /** @class */ (function () {
12
+ function InstallationRequired() {
15
13
  }
16
14
  // Checks the lists
17
- _InstallationRequired.prototype.checkLists = function () {
15
+ InstallationRequired.checkLists = function () {
18
16
  var _this = this;
19
17
  // Return a promise
20
18
  return new Promise(function (resolve) {
@@ -65,7 +63,7 @@ var _InstallationRequired = /** @class */ (function () {
65
63
  });
66
64
  };
67
65
  // Checks the configuration to see if an installation is required
68
- _InstallationRequired.prototype.requiresInstall = function (cfg) {
66
+ InstallationRequired.requiresInstall = function (cfg) {
69
67
  var _this = this;
70
68
  // Save the configuration
71
69
  this._cfg = cfg;
@@ -80,7 +78,7 @@ var _InstallationRequired = /** @class */ (function () {
80
78
  });
81
79
  });
82
80
  };
83
- _InstallationRequired.prototype.showDialog = function () {
81
+ InstallationRequired.showDialog = function () {
84
82
  var _this = this;
85
83
  // Set the header
86
84
  modal_1.Modal.setHeader("Installation Required");
@@ -145,7 +143,7 @@ var _InstallationRequired = /** @class */ (function () {
145
143
  type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,
146
144
  onClick: function () {
147
145
  // Refresh the page
148
- window.location.href = window.location.href;
146
+ window.location.reload();
149
147
  }
150
148
  }
151
149
  });
@@ -155,6 +153,8 @@ var _InstallationRequired = /** @class */ (function () {
155
153
  // Show the modal
156
154
  modal_1.Modal.show();
157
155
  };
158
- return _InstallationRequired;
156
+ InstallationRequired._cfg = null;
157
+ InstallationRequired._report = null;
158
+ return InstallationRequired;
159
159
  }());
160
- exports.InstallationRequired = new _InstallationRequired();
160
+ exports.InstallationRequired = InstallationRequired;
@@ -1,17 +1,16 @@
1
1
  /**
2
2
  * Loading Dialog
3
3
  */
4
- export declare class LoadingDialogModal {
5
- private _el;
6
- private _elBody;
7
- private _elBackdrop;
8
- private _elHeader;
4
+ export declare class LoadingDialog {
5
+ private static _el;
6
+ private static _elBody;
7
+ private static _elBackdrop;
8
+ private static _elHeader;
9
9
  constructor();
10
- get el(): HTMLElement;
11
- hide(): void;
12
- private render;
13
- setBody(content: any): void;
14
- setHeader(content: any): void;
15
- show(): void;
10
+ static get el(): HTMLElement;
11
+ static hide(): void;
12
+ private static render;
13
+ static setBody(content: any): void;
14
+ static setHeader(content: any): void;
15
+ static show(): void;
16
16
  }
17
- export declare const LoadingDialog: LoadingDialogModal;
@@ -1,34 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoadingDialog = exports.LoadingDialogModal = void 0;
3
+ exports.LoadingDialog = void 0;
4
4
  var gd_sprest_bs_1 = require("gd-sprest-bs");
5
5
  /**
6
6
  * Loading Dialog
7
7
  */
8
- var LoadingDialogModal = /** @class */ (function () {
8
+ var LoadingDialog = /** @class */ (function () {
9
9
  // Constructor
10
- function LoadingDialogModal() {
11
- this._el = null;
12
- this._elBody = null;
13
- this._elBackdrop = null;
14
- this._elHeader = null;
10
+ function LoadingDialog() {
15
11
  // Render the canvas
16
- this.render();
12
+ LoadingDialog.render();
17
13
  }
18
- Object.defineProperty(LoadingDialogModal.prototype, "el", {
14
+ Object.defineProperty(LoadingDialog, "el", {
19
15
  // Element
20
16
  get: function () { return this._el; },
21
17
  enumerable: false,
22
18
  configurable: true
23
19
  });
24
20
  // Hides the canvas
25
- LoadingDialogModal.prototype.hide = function () {
21
+ LoadingDialog.hide = function () {
26
22
  // Update the display
27
23
  this._el.style.display = "none";
28
24
  this._elBackdrop.style.display = "none";
29
25
  };
30
26
  // Renders the canvas
31
- LoadingDialogModal.prototype.render = function () {
27
+ LoadingDialog.render = function () {
32
28
  var _this = this;
33
29
  // Create the backdrop element
34
30
  this._elBackdrop = document.createElement("div");
@@ -75,7 +71,7 @@ var LoadingDialogModal = /** @class */ (function () {
75
71
  elMain.appendChild(this._elBody);
76
72
  };
77
73
  // Sets the body
78
- LoadingDialogModal.prototype.setBody = function (content) {
74
+ LoadingDialog.setBody = function (content) {
79
75
  // Clear the body
80
76
  while (this._elBody.firstChild) {
81
77
  this._elBody.removeChild(this._elBody.firstChild);
@@ -94,7 +90,7 @@ var LoadingDialogModal = /** @class */ (function () {
94
90
  }
95
91
  };
96
92
  // Sets the header
97
- LoadingDialogModal.prototype.setHeader = function (content) {
93
+ LoadingDialog.setHeader = function (content) {
98
94
  // Clear the body
99
95
  while (this._elHeader.firstChild) {
100
96
  this._elHeader.removeChild(this._elHeader.firstChild);
@@ -113,12 +109,17 @@ var LoadingDialogModal = /** @class */ (function () {
113
109
  }
114
110
  };
115
111
  // Shows the canvas
116
- LoadingDialogModal.prototype.show = function () {
112
+ LoadingDialog.show = function () {
117
113
  // Update the display
118
114
  this._el.style.display = "";
119
115
  this._elBackdrop.style.display = "";
120
116
  };
121
- return LoadingDialogModal;
117
+ LoadingDialog._el = null;
118
+ LoadingDialog._elBody = null;
119
+ LoadingDialog._elBackdrop = null;
120
+ LoadingDialog._elHeader = null;
121
+ return LoadingDialog;
122
122
  }());
123
- exports.LoadingDialogModal = LoadingDialogModal;
124
- exports.LoadingDialog = new LoadingDialogModal();
123
+ exports.LoadingDialog = LoadingDialog;
124
+ // Create an instance of the loading dialog
125
+ new LoadingDialog();
@@ -1,26 +1,24 @@
1
1
  /**
2
2
  * Modal
3
3
  */
4
- declare class _Modal {
5
- private _modal;
6
- private _onCloseEvent;
7
- private _elBody;
8
- get BodyElement(): HTMLElement;
9
- private _elFooter;
10
- get FooterElement(): HTMLElement;
11
- private _elHeader;
12
- get HeaderElement(): HTMLElement;
4
+ export declare class Modal {
5
+ private static _modal;
6
+ private static _onCloseEvent;
7
+ private static _elBody;
8
+ static get BodyElement(): HTMLElement;
9
+ private static _elFooter;
10
+ static get FooterElement(): HTMLElement;
11
+ private static _elHeader;
12
+ static get HeaderElement(): HTMLElement;
13
13
  constructor();
14
- clear(): void;
15
- hide(): void;
16
- private render;
17
- setAutoClose(value: boolean): void;
18
- setBody(content: any): void;
19
- setCloseEvent(event: any): void;
20
- setFooter(content: any): void;
21
- setHeader(content: any): void;
22
- setType(type: any): void;
23
- show(): void;
14
+ static clear(): void;
15
+ static hide(): void;
16
+ private static render;
17
+ static setAutoClose(value: boolean): void;
18
+ static setBody(content: any): void;
19
+ static setCloseEvent(event: any): void;
20
+ static setFooter(content: any): void;
21
+ static setHeader(content: any): void;
22
+ static setType(type: any): void;
23
+ static show(): void;
24
24
  }
25
- export declare const Modal: _Modal;
26
- export {};
@@ -5,46 +5,38 @@ var gd_sprest_bs_1 = require("gd-sprest-bs");
5
5
  /**
6
6
  * Modal
7
7
  */
8
- var _Modal = /** @class */ (function () {
8
+ var Modal = /** @class */ (function () {
9
9
  // Constructor
10
- function _Modal() {
11
- this._modal = null;
12
- this._onCloseEvent = null;
13
- // Modal Body
14
- this._elBody = null;
15
- // Modal Footer
16
- this._elFooter = null;
17
- // Modal Header
18
- this._elHeader = null;
10
+ function Modal() {
19
11
  // Render the canvas
20
- this.render();
12
+ Modal.render();
21
13
  }
22
- Object.defineProperty(_Modal.prototype, "BodyElement", {
14
+ Object.defineProperty(Modal, "BodyElement", {
23
15
  get: function () { return this._elBody; },
24
16
  enumerable: false,
25
17
  configurable: true
26
18
  });
27
- Object.defineProperty(_Modal.prototype, "FooterElement", {
19
+ Object.defineProperty(Modal, "FooterElement", {
28
20
  get: function () { return this._elFooter; },
29
21
  enumerable: false,
30
22
  configurable: true
31
23
  });
32
- Object.defineProperty(_Modal.prototype, "HeaderElement", {
24
+ Object.defineProperty(Modal, "HeaderElement", {
33
25
  get: function () { return this._elHeader; },
34
26
  enumerable: false,
35
27
  configurable: true
36
28
  });
37
29
  // Clears the canvas form
38
- _Modal.prototype.clear = function () {
30
+ Modal.clear = function () {
39
31
  // Clear the header, body and footer
40
32
  this.setHeader("");
41
33
  this.setBody("");
42
34
  this.setFooter("");
43
35
  };
44
36
  // Hides the modal
45
- _Modal.prototype.hide = function () { this._modal.hide(); };
37
+ Modal.hide = function () { this._modal.hide(); };
46
38
  // Renders the canvas
47
- _Modal.prototype.render = function () {
39
+ Modal.render = function () {
48
40
  var _this = this;
49
41
  // Create the element
50
42
  var el = document.createElement("div");
@@ -81,9 +73,9 @@ var _Modal = /** @class */ (function () {
81
73
  });
82
74
  };
83
75
  // Sets the auto close flag
84
- _Modal.prototype.setAutoClose = function (value) { this._modal.setAutoClose(value); };
76
+ Modal.setAutoClose = function (value) { this._modal.setAutoClose(value); };
85
77
  // Sets the body
86
- _Modal.prototype.setBody = function (content) {
78
+ Modal.setBody = function (content) {
87
79
  // Clear the body
88
80
  while (this._elBody.firstChild) {
89
81
  this._elBody.removeChild(this._elBody.firstChild);
@@ -102,9 +94,9 @@ var _Modal = /** @class */ (function () {
102
94
  }
103
95
  };
104
96
  // Sets the close event
105
- _Modal.prototype.setCloseEvent = function (event) { this._onCloseEvent = event; };
97
+ Modal.setCloseEvent = function (event) { this._onCloseEvent = event; };
106
98
  // Sets the footer
107
- _Modal.prototype.setFooter = function (content) {
99
+ Modal.setFooter = function (content) {
108
100
  // Clear the body
109
101
  while (this._elFooter.firstChild) {
110
102
  this._elFooter.removeChild(this._elFooter.firstChild);
@@ -123,7 +115,7 @@ var _Modal = /** @class */ (function () {
123
115
  }
124
116
  };
125
117
  // Sets the header
126
- _Modal.prototype.setHeader = function (content) {
118
+ Modal.setHeader = function (content) {
127
119
  // Clear the body
128
120
  while (this._elHeader.firstChild) {
129
121
  this._elHeader.removeChild(this._elHeader.firstChild);
@@ -142,9 +134,19 @@ var _Modal = /** @class */ (function () {
142
134
  }
143
135
  };
144
136
  // Sets the modal type
145
- _Modal.prototype.setType = function (type) { this._modal.setType(type); };
137
+ Modal.setType = function (type) { this._modal.setType(type); };
146
138
  // Shows the modal
147
- _Modal.prototype.show = function () { this._modal.show(); };
148
- return _Modal;
139
+ Modal.show = function () { this._modal.show(); };
140
+ Modal._modal = null;
141
+ Modal._onCloseEvent = null;
142
+ // Modal Body
143
+ Modal._elBody = null;
144
+ // Modal Footer
145
+ Modal._elFooter = null;
146
+ // Modal Header
147
+ Modal._elHeader = null;
148
+ return Modal;
149
149
  }());
150
- exports.Modal = new _Modal();
150
+ exports.Modal = Modal;
151
+ // Create an instance of the modal
152
+ new Modal();