dattatable 1.7.7 → 1.8.0

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 (47) hide show
  1. package/build/common/canvas.js +3 -0
  2. package/build/common/installRequired.d.ts +3 -0
  3. package/build/common/installRequired.js +111 -2
  4. package/build/common/modal.js +10 -0
  5. package/build/index.d.ts +0 -1
  6. package/build/index.js +1 -2
  7. package/build/itemForm.d.ts +26 -3
  8. package/build/itemForm.js +248 -139
  9. package/build/styles.js +1 -1
  10. package/dist/dattatable.js +669 -680
  11. package/dist/dattatable.min.js +1 -1
  12. package/docs/assets/search.js +1 -1
  13. package/docs/classes/CanvasForm.html +1 -1
  14. package/docs/classes/Dashboard.html +2 -2
  15. package/docs/classes/DataTable.html +2 -2
  16. package/docs/classes/Documents.html +5 -5
  17. package/docs/classes/FilterSlideout.html +1 -1
  18. package/docs/classes/Footer.html +1 -1
  19. package/docs/classes/Header.html +1 -1
  20. package/docs/classes/InstallationRequired.html +1 -1
  21. package/docs/classes/ItemForm.html +4 -4
  22. package/docs/classes/LoadingDialog.html +1 -1
  23. package/docs/classes/Modal.html +1 -1
  24. package/docs/classes/Navigation.html +1 -1
  25. package/docs/enums/ActionButtonTypes.html +1 -1
  26. package/docs/index.html +1 -1
  27. package/docs/interfaces/IDashboardProps.html +1 -1
  28. package/docs/interfaces/IDataTable.html +1 -1
  29. package/docs/interfaces/IDataTableProps.html +1 -1
  30. package/docs/interfaces/IDocumentsProps.html +1 -1
  31. package/docs/interfaces/IFilterItem.html +1 -1
  32. package/docs/interfaces/IFilterProps.html +1 -1
  33. package/docs/interfaces/IFooterProps.html +1 -1
  34. package/docs/interfaces/IHeaderProps.html +1 -1
  35. package/docs/interfaces/IItemFormCreateProps.html +1 -1
  36. package/docs/interfaces/IItemFormEditProps.html +1 -1
  37. package/docs/interfaces/IItemFormTab.html +3 -0
  38. package/docs/interfaces/IItemFormTabInfo.html +3 -1
  39. package/docs/interfaces/IItemFormViewProps.html +1 -1
  40. package/docs/interfaces/IShowDialogProps.html +1 -1
  41. package/docs/modules.html +1 -1
  42. package/package.json +10 -10
  43. package/pnpm-lock.yaml +613 -580
  44. package/build/itemFormTabs.d.ts +0 -27
  45. package/build/itemFormTabs.js +0 -95
  46. package/docs/classes/ItemFormTabs.html +0 -3
  47. package/docs/interfaces/IItemFormTabsProps.html +0 -1
