@coolon/angular-ui-powerups 12.4.0-alpha.1 → 12.4.0-alpha.11

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.
Files changed (86) hide show
  1. package/assets/empty-state.scss +11 -0
  2. package/assets/styles.scss +1 -0
  3. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +363 -259
  4. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.js +2 -7
  6. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  7. package/coolon-angular-ui-powerups.metadata.json +1 -1
  8. package/cypress/builder.d.ts +32 -0
  9. package/cypress/components/aup-abstract-activity.d.ts +8 -0
  10. package/cypress/components/aup-activity.d.ts +8 -0
  11. package/cypress/components/aup-alert.d.ts +8 -0
  12. package/cypress/components/aup-command-face.d.ts +7 -0
  13. package/cypress/components/aup-command.d.ts +6 -18
  14. package/cypress/components/aup-empty-state.d.ts +4 -0
  15. package/cypress/components/aup-input.d.ts +8 -8
  16. package/cypress/components/aup-modal-activity.d.ts +4 -0
  17. package/cypress/components/aup-modal-alert.d.ts +6 -0
  18. package/cypress/components/aup-table.d.ts +1 -2
  19. package/cypress/components/button-mixin.d.ts +3 -1
  20. package/cypress/components/button.d.ts +4 -2
  21. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  22. package/cypress/exports.d.ts +8 -1
  23. package/cypress/page-builder.d.ts +8 -0
  24. package/cypress/page-element.d.ts +5 -2
  25. package/cypress/page.d.ts +4 -30
  26. package/esm2015/cypress/builder.js +66 -0
  27. package/esm2015/cypress/builder.js.map +1 -0
  28. package/esm2015/cypress/builder.metadata.json +1 -0
  29. package/esm2015/cypress/components/aup-abstract-activity.js +11 -0
  30. package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -0
  31. package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -0
  32. package/esm2015/cypress/components/aup-activity.js +13 -0
  33. package/esm2015/cypress/components/aup-activity.js.map +1 -0
  34. package/esm2015/cypress/components/aup-activity.metadata.json +1 -0
  35. package/esm2015/cypress/components/aup-alert.js +13 -0
  36. package/esm2015/cypress/components/aup-alert.js.map +1 -0
  37. package/esm2015/cypress/components/aup-alert.metadata.json +1 -0
  38. package/esm2015/cypress/components/aup-command-face.js +20 -18
  39. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  40. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  41. package/esm2015/cypress/components/aup-command.js +25 -9
  42. package/esm2015/cypress/components/aup-command.js.map +1 -1
  43. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  44. package/esm2015/cypress/components/aup-empty-state.js +7 -0
  45. package/esm2015/cypress/components/aup-empty-state.js.map +1 -0
  46. package/esm2015/cypress/components/aup-empty-state.metadata.json +1 -0
  47. package/esm2015/cypress/components/aup-input.js +7 -7
  48. package/esm2015/cypress/components/aup-input.js.map +1 -1
  49. package/esm2015/cypress/components/aup-modal-activity.js +7 -0
  50. package/esm2015/cypress/components/aup-modal-activity.js.map +1 -0
  51. package/esm2015/cypress/components/aup-modal-activity.metadata.json +1 -0
  52. package/esm2015/cypress/components/aup-modal-alert.js +12 -0
  53. package/esm2015/cypress/components/aup-modal-alert.js.map +1 -0
  54. package/esm2015/cypress/components/aup-modal-alert.metadata.json +1 -0
  55. package/esm2015/cypress/components/aup-table.js.map +1 -1
  56. package/esm2015/cypress/components/aup-table.metadata.json +1 -1
  57. package/esm2015/cypress/components/button.js.map +1 -1
  58. package/esm2015/cypress/components/button.metadata.json +1 -1
  59. package/esm2015/cypress/exports.js +8 -1
  60. package/esm2015/cypress/exports.js.map +1 -1
  61. package/esm2015/cypress/exports.metadata.json +1 -1
  62. package/esm2015/cypress/page-builder.js +15 -0
  63. package/esm2015/cypress/page-builder.js.map +1 -0
  64. package/esm2015/cypress/page-builder.metadata.json +1 -0
  65. package/esm2015/cypress/page-element.js +9 -3
  66. package/esm2015/cypress/page-element.js.map +1 -1
  67. package/esm2015/cypress/page-element.metadata.json +1 -1
  68. package/esm2015/cypress/page.js +8 -10
  69. package/esm2015/cypress/page.js.map +1 -1
  70. package/esm2015/cypress/page.metadata.json +1 -1
  71. package/esm2015/cypress/path.js +3 -1
  72. package/esm2015/cypress/path.js.map +1 -1
  73. package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
  74. package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
  75. package/esm2015/lib/place/url-snapshot.js +1 -7
  76. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  77. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  78. package/fesm2015/coolon-angular-ui-powerups-cypress.js +264 -166
  79. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  80. package/fesm2015/coolon-angular-ui-powerups.js +2 -7
  81. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  82. package/package.json +1 -1
  83. package/cypress/section.d.ts +0 -49
  84. package/esm2015/cypress/section.js +0 -58
  85. package/esm2015/cypress/section.js.map +0 -1
  86. package/esm2015/cypress/section.metadata.json +0 -1
