@acorex/components 5.0.17 → 5.0.22

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.
@@ -224,7 +224,7 @@ function _ButtonComponentMixin(Base) {
224
224
  'ax-state-disabled': this["disabled"],
225
225
  'ax-state-selected': this.selected
226
226
  };
227
- cssClasses[`ax-${this.color || 'primary'}${this.look ? '-' + this.look : ''}`] = true;
227
+ cssClasses[`ax-${this.color || 'primary'}${this.look ? '-' + this.look : '-default'}`] = true;
228
228
  return cssClasses;
229
229
  }
230
230
  };
@@ -1080,7 +1080,7 @@ class AXAlertComponent extends AXBaseComponentMixin {
1080
1080
  }
1081
1081
  }
1082
1082
  get hostClass() {
1083
- return `ax-${this.color}`;
1083
+ return `ax-${this.color}-default`;
1084
1084
  }
1085
1085
  /**
1086
1086
  * set the visibility of the Alert
@@ -1635,7 +1635,7 @@ class AXButtonItemComponent extends AXBaseItemButtonMixin {
1635
1635
  'ax-state-disabled': this.disabled,
1636
1636
  'ax-state-selected': this.selected,
1637
1637
  };
1638
- cssClasses[`ax-${this.color || 'primary'}`] = true;
1638
+ cssClasses[`ax-${this.color || 'primary'}-default`] = true;
1639
1639
  return Object.entries(cssClasses).filter(c => c[1]).map(c => c[0]).join(' ');
1640
1640
  }
1641
1641
  }
@@ -1695,7 +1695,7 @@ class AXDecoratorPrefixComponent extends AXBaseComponentMixin {
1695
1695
  }
1696
1696
  AXDecoratorPrefixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDecoratorPrefixComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1697
1697
  AXDecoratorPrefixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AXDecoratorPrefixComponent, selector: "ax-prefix", usesInheritance: true, ngImport: i0, template: `
1698
- <ng-content select="ax-button,ax-loading,ax-icon,ax-badge">
1698
+ <ng-content select="ax-button,ax-loading,ax-icon,ax-content">
1699
1699
  </ng-content>
1700
1700
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1701
1701
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDecoratorPrefixComponent, decorators: [{
@@ -1703,7 +1703,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1703
1703
  args: [{
1704
1704
  selector: 'ax-prefix',
1705
1705
  template: `
1706
- <ng-content select="ax-button,ax-loading,ax-icon,ax-badge">
1706
+ <ng-content select="ax-button,ax-loading,ax-icon,ax-content">
1707
1707
  </ng-content>
1708
1708
  `,
1709
1709
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -1718,7 +1718,7 @@ class AXDecoratorSuffixComponent extends AXBaseComponentMixin {
1718
1718
  }
1719
1719
  AXDecoratorSuffixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDecoratorSuffixComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1720
1720
  AXDecoratorSuffixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AXDecoratorSuffixComponent, selector: "ax-suffix", usesInheritance: true, ngImport: i0, template: `
1721
- <ng-content select="ax-button,ax-icon,ax-badge">
1721
+ <ng-content select="ax-button,ax-icon,ax-badge,ax-content">
1722
1722
  </ng-content>
1723
1723
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1724
1724
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDecoratorSuffixComponent, decorators: [{
@@ -1726,7 +1726,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
1726
1726
  args: [{
1727
1727
  selector: 'ax-suffix',
1728
1728
  template: `
1729
- <ng-content select="ax-button,ax-icon,ax-badge">
1729
+ <ng-content select="ax-button,ax-icon,ax-badge,ax-content">
1730
1730
  </ng-content>
1731
1731
  `,
1732
1732
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -2041,6 +2041,8 @@ class AXCalendarComponent extends AXCalendarComponentMixin {
2041
2041
  // 'ax-state-event': d.dayOfMonth == 12,
2042
2042
  };
2043
2043
  }
2044
+ // just for tailwind
2045
+ //'ax-col-start-1','ax-col-start-2','ax-col-start-3','ax-col-start-4','ax-col-start-5','ax-col-start-6','ax-col-start-7'
2044
2046
  r.cssClass[`ax-col-start-${vr.startTime.dayOfWeek}`] = i == 0;
2045
2047
  return r;
2046
2048
  });
@@ -3161,42 +3163,66 @@ class AXDatePickerComponent extends AXBaseDatePickerMixin {
3161
3163
  const sStart = input.selectionStart;
3162
3164
  const sEnd = input.selectionEnd;
3163
3165
  const dateVal = new AXDateTime(this.value);
3164
- // //
3165
- if (![...nums, ...chars].includes(key)) {
3166
- ignore();
3167
- }
3168
- if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
3169
- const re = /[a-zA-Z0-9]+/ig;
3170
- const next = Array.from(valStr.substr(sEnd).matchAll(re));
3171
- const prev = Array.from(valStr.substring(0, sStart).matchAll(re));
3172
- ignore();
3173
- this._highlightPart(input, (e.key === 'ArrowRight' ? (sEnd + (((_a = next[0]) === null || _a === void 0 ? void 0 : _a.index) || 0)) : ((_b = prev[prev.length - 1]) === null || _b === void 0 ? void 0 : _b.index)));
3174
- }
3175
- else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
3176
- const re = /[a-zA-Z0-9]+/ig;
3177
- const sign = e.key === 'ArrowUp' ? +1 : -1;
3178
- const parts = Array.from(this.format.matchAll(re));
3179
- const word = valStr.substring(sStart, sEnd);
3180
- const part = parts[Array.from(valStr.matchAll(re)).findIndex(c => c[0] == word)];
3166
+ //
3167
+ const re = /[a-zA-Z0-9]+/ig;
3168
+ const parts = Array.from(this.format.matchAll(re));
3169
+ const word = valStr.substring(sStart, sEnd);
3170
+ const part = parts[Array.from(valStr.matchAll(re)).findIndex(c => c[0] == word)];
3171
+ //
3172
+ //
3173
+ if ([...nums].includes(key)) {
3181
3174
  if (part) {
3182
3175
  switch (part[0]) {
3183
3176
  case 'dd':
3184
3177
  case 'DD':
3185
- this.value = dateVal.add('day', sign).date;
3178
+ debugger;
3179
+ const newVal = Math.max(1, Math.min(31, Number(word + e.key)));
3180
+ this.value = dateVal.set('day', newVal).date;
3186
3181
  break;
3187
3182
  case 'mm':
3188
- case 'MMM':
3189
- case 'MMMM':
3190
- this.value = dateVal.add('month', sign).date;
3191
3183
  break;
3192
3184
  case 'yy':
3193
3185
  case 'YYYY':
3194
- this.value = dateVal.add('year', sign).date;
3195
3186
  break;
3196
3187
  }
3197
3188
  setTimeout(() => {
3198
- this._highlightPart(input, sEnd - 1);
3189
+ this._highlightPart(input, sStart);
3199
3190
  }, Math.max(10, this.debounceTime));
3191
+ ignore();
3192
+ }
3193
+ }
3194
+ else if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
3195
+ const next = Array.from(valStr.substr(sEnd).matchAll(re));
3196
+ const prev = Array.from(valStr.substring(0, sStart).matchAll(re));
3197
+ ignore();
3198
+ this._highlightPart(input, (e.key === 'ArrowRight' ? (sEnd + (((_a = next[0]) === null || _a === void 0 ? void 0 : _a.index) || 0)) : ((_b = prev[prev.length - 1]) === null || _b === void 0 ? void 0 : _b.index)));
3199
+ }
3200
+ else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
3201
+ if (e.ctrlKey && e.key === 'ArrowDown') {
3202
+ this.open();
3203
+ }
3204
+ else {
3205
+ const sign = e.key === 'ArrowUp' ? +1 : -1;
3206
+ if (part) {
3207
+ switch (part[0]) {
3208
+ case 'dd':
3209
+ case 'DD':
3210
+ this.value = dateVal.add('day', sign).date;
3211
+ break;
3212
+ case 'mm':
3213
+ case 'MMM':
3214
+ case 'MMMM':
3215
+ this.value = dateVal.add('month', sign).date;
3216
+ break;
3217
+ case 'yy':
3218
+ case 'YYYY':
3219
+ this.value = dateVal.add('year', sign).date;
3220
+ break;
3221
+ }
3222
+ setTimeout(() => {
3223
+ this._highlightPart(input, sStart);
3224
+ }, Math.max(10, this.debounceTime));
3225
+ }
3200
3226
  }
3201
3227
  ignore();
3202
3228
  }
@@ -3445,10 +3471,10 @@ class AXDialogComponent extends AXBaseComponentMixin {
3445
3471
  }
3446
3472
  }
3447
3473
  AXDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDialogComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3448
- AXDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AXDialogComponent, selector: "ax-dialog", usesInheritance: true, ngImport: i0, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" cdkTrapFocus>\r\n <div class=\"ax-dialog ax-{{options.type}}\" tabindex=\"0\" cdkDrag role=\"alert\" cdkDragHandle>\r\n <div class=\"ax-dialog-icon-side\">\r\n <i class=\"ax-dialog-icon {{_icon}}\"></i>\r\n </div>\r\n <div class=\"ax-dialog-content-side\">\r\n <div class=\"ax-dialog-title\">{{options.title}}</div>\r\n <div class=\"ax-dialog-content\">{{options.content}}</div>\r\n </div>\r\n <div class=\"ax-dialog-dismiss-icon\">\r\n <i class=\"ax-ic ax-ic-close\" *ngIf=\"options.dismissible\" (click)=\"close()\"></i>\r\n </div>\r\n <footer class=\"ax-dialog-footer\">\r\n <ng-container *ngFor=\"let button of options.buttons\">\r\n <ax-button [text]=\"button.text\" [submitBehavior]=\"button.submitBehavior\" [cancelBehavior]=\"button.cancelBehavior\" (onClick)=\"_handleButtonClick(button)\" [class]=\"button.cssClass\" [look]=\"button.look\" [color]=\"button.color\"></ax-button>\r\n <div class=\"ax-ml-2\"></div>\r\n </ng-container>\r\n </footer>\r\n </div>\r\n\r\n</div>", components: [{ type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "text", "submitBehavior", "cancelBehavior", "color", "look", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }], directives: [{ type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i3$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i3$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3474
+ AXDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: AXDialogComponent, selector: "ax-dialog", usesInheritance: true, ngImport: i0, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" cdkTrapFocus>\r\n <div class=\"ax-dialog ax-{{options.type}}-default\" tabindex=\"0\" cdkDrag role=\"alert\" cdkDragHandle>\r\n <div class=\"ax-dialog-icon-side\">\r\n <i class=\"ax-dialog-icon {{_icon}}\"></i>\r\n </div>\r\n <div class=\"ax-dialog-content-side\">\r\n <div class=\"ax-dialog-title\">{{options.title}}</div>\r\n <div class=\"ax-dialog-content\">{{options.content}}</div>\r\n </div>\r\n <div class=\"ax-dialog-dismiss-icon\">\r\n <i class=\"ax-ic ax-ic-close\" *ngIf=\"options.dismissible\" (click)=\"close()\"></i>\r\n </div>\r\n <footer class=\"ax-dialog-footer\">\r\n <ng-container *ngFor=\"let button of options.buttons\">\r\n <ax-button [text]=\"button.text\" [submitBehavior]=\"button.submitBehavior\" [cancelBehavior]=\"button.cancelBehavior\" (onClick)=\"_handleButtonClick(button)\" [class]=\"button.cssClass\" [look]=\"button.look\" [color]=\"button.color\"></ax-button>\r\n <div class=\"ax-ml-2\"></div>\r\n </ng-container>\r\n </footer>\r\n </div>\r\n\r\n</div>", components: [{ type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "text", "submitBehavior", "cancelBehavior", "color", "look", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }], directives: [{ type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i3$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i3$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3449
3475
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AXDialogComponent, decorators: [{
3450
3476
  type: Component,
3451
- args: [{ selector: 'ax-dialog', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" cdkTrapFocus>\r\n <div class=\"ax-dialog ax-{{options.type}}\" tabindex=\"0\" cdkDrag role=\"alert\" cdkDragHandle>\r\n <div class=\"ax-dialog-icon-side\">\r\n <i class=\"ax-dialog-icon {{_icon}}\"></i>\r\n </div>\r\n <div class=\"ax-dialog-content-side\">\r\n <div class=\"ax-dialog-title\">{{options.title}}</div>\r\n <div class=\"ax-dialog-content\">{{options.content}}</div>\r\n </div>\r\n <div class=\"ax-dialog-dismiss-icon\">\r\n <i class=\"ax-ic ax-ic-close\" *ngIf=\"options.dismissible\" (click)=\"close()\"></i>\r\n </div>\r\n <footer class=\"ax-dialog-footer\">\r\n <ng-container *ngFor=\"let button of options.buttons\">\r\n <ax-button [text]=\"button.text\" [submitBehavior]=\"button.submitBehavior\" [cancelBehavior]=\"button.cancelBehavior\" (onClick)=\"_handleButtonClick(button)\" [class]=\"button.cssClass\" [look]=\"button.look\" [color]=\"button.color\"></ax-button>\r\n <div class=\"ax-ml-2\"></div>\r\n </ng-container>\r\n </footer>\r\n </div>\r\n\r\n</div>" }]
3477
+ args: [{ selector: 'ax-dialog', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" cdkTrapFocus>\r\n <div class=\"ax-dialog ax-{{options.type}}-default\" tabindex=\"0\" cdkDrag role=\"alert\" cdkDragHandle>\r\n <div class=\"ax-dialog-icon-side\">\r\n <i class=\"ax-dialog-icon {{_icon}}\"></i>\r\n </div>\r\n <div class=\"ax-dialog-content-side\">\r\n <div class=\"ax-dialog-title\">{{options.title}}</div>\r\n <div class=\"ax-dialog-content\">{{options.content}}</div>\r\n </div>\r\n <div class=\"ax-dialog-dismiss-icon\">\r\n <i class=\"ax-ic ax-ic-close\" *ngIf=\"options.dismissible\" (click)=\"close()\"></i>\r\n </div>\r\n <footer class=\"ax-dialog-footer\">\r\n <ng-container *ngFor=\"let button of options.buttons\">\r\n <ax-button [text]=\"button.text\" [submitBehavior]=\"button.submitBehavior\" [cancelBehavior]=\"button.cancelBehavior\" (onClick)=\"_handleButtonClick(button)\" [class]=\"button.cssClass\" [look]=\"button.look\" [color]=\"button.color\"></ax-button>\r\n <div class=\"ax-ml-2\"></div>\r\n </ng-container>\r\n </footer>\r\n </div>\r\n\r\n</div>" }]
3452
3478
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; } });
3453
3479
 
3454
3480
  /**