@coolon/angular-ui-powerups 3.7.0-alpha.9 → 3.7.1
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 +21 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +20 -14
- 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 +11 -9
- 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/fesm2015/coolon-angular-ui-powerups.js +14 -8
- 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/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';
|
|
@@ -20,12 +19,21 @@ export class AbstractPopupMenuComponent extends PopupAwareComponent {
|
|
|
20
19
|
this.faceAdapterModel = chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f));
|
|
21
20
|
this.children = chain(this._unorderedChildren).sortBy('componentIndex');
|
|
22
21
|
}
|
|
22
|
+
ngAfterContentChecked() {
|
|
23
|
+
// force the list to re-order as the child indicies may have changed.
|
|
24
|
+
this._unorderedChildren.value = [...this._unorderedChildren.value];
|
|
25
|
+
}
|
|
23
26
|
get faceAdapter() {
|
|
24
|
-
|
|
27
|
+
var _a;
|
|
28
|
+
if (!this.faceAdapterModel) {
|
|
29
|
+
console.error("Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on");
|
|
30
|
+
}
|
|
31
|
+
return (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value;
|
|
25
32
|
}
|
|
26
33
|
isRoot() {
|
|
27
34
|
return !this.parent;
|
|
28
35
|
}
|
|
36
|
+
// @Trace()
|
|
29
37
|
register(component) {
|
|
30
38
|
this._unorderedChildren.push(component);
|
|
31
39
|
return Disposable.disposableThatRuns(() => {
|
|
@@ -58,10 +66,4 @@ AbstractPopupMenuComponent.propDecorators = {
|
|
|
58
66
|
yPosition: [{ type: Input }],
|
|
59
67
|
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
60
68
|
};
|
|
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
69
|
//# 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"],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AkB,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACpE,CAAC;IAGD,IAAI,WAAW;;QACb,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,OAAO,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAA;SAC3G;QACD,aAAO,IAAI,CAAC,gBAAgB,0CAAE,KAAK,CAAC;IACtC,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;IACtB,CAAC;IAED,WAAW;IACX,QAAQ,CAAC,SAA8B;QACrC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,OAAO,UAAU,CAAC,kBAAkB,CAAC,GAAG,EAAE;YACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC9B,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACpB,OAAO,CAAC,SAAS,EAAE,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;;;YArEF,SAAS,SAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,QAAQ,EAAE,EAAE;aAEb;;;YAvBwC,UAAU;4CA2Cf,MAAM,SAAC,eAAe;;;wBAZvD,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: ValueModelChain<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\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 // group.faceListModel = chain(this.faceModel).mapToList(face => [face]);\n\n this.faceAdapterModel = 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 if (!this.faceAdapterModel) {\n console.error(\"Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on\")\n }\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":43,"character":36},"arguments":[{"__symbolic":"reference","module":"../popup-container","name":"POPUP_CONTAINER","line":43,"character":43}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":43,"character":23},{"__symbolic":"reference","module":"../popup-container","name":"PopupContainer","line":43,"character":69}]}],"
|
|
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":43,"character":36},"arguments":[{"__symbolic":"reference","module":"../popup-container","name":"POPUP_CONTAINER","line":43,"character":43}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":43,"character":23},{"__symbolic":"reference","module":"../popup-container","name":"PopupContainer","line":43,"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,CAAC;QA3BF,eAAU,GAAG,IAAI,mBAAmB,EAAuB,CAAC;QAgBpE,iBAAY,GAAG,IAAI,YAAY,EAAE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;;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"]}
|
|
@@ -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)) {
|
|
@@ -706,12 +709,21 @@ class AbstractPopupMenuComponent extends PopupAwareComponent {
|
|
|
706
709
|
this.faceAdapterModel = chain(this.faceModelDelegate).map(f => new CommandFace.Adapter(f));
|
|
707
710
|
this.children = chain(this._unorderedChildren).sortBy('componentIndex');
|
|
708
711
|
}
|
|
712
|
+
ngAfterContentChecked() {
|
|
713
|
+
// force the list to re-order as the child indicies may have changed.
|
|
714
|
+
this._unorderedChildren.value = [...this._unorderedChildren.value];
|
|
715
|
+
}
|
|
709
716
|
get faceAdapter() {
|
|
710
|
-
|
|
717
|
+
var _a;
|
|
718
|
+
if (!this.faceAdapterModel) {
|
|
719
|
+
console.error("Somehow faceAdapterModel is nil -- set a break point here and let me know what's going on");
|
|
720
|
+
}
|
|
721
|
+
return (_a = this.faceAdapterModel) === null || _a === void 0 ? void 0 : _a.value;
|
|
711
722
|
}
|
|
712
723
|
isRoot() {
|
|
713
724
|
return !this.parent;
|
|
714
725
|
}
|
|
726
|
+
// @Trace()
|
|
715
727
|
register(component) {
|
|
716
728
|
this._unorderedChildren.push(component);
|
|
717
729
|
return Disposable.disposableThatRuns(() => {
|
|
@@ -744,12 +756,6 @@ AbstractPopupMenuComponent.propDecorators = {
|
|
|
744
756
|
yPosition: [{ type: Input }],
|
|
745
757
|
triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
|
|
746
758
|
};
|
|
747
|
-
__decorate([
|
|
748
|
-
Trace(),
|
|
749
|
-
__metadata("design:type", Function),
|
|
750
|
-
__metadata("design:paramtypes", [PopupAwareComponent]),
|
|
751
|
-
__metadata("design:returntype", void 0)
|
|
752
|
-
], AbstractPopupMenuComponent.prototype, "register", null);
|
|
753
759
|
|
|
754
760
|
/**
|
|
755
761
|
*
|