gd-sprest 7.2.5 → 7.2.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.
- package/@types/helper/sp.d.ts +29 -0
- package/@types/sptypes/index.d.ts +2 -0
- package/@types/sptypes/sptypes.d.ts +19 -0
- package/build/helper/sp/ribbon.js +31 -0
- package/build/helper/webpart.js +6 -1
- package/build/rest.js +1 -1
- package/build/sptypes/sptypes.js +27 -1
- package/dist/gd-sprest.d.ts +50 -0
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.js.LICENSE.txt +4 -0
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/@types/helper/sp.d.ts
CHANGED
|
@@ -535,6 +535,35 @@ export interface INotify {
|
|
|
535
535
|
removeNotification(id: string);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
/**
|
|
539
|
+
* Ribbon
|
|
540
|
+
*/
|
|
541
|
+
export interface IRibbon {
|
|
542
|
+
PageState: {
|
|
543
|
+
Handlers: {
|
|
544
|
+
isApproveEnabled: boolean;
|
|
545
|
+
isCancelApprovalEnabled: boolean;
|
|
546
|
+
isCheckinEnabled: boolean;
|
|
547
|
+
isCheckoutEnabled: boolean;
|
|
548
|
+
isDeleteEnabled: boolean;
|
|
549
|
+
isDiscardcheckoutEnabled: boolean;
|
|
550
|
+
isDontSaveAndStopEnabled: boolean;
|
|
551
|
+
isEditEnabled: boolean;
|
|
552
|
+
isInEditMode: boolean;
|
|
553
|
+
isOverrideCheckoutEnabled: boolean;
|
|
554
|
+
isPublishEnabled: boolean;
|
|
555
|
+
isRejectEnabled: boolean;
|
|
556
|
+
isSaveAndStopEditEnabled: boolean;
|
|
557
|
+
isSaveEnabled: boolean;
|
|
558
|
+
isSubmitForApprovalEnabled: boolean;
|
|
559
|
+
isUnpublishEnabled: boolean;
|
|
560
|
+
onCancelButton: (...args) => void;
|
|
561
|
+
onOkButton: (...args) => void;
|
|
562
|
+
showStateChangeDialog: boolean;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
538
567
|
/**
|
|
539
568
|
* Script on Demand (SOD)
|
|
540
569
|
*/
|
|
@@ -18,6 +18,7 @@ export interface ISPTypes {
|
|
|
18
18
|
DraftVisibilityType: Types.IDraftVisibilityType;
|
|
19
19
|
EventReceiverType: Types.IEventReceiverType;
|
|
20
20
|
EventReceiverSynchronizationType: Types.IEventReceiverSynchronizationType;
|
|
21
|
+
EnvironmentType: Types.IEnvironmentType;
|
|
21
22
|
FieldIndexStatus: Types.IFieldIndexStatus;
|
|
22
23
|
FieldNoteType: Types.IFieldNoteType;
|
|
23
24
|
FieldNumberType: Types.IFieldNumberType;
|
|
@@ -26,6 +27,7 @@ export interface ISPTypes {
|
|
|
26
27
|
FieldUserSelectionType: Types.IFieldUserSelectionType;
|
|
27
28
|
FileLevelType: Types.IFileLevelType;
|
|
28
29
|
FileTemplateType: Types.IFileTemplateType;
|
|
30
|
+
FormDisplayMode: Types.IFormDisplayMode;
|
|
29
31
|
FriendlyDateFormat: Types.IFriendlyDateFormat;
|
|
30
32
|
GetUserEffectivePermissionsResult: Types.IGetUserEffectivePermissionsResult;
|
|
31
33
|
ListExperienceOptions: Types.IListExperienceOptions;
|
|
@@ -446,6 +446,16 @@ export type IEventReceiverSynchronizationType = {
|
|
|
446
446
|
Synchronization: number
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
/**
|
|
450
|
+
* Environment Type
|
|
451
|
+
*/
|
|
452
|
+
export type IEnvironmentType = {
|
|
453
|
+
ClassicSharePoint: number,
|
|
454
|
+
Local: number,
|
|
455
|
+
SharePoint: number,
|
|
456
|
+
Test: number
|
|
457
|
+
}
|
|
458
|
+
|
|
449
459
|
/**
|
|
450
460
|
* Field Index Status
|
|
451
461
|
*/
|
|
@@ -653,6 +663,15 @@ export type IFileTemplateType = {
|
|
|
653
663
|
WikiPage: number
|
|
654
664
|
};
|
|
655
665
|
|
|
666
|
+
/**
|
|
667
|
+
* Form Display Mode
|
|
668
|
+
*/
|
|
669
|
+
export type IFormDisplayMode = {
|
|
670
|
+
Display: number,
|
|
671
|
+
Edit: number,
|
|
672
|
+
New: number
|
|
673
|
+
}
|
|
674
|
+
|
|
656
675
|
/**
|
|
657
676
|
* Friendly Date Format
|
|
658
677
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Ribbon = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Ribbon
|
|
6
|
+
*/
|
|
7
|
+
exports.Ribbon = {
|
|
8
|
+
PageState: {
|
|
9
|
+
Handlers: {
|
|
10
|
+
get isApproveEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isApproveEnabled : null; },
|
|
11
|
+
get isCancelApprovalEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isCancelApprovalEnabled : null; },
|
|
12
|
+
get isCheckinEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isCheckinEnabled : null; },
|
|
13
|
+
get isCheckoutEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isCheckoutEnabled : null; },
|
|
14
|
+
get isDeleteEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isDeleteEnabled : null; },
|
|
15
|
+
get isDiscardcheckoutEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isDiscardcheckoutEnabled : null; },
|
|
16
|
+
get isDontSaveAndStopEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isDontSaveAndStopEnabled : null; },
|
|
17
|
+
get isEditEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isEditEnabled : null; },
|
|
18
|
+
get isInEditMode() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isInEditMode : null; },
|
|
19
|
+
get isOverrideCheckoutEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isOverrideCheckoutEnabled : null; },
|
|
20
|
+
get isPublishEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isPublishEnabled : null; },
|
|
21
|
+
get isRejectEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isRejectEnabled : null; },
|
|
22
|
+
get isSaveAndStopEditEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isSaveAndStopEditEnabled : null; },
|
|
23
|
+
get isSaveEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isSaveEnabled : null; },
|
|
24
|
+
get isSubmitForApprovalEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isSubmitForApprovalEnabled : null; },
|
|
25
|
+
get isUnpublishEnabled() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.isUnpublishEnabled : null; },
|
|
26
|
+
get onCancelButton() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.onCancelButton : null; },
|
|
27
|
+
get onOkButton() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.onOkButton : null; },
|
|
28
|
+
get showStateChangeDialog() { return window["Ribbon"] && window["Ribbon"].PageState && window["Ribbon"].PageState.Handlers ? window["Ribbon"].PageState.Handlers.showStateChangeDialog : null; }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
package/build/helper/webpart.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebPart = void 0;
|
|
4
|
+
var ribbon_1 = require("./sp/ribbon");
|
|
4
5
|
/**
|
|
5
6
|
* Web Part
|
|
6
7
|
*/
|
|
@@ -239,7 +240,11 @@ var _WebPart = /** @class */ (function () {
|
|
|
239
240
|
* Method to detect if a page is being edited
|
|
240
241
|
*/
|
|
241
242
|
_WebPart.isEditMode = function () {
|
|
242
|
-
|
|
243
|
+
// See if the ribbon page state exists
|
|
244
|
+
if (ribbon_1.Ribbon.PageState.Handlers.isInEditMode != null) {
|
|
245
|
+
// Return the mode
|
|
246
|
+
return ribbon_1.Ribbon.PageState.Handlers.isInEditMode;
|
|
247
|
+
}
|
|
243
248
|
// Get the form
|
|
244
249
|
var form = document.forms[MSOWebPartPageFormName];
|
|
245
250
|
if (form) {
|
package/build/rest.js
CHANGED
package/build/sptypes/sptypes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebTemplateType = exports.ViewType = exports.UserCustomActionRegistrationType = exports.URLZones = exports.UrlFormatType = exports.StatusPriColor = exports.RoleType = exports.ReorderingRuleMatchType = exports.RenderListDataOptions = exports.RelationshipDeleteBehaviorType = exports.PrincipalTypes = exports.PrincipalSources = exports.PersonalSiteCapabilities = exports.PersonalizationScope = exports.PageType = exports.ModalDialogResult = exports.LocaleLCIDType = exports.ListTemplateType = exports.ListExperienceOptions = exports.FriendlyDateFormat = exports.FileTemplateType = exports.FileLevelType = exports.FieldUserSelectionType = exports.FieldType = exports.FieldResultType = exports.FieldNumberType = exports.FieldNoteType = exports.EventReceiverType = exports.EventReceiverSynchronizationType = exports.DraftVisibilityType = exports.DateFormat = exports.ControlMode = exports.CloudEnvironment = exports.ClientSidePageLayout = exports.ClientTemplatesUtility = exports.ChoiceFormatType = exports.CheckOutType = exports.CheckInType = exports.CalendarTypes = exports.BasePermissionTypes = void 0;
|
|
3
|
+
exports.WebTemplateType = exports.ViewType = exports.UserCustomActionRegistrationType = exports.URLZones = exports.UrlFormatType = exports.StatusPriColor = exports.RoleType = exports.ReorderingRuleMatchType = exports.RenderListDataOptions = exports.RelationshipDeleteBehaviorType = exports.PrincipalTypes = exports.PrincipalSources = exports.PersonalSiteCapabilities = exports.PersonalizationScope = exports.PageType = exports.ModalDialogResult = exports.LocaleLCIDType = exports.ListTemplateType = exports.ListExperienceOptions = exports.FriendlyDateFormat = exports.IFormDisplayMode = exports.FileTemplateType = exports.FileLevelType = exports.FieldUserSelectionType = exports.FieldType = exports.FieldResultType = exports.FieldNumberType = exports.FieldNoteType = exports.FieldIndexStatus = exports.EnvironmentType = exports.EventReceiverType = exports.EventReceiverSynchronizationType = exports.DraftVisibilityType = exports.DateFormat = exports.ControlMode = exports.CloudEnvironment = exports.ClientSidePageLayout = exports.ClientTemplatesUtility = exports.ChoiceFormatType = exports.CheckOutType = exports.CheckInType = exports.CalendarTypes = exports.BasePermissionTypes = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Base Permission Types
|
|
6
6
|
*/
|
|
@@ -201,6 +201,24 @@ exports.EventReceiverType = {
|
|
|
201
201
|
EmailReceived: 20000,
|
|
202
202
|
ContextEvent: 32766
|
|
203
203
|
};
|
|
204
|
+
/**
|
|
205
|
+
* Environment Type
|
|
206
|
+
*/
|
|
207
|
+
exports.EnvironmentType = {
|
|
208
|
+
ClassicSharePoint: 3,
|
|
209
|
+
Local: 1,
|
|
210
|
+
SharePoint: 2,
|
|
211
|
+
Test: 0
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Field Index Status
|
|
215
|
+
*/
|
|
216
|
+
exports.FieldIndexStatus = {
|
|
217
|
+
None: 0,
|
|
218
|
+
Indexed: 1,
|
|
219
|
+
Enabling: 2,
|
|
220
|
+
Disabling: 3
|
|
221
|
+
};
|
|
204
222
|
/**
|
|
205
223
|
* Field Note Types
|
|
206
224
|
*/
|
|
@@ -291,6 +309,14 @@ exports.FileLevelType = { Published: 1, Draft: 2, Checkout: 3 };
|
|
|
291
309
|
* File Template Types
|
|
292
310
|
*/
|
|
293
311
|
exports.FileTemplateType = { StandardPage: 0, WikiPage: 1, FormPage: 2 };
|
|
312
|
+
/**
|
|
313
|
+
* Form Display Mode
|
|
314
|
+
*/
|
|
315
|
+
exports.IFormDisplayMode = {
|
|
316
|
+
Display: 4,
|
|
317
|
+
Edit: 6,
|
|
318
|
+
New: 8
|
|
319
|
+
};
|
|
294
320
|
/**
|
|
295
321
|
* Friendly Date Format
|
|
296
322
|
*/
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -391,6 +391,7 @@ declare module 'gd-sprest/sptypes' {
|
|
|
391
391
|
DraftVisibilityType: Types.IDraftVisibilityType;
|
|
392
392
|
EventReceiverType: Types.IEventReceiverType;
|
|
393
393
|
EventReceiverSynchronizationType: Types.IEventReceiverSynchronizationType;
|
|
394
|
+
EnvironmentType: Types.IEnvironmentType;
|
|
394
395
|
FieldIndexStatus: Types.IFieldIndexStatus;
|
|
395
396
|
FieldNoteType: Types.IFieldNoteType;
|
|
396
397
|
FieldNumberType: Types.IFieldNumberType;
|
|
@@ -399,6 +400,7 @@ declare module 'gd-sprest/sptypes' {
|
|
|
399
400
|
FieldUserSelectionType: Types.IFieldUserSelectionType;
|
|
400
401
|
FileLevelType: Types.IFileLevelType;
|
|
401
402
|
FileTemplateType: Types.IFileTemplateType;
|
|
403
|
+
FormDisplayMode: Types.IFormDisplayMode;
|
|
402
404
|
FriendlyDateFormat: Types.IFriendlyDateFormat;
|
|
403
405
|
GetUserEffectivePermissionsResult: Types.IGetUserEffectivePermissionsResult;
|
|
404
406
|
ListExperienceOptions: Types.IListExperienceOptions;
|
|
@@ -2986,6 +2988,35 @@ declare module 'gd-sprest/helper/sp' {
|
|
|
2986
2988
|
removeNotification(id: string);
|
|
2987
2989
|
}
|
|
2988
2990
|
|
|
2991
|
+
/**
|
|
2992
|
+
* Ribbon
|
|
2993
|
+
*/
|
|
2994
|
+
export interface IRibbon {
|
|
2995
|
+
PageState: {
|
|
2996
|
+
Handlers: {
|
|
2997
|
+
isApproveEnabled: boolean;
|
|
2998
|
+
isCancelApprovalEnabled: boolean;
|
|
2999
|
+
isCheckinEnabled: boolean;
|
|
3000
|
+
isCheckoutEnabled: boolean;
|
|
3001
|
+
isDeleteEnabled: boolean;
|
|
3002
|
+
isDiscardcheckoutEnabled: boolean;
|
|
3003
|
+
isDontSaveAndStopEnabled: boolean;
|
|
3004
|
+
isEditEnabled: boolean;
|
|
3005
|
+
isInEditMode: boolean;
|
|
3006
|
+
isOverrideCheckoutEnabled: boolean;
|
|
3007
|
+
isPublishEnabled: boolean;
|
|
3008
|
+
isRejectEnabled: boolean;
|
|
3009
|
+
isSaveAndStopEditEnabled: boolean;
|
|
3010
|
+
isSaveEnabled: boolean;
|
|
3011
|
+
isSubmitForApprovalEnabled: boolean;
|
|
3012
|
+
isUnpublishEnabled: boolean;
|
|
3013
|
+
onCancelButton: (...args) => void;
|
|
3014
|
+
onOkButton: (...args) => void;
|
|
3015
|
+
showStateChangeDialog: boolean;
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
|
|
2989
3020
|
/**
|
|
2990
3021
|
* Script on Demand (SOD)
|
|
2991
3022
|
*/
|
|
@@ -4453,6 +4484,16 @@ declare module 'gd-sprest/sptypes/sptypes' {
|
|
|
4453
4484
|
Synchronization: number
|
|
4454
4485
|
};
|
|
4455
4486
|
|
|
4487
|
+
/**
|
|
4488
|
+
* Environment Type
|
|
4489
|
+
*/
|
|
4490
|
+
export type IEnvironmentType = {
|
|
4491
|
+
ClassicSharePoint: number,
|
|
4492
|
+
Local: number,
|
|
4493
|
+
SharePoint: number,
|
|
4494
|
+
Test: number
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4456
4497
|
/**
|
|
4457
4498
|
* Field Index Status
|
|
4458
4499
|
*/
|
|
@@ -4660,6 +4701,15 @@ declare module 'gd-sprest/sptypes/sptypes' {
|
|
|
4660
4701
|
WikiPage: number
|
|
4661
4702
|
};
|
|
4662
4703
|
|
|
4704
|
+
/**
|
|
4705
|
+
* Form Display Mode
|
|
4706
|
+
*/
|
|
4707
|
+
export type IFormDisplayMode = {
|
|
4708
|
+
Display: number,
|
|
4709
|
+
Edit: number,
|
|
4710
|
+
New: number
|
|
4711
|
+
}
|
|
4712
|
+
|
|
4663
4713
|
/**
|
|
4664
4714
|
* Friendly Date Format
|
|
4665
4715
|
*/
|