@alauda/ui 6.2.1-beta.1 → 6.2.1-beta.10

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 (47) hide show
  1. package/alauda-ui.d.ts +3 -3
  2. package/alauda-ui.metadata.json +1 -1
  3. package/bundles/alauda-ui.umd.js +78 -12
  4. package/bundles/alauda-ui.umd.js.map +1 -1
  5. package/bundles/alauda-ui.umd.min.js +1 -1
  6. package/bundles/alauda-ui.umd.min.js.map +1 -1
  7. package/button/button.component.d.ts +1 -0
  8. package/dropdown/dropdown.directive.d.ts +1 -0
  9. package/esm2015/alauda-ui.js +4 -4
  10. package/esm2015/alauda-ui.ngsummary.json +1 -1
  11. package/esm2015/autocomplete/autocomplete.module.js +3 -1
  12. package/esm2015/autocomplete/autocomplete.module.ngfactory.js +1 -1
  13. package/esm2015/autocomplete/suggestion/suggestion.component.ngfactory.js +9 -8
  14. package/esm2015/button/button.component.js +7 -2
  15. package/esm2015/button/button.component.ngfactory.js +1 -1
  16. package/esm2015/button/button.component.ngsummary.json +1 -1
  17. package/esm2015/date-picker/calendar/date-picker-panel/component.ngfactory.js +3 -3
  18. package/esm2015/date-picker/calendar/footer/component.ngfactory.js +5 -5
  19. package/esm2015/date-picker/calendar/header/component.ngfactory.js +9 -9
  20. package/esm2015/date-picker/calendar/panel/picker-panel.ngfactory.js +3 -3
  21. package/esm2015/dialog/confirm-dialog/confirm-dialog.component.ngfactory.js +5 -5
  22. package/esm2015/dialog/dialog.component.js +2 -2
  23. package/esm2015/dialog/dialog.component.ngfactory.js +2 -2
  24. package/esm2015/dropdown/dropdown-button/dropdown-button.component.js +2 -2
  25. package/esm2015/dropdown/dropdown-button/dropdown-button.component.ngfactory.js +3 -3
  26. package/esm2015/dropdown/dropdown.directive.js +8 -2
  27. package/esm2015/dropdown/dropdown.directive.ngsummary.json +1 -1
  28. package/esm2015/input/input.component.js +5 -2
  29. package/esm2015/input/number-input/number-input.component.ngfactory.js +5 -5
  30. package/esm2015/paginator/paginator.component.js +1 -1
  31. package/esm2015/paginator/paginator.component.ngfactory.js +13 -13
  32. package/esm2015/paginator/paginator.component.scss.ngstyle.js +1 -1
  33. package/esm2015/public-api.ngsummary.json +1 -1
  34. package/esm2015/radio/base-radio.js +2 -2
  35. package/esm2015/time-picker/panel/panel.component.ngfactory.js +4 -4
  36. package/esm2015/utils/e2e-attribute-binding.directive.js +34 -0
  37. package/esm2015/utils/e2e-attribute-binding.directive.ngsummary.json +1 -0
  38. package/esm2015/utils/fn.js +10 -1
  39. package/esm2015/utils/fn.ngsummary.json +1 -1
  40. package/esm2015/utils/index.js +2 -1
  41. package/esm2015/utils/index.ngsummary.json +1 -1
  42. package/fesm2015/alauda-ui.js +65 -11
  43. package/fesm2015/alauda-ui.js.map +1 -1
  44. package/package.json +1 -1
  45. package/utils/e2e-attribute-binding.directive.d.ts +7 -0
  46. package/utils/fn.d.ts +1 -0
  47. package/utils/index.d.ts +1 -0
@@ -106,6 +106,15 @@
106
106
  var last = function (values) { return values === null || values === void 0 ? void 0 : values[values.length - 1]; };
107
107
  var isTemplateRef = function (label) { return label instanceof i0.TemplateRef; };
108
108
  var handlePixel = function (value) { return Number.isNaN(+value) ? value : value + 'px'; };
