Skip to content

Commit 51fbf9f

Browse files
committed
Merged PR 186066: Expose mobile size (when available)
Expose mobile view page size (when available)
1 parent 62a5e7f commit 51fbf9f

File tree

7 files changed

+36
-18
lines changed

7 files changed

+36
-18
lines changed

dist/powerbi-client.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// powerbi-client v2.18.2
1+
// powerbi-client v2.18.3
22
// Copyright (c) Microsoft Corporation.
33
// Licensed under the MIT License.
44
declare module "config" {
@@ -841,6 +841,12 @@ declare module "page" {
841841
* @type {ICustomPageSize}
842842
*/
843843
defaultSize: ICustomPageSize;
844+
/**
845+
* Mobile view page size (if defined) as saved in the report.
846+
*
847+
* @type {ICustomPageSize}
848+
*/
849+
mobileSize: ICustomPageSize;
844850
/**
845851
* Page display options as saved in the report.
846852
*
@@ -857,7 +863,7 @@ declare module "page" {
857863
* @param {SectionVisibility} [visibility]
858864
* @hidden
859865
*/
860-
constructor(report: IReportNode, name: string, displayName?: string, isActivePage?: boolean, visibility?: SectionVisibility, defaultSize?: ICustomPageSize, defaultDisplayOption?: DisplayOption);
866+
constructor(report: IReportNode, name: string, displayName?: string, isActivePage?: boolean, visibility?: SectionVisibility, defaultSize?: ICustomPageSize, defaultDisplayOption?: DisplayOption, mobileSize?: ICustomPageSize);
861867
/**
862868
* Gets all page level filters within the report.
863869
*

dist/powerbi.js

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.18.2",
3+
"version": "2.18.3",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"types": "dist/powerbi-client.d.ts",
@@ -81,7 +81,7 @@
8181
},
8282
"dependencies": {
8383
"http-post-message": "^0.2",
84-
"powerbi-models": "^1.9",
84+
"powerbi-models": "^1.9.2",
8585
"powerbi-router": "^0.1",
8686
"window-post-message-proxy": "^0.2"
8787
},

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/** @ignore *//** */
55
const config = {
6-
version: '2.18.2',
6+
version: '2.18.3',
77
type: 'js'
88
};
99

src/page.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export class Page implements IPageNode, IFilterable {
8686
*/
8787
defaultSize: ICustomPageSize;
8888

89+
/**
90+
* Mobile view page size (if defined) as saved in the report.
91+
*
92+
* @type {ICustomPageSize}
93+
*/
94+
mobileSize: ICustomPageSize;
95+
8996
/**
9097
* Page display options as saved in the report.
9198
*
@@ -103,13 +110,14 @@ export class Page implements IPageNode, IFilterable {
103110
* @param {SectionVisibility} [visibility]
104111
* @hidden
105112
*/
106-
constructor(report: IReportNode, name: string, displayName?: string, isActivePage?: boolean, visibility?: SectionVisibility, defaultSize?: ICustomPageSize, defaultDisplayOption?: DisplayOption) {
113+
constructor(report: IReportNode, name: string, displayName?: string, isActivePage?: boolean, visibility?: SectionVisibility, defaultSize?: ICustomPageSize, defaultDisplayOption?: DisplayOption, mobileSize?: ICustomPageSize) {
107114
this.report = report;
108115
this.name = name;
109116
this.displayName = displayName;
110117
this.isActive = isActivePage;
111118
this.visibility = visibility;
112119
this.defaultSize = defaultSize;
120+
this.mobileSize = mobileSize;
113121
this.defaultDisplayOption = defaultDisplayOption;
114122
}
115123

src/report.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export class Report extends Embed implements IReportNode, IFilterable {
343343
try {
344344
const response = await this.service.hpm.get<IPage[]>('/report/pages', { uid: this.config.uniqueId }, this.iframe.contentWindow);
345345
return response.body
346-
.map((page) => new Page(this, page.name, page.displayName, page.isActive, page.visibility, page.defaultSize, page.defaultDisplayOption));
346+
.map((page) => new Page(this, page.name, page.displayName, page.isActive, page.visibility, page.defaultSize, page.defaultDisplayOption, page.mobileSize));
347347
} catch (response) {
348348
throw response.body;
349349
}
@@ -382,7 +382,8 @@ export class Report extends Embed implements IReportNode, IFilterable {
382382
page.isActive,
383383
page.visibility,
384384
page.defaultSize,
385-
page.defaultDisplayOption
385+
page.defaultDisplayOption,
386+
page.mobileSize
386387
);
387388
} catch (response) {
388389
throw response.body;
@@ -416,7 +417,8 @@ export class Report extends Embed implements IReportNode, IFilterable {
416417
activePage.isActive,
417418
activePage.visibility,
418419
activePage.defaultSize,
419-
activePage.defaultDisplayOption
420+
activePage.defaultDisplayOption,
421+
activePage.mobileSize
420422
);
421423
} catch (response) {
422424
throw response.body;

0 commit comments

Comments
 (0)