dattatable 2.10.4 → 2.10.6

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/common/itemForm.d.ts +4 -0
  2. package/build/common/itemForm.js +34 -18
  3. package/build/common/list.js +9 -6
  4. package/dist/dattatable.js +835 -835
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Accordion.html +2 -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 +5 -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 +2 -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 +3 -2
  50. package/docs/interfaces/IItemFormEditProps.html +3 -2
  51. package/docs/interfaces/IItemFormTab.html +2 -2
  52. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  53. package/docs/interfaces/IItemFormViewProps.html +3 -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 +54 -54
@@ -18,6 +18,7 @@ export interface IItemFormTabInfo {
18
18
  }
19
19
  /** Create Item Properties */
20
20
  export interface IItemFormCreateProps {
21
+ elForm?: HTMLElement;
21
22
  info?: Helper.IListFormResult;
22
23
  onCreateEditForm?: (props: Components.IListFormEditProps) => Components.IListFormEditProps;
23
24
  onFormButtonsRendering?: (buttons: Components.IButtonProps[]) => Components.IButtonProps[];
@@ -34,6 +35,7 @@ export interface IItemFormCreateProps {
34
35
  }
35
36
  /** Edit Item Properties */
36
37
  export interface IItemFormEditProps {
38
+ elForm?: HTMLElement;
37
39
  info?: Helper.IListFormResult;
38
40
  itemId: number;
39
41
  onCreateEditForm?: (props: Components.IListFormEditProps) => Components.IListFormEditProps;
@@ -51,6 +53,7 @@ export interface IItemFormEditProps {
51
53
  }
52
54
  /** View Item Properties */
53
55
  export interface IItemFormViewProps {
56
+ elForm?: HTMLElement;
54
57
  info?: Helper.IListFormResult;
55
58
  itemId: number;
56
59
  onCreateViewForm?: (props: Components.IListFormDisplayProps) => Components.IListFormDisplayProps;
@@ -67,6 +70,7 @@ export interface IItemFormViewProps {
67
70
  * Item Form
68
71
  */
69
72
  export declare class ItemForm {
73
+ private static _elForm;
70
74
  private static _onCreateEditForm;
71
75
  private static _onCreateViewForm;
72
76
  private static _onFormButtonsRendering;
@@ -101,6 +101,7 @@ var ItemForm = /** @class */ (function () {
101
101
  if (props === void 0) { props = {}; }
102
102
  // Set the properties
103
103
  this._controlMode = gd_sprest_bs_1.SPTypes.ControlMode.New;
104
+ this._elForm = props.elForm;
104
105
  this._info = props.info;
105
106
  this._onCreateEditForm = props.onCreateEditForm;
106
107
  this._onFormButtonsRendering = props.onFormButtonsRendering;
@@ -120,6 +121,7 @@ var ItemForm = /** @class */ (function () {
120
121
  ItemForm.edit = function (props) {
121
122
  // Set the properties
122
123
  this._controlMode = gd_sprest_bs_1.SPTypes.ControlMode.Edit;
124
+ this._elForm = props.elForm;
123
125
  this._info = props.info;
124
126
  this._onCreateEditForm = props.onCreateEditForm;
125
127
  this._onFormButtonsRendering = props.onFormButtonsRendering;
@@ -153,6 +155,7 @@ var ItemForm = /** @class */ (function () {
153
155
  ItemForm.view = function (props) {
154
156
  // Set the properties
155
157
  this._controlMode = gd_sprest_bs_1.SPTypes.ControlMode.Display;
158
+ this._elForm = props.elForm;
156
159
  this._info = props.info;
157
160
  this._onCreateViewForm = props.onCreateViewForm;
158
161
  this._onFormButtonsRendering = props.onFormButtonsRendering;
@@ -322,31 +325,43 @@ var ItemForm = /** @class */ (function () {
322
325
  };
323
326
  // Renders the form
324
327
  ItemForm.renderForm = function () {
325
- // Clear the form
326
- (this._useModal ? _1.Modal : _1.CanvasForm).clear();
327
- // Set the header
328
- (this._useModal ? _1.Modal : _1.CanvasForm).setHeader('<h5 class="m-0">' + (this._info.item ? this._info.item.Title : "Create Item") + '</h5>');
329
- // Call the header event
330
- this._onSetHeader ? this._onSetHeader(this._useModal ? _1.Modal.HeaderElement : _1.CanvasForm.HeaderElement) : null;
331
- // See if we are rendering tabs
332
- if (this._tabInfo) {
333
- // Render the tabs
334
- this.renderTabs();
328
+ // See if we are not rendering to a custom element
329
+ if (this._elForm == null) {
330
+ // Clear the form
331
+ (this._useModal ? _1.Modal : _1.CanvasForm).clear();
332
+ // Set the header
333
+ (this._useModal ? _1.Modal : _1.CanvasForm).setHeader('<h5 class="m-0">' + (this._info.item ? this._info.item.Title : "Create Item") + '</h5>');
334
+ // Call the header event
335
+ this._onSetHeader ? this._onSetHeader(this._useModal ? _1.Modal.HeaderElement : _1.CanvasForm.HeaderElement) : null;
336
+ // See if we are rendering tabs
337
+ if (this._tabInfo) {
338
+ // Render the tabs
339
+ this.renderTabs();
340
+ }
341
+ else {
342
+ // Render the form based on the type
343
+ var elForm = this.IsDisplay ? this.renderDisplayForm() : this.renderEditForm();
344
+ // Update the body
345
+ (this._useModal ? _1.Modal : _1.CanvasForm).setBody(elForm);
346
+ }
347
+ // Render the footer
348
+ this.renderFooter();
349
+ // Call the event
350
+ this._onShowForm ? this._onShowForm(this._useModal ? _1.Modal : _1.CanvasForm) : null;
351
+ // Show the form
352
+ (this._useModal ? _1.Modal : _1.CanvasForm).show();
335
353
  }
336
354
  else {
337
355
  // Render the form based on the type
338
356
  var elForm = this.IsDisplay ? this.renderDisplayForm() : this.renderEditForm();
339
- // Update the body
340
- (this._useModal ? _1.Modal : _1.CanvasForm).setBody(elForm);
357
+ // Copy the elements
358
+ for (var i = 0; i < elForm.children.length; i++) {
359
+ // Append the element
360
+ this._elForm.appendChild(elForm.children[i]);
361
+ }
341
362
  }
342
- // Render the footer
343
- this.renderFooter();
344
- // Call the event
345
- this._onShowForm ? this._onShowForm(this._useModal ? _1.Modal : _1.CanvasForm) : null;
346
363
  // Close the dialog
347
364
  _1.LoadingDialog.hide();
348
- // Show the form
349
- (this._useModal ? _1.Modal : _1.CanvasForm).show();
350
365
  };
351
366
  // Generates a tab
352
367
  ItemForm.renderTabs = function () {
@@ -513,6 +528,7 @@ var ItemForm = /** @class */ (function () {
513
528
  }
514
529
  });
515
530
  };
531
+ ItemForm._elForm = null;
516
532
  ItemForm._onCreateEditForm = null;
517
533
  ItemForm._onCreateViewForm = null;
518
534
  ItemForm._onFormButtonsRendering = null;
@@ -192,9 +192,12 @@ var List = /** @class */ (function () {
192
192
  configurable: true
193
193
  });
194
194
  // Clears the modal or canvas
195
- List.prototype.clear = function () {
196
- // Clear the modal/form
197
- _1.ItemForm.UseModal ? _1.Modal.clear() : _1.CanvasForm.clear();
195
+ List.prototype.clear = function (el) {
196
+ // Ensure we rendering to a modal/canvas
197
+ if (el == null) {
198
+ // Clear the modal/form
199
+ _1.ItemForm.UseModal ? _1.Modal.clear() : _1.CanvasForm.clear();
200
+ }
198
201
  // Set the list name
199
202
  _1.ItemForm.ListName = this.ListName;
200
203
  // Call the event
@@ -212,7 +215,7 @@ var List = /** @class */ (function () {
212
215
  // Displays the edit form
213
216
  List.prototype.editForm = function (props) {
214
217
  // Clear the modal/canvas
215
- this.clear();
218
+ this.clear(props.elForm);
216
219
  // Display the form
217
220
  _1.ItemForm.edit(props).then(null, this._onLoadFormError);
218
221
  };
@@ -456,7 +459,7 @@ var List = /** @class */ (function () {
456
459
  // Displays the new form
457
460
  List.prototype.newForm = function (props) {
458
461
  // Clear the modal/canvas
459
- this.clear();
462
+ this.clear(props.elForm);
460
463
  // Display the form
461
464
  _1.ItemForm.create(props).then(null, this._onLoadFormError);
462
465
  };
@@ -524,7 +527,7 @@ var List = /** @class */ (function () {
524
527
  // Displays the view form
525
528
  List.prototype.viewForm = function (props) {
526
529
  // Clear the modal/canvas
527
- this.clear();
530
+ this.clear(props.elForm);
528
531
  // Display the form
529
532
  _1.ItemForm.view(props).then(null, this._onLoadFormError);
530
533
  };