@coolon/angular-ui-powerups 12.4.0-alpha.75 → 12.4.0-alpha.77

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 (48) hide show
  1. package/assets/markdown.scss +10 -0
  2. package/assets/styles.scss +1 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.js +95 -133
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  7. package/esm2015/lib/components/forms/select-input/select-input.component.js +2 -2
  8. package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
  9. package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
  10. package/esm2015/lib/interaction/activity.js +1 -1
  11. package/esm2015/lib/interaction/activity.js.map +1 -1
  12. package/esm2015/lib/interaction/components/abstract-confirm-dialog.component.js +23 -0
  13. package/esm2015/lib/interaction/components/abstract-confirm-dialog.component.js.map +1 -0
  14. package/esm2015/lib/interaction/components/abstract-confirm-dialog.component.metadata.json +1 -0
  15. package/esm2015/lib/interaction/components/abstract-confirm-dialog.component.ngfactory.js.map +1 -0
  16. package/esm2015/lib/interaction/components/abstract-dialog.component.js +52 -0
  17. package/esm2015/lib/interaction/components/abstract-dialog.component.js.map +1 -0
  18. package/esm2015/lib/interaction/components/abstract-dialog.component.metadata.json +1 -0
  19. package/esm2015/lib/interaction/components/abstract-dialog.component.ngfactory.js.map +1 -0
  20. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +4 -17
  21. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  22. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.metadata.json +1 -1
  23. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +6 -34
  24. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  25. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.metadata.json +1 -1
  26. package/esm2015/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.js +5 -31
  27. package/esm2015/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.js.map +1 -1
  28. package/esm2015/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.metadata.json +1 -1
  29. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +5 -29
  30. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  31. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.metadata.json +1 -1
  32. package/esm2015/lib/interaction/exports.js +2 -0
  33. package/esm2015/lib/interaction/exports.js.map +1 -1
  34. package/esm2015/lib/interaction/exports.metadata.json +1 -1
  35. package/esm2015/lib/interaction/interaction.module.js +5 -1
  36. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  37. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  38. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  39. package/fesm2015/coolon-angular-ui-powerups.js +81 -105
  40. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  41. package/lib/interaction/components/abstract-confirm-dialog.component.d.ts +7 -0
  42. package/lib/interaction/components/abstract-dialog.component.d.ts +17 -0
  43. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +2 -11
  44. package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +2 -13
  45. package/lib/interaction/components/confirm-then-execute-dialog/confirm-then-execute-dialog.component.d.ts +2 -12
  46. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +2 -12
  47. package/lib/interaction/exports.d.ts +2 -0
  48. package/package.json +2 -2
@@ -0,0 +1,10 @@
1
+ aup-markdown {
2
+ p {
3
+ margin: 0;
4
+ line-height: 1.2em;
5
+ }
6
+
7
+ > *:not(:first-child) {
8
+ margin-top: 0.5em;
9
+ }
10
+ }
@@ -12,6 +12,7 @@
12
12
  @use "./icons";
13
13
  @use "./empty-state";
14
14
  @use "./pills";
15
+ @use "./markdown";
15
16
 
16
17
  @mixin apply-light-theme($theme, $typography) {
17
18
 
@@ -2393,8 +2393,8 @@
2393
2393
  SelectInputComponent.decorators = [
2394
2394
  { type: i0.Component, args: [{
2395
2395
  selector: 'aup-select-input',
2396
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
2397
- styles: [":host{display:inline-block}mat-form-field{width:100%}\n"]
2396
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">\n <ng-container *ngIf=\"!nilOptionTemplateRef\">{{placeholder}}</ng-container>\n <ng-container *ngIf=\"nilOptionTemplateRef\" [ngTemplateOutlet]=\"nilOptionTemplateRef\"></ng-container>\n </mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n<div class=\"width-strut\">\n <div *ngFor=\"let item of options\">{{optionLabelFormat(item)}}</div>\n</div>\n",
2397
+ styles: [":host{display:inline-block}mat-form-field{width:100%}.width-strut{height:0;max-height:0;width:auto;visibility:hidden;padding-right:12px}\n"]
2398
2398
  },] }
2399
2399
  ];
2400
2400
  SelectInputComponent.ctorParameters = function () { return []; };
@@ -5370,6 +5370,7 @@
5370
5370
  _this._busyModel = _this.registerDisposable(new pectin.DelegatingValueModel().withDefault(false));
5371
5371
  _this._focusedModel = _this.registerDisposable(new pectin.DelegatingValueModel());
5372
5372
  _this.class = 'aup-activity';
5373
+ _this.busyWhile(_this.confirmCommand.busy);
5373
5374
  return _this;
5374
5375
  }
