dattatable 2.0.4 → 2.0.7

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 +5 -0
  2. package/build/itemForm.js +10 -0
  3. package/dist/dattatable.js +679 -668
  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 +2 -2
  37. package/pnpm-lock.yaml +14 -14
@@ -1,4 +1,5 @@
1
1
  import { Components, Helper } from "gd-sprest-bs";
2
+ import { CanvasForm, Modal } from "./common";
2
3
  /** Tab */
3
4
  export interface IItemFormTab {
4
5
  title: string;
@@ -21,6 +22,7 @@ export interface IItemFormCreateProps {
21
22
  onSave?: (values: any) => object | PromiseLike<object>;
22
23
  onSetFooter?: (el: HTMLElement) => void;
23
24
  onSetHeader?: (el: HTMLElement) => void;
25
+ onShowForm?: (form?: CanvasForm | Modal) => void;
24
26
  onUpdate?: (item?: any) => void;
25
27
  onValidation?: (values?: any) => boolean | PromiseLike<boolean>;
26
28
  tabInfo?: IItemFormTabInfo;
@@ -37,6 +39,7 @@ export interface IItemFormEditProps {
37
39
  onSave?: (values: any) => object | PromiseLike<object>;
38
40
  onSetFooter?: (el: HTMLElement) => void;
39
41
  onSetHeader?: (el: HTMLElement) => void;
42
+ onShowForm?: (form?: CanvasForm | Modal) => void;
40
43
  onUpdate?: (item?: any) => void;
41
44
  onValidation?: (values?: any) => boolean | PromiseLike<boolean>;
42
45
  tabInfo?: IItemFormTabInfo;
@@ -52,6 +55,7 @@ export interface IItemFormViewProps {
52
55
  onGetListInfo?: (props: Helper.IListFormProps) => Helper.IListFormProps;
53
56
  onSetFooter?: (el: HTMLElement) => void;
54
57
  onSetHeader?: (el: HTMLElement) => void;
58
+ onShowForm?: (form?: CanvasForm | Modal) => void;
55
59
  tabInfo?: IItemFormTabInfo;
56
60
  useModal?: boolean;
57
61
  webUrl?: string;
@@ -66,6 +70,7 @@ export declare class ItemForm {
66
70
  private static _onGetListInfo;
67
71
  private static _onSetFooter?;
68
72
  private static _onSetHeader?;
73
+ private static _onShowForm?;
69
74
  private static _onSave;
70
75
  private static _onValidation;
71
76
  private static _tabInfo;
package/build/itemForm.js CHANGED
@@ -108,6 +108,7 @@ var ItemForm = /** @class */ (function () {
108
108
  this._onSave = props.onSave;
109
109
  this._onSetFooter = props.onSetFooter;
110
110
  this._onSetHeader = props.onSetHeader;
111
+ this._onShowForm = props.onShowForm;
111
112
  this._onValidation = props.onValidation;
112
113
  this._tabInfo = props.tabInfo;
113
114
  this._updateEvent = props.onUpdate;
@@ -126,6 +127,7 @@ var ItemForm = /** @class */ (function () {
126
127
  this._onSave = props.onSave;
127
128
  this._onSetFooter = props.onSetFooter;
128
129
  this._onSetHeader = props.onSetHeader;
130
+ this._onShowForm = props.onShowForm;
129
131
  this._onValidation = props.onValidation;
130
132
  this._tabInfo = props.tabInfo;
131
133
  this._updateEvent = props.onUpdate;
@@ -157,6 +159,7 @@ var ItemForm = /** @class */ (function () {
157
159
  this._onGetListInfo = props.onGetListInfo;
158
160
  this._onSetFooter = props.onSetFooter;
159
161
  this._onSetHeader = props.onSetHeader;
162
+ this._onShowForm = props.onShowForm;
160
163
  this._tabInfo = props.tabInfo;
161
164
  typeof (props.useModal) === "boolean" ? this._useModal = props.useModal : false;
162
165
  // Load the form
@@ -210,8 +213,10 @@ var ItemForm = /** @class */ (function () {
210
213
  // Ensure the element exists
211
214
  el = el || document.createElement("div");
212
215
  // Set the form properties
216
+ var displayAttachments = tab ? tab.fields && tab.fields.indexOf("Attachments") >= 0 : true;
213
217
  var props = {
214
218
  el: el,
219
+ displayAttachments: displayAttachments,
215
220
  info: this._info,
216
221
  rowClassName: "mb-3",
217
222
  includeFields: tab ? tab.fields : null,
@@ -235,8 +240,10 @@ var ItemForm = /** @class */ (function () {
235
240
  // Ensure the element exists
236
241
  el = el || document.createElement("div");
237
242
  // Set the form properties
243
+ var displayAttachments = tab ? tab.fields && tab.fields.indexOf("Attachments") >= 0 : true;
238
244
  var props = {
239
245
  el: el,
246
+ displayAttachments: displayAttachments,
240
247
  info: this._info,
241
248
  rowClassName: "mb-3",
242
249
  controlMode: this.IsNew ? gd_sprest_bs_1.SPTypes.ControlMode.New : gd_sprest_bs_1.SPTypes.ControlMode.Edit,
@@ -317,6 +324,8 @@ var ItemForm = /** @class */ (function () {
317
324
  }
318
325
  // Render the footer
319
326
  this.renderFooter();
327
+ // Call the event
328
+ this._onShowForm ? this._onShowForm(this._useModal ? common_1.Modal : common_1.CanvasForm) : null;
320
329
  // Close the dialog
321
330
  common_1.LoadingDialog.hide();
322
331
  // Show the form
@@ -461,6 +470,7 @@ var ItemForm = /** @class */ (function () {
461
470
  ItemForm._onGetListInfo = null;
462
471
  ItemForm._onSetFooter = null;
463
472
  ItemForm._onSetHeader = null;
473
+ ItemForm._onShowForm = null;
464
474
  ItemForm._onSave = null;
465
475
  ItemForm._onValidation = null;
466
476
  ItemForm._tabInfo = null;