1 | import { _SPQueryable, SPQueryable, _SPCollection, _SPInstance, spInvokableFactory, SPInstance, } from "../spqueryable.js";
|
2 | import { body } from "@pnp/queryable";
|
3 | import { spPost } from "../operations.js";
|
4 | export class _LimitedWebPartManager extends _SPQueryable {
|
5 | get scope() {
|
6 | return SPQueryable(this, "Scope");
|
7 | }
|
8 | get webparts() {
|
9 | return WebPartDefinitions(this, "webparts");
|
10 | }
|
11 | export(id) {
|
12 | return spPost(LimitedWebPartManagerCloneFactory(this, "ExportWebPart"), body({ webPartId: id }));
|
13 | }
|
14 | import(xml) {
|
15 | return spPost(LimitedWebPartManagerCloneFactory(this, "ImportWebPart"), body({ webPartXml: xml }));
|
16 | }
|
17 | }
|
18 | export const LimitedWebPartManager = (baseUrl, path) => new _LimitedWebPartManager(baseUrl, path);
|
19 | const LimitedWebPartManagerCloneFactory = (baseUrl, path) => LimitedWebPartManager(baseUrl, path);
|
20 | export class _WebPartDefinitions extends _SPCollection {
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 | getById(id) {
|
27 | return WebPartDefinition(this, `getbyid('${id}')`);
|
28 | }
|
29 | |
30 |
|
31 |
|
32 |
|
33 |
|
34 | getByControlId(id) {
|
35 | return WebPartDefinition(this, `getByControlId('${id}')`);
|
36 | }
|
37 | }
|
38 | export const WebPartDefinitions = spInvokableFactory(_WebPartDefinitions);
|
39 | export class _WebPartDefinition extends _SPInstance {
|
40 | |
41 |
|
42 |
|
43 | get webpart() {
|
44 | return SPInstance(this, "webpart");
|
45 | }
|
46 | |
47 |
|
48 |
|
49 | saveChanges() {
|
50 | return spPost(WebPartDefinition(this, "SaveWebPartChanges"));
|
51 | }
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | moveTo(zoneId, zoneIndex) {
|
59 | return spPost(WebPartDefinition(this, `MoveWebPartTo(zoneID='${zoneId}', zoneIndex=${zoneIndex})`));
|
60 | }
|
61 | |
62 |
|
63 |
|
64 | close() {
|
65 | return spPost(WebPartDefinition(this, "CloseWebPart"));
|
66 | }
|
67 | |
68 |
|
69 |
|
70 | open() {
|
71 | return spPost(WebPartDefinition(this, "OpenWebPart"));
|
72 | }
|
73 | |
74 |
|
75 |
|
76 | delete() {
|
77 | return spPost(WebPartDefinition(this, "DeleteWebPart"));
|
78 | }
|
79 | }
|
80 | export const WebPartDefinition = spInvokableFactory(_WebPartDefinition);
|
81 | export var WebPartsPersonalizationScope;
|
82 | (function (WebPartsPersonalizationScope) {
|
83 | WebPartsPersonalizationScope[WebPartsPersonalizationScope["User"] = 0] = "User";
|
84 | WebPartsPersonalizationScope[WebPartsPersonalizationScope["Shared"] = 1] = "Shared";
|
85 | })(WebPartsPersonalizationScope || (WebPartsPersonalizationScope = {}));
|
86 |
|
\ | No newline at end of file |