@coolon/angular-ui-powerups 3.7.0-alpha.8 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +81 -76
- 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/popup-aware.component.js +3 -0
- package/esm2015/lib/components/commands/group/popup-aware.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/popup-aware.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js +10 -10
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu.component.js.map +1 -1
- package/esm2015/lib/components/commands/separator.component.js +5 -4
- package/esm2015/lib/components/commands/separator.component.js.map +1 -1
- package/esm2015/lib/components/commands/separator.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +69 -64
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/commands/group/popup-aware.component.d.ts +1 -0
- package/lib/components/commands/group/popup-menu/abstract-popup-menu.component.d.ts +3 -2
- package/lib/components/commands/separator.component.d.ts +2 -1
- package/package.json +5 -4
- package/schematics/ng-add/index.js +4 -4
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/place-routes/place-builder.js +1 -1
- package/schematics/place-routes/place-builder.js.map +1 -1
|
@@ -9,6 +9,9 @@ export class PopupAwareComponent extends DisposableComponent {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
get componentIndex() {
|
|
12
|
+
return this.computeComponentIndex();
|
|
13
|
+
}
|
|
14
|
+
computeComponentIndex() {
|
|
12
15
|
let node = this.element.nativeElement;
|
|
13
16
|
let index = 0;
|
|
14
17
|
while ((node = node.previousElementSibling)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-aware.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-aware.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,OAAgB,mBAAoB,SAAQ,mBAAmB;IAEnE,YAAqB,OAAmB,EAAW,MAAuB;QACxE,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAY;QAAW,WAAM,GAAN,MAAM,CAAiB;QAExE,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SACrD;IACH,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACtC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,CAAC,EAAE;YAC3C,KAAK,EAAE,CAAC;SACT;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["import { ElementRef, Inject } from '@angular/core';\nimport { DisposableComponent } from '../../disposable-component';\nimport { CommandFace } from '../command-face';\nimport { POPUP_CONTAINER, PopupContainer } from './popup-container';\n\nexport abstract class PopupAwareComponent extends DisposableComponent {\n\n constructor(readonly element: ElementRef, readonly parent?: PopupContainer) {\n super();\n if (parent) {\n this.registerDisposable(this.parent.register(this));\n }\n }\n\n get componentIndex() {\n let node = this.element.nativeElement;\n let index = 0;\n while ((node = node.previousElementSibling)) {\n index++;\n }\n return index;\n }\n\n getFace(): CommandFace | undefined {\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"popup-aware.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-aware.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,OAAgB,mBAAoB,SAAQ,mBAAmB;IAEnE,YAAqB,OAAmB,EAAW,MAAuB;QACxE,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAY;QAAW,WAAM,GAAN,MAAM,CAAiB;QAExE,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SACrD;IACH,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAEO,qBAAqB;QAC3B,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACtC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,CAAC,EAAE;YAC3C,KAAK,EAAE,CAAC;SACT;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["import { ElementRef, Inject } from '@angular/core';\nimport { DisposableComponent } from '../../disposable-component';\nimport { CommandFace } from '../command-face';\nimport { POPUP_CONTAINER, PopupContainer } from './popup-container';\n\nexport abstract class PopupAwareComponent extends DisposableComponent {\n\n constructor(readonly element: ElementRef, readonly parent?: PopupContainer) {\n super();\n if (parent) {\n this.registerDisposable(this.parent.register(this));\n }\n }\n\n get componentIndex() {\n return this.computeComponentIndex();\n }\n\n private computeComponentIndex() {\n let node = this.element.nativeElement;\n let index = 0;\n while ((node = node.previousElementSibling)) {\n index++;\n }\n return index;\n }\n\n getFace(): CommandFace | undefined {\n return undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PopupAwareComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":5,"character":50},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":7,"character":32},{"__symbolic":"reference","module":"./popup-container","name":"PopupContainer","line":7,"character":62}]}],"getFace":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PopupAwareComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":5,"character":50},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":7,"character":32},{"__symbolic":"reference","module":"./popup-container","name":"PopupContainer","line":7,"character":62}]}],"computeComponentIndex":[{"__symbolic":"method"}],"getFace":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
1
|
import { Component, ElementRef, Inject, Input, QueryList, ViewChildren } from '@angular/core';
|
|
3
2
|
import { MatMenuTrigger } from '@angular/material/menu';
|
|
4
|
-
import { DelegatingValueModel, Disposable, Dsl, MutableListModel
|
|
3
|
+
import { DelegatingValueModel, Disposable, Dsl, MutableListModel } from '@coolon/pectin';
|
|
5
4
|
import { CommandFace } from '../../command-face';
|
|
6
5
|
import { PopupAwareComponent } from '../popup-aware.component';
|
|
7
6
|
import { POPUP_CONTAINER } from '../popup-container';
|
|
@@ -13,19 +12,26 @@ export class AbstractPopupMenuComponent extends PopupAwareComponent {
|
|
|
13
12
|
super(element, parent);
|
|
14
13
|
this._unorderedChildren = new MutableListModel();
|
|
15
14
|
this.faceModelDelegate = new DelegatingValueModel();
|
|
15
|
+
this.faceAdapterModel = new DelegatingValueModel();
|
|
16
16
|
this.xPosition = 'after';
|
|
17
17
|
this.yPosition = 'below';
|
|
18
18
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
19
|
-
//
|
|
20
|
-
|
|
19
|
+
// TODO: get faceAdapter seems to get called during the super constuctor so we have to use a delegate
|
|
20
|
+
// to avoid null pointers.
|
|
21
|
+
this.faceAdapterModel.setDelegate(chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f)));
|
|
21
22
|
this.children = chain(this._unorderedChildren).sortBy('componentIndex');
|
|
22
23
|
}
|
|
24
|
+
ngAfterContentChecked() {
|
|
25
|
+
// force the list to re-order as the child indicies may have changed.
|
|
26
|
+
this._unorderedChildren.value = [...this._unorderedChildren.value];
|
|
27
|
+
}
|
|
23
28
|
get faceAdapter() {
|
|
24
29
|
return this.faceAdapterModel.value;
|
|
25
30
|
}
|
|
26
31
|
isRoot() {
|
|
27
32
|
return !this.parent;
|
|
28
33
|
}
|
|
34
|
+
// @Trace()
|
|
29
35
|
register(component) {
|
|
30
36
|
this._unorderedChildren.push(component);
|
|
31
37
|
return Disposable.disposableThatRuns(() => {
|
|
@@ -58,10 +64,4 @@ AbstractPopupMenuComponent.propDecorators = {
|
|
|
58
64
|
yPosition: [{ type: Input }],
|
|
59
65
|
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
60
66
|
};
|
|
61
|
-
__decorate([
|
|
62
|
-
Trace(),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [PopupAwareComponent]),
|
|
65
|
-
__metadata("design:returntype", void 0)
|
|
66
|
-
], AbstractPopupMenuComponent.prototype, "register", null);
|
|
67
67
|
//# sourceMappingURL=abstract-popup-menu.component.js.map
|
package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-popup-menu.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/abstract-popup-menu.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstract-popup-menu.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/abstract-popup-menu.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,GAAG,EAEH,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAkB,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AAMH,MAAM,OAAO,0BAA2B,SAAQ,mBAAmB;IAkBjE,YAAY,OAAmB,EAA2B,MAAuB;QAC/E,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAjBjB,uBAAkB,GAAG,IAAI,gBAAgB,EAAuB,CAAC;QAEtD,sBAAiB,GAAG,IAAI,oBAAoB,EAAe,CAAC;QACvE,qBAAgB,GAAG,IAAI,oBAAoB,EAAuB,CAAC;QAG3E,cAAS,GAAuB,OAAO,CAAC;QAGxC,cAAS,GAAsB,OAAO,CAAC;QASrC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAA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EAAE;aAEb;;;YAvBwC,UAAU;4CA0Cf,MAAM,SAAC,eAAe;;;wBAXvD,KAAK;wBAGL,KAAK;uBAGL,YAAY,SAAC,cAAc","sourcesContent":["import { AfterContentChecked, Component, ElementRef, Inject, Input, QueryList, ViewChildren } from '@angular/core';\nimport { MatMenuTrigger } from '@angular/material/menu';\n\nimport {\n DelegatingValueModel,\n Disposable,\n Dsl,\n ListModelChain,\n MutableListModel,\n Trace,\n ValueModelChain\n} from '@coolon/pectin';\nimport { CommandFace } from '../../command-face';\nimport { PopupAwareComponent } from '../popup-aware.component';\nimport { POPUP_CONTAINER, PopupContainer } from '../popup-container';\n\n/**\n *\n */\n@Component({\n selector: 'aup-abstract-popup-menu',\n template: '',\n styleUrls: []\n})\nexport class AbstractPopupMenuComponent extends PopupAwareComponent implements PopupContainer, AfterContentChecked {\n\n private _unorderedChildren = new MutableListModel<PopupAwareComponent>();\n\n protected readonly faceModelDelegate = new DelegatingValueModel<CommandFace>();\n private faceAdapterModel = new DelegatingValueModel<CommandFace.Adapter>();\n\n @Input()\n xPosition: 'before' | 'after' = 'after';\n\n @Input()\n yPosition: 'above' | 'below' = 'below';\n\n @ViewChildren(MatMenuTrigger)\n triggers: QueryList<MatMenuTrigger>;\n\n readonly children: ListModelChain<PopupAwareComponent>;\n\n constructor(element: ElementRef, @Inject(POPUP_CONTAINER) parent?: PopupContainer) {\n super(element, parent);\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n // TODO: get faceAdapter seems to get called during the super constuctor so we have to use a delegate\n // to avoid null pointers.\n this.faceAdapterModel.setDelegate(chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f)));\n\n this.children = chain(this._unorderedChildren).sortBy('componentIndex');\n }\n\n ngAfterContentChecked(): void {\n // force the list to re-order as the child indicies may have changed.\n this._unorderedChildren.value = [...this._unorderedChildren.value]\n }\n\n\n get faceAdapter(): CommandFace.Adapter {\n return this.faceAdapterModel.value;\n }\n\n isRoot() {\n return !this.parent;\n }\n\n // @Trace()\n register(component: PopupAwareComponent) {\n this._unorderedChildren.push(component);\n return Disposable.disposableThatRuns(() => {\n this._unorderedChildren.remove(component);\n });\n }\n\n onCommandFired() {\n this.triggers.forEach(trigger => {\n if (trigger.menuOpen) {\n trigger.closeMenu();\n }\n });\n }\n\n getFace(): CommandFace | undefined {\n return this.faceAdapter.face;\n }\n\n\n}\n"]}
|
package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractPopupMenuComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../popup-aware.component","name":"PopupAwareComponent","line":24,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":19,"character":1},"arguments":[{"selector":"aup-abstract-popup-menu","template":"","styleUrls":[]}]}],"members":{"xPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"yPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":37,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/material/menu","name":"MatMenuTrigger","line":37,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractPopupMenuComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../popup-aware.component","name":"PopupAwareComponent","line":24,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":19,"character":1},"arguments":[{"selector":"aup-abstract-popup-menu","template":"","styleUrls":[]}]}],"members":{"xPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"yPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":37,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/material/menu","name":"MatMenuTrigger","line":37,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":42,"character":36},"arguments":[{"__symbolic":"reference","module":"../popup-container","name":"POPUP_CONTAINER","line":42,"character":43}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":42,"character":23},{"__symbolic":"reference","module":"../popup-container","name":"PopupContainer","line":42,"character":69}]}],"ngAfterContentChecked":[{"__symbolic":"method"}],"isRoot":[{"__symbolic":"method"}],"register":[{"__symbolic":"method"}],"onCommandFired":[{"__symbolic":"method"}],"getFace":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-menu-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAqB,mBAAmB,EAAE,GAAG,EAAc,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,MAAM,OAAO,0BAA2B,SAAQ,mBAAmB;
|
|
1
|
+
{"version":3,"file":"popup-menu-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAqB,mBAAmB,EAAE,GAAG,EAAc,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,MAAM,OAAO,0BAA2B,SAAQ,mBAAmB;IA8BjE;QACE,KAAK,EAAE,CA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AC;IAChB,CAAC;;;YAnGF,SAAS,SAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,m0CAAmD;aACpD;;;;qBAOE,KAAK;4BAUL,SAAS,SAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;2BAGlC,MAAM;uBAGN,YAAY,SAAC,cAAc","sourcesContent":["import { Component, EventEmitter, Input, Output, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { MatMenu, MatMenuTrigger } from '@angular/material/menu';\nimport { Command, Constant, DelegatingListModel, Dsl, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../../../../disposable-component';\nimport { TrackBy } from '../../../../track-by';\nimport { CommandFace } from '../../../command-face';\nimport { CommandComponent } from '../../../command/command.component';\nimport { SeparatorComponent } from '../../../separator.component';\nimport { PopupAwareComponent } from '../../popup-aware.component';\nimport { AbstractPopupMenuComponent } from '../abstract-popup-menu.component';\nimport { PopupMenuComponent } from '../popup-menu.component';\n\n@Component({\n selector: 'aup-popup-menu-renderer',\n templateUrl: './popup-menu-renderer.component.html'\n})\nexport class PopupMenuRendererComponent extends DisposableComponent {\n\n private _parentComponent: PopupMenuComponent;\n\n private _childList = new DelegatingListModel<PopupAwareComponent>();\n\n @Input()\n get parent(): PopupMenuComponent {\n return this._parentComponent;\n }\n\n set parent(comp: PopupMenuComponent) {\n this._parentComponent = comp;\n this._childList.setDelegate(comp.children);\n }\n\n @ViewChild('menu', { static: true })\n menuComponent: MatMenu;\n\n @Output()\n commandFired = new EventEmitter();\n\n @ViewChildren(MatMenuTrigger)\n triggers: QueryList<MatMenuTrigger>;\n\n readonly hasMixedIcons: ValueModel<boolean>;\n readonly commandProxy: Command<unknown>;\n\n TrackBy = TrackBy;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n // this.children = chain(this.groupViewDataModel).pluckList('children');\n // this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');\n const faces = chain(this._childList).map(child => {\n return child.getFace();\n }).rejectNil();\n const icons = faces.select(face => !!CommandFace.getIconOf(face));\n const iconCount = icons.count();\n const totalFaces = faces.count();\n this.hasMixedIcons = valueOf.all(\n iconCount.isGreaterThan(0),\n totalFaces.doesNotEqual(iconCount)\n ).areTruthy();\n }\n\n get children(): PopupAwareComponent[] {\n return this.parent.children.value;\n }\n\n executeCommand(data: PopupAwareComponent) {\n if (this.isCommand(data)) {\n data.command.execute().finally(() => {\n this.commandFired.emit();\n });\n }\n }\n\n isEnabled(data: PopupAwareComponent) {\n return true;//ViewData.getCommand(data).enabled.value;\n }\n\n // @Trace()\n onCommandFired() {\n this.commandFired.emit();\n this.triggers.forEach(trigger => {\n if (trigger.menuOpen) {\n trigger.closeMenu();\n }\n });\n }\n\n isCommand(child: any): child is CommandComponent {\n return child instanceof CommandComponent;\n }\n\n isPopupMenu(child: any): child is AbstractPopupMenuComponent {\n return child instanceof AbstractPopupMenuComponent;\n }\n\n isSeparator(child: any): child is SeparatorComponent {\n return child instanceof SeparatorComponent;\n }\n\n getTooltip(child: any) {\n return this.isCommand(child) ? CommandFace.getTooltipOf(child.face) : undefined;\n }\n\n getFaces(child: PopupAwareComponent) {\n return this.isCommand(child) ?\n child.faces.value :\n this.isPopupMenu(child) ?\n [child.faceAdapter.face] :\n undefined;\n }\n}\n\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PopupMenuRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../../disposable-component","name":"DisposableComponent","line":16,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"aup-popup-menu-renderer","template":"<mat-menu #menu [xPosition]=\"parent.xPosition\" [yPosition]=\"parent.yPosition\">\n <ng-template matMenuContent>\n <ng-container *ngFor=\"let child of children; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"isCommand(child)\"\n (click)=\"executeCommand(child)\"\n [disabled]=\"!isEnabled(child)\"\n [matTooltip]=\"getTooltip(child)\"\n mat-menu-item>\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"isPopupMenu(child)\">\n <button mat-menu-item\n matMenuTrigger\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #innerPanel\n [parent]=\"child\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <mat-divider *ngIf=\"isSeparator(child)\"></mat-divider>\n\n </ng-container>\n\n </ng-template>\n</mat-menu>\n"}]}],"members":{"parent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PopupMenuRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../../disposable-component","name":"DisposableComponent","line":16,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"aup-popup-menu-renderer","template":"<mat-menu #menu [xPosition]=\"parent.xPosition\" [yPosition]=\"parent.yPosition\">\n <ng-template matMenuContent>\n <ng-container *ngFor=\"let child of children; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"isCommand(child)\"\n (click)=\"executeCommand(child)\"\n [disabled]=\"!isEnabled(child)\"\n [matTooltip]=\"getTooltip(child)\"\n mat-menu-item>\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"isPopupMenu(child)\">\n <button mat-menu-item\n matMenuTrigger\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #innerPanel\n [parent]=\"child\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <mat-divider *ngIf=\"isSeparator(child)\"></mat-divider>\n\n </ng-container>\n\n </ng-template>\n</mat-menu>\n"}]}],"members":{"parent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"menuComponent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":32,"character":3},"arguments":["menu",{"static":true}]}]}],"commandFired":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":35,"character":3}}]}],"triggers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":38,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/material/menu","name":"MatMenuTrigger","line":38,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"executeCommand":[{"__symbolic":"method"}],"isEnabled":[{"__symbolic":"method"}],"onCommandFired":[{"__symbolic":"method"}],"isCommand":[{"__symbolic":"method"}],"isPopupMenu":[{"__symbolic":"method"}],"isSeparator":[{"__symbolic":"method"}],"getTooltip":[{"__symbolic":"method"}],"getFaces":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-menu.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/popup-menu.component.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"popup-menu.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/group/popup-menu/popup-menu.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9G,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAkB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AASH,MAAM,OAAO,kBAAmB,SAAQ,0BAA0B;IAQhE,YAAY,OAAmB,EAAmD,MAAuB;QACvG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzF,yEAAyE;IAC3E,CAAC;;;YApBF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,s1EAA0C;gBAE1C,SAAS,EAAC;oBACR,EAAC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAC;iBAC5D;aACF;;;YAjBwC,UAAU;4CA0Bf,MAAM,SAAC,eAAe,cAAG,QAAQ,YAAI,QAAQ;;;wBAN9E,KAAK;mBAGL,KAAK;;AAFN;IADU,aAAa,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;8BACjD,UAAU;qDAAc;AAGnC;IADU,iBAAiB,CAAC,WAAW,CAAC;;gDACtB","sourcesContent":["import { AfterContentChecked, Component, ElementRef, Inject, Input, Optional, SkipSelf } from '@angular/core';\n\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { CommandFace } from '../../command-face';\nimport { POPUP_CONTAINER, PopupContainer } from '../popup-container';\nimport { AbstractPopupMenuComponent } from './abstract-popup-menu.component';\n\n/**\n *\n */\n@Component({\n selector: 'aup-popup-menu',\n templateUrl: './popup-menu.component.html',\n styleUrls: [],\n providers:[\n {provide: POPUP_CONTAINER, useExisting: PopupMenuComponent}\n ]\n})\nexport class PopupMenuComponent extends AbstractPopupMenuComponent {\n\n @Input() @TrackExternal({ delegateTo: 'faceModelDelegate' })\n faceModel: ValueModel<CommandFace>;\n\n @Input() @StoreInValueModel('faceModel')\n face: CommandFace;\n\n constructor(element: ElementRef, @Inject(POPUP_CONTAINER) @Optional() @SkipSelf() parent?: PopupContainer) {\n super(element, parent);\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n // group.faceListModel = chain(this.faceModel).mapToList(face => [face]);\n }\n\n\n\n}\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Component, ElementRef, HostBinding, Optional } from '@angular/core';
|
|
1
|
+
import { Component, ElementRef, HostBinding, Inject, Optional } from '@angular/core';
|
|
2
2
|
import { CommandContainer } from './group/command-container';
|
|
3
3
|
import { PopupAwareComponent } from './group/popup-aware.component';
|
|
4
|
-
import {
|
|
4
|
+
import { POPUP_CONTAINER } from './group/popup-container';
|
|
5
5
|
import { ToolBarComponent } from './group/tool-bar/tool-bar.component';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
export class SeparatorComponent extends PopupAwareComponent {
|
|
10
|
-
constructor(element, containerParent) {
|
|
11
|
-
super(element,
|
|
10
|
+
constructor(element, popupContainer, containerParent) {
|
|
11
|
+
super(element, popupContainer);
|
|
12
12
|
this.containerParent = containerParent;
|
|
13
13
|
}
|
|
14
14
|
isHorizontalContainer() {
|
|
@@ -33,6 +33,7 @@ SeparatorComponent.decorators = [
|
|
|
33
33
|
];
|
|
34
34
|
SeparatorComponent.ctorParameters = () => [
|
|
35
35
|
{ type: ElementRef },
|
|
36
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [POPUP_CONTAINER,] }] },
|
|
36
37
|
{ type: CommandContainer, decorators: [{ type: Optional }] }
|
|
37
38
|
];
|
|
38
39
|
SeparatorComponent.propDecorators = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/separator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"separator.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/separator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAkB,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE;;GAEG;AAcH,MAAM,OAAO,kBAAmB,SAAQ,mBAAmB;IAEzD,YAAY,OAAmB,EACkB,cAA6B,EACrC,eAAkC;QACzE,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QADQ,oBAAe,GAAf,eAAe,CAAmB;IAE3E,CAAC;IAGD,qBAAqB;QACnB,OAAO,IAAI,CAAC,eAAe,YAAY,gBAAgB,IAAI,IAAI,CAAC,eAAe,CAAC,WAAW,KAAK,gBAAgB,CAAC,WAAW,CAAC,UAAU,CAAC;IAC1I,CAAC;IAED,QAAQ;IACR,CAAC;;;YA3BF,SAAS,SAAC;gBACT,QAAQ,EAAE,eAAe;gBACzB,QAAQ,EAAE;sEAC0D;yBAC3D;IACP;oBACA;;;;MAIE;aAEL;;;YAvBmB,UAAU;4CA2Bf,QAAQ,YAAI,MAAM,SAAC,eAAe;YAzBxC,gBAAgB,uBA0BV,QAAQ;;;oCAIpB,WAAW,SAAC,4BAA4B","sourcesContent":["import { Component, ElementRef, HostBinding, Inject, OnInit, Optional } from '@angular/core';\nimport { DisposableComponent } from '../disposable-component';\nimport { CommandContainer } from './group/command-container';\nimport { PopupAwareComponent } from './group/popup-aware.component';\nimport { POPUP_CONTAINER, PopupContainer } from './group/popup-container';\nimport { AbstractPopupMenuComponent } from './group/popup-menu/abstract-popup-menu.component';\nimport { ToolBarComponent } from './group/tool-bar/tool-bar.component';\n\n/**\n *\n */\n@Component({\n selector: 'aup-separator',\n template: `\n <mat-divider [vertical]=\"!isHorizontalContainer()\"></mat-divider>`,\n styles: [`:host {\n }`,\n `:host(.horizontal-container) {\n display: inline-flex;\n flex-direction: row;\n align-items: stretch;\n }`\n ]\n})\nexport class SeparatorComponent extends PopupAwareComponent implements OnInit {\n\n constructor(element: ElementRef,\n @Optional() @Inject(POPUP_CONTAINER) popupContainer:PopupContainer,\n @Optional() private readonly containerParent?: CommandContainer) {\n super(element, popupContainer);\n }\n\n @HostBinding('class.horizontal-container')\n isHorizontalContainer() {\n return this.containerParent instanceof ToolBarComponent && this.containerParent.orientation === CommandContainer.Orientation.HORIZONTAL;\n }\n\n ngOnInit() {\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"SeparatorComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./group/popup-aware.component","name":"PopupAwareComponent","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"SeparatorComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./group/popup-aware.component","name":"PopupAwareComponent","line":24,"character":40},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"aup-separator","template":"\n <mat-divider [vertical]=\"!isHorizontalContainer()\"></mat-divider>","styles":[":host {\n }",":host(.horizontal-container) {\n display: inline-flex;\n flex-direction: row;\n align-items: stretch;\n }"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":27,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":27,"character":27},"arguments":[{"__symbolic":"reference","module":"./group/popup-container","name":"POPUP_CONTAINER","line":27,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":28,"character":15}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":26,"character":23},{"__symbolic":"reference","module":"./group/popup-container","name":"PopupContainer","line":27,"character":66},{"__symbolic":"reference","module":"./group/command-container","name":"CommandContainer","line":28,"character":61}]}],"isHorizontalContainer":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":32,"character":3},"arguments":["class.horizontal-container"]}]}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
|
|
@@ -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, InjectionToken,
|
|
2
|
+
import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, InjectionToken, ViewEncapsulation, HostBinding, ViewChildren, SkipSelf, EventEmitter, ViewChild, Output, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, 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, ValueModel, StoreInValueModel, MutableListModel, Disposable,
|
|
21
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, ValueModel, StoreInValueModel, MutableListModel, Disposable, DelegatingListModel, StoreInListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, 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';
|
|
@@ -521,6 +521,9 @@ class PopupAwareComponent extends DisposableComponent {
|
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
get componentIndex() {
|
|
524
|
+
return this.computeComponentIndex();
|
|
525
|
+
}
|
|
526
|
+
computeComponentIndex() {
|
|
524
527
|
let node = this.element.nativeElement;
|
|
525
528
|
let index = 0;
|
|
526
529
|
while ((node = node.previousElementSibling)) {
|
|
@@ -623,66 +626,6 @@ class CommandContainer extends GarbageCollector {
|
|
|
623
626
|
CommandContainer.Orientation = Enum({ HORIZONTAL: 'horizontal', VERTICAL: 'vertical' });
|
|
624
627
|
})(CommandContainer || (CommandContainer = {}));
|
|
625
628
|
|
|
626
|
-
/**
|
|
627
|
-
*
|
|
628
|
-
*/
|
|
629
|
-
class AbstractPopupMenuComponent extends PopupAwareComponent {
|
|
630
|
-
constructor(element, parent) {
|
|
631
|
-
super(element, parent);
|
|
632
|
-
this._unorderedChildren = new MutableListModel();
|
|
633
|
-
this.faceModelDelegate = new DelegatingValueModel();
|
|
634
|
-
this.xPosition = 'after';
|
|
635
|
-
this.yPosition = 'below';
|
|
636
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
637
|
-
// group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
|
|
638
|
-
this.faceAdapterModel = chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f));
|
|
639
|
-
this.children = chain(this._unorderedChildren).sortBy('componentIndex');
|
|
640
|
-
}
|
|
641
|
-
get faceAdapter() {
|
|
642
|
-
return this.faceAdapterModel.value;
|
|
643
|
-
}
|
|
644
|
-
isRoot() {
|
|
645
|
-
return !this.parent;
|
|
646
|
-
}
|
|
647
|
-
register(component) {
|
|
648
|
-
this._unorderedChildren.push(component);
|
|
649
|
-
return Disposable.disposableThatRuns(() => {
|
|
650
|
-
this._unorderedChildren.remove(component);
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
onCommandFired() {
|
|
654
|
-
this.triggers.forEach(trigger => {
|
|
655
|
-
if (trigger.menuOpen) {
|
|
656
|
-
trigger.closeMenu();
|
|
657
|
-
}
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
getFace() {
|
|
661
|
-
return this.faceAdapter.face;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
AbstractPopupMenuComponent.decorators = [
|
|
665
|
-
{ type: Component, args: [{
|
|
666
|
-
selector: 'aup-abstract-popup-menu',
|
|
667
|
-
template: ''
|
|
668
|
-
},] }
|
|
669
|
-
];
|
|
670
|
-
AbstractPopupMenuComponent.ctorParameters = () => [
|
|
671
|
-
{ type: ElementRef },
|
|
672
|
-
{ type: undefined, decorators: [{ type: Inject, args: [POPUP_CONTAINER,] }] }
|
|
673
|
-
];
|
|
674
|
-
AbstractPopupMenuComponent.propDecorators = {
|
|
675
|
-
xPosition: [{ type: Input }],
|
|
676
|
-
yPosition: [{ type: Input }],
|
|
677
|
-
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
678
|
-
};
|
|
679
|
-
__decorate([
|
|
680
|
-
Trace(),
|
|
681
|
-
__metadata("design:type", Function),
|
|
682
|
-
__metadata("design:paramtypes", [PopupAwareComponent]),
|
|
683
|
-
__metadata("design:returntype", void 0)
|
|
684
|
-
], AbstractPopupMenuComponent.prototype, "register", null);
|
|
685
|
-
|
|
686
629
|
/**
|
|
687
630
|
*
|
|
688
631
|
*/
|
|
@@ -718,8 +661,8 @@ ToolBarComponent.ctorParameters = () => [];
|
|
|
718
661
|
*
|
|
719
662
|
*/
|
|
720
663
|
class SeparatorComponent extends PopupAwareComponent {
|
|
721
|
-
constructor(element, containerParent) {
|
|
722
|
-
super(element,
|
|
664
|
+
constructor(element, popupContainer, containerParent) {
|
|
665
|
+
super(element, popupContainer);
|
|
723
666
|
this.containerParent = containerParent;
|
|
724
667
|
}
|
|
725
668
|
isHorizontalContainer() {
|
|
@@ -744,12 +687,74 @@ SeparatorComponent.decorators = [
|
|
|
744
687
|
];
|
|
745
688
|
SeparatorComponent.ctorParameters = () => [
|
|
746
689
|
{ type: ElementRef },
|
|
690
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [POPUP_CONTAINER,] }] },
|
|
747
691
|
{ type: CommandContainer, decorators: [{ type: Optional }] }
|
|
748
692
|
];
|
|
749
693
|
SeparatorComponent.propDecorators = {
|
|
750
694
|
isHorizontalContainer: [{ type: HostBinding, args: ['class.horizontal-container',] }]
|
|
751
695
|
};
|
|
752
696
|
|
|
697
|
+
/**
|
|
698
|
+
*
|
|
699
|
+
*/
|
|
700
|
+
class AbstractPopupMenuComponent extends PopupAwareComponent {
|
|
701
|
+
constructor(element, parent) {
|
|
702
|
+
super(element, parent);
|
|
703
|
+
this._unorderedChildren = new MutableListModel();
|
|
704
|
+
this.faceModelDelegate = new DelegatingValueModel();
|
|
705
|
+
this.faceAdapterModel = new DelegatingValueModel();
|
|
706
|
+
this.xPosition = 'after';
|
|
707
|
+
this.yPosition = 'below';
|
|
708
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
709
|
+
// TODO: get faceAdapter seems to get called during the super constuctor so we have to use a delegate
|
|
710
|
+
// to avoid null pointers.
|
|
711
|
+
this.faceAdapterModel.setDelegate(chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f)));
|
|
712
|
+
this.children = chain(this._unorderedChildren).sortBy('componentIndex');
|
|
713
|
+
}
|
|
714
|
+
ngAfterContentChecked() {
|
|
715
|
+
// force the list to re-order as the child indicies may have changed.
|
|
716
|
+
this._unorderedChildren.value = [...this._unorderedChildren.value];
|
|
717
|
+
}
|
|
718
|
+
get faceAdapter() {
|
|
719
|
+
return this.faceAdapterModel.value;
|
|
720
|
+
}
|
|
721
|
+
isRoot() {
|
|
722
|
+
return !this.parent;
|
|
723
|
+
}
|
|
724
|
+
// @Trace()
|
|
725
|
+
register(component) {
|
|
726
|
+
this._unorderedChildren.push(component);
|
|
727
|
+
return Disposable.disposableThatRuns(() => {
|
|
728
|
+
this._unorderedChildren.remove(component);
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
onCommandFired() {
|
|
732
|
+
this.triggers.forEach(trigger => {
|
|
733
|
+
if (trigger.menuOpen) {
|
|
734
|
+
trigger.closeMenu();
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
getFace() {
|
|
739
|
+
return this.faceAdapter.face;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
AbstractPopupMenuComponent.decorators = [
|
|
743
|
+
{ type: Component, args: [{
|
|
744
|
+
selector: 'aup-abstract-popup-menu',
|
|
745
|
+
template: ''
|
|
746
|
+
},] }
|
|
747
|
+
];
|
|
748
|
+
AbstractPopupMenuComponent.ctorParameters = () => [
|
|
749
|
+
{ type: ElementRef },
|
|
750
|
+
{ type: undefined, decorators: [{ type: Inject, args: [POPUP_CONTAINER,] }] }
|
|
751
|
+
];
|
|
752
|
+
AbstractPopupMenuComponent.propDecorators = {
|
|
753
|
+
xPosition: [{ type: Input }],
|
|
754
|
+
yPosition: [{ type: Input }],
|
|
755
|
+
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
756
|
+
};
|
|
757
|
+
|
|
753
758
|
/**
|
|
754
759
|
*
|
|
755
760
|
*/
|