@sumaris-net/ngx-components 1.8.2 → 1.9.0
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/bundles/sumaris-net.ngx-components.umd.js +134 -97
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +4 -0
- package/esm2015/public_api.js +2 -1
- package/esm2015/src/app/core/home/home.js +2 -2
- package/esm2015/src/app/core/services/local-settings.service.js +18 -14
- package/esm2015/src/app/core/services/model/settings.model.js +1 -1
- package/esm2015/src/app/core/services/platform.service.js +35 -31
- package/esm2015/src/app/shared/directives/autofocus.directive.js +15 -24
- package/esm2015/src/app/shared/platforms.js +36 -0
- package/fesm2015/sumaris-net.ngx-components.js +99 -67
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/core/services/local-settings.service.d.ts +0 -2
- package/src/app/core/services/model/settings.model.d.ts +0 -1
- package/src/app/core/services/platform.service.d.ts +8 -5
- package/src/app/shared/directives/autofocus.directive.d.ts +4 -5
- package/src/app/shared/platforms.d.ts +13 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -1279,7 +1279,7 @@
|
|
|
1279
1279
|
return MatAutocompleteConfigHolder;
|
|
1280
1280
|
}());
|
|
1281
1281
|
var noop$8 = function (_) { };
|
|
1282
|
-
var ɵ0$
|
|
1282
|
+
var ɵ0$c = noop$8;
|
|
1283
1283
|
var MatAutocompleteField = /** @class */ (function () {
|
|
1284
1284
|
function MatAutocompleteField(cd, formGroupDir) {
|
|
1285
1285
|
this.cd = cd;
|
|
@@ -4469,27 +4469,56 @@
|
|
|
4469
4469
|
},] }
|
|
4470
4470
|
];
|
|
4471
4471
|
|
|
4472
|
+
/* ---
|
|
4473
|
+
* Source: https://github.com/ionic-team/ionic-framework/blob/b0d53ca73619585671d8cf4dc24e47f826495a0a/core/src/utils/platform.ts
|
|
4474
|
+
* --- */
|
|
4475
|
+
var matchMedia = function (win, query) { return win.matchMedia(query).matches; };
|
|
4476
|
+
var testUserAgent = function (win, expr) {
|
|
4477
|
+
var userAgent = win.navigator.userAgent || win.navigator.vendor || window.opera;
|
|
4478
|
+
return expr.test(userAgent);
|
|
4479
|
+
};
|
|
4480
|
+
var isWindow = function (win) {
|
|
4481
|
+
var userAgent = win.navigator.userAgent || win.navigator.vendor || window.opera;
|
|
4482
|
+
return /windows/i.test(userAgent);
|
|
4483
|
+
};
|
|
4484
|
+
/**
|
|
4485
|
+
* Detect desktop, by fine cursor. See https://github.com/ionic-team/ionic-framework/issues/19942
|
|
4486
|
+
* @param win
|
|
4487
|
+
*/
|
|
4488
|
+
var isDesktop = function (win) { return matchMedia(win, '(any-pointer:fine)'); };
|
|
4489
|
+
var isTouchUi = function (win) { return matchMedia(win, '(any-pointer:coarse)'); };
|
|
4490
|
+
var isMobile = function (win) { return isTouchUi(win) && !isDesktop(win); };
|
|
4491
|
+
var isIpad = function (win) {
|
|
4492
|
+
// iOS 12 and below
|
|
4493
|
+
if (testUserAgent(win, /iPad/i)) {
|
|
4494
|
+
return true;
|
|
4495
|
+
}
|
|
4496
|
+
// iOS 13+
|
|
4497
|
+
if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {
|
|
4498
|
+
return true;
|
|
4499
|
+
}
|
|
4500
|
+
return false;
|
|
4501
|
+
};
|
|
4502
|
+
var ɵ0$b = isIpad;
|
|
4503
|
+
var isIOS = function (win) { return testUserAgent(win, /iPhone|iPod/i) || isIpad(win); };
|
|
4504
|
+
var isAndroid = function (win) { return testUserAgent(win, /android|sink/i); };
|
|
4505
|
+
var isCordova = function (win) { return !!(win['cordova'] || win['phonegap'] || win['PhoneGap']); };
|
|
4506
|
+
|
|
4472
4507
|
// Import the core angular services.
|
|
4473
4508
|
// ----------------------------------------------------------------------------------- //
|
|
4474
4509
|
// ----------------------------------------------------------------------------------- //
|
|
4475
4510
|
var BASE_TIMER_DELAY = 100;
|
|
4476
4511
|
var AutofocusDirective = /** @class */ (function () {
|
|
4477
4512
|
// I initialize the autofocus directive.
|
|
4478
|
-
function AutofocusDirective(elementRef,
|
|
4479
|
-
var _this = this;
|
|
4513
|
+
function AutofocusDirective(elementRef, keyboard) {
|
|
4480
4514
|
this.keyboard = keyboard;
|
|
4481
|
-
this.
|
|
4482
|
-
this.
|
|
4515
|
+
this._timer = null;
|
|
4516
|
+
this._elementRef = elementRef;
|
|
4483
4517
|
this.shouldFocusElement = '';
|
|
4484
|
-
this.
|
|
4518
|
+
this._timer = null;
|
|
4485
4519
|
this.timerDelay = BASE_TIMER_DELAY;
|
|
4486
|
-
|
|
4487
|
-
_this.touchUi = platform.is('mobile') || platform.is('tablet');
|
|
4488
|
-
});
|
|
4520
|
+
this._mobile = isMobile(window);
|
|
4489
4521
|
}
|
|
4490
|
-
// ---
|
|
4491
|
-
// PUBLIC METHODS.
|
|
4492
|
-
// ---
|
|
4493
4522
|
// I get called once after the contents have been fully initialized.
|
|
4494
4523
|
AutofocusDirective.prototype.ngAfterContentInit = function () {
|
|
4495
4524
|
// Because this directive can act on the stand-only "autofocus" attribute or
|
|
@@ -4524,30 +4553,27 @@
|
|
|
4524
4553
|
AutofocusDirective.prototype.ngOnDestroy = function () {
|
|
4525
4554
|
this.stopFocusWorkflow();
|
|
4526
4555
|
};
|
|
4527
|
-
|
|
4528
|
-
// PRIVATE METHODS.
|
|
4529
|
-
// ---
|
|
4556
|
+
/* --- private functions -- */
|
|
4530
4557
|
// I start the timer-based workflow that will focus the current element.
|
|
4531
4558
|
AutofocusDirective.prototype.startFocusWorkflow = function () {
|
|
4532
4559
|
var _this = this;
|
|
4533
4560
|
// if touch UI: do NOT focus when keyboard hide
|
|
4534
|
-
if (this.
|
|
4561
|
+
if (this._mobile && this.keyboard && this.keyboard.isVisible === false)
|
|
4535
4562
|
return;
|
|
4536
4563
|
// If there is already a timer running for this element, just let it play out -
|
|
4537
4564
|
// resetting it at this point will only push-out the time at which the focus is
|
|
4538
4565
|
// applied to the element.
|
|
4539
|
-
if (this.
|
|
4566
|
+
if (this._timer)
|
|
4540
4567
|
return;
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
_this.
|
|
4544
|
-
_this.elementRef.nativeElement.focus();
|
|
4568
|
+
this._timer = setTimeout(function () {
|
|
4569
|
+
_this._timer = null;
|
|
4570
|
+
_this._elementRef.nativeElement.focus();
|
|
4545
4571
|
}, this.timerDelay);
|
|
4546
4572
|
};
|
|
4547
4573
|
// I stop the timer-based workflow, preventing focus from taking place.
|
|
4548
4574
|
AutofocusDirective.prototype.stopFocusWorkflow = function () {
|
|
4549
|
-
clearTimeout(this.
|
|
4550
|
-
this.
|
|
4575
|
+
clearTimeout(this._timer);
|
|
4576
|
+
this._timer = null;
|
|
4551
4577
|
};
|
|
4552
4578
|
return AutofocusDirective;
|
|
4553
4579
|
}());
|
|
@@ -4562,7 +4588,6 @@
|
|
|
4562
4588
|
];
|
|
4563
4589
|
AutofocusDirective.ctorParameters = function () { return [
|
|
4564
4590
|
{ type: i0.ElementRef },
|
|
4565
|
-
{ type: i1$5.Platform },
|
|
4566
4591
|
{ type: ngx.Keyboard, decorators: [{ type: i0.Optional }] }
|
|
4567
4592
|
]; };
|
|
4568
4593
|
|
|
@@ -11244,7 +11269,7 @@
|
|
|
11244
11269
|
|
|
11245
11270
|
var moment$3 = momentImported__namespace;
|
|
11246
11271
|
var SETTINGS_STORAGE_KEY = 'settings';
|
|
11247
|
-
var SETTINGS_TRANSIENT_PROPERTIES = ['mobile', 'touchUi'];
|
|
11272
|
+
var SETTINGS_TRANSIENT_PROPERTIES = ['mobile', 'touchUi' /*deprecated*/];
|
|
11248
11273
|
// fixme: this constant points to static environment
|
|
11249
11274
|
var DEFAULT_SETTINGS = {
|
|
11250
11275
|
accountInheritance: true,
|
|
@@ -11295,14 +11320,24 @@
|
|
|
11295
11320
|
});
|
|
11296
11321
|
Object.defineProperty(LocalSettingsService.prototype, "usageMode", {
|
|
11297
11322
|
get: function () {
|
|
11298
|
-
|
|
11323
|
+
var _a;
|
|
11324
|
+
if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.mobile)) {
|
|
11325
|
+
console.warn("[settings] Accessing to property 'usageMode' BEFORE service started! Please use ready()");
|
|
11326
|
+
return isCordova(window) ? 'FIELD' : 'DESK';
|
|
11327
|
+
}
|
|
11328
|
+
return this._data.usageMode;
|
|
11299
11329
|
},
|
|
11300
11330
|
enumerable: false,
|
|
11301
11331
|
configurable: true
|
|
11302
11332
|
});
|
|
11303
11333
|
Object.defineProperty(LocalSettingsService.prototype, "mobile", {
|
|
11304
11334
|
get: function () {
|
|
11305
|
-
|
|
11335
|
+
var _a;
|
|
11336
|
+
if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.mobile)) {
|
|
11337
|
+
console.warn("[settings] Accessing to property 'mobile' BEFORE service started! Please use ready()");
|
|
11338
|
+
return isMobile(window);
|
|
11339
|
+
}
|
|
11340
|
+
return this._data.mobile;
|
|
11306
11341
|
},
|
|
11307
11342
|
set: function (value) {
|
|
11308
11343
|
this._data.mobile = value;
|
|
@@ -11310,16 +11345,6 @@
|
|
|
11310
11345
|
enumerable: false,
|
|
11311
11346
|
configurable: true
|
|
11312
11347
|
});
|
|
11313
|
-
Object.defineProperty(LocalSettingsService.prototype, "touchUi", {
|
|
11314
|
-
get: function () {
|
|
11315
|
-
return this._data.touchUi;
|
|
11316
|
-
},
|
|
11317
|
-
set: function (value) {
|
|
11318
|
-
this._data.touchUi = value;
|
|
11319
|
-
},
|
|
11320
|
-
enumerable: false,
|
|
11321
|
-
configurable: true
|
|
11322
|
-
});
|
|
11323
11348
|
Object.defineProperty(LocalSettingsService.prototype, "pageHistory", {
|
|
11324
11349
|
get: function () {
|
|
11325
11350
|
return (this._data && this._data.pageHistory || []);
|
|
@@ -11330,9 +11355,8 @@
|
|
|
11330
11355
|
LocalSettingsService.prototype.ngOnStart = function () {
|
|
11331
11356
|
console.info('[settings] Starting service...');
|
|
11332
11357
|
// Restoring local settings
|
|
11333
|
-
this._data.mobile =
|
|
11334
|
-
this._data.
|
|
11335
|
-
this._data.usageMode = this.platform.is('android') || this.platform.is('ios') ? 'FIELD' : 'DESK'; // FIELD by default if Android or iOs
|
|
11358
|
+
this._data.mobile = isNotNil(this._data.mobile) ? this._data.mobile : isMobile(window);
|
|
11359
|
+
this._data.usageMode = (isAndroid(window) || isIOS(window)) ? 'FIELD' : 'DESK'; // FIELD by default if Android or iOS
|
|
11336
11360
|
// Restoring local settings
|
|
11337
11361
|
return this.restoreLocally();
|
|
11338
11362
|
};
|
|
@@ -11345,13 +11369,13 @@
|
|
|
11345
11369
|
LocalSettingsService.prototype.restoreLocally = function () {
|
|
11346
11370
|
return __awaiter(this, void 0, void 0, function () {
|
|
11347
11371
|
var data, settingsStr, restoredData_1;
|
|
11348
|
-
return __generator(this, function (
|
|
11349
|
-
switch (
|
|
11372
|
+
return __generator(this, function (_b) {
|
|
11373
|
+
switch (_b.label) {
|
|
11350
11374
|
case 0:
|
|
11351
11375
|
data = this._data || {};
|
|
11352
11376
|
return [4 /*yield*/, this.storage.get(SETTINGS_STORAGE_KEY)];
|
|
11353
11377
|
case 1:
|
|
11354
|
-
settingsStr =
|
|
11378
|
+
settingsStr = _b.sent();
|
|
11355
11379
|
// Restore local settings (or keep old settings)
|
|
11356
11380
|
if (isNotNilOrBlank(settingsStr)) {
|
|
11357
11381
|
console.info('[settings] Restoring previous settings...');
|
|
@@ -11408,14 +11432,14 @@
|
|
|
11408
11432
|
LocalSettingsService.prototype.apply = function (settings, opts) {
|
|
11409
11433
|
return __awaiter(this, void 0, void 0, function () {
|
|
11410
11434
|
var data;
|
|
11411
|
-
return __generator(this, function (
|
|
11412
|
-
switch (
|
|
11435
|
+
return __generator(this, function (_b) {
|
|
11436
|
+
switch (_b.label) {
|
|
11413
11437
|
case 0:
|
|
11414
11438
|
if (!!this.started) return [3 /*break*/, 2];
|
|
11415
11439
|
return [4 /*yield*/, this.ready()];
|
|
11416
11440
|
case 1:
|
|
11417
|
-
|
|
11418
|
-
|
|
11441
|
+
_b.sent();
|
|
11442
|
+
_b.label = 2;
|
|
11419
11443
|
case 2:
|
|
11420
11444
|
data = Object.assign(Object.assign({}, this._data), settings);
|
|
11421
11445
|
if (equals(data, this._data))
|
|
@@ -11424,11 +11448,11 @@
|
|
|
11424
11448
|
if (!(opts && opts.persistImmediate)) return [3 /*break*/, 4];
|
|
11425
11449
|
return [4 /*yield*/, this.persistLocally(true)];
|
|
11426
11450
|
case 3:
|
|
11427
|
-
|
|
11451
|
+
_b.sent();
|
|
11428
11452
|
return [3 /*break*/, 5];
|
|
11429
11453
|
case 4:
|
|
11430
11454
|
this.persistLocally(); // No AWAIT
|
|
11431
|
-
|
|
11455
|
+
_b.label = 5;
|
|
11432
11456
|
case 5:
|
|
11433
11457
|
// Emit event
|
|
11434
11458
|
if (!opts || opts.emitEvent !== false) {
|
|
@@ -11442,14 +11466,14 @@
|
|
|
11442
11466
|
LocalSettingsService.prototype.applyProperty = function (key, value, opts) {
|
|
11443
11467
|
return __awaiter(this, void 0, void 0, function () {
|
|
11444
11468
|
var changes;
|
|
11445
|
-
return __generator(this, function (
|
|
11446
|
-
switch (
|
|
11469
|
+
return __generator(this, function (_b) {
|
|
11470
|
+
switch (_b.label) {
|
|
11447
11471
|
case 0:
|
|
11448
11472
|
changes = {};
|
|
11449
11473
|
changes[key] = value;
|
|
11450
11474
|
return [4 /*yield*/, this.apply(changes, opts)];
|
|
11451
11475
|
case 1:
|
|
11452
|
-
|
|
11476
|
+
_b.sent();
|
|
11453
11477
|
return [2 /*return*/];
|
|
11454
11478
|
}
|
|
11455
11479
|
});
|
|
@@ -11467,7 +11491,7 @@
|
|
|
11467
11491
|
LocalSettingsService.prototype.savePageSetting = function (pageId, value, propertyName) {
|
|
11468
11492
|
return __awaiter(this, void 0, void 0, function () {
|
|
11469
11493
|
var key;
|
|
11470
|
-
return __generator(this, function (
|
|
11494
|
+
return __generator(this, function (_b) {
|
|
11471
11495
|
this._data = this._data || this.defaultSettings;
|
|
11472
11496
|
this._data.pages = this._data.pages || {};
|
|
11473
11497
|
key = pageId.replace(/[/]/g, '__');
|
|
@@ -11593,8 +11617,8 @@
|
|
|
11593
11617
|
) {
|
|
11594
11618
|
return __awaiter(this, void 0, void 0, function () {
|
|
11595
11619
|
var index, existingPage, removedPages;
|
|
11596
|
-
return __generator(this, function (
|
|
11597
|
-
switch (
|
|
11620
|
+
return __generator(this, function (_b) {
|
|
11621
|
+
switch (_b.label) {
|
|
11598
11622
|
case 0:
|
|
11599
11623
|
// If not inside recursive call: fill page history defaults
|
|
11600
11624
|
if (!pageHistory)
|
|
@@ -11631,8 +11655,8 @@
|
|
|
11631
11655
|
return [4 /*yield*/, this.addToPageHistory(page, opts, existingPage.children)];
|
|
11632
11656
|
case 3:
|
|
11633
11657
|
// Add page as parent's children (recursive call)
|
|
11634
|
-
|
|
11635
|
-
|
|
11658
|
+
_b.sent();
|
|
11659
|
+
_b.label = 4;
|
|
11636
11660
|
case 4:
|
|
11637
11661
|
if (!(pageHistory === this._data.pageHistory)) return [3 /*break*/, 6];
|
|
11638
11662
|
// If max has been reached, remove old pages
|
|
@@ -11644,8 +11668,8 @@
|
|
|
11644
11668
|
return [4 /*yield*/, this.applyProperty('pageHistory', pageHistory)];
|
|
11645
11669
|
case 5:
|
|
11646
11670
|
// Apply new value
|
|
11647
|
-
|
|
11648
|
-
|
|
11671
|
+
_b.sent();
|
|
11672
|
+
_b.label = 6;
|
|
11649
11673
|
case 6: return [2 /*return*/];
|
|
11650
11674
|
}
|
|
11651
11675
|
});
|
|
@@ -11656,8 +11680,8 @@
|
|
|
11656
11680
|
return __awaiter(this, void 0, void 0, function () {
|
|
11657
11681
|
var index, found;
|
|
11658
11682
|
var _this = this;
|
|
11659
|
-
return __generator(this, function (
|
|
11660
|
-
switch (
|
|
11683
|
+
return __generator(this, function (_b) {
|
|
11684
|
+
switch (_b.label) {
|
|
11661
11685
|
case 0:
|
|
11662
11686
|
pageHistory = pageHistory || this._data.pageHistory;
|
|
11663
11687
|
index = pageHistory.findIndex(function (p) { return p.path === path; });
|
|
@@ -11679,8 +11703,8 @@
|
|
|
11679
11703
|
return [4 /*yield*/, this.applyProperty('pageHistory', this._data.pageHistory)];
|
|
11680
11704
|
case 1:
|
|
11681
11705
|
// Apply changes
|
|
11682
|
-
|
|
11683
|
-
|
|
11706
|
+
_b.sent();
|
|
11707
|
+
_b.label = 2;
|
|
11684
11708
|
case 2: return [2 /*return*/, found];
|
|
11685
11709
|
}
|
|
11686
11710
|
});
|
|
@@ -11688,14 +11712,14 @@
|
|
|
11688
11712
|
};
|
|
11689
11713
|
LocalSettingsService.prototype.clearPageHistory = function () {
|
|
11690
11714
|
return __awaiter(this, void 0, void 0, function () {
|
|
11691
|
-
return __generator(this, function (
|
|
11692
|
-
switch (
|
|
11715
|
+
return __generator(this, function (_b) {
|
|
11716
|
+
switch (_b.label) {
|
|
11693
11717
|
case 0:
|
|
11694
11718
|
// Reset all page history
|
|
11695
11719
|
return [4 /*yield*/, this.applyProperty('pageHistory', [], { persistImmediate: true })];
|
|
11696
11720
|
case 1:
|
|
11697
11721
|
// Reset all page history
|
|
11698
|
-
|
|
11722
|
+
_b.sent();
|
|
11699
11723
|
return [2 /*return*/];
|
|
11700
11724
|
}
|
|
11701
11725
|
});
|
|
@@ -17293,29 +17317,44 @@
|
|
|
17293
17317
|
console.debug('[platform] Creating service');
|
|
17294
17318
|
return _this;
|
|
17295
17319
|
}
|
|
17320
|
+
PlatformService.prototype.is = function (platformName) {
|
|
17321
|
+
switch (platformName) {
|
|
17322
|
+
case 'mobile':
|
|
17323
|
+
// Use custom mobile detection - see SUMARIS issue #323
|
|
17324
|
+
return isMobile(window);
|
|
17325
|
+
default:
|
|
17326
|
+
return this.platform.is(platformName);
|
|
17327
|
+
}
|
|
17328
|
+
};
|
|
17296
17329
|
Object.defineProperty(PlatformService.prototype, "mobile", {
|
|
17297
17330
|
get: function () {
|
|
17298
|
-
return isNotNil(this._mobile) ? this._mobile :
|
|
17331
|
+
return isNotNil(this._mobile) ? this._mobile : isMobile(window);
|
|
17299
17332
|
},
|
|
17300
17333
|
enumerable: false,
|
|
17301
17334
|
configurable: true
|
|
17302
17335
|
});
|
|
17303
|
-
PlatformService.prototype.is = function (platformName) {
|
|
17304
|
-
return this.platform.is(platformName);
|
|
17305
|
-
};
|
|
17306
17336
|
/**
|
|
17307
|
-
* Say if opened has been opened
|
|
17337
|
+
* Say if opened has been opened inside an Android or iOs App.
|
|
17308
17338
|
* This is used to known if there is cordova features
|
|
17309
17339
|
*/
|
|
17310
|
-
PlatformService.prototype.
|
|
17311
|
-
return
|
|
17340
|
+
PlatformService.prototype.isCordova = function () {
|
|
17341
|
+
return this._cordova;
|
|
17312
17342
|
};
|
|
17313
17343
|
PlatformService.prototype.isAndroidCordova = function () {
|
|
17314
17344
|
return this._android && this._cordova || false;
|
|
17315
17345
|
};
|
|
17346
|
+
PlatformService.prototype.isIOSCordova = function () {
|
|
17347
|
+
return this._ios && this._cordova || false;
|
|
17348
|
+
};
|
|
17349
|
+
PlatformService.prototype.isWeb = function () {
|
|
17350
|
+
return !this._cordova || (!this._android && !this._ios);
|
|
17351
|
+
};
|
|
17352
|
+
PlatformService.prototype.isApp = function () {
|
|
17353
|
+
return this._cordova && (this._android || this._ios);
|
|
17354
|
+
};
|
|
17316
17355
|
Object.defineProperty(PlatformService.prototype, "canDownload", {
|
|
17317
17356
|
get: function () {
|
|
17318
|
-
return this.
|
|
17357
|
+
return !!this.downloader && this.isAndroidCordova();
|
|
17319
17358
|
},
|
|
17320
17359
|
enumerable: false,
|
|
17321
17360
|
configurable: true
|
|
@@ -17346,16 +17385,13 @@
|
|
|
17346
17385
|
_b.label = 1;
|
|
17347
17386
|
case 1:
|
|
17348
17387
|
_b.trys.push([1, 6, , 7]);
|
|
17349
|
-
this._mobile = this.
|
|
17350
|
-
this._cordova = this.
|
|
17351
|
-
this._android = this.
|
|
17352
|
-
this.
|
|
17353
|
-
this.
|
|
17354
|
-
// Force
|
|
17355
|
-
|
|
17356
|
-
this.settings.mobile = this._mobile;
|
|
17357
|
-
this.settings.touchUi = this.touchUi;
|
|
17358
|
-
}
|
|
17388
|
+
this._mobile = this.is('mobile');
|
|
17389
|
+
this._cordova = this.is('cordova');
|
|
17390
|
+
this._android = this.is('android');
|
|
17391
|
+
this._ios = this.is('ios');
|
|
17392
|
+
this.configureCordovaPlugins();
|
|
17393
|
+
// Force some settings
|
|
17394
|
+
this.settings.mobile = this._mobile;
|
|
17359
17395
|
// Configure translation
|
|
17360
17396
|
return [4 /*yield*/, this.configureTranslate()];
|
|
17361
17397
|
case 2:
|
|
@@ -17378,7 +17414,7 @@
|
|
|
17378
17414
|
case 5:
|
|
17379
17415
|
// Start root services
|
|
17380
17416
|
_b.sent();
|
|
17381
|
-
console.info("[platform] Starting platform [OK] {mobile: " + this._mobile + ",
|
|
17417
|
+
console.info("[platform] Starting platform [OK] {mobile: " + this._mobile + ", downloader: " + this.canDownload + ", fileOpener: " + this.canOpenFile + "} in " + (Date.now() - now) + "ms");
|
|
17382
17418
|
// Update cache configuration when network changed
|
|
17383
17419
|
this.networkService.onNetworkStatusChanges
|
|
17384
17420
|
.pipe(operators.skip(1)) // Skip the first event (behavior subject send event immediately)
|
|
@@ -17390,7 +17426,7 @@
|
|
|
17390
17426
|
console.info("[platform] Using auth token type {" + tokenType + "}");
|
|
17391
17427
|
_this.accountService.tokenType = tokenType;
|
|
17392
17428
|
});
|
|
17393
|
-
// Hide the splashscreen (if mobile) - after 1s
|
|
17429
|
+
// Hide the splashscreen (if mobile) - after 1s - and play start sound
|
|
17394
17430
|
if (this.mobile) {
|
|
17395
17431
|
setTimeout(function () {
|
|
17396
17432
|
var _a;
|
|
@@ -17469,7 +17505,7 @@
|
|
|
17469
17505
|
//}
|
|
17470
17506
|
};
|
|
17471
17507
|
/* -- protected methods -- */
|
|
17472
|
-
PlatformService.prototype.configureCordovaPlugins = function (
|
|
17508
|
+
PlatformService.prototype.configureCordovaPlugins = function () {
|
|
17473
17509
|
console.info('[platform] Configuring Cordova plugins...');
|
|
17474
17510
|
if (this.statusBar) {
|
|
17475
17511
|
this.statusBar.styleDefault();
|
|
@@ -17478,15 +17514,6 @@
|
|
|
17478
17514
|
if (this.keyboard) {
|
|
17479
17515
|
this.keyboard.hideFormAccessoryBar(true);
|
|
17480
17516
|
}
|
|
17481
|
-
// Force to use InAppBrowser instead of default window.open()
|
|
17482
|
-
if (this.browser) {
|
|
17483
|
-
// FIXME: this create a infinite loop (e.g. when downloading an extraction file)
|
|
17484
|
-
// window.open = (url?: string, target?: string, features?: string, replace?: boolean) => {
|
|
17485
|
-
// console.debug("[platform] Call to window.open() redirected to InAppBrowser.open()");
|
|
17486
|
-
// this.browser.create(url, target, features).show();
|
|
17487
|
-
// return window;
|
|
17488
|
-
// };
|
|
17489
|
-
}
|
|
17490
17517
|
};
|
|
17491
17518
|
PlatformService.prototype.configureTranslate = function () {
|
|
17492
17519
|
var _this = this;
|
|
@@ -20704,7 +20731,7 @@
|
|
|
20704
20731
|
this.appName = config.label || this.environment.defaultAppName || 'SUMARiS';
|
|
20705
20732
|
this.logo = config.largeLogo || config.smallLogo || undefined;
|
|
20706
20733
|
this.description = config.name;
|
|
20707
|
-
this.isWeb = this.platform.
|
|
20734
|
+
this.isWeb = this.platform.isWeb();
|
|
20708
20735
|
this.canRegister = config.getPropertyAsBoolean(CORE_CONFIG_OPTIONS.REGISTRATION_ENABLE);
|
|
20709
20736
|
var partners = (config.partners || []).filter(function (p) { return p && p.logo; });
|
|
20710
20737
|
this.$partners.next(partners);
|
|
@@ -29389,11 +29416,16 @@
|
|
|
29389
29416
|
exports.getRandomImage = getRandomImage;
|
|
29390
29417
|
exports.hexToRgb = hexToRgb;
|
|
29391
29418
|
exports.hexToRgbArray = hexToRgbArray;
|
|
29419
|
+
exports.isAndroid = isAndroid;
|
|
29392
29420
|
exports.isControlHasInput = isControlHasInput;
|
|
29421
|
+
exports.isCordova = isCordova;
|
|
29422
|
+
exports.isDesktop = isDesktop;
|
|
29393
29423
|
exports.isEmptyArray = isEmptyArray;
|
|
29424
|
+
exports.isIOS = isIOS;
|
|
29394
29425
|
exports.isInputElement = isInputElement;
|
|
29395
29426
|
exports.isInstanceOf = isInstanceOf;
|
|
29396
29427
|
exports.isInt = isInt;
|
|
29428
|
+
exports.isMobile = isMobile;
|
|
29397
29429
|
exports.isNil = isNil;
|
|
29398
29430
|
exports.isNilOrBlank = isNilOrBlank;
|
|
29399
29431
|
exports.isNilOrNaN = isNilOrNaN;
|
|
@@ -29404,6 +29436,8 @@
|
|
|
29404
29436
|
exports.isNotNilString = isNotNilString;
|
|
29405
29437
|
exports.isNumber = isNumber;
|
|
29406
29438
|
exports.isNumberRange = isNumberRange;
|
|
29439
|
+
exports.isTouchUi = isTouchUi;
|
|
29440
|
+
exports.isWindow = isWindow;
|
|
29407
29441
|
exports.joinProperties = joinProperties;
|
|
29408
29442
|
exports.joinPropertiesPath = joinPropertiesPath;
|
|
29409
29443
|
exports.logFormErrors = logFormErrors;
|
|
@@ -29411,6 +29445,7 @@
|
|
|
29411
29445
|
exports.markAsUntouched = markAsUntouched;
|
|
29412
29446
|
exports.markControlAsTouched = markControlAsTouched;
|
|
29413
29447
|
exports.markFormGroupAsTouched = markFormGroupAsTouched;
|
|
29448
|
+
exports.matchMedia = matchMedia;
|
|
29414
29449
|
exports.matchUpperCase = matchUpperCase;
|
|
29415
29450
|
exports.mergeLoadResult = mergeLoadResult;
|
|
29416
29451
|
exports.mixHex = mixHex;
|
|
@@ -29451,6 +29486,7 @@
|
|
|
29451
29486
|
exports.suggestFromArray = suggestFromArray;
|
|
29452
29487
|
exports.suggestFromStringArray = suggestFromStringArray;
|
|
29453
29488
|
exports.tabindexComparator = tabindexComparator;
|
|
29489
|
+
exports.testUserAgent = testUserAgent;
|
|
29454
29490
|
exports.toBoolean = toBoolean;
|
|
29455
29491
|
exports.toDateISOString = toDateISOString;
|
|
29456
29492
|
exports.toDuration = toDuration;
|
|
@@ -29465,6 +29501,7 @@
|
|
|
29465
29501
|
exports.waitForTrue = waitForTrue;
|
|
29466
29502
|
exports.waitIdle = waitIdle;
|
|
29467
29503
|
exports.waitWhilePending = waitWhilePending;
|
|
29504
|
+
exports["ɵ0"] = ɵ0$b;
|
|
29468
29505
|
exports["ɵa"] = CustomReuseStrategy;
|
|
29469
29506
|
exports["ɵb"] = MatNumpadDomService;
|
|
29470
29507
|
exports["ɵc"] = SharedMatBadgeIconModule;
|