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.
- package/@types/utils/base.d.ts +0 -3
- package/build/helper/executor.js +10 -20
- package/build/helper/fieldSchemaXML.js +85 -89
- package/build/helper/index.js +12 -28
- package/build/helper/jslink.js +124 -128
- package/build/helper/listForm.js +109 -118
- package/build/helper/listFormField.js +62 -65
- package/build/helper/methods/addContentEditorWebPart.js +9 -17
- package/build/helper/methods/addPermissionLevel.js +12 -16
- package/build/helper/methods/addScriptEditorWebPart.js +9 -17
- package/build/helper/methods/copyPermissionLevel.js +22 -26
- package/build/helper/methods/createContentType.js +96 -19
- package/build/helper/methods/createDocSet.js +10 -14
- package/build/helper/methods/getCurrentTheme.js +26 -31
- package/build/helper/methods/hasPermissions.js +8 -13
- package/build/helper/methods/index.js +16 -32
- package/build/helper/methods/loadSPCore.js +13 -17
- package/build/helper/methods/parse.js +5 -9
- package/build/helper/methods/request.js +4 -8
- package/build/helper/methods/setContentTypeFields.js +71 -79
- package/build/helper/methods/setGroupOwner.js +6 -10
- package/build/helper/methods/setWebProperty.js +26 -30
- package/build/helper/methods/stringify.js +3 -7
- package/build/helper/methods/webWorker.js +40 -20
- package/build/helper/ribbonLink.js +10 -14
- package/build/helper/sbLink.js +11 -15
- package/build/helper/sp/calloutManager.js +22 -25
- package/build/helper/sp/index.js +13 -16
- package/build/helper/sp/modalDialog.js +32 -35
- package/build/helper/sp/notify.js +9 -12
- package/build/helper/sp/ribbon.js +1 -4
- package/build/helper/sp/sod.js +9 -18
- package/build/helper/sp/status.js +18 -21
- package/build/helper/spCfg.js +232 -259
- package/build/helper/spCfgTypes.js +2 -5
- package/build/helper/taxonomy.js +144 -182
- package/build/helper/webpart.js +110 -94
- package/build/index.js +6 -23
- package/build/lib/apps.js +4 -7
- package/build/lib/contextInfo.js +217 -781
- package/build/lib/directorySession.js +4 -7
- package/build/lib/graph.js +16 -19
- package/build/lib/groupService.js +4 -7
- package/build/lib/groupSiteManager.js +4 -7
- package/build/lib/hubSites.js +11 -25
- package/build/lib/hubSitesUtility.js +4 -7
- package/build/lib/index.js +27 -43
- package/build/lib/list.js +49 -53
- package/build/lib/navigation.js +4 -7
- package/build/lib/peopleManager.js +4 -7
- package/build/lib/peoplePicker.js +4 -7
- package/build/lib/profileLoader.js +4 -7
- package/build/lib/search.js +30 -33
- package/build/lib/sensitivityLabels.js +6 -9
- package/build/lib/site.js +20 -35
- package/build/lib/siteIconManager.js +4 -7
- package/build/lib/siteManager.js +4 -7
- package/build/lib/sitePages.js +37 -51
- package/build/lib/socialFeed.js +13 -16
- package/build/lib/themeManager.js +4 -7
- package/build/lib/userProfile.js +4 -7
- package/build/lib/utility.js +12 -17
- package/build/lib/web.js +34 -49
- package/build/lib/webTemplateExtensions.js +4 -7
- package/build/lib/wfInstanceService.js +4 -7
- package/build/lib/wfSubscriptionService.js +4 -7
- package/build/mapper/custom/audit.js +3 -6
- package/build/mapper/custom/graph.js +13 -16
- package/build/mapper/custom/index.js +8 -24
- package/build/mapper/custom/odata.js +3 -6
- package/build/mapper/custom/old.js +42 -45
- package/build/mapper/custom/peoplePicker.js +4 -7
- package/build/mapper/custom/propertyValues.js +3 -6
- package/build/mapper/custom/utility.js +17 -20
- package/build/mapper/custom/webTemplateExtensions.js +19 -22
- package/build/mapper/def.js +1032 -989
- package/build/mapper/index.js +4 -9
- package/build/mapper/v2.js +2629 -2632
- package/build/rest.js +16 -19
- package/build/sptypes/graphtypes.js +694 -710
- package/build/sptypes/index.js +3 -7
- package/build/sptypes/sptypes.js +49 -52
- package/build/utils/base.js +20 -37
- package/build/utils/batch.js +53 -63
- package/build/utils/helper.js +79 -83
- package/build/utils/index.js +9 -25
- package/build/utils/methodInfo.js +88 -141
- package/build/utils/oData.js +62 -112
- package/build/utils/request.js +137 -155
- package/build/utils/requestType.js +1 -4
- package/build/utils/targetInfo.js +39 -52
- package/build/utils/xhrRequest.js +59 -107
- package/build/v2/drive.js +9 -13
- package/build/v2/drives.js +8 -12
- package/build/v2/index.js +3 -19
- package/build/v2/sites.js +61 -65
- package/dist/gd-sprest.d.ts +0 -3
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- 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
|
-
|
|
4
|
+
export const RibbonLink = (props) => {
|
|
8
5
|
// Creates the ribbon link
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
let create = () => {
|
|
7
|
+
let link = null;
|
|
11
8
|
// Default the append flag
|
|
12
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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(
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
42
39
|
// See if the top bar exists
|
|
43
40
|
if (getTopBar()) {
|
|
44
41
|
// Create the link
|
|
45
|
-
|
|
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",
|
|
50
|
+
window.addEventListener("load", () => {
|
|
54
51
|
// See if the top bar exists
|
|
55
52
|
if (getTopBar()) {
|
|
56
53
|
// Create the link
|
|
57
|
-
|
|
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;
|
package/build/helper/sbLink.js
CHANGED
|
@@ -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
|
-
|
|
4
|
+
export const SuiteBarLink = (props) => {
|
|
8
5
|
// Creates the ribbon link
|
|
9
|
-
|
|
6
|
+
let create = () => {
|
|
10
7
|
// Default the append flag
|
|
11
|
-
|
|
8
|
+
let appendFl = typeof (props.appendFl) === "boolean" ? props.appendFl : true;
|
|
12
9
|
// Query for the link, and ensure it exists
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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(
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
45
42
|
// See if the top links exists
|
|
46
43
|
if (getTopLinks()) {
|
|
47
44
|
// Create the link
|
|
48
|
-
|
|
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",
|
|
53
|
+
window.addEventListener("load", () => {
|
|
57
54
|
// See if the top links exists
|
|
58
55
|
if (getTopLinks()) {
|
|
59
56
|
// Create the link
|
|
60
|
-
|
|
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
|
-
|
|
4
|
+
export const CalloutManager = (() => {
|
|
8
5
|
// Return the callout manager
|
|
9
6
|
return {
|
|
10
7
|
/** Closes all callouts on the page. */
|
|
11
|
-
closeAll:
|
|
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:
|
|
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:
|
|
18
|
+
createAction: (options) => {
|
|
22
19
|
// Create the callout action options entry
|
|
23
|
-
|
|
20
|
+
let caOptions = new window["CalloutActionOptions"]();
|
|
24
21
|
// Update the options
|
|
25
|
-
for (
|
|
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:
|
|
34
|
-
|
|
30
|
+
createMenuEntries: (entries) => {
|
|
31
|
+
let menuEntries = [];
|
|
35
32
|
// Parse the action options
|
|
36
|
-
for (
|
|
37
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
57
|
+
getFromCalloutDescendant: (descendant) => {
|
|
61
58
|
return window["CalloutManager"].getFromCalloutDescendant(descendant);
|
|
62
59
|
},
|
|
63
60
|
/** Returns the callout from the specified launch point. */
|
|
64
|
-
getFromLaunchPoint:
|
|
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:
|
|
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:
|
|
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:
|
|
73
|
+
isAtLeastOneCalloutOpen: () => {
|
|
77
74
|
return window["CalloutManager"].isAtLeastOneCalloutOpen();
|
|
78
75
|
},
|
|
79
76
|
// Ensures the core library is loaded
|
|
80
|
-
init:
|
|
77
|
+
init: () => {
|
|
81
78
|
// Return a promise
|
|
82
|
-
return new Promise(
|
|
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",
|
|
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:
|
|
94
|
+
remove: (callout) => {
|
|
98
95
|
// Load the library and call the method
|
|
99
96
|
return window["CalloutManager"].remove(callout);
|
|
100
97
|
}
|
package/build/helper/sp/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
4
|
+
export const ModalDialog = (() => {
|
|
8
5
|
// Adds the custom methods to the dialog
|
|
9
|
-
|
|
6
|
+
let getDialog = (dialog) => {
|
|
10
7
|
// Shows the dialog
|
|
11
|
-
dialog.show =
|
|
8
|
+
dialog.show = () => {
|
|
12
9
|
// Get the modal dialog element
|
|
13
|
-
|
|
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 =
|
|
23
|
+
dialog.setTitle = (value) => {
|
|
27
24
|
// Get the title element
|
|
28
|
-
|
|
29
|
-
|
|
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 =
|
|
34
|
+
dialog.setSubTitle = (value) => {
|
|
38
35
|
// Get the sub-title element
|
|
39
|
-
|
|
40
|
-
|
|
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:
|
|
49
|
+
commonModalDialogClose: (dialogResult, returnVal) => {
|
|
53
50
|
// Load the library and call the method
|
|
54
|
-
|
|
51
|
+
ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.commonModalDialogClose(dialogResult, returnVal); });
|
|
55
52
|
},
|
|
56
53
|
// Open a dialog
|
|
57
|
-
commonModalDialogOpen:
|
|
54
|
+
commonModalDialogOpen: (url, options, callback, args) => {
|
|
58
55
|
// Load the library and call the method
|
|
59
|
-
|
|
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:
|
|
59
|
+
load: () => {
|
|
63
60
|
// Return a promise
|
|
64
|
-
return new Promise(
|
|
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",
|
|
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:
|
|
76
|
+
OpenPopUpPage: (url, callback, width, height) => {
|
|
80
77
|
// Load the library and call the method
|
|
81
|
-
|
|
78
|
+
ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.OpenPopUpPage(url, callback, width, height); });
|
|
82
79
|
},
|
|
83
80
|
// Refreshes the page
|
|
84
|
-
RefreshPage:
|
|
81
|
+
RefreshPage: (dialogResult) => {
|
|
85
82
|
// Load the library and call the method
|
|
86
|
-
|
|
83
|
+
ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.RefreshPage(dialogResult); });
|
|
87
84
|
},
|
|
88
85
|
// Shows a modal dialog
|
|
89
|
-
showModalDialog:
|
|
86
|
+
showModalDialog: (options) => {
|
|
90
87
|
// Return a promise
|
|
91
|
-
return new Promise(
|
|
88
|
+
return new Promise((resolve) => {
|
|
92
89
|
// Load the library and call the method
|
|
93
|
-
|
|
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:
|
|
97
|
+
ShowPopupDialog: (url) => {
|
|
101
98
|
// Load the library and call the method
|
|
102
|
-
|
|
99
|
+
ModalDialog.load().then(() => { window["SP"].UI.ModalDialog.ShowPopupDialog(url); });
|
|
103
100
|
},
|
|
104
101
|
// Shows a wait screen
|
|
105
|
-
showWaitScreenSize:
|
|
102
|
+
showWaitScreenSize: (title, message, callback, height, width) => {
|
|
106
103
|
// Return a promise
|
|
107
|
-
return new Promise(
|
|
104
|
+
return new Promise((resolve) => {
|
|
108
105
|
// Load the library and call the method
|
|
109
|
-
|
|
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:
|
|
113
|
+
showWaitScreenWithNoClose: (title, message, height, width) => {
|
|
117
114
|
// Return a promise
|
|
118
|
-
return new Promise(
|
|
115
|
+
return new Promise((resolve) => {
|
|
119
116
|
// Load the library and call the method
|
|
120
|
-
|
|
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
|
-
|
|
4
|
+
export const Notify = {
|
|
8
5
|
// Adds a notification
|
|
9
|
-
addNotification:
|
|
6
|
+
addNotification: (html, sticky) => {
|
|
10
7
|
// Return a promise
|
|
11
|
-
return new Promise(
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
12
9
|
// Load the library and call the method
|
|
13
|
-
|
|
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:
|
|
14
|
+
load: () => {
|
|
18
15
|
// Return a promise
|
|
19
|
-
return new Promise(
|
|
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",
|
|
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:
|
|
31
|
+
removeNotification: (id) => {
|
|
35
32
|
// Load the library and call the method
|
|
36
|
-
|
|
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
|
-
|
|
4
|
+
export const Ribbon = {
|
|
8
5
|
get exists() { return window["Ribbon"] != null && window["Ribbon"].PageState != null; },
|
|
9
6
|
PageState: {
|
|
10
7
|
Handlers: {
|
package/build/helper/sp/sod.js
CHANGED
|
@@ -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
|
-
|
|
4
|
+
export const SOD = {
|
|
8
5
|
// Executes the specified function in the specified file with the optional arguments.
|
|
9
|
-
execute:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
16
|
+
notifyScriptLoadedAndExecuteWaitingJobs: (scriptFileName) => { window["SP"] ? window["SP"].SOD.notifyScriptLoadedAndExecuteWaitingJobs(scriptFileName) : null; },
|
|
26
17
|
// Registers the specified file at the specified URL.
|
|
27
|
-
registerSod:
|
|
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:
|
|
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
|
-
|
|
4
|
+
export const Status = {
|
|
8
5
|
// Adds a status
|
|
9
|
-
addStatus:
|
|
6
|
+
addStatus: (title, html, prepend) => {
|
|
10
7
|
// Return a promise
|
|
11
|
-
return new Promise(
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
12
9
|
// Load the library
|
|
13
|
-
|
|
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:
|
|
17
|
+
appendStatus: (id, title, html) => {
|
|
21
18
|
// Return a promise
|
|
22
|
-
return new Promise(
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
23
20
|
// Load the library
|
|
24
|
-
|
|
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:
|
|
28
|
+
load: () => {
|
|
32
29
|
// Return a promise
|
|
33
|
-
return new Promise(
|
|
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",
|
|
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:
|
|
45
|
+
removeAllStatus: (hide) => {
|
|
49
46
|
// Load the library and call the method
|
|
50
|
-
|
|
47
|
+
Status.load().then(() => { window["SP"].UI.Status.removeAllStatus(hide); });
|
|
51
48
|
},
|
|
52
49
|
// Removes a status
|
|
53
|
-
removeStatus:
|
|
50
|
+
removeStatus: (id) => {
|
|
54
51
|
// Load the library and call the method
|
|
55
|
-
|
|
52
|
+
Status.load().then(() => { window["SP"].UI.Status.removeStatus(id); });
|
|
56
53
|
},
|
|
57
54
|
// Sets the status color
|
|
58
|
-
setStatusPriColor:
|
|
55
|
+
setStatusPriColor: (id, color) => {
|
|
59
56
|
// Load the library and call the method
|
|
60
|
-
|
|
57
|
+
Status.load().then(() => { window["SP"].UI.Status.setStatusPriColor(id, color); });
|
|
61
58
|
},
|
|
62
59
|
// Updates the status
|
|
63
|
-
updateStatus:
|
|
60
|
+
updateStatus: (id, html) => {
|
|
64
61
|
// Load the library and call the method
|
|
65
|
-
|
|
62
|
+
Status.load().then(() => { window["SP"].UI.Status.updateStatus(id, html); });
|
|
66
63
|
}
|
|
67
64
|
};
|