dattatable 2.11.7 → 2.11.9

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 (71) hide show
  1. package/build/common/listCfg.d.ts +2 -0
  2. package/build/common/listCfg.js +64 -0
  3. package/build/dashboard/index.d.ts +2 -1
  4. package/build/dashboard/tiles.d.ts +2 -1
  5. package/build/dashboard/tiles.js +3 -2
  6. package/dist/dattatable.js +836 -836
  7. package/dist/dattatable.min.js +1 -1
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/Accordion.html +2 -2
  10. package/docs/classes/AuditLog.html +2 -2
  11. package/docs/classes/CanvasForm.html +2 -2
  12. package/docs/classes/Comments.html +2 -2
  13. package/docs/classes/Dashboard.html +4 -4
  14. package/docs/classes/DataTable.html +3 -3
  15. package/docs/classes/Documents.html +6 -6
  16. package/docs/classes/FilterSlideout.html +2 -2
  17. package/docs/classes/Footer.html +2 -2
  18. package/docs/classes/Header.html +2 -2
  19. package/docs/classes/InstallationRequired.html +2 -2
  20. package/docs/classes/ItemForm.html +4 -4
  21. package/docs/classes/List.html +4 -4
  22. package/docs/classes/ListConfig.html +4 -2
  23. package/docs/classes/ListSecurity.html +2 -2
  24. package/docs/classes/LoadingDialog.html +2 -2
  25. package/docs/classes/Modal.html +2 -2
  26. package/docs/classes/Navigation.html +3 -3
  27. package/docs/classes/Tiles.html +2 -2
  28. package/docs/classes/Timeout.html +2 -2
  29. package/docs/enums/ActionButtonTypes.html +2 -2
  30. package/docs/functions/formatBytes.html +1 -1
  31. package/docs/functions/formatDateValue.html +1 -1
  32. package/docs/functions/formatTimeValue.html +1 -1
  33. package/docs/functions/getContextInfo.html +1 -1
  34. package/docs/functions/getFileExt.html +1 -1
  35. package/docs/functions/waitForTheme.html +1 -1
  36. package/docs/interfaces/IAccordion.html +2 -2
  37. package/docs/interfaces/IAccordionProps.html +2 -2
  38. package/docs/interfaces/IAuditLogItem.html +13 -13
  39. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  40. package/docs/interfaces/IAuditLogProps.html +2 -2
  41. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  42. package/docs/interfaces/ICommentsItem.html +2 -2
  43. package/docs/interfaces/ICreateLookupData.html +2 -2
  44. package/docs/interfaces/IDashboardProps.html +2 -2
  45. package/docs/interfaces/IDataTable.html +2 -2
  46. package/docs/interfaces/IDataTableProps.html +2 -2
  47. package/docs/interfaces/IDocumentsProps.html +2 -2
  48. package/docs/interfaces/IFilterItem.html +2 -2
  49. package/docs/interfaces/IFilterProps.html +2 -2
  50. package/docs/interfaces/IFooterProps.html +2 -2
  51. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  52. package/docs/interfaces/IHeaderProps.html +2 -2
  53. package/docs/interfaces/IInstallProps.html +2 -2
  54. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  55. package/docs/interfaces/IItemFormEditProps.html +2 -2
  56. package/docs/interfaces/IItemFormTab.html +2 -2
  57. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  58. package/docs/interfaces/IItemFormViewProps.html +2 -2
  59. package/docs/interfaces/IListConfig.html +2 -2
  60. package/docs/interfaces/IListConfigProps.html +2 -2
  61. package/docs/interfaces/IListProps.html +2 -2
  62. package/docs/interfaces/IListSecurity.html +2 -2
  63. package/docs/interfaces/IListSecurityItem.html +2 -2
  64. package/docs/interfaces/ILookupData.html +2 -2
  65. package/docs/interfaces/IShowDialogProps.html +2 -2
  66. package/docs/interfaces/ITiles.html +2 -2
  67. package/docs/interfaces/ITilesProps.html +3 -2
  68. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  69. package/docs/variables/DattaTable.html +1 -1
  70. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  71. package/package.json +2 -2
@@ -40,8 +40,10 @@ export interface IValidateLookupsProps {
40
40
  export declare class ListConfig {
41
41
  private static InternalFields;
42
42
  static createLookupListData(props: ICreateLookupData): PromiseLike<void>;
43
+ static fixMMSFields(webUrl: string, listName: string): PromiseLike<void>;
43
44
  static generate(props: IListConfigProps): PromiseLike<IListConfig>;
44
45
  static generateLookupListData(props: IGenerateLookupDataProps): PromiseLike<ILookupData[]>;
46
+ private static getMMSLookupListId;
45
47
  static readList(webUrl: string, listName: string, lookupField: string): PromiseLike<ILookupData>;
46
48
  static validateLookups(props: IValidateLookupsProps): PromiseLike<Helper.ISPConfigProps>;
47
49
  }
@@ -103,6 +103,59 @@ var ListConfig = /** @class */ (function () {
103
103
  });
104
104
  });
105
105
  };
