@coolon/angular-ui-powerups 0.0.72 → 0.0.74
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 +1482 -1230
- 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 +34 -32
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +34 -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 +3 -3
- 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/interaction-outlet/interaction-outlet.component.js +2 -2
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +3 -1
- 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 +61 -26
- 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-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 +70 -50
- package/esm2015/lib/place/visit.js +10 -1
- package/esm2015/public_api.js +4 -4
- package/esm5/coolon-angular-ui-powerups.js +34 -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 +3 -3
- 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/interaction-outlet/interaction-outlet.component.js +2 -2
- package/esm5/lib/interaction/services/dialog-interaction.service.js +3 -1
- 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 +69 -31
- 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-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 +72 -8
- package/esm5/lib/place/visit.js +13 -1
- package/esm5/public_api.js +4 -4
- package/fesm2015/coolon-angular-ui-powerups.js +1172 -990
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1440 -1192
- 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/place/components/abstract-place-navigation.component.d.ts +7 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +7 -5
- package/lib/place/index.d.ts +1 -1
- 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 +1 -1
- package/esm2015/lib/place/route/guards/place-route.guard.js +0 -243
- package/esm5/lib/place/route/guards/place-route.guard.js +0 -273
|
@@ -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
|
-
/**
|
|
464
|
-
* @return {?}
|
|
465
|
-
*/
|
|
466
|
-
NumberInputComponent.prototype.ngOnInit = /**
|
|
467
|
-
* @return {?}
|
|
468
|
-
*/
|
|
469
|
-
function () {
|
|
470
|
-
};
|
|
471
|
-
NumberInputComponent.decorators = [
|
|
472
|
-
{ type: core.Component, args: [{
|
|
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
|
-
}
|
|
492
448
|
/**
|
|
449
|
+
* @private
|
|
493
450
|
* @return {?}
|
|
494
451
|
*/
|
|
495
|
-
|
|
452
|
+
FocusBindingDirective.prototype.hasBinding = /**
|
|
453
|
+
* @private
|
|
496
454
|
* @return {?}
|
|
497
455
|
*/
|
|
498
456
|
function () {
|
|
457
|
+
return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
|
|
499
458
|
};
|
|
500
|
-
|
|
501
|
-
|
|
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
|
-
}
|
|
459
|
+
// Hook method for debugging via tracing.
|
|
460
|
+
// Hook method for debugging via tracing.
|
|
530
461
|
/**
|
|
531
462
|
* @return {?}
|
|
532
463
|
*/
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
*/
|
|
536
|
-
function () {
|
|
537
|
-
};
|
|
538
|
-
SelectInputComponent.decorators = [
|
|
539
|
-
{ type: core.Component, args: [{
|
|
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
|
-
}
|
|
464
|
+
FocusBindingDirective.prototype.alreadyHasFocus =
|
|
465
|
+
// Hook method for debugging via tracing.
|
|
583
466
|
/**
|
|
584
467
|
* @return {?}
|
|
585
468
|
*/
|
|
586
|
-
StringInputComponent.prototype.ngOnInit = /**
|
|
587
|
-
* @return {?}
|
|
588
|
-
*/
|
|
589
469
|
function () {
|
|
470
|
+
return this.isFocused(this.focusTarget);
|
|
590
471
|
};
|
|
591
|
-
|
|
592
|
-
|
|
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
|
-
});
|
|
472
|
+
// Hook method for debugging via tracing.
|
|
473
|
+
// Hook method for debugging via tracing.
|
|
655
474
|
/**
|
|
475
|
+
* @param {?} element
|
|
656
476
|
* @return {?}
|
|
657
477
|
*/
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
else {
|
|
669
|
-
if (this._commandParameterProvided) {
|
|
670
|
-
pectin.lang.illegalState('command parameters are only supported by UnaryCommands');
|
|
671
|
-
}
|
|
672
|
-
}
|
|
478
|
+
FocusBindingDirective.prototype.isFocused =
|
|
479
|
+
// Hook method for debugging via tracing.
|
|
480
|
+
/**
|
|
481
|
+
* @param {?} element
|
|
482
|
+
* @return {?}
|
|
483
|
+
*/
|
|
484
|
+
function (element) {
|
|
485
|
+
return this.document.activeElement === element;
|
|
673
486
|
};
|
|
674
487
|
/**
|
|
488
|
+
* @param {?=} retries
|
|
675
489
|
* @return {?}
|
|
676
490
|
*/
|
|
677
|
-
|
|
491
|
+
FocusBindingDirective.prototype.tryAndFocus = /**
|
|
492
|
+
* @param {?=} retries
|
|
678
493
|
* @return {?}
|
|
679
494
|
*/
|
|
680
|
-
function () {
|
|
495
|
+
function (retries) {
|
|
681
496
|
var _this = this;
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
* @param {?} enabled
|
|
687
|
-
* @return {?}
|
|
688
|
-
*/
|
|
689
|
-
function (enabled) {
|
|
690
|
-
if (enabled) {
|
|
691
|
-
_this.elementRef.nativeElement.removeAttribute('disabled');
|
|
692
|
-
if (_this.elementRef.nativeElement.tagName === 'A') {
|
|
693
|
-
_this.elementRef.nativeElement.setAttribute('href', 'javascript:void');
|
|
694
|
-
}
|
|
497
|
+
if (retries === void 0) { retries = 5; }
|
|
498
|
+
if (this.modelShouldStillHaveFocus() && this.canFocus()) {
|
|
499
|
+
if (!this.alreadyHasFocus()) {
|
|
500
|
+
this.focusTarget.focus();
|
|
695
501
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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.");
|
|
700
517
|
}
|
|
701
518
|
}
|
|
702
|
-
}
|
|
519
|
+
}
|
|
703
520
|
};
|
|
521
|
+
Object.defineProperty(FocusBindingDirective.prototype, "focusTarget", {
|
|
522
|
+
get: /**
|
|
523
|
+
* @return {?}
|
|
524
|
+
*/
|
|
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
|
-
* @
|
|
724
|
+
AbstractInputComponent.prototype.notifyEscapeKey = /**
|
|
725
|
+
* @return {?}
|
|
726
|
+
*/
|
|
727
|
+
function () {
|
|
728
|
+
this.safelyInvoke(this.escapeCommand);
|
|
729
|
+
this.escapeKey.emit();
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* @protected
|
|
733
|
+
* @param {?} command
|
|
734
|
+
* @return {?}
|
|
735
|
+
*/
|
|
736
|
+
AbstractInputComponent.prototype.safelyInvoke = /**
|
|
737
|
+
* @protected
|
|
738
|
+
* @param {?} command
|
|
848
739
|
* @return {?}
|
|
849
740
|
*/
|
|
850
|
-
function () {
|
|
851
|
-
|
|
741
|
+
function (command) {
|
|
742
|
+
if (command && command.enabled.value) {
|
|
743
|
+
command.execute();
|
|
744
|
+
}
|
|
852
745
|
};
|
|
853
|
-
// Hook method for debugging via tracing.
|
|
854
|
-
// Hook method for debugging via tracing.
|
|
855
746
|
/**
|
|
856
747
|
* @return {?}
|
|
857
748
|
*/
|
|
858
|
-
|
|
859
|
-
// Hook method for debugging via tracing.
|
|
860
|
-
/**
|
|
749
|
+
AbstractInputComponent.prototype.ngOnInit = /**
|
|
861
750
|
* @return {?}
|
|
862
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 */
|
|
@@ -1843,7 +1912,7 @@
|
|
|
1843
1912
|
* @return {?}
|
|
1844
1913
|
*/
|
|
1845
1914
|
function (confirm, activityType, data) {
|
|
1846
|
-
return this.startActivity(exports.ɵ
|
|
1915
|
+
return this.startActivity(exports.ɵbf, {
|
|
1847
1916
|
confirm: confirm,
|
|
1848
1917
|
activityType: activityType,
|
|
1849
1918
|
data: data
|
|
@@ -1972,8 +2041,8 @@
|
|
|
1972
2041
|
};
|
|
1973
2042
|
ActivityContainerComponent.decorators = [
|
|
1974
2043
|
{ type: core.Component, args: [{
|
|
1975
|
-
selector: '
|
|
1976
|
-
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <
|
|
2044
|
+
selector: 'aup-activity-container',
|
|
2045
|
+
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <aup-activity-outlet [interactionContext]=\"this\"\n [activityContext]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
|
|
1977
2046
|
styles: [":host{display:block}"]
|
|
1978
2047
|
}] }
|
|
1979
2048
|
];
|
|
@@ -2022,7 +2091,7 @@
|
|
|
2022
2091
|
}
|
|
2023
2092
|
InteractionOutletComponent.decorators = [
|
|
2024
2093
|
{ type: core.Component, args: [{
|
|
2025
|
-
selector: '
|
|
2094
|
+
selector: 'aup-interaction-outlet',
|
|
2026
2095
|
template: "<router-outlet name=\"interaction-context\"></router-outlet>\n",
|
|
2027
2096
|
styles: [":host{display:block}"]
|
|
2028
2097
|
}] }
|
|
@@ -2177,6 +2246,7 @@
|
|
|
2177
2246
|
* @return {?}
|
|
2178
2247
|
*/
|
|
2179
2248
|
function () {
|
|
2249
|
+
console.log("###### STARTING");
|
|
2180
2250
|
_this.currentActivityId = uuid.v1();
|
|
2181
2251
|
// this.location.go(this.router.routerState.snapshot.url, "aup");
|
|
2182
2252
|
/** @type {?} */
|
|
@@ -2233,6 +2303,7 @@
|
|
|
2233
2303
|
* @return {?}
|
|
2234
2304
|
*/
|
|
2235
2305
|
function () {
|
|
2306
|
+
console.log("###### FINISHED");
|
|
2236
2307
|
_this.currentActivityId = null;
|
|
2237
2308
|
self.safelyUpdateActivityListDelegate(null);
|
|
2238
2309
|
}));
|
|
@@ -2297,7 +2368,7 @@
|
|
|
2297
2368
|
* @return {?}
|
|
2298
2369
|
*/
|
|
2299
2370
|
function (confirm, activityType, data) {
|
|
2300
|
-
return this._startActivity(exports.ɵ
|
|
2371
|
+
return this._startActivity(exports.ɵbf, {
|
|
2301
2372
|
confirm: confirm,
|
|
2302
2373
|
activityType: activityType,
|
|
2303
2374
|
data: data
|
|
@@ -2370,7 +2441,7 @@
|
|
|
2370
2441
|
declarations: [
|
|
2371
2442
|
ActivityContainerComponent,
|
|
2372
2443
|
ConfirmationDialogComponent,
|
|
2373
|
-
exports.ɵ
|
|
2444
|
+
exports.ɵbf,
|
|
2374
2445
|
AlertDialogComponent,
|
|
2375
2446
|
ActivityOutletComponent,
|
|
2376
2447
|
InteractionOutletComponent
|
|
@@ -2383,7 +2454,7 @@
|
|
|
2383
2454
|
entryComponents: [
|
|
2384
2455
|
ActivityContainerComponent,
|
|
2385
2456
|
ConfirmationDialogComponent,
|
|
2386
|
-
exports.ɵ
|
|
2457
|
+
exports.ɵbf,
|
|
2387
2458
|
AlertDialogComponent
|
|
2388
2459
|
],
|
|
2389
2460
|
providers: [
|
|
@@ -2411,7 +2482,7 @@
|
|
|
2411
2482
|
};
|
|
2412
2483
|
BusyOverlayComponent.decorators = [
|
|
2413
2484
|
{ type: core.Component, args: [{
|
|
2414
|
-
selector: '
|
|
2485
|
+
selector: 'aup-busy-overlay',
|
|
2415
2486
|
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
2487
|
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
2488
|
}] }
|
|
@@ -2456,9 +2527,9 @@
|
|
|
2456
2527
|
};
|
|
2457
2528
|
EmptyStateComponent.decorators = [
|
|
2458
2529
|
{ type: core.Component, args: [{
|
|
2459
|
-
selector: '
|
|
2530
|
+
selector: 'aup-empty-state',
|
|
2460
2531
|
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(--
|
|
2532
|
+
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
2533
|
}] }
|
|
2463
2534
|
];
|
|
2464
2535
|
/** @nocollapse */
|
|
@@ -2773,11 +2844,10 @@
|
|
|
2773
2844
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2774
2845
|
*/
|
|
2775
2846
|
exports.PlaceDefinition = /** @class */ (function () {
|
|
2776
|
-
function PlaceDefinition(component, path, authenticate,
|
|
2847
|
+
function PlaceDefinition(component, path, authenticate, data, routeParameters, children) {
|
|
2777
2848
|
this.component = component;
|
|
2778
2849
|
this.path = path;
|
|
2779
2850
|
this.authenticate = authenticate;
|
|
2780
|
-
this.order = order;
|
|
2781
2851
|
this.data = data;
|
|
2782
2852
|
this.routeParameters = routeParameters;
|
|
2783
2853
|
this.children = children;
|
|
@@ -3083,8 +3153,6 @@
|
|
|
3083
3153
|
/** @type {?} */
|
|
3084
3154
|
exports.PlaceDefinition.prototype.authenticate;
|
|
3085
3155
|
/** @type {?} */
|
|
3086
|
-
exports.PlaceDefinition.prototype.order;
|
|
3087
|
-
/** @type {?} */
|
|
3088
3156
|
exports.PlaceDefinition.prototype.data;
|
|
3089
3157
|
/** @type {?} */
|
|
3090
3158
|
exports.PlaceDefinition.prototype.routeParameters;
|
|
@@ -3275,136 +3343,182 @@
|
|
|
3275
3343
|
* @fileoverview added by tsickle
|
|
3276
3344
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3277
3345
|
*/
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
function (c) { return exports.PlaceComponent.getDefinition(c); }));
|
|
3288
|
-
return _this;
|
|
3346
|
+
/**
|
|
3347
|
+
* @record
|
|
3348
|
+
*/
|
|
3349
|
+
function Params() { }
|
|
3350
|
+
var Visit = /** @class */ (function () {
|
|
3351
|
+
function Visit(placeDefinition, visitParameters) {
|
|
3352
|
+
if (visitParameters === void 0) { visitParameters = {}; }
|
|
3353
|
+
this.placeDefinition = placeDefinition;
|
|
3354
|
+
this.visitParameters = visitParameters;
|
|
3289
3355
|
}
|
|
3356
|
+
// @Trace()
|
|
3357
|
+
// @Trace()
|
|
3290
3358
|
/**
|
|
3291
|
-
* @param {?} placeDef
|
|
3292
3359
|
* @return {?}
|
|
3293
3360
|
*/
|
|
3294
|
-
|
|
3295
|
-
|
|
3361
|
+
Visit.prototype.getRouteId =
|
|
3362
|
+
// @Trace()
|
|
3363
|
+
/**
|
|
3296
3364
|
* @return {?}
|
|
3297
3365
|
*/
|
|
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
|
-
};
|
|
3366
|
+
function () {
|
|
3367
|
+
return this.placeDefinition.getRouteIdFrom(this);
|
|
3315
3368
|
};
|
|
3369
|
+
// @Trace()
|
|
3370
|
+
// @Trace()
|
|
3316
3371
|
/**
|
|
3317
3372
|
* @return {?}
|
|
3318
3373
|
*/
|
|
3319
|
-
|
|
3374
|
+
Visit.prototype.hasRouteId =
|
|
3375
|
+
// @Trace()
|
|
3376
|
+
/**
|
|
3320
3377
|
* @return {?}
|
|
3321
3378
|
*/
|
|
3322
3379
|
function () {
|
|
3380
|
+
return !___default.isNil(this.getRouteId());
|
|
3323
3381
|
};
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3382
|
+
/**
|
|
3383
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3384
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3385
|
+
* same as the the ValueModel property name.
|
|
3386
|
+
* @param parameterName the field name of the property model or the `as` option if specified.
|
|
3387
|
+
*/
|
|
3388
|
+
/**
|
|
3389
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3390
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3391
|
+
* same as the the ValueModel property name.
|
|
3392
|
+
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3393
|
+
* @return {?}
|
|
3394
|
+
*/
|
|
3395
|
+
Visit.prototype.getParameter = /**
|
|
3396
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
3397
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
3398
|
+
* same as the the ValueModel property name.
|
|
3399
|
+
* @param {?} parameterName the field name of the property model or the `as` option if specified.
|
|
3400
|
+
* @return {?}
|
|
3401
|
+
*/
|
|
3402
|
+
function (parameterName) {
|
|
3403
|
+
return this.visitParameters[parameterName];
|
|
3404
|
+
};
|
|
3405
|
+
// @Trace()
|
|
3406
|
+
// @Trace()
|
|
3407
|
+
/**
|
|
3408
|
+
* @param {?} parameterName
|
|
3409
|
+
* @return {?}
|
|
3410
|
+
*/
|
|
3411
|
+
Visit.prototype.hasParameter =
|
|
3412
|
+
// @Trace()
|
|
3413
|
+
/**
|
|
3414
|
+
* @param {?} parameterName
|
|
3415
|
+
* @return {?}
|
|
3416
|
+
*/
|
|
3417
|
+
function (parameterName) {
|
|
3418
|
+
return Object.keys(this.visitParameters).includes(parameterName);
|
|
3419
|
+
};
|
|
3420
|
+
/**
|
|
3421
|
+
* @template S
|
|
3422
|
+
* @param {?} parameter
|
|
3423
|
+
* @param {?} value
|
|
3424
|
+
* @return {?}
|
|
3425
|
+
*/
|
|
3426
|
+
Visit.prototype.replace = /**
|
|
3427
|
+
* @template S
|
|
3428
|
+
* @param {?} parameter
|
|
3429
|
+
* @param {?} value
|
|
3430
|
+
* @return {?}
|
|
3431
|
+
*/
|
|
3432
|
+
function (parameter, value) {
|
|
3433
|
+
var _a;
|
|
3434
|
+
return new Visit(this.placeDefinition, __assign({}, this.visitParameters, (_a = {}, _a[parameter.name] = value, _a)));
|
|
3435
|
+
};
|
|
3436
|
+
/**
|
|
3437
|
+
* @template S
|
|
3438
|
+
* @param {?} routeParams
|
|
3439
|
+
* @return {?}
|
|
3440
|
+
*/
|
|
3441
|
+
Visit.prototype.mergeRouteParameters = /**
|
|
3442
|
+
* @template S
|
|
3443
|
+
* @param {?} routeParams
|
|
3444
|
+
* @return {?}
|
|
3445
|
+
*/
|
|
3446
|
+
function (routeParams) {
|
|
3447
|
+
var _this = this;
|
|
3448
|
+
// todo: whitelist parameters.
|
|
3449
|
+
/** @type {?} */
|
|
3450
|
+
var routeParameterKeys = Object.keys(routeParams);
|
|
3451
|
+
/** @type {?} */
|
|
3452
|
+
var params = {};
|
|
3453
|
+
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
3454
|
+
* @param {?} def
|
|
3455
|
+
* @return {?}
|
|
3456
|
+
*/
|
|
3457
|
+
function (def) {
|
|
3458
|
+
if (def.isRouteId || def.isRouteParameter) {
|
|
3459
|
+
if (routeParameterKeys.includes(def.name)) {
|
|
3460
|
+
params[def.name] = routeParams[def.name];
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
else {
|
|
3464
|
+
// copy non route params as is, but only if they already exist otherwise we'll inject nil values and break the
|
|
3465
|
+
// defaults and remember sanitisation process.
|
|
3466
|
+
if (_this.hasParameter(def.name)) {
|
|
3467
|
+
params[def.name] = _this.getParameter(def.name);
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
}));
|
|
3471
|
+
return new Visit(this.placeDefinition, params);
|
|
3327
3472
|
};
|
|
3328
|
-
__decorate([
|
|
3329
|
-
pectin.StoreInListModel('placesModel'),
|
|
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
|
-
}
|
|
3364
3473
|
/**
|
|
3474
|
+
* @param {?} other
|
|
3365
3475
|
* @return {?}
|
|
3366
3476
|
*/
|
|
3367
|
-
|
|
3477
|
+
Visit.prototype.hasRoutingChangedFrom = /**
|
|
3478
|
+
* @param {?} other
|
|
3368
3479
|
* @return {?}
|
|
3369
3480
|
*/
|
|
3370
|
-
function () {
|
|
3371
|
-
|
|
3481
|
+
function (other) {
|
|
3482
|
+
/** @type {?} */
|
|
3483
|
+
var samePlace = other.placeDefinition === this.placeDefinition;
|
|
3484
|
+
/** @type {?} */
|
|
3485
|
+
var sameRouteParameters = ___default.isEqual(this.placeDefinition.getFormattedRouteParameters(this, true), this.placeDefinition.getFormattedRouteParameters(other, true));
|
|
3486
|
+
return !samePlace || !sameRouteParameters;
|
|
3372
3487
|
};
|
|
3373
3488
|
/**
|
|
3489
|
+
* @param {?} other
|
|
3374
3490
|
* @return {?}
|
|
3375
3491
|
*/
|
|
3376
|
-
|
|
3492
|
+
Visit.prototype.hasChangedFrom = /**
|
|
3493
|
+
* @param {?} other
|
|
3377
3494
|
* @return {?}
|
|
3378
3495
|
*/
|
|
3379
|
-
function () {
|
|
3380
|
-
|
|
3496
|
+
function (other) {
|
|
3497
|
+
/** @type {?} */
|
|
3498
|
+
var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
3499
|
+
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
3381
3500
|
};
|
|
3382
3501
|
/**
|
|
3383
3502
|
* @return {?}
|
|
3384
3503
|
*/
|
|
3385
|
-
|
|
3504
|
+
Visit.prototype.getUrlSegments = /**
|
|
3386
3505
|
* @return {?}
|
|
3387
3506
|
*/
|
|
3388
3507
|
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',] }]
|
|
3508
|
+
return this.placeDefinition.hasRouteId() ?
|
|
3509
|
+
[new router.UrlSegment(this.placeDefinition.path, {}), new router.UrlSegment(this.placeDefinition.getFormattedRouteId(this), this.placeDefinition.getFormattedRouteParameters(this))] :
|
|
3510
|
+
[new router.UrlSegment(this.placeDefinition.path, this.placeDefinition.getFormattedRouteParameters(this))];
|
|
3402
3511
|
};
|
|
3403
|
-
return
|
|
3404
|
-
}(
|
|
3512
|
+
return Visit;
|
|
3513
|
+
}());
|
|
3405
3514
|
if (false) {
|
|
3406
3515
|
/** @type {?} */
|
|
3407
|
-
|
|
3516
|
+
Visit.prototype.placeDefinition;
|
|
3517
|
+
/**
|
|
3518
|
+
* @type {?}
|
|
3519
|
+
* @private
|
|
3520
|
+
*/
|
|
3521
|
+
Visit.prototype.visitParameters;
|
|
3408
3522
|
}
|
|
3409
3523
|
|
|
3410
3524
|
/**
|
|
@@ -3615,243 +3729,72 @@
|
|
|
3615
3729
|
/**
|
|
3616
3730
|
* @param {?} state
|
|
3617
3731
|
* @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.
|
|
3732
|
+
*/
|
|
3733
|
+
function (state) {
|
|
3793
3734
|
/** @type {?} */
|
|
3794
|
-
var
|
|
3735
|
+
var history = this.getHistory(state.placeDefinition);
|
|
3795
3736
|
/** @type {?} */
|
|
3796
|
-
var
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
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);
|
|
3737
|
+
var previousState = ___default__default.last(history);
|
|
3738
|
+
if (!previousState || state.hasChangedFrom(previousState)) {
|
|
3739
|
+
history.unshift(state); // LIFO
|
|
3740
|
+
this.setHistory(state.placeDefinition, history.slice(0, 3)); // limit our history to 4 visits
|
|
3741
|
+
}
|
|
3816
3742
|
};
|
|
3817
3743
|
/**
|
|
3818
|
-
* @param {?}
|
|
3744
|
+
* @param {?} placeDef
|
|
3819
3745
|
* @return {?}
|
|
3820
3746
|
*/
|
|
3821
|
-
|
|
3822
|
-
* @param {?}
|
|
3747
|
+
PlaceHistory.prototype.getHistory = /**
|
|
3748
|
+
* @param {?} placeDef
|
|
3823
3749
|
* @return {?}
|
|
3824
3750
|
*/
|
|
3825
|
-
function (
|
|
3826
|
-
/** @type {?} */
|
|
3827
|
-
var samePlace = other.placeDefinition === this.placeDefinition;
|
|
3751
|
+
function (placeDef) {
|
|
3828
3752
|
/** @type {?} */
|
|
3829
|
-
var
|
|
3830
|
-
|
|
3753
|
+
var history = this._history.get(placeDef);
|
|
3754
|
+
if (!history) {
|
|
3755
|
+
history = [];
|
|
3756
|
+
this.setHistory(placeDef, history);
|
|
3757
|
+
}
|
|
3758
|
+
return history;
|
|
3831
3759
|
};
|
|
3832
3760
|
/**
|
|
3833
|
-
* @
|
|
3761
|
+
* @private
|
|
3762
|
+
* @param {?} placeDef
|
|
3763
|
+
* @param {?} history
|
|
3834
3764
|
* @return {?}
|
|
3835
3765
|
*/
|
|
3836
|
-
|
|
3837
|
-
* @
|
|
3766
|
+
PlaceHistory.prototype.setHistory = /**
|
|
3767
|
+
* @private
|
|
3768
|
+
* @param {?} placeDef
|
|
3769
|
+
* @param {?} history
|
|
3838
3770
|
* @return {?}
|
|
3839
3771
|
*/
|
|
3840
|
-
function (
|
|
3841
|
-
|
|
3842
|
-
var sameNonRouteParameters = ___default.isEqual(this.placeDefinition.getNonRouteParameters(this), this.placeDefinition.getNonRouteParameters(other));
|
|
3843
|
-
return !sameNonRouteParameters || this.hasRoutingChangedFrom(other);
|
|
3772
|
+
function (placeDef, history) {
|
|
3773
|
+
this._history.set(placeDef, history);
|
|
3844
3774
|
};
|
|
3845
|
-
|
|
3775
|
+
PlaceHistory.decorators = [
|
|
3776
|
+
{ type: core.Injectable, args: [{
|
|
3777
|
+
providedIn: 'root'
|
|
3778
|
+
},] }
|
|
3779
|
+
];
|
|
3780
|
+
/** @nocollapse */
|
|
3781
|
+
PlaceHistory.ctorParameters = function () { return [
|
|
3782
|
+
{ type: router.Router }
|
|
3783
|
+
]; };
|
|
3784
|
+
/** @nocollapse */ PlaceHistory.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PlaceHistory_Factory() { return new PlaceHistory(core.ɵɵinject(router.Router)); }, token: PlaceHistory, providedIn: "root" });
|
|
3785
|
+
return PlaceHistory;
|
|
3846
3786
|
}());
|
|
3847
3787
|
if (false) {
|
|
3848
|
-
/** @type {?} */
|
|
3849
|
-
Visit.prototype.placeDefinition;
|
|
3850
3788
|
/**
|
|
3851
3789
|
* @type {?}
|
|
3852
3790
|
* @private
|
|
3853
3791
|
*/
|
|
3854
|
-
|
|
3792
|
+
PlaceHistory.prototype._history;
|
|
3793
|
+
/**
|
|
3794
|
+
* @type {?}
|
|
3795
|
+
* @private
|
|
3796
|
+
*/
|
|
3797
|
+
PlaceHistory.prototype.router;
|
|
3855
3798
|
}
|
|
3856
3799
|
|
|
3857
3800
|
/**
|
|
@@ -3983,13 +3926,17 @@
|
|
|
3983
3926
|
});
|
|
3984
3927
|
});
|
|
3985
3928
|
};
|
|
3929
|
+
// @Trace()
|
|
3930
|
+
// @Trace()
|
|
3986
3931
|
/**
|
|
3987
3932
|
* @param {?} activatedRoute
|
|
3988
3933
|
* @param {?} previous
|
|
3989
3934
|
* @param {?} next
|
|
3990
3935
|
* @return {?}
|
|
3991
3936
|
*/
|
|
3992
|
-
PlaceRouter.prototype.pushVisitChangesToRoute =
|
|
3937
|
+
PlaceRouter.prototype.pushVisitChangesToRoute =
|
|
3938
|
+
// @Trace()
|
|
3939
|
+
/**
|
|
3993
3940
|
* @param {?} activatedRoute
|
|
3994
3941
|
* @param {?} previous
|
|
3995
3942
|
* @param {?} next
|
|
@@ -4009,13 +3956,16 @@
|
|
|
4009
3956
|
* @return {?}
|
|
4010
3957
|
*/
|
|
4011
3958
|
function (router) {
|
|
3959
|
+
// we have to to use the definition for route id as our redirection always includes
|
|
3960
|
+
// the id in the url segements (but leaves it blank when there's no id). I.e. in the
|
|
3961
|
+
// no id case we're doing the following redirect [<placePath>, ""] -> ["..", <id>]
|
|
4012
3962
|
/** @type {?} */
|
|
4013
3963
|
var relativePath = !!previous.placeDefinition.hasRouteId() ? '..' : '.';
|
|
4014
3964
|
/** @type {?} */
|
|
4015
3965
|
var commands = __spread([
|
|
4016
3966
|
relativePath
|
|
4017
3967
|
], _this.createRouteParameters(next), _this.extractChildPath(activatedRoute.snapshot));
|
|
4018
|
-
console.log('### Redirect', commands);
|
|
3968
|
+
console.log('### Push Changes to route Redirect', { commands: commands, relativeTo: activatedRoute.snapshot.url });
|
|
4019
3969
|
return router.navigate(commands, {
|
|
4020
3970
|
relativeTo: activatedRoute
|
|
4021
3971
|
});
|
|
@@ -4164,12 +4114,6 @@
|
|
|
4164
4114
|
__metadata("design:paramtypes", [Visit, Object]),
|
|
4165
4115
|
__metadata("design:returntype", Promise)
|
|
4166
4116
|
], 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
4117
|
return PlaceRouter;
|
|
4174
4118
|
}(pectin.GarbageCollector));
|
|
4175
4119
|
if (false) {
|
|
@@ -4283,18 +4227,40 @@
|
|
|
4283
4227
|
var _this = _super.call(this) || this;
|
|
4284
4228
|
_this.router = router;
|
|
4285
4229
|
_this.placeRouter = placeRouter;
|
|
4286
|
-
_this.parentOutlet = parentOutlet;
|
|
4287
4230
|
_this.animate = true;
|
|
4288
4231
|
_this.placeChanged = new core.EventEmitter();
|
|
4289
4232
|
_this._activePlace = new pectin.MutableValueModel();
|
|
4233
|
+
_this._placeVisit = new pectin.MutableValueModel();
|
|
4290
4234
|
_this._inOutletUpdate = new pectin.Guard();
|
|
4291
4235
|
_this._activatedRouteModel = new pectin.MutableValueModel();
|
|
4292
4236
|
_this._placeDefinition = new pectin.MutableValueModel();
|
|
4293
|
-
/**
|
|
4294
|
-
* TODO: This is now really a visit
|
|
4295
|
-
*/
|
|
4296
|
-
_this._placeVisit = new pectin.MutableValueModel();
|
|
4297
4237
|
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;
|
|
4238
|
+
_this.parentOutletModel = new pectin.MutableValueModel(parentOutlet);
|
|
4239
|
+
/** @type {?} */
|
|
4240
|
+
var defaultPlaceAnimationOrder = chain(_this.parentOutletModel)
|
|
4241
|
+
.pullValueModel((/**
|
|
4242
|
+
* @param {?} o
|
|
4243
|
+
* @return {?}
|
|
4244
|
+
*/
|
|
4245
|
+
function (o) { return o.activePlaceModel; }))
|
|
4246
|
+
.pluck("placeDefinition")
|
|
4247
|
+
.pluckList("children")
|
|
4248
|
+
.pluck("component");
|
|
4249
|
+
/** @type {?} */
|
|
4250
|
+
var activatePlaceType = chain(_this.activePlaceModel).map((/**
|
|
4251
|
+
* @param {?} p
|
|
4252
|
+
* @return {?}
|
|
4253
|
+
*/
|
|
4254
|
+
function (p) { return (/** @type {?} */ (p.constructor)); }));
|
|
4255
|
+
_this.placeAnimationOrder = chain(_this.customPlaceAnimationOrderModel)
|
|
4256
|
+
.otherwise(defaultPlaceAnimationOrder)
|
|
4257
|
+
.indexOf(activatePlaceType)
|
|
4258
|
+
.map((/**
|
|
4259
|
+
* @param {?} order
|
|
4260
|
+
* @return {?}
|
|
4261
|
+
*/
|
|
4262
|
+
function (order) { return Math.max(order, 0); })); // we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0.
|
|
4263
|
+
// we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0.
|
|
4298
4264
|
// Push incoming changes into the component
|
|
4299
4265
|
/** @type {?} */
|
|
4300
4266
|
var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
|
|
@@ -4358,6 +4324,16 @@
|
|
|
4358
4324
|
relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null
|
|
4359
4325
|
});
|
|
4360
4326
|
};
|
|
4327
|
+
Object.defineProperty(PlaceOutletComponent.prototype, "parentOutlet", {
|
|
4328
|
+
get: /**
|
|
4329
|
+
* @return {?}
|
|
4330
|
+
*/
|
|
4331
|
+
function () {
|
|
4332
|
+
return this.parentOutletModel.value;
|
|
4333
|
+
},
|
|
4334
|
+
enumerable: true,
|
|
4335
|
+
configurable: true
|
|
4336
|
+
});
|
|
4361
4337
|
/**
|
|
4362
4338
|
* @param {?} next
|
|
4363
4339
|
* @param {?} previous
|
|
@@ -4424,12 +4400,16 @@
|
|
|
4424
4400
|
this.animationDone();
|
|
4425
4401
|
}
|
|
4426
4402
|
};
|
|
4403
|
+
// @Trace()
|
|
4404
|
+
// @Trace()
|
|
4427
4405
|
/**
|
|
4428
4406
|
* @param {?} routerOutlet
|
|
4429
4407
|
* @param {?} $event
|
|
4430
4408
|
* @return {?}
|
|
4431
4409
|
*/
|
|
4432
|
-
PlaceOutletComponent.prototype.onOutletDeactivated =
|
|
4410
|
+
PlaceOutletComponent.prototype.onOutletDeactivated =
|
|
4411
|
+
// @Trace()
|
|
4412
|
+
/**
|
|
4433
4413
|
* @param {?} routerOutlet
|
|
4434
4414
|
* @param {?} $event
|
|
4435
4415
|
* @return {?}
|
|
@@ -4446,110 +4426,281 @@
|
|
|
4446
4426
|
}));
|
|
4447
4427
|
};
|
|
4448
4428
|
/**
|
|
4449
|
-
* @param {?} outlet
|
|
4450
4429
|
* @return {?}
|
|
4451
4430
|
*/
|
|
4452
|
-
PlaceOutletComponent.prototype.
|
|
4453
|
-
* @
|
|
4431
|
+
PlaceOutletComponent.prototype.animationDone = /**
|
|
4432
|
+
* @return {?}
|
|
4433
|
+
*/
|
|
4434
|
+
function () {
|
|
4435
|
+
if (this._activePlace.value) {
|
|
4436
|
+
this._activePlace.value.onPlaceReady();
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
PlaceOutletComponent.decorators = [
|
|
4440
|
+
{ type: core.Component, args: [{
|
|
4441
|
+
selector: 'aup-place-outlet',
|
|
4442
|
+
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",
|
|
4443
|
+
animations: [LEFT_RIGHT_PLACE_ANIMATION],
|
|
4444
|
+
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}"]
|
|
4445
|
+
}] }
|
|
4446
|
+
];
|
|
4447
|
+
/** @nocollapse */
|
|
4448
|
+
PlaceOutletComponent.ctorParameters = function () { return [
|
|
4449
|
+
{ type: router.Router },
|
|
4450
|
+
{ type: PlaceRouter },
|
|
4451
|
+
{ type: PlaceOutletComponent, decorators: [{ type: core.SkipSelf }, { type: core.Optional }] }
|
|
4452
|
+
]; };
|
|
4453
|
+
PlaceOutletComponent.propDecorators = {
|
|
4454
|
+
animate: [{ type: core.Input }],
|
|
4455
|
+
customPlaceAnimationOrderModel: [{ type: core.Input, args: ['placeAnimationOrderModel',] }],
|
|
4456
|
+
customPlaceAnimationOrder: [{ type: core.Input, args: ['placeAnimationOrder',] }],
|
|
4457
|
+
placeChanged: [{ type: core.Output }],
|
|
4458
|
+
routerOut: [{ type: core.ViewChild, args: ['routeOutlet', { static: true },] }]
|
|
4459
|
+
};
|
|
4460
|
+
__decorate([
|
|
4461
|
+
pectin.UseDelegate(),
|
|
4462
|
+
__metadata("design:type", pectin.ListModel)
|
|
4463
|
+
], PlaceOutletComponent.prototype, "customPlaceAnimationOrderModel", void 0);
|
|
4464
|
+
__decorate([
|
|
4465
|
+
pectin.StoreInListModel("customPlaceAnimationOrderModel"),
|
|
4466
|
+
__metadata("design:type", Array)
|
|
4467
|
+
], PlaceOutletComponent.prototype, "customPlaceAnimationOrder", void 0);
|
|
4468
|
+
__decorate([
|
|
4469
|
+
pectin.Trace(),
|
|
4470
|
+
__metadata("design:type", Function),
|
|
4471
|
+
__metadata("design:paramtypes", [Visit]),
|
|
4472
|
+
__metadata("design:returntype", void 0)
|
|
4473
|
+
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4474
|
+
__decorate([
|
|
4475
|
+
pectin.Trace(),
|
|
4476
|
+
__metadata("design:type", Function),
|
|
4477
|
+
__metadata("design:paramtypes", [router.RouterOutlet, exports.PlaceComponent]),
|
|
4478
|
+
__metadata("design:returntype", void 0)
|
|
4479
|
+
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
4480
|
+
return PlaceOutletComponent;
|
|
4481
|
+
}(DisposableComponent));
|
|
4482
|
+
if (false) {
|
|
4483
|
+
/** @type {?} */
|
|
4484
|
+
PlaceOutletComponent.prototype.animate;
|
|
4485
|
+
/** @type {?} */
|
|
4486
|
+
PlaceOutletComponent.prototype.customPlaceAnimationOrderModel;
|
|
4487
|
+
/** @type {?} */
|
|
4488
|
+
PlaceOutletComponent.prototype.customPlaceAnimationOrder;
|
|
4489
|
+
/** @type {?} */
|
|
4490
|
+
PlaceOutletComponent.prototype.placeChanged;
|
|
4491
|
+
/** @type {?} */
|
|
4492
|
+
PlaceOutletComponent.prototype.routerOut;
|
|
4493
|
+
/**
|
|
4494
|
+
* @type {?}
|
|
4495
|
+
* @private
|
|
4496
|
+
*/
|
|
4497
|
+
PlaceOutletComponent.prototype._activePlace;
|
|
4498
|
+
/**
|
|
4499
|
+
* @type {?}
|
|
4500
|
+
* @private
|
|
4501
|
+
*/
|
|
4502
|
+
PlaceOutletComponent.prototype._placeVisit;
|
|
4503
|
+
/**
|
|
4504
|
+
* @type {?}
|
|
4505
|
+
* @private
|
|
4506
|
+
*/
|
|
4507
|
+
PlaceOutletComponent.prototype._inOutletUpdate;
|
|
4508
|
+
/**
|
|
4509
|
+
* @type {?}
|
|
4510
|
+
* @private
|
|
4511
|
+
*/
|
|
4512
|
+
PlaceOutletComponent.prototype._activatedRouteModel;
|
|
4513
|
+
/**
|
|
4514
|
+
* @type {?}
|
|
4515
|
+
* @private
|
|
4516
|
+
*/
|
|
4517
|
+
PlaceOutletComponent.prototype._placeDefinition;
|
|
4518
|
+
/**
|
|
4519
|
+
* @type {?}
|
|
4520
|
+
* @private
|
|
4521
|
+
*/
|
|
4522
|
+
PlaceOutletComponent.prototype.parentOutletModel;
|
|
4523
|
+
/** @type {?} */
|
|
4524
|
+
PlaceOutletComponent.prototype.placeAnimationOrder;
|
|
4525
|
+
/**
|
|
4526
|
+
* @type {?}
|
|
4527
|
+
* @private
|
|
4528
|
+
*/
|
|
4529
|
+
PlaceOutletComponent.prototype.router;
|
|
4530
|
+
/**
|
|
4531
|
+
* @type {?}
|
|
4532
|
+
* @private
|
|
4533
|
+
*/
|
|
4534
|
+
PlaceOutletComponent.prototype.placeRouter;
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4537
|
+
/**
|
|
4538
|
+
* @fileoverview added by tsickle
|
|
4539
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4540
|
+
*/
|
|
4541
|
+
var AbstractPlaceNavigationComponent = /** @class */ (function (_super) {
|
|
4542
|
+
__extends(AbstractPlaceNavigationComponent, _super);
|
|
4543
|
+
function AbstractPlaceNavigationComponent() {
|
|
4544
|
+
var _this = _super.call(this) || this;
|
|
4545
|
+
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;
|
|
4546
|
+
_this.placeDefinitions = chain(_this.placesModel).map((/**
|
|
4547
|
+
* @param {?} c
|
|
4548
|
+
* @return {?}
|
|
4549
|
+
*/
|
|
4550
|
+
function (c) { return exports.PlaceComponent.getDefinition(c); }));
|
|
4551
|
+
_this.relativeToModel = chain(_this.placeOutletModel).pullValueModel((/**
|
|
4552
|
+
* @param {?} o
|
|
4553
|
+
* @return {?}
|
|
4554
|
+
*/
|
|
4555
|
+
function (o) { return o.activatedRouteModel; }));
|
|
4556
|
+
_this.commandFactory = pectin.Command.createFactory((/**
|
|
4557
|
+
* @param {?} placeDefinition
|
|
4558
|
+
* @return {?}
|
|
4559
|
+
*/
|
|
4560
|
+
function (placeDefinition) {
|
|
4561
|
+
_this.placeOutlet.navigate(new Visit(placeDefinition));
|
|
4562
|
+
}));
|
|
4563
|
+
return _this;
|
|
4564
|
+
}
|
|
4565
|
+
/**
|
|
4566
|
+
* @param {?} placeDef
|
|
4567
|
+
* @return {?}
|
|
4568
|
+
*/
|
|
4569
|
+
AbstractPlaceNavigationComponent.prototype.getNav = /**
|
|
4570
|
+
* @param {?} placeDef
|
|
4454
4571
|
* @return {?}
|
|
4455
4572
|
*/
|
|
4456
|
-
function (
|
|
4457
|
-
|
|
4573
|
+
function (placeDef) {
|
|
4574
|
+
/** @type {?} */
|
|
4575
|
+
var navItem = (/** @type {?} */ (placeDef.getPlaceData('nav')));
|
|
4576
|
+
return {
|
|
4577
|
+
title: (/**
|
|
4578
|
+
* @return {?}
|
|
4579
|
+
*/
|
|
4580
|
+
function () { return navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']); }),
|
|
4581
|
+
tooltip: (/**
|
|
4582
|
+
* @return {?}
|
|
4583
|
+
*/
|
|
4584
|
+
function () { return navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null); }),
|
|
4585
|
+
icon: (/**
|
|
4586
|
+
* @return {?}
|
|
4587
|
+
*/
|
|
4588
|
+
function () { return navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null); })
|
|
4589
|
+
};
|
|
4458
4590
|
};
|
|
4459
4591
|
/**
|
|
4460
4592
|
* @return {?}
|
|
4461
4593
|
*/
|
|
4462
|
-
|
|
4594
|
+
AbstractPlaceNavigationComponent.prototype.ngOnInit = /**
|
|
4463
4595
|
* @return {?}
|
|
4464
4596
|
*/
|
|
4465
4597
|
function () {
|
|
4466
|
-
if (this._activePlace.value) {
|
|
4467
|
-
this._activePlace.value.onPlaceReady();
|
|
4468
|
-
}
|
|
4469
4598
|
};
|
|
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 },] }]
|
|
4599
|
+
AbstractPlaceNavigationComponent.propDecorators = {
|
|
4600
|
+
places: [{ type: core.Input }],
|
|
4601
|
+
placesModel: [{ type: core.Input }],
|
|
4602
|
+
placeOutlet: [{ type: core.Input }],
|
|
4603
|
+
placeOutletModel: [{ type: core.Input }]
|
|
4488
4604
|
};
|
|
4489
4605
|
__decorate([
|
|
4490
|
-
pectin.
|
|
4491
|
-
__metadata("design:type",
|
|
4492
|
-
|
|
4493
|
-
__metadata("design:returntype", void 0)
|
|
4494
|
-
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4606
|
+
pectin.StoreInListModel('placesModel'),
|
|
4607
|
+
__metadata("design:type", Array)
|
|
4608
|
+
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
4495
4609
|
__decorate([
|
|
4496
|
-
pectin.
|
|
4497
|
-
__metadata("design:type",
|
|
4498
|
-
|
|
4499
|
-
__metadata("design:returntype", void 0)
|
|
4500
|
-
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
4610
|
+
pectin.UseDelegate(),
|
|
4611
|
+
__metadata("design:type", pectin.ListModel)
|
|
4612
|
+
], AbstractPlaceNavigationComponent.prototype, "placesModel", void 0);
|
|
4501
4613
|
__decorate([
|
|
4502
|
-
pectin.
|
|
4614
|
+
pectin.StoreInValueModel('placeOutletModel'),
|
|
4615
|
+
__metadata("design:type", PlaceOutletComponent)
|
|
4616
|
+
], AbstractPlaceNavigationComponent.prototype, "placeOutlet", void 0);
|
|
4617
|
+
__decorate([
|
|
4618
|
+
pectin.UseDelegate(),
|
|
4619
|
+
__metadata("design:type", pectin.ValueModel)
|
|
4620
|
+
], AbstractPlaceNavigationComponent.prototype, "placeOutletModel", void 0);
|
|
4621
|
+
__decorate([
|
|
4622
|
+
src.Memoize(),
|
|
4503
4623
|
__metadata("design:type", Function),
|
|
4504
|
-
__metadata("design:paramtypes", [
|
|
4505
|
-
__metadata("design:returntype",
|
|
4506
|
-
],
|
|
4507
|
-
return
|
|
4624
|
+
__metadata("design:paramtypes", [exports.PlaceDefinition]),
|
|
4625
|
+
__metadata("design:returntype", Object)
|
|
4626
|
+
], AbstractPlaceNavigationComponent.prototype, "getNav", null);
|
|
4627
|
+
return AbstractPlaceNavigationComponent;
|
|
4508
4628
|
}(DisposableComponent));
|
|
4509
4629
|
if (false) {
|
|
4510
4630
|
/** @type {?} */
|
|
4511
|
-
|
|
4631
|
+
AbstractPlaceNavigationComponent.prototype.places;
|
|
4512
4632
|
/** @type {?} */
|
|
4513
|
-
|
|
4633
|
+
AbstractPlaceNavigationComponent.prototype.placesModel;
|
|
4514
4634
|
/** @type {?} */
|
|
4515
|
-
|
|
4635
|
+
AbstractPlaceNavigationComponent.prototype.placeOutlet;
|
|
4636
|
+
/** @type {?} */
|
|
4637
|
+
AbstractPlaceNavigationComponent.prototype.placeOutletModel;
|
|
4638
|
+
/** @type {?} */
|
|
4639
|
+
AbstractPlaceNavigationComponent.prototype.placeDefinitions;
|
|
4516
4640
|
/**
|
|
4517
4641
|
* @type {?}
|
|
4518
|
-
* @
|
|
4642
|
+
* @protected
|
|
4519
4643
|
*/
|
|
4520
|
-
|
|
4644
|
+
AbstractPlaceNavigationComponent.prototype.relativeToModel;
|
|
4645
|
+
/** @type {?} */
|
|
4646
|
+
AbstractPlaceNavigationComponent.prototype.commandFactory;
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
/**
|
|
4650
|
+
* @fileoverview added by tsickle
|
|
4651
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4652
|
+
*/
|
|
4653
|
+
var ListPlaceNavComponent = /** @class */ (function (_super) {
|
|
4654
|
+
__extends(ListPlaceNavComponent, _super);
|
|
4655
|
+
function ListPlaceNavComponent() {
|
|
4656
|
+
var _this = _super.call(this) || this;
|
|
4657
|
+
_this.expanded = true;
|
|
4658
|
+
return _this;
|
|
4659
|
+
}
|
|
4521
4660
|
/**
|
|
4522
|
-
* @
|
|
4523
|
-
* @private
|
|
4661
|
+
* @return {?}
|
|
4524
4662
|
*/
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
* @type {?}
|
|
4528
|
-
* @private
|
|
4663
|
+
ListPlaceNavComponent.prototype.expandMenu = /**
|
|
4664
|
+
* @return {?}
|
|
4529
4665
|
*/
|
|
4530
|
-
|
|
4666
|
+
function () {
|
|
4667
|
+
this.expanded = true;
|
|
4668
|
+
};
|
|
4531
4669
|
/**
|
|
4532
|
-
* @
|
|
4533
|
-
* @private
|
|
4670
|
+
* @return {?}
|
|
4534
4671
|
*/
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
* TODO: This is now really a visit
|
|
4538
|
-
* @type {?}
|
|
4672
|
+
ListPlaceNavComponent.prototype.collapseMenu = /**
|
|
4673
|
+
* @return {?}
|
|
4539
4674
|
*/
|
|
4540
|
-
|
|
4675
|
+
function () {
|
|
4676
|
+
this.expanded = false;
|
|
4677
|
+
};
|
|
4541
4678
|
/**
|
|
4542
|
-
* @
|
|
4543
|
-
* @private
|
|
4679
|
+
* @return {?}
|
|
4544
4680
|
*/
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
* @type {?}
|
|
4548
|
-
* @private
|
|
4681
|
+
ListPlaceNavComponent.prototype.toggleMenu = /**
|
|
4682
|
+
* @return {?}
|
|
4549
4683
|
*/
|
|
4550
|
-
|
|
4684
|
+
function () {
|
|
4685
|
+
this.expanded = !this.expanded;
|
|
4686
|
+
};
|
|
4687
|
+
ListPlaceNavComponent.decorators = [
|
|
4688
|
+
{ type: core.Component, args: [{
|
|
4689
|
+
selector: 'aup-list-place-nav',
|
|
4690
|
+
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",
|
|
4691
|
+
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}"]
|
|
4692
|
+
}] }
|
|
4693
|
+
];
|
|
4694
|
+
/** @nocollapse */
|
|
4695
|
+
ListPlaceNavComponent.ctorParameters = function () { return []; };
|
|
4696
|
+
ListPlaceNavComponent.propDecorators = {
|
|
4697
|
+
expanded: [{ type: core.HostBinding, args: ['class.expanded',] }]
|
|
4698
|
+
};
|
|
4699
|
+
return ListPlaceNavComponent;
|
|
4700
|
+
}(AbstractPlaceNavigationComponent));
|
|
4701
|
+
if (false) {
|
|
4551
4702
|
/** @type {?} */
|
|
4552
|
-
|
|
4703
|
+
ListPlaceNavComponent.prototype.expanded;
|
|
4553
4704
|
}
|
|
4554
4705
|
|
|
4555
4706
|
/**
|
|
@@ -4563,8 +4714,8 @@
|
|
|
4563
4714
|
}
|
|
4564
4715
|
TabbedPlaceNavigationComponent.decorators = [
|
|
4565
4716
|
{ 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 [
|
|
4717
|
+
selector: 'aup-tabbed-place-navigation',
|
|
4718
|
+
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
4719
|
styles: [""]
|
|
4569
4720
|
}] }
|
|
4570
4721
|
];
|
|
@@ -4590,7 +4741,8 @@
|
|
|
4590
4741
|
tabs.MatTabsModule,
|
|
4591
4742
|
list.MatListModule,
|
|
4592
4743
|
tooltip.MatTooltipModule,
|
|
4593
|
-
icon.MatIconModule
|
|
4744
|
+
icon.MatIconModule,
|
|
4745
|
+
DirectivesModule
|
|
4594
4746
|
],
|
|
4595
4747
|
declarations: [
|
|
4596
4748
|
EmptyStateComponent,
|
|
@@ -4622,15 +4774,7 @@
|
|
|
4622
4774
|
}
|
|
4623
4775
|
AngularUiPowerupsModule.decorators = [
|
|
4624
4776
|
{ type: core.NgModule, args: [{
|
|
4625
|
-
declarations: [
|
|
4626
|
-
CommandDirective,
|
|
4627
|
-
FocusBindingDirective,
|
|
4628
|
-
NumberInputComponent,
|
|
4629
|
-
StringInputComponent,
|
|
4630
|
-
PasswordInputComponent,
|
|
4631
|
-
SelectInputComponent,
|
|
4632
|
-
NoopComponent
|
|
4633
|
-
],
|
|
4777
|
+
declarations: [],
|
|
4634
4778
|
imports: [
|
|
4635
4779
|
common.CommonModule,
|
|
4636
4780
|
animations.BrowserAnimationsModule,
|
|
@@ -4639,18 +4783,16 @@
|
|
|
4639
4783
|
material.MatFormFieldModule,
|
|
4640
4784
|
material.MatSelectModule,
|
|
4641
4785
|
tabs.MatTabsModule,
|
|
4786
|
+
DirectivesModule,
|
|
4787
|
+
ComponentsModule,
|
|
4642
4788
|
PlaceModule,
|
|
4643
4789
|
InteractionModule
|
|
4644
4790
|
],
|
|
4645
4791
|
exports: [
|
|
4646
|
-
CommandDirective,
|
|
4647
|
-
FocusBindingDirective,
|
|
4648
|
-
NumberInputComponent,
|
|
4649
|
-
StringInputComponent,
|
|
4650
|
-
PasswordInputComponent,
|
|
4651
|
-
SelectInputComponent,
|
|
4652
4792
|
InteractionModule,
|
|
4653
4793
|
PlaceModule,
|
|
4794
|
+
DirectivesModule,
|
|
4795
|
+
ComponentsModule,
|
|
4654
4796
|
NoopComponent
|
|
4655
4797
|
]
|
|
4656
4798
|
},] }
|
|
@@ -5146,7 +5288,7 @@
|
|
|
5146
5288
|
*/
|
|
5147
5289
|
function (target) {
|
|
5148
5290
|
if (exports.PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
5149
|
-
exports.PlaceComponent.injectDefinition(target, new exports.PlaceDefinition(target, options.path, ___default.isNil(options.authenticate) ? false : options.authenticate, options.
|
|
5291
|
+
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
5292
|
* @param {?} c
|
|
5151
5293
|
* @return {?}
|
|
5152
5294
|
*/
|
|
@@ -5166,8 +5308,6 @@
|
|
|
5166
5308
|
if (false) {
|
|
5167
5309
|
/** @type {?} */
|
|
5168
5310
|
Options.prototype.path;
|
|
5169
|
-
/** @type {?} */
|
|
5170
|
-
Options.prototype.order;
|
|
5171
5311
|
/** @type {?|undefined} */
|
|
5172
5312
|
Options.prototype.data;
|
|
5173
5313
|
/** @type {?|undefined} */
|
|
@@ -5471,218 +5611,79 @@
|
|
|
5471
5611
|
placeDef = visit.placeDefinition;
|
|
5472
5612
|
if (!placeDef.hasRouteId()) return [3 /*break*/, 2];
|
|
5473
5613
|
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];
|
|
5614
|
+
routeId = visit.getRouteId();
|
|
5615
|
+
return [4 /*yield*/, routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector)];
|
|
5593
5616
|
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);
|
|
5617
|
+
sanitisedValue = _a.sent();
|
|
5618
|
+
console.log({ routeId: routeId, sanitisedValue: sanitisedValue });
|
|
5619
|
+
// ###------- EARLY EXIT --------###
|
|
5620
|
+
if (routeIdDef.hasChanged(routeId, sanitisedValue)) {
|
|
5621
|
+
// if the route id has changed we redirect immediately as other
|
|
5622
|
+
// parameter sanitisers might use it.
|
|
5623
|
+
return [2 /*return*/, visit.replace(routeIdDef, sanitisedValue)];
|
|
5604
5624
|
}
|
|
5605
|
-
|
|
5606
|
-
return [4 /*yield*/, component.canDeactivate()];
|
|
5625
|
+
_a.label = 2;
|
|
5607
5626
|
case 2:
|
|
5608
|
-
//
|
|
5609
|
-
|
|
5627
|
+
// if we didn't replace the routeId we continue the url present parameters.
|
|
5628
|
+
parameterDefs = placeDef.getVisitParameterDefs({
|
|
5629
|
+
includeRouteParameters: true,
|
|
5630
|
+
includeNonRouteParameters: true
|
|
5631
|
+
});
|
|
5632
|
+
sanitisedVisit = visit;
|
|
5633
|
+
i = 0;
|
|
5610
5634
|
_a.label = 3;
|
|
5611
|
-
case 3:
|
|
5635
|
+
case 3:
|
|
5636
|
+
if (!(i < parameterDefs.length)) return [3 /*break*/, 6];
|
|
5637
|
+
def = parameterDefs[i];
|
|
5638
|
+
value = visit.getParameter(def.name);
|
|
5639
|
+
return [4 /*yield*/, def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector)];
|
|
5612
5640
|
case 4:
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
canLeave = false;
|
|
5617
|
-
}
|
|
5618
|
-
else {
|
|
5619
|
-
canLeave = true;
|
|
5641
|
+
sanitisedValue = _a.sent();
|
|
5642
|
+
if (def.hasChanged(value, sanitisedValue)) {
|
|
5643
|
+
sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);
|
|
5620
5644
|
}
|
|
5621
5645
|
_a.label = 5;
|
|
5622
5646
|
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];
|
|
5647
|
+
i++;
|
|
5648
|
+
return [3 /*break*/, 3];
|
|
5649
|
+
case 6: return [2 /*return*/, sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit];
|
|
5637
5650
|
}
|
|
5638
5651
|
});
|
|
5639
5652
|
});
|
|
5640
5653
|
};
|
|
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;
|
|
5654
|
+
return VisitSanitiser;
|
|
5656
5655
|
}());
|
|
5657
5656
|
if (false) {
|
|
5658
5657
|
/**
|
|
5659
5658
|
* @type {?}
|
|
5660
5659
|
* @private
|
|
5661
5660
|
*/
|
|
5662
|
-
|
|
5661
|
+
VisitSanitiser.prototype.activatedRoute;
|
|
5663
5662
|
/**
|
|
5664
5663
|
* @type {?}
|
|
5665
5664
|
* @private
|
|
5666
5665
|
*/
|
|
5667
|
-
|
|
5666
|
+
VisitSanitiser.prototype.router;
|
|
5668
5667
|
/**
|
|
5669
5668
|
* @type {?}
|
|
5670
5669
|
* @private
|
|
5671
5670
|
*/
|
|
5672
|
-
|
|
5673
|
-
/**
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5671
|
+
VisitSanitiser.prototype.placeHistory;
|
|
5672
|
+
/**
|
|
5673
|
+
* @type {?}
|
|
5674
|
+
* @private
|
|
5675
|
+
*/
|
|
5676
|
+
VisitSanitiser.prototype.injector;
|
|
5677
5677
|
}
|
|
5678
5678
|
|
|
5679
5679
|
/**
|
|
5680
5680
|
* @fileoverview added by tsickle
|
|
5681
5681
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5682
5682
|
*/
|
|
5683
|
-
exports.
|
|
5684
|
-
function
|
|
5683
|
+
exports.EnterPlaceGuard = /** @class */ (function () {
|
|
5684
|
+
function EnterPlaceGuard(router, urlSerializer, placeRouter, placeHistory, injector) {
|
|
5685
5685
|
this.router = router;
|
|
5686
|
+
this.urlSerializer = urlSerializer;
|
|
5686
5687
|
this.placeRouter = placeRouter;
|
|
5687
5688
|
this.placeHistory = placeHistory;
|
|
5688
5689
|
this.injector = injector;
|
|
@@ -5694,7 +5695,7 @@
|
|
|
5694
5695
|
* @param {?} state
|
|
5695
5696
|
* @return {?}
|
|
5696
5697
|
*/
|
|
5697
|
-
|
|
5698
|
+
EnterPlaceGuard.prototype.canActivate =
|
|
5698
5699
|
// @Trace()
|
|
5699
5700
|
/**
|
|
5700
5701
|
* @param {?} activatedRoute
|
|
@@ -5703,14 +5704,14 @@
|
|
|
5703
5704
|
*/
|
|
5704
5705
|
function (activatedRoute, state) {
|
|
5705
5706
|
return __awaiter(this, void 0, void 0, function () {
|
|
5706
|
-
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit,
|
|
5707
|
+
var placeDefinition, params, parsedParams, initialVisit, sanitiser, sanitisedVisit, routerStateUrlTree, commands;
|
|
5707
5708
|
return __generator(this, function (_a) {
|
|
5708
5709
|
switch (_a.label) {
|
|
5709
5710
|
case 0:
|
|
5710
5711
|
if (!exports.PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) return [3 /*break*/, 2];
|
|
5711
5712
|
placeDefinition = exports.PlaceComponent.getDefinition(activatedRoute.component);
|
|
5712
5713
|
// Parse our route params.
|
|
5713
|
-
params = new
|
|
5714
|
+
params = new EnterPlaceGuard.ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
|
|
5714
5715
|
parsedParams = placeDefinition.parseRouteParams(params);
|
|
5715
5716
|
initialVisit = this.placeRouter.navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
|
|
5716
5717
|
sanitiser = new VisitSanitiser(activatedRoute, this.router, this.placeHistory, this.injector);
|
|
@@ -5720,11 +5721,10 @@
|
|
|
5720
5721
|
// Save the visit with any updated parameters. We need to save it so we remember any non route parameters
|
|
5721
5722
|
this.placeRouter.navigationSession.storeVisit(sanitisedVisit);
|
|
5722
5723
|
if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
console.log('##### Redirect', commands);
|
|
5724
|
+
routerStateUrlTree = this.urlSerializer.parse(state.url);
|
|
5725
|
+
// Regenerate the url
|
|
5726
|
+
commands = this.createRedirectCommands(sanitisedVisit, __spread(routerStateUrlTree.root.children.primary.segments)).commands;
|
|
5727
|
+
console.log('##### Place Guard Redirect', commands);
|
|
5728
5728
|
return [2 /*return*/, this.router.createUrlTree(commands, {
|
|
5729
5729
|
replaceUrl: true,
|
|
5730
5730
|
skipLocationChange: false
|
|
@@ -5740,44 +5740,90 @@
|
|
|
5740
5740
|
});
|
|
5741
5741
|
});
|
|
5742
5742
|
};
|
|
5743
|
-
|
|
5743
|
+
/**
|
|
5744
|
+
* @private
|
|
5745
|
+
* @param {?} sanitisedVisit
|
|
5746
|
+
* @param {?} path
|
|
5747
|
+
* @return {?}
|
|
5748
|
+
*/
|
|
5749
|
+
EnterPlaceGuard.prototype.createRedirectCommands = /**
|
|
5750
|
+
* @private
|
|
5751
|
+
* @param {?} sanitisedVisit
|
|
5752
|
+
* @param {?} path
|
|
5753
|
+
* @return {?}
|
|
5754
|
+
*/
|
|
5755
|
+
function (sanitisedVisit, path) {
|
|
5756
|
+
// Ugly, but it works for now.
|
|
5757
|
+
/** @type {?} */
|
|
5758
|
+
var newSegments = sanitisedVisit.getUrlSegments();
|
|
5759
|
+
/** @type {?} */
|
|
5760
|
+
var replaceAt = path.findIndex((/**
|
|
5761
|
+
* @param {?} segment
|
|
5762
|
+
* @return {?}
|
|
5763
|
+
*/
|
|
5764
|
+
function (segment) { return segment.path === newSegments[0].path; }));
|
|
5765
|
+
/** @type {?} */
|
|
5766
|
+
var newPath = __spread(path);
|
|
5767
|
+
newPath.splice.apply(newPath, __spread([replaceAt, newSegments.length], newSegments)); // do not use the return value, it's the items that were removed!
|
|
5768
|
+
// do not use the return value, it's the items that were removed!
|
|
5769
|
+
/** @type {?} */
|
|
5770
|
+
var commands = [];
|
|
5771
|
+
newPath.forEach((/**
|
|
5772
|
+
* @param {?} s
|
|
5773
|
+
* @return {?}
|
|
5774
|
+
*/
|
|
5775
|
+
function (s) {
|
|
5776
|
+
commands.push(s.path);
|
|
5777
|
+
if (s.parameterMap.keys.length > 0) {
|
|
5778
|
+
commands.push(s.parameters);
|
|
5779
|
+
}
|
|
5780
|
+
}));
|
|
5781
|
+
return { newPath: newPath, commands: commands };
|
|
5782
|
+
};
|
|
5783
|
+
EnterPlaceGuard.decorators = [
|
|
5744
5784
|
{ type: core.Injectable, args: [{
|
|
5745
5785
|
providedIn: 'root'
|
|
5746
5786
|
},] }
|
|
5747
5787
|
];
|
|
5748
5788
|
/** @nocollapse */
|
|
5749
|
-
|
|
5789
|
+
EnterPlaceGuard.ctorParameters = function () { return [
|
|
5750
5790
|
{ type: router.Router },
|
|
5791
|
+
{ type: router.UrlSerializer },
|
|
5751
5792
|
{ type: PlaceRouter },
|
|
5752
5793
|
{ type: PlaceHistory },
|
|
5753
5794
|
{ type: core.Injector }
|
|
5754
5795
|
]; };
|
|
5755
|
-
/** @nocollapse */
|
|
5756
|
-
return
|
|
5796
|
+
/** @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" });
|
|
5797
|
+
return EnterPlaceGuard;
|
|
5757
5798
|
}());
|
|
5758
5799
|
if (false) {
|
|
5759
5800
|
/**
|
|
5760
5801
|
* @type {?}
|
|
5761
5802
|
* @private
|
|
5762
5803
|
*/
|
|
5763
|
-
exports.
|
|
5804
|
+
exports.EnterPlaceGuard.prototype.router;
|
|
5764
5805
|
/**
|
|
5765
5806
|
* @type {?}
|
|
5766
5807
|
* @private
|
|
5767
5808
|
*/
|
|
5768
|
-
exports.
|
|
5809
|
+
exports.EnterPlaceGuard.prototype.urlSerializer;
|
|
5769
5810
|
/**
|
|
5770
5811
|
* @type {?}
|
|
5771
5812
|
* @private
|
|
5772
5813
|
*/
|
|
5773
|
-
exports.
|
|
5814
|
+
exports.EnterPlaceGuard.prototype.placeRouter;
|
|
5774
5815
|
/**
|
|
5775
5816
|
* @type {?}
|
|
5776
5817
|
* @private
|
|
5777
5818
|
*/
|
|
5778
|
-
exports.
|
|
5819
|
+
exports.EnterPlaceGuard.prototype.placeHistory;
|
|
5820
|
+
/**
|
|
5821
|
+
* @type {?}
|
|
5822
|
+
* @private
|
|
5823
|
+
*/
|
|
5824
|
+
exports.EnterPlaceGuard.prototype.injector;
|
|
5779
5825
|
}
|
|
5780
|
-
(function (
|
|
5826
|
+
(function (EnterPlaceGuard) {
|
|
5781
5827
|
/**
|
|
5782
5828
|
* This a work around for the fact that an activated route with multiple segments doesn't
|
|
5783
5829
|
* include the segment params in the paramMap as well as each segment returns an empty
|
|
@@ -5866,7 +5912,7 @@
|
|
|
5866
5912
|
], ConsolidatedParameterMap.prototype, "keys", null);
|
|
5867
5913
|
return ConsolidatedParameterMap;
|
|
5868
5914
|
}());
|
|
5869
|
-
|
|
5915
|
+
EnterPlaceGuard.ConsolidatedParameterMap = ConsolidatedParameterMap;
|
|
5870
5916
|
if (false) {
|
|
5871
5917
|
/**
|
|
5872
5918
|
* @type {?}
|
|
@@ -5932,25 +5978,229 @@
|
|
|
5932
5978
|
*/
|
|
5933
5979
|
ParamMapAdapter.prototype.params;
|
|
5934
5980
|
}
|
|
5935
|
-
})(exports.
|
|
5981
|
+
})(exports.EnterPlaceGuard || (exports.EnterPlaceGuard = {}));
|
|
5982
|
+
|
|
5983
|
+
/**
|
|
5984
|
+
* @fileoverview added by tsickle
|
|
5985
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5986
|
+
*/
|
|
5987
|
+
var LeavePlaceGuard = /** @class */ (function () {
|
|
5988
|
+
function LeavePlaceGuard(router, injector, placeRouter, interactionContext, angularLocation) {
|
|
5989
|
+
this.router = router;
|
|
5990
|
+
this.injector = injector;
|
|
5991
|
+
this.placeRouter = placeRouter;
|
|
5992
|
+
this.interactionContext = interactionContext;
|
|
5993
|
+
this.angularLocation = angularLocation;
|
|
5994
|
+
}
|
|
5995
|
+
/**
|
|
5996
|
+
* @private
|
|
5997
|
+
* @param {?} nextState
|
|
5998
|
+
* @param {?} placeDefinition
|
|
5999
|
+
* @return {?}
|
|
6000
|
+
*/
|
|
6001
|
+
LeavePlaceGuard.prototype.isLeavingTheCurrentPlace = /**
|
|
6002
|
+
* @private
|
|
6003
|
+
* @param {?} nextState
|
|
6004
|
+
* @param {?} placeDefinition
|
|
6005
|
+
* @return {?}
|
|
6006
|
+
*/
|
|
6007
|
+
function (nextState, placeDefinition) {
|
|
6008
|
+
// TODO: this will break with child routes... need to examine the router states properly.
|
|
6009
|
+
// console.log('canDeactivate', {
|
|
6010
|
+
// staticPath: placeDefinitionPath,
|
|
6011
|
+
// currentStateUrl: currentState.url,
|
|
6012
|
+
// nextStateUrl: nextState.url
|
|
6013
|
+
// // alreadyDeclined: this._alreadyAccepted
|
|
6014
|
+
// });
|
|
6015
|
+
// Example of the above when navigating to a different child route.
|
|
6016
|
+
// canDeactivate {staticPath: "/hero-details",
|
|
6017
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-details",
|
|
6018
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats"
|
|
6019
|
+
// }
|
|
6020
|
+
// TODO: this will break with child routes... need to examine the router states properly.
|
|
6021
|
+
// console.log('canDeactivate', {
|
|
6022
|
+
// staticPath: placeDefinitionPath,
|
|
6023
|
+
// currentStateUrl: currentState.url,
|
|
6024
|
+
// nextStateUrl: nextState.url
|
|
6025
|
+
// // alreadyDeclined: this._alreadyAccepted
|
|
6026
|
+
// });
|
|
6027
|
+
// Example of the above when navigating to a different child route.
|
|
6028
|
+
// canDeactivate {staticPath: "/hero-details",
|
|
6029
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-details",
|
|
6030
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats"
|
|
6031
|
+
// }
|
|
6032
|
+
// Example clicking on router tab of the parent component (de-activates the parent due to route param changes)
|
|
6033
|
+
// canDeactivate {
|
|
6034
|
+
// staticPath: "/hero-stats",
|
|
6035
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6036
|
+
// nextStateUrl: "/route-parameters/"
|
|
6037
|
+
// }
|
|
6038
|
+
// canDeactivate {
|
|
6039
|
+
// staticPath: "/route-parameters",
|
|
6040
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6041
|
+
// nextStateUrl: "/route-parameters/"
|
|
6042
|
+
// }
|
|
6043
|
+
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: undefined, dl: Array(0), …}
|
|
6044
|
+
// parameter-snapshot.ts:20 {name: "idModel", mine: -1, theirs: null}
|
|
6045
|
+
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
6046
|
+
// canDeactivate {
|
|
6047
|
+
// staticPath: "/hero-stats",
|
|
6048
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6049
|
+
// nextStateUrl: "/route-parameters/-1"
|
|
6050
|
+
// }
|
|
6051
|
+
// canDeactivate {
|
|
6052
|
+
// staticPath: "/route-parameters",
|
|
6053
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6054
|
+
// nextStateUrl: "/route-parameters/-1"
|
|
6055
|
+
// }
|
|
6056
|
+
// logger.class.js:54 ParameterSnapshot.sanitise -> {idModel: -1, pv: undefined, pl: Array(0), dv: "A", dl: Array(3), …}
|
|
6057
|
+
// parameter-snapshot.ts:20 {name: "dv", mine: "A", theirs: undefined}
|
|
6058
|
+
// place-router.ts:28 redirect path (3) ["route-parameters", "-1", {…}]
|
|
6059
|
+
// canDeactivate {
|
|
6060
|
+
// staticPath: "/hero-stats",
|
|
6061
|
+
// currentStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c/hero-stats",
|
|
6062
|
+
// nextStateUrl: "/route-parameters/-1;dv=A;dl=a,b,c;rdv=A;rdl=a,b,c"
|
|
6063
|
+
// }
|
|
6064
|
+
/** @type {?} */
|
|
6065
|
+
var placeDefinitionPath = "/" + placeDefinition.path;
|
|
6066
|
+
return !nextState.url.startsWith(placeDefinitionPath);
|
|
6067
|
+
};
|
|
6068
|
+
/**
|
|
6069
|
+
* @param {?} component
|
|
6070
|
+
* @param {?} currentRoute
|
|
6071
|
+
* @param {?} currentState
|
|
6072
|
+
* @param {?=} nextState
|
|
6073
|
+
* @return {?}
|
|
6074
|
+
*/
|
|
6075
|
+
LeavePlaceGuard.prototype.canDeactivate = /**
|
|
6076
|
+
* @param {?} component
|
|
6077
|
+
* @param {?} currentRoute
|
|
6078
|
+
* @param {?} currentState
|
|
6079
|
+
* @param {?=} nextState
|
|
6080
|
+
* @return {?}
|
|
6081
|
+
*/
|
|
6082
|
+
function (component, currentRoute, currentState, nextState) {
|
|
6083
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6084
|
+
var self_1, canLeave;
|
|
6085
|
+
return __generator(this, function (_a) {
|
|
6086
|
+
switch (_a.label) {
|
|
6087
|
+
case 0:
|
|
6088
|
+
if (!this.placeRouter.navigationSession.alreadyAccepted(component)) return [3 /*break*/, 1];
|
|
6089
|
+
// We'll get called multiple times if there's any parameter sanitisation so
|
|
6090
|
+
// we always return true if we accepted on a previous cycle of the current
|
|
6091
|
+
// navigation session.
|
|
6092
|
+
return [2 /*return*/, true];
|
|
6093
|
+
case 1:
|
|
6094
|
+
self_1 = this;
|
|
6095
|
+
canLeave = true;
|
|
6096
|
+
if (!this.isLeavingTheCurrentPlace(nextState, component.placeDefinition)) return [3 /*break*/, 4];
|
|
6097
|
+
// we check the interaction first, so that components that don't need to check if they're in an
|
|
6098
|
+
// interaction during the canDeactivate cycle.
|
|
6099
|
+
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6100
|
+
if (this.interactionContext.isActive()) {
|
|
6101
|
+
canLeave = false;
|
|
6102
|
+
console.log('cancelling', { activity: this.interactionContext.currentActivity });
|
|
6103
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
6104
|
+
}
|
|
6105
|
+
if (!canLeave) return [3 /*break*/, 3];
|
|
6106
|
+
return [4 /*yield*/, component.canDeactivate()];
|
|
6107
|
+
case 2:
|
|
6108
|
+
// TODO: Add tests: hit back -> confirm leave dialog -> hit back -> close dialog -> hit back -> confirm leave dialog.
|
|
6109
|
+
canLeave = _a.sent();
|
|
6110
|
+
_a.label = 3;
|
|
6111
|
+
case 3: return [3 /*break*/, 5];
|
|
6112
|
+
case 4:
|
|
6113
|
+
if (this.interactionContext.isActive()) {
|
|
6114
|
+
console.log('cancelling', { activity: this.interactionContext.currentActivity });
|
|
6115
|
+
this.interactionContext.currentActivity.cancel(null);
|
|
6116
|
+
canLeave = false;
|
|
6117
|
+
}
|
|
6118
|
+
else {
|
|
6119
|
+
canLeave = true;
|
|
6120
|
+
}
|
|
6121
|
+
_a.label = 5;
|
|
6122
|
+
case 5:
|
|
6123
|
+
if (canLeave) {
|
|
6124
|
+
// We'll get called multiple times if there's any parameter sanitisation so
|
|
6125
|
+
// we remember the acceptance for the duration of the current navigation session.
|
|
6126
|
+
self_1.placeRouter.navigationSession.rememberAcceptanceOf(component);
|
|
6127
|
+
}
|
|
6128
|
+
else {
|
|
6129
|
+
// Angular doesn't preserve the url when a guard cancels the back button.
|
|
6130
|
+
// See https://github.com/angular/angular/issues/13586#issuecomment-432795720
|
|
6131
|
+
if (this.placeRouter.navigationSession.isPopState) {
|
|
6132
|
+
console.log('cancelled during popstate');
|
|
6133
|
+
this.angularLocation.go(this.placeRouter.navigationSession.popStateReturnUrl);
|
|
6134
|
+
}
|
|
6135
|
+
}
|
|
6136
|
+
return [2 /*return*/, canLeave];
|
|
6137
|
+
}
|
|
6138
|
+
});
|
|
6139
|
+
});
|
|
6140
|
+
};
|
|
6141
|
+
LeavePlaceGuard.decorators = [
|
|
6142
|
+
{ type: core.Injectable, args: [{
|
|
6143
|
+
providedIn: 'root'
|
|
6144
|
+
},] }
|
|
6145
|
+
];
|
|
6146
|
+
/** @nocollapse */
|
|
6147
|
+
LeavePlaceGuard.ctorParameters = function () { return [
|
|
6148
|
+
{ type: router.Router },
|
|
6149
|
+
{ type: core.Injector },
|
|
6150
|
+
{ type: PlaceRouter },
|
|
6151
|
+
{ type: InteractionContext },
|
|
6152
|
+
{ type: common.Location }
|
|
6153
|
+
]; };
|
|
6154
|
+
/** @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" });
|
|
6155
|
+
__decorate([
|
|
6156
|
+
pectin.Trace(),
|
|
6157
|
+
__metadata("design:type", Function),
|
|
6158
|
+
__metadata("design:paramtypes", [router.RouterStateSnapshot, exports.PlaceDefinition]),
|
|
6159
|
+
__metadata("design:returntype", void 0)
|
|
6160
|
+
], LeavePlaceGuard.prototype, "isLeavingTheCurrentPlace", null);
|
|
6161
|
+
return LeavePlaceGuard;
|
|
6162
|
+
}());
|
|
6163
|
+
if (false) {
|
|
6164
|
+
/**
|
|
6165
|
+
* @type {?}
|
|
6166
|
+
* @private
|
|
6167
|
+
*/
|
|
6168
|
+
LeavePlaceGuard.prototype.router;
|
|
6169
|
+
/**
|
|
6170
|
+
* @type {?}
|
|
6171
|
+
* @private
|
|
6172
|
+
*/
|
|
6173
|
+
LeavePlaceGuard.prototype.injector;
|
|
6174
|
+
/**
|
|
6175
|
+
* @type {?}
|
|
6176
|
+
* @private
|
|
6177
|
+
*/
|
|
6178
|
+
LeavePlaceGuard.prototype.placeRouter;
|
|
6179
|
+
/** @type {?} */
|
|
6180
|
+
LeavePlaceGuard.prototype.interactionContext;
|
|
6181
|
+
/** @type {?} */
|
|
6182
|
+
LeavePlaceGuard.prototype.angularLocation;
|
|
6183
|
+
}
|
|
5936
6184
|
|
|
5937
6185
|
exports.ACTIVITY_DATA = ACTIVITY_DATA;
|
|
5938
6186
|
exports.AbstractActivity = AbstractActivity;
|
|
5939
6187
|
exports.AbstractInputComponent = AbstractInputComponent;
|
|
5940
6188
|
exports.AbstractPlaceNavigationComponent = AbstractPlaceNavigationComponent;
|
|
5941
|
-
exports.Activity = exports.ɵ
|
|
6189
|
+
exports.Activity = exports.ɵbd;
|
|
5942
6190
|
exports.ActivityContainerComponent = ActivityContainerComponent;
|
|
5943
6191
|
exports.ActivityOutletComponent = ActivityOutletComponent;
|
|
5944
6192
|
exports.AlertDialogComponent = AlertDialogComponent;
|
|
5945
6193
|
exports.AngularUiPowerupsModule = AngularUiPowerupsModule;
|
|
5946
6194
|
exports.BusyOverlayComponent = BusyOverlayComponent;
|
|
5947
6195
|
exports.CommandDirective = CommandDirective;
|
|
5948
|
-
exports.
|
|
6196
|
+
exports.ComponentsModule = ComponentsModule;
|
|
6197
|
+
exports.ConfirmThenDialogComponent = exports.ɵbf;
|
|
5949
6198
|
exports.ConfirmationDialogComponent = ConfirmationDialogComponent;
|
|
5950
6199
|
exports.DEFINITION_META_DATA_KEY = DEFINITION_META_DATA_KEY;
|
|
5951
6200
|
exports.DIALOG_INTERACTION_SERVICE_DEFAULTS = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
5952
6201
|
exports.DialogInteractionService = DialogInteractionService;
|
|
5953
6202
|
exports.Dimension = Dimension;
|
|
6203
|
+
exports.DirectivesModule = DirectivesModule;
|
|
5954
6204
|
exports.DisposableComponent = DisposableComponent;
|
|
5955
6205
|
exports.EmptyStateComponent = EmptyStateComponent;
|
|
5956
6206
|
exports.FocusBindingDirective = FocusBindingDirective;
|
|
@@ -5982,37 +6232,39 @@
|
|
|
5982
6232
|
exports.VisitSanitiser = VisitSanitiser;
|
|
5983
6233
|
exports.leftRightPlaceAnimation = leftRightPlaceAnimation;
|
|
5984
6234
|
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.ɵ
|
|
6235
|
+
exports.ɵa = DirectivesModule;
|
|
6236
|
+
exports.ɵb = CommandDirective;
|
|
6237
|
+
exports.ɵba = ConfirmationDialogComponent;
|
|
6238
|
+
exports.ɵbb = AbstractActivity;
|
|
6239
|
+
exports.ɵbc = ACTIVITY_DATA;
|
|
6240
|
+
exports.ɵbg = AlertDialogComponent;
|
|
6241
|
+
exports.ɵbi = InteractionOutletComponent;
|
|
6242
|
+
exports.ɵbj = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
6243
|
+
exports.ɵbk = DialogInteractionService;
|
|
6244
|
+
exports.ɵc = FocusBindingDirective;
|
|
6245
|
+
exports.ɵd = DisposableComponent;
|
|
6246
|
+
exports.ɵe = ComponentsModule;
|
|
6247
|
+
exports.ɵf = NumberInputComponent;
|
|
6248
|
+
exports.ɵg = AbstractInputComponent;
|
|
6249
|
+
exports.ɵh = StringInputComponent;
|
|
6250
|
+
exports.ɵi = PasswordInputComponent;
|
|
6251
|
+
exports.ɵj = SelectInputComponent;
|
|
6252
|
+
exports.ɵk = NoopComponent;
|
|
6253
|
+
exports.ɵl = PlaceModule;
|
|
6254
|
+
exports.ɵm = EmptyStateComponent;
|
|
6255
|
+
exports.ɵn = BusyOverlayComponent;
|
|
6256
|
+
exports.ɵo = PlaceOutletComponent;
|
|
6257
|
+
exports.ɵp = leftRightPlaceAnimation;
|
|
6258
|
+
exports.ɵq = LEFT_RIGHT_PLACE_ANIMATION;
|
|
6259
|
+
exports.ɵr = PlaceRouter;
|
|
6260
|
+
exports.ɵs = PlaceHistory;
|
|
6261
|
+
exports.ɵt = TabbedPlaceNavigationComponent;
|
|
6262
|
+
exports.ɵu = AbstractPlaceNavigationComponent;
|
|
6263
|
+
exports.ɵv = ListPlaceNavComponent;
|
|
6264
|
+
exports.ɵw = InteractionModule;
|
|
6265
|
+
exports.ɵx = ActivityContainerComponent;
|
|
6266
|
+
exports.ɵy = InteractionContext;
|
|
6267
|
+
exports.ɵz = ActivityOutletComponent;
|
|
6016
6268
|
|
|
6017
6269
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6018
6270
|
|