109
+ var simplifyStringToTestId = function (input) {
110
+ if (!input)
111
+ return '';
112
+ return input
113
+ .replaceAll('\r', '')
114
+ .replaceAll('\n', '')
115
+ .replaceAll('\\s', '')
116
+ .replaceAll(' ', '');
117
+ };
109
118
 
110
119
  /*! *****************************************************************************
111
120
  Copyright (c) Microsoft Corporation.
@@ -481,6 +490,39 @@
481
490
  return queryList.changes.pipe(operators.startWith(queryList), operators.map(function (list) { return !!list.length; }), operators.publishReplay(1), operators.refCount());
482
491
  }
483
492
 
493
+ var simplifyString = function (str) { return str
494
+ .replaceAll('\r', '')
495
+ .replaceAll('\n', '')
496
+ .replaceAll('\\s', '')
497
+ .replaceAll(' ', ''); };
498
+ var ɵ0 = simplifyString;
499
+ var E2eAttributeBindingDirective = /** @class */ (function () {
500
+ function E2eAttributeBindingDirective(el) {
501
+ this.el = el;
502
+ }
503
+ E2eAttributeBindingDirective.prototype.ngAfterViewInit = function () {
504
+ this.setId();
505
+ };
506
+ E2eAttributeBindingDirective.prototype.setId = function () {
507
+ var currentAttr = simplifyString(this.el.nativeElement.getAttribute('data-test') ||
508
+ simplifyString(this.el.nativeElement.nodeName +
509
+ '/' +
510
+ this.el.nativeElement.textContent));
511
+ if (currentAttr !== this.el.nativeElement.getAttribute('data-test')) {
512
+ this.el.nativeElement.dataset.test = currentAttr;
513
+ }
514
+ };
515
+ return E2eAttributeBindingDirective;
516
+ }());
517
+ E2eAttributeBindingDirective.decorators = [
518
+ { type: i0.Directive, args: [{
519
+ selector: '[click]',
520
+ },] }
521
+ ];
522
+ E2eAttributeBindingDirective.ctorParameters = function () { return [
523
+ { type: i0.ElementRef }
524
+ ]; };
525
+
484
526
  var ThemeService = /** @class */ (function () {
485
527
  function ThemeService() {
486
528
  var _this = this;
@@ -1502,6 +1544,13 @@
1502
1544
  this.renderer.addClass(this.el.nativeElement, prefix + this.size);
1503
1545
  this.focusMonitor.monitor(this.el.nativeElement, false);
1504
1546
  }
1547
+ Object.defineProperty(ButtonComponent.prototype, "testId", {
1548
+ get: function () {
1549
+ return ('AUI-BUTTON/' + simplifyStringToTestId(this.el.nativeElement.textContent));
1550
+ },
1551
+ enumerable: false,
1552
+ configurable: true
1553
+ });
1505
1554
  Object.defineProperty(ButtonComponent.prototype, "type", {
1506
1555
  get: function () {
1507
1556
  return this._type;
@@ -1622,6 +1671,7 @@
1622
1671
  { type: a11y.FocusMonitor }
1623
1672
  ]; };
1624
1673
  ButtonComponent.propDecorators = {
1674
+ testId: [{ type: i0.HostBinding, args: ['attr.data-test',] }],
1625
1675
  type: [{ type: i0.Input, args: ['aui-button',] }],
1626
1676
  size: [{ type: i0.Input }],
1627
1677
  plain: [{ type: i0.Input }],
@@ -2773,7 +2823,7 @@
2773
2823
  DialogComponent.decorators = [
2774
2824
  { type: i0.Component, args: [{
2775
2825
  selector: 'aui-dialog',
2776
- template: "<div [ngClass]=\"rootClass\" [ngStyle]=\"customStyle\">\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n",
2826
+ template: "<div [ngClass]=\"rootClass\" [ngStyle]=\"customStyle\" data-test=\"AUI-DIALOG\">\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n",
2777
2827
  encapsulation: i0.ViewEncapsulation.None,
2778
2828
  // tslint:disable-next-line:validate-decorators
2779
2829
  changeDetection: i0.ChangeDetectionStrategy.Default,
@@ -3580,7 +3630,7 @@
3580
3630
  });
3581
3631
  Object.defineProperty(BaseRadio.prototype, "_testId", {
3582
3632
  get: function () {
3583
- return 'RADIO/' + this.value;
3633
+ return 'AUI-RADIO/' + this.value;
3584
3634
  },
3585
3635
  enumerable: false,
3586
3636
  configurable: true
@@ -3992,7 +4042,10 @@
3992
4042
  }
3993
4043
  Object.defineProperty(InputComponent.prototype, "testId", {
3994
4044
  get: function () {
3995
- return this.elementRef.nativeElement.getAttribute('name') || 'aui-input';
4045
+ return ('AUI-INPUT/' +
4046
+ (this.elementRef.nativeElement.getAttribute('formcontrolname') ||
4047
+ this.elementRef.nativeElement.getAttribute('name') ||
4048
+ ''));
3996
4049
  },
3997
4050
  enumerable: false,
3998
4051
  configurable: true
@@ -5096,6 +5149,14 @@
5096
5149
  _this.trigger = exports.TooltipTrigger.Click;
5097
5150
  return _this;
5098
5151
  }
5152
+ Object.defineProperty(DropdownDirective.prototype, "testId", {
5153
+ get: function () {
5154
+ return ('AUI-DROPDOWN/' +
5155
+ simplifyStringToTestId(this.elRef.nativeElement.textContent));
5156
+ },
5157
+ enumerable: false,
5158
+ configurable: true
5159
+ });
5099
5160
  Object.defineProperty(DropdownDirective.prototype, "menu", {
5100
5161
  get: function () {
5101
5162
  return this._menu;
@@ -5153,6 +5214,7 @@
5153
5214
  { type: i0.NgZone }
5154
5215
  ]; };
5155
5216
  DropdownDirective.propDecorators = {
5217
+ testId: [{ type: i0.HostBinding, args: ['attr.data-test',] }],
5156
5218
  menu: [{ type: i0.Input, args: ['auiDropdown',] }],
5157
5219
  lazyContentContext: [{ type: i0.Input, args: ['auiDropdownContext',] }],
5158
5220
  hideOnClick: [{ type: i0.Input, args: ['auiDropdownHideOnClick',] }],
@@ -5329,7 +5391,7 @@
5329
5391
  DropdownButtonComponent.decorators = [
5330
5392
  { type: i0.Component, args: [{
5331
5393
  selector: 'aui-dropdown-button',
5332
- template: "<div [class]=\"bem.block(size)\">\n <button\n type=\"button\"\n class=\"aui-dropdown-button__content\"\n [aui-button]=\"type\"\n [plain]=\"plain\"\n [size]=\"size\"\n [loading]=\"loading\"\n [disabled]=\"disabled\"\n (click)=\"buttonClick.emit($event)\"\n >\n <ng-content></ng-content>\n </button>\n <button\n type=\"button\"\n class=\"aui-dropdown-button__trigger\"\n [aui-button]=\"type\"\n [plain]=\"plain\"\n [size]=\"size\"\n [auiDropdown]=\"menu\"\n [disabled]=\"disableTrigger\"\n >\n <aui-icon icon=\"angle_down\"></aui-icon>\n </button>\n</div>\n",
5394
+ template: "<div [class]=\"bem.block(size)\">\n <button\n type=\"button\"\n class=\"aui-dropdown-button__content\"\n [aui-button]=\"type\"\n [plain]=\"plain\"\n [size]=\"size\"\n [loading]=\"loading\"\n [disabled]=\"disabled\"\n (click)=\"buttonClick.emit($event)\"\n data-test=\"DROPDOWN-BUTTON/\"\n >\n <ng-content></ng-content>\n </button>\n <button\n type=\"button\"\n class=\"aui-dropdown-button__trigger\"\n [aui-button]=\"type\"\n [plain]=\"plain\"\n [size]=\"size\"\n [auiDropdown]=\"menu\"\n [disabled]=\"disableTrigger\"\n >\n <aui-icon icon=\"angle_down\"></aui-icon>\n </button>\n</div>\n",
5333
5395
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
5334
5396
  encapsulation: i0.ViewEncapsulation.None,
5335
5397
  preserveWhitespaces: false,
@@ -6711,7 +6773,7 @@
6711
6773
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
6712
6774
  encapsulation: i0.ViewEncapsulation.None,
6713
6775
  preserveWhitespaces: false,
6714
- styles: [".aui-paginator{display:inline-flex;align-items:center;color:rgb(var(--aui-color-n-1))}.aui-paginator .aui-button{width:var(--aui-line-height-xl);height:var(--aui-line-height-xl);border:unset;background-color:transparent}.aui-paginator .aui-button .aui-button__content{padding:unset}.aui-paginator__fast-navigator[hidden]{display:none}.aui-paginator__fast-navigator .aui-icon{margin:0}.aui-paginator__fast-navigator:hover aui-icon:first-child,.aui-paginator__fast-navigator aui-icon:last-child{display:none}.aui-paginator__fast-navigator:hover aui-icon:last-child{display:inline}.aui-paginator__sizes{display:inline-flex;align-items:center}.aui-paginator__sizes .aui-select{width:80px;margin-right:var(--aui-spacing-s)}.aui-paginator__jumper .aui-input{width:80px}.aui-paginator__jumper span+input{margin-left:var(--aui-spacing-m)}.aui-paginator__jumper input+span{margin-left:var(--aui-spacing-s)}.aui-paginator__total{font-size:var(--aui-font-size-m)}.aui-paginator__navigator.aui-button{background-color:rgb(var(--aui-color-n-8))}.aui-paginator__navigator.aui-button aui-icon{font-size:var(--aui-font-size-l)}.aui-paginator__navigator.aui-button:hover{background-color:rgb(var(--aui-color-p-6))}.aui-paginator__pager{border:1px solid rgb(var(--aui-color-n-7));padding:3px;border-radius:var(--aui-border-radius-m);background-color:rgb(var(--aui-color-main-bg))}.aui-paginator__layout{display:inline-block}.aui-paginator__layout+.aui-paginator__layout{margin-left:var(--aui-spacing-l)}"]
6776
+ styles: [".aui-paginator{display:inline-flex;align-items:center;color:rgb(var(--aui-color-n-1))}.aui-paginator .aui-button{width:var(--aui-line-height-xl);height:var(--aui-line-height-xl);border:unset}.aui-paginator .aui-button--default{background-color:transparent}.aui-paginator .aui-button .aui-button__content{padding:unset}.aui-paginator__fast-navigator[hidden]{display:none}.aui-paginator__fast-navigator .aui-icon{margin:0}.aui-paginator__fast-navigator:hover aui-icon:first-child,.aui-paginator__fast-navigator aui-icon:last-child{display:none}.aui-paginator__fast-navigator:hover aui-icon:last-child{display:inline}.aui-paginator__sizes{display:inline-flex;align-items:center}.aui-paginator__sizes .aui-select{width:80px;margin-right:var(--aui-spacing-s)}.aui-paginator__jumper .aui-input{width:80px}.aui-paginator__jumper span+input{margin-left:var(--aui-spacing-m)}.aui-paginator__jumper input+span{margin-left:var(--aui-spacing-s)}.aui-paginator__total{font-size:var(--aui-font-size-m)}.aui-paginator__navigator.aui-button{background-color:rgb(var(--aui-color-n-8))}.aui-paginator__navigator.aui-button aui-icon{font-size:var(--aui-font-size-l)}.aui-paginator__navigator.aui-button:hover{background-color:rgb(var(--aui-color-p-6))}.aui-paginator__pager{border:1px solid rgb(var(--aui-color-n-7));padding:3px;border-radius:var(--aui-border-radius-m);background-color:rgb(var(--aui-color-main-bg))}.aui-paginator__layout{display:inline-block}.aui-paginator__layout+.aui-paginator__layout{margin-left:var(--aui-spacing-l)}"]
6715
6777
  },] }
6716
6778
  ];
6717
6779
  PaginatorComponent.ctorParameters = function () { return [
@@ -9354,6 +9416,7 @@
9354
9416
  AutocompletePlaceholderComponent,
9355
9417
  SuggestionGroupComponent,
9356
9418
  SuggestionGroupTitleDirective,
9419
+ E2eAttributeBindingDirective,
9357
9420
  ],
9358
9421
  exports: [
9359
9422
  AutoCompleteDirective,
@@ -9989,7 +10052,7 @@
9989
10052
  table: [{ type: i0.ContentChild, args: [TableComponent, { static: false },] }]
9990
10053
  };
9991
10054
 
9992
- var ɵ0 = scrolling._fixedSizeVirtualScrollStrategyFactory;
10055
+ var ɵ0$1 = scrolling._fixedSizeVirtualScrollStrategyFactory;
9993
10056
  var FixedSizeVirtualScrollDirective = /** @class */ (function (_super) {
9994
10057
  __extends(FixedSizeVirtualScrollDirective, _super);
9995
10058
  function FixedSizeVirtualScrollDirective() {
@@ -10004,7 +10067,7 @@
10004
10067
  providers: [
10005
10068
  {
10006
10069
  provide: scrolling.VIRTUAL_SCROLL_STRATEGY,
10007
- useFactory: ɵ0,
10070
+ useFactory: ɵ0$1,
10008
10071
  deps: [i0.forwardRef(function () { return FixedSizeVirtualScrollDirective; })],
10009
10072
  },
10010
10073
  ],
@@ -10871,8 +10934,8 @@
10871
10934
  tooltipRef: [{ type: i0.ViewChild, args: ['tooltipRef',] }]
10872
10935
  };
10873
10936
 
10874
- var ɵ0$1 = function (_, index) { return index; };
10875
- var HOUR_ITEMS = Array.from({ length: 24 }).map(ɵ0$1);
10937
+ var ɵ0$2 = function (_, index) { return index; };
10938
+ var HOUR_ITEMS = Array.from({ length: 24 }).map(ɵ0$2);
10876
10939
  var ɵ1 = function (_, index) { return index; };
10877
10940
  var MINUTE_ITEMS = Array.from({ length: 60 }).map(ɵ1);
10878
10941
  var ɵ2 = function (_, index) { return index; };
@@ -12592,6 +12655,7 @@
12592
12655
  exports.DropdownButtonComponent = DropdownButtonComponent;
12593
12656
  exports.DropdownDirective = DropdownDirective;
12594
12657
  exports.DropdownModule = DropdownModule;
12658
+ exports.E2eAttributeBindingDirective = E2eAttributeBindingDirective;
12595
12659
  exports.FixedSizeTableVirtualScrollDirective = FixedSizeTableVirtualScrollDirective;
12596
12660
  exports.FixedSizeTableVirtualScrollStrategy = FixedSizeTableVirtualScrollStrategy;
12597
12661
  exports.FixedSizeVirtualScrollDirective = FixedSizeVirtualScrollDirective;
@@ -12768,6 +12832,7 @@
12768
12832
  exports.observeMutationOn = observeMutationOn;
12769
12833
  exports.observeResizeOn = observeResizeOn;
12770
12834
  exports.scrollIntoView = scrollIntoView;
12835
+ exports.simplifyStringToTestId = simplifyStringToTestId;
12771
12836
  exports.sleep = sleep;
12772
12837
  exports.watchContentExist = watchContentExist;
12773
12838
  exports.zh = zh;
@@ -12796,9 +12861,10 @@
12796
12861
  exports.ɵt = MessageAnimations;
12797
12862
  exports.ɵu = BaseMessage;
12798
12863
  exports.ɵv = NotificationWrapperComponent;
12799
- exports.ɵw = VirtualForOfDirective;
12800
- exports.ɵx = _isNumberValue;
12801
- exports.ɵy = DatePickerComponent;
12864
+ exports.ɵw = E2eAttributeBindingDirective;
12865
+ exports.ɵx = VirtualForOfDirective;
12866
+ exports.ɵy = _isNumberValue;
12867
+ exports.ɵz = DatePickerComponent;
12802
12868
 
12803
12869
  Object.defineProperty(exports, '__esModule', { value: true });
12804
12870