@agorapulse/ui-components 20.3.31 → 20.3.33

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.
@@ -1,124 +1,92 @@
1
+ import { ActionDropdownTriggerDirective } from '@agorapulse/ui-components';
1
2
  import * as i1 from '@agorapulse/ui-components/directives';
2
3
  import { BaseButtonDirective } from '@agorapulse/ui-components/directives';
3
- import { SymbolRegistry, apChevronDown, SymbolComponent } from '@agorapulse/ui-symbol';
4
+ import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
5
+ import { SymbolRegistry, SymbolComponent, apChevronDown } from '@agorapulse/ui-symbol';
4
6
  import * as i0 from '@angular/core';
5
- import { inject, input, EventEmitter, booleanAttribute, HostListener, Output, ContentChild, ViewChild, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { inject, input, booleanAttribute, output, viewChild, contentChild, effect, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
6
8
  import * as i2 from '@angular/material/menu';
7
9
  import { MatMenuModule } from '@angular/material/menu';
8
- import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
9
10
 
10
11
  let id = 1;
11
12
  class SplitButtonComponent {
12
13
  symbolRegistry = inject(SymbolRegistry);
13
14
  baseButtonDirective = inject(BaseButtonDirective, { self: true });
14
- buttonElement;
15
- disabled = false;
16
- name = '';
17
- config;
18
- menuTrigger = null;
19
- splitDisabled = false;
20
- symbolPosition = 'right';
21
- splitButtonDataTest = undefined;
15
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
16
+ config = input({ style: 'primary', color: 'orange' }, ...(ngDevMode ? [{ debugName: "config" }] : []));
17
+ actionDropdownTrigger = input(...(ngDevMode ? [undefined, { debugName: "actionDropdownTrigger" }] : []));
18
+ /** @deprecated use actionDropdownTrigger instead */
19
+ menuTrigger = input(null, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : []));
20
+ splitDisabled = input(false, ...(ngDevMode ? [{ debugName: "splitDisabled" }] : []));
21
+ symbolPosition = input('right', ...(ngDevMode ? [{ debugName: "symbolPosition" }] : []));
22
+ splitButtonDataTest = input(undefined, ...(ngDevMode ? [{ debugName: "splitButtonDataTest" }] : []));
22
23
  symbolId = input(...(ngDevMode ? [undefined, { debugName: "symbolId" }] : []));
23
- splitButtonElement;
24
- symbolComponent;
25
- menuOpened = new EventEmitter();
26
- menuClosed = new EventEmitter();
27
- mainButtonClick = new EventEmitter();
24
+ name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
25
+ menuOpened = output();
26
+ menuClosed = output();
27
+ mainButtonClick = output();
28
28
  // eslint-disable-next-line @angular-eslint/no-output-native
29
- focus = new EventEmitter();
29
+ focus = output();
30
30
  // eslint-disable-next-line @angular-eslint/no-output-native
31
- blur = new EventEmitter();
31
+ blur = output();
32
+ buttonElement = viewChild.required('button');
33
+ splitButtonElement = viewChild.required('splitButton');
34
+ symbolComponent = contentChild(SymbolComponent, ...(ngDevMode ? [{ debugName: "symbolComponent" }] : []));
32
35
  id;
33
36
  menuOpen = false;
34
37
  constructor() {
35
38
  this.symbolRegistry.registerSymbols([apChevronDown]);
36
39
  this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
40
+ effect(() => {
41
+ const symbolComp = this.symbolComponent();
42
+ if (symbolComp) {
43
+ symbolComp.size.set('sm');
44
+ }
45
+ });
37
46
  }
38
47
  ngAfterViewInit() {
39
48
  this.id = this.baseButtonDirective.hostId ?? `ap-split-button-${id++}`;
40
49
  }
41
- ngAfterContentInit() {
42
- if (this.symbolComponent) {
43
- this.symbolComponent.size.set('sm');
44
- }
45
- }
46
50
  onSplitButtonClickHandle($event) {
47
51
  $event.stopImmediatePropagation();
48
52
  }
49
53
  handleMenuOpened() {
50
54
  this.menuOpened.emit();
51
55
  this.menuOpen = true;
52
- this.buttonElement.nativeElement.blur();
53
- this.splitButtonElement.nativeElement.blur();
56
+ this.buttonElement().nativeElement.blur();
57
+ this.splitButtonElement().nativeElement.blur();
54
58
  }
55
59
  handleMenuClosed() {
56
60
  this.menuClosed.emit();
57
61
  this.menuOpen = false;
58
- this.buttonElement.nativeElement.blur();
59
- this.splitButtonElement.nativeElement.blur();
62
+ this.buttonElement().nativeElement.blur();
63
+ this.splitButtonElement().nativeElement.blur();
60
64
  }
61
65
  focused = false;
62
66
  onClickHandle($event) {
63
- if (this.disabled) {
67
+ if (this.disabled()) {
64
68
  return;
65
69
  }
66
70
  $event.stopImmediatePropagation();
67
71
  this.mainButtonClick.emit($event);
68
- this.buttonElement.nativeElement.blur();
72
+ this.buttonElement().nativeElement.blur();
69
73
  this.blur.emit($event);
70
74
  }
71
75
  onSpaceKeyUp(event) {
72
76
  if (this.focused) {
73
77
  event.preventDefault();
74
- this.buttonElement.nativeElement.click();
78
+ this.buttonElement().nativeElement.click();
75
79
  }
76
80
  }
77
81
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: SplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
78
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: SplitButtonComponent, isStandalone: true, selector: "ap-split-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: true, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: false, isRequired: false, transformFunction: null }, splitDisabled: { classPropertyName: "splitDisabled", publicName: "splitDisabled", isSignal: false, isRequired: false, transformFunction: null }, symbolPosition: { classPropertyName: "symbolPosition", publicName: "symbolPosition", isSignal: false, isRequired: false, transformFunction: null }, splitButtonDataTest: { classPropertyName: "splitButtonDataTest", publicName: "splitButtonDataTest", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", mainButtonClick: "mainButtonClick", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "(disabled && splitDisabled) || null" } }, queries: [{ propertyName: "symbolComponent", first: true, predicate: SymbolComponent, descendants: true }], viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true }, { propertyName: "splitButtonElement", first: true, predicate: ["splitButton"], descendants: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [disabled]=\"splitDisabled\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest ?? name + '-split'\"\n [matMenuTriggerFor]=\"menuTrigger\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n", styles: ["ap-split-button{--loading-bar-width: 50px;display:inline-flex;gap:1px;position:relative}ap-split-button[disabled]{pointer-events:none}ap-split-button button{border:none;position:relative;padding:var(--comp-split-button-padding-horizontal) var(--comp-split-button-padding-vertical);max-height:var(--comp-button-height);min-height:var(--comp-button-height);overflow:hidden;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px}ap-split-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-split-button button.inverse{flex-direction:row-reverse}ap-split-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-split-button button:disabled{pointer-events:none}@media (hover: hover){ap-split-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px;z-index:10}}ap-split-button button span{font-size:var(--comp-split-button-text-size);font-family:var(--comp-split-button-text-font-family);line-height:var(--comp-split-button-text-line-height);font-weight:var(--comp-split-button-text-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ap-split-button button.loading{pointer-events:none}ap-split-button button.primary span,ap-split-button button.primary ap-symbol{color:var(--ref-color-white)}ap-split-button button.primary.orange{background:var(--ref-color-orange-100)}ap-split-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-split-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-split-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-split-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-split-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-split-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-split-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-split-button button:first-child{border-top-left-radius:var(--comp-split-button-border-radius);border-bottom-left-radius:var(--comp-split-button-border-radius)}ap-split-button button:last-child{border-top-right-radius:var(--comp-split-button-border-radius);border-bottom-right-radius:var(--comp-split-button-border-radius);padding:var(--comp-split-button-padding-horizontal) 10px var(--comp-split-button-padding-horizontal) 10px}ap-split-button button ap-symbol{will-change:transform;transition:.2s ease-in-out}ap-split-button button ap-symbol.opened{transform:rotate(180deg)}.visually-hidden{width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;position:absolute!important}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
82
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: SplitButtonComponent, isStandalone: true, selector: "ap-split-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, actionDropdownTrigger: { classPropertyName: "actionDropdownTrigger", publicName: "actionDropdownTrigger", isSignal: true, isRequired: false, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: true, isRequired: false, transformFunction: null }, splitDisabled: { classPropertyName: "splitDisabled", publicName: "splitDisabled", isSignal: true, isRequired: false, transformFunction: null }, symbolPosition: { classPropertyName: "symbolPosition", publicName: "symbolPosition", isSignal: true, isRequired: false, transformFunction: null }, splitButtonDataTest: { classPropertyName: "splitButtonDataTest", publicName: "splitButtonDataTest", isSignal: true, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", mainButtonClick: "mainButtonClick", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "(disabled() && splitDisabled()) || null" } }, queries: [{ propertyName: "symbolComponent", first: true, predicate: SymbolComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true, isSignal: true }, { propertyName: "splitButtonElement", first: true, predicate: ["splitButton"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [class.inverse]=\"symbolPosition() === 'left'\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [disabled]=\"splitDisabled()\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest() ?? name() + '-split'\"\n [apActionDropdownTrigger]=\"actionDropdownTrigger()\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n", styles: ["ap-split-button{--loading-bar-width: 50px;display:inline-flex;gap:1px;position:relative}ap-split-button[disabled]{pointer-events:none}ap-split-button button{border:none;position:relative;padding:var(--comp-split-button-padding-horizontal) var(--comp-split-button-padding-vertical);max-height:var(--comp-button-height);min-height:var(--comp-button-height);overflow:hidden;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px}ap-split-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-split-button button.inverse{flex-direction:row-reverse}ap-split-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-split-button button:disabled{pointer-events:none}@media (hover: hover){ap-split-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px;z-index:10}}ap-split-button button span{font-size:var(--comp-split-button-text-size);font-family:var(--comp-split-button-text-font-family);line-height:var(--comp-split-button-text-line-height);font-weight:var(--comp-split-button-text-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ap-split-button button.loading{pointer-events:none}ap-split-button button.primary span,ap-split-button button.primary ap-symbol{color:var(--ref-color-white)}ap-split-button button.primary.orange{background:var(--ref-color-orange-100)}ap-split-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-split-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-split-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-split-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-split-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-split-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-split-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-split-button button:first-child{border-top-left-radius:var(--comp-split-button-border-radius);border-bottom-left-radius:var(--comp-split-button-border-radius)}ap-split-button button:last-child{border-top-right-radius:var(--comp-split-button-border-radius);border-bottom-right-radius:var(--comp-split-button-border-radius);padding:var(--comp-split-button-padding-horizontal) 10px var(--comp-split-button-padding-horizontal) 10px}ap-split-button button ap-symbol{will-change:transform;transition:.2s ease-in-out}ap-split-button button ap-symbol.opened{transform:rotate(180deg)}.visually-hidden{width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;position:absolute!important}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: ActionDropdownTriggerDirective, selector: "[apActionDropdownTrigger]", inputs: ["apActionDropdownTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
79
83
  }
80
84
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: SplitButtonComponent, decorators: [{
81
85
  type: Component,
82
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-split-button', imports: [SymbolComponent, MatMenuModule], encapsulation: ViewEncapsulation.None, hostDirectives: [BaseButtonDirective], host: {
83
- '[attr.disabled]': '(disabled && splitDisabled) || null',
84
- }, template: "<button\n #button\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [disabled]=\"splitDisabled\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest ?? name + '-split'\"\n [matMenuTriggerFor]=\"menuTrigger\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n", styles: ["ap-split-button{--loading-bar-width: 50px;display:inline-flex;gap:1px;position:relative}ap-split-button[disabled]{pointer-events:none}ap-split-button button{border:none;position:relative;padding:var(--comp-split-button-padding-horizontal) var(--comp-split-button-padding-vertical);max-height:var(--comp-button-height);min-height:var(--comp-button-height);overflow:hidden;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px}ap-split-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-split-button button.inverse{flex-direction:row-reverse}ap-split-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-split-button button:disabled{pointer-events:none}@media (hover: hover){ap-split-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px;z-index:10}}ap-split-button button span{font-size:var(--comp-split-button-text-size);font-family:var(--comp-split-button-text-font-family);line-height:var(--comp-split-button-text-line-height);font-weight:var(--comp-split-button-text-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ap-split-button button.loading{pointer-events:none}ap-split-button button.primary span,ap-split-button button.primary ap-symbol{color:var(--ref-color-white)}ap-split-button button.primary.orange{background:var(--ref-color-orange-100)}ap-split-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-split-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-split-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-split-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-split-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-split-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-split-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-split-button button:first-child{border-top-left-radius:var(--comp-split-button-border-radius);border-bottom-left-radius:var(--comp-split-button-border-radius)}ap-split-button button:last-child{border-top-right-radius:var(--comp-split-button-border-radius);border-bottom-right-radius:var(--comp-split-button-border-radius);padding:var(--comp-split-button-padding-horizontal) 10px var(--comp-split-button-padding-horizontal) 10px}ap-split-button button ap-symbol{will-change:transform;transition:.2s ease-in-out}ap-split-button button ap-symbol.opened{transform:rotate(180deg)}.visually-hidden{width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;position:absolute!important}\n"] }]
85
- }], ctorParameters: () => [], propDecorators: { buttonElement: [{
86
- type: ViewChild,
87
- args: ['button']
88
- }], disabled: [{
89
- type: Input,
90
- args: [{ transform: booleanAttribute }]
91
- }], name: [{
92
- type: Input,
93
- args: [{ required: true }]
94
- }], config: [{
95
- type: Input,
96
- args: [{ required: true }]
97
- }], menuTrigger: [{
98
- type: Input
99
- }], splitDisabled: [{
100
- type: Input
101
- }], symbolPosition: [{
102
- type: Input
103
- }], splitButtonDataTest: [{
104
- type: Input
105
- }], splitButtonElement: [{
106
- type: ViewChild,
107
- args: ['splitButton']
108
- }], symbolComponent: [{
109
- type: ContentChild,
110
- args: [SymbolComponent]
111
- }], menuOpened: [{
112
- type: Output
113
- }], menuClosed: [{
114
- type: Output
115
- }], mainButtonClick: [{
116
- type: Output
117
- }], focus: [{
118
- type: Output
119
- }], blur: [{
120
- type: Output
121
- }], onSpaceKeyUp: [{
86
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-split-button', imports: [SymbolComponent, MatMenuModule, ActionDropdownTriggerDirective], encapsulation: ViewEncapsulation.None, hostDirectives: [BaseButtonDirective], host: {
87
+ '[attr.disabled]': '(disabled() && splitDisabled()) || null',
88
+ }, template: "<button\n #button\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [class.inverse]=\"symbolPosition() === 'left'\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [disabled]=\"splitDisabled()\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest() ?? name() + '-split'\"\n [apActionDropdownTrigger]=\"actionDropdownTrigger()\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n", styles: ["ap-split-button{--loading-bar-width: 50px;display:inline-flex;gap:1px;position:relative}ap-split-button[disabled]{pointer-events:none}ap-split-button button{border:none;position:relative;padding:var(--comp-split-button-padding-horizontal) var(--comp-split-button-padding-vertical);max-height:var(--comp-button-height);min-height:var(--comp-button-height);overflow:hidden;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px}ap-split-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-split-button button.inverse{flex-direction:row-reverse}ap-split-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-split-button button:disabled{pointer-events:none}@media (hover: hover){ap-split-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px;z-index:10}}ap-split-button button span{font-size:var(--comp-split-button-text-size);font-family:var(--comp-split-button-text-font-family);line-height:var(--comp-split-button-text-line-height);font-weight:var(--comp-split-button-text-weight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ap-split-button button.loading{pointer-events:none}ap-split-button button.primary span,ap-split-button button.primary ap-symbol{color:var(--ref-color-white)}ap-split-button button.primary.orange{background:var(--ref-color-orange-100)}ap-split-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-split-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-split-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-split-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-split-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-split-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-split-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-split-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-split-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-split-button button:first-child{border-top-left-radius:var(--comp-split-button-border-radius);border-bottom-left-radius:var(--comp-split-button-border-radius)}ap-split-button button:last-child{border-top-right-radius:var(--comp-split-button-border-radius);border-bottom-right-radius:var(--comp-split-button-border-radius);padding:var(--comp-split-button-padding-horizontal) 10px var(--comp-split-button-padding-horizontal) 10px}ap-split-button button ap-symbol{will-change:transform;transition:.2s ease-in-out}ap-split-button button ap-symbol.opened{transform:rotate(180deg)}.visually-hidden{width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;position:absolute!important}\n"] }]
89
+ }], ctorParameters: () => [], propDecorators: { onSpaceKeyUp: [{
122
90
  type: HostListener,
123
91
  args: ['window:keyup.space', ['$event']]
124
92
  }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-split-button.mjs","sources":["../../../libs/ui-components/split-button/src/split-button.component.ts","../../../libs/ui-components/split-button/src/split-button.component.html","../../../libs/ui-components/split-button/src/agorapulse-ui-components-split-button.ts"],"sourcesContent":["import { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { agorapulseSymbol, apChevronDown, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterContentInit,\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n input,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenu, MatMenuModule } from '@angular/material/menu';\nimport {UI_COMPONENTS_SYMBOLS} from \"@agorapulse/ui-components/providers\";\n\ntype SplitButtonConfig = { style: 'primary'; color: 'orange' | 'blue' };\n\nlet id = 1;\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-split-button',\n styleUrls: ['./split-button.component.scss'],\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './split-button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n host: {\n '[attr.disabled]': '(disabled && splitDisabled) || null',\n },\n})\nexport class SplitButtonComponent implements AfterContentInit, AfterViewInit {\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n @ViewChild('button') buttonElement!: ElementRef<HTMLButtonElement>;\n\n @Input({ transform: booleanAttribute })\n disabled: boolean = false;\n @Input({ required: true })\n name = '';\n @Input({ required: true })\n config!: SplitButtonConfig;\n @Input() menuTrigger: MatMenu | null = null;\n @Input() splitDisabled: boolean = false;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n @Input() splitButtonDataTest: string | undefined = undefined;\n symbolId = input<agorapulseSymbol>();\n\n @ViewChild('splitButton') splitButtonElement!: ElementRef<HTMLButtonElement>;\n\n @ContentChild(SymbolComponent) symbolComponent!: SymbolComponent;\n\n @Output() menuOpened: EventEmitter<void> = new EventEmitter();\n @Output() menuClosed: EventEmitter<void> = new EventEmitter();\n @Output() mainButtonClick: EventEmitter<MouseEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus: EventEmitter<FocusEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur: EventEmitter<FocusEvent> = new EventEmitter();\n\n id!: string;\n menuOpen = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apChevronDown]);\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n ngAfterViewInit() {\n this.id = this.baseButtonDirective.hostId ?? `ap-split-button-${id++}`;\n }\n\n ngAfterContentInit() {\n if (this.symbolComponent) {\n this.symbolComponent.size.set('sm');\n }\n }\n\n onSplitButtonClickHandle($event: MouseEvent): void {\n $event.stopImmediatePropagation();\n }\n\n handleMenuOpened(): void {\n this.menuOpened.emit();\n this.menuOpen = true;\n this.buttonElement.nativeElement.blur();\n this.splitButtonElement.nativeElement.blur();\n }\n\n handleMenuClosed(): void {\n this.menuClosed.emit();\n this.menuOpen = false;\n this.buttonElement.nativeElement.blur();\n this.splitButtonElement.nativeElement.blur();\n }\n\n focused: boolean = false;\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled) {\n return;\n }\n $event.stopImmediatePropagation();\n this.mainButtonClick.emit($event);\n this.buttonElement.nativeElement.blur();\n this.blur.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused) {\n event.preventDefault();\n this.buttonElement.nativeElement.click();\n }\n }\n}\n","<button\n #button\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config.style === 'primary'\"\n [class.orange]=\"config.color === 'orange'\"\n [class.blue]=\"config.color === 'blue'\"\n [disabled]=\"splitDisabled\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest ?? name + '-split'\"\n [matMenuTriggerFor]=\"menuTrigger\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAwBA,IAAI,EAAE,GAAG,CAAC;MAcG,oBAAoB,CAAA;AACrB,IAAA,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC;IACtD,mBAAmB,GAAwB,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE1E,IAAA,aAAa;IAGlC,QAAQ,GAAY,KAAK;IAEzB,IAAI,GAAG,EAAE;AAET,IAAA,MAAM;IACG,WAAW,GAAmB,IAAI;IAClC,aAAa,GAAY,KAAK;IAC9B,cAAc,GAAqB,OAAO;IAC1C,mBAAmB,GAAuB,SAAS;IAC5D,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AAEV,IAAA,kBAAkB;AAEb,IAAA,eAAe;AAEpC,IAAA,UAAU,GAAuB,IAAI,YAAY,EAAE;AACnD,IAAA,UAAU,GAAuB,IAAI,YAAY,EAAE;AACnD,IAAA,eAAe,GAA6B,IAAI,YAAY,EAAE;;AAE9D,IAAA,KAAK,GAA6B,IAAI,YAAY,EAAE;;AAEpD,I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BAAtB;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBAGyB,kBAAkB,EAAA,CAAA;sBAA3C,SAAS;uBAAC,aAAa;gBAEO,eAAe,EAAA,CAAA;sBAA7C,YAAY;uBAAC,eAAe;gBAEnB,UAAU,EAAA,CAAA;sBAAnB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBACS,eAAe,EAAA,CAAA;sBAAxB;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBAmDD,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEpHlD;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-split-button.mjs","sources":["../../../libs/ui-components/split-button/src/split-button.component.ts","../../../libs/ui-components/split-button/src/split-button.component.html","../../../libs/ui-components/split-button/src/agorapulse-ui-components-split-button.ts"],"sourcesContent":["import { ActionDropdownComponent, ActionDropdownTriggerDirective } from '@agorapulse/ui-components';\nimport { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, apChevronDown, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n effect,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenu, MatMenuModule } from '@angular/material/menu';\n\ntype SplitButtonConfig = { style: 'primary'; color: 'orange' | 'blue' };\n\nlet id = 1;\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-split-button',\n styleUrls: ['./split-button.component.scss'],\n imports: [SymbolComponent, MatMenuModule, ActionDropdownTriggerDirective],\n templateUrl: './split-button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n host: {\n '[attr.disabled]': '(disabled() && splitDisabled()) || null',\n },\n})\nexport class SplitButtonComponent implements AfterViewInit {\n private symbolRegistry = inject(SymbolRegistry);\n readonly baseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n disabled = input(false, { transform: booleanAttribute });\n config = input<SplitButtonConfig>({ style: 'primary', color: 'orange' });\n actionDropdownTrigger = input<ActionDropdownComponent>();\n /** @deprecated use actionDropdownTrigger instead */\n menuTrigger = input<MatMenu | null>(null);\n splitDisabled = input(false);\n symbolPosition = input<'left' | 'right'>('right');\n splitButtonDataTest = input<string | undefined>(undefined);\n symbolId = input<agorapulseSymbol>();\n name = input<string>();\n\n menuOpened = output<void>();\n menuClosed = output<void>();\n mainButtonClick = output<MouseEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n buttonElement = viewChild.required<ElementRef<HTMLButtonElement>>('button');\n splitButtonElement = viewChild.required<ElementRef<HTMLButtonElement>>('splitButton');\n symbolComponent = contentChild(SymbolComponent);\n\n id!: string;\n menuOpen = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apChevronDown]);\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n\n effect(() => {\n const symbolComp = this.symbolComponent();\n if (symbolComp) {\n symbolComp.size.set('sm');\n }\n });\n }\n\n ngAfterViewInit() {\n this.id = this.baseButtonDirective.hostId ?? `ap-split-button-${id++}`;\n }\n\n onSplitButtonClickHandle($event: MouseEvent): void {\n $event.stopImmediatePropagation();\n }\n\n handleMenuOpened(): void {\n this.menuOpened.emit();\n this.menuOpen = true;\n this.buttonElement().nativeElement.blur();\n this.splitButtonElement().nativeElement.blur();\n }\n\n handleMenuClosed(): void {\n this.menuClosed.emit();\n this.menuOpen = false;\n this.buttonElement().nativeElement.blur();\n this.splitButtonElement().nativeElement.blur();\n }\n\n focused: boolean = false;\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled()) {\n return;\n }\n $event.stopImmediatePropagation();\n this.mainButtonClick.emit($event);\n this.buttonElement().nativeElement.blur();\n this.blur.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused) {\n event.preventDefault();\n this.buttonElement().nativeElement.click();\n }\n }\n}\n","<button\n #button\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [class.inverse]=\"symbolPosition() === 'left'\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [id]=\"id\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"focus.emit($event)\"\n (blur)=\"blur.emit($event)\">\n <ng-content select=\"span\" />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n</button>\n<button\n #splitButton\n type=\"button\"\n [class.primary]=\"config().style === 'primary'\"\n [class.orange]=\"config().color === 'orange'\"\n [class.blue]=\"config().color === 'blue'\"\n [disabled]=\"splitDisabled()\"\n [id]=\"id + '-split'\"\n [attr.aria-labelledby]=\"id + '-split ' + id\"\n [attr.data-test]=\"splitButtonDataTest() ?? name() + '-split'\"\n [apActionDropdownTrigger]=\"actionDropdownTrigger()\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n (click)=\"onSplitButtonClickHandle($event)\"\n (menuClosed)=\"handleMenuClosed()\"\n (menuOpened)=\"handleMenuOpened()\">\n <ap-symbol\n symbolId=\"chevron-down\"\n size=\"sm\"\n [class.opened]=\"menuOpen\" />\n <span class=\"visually-hidden\">Toggle</span>\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;AAuBA,IAAI,EAAE,GAAG,CAAC;MAcG,oBAAoB,CAAA;AACrB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AAA;kBAZhC,SAAS;sCACW,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,iBAAiB,WAElB,CAAC,eAAe,EAAE,aAAa,EAAE,8BAA8B,CAAC,EAAA,aAAA,EAE1D,iBAAiB,CAAC,IAAI,kBACrB,CAAC,mBAAmB,CAAC,EAAA,IAAA,EAC/B;AACF,wBAAA,iBAAiB,EAAE,0CAA0C;AAChE,qBAAA,EAAA,QAAA,EAAA,68CAAA,EAAA,MAAA,EAAA,CAAA,mrGAAA,CAAA,EAAA;wDA+ED,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEjHlD;;AAEG;;;;"}
@@ -1,7 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, signal, ChangeDetectionStrategy, Component, contentChildren, viewChild, output, linkedSignal, effect } from '@angular/core';
2
+ import { input, signal, ChangeDetectionStrategy, Component, inject, contentChildren, viewChild, output, linkedSignal, effect } from '@angular/core';
3
3
  import { CounterComponent } from '@agorapulse/ui-components/counter';
4
- import { SymbolComponent, withSymbols } from '@agorapulse/ui-symbol';
4
+ import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
5
+ import { SymbolRegistry, SymbolComponent, withSymbols } from '@agorapulse/ui-symbol';
5
6
  import { apFeatureLock } from '@agorapulse/ui-symbol/icons';
6
7
  import { CommonModule } from '@angular/common';
7
8
 
@@ -22,6 +23,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
22
23
  }] });
