@coolon/angular-ui-powerups 12.4.0-alpha.19 → 12.4.0-alpha.20

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 (69) hide show
  1. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +107 -115
  2. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  3. package/cypress/builder.d.ts +2 -0
  4. package/cypress/components/aup-command-face.d.ts +0 -7
  5. package/cypress/components/aup-table.d.ts +0 -2
  6. package/cypress/components/button.d.ts +1 -1
  7. package/cypress/components/form-element-mixin.d.ts +1 -1
  8. package/cypress/components/mat-checkbox.d.ts +1 -1
  9. package/cypress/components/popup/aup-abstract-popup-menu.d.ts +15 -0
  10. package/cypress/components/popup/aup-more-menu.d.ts +5 -0
  11. package/cypress/components/popup/aup-popup-menu-panel.d.ts +3 -0
  12. package/cypress/components/popup/aup-popup-menu.d.ts +7 -0
  13. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  14. package/cypress/element-locator.d.ts +3 -5
  15. package/cypress/exports.d.ts +4 -2
  16. package/cypress/page-element.d.ts +1 -3
  17. package/esm2015/cypress/builder.js +6 -8
  18. package/esm2015/cypress/builder.js.map +1 -1
  19. package/esm2015/cypress/builder.metadata.json +1 -1
  20. package/esm2015/cypress/components/aup-abstract-table.js +4 -8
  21. package/esm2015/cypress/components/aup-abstract-table.js.map +1 -1
  22. package/esm2015/cypress/components/aup-abstract-table.metadata.json +1 -1
  23. package/esm2015/cypress/components/aup-command-face.js +9 -20
  24. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  25. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  26. package/esm2015/cypress/components/aup-command.js +6 -11
  27. package/esm2015/cypress/components/aup-command.js.map +1 -1
  28. package/esm2015/cypress/components/aup-table.js.map +1 -1
  29. package/esm2015/cypress/components/aup-table.metadata.json +1 -1
  30. package/esm2015/cypress/components/button.js +1 -1
  31. package/esm2015/cypress/components/button.js.map +1 -1
  32. package/esm2015/cypress/components/mat-checkbox.js +1 -1
  33. package/esm2015/cypress/components/mat-checkbox.js.map +1 -1
  34. package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js +33 -0
  35. package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js.map +1 -0
  36. package/esm2015/cypress/components/popup/aup-abstract-popup-menu.metadata.json +1 -0
  37. package/esm2015/cypress/components/popup/aup-more-menu.js +8 -0
  38. package/esm2015/cypress/components/popup/aup-more-menu.js.map +1 -0
  39. package/esm2015/cypress/components/popup/aup-more-menu.metadata.json +1 -0
  40. package/esm2015/cypress/components/popup/aup-popup-menu-panel.js +4 -0
  41. package/esm2015/cypress/components/popup/aup-popup-menu-panel.js.map +1 -0
  42. package/esm2015/cypress/components/popup/aup-popup-menu-panel.metadata.json +1 -0
  43. package/esm2015/cypress/components/popup/aup-popup-menu.js +12 -0
  44. package/esm2015/cypress/components/popup/aup-popup-menu.js.map +1 -0
  45. package/esm2015/cypress/components/popup/aup-popup-menu.metadata.json +1 -0
  46. package/esm2015/cypress/components/table/aup-table-cell.js +2 -6
  47. package/esm2015/cypress/components/table/aup-table-cell.js.map +1 -1
  48. package/esm2015/cypress/components/table/aup-table-column.js +2 -4
  49. package/esm2015/cypress/components/table/aup-table-column.js.map +1 -1
  50. package/esm2015/cypress/components/table/aup-table-row.js +4 -6
  51. package/esm2015/cypress/components/table/aup-table-row.js.map +1 -1
  52. package/esm2015/cypress/element-locator.js +7 -13
  53. package/esm2015/cypress/element-locator.js.map +1 -1
  54. package/esm2015/cypress/exports.js +4 -2
  55. package/esm2015/cypress/exports.js.map +1 -1
  56. package/esm2015/cypress/exports.metadata.json +1 -1
  57. package/esm2015/cypress/page-element.js +3 -8
  58. package/esm2015/cypress/page-element.js.map +1 -1
  59. package/fesm2015/coolon-angular-ui-powerups-cypress.js +90 -106
  60. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  61. package/package.json +1 -1
  62. package/cypress/components/aup-more-menu.d.ts +0 -4
  63. package/cypress/components/aup-popup-menu.d.ts +0 -6
  64. package/esm2015/cypress/components/aup-more-menu.js +0 -7
  65. package/esm2015/cypress/components/aup-more-menu.js.map +0 -1
  66. package/esm2015/cypress/components/aup-more-menu.metadata.json +0 -1
  67. package/esm2015/cypress/components/aup-popup-menu.js +0 -19
  68. package/esm2015/cypress/components/aup-popup-menu.js.map +0 -1
  69. package/esm2015/cypress/components/aup-popup-menu.metadata.json +0 -1
