diff --git a/demo/v2-demo/scripts/codesamples.js b/demo/v2-demo/scripts/codesamples.js
index 3e98d745..cf32e2a9 100644
--- a/demo/v2-demo/scripts/codesamples.js
+++ b/demo/v2-demo/scripts/codesamples.js
@@ -1135,6 +1135,24 @@ function _Page_RemoveFilters() {
});
}
+function _Page_HasLayout() {
+ // Get models. models contains enums that can be used.
+ var models = window['powerbi-client'].models;
+
+ // Get a reference to the embedded report HTML element
+ var embedContainer = $('#embedContainer')[0];
+
+ // Get a reference to the embedded report.
+ report = powerbi.get(embedContainer);
+
+ // Retrieve the page collection and check if the first page has a MobilePortrait layout.
+ report.getPages().then(function (pages) {
+ pages[0].hasLayout(models.LayoutType.MobilePortrait).then(function(hasLayout) {
+ Log.log(hasLayout);
+ })
+ });
+}
+
// ---- Event Listener ----------------------------------------------------
function _Events_PageChanged() {
diff --git a/demo/v2-demo/scripts/step_embed.js b/demo/v2-demo/scripts/step_embed.js
index 9f0ee1a5..38062ba6 100644
--- a/demo/v2-demo/scripts/step_embed.js
+++ b/demo/v2-demo/scripts/step_embed.js
@@ -81,6 +81,9 @@ function Page_RemoveFilters() {
SetCode(_Page_RemoveFilters);
}
+function Page_HasLayout() {
+ SetCode(_Page_HasLayout);
+}
// ---- Event Listener ----------------------------------------------------
function Events_PageChanged() {
diff --git a/demo/v2-demo/settings_interact.html b/demo/v2-demo/settings_interact.html
index d6007f0f..4f539c0f 100644
--- a/demo/v2-demo/settings_interact.html
+++ b/demo/v2-demo/settings_interact.html
@@ -45,6 +45,7 @@
Set Filters
Get Filters
Remove Filters
+ Check Layout
Get Visuals
diff --git a/dist/powerbi-client.d.ts b/dist/powerbi-client.d.ts
index 93cc5c65..0eb1d526 100644
--- a/dist/powerbi-client.d.ts
+++ b/dist/powerbi-client.d.ts
@@ -1,4 +1,4 @@
-/*! powerbi-client v2.4.6 | (c) 2016 Microsoft Corporation MIT */
+/*! powerbi-client v2.4.7 | (c) 2016 Microsoft Corporation MIT */
declare module "config" {
const config: {
version: string;
@@ -619,6 +619,17 @@ declare module "page" {
* @returns {Promise}
*/
getVisuals(): Promise;
+ /**
+ * Checks if page has layout.
+ *
+ * ```javascript
+ * page.hasLayout(layoutType)
+ * .then(hasLayout: boolean => { ... });
+ * ```
+ *
+ * @returns {(Promise)}
+ */
+ hasLayout(layoutType: any): Promise;
}
}
declare module "defaults" {
diff --git a/dist/powerbi.js b/dist/powerbi.js
index 2a6416ea..e19c8071 100644
--- a/dist/powerbi.js
+++ b/dist/powerbi.js
@@ -1,4 +1,4 @@
-/*! powerbi-client v2.4.6 | (c) 2016 Microsoft Corporation MIT */
+/*! powerbi-client v2.4.7 | (c) 2016 Microsoft Corporation MIT */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
@@ -957,7 +957,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
- /*! powerbi-models v1.0.1 | (c) 2016 Microsoft Corporation MIT */
+ /*! powerbi-models v1.0.2 | (c) 2016 Microsoft Corporation MIT */
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
@@ -1049,6 +1049,8 @@ return /******/ (function(modules) { // webpackBootstrap
(function (LayoutType) {
LayoutType[LayoutType["Master"] = 0] = "Master";
LayoutType[LayoutType["Custom"] = 1] = "Custom";
+ LayoutType[LayoutType["MobilePortrait"] = 2] = "MobilePortrait";
+ LayoutType[LayoutType["MobileLandscape"] = 3] = "MobileLandscape";
})(LayoutType = exports.LayoutType || (exports.LayoutType = {}));
var Permissions;
(function (Permissions) {
@@ -1093,7 +1095,7 @@ return /******/ (function(modules) { // webpackBootstrap
RelativeDateOperators[RelativeDateOperators["InThis"] = 1] = "InThis";
RelativeDateOperators[RelativeDateOperators["InNext"] = 2] = "InNext";
})(RelativeDateOperators = exports.RelativeDateOperators || (exports.RelativeDateOperators = {}));
- var Filter = (function () {
+ var Filter = /** @class */ (function () {
function Filter(target, filterType) {
this.target = target;
this.filterType = filterType;
@@ -1109,7 +1111,7 @@ return /******/ (function(modules) { // webpackBootstrap
return Filter;
}());
exports.Filter = Filter;
- var NotSupportedFilter = (function (_super) {
+ var NotSupportedFilter = /** @class */ (function (_super) {
__extends(NotSupportedFilter, _super);
function NotSupportedFilter(target, message, notSupportedTypeName) {
var _this = _super.call(this, target, FilterType.Unknown) || this;
@@ -1124,11 +1126,11 @@ return /******/ (function(modules) { // webpackBootstrap
filter.notSupportedTypeName = this.notSupportedTypeName;
return filter;
};
+ NotSupportedFilter.schemaUrl = "http://powerbi.com/product/schema#notSupported";
return NotSupportedFilter;
}(Filter));
- NotSupportedFilter.schemaUrl = "http://powerbi.com/product/schema#notSupported";
exports.NotSupportedFilter = NotSupportedFilter;
- var IncludeExcludeFilter = (function (_super) {
+ var IncludeExcludeFilter = /** @class */ (function (_super) {
__extends(IncludeExcludeFilter, _super);
function IncludeExcludeFilter(target, isExclude, values) {
var _this = _super.call(this, target, FilterType.IncludeExclude) || this;
@@ -1143,11 +1145,11 @@ return /******/ (function(modules) { // webpackBootstrap
filter.values = this.values;
return filter;
};
+ IncludeExcludeFilter.schemaUrl = "http://powerbi.com/product/schema#includeExclude";
return IncludeExcludeFilter;
}(Filter));
- IncludeExcludeFilter.schemaUrl = "http://powerbi.com/product/schema#includeExclude";
exports.IncludeExcludeFilter = IncludeExcludeFilter;
- var TopNFilter = (function (_super) {
+ var TopNFilter = /** @class */ (function (_super) {
__extends(TopNFilter, _super);
function TopNFilter(target, operator, itemCount) {
var _this = _super.call(this, target, FilterType.TopN) || this;
@@ -1162,11 +1164,11 @@ return /******/ (function(modules) { // webpackBootstrap
filter.itemCount = this.itemCount;
return filter;
};
+ TopNFilter.schemaUrl = "http://powerbi.com/product/schema#topN";
return TopNFilter;
}(Filter));
- TopNFilter.schemaUrl = "http://powerbi.com/product/schema#topN";
exports.TopNFilter = TopNFilter;
- var RelativeDateFilter = (function (_super) {
+ var RelativeDateFilter = /** @class */ (function (_super) {
__extends(RelativeDateFilter, _super);
function RelativeDateFilter(target, operator, timeUnitsCount, timeUnitType, includeToday) {
var _this = _super.call(this, target, FilterType.RelativeDate) || this;
@@ -1185,11 +1187,11 @@ return /******/ (function(modules) { // webpackBootstrap
filter.includeToday = this.includeToday;
return filter;
};
+ RelativeDateFilter.schemaUrl = "http://powerbi.com/product/schema#relativeDate";
return RelativeDateFilter;
}(Filter));
- RelativeDateFilter.schemaUrl = "http://powerbi.com/product/schema#relativeDate";
exports.RelativeDateFilter = RelativeDateFilter;
- var BasicFilter = (function (_super) {
+ var BasicFilter = /** @class */ (function (_super) {
__extends(BasicFilter, _super);
function BasicFilter(target, operator) {
var values = [];
@@ -1221,11 +1223,11 @@ return /******/ (function(modules) { // webpackBootstrap
filter.values = this.values;
return filter;
};
+ BasicFilter.schemaUrl = "http://powerbi.com/product/schema#basic";
return BasicFilter;
}(Filter));
- BasicFilter.schemaUrl = "http://powerbi.com/product/schema#basic";
exports.BasicFilter = BasicFilter;
- var BasicFilterWithKeys = (function (_super) {
+ var BasicFilterWithKeys = /** @class */ (function (_super) {
__extends(BasicFilterWithKeys, _super);
function BasicFilterWithKeys(target, operator, values, keyValues) {
var _this = _super.call(this, target, operator, values) || this;
@@ -1256,7 +1258,7 @@ return /******/ (function(modules) { // webpackBootstrap
return BasicFilterWithKeys;
}(BasicFilter));
exports.BasicFilterWithKeys = BasicFilterWithKeys;
- var AdvancedFilter = (function (_super) {
+ var AdvancedFilter = /** @class */ (function (_super) {
__extends(AdvancedFilter, _super);
function AdvancedFilter(target, logicalOperator) {
var conditions = [];
@@ -1301,9 +1303,9 @@ return /******/ (function(modules) { // webpackBootstrap
filter.conditions = this.conditions;
return filter;
};
+ AdvancedFilter.schemaUrl = "http://powerbi.com/product/schema#advanced";
return AdvancedFilter;
}(Filter));
- AdvancedFilter.schemaUrl = "http://powerbi.com/product/schema#advanced";
exports.AdvancedFilter = AdvancedFilter;
function isFilterKeyColumnsTarget(target) {
return isColumn(target) && !!target.keys;
@@ -1471,7 +1473,7 @@ return /******/ (function(modules) { // webpackBootstrap
filtersValidator: new filtersValidator_1.FilterValidator(),
includeExcludeFilterValidator: new filtersValidator_1.IncludeExcludeFilterValidator(),
includeExludeFilterTypeValidator: new typeValidator_1.EnumValidator([3]),
- layoutTypeValidator: new typeValidator_1.EnumValidator([0, 1]),
+ layoutTypeValidator: new typeValidator_1.EnumValidator([0, 1, 2, 3]),
loadQnaValidator: new qnaValidator_1.LoadQnaValidator(),
menuExtensionValidator: new extensionsValidator_1.MenuExtensionValidator(),
notSupportedFilterTypeValidator: new typeValidator_1.EnumValidator([2]),
@@ -1521,7 +1523,7 @@ return /******/ (function(modules) { // webpackBootstrap
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
- var ObjectValidator = (function () {
+ var ObjectValidator = /** @class */ (function () {
function ObjectValidator() {
}
ObjectValidator.prototype.validate = function (input, path, field) {
@@ -1540,7 +1542,7 @@ return /******/ (function(modules) { // webpackBootstrap
return ObjectValidator;
}());
exports.ObjectValidator = ObjectValidator;
- var ArrayValidator = (function () {
+ var ArrayValidator = /** @class */ (function () {
function ArrayValidator(itemValidators) {
this.itemValidators = itemValidators;
}
@@ -1574,7 +1576,7 @@ return /******/ (function(modules) { // webpackBootstrap
return ArrayValidator;
}());
exports.ArrayValidator = ArrayValidator;
- var TypeValidator = (function () {
+ var TypeValidator = /** @class */ (function () {
function TypeValidator(expectedType) {
this.expectedType = expectedType;
}
@@ -1594,7 +1596,7 @@ return /******/ (function(modules) { // webpackBootstrap
return TypeValidator;
}());
exports.TypeValidator = TypeValidator;
- var StringValidator = (function (_super) {
+ var StringValidator = /** @class */ (function (_super) {
__extends(StringValidator, _super);
function StringValidator() {
return _super.call(this, "string") || this;
@@ -1602,7 +1604,7 @@ return /******/ (function(modules) { // webpackBootstrap
return StringValidator;
}(TypeValidator));
exports.StringValidator = StringValidator;
- var BooleanValidator = (function (_super) {
+ var BooleanValidator = /** @class */ (function (_super) {
__extends(BooleanValidator, _super);
function BooleanValidator() {
return _super.call(this, "boolean") || this;
@@ -1610,7 +1612,7 @@ return /******/ (function(modules) { // webpackBootstrap
return BooleanValidator;
}(TypeValidator));
exports.BooleanValidator = BooleanValidator;
- var NumberValidator = (function (_super) {
+ var NumberValidator = /** @class */ (function (_super) {
__extends(NumberValidator, _super);
function NumberValidator() {
return _super.call(this, "number") || this;
@@ -1618,7 +1620,7 @@ return /******/ (function(modules) { // webpackBootstrap
return NumberValidator;
}(TypeValidator));
exports.NumberValidator = NumberValidator;
- var ValueValidator = (function () {
+ var ValueValidator = /** @class */ (function () {
function ValueValidator(possibleValues) {
this.possibleValues = possibleValues;
}
@@ -1638,7 +1640,7 @@ return /******/ (function(modules) { // webpackBootstrap
return ValueValidator;
}());
exports.ValueValidator = ValueValidator;
- var EnumValidator = (function (_super) {
+ var EnumValidator = /** @class */ (function (_super) {
__extends(EnumValidator, _super);
function EnumValidator(possibleValues) {
var _this = _super.call(this) || this;
@@ -1659,7 +1661,7 @@ return /******/ (function(modules) { // webpackBootstrap
return EnumValidator;
}(NumberValidator));
exports.EnumValidator = EnumValidator;
- var StringArrayValidator = (function (_super) {
+ var StringArrayValidator = /** @class */ (function (_super) {
__extends(StringArrayValidator, _super);
function StringArrayValidator() {
return _super.call(this, [new StringValidator()]) || this;
@@ -1678,7 +1680,7 @@ return /******/ (function(modules) { // webpackBootstrap
return StringArrayValidator;
}(ArrayValidator));
exports.StringArrayValidator = StringArrayValidator;
- var BooleanArrayValidator = (function (_super) {
+ var BooleanArrayValidator = /** @class */ (function (_super) {
__extends(BooleanArrayValidator, _super);
function BooleanArrayValidator() {
return _super.call(this, [new BooleanValidator()]) || this;
@@ -1697,7 +1699,7 @@ return /******/ (function(modules) { // webpackBootstrap
return BooleanArrayValidator;
}(ArrayValidator));
exports.BooleanArrayValidator = BooleanArrayValidator;
- var NumberArrayValidator = (function (_super) {
+ var NumberArrayValidator = /** @class */ (function (_super) {
__extends(NumberArrayValidator, _super);
function NumberArrayValidator() {
return _super.call(this, [new NumberValidator()]) || this;
@@ -1736,7 +1738,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var MenuExtensionValidator = (function (_super) {
+ var MenuExtensionValidator = /** @class */ (function (_super) {
__extends(MenuExtensionValidator, _super);
function MenuExtensionValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1765,7 +1767,7 @@ return /******/ (function(modules) { // webpackBootstrap
return MenuExtensionValidator;
}(typeValidator_1.ObjectValidator));
exports.MenuExtensionValidator = MenuExtensionValidator;
- var ExtensionPointsValidator = (function (_super) {
+ var ExtensionPointsValidator = /** @class */ (function (_super) {
__extends(ExtensionPointsValidator, _super);
function ExtensionPointsValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1794,7 +1796,7 @@ return /******/ (function(modules) { // webpackBootstrap
return ExtensionPointsValidator;
}(typeValidator_1.ObjectValidator));
exports.ExtensionPointsValidator = ExtensionPointsValidator;
- var ExtensionItemValidator = (function (_super) {
+ var ExtensionItemValidator = /** @class */ (function (_super) {
__extends(ExtensionItemValidator, _super);
function ExtensionItemValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1823,7 +1825,7 @@ return /******/ (function(modules) { // webpackBootstrap
return ExtensionItemValidator;
}(typeValidator_1.ObjectValidator));
exports.ExtensionItemValidator = ExtensionItemValidator;
- var CommandExtensionValidator = (function (_super) {
+ var CommandExtensionValidator = /** @class */ (function (_super) {
__extends(CommandExtensionValidator, _super);
function CommandExtensionValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1852,7 +1854,7 @@ return /******/ (function(modules) { // webpackBootstrap
return CommandExtensionValidator;
}(ExtensionItemValidator));
exports.CommandExtensionValidator = CommandExtensionValidator;
- var ExtensionValidator = (function (_super) {
+ var ExtensionValidator = /** @class */ (function (_super) {
__extends(ExtensionValidator, _super);
function ExtensionValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1884,7 +1886,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
- var MultipleFieldsValidator = (function () {
+ var MultipleFieldsValidator = /** @class */ (function () {
function MultipleFieldsValidator(fieldValidatorsPairs) {
this.fieldValidatorsPairs = fieldValidatorsPairs;
}
@@ -1928,7 +1930,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var SettingsValidator = (function (_super) {
+ var SettingsValidator = /** @class */ (function (_super) {
__extends(SettingsValidator, _super);
function SettingsValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -1993,7 +1995,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var FilterColumnTargetValidator = (function (_super) {
+ var FilterColumnTargetValidator = /** @class */ (function (_super) {
__extends(FilterColumnTargetValidator, _super);
function FilterColumnTargetValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2022,7 +2024,7 @@ return /******/ (function(modules) { // webpackBootstrap
return FilterColumnTargetValidator;
}(typeValidator_1.ObjectValidator));
exports.FilterColumnTargetValidator = FilterColumnTargetValidator;
- var FilterHierarchyTargetValidator = (function (_super) {
+ var FilterHierarchyTargetValidator = /** @class */ (function (_super) {
__extends(FilterHierarchyTargetValidator, _super);
function FilterHierarchyTargetValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2055,7 +2057,7 @@ return /******/ (function(modules) { // webpackBootstrap
return FilterHierarchyTargetValidator;
}(typeValidator_1.ObjectValidator));
exports.FilterHierarchyTargetValidator = FilterHierarchyTargetValidator;
- var FilterMeasureTargetValidator = (function (_super) {
+ var FilterMeasureTargetValidator = /** @class */ (function (_super) {
__extends(FilterMeasureTargetValidator, _super);
function FilterMeasureTargetValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2084,7 +2086,7 @@ return /******/ (function(modules) { // webpackBootstrap
return FilterMeasureTargetValidator;
}(typeValidator_1.ObjectValidator));
exports.FilterMeasureTargetValidator = FilterMeasureTargetValidator;
- var BasicFilterValidator = (function (_super) {
+ var BasicFilterValidator = /** @class */ (function (_super) {
__extends(BasicFilterValidator, _super);
function BasicFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2121,7 +2123,7 @@ return /******/ (function(modules) { // webpackBootstrap
return BasicFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.BasicFilterValidator = BasicFilterValidator;
- var AdvancedFilterValidator = (function (_super) {
+ var AdvancedFilterValidator = /** @class */ (function (_super) {
__extends(AdvancedFilterValidator, _super);
function AdvancedFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2158,7 +2160,7 @@ return /******/ (function(modules) { // webpackBootstrap
return AdvancedFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.AdvancedFilterValidator = AdvancedFilterValidator;
- var RelativeDateFilterValidator = (function (_super) {
+ var RelativeDateFilterValidator = /** @class */ (function (_super) {
__extends(RelativeDateFilterValidator, _super);
function RelativeDateFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2203,7 +2205,7 @@ return /******/ (function(modules) { // webpackBootstrap
return RelativeDateFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.RelativeDateFilterValidator = RelativeDateFilterValidator;
- var TopNFilterValidator = (function (_super) {
+ var TopNFilterValidator = /** @class */ (function (_super) {
__extends(TopNFilterValidator, _super);
function TopNFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2240,7 +2242,7 @@ return /******/ (function(modules) { // webpackBootstrap
return TopNFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.TopNFilterValidator = TopNFilterValidator;
- var NotSupportedFilterValidator = (function (_super) {
+ var NotSupportedFilterValidator = /** @class */ (function (_super) {
__extends(NotSupportedFilterValidator, _super);
function NotSupportedFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2277,7 +2279,7 @@ return /******/ (function(modules) { // webpackBootstrap
return NotSupportedFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.NotSupportedFilterValidator = NotSupportedFilterValidator;
- var IncludeExcludeFilterValidator = (function (_super) {
+ var IncludeExcludeFilterValidator = /** @class */ (function (_super) {
__extends(IncludeExcludeFilterValidator, _super);
function IncludeExcludeFilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2314,7 +2316,7 @@ return /******/ (function(modules) { // webpackBootstrap
return IncludeExcludeFilterValidator;
}(typeValidator_1.ObjectValidator));
exports.IncludeExcludeFilterValidator = IncludeExcludeFilterValidator;
- var FilterValidator = (function (_super) {
+ var FilterValidator = /** @class */ (function (_super) {
__extends(FilterValidator, _super);
function FilterValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2328,7 +2330,7 @@ return /******/ (function(modules) { // webpackBootstrap
return FilterValidator;
}(typeValidator_1.ObjectValidator));
exports.FilterValidator = FilterValidator;
- var ConditionItemValidator = (function (_super) {
+ var ConditionItemValidator = /** @class */ (function (_super) {
__extends(ConditionItemValidator, _super);
function ConditionItemValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2364,7 +2366,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
- var FieldRequiredValidator = (function () {
+ var FieldRequiredValidator = /** @class */ (function () {
function FieldRequiredValidator() {
}
FieldRequiredValidator.prototype.validate = function (input, path, field) {
@@ -2387,7 +2389,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
- var AnyOfValidator = (function () {
+ var AnyOfValidator = /** @class */ (function () {
function AnyOfValidator(validators) {
this.validators = validators;
}
@@ -2436,7 +2438,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var ReportLoadValidator = (function (_super) {
+ var ReportLoadValidator = /** @class */ (function (_super) {
__extends(ReportLoadValidator, _super);
function ReportLoadValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2509,7 +2511,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var ReportCreateValidator = (function (_super) {
+ var ReportCreateValidator = /** @class */ (function (_super) {
__extends(ReportCreateValidator, _super);
function ReportCreateValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2562,7 +2564,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var DashboardLoadValidator = (function (_super) {
+ var DashboardLoadValidator = /** @class */ (function (_super) {
__extends(DashboardLoadValidator, _super);
function DashboardLoadValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2619,7 +2621,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var TileLoadValidator = (function (_super) {
+ var TileLoadValidator = /** @class */ (function (_super) {
__extends(TileLoadValidator, _super);
function TileLoadValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2688,7 +2690,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var PageSizeValidator = (function (_super) {
+ var PageSizeValidator = /** @class */ (function (_super) {
__extends(PageSizeValidator, _super);
function PageSizeValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2713,7 +2715,7 @@ return /******/ (function(modules) { // webpackBootstrap
return PageSizeValidator;
}(typeValidator_1.ObjectValidator));
exports.PageSizeValidator = PageSizeValidator;
- var CustomPageSizeValidator = (function (_super) {
+ var CustomPageSizeValidator = /** @class */ (function (_super) {
__extends(CustomPageSizeValidator, _super);
function CustomPageSizeValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2742,7 +2744,7 @@ return /******/ (function(modules) { // webpackBootstrap
return CustomPageSizeValidator;
}(PageSizeValidator));
exports.CustomPageSizeValidator = CustomPageSizeValidator;
- var PageValidator = (function (_super) {
+ var PageValidator = /** @class */ (function (_super) {
__extends(PageValidator, _super);
function PageValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2767,7 +2769,7 @@ return /******/ (function(modules) { // webpackBootstrap
return PageValidator;
}(typeValidator_1.ObjectValidator));
exports.PageValidator = PageValidator;
- var PageViewFieldValidator = (function (_super) {
+ var PageViewFieldValidator = /** @class */ (function (_super) {
__extends(PageViewFieldValidator, _super);
function PageViewFieldValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2811,7 +2813,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var LoadQnaValidator = (function (_super) {
+ var LoadQnaValidator = /** @class */ (function (_super) {
__extends(LoadQnaValidator, _super);
function LoadQnaValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2856,7 +2858,7 @@ return /******/ (function(modules) { // webpackBootstrap
return LoadQnaValidator;
}(typeValidator_1.ObjectValidator));
exports.LoadQnaValidator = LoadQnaValidator;
- var QnaSettingsValidator = (function (_super) {
+ var QnaSettingsValidator = /** @class */ (function (_super) {
__extends(QnaSettingsValidator, _super);
function QnaSettingsValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2881,7 +2883,7 @@ return /******/ (function(modules) { // webpackBootstrap
return QnaSettingsValidator;
}(typeValidator_1.ObjectValidator));
exports.QnaSettingsValidator = QnaSettingsValidator;
- var QnaInterpretInputDataValidator = (function (_super) {
+ var QnaInterpretInputDataValidator = /** @class */ (function (_super) {
__extends(QnaInterpretInputDataValidator, _super);
function QnaInterpretInputDataValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2930,7 +2932,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var SaveAsParametersValidator = (function (_super) {
+ var SaveAsParametersValidator = /** @class */ (function (_super) {
__extends(SaveAsParametersValidator, _super);
function SaveAsParametersValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -2973,7 +2975,7 @@ return /******/ (function(modules) { // webpackBootstrap
})();
Object.defineProperty(exports, "__esModule", { value: true });
var typeValidator_1 = __webpack_require__(2);
- var MapValidator = (function (_super) {
+ var MapValidator = /** @class */ (function (_super) {
__extends(MapValidator, _super);
function MapValidator(keyValidators, valueValidators) {
var _this = _super.call(this) || this;
@@ -3033,7 +3035,7 @@ return /******/ (function(modules) { // webpackBootstrap
var validator_1 = __webpack_require__(1);
var multipleFieldsValidator_1 = __webpack_require__(4);
var typeValidator_1 = __webpack_require__(2);
- var CustomLayoutValidator = (function (_super) {
+ var CustomLayoutValidator = /** @class */ (function (_super) {
__extends(CustomLayoutValidator, _super);
function CustomLayoutValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -3066,7 +3068,7 @@ return /******/ (function(modules) { // webpackBootstrap
return CustomLayoutValidator;
}(typeValidator_1.ObjectValidator));
exports.CustomLayoutValidator = CustomLayoutValidator;
- var VisualLayoutValidator = (function (_super) {
+ var VisualLayoutValidator = /** @class */ (function (_super) {
__extends(VisualLayoutValidator, _super);
function VisualLayoutValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -3111,7 +3113,7 @@ return /******/ (function(modules) { // webpackBootstrap
return VisualLayoutValidator;
}(typeValidator_1.ObjectValidator));
exports.VisualLayoutValidator = VisualLayoutValidator;
- var DisplayStateValidator = (function (_super) {
+ var DisplayStateValidator = /** @class */ (function (_super) {
__extends(DisplayStateValidator, _super);
function DisplayStateValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -3136,7 +3138,7 @@ return /******/ (function(modules) { // webpackBootstrap
return DisplayStateValidator;
}(typeValidator_1.ObjectValidator));
exports.DisplayStateValidator = DisplayStateValidator;
- var PageLayoutValidator = (function (_super) {
+ var PageLayoutValidator = /** @class */ (function (_super) {
__extends(PageLayoutValidator, _super);
function PageLayoutValidator() {
return _super !== null && _super.apply(this, arguments) || this;
@@ -3445,6 +3447,8 @@ return /******/ (function(modules) { // webpackBootstrap
*/
Report.prototype.populateConfig = function (baseConfig) {
var config = baseConfig;
+ if (config.settings && (config.settings.layoutType === models.LayoutType.MobileLandscape || config.settings.layoutType === models.LayoutType.MobilePortrait))
+ config.embedUrl = utils.addParamToUrl(config.embedUrl, "isMobile", "true");
_super.prototype.populateConfig.call(this, config);
// TODO: Change when Object.assign is available.
var settings = utils.assign({}, defaults_1.Defaults.defaultSettings, config.settings);
@@ -3483,7 +3487,7 @@ return /******/ (function(modules) { // webpackBootstrap
throw response.body;
});
};
- Report.allowedEvents = ["filtersApplied", "pageChanged", "commandTriggered"];
+ Report.allowedEvents = ["filtersApplied", "pageChanged", "commandTriggered", "swipeStart", "swipeEnd"];
Report.reportIdAttribute = 'powerbi-report-id';
Report.filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';
Report.navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';
@@ -3499,6 +3503,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, exports, __webpack_require__) {
var visualDescriptor_1 = __webpack_require__(7);
+ var models = __webpack_require__(4);
/**
* A Power BI report page
*
@@ -3609,6 +3614,23 @@ return /******/ (function(modules) { // webpackBootstrap
throw response.body;
});
};
+ /**
+ * Checks if page has layout.
+ *
+ * ```javascript
+ * page.hasLayout(layoutType)
+ * .then(hasLayout: boolean => { ... });
+ * ```
+ *
+ * @returns {(Promise)}
+ */
+ Page.prototype.hasLayout = function (layoutType) {
+ var layoutTypeEnum = models.LayoutType[layoutType];
+ return this.report.service.hpm.get("/report/pages/" + this.name + "/layoutTypes/" + layoutTypeEnum, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)
+ .then(function (response) { return response.body; }, function (response) {
+ throw response.body;
+ });
+ };
return Page;
}());
exports.Page = Page;
@@ -4214,7 +4236,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, exports) {
var config = {
- version: '2.4.6',
+ version: '2.4.7',
type: 'js'
};
Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/dist/powerbi.min.js b/dist/powerbi.min.js
index 68b8238a..8bb4c468 100644
--- a/dist/powerbi.min.js
+++ b/dist/powerbi.min.js
@@ -1,7 +1,7 @@
-/*! powerbi-client v2.4.6 | (c) 2016 Microsoft Corporation MIT */
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["powerbi-client"]=e():t["powerbi-client"]=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={exports:{},id:i,loaded:!1};return t[i].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var i=r(1);e.service=i;var a=r(14);e.factories=a;var n=r(4);e.models=n;var o=r(5);e.Report=o.Report;var l=r(10);e.Dashboard=l.Dashboard;var s=r(11);e.Tile=s.Tile;var d=r(2);e.Embed=d.Embed;var u=r(6);e.Page=u.Page;var p=r(12);e.Qna=p.Qna;var c=r(13);e.Visual=c.Visual;var f=r(7);e.VisualDescriptor=f.VisualDescriptor;var h=new i.Service(a.hpmFactory,a.wpmpFactory,a.routerFactory);window.powerbi=h},function(t,e,r){var i=r(2),a=r(5),n=r(9),o=r(10),l=r(11),s=r(6),d=r(12),u=r(13),p=r(3),c=function(){function t(e,r,i,a){var n=this;void 0===a&&(a={}),this.wpmp=r(a.wpmpName,a.logMessages),this.hpm=e(this.wpmp,null,a.version,a.type),this.router=i(this.wpmp),this.router.post("/reports/:uniqueId/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/visuals/:visualName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(t,e){var r={type:"dashboard",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.router.post("/tile/:uniqueId/events/:eventName",function(t,e){var r={type:"tile",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.router.post("/qna/:uniqueId/events/:eventName",function(t,e){var r={type:"qna",id:t.params.uniqueId,name:t.params.eventName,value:t.body};n.handleEvent(r)}),this.embeds=[],this.config=p.assign({},t.defaultConfig,a),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return t.prototype.createReport=function(t,e){e.type="create";var r=t,i=new n.Create(this,r,e);return r.powerBiEmbed=i,this.addOrOverwriteEmbed(i,t),i},t.prototype.init=function(t,e){var r=this;void 0===e&&(e=void 0),t=t&&t instanceof HTMLElement?t:document.body;var a=Array.prototype.slice.call(t.querySelectorAll("["+i.Embed.embedUrlAttribute+"]"));return a.map(function(t){return r.embed(t,e)})},t.prototype.embed=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e)},t.prototype.load=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e,!0)},t.prototype.embedInternal=function(t,e,r){void 0===e&&(e={});var i,a=t;return i=a.powerBiEmbed?this.embedExisting(a,e,r):this.embedNew(a,e,r)},t.prototype.embedNew=function(e,r,n){var o=r.type||e.getAttribute(i.Embed.typeAttribute);if(!o)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+e.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+i.Embed.typeAttribute+'="'+a.Report.type.toLowerCase()+"\"'.");r.type=o;var l=p.find(function(t){return o===t.type.toLowerCase()},t.components);if(!l)throw new Error("Attempted to embed component of type: "+o+" but did not find any matching component. Please verify the type you specified is intended.");var s=new l(this,e,r,n);return e.powerBiEmbed=s,this.addOrOverwriteEmbed(s,e),s},t.prototype.embedExisting=function(t,e,r){var i=p.find(function(e){return e.element===t},this.embeds);if(!i)throw new Error("Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if(e.type&&"qna"===e.type.toLowerCase())return this.embedNew(t,e);if("string"==typeof e.type&&e.type!==i.config.type){if("report"===e.type&&"create"===i.config.type){var n=new a.Report(this,t,e,(!1),t.powerBiEmbed.iframe);return n.load(e),t.powerBiEmbed=n,this.addOrOverwriteEmbed(i,t),n}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+e.type)}return i.load(e,r),i},t.prototype.enableAutoEmbed=function(){var t=this;window.addEventListener("DOMContentLoaded",function(e){return t.init(document.body)},!1)},t.prototype.get=function(t){var e=t;if(!e.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+t.outerHTML+" but there was no associated instance.");return e.powerBiEmbed},t.prototype.find=function(t){return p.find(function(e){return e.config.uniqueId===t},this.embeds)},t.prototype.addOrOverwriteEmbed=function(t,e){this.embeds=this.embeds.filter(function(t){return t.element.id!==e.id}),this.embeds.push(t)},t.prototype.reset=function(t){var e=t;if(e.powerBiEmbed){p.remove(function(t){return t===e.powerBiEmbed},this.embeds),delete e.powerBiEmbed;var r=t.querySelector("iframe");r&&(void 0!==r.remove?r.remove():r.parentElement.removeChild(r))}},t.prototype.handleTileEvents=function(t){"tile"===t.type&&this.handleEvent(t)},t.prototype.handleEvent=function(t){var e=p.find(function(e){return e.config.uniqueId===t.id},this.embeds);if(e){var r=t.value;if("pageChanged"===t.name){var i="newPage",a=r[i];if(!a)throw new Error("Page model not found at 'event.value."+i+"'.");r[i]=new s.Page(e,a.name,a.displayName,(!0))}p.raiseCustomEvent(e.element,t.name,r)}},t.prototype.preload=function(t,e){var r=document.createElement("iframe");r.setAttribute("style","display:none;"),r.setAttribute("src",t.embedUrl),r.setAttribute("scrolling","no"),r.setAttribute("allowfullscreen","false");var i=e;return i||(i=document.getElementsByTagName("body")[0]),i.appendChild(r),r.onload=function(){p.raiseCustomEvent(r,"preloaded",{})},r},t.components=[l.Tile,a.Report,o.Dashboard,d.Qna,u.Visual],t.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var t=[],e=0;e0?"&":"?";return t+=i+e+"="+r}e.raiseCustomEvent=r,e.findIndex=i,e.find=a,e.remove=n,e.assign=o,e.createRandomString=l,e.addParamToUrl=s},function(t,e,r){/*! powerbi-models v1.0.1 | (c) 2016 Microsoft Corporation MIT */
-!function(e,r){t.exports=r()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={exports:{},id:i,loaded:!1};return t[i].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function i(t){return l(t)&&!!t.keys}function a(t){return n(t)===x.Basic&&!!t.keyValues}function n(t){if(t.filterType)return t.filterType;var e=t,r=t;return"string"==typeof e.operator&&Array.isArray(e.values)?x.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?x.Advanced:x.Unknown}function o(t){return void 0!==t.table&&void 0!==t.measure}function l(t){return void 0!==t.table&&void 0!==t.column}function s(t){return void 0!==t.table&&void 0!==t.hierarchy&&void 0!==t.hierarchyLevel}function d(t){var e=t.message;return e||(e=t.path+" is invalid. Not meeting "+t.keyword+" constraint"),{message:e}}function u(t){var r=e.Validators.settingsValidator.validate(t);return r?r.map(d):void 0}function p(t){var r=e.Validators.customPageSizeValidator.validate(t);return r?r.map(d):void 0}function c(t){var r=e.Validators.extentionValidator.validate(t);return r?r.map(d):void 0}function f(t){var r=e.Validators.reportLoadValidator.validate(t);return r?r.map(d):void 0}function h(t){var r=e.Validators.reportCreateValidator.validate(t);return r?r.map(d):void 0}function v(t){var r=e.Validators.dashboardLoadValidator.validate(t);return r?r.map(d):void 0}function y(t){var r=e.Validators.tileLoadValidator.validate(t);return r?r.map(d):void 0}function g(t){var r=e.Validators.pageValidator.validate(t);return r?r.map(d):void 0}function m(t){var r=e.Validators.filtersValidator.validate(t);return r?r.map(d):void 0}function V(t){var r=e.Validators.saveAsParametersValidator.validate(t);return r?r.map(d):void 0}function w(t){var r=e.Validators.loadQnaValidator.validate(t);return r?r.map(d):void 0}function b(t){var r=e.Validators.qnaInterpretInputDataValidator.validate(t);return r?r.map(d):void 0}var E=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Validators=r(1).Validators;var P;!function(t){t[t.Widescreen=0]="Widescreen",t[t.Standard=1]="Standard",t[t.Cortana=2]="Cortana",t[t.Letter=3]="Letter",t[t.Custom=4]="Custom"}(P=e.PageSizeType||(e.PageSizeType={}));var O;!function(t){t[t.FitToPage=0]="FitToPage",t[t.FitToWidth=1]="FitToWidth",t[t.ActualSize=2]="ActualSize"}(O=e.DisplayOption||(e.DisplayOption={}));var T;!function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden"}(T=e.VisualContainerDisplayMode||(e.VisualContainerDisplayMode={}));var _;!function(t){t[t.Master=0]="Master",t[t.Custom=1]="Custom"}(_=e.LayoutType||(e.LayoutType={}));var A;!function(t){t[t.Read=0]="Read",t[t.ReadWrite=1]="ReadWrite",t[t.Copy=2]="Copy",t[t.Create=4]="Create",t[t.All=7]="All"}(A=e.Permissions||(e.Permissions={}));var F;!function(t){t[t.View=0]="View",t[t.Edit=1]="Edit"}(F=e.ViewMode||(e.ViewMode={}));var S;!function(t){t[t.Aad=0]="Aad",t[t.Embed=1]="Embed"}(S=e.TokenType||(e.TokenType={}));var x;!function(t){t[t.Advanced=0]="Advanced",t[t.Basic=1]="Basic",t[t.Unknown=2]="Unknown",t[t.IncludeExclude=3]="IncludeExclude",t[t.RelativeDate=4]="RelativeDate",t[t.TopN=5]="TopN"}(x=e.FilterType||(e.FilterType={}));var C;!function(t){t[t.Days=0]="Days",t[t.Weeks=1]="Weeks",t[t.CalendarWeeks=2]="CalendarWeeks",t[t.Months=3]="Months",t[t.CalendarMonths=4]="CalendarMonths",t[t.Years=5]="Years",t[t.CalendarYears=6]="CalendarYears"}(C=e.RelativeDateFilterTimeUnit||(e.RelativeDateFilterTimeUnit={}));var R;!function(t){t[t.InLast=0]="InLast",t[t.InThis=1]="InThis",t[t.InNext=2]="InNext"}(R=e.RelativeDateOperators||(e.RelativeDateOperators={}));var M=function(){function t(t,e){this.target=t,this.filterType=e}return t.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target,filterType:this.filterType}},t}();e.Filter=M;var q=function(t){function e(r,i,a){var n=t.call(this,r,x.Unknown)||this;return n.message=i,n.notSupportedTypeName=a,n.schemaUrl=e.schemaUrl,n}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.message=this.message,e.notSupportedTypeName=this.notSupportedTypeName,e},e}(M);q.schemaUrl="http://powerbi.com/product/schema#notSupported",e.NotSupportedFilter=q;var I=function(t){function e(r,i,a){var n=t.call(this,r,x.IncludeExclude)||this;return n.values=a,n.isExclude=i,n.schemaUrl=e.schemaUrl,n}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.isExclude=this.isExclude,e.values=this.values,e},e}(M);I.schemaUrl="http://powerbi.com/product/schema#includeExclude",e.IncludeExcludeFilter=I;var k=function(t){function e(r,i,a){var n=t.call(this,r,x.TopN)||this;return n.operator=i,n.itemCount=a,n.schemaUrl=e.schemaUrl,n}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.itemCount=this.itemCount,e},e}(M);k.schemaUrl="http://powerbi.com/product/schema#topN",e.TopNFilter=k;var j=function(t){function e(r,i,a,n,o){var l=t.call(this,r,x.RelativeDate)||this;return l.operator=i,l.timeUnitsCount=a,l.timeUnitType=n,l.includeToday=o,l.schemaUrl=e.schemaUrl,l}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.timeUnitsCount=this.timeUnitsCount,e.timeUnitType=this.timeUnitType,e.includeToday=this.includeToday,e},e}(M);j.schemaUrl="http://powerbi.com/product/schema#relativeDate",e.RelativeDateFilter=j;var N=function(t){function e(r,i){for(var a=[],n=2;n0&&!a)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&a&&a.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var l=0;l2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+a.length);if(1===l.length&&"And"!==i)throw new Error('Logical Operator must be "And" when there is only one condition provided');return o.conditions=l,o}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.logicalOperator=this.logicalOperator,e.conditions=this.conditions,e},e}(M);U.schemaUrl="http://powerbi.com/product/schema#advanced",e.AdvancedFilter=U,e.isFilterKeyColumnsTarget=i,e.isBasicFilterWithKeys=a,e.getFilterType=n,e.isMeasure=o,e.isColumn=l,e.isHierarchy=s;var D;!function(t){t[t.Interactive=0]="Interactive",t[t.ResultOnly=1]="ResultOnly"}(D=e.QnaMode||(e.QnaMode={})),e.validateSettings=u,e.validateCustomPageSize=p,e.validateExtension=c,e.validateReportLoad=f,e.validateCreateReport=h,e.validateDashboardLoad=v,e.validateTileLoad=y,e.validatePage=g,e.validateFilter=m,e.validateSaveAsParameters=V,e.validateLoadQnaConfiguration=w,e.validateQnaInterpretInputData=b},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),a=r(3),n=r(5),o=r(6),l=r(7),s=r(8),d=r(9),u=r(10),p=r(11),c=r(12),f=r(13),h=r(14),v=r(15),y=r(16),g=r(17);e.Validators={advancedFilterTypeValidator:new i.EnumValidator([0]),advancedFilterValidator:new o.AdvancedFilterValidator,anyArrayValidator:new i.ArrayValidator([new s.AnyOfValidator([new i.StringValidator,new i.NumberValidator,new i.BooleanValidator])]),anyFilterValidator:new s.AnyOfValidator([new o.BasicFilterValidator,new o.AdvancedFilterValidator,new o.IncludeExcludeFilterValidator,new o.NotSupportedFilterValidator,new o.RelativeDateFilterValidator,new o.TopNFilterValidator]),anyValueValidator:new s.AnyOfValidator([new i.StringValidator,new i.NumberValidator,new i.BooleanValidator]),basicFilterTypeValidator:new i.EnumValidator([1]),basicFilterValidator:new o.BasicFilterValidator,booleanArrayValidator:new i.BooleanArrayValidator,booleanValidator:new i.BooleanValidator,commandExtensionValidator:new a.CommandExtensionValidator,conditionItemValidator:new o.ConditionItemValidator,customLayoutValidator:new g.CustomLayoutValidator,customLayoutDisplayOptionValidator:new i.EnumValidator([0,1,2]),customPageSizeValidator:new f.CustomPageSizeValidator,dashboardLoadValidator:new p.DashboardLoadValidator,displayStateModeValidator:new i.EnumValidator([0,1]),displayStateValidator:new g.DisplayStateValidator,extensionPointsValidator:new a.ExtensionPointsValidator,extentionArrayValidator:new i.ArrayValidator([new a.ExtensionValidator]),extentionValidator:new a.ExtensionValidator,fieldRequiredValidator:new l.FieldRequiredValidator,filterColumnTargetValidator:new o.FilterColumnTargetValidator,filterConditionsValidator:new i.ArrayValidator([new o.ConditionItemValidator]),filterHierarchyTargetValidator:new o.FilterHierarchyTargetValidator,filterMeasureTargetValidator:new o.FilterMeasureTargetValidator,filterTargetValidator:new s.AnyOfValidator([new o.FilterColumnTargetValidator,new o.FilterHierarchyTargetValidator,new o.FilterMeasureTargetValidator]),filtersArrayValidator:new i.ArrayValidator([new s.AnyOfValidator([new o.BasicFilterValidator,new o.AdvancedFilterValidator,new o.RelativeDateFilterValidator])]),filtersValidator:new o.FilterValidator,includeExcludeFilterValidator:new o.IncludeExcludeFilterValidator,includeExludeFilterTypeValidator:new i.EnumValidator([3]),layoutTypeValidator:new i.EnumValidator([0,1]),loadQnaValidator:new h.LoadQnaValidator,menuExtensionValidator:new a.MenuExtensionValidator,notSupportedFilterTypeValidator:new i.EnumValidator([2]),notSupportedFilterValidator:new o.NotSupportedFilterValidator,numberArrayValidator:new i.NumberArrayValidator,numberValidator:new i.NumberValidator,pageLayoutValidator:new y.MapValidator([new i.StringValidator],[new g.VisualLayoutValidator]),pageSizeTypeValidator:new i.EnumValidator([0,1,2,3,4,5]),pageSizeValidator:new f.PageSizeValidator,pageValidator:new f.PageValidator,pageViewFieldValidator:new f.PageViewFieldValidator,pagesLayoutValidator:new y.MapValidator([new i.StringValidator],[new g.PageLayoutValidator]),permissionsValidator:new i.EnumValidator([0,1,2,4,7]),qnaInterpretInputDataValidator:new h.QnaInterpretInputDataValidator,qnaSettingValidator:new h.QnaSettingsValidator,relativeDateFilterOperatorValidator:new i.EnumValidator([0,1,2]),relativeDateFilterTimeUnitTypeValidator:new i.EnumValidator([0,1,2,3,4,5,6]),relativeDateFilterTypeValidator:new i.EnumValidator([4]),relativeDateFilterValidator:new o.RelativeDateFilterValidator,reportCreateValidator:new u.ReportCreateValidator,reportLoadValidator:new d.ReportLoadValidator,saveAsParametersValidator:new v.SaveAsParametersValidator,settingsValidator:new n.SettingsValidator,stringArrayValidator:new i.StringArrayValidator,stringValidator:new i.StringValidator,tileLoadValidator:new c.TileLoadValidator,tokenTypeValidator:new i.EnumValidator([0,1]),topNFilterTypeValidator:new i.EnumValidator([5]),topNFilterValidator:new o.TopNFilterValidator,viewModeValidator:new i.EnumValidator([0,1]),visualLayoutValidator:new g.VisualLayoutValidator}},function(t,e){var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?null:"object"!=typeof t||Array.isArray(t)?[{message:void 0!==r?r+" must be an object":"input must be an object",path:e,keyword:"type"}]:null},t}();e.ObjectValidator=i;var a=function(){function t(t){this.itemValidators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;if(!Array.isArray(t))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];for(var i=0;i0?"&":"?";return t+=i+e+"="+r}e.raiseCustomEvent=r,e.findIndex=i,e.find=a,e.remove=o,e.assign=n,e.createRandomString=l,e.addParamToUrl=s},function(t,e,r){/*! powerbi-models v1.0.2 | (c) 2016 Microsoft Corporation MIT */
+!function(e,r){t.exports=r()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={exports:{},id:i,loaded:!1};return t[i].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function i(t){return l(t)&&!!t.keys}function a(t){return o(t)===x.Basic&&!!t.keyValues}function o(t){if(t.filterType)return t.filterType;var e=t,r=t;return"string"==typeof e.operator&&Array.isArray(e.values)?x.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?x.Advanced:x.Unknown}function n(t){return void 0!==t.table&&void 0!==t.measure}function l(t){return void 0!==t.table&&void 0!==t.column}function s(t){return void 0!==t.table&&void 0!==t.hierarchy&&void 0!==t.hierarchyLevel}function d(t){var e=t.message;return e||(e=t.path+" is invalid. Not meeting "+t.keyword+" constraint"),{message:e}}function u(t){var r=e.Validators.settingsValidator.validate(t);return r?r.map(d):void 0}function p(t){var r=e.Validators.customPageSizeValidator.validate(t);return r?r.map(d):void 0}function c(t){var r=e.Validators.extentionValidator.validate(t);return r?r.map(d):void 0}function f(t){var r=e.Validators.reportLoadValidator.validate(t);return r?r.map(d):void 0}function h(t){var r=e.Validators.reportCreateValidator.validate(t);return r?r.map(d):void 0}function v(t){var r=e.Validators.dashboardLoadValidator.validate(t);return r?r.map(d):void 0}function y(t){var r=e.Validators.tileLoadValidator.validate(t);return r?r.map(d):void 0}function g(t){var r=e.Validators.pageValidator.validate(t);return r?r.map(d):void 0}function m(t){var r=e.Validators.filtersValidator.validate(t);return r?r.map(d):void 0}function V(t){var r=e.Validators.saveAsParametersValidator.validate(t);return r?r.map(d):void 0}function w(t){var r=e.Validators.loadQnaValidator.validate(t);return r?r.map(d):void 0}function b(t){var r=e.Validators.qnaInterpretInputDataValidator.validate(t);return r?r.map(d):void 0}var E=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Validators=r(1).Validators;var P;!function(t){t[t.Widescreen=0]="Widescreen",t[t.Standard=1]="Standard",t[t.Cortana=2]="Cortana",t[t.Letter=3]="Letter",t[t.Custom=4]="Custom"}(P=e.PageSizeType||(e.PageSizeType={}));var T;!function(t){t[t.FitToPage=0]="FitToPage",t[t.FitToWidth=1]="FitToWidth",t[t.ActualSize=2]="ActualSize"}(T=e.DisplayOption||(e.DisplayOption={}));var O;!function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden"}(O=e.VisualContainerDisplayMode||(e.VisualContainerDisplayMode={}));var _;!function(t){t[t.Master=0]="Master",t[t.Custom=1]="Custom",t[t.MobilePortrait=2]="MobilePortrait",t[t.MobileLandscape=3]="MobileLandscape"}(_=e.LayoutType||(e.LayoutType={}));var A;!function(t){t[t.Read=0]="Read",t[t.ReadWrite=1]="ReadWrite",t[t.Copy=2]="Copy",t[t.Create=4]="Create",t[t.All=7]="All"}(A=e.Permissions||(e.Permissions={}));var F;!function(t){t[t.View=0]="View",t[t.Edit=1]="Edit"}(F=e.ViewMode||(e.ViewMode={}));var S;!function(t){t[t.Aad=0]="Aad",t[t.Embed=1]="Embed"}(S=e.TokenType||(e.TokenType={}));var x;!function(t){t[t.Advanced=0]="Advanced",t[t.Basic=1]="Basic",t[t.Unknown=2]="Unknown",t[t.IncludeExclude=3]="IncludeExclude",t[t.RelativeDate=4]="RelativeDate",t[t.TopN=5]="TopN"}(x=e.FilterType||(e.FilterType={}));var C;!function(t){t[t.Days=0]="Days",t[t.Weeks=1]="Weeks",t[t.CalendarWeeks=2]="CalendarWeeks",t[t.Months=3]="Months",t[t.CalendarMonths=4]="CalendarMonths",t[t.Years=5]="Years",t[t.CalendarYears=6]="CalendarYears"}(C=e.RelativeDateFilterTimeUnit||(e.RelativeDateFilterTimeUnit={}));var R;!function(t){t[t.InLast=0]="InLast",t[t.InThis=1]="InThis",t[t.InNext=2]="InNext"}(R=e.RelativeDateOperators||(e.RelativeDateOperators={}));var M=function(){function t(t,e){this.target=t,this.filterType=e}return t.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target,filterType:this.filterType}},t}();e.Filter=M;var q=function(t){function e(r,i,a){var o=t.call(this,r,x.Unknown)||this;return o.message=i,o.notSupportedTypeName=a,o.schemaUrl=e.schemaUrl,o}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.message=this.message,e.notSupportedTypeName=this.notSupportedTypeName,e},e.schemaUrl="http://powerbi.com/product/schema#notSupported",e}(M);e.NotSupportedFilter=q;var I=function(t){function e(r,i,a){var o=t.call(this,r,x.IncludeExclude)||this;return o.values=a,o.isExclude=i,o.schemaUrl=e.schemaUrl,o}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.isExclude=this.isExclude,e.values=this.values,e},e.schemaUrl="http://powerbi.com/product/schema#includeExclude",e}(M);e.IncludeExcludeFilter=I;var k=function(t){function e(r,i,a){var o=t.call(this,r,x.TopN)||this;return o.operator=i,o.itemCount=a,o.schemaUrl=e.schemaUrl,o}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.itemCount=this.itemCount,e},e.schemaUrl="http://powerbi.com/product/schema#topN",e}(M);e.TopNFilter=k;var j=function(t){function e(r,i,a,o,n){var l=t.call(this,r,x.RelativeDate)||this;return l.operator=i,l.timeUnitsCount=a,l.timeUnitType=o,l.includeToday=n,l.schemaUrl=e.schemaUrl,l}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.timeUnitsCount=this.timeUnitsCount,e.timeUnitType=this.timeUnitType,e.includeToday=this.includeToday,e},e.schemaUrl="http://powerbi.com/product/schema#relativeDate",e}(M);e.RelativeDateFilter=j;var N=function(t){function e(r,i){for(var a=[],o=2;o0&&!a)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+n+" keys");if(0===n&&a&&a.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var l=0;l2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+a.length);if(1===l.length&&"And"!==i)throw new Error('Logical Operator must be "And" when there is only one condition provided');return n.conditions=l,n}return E(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.logicalOperator=this.logicalOperator,e.conditions=this.conditions,e},e.schemaUrl="http://powerbi.com/product/schema#advanced",e}(M);e.AdvancedFilter=U,e.isFilterKeyColumnsTarget=i,e.isBasicFilterWithKeys=a,e.getFilterType=o,e.isMeasure=n,e.isColumn=l,e.isHierarchy=s;var D;!function(t){t[t.Interactive=0]="Interactive",t[t.ResultOnly=1]="ResultOnly"}(D=e.QnaMode||(e.QnaMode={})),e.validateSettings=u,e.validateCustomPageSize=p,e.validateExtension=c,e.validateReportLoad=f,e.validateCreateReport=h,e.validateDashboardLoad=v,e.validateTileLoad=y,e.validatePage=g,e.validateFilter=m,e.validateSaveAsParameters=V,e.validateLoadQnaConfiguration=w,e.validateQnaInterpretInputData=b},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),a=r(3),o=r(5),n=r(6),l=r(7),s=r(8),d=r(9),u=r(10),p=r(11),c=r(12),f=r(13),h=r(14),v=r(15),y=r(16),g=r(17);e.Validators={advancedFilterTypeValidator:new i.EnumValidator([0]),advancedFilterValidator:new n.AdvancedFilterValidator,anyArrayValidator:new i.ArrayValidator([new s.AnyOfValidator([new i.StringValidator,new i.NumberValidator,new i.BooleanValidator])]),anyFilterValidator:new s.AnyOfValidator([new n.BasicFilterValidator,new n.AdvancedFilterValidator,new n.IncludeExcludeFilterValidator,new n.NotSupportedFilterValidator,new n.RelativeDateFilterValidator,new n.TopNFilterValidator]),anyValueValidator:new s.AnyOfValidator([new i.StringValidator,new i.NumberValidator,new i.BooleanValidator]),basicFilterTypeValidator:new i.EnumValidator([1]),basicFilterValidator:new n.BasicFilterValidator,booleanArrayValidator:new i.BooleanArrayValidator,booleanValidator:new i.BooleanValidator,commandExtensionValidator:new a.CommandExtensionValidator,conditionItemValidator:new n.ConditionItemValidator,customLayoutValidator:new g.CustomLayoutValidator,customLayoutDisplayOptionValidator:new i.EnumValidator([0,1,2]),customPageSizeValidator:new f.CustomPageSizeValidator,dashboardLoadValidator:new p.DashboardLoadValidator,displayStateModeValidator:new i.EnumValidator([0,1]),displayStateValidator:new g.DisplayStateValidator,extensionPointsValidator:new a.ExtensionPointsValidator,extentionArrayValidator:new i.ArrayValidator([new a.ExtensionValidator]),extentionValidator:new a.ExtensionValidator,fieldRequiredValidator:new l.FieldRequiredValidator,filterColumnTargetValidator:new n.FilterColumnTargetValidator,filterConditionsValidator:new i.ArrayValidator([new n.ConditionItemValidator]),filterHierarchyTargetValidator:new n.FilterHierarchyTargetValidator,filterMeasureTargetValidator:new n.FilterMeasureTargetValidator,filterTargetValidator:new s.AnyOfValidator([new n.FilterColumnTargetValidator,new n.FilterHierarchyTargetValidator,new n.FilterMeasureTargetValidator]),filtersArrayValidator:new i.ArrayValidator([new s.AnyOfValidator([new n.BasicFilterValidator,new n.AdvancedFilterValidator,new n.RelativeDateFilterValidator])]),filtersValidator:new n.FilterValidator,includeExcludeFilterValidator:new n.IncludeExcludeFilterValidator,includeExludeFilterTypeValidator:new i.EnumValidator([3]),layoutTypeValidator:new i.EnumValidator([0,1,2,3]),loadQnaValidator:new h.LoadQnaValidator,menuExtensionValidator:new a.MenuExtensionValidator,notSupportedFilterTypeValidator:new i.EnumValidator([2]),notSupportedFilterValidator:new n.NotSupportedFilterValidator,numberArrayValidator:new i.NumberArrayValidator,numberValidator:new i.NumberValidator,pageLayoutValidator:new y.MapValidator([new i.StringValidator],[new g.VisualLayoutValidator]),pageSizeTypeValidator:new i.EnumValidator([0,1,2,3,4,5]),pageSizeValidator:new f.PageSizeValidator,pageValidator:new f.PageValidator,pageViewFieldValidator:new f.PageViewFieldValidator,pagesLayoutValidator:new y.MapValidator([new i.StringValidator],[new g.PageLayoutValidator]),permissionsValidator:new i.EnumValidator([0,1,2,4,7]),qnaInterpretInputDataValidator:new h.QnaInterpretInputDataValidator,qnaSettingValidator:new h.QnaSettingsValidator,relativeDateFilterOperatorValidator:new i.EnumValidator([0,1,2]),relativeDateFilterTimeUnitTypeValidator:new i.EnumValidator([0,1,2,3,4,5,6]),relativeDateFilterTypeValidator:new i.EnumValidator([4]),relativeDateFilterValidator:new n.RelativeDateFilterValidator,reportCreateValidator:new u.ReportCreateValidator,reportLoadValidator:new d.ReportLoadValidator,saveAsParametersValidator:new v.SaveAsParametersValidator,settingsValidator:new o.SettingsValidator,stringArrayValidator:new i.StringArrayValidator,stringValidator:new i.StringValidator,tileLoadValidator:new c.TileLoadValidator,tokenTypeValidator:new i.EnumValidator([0,1]),topNFilterTypeValidator:new i.EnumValidator([5]),topNFilterValidator:new n.TopNFilterValidator,viewModeValidator:new i.EnumValidator([0,1]),visualLayoutValidator:new g.VisualLayoutValidator}},function(t,e){var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?null:"object"!=typeof t||Array.isArray(t)?[{message:void 0!==r?r+" must be an object":"input must be an object",path:e,keyword:"type"}]:null},t}();e.ObjectValidator=i;var a=function(){function t(t){this.itemValidators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;if(!Array.isArray(t))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];for(var i=0;i2&&"[]"===o.slice(l-2)&&(s=!0,o=o.slice(0,l-2),r[o]||(r[o]=[])),a=n[1]?w(n[1]):""),s?r[o].push(a):r[o]=a}return r},recognize:function(t){var e,r,i,a=[this.rootState],n={},o=!1;if(i=t.indexOf("?"),i!==-1){var l=t.substr(i+1,t.length);t=t.substr(0,i),n=this.parseQueryString(l)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),o=!0),r=0;r2&&"[]"===n.slice(l-2)&&(s=!0,n=n.slice(0,l-2),r[n]||(r[n]=[])),a=o[1]?w(o[1]):""),s?r[n].push(a):r[n]=a}return r},recognize:function(t){var e,r,i,a=[this.rootState],o={},n=!1;if(i=t.indexOf("?"),i!==-1){var l=t.substr(i+1,t.length);t=t.substr(0,i),o=this.parseQueryString(l)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),n=!0),r=0;r { ... });
+ * ```
+ *
+ * @returns {(Promise)}
+ */
+ hasLayout(layoutType): Promise {
+ let layoutTypeEnum = models.LayoutType[layoutType];
+ return this.report.service.hpm.get(`/report/pages/${this.name}/layoutTypes/${layoutTypeEnum}`, { uid: this.report.config.uniqueId }, this.report.iframe.contentWindow)
+ .then(response => response.body,
+ response => {
+ throw response.body;
+ });
+ }
}
\ No newline at end of file
diff --git a/src/report.ts b/src/report.ts
index 17826390..698debde 100644
--- a/src/report.ts
+++ b/src/report.ts
@@ -31,7 +31,7 @@ export interface IReportNode {
* @implements {IFilterable}
*/
export class Report extends embed.Embed implements IReportNode, IFilterable {
- static allowedEvents = ["filtersApplied", "pageChanged", "commandTriggered"];
+ static allowedEvents = ["filtersApplied", "pageChanged", "commandTriggered", "swipeStart", "swipeEnd"];
static reportIdAttribute = 'powerbi-report-id';
static filterPaneEnabledAttribute = 'powerbi-settings-filter-pane-enabled';
static navContentPaneEnabledAttribute = 'powerbi-settings-nav-content-pane-enabled';
@@ -306,6 +306,8 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
*/
populateConfig(baseConfig: embed.IEmbedConfigurationBase): void {
let config = baseConfig;
+ if (config.settings && (config.settings.layoutType === models.LayoutType.MobileLandscape || config.settings.layoutType === models.LayoutType.MobilePortrait))
+ config.embedUrl = utils.addParamToUrl(config.embedUrl, "isMobile", "true")
super.populateConfig(config);