23
24
 
24
25
  class TabsComponent {
26
+ symbolRegistry = inject(SymbolRegistry);
25
27
  tabs = contentChildren(TabComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
26
28
  indicator = viewChild('indicator', ...(ngDevMode ? [{ debugName: "indicator" }] : []));
27
29
  tabNav = viewChild('tabNav', ...(ngDevMode ? [{ debugName: "tabNav" }] : []));
@@ -41,6 +43,9 @@ class TabsComponent {
41
43
  });
42
44
  this.updateIndicatorPosition(activeIndex);
43
45
  }, ...(ngDevMode ? [{ debugName: "updateIndicatorPositionEffect" }] : []));
46
+ constructor() {
47
+ this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
48
+ }
44
49
  selectTab(index) {
45
50
  if (this.disabled() || index < 0 || index >= this.tabs().length) {
46
51
  return;
@@ -98,7 +103,7 @@ class TabsComponent {
98
103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: TabsComponent, decorators: [{
99
104
  type: Component,
100
105
  args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-tabs', imports: [CommonModule, CounterComponent, SymbolComponent], providers: [withSymbols(apFeatureLock)], template: "<div class=\"ap-tabs\">\n <!-- Tab Navigation -->\n <div\n #tabNav\n class=\"ap-tabs__nav\"\n role=\"tablist\">\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"ap-tabs__tab\"\n [class.ap-tabs__tab--active]=\"activeTabIndex() === $index\"\n [class.ap-tabs__tab--disabled]=\"tab.disabled()\"\n [class.ap-tabs__tab--feature-locked]=\"tab.featureLocked()\"\n [attr.aria-selected]=\"activeTabIndex() === $index\"\n [attr.aria-controls]=\"componentId() + '-panel-' + $index\"\n [attr.id]=\"componentId() + '-tab-' + $index\"\n [attr.data-tab-index]=\"$index\"\n [disabled]=\"disabled() || tab.disabled()\"\n [tabindex]=\"disabled() || tab.disabled() ? -1 : 0\"\n (click)=\"selectTab($index)\"\n (keydown)=\"onKeyDown($event, $index)\">\n <div class=\"ap-tabs__tab-content\">\n <div class=\"ap-tabs__tab-header\">\n @if (tab.symbolId()) {\n <ap-symbol\n class=\"ap-tabs__tab-icon\"\n size=\"sm\"\n [symbolId]=\"tab.symbolId()\"\n [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'purple' : 'blue') : 'basic-grey'\" />\n }\n <span class=\"ap-tabs__tab-label\">{{ tab.label() }}</span>\n @if (tab.featureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n class=\"ap-tabs__tab-feature-lock\" />\n }\n @if (tab.counter() && !tab.featureLocked()) {\n <ap-counter [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'blue' : 'blue') : 'grey'\">\n {{ tab.counter() }}\n </ap-counter>\n }\n </div>\n </div>\n </button>\n }\n <!-- Sliding indicator -->\n <div\n #indicator\n class=\"ap-tabs__indicator\"></div>\n </div>\n\n <!-- Tab Panels -->\n <div class=\"ap-tabs__content\">\n <ng-content />\n </div>\n</div>\n", styles: [":host{display:block;width:100%}.ap-tabs{display:flex;flex-direction:column;width:100%}.ap-tabs .ap-tabs__nav{display:flex;align-items:center;border-bottom:1px solid var(--comp-tabs-border-color);position:relative}.ap-tabs .ap-tabs__tab{display:flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;font-family:var(--comp-tabs-text-font-family);text-align:center;position:relative;white-space:nowrap;padding:var(--comp-tabs-tab-padding);font-size:var(--comp-tabs-tab-font-size);line-height:var(--comp-tabs-tab-line-height);min-height:var(--comp-tabs-tab-min-height);color:var(--comp-tabs-tab-text-color-default)}.ap-tabs .ap-tabs__tab .ap-tabs__tab-content{display:flex;flex-direction:column;align-items:center;gap:var(--comp-tabs-tab-content-gap)}.ap-tabs .ap-tabs__tab .ap-tabs__tab-header{display:flex;align-items:center;gap:var(--comp-tabs-tab-header-gap)}.ap-tabs .ap-tabs__tab .ap-tabs__tab-label{font-weight:inherit;font-size:inherit;line-height:inherit}.ap-tabs .ap-tabs__tab .ap-tabs__tab-feature-lock{width:16px;height:16px;color:var(--comp-tabs-tab-feature-lock-color)}.ap-tabs .ap-tabs__tab:hover:not(:disabled):not(.ap-tabs .ap-tabs__tab.ap-tabs__tab--active){background-color:var(--comp-tabs-tab-hover-background-color)}.ap-tabs .ap-tabs__tab:focus{outline:none}.ap-tabs .ap-tabs__tab:focus-visible:not(.ap-tabs .ap-tabs__tab.ap-tabs__tab--active){outline:none;box-shadow:inset 0 0 0 2px var(--comp-tabs-tab-focus-color);border-radius:var(--comp-tabs-tab-focus-border-radius);background-color:var(--comp-tabs-tab-focus-background-color)}.ap-tabs .ap-tabs__tab:active:not(:disabled):not(.ap-tabs .ap-tabs__tab.ap-tabs__tab--active){background-color:var(--comp-tabs-tab-active-background-color)}.ap-tabs .ap-tabs__tab:disabled{cursor:not-allowed;opacity:.5}.ap-tabs .ap-tabs__tab.ap-tabs__tab--active{color:var(--comp-tabs-tab-text-color-active);text-shadow:.5px 0 0 currentColor}.ap-tabs .ap-tabs__tab.ap-tabs__tab--active:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--comp-tabs-tab-focus-color);border-radius:var(--comp-tabs-tab-focus-border-radius)}.ap-tabs .ap-tabs__tab.ap-tabs__tab--disabled{color:var(--comp-tabs-tab-text-color-disabled);cursor:not-allowed}.ap-tabs .ap-tabs__tab.ap-tabs__tab--feature-locked:hover:not(:disabled):not(.ap-tabs__tab--active){background-color:var(--comp-tabs-tab-feature-locked-hover-background-color)}.ap-tabs .ap-tabs__tab.ap-tabs__tab--feature-locked:focus-visible:not(.ap-tabs__tab--active){color:var(--comp-tabs-tab-text-color-feature-locked-focus);background-color:var(--comp-tabs-tab-feature-locked-focus-background-color)}.ap-tabs .ap-tabs__tab.ap-tabs__tab--feature-locked:active:not(:disabled):not(.ap-tabs__tab--active){background-color:var(--comp-tabs-tab-feature-locked-active-background-color)}.ap-tabs .ap-tabs__tab.ap-tabs__tab--feature-locked.ap-tabs__tab--active{color:var(--comp-tabs-tab-text-color-feature-locked-active);text-shadow:.5px 0 0 currentColor}.ap-tabs .ap-tabs__tab.ap-tabs__tab--feature-locked.ap-tabs__tab--active:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--comp-tabs-tab-focus-color);border-radius:var(--comp-tabs-tab-focus-border-radius)}.ap-tabs .ap-tabs__indicator{position:absolute;bottom:-1px;height:4px;background-color:var(--comp-tabs-tab-active-indicator-color);transition:transform .3s cubic-bezier(.4,0,.2,1),width .3s cubic-bezier(.4,0,.2,1),background-color .3s cubic-bezier(.4,0,.2,1);transform-origin:left}.ap-tabs .ap-tabs__content{flex:1;width:100%}\n"] }]
101
- }] });
106
+ }], ctorParameters: () => [] });
102
107
 
