matcha-components 20.253.0 → 20.257.0

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.
@@ -8343,6 +8343,7 @@ class MatchaTabItemComponent {
8343
8343
  this.icon = '';
8344
8344
  this._active = false;
8345
8345
  this._hasBeenActivated = false;
8346
+ this._disabled = false;
8346
8347
  }
8347
8348
  set active(value) {
8348
8349
  this._active = value === '' || value === true || value === 'true';
@@ -8352,8 +8353,12 @@ class MatchaTabItemComponent {
8352
8353
  }
8353
8354
  get active() { return this._active; }
8354
8355
  get hasBeenActivated() { return this._hasBeenActivated; }
8356
+ set disabled(value) {
8357
+ this._disabled = value === '' || value === true || value === 'true';
8358
+ }
8359
+ get disabled() { return this._disabled; }
8355
8360
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaTabItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8356
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaTabItemComponent, isStandalone: false, selector: "matcha-tab", inputs: { title: "title", icon: "icon", active: "active" }, ngImport: i0, template: "<div *ngIf=\"hasBeenActivated\" [hidden]=\"!active\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
8361
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaTabItemComponent, isStandalone: false, selector: "matcha-tab", inputs: { title: "title", icon: "icon", active: "active", disabled: "disabled" }, ngImport: i0, template: "<div *ngIf=\"hasBeenActivated\" [hidden]=\"!active\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
8357
8362
  }
8358
8363
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaTabItemComponent, decorators: [{
8359
8364
  type: Component,
@@ -8364,6 +8369,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
8364
8369
  type: Input
8365
8370
  }], active: [{
8366
8371
  type: Input
8372
+ }], disabled: [{
8373
+ type: Input
8367
8374
  }] } });
8368
8375
 
