gd-sprest 7.5.3 → 7.5.4

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.
@@ -62,10 +62,11 @@ export interface IListForm {
62
62
 
63
63
  /**
64
64
  * Method to show the file dialog.
65
+ * @param accept - The acceptable file extensions to allow.
65
66
  * @param info - The list form information.
66
67
  * @param onSave - The save event triggered when a file is uploaded to the item.
67
68
  */
68
- showFileDialog(info: IListFormResult, onSave?: (IListFormAttachmentInfo) => void): PromiseLike<IListFormResult>;
69
+ showFileDialog(accept?: string[], info: IListFormResult, onSave?: (IListFormAttachmentInfo) => void): PromiseLike<IListFormResult>;
69
70
  }
70
71
 
71
72
  /**
@@ -543,7 +543,7 @@ exports.ListForm = {
543
543
  });
544
544
  },
545
545
  // Method to show a file dialog
546
- showFileDialog: function (info, onSave) {
546
+ showFileDialog: function (accept, info, onSave) {
547
547
  // Return a promise
548
548
  return new Promise(function (resolve, reject) {
549
549
  // Method to add an attachment
@@ -612,6 +612,7 @@ exports.ListForm = {
612
612
  if (el == null) {
613
613
  el = document.createElement("input");
614
614
  // Set the properties
615
+ el.accept = accept ? accept.join(',') : null;
615
616
  el.id = "listform-attachment";
616
617
  el.type = "file";
617
618
  el.hidden = true;
package/build/rest.js CHANGED
@@ -8,7 +8,7 @@ var sptypes_1 = require("./sptypes");
8
8
  * SharePoint REST Library
9
9
  */
10
10
  exports.$REST = {
11
- __ver: 7.53,
11
+ __ver: 7.54,
12
12
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
13
13
  Apps: Lib.Apps,
14
14
  ContextInfo: Lib.ContextInfo,
@@ -2336,10 +2336,11 @@ declare module 'gd-sprest/helper/listForm' {
2336
2336
 
2337
2337
  /**
2338
2338
  * Method to show the file dialog.
2339
+ * @param accept - The acceptable file extensions to allow.
2339
2340
  * @param info - The list form information.
2340
2341
  * @param onSave - The save event triggered when a file is uploaded to the item.
2341
2342
  */
2342
- showFileDialog(info: IListFormResult, onSave?: (IListFormAttachmentInfo) => void): PromiseLike<IListFormResult>;
2343
+ showFileDialog(accept?: string[], info: IListFormResult, onSave?: (IListFormAttachmentInfo) => void): PromiseLike<IListFormResult>;
2343
2344
  }
2344
2345
 
2345
2346
  /**