@coolon/angular-ui-powerups 3.7.0-alpha.3 → 3.7.0-alpha.5
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/CHANGELOG.md +14 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +206 -147
- 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.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/abstract-popup-menu.component.js +50 -0
- package/esm2015/lib/components/commands/group/abstract-popup-menu.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/abstract-popup-menu.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/abstract-popup-menu.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/commands/group/command-group/command-group.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/command-group/command-group.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.js +17 -6
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.js +16 -3
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/more-menu.component.js +4 -11
- package/esm2015/lib/components/commands/group/more-menu.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/more-menu.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu.component.js +4 -15
- package/esm2015/lib/components/commands/group/popup-menu.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/popup-menu.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.js +3 -1
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/exports.js +1 -0
- package/esm2015/lib/components/exports.js.map +1 -1
- package/esm2015/lib/components/exports.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +15 -15
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +172 -120
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/commands/group/abstract-popup-menu.component.d.ts +16 -0
- package/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.d.ts +5 -2
- package/lib/components/commands/group/command-group-renderer/command-group-renderer.component.d.ts +5 -0
- package/lib/components/commands/group/more-menu.component.d.ts +2 -6
- package/lib/components/commands/group/popup-menu.component.d.ts +2 -7
- package/lib/components/exports.d.ts +1 -0
- package/package.json +1 -1
|
@@ -34,23 +34,23 @@ export class PlaceGuard {
|
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
36
36
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
if (placeDefinition.authenticate) {
|
|
38
|
+
if (!(yield this.placeAuthService.isAuthenticated())) {
|
|
39
|
+
const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);
|
|
40
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
41
|
+
if (nextPlaceDef.authenticate) {
|
|
42
|
+
lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);
|
|
43
|
+
}
|
|
44
|
+
return this.createUrlTree(redirectLocation);
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (!this.placeAuthService.isAuthorised(placeDefinition)) {
|
|
47
|
+
const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);
|
|
48
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
49
|
+
if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {
|
|
50
|
+
lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);
|
|
51
|
+
}
|
|
52
|
+
return this.createUrlTree(redirectLocation);
|
|
52
53
|
}
|
|
53
|
-
return this.createUrlTree(redirectLocation);
|
|
54
54
|
}
|
|
55
55
|
const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
// Parse our route params.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,MAAM,EAGP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAiB,IAAI,EAAS,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAg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@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n CanDeactivate,\n Router,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport { Constructable, lang, Trace } from '@coolon/pectin';\nimport { InteractionService } from '../../interaction/services/interaction.service';\nimport { PLACE_AUTH_SERVICE, PlaceAuthService } from '../place-auth-service';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceHistory } from '../place-history';\nimport { PlaceRouter } from '../place-router';\nimport { VisitSanitiser } from '../route/visit-sanitiser';\nimport { UrlService } from '../url-service';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { Visit } from '../visit';\nimport { ConsolidatedParameterMap } from './consolidated-param-map';\n\n@Injectable({ providedIn: 'root' })\nexport class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {\n\n\n constructor(private readonly router: Router,\n private urlService: UrlService,\n private readonly placeRouter: PlaceRouter,\n private readonly placeHistory: PlaceHistory,\n @Inject(PLACE_AUTH_SERVICE) private readonly placeAuthService: PlaceAuthService,\n private readonly interactionService: InteractionService,\n private readonly injector: Injector) {\n }\n\n // @Trace()\n async canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {\n const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);\n\n const needsAuth = placeDefinition.authenticate;\n\n const proceed = !needsAuth || await this.placeAuthService.isAuthenticated();\n if (!proceed) {\n const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (nextPlaceDef.authenticate) {\n lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n\n if (!this.placeAuthService.isAuthorised(placeDefinition)) {\n const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {\n lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n\n const result = await this.cleanInteractionState(activatedRoute, state, async () => {\n // Parse our route params.\n const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);\n const parsedParams = placeDefinition.parseRouteParams(params);\n\n const navigationSession = this.placeRouter.navigationSession;\n const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);\n const sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);\n const sanitisedVisit = await sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams));\n\n // Save the visit with any updated parameters. We need to save it so we remember any non route parameters\n navigationSession.storeVisit(sanitisedVisit);\n if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {\n // Regenerate the url\n const urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);\n // console.log('##### Place Guard Redirect', urlSnapshot);\n return urlSnapshot;\n } else {\n return true;\n }\n });\n return result instanceof UrlSnapshot ? result.urlTree : result;\n\n } else {\n return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);\n }\n }\n\n // @Trace()\n async canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree> {\n const currentUrl = this.urlService.parseUrl(currentState.url);\n const nextUrl = this.urlService.parseUrl(nextState.url);\n const result = await this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);\n return result instanceof UrlSnapshot ? result.urlTree : result;\n }\n\n private getPlaceDefinition(result: Constructable<PlaceComponent> | Visit): PlaceDefinition {\n return result instanceof Visit ?\n result.placeDefinition :\n PlaceComponent.getDefinition(result);\n }\n\n private createUrlTree(result: Constructable<PlaceComponent> | Visit) {\n const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});\n return this.urlService.createUrlSnapshot(visit).urlTree;\n }\n\n // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;\n // if (authoriseResult === true) {\n // // we're authorised, now run the place guards.\n // return next(placeDefinition);\n // } else {\n // console.log('not authorised result', authoriseResult);\n // return authoriseResult;\n // }\n // }\n //\n // // @Trace()\n // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n //\n // }\n\n // @Trace()\n // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);\n // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;\n // }\n\n // abstract getAuthGuard(injector: Injector): CanActivate;\n\n // @Trace()\n async cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot> {\n const url = this.urlService.parseUrl(state.url);\n if (!this.interactionService.isActive() && url.hasInteractions()) {\n // This happens if we reload the page or the url was pasted as the route should only be activated\n // after the interaction context has become active.\n return url.removeInteractionIds();\n } else {\n return next();\n }\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,MAAM,EAGP,MAAM,iBA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AG,CAAC,eAAe,EAAE,EAAE;gBAChE,iGAAiG;gBACjG,mDAAmD;gBACnD,OAAO,GAAG,CAAC,oBAAoB,EAAE,CAAC;aACnC;iBAAM;gBACL,OAAO,IAAI,EAAE,CAAC;aACf;QACH,CAAC;KAAA;;;;YAzHF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;YAjBhC,MAAM;YAYC,UAAU;YAFV,WAAW;YADX,YAAY;4CAgBN,MAAM,SAAC,kBAAkB;YApB/B,kBAAkB;YAVE,QAAQ","sourcesContent":["import { Inject, Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n CanDeactivate,\n Router,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport { Constructable, lang } from '@coolon/pectin';\nimport { InteractionService } from '../../interaction/services/interaction.service';\nimport { PLACE_AUTH_SERVICE, PlaceAuthService } from '../place-auth-service';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceHistory } from '../place-history';\nimport { PlaceRouter } from '../place-router';\nimport { VisitSanitiser } from '../route/visit-sanitiser';\nimport { UrlService } from '../url-service';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { Visit } from '../visit';\nimport { ConsolidatedParameterMap } from './consolidated-param-map';\n\n@Injectable({ providedIn: 'root' })\nexport class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {\n\n\n constructor(private readonly router: Router,\n private urlService: UrlService,\n private readonly placeRouter: PlaceRouter,\n private readonly placeHistory: PlaceHistory,\n @Inject(PLACE_AUTH_SERVICE) private readonly placeAuthService: PlaceAuthService,\n private readonly interactionService: InteractionService,\n private readonly injector: Injector) {\n }\n\n // @Trace()\n async canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {\n const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);\n\n if (placeDefinition.authenticate) {\n\n if (!await this.placeAuthService.isAuthenticated()) {\n const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (nextPlaceDef.authenticate) {\n lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n\n if (!this.placeAuthService.isAuthorised(placeDefinition)) {\n const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {\n lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n }\n\n const result = await this.cleanInteractionState(activatedRoute, state, async () => {\n // Parse our route params.\n const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);\n const parsedParams = placeDefinition.parseRouteParams(params);\n\n const navigationSession = this.placeRouter.navigationSession;\n const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);\n const sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);\n const sanitisedVisit = await sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams));\n\n // Save the visit with any updated parameters. We need to save it so we remember any non route parameters\n navigationSession.storeVisit(sanitisedVisit);\n if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {\n // Regenerate the url\n const urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);\n // console.log('##### Place Guard Redirect', urlSnapshot);\n return urlSnapshot;\n } else {\n return true;\n }\n });\n return result instanceof UrlSnapshot ? result.urlTree : result;\n\n } else {\n return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);\n }\n }\n\n // @Trace()\n async canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree> {\n const currentUrl = this.urlService.parseUrl(currentState.url);\n const nextUrl = this.urlService.parseUrl(nextState.url);\n const result = await this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);\n return result instanceof UrlSnapshot ? result.urlTree : result;\n }\n\n private getPlaceDefinition(result: Constructable<PlaceComponent> | Visit): PlaceDefinition {\n return result instanceof Visit ?\n result.placeDefinition :\n PlaceComponent.getDefinition(result);\n }\n\n private createUrlTree(result: Constructable<PlaceComponent> | Visit) {\n const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});\n return this.urlService.createUrlSnapshot(visit).urlTree;\n }\n\n // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;\n // if (authoriseResult === true) {\n // // we're authorised, now run the place guards.\n // return next(placeDefinition);\n // } else {\n // console.log('not authorised result', authoriseResult);\n // return authoriseResult;\n // }\n // }\n //\n // // @Trace()\n // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n //\n // }\n\n // @Trace()\n // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);\n // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;\n // }\n\n // abstract getAuthGuard(injector: Injector): CanActivate;\n\n // @Trace()\n async cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot> {\n const url = this.urlService.parseUrl(state.url);\n if (!this.interactionService.isActive() && url.hasInteractions()) {\n // This happens if we reload the page or the url was pasted as the route should only be activated\n // after the interaction context has become active.\n return url.removeInteractionIds();\n } else {\n return next();\n }\n }\n\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DOCUMENT, CommonModule, Location } from '@angular/common';
|
|
2
|
-
import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, EventEmitter, SkipSelf, ViewChild, Output,
|
|
2
|
+
import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, ViewChildren, EventEmitter, SkipSelf, ViewChild, Output, HostBinding, ViewEncapsulation, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, InjectionToken, Injector, ComponentFactoryResolver, INJECTOR } from '@angular/core';
|
|
3
3
|
import { FormsModule } from '@angular/forms';
|
|
4
4
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
5
5
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -18,7 +18,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
18
18
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
19
|
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
|
|
20
20
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
21
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, MutableValueModel,
|
|
21
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, MutableValueModel, MutableListModel, ListModel, ValueModel, StoreInValueModel, StoreInListModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Trace, Functions } from '@coolon/pectin';
|
|
22
22
|
import { __decorate, __metadata, __awaiter } from 'tslib';
|
|
23
23
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
24
24
|
import _, { isNil, isEqual } from 'lodash';
|
|
@@ -506,11 +506,6 @@ __decorate([
|
|
|
506
506
|
__metadata("design:type", Command)
|
|
507
507
|
], CardContainerComponent.prototype, "addCardCommand", void 0);
|
|
508
508
|
|
|
509
|
-
var TrackBy;
|
|
510
|
-
(function (TrackBy) {
|
|
511
|
-
TrackBy.byIndex = (data, index) => index;
|
|
512
|
-
})(TrackBy || (TrackBy = {}));
|
|
513
|
-
|
|
514
509
|
class ViewData {
|
|
515
510
|
}
|
|
516
511
|
(function (ViewData) {
|
|
@@ -620,78 +615,6 @@ class ViewData {
|
|
|
620
615
|
ViewData.isFlex = isFlex;
|
|
621
616
|
})(ViewData || (ViewData = {}));
|
|
622
617
|
|
|
623
|
-
class CommandGroupMenuRendererComponent extends DisposableComponent {
|
|
624
|
-
constructor(parent) {
|
|
625
|
-
super();
|
|
626
|
-
this.parent = parent;
|
|
627
|
-
this.groupViewDataModel = new MutableValueModel();
|
|
628
|
-
this.commandFired = new EventEmitter();
|
|
629
|
-
this.ViewData = ViewData;
|
|
630
|
-
this.TrackBy = TrackBy;
|
|
631
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
632
|
-
this.children = chain(this.groupViewDataModel).pluckList('children');
|
|
633
|
-
this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
|
|
634
|
-
}
|
|
635
|
-
getCommand(data) {
|
|
636
|
-
const command = ViewData.getCommand(data);
|
|
637
|
-
const { when } = Dsl.disposeWith(this);
|
|
638
|
-
when(command.busy).becomesFalsey(() => this.commandFired.emit());
|
|
639
|
-
return command;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
CommandGroupMenuRendererComponent.decorators = [
|
|
643
|
-
{ type: Component, args: [{
|
|
644
|
-
selector: 'aup-command-group-menu',
|
|
645
|
-
template: "<mat-menu #menu [xPosition]=\"groupViewData.xPosition\" [yPosition]=\"groupViewData.yPosition\">\n <ng-container *ngFor=\"let data of children.value; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"ViewData.isCommand(data)\"\n [pectinCommand]=\"getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n mat-menu-item>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"ViewData.isGroup(data)\">\n <button mat-menu-item\n #trigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-command-group-menu #innerPanel\n [groupViewData]=\"ViewData.asGroup(data)\"\n (commandFired)=\"trigger.closeMenu()\"></aup-command-group-menu>\n </ng-container>\n\n <mat-divider *ngIf=\"ViewData.isSeparator(data)\"></mat-divider>\n\n </ng-container>\n</mat-menu>\n"
|
|
646
|
-
},] }
|
|
647
|
-
];
|
|
648
|
-
CommandGroupMenuRendererComponent.ctorParameters = () => [
|
|
649
|
-
{ type: CommandGroupMenuRendererComponent, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
650
|
-
];
|
|
651
|
-
CommandGroupMenuRendererComponent.propDecorators = {
|
|
652
|
-
menuComponent: [{ type: ViewChild, args: ['menu', { static: true },] }],
|
|
653
|
-
groupViewData: [{ type: Input }],
|
|
654
|
-
commandFired: [{ type: Output }],
|
|
655
|
-
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
656
|
-
};
|
|
657
|
-
__decorate([
|
|
658
|
-
StoreInValueModel('groupViewDataModel'),
|
|
659
|
-
__metadata("design:type", ViewData.GroupData)
|
|
660
|
-
], CommandGroupMenuRendererComponent.prototype, "groupViewData", void 0);
|
|
661
|
-
|
|
662
|
-
class CommandGroupRendererComponent extends DisposableComponent {
|
|
663
|
-
constructor() {
|
|
664
|
-
super();
|
|
665
|
-
this.renderRootNode = true;
|
|
666
|
-
this.ViewData = ViewData;
|
|
667
|
-
this.TrackBy = TrackBy;
|
|
668
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
669
|
-
this.childViewDataModels = chain(this.groupViewDataModel)
|
|
670
|
-
.pluckList('children');
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
CommandGroupRendererComponent.decorators = [
|
|
674
|
-
{ type: Component, args: [{
|
|
675
|
-
selector: 'aup-command-group-renderer',
|
|
676
|
-
template: "<ng-template #groupTemplate let-group>\n\n <ng-container *ngIf=\"ViewData.hasText(group)\" [ngSwitch]=\"ViewData.getStyle(group)\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button #trigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-stroked-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu [groupViewData]=\"group\" (commandFired)=\"trigger.closeMenu()\"></aup-command-group-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button #trigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-raised-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu [groupViewData]=\"group\" (commandFired)=\"trigger.closeMenu()\"></aup-command-group-menu>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button #trigger=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu [groupViewData]=\"group\" (commandFired)=\"trigger.closeMenu()\"></aup-command-group-menu>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!ViewData.hasText(group)\">\n <button #trigger=\"matMenuTrigger\"\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n >\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu [groupViewData]=\"group\" (commandFired)=\"trigger.closeMenu()\"></aup-command-group-menu>\n </ng-container>\n\n</ng-template>\n\n\n<ng-template #commandTemplate let-data>\n\n <ng-container *ngIf=\"ViewData.hasText(data)\" [ngSwitch]=\"ViewData.getStyle(data)\">\n <button *ngSwitchCase=\"'raised'\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-raised-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n <button *ngSwitchCase=\"'stroked'\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-stroked-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n <button *ngSwitchDefault\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n </ng-container>\n\n <button *ngIf=\"!ViewData.hasText(data)\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-icon-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n\n</ng-template>\n\n\n<ng-template *ngIf=\"renderRootNode\"\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: groupViewDataModel.value }\">\n</ng-template>\n\n<ng-container *ngIf=\"!renderRootNode\">\n <ng-container *ngFor=\"let data of this.childViewDataModels.value; trackBy: TrackBy.byIndex\">\n <ng-template *ngIf=\"ViewData.isGroup(data)\"\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: data }\">\n </ng-template>\n <ng-template *ngIf=\"ViewData.isCommand(data)\"\n [ngTemplateOutlet]=\"commandTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: data }\">\n </ng-template>\n\n <mat-divider *ngIf=\"ViewData.isSeparator(data)\" [vertical]=\"true\"></mat-divider>\n </ng-container>\n\n</ng-container>\n",
|
|
677
|
-
styles: [":host{align-items:center;display:inline-flex;flex-direction:row}:host:not(.render-root) mat-divider{-ms-grid-row-align:stretch;align-self:stretch;margin:4px 0}:host:not(.render-root)>*+*{margin-left:8px}:host span.flex{flex:1}"]
|
|
678
|
-
},] }
|
|
679
|
-
];
|
|
680
|
-
CommandGroupRendererComponent.ctorParameters = () => [];
|
|
681
|
-
CommandGroupRendererComponent.propDecorators = {
|
|
682
|
-
groupViewDataModel: [{ type: Input }],
|
|
683
|
-
groupViewData: [{ type: Input }],
|
|
684
|
-
renderRootNode: [{ type: Input }, { type: HostBinding, args: ['class.render-root',] }]
|
|
685
|
-
};
|
|
686
|
-
__decorate([
|
|
687
|
-
TrackExternal(),
|
|
688
|
-
__metadata("design:type", ValueModel)
|
|
689
|
-
], CommandGroupRendererComponent.prototype, "groupViewDataModel", void 0);
|
|
690
|
-
__decorate([
|
|
691
|
-
StoreInValueModel('groupViewDataModel'),
|
|
692
|
-
__metadata("design:type", ViewData.GroupData)
|
|
693
|
-
], CommandGroupRendererComponent.prototype, "groupViewData", void 0);
|
|
694
|
-
|
|
695
618
|
class Registration extends GarbageCollector {
|
|
696
619
|
}
|
|
697
620
|
(function (Registration) {
|
|
@@ -847,6 +770,152 @@ class CommandGroup extends GarbageCollector {
|
|
|
847
770
|
CommandGroup.factory = factory;
|
|
848
771
|
})(CommandGroup || (CommandGroup = {}));
|
|
849
772
|
|
|
773
|
+
class AbstractPopupMenuComponent extends DisposableComponent {
|
|
774
|
+
constructor(group) {
|
|
775
|
+
super();
|
|
776
|
+
this.group = group;
|
|
777
|
+
}
|
|
778
|
+
get xPosition() {
|
|
779
|
+
return this.group.xPosition;
|
|
780
|
+
}
|
|
781
|
+
set xPosition(position) {
|
|
782
|
+
this.group.xPosition = position;
|
|
783
|
+
}
|
|
784
|
+
get yPosition() {
|
|
785
|
+
return this.group.yPosition;
|
|
786
|
+
}
|
|
787
|
+
set yPosition(position) {
|
|
788
|
+
this.group.yPosition = position;
|
|
789
|
+
}
|
|
790
|
+
ngAfterContentInit() {
|
|
791
|
+
this.group.initialise();
|
|
792
|
+
}
|
|
793
|
+
ngOnInit() {
|
|
794
|
+
}
|
|
795
|
+
// @Trace()
|
|
796
|
+
closeMenu() {
|
|
797
|
+
this.triggers.forEach(trigger => {
|
|
798
|
+
if (trigger.menuOpen) {
|
|
799
|
+
trigger.closeMenu();
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
AbstractPopupMenuComponent.decorators = [
|
|
805
|
+
{ type: Component, args: [{
|
|
806
|
+
selector: 'aup-abstract-popup-menu-component',
|
|
807
|
+
template: ''
|
|
808
|
+
},] }
|
|
809
|
+
];
|
|
810
|
+
AbstractPopupMenuComponent.ctorParameters = () => [
|
|
811
|
+
{ type: CommandGroup }
|
|
812
|
+
];
|
|
813
|
+
AbstractPopupMenuComponent.propDecorators = {
|
|
814
|
+
xPosition: [{ type: Input }],
|
|
815
|
+
yPosition: [{ type: Input }],
|
|
816
|
+
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
var TrackBy;
|
|
820
|
+
(function (TrackBy) {
|
|
821
|
+
TrackBy.byIndex = (data, index) => index;
|
|
822
|
+
})(TrackBy || (TrackBy = {}));
|
|
823
|
+
|
|
824
|
+
class CommandGroupMenuRendererComponent extends DisposableComponent {
|
|
825
|
+
constructor(parent) {
|
|
826
|
+
super();
|
|
827
|
+
this.parent = parent;
|
|
828
|
+
this.groupViewDataModel = new MutableValueModel();
|
|
829
|
+
this.commandFired = new EventEmitter();
|
|
830
|
+
this.ViewData = ViewData;
|
|
831
|
+
this.TrackBy = TrackBy;
|
|
832
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
833
|
+
this.children = chain(this.groupViewDataModel).pluckList('children');
|
|
834
|
+
this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
|
|
835
|
+
}
|
|
836
|
+
executeCommand(data) {
|
|
837
|
+
ViewData.getCommand(data).execute().finally(() => {
|
|
838
|
+
this.commandFired.emit();
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
isEnabled(data) {
|
|
842
|
+
return ViewData.getCommand(data).enabled.value;
|
|
843
|
+
}
|
|
844
|
+
// @Trace()
|
|
845
|
+
onCommandFired() {
|
|
846
|
+
this.commandFired.emit();
|
|
847
|
+
this.triggers.forEach(trigger => {
|
|
848
|
+
if (trigger.menuOpen) {
|
|
849
|
+
trigger.closeMenu();
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
CommandGroupMenuRendererComponent.decorators = [
|
|
855
|
+
{ type: Component, args: [{
|
|
856
|
+
selector: 'aup-command-group-menu',
|
|
857
|
+
template: "<mat-menu #menu [xPosition]=\"groupViewData.xPosition\" [yPosition]=\"groupViewData.yPosition\">\n <ng-container *ngFor=\"let data of children.value; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"ViewData.isCommand(data)\"\n (click)=\"executeCommand(data)\"\n [disabled]=\"!isEnabled(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n mat-menu-item>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"ViewData.isGroup(data)\">\n <button mat-menu-item\n matMenuTrigger\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-command-group-menu #innerPanel\n [groupViewData]=\"ViewData.asGroup(data)\"\n (commandFired)=\"onCommandFired()\"></aup-command-group-menu>\n </ng-container>\n\n <mat-divider *ngIf=\"ViewData.isSeparator(data)\"></mat-divider>\n\n </ng-container>\n</mat-menu>\n"
|
|
858
|
+
},] }
|
|
859
|
+
];
|
|
860
|
+
CommandGroupMenuRendererComponent.ctorParameters = () => [
|
|
861
|
+
{ type: CommandGroupMenuRendererComponent, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
862
|
+
];
|
|
863
|
+
CommandGroupMenuRendererComponent.propDecorators = {
|
|
864
|
+
menuComponent: [{ type: ViewChild, args: ['menu', { static: true },] }],
|
|
865
|
+
groupViewData: [{ type: Input }],
|
|
866
|
+
commandFired: [{ type: Output }],
|
|
867
|
+
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
868
|
+
};
|
|
869
|
+
__decorate([
|
|
870
|
+
StoreInValueModel('groupViewDataModel'),
|
|
871
|
+
__metadata("design:type", ViewData.GroupData)
|
|
872
|
+
], CommandGroupMenuRendererComponent.prototype, "groupViewData", void 0);
|
|
873
|
+
|
|
874
|
+
class CommandGroupRendererComponent extends DisposableComponent {
|
|
875
|
+
constructor() {
|
|
876
|
+
super();
|
|
877
|
+
this.renderRootNode = true;
|
|
878
|
+
this.commandFired = new EventEmitter();
|
|
879
|
+
this.ViewData = ViewData;
|
|
880
|
+
this.TrackBy = TrackBy;
|
|
881
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
882
|
+
this.childViewDataModels = chain(this.groupViewDataModel)
|
|
883
|
+
.pluckList('children');
|
|
884
|
+
}
|
|
885
|
+
// @Trace()
|
|
886
|
+
onCommandFired() {
|
|
887
|
+
this.commandFired.emit();
|
|
888
|
+
this.triggers.forEach(trigger => {
|
|
889
|
+
if (trigger.menuOpen) {
|
|
890
|
+
trigger.closeMenu();
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
CommandGroupRendererComponent.decorators = [
|
|
896
|
+
{ type: Component, args: [{
|
|
897
|
+
selector: 'aup-command-group-renderer',
|
|
898
|
+
template: "<ng-template #groupTemplate let-group>\n\n <ng-container *ngIf=\"ViewData.hasText(group)\" [ngSwitch]=\"ViewData.getStyle(group)\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-stroked-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu\n [groupViewData]=\"group\"\n (commandFired)=\"onCommandFired()\"></aup-command-group-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-raised-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu\n [groupViewData]=\"group\"\n (commandFired)=\"onCommandFired()\"></aup-command-group-menu>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n mat-button>\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu\n [groupViewData]=\"group\"\n (commandFired)=\"onCommandFired()\"></aup-command-group-menu>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!ViewData.hasText(group)\">\n <button matMenuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"ViewData.getTooltip(group)\"\n [color]=\"ViewData.getColor(group)\"\n >\n <aup-command-face [faces]=\"ViewData.getFaces(group)\"></aup-command-face>\n </button>\n <aup-command-group-menu #subMenu\n [groupViewData]=\"group\"\n (commandFired)=\"onCommandFired()\"></aup-command-group-menu>\n </ng-container>\n\n</ng-template>\n\n\n<ng-template #commandTemplate let-data>\n\n <ng-container *ngIf=\"ViewData.hasText(data)\" [ngSwitch]=\"ViewData.getStyle(data)\">\n <button *ngSwitchCase=\"'raised'\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-raised-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n <button *ngSwitchCase=\"'stroked'\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-stroked-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n <button *ngSwitchDefault\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n </ng-container>\n\n <button *ngIf=\"!ViewData.hasText(data)\"\n [pectinCommand]=\"ViewData.getCommand(data)\"\n [matTooltip]=\"ViewData.getTooltip(data)\"\n [color]=\"ViewData.getColor(data)\"\n mat-icon-button>\n <aup-command-face [faces]=\"ViewData.getFaces(data)\"></aup-command-face>\n </button>\n\n</ng-template>\n\n\n<ng-template *ngIf=\"renderRootNode\"\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: groupViewDataModel.value }\">\n</ng-template>\n\n<ng-container *ngIf=\"!renderRootNode\">\n <ng-container *ngFor=\"let data of this.childViewDataModels.value; trackBy: TrackBy.byIndex\">\n <ng-template *ngIf=\"ViewData.isGroup(data)\"\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: data }\">\n </ng-template>\n <ng-template *ngIf=\"ViewData.isCommand(data)\"\n [ngTemplateOutlet]=\"commandTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: data }\">\n </ng-template>\n\n <mat-divider *ngIf=\"ViewData.isSeparator(data)\" [vertical]=\"true\"></mat-divider>\n </ng-container>\n\n</ng-container>\n",
|
|
899
|
+
styles: [":host{align-items:center;display:inline-flex;flex-direction:row}:host:not(.render-root) mat-divider{-ms-grid-row-align:stretch;align-self:stretch;margin:4px 0}:host:not(.render-root)>*+*{margin-left:8px}:host span.flex{flex:1}"]
|
|
900
|
+
},] }
|
|
901
|
+
];
|
|
902
|
+
CommandGroupRendererComponent.ctorParameters = () => [];
|
|
903
|
+
CommandGroupRendererComponent.propDecorators = {
|
|
904
|
+
groupViewDataModel: [{ type: Input }],
|
|
905
|
+
groupViewData: [{ type: Input }],
|
|
906
|
+
renderRootNode: [{ type: Input }, { type: HostBinding, args: ['class.render-root',] }],
|
|
907
|
+
commandFired: [{ type: Output }],
|
|
908
|
+
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
909
|
+
};
|
|
910
|
+
__decorate([
|
|
911
|
+
TrackExternal(),
|
|
912
|
+
__metadata("design:type", ValueModel)
|
|
913
|
+
], CommandGroupRendererComponent.prototype, "groupViewDataModel", void 0);
|
|
914
|
+
__decorate([
|
|
915
|
+
StoreInValueModel('groupViewDataModel'),
|
|
916
|
+
__metadata("design:type", ViewData.GroupData)
|
|
917
|
+
], CommandGroupRendererComponent.prototype, "groupViewData", void 0);
|
|
918
|
+
|
|
850
919
|
class CommandGroupComponent extends CommandGroup {
|
|
851
920
|
constructor(parent) {
|
|
852
921
|
super(parent);
|
|
@@ -1042,10 +1111,9 @@ const ɵ0 = CommandGroup.factory;
|
|
|
1042
1111
|
/**
|
|
1043
1112
|
*
|
|
1044
1113
|
*/
|
|
1045
|
-
class MoreMenuComponent extends
|
|
1114
|
+
class MoreMenuComponent extends AbstractPopupMenuComponent {
|
|
1046
1115
|
constructor(group) {
|
|
1047
|
-
super();
|
|
1048
|
-
this.group = group;
|
|
1116
|
+
super(group);
|
|
1049
1117
|
this.tooltipModel = new MutableValueModel();
|
|
1050
1118
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1051
1119
|
group.xPosition = 'before'; // this should be the default unless overridden by the user.
|
|
@@ -1060,17 +1128,11 @@ class MoreMenuComponent extends DisposableComponent {
|
|
|
1060
1128
|
];
|
|
1061
1129
|
}, { allowNil: true });
|
|
1062
1130
|
}
|
|
1063
|
-
ngOnInit() {
|
|
1064
|
-
}
|
|
1065
|
-
// @Trace()
|
|
1066
|
-
ngAfterContentInit() {
|
|
1067
|
-
this.group.initialise();
|
|
1068
|
-
}
|
|
1069
1131
|
}
|
|
1070
1132
|
MoreMenuComponent.decorators = [
|
|
1071
1133
|
{ type: Component, args: [{
|
|
1072
1134
|
selector: 'aup-more-menu',
|
|
1073
|
-
template: '<aup-command-group-renderer [renderRootNode]="true" [groupViewDataModel]="group.rootTemplate"></aup-command-group-renderer>',
|
|
1135
|
+
template: '<aup-command-group-renderer [renderRootNode]="true" [groupViewDataModel]="group.rootTemplate" (commandFired)="closeMenu()"></aup-command-group-renderer>',
|
|
1074
1136
|
providers: [{ provide: CommandGroup, useFactory: ɵ0 }]
|
|
1075
1137
|
},] }
|
|
1076
1138
|
];
|
|
@@ -1089,28 +1151,17 @@ const ɵ0$1 = CommandGroup.factory;
|
|
|
1089
1151
|
/**
|
|
1090
1152
|
*
|
|
1091
1153
|
*/
|
|
1092
|
-
class PopupMenuComponent extends
|
|
1154
|
+
class PopupMenuComponent extends AbstractPopupMenuComponent {
|
|
1093
1155
|
constructor(group) {
|
|
1094
|
-
super();
|
|
1095
|
-
this.group = group;
|
|
1156
|
+
super(group);
|
|
1096
1157
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1097
1158
|
group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
|
|
1098
1159
|
}
|
|
1099
|
-
// @Trace()
|
|
1100
|
-
ngOnInit() {
|
|
1101
|
-
}
|
|
1102
|
-
// @Trace()
|
|
1103
|
-
ngAfterContentInit() {
|
|
1104
|
-
this.group.initialise();
|
|
1105
|
-
}
|
|
1106
|
-
// @Trace()
|
|
1107
|
-
ngAfterViewInit() {
|
|
1108
|
-
}
|
|
1109
1160
|
}
|
|
1110
1161
|
PopupMenuComponent.decorators = [
|
|
1111
1162
|
{ type: Component, args: [{
|
|
1112
1163
|
selector: 'aup-popup-menu',
|
|
1113
|
-
template: '<aup-command-group-renderer [renderRootNode]="true" [groupViewDataModel]="group.rootTemplate"></aup-command-group-renderer>',
|
|
1164
|
+
template: '<aup-command-group-renderer [renderRootNode]="true" [groupViewDataModel]="group.rootTemplate" (commandFired)="closeMenu()"></aup-command-group-renderer>',
|
|
1114
1165
|
providers: [{ provide: CommandGroup, useFactory: ɵ0$1 }]
|
|
1115
1166
|
},] }
|
|
1116
1167
|
];
|
|
@@ -3093,7 +3144,8 @@ ComponentsModule.decorators = [
|
|
|
3093
3144
|
SeparatorComponent,
|
|
3094
3145
|
FlexComponent,
|
|
3095
3146
|
CommandGroupMenuRendererComponent,
|
|
3096
|
-
CommandGroupRendererComponent
|
|
3147
|
+
CommandGroupRendererComponent,
|
|
3148
|
+
AbstractPopupMenuComponent
|
|
3097
3149
|
],
|
|
3098
3150
|
imports: [
|
|
3099
3151
|
CommonModule,
|
|
@@ -6917,23 +6969,23 @@ class PlaceGuard {
|
|
|
6917
6969
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6918
6970
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
6919
6971
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6972
|
+
if (placeDefinition.authenticate) {
|
|
6973
|
+
if (!(yield this.placeAuthService.isAuthenticated())) {
|
|
6974
|
+
const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);
|
|
6975
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
6976
|
+
if (nextPlaceDef.authenticate) {
|
|
6977
|
+
lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);
|
|
6978
|
+
}
|
|
6979
|
+
return this.createUrlTree(redirectLocation);
|
|
6927
6980
|
}
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6981
|
+
if (!this.placeAuthService.isAuthorised(placeDefinition)) {
|
|
6982
|
+
const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);
|
|
6983
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
6984
|
+
if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {
|
|
6985
|
+
lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);
|
|
6986
|
+
}
|
|
6987
|
+
return this.createUrlTree(redirectLocation);
|
|
6935
6988
|
}
|
|
6936
|
-
return this.createUrlTree(redirectLocation);
|
|
6937
6989
|
}
|
|
6938
6990
|
const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
|
|
6939
6991
|
// Parse our route params.
|
|
@@ -7130,5 +7182,5 @@ function VisitParameterList(options) {
|
|
|
7130
7182
|
* Generated bundle index. Do not edit.
|
|
7131
7183
|
*/
|
|
7132
7184
|
|
|
7133
|
-
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandDirective, CommandFace, CommandFaceComponent, CommandGroup, CommandGroupComponent, CommandGroupMenuRendererComponent, CommandGroupRendererComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, PLACE_AUTH_SERVICE, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PopupMenuComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, Registration, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, UrlService, UrlSnapshot, VerticalFocusContainerComponent, ViewData, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
|
|
7185
|
+
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandDirective, CommandFace, CommandFaceComponent, CommandGroup, CommandGroupComponent, CommandGroupMenuRendererComponent, CommandGroupRendererComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, PLACE_AUTH_SERVICE, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PopupMenuComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, Registration, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, UrlService, UrlSnapshot, VerticalFocusContainerComponent, ViewData, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
|
|
7134
7186
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|