@coolon/angular-ui-powerups 12.4.0-alpha.2 → 12.4.0-alpha.21
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/empty-state.scss +11 -0
- package/assets/styles.scss +1 -0
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js +643 -306
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +7 -11
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/cypress/builder.d.ts +44 -0
- package/cypress/components/aup-abstract-activity.d.ts +9 -0
- package/cypress/components/aup-abstract-table.d.ts +18 -0
- package/cypress/components/aup-activity.d.ts +9 -0
- package/cypress/components/aup-alert-dialog.d.ts +7 -0
- package/cypress/components/aup-alert.d.ts +9 -0
- package/cypress/components/aup-command-face.d.ts +2 -8
- package/cypress/components/aup-command.d.ts +1 -1
- package/cypress/components/aup-empty-state.d.ts +4 -0
- package/cypress/components/aup-input.d.ts +11 -5
- package/cypress/components/aup-modal-activity.d.ts +4 -0
- package/cypress/components/aup-table.d.ts +5 -18
- package/cypress/components/aup-tree-table.d.ts +16 -0
- package/cypress/components/button.d.ts +10 -7
- package/cypress/components/form-element-mixin.d.ts +21 -0
- package/cypress/components/mat-checkbox.d.ts +30 -0
- package/cypress/components/popup/aup-abstract-popup-menu.d.ts +15 -0
- package/cypress/components/popup/aup-more-menu.d.ts +5 -0
- package/cypress/components/popup/aup-popup-menu-panel.d.ts +3 -0
- package/cypress/components/popup/aup-popup-menu.d.ts +7 -0
- package/cypress/components/table/aup-table-cell.d.ts +9 -0
- package/cypress/components/table/aup-table-column.d.ts +10 -0
- package/cypress/components/table/aup-table-row.d.ts +17 -0
- package/cypress/components/table/aup-table-selection-cell.d.ts +5 -0
- package/cypress/components/table/aup-table-selection-column.d.ts +5 -0
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/element-locator.d.ts +8 -0
- package/cypress/exports.d.ts +22 -4
- package/cypress/page-builder.d.ts +8 -0
- package/cypress/page-element.d.ts +10 -12
- package/cypress/page.d.ts +5 -33
- package/esm2015/cypress/builder.js +81 -0
- package/esm2015/cypress/builder.js.map +1 -0
- package/esm2015/cypress/builder.metadata.json +1 -0
- package/esm2015/cypress/components/aup-abstract-activity.js +12 -0
- package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-abstract-table.js +50 -0
- package/esm2015/cypress/components/aup-abstract-table.js.map +1 -0
- package/esm2015/cypress/components/aup-abstract-table.metadata.json +1 -0
- package/esm2015/cypress/components/aup-activity.js +13 -0
- package/esm2015/cypress/components/aup-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-alert-dialog.js +12 -0
- package/esm2015/cypress/components/aup-alert-dialog.js.map +1 -0
- package/esm2015/cypress/components/aup-alert-dialog.metadata.json +1 -0
- package/esm2015/cypress/components/aup-alert.js +13 -0
- package/esm2015/cypress/components/aup-alert.js.map +1 -0
- package/esm2015/cypress/components/aup-alert.metadata.json +1 -0
- package/esm2015/cypress/components/aup-command-face.js +11 -22
- 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 +9 -6
- 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-empty-state.js +7 -0
- package/esm2015/cypress/components/aup-empty-state.js.map +1 -0
- package/esm2015/cypress/components/aup-empty-state.metadata.json +1 -0
- package/esm2015/cypress/components/aup-input.js +17 -5
- 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-modal-activity.js +7 -0
- package/esm2015/cypress/components/aup-modal-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-modal-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-navigation.js +1 -1
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-table.js +5 -33
- package/esm2015/cypress/components/aup-table.js.map +1 -1
- package/esm2015/cypress/components/aup-table.metadata.json +1 -1
- package/esm2015/cypress/components/aup-tree-table.js +34 -0
- package/esm2015/cypress/components/aup-tree-table.js.map +1 -0
- package/esm2015/cypress/components/aup-tree-table.metadata.json +1 -0
- package/esm2015/cypress/components/button.js +4 -10
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/components/form-element-mixin.js +11 -0
- package/esm2015/cypress/components/form-element-mixin.js.map +1 -0
- package/esm2015/cypress/components/form-element-mixin.metadata.json +1 -0
- package/esm2015/cypress/components/mat-checkbox.js +34 -0
- package/esm2015/cypress/components/mat-checkbox.js.map +1 -0
- package/esm2015/cypress/components/mat-checkbox.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js +33 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-more-menu.js +8 -0
- package/esm2015/cypress/components/popup/aup-more-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-more-menu.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.js +4 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.js +12 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-cell.js +14 -0
- package/esm2015/cypress/components/table/aup-table-cell.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-cell.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-column.js +19 -0
- package/esm2015/cypress/components/table/aup-table-column.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-column.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-row.js +28 -0
- package/esm2015/cypress/components/table/aup-table-row.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-row.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.js +6 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.js +6 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.metadata.json +1 -0
- package/esm2015/cypress/element-locator.js +16 -0
- package/esm2015/cypress/element-locator.js.map +1 -0
- package/esm2015/cypress/element-locator.metadata.json +1 -0
- package/esm2015/cypress/exports.js +22 -4
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-builder.js +15 -0
- package/esm2015/cypress/page-builder.js.map +1 -0
- package/esm2015/cypress/page-builder.metadata.json +1 -0
- package/esm2015/cypress/page-element.js +22 -19
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +8 -10
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/esm2015/cypress/path.js +3 -1
- package/esm2015/cypress/path.js.map +1 -1
- 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/components/tables/tree-table/flattened-tree-list-model.js +4 -4
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js +1 -0
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.metadata.json +1 -1
- package/esm2015/lib/place/url-snapshot.js +1 -7
- 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 +482 -221
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +7 -11
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/tables/tree-table/flattened-tree-list-model.d.ts +0 -1
- package/lib/components/tables/tree-table/tree-table-model.d.ts +4 -5
- package/package.json +1 -1
- package/cypress/components/aup-more-menu.d.ts +0 -4
- package/cypress/components/aup-popup-menu.d.ts +0 -7
- package/cypress/components/button-mixin.d.ts +0 -19
- package/cypress/section.d.ts +0 -51
- package/esm2015/cypress/components/aup-more-menu.js +0 -7
- package/esm2015/cypress/components/aup-more-menu.js.map +0 -1
- package/esm2015/cypress/components/aup-more-menu.metadata.json +0 -1
- package/esm2015/cypress/components/aup-popup-menu.js +0 -19
- package/esm2015/cypress/components/aup-popup-menu.js.map +0 -1
- package/esm2015/cypress/components/aup-popup-menu.metadata.json +0 -1
- package/esm2015/cypress/components/button-mixin.js +0 -15
- package/esm2015/cypress/components/button-mixin.js.map +0 -1
- package/esm2015/cypress/components/button-mixin.metadata.json +0 -1
- package/esm2015/cypress/section.js +0 -58
- package/esm2015/cypress/section.js.map +0 -1
- package/esm2015/cypress/section.metadata.json +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { lang } from '@coolon/typescript-utilities';
|
|
2
1
|
import * as _ from 'lodash';
|
|
2
|
+
import { ElementLocator } from './element-locator';
|
|
3
|
+
import { Stringy } from '@coolon/typescript-utilities';
|
|
3
4
|
export class PageElement {
|
|
4
|
-
constructor(parent,
|
|
5
|
-
this.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
constructor(parent, selectorOrLocator) {
|
|
6
|
+
this.parent = parent;
|
|
7
|
+
const selector = selectorOrLocator !== null && selectorOrLocator !== void 0 ? selectorOrLocator : this.getDefaultSelector();
|
|
8
|
+
this.domElementLocator = _.isString(selector) ?
|
|
9
|
+
ElementLocator.findByCssSelector(selector) :
|
|
10
|
+
selector;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return parent ? this.elementAccessStrategy.findIn(parent) : undefined;
|
|
12
|
+
getDefaultSelector() {
|
|
13
|
+
return Stringy.from(this.constructor.name).dasherize().toString();
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
return this.
|
|
15
|
+
dom() {
|
|
16
|
+
return this.domElementLocator(this.parent);
|
|
17
17
|
}
|
|
18
18
|
find(selector) {
|
|
19
|
-
return new PageElement(
|
|
19
|
+
return new PageElement(this, selector);
|
|
20
20
|
}
|
|
21
21
|
click(text) {
|
|
22
|
-
text ? this.
|
|
22
|
+
text ? this.dom().contains(text).click() : this.dom().click();
|
|
23
23
|
}
|
|
24
24
|
get should() {
|
|
25
25
|
return this.getShoulder(this.getShouldElement());
|
|
@@ -28,16 +28,19 @@ export class PageElement {
|
|
|
28
28
|
return element.should.bind(element);
|
|
29
29
|
}
|
|
30
30
|
getShouldElement() {
|
|
31
|
-
return this.
|
|
31
|
+
return this.dom();
|
|
32
32
|
}
|
|
33
33
|
shouldBeVisible() {
|
|
34
34
|
this.should('be.visible');
|
|
35
35
|
}
|
|
36
36
|
shouldNotBeVisible() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.
|
|
37
|
+
this.should('not.be.visible');
|
|
38
|
+
}
|
|
39
|
+
shouldExist() {
|
|
40
|
+
this.dom().should('exist');
|
|
41
|
+
}
|
|
42
|
+
shouldNotExist() {
|
|
43
|
+
this.dom().should('not.exist');
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
//# sourceMappingURL=page-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-element.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page-element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-element.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page-element.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,MAAM,OAAO,WAAW;IAMtB,YAAqB,MAAS,EAAE,iBAA2C;QAAtD,WAAM,GAAN,MAAM,CAAG;QAC5B,MAAM,QAAQ,GAAG,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAChE,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7C,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC;IACb,CAAC;IAED,kBAAkB;QAChB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAA;IACnE,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,QAAgB;QACnB,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,IAAa;QACjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IAChE,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,WAAW,CAAC,OAA0B;QACpC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,eAAe;QACb,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAChC,CAAC;IAED,WAAW;QACT,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;CACF","sourcesContent":["/* tslint:disable:unified-signatures */\nimport Chainable = Cypress.Chainable;\nimport * as _ from 'lodash';\nimport { ElementLocator } from './element-locator';\nimport { Stringy } from '@coolon/typescript-utilities';\n\nexport class PageElement<P extends PageElement<any> = PageElement<any>> {\n\n readonly domElementLocator: ElementLocator;\n\n constructor(parent: P, selector?: string)\n constructor(parent: P, locator?: ElementLocator)\n constructor(readonly parent: P, selectorOrLocator?: string | ElementLocator) {\n const selector = selectorOrLocator ?? this.getDefaultSelector();\n this.domElementLocator = _.isString(selector) ?\n ElementLocator.findByCssSelector(selector) :\n selector;\n }\n\n getDefaultSelector():string {\n return Stringy.from(this.constructor.name).dasherize().toString()\n }\n\n dom(): Chainable<JQuery> {\n return this.domElementLocator(this.parent);\n }\n\n find(selector: string): PageElement {\n return new PageElement(this, selector);\n }\n\n click(text?: string) {\n text ? this.dom().contains(text).click() : this.dom().click();\n }\n\n get should() {\n return this.getShoulder(this.getShouldElement());\n }\n\n getShoulder(element: Chainable<JQuery>) {\n return element.should.bind(element);\n }\n\n getShouldElement(): Chainable<JQuery> {\n return this.dom();\n }\n\n shouldBeVisible() {\n this.should('be.visible');\n }\n\n shouldNotBeVisible() {\n this.should('not.be.visible');\n }\n\n shouldExist() {\n this.dom().should('exist');\n }\n\n shouldNotExist() {\n this.dom().should('not.exist');\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PageElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PageElement":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":10,"character":22,"context":{"typeName":"P"}},{"__symbolic":"reference","name":"string"}]},{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":11,"character":22,"context":{"typeName":"P"}},{"__symbolic":"reference","module":"./element-locator","name":"ElementLocator","line":11,"character":35}]},{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":12,"character":31,"context":{"typeName":"P"}},{"__symbolic":"reference","name":"string"}]}],"getDefaultSelector":[{"__symbolic":"method"}],"dom":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"click":[{"__symbolic":"method"}],"getShoulder":[{"__symbolic":"method"}],"getShouldElement":[{"__symbolic":"method"}],"shouldBeVisible":[{"__symbolic":"method"}],"shouldNotBeVisible":[{"__symbolic":"method"}],"shouldExist":[{"__symbolic":"method"}],"shouldNotExist":[{"__symbolic":"method"}]}}}}]
|
package/esm2015/cypress/page.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Mixin } from '@coolon/typescript-utilities';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
|
+
import { PageBuilder } from './page-builder';
|
|
3
4
|
import { PageElement } from './page-element';
|
|
4
5
|
import { Path } from './path';
|
|
5
|
-
import { Section } from './section';
|
|
6
6
|
export class Page extends PageElement {
|
|
7
7
|
constructor(path) {
|
|
8
8
|
super(undefined, undefined);
|
|
9
9
|
this.path = path;
|
|
10
10
|
this.rootElementSelector = 'body';
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
dom() {
|
|
13
13
|
return cy.get(this.rootElementSelector);
|
|
14
14
|
}
|
|
15
15
|
visit(visitParams, queryParams) {
|
|
@@ -32,7 +32,7 @@ export class Page extends PageElement {
|
|
|
32
32
|
}
|
|
33
33
|
shouldBeActive(withParameters) {
|
|
34
34
|
// Note: cy.window() doesn't return a promise... it's a chainable.
|
|
35
|
-
cy[
|
|
35
|
+
cy['waitUntil'](() => {
|
|
36
36
|
return cy.window().then(window => {
|
|
37
37
|
return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
|
|
38
38
|
});
|
|
@@ -50,20 +50,18 @@ export class Page extends PageElement {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
(function (Page) {
|
|
53
|
-
function create(pathOrPathBuilder,
|
|
53
|
+
function create(pathOrPathBuilder, builder) {
|
|
54
54
|
const pathBuilder = new Path.Builder();
|
|
55
55
|
if (_.isString(pathOrPathBuilder)) {
|
|
56
|
-
pathOrPathBuilder.split(
|
|
56
|
+
pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
pathOrPathBuilder(pathBuilder);
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const instance = new Page(pathBuilder.getPath());
|
|
62
|
+
const content = builder.call(instance, new PageBuilder(instance));
|
|
63
|
+
return Mixin.createProxy(content, instance);
|
|
63
64
|
}
|
|
64
65
|
Page.create = create;
|
|
65
|
-
class PageBuilder extends Section.Mixin(Page) {
|
|
66
|
-
}
|
|
67
|
-
Page.PageBuilder = PageBuilder;
|
|
68
66
|
})(Page || (Page = {}));
|
|
69
67
|
//# sourceMappingURL=page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,OAAO,IAAK,SAAQ,WAAW;IAInC,YAAqB,IAAU;QAC7B,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QADT,SAAI,GAAJ,IAAI,CAAM;QAFrB,wBAAmB,GAAG,MAAM,CAAC;IAIvC,CAAC;IAED,GAAG;QACD,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,WAAoB,EAAE,WAAuC;QACjE,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAC3C,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,MAAe,EAAE,WAAuC;QAClE,MA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pD,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBAC1C,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;oBACvC,aAAa;oBACb,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC9C,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CAEF;AAGD,WAAiB,IAAI;IAKnB,SAAgB,MAAM,CAAmB,iBAAiE,EAAE,OAAwD;QAClK,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACjC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9F;aAAM;YACL,iBAAiB,CAAC,WAAW,CAAC,CAAC;SAChC;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAa,CAAC;IAC1D,CAAC;IAVe,WAAM,SAUrB,CAAA;AACH,CAAC,EAhBgB,IAAI,KAAJ,IAAI,QAgBpB","sourcesContent":["import { Mixin } from '@coolon/typescript-utilities';\nimport * as _ from 'lodash';\nimport { Builder } from './builder';\nimport { PageBuilder } from './page-builder';\nimport { PageElement } from './page-element';\nimport { Path } from './path';\n\nexport class Page extends PageElement {\n\n protected rootElementSelector = 'body';\n\n constructor(readonly path: Path) {\n super(undefined, undefined);\n }\n\n dom(): Cypress.Chainable<JQuery<HTMLElement>> {\n return cy.get(this.rootElementSelector);\n }\n\n visit(visitParams?: object, queryParams?: { [key: string]: string }) {\n this.tryAndVisit(visitParams, queryParams);\n this.shouldBeActive(visitParams);\n }\n\n tryAndVisit(params?: object, queryParams?: { [key: string]: string }) {\n const path = this.path.toUrl(params ?? {});\n const queryString = queryParams ? `?${new URLSearchParams(queryParams).toString()}` : '';\n cy.visit(`/${path}${queryString}`);\n }\n\n shouldHaveActivityIds(...ids: string[]) {\n cy.location('search').should('contain', `?aup-interactions=${ids.join('--')}`);\n }\n\n shouldNotHaveActivityIds() {\n cy.location('search').should('not.contain', `?aup-interactions`);\n }\n\n shouldHaveTitle(title: string) {\n cy.title().should('eq', title);\n }\n\n shouldBeActive(withParameters?: object) {\n // Note: cy.window() doesn't return a promise... it's a chainable.\n cy['waitUntil'](() => {\n return cy.window().then(window => {\n return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();\n });\n });\n\n if (withParameters) {\n cy.location('pathname').then(path => {\n const urlParams = Path.extractVisitParameters(path);\n Object.keys(withParameters).forEach(param => {\n const expected = withParameters[param];\n // @ts-ignore\n expect(urlParams[param]).to.equal(expected);\n });\n });\n }\n }\n\n}\n\n\nexport namespace Page {\n\n export function create<T extends object>(path: string, builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page\n // tslint:disable-next-line:unified-signatures\n export function create<T extends object>(pathBuilder: ((pathBuilder: Path.Builder) => void), builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page\n export function create<T extends object>(pathOrPathBuilder: string | ((pathBuilder: Path.Builder) => void), builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page {\n const pathBuilder = new Path.Builder();\n if (_.isString(pathOrPathBuilder)) {\n pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));\n } else {\n pathOrPathBuilder(pathBuilder);\n }\n const instance = new Page(pathBuilder.getPath());\n const content = builder.call(instance, new PageBuilder(instance));\n return Mixin.createProxy(content, instance) as T & Page;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"Page":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./page-element","name":"PageElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"Page":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./page-element","name":"PageElement","line":7,"character":26},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./path","name":"Path","line":11,"character":29}]}],"dom":[{"__symbolic":"method"}],"visit":[{"__symbolic":"method"}],"tryAndVisit":[{"__symbolic":"method"}],"shouldHaveActivityIds":[{"__symbolic":"method"}],"shouldNotHaveActivityIds":[{"__symbolic":"method"}],"shouldHaveTitle":[{"__symbolic":"method"}],"shouldBeActive":[{"__symbolic":"method"}]}}}}]
|
package/esm2015/cypress/path.js
CHANGED
|
@@ -5,9 +5,11 @@ export class Path {
|
|
|
5
5
|
this.segments = segments;
|
|
6
6
|
}
|
|
7
7
|
static extractVisitParameters(url) {
|
|
8
|
+
var _a, _b;
|
|
8
9
|
let result = {};
|
|
9
10
|
const urlTree = urlSerialiser.parse(url);
|
|
10
|
-
urlTree.root.children.primary.segments
|
|
11
|
+
const urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
|
|
12
|
+
urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(s => {
|
|
11
13
|
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
12
14
|
});
|
|
13
15
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/path.ts"],"names":[],"mapp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,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF;IAbY,YAAO,UAanB,CAAA;AAMH,CAAC,EAnDgB,IAAI,KAAJ,IAAI,QAmDpB","sourcesContent":["import { DefaultUrlSerializer, UrlSerializer } from '@angular/router';\n\nlet urlSerialiser: UrlSerializer = new DefaultUrlSerializer();\n\nexport class Path {\n\n constructor(readonly segments: Path.Segment[]) {\n }\n\n static extractVisitParameters(url: string): object {\n let result = {};\n const urlTree = urlSerialiser.parse(url);\n const urlSegments = urlTree.root.children.primary?.segments ?? [];\n urlSegments?.forEach(s => {\n result = { ...result, ...s.parameters }\n });\n return result;\n }\n\n toUrl(matrixParams: object): string {\n return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');\n }\n\n}\n\nexport namespace Path {\n\n export function setUrlSerialiser(serialiser: UrlSerializer) {\n urlSerialiser = serialiser;\n }\n\n export class Segment {\n\n private routeId: string | undefined;\n private visitParams: string[];\n\n constructor(readonly path: string, params: SegmentParams = {}) {\n this.routeId = params?.routeId;\n this.visitParams = params?.visitParams ?? [];\n }\n\n toUrlPart(params: object) {\n let path: string = this.path;\n this.visitParams.forEach(p => {\n const value = params[p];\n if (value) {\n path = `${path};${p}=${value}`;\n }\n });\n if (this.routeId && params[this.routeId]) {\n path = path + '/' + params[this.routeId];\n }\n return path;\n }\n\n }\n\n export class Builder {\n\n private segments: Segment[] = [];\n\n segment(name: string, params?: SegmentParams): this {\n const builder = new Segment(name, params);\n this.segments.push(builder);\n return this;\n }\n\n getPath(): Path {\n return new Path(this.segments);\n }\n }\n\n export interface SegmentParams {\n routeId?: string;\n visitParams?: string[]\n }\n}\n"]}
|
|
@@ -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{padding:var(--aup-default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]
|
|
16
|
+
styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{display:flex;flex-direction:column;align-items:stretch;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{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
|
+
[{"__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{display:flex;flex-direction:column;align-items:stretch;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"}]}}}}]
|
|
@@ -2,15 +2,15 @@ import { ComputedListModel } from '@coolon/pectin';
|
|
|
2
2
|
import { DecoratedTreeNode, treeNodeDecorator } from './decorated-tree-node';
|
|
3
3
|
export class FlattenedTreeListModel extends ComputedListModel {
|
|
4
4
|
constructor(source, childRef, expansionModel) {
|
|
5
|
-
super(source
|
|
5
|
+
super(source, {
|
|
6
|
+
initialValue: [],
|
|
7
|
+
identifiedWith: row => source.identityOf(row)
|
|
8
|
+
});
|
|
6
9
|
this.source = source;
|
|
7
10
|
this.childRef = childRef;
|
|
8
11
|
this.expansionModel = expansionModel;
|
|
9
12
|
this.trackSource(expansionModel.isExpandedPredicate);
|
|
10
13
|
}
|
|
11
|
-
getIdentityOf(item) {
|
|
12
|
-
return this.source.identityOf(item);
|
|
13
|
-
}
|
|
14
14
|
compute(values) {
|
|
15
15
|
const result = [];
|
|
16
16
|
values.forEach(rootNode => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flattened-tree-list-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/flattened-tree-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,MAAM,OAAO,sBAA0B,SAAQ,iBAA4C;IAEzF,YAA6B,MAAoB,EAAmB,QAA0B,EAAW,cAAwD;QAC/J,KAAK,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"flattened-tree-list-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/flattened-tree-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG7E,MAAM,OAAO,sBAA0B,SAAQ,iBAA4C;IAEzF,YAA6B,MAAoB,EAAmB,QAA0B,EAAW,cAAwD;QAC/J,KAAK,CAAC,MAAM,EAAE;YACZ,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;SAC9C,CAAC,CAAC;QAJwB,WAAM,GAAN,MAAM,CAAc;QAAmB,aAAQ,GAAR,QAAQ,CAAkB;QAAW,mBAAc,GAAd,cAAc,CAA0C;QAK/J,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CAAC,MAAW;QACjB,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QACzG,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAGO,yBAAyB,CAAC,IAA0B,EAAE,MAA8B;QAC1F,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC1C,IAAI,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACrE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SACpF;IACH,CAAC;CAEF","sourcesContent":["import { ComputedListModel, ListModel } from '@coolon/pectin';\nimport { DecoratedTreeNode, treeNodeDecorator } from './decorated-tree-node';\nimport { TreeExpansionModel } from './tree-expansion-model';\n\nexport class FlattenedTreeListModel<T> extends ComputedListModel<DecoratedTreeNode<T>, T[]> {\n\n constructor(private readonly source: ListModel<T>, private readonly childRef: (node: T) => T[], readonly expansionModel: TreeExpansionModel<DecoratedTreeNode<T>>) {\n super(source, {\n initialValue: [],\n identifiedWith: row => source.identityOf(row)\n });\n this.trackSource(expansionModel.isExpandedPredicate)\n }\n\n compute(values: T[]): DecoratedTreeNode<T>[] {\n const result: DecoratedTreeNode<T>[] = [];\n values.forEach(rootNode => {\n return this.addNodeAndVisibleChildren(DecoratedTreeNode.decorateRoot(rootNode, this.childRef), result);\n });\n return result;\n }\n\n\n private addNodeAndVisibleChildren(node: DecoratedTreeNode<T>, result: DecoratedTreeNode<T>[]) {\n result.push(node);\n const decorator = node[treeNodeDecorator];\n if (decorator.hasChildren() && !this.expansionModel.isCollapsed(node)) {\n decorator.children.forEach(child => this.addNodeAndVisibleChildren(child, result));\n }\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"FlattenedTreeListModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"ComputedListModel","line":4,"character":47},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":6,"character":39,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":6,"character":49,"context":{"typeName":"T"}}]},{"__symbolic":"error","message":"Expression form not supported","line":6,"character":80},{"__symbolic":"reference","module":"./tree-expansion-model","name":"TreeExpansionModel","line":6,"character":123,"arguments":[{"__symbolic":"reference","module":"./decorated-tree-node","name":"DecoratedTreeNode","line":6,"character":142,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":6,"character":160,"context":{"typeName":"T"}}]}]}]}],"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"FlattenedTreeListModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"ComputedListModel","line":4,"character":47},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":6,"character":39,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":6,"character":49,"context":{"typeName":"T"}}]},{"__symbolic":"error","message":"Expression form not supported","line":6,"character":80},{"__symbolic":"reference","module":"./tree-expansion-model","name":"TreeExpansionModel","line":6,"character":123,"arguments":[{"__symbolic":"reference","module":"./decorated-tree-node","name":"DecoratedTreeNode","line":6,"character":142,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":6,"character":160,"context":{"typeName":"T"}}]}]}]}],"compute":[{"__symbolic":"method"}],"addNodeAndVisibleChildren":[{"__symbolic":"method"}]}}}}]
|
|
@@ -22,6 +22,7 @@ export class TreeTableModel extends AbstractTableModel {
|
|
|
22
22
|
const childExtractor = _.isFunction(childAccessor) ? childAccessor : row => row[childAccessor];
|
|
23
23
|
this.flattenedDataSource = this.registerDisposable(new FlattenedTreeListModel(source, childExtractor, this.treeExpansionModel));
|
|
24
24
|
this.setDataSource(this.flattenedDataSource);
|
|
25
|
+
this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));
|
|
25
26
|
}
|
|
26
27
|
treeControlColumn(builder) {
|
|
27
28
|
const columnId = 'tree-label';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,QAAQ;AAC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AC,IAAS;QACd,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,QAAQ,CAAC,IAAS;QAChB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,WAAW,CAAC,IAAS;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,6BAA6B,CAAC,IAAS;QACrC,IAAI,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,kBAAkB,CAAC,cAAoC,EAAE,mBAAmD;QAC1G,OAAO,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACvE,CAAC;CAoCF;AAcD,oGAAoG;AACpG,EAAE;AACF,8BAA8B;AAC9B,gCAAgC;AAChC,EAAE;AACF,6CAA6C;AAC7C,eAAe;AACf,kDAAkD;AAClD,MAAM;AACN,EAAE;AACF,+BAA+B;AAC/B,4BAA4B;AAC5B,MAAM;AACN,EAAE;AACF,sDAAsD;AACtD,uCAAuC;AACvC,MAAM;AACN,EAAE;AACF,gCAAgC;AAChC,0BAA0B;AAC1B,MAAM;AACN,EAAE;AACF,IAAI;AAEJ,yBAAyB;AACzB,EAAE;AACF,0CAA0C;AAC1C,EAAE;AACF,uBAAuB;AACvB,EAAE;AACF,kCAAkC;AAClC,EAAE;AACF,qDAAqD;AACrD,gCAAgC;AAChC,sEAAsE;AACtE,oDAAoD;AACpD,YAAY;AACZ,gCAAgC;AAChC,QAAQ;AACR,EAAE;AACF,gBAAgB;AAChB,4BAA4B;AAC5B,QAAQ;AACR,EAAE;AACF,EAAE;AACF,IAAI","sourcesContent":["import { ListModel, MutableValueModel, SelectionModel, ValueModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { SelectionColumnModel } from '../table/column-model';\nimport { FlattenedTreeListModel } from './flattened-tree-list-model';\nimport { TreeExpansionModel } from './tree-expansion-model';\nimport { TreeLabelColumnModel } from './tree-label-column-model';\n\nexport type ChildArrayPropertiesOf<T> = { [K in keyof T]: T[K] extends T[] ? K : never }[keyof T];\n\n// TODO:\n// Selection Models:\n// - as simple navigation tree\n// - as editable grid (selecte all, even hidden etc?)\n// - fixing selection on underlying model changes.\n// - rendering selection: row highlighting, checkboxes (in the tree renderer or in separate column), both.\n// Expansion Models:\n// - Add ability to auto show to depth\n// - Add a predicate to check default expansion (i.e. has children of a certain type)\n//\nexport class TreeTableModel<Row> extends AbstractTableModel<Row> {\n\n readonly treeExpansionModel = new TreeExpansionModel<Row>(row => this.identityOf(row));\n private readonly flattenedDataSource: FlattenedTreeListModel<Row>;\n\n constructor(source: ListModel<Row>, childAccessor: ChildArrayPropertiesOf<Row> | ((node: Row) => Row[]), builder?: (model: TreeTableModel<Row>) => void) {\n super();\n if (builder) builder(this);\n const childExtractor = _.isFunction(childAccessor) ? childAccessor : row => row[childAccessor];\n this.flattenedDataSource = this.registerDisposable(new FlattenedTreeListModel<Row>(source, childExtractor, this.treeExpansionModel));\n this.setDataSource(this.flattenedDataSource);\n\n this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));\n }\n\n treeControlColumn(builder: (column: TreeLabelColumnModel<Row>) => void) {\n const columnId = 'tree-label';\n const column = new TreeLabelColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), this.treeExpansionModel);\n builder(column);\n this.addColumn(column);\n }\n\n expand(node: Row) {\n this.treeExpansionModel.expand(node);\n }\n\n collapse(node: Row) {\n this.treeExpansionModel.expand(node);\n }\n\n isCollapsed(node: Row): boolean {\n return this.treeExpansionModel.isCollapsed(node);\n }\n\n ensureAncestorsAndSelfVisible(node: Row) {\n this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);\n }\n\n addSelectionColumn(selectionModel?: SelectionModel<Row>, showSelectionColumn?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n return this._addSelectionColumn(selectionModel, showSelectionColumn);\n }\n\n // saveSelection() {\n // let ids: number[] = [];\n // const selectedArea = this._decoratedSelectionModel.leadSelection.value;\n // if (selectedArea) {\n // ids.push(selectedArea.id);\n // ids = ids.concat(selectedArea.siblingsAfter().map(a => a.id));\n // ids = ids.concat(selectedArea.siblingsBefore().reverse().map(a => a.id));\n // ids = ids.concat(selectedArea.ancestorsToZone().reverse().map(a => a.id));\n // }\n // this._storedSelection = ids;\n // }\n //\n //\n // restoreSelection() {\n // const all = this.rootNodeModel.value.selfAndDescendants();\n // for (let i = 0; i < this._storedSelection.length; i++) {\n // const id = this._storedSelection[i];\n // const found = all.find(area => area.id === id);\n // if (found) {\n // this.selectedAreaId.value = found.id;\n // break;\n // }\n // }\n // }\n //\n // collapseAll(areas: T[]) {\n // this.collapsedAreaIds.value = [].concat(this.collapsedAreaIds.value, areas.map(a => a.id));\n // }\n\n // disableSelection(disable: boolean = true) {\n // this._disableSelection.value = disable;\n // }\n\n\n}\n\n\nexport namespace TreeTableModel {\n\n export interface Options<T, K extends keyof T> {\n storeIdIn: MutableValueModel<K>\n }\n\n export type IconFactory<Row> = (node: Row, expanded: boolean, defaultIcon: string) => string;\n\n}\n\n\n// export class FlattenStrategy<T extends VisitableTree<any>> extends SelfAndDescendantsVisitor<T> {\n//\n// private _areas: T[] = [];\n// private _collapsed: Set<T>;\n//\n// constructor(private collapsedIds: T[]) {\n// super();\n// this._collapsed = new Set<T>(collapsedIds);\n// }\n//\n// protected onVisit(it: T) {\n// this._areas.push(it);\n// }\n//\n// protected shouldVisitChildrenOf(it: T): boolean {\n// return !this._collapsed.has(it);\n// }\n//\n// get flattenedAreas(): T[] {\n// return this._areas;\n// }\n//\n// }\n\n// class DecoratorCache {\n//\n// private map = new Map<number, T>();\n//\n// get(area:T): T {\n//\n// if (!area) return null;\n//\n// let decoratedArea = this.map.get(area.id);\n// if (!decoratedArea) {\n// decoratedArea = TreeModel.AreaDecorator.decorate(area);\n// this.map.set(area.id, decoratedArea);\n// }\n// return decoratedArea;\n// }\n//\n// clear() {\n// this.map.clear();\n// }\n//\n//\n// }\n\n\n\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ChildArrayPropertiesOf":{"__symbolic":"interface"},"TreeTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ChildArrayPropertiesOf":{"__symbolic":"interface"},"TreeTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":20,"character":41},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":25,"character":22,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":25,"character":32,"context":{"typeName":"Row"}}]},{"__symbolic":"error","message":"Could not resolve type","line":25,"character":53,"context":{"typeName":"ChildArrayPropertiesOf"}},{"__symbolic":"error","message":"Expression form not supported","line":25,"character":117}]}],"treeControlColumn":[{"__symbolic":"method"}],"expand":[{"__symbolic":"method"}],"collapse":[{"__symbolic":"method"}],"isCollapsed":[{"__symbolic":"method"}],"ensureAncestorsAndSelfVisible":[{"__symbolic":"method"}],"addSelectionColumn":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { UrlSegment } from '@angular/router';
|
|
3
|
-
import { Trace } from '@coolon/pectin';
|
|
4
3
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
5
4
|
import _ from 'lodash';
|
|
6
5
|
import { ConsolidatedParameterMap } from './guards/consolidated-param-map';
|
|
@@ -15,6 +14,7 @@ export class UrlSnapshot {
|
|
|
15
14
|
this.url = url;
|
|
16
15
|
this.urlTree = urlSerializer.parse(url);
|
|
17
16
|
}
|
|
17
|
+
// @Trace()
|
|
18
18
|
updateVisitSegments(visit) {
|
|
19
19
|
const newUrlTree = this.urlSerializer.parse(this.url);
|
|
20
20
|
// Ugly, but it works for now.
|
|
@@ -91,12 +91,6 @@ 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);
|
|
100
94
|
__decorate([
|
|
101
95
|
Memoize(),
|
|
102
96
|
__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;AAErE,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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AAO,CAAC,WAAW,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAC5F,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAED,WAAW;IACX,oBAAoB;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE;YACnF,OAAO,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;AAhFC;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"
|
|
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"}]}}}}]
|