103
108
  /**
104
109
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-tabs.mjs","sources":["../../../libs/ui-components/tabs/src/tab/tab.component.ts","../../../libs/ui-components/tabs/src/tab/tab.component.html","../../../libs/ui-components/tabs/src/tabs.component.ts","../../../libs/ui-components/tabs/src/tabs.component.html","../../../libs/ui-components/tabs/src/agorapulse-ui-components-tabs.ts"],"sourcesContent":["import { agorapulseSymbol } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, input, signal } from '@angular/core';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tab',\n templateUrl: './tab.component.html',\n})\nexport class TabComponent {\n label = input.required<string>();\n counter = input<number>();\n disabled = input(false);\n featureLocked = input(false);\n symbolId = input<agorapulseSymbol>();\n\n isActive = signal(false);\n tabIndex = signal(0);\n}\n","@if (isActive()) {\n <div\n role=\"tabpanel\"\n class=\"ap-tab__panel\"\n [attr.id]=\"'ap-tab-panel-' + tabIndex()\"\n [attr.aria-labelledby]=\"'ap-tab-' + tabIndex()\">\n <ng-content />\n </div>\n}\n","import { CounterComponent } from '@agorapulse/ui-components/counter';\nimport { SymbolComponent, withSymbols } from '@agorapulse/ui-symbol';\nimport { apFeatureLock } from '@agorapulse/ui-symbol/icons';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n ElementRef,\n input,\n linkedSignal,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { TabComponent } from './tab/tab.component';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tabs',\n templateUrl: './tabs.component.html',\n styleUrls: ['./tabs.component.scss'],\n imports: [CommonModule, CounterComponent, SymbolComponent],\n providers: [withSymbols(apFeatureLock)],\n})\nexport class TabsComponent {\n tabs = contentChildren(TabComponent);\n indicator = viewChild<ElementRef<HTMLElement>>('indicator');\n tabNav = viewChild<ElementRef<HTMLElement>>('tabNav');\n\n selectedIndex = input(0);\n disabled = input(false);\n\n tabChange = output<{ index: number; tab: TabComponent }>();\n\n // Unique ID per component instance to prevent DOM ID conflicts\n private static nextId = 0;\n readonly componentId = signal(`ap-tabs-${TabsComponent.nextId++}`);\n\n readonly activeTabIndex = linkedSignal(() => this.selectedIndex());\n\n private readonly updateIndicatorPositionEffect = effect(() => {\n const activeIndex = this.activeTabIndex();\n const tabs = this.tabs();\n tabs.forEach((tab, index) => {\n tab.isActive.set(index === activeIndex);\n tab.tabIndex.set(index);\n });\n this.updateIndicatorPosition(activeIndex);\n });\n\n selectTab(index: number): void {\n if (this.disabled() || index < 0 || index >= this.tabs().length) {\n return;\n }\n\n const tab = this.tabs()[index];\n if (tab?.disabled()) {\n return;\n }\n\n this.activeTabIndex.set(index);\n this.tabChange.emit({ index, tab });\n }\n\n onKeyDown(event: KeyboardEvent, index: number): void {\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.selectTab(index);\n break;\n }\n }\n\n private focusTab(index: number): void {\n const tabButton = document.querySelector(`[data-tab-index=\"${index}\"]`) as HTMLElement;\n tabButton?.focus();\n }\n\n private updateIndicatorPosition(activeIndex: number): void {\n const indicatorEl = this.indicator()?.nativeElement;\n const tabNavEl = this.tabNav()?.nativeElement;\n\n if (!indicatorEl || !tabNavEl) {\n // If elements aren't ready, try again in the next tick\n setTimeout(() => this.updateIndicatorPosition(activeIndex), 0);\n return;\n }\n\n const activeTab = tabNavEl.querySelector(`[data-tab-index=\"${activeIndex}\"]`) as HTMLElement;\n if (!activeTab) {\n // If tab button isn't ready, try again in the next tick\n setTimeout(() => this.updateIndicatorPosition(activeIndex), 0);\n return;\n }\n\n const tabRect = activeTab.getBoundingClientRect();\n const navRect = tabNavEl.getBoundingClientRect();\n\n const left = tabRect.left - navRect.left;\n const width = tabRect.width;\n\n // Check if active tab is feature locked to change indicator color\n const isFeatureLocked = this.tabs()[activeIndex]?.featureLocked();\n const color = isFeatureLocked\n ? 'var(--comp-tabs-tab-feature-locked-indicator-color)'\n : 'var(--comp-tabs-tab-active-indicator-color)';\n\n indicatorEl.style.transform = `translateX(${left}px)`;\n indicatorEl.style.width = `${width}px`;\n indicatorEl.style.backgroundColor = color;\n }\n}\n","<div class=\"ap-tabs\">\n <!-- Tab Navigation -->\n <div\n #tabNav\n class=\"ap-tabs__nav\"\n role=\"tablist\">\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"ap-tabs__tab\"\n [class.ap-tabs__tab--active]=\"activeTabIndex() === $index\"\n [class.ap-tabs__tab--disabled]=\"tab.disabled()\"\n [class.ap-tabs__tab--feature-locked]=\"tab.featureLocked()\"\n [attr.aria-selected]=\"activeTabIndex() === $index\"\n [attr.aria-controls]=\"componentId() + '-panel-' + $index\"\n [attr.id]=\"componentId() + '-tab-' + $index\"\n [attr.data-tab-index]=\"$index\"\n [disabled]=\"disabled() || tab.disabled()\"\n [tabindex]=\"disabled() || tab.disabled() ? -1 : 0\"\n (click)=\"selectTab($index)\"\n (keydown)=\"onKeyDown($event, $index)\">\n <div class=\"ap-tabs__tab-content\">\n <div class=\"ap-tabs__tab-header\">\n @if (tab.symbolId()) {\n <ap-symbol\n class=\"ap-tabs__tab-icon\"\n size=\"sm\"\n [symbolId]=\"tab.symbolId()\"\n [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'purple' : 'blue') : 'basic-grey'\" />\n }\n <span class=\"ap-tabs__tab-label\">{{ tab.label() }}</span>\n @if (tab.featureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n class=\"ap-tabs__tab-feature-lock\" />\n }\n @if (tab.counter() && !tab.featureLocked()) {\n <ap-counter [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'blue' : 'blue') : 'grey'\">\n {{ tab.counter() }}\n </ap-counter>\n }\n </div>\n </div>\n </button>\n }\n <!-- Sliding indicator -->\n <div\n #indicator\n class=\"ap-tabs__indicator\"></div>\n </div>\n\n <!-- Tab Panels -->\n <div class=\"ap-tabs__content\">\n <ng-content />\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAQa,YAAY,CAAA;AACrB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AACvB,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,yDAAC;IAC5B,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAoB;AAEpC,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AACxB,IAAA,QAAQ,GAAG,MAAM,CAAC,CAAC,oDAAC;uGARX,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAY,qtBCRzB,mPASA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDDa,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,SAAS;sCACW,uBAAuB,CAAC,MAAM,EAAA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AAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC3BvC,2/EAyDA,EAAA,MAAA,EAAA,CAAA,s8GAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDlCc,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,iHAAE,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGhD,aAAa,EAAA,UAAA,EAAA,CAAA;kBARzB,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,SAAS,EAAA,OAAA,EAGV,CAAC,YAAY,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAAA,SAAA,EAC/C,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAAA,QAAA,EAAA,2/EAAA,EAAA,MAAA,EAAA,CAAA,s8GAAA,CAAA,EAAA;;;AExB3C;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-tabs.mjs","sources":["../../../libs/ui-components/tabs/src/tab/tab.component.ts","../../../libs/ui-components/tabs/src/tab/tab.component.html","../../../libs/ui-components/tabs/src/tabs.component.ts","../../../libs/ui-components/tabs/src/tabs.component.html","../../../libs/ui-components/tabs/src/agorapulse-ui-components-tabs.ts"],"sourcesContent":["import { agorapulseSymbol } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, input, signal } from '@angular/core';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tab',\n templateUrl: './tab.component.html',\n})\nexport class TabComponent {\n label = input.required<string>();\n counter = input<number>();\n disabled = input(false);\n featureLocked = input(false);\n symbolId = input<agorapulseSymbol>();\n\n isActive = signal(false);\n tabIndex = signal(0);\n}\n","@if (isActive()) {\n <div\n role=\"tabpanel\"\n class=\"ap-tab__panel\"\n [attr.id]=\"'ap-tab-panel-' + tabIndex()\"\n [attr.aria-labelledby]=\"'ap-tab-' + tabIndex()\">\n <ng-content />\n </div>\n}\n","import { CounterComponent } from '@agorapulse/ui-components/counter';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { SymbolComponent, SymbolRegistry, withSymbols } from '@agorapulse/ui-symbol';\nimport { apFeatureLock } from '@agorapulse/ui-symbol/icons';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { TabComponent } from './tab/tab.component';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tabs',\n templateUrl: './tabs.component.html',\n styleUrls: ['./tabs.component.scss'],\n imports: [CommonModule, CounterComponent, SymbolComponent],\n providers: [withSymbols(apFeatureLock)],\n})\nexport class TabsComponent {\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n tabs = contentChildren(TabComponent);\n indicator = viewChild<ElementRef<HTMLElement>>('indicator');\n tabNav = viewChild<ElementRef<HTMLElement>>('tabNav');\n\n selectedIndex = input(0);\n disabled = input(false);\n\n tabChange = output<{ index: number; tab: TabComponent }>();\n\n // Unique ID per component instance to prevent DOM ID conflicts\n private static nextId = 0;\n readonly componentId = signal(`ap-tabs-${TabsComponent.nextId++}`);\n\n readonly activeTabIndex = linkedSignal(() => this.selectedIndex());\n\n private readonly updateIndicatorPositionEffect = effect(() => {\n const activeIndex = this.activeTabIndex();\n const tabs = this.tabs();\n tabs.forEach((tab, index) => {\n tab.isActive.set(index === activeIndex);\n tab.tabIndex.set(index);\n });\n this.updateIndicatorPosition(activeIndex);\n });\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n selectTab(index: number): void {\n if (this.disabled() || index < 0 || index >= this.tabs().length) {\n return;\n }\n\n const tab = this.tabs()[index];\n if (tab?.disabled()) {\n return;\n }\n\n this.activeTabIndex.set(index);\n this.tabChange.emit({ index, tab });\n }\n\n onKeyDown(event: KeyboardEvent, index: number): void {\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.selectTab(index);\n break;\n }\n }\n\n private focusTab(index: number): void {\n const tabButton = document.querySelector(`[data-tab-index=\"${index}\"]`) as HTMLElement;\n tabButton?.focus();\n }\n\n private updateIndicatorPosition(activeIndex: number): void {\n const indicatorEl = this.indicator()?.nativeElement;\n const tabNavEl = this.tabNav()?.nativeElement;\n\n if (!indicatorEl || !tabNavEl) {\n // If elements aren't ready, try again in the next tick\n setTimeout(() => this.updateIndicatorPosition(activeIndex), 0);\n return;\n }\n\n const activeTab = tabNavEl.querySelector(`[data-tab-index=\"${activeIndex}\"]`) as HTMLElement;\n if (!activeTab) {\n // If tab button isn't ready, try again in the next tick\n setTimeout(() => this.updateIndicatorPosition(activeIndex), 0);\n return;\n }\n\n const tabRect = activeTab.getBoundingClientRect();\n const navRect = tabNavEl.getBoundingClientRect();\n\n const left = tabRect.left - navRect.left;\n const width = tabRect.width;\n\n // Check if active tab is feature locked to change indicator color\n const isFeatureLocked = this.tabs()[activeIndex]?.featureLocked();\n const color = isFeatureLocked\n ? 'var(--comp-tabs-tab-feature-locked-indicator-color)'\n : 'var(--comp-tabs-tab-active-indicator-color)';\n\n indicatorEl.style.transform = `translateX(${left}px)`;\n indicatorEl.style.width = `${width}px`;\n indicatorEl.style.backgroundColor = color;\n }\n}\n","<div class=\"ap-tabs\">\n <!-- Tab Navigation -->\n <div\n #tabNav\n class=\"ap-tabs__nav\"\n role=\"tablist\">\n @for (tab of tabs(); track $index) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"ap-tabs__tab\"\n [class.ap-tabs__tab--active]=\"activeTabIndex() === $index\"\n [class.ap-tabs__tab--disabled]=\"tab.disabled()\"\n [class.ap-tabs__tab--feature-locked]=\"tab.featureLocked()\"\n [attr.aria-selected]=\"activeTabIndex() === $index\"\n [attr.aria-controls]=\"componentId() + '-panel-' + $index\"\n [attr.id]=\"componentId() + '-tab-' + $index\"\n [attr.data-tab-index]=\"$index\"\n [disabled]=\"disabled() || tab.disabled()\"\n [tabindex]=\"disabled() || tab.disabled() ? -1 : 0\"\n (click)=\"selectTab($index)\"\n (keydown)=\"onKeyDown($event, $index)\">\n <div class=\"ap-tabs__tab-content\">\n <div class=\"ap-tabs__tab-header\">\n @if (tab.symbolId()) {\n <ap-symbol\n class=\"ap-tabs__tab-icon\"\n size=\"sm\"\n [symbolId]=\"tab.symbolId()\"\n [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'purple' : 'blue') : 'basic-grey'\" />\n }\n <span class=\"ap-tabs__tab-label\">{{ tab.label() }}</span>\n @if (tab.featureLocked()) {\n <ap-symbol\n symbolId=\"feature-lock\"\n class=\"ap-tabs__tab-feature-lock\" />\n }\n @if (tab.counter() && !tab.featureLocked()) {\n <ap-counter [color]=\"activeTabIndex() === $index ? (tab.featureLocked() ? 'blue' : 'blue') : 'grey'\">\n {{ tab.counter() }}\n </ap-counter>\n }\n </div>\n </div>\n </button>\n }\n <!-- Sliding indicator -->\n <div\n #indicator\n class=\"ap-tabs__indicator\"></div>\n </div>\n\n <!-- Tab Panels -->\n <div class=\"ap-tabs__content\">\n <ng-content />\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAQa,YAAY,CAAA;AACrB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,C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AA,EDhCc,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,iHAAE,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGhD,aAAa,EAAA,UAAA,EAAA,CAAA;kBARzB,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,SAAS,EAAA,OAAA,EAGV,CAAC,YAAY,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAAA,SAAA,EAC/C,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAAA,QAAA,EAAA,2/EAAA,EAAA,MAAA,EAAA,CAAA,s8GAAA,CAAA,EAAA;;;AE1B3C;;AAEG;;;;"}
@@ -57,11 +57,9 @@ type NavSelectorBaseNode = {
57
57
  */
