gd-sprest 9.7.2 → 9.7.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.
Files changed (100) hide show
  1. package/@types/utils/base.d.ts +0 -3
  2. package/build/helper/executor.js +10 -20
  3. package/build/helper/fieldSchemaXML.js +85 -89
  4. package/build/helper/index.js +12 -28
  5. package/build/helper/jslink.js +124 -128
  6. package/build/helper/listForm.js +109 -118
  7. package/build/helper/listFormField.js +62 -65
  8. package/build/helper/methods/addContentEditorWebPart.js +9 -17
  9. package/build/helper/methods/addPermissionLevel.js +12 -16
  10. package/build/helper/methods/addScriptEditorWebPart.js +9 -17
  11. package/build/helper/methods/copyPermissionLevel.js +22 -26
  12. package/build/helper/methods/createContentType.js +96 -19
  13. package/build/helper/methods/createDocSet.js +10 -14
  14. package/build/helper/methods/getCurrentTheme.js +26 -31
  15. package/build/helper/methods/hasPermissions.js +8 -13
  16. package/build/helper/methods/index.js +16 -32
  17. package/build/helper/methods/loadSPCore.js +13 -17
  18. package/build/helper/methods/parse.js +5 -9
  19. package/build/helper/methods/request.js +4 -8
  20. package/build/helper/methods/setContentTypeFields.js +71 -79
  21. package/build/helper/methods/setGroupOwner.js +6 -10
  22. package/build/helper/methods/setWebProperty.js +26 -30
  23. package/build/helper/methods/stringify.js +3 -7
  24. package/build/helper/methods/webWorker.js +40 -20
  25. package/build/helper/ribbonLink.js +10 -14
  26. package/build/helper/sbLink.js +11 -15
  27. package/build/helper/sp/calloutManager.js +22 -25
  28. package/build/helper/sp/index.js +13 -16
  29. package/build/helper/sp/modalDialog.js +32 -35
  30. package/build/helper/sp/notify.js +9 -12
  31. package/build/helper/sp/ribbon.js +1 -4
  32. package/build/helper/sp/sod.js +9 -18
  33. package/build/helper/sp/status.js +18 -21
  34. package/build/helper/spCfg.js +232 -259
  35. package/build/helper/spCfgTypes.js +2 -5
  36. package/build/helper/taxonomy.js +144 -182
  37. package/build/helper/webpart.js +110 -94
  38. package/build/index.js +6 -23
  39. package/build/lib/apps.js +4 -7
  40. package/build/lib/contextInfo.js +217 -781
  41. package/build/lib/directorySession.js +4 -7
  42. package/build/lib/graph.js +16 -19
  43. package/build/lib/groupService.js +4 -7
  44. package/build/lib/groupSiteManager.js +4 -7
  45. package/build/lib/hubSites.js +11 -25
  46. package/build/lib/hubSitesUtility.js +4 -7
  47. package/build/lib/index.js +27 -43
  48. package/build/lib/list.js +49 -53
  49. package/build/lib/navigation.js +4 -7
  50. package/build/lib/peopleManager.js +4 -7
  51. package/build/lib/peoplePicker.js +4 -7
  52. package/build/lib/profileLoader.js +4 -7
  53. package/build/lib/search.js +30 -33
  54. package/build/lib/sensitivityLabels.js +6 -9
  55. package/build/lib/site.js +20 -35
  56. package/build/lib/siteIconManager.js +4 -7
  57. package/build/lib/siteManager.js +4 -7
  58. package/build/lib/sitePages.js +37 -51
  59. package/build/lib/socialFeed.js +13 -16
  60. package/build/lib/themeManager.js +4 -7
  61. package/build/lib/userProfile.js +4 -7
  62. package/build/lib/utility.js +12 -17
  63. package/build/lib/web.js +34 -49
  64. package/build/lib/webTemplateExtensions.js +4 -7
  65. package/build/lib/wfInstanceService.js +4 -7
  66. package/build/lib/wfSubscriptionService.js +4 -7
  67. package/build/mapper/custom/audit.js +3 -6
  68. package/build/mapper/custom/graph.js +13 -16
  69. package/build/mapper/custom/index.js +8 -24
  70. package/build/mapper/custom/odata.js +3 -6
  71. package/build/mapper/custom/old.js +42 -45
  72. package/build/mapper/custom/peoplePicker.js +4 -7
  73. package/build/mapper/custom/propertyValues.js +3 -6
  74. package/build/mapper/custom/utility.js +17 -20
  75. package/build/mapper/custom/webTemplateExtensions.js +19 -22
  76. package/build/mapper/def.js +1032 -989
  77. package/build/mapper/index.js +4 -9
  78. package/build/mapper/v2.js +2629 -2632
  79. package/build/rest.js +16 -19
  80. package/build/sptypes/graphtypes.js +694 -710
  81. package/build/sptypes/index.js +3 -7
  82. package/build/sptypes/sptypes.js +49 -52
  83. package/build/utils/base.js +20 -37
  84. package/build/utils/batch.js +53 -63
  85. package/build/utils/helper.js +79 -83
  86. package/build/utils/index.js +9 -25
  87. package/build/utils/methodInfo.js +88 -141
  88. package/build/utils/oData.js +62 -112
  89. package/build/utils/request.js +137 -155
  90. package/build/utils/requestType.js +1 -4
  91. package/build/utils/targetInfo.js +39 -52
  92. package/build/utils/xhrRequest.js +59 -107
  93. package/build/v2/drive.js +9 -13
  94. package/build/v2/drives.js +8 -12
  95. package/build/v2/index.js +3 -19
  96. package/build/v2/sites.js +61 -65
  97. package/dist/gd-sprest.d.ts +0 -3
  98. package/dist/gd-sprest.js +1 -1
  99. package/dist/gd-sprest.min.js +1 -1
  100. package/package.json +2 -2
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RibbonLink = void 0;
4
1
  /**
5
2
  * Ribbon Link
6
3
  */
