@coolon/angular-ui-powerups 0.0.72 → 0.0.75
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/coolon-angular-ui-powerups.umd.js +1793 -1331
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +35 -32
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +35 -32
- package/esm2015/index.js +2 -2
- package/esm2015/lib/angular-ui-powerups.module.js +8 -22
- package/esm2015/lib/components/components.module.js +47 -0
- package/esm2015/lib/components/forms/number-input/number-input.component.js +2 -2
- package/esm2015/lib/components/forms/password-input/password-input.component.js +2 -2
- package/esm2015/lib/components/forms/select-input/select-input.component.js +2 -2
- package/esm2015/lib/components/forms/string-input/string-input.component.js +2 -2
- package/esm2015/lib/components/index.js +2 -1
- package/esm2015/lib/components/noop/noop.component.js +2 -2
- package/esm2015/lib/directives/directives.module.js +36 -0
- package/esm2015/lib/directives/index.js +2 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +72 -49
- package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js +2 -2
- package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
- package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +128 -0
- package/esm2015/lib/interaction/components/interaction-outlet/interaction-outlet.component.js +2 -2
- package/esm2015/lib/interaction/index.js +2 -1
- package/esm2015/lib/interaction/interaction.module.js +6 -3
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +10 -7
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +38 -3
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +2 -2
- package/esm2015/lib/place/components/empty-state/empty-state.component.js +3 -3
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +3 -3
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +73 -33
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +3 -3
- package/esm2015/lib/place/index.js +2 -2
- package/esm2015/lib/place/place-component.js +3 -1
- package/esm2015/lib/place/place-definition.js +2 -6
- package/esm2015/lib/place/place-router.js +7 -9
- package/esm2015/lib/place/place.decorator.js +2 -4
- package/esm2015/lib/place/place.module.js +4 -2
- package/esm2015/lib/place/route/guards/enter-place-guard.service.js +283 -0
- package/esm2015/lib/place/route/guards/leave-place.guard.js +73 -53
- package/esm2015/lib/place/visit.js +10 -1
- package/esm2015/public_api.js +5 -5
- package/esm5/coolon-angular-ui-powerups.js +35 -32
- package/esm5/index.js +2 -2
- package/esm5/lib/angular-ui-powerups.module.js +8 -22
- package/esm5/lib/components/components.module.js +51 -0
- package/esm5/lib/components/forms/number-input/number-input.component.js +2 -2
- package/esm5/lib/components/forms/password-input/password-input.component.js +2 -2
- package/esm5/lib/components/forms/select-input/select-input.component.js +2 -2
- package/esm5/lib/components/forms/string-input/string-input.component.js +2 -2
- package/esm5/lib/components/index.js +2 -1
- package/esm5/lib/components/noop/noop.component.js +2 -2
- package/esm5/lib/directives/directives.module.js +40 -0
- package/esm5/lib/directives/index.js +2 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +80 -50
- package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js +2 -2
- package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +3 -3
- package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +3 -3
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +3 -3
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +171 -0
- package/esm5/lib/interaction/components/interaction-outlet/interaction-outlet.component.js +2 -2
- package/esm5/lib/interaction/index.js +2 -1
- package/esm5/lib/interaction/interaction.module.js +6 -3
- package/esm5/lib/interaction/services/dialog-interaction.service.js +10 -7
- package/esm5/lib/place/components/abstract-place-navigation.component.js +38 -3
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +2 -2
- package/esm5/lib/place/components/empty-state/empty-state.component.js +3 -3
- package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +3 -3
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +85 -39
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +3 -3
- package/esm5/lib/place/index.js +2 -2
- package/esm5/lib/place/place-component.js +3 -1
- package/esm5/lib/place/place-definition.js +2 -5
- package/esm5/lib/place/place-router.js +11 -10
- package/esm5/lib/place/place.decorator.js +2 -4
- package/esm5/lib/place/place.module.js +4 -2
- package/esm5/lib/place/route/guards/enter-place-guard.service.js +319 -0
- package/esm5/lib/place/route/guards/leave-place.guard.js +75 -11
- package/esm5/lib/place/visit.js +13 -1
- package/esm5/public_api.js +5 -5
- package/fesm2015/coolon-angular-ui-powerups.js +1308 -970
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1747 -1292
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/components.module.d.ts +2 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/directives/directives.module.d.ts +2 -0
- package/lib/directives/index.d.ts +1 -0
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +9 -6
- package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +21 -0
- package/lib/interaction/index.d.ts +1 -0
- package/lib/place/components/abstract-place-navigation.component.d.ts +7 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +8 -5
- package/lib/place/index.d.ts +1 -1
- package/lib/place/place-component.d.ts +2 -0
- package/lib/place/place-definition.d.ts +1 -2
- package/lib/place/place.decorator.d.ts +0 -1
- package/lib/place/route/guards/{place-route.guard.d.ts → enter-place-guard.service.d.ts} +6 -4
- package/lib/place/visit.d.ts +2 -0
- package/package.json +1 -1
- package/schematics/place-routes/place-builder.js +0 -1
- package/schematics/place-routes/place-builder.js.map +1 -1
- package/schematics/place-routes/place-class-scanner.js +0 -1
- package/schematics/place-routes/place-class-scanner.js.map +1 -1
- package/schematics/place-routes/place-def.d.ts +0 -2
- package/schematics/place-routes/place-def.js +12 -11
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/place-routes/templates/place-routes.ts.template +1 -1
- package/styles/styles.scss +7 -2
- package/esm2015/lib/place/route/guards/place-route.guard.js +0 -243
- package/esm5/lib/place/route/guards/place-route.guard.js +0 -273
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', '
|
|
4
|
-
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.
|
|
5
|
-
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, dialog,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill'], factory) :
|
|
4
|
+
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.src, global.fastMemoizeDecorator, null, global.ng.animations, global.ResizeObserver));
|
|
5
|
+
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, dialog, icon, list, tooltip, src, fastMemoizeDecorator, reflectMetadata, animations$1, ResizeObserver) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ___default__default = 'default' in ___default ? ___default['default'] : ___default;
|
|
8
8
|
ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
|
|
@@ -204,70 +204,35 @@
|
|
|
204
204
|
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
/**
|
|
208
|
-
* @fileoverview added by tsickle
|
|
209
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
210
|
-
*/
|
|
211
|
-
var DisposableComponent = /** @class */ (function (_super) {
|
|
212
|
-
__extends(DisposableComponent, _super);
|
|
213
|
-
function DisposableComponent() {
|
|
214
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* @return {?}
|
|
218
|
-
*/
|
|
219
|
-
DisposableComponent.prototype.ngOnDestroy = /**
|
|
220
|
-
* @return {?}
|
|
221
|
-
*/
|
|
222
|
-
function () {
|
|
223
|
-
this.dispose();
|
|
224
|
-
};
|
|
225
|
-
return DisposableComponent;
|
|
226
|
-
}(pectin.GarbageCollector));
|
|
227
|
-
|
|
228
207
|
/**
|
|
229
208
|
* @fileoverview added by tsickle
|
|
230
209
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
231
210
|
*/
|
|
232
211
|
/**
|
|
233
|
-
* @
|
|
234
|
-
* @template T
|
|
212
|
+
* @template P
|
|
235
213
|
*/
|
|
236
|
-
var
|
|
237
|
-
__extends(
|
|
238
|
-
function
|
|
214
|
+
var CommandDirective = /** @class */ (function (_super) {
|
|
215
|
+
__extends(CommandDirective, _super);
|
|
216
|
+
function CommandDirective(elementRef) {
|
|
239
217
|
var _this = _super.call(this) || this;
|
|
240
|
-
_this.
|
|
241
|
-
|
|
242
|
-
// tslint:disable-next-line:no-output-native
|
|
243
|
-
_this.focus = new core.EventEmitter();
|
|
244
|
-
// tslint:disable-next-line:no-output-native
|
|
245
|
-
_this.blur = new core.EventEmitter();
|
|
246
|
-
// tslint:disable-next-line:no-output-native
|
|
247
|
-
_this.enterKey = new core.EventEmitter();
|
|
248
|
-
// tslint:disable-next-line:no-output-native
|
|
249
|
-
_this.escapeKey = new core.EventEmitter();
|
|
250
|
-
/** @type {?} */
|
|
251
|
-
var self = _this;
|
|
252
|
-
_this.errorStateMatcher = {
|
|
253
|
-
isErrorState: /**
|
|
254
|
-
* @param {?} control
|
|
255
|
-
* @param {?} form
|
|
256
|
-
* @return {?}
|
|
257
|
-
*/
|
|
258
|
-
function (control, form) {
|
|
259
|
-
return self.hasErrors();
|
|
260
|
-
}
|
|
261
|
-
};
|
|
218
|
+
_this.elementRef = elementRef;
|
|
219
|
+
_this._commandParameterProvided = false;
|
|
262
220
|
return _this;
|
|
263
221
|
}
|
|
264
|
-
Object.defineProperty(
|
|
222
|
+
Object.defineProperty(CommandDirective.prototype, "commandParameter", {
|
|
223
|
+
get: /**
|
|
224
|
+
* @return {?}
|
|
225
|
+
*/
|
|
226
|
+
function () {
|
|
227
|
+
return this._commandParameter;
|
|
228
|
+
},
|
|
265
229
|
set: /**
|
|
266
|
-
* @param {?}
|
|
230
|
+
* @param {?} value
|
|
267
231
|
* @return {?}
|
|
268
232
|
*/
|
|
269
|
-
function (
|
|
270
|
-
this.
|
|
233
|
+
function (value) {
|
|
234
|
+
this._commandParameterProvided = true;
|
|
235
|
+
this._commandParameter = value;
|
|
271
236
|
},
|
|
272
237
|
enumerable: true,
|
|
273
238
|
configurable: true
|
|
@@ -275,725 +240,829 @@
|
|
|
275
240
|
/**
|
|
276
241
|
* @return {?}
|
|
277
242
|
*/
|
|
278
|
-
|
|
243
|
+
CommandDirective.prototype.ngOnInit = /**
|
|
279
244
|
* @return {?}
|
|
280
245
|
*/
|
|
281
246
|
function () {
|
|
282
|
-
|
|
247
|
+
pectin.assert.notNil(this.pectinCommand);
|
|
248
|
+
if (this.pectinCommand instanceof pectin.UnaryCommand) {
|
|
249
|
+
if (!this._commandParameterProvided) {
|
|
250
|
+
pectin.lang.illegalState('UnaryCommands required the command parameter to be specified.');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
if (this._commandParameterProvided) {
|
|
255
|
+
pectin.lang.illegalState('command parameters are only supported by UnaryCommands');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
283
258
|
};
|
|
284
259
|
/**
|
|
285
260
|
* @return {?}
|
|
286
261
|
*/
|
|
287
|
-
|
|
262
|
+
CommandDirective.prototype.ngAfterViewInit = /**
|
|
288
263
|
* @return {?}
|
|
289
264
|
*/
|
|
290
265
|
function () {
|
|
291
|
-
this
|
|
292
|
-
|
|
266
|
+
var _this = this;
|
|
267
|
+
// for some reason mat-buttons kills the disabled host binding. It works on a regular button but for now
|
|
268
|
+
// we need to do this.
|
|
269
|
+
var chain = pectin.Dsl.disposeWith(this).chain;
|
|
270
|
+
chain(this.pectinCommand.enabled).subscribe((/**
|
|
271
|
+
* @param {?} enabled
|
|
272
|
+
* @return {?}
|
|
273
|
+
*/
|
|
274
|
+
function (enabled) {
|
|
275
|
+
if (enabled) {
|
|
276
|
+
_this.elementRef.nativeElement.removeAttribute('disabled');
|
|
277
|
+
if (_this.elementRef.nativeElement.tagName === 'A') {
|
|
278
|
+
_this.elementRef.nativeElement.setAttribute('href', 'javascript:void');
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
_this.elementRef.nativeElement.setAttribute('disabled', 'disabled');
|
|
283
|
+
if (_this.elementRef.nativeElement.tagName === 'A') {
|
|
284
|
+
_this.elementRef.nativeElement.removeAttribute('href');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}));
|
|
293
288
|
};
|
|
294
289
|
/**
|
|
295
290
|
* @return {?}
|
|
296
291
|
*/
|
|
297
|
-
|
|
292
|
+
CommandDirective.prototype.ngOnDestroy = /**
|
|
298
293
|
* @return {?}
|
|
299
294
|
*/
|
|
300
295
|
function () {
|
|
301
|
-
this.
|
|
302
|
-
this.blur.emit();
|
|
296
|
+
this.dispose();
|
|
303
297
|
};
|
|
304
298
|
/**
|
|
299
|
+
* @param {?} $event
|
|
305
300
|
* @return {?}
|
|
306
301
|
*/
|
|
307
|
-
|
|
302
|
+
CommandDirective.prototype.notifyClick = /**
|
|
303
|
+
* @param {?} $event
|
|
308
304
|
* @return {?}
|
|
309
305
|
*/
|
|
310
|
-
function () {
|
|
311
|
-
|
|
312
|
-
|
|
306
|
+
function ($event) {
|
|
307
|
+
$event.preventDefault();
|
|
308
|
+
$event.stopPropagation();
|
|
309
|
+
if (this.pectinCommand.enabled.value) {
|
|
310
|
+
if (this.pectinCommand instanceof pectin.UnaryCommand) {
|
|
311
|
+
this.pectinCommand.withContext({ event: $event }).execute(this.commandParameter);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
this.pectinCommand.withContext({ event: $event }).execute();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
console.warn('disabled command clicked, ignoring.');
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
CommandDirective.decorators = [
|
|
322
|
+
{ type: core.Directive, args: [{
|
|
323
|
+
// tslint:disable-next-line:directive-selector
|
|
324
|
+
selector: '[pectinCommand]'
|
|
325
|
+
},] }
|
|
326
|
+
];
|
|
327
|
+
/** @nocollapse */
|
|
328
|
+
CommandDirective.ctorParameters = function () { return [
|
|
329
|
+
{ type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
|
|
330
|
+
]; };
|
|
331
|
+
CommandDirective.propDecorators = {
|
|
332
|
+
pectinCommand: [{ type: core.Input }],
|
|
333
|
+
commandParameter: [{ type: core.Input }],
|
|
334
|
+
notifyClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
|
|
313
335
|
};
|
|
336
|
+
return CommandDirective;
|
|
337
|
+
}(pectin.GarbageCollector));
|
|
338
|
+
if (false) {
|
|
339
|
+
/** @type {?} */
|
|
340
|
+
CommandDirective.prototype.pectinCommand;
|
|
341
|
+
/**
|
|
342
|
+
* @type {?}
|
|
343
|
+
* @private
|
|
344
|
+
*/
|
|
345
|
+
CommandDirective.prototype._commandParameter;
|
|
346
|
+
/**
|
|
347
|
+
* @type {?}
|
|
348
|
+
* @private
|
|
349
|
+
*/
|
|
350
|
+
CommandDirective.prototype._commandParameterProvided;
|
|
351
|
+
/**
|
|
352
|
+
* @type {?}
|
|
353
|
+
* @private
|
|
354
|
+
*/
|
|
355
|
+
CommandDirective.prototype.elementRef;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @fileoverview added by tsickle
|
|
360
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
361
|
+
*/
|
|
362
|
+
var DisposableComponent = /** @class */ (function (_super) {
|
|
363
|
+
__extends(DisposableComponent, _super);
|
|
364
|
+
function DisposableComponent() {
|
|
365
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
366
|
+
}
|
|
314
367
|
/**
|
|
315
368
|
* @return {?}
|
|
316
369
|
*/
|
|
317
|
-
|
|
370
|
+
DisposableComponent.prototype.ngOnDestroy = /**
|
|
318
371
|
* @return {?}
|
|
319
372
|
*/
|
|
320
373
|
function () {
|
|
321
|
-
this.
|
|
322
|
-
this.escapeKey.emit();
|
|
374
|
+
this.dispose();
|
|
323
375
|
};
|
|
376
|
+
return DisposableComponent;
|
|
377
|
+
}(pectin.GarbageCollector));
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @fileoverview added by tsickle
|
|
381
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
382
|
+
*/
|
|
383
|
+
var FocusBindingDirective = /** @class */ (function (_super) {
|
|
384
|
+
__extends(FocusBindingDirective, _super);
|
|
385
|
+
function FocusBindingDirective(el, ngZone, document) {
|
|
386
|
+
var _this = _super.call(this) || this;
|
|
387
|
+
_this.el = el;
|
|
388
|
+
_this.ngZone = ngZone;
|
|
389
|
+
// @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
|
|
390
|
+
_this.document = (/** @type {?} */ (document));
|
|
391
|
+
return _this;
|
|
392
|
+
}
|
|
324
393
|
/**
|
|
325
|
-
* @protected
|
|
326
|
-
* @param {?} command
|
|
327
394
|
* @return {?}
|
|
328
395
|
*/
|
|
329
|
-
|
|
330
|
-
* @protected
|
|
331
|
-
* @param {?} command
|
|
396
|
+
FocusBindingDirective.prototype.onFocusIn = /**
|
|
332
397
|
* @return {?}
|
|
333
398
|
*/
|
|
334
|
-
function (
|
|
335
|
-
if (
|
|
336
|
-
|
|
399
|
+
function () {
|
|
400
|
+
if (this.hasBinding()) {
|
|
401
|
+
this.pectinFocusBinding.focusContext.notifyFocusIn();
|
|
337
402
|
}
|
|
338
403
|
};
|
|
339
404
|
/**
|
|
340
405
|
* @return {?}
|
|
341
406
|
*/
|
|
342
|
-
|
|
407
|
+
FocusBindingDirective.prototype.onFocusOut = /**
|
|
343
408
|
* @return {?}
|
|
344
409
|
*/
|
|
345
410
|
function () {
|
|
411
|
+
if (this.hasBinding()) {
|
|
412
|
+
this.pectinFocusBinding.focusContext.notifyFocusOut();
|
|
413
|
+
}
|
|
346
414
|
};
|
|
347
415
|
/**
|
|
348
416
|
* @return {?}
|
|
349
417
|
*/
|
|
350
|
-
|
|
418
|
+
FocusBindingDirective.prototype.ngOnInit = /**
|
|
351
419
|
* @return {?}
|
|
352
420
|
*/
|
|
353
421
|
function () {
|
|
354
|
-
return this.enabled.value;
|
|
355
422
|
};
|
|
356
|
-
Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
|
|
357
|
-
get: /**
|
|
358
|
-
* @return {?}
|
|
359
|
-
*/
|
|
360
|
-
function () {
|
|
361
|
-
return this.valueModel.enabled;
|
|
362
|
-
},
|
|
363
|
-
enumerable: true,
|
|
364
|
-
configurable: true
|
|
365
|
-
});
|
|
366
423
|
/**
|
|
367
424
|
* @return {?}
|
|
368
425
|
*/
|
|
369
|
-
|
|
426
|
+
FocusBindingDirective.prototype.ngAfterViewInit = /**
|
|
370
427
|
* @return {?}
|
|
371
428
|
*/
|
|
372
429
|
function () {
|
|
373
|
-
|
|
430
|
+
var _this = this;
|
|
431
|
+
// TODO: Make this also track the current enabled/disabled state.
|
|
432
|
+
if (this.hasBinding()) {
|
|
433
|
+
var chain = pectin.Dsl.disposeWith(this).chain;
|
|
434
|
+
chain(this.pectinFocusBinding.focusContext.focused).subscribe((/**
|
|
435
|
+
* @param {?} focused
|
|
436
|
+
* @return {?}
|
|
437
|
+
*/
|
|
438
|
+
function (focused) {
|
|
439
|
+
if (focused && !_this.alreadyHasFocus()) {
|
|
440
|
+
_this.tryAndFocus();
|
|
441
|
+
}
|
|
442
|
+
}));
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
pectin.Logger.get(this).warn('pectinFocusBinding was nil');
|
|
446
|
+
}
|
|
374
447
|
};
|
|
375
|
-
Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
|
|
376
|
-
get: /**
|
|
377
|
-
* @return {?}
|
|
378
|
-
*/
|
|
379
|
-
function () {
|
|
380
|
-
return this.valueModel.errorList;
|
|
381
|
-
},
|
|
382
|
-
enumerable: true,
|
|
383
|
-
configurable: true
|
|
384
|
-
});
|
|
385
|
-
Object.defineProperty(AbstractInputComponent.prototype, "firstError", {
|
|
386
|
-
get: /**
|
|
387
|
-
* @return {?}
|
|
388
|
-
*/
|
|
389
|
-
function () {
|
|
390
|
-
return this.hasErrors() ? this.errorList.value[0] : null;
|
|
391
|
-
},
|
|
392
|
-
enumerable: true,
|
|
393
|
-
configurable: true
|
|
394
|
-
});
|
|
395
|
-
AbstractInputComponent.propDecorators = {
|
|
396
|
-
userValueModel: [{ type: core.Input, args: ['valueModel',] }],
|
|
397
|
-
label: [{ type: core.Input }],
|
|
398
|
-
floatLabel: [{ type: core.Input }],
|
|
399
|
-
hint: [{ type: core.Input }],
|
|
400
|
-
placeholder: [{ type: core.Input }],
|
|
401
|
-
focusCommand: [{ type: core.Input, args: ['command.focus',] }],
|
|
402
|
-
blurCommand: [{ type: core.Input, args: ['command.blur',] }],
|
|
403
|
-
enterCommand: [{ type: core.Input, args: ['command.enter',] }],
|
|
404
|
-
escapeCommand: [{ type: core.Input, args: ['command.escape',] }],
|
|
405
|
-
clickCommand: [{ type: core.Input, args: ['command.click',] }],
|
|
406
|
-
focus: [{ type: core.Output }],
|
|
407
|
-
blur: [{ type: core.Output }],
|
|
408
|
-
enterKey: [{ type: core.Output }],
|
|
409
|
-
escapeKey: [{ type: core.Output }],
|
|
410
|
-
notifyClick: [{ type: core.HostListener, args: ['click',] }],
|
|
411
|
-
notifyFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
|
|
412
|
-
notifyFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
|
|
413
|
-
};
|
|
414
|
-
__decorate([
|
|
415
|
-
pectin.UseDelegate(),
|
|
416
|
-
__metadata("design:type", pectin.ValueModel),
|
|
417
|
-
__metadata("design:paramtypes", [pectin.ValueModel])
|
|
418
|
-
], AbstractInputComponent.prototype, "userValueModel", null);
|
|
419
|
-
return AbstractInputComponent;
|
|
420
|
-
}(DisposableComponent));
|
|
421
|
-
if (false) {
|
|
422
|
-
/** @type {?} */
|
|
423
|
-
AbstractInputComponent.prototype.valueModel;
|
|
424
|
-
/** @type {?} */
|
|
425
|
-
AbstractInputComponent.prototype.label;
|
|
426
|
-
/** @type {?} */
|
|
427
|
-
AbstractInputComponent.prototype.floatLabel;
|
|
428
|
-
/** @type {?} */
|
|
429
|
-
AbstractInputComponent.prototype.hint;
|
|
430
|
-
/** @type {?} */
|
|
431
|
-
AbstractInputComponent.prototype.placeholder;
|
|
432
|
-
/** @type {?} */
|
|
433
|
-
AbstractInputComponent.prototype.focusCommand;
|
|
434
|
-
/** @type {?} */
|
|
435
|
-
AbstractInputComponent.prototype.blurCommand;
|
|
436
|
-
/** @type {?} */
|
|
437
|
-
AbstractInputComponent.prototype.enterCommand;
|
|
438
|
-
/** @type {?} */
|
|
439
|
-
AbstractInputComponent.prototype.escapeCommand;
|
|
440
|
-
/** @type {?} */
|
|
441
|
-
AbstractInputComponent.prototype.clickCommand;
|
|
442
|
-
/** @type {?} */
|
|
443
|
-
AbstractInputComponent.prototype.focus;
|
|
444
|
-
/** @type {?} */
|
|
445
|
-
AbstractInputComponent.prototype.blur;
|
|
446
|
-
/** @type {?} */
|
|
447
|
-
AbstractInputComponent.prototype.enterKey;
|
|
448
|
-
/** @type {?} */
|
|
449
|
-
AbstractInputComponent.prototype.escapeKey;
|
|
450
|
-
/** @type {?} */
|
|
451
|
-
AbstractInputComponent.prototype.errorStateMatcher;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* @fileoverview added by tsickle
|
|
456
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
457
|
-
*/
|
|
458
|
-
var NumberInputComponent = /** @class */ (function (_super) {
|
|
459
|
-
__extends(NumberInputComponent, _super);
|
|
460
|
-
function NumberInputComponent() {
|
|
461
|
-
return _super.call(this) || this;
|
|
462
|
-
}
|
|
463
448
|
/**
|
|
449
|
+
* @private
|
|
464
450
|
* @return {?}
|
|
465
451
|
*/
|
|
466
|
-
|
|
452
|
+
FocusBindingDirective.prototype.hasBinding = /**
|
|
453
|
+
* @private
|
|
467
454
|
* @return {?}
|
|
468
455
|
*/
|
|
469
456
|
function () {
|
|
457
|
+
return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
|
|
470
458
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
selector: 'angular-ui-powerups-number-input',
|
|
474
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
475
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
476
|
-
}] }
|
|
477
|
-
];
|
|
478
|
-
/** @nocollapse */
|
|
479
|
-
NumberInputComponent.ctorParameters = function () { return []; };
|
|
480
|
-
return NumberInputComponent;
|
|
481
|
-
}(AbstractInputComponent));
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* @fileoverview added by tsickle
|
|
485
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
486
|
-
*/
|
|
487
|
-
var PasswordInputComponent = /** @class */ (function (_super) {
|
|
488
|
-
__extends(PasswordInputComponent, _super);
|
|
489
|
-
function PasswordInputComponent() {
|
|
490
|
-
return _super.call(this) || this;
|
|
491
|
-
}
|
|
459
|
+
// Hook method for debugging via tracing.
|
|
460
|
+
// Hook method for debugging via tracing.
|
|
492
461
|
/**
|
|
493
462
|
* @return {?}
|
|
494
463
|
*/
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
*/
|
|
498
|
-
function () {
|
|
499
|
-
};
|
|
500
|
-
PasswordInputComponent.decorators = [
|
|
501
|
-
{ type: core.Component, args: [{
|
|
502
|
-
selector: 'angular-ui-powerups-password-input',
|
|
503
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
504
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
505
|
-
}] }
|
|
506
|
-
];
|
|
507
|
-
/** @nocollapse */
|
|
508
|
-
PasswordInputComponent.ctorParameters = function () { return []; };
|
|
509
|
-
return PasswordInputComponent;
|
|
510
|
-
}(AbstractInputComponent));
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* @fileoverview added by tsickle
|
|
514
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
515
|
-
*/
|
|
516
|
-
/**
|
|
517
|
-
* @template T
|
|
518
|
-
*/
|
|
519
|
-
var SelectInputComponent = /** @class */ (function (_super) {
|
|
520
|
-
__extends(SelectInputComponent, _super);
|
|
521
|
-
function SelectInputComponent() {
|
|
522
|
-
var _this = _super.call(this) || this;
|
|
523
|
-
_this.optionLabelFormat = (/**
|
|
524
|
-
* @param {?} option
|
|
525
|
-
* @return {?}
|
|
526
|
-
*/
|
|
527
|
-
function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; });
|
|
528
|
-
return _this;
|
|
529
|
-
}
|
|
464
|
+
FocusBindingDirective.prototype.alreadyHasFocus =
|
|
465
|
+
// Hook method for debugging via tracing.
|
|
530
466
|
/**
|
|
531
467
|
* @return {?}
|
|
532
468
|
*/
|
|
533
|
-
SelectInputComponent.prototype.ngOnInit = /**
|
|
534
|
-
* @return {?}
|
|
535
|
-
*/
|
|
536
469
|
function () {
|
|
470
|
+
return this.isFocused(this.focusTarget);
|
|
537
471
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
selector: 'angular-ui-powerups-select-input',
|
|
541
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
542
|
-
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
543
|
-
}] }
|
|
544
|
-
];
|
|
545
|
-
/** @nocollapse */
|
|
546
|
-
SelectInputComponent.ctorParameters = function () { return []; };
|
|
547
|
-
SelectInputComponent.propDecorators = {
|
|
548
|
-
optionsModel: [{ type: core.Input }],
|
|
549
|
-
options: [{ type: core.Input }],
|
|
550
|
-
optionLabel: [{ type: core.Input }],
|
|
551
|
-
optionLabelFormat: [{ type: core.Input }]
|
|
552
|
-
};
|
|
553
|
-
__decorate([
|
|
554
|
-
pectin.UseDelegate(),
|
|
555
|
-
__metadata("design:type", pectin.ListModel)
|
|
556
|
-
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
557
|
-
__decorate([
|
|
558
|
-
pectin.StoreInListModel('optionsModel'),
|
|
559
|
-
__metadata("design:type", Array)
|
|
560
|
-
], SelectInputComponent.prototype, "options", void 0);
|
|
561
|
-
return SelectInputComponent;
|
|
562
|
-
}(AbstractInputComponent));
|
|
563
|
-
if (false) {
|
|
564
|
-
/** @type {?} */
|
|
565
|
-
SelectInputComponent.prototype.optionsModel;
|
|
566
|
-
/** @type {?} */
|
|
567
|
-
SelectInputComponent.prototype.options;
|
|
568
|
-
/** @type {?} */
|
|
569
|
-
SelectInputComponent.prototype.optionLabel;
|
|
570
|
-
/** @type {?} */
|
|
571
|
-
SelectInputComponent.prototype.optionLabelFormat;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* @fileoverview added by tsickle
|
|
576
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
577
|
-
*/
|
|
578
|
-
var StringInputComponent = /** @class */ (function (_super) {
|
|
579
|
-
__extends(StringInputComponent, _super);
|
|
580
|
-
function StringInputComponent() {
|
|
581
|
-
return _super.call(this) || this;
|
|
582
|
-
}
|
|
472
|
+
// Hook method for debugging via tracing.
|
|
473
|
+
// Hook method for debugging via tracing.
|
|
583
474
|
/**
|
|
475
|
+
* @param {?} element
|
|
584
476
|
* @return {?}
|
|
585
477
|
*/
|
|
586
|
-
|
|
478
|
+
FocusBindingDirective.prototype.isFocused =
|
|
479
|
+
// Hook method for debugging via tracing.
|
|
480
|
+
/**
|
|
481
|
+
* @param {?} element
|
|
587
482
|
* @return {?}
|
|
588
483
|
*/
|
|
589
|
-
function () {
|
|
484
|
+
function (element) {
|
|
485
|
+
return this.document.activeElement === element;
|
|
590
486
|
};
|
|
591
|
-
StringInputComponent.decorators = [
|
|
592
|
-
{ type: core.Component, args: [{
|
|
593
|
-
selector: 'angular-ui-powerups-string-input',
|
|
594
|
-
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
595
|
-
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
596
|
-
}] }
|
|
597
|
-
];
|
|
598
|
-
/** @nocollapse */
|
|
599
|
-
StringInputComponent.ctorParameters = function () { return []; };
|
|
600
|
-
return StringInputComponent;
|
|
601
|
-
}(AbstractInputComponent));
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* @fileoverview added by tsickle
|
|
605
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
606
|
-
*/
|
|
607
|
-
var NoopComponent = /** @class */ (function () {
|
|
608
|
-
function NoopComponent() {
|
|
609
|
-
}
|
|
610
|
-
NoopComponent.decorators = [
|
|
611
|
-
{ type: core.Component, args: [{
|
|
612
|
-
selector: 'angular-ui-powerups-noop',
|
|
613
|
-
template: "",
|
|
614
|
-
styles: [":host{display:block}"]
|
|
615
|
-
}] }
|
|
616
|
-
];
|
|
617
|
-
/** @nocollapse */
|
|
618
|
-
NoopComponent.ctorParameters = function () { return []; };
|
|
619
|
-
return NoopComponent;
|
|
620
|
-
}());
|
|
621
|
-
|
|
622
|
-
/**
|
|
623
|
-
* @fileoverview added by tsickle
|
|
624
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
625
|
-
*/
|
|
626
|
-
/**
|
|
627
|
-
* @template P
|
|
628
|
-
*/
|
|
629
|
-
var CommandDirective = /** @class */ (function (_super) {
|
|
630
|
-
__extends(CommandDirective, _super);
|
|
631
|
-
function CommandDirective(elementRef) {
|
|
632
|
-
var _this = _super.call(this) || this;
|
|
633
|
-
_this.elementRef = elementRef;
|
|
634
|
-
_this._commandParameterProvided = false;
|
|
635
|
-
return _this;
|
|
636
|
-
}
|
|
637
|
-
Object.defineProperty(CommandDirective.prototype, "commandParameter", {
|
|
638
|
-
get: /**
|
|
639
|
-
* @return {?}
|
|
640
|
-
*/
|
|
641
|
-
function () {
|
|
642
|
-
return this._commandParameter;
|
|
643
|
-
},
|
|
644
|
-
set: /**
|
|
645
|
-
* @param {?} value
|
|
646
|
-
* @return {?}
|
|
647
|
-
*/
|
|
648
|
-
function (value) {
|
|
649
|
-
this._commandParameterProvided = true;
|
|
650
|
-
this._commandParameter = value;
|
|
651
|
-
},
|
|
652
|
-
enumerable: true,
|
|
653
|
-
configurable: true
|
|
654
|
-
});
|
|
655
487
|
/**
|
|
488
|
+
* @param {?=} retries
|
|
656
489
|
* @return {?}
|
|
657
490
|
*/
|
|
658
|
-
|
|
491
|
+
FocusBindingDirective.prototype.tryAndFocus = /**
|
|
492
|
+
* @param {?=} retries
|
|
659
493
|
* @return {?}
|
|
660
494
|
*/
|
|
661
|
-
function () {
|
|
662
|
-
|
|
663
|
-
if (
|
|
664
|
-
|
|
665
|
-
|
|
495
|
+
function (retries) {
|
|
496
|
+
var _this = this;
|
|
497
|
+
if (retries === void 0) { retries = 5; }
|
|
498
|
+
if (this.modelShouldStillHaveFocus() && this.canFocus()) {
|
|
499
|
+
if (!this.alreadyHasFocus()) {
|
|
500
|
+
this.focusTarget.focus();
|
|
666
501
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
502
|
+
// if we didn't get the focus we try again later.
|
|
503
|
+
if (!this.alreadyHasFocus()) {
|
|
504
|
+
pectin.Logger.get(this).log("focus failed, trying " + retries + " more times");
|
|
505
|
+
if (retries > 0) {
|
|
506
|
+
// try again on the next paint
|
|
507
|
+
// TODO: is there an angular way of doing this without calling a window function.
|
|
508
|
+
requestAnimationFrame((/**
|
|
509
|
+
* @return {?}
|
|
510
|
+
*/
|
|
511
|
+
function () {
|
|
512
|
+
_this.tryAndFocus(retries - 1);
|
|
513
|
+
}));
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
pectin.Logger.get(this).warn("Tried to focus but gave up as the component wasn't enabled or visible.");
|
|
517
|
+
}
|
|
671
518
|
}
|
|
672
519
|
}
|
|
673
520
|
};
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
*/
|
|
677
|
-
CommandDirective.prototype.ngAfterViewInit = /**
|
|
678
|
-
* @return {?}
|
|
679
|
-
*/
|
|
680
|
-
function () {
|
|
681
|
-
var _this = this;
|
|
682
|
-
// for some reason mat-buttons kills the disabled host binding. It works on a regular button but for now
|
|
683
|
-
// we need to do this.
|
|
684
|
-
var chain = pectin.Dsl.disposeWith(this).chain;
|
|
685
|
-
chain(this.pectinCommand.enabled).subscribe((/**
|
|
686
|
-
* @param {?} enabled
|
|
521
|
+
Object.defineProperty(FocusBindingDirective.prototype, "focusTarget", {
|
|
522
|
+
get: /**
|
|
687
523
|
* @return {?}
|
|
688
524
|
*/
|
|
689
|
-
function (
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
_this.elementRef.nativeElement.setAttribute('disabled', 'disabled');
|
|
698
|
-
if (_this.elementRef.nativeElement.tagName === 'A') {
|
|
699
|
-
_this.elementRef.nativeElement.removeAttribute('href');
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}));
|
|
703
|
-
};
|
|
525
|
+
function () {
|
|
526
|
+
return this.focusBindingTarget || this.el.nativeElement;
|
|
527
|
+
},
|
|
528
|
+
enumerable: true,
|
|
529
|
+
configurable: true
|
|
530
|
+
});
|
|
531
|
+
// Hook method for debugging via tracing.
|
|
532
|
+
// Hook method for debugging via tracing.
|
|
704
533
|
/**
|
|
705
534
|
* @return {?}
|
|
706
535
|
*/
|
|
707
|
-
|
|
536
|
+
FocusBindingDirective.prototype.modelShouldStillHaveFocus =
|
|
537
|
+
// Hook method for debugging via tracing.
|
|
538
|
+
/**
|
|
708
539
|
* @return {?}
|
|
709
540
|
*/
|
|
710
541
|
function () {
|
|
711
|
-
this.
|
|
542
|
+
return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
|
|
712
543
|
};
|
|
544
|
+
// Hook method for debugging via tracing.
|
|
545
|
+
// Hook method for debugging via tracing.
|
|
713
546
|
/**
|
|
714
|
-
* @param {?} $event
|
|
715
547
|
* @return {?}
|
|
716
548
|
*/
|
|
717
|
-
|
|
718
|
-
|
|
549
|
+
FocusBindingDirective.prototype.canFocus =
|
|
550
|
+
// Hook method for debugging via tracing.
|
|
551
|
+
/**
|
|
719
552
|
* @return {?}
|
|
720
553
|
*/
|
|
721
|
-
function (
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
else {
|
|
729
|
-
this.pectinCommand.withContext({ event: $event }).execute();
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
console.warn('disabled command clicked, ignoring.');
|
|
734
|
-
}
|
|
554
|
+
function () {
|
|
555
|
+
/** @type {?} */
|
|
556
|
+
var dimension = this.focusTarget.getBoundingClientRect();
|
|
557
|
+
/** @type {?} */
|
|
558
|
+
var hasSize = dimension.height >= 0 && dimension.height >= 0;
|
|
559
|
+
// tslint:disable-next-line:no-string-literal
|
|
560
|
+
return hasSize && !this.focusTarget['disabled'];
|
|
735
561
|
};
|
|
736
|
-
|
|
562
|
+
FocusBindingDirective.decorators = [
|
|
737
563
|
{ type: core.Directive, args: [{
|
|
738
564
|
// tslint:disable-next-line:directive-selector
|
|
739
|
-
selector: '[
|
|
565
|
+
selector: '[pectinFocusBinding]'
|
|
740
566
|
},] }
|
|
741
567
|
];
|
|
742
568
|
/** @nocollapse */
|
|
743
|
-
|
|
744
|
-
{ type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] }
|
|
569
|
+
FocusBindingDirective.ctorParameters = function () { return [
|
|
570
|
+
{ type: core.ElementRef, decorators: [{ type: core.Inject, args: [core.ElementRef,] }] },
|
|
571
|
+
{ type: core.NgZone, decorators: [{ type: core.Inject, args: [core.NgZone,] }] },
|
|
572
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }
|
|
745
573
|
]; };
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
574
|
+
FocusBindingDirective.propDecorators = {
|
|
575
|
+
pectinFocusBinding: [{ type: core.Input }],
|
|
576
|
+
focusBindingTarget: [{ type: core.Input }],
|
|
577
|
+
onFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
|
|
578
|
+
onFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
|
|
750
579
|
};
|
|
751
|
-
return
|
|
752
|
-
}(
|
|
580
|
+
return FocusBindingDirective;
|
|
581
|
+
}(DisposableComponent));
|
|
753
582
|
if (false) {
|
|
754
|
-
/** @type {?} */
|
|
755
|
-
CommandDirective.prototype.pectinCommand;
|
|
756
583
|
/**
|
|
757
584
|
* @type {?}
|
|
758
585
|
* @private
|
|
759
586
|
*/
|
|
760
|
-
|
|
587
|
+
FocusBindingDirective.prototype.document;
|
|
588
|
+
/** @type {?} */
|
|
589
|
+
FocusBindingDirective.prototype.pectinFocusBinding;
|
|
590
|
+
/** @type {?} */
|
|
591
|
+
FocusBindingDirective.prototype.focusBindingTarget;
|
|
761
592
|
/**
|
|
762
593
|
* @type {?}
|
|
763
594
|
* @private
|
|
764
595
|
*/
|
|
765
|
-
|
|
596
|
+
FocusBindingDirective.prototype.el;
|
|
766
597
|
/**
|
|
767
598
|
* @type {?}
|
|
768
599
|
* @private
|
|
769
600
|
*/
|
|
770
|
-
|
|
601
|
+
FocusBindingDirective.prototype.ngZone;
|
|
771
602
|
}
|
|
772
603
|
|
|
773
604
|
/**
|
|
774
605
|
* @fileoverview added by tsickle
|
|
775
606
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
776
607
|
*/
|
|
777
|
-
var
|
|
778
|
-
|
|
779
|
-
|
|
608
|
+
var DirectivesModule = /** @class */ (function () {
|
|
609
|
+
function DirectivesModule() {
|
|
610
|
+
}
|
|
611
|
+
DirectivesModule.decorators = [
|
|
612
|
+
{ type: core.NgModule, args: [{
|
|
613
|
+
declarations: [
|
|
614
|
+
CommandDirective,
|
|
615
|
+
FocusBindingDirective
|
|
616
|
+
],
|
|
617
|
+
imports: [
|
|
618
|
+
common.CommonModule,
|
|
619
|
+
animations.BrowserAnimationsModule,
|
|
620
|
+
forms.FormsModule,
|
|
621
|
+
material.MatInputModule,
|
|
622
|
+
material.MatFormFieldModule,
|
|
623
|
+
material.MatSelectModule,
|
|
624
|
+
tabs.MatTabsModule
|
|
625
|
+
],
|
|
626
|
+
exports: [
|
|
627
|
+
CommandDirective,
|
|
628
|
+
FocusBindingDirective
|
|
629
|
+
]
|
|
630
|
+
},] }
|
|
631
|
+
];
|
|
632
|
+
return DirectivesModule;
|
|
633
|
+
}());
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* @fileoverview added by tsickle
|
|
637
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
638
|
+
*/
|
|
639
|
+
/**
|
|
640
|
+
* @abstract
|
|
641
|
+
* @template T
|
|
642
|
+
*/
|
|
643
|
+
var AbstractInputComponent = /** @class */ (function (_super) {
|
|
644
|
+
__extends(AbstractInputComponent, _super);
|
|
645
|
+
function AbstractInputComponent() {
|
|
780
646
|
var _this = _super.call(this) || this;
|
|
781
|
-
_this.
|
|
782
|
-
|
|
783
|
-
//
|
|
784
|
-
_this.
|
|
647
|
+
_this.valueModel = new pectin.DelegatingFormValueModel();
|
|
648
|
+
// TODO: fix this.
|
|
649
|
+
// tslint:disable-next-line:no-output-native
|
|
650
|
+
_this.focus = new core.EventEmitter();
|
|
651
|
+
// tslint:disable-next-line:no-output-native
|
|
652
|
+
_this.blur = new core.EventEmitter();
|
|
653
|
+
// tslint:disable-next-line:no-output-native
|
|
654
|
+
_this.enterKey = new core.EventEmitter();
|
|
655
|
+
// tslint:disable-next-line:no-output-native
|
|
656
|
+
_this.escapeKey = new core.EventEmitter();
|
|
657
|
+
/** @type {?} */
|
|
658
|
+
var self = _this;
|
|
659
|
+
_this.errorStateMatcher = {
|
|
660
|
+
isErrorState: /**
|
|
661
|
+
* @param {?} control
|
|
662
|
+
* @param {?} form
|
|
663
|
+
* @return {?}
|
|
664
|
+
*/
|
|
665
|
+
function (control, form) {
|
|
666
|
+
return self.hasErrors();
|
|
667
|
+
}
|
|
668
|
+
};
|
|
785
669
|
return _this;
|
|
786
670
|
}
|
|
671
|
+
Object.defineProperty(AbstractInputComponent.prototype, "userValueModel", {
|
|
672
|
+
set: /**
|
|
673
|
+
* @param {?} model
|
|
674
|
+
* @return {?}
|
|
675
|
+
*/
|
|
676
|
+
function (model) {
|
|
677
|
+
this.valueModel.setDelegate(model);
|
|
678
|
+
},
|
|
679
|
+
enumerable: true,
|
|
680
|
+
configurable: true
|
|
681
|
+
});
|
|
787
682
|
/**
|
|
788
683
|
* @return {?}
|
|
789
684
|
*/
|
|
790
|
-
|
|
685
|
+
AbstractInputComponent.prototype.notifyClick = /**
|
|
791
686
|
* @return {?}
|
|
792
687
|
*/
|
|
793
688
|
function () {
|
|
794
|
-
|
|
795
|
-
this.pectinFocusBinding.focusContext.notifyFocusIn();
|
|
796
|
-
}
|
|
689
|
+
this.safelyInvoke(this.clickCommand);
|
|
797
690
|
};
|
|
798
691
|
/**
|
|
799
692
|
* @return {?}
|
|
800
693
|
*/
|
|
801
|
-
|
|
694
|
+
AbstractInputComponent.prototype.notifyFocusIn = /**
|
|
802
695
|
* @return {?}
|
|
803
696
|
*/
|
|
804
697
|
function () {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}
|
|
698
|
+
this.safelyInvoke(this.focusCommand);
|
|
699
|
+
this.focus.emit();
|
|
808
700
|
};
|
|
809
701
|
/**
|
|
810
702
|
* @return {?}
|
|
811
703
|
*/
|
|
812
|
-
|
|
704
|
+
AbstractInputComponent.prototype.notifyFocusOut = /**
|
|
813
705
|
* @return {?}
|
|
814
706
|
*/
|
|
815
707
|
function () {
|
|
708
|
+
this.safelyInvoke(this.blurCommand);
|
|
709
|
+
this.blur.emit();
|
|
816
710
|
};
|
|
817
711
|
/**
|
|
818
712
|
* @return {?}
|
|
819
713
|
*/
|
|
820
|
-
|
|
714
|
+
AbstractInputComponent.prototype.notifyEnterKey = /**
|
|
821
715
|
* @return {?}
|
|
822
716
|
*/
|
|
823
717
|
function () {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
if (this.hasBinding()) {
|
|
827
|
-
var chain = pectin.Dsl.disposeWith(this).chain;
|
|
828
|
-
chain(this.pectinFocusBinding.focusContext.focused).subscribe((/**
|
|
829
|
-
* @param {?} focused
|
|
830
|
-
* @return {?}
|
|
831
|
-
*/
|
|
832
|
-
function (focused) {
|
|
833
|
-
if (focused && !_this.alreadyHasFocus()) {
|
|
834
|
-
_this.tryAndFocus();
|
|
835
|
-
}
|
|
836
|
-
}));
|
|
837
|
-
}
|
|
838
|
-
else {
|
|
839
|
-
pectin.Logger.get(this).warn('pectinFocusBinding was nil');
|
|
840
|
-
}
|
|
718
|
+
this.safelyInvoke(this.enterCommand);
|
|
719
|
+
this.enterKey.emit();
|
|
841
720
|
};
|
|
842
721
|
/**
|
|
843
|
-
* @private
|
|
844
722
|
* @return {?}
|
|
845
723
|
*/
|
|
846
|
-
|
|
847
|
-
* @private
|
|
724
|
+
AbstractInputComponent.prototype.notifyEscapeKey = /**
|
|
848
725
|
* @return {?}
|
|
849
726
|
*/
|
|
850
727
|
function () {
|
|
851
|
-
|
|
728
|
+
this.safelyInvoke(this.escapeCommand);
|
|
729
|
+
this.escapeKey.emit();
|
|
852
730
|
};
|
|
853
|
-
// Hook method for debugging via tracing.
|
|
854
|
-
// Hook method for debugging via tracing.
|
|
855
731
|
/**
|
|
732
|
+
* @protected
|
|
733
|
+
* @param {?} command
|
|
856
734
|
* @return {?}
|
|
857
735
|
*/
|
|
858
|
-
|
|
859
|
-
|
|
736
|
+
AbstractInputComponent.prototype.safelyInvoke = /**
|
|
737
|
+
* @protected
|
|
738
|
+
* @param {?} command
|
|
739
|
+
* @return {?}
|
|
740
|
+
*/
|
|
741
|
+
function (command) {
|
|
742
|
+
if (command && command.enabled.value) {
|
|
743
|
+
command.execute();
|
|
744
|
+
}
|
|
745
|
+
};
|
|
860
746
|
/**
|
|
861
747
|
* @return {?}
|
|
862
748
|
*/
|
|
749
|
+
AbstractInputComponent.prototype.ngOnInit = /**
|
|
750
|
+
* @return {?}
|
|
751
|
+
*/
|
|
863
752
|
function () {
|
|
864
|
-
return this.isFocused(this.focusTarget);
|
|
865
753
|
};
|
|
866
|
-
// Hook method for debugging via tracing.
|
|
867
|
-
// Hook method for debugging via tracing.
|
|
868
754
|
/**
|
|
869
|
-
* @param {?} element
|
|
870
755
|
* @return {?}
|
|
871
756
|
*/
|
|
872
|
-
|
|
873
|
-
// Hook method for debugging via tracing.
|
|
874
|
-
/**
|
|
875
|
-
* @param {?} element
|
|
757
|
+
AbstractInputComponent.prototype.isEnabled = /**
|
|
876
758
|
* @return {?}
|
|
877
759
|
*/
|
|
878
|
-
function (
|
|
879
|
-
return this.
|
|
760
|
+
function () {
|
|
761
|
+
return this.enabled.value;
|
|
880
762
|
};
|
|
763
|
+
Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
|
|
764
|
+
get: /**
|
|
765
|
+
* @return {?}
|
|
766
|
+
*/
|
|
767
|
+
function () {
|
|
768
|
+
return this.valueModel.enabled;
|
|
769
|
+
},
|
|
770
|
+
enumerable: true,
|
|
771
|
+
configurable: true
|
|
772
|
+
});
|
|
881
773
|
/**
|
|
882
|
-
* @param {?=} retries
|
|
883
774
|
* @return {?}
|
|
884
775
|
*/
|
|
885
|
-
|
|
886
|
-
* @param {?=} retries
|
|
776
|
+
AbstractInputComponent.prototype.hasErrors = /**
|
|
887
777
|
* @return {?}
|
|
888
778
|
*/
|
|
889
|
-
function (
|
|
890
|
-
|
|
891
|
-
if (retries === void 0) { retries = 5; }
|
|
892
|
-
if (this.modelShouldStillHaveFocus() && this.canFocus()) {
|
|
893
|
-
if (!this.alreadyHasFocus()) {
|
|
894
|
-
this.focusTarget.focus();
|
|
895
|
-
}
|
|
896
|
-
// if we didn't get the focus we try again later.
|
|
897
|
-
if (!this.alreadyHasFocus()) {
|
|
898
|
-
pectin.Logger.get(this).log("focus failed, trying " + retries + " more times");
|
|
899
|
-
if (retries > 0) {
|
|
900
|
-
// try again on the next paint
|
|
901
|
-
// TODO: is there an angular way of doing this without calling a window function.
|
|
902
|
-
requestAnimationFrame((/**
|
|
903
|
-
* @return {?}
|
|
904
|
-
*/
|
|
905
|
-
function () {
|
|
906
|
-
_this.tryAndFocus(retries - 1);
|
|
907
|
-
}));
|
|
908
|
-
}
|
|
909
|
-
else {
|
|
910
|
-
pectin.Logger.get(this).warn("Tried to focus but gave up as the component wasn't enabled or visible.");
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
779
|
+
function () {
|
|
780
|
+
return !this.errorList.query().isEmpty();
|
|
914
781
|
};
|
|
915
|
-
Object.defineProperty(
|
|
782
|
+
Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
|
|
916
783
|
get: /**
|
|
917
784
|
* @return {?}
|
|
918
785
|
*/
|
|
919
786
|
function () {
|
|
920
|
-
return this.
|
|
787
|
+
return this.valueModel.errorList;
|
|
921
788
|
},
|
|
922
789
|
enumerable: true,
|
|
923
790
|
configurable: true
|
|
924
791
|
});
|
|
925
|
-
|
|
926
|
-
|
|
792
|
+
Object.defineProperty(AbstractInputComponent.prototype, "firstError", {
|
|
793
|
+
get: /**
|
|
794
|
+
* @return {?}
|
|
795
|
+
*/
|
|
796
|
+
function () {
|
|
797
|
+
return this.hasErrors() ? this.errorList.value[0] : null;
|
|
798
|
+
},
|
|
799
|
+
enumerable: true,
|
|
800
|
+
configurable: true
|
|
801
|
+
});
|
|
802
|
+
AbstractInputComponent.propDecorators = {
|
|
803
|
+
userValueModel: [{ type: core.Input, args: ['valueModel',] }],
|
|
804
|
+
label: [{ type: core.Input }],
|
|
805
|
+
floatLabel: [{ type: core.Input }],
|
|
806
|
+
hint: [{ type: core.Input }],
|
|
807
|
+
placeholder: [{ type: core.Input }],
|
|
808
|
+
focusCommand: [{ type: core.Input, args: ['command.focus',] }],
|
|
809
|
+
blurCommand: [{ type: core.Input, args: ['command.blur',] }],
|
|
810
|
+
enterCommand: [{ type: core.Input, args: ['command.enter',] }],
|
|
811
|
+
escapeCommand: [{ type: core.Input, args: ['command.escape',] }],
|
|
812
|
+
clickCommand: [{ type: core.Input, args: ['command.click',] }],
|
|
813
|
+
focus: [{ type: core.Output }],
|
|
814
|
+
blur: [{ type: core.Output }],
|
|
815
|
+
enterKey: [{ type: core.Output }],
|
|
816
|
+
escapeKey: [{ type: core.Output }],
|
|
817
|
+
notifyClick: [{ type: core.HostListener, args: ['click',] }],
|
|
818
|
+
notifyFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
|
|
819
|
+
notifyFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
|
|
820
|
+
};
|
|
821
|
+
__decorate([
|
|
822
|
+
pectin.UseDelegate(),
|
|
823
|
+
__metadata("design:type", pectin.ValueModel),
|
|
824
|
+
__metadata("design:paramtypes", [pectin.ValueModel])
|
|
825
|
+
], AbstractInputComponent.prototype, "userValueModel", null);
|
|
826
|
+
return AbstractInputComponent;
|
|
827
|
+
}(DisposableComponent));
|
|
828
|
+
if (false) {
|
|
829
|
+
/** @type {?} */
|
|
830
|
+
AbstractInputComponent.prototype.valueModel;
|
|
831
|
+
/** @type {?} */
|
|
832
|
+
AbstractInputComponent.prototype.label;
|
|
833
|
+
/** @type {?} */
|
|
834
|
+
AbstractInputComponent.prototype.floatLabel;
|
|
835
|
+
/** @type {?} */
|
|
836
|
+
AbstractInputComponent.prototype.hint;
|
|
837
|
+
/** @type {?} */
|
|
838
|
+
AbstractInputComponent.prototype.placeholder;
|
|
839
|
+
/** @type {?} */
|
|
840
|
+
AbstractInputComponent.prototype.focusCommand;
|
|
841
|
+
/** @type {?} */
|
|
842
|
+
AbstractInputComponent.prototype.blurCommand;
|
|
843
|
+
/** @type {?} */
|
|
844
|
+
AbstractInputComponent.prototype.enterCommand;
|
|
845
|
+
/** @type {?} */
|
|
846
|
+
AbstractInputComponent.prototype.escapeCommand;
|
|
847
|
+
/** @type {?} */
|
|
848
|
+
AbstractInputComponent.prototype.clickCommand;
|
|
849
|
+
/** @type {?} */
|
|
850
|
+
AbstractInputComponent.prototype.focus;
|
|
851
|
+
/** @type {?} */
|
|
852
|
+
AbstractInputComponent.prototype.blur;
|
|
853
|
+
/** @type {?} */
|
|
854
|
+
AbstractInputComponent.prototype.enterKey;
|
|
855
|
+
/** @type {?} */
|
|
856
|
+
AbstractInputComponent.prototype.escapeKey;
|
|
857
|
+
/** @type {?} */
|
|
858
|
+
AbstractInputComponent.prototype.errorStateMatcher;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* @fileoverview added by tsickle
|
|
863
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
864
|
+
*/
|
|
865
|
+
var NumberInputComponent = /** @class */ (function (_super) {
|
|
866
|
+
__extends(NumberInputComponent, _super);
|
|
867
|
+
function NumberInputComponent() {
|
|
868
|
+
return _super.call(this) || this;
|
|
869
|
+
}
|
|
927
870
|
/**
|
|
928
871
|
* @return {?}
|
|
929
872
|
*/
|
|
930
|
-
|
|
931
|
-
// Hook method for debugging via tracing.
|
|
932
|
-
/**
|
|
873
|
+
NumberInputComponent.prototype.ngOnInit = /**
|
|
933
874
|
* @return {?}
|
|
934
875
|
*/
|
|
935
876
|
function () {
|
|
936
|
-
return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
|
|
937
877
|
};
|
|
938
|
-
|
|
939
|
-
|
|
878
|
+
NumberInputComponent.decorators = [
|
|
879
|
+
{ type: core.Component, args: [{
|
|
880
|
+
selector: 'aup-number-input',
|
|
881
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
882
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
883
|
+
}] }
|
|
884
|
+
];
|
|
885
|
+
/** @nocollapse */
|
|
886
|
+
NumberInputComponent.ctorParameters = function () { return []; };
|
|
887
|
+
return NumberInputComponent;
|
|
888
|
+
}(AbstractInputComponent));
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* @fileoverview added by tsickle
|
|
892
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
893
|
+
*/
|
|
894
|
+
var PasswordInputComponent = /** @class */ (function (_super) {
|
|
895
|
+
__extends(PasswordInputComponent, _super);
|
|
896
|
+
function PasswordInputComponent() {
|
|
897
|
+
return _super.call(this) || this;
|
|
898
|
+
}
|
|
940
899
|
/**
|
|
941
900
|
* @return {?}
|
|
942
901
|
*/
|
|
943
|
-
|
|
944
|
-
|
|
902
|
+
PasswordInputComponent.prototype.ngOnInit = /**
|
|
903
|
+
* @return {?}
|
|
904
|
+
*/
|
|
905
|
+
function () {
|
|
906
|
+
};
|
|
907
|
+
PasswordInputComponent.decorators = [
|
|
908
|
+
{ type: core.Component, args: [{
|
|
909
|
+
selector: 'aup-password-input',
|
|
910
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
911
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
912
|
+
}] }
|
|
913
|
+
];
|
|
914
|
+
/** @nocollapse */
|
|
915
|
+
PasswordInputComponent.ctorParameters = function () { return []; };
|
|
916
|
+
return PasswordInputComponent;
|
|
917
|
+
}(AbstractInputComponent));
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* @fileoverview added by tsickle
|
|
921
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
922
|
+
*/
|
|
923
|
+
/**
|
|
924
|
+
* @template T
|
|
925
|
+
*/
|
|
926
|
+
var SelectInputComponent = /** @class */ (function (_super) {
|
|
927
|
+
__extends(SelectInputComponent, _super);
|
|
928
|
+
function SelectInputComponent() {
|
|
929
|
+
var _this = _super.call(this) || this;
|
|
930
|
+
_this.optionLabelFormat = (/**
|
|
931
|
+
* @param {?} option
|
|
932
|
+
* @return {?}
|
|
933
|
+
*/
|
|
934
|
+
function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; });
|
|
935
|
+
return _this;
|
|
936
|
+
}
|
|
945
937
|
/**
|
|
946
938
|
* @return {?}
|
|
947
939
|
*/
|
|
940
|
+
SelectInputComponent.prototype.ngOnInit = /**
|
|
941
|
+
* @return {?}
|
|
942
|
+
*/
|
|
948
943
|
function () {
|
|
949
|
-
/** @type {?} */
|
|
950
|
-
var dimension = this.focusTarget.getBoundingClientRect();
|
|
951
|
-
/** @type {?} */
|
|
952
|
-
var hasSize = dimension.height >= 0 && dimension.height >= 0;
|
|
953
|
-
// tslint:disable-next-line:no-string-literal
|
|
954
|
-
return hasSize && !this.focusTarget['disabled'];
|
|
955
944
|
};
|
|
956
|
-
|
|
957
|
-
{ type: core.
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
945
|
+
SelectInputComponent.decorators = [
|
|
946
|
+
{ type: core.Component, args: [{
|
|
947
|
+
selector: 'aup-select-input',
|
|
948
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngFor=\"let option of optionsModel.value\" [value]=\"option\">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
|
|
949
|
+
styles: [":host{display:inline-block}mat-form-field{width:100%}"]
|
|
950
|
+
}] }
|
|
961
951
|
];
|
|
962
952
|
/** @nocollapse */
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
pectinFocusBinding: [{ type: core.Input }],
|
|
970
|
-
focusBindingTarget: [{ type: core.Input }],
|
|
971
|
-
onFocusIn: [{ type: core.HostListener, args: ['focusin',] }],
|
|
972
|
-
onFocusOut: [{ type: core.HostListener, args: ['focusout',] }]
|
|
953
|
+
SelectInputComponent.ctorParameters = function () { return []; };
|
|
954
|
+
SelectInputComponent.propDecorators = {
|
|
955
|
+
optionsModel: [{ type: core.Input }],
|
|
956
|
+
options: [{ type: core.Input }],
|
|
957
|
+
optionLabel: [{ type: core.Input }],
|
|
958
|
+
optionLabelFormat: [{ type: core.Input }]
|
|
973
959
|
};
|
|
974
|
-
|
|
975
|
-
|
|
960
|
+
__decorate([
|
|
961
|
+
pectin.UseDelegate(),
|
|
962
|
+
__metadata("design:type", pectin.ListModel)
|
|
963
|
+
], SelectInputComponent.prototype, "optionsModel", void 0);
|
|
964
|
+
__decorate([
|
|
965
|
+
pectin.StoreInListModel('optionsModel'),
|
|
966
|
+
__metadata("design:type", Array)
|
|
967
|
+
], SelectInputComponent.prototype, "options", void 0);
|
|
968
|
+
return SelectInputComponent;
|
|
969
|
+
}(AbstractInputComponent));
|
|
976
970
|
if (false) {
|
|
977
|
-
/**
|
|
978
|
-
* @type {?}
|
|
979
|
-
* @private
|
|
980
|
-
*/
|
|
981
|
-
FocusBindingDirective.prototype.document;
|
|
982
971
|
/** @type {?} */
|
|
983
|
-
|
|
972
|
+
SelectInputComponent.prototype.optionsModel;
|
|
984
973
|
/** @type {?} */
|
|
985
|
-
|
|
974
|
+
SelectInputComponent.prototype.options;
|
|
975
|
+
/** @type {?} */
|
|
976
|
+
SelectInputComponent.prototype.optionLabel;
|
|
977
|
+
/** @type {?} */
|
|
978
|
+
SelectInputComponent.prototype.optionLabelFormat;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* @fileoverview added by tsickle
|
|
983
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
984
|
+
*/
|
|
985
|
+
var StringInputComponent = /** @class */ (function (_super) {
|
|
986
|
+
__extends(StringInputComponent, _super);
|
|
987
|
+
function StringInputComponent() {
|
|
988
|
+
return _super.call(this) || this;
|
|
989
|
+
}
|
|
986
990
|
/**
|
|
987
|
-
* @
|
|
988
|
-
* @private
|
|
991
|
+
* @return {?}
|
|
989
992
|
*/
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
* @type {?}
|
|
993
|
-
* @private
|
|
993
|
+
StringInputComponent.prototype.ngOnInit = /**
|
|
994
|
+
* @return {?}
|
|
994
995
|
*/
|
|
995
|
-
|
|
996
|
-
|
|
996
|
+
function () {
|
|
997
|
+
};
|
|
998
|
+
StringInputComponent.decorators = [
|
|
999
|
+
{ type: core.Component, args: [{
|
|
1000
|
+
selector: 'aup-string-input',
|
|
1001
|
+
template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
|
|
1002
|
+
styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
|
|
1003
|
+
}] }
|
|
1004
|
+
];
|
|
1005
|
+
/** @nocollapse */
|
|
1006
|
+
StringInputComponent.ctorParameters = function () { return []; };
|
|
1007
|
+
return StringInputComponent;
|
|
1008
|
+
}(AbstractInputComponent));
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* @fileoverview added by tsickle
|
|
1012
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1013
|
+
*/
|
|
1014
|
+
var NoopComponent = /** @class */ (function () {
|
|
1015
|
+
function NoopComponent() {
|
|
1016
|
+
}
|
|
1017
|
+
NoopComponent.decorators = [
|
|
1018
|
+
{ type: core.Component, args: [{
|
|
1019
|
+
selector: 'aup-noop',
|
|
1020
|
+
template: "",
|
|
1021
|
+
styles: [":host{display:block}"]
|
|
1022
|
+
}] }
|
|
1023
|
+
];
|
|
1024
|
+
/** @nocollapse */
|
|
1025
|
+
NoopComponent.ctorParameters = function () { return []; };
|
|
1026
|
+
return NoopComponent;
|
|
1027
|
+
}());
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* @fileoverview added by tsickle
|
|
1031
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1032
|
+
*/
|
|
1033
|
+
var ComponentsModule = /** @class */ (function () {
|
|
1034
|
+
function ComponentsModule() {
|
|
1035
|
+
}
|
|
1036
|
+
ComponentsModule.decorators = [
|
|
1037
|
+
{ type: core.NgModule, args: [{
|
|
1038
|
+
declarations: [
|
|
1039
|
+
NumberInputComponent,
|
|
1040
|
+
StringInputComponent,
|
|
1041
|
+
PasswordInputComponent,
|
|
1042
|
+
SelectInputComponent,
|
|
1043
|
+
NoopComponent
|
|
1044
|
+
],
|
|
1045
|
+
imports: [
|
|
1046
|
+
common.CommonModule,
|
|
1047
|
+
animations.BrowserAnimationsModule,
|
|
1048
|
+
forms.FormsModule,
|
|
1049
|
+
material.MatInputModule,
|
|
1050
|
+
material.MatFormFieldModule,
|
|
1051
|
+
material.MatSelectModule,
|
|
1052
|
+
tabs.MatTabsModule,
|
|
1053
|
+
DirectivesModule
|
|
1054
|
+
],
|
|
1055
|
+
exports: [
|
|
1056
|
+
NumberInputComponent,
|
|
1057
|
+
StringInputComponent,
|
|
1058
|
+
PasswordInputComponent,
|
|
1059
|
+
SelectInputComponent,
|
|
1060
|
+
NoopComponent
|
|
1061
|
+
]
|
|
1062
|
+
},] }
|
|
1063
|
+
];
|
|
1064
|
+
return ComponentsModule;
|
|
1065
|
+
}());
|
|
997
1066
|
|
|
998
1067
|
/**
|
|
999
1068
|
* @fileoverview added by tsickle
|
|
@@ -1087,7 +1156,7 @@
|
|
|
1087
1156
|
* @abstract
|
|
1088
1157
|
* @template D, R, E
|
|
1089
1158
|
*/
|
|
1090
|
-
exports.ɵ
|
|
1159
|
+
exports.ɵbd = /** @class */ (function (_super) {
|
|
1091
1160
|
__extends(Activity, _super);
|
|
1092
1161
|
function Activity() {
|
|
1093
1162
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -1177,12 +1246,12 @@
|
|
|
1177
1246
|
* @type {?}
|
|
1178
1247
|
* @private
|
|
1179
1248
|
*/
|
|
1180
|
-
exports.ɵ
|
|
1249
|
+
exports.ɵbd.prototype._busyModel;
|
|
1181
1250
|
/**
|
|
1182
1251
|
* @type {?}
|
|
1183
1252
|
* @private
|
|
1184
1253
|
*/
|
|
1185
|
-
exports.ɵ
|
|
1254
|
+
exports.ɵbd.prototype._activityContext;
|
|
1186
1255
|
}
|
|
1187
1256
|
(function (Activity) {
|
|
1188
1257
|
/**
|
|
@@ -1197,7 +1266,7 @@
|
|
|
1197
1266
|
/** @type {?} */
|
|
1198
1267
|
Callbacks.prototype.onCancel;
|
|
1199
1268
|
}
|
|
1200
|
-
})(exports.ɵ
|
|
1269
|
+
})(exports.ɵbd || (exports.ɵbd = {}));
|
|
1201
1270
|
|
|
1202
1271
|
/**
|
|
1203
1272
|
* @fileoverview added by tsickle
|
|
@@ -1286,7 +1355,7 @@
|
|
|
1286
1355
|
});
|
|
1287
1356
|
ActivityOutletComponent.decorators = [
|
|
1288
1357
|
{ type: core.Component, args: [{
|
|
1289
|
-
selector: '
|
|
1358
|
+
selector: 'aup-activity-outlet',
|
|
1290
1359
|
template: '',
|
|
1291
1360
|
styles: [":host{display:block}"]
|
|
1292
1361
|
}] }
|
|
@@ -1354,7 +1423,7 @@
|
|
|
1354
1423
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1355
1424
|
}
|
|
1356
1425
|
return AbstractActivity;
|
|
1357
|
-
}(exports.ɵ
|
|
1426
|
+
}(exports.ɵbd));
|
|
1358
1427
|
|
|
1359
1428
|
/**
|
|
1360
1429
|
* @fileoverview added by tsickle
|
|
@@ -1377,9 +1446,9 @@
|
|
|
1377
1446
|
};
|
|
1378
1447
|
AlertDialogComponent.decorators = [
|
|
1379
1448
|
{ type: core.Component, args: [{
|
|
1380
|
-
selector: '
|
|
1449
|
+
selector: 'aup-alert-dialog',
|
|
1381
1450
|
template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</p>\n",
|
|
1382
|
-
styles: [":host{display:block;padding:var(--
|
|
1451
|
+
styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
|
|
1383
1452
|
}] }
|
|
1384
1453
|
];
|
|
1385
1454
|
/** @nocollapse */
|
|
@@ -1400,7 +1469,7 @@
|
|
|
1400
1469
|
/**
|
|
1401
1470
|
* @template D, R, E
|
|
1402
1471
|
*/
|
|
1403
|
-
exports.ɵ
|
|
1472
|
+
exports.ɵbf = /** @class */ (function (_super) {
|
|
1404
1473
|
__extends(ConfirmThenDialogComponent, _super);
|
|
1405
1474
|
function ConfirmThenDialogComponent(config, interactionContext) {
|
|
1406
1475
|
var _this = _super.call(this) || this;
|
|
@@ -1458,9 +1527,9 @@
|
|
|
1458
1527
|
};
|
|
1459
1528
|
ConfirmThenDialogComponent.decorators = [
|
|
1460
1529
|
{ type: core.Component, args: [{
|
|
1461
|
-
selector: '
|
|
1530
|
+
selector: 'aup-confirmation-dialog',
|
|
1462
1531
|
template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
|
|
1463
|
-
styles: [":host{display:block;padding:var(--
|
|
1532
|
+
styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
|
|
1464
1533
|
}] }
|
|
1465
1534
|
];
|
|
1466
1535
|
/** @nocollapse */
|
|
@@ -1472,9 +1541,9 @@
|
|
|
1472
1541
|
}(AbstractActivity));
|
|
1473
1542
|
if (false) {
|
|
1474
1543
|
/** @type {?} */
|
|
1475
|
-
exports.ɵ
|
|
1544
|
+
exports.ɵbf.prototype.config;
|
|
1476
1545
|
/** @type {?} */
|
|
1477
|
-
exports.ɵ
|
|
1546
|
+
exports.ɵbf.prototype.interactionContext;
|
|
1478
1547
|
}
|
|
1479
1548
|
(function (ConfirmThenDialogComponent) {
|
|
1480
1549
|
/**
|
|
@@ -1491,7 +1560,7 @@
|
|
|
1491
1560
|
/** @type {?} */
|
|
1492
1561
|
Data.prototype.data;
|
|
1493
1562
|
}
|
|
1494
|
-
})(exports.ɵ
|
|
1563
|
+
})(exports.ɵbf || (exports.ɵbf = {}));
|
|
1495
1564
|
|
|
1496
1565
|
/**
|
|
1497
1566
|
* @fileoverview added by tsickle
|
|
@@ -1524,9 +1593,9 @@
|
|
|
1524
1593
|
};
|
|
1525
1594
|
ConfirmationDialogComponent.decorators = [
|
|
1526
1595
|
{ type: core.Component, args: [{
|
|
1527
|
-
selector: '
|
|
1596
|
+
selector: 'aup-confirmation-dialog',
|
|
1528
1597
|
template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</p>\n\n",
|
|
1529
|
-
styles: [":host{display:block;padding:var(--
|
|
1598
|
+
styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-actions{justify-content:flex-end}"]
|
|
1530
1599
|
}] }
|
|
1531
1600
|
];
|
|
1532
1601
|
/** @nocollapse */
|
|
@@ -1665,15 +1734,17 @@
|
|
|
1665
1734
|
__extends(ActivityContainerComponent, _super);
|
|
1666
1735
|
function ActivityContainerComponent() {
|
|
1667
1736
|
var _this = _super.call(this) || this;
|
|
1668
|
-
_this.
|
|
1737
|
+
_this.throttledNestedActivityFinishEvents = new pectin.MutableStream();
|
|
1738
|
+
// tslint:disable-next-line:no-output-rename
|
|
1739
|
+
_this.initialActivityOutletContextEvent = new core.EventEmitter();
|
|
1740
|
+
_this.dynamicHeight = false;
|
|
1669
1741
|
_this.activityTabs = new pectin.MutableListModel();
|
|
1670
|
-
_this.finished = false;
|
|
1671
1742
|
_this._activityList = new pectin.MutableListModel();
|
|
1672
1743
|
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1673
|
-
chain(_this.
|
|
1744
|
+
chain(_this.throttledNestedActivityFinishEvents).throttle(50).subscribe((/**
|
|
1674
1745
|
* @return {?}
|
|
1675
1746
|
*/
|
|
1676
|
-
function () { return _this.
|
|
1747
|
+
function () { return _this.onNestedActivityFinished(); }));
|
|
1677
1748
|
return _this;
|
|
1678
1749
|
}
|
|
1679
1750
|
Object.defineProperty(ActivityContainerComponent.prototype, "initialActivityOutletContext", {
|
|
@@ -1681,33 +1752,37 @@
|
|
|
1681
1752
|
* @return {?}
|
|
1682
1753
|
*/
|
|
1683
1754
|
function () {
|
|
1684
|
-
return this.
|
|
1755
|
+
return this._initialActivityOutletContext;
|
|
1685
1756
|
},
|
|
1686
1757
|
set: /**
|
|
1687
1758
|
* @param {?} initialContext
|
|
1688
1759
|
* @return {?}
|
|
1689
1760
|
*/
|
|
1690
1761
|
function (initialContext) {
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1762
|
+
pectin.assert.isNil(this._initialActivityOutletContext);
|
|
1763
|
+
/** @type {?} */
|
|
1764
|
+
var self = this;
|
|
1765
|
+
if (initialContext) {
|
|
1766
|
+
this._initialActivityOutletContext = initialContext;
|
|
1767
|
+
this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
|
|
1768
|
+
onDone: (/**
|
|
1769
|
+
* @param {?} result
|
|
1770
|
+
* @return {?}
|
|
1771
|
+
*/
|
|
1772
|
+
function (result) {
|
|
1773
|
+
self.finishInitialActivity();
|
|
1774
|
+
initialContext.onDone(result);
|
|
1775
|
+
}),
|
|
1776
|
+
onCancel: (/**
|
|
1777
|
+
* @param {?} error
|
|
1778
|
+
* @return {?}
|
|
1779
|
+
*/
|
|
1780
|
+
function (error) {
|
|
1781
|
+
self.finishInitialActivity();
|
|
1782
|
+
initialContext.onCancel(error);
|
|
1783
|
+
})
|
|
1784
|
+
}));
|
|
1785
|
+
}
|
|
1711
1786
|
},
|
|
1712
1787
|
enumerable: true,
|
|
1713
1788
|
configurable: true
|
|
@@ -1719,7 +1794,7 @@
|
|
|
1719
1794
|
* @return {?}
|
|
1720
1795
|
*/
|
|
1721
1796
|
function () {
|
|
1722
|
-
return this.
|
|
1797
|
+
return this._activityList.length > 0;
|
|
1723
1798
|
};
|
|
1724
1799
|
Object.defineProperty(ActivityContainerComponent.prototype, "activityList", {
|
|
1725
1800
|
get: /**
|
|
@@ -1731,6 +1806,16 @@
|
|
|
1731
1806
|
enumerable: true,
|
|
1732
1807
|
configurable: true
|
|
1733
1808
|
});
|
|
1809
|
+
Object.defineProperty(ActivityContainerComponent.prototype, "isFinished", {
|
|
1810
|
+
get: /**
|
|
1811
|
+
* @return {?}
|
|
1812
|
+
*/
|
|
1813
|
+
function () {
|
|
1814
|
+
return !this._initialActivityOutletContext;
|
|
1815
|
+
},
|
|
1816
|
+
enumerable: true,
|
|
1817
|
+
configurable: true
|
|
1818
|
+
});
|
|
1734
1819
|
/**
|
|
1735
1820
|
* @return {?}
|
|
1736
1821
|
*/
|
|
@@ -1791,7 +1876,7 @@
|
|
|
1791
1876
|
*/
|
|
1792
1877
|
function (result) {
|
|
1793
1878
|
resolve(result);
|
|
1794
|
-
self.
|
|
1879
|
+
self.throttledNestedActivityFinishEvents.publish({});
|
|
1795
1880
|
}),
|
|
1796
1881
|
onCancel: (/**
|
|
1797
1882
|
* @param {?} error
|
|
@@ -1799,7 +1884,7 @@
|
|
|
1799
1884
|
*/
|
|
1800
1885
|
function (error) {
|
|
1801
1886
|
reject(error);
|
|
1802
|
-
self.
|
|
1887
|
+
self.throttledNestedActivityFinishEvents.publish({});
|
|
1803
1888
|
})
|
|
1804
1889
|
});
|
|
1805
1890
|
self.activityTabs.push(context);
|
|
@@ -1843,19 +1928,33 @@
|
|
|
1843
1928
|
* @return {?}
|
|
1844
1929
|
*/
|
|
1845
1930
|
function (confirm, activityType, data) {
|
|
1846
|
-
return this.startActivity(exports.ɵ
|
|
1931
|
+
return this.startActivity(exports.ɵbf, {
|
|
1847
1932
|
confirm: confirm,
|
|
1848
1933
|
activityType: activityType,
|
|
1849
1934
|
data: data
|
|
1850
1935
|
});
|
|
1851
1936
|
};
|
|
1937
|
+
/**
|
|
1938
|
+
* @private
|
|
1939
|
+
* @return {?}
|
|
1940
|
+
*/
|
|
1941
|
+
ActivityContainerComponent.prototype.finishInitialActivity = /**
|
|
1942
|
+
* @private
|
|
1943
|
+
* @return {?}
|
|
1944
|
+
*/
|
|
1945
|
+
function () {
|
|
1946
|
+
this._initialActivityOutletContext = null;
|
|
1947
|
+
this.activityTabs.value = [];
|
|
1948
|
+
this._activityList.value = [];
|
|
1949
|
+
this.initialActivityOutletContextEvent.emit(null);
|
|
1950
|
+
};
|
|
1852
1951
|
// @Trace()
|
|
1853
1952
|
// @Trace()
|
|
1854
1953
|
/**
|
|
1855
1954
|
* @private
|
|
1856
1955
|
* @return {?}
|
|
1857
1956
|
*/
|
|
1858
|
-
ActivityContainerComponent.prototype.
|
|
1957
|
+
ActivityContainerComponent.prototype.onNestedActivityFinished =
|
|
1859
1958
|
// @Trace()
|
|
1860
1959
|
/**
|
|
1861
1960
|
* @private
|
|
@@ -1863,12 +1962,10 @@
|
|
|
1863
1962
|
*/
|
|
1864
1963
|
function () {
|
|
1865
1964
|
// don't do anything if job already queued up.
|
|
1866
|
-
if (
|
|
1867
|
-
|
|
1868
|
-
this.cleanupStaleActivities();
|
|
1869
|
-
}
|
|
1870
|
-
this.updateActivityList();
|
|
1965
|
+
if (this.synchroniseSelectedTabIndex()) {
|
|
1966
|
+
this.cleanupStaleNestedActivities();
|
|
1871
1967
|
}
|
|
1968
|
+
this.updateActivityList();
|
|
1872
1969
|
};
|
|
1873
1970
|
// @Trace()
|
|
1874
1971
|
// @Trace()
|
|
@@ -1876,7 +1973,7 @@
|
|
|
1876
1973
|
* @private
|
|
1877
1974
|
* @return {?}
|
|
1878
1975
|
*/
|
|
1879
|
-
ActivityContainerComponent.prototype.
|
|
1976
|
+
ActivityContainerComponent.prototype.cleanupStaleNestedActivities =
|
|
1880
1977
|
// @Trace()
|
|
1881
1978
|
/**
|
|
1882
1979
|
* @private
|
|
@@ -1884,7 +1981,6 @@
|
|
|
1884
1981
|
*/
|
|
1885
1982
|
function () {
|
|
1886
1983
|
var _this = this;
|
|
1887
|
-
// clean up old tabs
|
|
1888
1984
|
if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
|
|
1889
1985
|
this.activityTabs.runInTransaction((/**
|
|
1890
1986
|
* @param {?} draft
|
|
@@ -1937,7 +2033,7 @@
|
|
|
1937
2033
|
*/
|
|
1938
2034
|
function () {
|
|
1939
2035
|
this.getSelectedOutlet().component.onActivityReady();
|
|
1940
|
-
this.
|
|
2036
|
+
this.cleanupStaleNestedActivities();
|
|
1941
2037
|
this.updateActivityList();
|
|
1942
2038
|
};
|
|
1943
2039
|
/**
|
|
@@ -1960,57 +2056,223 @@
|
|
|
1960
2056
|
function (t) { return t.component; }));
|
|
1961
2057
|
};
|
|
1962
2058
|
/**
|
|
1963
|
-
* @private
|
|
2059
|
+
* @private
|
|
2060
|
+
* @return {?}
|
|
2061
|
+
*/
|
|
2062
|
+
ActivityContainerComponent.prototype.getSelectedOutlet = /**
|
|
2063
|
+
* @private
|
|
2064
|
+
* @return {?}
|
|
2065
|
+
*/
|
|
2066
|
+
function () {
|
|
2067
|
+
return this.outlets.toArray()[this.tabs.selectedIndex];
|
|
2068
|
+
};
|
|
2069
|
+
ActivityContainerComponent.decorators = [
|
|
2070
|
+
{ type: core.Component, args: [{
|
|
2071
|
+
selector: 'aup-activity-container',
|
|
2072
|
+
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"dynamicHeight\" [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <aup-activity-outlet [interactionContext]=\"this\" [activityContext]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
|
|
2073
|
+
styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
|
|
2074
|
+
}] }
|
|
2075
|
+
];
|
|
2076
|
+
/** @nocollapse */
|
|
2077
|
+
ActivityContainerComponent.ctorParameters = function () { return []; };
|
|
2078
|
+
ActivityContainerComponent.propDecorators = {
|
|
2079
|
+
initialActivityOutletContext: [{ type: core.Input }],
|
|
2080
|
+
initialActivityOutletContextEvent: [{ type: core.Output, args: ['initialActivityOutletContext',] }],
|
|
2081
|
+
dynamicHeight: [{ type: core.Input }],
|
|
2082
|
+
tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }],
|
|
2083
|
+
outlets: [{ type: core.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
2084
|
+
};
|
|
2085
|
+
return ActivityContainerComponent;
|
|
2086
|
+
}(InteractionContext));
|
|
2087
|
+
if (false) {
|
|
2088
|
+
/**
|
|
2089
|
+
* @type {?}
|
|
2090
|
+
* @private
|
|
2091
|
+
*/
|
|
2092
|
+
ActivityContainerComponent.prototype.throttledNestedActivityFinishEvents;
|
|
2093
|
+
/**
|
|
2094
|
+
* @type {?}
|
|
2095
|
+
* @private
|
|
2096
|
+
*/
|
|
2097
|
+
ActivityContainerComponent.prototype._initialActivityOutletContext;
|
|
2098
|
+
/** @type {?} */
|
|
2099
|
+
ActivityContainerComponent.prototype.initialActivityOutletContextEvent;
|
|
2100
|
+
/** @type {?} */
|
|
2101
|
+
ActivityContainerComponent.prototype.dynamicHeight;
|
|
2102
|
+
/** @type {?} */
|
|
2103
|
+
ActivityContainerComponent.prototype.tabs;
|
|
2104
|
+
/** @type {?} */
|
|
2105
|
+
ActivityContainerComponent.prototype.outlets;
|
|
2106
|
+
/** @type {?} */
|
|
2107
|
+
ActivityContainerComponent.prototype.activityTabs;
|
|
2108
|
+
/**
|
|
2109
|
+
* @type {?}
|
|
2110
|
+
* @private
|
|
2111
|
+
*/
|
|
2112
|
+
ActivityContainerComponent.prototype._activityList;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* @fileoverview added by tsickle
|
|
2117
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2118
|
+
*/
|
|
2119
|
+
/**
|
|
2120
|
+
* @template D, R, E
|
|
2121
|
+
*/
|
|
2122
|
+
var InplaceInteractionContextComponent = /** @class */ (function (_super) {
|
|
2123
|
+
__extends(InplaceInteractionContextComponent, _super);
|
|
2124
|
+
function InplaceInteractionContextComponent() {
|
|
2125
|
+
return _super.call(this) || this;
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* @return {?}
|
|
2129
|
+
*/
|
|
2130
|
+
InplaceInteractionContextComponent.prototype.ngOnInit = /**
|
|
2131
|
+
* @return {?}
|
|
2132
|
+
*/
|
|
2133
|
+
function () {
|
|
2134
|
+
};
|
|
2135
|
+
Object.defineProperty(InplaceInteractionContextComponent.prototype, "activityList", {
|
|
2136
|
+
get: /**
|
|
2137
|
+
* @return {?}
|
|
2138
|
+
*/
|
|
2139
|
+
function () {
|
|
2140
|
+
return this.interactionContext.activityList;
|
|
2141
|
+
},
|
|
2142
|
+
enumerable: true,
|
|
2143
|
+
configurable: true
|
|
2144
|
+
});
|
|
2145
|
+
/**
|
|
2146
|
+
* @return {?}
|
|
2147
|
+
*/
|
|
2148
|
+
InplaceInteractionContextComponent.prototype.isActive = /**
|
|
2149
|
+
* @return {?}
|
|
2150
|
+
*/
|
|
2151
|
+
function () {
|
|
2152
|
+
return this.interactionContext.isActive();
|
|
2153
|
+
};
|
|
2154
|
+
/**
|
|
2155
|
+
* @param {?} alert
|
|
2156
|
+
* @return {?}
|
|
2157
|
+
*/
|
|
2158
|
+
InplaceInteractionContextComponent.prototype.alert = /**
|
|
2159
|
+
* @param {?} alert
|
|
2160
|
+
* @return {?}
|
|
2161
|
+
*/
|
|
2162
|
+
function (alert) {
|
|
2163
|
+
// TODO: Test disableClose === false
|
|
2164
|
+
return this._startActivity(AlertDialogComponent, alert);
|
|
2165
|
+
};
|
|
2166
|
+
/**
|
|
2167
|
+
* @param {?} confirm
|
|
2168
|
+
* @return {?}
|
|
2169
|
+
*/
|
|
2170
|
+
InplaceInteractionContextComponent.prototype.confirm = /**
|
|
2171
|
+
* @param {?} confirm
|
|
2172
|
+
* @return {?}
|
|
2173
|
+
*/
|
|
2174
|
+
function (confirm) {
|
|
2175
|
+
return this._startActivity(ConfirmationDialogComponent, confirm);
|
|
2176
|
+
};
|
|
2177
|
+
/**
|
|
2178
|
+
* @template D1, R1, E1
|
|
2179
|
+
* @param {?} confirm
|
|
2180
|
+
* @param {?} activityType
|
|
2181
|
+
* @param {?=} data
|
|
2182
|
+
* @return {?}
|
|
2183
|
+
*/
|
|
2184
|
+
InplaceInteractionContextComponent.prototype.confirmThen = /**
|
|
2185
|
+
* @template D1, R1, E1
|
|
2186
|
+
* @param {?} confirm
|
|
2187
|
+
* @param {?} activityType
|
|
2188
|
+
* @param {?=} data
|
|
2189
|
+
* @return {?}
|
|
2190
|
+
*/
|
|
2191
|
+
function (confirm, activityType, data) {
|
|
2192
|
+
return this._startActivity(exports.ɵbf, {
|
|
2193
|
+
confirm: confirm,
|
|
2194
|
+
activityType: activityType,
|
|
2195
|
+
data: data
|
|
2196
|
+
});
|
|
2197
|
+
};
|
|
2198
|
+
/**
|
|
2199
|
+
* @template D1, R1, E1
|
|
2200
|
+
* @param {?} activityType
|
|
2201
|
+
* @param {?=} data
|
|
2202
|
+
* @return {?}
|
|
2203
|
+
*/
|
|
2204
|
+
InplaceInteractionContextComponent.prototype.startActivity = /**
|
|
2205
|
+
* @template D1, R1, E1
|
|
2206
|
+
* @param {?} activityType
|
|
2207
|
+
* @param {?=} data
|
|
2208
|
+
* @return {?}
|
|
2209
|
+
*/
|
|
2210
|
+
function (activityType, data) {
|
|
2211
|
+
return this._startActivity(activityType, data);
|
|
2212
|
+
};
|
|
2213
|
+
/**
|
|
2214
|
+
* @protected
|
|
2215
|
+
* @template D1, R1, E1
|
|
2216
|
+
* @param {?} activityType
|
|
2217
|
+
* @param {?=} data
|
|
1964
2218
|
* @return {?}
|
|
1965
2219
|
*/
|
|
1966
|
-
|
|
1967
|
-
* @
|
|
2220
|
+
InplaceInteractionContextComponent.prototype._startActivity = /**
|
|
2221
|
+
* @protected
|
|
2222
|
+
* @template D1, R1, E1
|
|
2223
|
+
* @param {?} activityType
|
|
2224
|
+
* @param {?=} data
|
|
1968
2225
|
* @return {?}
|
|
1969
2226
|
*/
|
|
1970
|
-
function () {
|
|
1971
|
-
|
|
2227
|
+
function (activityType, data) {
|
|
2228
|
+
var _this = this;
|
|
2229
|
+
/** @type {?} */
|
|
2230
|
+
var self = this;
|
|
2231
|
+
return new Promise((/**
|
|
2232
|
+
* @param {?} resolve
|
|
2233
|
+
* @param {?} reject
|
|
2234
|
+
* @return {?}
|
|
2235
|
+
*/
|
|
2236
|
+
function (resolve, reject) {
|
|
2237
|
+
_this.interactionContext.initialActivityOutletContext = {
|
|
2238
|
+
activityClass: activityType,
|
|
2239
|
+
activityData: data,
|
|
2240
|
+
onDone: /**
|
|
2241
|
+
* @param {?} result
|
|
2242
|
+
* @return {?}
|
|
2243
|
+
*/
|
|
2244
|
+
function (result) {
|
|
2245
|
+
resolve(result);
|
|
2246
|
+
},
|
|
2247
|
+
onCancel: /**
|
|
2248
|
+
* @param {?} error
|
|
2249
|
+
* @return {?}
|
|
2250
|
+
*/
|
|
2251
|
+
function (error) {
|
|
2252
|
+
reject(error);
|
|
2253
|
+
}
|
|
2254
|
+
};
|
|
2255
|
+
}));
|
|
1972
2256
|
};
|
|
1973
|
-
|
|
2257
|
+
InplaceInteractionContextComponent.decorators = [
|
|
1974
2258
|
{ type: core.Component, args: [{
|
|
1975
|
-
selector: '
|
|
1976
|
-
template: "<mat-tab-group
|
|
1977
|
-
styles: [":host{display:
|
|
2259
|
+
selector: 'aup-inplace-interaction-context',
|
|
2260
|
+
template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs [dynamicHeight]=\"false\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer\n [(initialActivityOutletContext)]=\"initialActivityContext\"\n [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n",
|
|
2261
|
+
styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
|
|
1978
2262
|
}] }
|
|
1979
2263
|
];
|
|
1980
2264
|
/** @nocollapse */
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
initialActivityOutletContext: [{ type: core.Input }],
|
|
1985
|
-
tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }],
|
|
1986
|
-
outlets: [{ type: core.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
2265
|
+
InplaceInteractionContextComponent.ctorParameters = function () { return []; };
|
|
2266
|
+
InplaceInteractionContextComponent.propDecorators = {
|
|
2267
|
+
interactionContext: [{ type: core.ViewChild, args: ["activityContainer", { static: true },] }]
|
|
1987
2268
|
};
|
|
1988
|
-
return
|
|
2269
|
+
return InplaceInteractionContextComponent;
|
|
1989
2270
|
}(InteractionContext));
|
|
1990
2271
|
if (false) {
|
|
1991
|
-
/**
|
|
1992
|
-
* @type {?}
|
|
1993
|
-
* @private
|
|
1994
|
-
*/
|
|
1995
|
-
ActivityContainerComponent.prototype.activityFinishedEvents;
|
|
1996
2272
|
/** @type {?} */
|
|
1997
|
-
|
|
1998
|
-
/** @type {?} */
|
|
1999
|
-
ActivityContainerComponent.prototype.tabs;
|
|
2000
|
-
/** @type {?} */
|
|
2001
|
-
ActivityContainerComponent.prototype.outlets;
|
|
2273
|
+
InplaceInteractionContextComponent.prototype.interactionContext;
|
|
2002
2274
|
/** @type {?} */
|
|
2003
|
-
|
|
2004
|
-
/**
|
|
2005
|
-
* @type {?}
|
|
2006
|
-
* @private
|
|
2007
|
-
*/
|
|
2008
|
-
ActivityContainerComponent.prototype.finished;
|
|
2009
|
-
/**
|
|
2010
|
-
* @type {?}
|
|
2011
|
-
* @private
|
|
2012
|
-
*/
|
|
2013
|
-
ActivityContainerComponent.prototype._activityList;
|
|
2275
|
+
InplaceInteractionContextComponent.prototype.initialActivityContext;
|
|
2014
2276
|
}
|
|
2015
2277
|
|
|
2016
2278
|
/**
|
|
@@ -2022,7 +2284,7 @@
|
|
|
2022
2284
|
}
|
|
2023
2285
|
InteractionOutletComponent.decorators = [
|
|
2024
2286
|
{ type: core.Component, args: [{
|
|
2025
|
-
selector: '
|
|
2287
|
+
selector: 'aup-interaction-outlet',
|
|
2026
2288
|
template: "<router-outlet name=\"interaction-context\"></router-outlet>\n",
|
|
2027
2289
|
styles: [":host{display:block}"]
|
|
2028
2290
|
}] }
|
|
@@ -2111,7 +2373,7 @@
|
|
|
2111
2373
|
* @return {?}
|
|
2112
2374
|
*/
|
|
2113
2375
|
function () {
|
|
2114
|
-
return
|
|
2376
|
+
return this._activityList.length > 0;
|
|
2115
2377
|
};
|
|
2116
2378
|
/**
|
|
2117
2379
|
* @return {?}
|
|
@@ -2177,7 +2439,8 @@
|
|
|
2177
2439
|
* @return {?}
|
|
2178
2440
|
*/
|
|
2179
2441
|
function () {
|
|
2180
|
-
|
|
2442
|
+
console.log('###### STARTING');
|
|
2443
|
+
// this.currentActivityId = uuid.v1();
|
|
2181
2444
|
// this.location.go(this.router.routerState.snapshot.url, "aup");
|
|
2182
2445
|
/** @type {?} */
|
|
2183
2446
|
var self = _this;
|
|
@@ -2197,7 +2460,6 @@
|
|
|
2197
2460
|
function (resolve, reject) {
|
|
2198
2461
|
/** @type {?} */
|
|
2199
2462
|
var activityContainer = matDialogRef.componentInstance;
|
|
2200
|
-
activityContainer.parentInteractionContext = _this;
|
|
2201
2463
|
self.safelyUpdateActivityListDelegate(activityContainer.activityList);
|
|
2202
2464
|
activityContainer.initialActivityOutletContext = {
|
|
2203
2465
|
activityClass: activityType,
|
|
@@ -2219,13 +2481,16 @@
|
|
|
2219
2481
|
matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
|
|
2220
2482
|
}
|
|
2221
2483
|
};
|
|
2484
|
+
// we need to check if our onDone/onCancel methods above we called or if we were
|
|
2485
|
+
// closed by the user clicking the backdrop. If the later then we need to reject
|
|
2486
|
+
// our promise.
|
|
2222
2487
|
matDialogRef.afterClosed().subscribe((/**
|
|
2223
2488
|
* @param {?} promiseAlreadyFinished
|
|
2224
2489
|
* @return {?}
|
|
2225
2490
|
*/
|
|
2226
2491
|
function (promiseAlreadyFinished) {
|
|
2227
2492
|
if (!promiseAlreadyFinished) {
|
|
2228
|
-
reject(
|
|
2493
|
+
reject('auto-closed');
|
|
2229
2494
|
}
|
|
2230
2495
|
}));
|
|
2231
2496
|
matDialogRef.updateSize();
|
|
@@ -2233,7 +2498,8 @@
|
|
|
2233
2498
|
* @return {?}
|
|
2234
2499
|
*/
|
|
2235
2500
|
function () {
|
|
2236
|
-
|
|
2501
|
+
console.log('###### FINISHED');
|
|
2502
|
+
// this.currentActivityId = null;
|
|
2237
2503
|
self.safelyUpdateActivityListDelegate(null);
|
|
2238
2504
|
}));
|
|
2239
2505
|
}));
|
|
@@ -2297,7 +2563,7 @@
|
|
|
2297
2563
|
* @return {?}
|
|
2298
2564
|
*/
|
|
2299
2565
|
function (confirm, activityType, data) {
|
|
2300
|
-
return this._startActivity(exports.ɵ
|
|
2566
|
+
return this._startActivity(exports.ɵbf, {
|
|
2301
2567
|
confirm: confirm,
|
|
2302
2568
|
activityType: activityType,
|
|
2303
2569
|
data: data
|
|
@@ -2370,20 +2636,22 @@
|
|
|
2370
2636
|
declarations: [
|
|
2371
2637
|
ActivityContainerComponent,
|
|
2372
2638
|
ConfirmationDialogComponent,
|
|
2373
|
-
exports.ɵ
|
|
2639
|
+
exports.ɵbf,
|
|
2374
2640
|
AlertDialogComponent,
|
|
2375
2641
|
ActivityOutletComponent,
|
|
2376
|
-
InteractionOutletComponent
|
|
2642
|
+
InteractionOutletComponent,
|
|
2643
|
+
InplaceInteractionContextComponent
|
|
2377
2644
|
],
|
|
2378
2645
|
exports: [
|
|
2379
2646
|
ActivityContainerComponent,
|
|
2380
2647
|
ActivityOutletComponent,
|
|
2381
|
-
InteractionOutletComponent
|
|
2648
|
+
InteractionOutletComponent,
|
|
2649
|
+
InplaceInteractionContextComponent
|
|
2382
2650
|
],
|
|
2383
2651
|
entryComponents: [
|
|
2384
2652
|
ActivityContainerComponent,
|
|
2385
2653
|
ConfirmationDialogComponent,
|
|
2386
|
-
exports.ɵ
|
|
2654
|
+
exports.ɵbf,
|
|
2387
2655
|
AlertDialogComponent
|
|
2388
2656
|
],
|
|
2389
2657
|
providers: [
|
|
@@ -2411,7 +2679,7 @@
|
|
|
2411
2679
|
};
|
|
2412
2680
|
BusyOverlayComponent.decorators = [
|
|
2413
2681
|
{ type: core.Component, args: [{
|
|
2414
|
-
selector: '
|
|
2682
|
+
selector: 'aup-busy-overlay',
|
|
2415
2683
|
template: "<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n",
|
|
2416
2684
|
styles: [":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]
|
|
2417
2685
|
}] }
|
|
@@ -2456,9 +2724,9 @@
|
|
|
2456
2724
|
};
|
|
2457
2725
|
EmptyStateComponent.decorators = [
|
|
2458
2726
|
{ type: core.Component, args: [{
|
|
2459
|
-
selector: '
|
|
2727
|
+
selector: 'aup-empty-state',
|
|
2460
2728
|
template: "\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ",
|
|
2461
|
-
styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--
|
|
2729
|
+
styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
|
|
2462
2730
|
}] }
|
|
2463
2731
|
];
|
|
2464
2732
|
/** @nocollapse */
|
|
@@ -2773,11 +3041,10 @@
|
|
|
2773
3041
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2774
3042
|
*/
|
|
2775
3043
|
exports.PlaceDefinition = /** @class */ (function () {
|
|
2776
|
-
function PlaceDefinition(component, path, authenticate,
|
|
3044
|
+
function PlaceDefinition(component, path, authenticate, data, routeParameters, children) {
|
|
2777
3045
|
this.component = component;
|
|
2778
3046
|
this.path = path;
|
|
2779
3047
|
this.authenticate = authenticate;
|
|
2780
|
-
this.order = order;
|
|
2781
3048
|
this.data = data;
|
|
2782
3049
|
this.routeParameters = routeParameters;
|
|
2783
3050
|
this.children = children;
|
|
@@ -3083,8 +3350,6 @@
|
|
|
3083
3350
|
/** @type {?} */
|
|
3084
3351
|
exports.PlaceDefinition.prototype.authenticate;
|
|
3085
3352
|
/** @type {?} */
|
|
3086
|
-
exports.PlaceDefinition.prototype.order;
|
|
3087
|
-
/** @type {?} */
|
|
3088
3353
|
exports.PlaceDefinition.prototype.data;
|
|
3089
3354
|
/** @type {?} */
|
|
3090
3355
|
exports.PlaceDefinition.prototype.routeParameters;
|
|
@@ -3234,6 +3499,8 @@
|
|
|
3234
3499
|
* @private
|
|
3235
3500
|
*/
|
|
3236
3501
|
exports.PlaceComponent.prototype.visit;
|
|
3502
|
+
/** @type {?} */
|
|
3503
|
+
exports.PlaceComponent.prototype.interactionContext;
|
|
3237
3504
|
}
|
|
3238
3505
|
(function (PlaceComponent) {
|
|
3239
3506
|
/**
|
|
@@ -3275,136 +3542,182 @@
|
|
|
3275
3542
|
* @fileoverview added by tsickle
|
|
3276
3543
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3277
3544
|
*/
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
function (c) { return exports.PlaceComponent.getDefinition(c); }));
|
|
3288
|
-
return _this;
|
|
3545
|
+
/**
|
|
3546
|
+
* @record
|
|
3547
|
+
*/
|
|
3548
|
+
function Params() { }
|
|
3549
|
+
var Visit = /** @class */ (function () {
|
|
3550
|
+
function Visit(placeDefinition, visitParameters) {
|
|
3551
|
+
if (visitParameters === void 0) { visitParameters = {}; }
|
|
3552
|
+
this.placeDefinition = placeDefinition;
|
|
3553
|
+
this.visitParameters = visitParameters;
|
|
3289
3554
|
}
|
|
3555
|
+
// @Trace()
|
|
3556
|
+
// @Trace()
|
|
3290
3557
|
/**
|
|
3291
|
-
* @param {?} placeDef
|
|
3292
3558
|
* @return {?}
|
|
3293
3559
|
*/
|
|
3294
|
-
|
|
3295
|
-
|
|
3560
|
+
Visit.prototype.getRouteId =
|
|
3561
|
+
// @Trace()
|
|
3562
|
+
/**
|
|
3296
3563
|
* @return {?}
|
|
3297
3564
|
*/
|
|
3298
|
-
function (
|
|
3299
|
-
|
|
3300
|
-
var navItem = (/** @type {?} */ (placeDef.getPlaceData('nav')));
|
|
3301
|
-
return {
|
|
3302
|
-
title: (/**
|
|
3303
|
-
* @return {?}
|
|
3304
|
-
*/
|
|
3305
|
-
function () { return navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']); }),
|
|
3306
|
-
tooltip: (/**
|
|
3307
|
-
* @return {?}
|
|
3308
|
-
*/
|
|
3309
|
-
function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null); }),
|
|
3310
|
-
icon: (/**
|
|
3311
|
-
* @return {?}
|
|
3312
|
-
*/
|
|
3313
|
-
function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null); })
|
|
3314
|
-
};
|
|
3565
|
+
function () {
|
|
3566
|
+
return this.placeDefinition.getRouteIdFrom(this);
|
|
3315
3567
|
};
|
|
3568
|
+
// @Trace()
|
|
3569
|
+
// @Trace()
|
|
3316
3570
|
/**
|
|
3317
3571
|
* @return {?}
|
|
3318
3572
|
*/
|
|
3319
|
-
|
|
3573
|
+
Visit.prototype.hasRouteId =
|
|
3574
|
+
// @Trace()
|
|
3575
|
+
/**
|
|
3320
3576
|
* @return {?}
|
|
3321
3577
|
*/
|
|
3322
3578
|
function () {
|
|
3579
|
+
return !___default.isNil(this.getRouteId());
|
|
3323
3580
|
};
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3581
|
+
/**
|
|
3582
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3583
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3584
|
+
* same as the the ValueModel property name.
|
|
3585
|
+
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
3586
|
+
*/
|
|
3587
|
+
/**
|
|
3588
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3589
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3590
|
+
* same as the the ValueModel property name.
|
|
3591
|
+
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3592
|
+
* @return {?}
|
|
3593
|
+
*/
|
|
3594
|
+
Visit.prototype.getParameter = /**
|
|
3595
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3596
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3597
|
+
* same as the the ValueModel property name.
|
|
3598
|
+
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3599
|
+
* @return {?}
|
|
3600
|
+
*/
|
|
3601
|
+
function (parameterName) {
|
|
3602
|
+
return this.visitParameters[parameterName];
|
|
3327
3603
|
};
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
__metadata("design:type", Array)
|
|
3331
|
-
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
3332
|
-
__decorate([
|
|
3333
|
-
pectin.UseDelegate(),
|
|
3334
|
-
__metadata("design:type", pectin.ListModel)
|
|
3335
|
-
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
3336
|
-
__decorate([
|
|
3337
|
-
src.Memoize(),
|
|
3338
|
-
__metadata("design:type", Function),
|
|
3339
|
-
__metadata("design:paramtypes", [exports.PlaceDefinition]),
|
|
3340
|
-
__metadata("design:returntype", Object)
|
|
3341
|
-
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
3342
|
-
return AbstractPlaceNavigationComponent;
|
|
3343
|
-
}(DisposableComponent));
|
|
3344
|
-
if (false) {
|
|
3345
|
-
/** @type {?} */
|
|
3346
|
-
AbstractPlaceNavigationComponent.prototype.places;
|
|
3347
|
-
/** @type {?} */
|
|
3348
|
-
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
3349
|
-
/** @type {?} */
|
|
3350
|
-
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
3351
|
-
}
|
|
3352
|
-
|
|
3353
|
-
/**
|
|
3354
|
-
* @fileoverview added by tsickle
|
|
3355
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3356
|
-
*/
|
|
3357
|
-
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
3358
|
-
__extends(ListPlaceNavComponent, _super);
|
|
3359
|
-
function ListPlaceNavComponent() {
|
|
3360
|
-
var _this = _super.call(this) || this;
|
|
3361
|
-
_this.expanded = true;
|
|
3362
|
-
return _this;
|
|
3363
|
-
}
|
|
3604
|
+
// @Trace()
|
|
3605
|
+
// @Trace()
|
|
3364
3606
|
/**
|
|
3607
|
+
* @param {?} parameterName
|
|
3365
3608
|
* @return {?}
|
|
3366
3609
|
*/
|
|
3367
|
-
|
|
3610
|
+
Visit.prototype.hasParameter =
|
|
3611
|
+
// @Trace()
|
|
3612
|
+
/**
|
|
3613
|
+
* @param {?} parameterName
|
|
3368
3614
|
* @return {?}
|
|
3369
3615
|
*/
|
|
3370
|
-
function () {
|
|
3371
|
-
this.
|
|
3616
|
+
function (parameterName) {
|
|
3617
|
+
return Object.keys(this.visitParameters).includes(parameterName);
|
|
3618
|
+
};
|
|
3619
|
+
/**
|
|
3620
|
+
* @template S
|
|
3621
|
+
* @param {?} parameter
|
|
3622
|
+
* @param {?} value
|
|
3623
|
+
* @return {?}
|
|
3624
|
+
*/
|
|
3625
|
+
Visit.prototype.replace = /**
|
|
3626
|
+
* @template S
|
|
3627
|
+
* @param {?} parameter
|
|
3628
|
+
* @param {?} value
|
|
3629
|
+
* @return {?}
|
|
3630
|
+
*/
|
|
3631
|
+
function (parameter, value) {
|
|
3632
|
+
var _a;
|
|
3633
|
+
return new Visit(this.placeDefinition, __assign({}, this.visitParameters, (_a = {}, _a[parameter.name] = value, _a)));
|
|
3634
|
+
};
|
|
3635
|
+
/**
|
|
3636
|
+
* @template S
|
|
3637
|
+
* @param {?} routeParams
|
|
3638
|
+
* @return {?}
|
|
3639
|
+
*/
|
|
3640
|
+
Visit.prototype.mergeRouteParameters = /**
|
|
3641
|
+
* @template S
|
|
3642
|
+
* @param {?} routeParams
|
|
3643
|
+
* @return {?}
|
|
3644
|
+
*/
|
|
3645
|
+
function (routeParams) {
|
|
3646
|
+
var _this = this;
|
|
3647
|
+
// todo: whitelist parameters.
|
|
3648
|
+
/** @type {?} */
|
|
3649
|
+
var routeParameterKeys = Object.keys(routeParams);
|
|
3650
|
+
/** @type {?} */
|
|
3651
|
+
var params = {};
|
|
3652
|
+
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
3653
|
+
* @param {?} def
|
|
3654
|
+
* @return {?}
|
|
3655
|
+
*/
|
|
3656
|
+
function (def) {
|
|
3657
|
+
if (def.isRouteId || def.isRouteParameter) {
|
|
3658
|
+
if (routeParameterKeys.includes(def.name)) {
|
|
3659
|
+
params[def.name] = routeParams[def.name];
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
else {
|
|
3663
|
+
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
3664
|
+
// defaults and remember sanitisation process.
|
|
3665
|
+
if (_this.hasParameter(def.name)) {
|
|
3666
|
+
params[def.name] = _this.getParameter(def.name);
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
}));
|
|
3670
|
+
return new Visit(this.placeDefinition, params);
|
|
3671
|
+
};
|
|
3672
|
+
/**
|
|
3673
|
+
* @param {?} other
|
|
3674
|
+
* @return {?}
|
|
3675
|
+
*/
|
|
3676
|
+
Visit.prototype.hasRoutingChangedFrom = /**
|
|
3677
|
+
* @param {?} other
|
|
3678
|
+
* @return {?}
|
|
3679
|
+
*/
|
|
3680
|
+
function (other) {
|
|
3681
|
+
/** @type {?} */
|
|
3682
|
+
var samePlace = other.placeDefinition === this.placeDefinition;
|
|
3683
|
+
/** @type {?} */
|
|
3684
|
+
var sameRouteParameters = ___default.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
3685
|
+
return !samePlace || !sameRouteParameters;
|
|
3372
3686
|
};
|
|
3373
3687
|
/**
|
|
3688
|
+
* @param {?} other
|
|
3374
3689
|
* @return {?}
|
|
3375
3690
|
*/
|
|
3376
|
-
|
|
3691
|
+
Visit.prototype.hasChangedFrom = /**
|
|
3692
|
+
* @param {?} other
|
|
3377
3693
|
* @return {?}
|
|
3378
3694
|
*/
|
|
3379
|
-
function () {
|
|
3380
|
-
|
|
3695
|
+
function (other) {
|
|
3696
|
+
/** @type {?} */
|
|
3697
|
+
var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
3698
|
+
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
3381
3699
|
};
|
|
3382
3700
|
/**
|
|
3383
3701
|
* @return {?}
|
|
3384
3702
|
*/
|
|
3385
|
-
|
|
3703
|
+
Visit.prototype.getUrlSegments = /**
|
|
3386
3704
|
* @return {?}
|
|
3387
3705
|
*/
|
|
3388
3706
|
function () {
|
|
3389
|
-
this.
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
{ type: core.Component, args: [{
|
|
3393
|
-
selector: 'angular-ui-powerups-list-place-nav',
|
|
3394
|
-
template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [routerLink]='place.path'\n [replaceUrl]=\"true\"\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
|
|
3395
|
-
styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
|
|
3396
|
-
}] }
|
|
3397
|
-
];
|
|
3398
|
-
/** @nocollapse */
|
|
3399
|
-
ListPlaceNavComponent.ctorParameters = function () { return []; };
|
|
3400
|
-
ListPlaceNavComponent.propDecorators = {
|
|
3401
|
-
expanded: [{ type: core.HostBinding, args: ['class.expanded',] }]
|
|
3707
|
+
return this.placeDefinition.hasRouteId() ?
|
|
3708
|
+
[new router.UrlSegment(this.placeDefinition.path, {}), new router.UrlSegment(this.placeDefinition.getFormattedRouteId(this), this.placeDefinition.getFormattedRouteParameters(this))] :
|
|
3709
|
+
[new router.UrlSegment(this.placeDefinition.path, this.placeDefinition.getFormattedRouteParameters(this))];
|
|
3402
3710
|
};
|
|
3403
|
-
return
|
|
3404
|
-
}(
|
|
3711
|
+
return Visit;
|
|
3712
|
+
}());
|
|
3405
3713
|
if (false) {
|
|
3406
3714
|
/** @type {?} */
|
|
3407
|
-
|
|
3715
|
+
Visit.prototype.placeDefinition;
|
|
3716
|
+
/**
|
|
3717
|
+
* @type {?}
|
|
3718
|
+
* @private
|
|
3719
|
+
*/
|
|
3720
|
+
Visit.prototype.visitParameters;
|
|
3408
3721
|
}
|
|
3409
3722
|
|
|
3410
3723
|
/**
|
|
@@ -3597,261 +3910,90 @@
|
|
|
3597
3910
|
|
|
3598
3911
|
/**
|
|
3599
3912
|
* @fileoverview added by tsickle
|
|
3600
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3601
|
-
*/
|
|
3602
|
-
var PlaceHistory = /** @class */ (function () {
|
|
3603
|
-
function PlaceHistory(router) {
|
|
3604
|
-
this.router = router;
|
|
3605
|
-
this._history = new Map();
|
|
3606
|
-
}
|
|
3607
|
-
// @Trace()
|
|
3608
|
-
// @Trace()
|
|
3609
|
-
/**
|
|
3610
|
-
* @param {?} state
|
|
3611
|
-
* @return {?}
|
|
3612
|
-
*/
|
|
3613
|
-
PlaceHistory.prototype.add =
|
|
3614
|
-
// @Trace()
|
|
3615
|
-
/**
|
|
3616
|
-
* @param {?} state
|
|
3617
|
-
* @return {?}
|
|
3618
|
-
*/
|
|
3619
|
-
function (state) {
|
|
3620
|
-
/** @type {?} */
|
|
3621
|
-
var history = this.getHistory(state.placeDefinition);
|
|
3622
|
-
/** @type {?} */
|
|
3623
|
-
var previousState = ___default__default.last(history);
|
|
3624
|
-
if (!previousState || state.hasChangedFrom(previousState)) {
|
|
3625
|
-
history.unshift(state); // LIFO
|
|
3626
|
-
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
3627
|
-
}
|
|
3628
|
-
};
|
|
3629
|
-
/**
|
|
3630
|
-
* @param {?} placeDef
|
|
3631
|
-
* @return {?}
|
|
3632
|
-
*/
|
|
3633
|
-
PlaceHistory.prototype.getHistory = /**
|
|
3634
|
-
* @param {?} placeDef
|
|
3635
|
-
* @return {?}
|
|
3636
|
-
*/
|
|
3637
|
-
function (placeDef) {
|
|
3638
|
-
/** @type {?} */
|
|
3639
|
-
var history = this._history.get(placeDef);
|
|
3640
|
-
if (!history) {
|
|
3641
|
-
history = [];
|
|
3642
|
-
this.setHistory(placeDef, history);
|
|
3643
|
-
}
|
|
3644
|
-
return history;
|
|
3645
|
-
};
|
|
3646
|
-
/**
|
|
3647
|
-
* @private
|
|
3648
|
-
* @param {?} placeDef
|
|
3649
|
-
* @param {?} history
|
|
3650
|
-
* @return {?}
|
|
3651
|
-
*/
|
|
3652
|
-
PlaceHistory.prototype.setHistory = /**
|
|
3653
|
-
* @private
|
|
3654
|
-
* @param {?} placeDef
|
|
3655
|
-
* @param {?} history
|
|
3656
|
-
* @return {?}
|
|
3657
|
-
*/
|
|
3658
|
-
function (placeDef, history) {
|
|
3659
|
-
this._history.set(placeDef, history);
|
|
3660
|
-
};
|
|
3661
|
-
PlaceHistory.decorators = [
|
|
3662
|
-
{ type: core.Injectable, args: [{
|
|
3663
|
-
providedIn: 'root'
|
|
3664
|
-
},] }
|
|
3665
|
-
];
|
|
3666
|
-
/** @nocollapse */
|
|
3667
|
-
PlaceHistory.ctorParameters = function () { return [
|
|
3668
|
-
{ type: router.Router }
|
|
3669
|
-
]; };
|
|
3670
|
-
/** @nocollapse */ PlaceHistory.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(core.ɵɵinject(router.Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
3671
|
-
return PlaceHistory;
|
|
3672
|
-
}());
|
|
3673
|
-
if (false) {
|
|
3674
|
-
/**
|
|
3675
|
-
* @type {?}
|
|
3676
|
-
* @private
|
|
3677
|
-
*/
|
|
3678
|
-
PlaceHistory.prototype._history;
|
|
3679
|
-
/**
|
|
3680
|
-
* @type {?}
|
|
3681
|
-
* @private
|
|
3682
|
-
*/
|
|
3683
|
-
PlaceHistory.prototype.router;
|
|
3684
|
-
}
|
|
3685
|
-
|
|
3686
|
-
/**
|
|
3687
|
-
* @fileoverview added by tsickle
|
|
3688
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3689
|
-
*/
|
|
3690
|
-
/**
|
|
3691
|
-
* @record
|
|
3692
|
-
*/
|
|
3693
|
-
function Params() { }
|
|
3694
|
-
var Visit = /** @class */ (function () {
|
|
3695
|
-
function Visit(placeDefinition, visitParameters) {
|
|
3696
|
-
if (visitParameters === void 0) { visitParameters = {}; }
|
|
3697
|
-
this.placeDefinition = placeDefinition;
|
|
3698
|
-
this.visitParameters = visitParameters;
|
|
3699
|
-
}
|
|
3700
|
-
// @Trace()
|
|
3701
|
-
// @Trace()
|
|
3702
|
-
/**
|
|
3703
|
-
* @return {?}
|
|
3704
|
-
*/
|
|
3705
|
-
Visit.prototype.getRouteId =
|
|
3706
|
-
// @Trace()
|
|
3707
|
-
/**
|
|
3708
|
-
* @return {?}
|
|
3709
|
-
*/
|
|
3710
|
-
function () {
|
|
3711
|
-
return this.placeDefinition.getRouteIdFrom(this);
|
|
3712
|
-
};
|
|
3713
|
-
// @Trace()
|
|
3714
|
-
// @Trace()
|
|
3715
|
-
/**
|
|
3716
|
-
* @return {?}
|
|
3717
|
-
*/
|
|
3718
|
-
Visit.prototype.hasRouteId =
|
|
3719
|
-
// @Trace()
|
|
3720
|
-
/**
|
|
3721
|
-
* @return {?}
|
|
3722
|
-
*/
|
|
3723
|
-
function () {
|
|
3724
|
-
return !___default.isNil(this.getRouteId());
|
|
3725
|
-
};
|
|
3726
|
-
/**
|
|
3727
|
-
* Returns the value of the place parameter with the specified name. The parameter
|
|
3728
|
-
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3729
|
-
* same as the the ValueModel property name.
|
|
3730
|
-
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
3731
|
-
*/
|
|
3732
|
-
/**
|
|
3733
|
-
* Returns the value of the place parameter with the specified name. The parameter
|
|
3734
|
-
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3735
|
-
* same as the the ValueModel property name.
|
|
3736
|
-
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3737
|
-
* @return {?}
|
|
3738
|
-
*/
|
|
3739
|
-
Visit.prototype.getParameter = /**
|
|
3740
|
-
* Returns the value of the place parameter with the specified name. The parameter
|
|
3741
|
-
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3742
|
-
* same as the the ValueModel property name.
|
|
3743
|
-
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3744
|
-
* @return {?}
|
|
3745
|
-
*/
|
|
3746
|
-
function (parameterName) {
|
|
3747
|
-
return this.visitParameters[parameterName];
|
|
3748
|
-
};
|
|
3749
|
-
// @Trace()
|
|
3750
|
-
// @Trace()
|
|
3751
|
-
/**
|
|
3752
|
-
* @param {?} parameterName
|
|
3753
|
-
* @return {?}
|
|
3754
|
-
*/
|
|
3755
|
-
Visit.prototype.hasParameter =
|
|
3756
|
-
// @Trace()
|
|
3757
|
-
/**
|
|
3758
|
-
* @param {?} parameterName
|
|
3759
|
-
* @return {?}
|
|
3760
|
-
*/
|
|
3761
|
-
function (parameterName) {
|
|
3762
|
-
return Object.keys(this.visitParameters).includes(parameterName);
|
|
3763
|
-
};
|
|
3764
|
-
/**
|
|
3765
|
-
* @template S
|
|
3766
|
-
* @param {?} parameter
|
|
3767
|
-
* @param {?} value
|
|
3768
|
-
* @return {?}
|
|
3769
|
-
*/
|
|
3770
|
-
Visit.prototype.replace = /**
|
|
3771
|
-
* @template S
|
|
3772
|
-
* @param {?} parameter
|
|
3773
|
-
* @param {?} value
|
|
3774
|
-
* @return {?}
|
|
3775
|
-
*/
|
|
3776
|
-
function (parameter, value) {
|
|
3777
|
-
var _a;
|
|
3778
|
-
return new Visit(this.placeDefinition, __assign({}, this.visitParameters, (_a = {}, _a[parameter.name] = value, _a)));
|
|
3779
|
-
};
|
|
3780
|
-
/**
|
|
3781
|
-
* @template S
|
|
3782
|
-
* @param {?} routeParams
|
|
3783
|
-
* @return {?}
|
|
3784
|
-
*/
|
|
3785
|
-
Visit.prototype.mergeRouteParameters = /**
|
|
3786
|
-
* @template S
|
|
3787
|
-
* @param {?} routeParams
|
|
3788
|
-
* @return {?}
|
|
3789
|
-
*/
|
|
3790
|
-
function (routeParams) {
|
|
3791
|
-
var _this = this;
|
|
3792
|
-
// todo: whitelist parameters.
|
|
3793
|
-
/** @type {?} */
|
|
3794
|
-
var routeParameterKeys = Object.keys(routeParams);
|
|
3795
|
-
/** @type {?} */
|
|
3796
|
-
var params = {};
|
|
3797
|
-
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
3798
|
-
* @param {?} def
|
|
3799
|
-
* @return {?}
|
|
3800
|
-
*/
|
|
3801
|
-
function (def) {
|
|
3802
|
-
if (def.isRouteId || def.isRouteParameter) {
|
|
3803
|
-
if (routeParameterKeys.includes(def.name)) {
|
|
3804
|
-
params[def.name] = routeParams[def.name];
|
|
3805
|
-
}
|
|
3806
|
-
}
|
|
3807
|
-
else {
|
|
3808
|
-
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
3809
|
-
// defaults and remember sanitisation process.
|
|
3810
|
-
if (_this.hasParameter(def.name)) {
|
|
3811
|
-
params[def.name] = _this.getParameter(def.name);
|
|
3812
|
-
}
|
|
3813
|
-
}
|
|
3814
|
-
}));
|
|
3815
|
-
return new Visit(this.placeDefinition, params);
|
|
3816
|
-
};
|
|
3913
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3914
|
+
*/
|
|
3915
|
+
var PlaceHistory = /** @class */ (function () {
|
|
3916
|
+
function PlaceHistory(router) {
|
|
3917
|
+
this.router = router;
|
|
3918
|
+
this._history = new Map();
|
|
3919
|
+
}
|
|
3920
|
+
// @Trace()
|
|
3921
|
+
// @Trace()
|
|
3817
3922
|
/**
|
|
3818
|
-
* @param {?}
|
|
3923
|
+
* @param {?} state
|
|
3819
3924
|
* @return {?}
|
|
3820
3925
|
*/
|
|
3821
|
-
|
|
3822
|
-
|
|
3926
|
+
PlaceHistory.prototype.add =
|
|
3927
|
+
// @Trace()
|
|
3928
|
+
/**
|
|
3929
|
+
* @param {?} state
|
|
3823
3930
|
* @return {?}
|
|
3824
3931
|
*/
|
|
3825
|
-
function (
|
|
3932
|
+
function (state) {
|
|
3826
3933
|
/** @type {?} */
|
|
3827
|
-
var
|
|
3934
|
+
var history = this.getHistory(state.placeDefinition);
|
|
3828
3935
|
/** @type {?} */
|
|
3829
|
-
var
|
|
3830
|
-
|
|
3936
|
+
var previousState = ___default__default.last(history);
|
|
3937
|
+
if (!previousState || state.hasChangedFrom(previousState)) {
|
|
3938
|
+
history.unshift(state); // LIFO
|
|
3939
|
+
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
3940
|
+
}
|
|
3831
3941
|
};
|
|
3832
3942
|
/**
|
|
3833
|
-
* @param {?}
|
|
3943
|
+
* @param {?} placeDef
|
|
3834
3944
|
* @return {?}
|
|
3835
3945
|
*/
|
|
3836
|
-
|
|
3837
|
-
* @param {?}
|
|
3946
|
+
PlaceHistory.prototype.getHistory = /**
|
|
3947
|
+
* @param {?} placeDef
|
|
3838
3948
|
* @return {?}
|
|
3839
3949
|
*/
|
|
3840
|
-
function (
|
|
3950
|
+
function (placeDef) {
|
|
3841
3951
|
/** @type {?} */
|
|
3842
|
-
var
|
|
3843
|
-
|
|
3952
|
+
var history = this._history.get(placeDef);
|
|
3953
|
+
if (!history) {
|
|
3954
|
+
history = [];
|
|
3955
|
+
this.setHistory(placeDef, history);
|
|
3956
|
+
}
|
|
3957
|
+
return history;
|
|
3844
3958
|
};
|
|
3845
|
-
|
|
3959
|
+
/**
|
|
3960
|
+
* @private
|
|
3961
|
+
* @param {?} placeDef
|
|
3962
|
+
* @param {?} history
|
|
3963
|
+
* @return {?}
|
|
3964
|
+
*/
|
|
3965
|
+
PlaceHistory.prototype.setHistory = /**
|
|
3966
|
+
* @private
|
|
3967
|
+
* @param {?} placeDef
|
|
3968
|
+
* @param {?} history
|
|
3969
|
+
* @return {?}
|
|
3970
|
+
*/
|
|
3971
|
+
function (placeDef, history) {
|
|
3972
|
+
this._history.set(placeDef, history);
|
|
3973
|
+
};
|
|
3974
|
+
PlaceHistory.decorators = [
|
|
3975
|
+
{ type: core.Injectable, args: [{
|
|
3976
|
+
providedIn: 'root'
|
|
3977
|
+
},] }
|
|
3978
|
+
];
|
|
3979
|
+
/** @nocollapse */
|
|
3980
|
+
PlaceHistory.ctorParameters = function () { return [
|
|
3981
|
+
{ type: router.Router }
|
|
3982
|
+
]; };
|
|
3983
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(core.ɵɵinject(router.Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
3984
|
+
return PlaceHistory;
|
|
3846
3985
|
}());
|
|
3847
3986
|
if (false) {
|
|
3848
|
-
/** @type {?} */
|
|
3849
|
-
Visit.prototype.placeDefinition;
|
|
3850
3987
|
/**
|
|
3851
3988
|
* @type {?}
|
|
3852
3989
|
* @private
|
|
3853
3990
|
*/
|
|
3854
|
-
|
|
3991
|
+
PlaceHistory.prototype._history;
|
|
3992
|
+
/**
|
|
3993
|
+
* @type {?}
|
|
3994
|
+
* @private
|
|
3995
|
+
*/
|
|
3996
|
+
PlaceHistory.prototype.router;
|
|
3855
3997
|
}
|
|
3856
3998
|
|
|
3857
3999
|
/**
|
|
@@ -3983,13 +4125,17 @@
|
|
|
3983
4125
|
});
|
|
3984
4126
|
});
|
|
3985
4127
|
};
|
|
4128
|
+
// @Trace()
|
|
4129
|
+
// @Trace()
|
|
3986
4130
|
/**
|
|
3987
4131
|
* @param {?} activatedRoute
|
|
3988
4132
|
* @param {?} previous
|
|
3989
4133
|
* @param {?} next
|
|
3990
4134
|
* @return {?}
|
|
3991
4135
|
*/
|
|
3992
|
-
PlaceRouter.prototype.pushVisitChangesToRoute =
|
|
4136
|
+
PlaceRouter.prototype.pushVisitChangesToRoute =
|
|
4137
|
+
// @Trace()
|
|
4138
|
+
/**
|
|
3993
4139
|
* @param {?} activatedRoute
|
|
3994
4140
|
* @param {?} previous
|
|
3995
4141
|
* @param {?} next
|
|
@@ -4009,13 +4155,16 @@
|
|
|
4009
4155
|
* @return {?}
|
|
4010
4156
|
*/
|
|
4011
4157
|
function (router) {
|
|
4158
|
+
// we have to to use the definition for route id as our redirection always includes
|
|
4159
|
+
// the id in the url segements (but leaves it blank when there's no id). I.e. in the
|
|
4160
|
+
// no id case we're doing the following redirect [<placePath>, ""] -> ["..", <id>]
|
|
4012
4161
|
/** @type {?} */
|
|
4013
4162
|
var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
|
|
4014
4163
|
/** @type {?} */
|
|
4015
4164
|
var commands = __spread([
|
|
4016
4165
|
relativePath
|
|
4017
4166
|
], _this.createRouteParameters(next), _this.extractChildPath(activatedRoute.snapshot));
|
|
4018
|
-
console.log('### Redirect', commands);
|
|
4167
|
+
console.log('### Push Changes to route Redirect', { commands: commands, relativeTo: activatedRoute.snapshot.url });
|
|
4019
4168
|
return router.navigate(commands, {
|
|
4020
4169
|
relativeTo: activatedRoute
|
|
4021
4170
|
});
|
|
@@ -4164,12 +4313,6 @@
|
|
|
4164
4313
|
__metadata("design:paramtypes", [Visit, Object]),
|
|
4165
4314
|
__metadata("design:returntype", Promise)
|
|
4166
4315
|
], PlaceRouter.prototype, "navigate", null);
|
|
4167
|
-
__decorate([
|
|
4168
|
-
pectin.Trace(),
|
|
4169
|
-
__metadata("design:type", Function),
|
|
4170
|
-
__metadata("design:paramtypes", [router.ActivatedRoute, Visit, Visit]),
|
|
4171
|
-
__metadata("design:returntype", Promise)
|
|
4172
|
-
], PlaceRouter.prototype, "pushVisitChangesToRoute", null);
|
|
4173
4316
|
return PlaceRouter;
|
|
4174
4317
|
}(pectin.GarbageCollector));
|
|
4175
4318
|
if (false) {
|
|
@@ -4283,18 +4426,45 @@
|
|
|
4283
4426
|
var _this = _super.call(this) || this;
|
|
4284
4427
|
_this.router = router;
|
|
4285
4428
|
_this.placeRouter = placeRouter;
|
|
4286
|
-
_this.parentOutlet = parentOutlet;
|
|
4287
4429
|
_this.animate = true;
|
|
4288
4430
|
_this.placeChanged = new core.EventEmitter();
|
|
4289
4431
|
_this._activePlace = new pectin.MutableValueModel();
|
|
4432
|
+
_this._placeVisit = new pectin.MutableValueModel();
|
|
4290
4433
|
_this._inOutletUpdate = new pectin.Guard();
|
|
4291
4434
|
_this._activatedRouteModel = new pectin.MutableValueModel();
|
|
4292
4435
|
_this._placeDefinition = new pectin.MutableValueModel();
|
|
4293
|
-
|
|
4294
|
-
* TODO: This is now really a visit
|
|
4295
|
-
*/
|
|
4296
|
-
_this._placeVisit = new pectin.MutableValueModel();
|
|
4436
|
+
_this.isOnInitialPlace = true;
|
|
4297
4437
|
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
4438
|
+
_this.parentOutletModel = new pectin.MutableValueModel(parentOutlet);
|
|
4439
|
+
/** @type {?} */
|
|
4440
|
+
var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
|
|
4441
|
+
.pullValueModel((/**
|
|
4442
|
+
* @param {?} o
|
|
4443
|
+
* @return {?}
|
|
4444
|
+
*/
|
|
4445
|
+
function (o) { return o.activePlaceModel; }))
|
|
4446
|
+
.pluck("placeDefinition")
|
|
4447
|
+
.pluckList("children")
|
|
4448
|
+
.pluck("component");
|
|
4449
|
+
/** @type {?} */
|
|
4450
|
+
var activatePlaceType = chain(_this.activePlaceModel).map((/**
|
|
4451
|
+
* @param {?} p
|
|
4452
|
+
* @return {?}
|
|
4453
|
+
*/
|
|
4454
|
+
function (p) { return (/** @type {?} */ (p.constructor)); }));
|
|
4455
|
+
_this.placeAnimationOrder = chain(_this.customPlaceAnimationOrderModel)
|
|
4456
|
+
.otherwise(defaultPlaceAnimationOrder)
|
|
4457
|
+
.indexOf(activatePlaceType)
|
|
4458
|
+
.map((/**
|
|
4459
|
+
* @param {?} order
|
|
4460
|
+
* @return {?}
|
|
4461
|
+
*/
|
|
4462
|
+
function (order) {
|
|
4463
|
+
// we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0
|
|
4464
|
+
// if we're animating.
|
|
4465
|
+
return _this.isOnInitialPlace ? 0 :
|
|
4466
|
+
_this.animate ? Math.max(order, 0) : 0;
|
|
4467
|
+
}));
|
|
4298
4468
|
// Push incoming changes into the component
|
|
4299
4469
|
/** @type {?} */
|
|
4300
4470
|
var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
|
|
@@ -4358,6 +4528,16 @@
|
|
|
4358
4528
|
relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null
|
|
4359
4529
|
});
|
|
4360
4530
|
};
|
|
4531
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "parentOutlet", {
|
|
4532
|
+
get: /**
|
|
4533
|
+
* @return {?}
|
|
4534
|
+
*/
|
|
4535
|
+
function () {
|
|
4536
|
+
return this.parentOutletModel.value;
|
|
4537
|
+
},
|
|
4538
|
+
enumerable: true,
|
|
4539
|
+
configurable: true
|
|
4540
|
+
});
|
|
4361
4541
|
/**
|
|
4362
4542
|
* @param {?} next
|
|
4363
4543
|
* @param {?} previous
|
|
@@ -4393,12 +4573,16 @@
|
|
|
4393
4573
|
enumerable: true,
|
|
4394
4574
|
configurable: true
|
|
4395
4575
|
});
|
|
4576
|
+
// @Trace()
|
|
4577
|
+
// @Trace()
|
|
4396
4578
|
/**
|
|
4397
4579
|
* @param {?} routerOutlet
|
|
4398
4580
|
* @param {?} place
|
|
4399
4581
|
* @return {?}
|
|
4400
4582
|
*/
|
|
4401
|
-
PlaceOutletComponent.prototype.onOutletActivated =
|
|
4583
|
+
PlaceOutletComponent.prototype.onOutletActivated =
|
|
4584
|
+
// @Trace()
|
|
4585
|
+
/**
|
|
4402
4586
|
* @param {?} routerOutlet
|
|
4403
4587
|
* @param {?} place
|
|
4404
4588
|
* @return {?}
|
|
@@ -4424,12 +4608,16 @@
|
|
|
4424
4608
|
this.animationDone();
|
|
4425
4609
|
}
|
|
4426
4610
|
};
|
|
4611
|
+
// @Trace()
|
|
4612
|
+
// @Trace()
|
|
4427
4613
|
/**
|
|
4428
4614
|
* @param {?} routerOutlet
|
|
4429
4615
|
* @param {?} $event
|
|
4430
4616
|
* @return {?}
|
|
4431
4617
|
*/
|
|
4432
|
-
PlaceOutletComponent.prototype.onOutletDeactivated =
|
|
4618
|
+
PlaceOutletComponent.prototype.onOutletDeactivated =
|
|
4619
|
+
// @Trace()
|
|
4620
|
+
/**
|
|
4433
4621
|
* @param {?} routerOutlet
|
|
4434
4622
|
* @param {?} $event
|
|
4435
4623
|
* @return {?}
|
|
@@ -4440,116 +4628,287 @@
|
|
|
4440
4628
|
* @return {?}
|
|
4441
4629
|
*/
|
|
4442
4630
|
function () {
|
|
4631
|
+
_this.isOnInitialPlace = false;
|
|
4443
4632
|
_this._activePlace.value = null;
|
|
4444
4633
|
_this._activatedRouteModel.value = null;
|
|
4445
4634
|
_this._placeDefinition.value = null;
|
|
4446
4635
|
}));
|
|
4447
4636
|
};
|
|
4448
4637
|
/**
|
|
4449
|
-
* @param {?} outlet
|
|
4450
4638
|
* @return {?}
|
|
4451
4639
|
*/
|
|
4452
|
-
PlaceOutletComponent.prototype.
|
|
4453
|
-
* @
|
|
4640
|
+
PlaceOutletComponent.prototype.animationDone = /**
|
|
4641
|
+
* @return {?}
|
|
4642
|
+
*/
|
|
4643
|
+
function () {
|
|
4644
|
+
if (this._activePlace.value) {
|
|
4645
|
+
this._activePlace.value.onPlaceReady();
|
|
4646
|
+
}
|
|
4647
|
+
};
|
|
4648
|
+
PlaceOutletComponent.decorators = [
|
|
4649
|
+
{ type: core.Component, args: [{
|
|
4650
|
+
selector: 'aup-place-outlet',
|
|
4651
|
+
template: "<div class=\"router-outlet-container\"\n [@routeAnimations]=\"placeAnimationOrder.value\"\n (@routeAnimations.done)=\"animationDone()\"\n>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated(routerOutlet, $event)\">\n </router-outlet>\n</div>\n\n",
|
|
4652
|
+
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
4653
|
+
styles: [":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
|
|
4654
|
+
}] }
|
|
4655
|
+
];
|
|
4656
|
+
/** @nocollapse */
|
|
4657
|
+
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4658
|
+
{ type: router.Router },
|
|
4659
|
+
{ type: PlaceRouter },
|
|
4660
|
+
{ type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
|
|
4661
|
+
]; };
|
|
4662
|
+
PlaceOutletComponent.propDecorators = {
|
|
4663
|
+
animate: [{ type: core.Input }],
|
|
4664
|
+
customPlaceAnimationOrderModel: [{ type: core.Input, args: ['placeAnimationOrderModel',] }],
|
|
4665
|
+
customPlaceAnimationOrder: [{ type: core.Input, args: ['placeAnimationOrder',] }],
|
|
4666
|
+
placeChanged: [{ type: core.Output }],
|
|
4667
|
+
routerOut: [{ type: core.ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
4668
|
+
};
|
|
4669
|
+
__decorate([
|
|
4670
|
+
pectin.UseDelegate(),
|
|
4671
|
+
__metadata("design:type", pectin.ListModel)
|
|
4672
|
+
], PlaceOutletComponent.prototype, "customPlaceAnimationOrderModel", void 0);
|
|
4673
|
+
__decorate([
|
|
4674
|
+
pectin.StoreInListModel("customPlaceAnimationOrderModel"),
|
|
4675
|
+
__metadata("design:type", Array)
|
|
4676
|
+
], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
|
|
4677
|
+
__decorate([
|
|
4678
|
+
pectin.Trace(),
|
|
4679
|
+
__metadata("design:type", Function),
|
|
4680
|
+
__metadata("design:paramtypes", [Visit]),
|
|
4681
|
+
__metadata("design:returntype", void 0)
|
|
4682
|
+
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4683
|
+
return PlaceOutletComponent;
|
|
4684
|
+
}(DisposableComponent));
|
|
4685
|
+
if (false) {
|
|
4686
|
+
/** @type {?} */
|
|
4687
|
+
PlaceOutletComponent.prototype.animate;
|
|
4688
|
+
/** @type {?} */
|
|
4689
|
+
PlaceOutletComponent.prototype.customPlaceAnimationOrderModel;
|
|
4690
|
+
/** @type {?} */
|
|
4691
|
+
PlaceOutletComponent.prototype.customPlaceAnimationOrder;
|
|
4692
|
+
/** @type {?} */
|
|
4693
|
+
PlaceOutletComponent.prototype.placeChanged;
|
|
4694
|
+
/** @type {?} */
|
|
4695
|
+
PlaceOutletComponent.prototype.routerOut;
|
|
4696
|
+
/**
|
|
4697
|
+
* @type {?}
|
|
4698
|
+
* @private
|
|
4699
|
+
*/
|
|
4700
|
+
PlaceOutletComponent.prototype._activePlace;
|
|
4701
|
+
/**
|
|
4702
|
+
* @type {?}
|
|
4703
|
+
* @private
|
|
4704
|
+
*/
|
|
4705
|
+
PlaceOutletComponent.prototype._placeVisit;
|
|
4706
|
+
/**
|
|
4707
|
+
* @type {?}
|
|
4708
|
+
* @private
|
|
4709
|
+
*/
|
|
4710
|
+
PlaceOutletComponent.prototype._inOutletUpdate;
|
|
4711
|
+
/**
|
|
4712
|
+
* @type {?}
|
|
4713
|
+
* @private
|
|
4714
|
+
*/
|
|
4715
|
+
PlaceOutletComponent.prototype._activatedRouteModel;
|
|
4716
|
+
/**
|
|
4717
|
+
* @type {?}
|
|
4718
|
+
* @private
|
|
4719
|
+
*/
|
|
4720
|
+
PlaceOutletComponent.prototype._placeDefinition;
|
|
4721
|
+
/**
|
|
4722
|
+
* @type {?}
|
|
4723
|
+
* @private
|
|
4724
|
+
*/
|
|
4725
|
+
PlaceOutletComponent.prototype.parentOutletModel;
|
|
4726
|
+
/** @type {?} */
|
|
4727
|
+
PlaceOutletComponent.prototype.placeAnimationOrder;
|
|
4728
|
+
/**
|
|
4729
|
+
* @type {?}
|
|
4730
|
+
* @private
|
|
4731
|
+
*/
|
|
4732
|
+
PlaceOutletComponent.prototype.isOnInitialPlace;
|
|
4733
|
+
/**
|
|
4734
|
+
* @type {?}
|
|
4735
|
+
* @private
|
|
4736
|
+
*/
|
|
4737
|
+
PlaceOutletComponent.prototype.router;
|
|
4738
|
+
/**
|
|
4739
|
+
* @type {?}
|
|
4740
|
+
* @private
|
|
4741
|
+
*/
|
|
4742
|
+
PlaceOutletComponent.prototype.placeRouter;
|
|
4743
|
+
}
|
|
4744
|
+
|
|
4745
|
+
/**
|
|
4746
|
+
* @fileoverview added by tsickle
|
|
4747
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4748
|
+
*/
|
|
4749
|
+
var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
4750
|
+
__extends(AbstractPlaceNavigationComponent, _super);
|
|
4751
|
+
function AbstractPlaceNavigationComponent() {
|
|
4752
|
+
var _this = _super.call(this) || this;
|
|
4753
|
+
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
4754
|
+
_this.placeDefinitions = chain(_this.placesModel).map((/**
|
|
4755
|
+
* @param {?} c
|
|
4756
|
+
* @return {?}
|
|
4757
|
+
*/
|
|
4758
|
+
function (c) { return exports.PlaceComponent.getDefinition(c); }));
|
|
4759
|
+
_this.relativeToModel = chain(_this.placeOutletModel).pullValueModel((/**
|
|
4760
|
+
* @param {?} o
|
|
4761
|
+
* @return {?}
|
|
4762
|
+
*/
|
|
4763
|
+
function (o) { return o.activatedRouteModel; }));
|
|
4764
|
+
_this.commandFactory = pectin.Command.createFactory((/**
|
|
4765
|
+
* @param {?} placeDefinition
|
|
4766
|
+
* @return {?}
|
|
4767
|
+
*/
|
|
4768
|
+
function (placeDefinition) {
|
|
4769
|
+
_this.placeOutlet.navigate(new Visit(placeDefinition));
|
|
4770
|
+
}));
|
|
4771
|
+
return _this;
|
|
4772
|
+
}
|
|
4773
|
+
/**
|
|
4774
|
+
* @param {?} placeDef
|
|
4775
|
+
* @return {?}
|
|
4776
|
+
*/
|
|
4777
|
+
AbstractPlaceNavigationComponent.prototype.getNav = /**
|
|
4778
|
+
* @param {?} placeDef
|
|
4454
4779
|
* @return {?}
|
|
4455
4780
|
*/
|
|
4456
|
-
function (
|
|
4457
|
-
|
|
4781
|
+
function (placeDef) {
|
|
4782
|
+
/** @type {?} */
|
|
4783
|
+
var navItem = (/** @type {?} */ (placeDef.getPlaceData('nav')));
|
|
4784
|
+
return {
|
|
4785
|
+
title: (/**
|
|
4786
|
+
* @return {?}
|
|
4787
|
+
*/
|
|
4788
|
+
function () { return navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']); }),
|
|
4789
|
+
tooltip: (/**
|
|
4790
|
+
* @return {?}
|
|
4791
|
+
*/
|
|
4792
|
+
function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null); }),
|
|
4793
|
+
icon: (/**
|
|
4794
|
+
* @return {?}
|
|
4795
|
+
*/
|
|
4796
|
+
function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null); })
|
|
4797
|
+
};
|
|
4458
4798
|
};
|
|
4459
4799
|
/**
|
|
4460
4800
|
* @return {?}
|
|
4461
4801
|
*/
|
|
4462
|
-
|
|
4802
|
+
AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
4463
4803
|
* @return {?}
|
|
4464
4804
|
*/
|
|
4465
4805
|
function () {
|
|
4466
|
-
if (this._activePlace.value) {
|
|
4467
|
-
this._activePlace.value.onPlaceReady();
|
|
4468
|
-
}
|
|
4469
4806
|
};
|
|
4470
|
-
|
|
4471
|
-
{ type: core.
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
styles: [":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0}router-outlet{display:none}"]
|
|
4476
|
-
}] }
|
|
4477
|
-
];
|
|
4478
|
-
/** @nocollapse */
|
|
4479
|
-
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4480
|
-
{ type: router.Router },
|
|
4481
|
-
{ type: PlaceRouter },
|
|
4482
|
-
{ type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
|
|
4483
|
-
]; };
|
|
4484
|
-
PlaceOutletComponent.propDecorators = {
|
|
4485
|
-
animate: [{ type: core.Input }],
|
|
4486
|
-
placeChanged: [{ type: core.Output }],
|
|
4487
|
-
routerOut: [{ type: core.ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
4807
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
4808
|
+
places: [{ type: core.Input }],
|
|
4809
|
+
placesModel: [{ type: core.Input }],
|
|
4810
|
+
placeOutlet: [{ type: core.Input }],
|
|
4811
|
+
placeOutletModel: [{ type: core.Input }]
|
|
4488
4812
|
};
|
|
4489
4813
|
__decorate([
|
|
4490
|
-
pectin.
|
|
4491
|
-
__metadata("design:type",
|
|
4492
|
-
|
|
4493
|
-
__metadata("design:returntype", void 0)
|
|
4494
|
-
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4814
|
+
pectin.StoreInListModel('placesModel'),
|
|
4815
|
+
__metadata("design:type", Array)
|
|
4816
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
4495
4817
|
__decorate([
|
|
4496
|
-
pectin.
|
|
4497
|
-
__metadata("design:type",
|
|
4498
|
-
|
|
4499
|
-
__metadata("design:returntype", void 0)
|
|
4500
|
-
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
4818
|
+
pectin.UseDelegate(),
|
|
4819
|
+
__metadata("design:type", pectin.ListModel)
|
|
4820
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
4501
4821
|
__decorate([
|
|
4502
|
-
pectin.
|
|
4822
|
+
pectin.StoreInValueModel('placeOutletModel'),
|
|
4823
|
+
__metadata("design:type", PlaceOutletComponent)
|
|
4824
|
+
], AbstractPlaceNavigationComponent.prototype, "placeOutlet", void 0);
|
|
4825
|
+
__decorate([
|
|
4826
|
+
pectin.UseDelegate(),
|
|
4827
|
+
__metadata("design:type", pectin.ValueModel)
|
|
4828
|
+
], AbstractPlaceNavigationComponent.prototype, "placeOutletModel", void 0);
|
|
4829
|
+
__decorate([
|
|
4830
|
+
src.Memoize(),
|
|
4503
4831
|
__metadata("design:type", Function),
|
|
4504
|
-
__metadata("design:paramtypes", [
|
|
4505
|
-
__metadata("design:returntype",
|
|
4506
|
-
],
|
|
4507
|
-
return
|
|
4832
|
+
__metadata("design:paramtypes", [exports.PlaceDefinition]),
|
|
4833
|
+
__metadata("design:returntype", Object)
|
|
4834
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
4835
|
+
return AbstractPlaceNavigationComponent;
|
|
4508
4836
|
}(DisposableComponent));
|
|
4509
4837
|
if (false) {
|
|
4510
4838
|
/** @type {?} */
|
|
4511
|
-
|
|
4839
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
4512
4840
|
/** @type {?} */
|
|
4513
|
-
|
|
4841
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
4514
4842
|
/** @type {?} */
|
|
4515
|
-
|
|
4843
|
+
AbstractPlaceNavigationComponent.prototype.placeOutlet;
|
|
4844
|
+
/** @type {?} */
|
|
4845
|
+
AbstractPlaceNavigationComponent.prototype.placeOutletModel;
|
|
4846
|
+
/** @type {?} */
|
|
4847
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
4516
4848
|
/**
|
|
4517
4849
|
* @type {?}
|
|
4518
|
-
* @
|
|
4850
|
+
* @protected
|
|
4519
4851
|
*/
|
|
4520
|
-
|
|
4852
|
+
AbstractPlaceNavigationComponent.prototype.relativeToModel;
|
|
4853
|
+
/** @type {?} */
|
|
4854
|
+
AbstractPlaceNavigationComponent.prototype.commandFactory;
|
|
4855
|
+
}
|
|
4856
|
+
|
|
4857
|
+
/**
|
|
4858
|
+
* @fileoverview added by tsickle
|
|
4859
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4860
|
+
*/
|
|
4861
|
+
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
4862
|
+
__extends(ListPlaceNavComponent, _super);
|
|
4863
|
+
function ListPlaceNavComponent() {
|
|
4864
|
+
var _this = _super.call(this) || this;
|
|
4865
|
+
_this.expanded = true;
|
|
4866
|
+
return _this;
|
|
4867
|
+
}
|
|
4521
4868
|
/**
|
|
4522
|
-
* @
|
|
4523
|
-
* @private
|
|
4869
|
+
* @return {?}
|
|
4524
4870
|
*/
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
* @type {?}
|
|
4528
|
-
* @private
|
|
4871
|
+
ListPlaceNavComponent.prototype.expandMenu = /**
|
|
4872
|
+
* @return {?}
|
|
4529
4873
|
*/
|
|
4530
|
-
|
|
4874
|
+
function () {
|
|
4875
|
+
this.expanded = true;
|
|
4876
|
+
};
|
|
4531
4877
|
/**
|
|
4532
|
-
* @
|
|
4533
|
-
* @private
|
|
4878
|
+
* @return {?}
|
|
4534
4879
|
*/
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
* TODO: This is now really a visit
|
|
4538
|
-
* @type {?}
|
|
4880
|
+
ListPlaceNavComponent.prototype.collapseMenu = /**
|
|
4881
|
+
* @return {?}
|
|
4539
4882
|
*/
|
|
4540
|
-
|
|
4883
|
+
function () {
|
|
4884
|
+
this.expanded = false;
|
|
4885
|
+
};
|
|
4541
4886
|
/**
|
|
4542
|
-
* @
|
|
4543
|
-
* @private
|
|
4887
|
+
* @return {?}
|
|
4544
4888
|
*/
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
* @type {?}
|
|
4548
|
-
* @private
|
|
4889
|
+
ListPlaceNavComponent.prototype.toggleMenu = /**
|
|
4890
|
+
* @return {?}
|
|
4549
4891
|
*/
|
|
4550
|
-
|
|
4892
|
+
function () {
|
|
4893
|
+
this.expanded = !this.expanded;
|
|
4894
|
+
};
|
|
4895
|
+
ListPlaceNavComponent.decorators = [
|
|
4896
|
+
{ type: core.Component, args: [{
|
|
4897
|
+
selector: 'aup-list-place-nav',
|
|
4898
|
+
template: "<mat-nav-list class=\"app-menu\">\n <a mat-list-item *ngFor=\"let place of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(place)\"\n routerLinkActive #rla=\"routerLinkActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span class=\"expanded-only\">{{getNav(place).title()}}</span>\n </a>\n</mat-nav-list>\n",
|
|
4899
|
+
styles: [":host{display:flex;flex-direction:column;--expanded-width:235px;--nav-item-width:var(--nav-bar-height);width:var(--nav-item-width);transition:width 125ms linear}:host.expanded{width:var(--expanded-width);max-width:var(--expanded-width)}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}.header{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;height:var(--nav-bar-height);border-bottom:var(--pinstripe-border);cursor:pointer}.header .menu{flex:1}.header button{color:inherit;width:var(--nav-item-width);height:var(--nav-bar-height)}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--nav-item-width);height:var(--nav-bar-height);color:inherit}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item mat-icon{margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}a[ng-reflect-router-link=manage-instruments] mat-icon{transform:rotate(90deg)}.app-menu{padding-top:0}"]
|
|
4900
|
+
}] }
|
|
4901
|
+
];
|
|
4902
|
+
/** @nocollapse */
|
|
4903
|
+
ListPlaceNavComponent.ctorParameters = function () { return []; };
|
|
4904
|
+
ListPlaceNavComponent.propDecorators = {
|
|
4905
|
+
expanded: [{ type: core.HostBinding, args: ['class.expanded',] }]
|
|
4906
|
+
};
|
|
4907
|
+
return ListPlaceNavComponent;
|
|
4908
|
+
}(AbstractPlaceNavigationComponent));
|
|
4909
|
+
if (false) {
|
|
4551
4910
|
/** @type {?} */
|
|
4552
|
-
|
|
4911
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
4553
4912
|
}
|
|
4554
4913
|
|
|
4555
4914
|
/**
|
|
@@ -4563,8 +4922,8 @@
|
|
|
4563
4922
|
}
|
|
4564
4923
|
TabbedPlaceNavigationComponent.decorators = [
|
|
4565
4924
|
{ type: core.Component, args: [{
|
|
4566
|
-
selector: '
|
|
4567
|
-
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [
|
|
4925
|
+
selector: 'aup-tabbed-place-navigation',
|
|
4926
|
+
template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let place of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(place)\"\n routerLinkActive #rla=\"routerLinkActive\"\n [active]=\"rla.isActive\"\n [matTooltip]=\"getNav(place).tooltip()\">\n <mat-icon *ngIf=\"getNav(place).icon()\">{{getNav(place).icon()}}</mat-icon>\n <span>{{getNav(place).title()}}</span>\n </a>\n</nav>\n",
|
|
4568
4927
|
styles: [""]
|
|
4569
4928
|
}] }
|
|
4570
4929
|
];
|
|
@@ -4590,7 +4949,8 @@
|
|
|
4590
4949
|
tabs.MatTabsModule,
|
|
4591
4950
|
list.MatListModule,
|
|
4592
4951
|
tooltip.MatTooltipModule,
|
|
4593
|
-
icon.MatIconModule
|
|
4952
|
+
icon.MatIconModule,
|
|
4953
|
+
DirectivesModule
|
|
4594
4954
|
],
|
|
4595
4955
|
declarations: [
|
|
4596
4956
|
EmptyStateComponent,
|
|
@@ -4622,15 +4982,7 @@
|
|
|
4622
4982
|
}
|
|
4623
4983
|
AngularUiPowerupsModule.decorators = [
|
|
4624
4984
|
{ type: core.NgModule, args: [{
|
|
4625
|
-
declarations: [
|
|
4626
|
-
CommandDirective,
|
|
4627
|
-
FocusBindingDirective,
|
|
4628
|
-
NumberInputComponent,
|
|
4629
|
-
StringInputComponent,
|
|
4630
|
-
PasswordInputComponent,
|
|
4631
|
-
SelectInputComponent,
|
|
4632
|
-
NoopComponent
|
|
4633
|
-
],
|
|
4985
|
+
declarations: [],
|
|
4634
4986
|
imports: [
|
|
4635
4987
|
common.CommonModule,
|
|
4636
4988
|
animations.BrowserAnimationsModule,
|
|
@@ -4639,18 +4991,16 @@
|
|
|
4639
4991
|
material.MatFormFieldModule,
|
|
4640
4992
|
material.MatSelectModule,
|
|
4641
4993
|
tabs.MatTabsModule,
|
|
4994
|
+
DirectivesModule,
|
|
4995
|
+
ComponentsModule,
|
|
4642
4996
|
PlaceModule,
|
|
4643
4997
|
InteractionModule
|
|
4644
4998
|
],
|
|
4645
4999
|
exports: [
|
|
4646
|
-
CommandDirective,
|
|
4647
|
-
FocusBindingDirective,
|
|
4648
|
-
NumberInputComponent,
|
|
4649
|
-
StringInputComponent,
|
|
4650
|
-
PasswordInputComponent,
|
|
4651
|
-
SelectInputComponent,
|
|
4652
5000
|
InteractionModule,
|
|
4653
5001
|
PlaceModule,
|
|
5002
|
+
DirectivesModule,
|
|
5003
|
+
ComponentsModule,
|
|
4654
5004
|
NoopComponent
|
|
4655
5005
|
]
|
|
4656
5006
|
},] }
|
|
@@ -5146,7 +5496,7 @@
|
|
|
5146
5496
|
*/
|
|
5147
5497
|
function (target) {
|
|
5148
5498
|
if (exports.PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
5149
|
-
exports.PlaceComponent.injectDefinition(target, new exports.PlaceDefinition(target, options.path, ___default.isNil(options.authenticate) ? false : options.authenticate, options.
|
|
5499
|
+
exports.PlaceComponent.injectDefinition(target, new exports.PlaceDefinition(target, options.path, ___default.isNil(options.authenticate) ? false : options.authenticate, options.data, exports.PlaceComponent.getRouteParameters(target), (options.children || []).map((/**
|
|
5150
5500
|
* @param {?} c
|
|
5151
5501
|
* @return {?}
|
|
5152
5502
|
*/
|
|
@@ -5166,8 +5516,6 @@
|
|
|
5166
5516
|
if (false) {
|
|
5167
5517
|
/** @type {?} */
|
|
5168
5518
|
Options.prototype.path;
|
|
5169
|
-
/** @type {?} */
|
|
5170
|
-
Options.prototype.order;
|
|
5171
5519
|
/** @type {?|undefined} */
|
|
5172
5520
|
Options.prototype.data;
|
|
5173
5521
|
/** @type {?|undefined} */
|
|
@@ -5468,221 +5816,82 @@
|
|
|
5468
5816
|
return __generator(this, function (_a) {
|
|
5469
5817
|
switch (_a.label) {
|
|
5470
5818
|
case 0:
|
|
5471
|
-
placeDef = visit.placeDefinition;
|
|
5472
|
-
if (!placeDef.hasRouteId()) return [3 /*break*/, 2];
|
|
5473
|
-
routeIdDef = placeDef.getRouteIdParameterDef();
|
|
5474
|
-
routeId = visit.getRouteId();
|
|
5475
|
-
return [4 /*yield*/, routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector)];
|
|
5476
|
-
case 1:
|
|
5477
|
-
sanitisedValue = _a.sent();
|
|
5478
|
-
console.log({ routeId: routeId, sanitisedValue: sanitisedValue });
|
|
5479
|
-
// ###------- EARLY EXIT --------###
|
|
5480
|
-
if (routeIdDef.hasChanged(routeId, sanitisedValue)) {
|
|
5481
|
-
// if the route id has changed we redirect immediately as other
|
|
5482
|
-
// parameter sanitisers might use it.
|
|
5483
|
-
return [2 /*return*/, visit.replace(routeIdDef, sanitisedValue)];
|
|
5484
|
-
}
|
|
5485
|
-
_a.label = 2;
|
|
5486
|
-
case 2:
|
|
5487
|
-
// if we didn't replace the routeId we continue the url present parameters.
|
|
5488
|
-
parameterDefs = placeDef.getVisitParameterDefs({
|
|
5489
|
-
includeRouteParameters: true,
|
|
5490
|
-
includeNonRouteParameters: true
|
|
5491
|
-
});
|
|
5492
|
-
sanitisedVisit = visit;
|
|
5493
|
-
i = 0;
|
|
5494
|
-
_a.label = 3;
|
|
5495
|
-
case 3:
|
|
5496
|
-
if (!(i < parameterDefs.length)) return [3 /*break*/, 6];
|
|
5497
|
-
def = parameterDefs[i];
|
|
5498
|
-
value = visit.getParameter(def.name);
|
|
5499
|
-
return [4 /*yield*/, def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector)];
|
|
5500
|
-
case 4:
|
|
5501
|
-
sanitisedValue = _a.sent();
|
|
5502
|
-
if (def.hasChanged(value, sanitisedValue)) {
|
|
5503
|
-
sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);
|
|
5504
|
-
}
|
|
5505
|
-
_a.label = 5;
|
|
5506
|
-
case 5:
|
|
5507
|
-
i++;
|
|
5508
|
-
return [3 /*break*/, 3];
|
|
5509
|
-
case 6: return [2 /*return*/, sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit];
|
|
5510
|
-
}
|
|
5511
|
-
});
|
|
5512
|
-
});
|
|
5513
|
-
};
|
|
5514
|
-
return VisitSanitiser;
|
|
5515
|
-
}());
|
|
5516
|
-
if (false) {
|
|
5517
|
-
/**
|
|
5518
|
-
* @type {?}
|
|
5519
|
-
* @private
|
|
5520
|
-
*/
|
|
5521
|
-
VisitSanitiser.prototype.activatedRoute;
|
|
5522
|
-
/**
|
|
5523
|
-
* @type {?}
|
|
5524
|
-
* @private
|
|
5525
|
-
*/
|
|
5526
|
-
VisitSanitiser.prototype.router;
|
|
5527
|
-
/**
|
|
5528
|
-
* @type {?}
|
|
5529
|
-
* @private
|
|
5530
|
-
*/
|
|
5531
|
-
VisitSanitiser.prototype.placeHistory;
|
|
5532
|
-
/**
|
|
5533
|
-
* @type {?}
|
|
5534
|
-
* @private
|
|
5535
|
-
*/
|
|
5536
|
-
VisitSanitiser.prototype.injector;
|
|
5537
|
-
}
|
|
5538
|
-
|
|
5539
|
-
/**
|
|
5540
|
-
* @fileoverview added by tsickle
|
|
5541
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5542
|
-
*/
|
|
5543
|
-
var LeavePlaceGuard = /** @class */ (function () {
|
|
5544
|
-
function LeavePlaceGuard(router, injector, placeRouter, interactionContext, angularLocation) {
|
|
5545
|
-
this.router = router;
|
|
5546
|
-
this.injector = injector;
|
|
5547
|
-
this.placeRouter = placeRouter;
|
|
5548
|
-
this.interactionContext = interactionContext;
|
|
5549
|
-
this.angularLocation = angularLocation;
|
|
5550
|
-
}
|
|
5551
|
-
/**
|
|
5552
|
-
* @private
|
|
5553
|
-
* @param {?} nextState
|
|
5554
|
-
* @param {?} placeDefinitionPath
|
|
5555
|
-
* @return {?}
|
|
5556
|
-
*/
|
|
5557
|
-
LeavePlaceGuard.prototype.isLeavingTheCurrentPlace = /**
|
|
5558
|
-
* @private
|
|
5559
|
-
* @param {?} nextState
|
|
5560
|
-
* @param {?} placeDefinitionPath
|
|
5561
|
-
* @return {?}
|
|
5562
|
-
*/
|
|
5563
|
-
function (nextState, placeDefinitionPath) {
|
|
5564
|
-
// TODO: this will break with child routes... need to examine the router states properly.
|
|
5565
|
-
return !nextState.url.startsWith(placeDefinitionPath);
|
|
5566
|
-
};
|
|
5567
|
-
/**
|
|
5568
|
-
* @param {?} component
|
|
5569
|
-
* @param {?} currentRoute
|
|
5570
|
-
* @param {?} currentState
|
|
5571
|
-
* @param {?=} nextState
|
|
5572
|
-
* @return {?}
|
|
5573
|
-
*/
|
|
5574
|
-
LeavePlaceGuard.prototype.canDeactivate = /**
|
|
5575
|
-
* @param {?} component
|
|
5576
|
-
* @param {?} currentRoute
|
|
5577
|
-
* @param {?} currentState
|
|
5578
|
-
* @param {?=} nextState
|
|
5579
|
-
* @return {?}
|
|
5580
|
-
*/
|
|
5581
|
-
function (component, currentRoute, currentState, nextState) {
|
|
5582
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5583
|
-
var placeDefinitionPath, self_1, canLeave;
|
|
5584
|
-
return __generator(this, function (_a) {
|
|
5585
|
-
switch (_a.label) {
|
|
5586
|
-
case 0:
|
|
5587
|
-
placeDefinitionPath = "/" + component.placeDefinition.path;
|
|
5588
|
-
if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
|
|
5589
|
-
// We'll get called multiple times if there's any parameter sanitisation so
|
|
5590
|
-
// we always return true if we accepted on a previous cycle of the current
|
|
5591
|
-
// navigation session.
|
|
5592
|
-
return [2 /*return*/, true];
|
|
5819
|
+
placeDef = visit.placeDefinition;
|
|
5820
|
+
if (!placeDef.hasRouteId()) return [3 /*break*/, 2];
|
|
5821
|
+
routeIdDef = placeDef.getRouteIdParameterDef();
|
|
5822
|
+
routeId = visit.getRouteId();
|
|
5823
|
+
return [4 /*yield*/, routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector)];
|
|
5593
5824
|
case 1:
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
canLeave = false;
|
|
5602
|
-
console.log('cancelling', { activity: this.interactionContext.currentActivity });
|
|
5603
|
-
this.interactionContext.currentActivity.cancel(null);
|
|
5825
|
+
sanitisedValue = _a.sent();
|
|
5826
|
+
console.log({ routeId: routeId, sanitisedValue: sanitisedValue });
|
|
5827
|
+
// ###------- EARLY EXIT --------###
|
|
5828
|
+
if (routeIdDef.hasChanged(routeId, sanitisedValue)) {
|
|
5829
|
+
// if the route id has changed we redirect immediately as other
|
|
5830
|
+
// parameter sanitisers might use it.
|
|
5831
|
+
return [2 /*return*/, visit.replace(routeIdDef, sanitisedValue)];
|
|
5604
5832
|
}
|
|
5605
|
-
|
|
5606
|
-
return [4 /*yield*/, component.canDeactivate()];
|
|
5833
|
+
_a.label = 2;
|
|
5607
5834
|
case 2:
|
|
5608
|
-
//
|
|
5609
|
-
|
|
5835
|
+
// if we didn't replace the routeId we continue the url present parameters.
|
|
5836
|
+
parameterDefs = placeDef.getVisitParameterDefs({
|
|
5837
|
+
includeRouteParameters: true,
|
|
5838
|
+
includeNonRouteParameters: true
|
|
5839
|
+
});
|
|
5840
|
+
sanitisedVisit = visit;
|
|
5841
|
+
i = 0;
|
|
5610
5842
|
_a.label = 3;
|
|
5611
|
-
case 3:
|
|
5843
|
+
case 3:
|
|
5844
|
+
if (!(i < parameterDefs.length)) return [3 /*break*/, 6];
|
|
5845
|
+
def = parameterDefs[i];
|
|
5846
|
+
value = visit.getParameter(def.name);
|
|
5847
|
+
return [4 /*yield*/, def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector)];
|
|
5612
5848
|
case 4:
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
canLeave = false;
|
|
5617
|
-
}
|
|
5618
|
-
else {
|
|
5619
|
-
canLeave = true;
|
|
5849
|
+
sanitisedValue = _a.sent();
|
|
5850
|
+
if (def.hasChanged(value, sanitisedValue)) {
|
|
5851
|
+
sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);
|
|
5620
5852
|
}
|
|
5621
5853
|
_a.label = 5;
|
|
5622
5854
|
case 5:
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
|
|
5627
|
-
}
|
|
5628
|
-
else {
|
|
5629
|
-
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
5630
|
-
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
5631
|
-
if (this.placeRouter.navigationSession.isPopState) {
|
|
5632
|
-
console.log('cancelled during popstate');
|
|
5633
|
-
this.angularLocation.go(this.placeRouter.navigationSession.popStateReturnUrl);
|
|
5634
|
-
}
|
|
5635
|
-
}
|
|
5636
|
-
return [2 /*return*/, canLeave];
|
|
5855
|
+
i++;
|
|
5856
|
+
return [3 /*break*/, 3];
|
|
5857
|
+
case 6: return [2 /*return*/, sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit];
|
|
5637
5858
|
}
|
|
5638
5859
|
});
|
|
5639
5860
|
});
|
|
5640
5861
|
};
|
|
5641
|
-
|
|
5642
|
-
{ type: core.Injectable, args: [{
|
|
5643
|
-
providedIn: 'root'
|
|
5644
|
-
},] }
|
|
5645
|
-
];
|
|
5646
|
-
/** @nocollapse */
|
|
5647
|
-
LeavePlaceGuard.ctorParameters = function () { return [
|
|
5648
|
-
{ type: router.Router },
|
|
5649
|
-
{ type: core.Injector },
|
|
5650
|
-
{ type: PlaceRouter },
|
|
5651
|
-
{ type: InteractionContext },
|
|
5652
|
-
{ type: common.Location }
|
|
5653
|
-
]; };
|
|
5654
|
-
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(PlaceRouter), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
|
|
5655
|
-
return LeavePlaceGuard;
|
|
5862
|
+
return VisitSanitiser;
|
|
5656
5863
|
}());
|
|
5657
5864
|
if (false) {
|
|
5658
5865
|
/**
|
|
5659
5866
|
* @type {?}
|
|
5660
5867
|
* @private
|
|
5661
5868
|
*/
|
|
5662
|
-
|
|
5869
|
+
VisitSanitiser.prototype.activatedRoute;
|
|
5663
5870
|
/**
|
|
5664
5871
|
* @type {?}
|
|
5665
5872
|
* @private
|
|
5666
5873
|
*/
|
|
5667
|
-
|
|
5874
|
+
VisitSanitiser.prototype.router;
|
|
5668
5875
|
/**
|
|
5669
5876
|
* @type {?}
|
|
5670
5877
|
* @private
|
|
5671
5878
|
*/
|
|
5672
|
-
|
|
5673
|
-
/**
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5879
|
+
VisitSanitiser.prototype.placeHistory;
|
|
5880
|
+
/**
|
|
5881
|
+
* @type {?}
|
|
5882
|
+
* @private
|
|
5883
|
+
*/
|
|
5884
|
+
VisitSanitiser.prototype.injector;
|
|
5677
5885
|
}
|
|
5678
5886
|
|
|
5679
5887
|
/**
|
|
5680
5888
|
* @fileoverview added by tsickle
|
|
5681
5889
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5682
5890
|
*/
|
|
5683
|
-
exports.
|
|
5684
|
-
function
|
|
5891
|
+
exports.EnterPlaceGuard = /** @class */ (function () {
|
|
5892
|
+
function EnterPlaceGuard(router, urlSerializer, placeRouter, placeHistory, injector) {
|
|
5685
5893
|
this.router = router;
|
|
5894
|
+
this.urlSerializer = urlSerializer;
|
|
5686
5895
|
this.placeRouter = placeRouter;
|
|
5687
5896
|
this.placeHistory = placeHistory;
|
|
5688
5897
|
this.injector = injector;
|
|
@@ -5694,7 +5903,7 @@
|
|
|
5694
5903
|
* @param {?} state
|
|
5695
5904
|
* @return {?}
|
|
5696
5905
|
*/
|
|
5697
|
-
|
|
5906
|
+
EnterPlaceGuard.prototype.canActivate =
|
|
5698
5907
|
// @Trace()
|
|
5699
5908
|
/**
|
|
5700
5909
|
* @param {?} activatedRoute
|
|
@@ -5703,14 +5912,14 @@
|
|
|
5703
5912
|
*/
|
|
5704
5913
|
function (activatedRoute, state) {
|
|
5705
5914
|
return __awaiter(this, void 0, void 0, function () {
|
|
5706
|
-
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit,
|
|
5915
|
+
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, routerStateUrlTree, commands;
|
|
5707
5916
|
return __generator(this, function (_a) {
|
|
5708
5917
|
switch (_a.label) {
|
|
5709
5918
|
case 0:
|
|
5710
5919
|
if (!exports.PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) return [3 /*break*/, 2];
|
|
5711
5920
|
placeDefinition = exports.PlaceComponent.getDefinition(activatedRoute.component);
|
|
5712
5921
|
// Parse our route params.
|
|
5713
|
-
params = new
|
|
5922
|
+
params = new EnterPlaceGuard.ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
|
|
5714
5923
|
parsedParams = placeDefinition.parseRouteParams(params);
|
|
5715
5924
|
initialVisit = this.placeRouter.navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
|
|
5716
5925
|
sanitiser = new VisitSanitiser(activatedRoute, this.router, this.placeHistory, this.injector);
|
|
@@ -5720,11 +5929,10 @@
|
|
|
5720
5929
|
// Save the visit with any updated parameters. We need to save it so we remember any non route parameters
|
|
5721
5930
|
this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
|
|
5722
5931
|
if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
console.log('##### Redirect', commands);
|
|
5932
|
+
routerStateUrlTree = this.urlSerializer.parse(state.url);
|
|
5933
|
+
// Regenerate the url
|
|
5934
|
+
commands = this.createRedirectCommands(sanitisedVisit, __spread(routerStateUrlTree.root.children.primary.segments)).commands;
|
|
5935
|
+
console.log('##### Place Guard Redirect', commands);
|
|
5728
5936
|
return [2 /*return*/, this.router.createUrlTree(commands, {
|
|
5729
5937
|
replaceUrl: true,
|
|
5730
5938
|
skipLocationChange: false
|
|
@@ -5740,44 +5948,90 @@
|
|
|
5740
5948
|
});
|
|
5741
5949
|
});
|
|
5742
5950
|
};
|
|
5743
|
-
|
|
5951
|
+
/**
|
|
5952
|
+
* @private
|
|
5953
|
+
* @param {?} sanitisedVisit
|
|
5954
|
+
* @param {?} path
|
|
5955
|
+
* @return {?}
|
|
5956
|
+
*/
|
|
5957
|
+
EnterPlaceGuard.prototype.createRedirectCommands = /**
|
|
5958
|
+
* @private
|
|
5959
|
+
* @param {?} sanitisedVisit
|
|
5960
|
+
* @param {?} path
|
|
5961
|
+
* @return {?}
|
|
5962
|
+
*/
|
|
5963
|
+
function (sanitisedVisit, path) {
|
|
5964
|
+
// Ugly, but it works for now.
|
|
5965
|
+
/** @type {?} */
|
|
5966
|
+
var newSegments = sanitisedVisit.getUrlSegments();
|
|
5967
|
+
/** @type {?} */
|
|
5968
|
+
var replaceAt = path.findIndex((/**
|
|
5969
|
+
* @param {?} segment
|
|
5970
|
+
* @return {?}
|
|
5971
|
+
*/
|
|
5972
|
+
function (segment) { return segment.path === newSegments[0].path; }));
|
|
5973
|
+
/** @type {?} */
|
|
5974
|
+
var newPath = __spread(path);
|
|
5975
|
+
newPath.splice.apply(newPath, __spread([replaceAt, newSegments.length], newSegments)); // do not use the return value, it's the items that were removed!
|
|
5976
|
+
// do not use the return value, it's the items that were removed!
|
|
5977
|
+
/** @type {?} */
|
|
5978
|
+
var commands = [];
|
|
5979
|
+
newPath.forEach((/**
|
|
5980
|
+
* @param {?} s
|
|
5981
|
+
* @return {?}
|
|
5982
|
+
*/
|
|
5983
|
+
function (s) {
|
|
5984
|
+
commands.push(s.path);
|
|
5985
|
+
if (s.parameterMap.keys.length > 0) {
|
|
5986
|
+
commands.push(s.parameters);
|
|
5987
|
+
}
|
|
5988
|
+
}));
|
|
5989
|
+
return { newPath: newPath, commands: commands };
|
|
5990
|
+
};
|
|
5991
|
+
EnterPlaceGuard.decorators = [
|
|
5744
5992
|
{ type: core.Injectable, args: [{
|
|
5745
5993
|
providedIn: 'root'
|
|
5746
5994
|
},] }
|
|
5747
5995
|
];
|
|
5748
5996
|
/** @nocollapse */
|
|
5749
|
-
|
|
5997
|
+
EnterPlaceGuard.ctorParameters = function () { return [
|
|
5750
5998
|
{ type: router.Router },
|
|
5999
|
+
{ type: router.UrlSerializer },
|
|
5751
6000
|
{ type: PlaceRouter },
|
|
5752
6001
|
{ type: PlaceHistory },
|
|
5753
6002
|
{ type: core.Injector }
|
|
5754
6003
|
]; };
|
|
5755
|
-
/** @nocollapse */
|
|
5756
|
-
return
|
|
6004
|
+
/** @nocollapse */ EnterPlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function EnterPlaceGuard_Factory() { return new EnterPlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(router.UrlSerializer), core.ɵɵinject(PlaceRouter), core.ɵɵinject(PlaceHistory), core.ɵɵinject(core.INJECTOR)); }, token: EnterPlaceGuard, providedIn: "root" });
|
|
6005
|
+
return EnterPlaceGuard;
|
|
5757
6006
|
}());
|
|
5758
6007
|
if (false) {
|
|
5759
6008
|
/**
|
|
5760
6009
|
* @type {?}
|
|
5761
6010
|
* @private
|
|
5762
6011
|
*/
|
|
5763
|
-
exports.
|
|
6012
|
+
exports.EnterPlaceGuard.prototype.router;
|
|
6013
|
+
/**
|
|
6014
|
+
* @type {?}
|
|
6015
|
+
* @private
|
|
6016
|
+
*/
|
|
6017
|
+
exports.EnterPlaceGuard.prototype.urlSerializer;
|
|
5764
6018
|
/**
|
|
5765
6019
|
* @type {?}
|
|
5766
6020
|
* @private
|
|
5767
6021
|
*/
|
|
5768
|
-
exports.
|
|
6022
|
+
exports.EnterPlaceGuard.prototype.placeRouter;
|
|
5769
6023
|
/**
|
|
5770
6024
|
* @type {?}
|
|
5771
6025
|
* @private
|
|
5772
6026
|
*/
|
|
5773
|
-
exports.
|
|
6027
|
+
exports.EnterPlaceGuard.prototype.placeHistory;
|
|
5774
6028
|
/**
|
|
5775
6029
|
* @type {?}
|
|
5776
6030
|
* @private
|
|
5777
6031
|
*/
|
|
5778
|
-
exports.
|
|
6032
|
+
exports.EnterPlaceGuard.prototype.injector;
|
|
5779
6033
|
}
|
|
5780
|
-
(function (
|
|
6034
|
+
(function (EnterPlaceGuard) {
|
|
5781
6035
|
/**
|
|
5782
6036
|
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
5783
6037
|
* include the segment params in the paramMap as well as each segment returns an empty
|
|
@@ -5866,7 +6120,7 @@
|
|
|
5866
6120
|
], ConsolidatedParameterMap.prototype, "keys", null);
|
|
5867
6121
|
return ConsolidatedParameterMap;
|
|
5868
6122
|
}());
|
|
5869
|
-
|
|
6123
|
+
EnterPlaceGuard.ConsolidatedParameterMap = ConsolidatedParameterMap;
|
|
5870
6124
|
if (false) {
|
|
5871
6125
|
/**
|
|
5872
6126
|
* @type {?}
|
|
@@ -5932,28 +6186,233 @@
|
|
|
5932
6186
|
*/
|
|
5933
6187
|
ParamMapAdapter.prototype.params;
|
|
5934
6188
|
}
|
|
5935
|
-
})(exports.
|
|
6189
|
+
})(exports.EnterPlaceGuard || (exports.EnterPlaceGuard = {}));
|
|
6190
|
+
|
|
6191
|
+
/**
|
|
6192
|
+
* @fileoverview added by tsickle
|
|
6193
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6194
|
+
*/
|
|
6195
|
+
var LeavePlaceGuard = /** @class */ (function () {
|
|
6196
|
+
function LeavePlaceGuard(router, injector, placeRouter, interactionContext, angularLocation) {
|
|
6197
|
+
this.router = router;
|
|
6198
|
+
this.injector = injector;
|
|
6199
|
+
this.placeRouter = placeRouter;
|
|
6200
|
+
this.interactionContext = interactionContext;
|
|
6201
|
+
this.angularLocation = angularLocation;
|
|
6202
|
+
}
|
|
6203
|
+
/**
|
|
6204
|
+
* @private
|
|
6205
|
+
* @param {?} nextState
|
|
6206
|
+
* @param {?} placeDefinition
|
|
6207
|
+
* @return {?}
|
|
6208
|
+
*/
|
|
6209
|
+
LeavePlaceGuard.prototype.isLeavingTheCurrentPlace = /**
|
|
6210
|
+
* @private
|
|
6211
|
+
* @param {?} nextState
|
|
6212
|
+
* @param {?} placeDefinition
|
|
6213
|
+
* @return {?}
|
|
6214
|
+
*/
|
|
6215
|
+
function (nextState, placeDefinition) {
|
|
6216
|
+
// TODO: this will break with child routes... need to examine the router states properly.
|
|
6217
|
+
// console.log('canDeactivate', {
|
|
6218
|
+
// staticPath: placeDefinitionPath,
|
|
6219
|
+
// currentStateUrl: currentState.url,
|
|
6220
|
+
// nextStateUrl: nextState.url
|
|
6221
|
+
// // alreadyDeclined: this._alreadyAccepted
|
|
6222
|
+
// });
|
|
6223
|
+
// Example of the above when navigating to a different child route.
|
|
6224
|
+
// canDeactivate {staticPath: "/hero-details",
|
|
6225
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-details",
|
|
6226
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats"
|
|
6227
|
+
// }
|
|
6228
|
+
// TODO: this will break with child routes... need to examine the router states properly.
|
|
6229
|
+
// console.log('canDeactivate', {
|
|
6230
|
+
// staticPath: placeDefinitionPath,
|
|
6231
|
+
// currentStateUrl: currentState.url,
|
|
6232
|
+
// nextStateUrl: nextState.url
|
|
6233
|
+
// // alreadyDeclined: this._alreadyAccepted
|
|
6234
|
+
// });
|
|
6235
|
+
// Example of the above when navigating to a different child route.
|
|
6236
|
+
// canDeactivate {staticPath: "/hero-details",
|
|
6237
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-details",
|
|
6238
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats"
|
|
6239
|
+
// }
|
|
6240
|
+
// Example clicking on router tab of the parent component (de-activates the parent due to route param changes)
|
|
6241
|
+
// canDeactivate {
|
|
6242
|
+
// staticPath: "/hero-stats",
|
|
6243
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6244
|
+
// nextStateUrl: "/route-parameters/"
|
|
6245
|
+
// }
|
|
6246
|
+
// canDeactivate {
|
|
6247
|
+
// staticPath: "/route-parameters",
|
|
6248
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6249
|
+
// nextStateUrl: "/route-parameters/"
|
|
6250
|
+
// }
|
|
6251
|
+
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: undefined, dl: Array(0), …}
|
|
6252
|
+
// parameter-snapshot.ts:20 {name: "idModel", mine: -1, theirs: null}
|
|
6253
|
+
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
6254
|
+
// canDeactivate {
|
|
6255
|
+
// staticPath: "/hero-stats",
|
|
6256
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6257
|
+
// nextStateUrl: "/route-parameters/-1"
|
|
6258
|
+
// }
|
|
6259
|
+
// canDeactivate {
|
|
6260
|
+
// staticPath: "/route-parameters",
|
|
6261
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6262
|
+
// nextStateUrl: "/route-parameters/-1"
|
|
6263
|
+
// }
|
|
6264
|
+
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: "A", dl: Array(3), …}
|
|
6265
|
+
// parameter-snapshot.ts:20 {name: "dv", mine: "A", theirs: undefined}
|
|
6266
|
+
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
6267
|
+
// canDeactivate {
|
|
6268
|
+
// staticPath: "/hero-stats",
|
|
6269
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6270
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c"
|
|
6271
|
+
// }
|
|
6272
|
+
/** @type {?} */
|
|
6273
|
+
var placeDefinitionPath = "/" + placeDefinition.path;
|
|
6274
|
+
return !nextState.url.startsWith(placeDefinitionPath);
|
|
6275
|
+
};
|
|
6276
|
+
/**
|
|
6277
|
+
* @param {?} component
|
|
6278
|
+
* @param {?} currentRoute
|
|
6279
|
+
* @param {?} currentState
|
|
6280
|
+
* @param {?=} nextState
|
|
6281
|
+
* @return {?}
|
|
6282
|
+
*/
|
|
6283
|
+
LeavePlaceGuard.prototype.canDeactivate = /**
|
|
6284
|
+
* @param {?} component
|
|
6285
|
+
* @param {?} currentRoute
|
|
6286
|
+
* @param {?} currentState
|
|
6287
|
+
* @param {?=} nextState
|
|
6288
|
+
* @return {?}
|
|
6289
|
+
*/
|
|
6290
|
+
function (component, currentRoute, currentState, nextState) {
|
|
6291
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6292
|
+
var self_1, canLeave;
|
|
6293
|
+
return __generator(this, function (_a) {
|
|
6294
|
+
switch (_a.label) {
|
|
6295
|
+
case 0:
|
|
6296
|
+
if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
|
|
6297
|
+
// We'll get called multiple times if there's any parameter sanitisation so
|
|
6298
|
+
// we always return true if we accepted on a previous cycle of the current
|
|
6299
|
+
// navigation session.
|
|
6300
|
+
return [2 /*return*/, true];
|
|
6301
|
+
case 1:
|
|
6302
|
+
self_1 = this;
|
|
6303
|
+
canLeave = true;
|
|
6304
|
+
if (!this.isLeavingTheCurrentPlace(nextState, component.placeDefinition)) return [3 /*break*/, 4];
|
|
6305
|
+
// we check the interaction first, so that components that don't need to check if they're in an
|
|
6306
|
+
// interaction during the canDeactivate cycle.
|
|
6307
|
+
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6308
|
+
if (component.interactionContext && component.interactionContext.isActive()) {
|
|
6309
|
+
canLeave = false;
|
|
6310
|
+
console.log('cancelling', { activity: component.interactionContext.currentActivity });
|
|
6311
|
+
component.interactionContext.currentActivity.cancel(null);
|
|
6312
|
+
}
|
|
6313
|
+
if (!canLeave) return [3 /*break*/, 3];
|
|
6314
|
+
return [4 /*yield*/, component.canDeactivate()];
|
|
6315
|
+
case 2:
|
|
6316
|
+
// TODO: Add tests: hit back -> confirm leave dialog -> hit back -> close dialog -> hit back -> confirm leave dialog.
|
|
6317
|
+
canLeave = _a.sent();
|
|
6318
|
+
_a.label = 3;
|
|
6319
|
+
case 3: return [3 /*break*/, 5];
|
|
6320
|
+
case 4:
|
|
6321
|
+
if (this.interactionContext.isActive()) {
|
|
6322
|
+
console.log('cancelling', { activity: this.interactionContext.currentActivity });
|
|
6323
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
6324
|
+
canLeave = false;
|
|
6325
|
+
}
|
|
6326
|
+
else {
|
|
6327
|
+
canLeave = true;
|
|
6328
|
+
}
|
|
6329
|
+
_a.label = 5;
|
|
6330
|
+
case 5:
|
|
6331
|
+
if (canLeave) {
|
|
6332
|
+
// We'll get called multiple times if there's any parameter sanitisation so
|
|
6333
|
+
// we remember the acceptance for the duration of the current navigation session.
|
|
6334
|
+
self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
|
|
6335
|
+
}
|
|
6336
|
+
else {
|
|
6337
|
+
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
6338
|
+
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
6339
|
+
if (this.placeRouter.navigationSession.isPopState) {
|
|
6340
|
+
console.log('cancelled during popstate');
|
|
6341
|
+
this.angularLocation.go(this.placeRouter.navigationSession.popStateReturnUrl);
|
|
6342
|
+
}
|
|
6343
|
+
}
|
|
6344
|
+
return [2 /*return*/, canLeave];
|
|
6345
|
+
}
|
|
6346
|
+
});
|
|
6347
|
+
});
|
|
6348
|
+
};
|
|
6349
|
+
LeavePlaceGuard.decorators = [
|
|
6350
|
+
{ type: core.Injectable, args: [{
|
|
6351
|
+
providedIn: 'root'
|
|
6352
|
+
},] }
|
|
6353
|
+
];
|
|
6354
|
+
/** @nocollapse */
|
|
6355
|
+
LeavePlaceGuard.ctorParameters = function () { return [
|
|
6356
|
+
{ type: router.Router },
|
|
6357
|
+
{ type: core.Injector },
|
|
6358
|
+
{ type: PlaceRouter },
|
|
6359
|
+
{ type: InteractionContext },
|
|
6360
|
+
{ type: common.Location }
|
|
6361
|
+
]; };
|
|
6362
|
+
/** @nocollapse */ LeavePlaceGuard.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LeavePlaceGuard_Factory() { return new LeavePlaceGuard(core.ɵɵinject(router.Router), core.ɵɵinject(core.INJECTOR), core.ɵɵinject(PlaceRouter), core.ɵɵinject(InteractionContext), core.ɵɵinject(common.Location)); }, token: LeavePlaceGuard, providedIn: "root" });
|
|
6363
|
+
__decorate([
|
|
6364
|
+
pectin.Trace(),
|
|
6365
|
+
__metadata("design:type", Function),
|
|
6366
|
+
__metadata("design:paramtypes", [router.RouterStateSnapshot, exports.PlaceDefinition]),
|
|
6367
|
+
__metadata("design:returntype", void 0)
|
|
6368
|
+
], LeavePlaceGuard.prototype, "isLeavingTheCurrentPlace", null);
|
|
6369
|
+
return LeavePlaceGuard;
|
|
6370
|
+
}());
|
|
6371
|
+
if (false) {
|
|
6372
|
+
/**
|
|
6373
|
+
* @type {?}
|
|
6374
|
+
* @private
|
|
6375
|
+
*/
|
|
6376
|
+
LeavePlaceGuard.prototype.router;
|
|
6377
|
+
/**
|
|
6378
|
+
* @type {?}
|
|
6379
|
+
* @private
|
|
6380
|
+
*/
|
|
6381
|
+
LeavePlaceGuard.prototype.injector;
|
|
6382
|
+
/**
|
|
6383
|
+
* @type {?}
|
|
6384
|
+
* @private
|
|
6385
|
+
*/
|
|
6386
|
+
LeavePlaceGuard.prototype.placeRouter;
|
|
6387
|
+
/** @type {?} */
|
|
6388
|
+
LeavePlaceGuard.prototype.interactionContext;
|
|
6389
|
+
/** @type {?} */
|
|
6390
|
+
LeavePlaceGuard.prototype.angularLocation;
|
|
6391
|
+
}
|
|
5936
6392
|
|
|
5937
6393
|
exports.ACTIVITY_DATA = ACTIVITY_DATA;
|
|
5938
6394
|
exports.AbstractActivity = AbstractActivity;
|
|
5939
6395
|
exports.AbstractInputComponent = AbstractInputComponent;
|
|
5940
6396
|
exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
|
|
5941
|
-
exports.Activity = exports.ɵ
|
|
6397
|
+
exports.Activity = exports.ɵbd;
|
|
5942
6398
|
exports.ActivityContainerComponent = ActivityContainerComponent;
|
|
5943
6399
|
exports.ActivityOutletComponent = ActivityOutletComponent;
|
|
5944
6400
|
exports.AlertDialogComponent = AlertDialogComponent;
|
|
5945
6401
|
exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
|
|
5946
6402
|
exports.BusyOverlayComponent = BusyOverlayComponent;
|
|
5947
6403
|
exports.CommandDirective = CommandDirective;
|
|
5948
|
-
exports.
|
|
6404
|
+
exports.ComponentsModule = ComponentsModule;
|
|
6405
|
+
exports.ConfirmThenDialogComponent = exports.ɵbf;
|
|
5949
6406
|
exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
|
|
5950
6407
|
exports.DEFINITION_META_DATA_KEY = DEFINITION_META_DATA_KEY;
|
|
5951
6408
|
exports.DIALOG_INTERACTION_SERVICE_DEFAULTS = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
5952
6409
|
exports.DialogInteractionService = DialogInteractionService;
|
|
5953
6410
|
exports.Dimension = Dimension;
|
|
6411
|
+
exports.DirectivesModule = DirectivesModule;
|
|
5954
6412
|
exports.DisposableComponent = DisposableComponent;
|
|
5955
6413
|
exports.EmptyStateComponent = EmptyStateComponent;
|
|
5956
6414
|
exports.FocusBindingDirective = FocusBindingDirective;
|
|
6415
|
+
exports.InplaceInteractionContextComponent = InplaceInteractionContextComponent;
|
|
5957
6416
|
exports.InteractionContext = InteractionContext;
|
|
5958
6417
|
exports.InteractionGuard = InteractionGuard;
|
|
5959
6418
|
exports.InteractionModule = InteractionModule;
|
|
@@ -5982,37 +6441,40 @@
|
|
|
5982
6441
|
exports.VisitSanitiser = VisitSanitiser;
|
|
5983
6442
|
exports.leftRightPlaceAnimation = leftRightPlaceAnimation;
|
|
5984
6443
|
exports.slideDownAndUpAnimation = slideDownAndUpAnimation;
|
|
5985
|
-
exports.ɵa =
|
|
5986
|
-
exports.ɵb =
|
|
5987
|
-
exports.ɵba =
|
|
5988
|
-
exports.ɵ
|
|
5989
|
-
exports.ɵ
|
|
5990
|
-
exports.ɵ
|
|
5991
|
-
exports.ɵbi =
|
|
5992
|
-
exports.ɵ
|
|
5993
|
-
exports.ɵ
|
|
5994
|
-
exports.ɵ
|
|
5995
|
-
exports.ɵ
|
|
5996
|
-
exports.ɵ
|
|
5997
|
-
exports.ɵ
|
|
5998
|
-
exports.ɵ
|
|
5999
|
-
exports.ɵ
|
|
6000
|
-
exports.ɵ
|
|
6001
|
-
exports.ɵ
|
|
6002
|
-
exports.ɵ
|
|
6003
|
-
exports.ɵ
|
|
6004
|
-
exports.ɵ
|
|
6005
|
-
exports.ɵ
|
|
6006
|
-
exports.ɵ
|
|
6007
|
-
exports.ɵ
|
|
6008
|
-
exports.ɵ
|
|
6009
|
-
exports.ɵ
|
|
6010
|
-
exports.ɵ
|
|
6011
|
-
exports.ɵ
|
|
6012
|
-
exports.ɵ
|
|
6013
|
-
exports.ɵ
|
|
6014
|
-
exports.ɵ
|
|
6015
|
-
exports.ɵ
|
|
6444
|
+
exports.ɵa = DirectivesModule;
|
|
6445
|
+
exports.ɵb = CommandDirective;
|
|
6446
|
+
exports.ɵba = ConfirmationDialogComponent;
|
|
6447
|
+
exports.ɵbb = AbstractActivity;
|
|
6448
|
+
exports.ɵbc = ACTIVITY_DATA;
|
|
6449
|
+
exports.ɵbg = AlertDialogComponent;
|
|
6450
|
+
exports.ɵbi = InteractionOutletComponent;
|
|
6451
|
+
exports.ɵbj = InplaceInteractionContextComponent;
|
|
6452
|
+
exports.ɵbk = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
6453
|
+
exports.ɵbl = DialogInteractionService;
|
|
6454
|
+
exports.ɵc = FocusBindingDirective;
|
|
6455
|
+
exports.ɵd = DisposableComponent;
|
|
6456
|
+
exports.ɵe = ComponentsModule;
|
|
6457
|
+
exports.ɵf = NumberInputComponent;
|
|
6458
|
+
exports.ɵg = AbstractInputComponent;
|
|
6459
|
+
exports.ɵh = StringInputComponent;
|
|
6460
|
+
exports.ɵi = PasswordInputComponent;
|
|
6461
|
+
exports.ɵj = SelectInputComponent;
|
|
6462
|
+
exports.ɵk = NoopComponent;
|
|
6463
|
+
exports.ɵl = PlaceModule;
|
|
6464
|
+
exports.ɵm = EmptyStateComponent;
|
|
6465
|
+
exports.ɵn = BusyOverlayComponent;
|
|
6466
|
+
exports.ɵo = PlaceOutletComponent;
|
|
6467
|
+
exports.ɵp = leftRightPlaceAnimation;
|
|
6468
|
+
exports.ɵq = LEFT_RIGHT_PLACE_ANIMATION;
|
|
6469
|
+
exports.ɵr = PlaceRouter;
|
|
6470
|
+
exports.ɵs = PlaceHistory;
|
|
6471
|
+
exports.ɵt = TabbedPlaceNavigationComponent;
|
|
6472
|
+
exports.ɵu = AbstractPlaceNavigationComponent;
|
|
6473
|
+
exports.ɵv = ListPlaceNavComponent;
|
|
6474
|
+
exports.ɵw = InteractionModule;
|
|
6475
|
+
exports.ɵx = ActivityContainerComponent;
|
|
6476
|
+
exports.ɵy = InteractionContext;
|
|
6477
|
+
exports.ɵz = ActivityOutletComponent;
|
|
6016
6478
|
|
|
6017
6479
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6018
6480
|
|