dattatable 1.9.9 → 2.0.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 (37) hide show
  1. package/build/itemForm.d.ts +3 -0
  2. package/build/itemForm.js +17 -3
  3. package/dist/dattatable.js +1076 -1076
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/CanvasForm.html +1 -1
  7. package/docs/classes/Comments.html +1 -1
  8. package/docs/classes/Dashboard.html +2 -2
  9. package/docs/classes/DataTable.html +2 -2
  10. package/docs/classes/Documents.html +5 -5
  11. package/docs/classes/FilterSlideout.html +1 -1
  12. package/docs/classes/Footer.html +1 -1
  13. package/docs/classes/Header.html +1 -1
  14. package/docs/classes/InstallationRequired.html +1 -1
  15. package/docs/classes/ItemForm.html +3 -3
  16. package/docs/classes/LoadingDialog.html +1 -1
  17. package/docs/classes/Modal.html +1 -1
  18. package/docs/classes/Navigation.html +1 -1
  19. package/docs/enums/ActionButtonTypes.html +1 -1
  20. package/docs/interfaces/ICommentsItem.html +1 -1
  21. package/docs/interfaces/IDashboardProps.html +1 -1
  22. package/docs/interfaces/IDataTable.html +1 -1
  23. package/docs/interfaces/IDataTableProps.html +1 -1
  24. package/docs/interfaces/IDocumentsProps.html +1 -1
  25. package/docs/interfaces/IFilterItem.html +1 -1
  26. package/docs/interfaces/IFilterProps.html +1 -1
  27. package/docs/interfaces/IFooterProps.html +1 -1
  28. package/docs/interfaces/IHeaderProps.html +1 -1
  29. package/docs/interfaces/IItemFormCreateProps.html +1 -1
  30. package/docs/interfaces/IItemFormEditProps.html +1 -1
  31. package/docs/interfaces/IItemFormTab.html +1 -1
  32. package/docs/interfaces/IItemFormTabInfo.html +1 -1
  33. package/docs/interfaces/IItemFormViewProps.html +1 -1
  34. package/docs/interfaces/IShowDialogProps.html +1 -1
  35. package/docs/modules.html +1 -1
  36. package/package.json +5 -5
  37. package/pnpm-lock.yaml +522 -520
@@ -3,6 +3,7 @@ import { Components, Helper } from "gd-sprest-bs";
3
3
  export interface IItemFormTab {
4
4
  title: string;
5
5
  fields: string[];
6
+ onFormRendered?: (form?: Components.IListFormDisplay | Components.IListFormEdit) => void;
6
7
  onRendered?: (el?: HTMLElement, item?: Components.IListGroupItem) => void;
7
8
  onRendering?: (item?: Components.IListGroupItem) => object;
8
9
  }
@@ -72,8 +73,10 @@ export declare class ItemForm {
72
73
  static set AutoClose(value: boolean);
73
74
  private static _displayForms;
74
75
  static get DisplayForm(): Components.IListFormDisplay;
76
+ static get DisplayForms(): Components.IListFormDisplay[];
75
77
  private static _editForms;
76
78
  static get EditForm(): Components.IListFormEdit;
79
+ static get EditForms(): Components.IListFormEdit[];
77
80
  private static _info;
78
81
  static get FormInfo(): Helper.IListFormResult;
79
82
  private static _controlMode;
package/build/itemForm.js CHANGED
@@ -34,11 +34,21 @@ var ItemForm = /** @class */ (function () {
34
34
  enumerable: false,
35
35
  configurable: true
36
36
  });
37
+ Object.defineProperty(ItemForm, "DisplayForms", {
38
+ get: function () { return this._displayForms; },
39
+ enumerable: false,
40
+ configurable: true
41
+ });
37
42
  Object.defineProperty(ItemForm, "EditForm", {
38
43
  get: function () { return this._editForms[0]; },
39
44
  enumerable: false,
40
45
  configurable: true
41
46
  });
47
+ Object.defineProperty(ItemForm, "EditForms", {
48
+ get: function () { return this._editForms; },
49
+ enumerable: false,
50
+ configurable: true
51
+ });
42
52
  Object.defineProperty(ItemForm, "FormInfo", {
43
53
  get: function () { return this._info; },
44
54
  enumerable: false,
@@ -210,6 +220,8 @@ var ItemForm = /** @class */ (function () {
210
220
  // Render the display form
211
221
  var form = gd_sprest_bs_1.Components.ListForm.renderDisplayForm(props);
212
222
  this._displayForms.push(form);
223
+ // Call the event if it exists
224
+ tab && tab.onFormRendered ? tab.onFormRendered(form) : null;
213
225
  // Return the form element
214
226
  return el;
215
227
  };
@@ -234,6 +246,8 @@ var ItemForm = /** @class */ (function () {
234
246
  // Render the edit form
235
247
  var form = gd_sprest_bs_1.Components.ListForm.renderEditForm(props);
236
248
  this._editForms.push(form);
249
+ // Call the event if it exists
250
+ tab && tab.onFormRendered ? tab.onFormRendered(form) : null;
237
251
  // Return the form element
238
252
  return el;
239
253
  };
@@ -344,9 +358,9 @@ var ItemForm = /** @class */ (function () {
344
358
  // Saves the edit form
345
359
  ItemForm.save = function (form) {
346
360
  var _this = this;
347
- if (form === void 0) { form = this._editForms[0]; }
348
- var forms = form ? [form] : this._editForms;
349
361
  var values = {};
362
+ // Default the form
363
+ var forms = form ? [form] : this._editForms;
350
364
  // Display a loading dialog
351
365
  common_1.LoadingDialog.setHeader("Validation");
352
366
  common_1.LoadingDialog.setBody("Validating the form...");
@@ -376,7 +390,7 @@ var ItemForm = /** @class */ (function () {
376
390
  // Saves the item
377
391
  var saveItem_1 = function (values) {
378
392
  // Save the item
379
- form.save(values).then(function (item) {
393
+ forms[0].save(values).then(function (item) {
380
394
  // Call the update event
381
395
  _this._updateEvent ? _this._updateEvent(item) : null;
382
396
  // Close the dialogs