106
+ // Fixes the MMS fields to ensure the list property is configured correctly
107
+ ListConfig.fixMMSFields = function (webUrl, listName) {
108
+ var _this = this;
109
+ // Return a promise
110
+ return new Promise(function (resolve, reject) {
111
+ // Show a loading dialog
112
+ loadingDialog_1.LoadingDialog.setHeader("Validating MMS Fields");
113
+ loadingDialog_1.LoadingDialog.setBody("Getting the list '" + listName + "' fields...");
114
+ loadingDialog_1.LoadingDialog.show();
115
+ // Get the hidden list
116
+ _this.getMMSLookupListId(webUrl).then(function (listId) {
117
+ var mmsListId = "{" + listId + "}";
118
+ // Load the list fields
119
+ (0, gd_sprest_bs_1.Web)(webUrl).Lists(listName).Fields().execute(function (fields) {
120
+ // Parse the fields
121
+ gd_sprest_bs_1.Helper.Executor(fields.results, function (field) {
122
+ // See if this is not a MMS field
123
+ if (field.TypeDisplayName != "Managed Metadata") {
124
+ return;
125
+ }
126
+ // Return a promise
127
+ return new Promise(function (resolve) {
128
+ // Get the schema for this field
129
+ var parser = new DOMParser();
130
+ var schemaXml = parser.parseFromString(field.SchemaXml, "application/xml");
131
+ var xmlField = schemaXml.querySelector("Field");
132
+ // See if the list property is correct
133
+ if (xmlField.getAttribute("List") == mmsListId) {
134
+ // Check the next field
135
+ resolve(null);
136
+ }
137
+ else {
138
+ // Update the list property
139
+ xmlField.setAttribute("List", mmsListId);
140
+ // Update the schema value and check the next field
141
+ field.update({ SchemaXml: xmlField.outerHTML }).execute(resolve, function () {
142
+ // Log the error
143
+ console.error("Error updating the MMS list property for field: " + field.InternalName);
144
+ // Check the next field
145
+ resolve(null);
146
+ });
147
+ }
148
+ });
149
+ }).then(resolve, reject);
150
+ }, reject);
151
+ }, function () {
152
+ // Error getting the list data
153
+ console.error("Error getting the taxonomy hidden list.");
154
+ // Resolve the request
155
+ resolve();
156
+ });
157
+ });
158
+ };
106
159
  // Generates the list configuration
107
160
  ListConfig.generate = function (props) {
108
161
  var _this = this;
@@ -467,6 +520,17 @@ var ListConfig = /** @class */ (function () {
467
520
  }, reject);
468
521
  });
469
522
  };
523
+ // Gets the taxonomy hidden list
524
+ ListConfig.getMMSLookupListId = function (webUrl) {
525
+ // Return a promise
526
+ return new Promise(function (resolve, reject) {
527
+ // Query the web for the hidden list
528
+ (0, gd_sprest_bs_1.Web)(webUrl).Lists("TaxonomyHiddenList").execute(function (list) {
529
+ // Resolve the request
530
+ resolve(list.Id);
531
+ }, reject);
532
+ });
533
+ };
470
534
  // Generates the lookup list data
471
535
  ListConfig.readList = function (webUrl, listName, lookupField) {
472
536
  // Return a promise
@@ -94,8 +94,9 @@ export interface IDashboardProps {
94
94
  filterFields?: string[];
95
95
  items: any[];
96
96
  onBodyRendered?: (el?: HTMLElement, item?: any) => void;
97
+ onCardBodyRendering?: (cardBody?: Components.ICardBody, item?: any) => void;
97
98
  onCardRendered?: (el?: HTMLElement, item?: any) => void;
98
- onCardRendering?: (item?: Components.ICardProps) => void;
99
+ onCardRendering?: (cardProps?: Components.ICardProps, item?: any) => void;
99
100
  onClick?: (el?: HTMLElement, item?: Components.ICardBody) => void;
100
101
  onColumnRendered?: (el?: HTMLElement, item?: any) => void;
101
102
  onFooterRendered?: (el?: HTMLElement, item?: any) => void;
@@ -13,8 +13,9 @@ export interface ITilesProps {
13
13
  filterFields?: string[];
14
14
  items: any[];
15
15
  onBodyRendered?: (el?: HTMLElement, item?: any) => void;
16
+ onCardBodyRendering?: (cardBody?: Components.ICardBody, item?: any) => void;
16
17
  onCardRendered?: (el?: HTMLElement, item?: any) => void;
17
- onCardRendering?: (item?: Components.ICardProps) => void;
18
+ onCardRendering?: (cardProps?: Components.ICardProps, item?: any) => void;
18
19
  onClick?: (el?: HTMLElement, item?: Components.ICardBody) => void;
19
20
  onColumnRendered?: (el?: HTMLElement, item?: any) => void;
20
21
  onFooterRendered?: (el?: HTMLElement, item?: any) => void;
@@ -152,8 +152,9 @@ var Tiles = /** @class */ (function () {
152
152
  }
153
153
  };
154
154
  }
155
- // Call the event
156
- this._props.onCardRendering ? this._props.onCardRendering(cardProps) : null;
155
+ // Call the events
156
+ this._props.onCardBodyRendering ? this._props.onCardBodyRendering(cardProps.body[0], item) : null;
157
+ this._props.onCardRendering ? this._props.onCardRendering(cardProps, item) : null;
157
158
  // Return the card properties
158
159
  return cardProps;
159
160
  };