7
- var RibbonLink = function (props) {
4
+ export const RibbonLink = (props) => {
8
5
  // Creates the ribbon link
9
- var create = function () {
10
- var link = null;
6
+ let create = () => {
7
+ let link = null;
11
8
  // Default the append flag
12
- var appendFl = typeof (props.appendFl) === "boolean" ? props.appendFl : false;
9
+ let appendFl = typeof (props.appendFl) === "boolean" ? props.appendFl : false;
13
10
  // Get the link
14
11
  link = _elTopBar.querySelector("#" + props.id);
15
12
  if (link == null) {
@@ -27,8 +24,8 @@ var RibbonLink = function (props) {
27
24
  return link;
28
25
  };
29
26
  // Gets the top bar element
30
- var _elTopBar = null;
31
- var getTopBar = function () {
27
+ let _elTopBar = null;
28
+ let getTopBar = () => {
32
29
  // See if the bar exists
33
30
  if (_elTopBar == null) {
34
31
  // Set the element
@@ -38,11 +35,11 @@ var RibbonLink = function (props) {
38
35
  return _elTopBar;
39
36
  };
40
37
  // Return a promise
41
- return new Promise(function (resolve, reject) {
38
+ return new Promise((resolve, reject) => {
42
39
  // See if the top bar exists
43
40
  if (getTopBar()) {
44
41
  // Create the link
45
- var el = create();
42
+ let el = create();
46
43
  if (el) {
47
44
  // Resolve the promise
48
45
  resolve(el);
@@ -50,11 +47,11 @@ var RibbonLink = function (props) {
50
47
  }
51
48
  else if (window) {
52
49
  // Wait for the window to be loaded
53
- window.addEventListener("load", function () {
50
+ window.addEventListener("load", () => {
54
51
  // See if the top bar exists
55
52
  if (getTopBar()) {
56
53
  // Create the link
57
- var el = create();
54
+ let el = create();
58
55
  if (el) {
59
56
  // Resolve the promise
60
57
  resolve(el);
@@ -64,4 +61,3 @@ var RibbonLink = function (props) {
64
61
  }
65
62
  });
66
63
  };
67
- exports.RibbonLink = RibbonLink;
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SuiteBarLink = void 0;
4
1
  /**
5
2
  * Suite Bar Link
6
3
  */
7
- var SuiteBarLink = function (props) {
4
+ export const SuiteBarLink = (props) => {
8
5
  // Creates the ribbon link
9
- var create = function () {
6
+ let create = () => {
10
7
  // Default the append flag
11
- var appendFl = typeof (props.appendFl) === "boolean" ? props.appendFl : true;
8
+ let appendFl = typeof (props.appendFl) === "boolean" ? props.appendFl : true;
12
9
  // Query for the link, and ensure it exists
13
- var link = _elTopLinks.querySelector("#" + props.id);
10
+ let link = _elTopLinks.querySelector("#" + props.id);
14
11
  if (link == null) {
15
12
  // Create a list link
16
13
  link = document.createElement("a");
@@ -20,7 +17,7 @@ var SuiteBarLink = function (props) {
20
17
  link.innerHTML = props.title;
21
18
  link.onclick = props.onClick;
22
19
  // Create the suite bar link
23
- var sbLink = document.createElement("li");
20
+ let sbLink = document.createElement("li");
24
21
  sbLink.className = "ms-core-suiteLink";
25
22
  sbLink.appendChild(link);
26
23
  // Append the item to the list
@@ -30,8 +27,8 @@ var SuiteBarLink = function (props) {
30
27
  return link;
31
28
  };
32
29
  // Gets the top links element
33
- var _elTopLinks = null;
34
- var getTopLinks = function () {
30
+ let _elTopLinks = null;
31
+ let getTopLinks = () => {
35
32
  // See if the bar exists
36
33
  if (_elTopLinks == null) {
37
34
  // Set the element
@@ -41,11 +38,11 @@ var SuiteBarLink = function (props) {
41
38
  return _elTopLinks;
42
39
  };
43
40
  // Return a promise
44
- return new Promise(function (resolve, reject) {
41
+ return new Promise((resolve, reject) => {
45
42
  // See if the top links exists
46
43
  if (getTopLinks()) {
47
44
  // Create the link
48
- var el = create();
45
+ let el = create();
49
46
  if (el) {
50
47
  // Resolve the promise
51
48
  resolve(el);
@@ -53,11 +50,11 @@ var SuiteBarLink = function (props) {
53
50
  }
54
51
  else if (window) {
55
52
  // Wait for the window to be loaded
56
- window.addEventListener("load", function () {
53
+ window.addEventListener("load", () => {
57
54
  // See if the top links exists
58
55
  if (getTopLinks()) {
59
56
  // Create the link
60
- var el = create();
57
+ let el = create();
61
58
  if (el) {
62
59
  // Resolve the promise
63
60
  resolve(el);
@@ -67,4 +64,3 @@ var SuiteBarLink = function (props) {
67
64
  }
68
65
  });
69
66
  };
70
- exports.SuiteBarLink = SuiteBarLink;
@@ -1,28 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CalloutManager = void 0;
4
1
  /**
5
2
  * Callout Manager
6
3
  */
7
- exports.CalloutManager = (function () {
4
+ export const CalloutManager = (() => {
8
5
  // Return the callout manager
9
6
  return {
10
7
  /** Closes all callouts on the page. */
11
- closeAll: function () {
8
+ closeAll: () => {
12
9
  // Load the library and call the method
13
10
  return window["CalloutManager"].closeAll();
14
11
  },
15
12
  /** Returns true if the associated callout is open. */
16
- containsOneCalloutOpen: function (el) {
13
+ containsOneCalloutOpen: (el) => {
17
14
  // Load the library and call the method
18
15
  return window["CalloutManager"].containsOneCalloutOpen(el);
19
16
  },
20
17
  /** Returns an callout action entry. */
21
- createAction: function (options) {
18
+ createAction: (options) => {
22
19
  // Create the callout action options entry
23
- var caOptions = new window["CalloutActionOptions"]();
20
+ let caOptions = new window["CalloutActionOptions"]();
24
21
  // Update the options
25
- for (var key in options) {
22
+ for (let key in options) {
26
23
  // Set the option
27
24
  caOptions[key] = options[key];
28
25
  }
@@ -30,11 +27,11 @@ exports.CalloutManager = (function () {
30
27
  return new window["CalloutAction"](caOptions);
31
28
  },
32
29
  /** Returns an callout action menu entries. */
33
- createMenuEntries: function (entries) {
34
- var menuEntries = [];
30
+ createMenuEntries: (entries) => {
31
+ let menuEntries = [];
35
32
  // Parse the action options
36
- for (var i = 0; i < entries.length; i++) {
37
- var entry = entries[i];
33
+ for (let i = 0; i < entries.length; i++) {
34
+ let entry = entries[i];
38
35
  // Add the action
39
36
  menuEntries.push(new window["CalloutActionMenuEntry"](entry.text, entry.onClickCallback, entry.iconUrl));
40
37
  }
@@ -42,51 +39,51 @@ exports.CalloutManager = (function () {
42
39
  return menuEntries;
43
40
  },
44
41
  /** Creates a new callout. */
45
- createNew: function (options) {
42
+ createNew: (options) => {
46
43
  // Load the library and call the method
47
44
  return window["CalloutManager"].createNew(options);
48
45
  },
49
46
  /** Checks if the callout id exists, before creating it. */
50
- createNewIfNecessary: function (options) {
47
+ createNewIfNecessary: (options) => {
51
48
  // Load the library and call the method
52
49
  return window["CalloutManager"].createNewIfNecessary(options);
53
50
  },
54
51
  /** Performs an action on each callout on the page. */
55
- forEach: function (callback) {
52
+ forEach: (callback) => {
56
53
  // Load the library and call the method
57
54
  return window["CalloutManager"].forEach(callback);
58
55
  },
59
56
  /** Finds the closest launch point and returns the callout associated with it. */
60
- getFromCalloutDescendant: function (descendant) {
57
+ getFromCalloutDescendant: (descendant) => {
61
58
  return window["CalloutManager"].getFromCalloutDescendant(descendant);
62
59
  },
63
60
  /** Returns the callout from the specified launch point. */
64
- getFromLaunchPoint: function (launchPoint) {
61
+ getFromLaunchPoint: (launchPoint) => {
65
62
  return window["CalloutManager"].getFromLaunchPoint(launchPoint);
66
63
  },
67
64
  /** Returns the callout for the specified launch point, null if it doesn't exist. */
68
- getFromLaunchPointIfExists: function (launchPoint) {
65
+ getFromLaunchPointIfExists: (launchPoint) => {
69
66
  return window["CalloutManager"].getFromLaunchPointIfExists(launchPoint);
70
67
  },
71
68
  /** Returns true if at least one callout is defined on the page is opened or opening. */
72
- isAtLeastOneCalloutOn: function () {
69
+ isAtLeastOneCalloutOn: () => {
73
70
  return window["CalloutManager"].isAtLeastOneCalloutOn();
74
71
  },
75
72
  /** Returns true if at least one callout is opened on the page. */
76
- isAtLeastOneCalloutOpen: function () {
73
+ isAtLeastOneCalloutOpen: () => {
77
74
  return window["CalloutManager"].isAtLeastOneCalloutOpen();
78
75
  },
79
76
  // Ensures the core library is loaded
80
- init: function () {
77
+ init: () => {
81
78
  // Return a promise
82
- return new Promise(function (resolve, reject) {
79
+ return new Promise((resolve, reject) => {
83
80
  // See if the class exists
84
81
  if (window["CalloutManager"]) {
85
82
  resolve();
86
83
  }
87
84
  else {
88
85
  // Wait for the core script to be loaded
89
- window["SP"].SOD.executeFunc("callout.js", "Callout", function () {
86
+ window["SP"].SOD.executeFunc("callout.js", "Callout", () => {
90
87
  // Resolve the promise
91
88
  resolve();
92
89
  });
@@ -94,7 +91,7 @@ exports.CalloutManager = (function () {
94
91
  });
95
92
  },
96
93
  /** Removes the callout and destroys it. */
97
- remove: function (callout) {
94
+ remove: (callout) => {
98
95
  // Load the library and call the method
99
96
  return window["CalloutManager"].remove(callout);
100
97
  }
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SP = void 0;
4
- var calloutManager_1 = require("./calloutManager");
5
- var modalDialog_1 = require("./modalDialog");
6
- var notify_1 = require("./notify");
7
- var ribbon_1 = require("./ribbon");
8
- var sod_1 = require("./sod");
9
- var status_1 = require("./status");
10
- exports.SP = {
11
- CalloutManager: calloutManager_1.CalloutManager,
12
- ModalDialog: modalDialog_1.ModalDialog,
13
- Notify: notify_1.Notify,
14
- Ribbon: ribbon_1.Ribbon,
15
- SOD: sod_1.SOD,
16
- Status: status_1.Status
1
+ import { CalloutManager } from "./calloutManager";
2
+ import { ModalDialog } from "./modalDialog";
3
+ import { Notify } from "./notify";
4
+ import { Ribbon } from "./ribbon";
5
+ import { SOD } from "./sod";
6
+ import { Status } from "./status";
7
+ export const SP = {
8
+ CalloutManager,
9
+ ModalDialog,
10
+ Notify,
11
+ Ribbon,
12
+ SOD,
13
+ Status
17
14
  };
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModalDialog = void 0;
4
1
  /**
5
2
  * Modal Dialog
6
3
  */
7
- exports.ModalDialog = (function () {
4
+ export const ModalDialog = (() => {
8
5
  // Adds the custom methods to the dialog
9
- var getDialog = function (dialog) {
6
+ let getDialog = (dialog) => {
10
7
  // Shows the dialog
11
- dialog.show = function () {
8
+ dialog.show = () => {
12
9
  // Get the modal dialog element
13
- var el = dialog.get_dialogElement();
10
+ let el = dialog.get_dialogElement();
14
11
  if (el) {
15
12
  // Show the dialog
16
13
  el.style.display = "";
@@ -23,10 +20,10 @@ exports.ModalDialog = (function () {
23
20
  }
24
21
  };
25
22
  // Updates the title
26
- dialog.setTitle = function (value) {
23
+ dialog.setTitle = (value) => {
27
24
  // Get the title element
28
- var elDlg = dialog.get_dialogElement();
29
- var elTitle = elDlg ? elDlg.querySelector(".ms-dlgLoadingTextDiv .ms-core-pageTitle") : null;
25
+ let elDlg = dialog.get_dialogElement();
26
+ let elTitle = elDlg ? elDlg.querySelector(".ms-dlgLoadingTextDiv .ms-core-pageTitle") : null;
30
27
  elTitle = elTitle || elDlg.querySelector(".ms-dlgTitle .ms-dlgTitleText");
31
28
  if (elTitle) {
32
29
  // Update the title
@@ -34,10 +31,10 @@ exports.ModalDialog = (function () {
34
31
  }
35
32
  };
36
33
  // Updates the sub-title
37
- dialog.setSubTitle = function (value) {
34
+ dialog.setSubTitle = (value) => {
38
35
  // Get the sub-title element
39
- var elDlg = dialog.get_dialogElement();
40
- var elSubTitle = elDlg ? elDlg.querySelector(".ms-dlgLoadingTextDiv ~ div") : null;
36
+ let elDlg = dialog.get_dialogElement();
37
+ let elSubTitle = elDlg ? elDlg.querySelector(".ms-dlgLoadingTextDiv ~ div") : null;
41
38
  if (elSubTitle) {
42
39
  // Update the sub-title
43
40
  elSubTitle.innerHTML = value;
@@ -49,26 +46,26 @@ exports.ModalDialog = (function () {
49
46
  // Return the modal dialog
50
47
  return {
51
48
  // Close the dialog
52
- commonModalDialogClose: function (dialogResult, returnVal) {
49
+ commonModalDialogClose: (dialogResult, returnVal) => {
53
50
  // Load the library and call the method
54
- exports.ModalDialog.load().then(function () { window["SP"].UI.ModalDialog.commonModalDialogClose(dialogResult, returnVal); });
51
+ ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.commonModalDialogClose(dialogResult, returnVal); });
55
52
  },
56
53
  // Open a dialog
57
- commonModalDialogOpen: function (url, options, callback, args) {
54
+ commonModalDialogOpen: (url, options, callback, args) => {
58
55
  // Load the library and call the method
59
- exports.ModalDialog.load().then(function () { window["SP"].UI.ModalDialog.commonModalDialogOpen(url, options, callback, args); });
56
+ ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.commonModalDialogOpen(url, options, callback, args); });
60
57
  },
61
58
  // Method to ensure the core library is loaded
62
- load: function () {
59
+ load: () => {
63
60
  // Return a promise
64
- return new Promise(function (resolve, reject) {
61
+ return new Promise((resolve, reject) => {
65
62
  // See if the class exists
66
63
  if (window["SP"] && window["SP"].UI && window["SP"].UI.ModalDialog) {
67
64
  resolve();
68
65
  }
69
66
  else {
70
67
  // Wait for the core script to be loaded
71
- window["SP"].SOD.executeFunc("sp.js", "SP.UI.ModalDialog", function () {
68
+ window["SP"].SOD.executeFunc("sp.js", "SP.UI.ModalDialog", () => {
72
69
  // Resolve the promise
73
70
  resolve();
74
71
  });
@@ -76,48 +73,48 @@ exports.ModalDialog = (function () {
76
73
  });
77
74
  },
78
75
  // Opens a pop-up page
79
- OpenPopUpPage: function (url, callback, width, height) {
76
+ OpenPopUpPage: (url, callback, width, height) => {
80
77
  // Load the library and call the method
81
- exports.ModalDialog.load().then(function () { window["SP"].UI.ModalDialog.OpenPopUpPage(url, callback, width, height); });
78
+ ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.OpenPopUpPage(url, callback, width, height); });
82
79
  },
83
80
  // Refreshes the page
84
- RefreshPage: function (dialogResult) {
81
+ RefreshPage: (dialogResult) => {
85
82
  // Load the library and call the method
86
- exports.ModalDialog.load().then(function () { window["SP"].UI.ModalDialog.RefreshPage(dialogResult); });
83
+ ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.RefreshPage(dialogResult); });
87
84
  },
88
85
  // Shows a modal dialog
89
- showModalDialog: function (options) {
86
+ showModalDialog: (options) => {
90
87
  // Return a promise
91
- return new Promise(function (resolve) {
88
+ return new Promise((resolve) => {
92
89
  // Load the library and call the method
93
- exports.ModalDialog.load().then(function () {
90
+ ModalDialog.load().then(() => {
94
91
  // Resolve the promise
95
92
  resolve(getDialog(window["SP"].UI.ModalDialog.showModalDialog(options)));
96
93
  });
97
94
  });
98
95
  },
99
96
  // Shows a pop-up dialog
100
- ShowPopupDialog: function (url) {
97
+ ShowPopupDialog: (url) => {
101
98
  // Load the library and call the method
102
- exports.ModalDialog.load().then(function () { window["SP"].UI.ModalDialog.ShowPopupDialog(url); });
99
+ ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.ShowPopupDialog(url); });
103
100
  },
104
101
  // Shows a wait screen
105
- showWaitScreenSize: function (title, message, callback, height, width) {
102
+ showWaitScreenSize: (title, message, callback, height, width) => {
106
103
  // Return a promise
107
- return new Promise(function (resolve) {
104
+ return new Promise((resolve) => {
108
105
  // Load the library and call the method
109
- exports.ModalDialog.load().then(function () {
106
+ ModalDialog.load().then(() => {
110
107
  // Resolve the promise
111
108
  resolve(getDialog(window["SP"].UI.ModalDialog.showWaitScreenSize(title, message, callback, height, width)));
112
109
  });
113
110
  });
114
111
  },
115
112
  // Shows a wait screen w/ no close button
116
- showWaitScreenWithNoClose: function (title, message, height, width) {
113
+ showWaitScreenWithNoClose: (title, message, height, width) => {
117
114
  // Return a promise
118
- return new Promise(function (resolve) {
115
+ return new Promise((resolve) => {
119
116
  // Load the library and call the method
120
- exports.ModalDialog.load().then(function () {
117
+ ModalDialog.load().then(() => {
121
118
  // Resolve the promise
122
119
  resolve(getDialog(window["SP"].UI.ModalDialog.showWaitScreenWithNoClose(title, message, height, width)));
123
120
  });
@@ -1,29 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Notify = void 0;
4
1
  /**
5
2
  * Notification
6
3
  */
7
- exports.Notify = {
4
+ export const Notify = {
8
5
  // Adds a notification
9
- addNotification: function (html, sticky) {
6
+ addNotification: (html, sticky) => {
10
7
  // Return a promise
11
- return new Promise(function (resolve, reject) {
8
+ return new Promise((resolve, reject) => {
12
9
  // Load the library and call the method
13
- exports.Notify.load().then(function () { resolve(window["SP"].UI.Notify.addNotification(html, sticky)); });
10
+ Notify.load().then(() => { resolve(window["SP"].UI.Notify.addNotification(html, sticky)); });
14
11
  });
15
12
  },
16
13
  // Method to ensure the core library is loaded
17
- load: function () {
14
+ load: () => {
18
15
  // Return a promise
19
- return new Promise(function (resolve, reject) {
16
+ return new Promise((resolve, reject) => {
20
17
  // See if the class exists
21
18
  if (window["SP"] && window["SP"].UI && window["SP"].UI.Notify) {
22
19
  resolve();
23
20
  }
24
21
  else {
25
22
  // Wait for the core script to be loaded
26
- window["SP"].SOD.executeFunc("sp.js", "SP.UI.Notify", function () {
23
+ window["SP"].SOD.executeFunc("sp.js", "SP.UI.Notify", () => {
27
24
  // Resolve the promise
28
25
  resolve();
29
26
  });
@@ -31,8 +28,8 @@ exports.Notify = {
31
28
  });
32
29
  },
33
30
  // Removes a notification
34
- removeNotification: function (id) {
31
+ removeNotification: (id) => {
35
32
  // Load the library and call the method
36
- exports.Notify.load().then(function () { window["SP"].UI.Notify.removeNotification(id); });
33
+ Notify.load().then(() => { window["SP"].UI.Notify.removeNotification(id); });
37
34
  }
38
35
  };
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Ribbon = void 0;
4
1
  /**
5
2
  * Ribbon
6
3
  */
7
- exports.Ribbon = {
4
+ export const Ribbon = {
8
5
  get exists() { return window["Ribbon"] != null && window["Ribbon"].PageState != null; },
9
6
  PageState: {
10
7
  Handlers: {
@@ -1,30 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SOD = void 0;
4
1
  /**
5
2
  * Script on Demand (SOD)
6
3
  */
7
- exports.SOD = {
4
+ export const SOD = {
8
5
  // Executes the specified function in the specified file with the optional arguments.
9
- execute: function (key, functionName) {
10
- var args = [];
11
- for (var _i = 2; _i < arguments.length; _i++) {
12
- args[_i - 2] = arguments[_i];
13
- }
14
- window["SP"] ? window["SP"].SOD.execute(key, functionName, args) : null;
15
- },
6
+ execute: (key, functionName, ...args) => { window["SP"] ? window["SP"].SOD.execute(key, functionName, args) : null; },
16
7
  // Ensures that the specified file that contains the specified function is loaded and then runs the specified callback function.
17
- executeFunc: function (key, functionName, fn) { window["SP"] ? window["SP"].SOD.executeFunc(key, functionName, fn) : null; },
8
+ executeFunc: (key, functionName, fn) => { window["SP"] ? window["SP"].SOD.executeFunc(key, functionName, fn) : null; },
18
9
  // Executes the specified function if the specified event has occurred; otherwise, adds the function to the pending job queue.
19
- executeOrDelayUntilEventNotified: function (func, eventName) { window["SP"] ? window["SP"].SOD.executeOrDelayUntilEventNotified(func, eventName) : null; },
10
+ executeOrDelayUntilEventNotified: (func, eventName) => { window["SP"] ? window["SP"].SOD.executeOrDelayUntilEventNotified(func, eventName) : null; },
20
11
  // Executes the specified function if the file containing it is loaded; otherwise, adds it to the pending job queue.
21
- executeOrDelayUntilScriptLoaded: function (func, depScriptFileName) { window["SP"] ? window["SP"].SOD.executeOrDelayUntilScriptLoaded(func, depScriptFileName) : null; },
12
+ executeOrDelayUntilScriptLoaded: (func, depScriptFileName) => { window["SP"] ? window["SP"].SOD.executeOrDelayUntilScriptLoaded(func, depScriptFileName) : null; },
22
13
  // Records the event and executes any jobs in the pending job queue that are waiting on the event.
23
- notifyEventAndExecuteWaitingJobs: function (eventName) { window["SP"] ? window["SP"].SOD.notifyEventAndExecuteWaitingJobs(eventName) : null; },
14
+ notifyEventAndExecuteWaitingJobs: (eventName) => { window["SP"] ? window["SP"].SOD.notifyEventAndExecuteWaitingJobs(eventName) : null; },
24
15
  // Records that the script file is loaded and executes any jobs in the pending job queue that are waiting for the script file to be loaded.
25
- notifyScriptLoadedAndExecuteWaitingJobs: function (scriptFileName) { window["SP"] ? window["SP"].SOD.notifyScriptLoadedAndExecuteWaitingJobs(scriptFileName) : null; },
16
+ notifyScriptLoadedAndExecuteWaitingJobs: (scriptFileName) => { window["SP"] ? window["SP"].SOD.notifyScriptLoadedAndExecuteWaitingJobs(scriptFileName) : null; },
26
17
  // Registers the specified file at the specified URL.
27
- registerSod: function (key, url) { window["SP"] ? window["SP"].SOD.registerSod(key, url) : null; },
18
+ registerSod: (key, url) => { window["SP"] ? window["SP"].SOD.registerSod(key, url) : null; },
28
19
  // Registers the specified file as a dependency of another file.
29
- registerSodDep: function (key, dep) { window["SP"] ? window["SP"].SOD.registerSodDep(key, dep) : null; },
20
+ registerSodDep: (key, dep) => { window["SP"] ? window["SP"].SOD.registerSodDep(key, dep) : null; },
30
21
  };
@@ -1,43 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Status = void 0;
4
1
  /**
5
2
  * Status
6
3
  */
7
- exports.Status = {
4
+ export const Status = {
8
5
  // Adds a status
9
- addStatus: function (title, html, prepend) {
6
+ addStatus: (title, html, prepend) => {
10
7
  // Return a promise
11
- return new Promise(function (resolve, reject) {
8
+ return new Promise((resolve, reject) => {
12
9
  // Load the library
13
- exports.Status.load().then(function () {
10
+ Status.load().then(() => {
14
11
  // Add the status and resolve the promise
15
12
  resolve(window["SP"].UI.Status.addStatus(title, html, prepend));
16
13
  });
17
14
  });
18
15
  },
19
16
  // Appends a status
20
- appendStatus: function (id, title, html) {
17
+ appendStatus: (id, title, html) => {
21
18
  // Return a promise
22
- return new Promise(function (resolve, reject) {
19
+ return new Promise((resolve, reject) => {
23
20
  // Load the library
24
- exports.Status.load().then(function () {
21
+ Status.load().then(() => {
25
22
  // Add the status and resolve the promise
26
23
  resolve(window["SP"].UI.Status.appendStatus(id, title, html));
27
24
  });
28
25
  });
29
26
  },
30
27
  // Method to ensure the core library is loaded
31
- load: function () {
28
+ load: () => {
32
29
  // Return a promise
33
- return new Promise(function (resolve, reject) {
30
+ return new Promise((resolve, reject) => {
34
31
  // See if the class exists
35
32
  if (window["SP"] && window["SP"].UI && window["SP"].UI.Status) {
36
33
  resolve();
37
34
  }
38
35
  else {
39
36
  // Wait for the core script to be loaded
40
- window["SP"].SOD.executeFunc("sp.js", "SP.UI.Status", function () {
37
+ window["SP"].SOD.executeFunc("sp.js", "SP.UI.Status", () => {
41
38
  // Resolve the promise
42
39
  resolve();
43
40
  });
@@ -45,23 +42,23 @@ exports.Status = {
45
42
  });
46
43
  },
47
44
  // Removes all status messages
48
- removeAllStatus: function (hide) {
45
+ removeAllStatus: (hide) => {
49
46
  // Load the library and call the method
50
- exports.Status.load().then(function () { window["SP"].UI.Status.removeAllStatus(hide); });
47
+ Status.load().then(() => { window["SP"].UI.Status.removeAllStatus(hide); });
51
48
  },
52
49
  // Removes a status
53
- removeStatus: function (id) {
50
+ removeStatus: (id) => {
54
51
  // Load the library and call the method
55
- exports.Status.load().then(function () { window["SP"].UI.Status.removeStatus(id); });
52
+ Status.load().then(() => { window["SP"].UI.Status.removeStatus(id); });
56
53
  },
57
54
  // Sets the status color
58
- setStatusPriColor: function (id, color) {
55
+ setStatusPriColor: (id, color) => {
59
56
  // Load the library and call the method
60
- exports.Status.load().then(function () { window["SP"].UI.Status.setStatusPriColor(id, color); });
57
+ Status.load().then(() => { window["SP"].UI.Status.setStatusPriColor(id, color); });
61
58
  },
62
59
  // Updates the status
63
- updateStatus: function (id, html) {
60
+ updateStatus: (id, html) => {
64
61
  // Load the library and call the method
65
- exports.Status.load().then(function () { window["SP"].UI.Status.updateStatus(id, html); });
62
+ Status.load().then(() => { window["SP"].UI.Status.updateStatus(id, html); });
66
63
  }
67
64
  };