8369
8376
  class MatchaTabsComponent {
@@ -8400,7 +8407,7 @@ class MatchaTabsComponent {
8400
8407
  }
8401
8408
  /** Ativa uma tab por interação do usuário (emite eventos) */
8402
8409
  selectTab(tab) {
8403
- if (tab.active)
8410
+ if (tab.active || tab.disabled)
8404
8411
  return;
8405
8412
  this.setActiveTab(tab);
8406
8413
  const index = this.tabs.toArray().indexOf(tab);
@@ -8445,11 +8452,11 @@ class MatchaTabsComponent {
8445
8452
  }
8446
8453
  }
8447
8454
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaTabsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
8448
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { selectedIndex: "selectedIndex", activeTabIndex: "activeTabIndex" }, outputs: { selectedIndexChange: "selectedIndexChange", selectedTabChange: "selectedTabChange", tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex-column gap-outside w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-md-128 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"color-fg fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
8455
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { selectedIndex: "selectedIndex", activeTabIndex: "activeTabIndex" }, outputs: { selectedIndexChange: "selectedIndexChange", selectedTabChange: "selectedTabChange", tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex-column gap-outside w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [attr.disabled]=\"tab.disabled || null\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n {{tab.disabled ? 'cursor-not-allowed' : 'cursor-pointer'}} w-100-p min-w-md-128 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active && !tab.disabled ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" [color]=\"tab.disabled ? 'grey' : 'accent'\" size=\"md\"></matcha-icon>\n <span class=\"{{tab.disabled ? 'color-grey' : 'color-fg'}} fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
8449
8456
  }
8450
8457
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaTabsComponent, decorators: [{
8451
8458
  type: Component,
8452
- args: [{ selector: 'matcha-tabs', animations: [...createAnimations], standalone: false, template: "<div class=\"flex-column gap-outside w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-md-128 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"color-fg fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n" }]
8459
+ args: [{ selector: 'matcha-tabs', animations: [...createAnimations], standalone: false, template: "<div class=\"flex-column gap-outside w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [attr.disabled]=\"tab.disabled || null\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n {{tab.disabled ? 'cursor-not-allowed' : 'cursor-pointer'}} w-100-p min-w-md-128 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active && !tab.disabled ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" [color]=\"tab.disabled ? 'grey' : 'accent'\" size=\"md\"></matcha-icon>\n <span class=\"{{tab.disabled ? 'color-grey' : 'color-fg'}} fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n" }]
8453
8460
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { tabs: [{
8454
8461
  type: ContentChildren,
8455
8462
  args: [MatchaTabItemComponent]
@@ -14595,74 +14602,111 @@ function buildSunEditorConfig(options = {}) {
14595
14602
  };
14596
14603
  }
14597
14604
  function _buildButtonList(opts) {
14598
- // Desktop toolbar — mirrors suneditor.html reference exactly
14605
+ const formatGroup = _groupFormat(opts);
14606
+ const textGroup = _groupText(opts);
14607
+ const colorGroup = _groupColor(opts);
14608
+ const indentGroup = _groupIndent(opts);
14609
+ const insertGroup = _groupInsert(opts);
14610
+ const viewGroup = _groupView(opts);
14611
+ // Desktop toolbar
14599
14612
  const desktop = [['undo', 'redo']];
14600
- if (opts.showFormats || opts.showFont) {
14601
- desktop.push('|', ['blockStyle', 'font', 'fontSize']);
14602
- }
14603
- if (opts.showBold || opts.showItalic || opts.showUnderline || opts.showStrike) {
14604
- desktop.push('|', ['bold', 'italic', 'underline', 'strike']);
14605
- }
14606
- if (opts.showFontColor || opts.showHiliteColor) {
14607
- desktop.push('|', ['fontColor', 'backgroundColor']);
14608
- }
14613
+ if (formatGroup.length)
14614
+ desktop.push('|', formatGroup);
14615
+ if (textGroup.length)
14616
+ desktop.push('|', textGroup);
14617
+ if (colorGroup.length)
14618
+ desktop.push('|', colorGroup);
14609
14619
  desktop.push('|', ['removeFormat'], '/');
14610
- if (opts.showInOutDent || opts.showAlign || opts.showList) {
14611
- desktop.push(['outdent', 'indent', 'align', 'list']);
14612
- }
14613
- if (opts.showTable || opts.showLink || opts.showImage || opts.showVideo) {
14614
- desktop.push('|', ['table', 'link', 'image', 'video']);
14615
- }
14616
- const viewBtns = [
14620
+ if (indentGroup.length)
14621
+ desktop.push(indentGroup);
14622
+ if (insertGroup.length)
14623
+ desktop.push('|', insertGroup);
14624
+ if (viewGroup.length)
14625
+ desktop.push('|', viewGroup);
14626
+ // %992: format group collapses into a "more" dropdown
14627
+ const bp992 = [['undo', 'redo'], '|'];
14628
+ if (formatGroup.length)
14629
+ bp992.push([':Format-default.more_paragraph', ...formatGroup]);
14630
+ if (textGroup.length)
14631
+ bp992.push(textGroup);
14632
+ if (colorGroup.length)
14633
+ bp992.push('|', colorGroup);
14634
+ bp992.push('|', ['removeFormat']);
14635
+ if (indentGroup.length)
14636
+ bp992.push('|', indentGroup);
14637
+ if (insertGroup.length)
14638
+ bp992.push('|', insertGroup);
14639
+ if (viewGroup.length)
14640
+ bp992.push('|', viewGroup);
14641
+ // %768: removeFormat moves inside format dropdown; insert collapses
14642
+ const bp768 = [['undo', 'redo'], '|'];
14643
+ if (formatGroup.length) {
14644
+ bp768.push([':Format-default.more_paragraph', ...formatGroup, '|', 'removeFormat']);
14645
+ }
14646
+ else {
14647
+ bp768.push(['removeFormat']);
14648
+ }
14649
+ if (textGroup.length)
14650
+ bp768.push(textGroup);
14651
+ if (colorGroup.length)
14652
+ bp768.push('|', colorGroup);
14653
+ if (indentGroup.length)
14654
+ bp768.push(indentGroup);
14655
+ if (insertGroup.length)
14656
+ bp768.push('|', [':Insert-default.more_plus', ...insertGroup]);
14657
+ if (viewGroup.length)
14658
+ bp768.push('|', viewGroup);
14659
+ // %576: text+color+removeFormat collapse into one dropdown
14660
+ const bp576 = [['undo', 'redo'], '|'];
14661
+ if (formatGroup.length)
14662
+ bp576.push([':Format-default.more_paragraph', ...formatGroup]);
14663
+ if (textGroup.length || colorGroup.length) {
14664
+ const combined = [':Text-default.more_text', ...textGroup];
14665
+ if (colorGroup.length)
14666
+ combined.push('|', ...colorGroup);
14667
+ combined.push('|', 'removeFormat');
14668
+ bp576.push(combined);
14669
+ }
14670
+ else {
14671
+ bp576.push(['removeFormat']);
14672
+ }
14673
+ if (indentGroup.length)
14674
+ bp576.push(indentGroup);
14675
+ if (insertGroup.length)
14676
+ bp576.push('|', [':Insert-default.more_plus', ...insertGroup]);
14677
+ if (viewGroup.length)
14678
+ bp576.push(['-right', ...viewGroup]);
14679
+ return [
14680
+ ...desktop,
14681
+ ['%992', bp992],
14682
+ ['%768', bp768],
14683
+ ['%576', bp576],
14684
+ ];
14685
+ }
14686
+ function _groupFormat(opts) {
14687
+ return (opts.showFormats || opts.showFont) ? ['blockStyle', 'font', 'fontSize'] : [];
14688
+ }
14689
+ function _groupText(opts) {
14690
+ return (opts.showBold || opts.showItalic || opts.showUnderline || opts.showStrike)
14691
+ ? ['bold', 'italic', 'underline', 'strike'] : [];
14692
+ }
14693
+ function _groupColor(opts) {
14694
+ return (opts.showFontColor || opts.showHiliteColor) ? ['fontColor', 'backgroundColor'] : [];
14695
+ }
14696
+ function _groupIndent(opts) {
14697
+ return (opts.showInOutDent || opts.showAlign || opts.showList)
14698
+ ? ['outdent', 'indent', 'align', 'list'] : [];
14699
+ }
14700
+ function _groupInsert(opts) {
14701
+ return (opts.showTable || opts.showLink || opts.showImage || opts.showVideo)
14702
+ ? ['table', 'link', 'image', 'video'] : [];
14703
+ }
14704
+ function _groupView(opts) {
14705
+ return [
14617
14706
  ...(opts.showFullScreen ? ['fullScreen'] : []),
14618
14707
  ...(opts.showCodeView ? ['codeView'] : []),
14619
14708
  ...(opts.showMarkdown ? ['markdownView'] : []),
14620
14709
  ];
14621
- if (viewBtns.length)
14622
- desktop.push('|', viewBtns);
14623
- // Responsive breakpoints — mirrors suneditor.html reference exactly
14624
- return [
14625
- ...desktop,
14626
- ['%992', [
14627
- ['undo', 'redo'],
14628
- '|',
14629
- [':Format-default.more_paragraph', 'blockStyle', 'font', 'fontSize'],
14630
- ['bold', 'italic', 'underline', 'strike'],
14631
- '|',
14632
- ['fontColor', 'backgroundColor'],
14633
- '|',
14634
- ['removeFormat'],
14635
- '|',
14636
- ['outdent', 'indent', 'align', 'list'],
14637
- '|',
14638
- ['table', 'link', 'image', 'video'],
14639
- '|',
14640
- ['fullScreen', 'codeView', 'markdownView'],
14641
- ]],
14642
- ['%768', [
14643
- ['undo', 'redo'],
14644
- '|',
14645
- [':Format-default.more_paragraph', 'blockStyle', 'font', 'fontSize', '|', 'removeFormat'],
14646
- ['bold', 'italic', 'underline', 'strike'],
14647
- '|',
14648
- ['fontColor', 'backgroundColor'],
14649
- ['outdent', 'indent', 'align', 'list'],
14650
- '|',
14651
- [':Insert-default.more_plus', 'table', 'link', 'image', 'video'],
14652
- '|',
14653
- ['fullScreen', 'codeView', 'markdownView'],
14654
- ]],
14655
- ['%576', [
14656
- ['undo', 'redo'],
14657
- '|',
14658
- [':Format-default.more_paragraph', 'blockStyle', 'font', 'fontSize'],
14659
- [':Text-default.more_text', 'bold', 'italic', 'underline', 'strike', '|', 'fontColor', 'backgroundColor', '|', 'removeFormat'],
14660
- ['outdent', 'indent', 'align', 'list'],
14661
- '|',
14662
- [':Insert-default.more_plus', 'table', 'link', 'image', 'video'],
14663
- ['-right', 'fullScreen', 'codeView', 'markdownView'],
14664
- ]],
14665
- ];
14666
14710
  }
14667
14711
 
14668
14712
  class MatchaSkeletonComponent {