@@ -341,34 +341,28 @@
341
341
  exports.ElementLocator = void 0;
342
342
  (function (ElementLocator) {
343
343
  function findByCssSelector(selector) {
344
- return {
345
- findIn: function (parent) { return parent.dom().find(selector); },
346
- shouldNotExist: function (p) { return p.dom().find(selector).should('not.exist'); }
347
- };
344
+ return function (parent) { return parent.dom().find(selector); };
348
345
  }
349
346
  ElementLocator.findByCssSelector = findByCssSelector;
350
- function findByTextContent(selector, text) {
351
- return {
352
- findIn: function (parent) {
353
- return parent.dom().contains(selector, text);
354
- },
355
- shouldNotExist: function (parent) {
356
- return parent.dom().should('not.contain', text);
357
- }
358
- };
347
+ function findByTextContent(text) {
348
+ return function (parent) { return parent.dom().contains(text); };
359
349
  }
360
350
  ElementLocator.findByTextContent = findByTextContent;
351
+ function findBySelectorAndTextContent(selector, text) {
352
+ return function (parent) { return parent.dom().contains(selector, text); };
353
+ }
354
+ ElementLocator.findBySelectorAndTextContent = findBySelectorAndTextContent;
361
355
  })(exports.ElementLocator || (exports.ElementLocator = {}));
362
356
 
363
357
  var PageElement = /** @class */ (function () {
364
358
  function PageElement(parent, selectorOrLocator) {
365
359
  this.parent = parent;
366
- this.elementAccessStrategy = ___namespace.isString(selectorOrLocator) ?
360
+ this.domElementLocator = ___namespace.isString(selectorOrLocator) ?
367
361
  exports.ElementLocator.findByCssSelector(selectorOrLocator) :
368
362
  selectorOrLocator;
369
363
  }
370
364
  PageElement.prototype.dom = function () {
371
- return this.elementAccessStrategy.findIn(this.parent);
365
+ return this.domElementLocator(this.parent);
372
366
  };
373
367
  PageElement.prototype.find = function (selector) {
374
368
  return new PageElement(this, selector);
@@ -399,43 +393,26 @@
399
393
  this.dom().should('exist');
400
394
  };
401
395
  PageElement.prototype.shouldNotExist = function () {
402
- if (!this.elementAccessStrategy.shouldNotExist) {
403
- this.dom().should('not.exist');
404
- }
405
- else {
406
- this.elementAccessStrategy.shouldNotExist(this.parent);
407
- }
396
+ this.dom().should('not.exist');
408
397
  };
409
398
  return PageElement;
410
399
  }());
411
400
 
412
- var FaceElementLocator = /** @class */ (function () {
413
- function FaceElementLocator(face) {
414
- this.face = face;
415
- }
416
- FaceElementLocator.prototype.findIn = function (parent) {
417
- return this.face.text ?
418
- parent.dom().contains("aup-command-face", this.face.text()) :
419
- this.face.icon ?
420
- parent.dom().find("aup-icon[ng-reflect-icon=" + this.face.icon() + "]").closest('aup-command-face') :
421
- undefined;
422
- };
423
- FaceElementLocator.prototype.shouldNotExist = function (parent) {
424
- return this.face.text ?
425
- parent.should('not.contain', "aup-command-face", this.face.text()) :
426
- this.face.icon ?
427
- parent.should('not.contain', "aup-icon[ng-reflect-icon=" + this.face.icon() + "]") :
428
- undefined;
429
- };
430
- return FaceElementLocator;
431
- }());
432
401
  var AupCommandFace = /** @class */ (function (_super) {
433
402
  __extends(AupCommandFace, _super);
434
403
  function AupCommandFace(parentElement, face) {
435
404
  return _super.call(this, parentElement, AupCommandFace.createElementLocator(face)) || this;
436
405
  }
437
406
  AupCommandFace.createElementLocator = function (face) {
438
- return new FaceElementLocator(face);
407
+ var locator = function (parent) {
408
+ return face.text ?
409
+ parent.dom().contains("aup-command-face", face.text()) :
410
+ face.icon ?
411
+ parent.dom().find("aup-icon[ng-reflect-icon=" + face.icon() + "]").closest('aup-command-face') :
412
+ undefined;
413
+ };
414
+ // aot compiler doesn't like lambas
415
+ return locator;
439
416
  };
440
417
  return AupCommandFace;
441
418
  }(PageElement));
@@ -443,17 +420,12 @@
443
420
  var AupCommand = /** @class */ (function (_super) {
444
421
  __extends(AupCommand, _super);
445
422
  function AupCommand(parent, faceOrSelector) {
446
- return _super.call(this, parent, {
447
- findIn: function (parentElement) {
448
- if (___namespace.isString(faceOrSelector)) {
449
- return parentElement.dom().find(faceOrSelector);
450
- }
451
- else {
452
- return AupCommandFace.createElementLocator(faceOrSelector).findIn(parentElement).closest('aup-command');
453
- }
454
- },
455
- shouldNotExist: function (parentElement) {
456
- this.findIn(parentElement).should("not.exist");
423
+ return _super.call(this, parent, function (parentElement) {
424
+ if (___namespace.isString(faceOrSelector)) {
425
+ return parentElement.dom().find(faceOrSelector);
426
+ }
427
+ else {
428
+ return AupCommandFace.createElementLocator(faceOrSelector)(parentElement).closest('aup-command');
457
429
  }
458
430
  }) || this;
459
431
  }
@@ -590,6 +562,59 @@
590
562
  AupInput.TextAreaInput = TextAreaInput;
591
563
  })(exports.AupInput || (exports.AupInput = {}));
592
564
 
565
+ var AupPopupMenuPanel = /** @class */ (function (_super) {
566
+ __extends(AupPopupMenuPanel, _super);
567
+ function AupPopupMenuPanel() {
568
+ return _super !== null && _super.apply(this, arguments) || this;
569
+ }
570
+ return AupPopupMenuPanel;
571
+ }(PageElement));
572
+
573
+ var AupAbstractPopupMenu = /** @class */ (function (_super) {
574
+ __extends(AupAbstractPopupMenu, _super);
575
+ function AupAbstractPopupMenu(parent, locator) {
576
+ var _this = _super.call(this, parent, locator) || this;
577
+ _this.popup = new AupPopupMenuPanel(_this, function (p) { return _this.findPopupIn(p); });
578
+ return _this;
579
+ }
580
+ AupAbstractPopupMenu.prototype.findPopupIn = function (p) {
581
+ return this.getOverlay().find('.mat-menu-panel');
582
+ };
583
+ AupAbstractPopupMenu.prototype.getOverlay = function () {
584
+ return this.dom().closest('body').find('.cdk-overlay-container');
585
+ };
586
+ AupAbstractPopupMenu.prototype.getBackdrop = function () {
587
+ return this.getOverlay().find('.cdk-overlay-backdrop');
588
+ };
589
+ AupAbstractPopupMenu.prototype.openPopup = function () {
590
+ this.shouldNotBeOpen();
591
+ this.click();
592
+ return this.popup;
593
+ };
594
+ AupAbstractPopupMenu.prototype.closePopup = function () {
595
+ this.shouldBeOpen();
596
+ this.getBackdrop().click();
597
+ };
598
+ AupAbstractPopupMenu.prototype.shouldBeOpen = function () {
599
+ this.popup.shouldBeVisible();
600
+ };
601
+ AupAbstractPopupMenu.prototype.shouldNotBeOpen = function () {
602
+ this.dom().closest('body').find('.mat-menu-panel').should("not.exist");
603
+ };
604
+ return AupAbstractPopupMenu;
605
+ }(PageElement));
606
+
607
+ var AupMoreMenu = /** @class */ (function (_super) {
608
+ __extends(AupMoreMenu, _super);
609
+ function AupMoreMenu() {
610
+ return _super !== null && _super.apply(this, arguments) || this;
611
+ }
612
+ AupMoreMenu.create = function (parent, selector) {
613
+ return new AupMoreMenu(parent, exports.ElementLocator.findByCssSelector(selector !== null && selector !== void 0 ? selector : 'aup-more-menu'));
614
+ };
615
+ return AupMoreMenu;
616
+ }(AupAbstractPopupMenu));
617
+
593
618
  var AupNavigation = /** @class */ (function (_super) {
594
619
  __extends(AupNavigation, _super);
595
620
  function AupNavigation() {
@@ -620,12 +645,8 @@
620
645
  };
621
646
  AupTableCell.prototype.row = function () {
622
647
  var self = this;
623
- return this.parent.createRow({
624
- findIn: function (parent) {
625
- return self.rowId().then(function (rowId) {
626
- return parent.dom().find(exports.AupAbstractTable.cssSelectorForTableRowById(rowId));
627
- });
628
- }
648
+ return this.parent.createRow(function (parent) {
649
+ return self.rowId().then(function (rowId) { return parent.dom().find(exports.AupAbstractTable.cssSelectorForTableRowById(rowId)); });
629
650
  });
630
651
  };
631
652
  return AupTableCell;
@@ -640,10 +661,8 @@
640
661
  }
641
662
  AupTableColumn.prototype.cellContaining = function (content) {
642
663
  var self = this;
643
- return new AupTableCell(this.parent, {
644
- findIn: function (parent) {
645
- return parent.dom().contains(exports.AupAbstractTable.cssSelectorForColumnCellRendererById(self.columnId), content);
646
- }
664
+ return new AupTableCell(this.parent, function (parent) {
665
+ return parent.dom().contains(exports.AupAbstractTable.cssSelectorForColumnCellRendererById(self.columnId), content);
647
666
  });
648
667
  };
649
668
  AupTableColumn.prototype.rowContaining = function (content) {
@@ -668,17 +687,13 @@
668
687
  return _super !== null && _super.apply(this, arguments) || this;
669
688
  }
670
689
  AupAbstractTable.prototype.row = function (rowId) {
671
- return this.createRow({
672
- findIn: function (parent) {
673
- return parent.dom().find(AupAbstractTable.cssSelectorForTableRowById(rowId));
674
- }
690
+ return this.createRow(function (parent) {
691
+ return parent.dom().find(AupAbstractTable.cssSelectorForTableRowById(rowId));
675
692
  });
676
693
  };
677
694
  AupAbstractTable.prototype.rowNumber = function (rowNumber) {
678
- return this.createRow({
679
- findIn: function (parent) {
680
- return parent.dom().find(AupAbstractTable.cssSelectorForNthTableRow(rowNumber));
681
- }
695
+ return this.createRow(function (parent) {
696
+ return parent.dom().find(AupAbstractTable.cssSelectorForNthTableRow(rowNumber));
682
697
  });
683
698
  };
684
699
  AupAbstractTable.prototype.column = function (columnId) {
@@ -732,12 +747,10 @@
732
747
  };
733
748
  AupTableRow.prototype.cell = function (columnOrId) {
734
749
  var self = this;
735
- return new AupTableCell(this.parent, {
736
- findIn: function (parent) {
737
- return self.rowId()
738
- .then(function (rowId) { return exports.AupAbstractTable.cssSelectorForCell(rowId, columnOrId); })
739
- .then(function (selector) { return parent.dom().find(selector); });
740
- }
750
+ return new AupTableCell(this.parent, function (parent) {
751
+ return self.rowId()
752
+ .then(function (rowId) { return exports.AupAbstractTable.cssSelectorForCell(rowId, columnOrId); })
753
+ .then(function (selector) { return parent.dom().find(selector); });
741
754
  });
742
755
  };
743
756
  AupTableRow.prototype.shouldBeSelected = function () {
@@ -827,7 +840,7 @@
827
840
  var Button = /** @class */ (function (_super) {
828
841
  __extends(Button, _super);
829
842
  function Button(parentElementAccessor, buttonText) {
830
- return _super.call(this, parentElementAccessor, exports.ElementLocator.findByTextContent('button', buttonText)) || this;
843
+ return _super.call(this, parentElementAccessor, exports.ElementLocator.findBySelectorAndTextContent('button', buttonText)) || this;
831
844
  }
832
845
  return Button;
833
846
  }(FormElementMixin(PageElement)));
@@ -835,7 +848,7 @@
835
848
  var MatCheckbox = /** @class */ (function (_super) {
836
849
  __extends(MatCheckbox, _super);
837
850
  function MatCheckbox(parentElementAccessor, text) {
838
- return _super.call(this, parentElementAccessor, exports.ElementLocator.findByTextContent('mat-checkbox', text)) || this;
851
+ return _super.call(this, parentElementAccessor, exports.ElementLocator.findBySelectorAndTextContent('mat-checkbox', text)) || this;
839
852
  }
840
853
  MatCheckbox.prototype.shouldBeChecked = function () {
841
854
  this.hiddenCheckBoxElement().should('be.checked');
@@ -878,14 +891,7 @@
878
891
  return this.createContainerElement(PageElement, selector, builder);
879
892
  };
880
893
  Builder.prototype.contains = function (text) {
881
- return new PageElement(this.parentPageElement, {
882
- findIn: function (parent) {
883
- return parent.dom().contains(text);
884
- },
885
- shouldNotExist: function (parent) {
886
- return parent.dom().should('not.contain', text);
887
- }
888
- });
894
+ return new PageElement(this.parentPageElement, exports.ElementLocator.findByTextContent(text));
889
895
  };
890
896
  Builder.prototype.button = function (text) {
891
897
  return new Button(this.parentPageElement, text);
@@ -914,6 +920,9 @@
914
920
  Builder.prototype.aupSideNavigation = function () {
915
921
  return new AupNavigation(this.parentPageElement, 'aup-list-place-nav');
916
922
  };
923
+ Builder.prototype.aupMoreMenu = function (selector) {
924
+ return AupMoreMenu.create(this.parentPageElement, selector);
925
+ };
917
926
  Builder.prototype.aupTable = function (selectorOrBuilder, optionalBuilder) {
918
927
  return this.createContainerElement(AupTable, selectorOrBuilder, optionalBuilder, 'aup-table');
919
928
  };
@@ -1196,15 +1205,16 @@
1196
1205
  return AupCommandGroup;
1197
1206
  }(PageElement));
1198
1207
 
1199
- var AupMoreMenu = /** @class */ (function (_super) {
1200
- __extends(AupMoreMenu, _super);
1201
- function AupMoreMenu() {
1208
+ var AupToolBar = /** @class */ (function (_super) {
1209
+ __extends(AupToolBar, _super);
1210
+ function AupToolBar() {
1202
1211
  return _super !== null && _super.apply(this, arguments) || this;
1203
1212
  }
1204
- AupMoreMenu.create = function (parent) {
1205
- return new AupMoreMenu(parent, 'aup-more-menu');
1213
+ AupToolBar.create = function (parent, face) {
1214
+ // const findFace = AupCommandFace.createFinder(() => parent.element(), face)
1215
+ // return new AupCommandGroup(() => findFace().closest('button'));
1206
1216
  };
1207
- return AupMoreMenu;
1217
+ return AupToolBar;
1208
1218
  }(PageElement));
1209
1219
 
1210
1220
  var AupPopupMenu = /** @class */ (function (_super) {
@@ -1212,33 +1222,14 @@
1212
1222
  function AupPopupMenu(parentElementAccessor, face) {
1213
1223
  var _this = this;
1214
1224
  var locator = AupCommandFace.createElementLocator(face);
1215
- _this = _super.call(this, parentElementAccessor, {
1216
- findIn: function (parent) {
1217
- return locator.findIn(parent).closest('button');
1218
- },
1219
- shouldNotExist: function (parent) {
1220
- locator.shouldNotExist(parent);
1221
- }
1222
- }) || this;
1225
+ _this = _super.call(this, parentElementAccessor, function (parent) { return locator(parent).closest('button'); }) || this;
1223
1226
  return _this;
1224
1227
  }
1225
1228
  AupPopupMenu.create = function (parent, face) {
1226
1229
  return new AupPopupMenu(parent, face);
1227
1230
  };
1228
1231
  return AupPopupMenu;
1229
- }(PageElement));
1230
-
1231
- var AupToolBar = /** @class */ (function (_super) {
1232
- __extends(AupToolBar, _super);
1233
- function AupToolBar() {
1234
- return _super !== null && _super.apply(this, arguments) || this;
1235
- }
1236
- AupToolBar.create = function (parent, face) {
1237
- // const findFace = AupCommandFace.createFinder(() => parent.element(), face)
1238
- // return new AupCommandGroup(() => findFace().closest('button'));
1239
- };
1240
- return AupToolBar;
1241
- }(PageElement));
1232
+ }(AupAbstractPopupMenu));
1242
1233
 
1243
1234
  var AupTableSelectionCell = /** @class */ (function (_super) {
1244
1235
  __extends(AupTableSelectionCell, _super);
@@ -1259,6 +1250,7 @@
1259
1250
  */
1260
1251
 
1261
1252
  exports.AupAbstractActivity = AupAbstractActivity;
1253
+ exports.AupAbstractPopupMenu = AupAbstractPopupMenu;
1262
1254
  exports.AupActivity = AupActivity;
1263
1255
  exports.AupAlert = AupAlert;
1264
1256
  exports.AupCommand = AupCommand;
@@ -1270,6 +1262,7 @@
1270
1262
  exports.AupMoreMenu = AupMoreMenu;
1271
1263
  exports.AupNavigation = AupNavigation;
1272
1264
  exports.AupPopupMenu = AupPopupMenu;
1265
+ exports.AupPopupMenuPanel = AupPopupMenuPanel;
1273
1266
  exports.AupTable = AupTable;
1274
1267
  exports.AupTableCell = AupTableCell;
1275
1268
  exports.AupTableColumn = AupTableColumn;
@@ -1279,7 +1272,6 @@
1279
1272
  exports.AupToolBar = AupToolBar;
1280
1273
  exports.Builder = Builder;
1281
1274
  exports.Button = Button;
1282
- exports.FaceElementLocator = FaceElementLocator;
1283
1275
  exports.FormElementMixin = FormElementMixin;
1284
1276
  exports.MatCheckbox = MatCheckbox;
1285
1277
  exports.PageBuilder = PageBuilder;