@coolon/angular-ui-powerups 12.4.0-alpha.18 → 12.4.0-alpha.2
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/assets/styles.scss +0 -1
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js +241 -520
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +7 -2
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/cypress/components/aup-command-face.d.ts +4 -5
- package/cypress/components/aup-command.d.ts +1 -1
- package/cypress/components/aup-input.d.ts +5 -11
- package/cypress/components/aup-popup-menu.d.ts +2 -1
- package/cypress/components/aup-table.d.ts +3 -29
- package/cypress/components/{form-element-mixin.d.ts → button-mixin.d.ts} +6 -7
- package/cypress/components/button.d.ts +6 -8
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/exports.d.ts +2 -11
- package/cypress/page-element.d.ts +9 -8
- package/cypress/page.d.ts +33 -5
- package/cypress/section.d.ts +51 -0
- package/esm2015/cypress/components/aup-command-face.js +6 -6
- package/esm2015/cypress/components/aup-command-face.js.map +1 -1
- package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
- package/esm2015/cypress/components/aup-command.js +4 -12
- package/esm2015/cypress/components/aup-command.js.map +1 -1
- package/esm2015/cypress/components/aup-command.metadata.json +1 -1
- package/esm2015/cypress/components/aup-input.js +5 -17
- package/esm2015/cypress/components/aup-input.js.map +1 -1
- package/esm2015/cypress/components/aup-input.metadata.json +1 -1
- package/esm2015/cypress/components/aup-navigation.js +1 -1
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.js +3 -3
- package/esm2015/cypress/components/aup-popup-menu.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.metadata.json +1 -1
- package/esm2015/cypress/components/aup-table.js +7 -85
- package/esm2015/cypress/components/aup-table.js.map +1 -1
- package/esm2015/cypress/components/aup-table.metadata.json +1 -1
- package/esm2015/cypress/components/button-mixin.js +15 -0
- package/esm2015/cypress/components/button-mixin.js.map +1 -0
- package/esm2015/cypress/components/button-mixin.metadata.json +1 -0
- package/esm2015/cypress/components/button.js +10 -4
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/exports.js +2 -11
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-element.js +18 -21
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +10 -8
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/esm2015/cypress/path.js +1 -3
- package/esm2015/cypress/path.js.map +1 -1
- package/esm2015/cypress/section.js +58 -0
- package/esm2015/cypress/section.js.map +1 -0
- package/esm2015/cypress/section.metadata.json +1 -0
- package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
- package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
- package/esm2015/lib/place/url-snapshot.js +7 -1
- package/esm2015/lib/place/url-snapshot.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups-cypress.js +168 -414
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +7 -2
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
- package/assets/empty-state.scss +0 -11
- package/cypress/builder.d.ts +0 -39
- package/cypress/components/aup-abstract-activity.d.ts +0 -9
- package/cypress/components/aup-activity.d.ts +0 -9
- package/cypress/components/aup-alert.d.ts +0 -9
- package/cypress/components/aup-empty-state.d.ts +0 -4
- package/cypress/components/aup-modal-activity.d.ts +0 -4
- package/cypress/components/aup-modal-alert.d.ts +0 -7
- package/cypress/components/mat-checkbox.d.ts +0 -29
- package/cypress/element-locator.d.ts +0 -10
- package/cypress/page-builder.d.ts +0 -8
- package/esm2015/cypress/builder.js +0 -97
- package/esm2015/cypress/builder.js.map +0 -1
- package/esm2015/cypress/builder.metadata.json +0 -1
- package/esm2015/cypress/components/aup-abstract-activity.js +0 -12
- package/esm2015/cypress/components/aup-abstract-activity.js.map +0 -1
- package/esm2015/cypress/components/aup-abstract-activity.metadata.json +0 -1
- package/esm2015/cypress/components/aup-activity.js +0 -13
- package/esm2015/cypress/components/aup-activity.js.map +0 -1
- package/esm2015/cypress/components/aup-activity.metadata.json +0 -1
- package/esm2015/cypress/components/aup-alert.js +0 -13
- package/esm2015/cypress/components/aup-alert.js.map +0 -1
- package/esm2015/cypress/components/aup-alert.metadata.json +0 -1
- package/esm2015/cypress/components/aup-empty-state.js +0 -7
- package/esm2015/cypress/components/aup-empty-state.js.map +0 -1
- package/esm2015/cypress/components/aup-empty-state.metadata.json +0 -1
- package/esm2015/cypress/components/aup-modal-activity.js +0 -7
- package/esm2015/cypress/components/aup-modal-activity.js.map +0 -1
- package/esm2015/cypress/components/aup-modal-activity.metadata.json +0 -1
- package/esm2015/cypress/components/aup-modal-alert.js +0 -12
- package/esm2015/cypress/components/aup-modal-alert.js.map +0 -1
- package/esm2015/cypress/components/aup-modal-alert.metadata.json +0 -1
- package/esm2015/cypress/components/form-element-mixin.js +0 -11
- package/esm2015/cypress/components/form-element-mixin.js.map +0 -1
- package/esm2015/cypress/components/form-element-mixin.metadata.json +0 -1
- package/esm2015/cypress/components/mat-checkbox.js +0 -34
- package/esm2015/cypress/components/mat-checkbox.js.map +0 -1
- package/esm2015/cypress/components/mat-checkbox.metadata.json +0 -1
- package/esm2015/cypress/element-locator.js +0 -22
- package/esm2015/cypress/element-locator.js.map +0 -1
- package/esm2015/cypress/element-locator.metadata.json +0 -1
- package/esm2015/cypress/page-builder.js +0 -15
- package/esm2015/cypress/page-builder.js.map +0 -1
- package/esm2015/cypress/page-builder.metadata.json +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Mixin as CreateMixin } from '@coolon/typescript-utilities';
|
|
2
|
+
import { AupCommand } from './components/aup-command';
|
|
3
|
+
import { AupInput } from './components/aup-input';
|
|
4
|
+
import { AupNavigation } from './components/aup-navigation';
|
|
5
|
+
import { AupTable } from './components/aup-table';
|
|
6
|
+
import { Button } from './components/button';
|
|
7
|
+
import { PageElement } from './page-element';
|
|
8
|
+
export var Section;
|
|
9
|
+
(function (Section) {
|
|
10
|
+
function Mixin(Base) {
|
|
11
|
+
return class extends Base {
|
|
12
|
+
section(selector, section) {
|
|
13
|
+
const impl = new Impl(() => this.element(), selector);
|
|
14
|
+
return CreateMixin.createProxy(section(impl), impl);
|
|
15
|
+
}
|
|
16
|
+
find(selector) {
|
|
17
|
+
return new PageElement(() => this.element(), selector);
|
|
18
|
+
}
|
|
19
|
+
contains(text) {
|
|
20
|
+
return new PageElement(() => this.element(), {
|
|
21
|
+
findIn: parent => parent.contains(text),
|
|
22
|
+
shouldNotExist: (parent) => parent.should('not.contain', text)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
button(text) {
|
|
26
|
+
return new Button(() => this.element(), text);
|
|
27
|
+
}
|
|
28
|
+
aupStringInput(selector) {
|
|
29
|
+
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
30
|
+
}
|
|
31
|
+
aupTextInput(selector) {
|
|
32
|
+
return new AupInput.TextAreaInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
33
|
+
}
|
|
34
|
+
aupPasswordInput(selector) {
|
|
35
|
+
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
36
|
+
}
|
|
37
|
+
aupNumberInput(selector) {
|
|
38
|
+
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
39
|
+
}
|
|
40
|
+
aupCommand(face) {
|
|
41
|
+
return new AupCommand(this, face);
|
|
42
|
+
}
|
|
43
|
+
aupTabbedNavigation() {
|
|
44
|
+
return new AupNavigation(this, 'aup-tabbed-place-navigation');
|
|
45
|
+
}
|
|
46
|
+
aupSideNavigation() {
|
|
47
|
+
return new AupNavigation(() => this.element(), 'aup-list-place-nav');
|
|
48
|
+
}
|
|
49
|
+
aupTable(selector) {
|
|
50
|
+
return new AupTable(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-table');
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
Section.Mixin = Mixin;
|
|
55
|
+
class Impl extends Mixin(PageElement) {
|
|
56
|
+
}
|
|
57
|
+
})(Section || (Section = {}));
|
|
58
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/section.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAsC7C,MAAM,KAAW,OAAO,CA+EvB;AA/ED,WAAiB,OAAO;IAEtB,SAAgB,KAAK,CAAwC,IAAQ;QAEnE,OAAO,KAAM,SAAQ,IAAI;YAEvB,OAAO,CAAmB,QAAgB,EAAE,OAAgC;gBAC1E,MAAM,IAAI,GAAG,IAAI,IAAI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AC,OAAO,EAAE,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,oBAAoB,CAAC,CAAC;YACxF,CAAC;YAED,cAAc,CAAC,QAAiB;gBAC9B,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,kBAAkB,CAAC,CAAC;YACtF,CAAC;YAED,UAAU,CAAC,IAAuB;gBAChC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC;YAED,mBAAmB;gBACjB,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;YAChE,CAAC;YAED,iBAAiB;gBACf,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,oBAAoB,CAAC,CAAC;YACvE,CAAC;YAED,QAAQ,CAAC,QAAiB;gBACxB,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,WAAW,CAAC,CAAC;YACrE,CAAC;SAgBF,CAAC;IACJ,CAAC;IAvEe,aAAK,QAuEpB,CAAA;IAED,MAAM,IAAK,SAAQ,KAAK,CAAC,WAAW,CAAC;KACpC;AAGH,CAAC,EA/EgB,OAAO,KAAP,OAAO,QA+EvB","sourcesContent":["import { Constructable } from '@coolon/pectin';\nimport { Mixin as CreateMixin } from '@coolon/typescript-utilities';\nimport { AupCommand } from './components/aup-command';\nimport { AupInput } from './components/aup-input';\nimport { AupNavigation } from './components/aup-navigation';\nimport { AupTable } from './components/aup-table';\nimport { Button } from './components/button';\nimport { Types } from './components/types';\nimport { PageElement } from './page-element';\n\nexport interface Section {\n section<T extends object>(selector: string, section: (section: Section) => T): T & PageElement;\n\n find(selector: string): PageElement;\n\n contains(text: string): PageElement;\n\n button(text: string): Button;\n\n aupStringInput(selector?: string): AupInput<string>;\n\n aupTextInput(selector?: string): AupInput<string>;\n\n aupPasswordInput(selector?: string): AupInput<string>;\n\n aupNumberInput(selector?: string): AupInput<number>;\n\n aupCommand(face: Types.CommandFace): AupCommand\n\n // aupToolbar<T extends object>(builder: () => T): AupToolBar & T\n //\n // aupToolbar<T extends object>(selector: string, builder: () => T): AupToolBar & T\n //\n // aupToolbar<T extends object>(selectorOrBuilder: string | (() => T), builder?: () => T): AupToolBar & T\n //\n // aupPopupMenu<T extends object>(face: CommandFace, builder: () => T): AupPopupMenu & T\n\n aupTabbedNavigation<T extends object>(): AupNavigation;\n\n aupSideNavigation<T extends object>(): AupNavigation;\n\n aupTable(selector?: string): AupTable;\n\n}\n\n\nexport namespace Section {\n\n export function Mixin<BC extends Constructable<PageElement>>(Base: BC) {\n\n return class extends Base implements Section {\n\n section<T extends object>(selector: string, section: (section: Section) => T): T & PageElement {\n const impl = new Impl(() => this.element(), selector);\n return CreateMixin.createProxy(section(impl), impl);\n }\n\n find(selector: string): PageElement {\n return new PageElement(() => this.element(), selector);\n }\n\n contains(text: string): PageElement {\n return new PageElement(() => this.element(), {\n findIn: parent => parent.contains(text),\n shouldNotExist: (parent: Cypress.Chainable<JQuery>) => parent.should('not.contain', text)\n });\n }\n\n button(text: string): Button {\n return new Button(() => this.element(), text);\n }\n\n aupStringInput(selector?: string): AupInput<string> {\n return new AupInput.HtmlInput(() => this.element(), selector ?? 'aup-string-input');\n }\n\n aupTextInput(selector?: string): AupInput<string> {\n return new AupInput.TextAreaInput(() => this.element(), selector ?? 'aup-text-input');\n }\n\n aupPasswordInput(selector?: string): AupInput<string> {\n return new AupInput.HtmlInput(() => this.element(), selector ?? 'aup-password-input');\n }\n\n aupNumberInput(selector?: string): AupInput<number> {\n return new AupInput.HtmlInput(() => this.element(), selector ?? 'aup-number-input');\n }\n\n aupCommand(face: Types.CommandFace): AupCommand {\n return new AupCommand(this, face);\n }\n\n aupTabbedNavigation<T extends object>(): AupNavigation {\n return new AupNavigation(this, 'aup-tabbed-place-navigation');\n }\n\n aupSideNavigation<T extends object>(): AupNavigation {\n return new AupNavigation(() => this.element(), 'aup-list-place-nav');\n }\n\n aupTable(selector?: string): AupTable {\n return new AupTable(() => this.element(), selector ?? 'aup-table');\n }\n\n // aupToolbar<T extends object>(builder: () => T): AupToolBar\n // aupToolbar<T extends object>(selector: string, builder: () => T): AupToolBar\n // aupToolbar<T extends object>(selectorOrBuilder: string | (() => T), builder?: () => T): AupToolBar {\n // return lang.notImplemented();\n // }\n //\n // aupPopupMenu<T extends object>(face: CommandFace, builder: () => T): AupPopupMenu & T {\n // return lang.notImplemented();\n // }\n //\n // aupMoreMenu<T extends object>(builder: () => T): AupPopupMenu & T {\n // return lang.notImplemented();\n // }\n\n };\n }\n\n class Impl extends Mixin(PageElement) {\n }\n\n\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"Section":{"__symbolic":"interface"}}}]
|
|
@@ -13,7 +13,7 @@ EmptyStateComponent.decorators = [
|
|
|
13
13
|
<ng-content></ng-content>
|
|
14
14
|
</div>
|
|
15
15
|
`,
|
|
16
|
-
styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{
|
|
16
|
+
styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
|
|
17
17
|
},] }
|
|
18
18
|
];
|
|
19
19
|
EmptyStateComponent.ctorParameters = () => [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"EmptyStateComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"aup-empty-state","template":"\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ","styles":[":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"EmptyStateComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"aup-empty-state","template":"\n <div class=\"container\">\n <ng-content></ng-content>\n </div>\n ","styles":[":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { UrlSegment } from '@angular/router';
|
|
3
|
+
import { Trace } from '@coolon/pectin';
|
|
3
4
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
4
5
|
import _ from 'lodash';
|
|
5
6
|
import { ConsolidatedParameterMap } from './guards/consolidated-param-map';
|
|
@@ -14,7 +15,6 @@ export class UrlSnapshot {
|
|
|
14
15
|
this.url = url;
|
|
15
16
|
this.urlTree = urlSerializer.parse(url);
|
|
16
17
|
}
|
|
17
|
-
// @Trace()
|
|
18
18
|
updateVisitSegments(visit) {
|
|
19
19
|
const newUrlTree = this.urlSerializer.parse(this.url);
|
|
20
20
|
// Ugly, but it works for now.
|
|
@@ -91,6 +91,12 @@ export class UrlSnapshot {
|
|
|
91
91
|
return `UrlSnapshot(${this.url})`;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
__decorate([
|
|
95
|
+
Trace(),
|
|
96
|
+
__metadata("design:type", Function),
|
|
97
|
+
__metadata("design:paramtypes", [Visit]),
|
|
98
|
+
__metadata("design:returntype", UrlSnapshot)
|
|
99
|
+
], UrlSnapshot.prototype, "updateVisitSegments", null);
|
|
94
100
|
__decorate([
|
|
95
101
|
Memoize(),
|
|
96
102
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-snapshot.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/url-snapshot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"url-snapshot.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/url-snapshot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,SAAS,sBAAsB,CAAC,OAAgB;IAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;AAChD,CAAC;AAED,MAAM,OAAO,WAAW;IAItB,iIAAiI;IACjI,YAAqB,aAA4B,EAAW,GAAW;QAAlD,kBAAa,GAAb,aAAa,CAAe;QAAW,QAAG,GAAH,GAAG,CAAQ;QACrE,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAGM,mBAAmB,CAAC,KAAY;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtD,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,CAAC,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACjD,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AAO,CAAC,WAAW,GAAG,EAAE,CAAC,CAAA,yCAAyC;SACnE;QACD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,QAAQ;QACN,OAAO,eAAe,IAAI,CAAC,GAAG,GAAG,CAAC;IACpC,CAAC;CAWF;AA7FC;IADC,KAAK,EAAE;;qCAC0B,KAAK;oCAAG,WAAW;sDAUpD;AAGD;IADC,OAAO,EAAE;;;;qDAGT;AAgFH,WAAiB,WAAW;IAEb,mCAAuB,GAAG,kBAAkB,CAAC;IAC7C,oCAAwB,GAAG,IAAI,CAAC;IAE7C,SAAgB,mBAAmB,CAAC,IAAY;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,YAAA,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAFe,+BAAmB,sBAElC,CAAA;IAED,SAAgB,eAAe,CAAC,cAAwB;QACtD,OAAO,cAAc,CAAC,IAAI,CAAC,YAAA,wBAAwB,CAAC,CAAC;IACvD,CAAC;IAFe,2BAAe,kBAE9B,CAAA;AAKH,CAAC,EAhBgB,WAAW,KAAX,WAAW,QAgB3B","sourcesContent":["import { UrlSegment, UrlSerializer, UrlTree } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { ConsolidatedParameterMap } from './guards/consolidated-param-map';\nimport { PlaceDefinition } from './place-definition';\nimport { Visit } from './visit';\n\nfunction extractPrimarySegments(urlTree: UrlTree): UrlSegment[] {\n return urlTree.root.children.primary.segments;\n}\n\nexport class UrlSnapshot {\n\n readonly urlTree: UrlTree;\n\n // TODO: Update this accept a url Parser so it can be immutable and generate new trees on mutation using toString() are parseUrl.\n constructor(readonly urlSerializer: UrlSerializer, readonly url: string) {\n this.urlTree = urlSerializer.parse(url);\n }\n\n @Trace()\n public updateVisitSegments(visit: Visit): UrlSnapshot {\n const newUrlTree = this.urlSerializer.parse(this.url);\n // Ugly, but it works for now.\n const segments = [...extractPrimarySegments(newUrlTree)];\n const visitSegments = this.getSegmentsFor(visit);\n const replaceAt = segments.findIndex(segment => segment.path === visitSegments[0].path);\n // do not use the return value, it's the items that were removed!\n segments.splice(replaceAt, visitSegments.length, ...visitSegments);\n newUrlTree.root.children.primary.segments = segments;\n return new UrlSnapshot(this.urlSerializer, newUrlTree.toString());\n }\n\n @Memoize()\n private getPrimarySegments(): UrlSegment[] {\n return extractPrimarySegments(this.urlTree);\n }\n\n /**\n * Converts the visit into segments. Please not that these segments are not e\n * @param visit\n */\n protected getSegmentsFor(visit: Visit): UrlSegment[] {\n return visit.placeDefinition.hasRouteId() ?\n [\n // NOTE:\n // It's important to attach the params to the root path and not the id. If we attach them\n // to an empty id then the angular router won't match the pattern.\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit)),\n new UrlSegment(visit.placeDefinition.getFormattedRouteId(visit), {})]\n :\n [\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit))\n ];\n }\n\n includesPathOf(placeDef: PlaceDefinition) {\n return this.getPrimarySegments().find(s => s.path === placeDef.path);\n }\n\n createVisitFor(placeDef: PlaceDefinition) {\n return new Visit(placeDef, new ConsolidatedParameterMap(this.getPrimarySegments()));\n }\n\n getInteractionIds() {\n const queryParam = this.urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM];\n if (queryParam) {\n return UrlSnapshot.parseInteractionIds(queryParam);\n } else {\n return [];\n }\n }\n\n hasInteractions() {\n return this.getInteractionIds().length > 0;\n }\n\n hasInteractionIds(ids: string[]): boolean {\n return _.isEqual(this.getInteractionIds(), ids);\n }\n\n // @Trace()\n updateInteractionIds(ids: string[]): UrlSnapshot {\n if (ids.length === 0) {\n return this.removeInteractionIds();\n } else {\n const urlTree = this.urlSerializer.parse(this.url);\n urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM] = UrlSnapshot.createPathIdFor(ids);\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n }\n\n // @Trace()\n removeInteractionIds(): UrlSnapshot {\n const urlTree = this.urlSerializer.parse(this.url);\n if (urlTree.queryParams && urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM]) {\n urlTree.queryParams = {};//[UrlSnapshot.INTERACTION_ROUTER_OUTLET]\n }\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n\n toString(): string {\n return `UrlSnapshot(${this.url})`;\n }\n\n // withOptions(options: NavigationExtras) {\n // return new UrlSnapshot(this.urlSerializer, this.url, options);\n // }\n //\n // @Trace()\n // getNavigationExtras(): NavigationExtras {\n // return this.options;\n // }\n\n}\n\nexport namespace UrlSnapshot {\n\n export const INTERACTION_QUERY_PARAM = 'aup-interactions';\n export const INTERACTION_ID_SEPARATOR = '--';\n\n export function parseInteractionIds(path: string) {\n return path.split(INTERACTION_ID_SEPARATOR);\n }\n\n export function createPathIdFor(interactionIds: string[]) {\n return interactionIds.join(INTERACTION_ID_SEPARATOR);\n }\n\n export interface NavigationOptions {\n replaceUrl?: boolean;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"UrlSnapshot":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSerializer","line":17,"character":38},{"__symbolic":"reference","name":"string"}]}],"updateVisitSegments":[{"__symbolic":"method"}],"getPrimarySegments":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":34,"character":3}}]}],"getSegmentsFor":[{"__symbolic":"method"}],"includesPathOf":[{"__symbolic":"method"}],"createVisitFor":[{"__symbolic":"method"}],"getInteractionIds":[{"__symbolic":"method"}],"hasInteractions":[{"__symbolic":"method"}],"hasInteractionIds":[{"__symbolic":"method"}],"updateInteractionIds":[{"__symbolic":"method"}],"removeInteractionIds":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"UrlSnapshot":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSerializer","line":17,"character":38},{"__symbolic":"reference","name":"string"}]}],"updateVisitSegments":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"Trace","line":21,"character":3}}]}],"getPrimarySegments":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":34,"character":3}}]}],"getSegmentsFor":[{"__symbolic":"method"}],"includesPathOf":[{"__symbolic":"method"}],"createVisitFor":[{"__symbolic":"method"}],"getInteractionIds":[{"__symbolic":"method"}],"hasInteractions":[{"__symbolic":"method"}],"hasInteractionIds":[{"__symbolic":"method"}],"updateInteractionIds":[{"__symbolic":"method"}],"removeInteractionIds":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}]}}}}]
|