58
58
  type NavSelectorLeafAction = {
59
59
  /** Unique identifier of the action, used for click tracking */
60
- id: string | null;
60
+ id: string;
61
61
  /** Action label to display */
62
62
  label: string;
63
- /** Technical name of the action, used to identify the action */
64
- name: string;
65
63
  /** Optional icon to display on the action */
66
64
  icon: string | null;
67
65
  /** Optional Status */
@@ -169,11 +167,9 @@ type NodeAccessibility = {
169
167
  };
170
168
  type InternalNavSelectorLeafAction = {
171
169
  /** Unique identifier of the action, used for click tracking */
172
- id: string | null;
170
+ id: string;
173
171
  /** Action label to display */
174
172
  label: string;
175
- /** Technical name of the action, used to identify the action */
176
- name: string;
177
173
  /** Optional icon to display on the action */
178
174
  icon: string | null;
179
175
  /** Optional Status */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-components",
3
3
  "description": "Agorapulse UI Components Library",
4
- "version": "20.3.31",
4
+ "version": "20.3.33",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,5 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { AfterContentInit, AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
+ import { AfterViewInit, ElementRef } from '@angular/core';
3
+ import { ActionDropdownComponent } from '@agorapulse/ui-components';
3
4
  import * as i1 from '@agorapulse/ui-components/directives';
4
5
  import { BaseButtonDirective } from '@agorapulse/ui-components/directives';
5
6
  import { SymbolComponent } from '@agorapulse/ui-symbol';
@@ -9,39 +10,39 @@ type SplitButtonConfig = {
9
10
  style: 'primary';
10
11
  color: 'orange' | 'blue';
11
12
  };
12
- declare class SplitButtonComponent implements AfterContentInit, AfterViewInit {
13
+ declare class SplitButtonComponent implements AfterViewInit {
13
14
  private symbolRegistry;
14
15
  readonly baseButtonDirective: BaseButtonDirective;
15
- buttonElement: ElementRef<HTMLButtonElement>;
16
- disabled: boolean;
17
- name: string;
18
- config: SplitButtonConfig;
19
- menuTrigger: MatMenu | null;
20
- splitDisabled: boolean;
21
- symbolPosition: 'left' | 'right';
22
- splitButtonDataTest: string | undefined;
23
- symbolId: i0.InputSignal<string | undefined>;
24
- splitButtonElement: ElementRef<HTMLButtonElement>;
25
- symbolComponent: SymbolComponent;
26
- menuOpened: EventEmitter<void>;
27
- menuClosed: EventEmitter<void>;
28
- mainButtonClick: EventEmitter<MouseEvent>;
29
- focus: EventEmitter<FocusEvent>;
30
- blur: EventEmitter<FocusEvent>;
16
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
17
+ config: _angular_core.InputSignal<SplitButtonConfig>;
18
+ actionDropdownTrigger: _angular_core.InputSignal<ActionDropdownComponent | undefined>;
19
+ /** @deprecated use actionDropdownTrigger instead */
20
+ menuTrigger: _angular_core.InputSignal<MatMenu | null>;
21
+ splitDisabled: _angular_core.InputSignal<boolean>;
22
+ symbolPosition: _angular_core.InputSignal<"left" | "right">;
23
+ splitButtonDataTest: _angular_core.InputSignal<string | undefined>;
24
+ symbolId: _angular_core.InputSignal<string | undefined>;
25
+ name: _angular_core.InputSignal<string | undefined>;
26
+ menuOpened: _angular_core.OutputEmitterRef<void>;
27
+ menuClosed: _angular_core.OutputEmitterRef<void>;
28
+ mainButtonClick: _angular_core.OutputEmitterRef<MouseEvent>;
29
+ focus: _angular_core.OutputEmitterRef<FocusEvent>;
30
+ blur: _angular_core.OutputEmitterRef<FocusEvent>;
31
+ buttonElement: _angular_core.Signal<ElementRef<HTMLButtonElement>>;
32
+ splitButtonElement: _angular_core.Signal<ElementRef<HTMLButtonElement>>;
33
+ symbolComponent: _angular_core.Signal<SymbolComponent | undefined>;
31
34
  id: string;
32
35
  menuOpen: boolean;
33
36
  constructor();
34
37
  ngAfterViewInit(): void;
35
- ngAfterContentInit(): void;
36
38
  onSplitButtonClickHandle($event: MouseEvent): void;
37
39
  handleMenuOpened(): void;
38
40
  handleMenuClosed(): void;
39
41
  focused: boolean;
40
42
  onClickHandle($event: MouseEvent): void;
41
43
  onSpaceKeyUp(event: KeyboardEvent): void;
42
- static ɵfac: i0.ɵɵFactoryDeclaration<SplitButtonComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<SplitButtonComponent, "ap-split-button", never, { "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": true; }; "config": { "alias": "config"; "required": true; }; "menuTrigger": { "alias": "menuTrigger"; "required": false; }; "splitDisabled": { "alias": "splitDisabled"; "required": false; }; "symbolPosition": { "alias": "symbolPosition"; "required": false; }; "splitButtonDataTest": { "alias": "splitButtonDataTest"; "required": false; }; "symbolId": { "alias": "symbolId"; "required": false; "isSignal": true; }; }, { "menuOpened": "menuOpened"; "menuClosed": "menuClosed"; "mainButtonClick": "mainButtonClick"; "focus": "focus"; "blur": "blur"; }, ["symbolComponent"], ["span", "ap-symbol"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
44
- static ngAcceptInputType_disabled: unknown;
44
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SplitButtonComponent, never>;
45
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SplitButtonComponent, "ap-split-button", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "actionDropdownTrigger": { "alias": "actionDropdownTrigger"; "required": false; "isSignal": true; }; "menuTrigger": { "alias": "menuTrigger"; "required": false; "isSignal": true; }; "splitDisabled": { "alias": "splitDisabled"; "required": false; "isSignal": true; }; "symbolPosition": { "alias": "symbolPosition"; "required": false; "isSignal": true; }; "splitButtonDataTest": { "alias": "splitButtonDataTest"; "required": false; "isSignal": true; }; "symbolId": { "alias": "symbolId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; }, { "menuOpened": "menuOpened"; "menuClosed": "menuClosed"; "mainButtonClick": "mainButtonClick"; "focus": "focus"; "blur": "blur"; }, ["symbolComponent"], ["span", "ap-symbol"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
45
46
  }
46
47
 
47
48
  export { SplitButtonComponent };
package/tabs/index.d.ts CHANGED
@@ -14,6 +14,7 @@ declare class TabComponent {
14
14
  }
15
15
 
16
16
  declare class TabsComponent {
17
+ private readonly symbolRegistry;
17
18
  tabs: _angular_core.Signal<readonly TabComponent[]>;
18
19
  indicator: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
19
20
  tabNav: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
@@ -27,6 +28,7 @@ declare class TabsComponent {
27
28
  readonly componentId: _angular_core.WritableSignal<string>;
28
29
  readonly activeTabIndex: _angular_core.WritableSignal<number>;
29
30
  private readonly updateIndicatorPositionEffect;
31
+ constructor();
30
32
  selectTab(index: number): void;
31
33
  onKeyDown(event: KeyboardEvent, index: number): void;
32
34
  private focusTab;