@@ -26,6 +26,9 @@ var CanvasForm = /** @class */ (function () {
26
26
  // Clear the header and body
27
27
  this.setHeader("");
28
28
  this.setBody("");
29
+ // Set the default properties
30
+ this.setAutoClose(true);
31
+ this.setType(gd_sprest_bs_1.Components.OffcanvasTypes.End);
29
32
  };
30
33
  Object.defineProperty(CanvasForm, "el", {
31
34
  // Element
@@ -12,6 +12,9 @@ export interface IShowDialogProps {
12
12
  export declare class InstallationRequired {
13
13
  private static _cfg;
14
14
  private static _report;
15
+ private static _customActionsExist;
16
+ static get CustomActionsExist(): boolean;
17
+ private static checkCustomActions;
15
18
  private static _listsExist;
16
19
  static get ListsExist(): boolean;
17
20
  private static checkLists;
@@ -11,6 +11,102 @@ var modal_1 = require("./modal");
11
11
  var InstallationRequired = /** @class */ (function () {
12
12
  function InstallationRequired() {
13
13
  }
14
+ Object.defineProperty(InstallationRequired, "CustomActionsExist", {
15
+ get: function () { return this._customActionsExist; },
16
+ enumerable: false,
17
+ configurable: true
18
+ });
19
+ // Checks the custom actions
20
+ InstallationRequired.checkCustomActions = function () {
21
+ var _this = this;
22
+ // Clear the flag
23
+ this._customActionsExist = true;
24
+ // Method to check the web custom actions
25
+ var checkWeb = function () {
26
+ // Return a promise
27
+ return new Promise(function (resolve) {
28
+ // Ensure custom actions exist
29
+ if (_this._cfg._configuration.CustomActionCfg == null || _this._cfg._configuration.CustomActionCfg.Web == null || _this._cfg._configuration.CustomActionCfg.Web.length == 0) {
30
+ // Resolve the request
31
+ resolve(null);
32
+ return;
33
+ }
34
+ // Load the web custom actions
35
+ var web = (0, gd_sprest_bs_1.Web)();
36
+ web.UserCustomActions().execute(function (webCustomActions) {
37
+ // Parse the web custom actions
38
+ for (var i = 0; i < _this._cfg._configuration.CustomActionCfg.Web.length; i++) {
39
+ var customAction = _this._cfg._configuration.CustomActionCfg.Web[i];
40
+ var found = false;
41
+ // Parse the web custom actions
42
+ for (var j = 0; j < webCustomActions.results.length; j++) {
43
+ // See if they match
44
+ if (customAction.Title == webCustomActions.results[j].Title) {
45
+ // Set the flag
46
+ found = true;
47
+ }
48
+ }
49
+ // See if it was not found
50
+ if (!found) {
51
+ // Set the error
52
+ _this._report.push("Web Custom Action '" + customAction.Title + "' is missing.");
53
+ // Set the flag
54
+ _this._customActionsExist = false;
55
+ }
56
+ }
57
+ // Resolve the request
58
+ resolve(null);
59
+ });
60
+ });
61
+ };
62
+ // Method to check the site custom actions
63
+ var checkSite = function () {
64
+ return new Promise(function (resolve) {
65
+ // Ensure custom actions exist
66
+ if (_this._cfg._configuration.CustomActionCfg == null || _this._cfg._configuration.CustomActionCfg.Site == null || _this._cfg._configuration.CustomActionCfg.Site.length == 0) {
67
+ // Resolve the request
68
+ resolve(null);
69
+ return;
70
+ }
71
+ // Load the site custom actions
72
+ (0, gd_sprest_bs_1.Site)().UserCustomActions().execute(function (siteCustomActions) {
73
+ // Parse the site custom actions
74
+ for (var i = 0; i < _this._cfg._configuration.CustomActionCfg.Site.length; i++) {
75
+ var customAction = _this._cfg._configuration.CustomActionCfg.Site[i];
76
+ var found = false;
77
+ // Parse the web custom actions
78
+ for (var j = 0; j < siteCustomActions.results.length; j++) {
79
+ // See if they match
80
+ if (customAction.Title == siteCustomActions.results[j].Title) {
81
+ // Set the flag
82
+ found = true;
83
+ }
84
+ }
85
+ // See if it was not found
86
+ if (!found) {
87
+ // Set the error
88
+ _this._report.push("Site Custom Action '" + customAction.Title + "' is missing.");
89
+ // Set the flag
90
+ _this._customActionsExist = false;
91
+ }
92
+ }
93
+ // Resolve the request
94
+ resolve(null);
95
+ });
96
+ });
97
+ };
98
+ // Return a promise
99
+ return new Promise(function (resolve) {
100
+ // Check the site & web
101
+ Promise.all([
102
+ checkSite(),
103
+ checkWeb()
104
+ ]).then(function () {
105
+ // Resolve the request
106
+ resolve();
107
+ });
108
+ });
109
+ };
14
110
  Object.defineProperty(InstallationRequired, "ListsExist", {
15
111
  get: function () { return this._listsExist; },
16
112
  enumerable: false,
@@ -23,6 +119,12 @@ var InstallationRequired = /** @class */ (function () {
23
119
  this._listsExist = true;
24
120
  // Return a promise
25
121
  return new Promise(function (resolve) {
122
+ // Ensure lists exist
123
+ if (_this._cfg._configuration.ListCfg == null || _this._cfg._configuration.ListCfg.length == 0) {
124
+ // Resolve the request
125
+ resolve(null);
126
+ return;
127
+ }
26
128
  // Parse the lists
27
129
  gd_sprest_bs_1.Helper.Executor(_this._cfg._configuration.ListCfg, function (listCfg) {
28
130
  // Return a promise
@@ -80,8 +182,13 @@ var InstallationRequired = /** @class */ (function () {
80
182
  this._report = [];
81
183
  // Return a promise
82
184
  return new Promise(function (resolve) {
83
- // Check the lists
84
- _this.checkLists().then(function () {
185
+ // Check the configuration
186
+ Promise.all([
187
+ // Check the custom actions
188
+ _this.checkCustomActions(),
189
+ // Check the lists
190
+ _this.checkLists()
191
+ ]).then(function () {
85
192
  // Resolve the request
86
193
  resolve(_this._report.length > 0);
87
194
  });
@@ -169,6 +276,8 @@ var InstallationRequired = /** @class */ (function () {
169
276
  };
170
277
  InstallationRequired._cfg = null;
171
278
  InstallationRequired._report = null;
279
+ // Custom Actions exists
280
+ InstallationRequired._customActionsExist = null;
172
281
  // Lists exists
173
282
  InstallationRequired._listsExist = null;
174
283
  return InstallationRequired;
@@ -32,6 +32,16 @@ var Modal = /** @class */ (function () {
32
32
  this.setHeader("");
33
33
  this.setBody("");
34
34
  this.setFooter("");
35
+ // Set the default properties
36
+ this.setAutoClose(false);
37
+ this.setBackdrop(true);
38
+ this.setCloseButtonVisibility(true);
39
+ this.setCloseEvent(null);
40
+ this.setFocus(false);
41
+ this.setIsCentered(true);
42
+ this.setKeyboard(true);
43
+ this.setScrollable(false);
44
+ this.setType(gd_sprest_bs_1.Components.ModalTypes.Large);
35
45
  };
36
46
  // Hides the modal
37
47
  Modal.hide = function () { this._modal.hide(); };
package/build/index.d.ts CHANGED
@@ -2,6 +2,5 @@ export * from "./common";
2
2
  export * from "./dashboard";
3
3
  export * from "./documents";
4
4
  export * from "./itemForm";
5
- export * from "./itemFormTabs";
6
5
  /** Styling */
7
6
  import "./styles";
package/build/index.js CHANGED
@@ -22,7 +22,6 @@ var documents_1 = require("./documents");
22
22
  __exportStar(require("./documents"), exports);
23
23
  var itemForm_1 = require("./itemForm");
24
24
  __exportStar(require("./itemForm"), exports);
25
- __exportStar(require("./itemFormTabs"), exports);
26
25
  /** Styling */
27
26
  require("./styles");
28
27
  /** Global Variable */
@@ -31,5 +30,5 @@ window["DattaTable"] = {
31
30
  Common: Common,
32
31
  Dashboard: dashboard_1.Dashboard,
33
32
  Documents: documents_1.Documents,
34
- ItemForm: itemForm_1.ItemForm //, ItemFormTabs
33
+ ItemForm: itemForm_1.ItemForm
35
34
  };
@@ -1,4 +1,16 @@
1
1
  import { Components, Helper } from "gd-sprest-bs";
2
+ /** Tab */
3
+ export interface IItemFormTab {
4
+ title: string;
5
+ fields: string[];
6
+ onRendered: (el?: HTMLElement, item?: Components.IListGroupItem) => void;
7
+ onRendering: (item?: Components.IListGroupItem) => any;
8
+ }
9
+ /** Tab Information */
10
+ export interface IItemFormTabInfo {
11
+ isVertical?: boolean;
12
+ tabs: IItemFormTab[];
13
+ }
2
14
  /** Create Item Properties */
3
15
  export interface IItemFormCreateProps {
4
16
  info?: Helper.IListFormResult;
@@ -10,6 +22,7 @@ export interface IItemFormCreateProps {
10
22
  onSetHeader?: (el: HTMLElement) => void;
11
23
  onUpdate?: (item?: any) => void;
12
24
  onValidation?: (values?: any) => boolean | PromiseLike<boolean>;
25
+ tabInfo?: IItemFormTabInfo;
13
26
  useModal?: boolean;
14
27
  webUrl?: string;
15
28
  }
@@ -25,6 +38,7 @@ export interface IItemFormEditProps {
25
38
  onSetHeader?: (el: HTMLElement) => void;
26
39
  onUpdate?: (item?: any) => void;
27
40
  onValidation?: (values?: any) => boolean | PromiseLike<boolean>;
41
+ tabInfo?: IItemFormTabInfo;
28
42
  useModal?: boolean;
29
43
  webUrl?: string;
30
44
  }
@@ -37,6 +51,7 @@ export interface IItemFormViewProps {
37
51
  onGetListInfo?: (props: Helper.IListFormProps) => Helper.IListFormProps;
38
52
  onSetFooter?: (el: HTMLElement) => void;
39
53
  onSetHeader?: (el: HTMLElement) => void;
54
+ tabInfo?: IItemFormTabInfo;
40
55
  useModal?: boolean;
41
56
  webUrl?: string;
42
57
  }
@@ -52,11 +67,12 @@ export declare class ItemForm {
52
67
  private static _onSetHeader?;
53
68
  private static _onSave;
54
69
  private static _onValidation;
70
+ private static _tabInfo;
55
71
  private static _updateEvent;
56
72
  static set AutoClose(value: boolean);
57
- private static _displayForm;
73
+ private static _displayForms;
58
74
  static get DisplayForm(): Components.IListFormDisplay;
59
- private static _editForm;
75
+ private static _editForms;
60
76
  static get EditForm(): Components.IListFormEdit;
61
77
  private static _info;
62
78
  static get FormInfo(): Helper.IListFormResult;
@@ -67,6 +83,8 @@ export declare class ItemForm {
67
83
  private static _listName;
68
84
  static get ListName(): string;
69
85
  static set ListName(value: string);
86
+ private static _tabs;
87
+ static get Tabs(): Components.IListGroup;
70
88
  private static _useModal;
71
89
  static get UseModal(): boolean;
72
90
  static set UseModal(value: boolean);
@@ -76,8 +94,13 @@ export declare class ItemForm {
76
94
  static edit(props: IItemFormEditProps): void;
77
95
  static loadFormInfo(props: Helper.IListFormProps): PromiseLike<void>;
78
96
  static view(props: IItemFormViewProps): void;
79
- /** private static Methods */
97
+ /** Private Methods */
80
98
  private static load;
99
+ private static renderDisplayForm;
100
+ private static renderEditForm;
101
+ private static renderFooter;
102
+ private static renderForm;
103
+ private static renderTabs;
81
104
  static save(form?: Components.IListFormEdit): void;
82
105
  private static validate;
83
106
  }