@@ -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","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"}]}}}}]
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,5 +1,5 @@
1
- import * as _ from 'lodash';
2
1
  import { lang, Mixin } from '@coolon/typescript-utilities';
2
+ import * as _ from 'lodash';
3
3
  import { DefaultUrlSerializer } from '@angular/router';
4
4
 
5
5
  class PageElement {
@@ -7,7 +7,7 @@ class PageElement {
7
7
  this.parentElementAccessor = parent instanceof PageElement ? () => parent.element() : parent;
8
8
  this.elementAccessStrategy = _.isString(selector) ? {
9
9
  findIn: p => p.find(selector),
10
- shouldNotExist: (p) => p.should('not.have', selector)
10
+ shouldNotExist: (p) => p.find(selector).should('not.exist')
11
11
  } : selector;
12
12
  }
13
13
  element() {
@@ -24,7 +24,13 @@ class PageElement {
24
24
  text ? this.element().contains(text).click() : this.element().click();
25
25
  }
26
26
  get should() {
27
- return this.element().should;
27
+ return this.getShoulder(this.getShouldElement());
28
+ }
29
+ getShoulder(element) {
30
+ return element.should.bind(element);
31
+ }
32
+ getShouldElement() {
33
+ return this.element();
28
34
  }
29
35
  shouldBeVisible() {
30
36
  this.should('be.visible');
@@ -37,118 +43,67 @@ class PageElement {
37
43
  }
38
44
  }
39
45
 
40
- let urlSerialiser = new DefaultUrlSerializer();
41
- class Path {
42
- constructor(segments) {
43
- this.segments = segments;
44
- }
45
- static extractVisitParameters(url) {
46
- let result = {};
47
- const urlTree = urlSerialiser.parse(url);
48
- urlTree.root.children.primary.segments.forEach(s => {
49
- result = Object.assign(Object.assign({}, result), s.parameters);
50
- });
51
- return result;
52
- }
53
- toUrl(matrixParams) {
54
- return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');
46
+ class FaceAccessor {
47
+ constructor(face) {
48
+ this.face = face;
49
+ }
50
+ findIn(parent) {
51
+ return this.face.text ?
52
+ parent.contains(`aup-command-face`, this.face.text()) :
53
+ this.face.icon ?
54
+ parent.find(`aup-icon[ng-reflect-icon=${this.face.icon()}]`).closest('aup-command-face') :
55
+ undefined;
56
+ }
57
+ shouldNotExist(parent) {
58
+ return this.face.text ?
59
+ parent.should('not.contain', `aup-command-face`, this.face.text()) :
60
+ this.face.icon ?
61
+ parent.should('not.contain', `aup-icon[ng-reflect-icon=${this.face.icon()}]`) :
62
+ undefined;
55
63
  }
56
64
  }
57
- (function (Path) {
58
- function setUrlSerialiser(serialiser) {
59
- urlSerialiser = serialiser;
60
- }
61
- Path.setUrlSerialiser = setUrlSerialiser;
62
- class Segment {
63
- constructor(path, params = {}) {
64
- var _a;
65
- this.path = path;
66
- this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
67
- this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
68
- }
69
- toUrlPart(params) {
70
- let path = this.path;
71
- this.visitParams.forEach(p => {
72
- const value = params[p];
73
- if (value) {
74
- path = `${path};${p}=${value}`;
75
- }
76
- });
77
- if (this.routeId && params[this.routeId]) {
78
- path = path + '/' + params[this.routeId];
79
- }
80
- return path;
81
- }
82
- }
83
- Path.Segment = Segment;
84
- class Builder {
85
- constructor() {
86
- this.segments = [];
87
- }
88
- segment(name, params) {
89
- const builder = new Segment(name, params);
90
- this.segments.push(builder);
91
- return this;
92
- }
93
- getPath() {
94
- return new Path(this.segments);
95
- }
96
- }
97
- Path.Builder = Builder;
98
- })(Path || (Path = {}));
99
-
100
65
  class AupCommandFace extends PageElement {
101
66
  constructor(parentElement, face) {
102
67
  super(() => parentElement.element(), AupCommandFace.createAccessor(face));
103
68
  }
104
69
  static createAccessor(face) {
105
- // AOT barfs if we return a lambda
106
- const accessor = {
107
- findIn(parent) {
108
- return face.text ?
109
- parent.contains(`aup-command-face`, face.text()) :
110
- face.icon ?
111
- parent.find(`aup-icon[ng-reflect-icon=${face.icon()}]`).closest('aup-command-face') :
112
- undefined;
113
- },
114
- shouldNotExist(parent) {
115
- return face.text ?
116
- parent.should("not.contain", `aup-command-face`, face.text()) :
117
- face.icon ?
118
- parent.should("not.contain", `aup-icon[ng-reflect-icon=${face.icon()}]`) :
119
- undefined;
120
- }
121
- };
122
- return accessor;
70
+ return new FaceAccessor(face);
123
71
  }
124
72
  }
125
73
 
126
- function ButtonMixin(Base) {
127
- return class extends Base {
128
- constructor(...args) {
129
- super(...args);
130
- }
131
- click() {
132
- return this.element().click();
133
- }
134
- shouldBeDisabled() {
135
- this.should("be.disabled");
136
- // this.should("have.css", "color", "rgba(0,0,0,0.26)")
137
- }
138
- };
139
- }
140
-
141
- class AupCommand extends ButtonMixin(PageElement) {
142
- constructor(parentElementAccessor, face) {
143
- const faceAccessor = AupCommandFace.createAccessor(face);
144
- super(parentElementAccessor, {
145
- findIn(parent) {
146
- return faceAccessor.findIn(parent).closest("aup-command");
74
+ class AupCommand extends PageElement {
75
+ constructor(parent, faceOrSelector) {
76
+ super(parent, {
77
+ findIn(parentElement) {
78
+ if (_.isString(faceOrSelector)) {
79
+ return parentElement.find(faceOrSelector);
80
+ }
81
+ else {
82
+ return AupCommandFace.createAccessor(faceOrSelector).findIn(parentElement).closest('aup-command');
83
+ }
84
+ },
85
+ shouldNotExist(parentElement) {
86
+ this.findIn(parentElement).should("not.exist");
147
87
  }
148
88
  });
149
89
  }
150
- get should() {
151
- return this.element().find('button').should;
90
+ click() {
91
+ this.getButton().click();
92
+ }
93
+ getShouldElement() {
94
+ return this.getButton();
95
+ }
96
+ shouldBeDisabled() {
97
+ this.getButton().should('be.disabled');
98
+ }
99
+ getButton() {
100
+ return this.element().find('button');
101
+ }
102
+ }
103
+
104
+ class AupEmptyState extends PageElement {
105
+ shouldContainText(text) {
106
+ this.element().should("contain.text", text);
152
107
  }
153
108
  }
154
109
 
@@ -163,13 +118,13 @@ class AupInput extends PageElement {
163
118
  return this.element().find('mat-error');
164
119
  }
165
120
  get labelShould() {
166
- return this.label().should;
121
+ return this.getShoulder(this.label());
167
122
  }
168
123
  get hintShould() {
169
- return this.hint().should;
124
+ return this.getShoulder(this.hint());
170
125
  }
171
126
  get errorShould() {
172
- return this.error().should;
127
+ return this.getShoulder(this.error());
173
128
  }
174
129
  labelShouldBe(text) {
175
130
  return this.labelShould("have.text", text);
@@ -195,14 +150,14 @@ class AupInput extends PageElement {
195
150
  input.type(`${value}`);
196
151
  this.input().should('have.value', `${value}`);
197
152
  }
198
- get should() {
199
- return this.input().should;
153
+ getShouldElement() {
154
+ return this.input();
200
155
  }
201
156
  }
202
157
  AupInput.HtmlInput = HtmlInput;
203
158
  class TextAreaInput extends AupInput {
204
- get should() {
205
- return this.input().should;
159
+ getShouldElement() {
160
+ return this.input();
206
161
  }
207
162
  input() {
208
163
  return this.element().find('textarea');
@@ -270,6 +225,21 @@ class AupTable extends PageElement {
270
225
  AupTable.Cell = Cell;
271
226
  })(AupTable || (AupTable = {}));
272
227
 
228
+ function ButtonMixin(Base) {
229
+ return class extends Base {
230
+ constructor(...args) {
231
+ super(...args);
232
+ }
233
+ click() {
234
+ return this.element().click();
235
+ }
236
+ shouldBeDisabled() {
237
+ this.should("be.disabled");
238
+ // this.should("have.css", "color", "rgba(0,0,0,0.26)")
239
+ }
240
+ };
241
+ }
242
+
273
243
  class Button extends ButtonMixin(PageElement) {
274
244
  constructor(parentElementAccessor, buttonText) {
275
245
  super(parentElementAccessor, {
@@ -283,56 +253,186 @@ class Button extends ButtonMixin(PageElement) {
283
253
  }
284
254
  }
285
255
 
286
- var Section;
287
- (function (Section) {
288
- function Mixin$1(Base) {
289
- return class extends Base {
290
- section(selector, section) {
291
- const impl = new Impl(() => this.element(), selector);
292
- return Mixin.createProxy(section(impl), impl);
293
- }
294
- find(selector) {
295
- return new PageElement(() => this.element(), selector);
296
- }
297
- contains(text) {
298
- return new PageElement(() => this.element(), {
299
- findIn: parent => parent.contains(text),
300
- shouldNotExist: (parent) => parent.should("not.contain", text)
301
- });
302
- }
303
- button(text) {
304
- return new Button(() => this.element(), text);
305
- }
306
- aupStringInput(selector) {
307
- return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-string-input');
308
- }
309
- aupTextInput(selector) {
310
- return new AupInput.TextAreaInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-text-input');
311
- }
312
- aupPasswordInput(selector) {
313
- return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-password-input');
314
- }
315
- aupNumberInput(selector) {
316
- return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-number-input');
317
- }
318
- aupCommand(face) {
319
- return new AupCommand(() => this.element(), face);
320
- }
321
- aupTabbedNavigation() {
322
- return new AupNavigation(() => this.element(), 'aup-tabbed-place-navigation');
323
- }
324
- aupSideNavigation() {
325
- return new AupNavigation(() => this.element(), 'aup-list-place-nav');
326
- }
327
- aupTable(selector) {
328
- return new AupTable(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-table');
256
+ class Builder {
257
+ constructor(source) {
258
+ this.source = source;
259
+ }
260
+ find(selector) {
261
+ return new PageElement(this.source, selector);
262
+ }
263
+ section(selector, builder) {
264
+ return this.createContainerElement(PageElement, selector, builder);
265
+ }
266
+ contains(text) {
267
+ return new PageElement(this.source, {
268
+ findIn: parent => parent.contains(text),
269
+ shouldNotExist: (parent) => parent.should('not.contain', text)
270
+ });
271
+ }
272
+ button(text) {
273
+ return new Button(this.source, text);
274
+ }
275
+ aupStringInput(selector) {
276
+ return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
277
+ }
278
+ aupTextInput(selector) {
279
+ return new AupInput.TextAreaInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
280
+ }
281
+ aupPasswordInput(selector) {
282
+ return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
283
+ }
284
+ aupNumberInput(selector) {
285
+ return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
286
+ }
287
+ aupCommand(faceOrSelector) {
288
+ return new AupCommand(this.source, faceOrSelector);
289
+ }
290
+ aupTabbedNavigation() {
291
+ return new AupNavigation(this.source, 'aup-tabbed-place-navigation');
292
+ }
293
+ aupSideNavigation() {
294
+ return new AupNavigation(this.source, 'aup-list-place-nav');
295
+ }
296
+ aupTable(selector) {
297
+ return new AupTable(this.source, selector !== null && selector !== void 0 ? selector : 'aup-table');
298
+ }
299
+ aupEmptyState(selectorOrBuilder, optionalBuilder) {
300
+ return this.createContainerElement(AupEmptyState, selectorOrBuilder, optionalBuilder, 'aup-empty-state');
301
+ }
302
+ createContainerElement(klass, selectorOrBuilder, optionalBuilder, defaultSelector) {
303
+ const selector = _.isString(selectorOrBuilder) ? selectorOrBuilder : defaultSelector;
304
+ const builder = _.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
305
+ if (!selector) {
306
+ lang.illegalState('This element requires a selector but none was provided');
307
+ }
308
+ const element = new klass(this.source, selector);
309
+ return builder ? Mixin.createProxy(element, builder(new Builder(element))) : element;
310
+ }
311
+ }
312
+
313
+ class AupAbstractActivity extends PageElement {
314
+ constructor(parent, selector) {
315
+ super(parent, selector);
316
+ this.title = this.find('aup-activity-title');
317
+ this._confirmCommand = new Builder(this).aupCommand('[data-cy=confirm-command]');
318
+ this._cancelCommand = new Builder(this).aupCommand('[data-cy=cancel-command]');
319
+ }
320
+ }
321
+
322
+ class AupActivity extends AupAbstractActivity {
323
+ constructor(parent, selector) {
324
+ super(parent, selector);
325
+ }
326
+ get confirmCommand() {
327
+ return this._confirmCommand;
328
+ }
329
+ get cancelCommand() {
330
+ return this._cancelCommand;
331
+ }
332
+ }
333
+
334
+ class AupModalActivity extends AupActivity {
335
+ clickBackdrop() {
336
+ this.element().closest(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
337
+ }
338
+ }
339
+
340
+ class AupAlert extends AupAbstractActivity {
341
+ constructor(parent, selector) {
342
+ super(parent, selector);
343
+ }
344
+ get closeCommand() {
345
+ return this._confirmCommand;
346
+ }
347
+ clickClose() {
348
+ this.closeCommand.click();
349
+ }
350
+ }
351
+
352
+ class AupModalAlert extends AupAlert {
353
+ constructor(parent, selector) {
354
+ super(parent, selector);
355
+ }
356
+ clickBackdrop() {
357
+ this.element()
358
+ .closest(`.cdk-overlay-container`)
359
+ .find(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
360
+ }
361
+ }
362
+
363
+ class PageBuilder extends Builder {
364
+ aupModalActivity(selector, builder) {
365
+ return this.createContainerElement(AupModalActivity, `.dialog-interaction-context ${selector}`, builder);
366
+ }
367
+ aupModalAlert(builder) {
368
+ return this.createContainerElement(AupModalAlert, `.dialog-interaction-context aup-alert-dialog`, builder);
369
+ }
370
+ aupModelConfirm(builder) {
371
+ return this.aupModalActivity(`aup-confirm-dialog`, builder);
372
+ }
373
+ }
374
+
375
+ let urlSerialiser = new DefaultUrlSerializer();
376
+ class Path {
377
+ constructor(segments) {
378
+ this.segments = segments;
379
+ }
380
+ static extractVisitParameters(url) {
381
+ var _a, _b;
382
+ let result = {};
383
+ const urlTree = urlSerialiser.parse(url);
384
+ const urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
385
+ urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(s => {
386
+ result = Object.assign(Object.assign({}, result), s.parameters);
387
+ });
388
+ return result;
389
+ }
390
+ toUrl(matrixParams) {
391
+ return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');
392
+ }
393
+ }
394
+ (function (Path) {
395
+ function setUrlSerialiser(serialiser) {
396
+ urlSerialiser = serialiser;
397
+ }
398
+ Path.setUrlSerialiser = setUrlSerialiser;
399
+ class Segment {
400
+ constructor(path, params = {}) {
401
+ var _a;
402
+ this.path = path;
403
+ this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
404
+ this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
405
+ }
406
+ toUrlPart(params) {
407
+ let path = this.path;
408
+ this.visitParams.forEach(p => {
409
+ const value = params[p];
410
+ if (value) {
411
+ path = `${path};${p}=${value}`;
412
+ }
413
+ });
414
+ if (this.routeId && params[this.routeId]) {
415
+ path = path + '/' + params[this.routeId];
329
416
  }
330
- };
417
+ return path;
418
+ }
331
419
  }
332
- Section.Mixin = Mixin$1;
333
- class Impl extends Mixin$1(PageElement) {
420
+ Path.Segment = Segment;
421
+ class Builder {
422
+ constructor() {
423
+ this.segments = [];
424
+ }
425
+ segment(name, params) {
426
+ const builder = new Segment(name, params);
427
+ this.segments.push(builder);
428
+ return this;
429
+ }
430
+ getPath() {
431
+ return new Path(this.segments);
432
+ }
334
433
  }
335
- })(Section || (Section = {}));
434
+ Path.Builder = Builder;
435
+ })(Path || (Path = {}));
336
436
 
337
437
  class Page extends PageElement {
338
438
  constructor(path) {
@@ -363,8 +463,8 @@ class Page extends PageElement {
363
463
  }
364
464
  shouldBeActive(withParameters) {
365
465
  // Note: cy.window() doesn't return a promise... it's a chainable.
366
- cy.window().then(window => {
367
- cy['waitUntil'](() => {
466
+ cy['waitUntil'](() => {
467
+ return cy.window().then(window => {
368
468
  return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
369
469
  });
370
470
  });
@@ -381,21 +481,19 @@ class Page extends PageElement {
381
481
  }
382
482
  }
383
483
  (function (Page) {
384
- function create(pathOrPathBuilder, page) {
484
+ function create(pathOrPathBuilder, builder) {
385
485
  const pathBuilder = new Path.Builder();
386
486
  if (_.isString(pathOrPathBuilder)) {
387
- pathOrPathBuilder.split("/").filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
487
+ pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
388
488
  }
389
489
  else {
390
490
  pathOrPathBuilder(pathBuilder);
391
491
  }
392
- const builder = new PageBuilder(pathBuilder.getPath());
393
- return Mixin.createProxy(page(builder), builder);
492
+ const instance = new Page(pathBuilder.getPath());
493
+ const content = builder(new PageBuilder(instance));
494
+ return Mixin.createProxy(content, instance);
394
495
  }
395
496
  Page.create = create;
396
- class PageBuilder extends Section.Mixin(Page) {
397
- }
398
- Page.PageBuilder = PageBuilder;
399
497
  })(Page || (Page = {}));
400
498
 
401
499
  class AupCommandGroup extends PageElement {
@@ -439,5 +537,5 @@ class AupToolBar extends PageElement {
439
537
  * Generated bundle index. Do not edit.
440
538
  */
441
539
 
442
- export { AupCommand, AupCommandFace, AupCommandGroup, AupInput, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Button, ButtonMixin, Page, PageElement, Path, Section };
540
+ export { AupAbstractActivity, AupActivity, AupAlert, AupCommand, AupCommandFace, AupCommandGroup, AupEmptyState, AupInput, AupModalActivity, AupModalAlert, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Builder, Button, ButtonMixin, FaceAccessor, Page, PageBuilder, PageElement, Path };
443
541
  //# sourceMappingURL=coolon-angular-ui-powerups-cypress.js.map