5375
5376
  Object.defineProperty(Activity.prototype, "isFocused", {
@@ -5389,7 +5390,6 @@
5389
5390
  when(this._focusedModel).becomesTruthy(function () {
5390
5391
  _this.onActivityReady();
5391
5392
  });
5392
- this.busyWhile(this.confirmCommand.busy);
5393
5393
  };
5394
5394
  Activity.prototype.ngAfterViewInit = function () {
5395
5395
  var _a;
@@ -5474,31 +5474,89 @@
5474
5474
  Alert.getColor = getColor;
5475
5475
  })(exports.Alert || (exports.Alert = {}));
5476
5476
 
5477
+ var ALERT_CONFIG = new i0.InjectionToken('AlertConfig');
5478
+ var AbstractDialogComponent = /** @class */ (function (_super) {
5479
+ __extends(AbstractDialogComponent, _super);
5480
+ function AbstractDialogComponent(config) {
5481
+ var _this = _super.call(this) || this;
5482
+ _this.config = config;
5483
+ pectin.assert.notNil(config);
5484
+ _this.title = exports.Alert.getTitle(config);
5485
+ _this.color = _this.checkColor(exports.Alert.getColor(config));
5486
+ _this.content = exports.Alert.getContent(config);
5487
+ _this.confirmFace = {
5488
+ text: function () { return config.ok(); },
5489
+ color: function () { return _this.color || 'primary'; },
5490
+ style: function () { return 'raised'; }
5491
+ };
5492
+ return _this;
5493
+ }
5494
+ AbstractDialogComponent.prototype.getConfig = function () {
5495
+ return typescriptUtilities.lang.abstractMethod(this.constructor);
5496
+ };
5497
+ AbstractDialogComponent.prototype.checkColor = function (rawColor) {
5498
+ if (this.isDestructive()) {
5499
+ return 'warn';
5500
+ }
5501
+ else {
5502
+ if (['primary', 'accent', 'warn'].includes(rawColor)) {
5503
+ return rawColor;
5504
+ }
5505
+ else {
5506
+ console.warn("Invalid color string " + rawColor);
5507
+ return undefined;
5508
+ }
5509
+ }
5510
+ };
5511
+ AbstractDialogComponent.prototype.isDestructive = function () {
5512
+ // @ts-ignore
5513
+ return ___namespace.isFunction(this.config['destructive']) && this.config.destructive();
5514
+ };
5515
+ return AbstractDialogComponent;
5516
+ }(Activity));
5517
+ AbstractDialogComponent.decorators = [
5518
+ { type: i0.Component, args: [{
5519
+ template: ''
5520
+ },] }
5521
+ ];
5522
+ AbstractDialogComponent.ctorParameters = function () { return [
5523
+ { type: undefined, decorators: [{ type: i0.Inject, args: [ALERT_CONFIG,] }] }
5524
+ ]; };
5525
+
5526
+ var AbstractConfirmDialogComponent = /** @class */ (function (_super) {
5527
+ __extends(AbstractConfirmDialogComponent, _super);
5528
+ function AbstractConfirmDialogComponent(config) {
5529
+ var _this = _super.call(this, config) || this;
5530
+ _this.cancelFace = {
5531
+ text: function () { return config.cancel(); }
5532
+ };
5533
+ _this.cancelCommand = pectin.Command.create(function () {
5534
+ return _this.cancel();
5535
+ });
5536
+ return _this;
5537
+ }
5538
+ return AbstractConfirmDialogComponent;
5539
+ }(AbstractDialogComponent));
5540
+ AbstractConfirmDialogComponent.decorators = [
5541
+ { type: i0.Component, args: [{
5542
+ template: ''
5543
+ },] }
5544
+ ];
5545
+ AbstractConfirmDialogComponent.ctorParameters = function () { return [
5546
+ { type: undefined, decorators: [{ type: i0.Inject, args: [ALERT_CONFIG,] }] }
5547
+ ]; };
5548
+
5477
5549
  var AlertDialogComponent = /** @class */ (function (_super) {
5478
5550
  __extends(AlertDialogComponent, _super);
5479
5551
  function AlertDialogComponent(alert) {
5480
- var _this = _super.call(this) || this;
5481
- _this.alert = alert;
5552
+ var _this = _super.call(this, alert) || this;
5482
5553
  _this.confirmCommand = pectin.Command.create(function () {
5483
5554
  _this.done();
5484
5555
  });
5485
- _this.title = exports.Alert.getTitle(alert);
5486
- _this.color = exports.Alert.getColor(alert);
5487
- _this.content = exports.Alert.getContent(alert);
5488
- _this.confirmFace = {
5489
- text: function () { return alert.ok(); },
5490
- color: function () { return _this.color || "primary"; },
5491
- style: function () { return "raised"; }
5492
- };
5493
5556
  return _this;
5494
5557
  }
5495
- AlertDialogComponent.prototype.isContentArray = function () {
5496
- return;
5497
- };
5498
- AlertDialogComponent.prototype.ngOnInit = function () {
5499
- };
5500
5558
  return AlertDialogComponent;
5501
- }(Activity));
5559
+ }(AbstractDialogComponent));
5502
5560
  AlertDialogComponent.decorators = [
5503
5561
  { type: i0.Component, args: [{
5504
5562
  selector: 'aup-alert-dialog',
@@ -5513,53 +5571,16 @@
5513
5571
  var ConfirmThenDialogComponent = /** @class */ (function (_super) {
5514
5572
  __extends(ConfirmThenDialogComponent, _super);
5515
5573
  function ConfirmThenDialogComponent(config) {
5516
- var _this = this;
5517
- var _a;
5518
- _this = _super.call(this) || this;
5519
- _this.config = config;
5520
- pectin.assert.notNil(config);
5574
+ var _this = _super.call(this, config.confirm) || this;
5521
5575
  _this.confirmCommand = pectin.Command.create(function () {
5522
- _this.interactionContext.startActivity(_this.config.activityType, _this.config.data)
5576
+ _this.interactionContext.startActivity(config.activityType, config.data)
5523
5577
  .then(function (result) { return _this.done(result); })
5524
5578
  .catch(function (error) { return _this.cancel(error); });
5525
5579
  });
5526
- _this.cancelCommand = pectin.Command.create(function () {
5527
- return _this.cancel();
5528
- });
5529
- _this.title = exports.Alert.getTitle(config.confirm);
5530
- _this.color = _this.isDestructive() ? 'warn' : (_a = exports.Alert.getColor(config.confirm)) !== null && _a !== void 0 ? _a : 'primary';
5531
- _this.content = exports.Alert.getContent(config.confirm);
5532
- _this.confirmFace = {
5533
- text: function () { return _this.confirm.ok(); },
5534
- color: function () { return _this.color; },
5535
- style: function () { return 'raised'; }
5536
- };
5537
- _this.cancelFace = {
5538
- text: function () { return _this.confirm.cancel(); },
5539
- };
5540
5580
  return _this;
5541
5581
  }
5542
- ConfirmThenDialogComponent.prototype.ngOnInit = function () {
5543
- };
5544
- Object.defineProperty(ConfirmThenDialogComponent.prototype, "confirm", {
5545
- get: function () {
5546
- return this.config.confirm;
5547
- },
5548
- enumerable: false,
5549
- configurable: true
5550
- });
5551
- Object.defineProperty(ConfirmThenDialogComponent.prototype, "titleColor", {
5552
- get: function () {
5553
- return this.isDestructive() ? 'warn' : undefined;
5554
- },
5555
- enumerable: false,
5556
- configurable: true
5557
- });
5558
- ConfirmThenDialogComponent.prototype.isDestructive = function () {
5559
- return this.confirm.destructive && this.confirm.destructive();
5560
- };
5561
5582
  return ConfirmThenDialogComponent;
5562
- }(Activity));
5583
+ }(AbstractConfirmDialogComponent));
5563
5584
  ConfirmThenDialogComponent.decorators = [
5564
5585
  { type: i0.Component, args: [{
5565
5586
  selector: 'aup-confirmation-dialog',
@@ -5574,65 +5595,30 @@
5574
5595
  var ConfirmThenExecuteDialogComponent = /** @class */ (function (_super) {
5575
5596
  __extends(ConfirmThenExecuteDialogComponent, _super);
5576
5597
  function ConfirmThenExecuteDialogComponent(data) {
5577
- var _this = this;
5578
- var _a;
5579
- _this = _super.call(this) || this;
5580
- _this.data = data;
5581
- pectin.assert.notNil(data);
5598
+ var _this = _super.call(this, data.confirm) || this;
5582
5599
  _this.confirmCommand = pectin.Command.create(function () { return __awaiter(_this, void 0, void 0, function () {
5583
5600
  var result, e_1;
5584
- return __generator(this, function (_b) {
5585
- switch (_b.label) {
5601
+ return __generator(this, function (_a) {
5602
+ switch (_a.label) {
5586
5603
  case 0:
5587
- _b.trys.push([0, 2, , 3]);
5604
+ _a.trys.push([0, 2, , 3]);
5588
5605
  return [4 /*yield*/, data.operation(this.interactionContext)];
5589
5606
  case 1:
5590
- result = _b.sent();
5607
+ result = _a.sent();
5591
5608
  this.done(result);
5592
5609
  return [3 /*break*/, 3];
5593
5610
  case 2:
5594
- e_1 = _b.sent();
5611
+ e_1 = _a.sent();
5595
5612
  this.cancel(e_1);
5596
5613
  return [3 /*break*/, 3];
5597
5614
  case 3: return [2 /*return*/];
5598
5615
  }
5599
5616
  });
5600
5617
  }); });
5601
- _this.cancelCommand = pectin.Command.create(function () {
5602
- return _this.cancel();
5603
- });
5604
- _this.title = exports.Alert.getTitle(data.confirm);
5605
- _this.color = _this.isDestructive() ? 'warn' : (_a = exports.Alert.getColor(data.confirm)) !== null && _a !== void 0 ? _a : 'primary';
5606
- _this.content = exports.Alert.getContent(data.confirm);
5607
- _this.confirmFace = {
5608
- text: function () { return _this.confirm.ok(); },
5609
- color: function () { return _this.color; },
5610
- style: function () { return 'raised'; }
5611
- };
5612
- _this.cancelFace = {
5613
- text: function () { return _this.confirm.cancel(); }
5614
- };
5615
5618
  return _this;
5616
5619
  }
5617
- Object.defineProperty(ConfirmThenExecuteDialogComponent.prototype, "confirm", {
5618
- get: function () {
5619
- return this.data.confirm;
5620
- },
5621
- enumerable: false,
5622
- configurable: true
5623
- });
5624
- Object.defineProperty(ConfirmThenExecuteDialogComponent.prototype, "titleColor", {
5625
- get: function () {
5626
- return this.isDestructive() ? 'warn' : undefined;
5627
- },
5628
- enumerable: false,
5629
- configurable: true
5630
- });
5631
- ConfirmThenExecuteDialogComponent.prototype.isDestructive = function () {
5632
- return this.confirm.destructive && this.confirm.destructive();
5633
- };
5634
5620
  return ConfirmThenExecuteDialogComponent;
5635
- }(Activity));
5621
+ }(AbstractConfirmDialogComponent));
5636
5622
  ConfirmThenExecuteDialogComponent.decorators = [
5637
5623
  { type: i0.Component, args: [{
5638
5624
  selector: 'aup-confirmation-execute-dialog',
@@ -5647,44 +5633,15 @@
5647
5633
  var ConfirmationDialogComponent = /** @class */ (function (_super) {
5648
5634
  __extends(ConfirmationDialogComponent, _super);
5649
5635
  function ConfirmationDialogComponent(confirm) {
5650
- var _this = this;
5651
- var _a;
5652
- _this = _super.call(this) || this;
5636
+ var _this = _super.call(this, confirm) || this;
5653
5637
  _this.confirm = confirm;
5654
- pectin.assert.notNil(confirm);
5655
5638
  _this.confirmCommand = pectin.Command.create(function () {
5656
5639
  return _this.done();
5657
5640
  });
5658
- _this.cancelCommand = pectin.Command.create(function () {
5659
- return _this.cancel();
5660
- });
5661
- _this.title = exports.Alert.getTitle(confirm);
5662
- _this.color = _this.isDestructive() ? 'warn' : (_a = exports.Alert.getColor(confirm)) !== null && _a !== void 0 ? _a : 'primary';
5663
- _this.content = exports.Alert.getContent(confirm);
5664
- _this.confirmFace = {
5665
- text: function () { return confirm.ok(); },
5666
- color: function () { return _this.color; },
5667
- style: function () { return 'raised'; }
5668
- };
5669
- _this.cancelFace = {
5670
- text: function () { return confirm.cancel(); }
5671
- };
5672
5641
  return _this;
5673
5642
  }
5674
- ConfirmationDialogComponent.prototype.ngOnInit = function () {
5675
- };
5676
- Object.defineProperty(ConfirmationDialogComponent.prototype, "titleColor", {
5677
- get: function () {
5678
- return this.isDestructive() ? 'warn' : undefined;
5679
- },
5680
- enumerable: false,
5681
- configurable: true
5682
- });
5683
- ConfirmationDialogComponent.prototype.isDestructive = function () {
5684
- return this.confirm.destructive && this.confirm.destructive();
5685
- };
5686
5643
  return ConfirmationDialogComponent;
5687
- }(Activity));
5644
+ }(AbstractConfirmDialogComponent));
5688
5645
  ConfirmationDialogComponent.decorators = [
5689
5646
  { type: i0.Component, args: [{
5690
5647
  selector: 'aup-confirmation-dialog',
@@ -7465,7 +7422,9 @@
7465
7422
  InlineActivityTriggerComponent,
7466
7423
  ModalActivityTriggerComponent,
7467
7424
  exports.AddCardActivityComponent,
7468
- exports.InlineStringEditorComponent
7425
+ exports.InlineStringEditorComponent,
7426
+ AbstractDialogComponent,
7427
+ AbstractConfirmDialogComponent,
7469
7428
  ],
7470
7429
  exports: [
7471
7430
  ActivityContainerComponent,
@@ -10790,10 +10749,13 @@
10790
10749
  */
10791
10750
 
10792
10751
  exports.ACTIVITY_DATA = ACTIVITY_DATA;
10752
+ exports.ALERT_CONFIG = ALERT_CONFIG;
10793
10753
  exports.AUP_PLACE_CONFIG = AUP_PLACE_CONFIG;
10794
10754
  exports.AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT = AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT;
10795
10755
  exports.AbstractActivityTriggerComponent = AbstractActivityTriggerComponent;
10796
10756
  exports.AbstractCardContainerComponent = AbstractCardContainerComponent;
10757
+ exports.AbstractConfirmDialogComponent = AbstractConfirmDialogComponent;
10758
+ exports.AbstractDialogComponent = AbstractDialogComponent;
10797
10759
  exports.AbstractInputComponent = AbstractInputComponent;
10798
10760
  exports.AbstractInteractionContext = AbstractInteractionContext;
10799
10761
  exports.AbstractListInputComponent = AbstractListInputComponent;