@acorex/components 21.0.3-next.39 → 21.0.3-next.41
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.
- package/{conversation2 → conversation}/README.md +23 -23
- package/fesm2022/acorex-components-button.mjs +4 -4
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs +101 -0
- package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs.map +1 -0
- package/fesm2022/acorex-components-conversation-emoji-categories-C7Gm95V0.mjs +1840 -0
- package/fesm2022/acorex-components-conversation-emoji-categories-C7Gm95V0.mjs.map +1 -0
- package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs +223 -0
- package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs.map +1 -0
- package/fesm2022/{acorex-components-conversation2.mjs → acorex-components-conversation.mjs} +20368 -20258
- package/fesm2022/acorex-components-conversation.mjs.map +1 -0
- package/fesm2022/acorex-components-kbd.mjs +2 -2
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +22 -14
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +4 -13
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +2 -2
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/package.json +6 -10
- package/types/{acorex-components-conversation2.d.ts → acorex-components-conversation.d.ts} +2008 -1629
- package/types/acorex-components-scheduler-picker.d.ts +2 -0
- package/types/acorex-components-side-menu.d.ts +1 -3
- package/fesm2022/acorex-components-conversation2.mjs.map +0 -1
- package/fesm2022/acorex-components-sidebar.mjs +0 -275
- package/fesm2022/acorex-components-sidebar.mjs.map +0 -1
- package/sidebar/README.md +0 -5
- package/types/acorex-components-sidebar.d.ts +0 -132
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @acorex/components/
|
|
1
|
+
# @acorex/components/conversation
|
|
2
2
|
|
|
3
3
|
A modern, fully-featured conversation/chat component for Angular 18+. Built with signals, standalone components, and extensibility in mind.
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ A modern, fully-featured conversation/chat component for Angular 18+. Built with
|
|
|
19
19
|
## 📦 Installation
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npm install @acorex/components/
|
|
22
|
+
npm install @acorex/components/conversation
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## 🔧 Peer Dependencies
|
|
@@ -70,7 +70,7 @@ This package requires the following peer dependencies:
|
|
|
70
70
|
|
|
71
71
|
## 🎯 Quick Start
|
|
72
72
|
|
|
73
|
-
> **New to
|
|
73
|
+
> **New to conversation?** Check out our [5-Minute Quick Start Guide](./docs/QUICK-START.md) for the fastest way to get started!
|
|
74
74
|
|
|
75
75
|
### Detailed Setup
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
AXIndexedDBConversationApi,
|
|
85
85
|
AXIndexedDBMessageApi,
|
|
86
86
|
AXIndexedDBRealtimeApi,
|
|
87
|
-
} from '@acorex/components/
|
|
87
|
+
} from '@acorex/components/conversation';
|
|
88
88
|
|
|
89
89
|
export const appConfig: ApplicationConfig = {
|
|
90
90
|
providers: [
|
|
@@ -111,16 +111,16 @@ export const appConfig: ApplicationConfig = {
|
|
|
111
111
|
```typescript
|
|
112
112
|
import { NgModule } from '@angular/core';
|
|
113
113
|
import {
|
|
114
|
-
|
|
114
|
+
AXConversationModule,
|
|
115
115
|
AXIndexedDBUserApi,
|
|
116
116
|
AXIndexedDBConversationApi,
|
|
117
117
|
AXIndexedDBMessageApi,
|
|
118
118
|
AXIndexedDBRealtimeApi,
|
|
119
|
-
} from '@acorex/components/
|
|
119
|
+
} from '@acorex/components/conversation';
|
|
120
120
|
|
|
121
121
|
@NgModule({
|
|
122
122
|
imports: [
|
|
123
|
-
|
|
123
|
+
AXConversationModule.forRoot({
|
|
124
124
|
userApi: AXIndexedDBUserApi,
|
|
125
125
|
conversationApi: AXIndexedDBConversationApi,
|
|
126
126
|
messageApi: AXIndexedDBMessageApi,
|
|
@@ -145,7 +145,7 @@ You must provide an API implementation that extends `AXConversationApi`:
|
|
|
145
145
|
```typescript
|
|
146
146
|
import { Injectable } from '@angular/core';
|
|
147
147
|
import { HttpClient } from '@angular/common/http';
|
|
148
|
-
import { AXConversationApi,
|
|
148
|
+
import { AXConversationApi, AXConversationPagination, AXConversationPaginatedResult } from '@acorex/components/conversation';
|
|
149
149
|
|
|
150
150
|
@Injectable()
|
|
151
151
|
export class MyConversationApi extends AXConversationApi {
|
|
@@ -157,7 +157,7 @@ export class MyConversationApi extends AXConversationApi {
|
|
|
157
157
|
// Initialize WebSocket connection
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
async fetchConversations(pagination:
|
|
160
|
+
async fetchConversations(pagination: AXConversationPagination): Promise<AXConversationPaginatedResult<AXConversation>> {
|
|
161
161
|
const response = await this.http.get('/api/conversations', {
|
|
162
162
|
params: { page: pagination.page, pageSize: pagination.pageSize }
|
|
163
163
|
}).toPromise();
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
AXIndexedDBConversationApi,
|
|
180
180
|
AXIndexedDBMessageApi,
|
|
181
181
|
AXIndexedDBRealtimeApi,
|
|
182
|
-
} from '@acorex/components/
|
|
182
|
+
} from '@acorex/components/conversation';
|
|
183
183
|
|
|
184
184
|
// Provides in-memory storage with sample data
|
|
185
185
|
// Perfect for development and demos
|
|
@@ -202,7 +202,7 @@ import {
|
|
|
202
202
|
AXIndexedDBConversationApi,
|
|
203
203
|
AXIndexedDBMessageAIApi,
|
|
204
204
|
AXIndexedDBRealtimeApi,
|
|
205
|
-
} from '@acorex/components/
|
|
205
|
+
} from '@acorex/components/conversation';
|
|
206
206
|
|
|
207
207
|
// Includes AI-powered auto-responses via message API
|
|
208
208
|
provideConversation({
|
|
@@ -234,13 +234,13 @@ interface AXConversationConfig {
|
|
|
234
234
|
### Registry Configuration
|
|
235
235
|
|
|
236
236
|
```typescript
|
|
237
|
-
interface
|
|
238
|
-
messageRenderers?:
|
|
239
|
-
messageActions?:
|
|
240
|
-
composerActions?:
|
|
241
|
-
composerTabs?:
|
|
237
|
+
interface AXConversationRegistryConfiguration {
|
|
238
|
+
messageRenderers?: AXConversationMessageRenderer[];
|
|
239
|
+
messageActions?: AXConversationMessageAction[];
|
|
240
|
+
composerActions?: AXConversationComposerAction[];
|
|
241
|
+
composerTabs?: AXConversationComposerTab[];
|
|
242
242
|
conversationTabs?: AXConversationTab[];
|
|
243
|
-
infoBarActions?:
|
|
243
|
+
infoBarActions?: AXConversationInfoBarAction[];
|
|
244
244
|
conversationItemActions?: AXConversationItemAction[];
|
|
245
245
|
}
|
|
246
246
|
```
|
|
@@ -251,17 +251,17 @@ interface AXRegistryConfiguration {
|
|
|
251
251
|
|
|
252
252
|
```typescript
|
|
253
253
|
import { Component, input } from '@angular/core';
|
|
254
|
-
import {
|
|
254
|
+
import { AXConversationMessageRenderer } from '@acorex/components/conversation';
|
|
255
255
|
|
|
256
256
|
@Component({
|
|
257
257
|
selector: 'my-custom-renderer',
|
|
258
258
|
template: `<div>{{ message().payload.customData }}</div>`
|
|
259
259
|
})
|
|
260
260
|
export class MyCustomRendererComponent {
|
|
261
|
-
message = input.required<
|
|
261
|
+
message = input.required<AXConversationMessage>();
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
const myRenderer:
|
|
264
|
+
const myRenderer: AXConversationMessageRenderer = {
|
|
265
265
|
type: 'custom',
|
|
266
266
|
component: MyCustomRendererComponent,
|
|
267
267
|
priority: 100
|
|
@@ -279,7 +279,7 @@ provideConversation({
|
|
|
279
279
|
### Custom Message Action
|
|
280
280
|
|
|
281
281
|
```typescript
|
|
282
|
-
const forwardAction:
|
|
282
|
+
const forwardAction: AXConversationMessageAction = {
|
|
283
283
|
id: 'forward',
|
|
284
284
|
label: 'Forward',
|
|
285
285
|
icon: 'forward',
|
|
@@ -333,7 +333,7 @@ Main service for conversation operations:
|
|
|
333
333
|
|
|
334
334
|
```typescript
|
|
335
335
|
import { inject } from '@angular/core';
|
|
336
|
-
import { AXConversationService } from '@acorex/components/
|
|
336
|
+
import { AXConversationService } from '@acorex/components/conversation';
|
|
337
337
|
|
|
338
338
|
export class MyComponent {
|
|
339
339
|
private conversationService = inject(AXConversationService);
|
|
@@ -359,7 +359,7 @@ export class MyComponent {
|
|
|
359
359
|
|
|
360
360
|
```typescript
|
|
361
361
|
import { TestBed } from '@angular/core/testing';
|
|
362
|
-
import { provideConversation, AXConversationService } from '@acorex/components/
|
|
362
|
+
import { provideConversation, AXConversationService } from '@acorex/components/conversation';
|
|
363
363
|
import { MockUserApi, MockConversationApi, MockMessageApi } from './mocks/mock-apis';
|
|
364
364
|
|
|
365
365
|
describe('MyComponent', () => {
|
|
@@ -119,7 +119,7 @@ class AXButtonItemComponent extends classes(MXInteractiveComponent, MXColorCompo
|
|
|
119
119
|
<ng-content select="ax-suffix"> </ng-content>
|
|
120
120
|
</div>
|
|
121
121
|
<ng-content select="ax-dropdown-panel"> </ng-content>
|
|
122
|
-
`, isInline: true, styles: ["@layer components{ax-button-item{color:var(--ax-comp-bg
|
|
122
|
+
`, isInline: true, styles: ["@layer components{ax-button-item{color:var(--ax-comp-bg, var(--color-on-surface))}ax-button-item.ax-state-selected{background-color:rgba(var(--ax-sys-color-surface))}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
123
123
|
}
|
|
124
124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXButtonItemComponent, decorators: [{
|
|
125
125
|
type: Component,
|
|
@@ -136,7 +136,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
136
136
|
<ng-content select="ax-suffix"> </ng-content>
|
|
137
137
|
</div>
|
|
138
138
|
<ng-content select="ax-dropdown-panel"> </ng-content>
|
|
139
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color', 'disabled'], outputs: ['onClick', 'onFocus', 'onBlur', 'disabledChange'], imports: [CommonModule, AXDecoratorGenericComponent, AXTranslationModule], providers: [{ provide: AXComponent, useExisting: AXButtonItemComponent }], styles: ["@layer components{ax-button-item{color:var(--ax-comp-bg
|
|
139
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color', 'disabled'], outputs: ['onClick', 'onFocus', 'onBlur', 'disabledChange'], imports: [CommonModule, AXDecoratorGenericComponent, AXTranslationModule], providers: [{ provide: AXComponent, useExisting: AXButtonItemComponent }], styles: ["@layer components{ax-button-item{color:var(--ax-comp-bg, var(--color-on-surface))}ax-button-item.ax-state-selected{background-color:rgba(var(--ax-sys-color-surface))}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
140
140
|
}], propDecorators: { text: [{
|
|
141
141
|
type: Input
|
|
142
142
|
}], selected: [{
|
|
@@ -475,7 +475,7 @@ class AXButtonComponent extends MXButtonBaseComponent {
|
|
|
475
475
|
{ provide: AXComponent, useExisting: AXButtonComponent },
|
|
476
476
|
{ provide: AXButtonItemComponent, useExisting: AXButtonComponent },
|
|
477
477
|
{ provide: AXFocusableComponent, useExisting: AXButtonComponent },
|
|
478
|
-
], queries: [{ propertyName: "loadingIcon", first: true, predicate: AXLoadingComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n", styles: ["@layer properties;@layer components{ax-button{display:inline-flex;border-radius:var(--ax-sys-border-radius)}ax-button button{position:relative;display:flex;height:var(--ax-sys-size-base);width:100%;cursor:pointer;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:inherit;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);-webkit-user-select:none;user-select:none}ax-button button.ax-state-disabled,ax-button button.ax-state-loading{cursor:not-allowed;opacity:50%}ax-button.ax-xs button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 4);line-height:calc(var(--spacing, .25rem) * 4)}ax-button.ax-sm button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button button,ax-button.ax-md button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-lg button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-xl button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6)}ax-button .ax-button-text{text-wrap:nowrap}ax-button.ax-button-icon.ax-xs button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-sm button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button,ax-button.ax-button-icon.ax-md button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-lg button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-xl button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button ax-dropdown-panel{position:absolute}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: AXRippleDirective, selector: "[axRipple]", inputs: ["axRipple", "axRippleColor"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
478
|
+
], queries: [{ propertyName: "loadingIcon", first: true, predicate: AXLoadingComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n", styles: ["@layer properties;@layer components{ax-button{display:inline-flex;border-radius:var(--ax-sys-border-radius)}ax-button button{position:relative;display:flex;height:var(--ax-sys-size-base);width:100%;cursor:pointer;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:inherit;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);-webkit-user-select:none;user-select:none}ax-button button.ax-state-disabled,ax-button button.ax-state-loading{cursor:not-allowed;opacity:50%}ax-button.ax-xs button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 4);line-height:calc(var(--spacing, .25rem) * 4)}ax-button.ax-sm button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button button,ax-button.ax-md button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-lg button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-xl button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6)}ax-button .ax-button-text{text-wrap:nowrap}ax-button.ax-button-icon.ax-xs button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-sm button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button,ax-button.ax-button-icon.ax-md button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-lg button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-xl button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button ax-icon,ax-button.ax-button-icon button ax-prefix,ax-button.ax-button-icon button i{font-size:1.25em}ax-button ax-dropdown-panel{position:absolute}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: AXRippleDirective, selector: "[axRipple]", inputs: ["axRipple", "axRippleColor"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
479
479
|
}
|
|
480
480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXButtonComponent, decorators: [{
|
|
481
481
|
type: Component,
|
|
@@ -492,7 +492,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
492
492
|
{ provide: AXComponent, useExisting: AXButtonComponent },
|
|
493
493
|
{ provide: AXButtonItemComponent, useExisting: AXButtonComponent },
|
|
494
494
|
{ provide: AXFocusableComponent, useExisting: AXButtonComponent },
|
|
495
|
-
], imports: [AXRippleDirective, AXTranslationModule, CommonModule], template: "<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n", styles: ["@layer properties;@layer components{ax-button{display:inline-flex;border-radius:var(--ax-sys-border-radius)}ax-button button{position:relative;display:flex;height:var(--ax-sys-size-base);width:100%;cursor:pointer;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:inherit;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);-webkit-user-select:none;user-select:none}ax-button button.ax-state-disabled,ax-button button.ax-state-loading{cursor:not-allowed;opacity:50%}ax-button.ax-xs button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 4);line-height:calc(var(--spacing, .25rem) * 4)}ax-button.ax-sm button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button button,ax-button.ax-md button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-lg button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-xl button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6)}ax-button .ax-button-text{text-wrap:nowrap}ax-button.ax-button-icon.ax-xs button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-sm button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button,ax-button.ax-button-icon.ax-md button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-lg button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-xl button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button ax-dropdown-panel{position:absolute}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
495
|
+
], imports: [AXRippleDirective, AXTranslationModule, CommonModule], template: "<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n", styles: ["@layer properties;@layer components{ax-button{display:inline-flex;border-radius:var(--ax-sys-border-radius)}ax-button button{position:relative;display:flex;height:var(--ax-sys-size-base);width:100%;cursor:pointer;align-items:center;justify-content:center;gap:calc(var(--spacing, .25rem) * 2);border-radius:inherit;padding-inline:calc(var(--spacing, .25rem) * 4);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);-webkit-user-select:none;user-select:none}ax-button button.ax-state-disabled,ax-button button.ax-state-loading{cursor:not-allowed;opacity:50%}ax-button.ax-xs button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 4);line-height:calc(var(--spacing, .25rem) * 4)}ax-button.ax-sm button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button button,ax-button.ax-md button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-lg button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 5);line-height:calc(var(--spacing, .25rem) * 5)}ax-button.ax-xl button{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6)}ax-button .ax-button-text{text-wrap:nowrap}ax-button.ax-button-icon.ax-xs button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-sm button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 1);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button,ax-button.ax-button-icon.ax-md button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-lg button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 2);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon.ax-xl button{width:var(--ax-sys-size-base);height:var(--ax-sys-size-base);padding:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}ax-button.ax-button-icon button ax-icon,ax-button.ax-button-icon button ax-prefix,ax-button.ax-button-icon button i{font-size:1.25em}ax-button ax-dropdown-panel{position:absolute}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-leading: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
496
496
|
}], propDecorators: { iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], loadingIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AXLoadingComponent), { isSignal: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], loadingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingText", required: false }] }, { type: i0.Output, args: ["loadingTextChange"] }], __hostClass: [{
|
|
497
497
|
type: HostBinding,
|
|
498
498
|
args: ['class']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-button.mjs","sources":["../../../../packages/components/button/src/lib/button-item.component.ts","../../../../packages/components/button/src/lib/button-item-list.component.ts","../../../../packages/components/button/src/lib/button.component.ts","../../../../packages/components/button/src/lib/button.component.html","../../../../packages/components/button/src/lib/button.module.ts","../../../../packages/components/button/src/acorex-components-button.ts"],"sourcesContent":["import {\n AXClickEvent,\n AXComponent,\n AXStyleColorType,\n MXColorComponent,\n MXInteractiveComponent,\n} from '@acorex/cdk/common';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { classes } from 'polytype';\n\nexport interface AXButtonItemListItem {\n name: string;\n text: string;\n icon: string;\n divided?: boolean;\n disabled?: boolean;\n selected?: boolean;\n iconOnly?: boolean;\n color?: AXStyleColorType;\n loading?: boolean;\n}\n\n/**\n * Represents a button item with optional content like icons, text, and dropdowns.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button-item',\n template: `\n <div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"> </ng-content>\n <ng-content select=\"ax-loading\"> </ng-content>\n <ng-content select=\"ax-icon\"> </ng-content>\n @if (text) {\n <ax-text>{{ text | translate | async }}</ax-text>\n }\n </div>\n <div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"> </ng-content>\n </div>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['color', 'disabled'],\n outputs: ['onClick', 'onFocus', 'onBlur', 'disabledChange'],\n imports: [CommonModule, AXDecoratorGenericComponent, AXTranslationModule],\n providers: [{ provide: AXComponent, useExisting: AXButtonItemComponent }],\n styleUrl: './button-item.component.css',\n})\nexport class AXButtonItemComponent extends classes(MXInteractiveComponent, MXColorComponent) {\n /**\n * Text displayed on the button item.\n */\n @Input()\n text: string;\n\n /**\n * @ignore\n */\n private _selected: boolean;\n\n /**\n * Indicates whether the button item is selected.\n *\n * @param v - A boolean indicating the selected state.\n * Updates the view when the value changes.\n */\n @Input()\n public get selected(): boolean {\n return this._selected;\n }\n public set selected(v: boolean) {\n this._selected = v;\n this.cdr.markForCheck();\n }\n\n /**\n * Whether the item is visually separated from other items.\n * @defaultValue false\n */\n @Input()\n divided = false;\n\n /**\n * Data associated with the button item.\n */\n @Input()\n data: unknown;\n\n /**\n * The name of the button item.\n */\n @Input()\n name: string;\n\n /**\n * Emitted when the button item is clicked.\n * @event\n * The emitted value is an `AXClickEvent` object containing event details.\n */\n @Output()\n onClick: EventEmitter<AXClickEvent> = new EventEmitter<AXClickEvent>();\n\n /**\n * Handles click events on the button item host element.\n * Emits the onClick event if the component is not disabled.\n *\n * @param e - The mouse event that triggered the click.\n * @ignore\n */\n @HostListener('click', ['$event'])\n __hostClick(e: MouseEvent) {\n if (!this.disabled) {\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n }\n }\n /**\n * Handles focus events on the button item host element.\n * Emits the onFocus event.\n *\n * @param e - The focus event that was triggered.\n * @ignore\n */\n @HostListener('focus', ['$event'])\n __hostFocus(e: FocusEvent) {\n this.emitOnFocusEvent(e);\n }\n\n /**\n * Handles blur events on the button item host element.\n * Emits the onBlur event.\n *\n * @param e - The blur event that was triggered.\n * @ignore\n */\n @HostListener('blur', ['$event'])\n __hostBlur(e: FocusEvent) {\n this.emitOnBlurEvent(e);\n }\n\n /**\n * Generates the CSS classes for the button item host element.\n * Includes classes for icon-only state, disabled state, selected state, divided state, and color.\n *\n * @returns string - The space-separated CSS class names.\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n const cssClasses = {\n 'ax-button-icon': !this.text,\n 'ax-state-disabled': this.disabled,\n 'ax-state-selected': this.selected,\n 'ax-divided': this.divided,\n 'ax-action-item': true,\n };\n cssClasses[`${this.color}`] = true;\n return Object.entries(cssClasses)\n .filter((c) => c[1])\n .map((c) => c[0])\n .join(' ');\n }\n\n /**\n * Sets the tabindex attribute for keyboard navigation.\n *\n * @ignore\n */\n @HostBinding('attr.tabindex') tabindex = '0';\n}\n","import {\n AXClickEvent,\n AXClosableComponent,\n AXComponent,\n AXItemClickEvent,\n MXInteractiveComponent,\n} from '@acorex/cdk/common';\nimport { AXDecoratorGenericComponent, AXDecoratorIconComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n EventEmitter,\n HostBinding,\n Output,\n QueryList,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\nimport { AXButtonItemComponent, AXButtonItemListItem } from './button-item.component';\n\n/**\n * A component for rendering a list of button items with optional dividers between them.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button-item-list',\n template: `\n @for (item of items(); track item.name) {\n <ax-button-item\n [text]=\"item.text\"\n [name]=\"item.name\"\n [disabled]=\"isDisabled(item)\"\n [color]=\"item.color\"\n [selected]=\"item.selected\"\n (onClick)=\"_handleOnItemClick($event)\"\n >\n @if (item.loading) {\n <ax-loading class=\"ax-button-item-loading\"></ax-loading>\n } @else if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n }\n </ax-button-item>\n @if (item.divided) {\n <ax-divider></ax-divider>\n }\n }\n <ng-content></ng-content>\n `,\n styleUrls: ['./button-item-list.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AXButtonItemComponent, AXDecoratorGenericComponent, AXDecoratorIconComponent, AXLoadingComponent],\n providers: [{ provide: AXComponent, useExisting: AXButtonItemListComponent }],\n})\nexport class AXButtonItemListComponent extends MXInteractiveComponent {\n private parent = inject<AXClosableComponent>(AXClosableComponent, { optional: true });\n\n @ContentChildren(AXButtonItemComponent)\n protected _contentButtons: QueryList<AXButtonItemComponent>;\n\n /**\n * The list of button items to display.\n *\n * @defaultValue []\n */\n items = input<AXButtonItemListItem[]>([]);\n\n /**\n * Determines if the parent closable component should be closed automatically when\n * an item is clicked.\n *\n * @defaultValue true\n */\n closeParentOnClick = input(true);\n\n /**\n * Locks interaction for all items when any item is loading.\n *\n * @defaultValue false\n */\n lockOnLoading = input(false);\n\n /**\n * Emits an event when an item is clicked.\n * The event contains details about the clicked item.\n *\n * @event {AXItemClickEvent<AXButtonItemComponent>} - The event object containing clicked item details.\n */\n @Output()\n onItemClick: EventEmitter<AXItemClickEvent<AXButtonItemComponent>> = new EventEmitter<\n AXItemClickEvent<AXButtonItemComponent>\n >();\n\n /**\n * Initializes the button item list component.\n * Sets up content change detection and initializes content after the next render.\n *\n * @ignore\n */\n constructor() {\n super();\n afterNextRender(() => {\n this._initContents();\n this._contentButtons.changes.subscribe(() => {\n this._initContents();\n });\n });\n }\n\n protected isDisabled(item: AXButtonItemListItem): boolean {\n if (item.disabled) {\n return true;\n }\n if (item.loading) {\n return true;\n }\n if (this.lockOnLoading() && this.hasAnyLoadingItem()) {\n return true;\n }\n return false;\n }\n\n protected hasAnyLoadingItem(): boolean {\n return this.items().some((item) => !!item.loading);\n }\n /**\n * Initializes the content of the button item list.\n * Binds events and properties to content button items and marks for change detection.\n *\n * @ignore\n */\n private _initContents() {\n this._bindEvents();\n this._bindProps();\n this.cdr.markForCheck();\n }\n\n /**\n * Binds click events to content button items.\n * Subscribes to onClick events of child button items if not already subscribed.\n *\n * @ignore\n */\n private _bindEvents() {\n this._contentButtons?.forEach((b) => {\n if (!b.onClick.length)\n b.onClick.subscribe((c) => {\n this._handleOnItemClick(c);\n });\n });\n }\n\n /**\n * Binds properties to content button items.\n * Sets the disabled state of child button items based on the parent's disabled state.\n *\n * @ignore\n */\n private _bindProps() {\n this._contentButtons?.forEach((b) => {\n b.disabled = b.disabled ?? this.disabled;\n });\n }\n\n /**\n * Handles click events from button items.\n * Closes the parent component if available and emits the item click event.\n *\n * @param e - The click event from the button item.\n * @ignore\n */\n protected _handleOnItemClick(e: AXClickEvent) {\n if (this.closeParentOnClick()) {\n this.parent?.close();\n }\n this._emitOnItemClickEvent(e, e.component);\n }\n\n /**\n * Emits the onItemClick event with details about the clicked item.\n *\n * @param e - The click event from the button item.\n * @param item - The button item component that was clicked.\n * @ignore\n */\n _emitOnItemClickEvent(e: AXClickEvent, item: AXButtonItemComponent): void {\n this.onItemClick.emit({\n component: this,\n item,\n htmlElement: this.getHostElement(),\n nativeEvent: e.nativeEvent,\n name: item.name,\n data: item.data,\n });\n }\n\n /**\n * Closes the parent closable component if available.\n */\n public closeParent(): void {\n this.parent?.close();\n }\n\n /**\n * Generates the CSS classes for the button item list host element.\n * Includes classes for action list and vertical layout.\n *\n * @returns string - The space-separated CSS class names.\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-action-list ax-action-list-vertical`;\n }\n}\n","import {\n AXClickEvent,\n AXComponent,\n AXFocusableComponent,\n AXRippleDirective,\n MXButtonBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n ViewEncapsulation,\n computed,\n contentChild,\n input,\n model,\n} from '@angular/core';\nimport { AXButtonType } from './button-item.class';\nimport { AXButtonItemComponent } from './button-item.component';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.css'],\n inputs: ['disabled', 'size', 'tabIndex', 'color', 'look', 'text', 'toggleable', 'selected'],\n outputs: [\n 'onBlur',\n 'onFocus',\n 'onClick',\n 'selectedChange',\n 'toggleableChange',\n 'lookChange',\n 'colorChange',\n 'disabledChange',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n { provide: AXComponent, useExisting: AXButtonComponent },\n { provide: AXButtonItemComponent, useExisting: AXButtonComponent },\n { provide: AXFocusableComponent, useExisting: AXButtonComponent },\n ],\n imports: [AXRippleDirective, AXTranslationModule, CommonModule],\n})\nexport class AXButtonComponent extends MXButtonBaseComponent implements AfterViewInit {\n iconOnly = input(false);\n\n protected showIcon = computed(() => {\n return !this.hasLoadingIcon();\n });\n protected loadingIcon = contentChild(AXLoadingComponent);\n protected hasLoadingIcon = computed(() => this.loadingIcon() != null);\n\n /**\n * Fires each time the user clicks the button.\n * @event\n */\n onClick: EventEmitter<AXClickEvent> = new EventEmitter<AXClickEvent>();\n\n /**\n * Specifies the type of button to be used in the action sheet.\n *\n * @defaultValue 'button'\n */\n type = input<AXButtonType>('button');\n\n /**\n * Defines the text displayed while the action sheet is loading.\n *\n * @defaultValue null\n */\n loadingText = model<string | null>(null);\n\n /**\n * @ignore\n */\n ngAfterViewInit(): void {\n this.getHostElement().removeAttribute('tabindex');\n }\n\n /**\n * @ignore\n */\n private getButton(): HTMLButtonElement {\n return this.getHostElement().firstElementChild as HTMLButtonElement;\n }\n\n /**\n * @ignore\n */\n _handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n return;\n }\n if (this.toggleable) {\n this.selected = !this.selected;\n }\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n\n // TODO: check keyboard event\n setTimeout(() => {\n this.blur();\n });\n }\n\n /**\n * Triggers a click event on the button element.\n */\n click() {\n this.getButton()?.click();\n }\n\n /**\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string[] {\n const list = Object.entries(this.cssClasses)\n .filter((c) => c[1])\n .map((c) => c[0]);\n if (this.iconOnly()) {\n list.push('ax-button-icon');\n }\n return list;\n }\n\n protected override emitOnFocusEvent(e?: FocusEvent): void {\n this.getButton()?.classList.add('ax-state-focus');\n super.emitOnFocusEvent(e);\n }\n\n protected override emitOnBlurEvent(e?: FocusEvent): void {\n this.getButton()?.classList.remove('ax-state-focus');\n super.emitOnBlurEvent(e);\n }\n\n override focus() {\n this.getButton()?.focus();\n }\n\n override blur() {\n this.getButton()?.blur();\n }\n}\n","<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n","import { NgModule } from '@angular/core';\nimport { AXButtonItemListComponent } from './button-item-list.component';\nimport { AXButtonItemComponent } from './button-item.component';\nimport { AXButtonComponent } from './button.component';\n\n@NgModule({\n imports: [AXButtonComponent, AXButtonItemComponent, AXButtonItemListComponent],\n exports: [AXButtonComponent, AXButtonItemComponent, AXButtonItemListComponent],\n})\nexport class AXButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;AAmCA;;;;AAIG;AAyBG,MAAO,qBAAsB,SAAQ,OAAO,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;AAxB5F,IAAA,WAAA,GAAA;;AAmDE;;;AAGG;QAEH,IAAA,CAAA,OAAO,GAAG,KAAK;AAcf;;;;AAIG;AAEH,QAAA,IAAA,CAAA,OAAO,GAA+B,IAAI,YAAY,EAAgB;AAkEtE;;;;AAIG;QAC2B,IAAA,CAAA,QAAQ,GAAG,GAAG;AAC7C,IAAA;AAhHC;;;;;AAKG;AACH,IAAA,IACW,QAAQ,GAAA;QACjB,OAAO,IAAI,CAAC,SAAS;IACvB;IACA,IAAW,QAAQ,CAAC,CAAU,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,CAAC;AAClB,QAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;IACzB;AA6BA;;;;;;AAMG;AAEH,IAAA,WAAW,CAAC,CAAa,EAAA;AACvB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;AAChB,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,WAAW,EAAE,IAAI,CAAC,cAAc,EAAE;AAClC,gBAAA,WAAW,EAAE,CAAC;AACf,aAAA,CAAC;QACJ;IACF;AACA;;;;;;AAMG;AAEH,IAAA,WAAW,CAAC,CAAa,EAAA;AACvB,QAAA,IA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AA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA;sBAsEtD,WAAW;uBAAC,OAAO;;;MEzHT,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAA,EAAA,OAAA,EAAA,CACnE,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAA,EAAA,CAAA,CAAA;AAElE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAA,EAAA,CAAA,CAAA;;2FAGlE,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAC;AAC9E,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAC;AAC/E,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-components-button.mjs","sources":["../../../../packages/components/button/src/lib/button-item.component.ts","../../../../packages/components/button/src/lib/button-item-list.component.ts","../../../../packages/components/button/src/lib/button.component.ts","../../../../packages/components/button/src/lib/button.component.html","../../../../packages/components/button/src/lib/button.module.ts","../../../../packages/components/button/src/acorex-components-button.ts"],"sourcesContent":["import {\n AXClickEvent,\n AXComponent,\n AXStyleColorType,\n MXColorComponent,\n MXInteractiveComponent,\n} from '@acorex/cdk/common';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { classes } from 'polytype';\n\nexport interface AXButtonItemListItem {\n name: string;\n text: string;\n icon: string;\n divided?: boolean;\n disabled?: boolean;\n selected?: boolean;\n iconOnly?: boolean;\n color?: AXStyleColorType;\n loading?: boolean;\n}\n\n/**\n * Represents a button item with optional content like icons, text, and dropdowns.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button-item',\n template: `\n <div class=\"ax-action-item-prefix\">\n <ng-content select=\"ax-prefix\"> </ng-content>\n <ng-content select=\"ax-loading\"> </ng-content>\n <ng-content select=\"ax-icon\"> </ng-content>\n @if (text) {\n <ax-text>{{ text | translate | async }}</ax-text>\n }\n </div>\n <div class=\"ax-action-item-suffix\">\n <ng-content select=\"ax-suffix\"> </ng-content>\n </div>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['color', 'disabled'],\n outputs: ['onClick', 'onFocus', 'onBlur', 'disabledChange'],\n imports: [CommonModule, AXDecoratorGenericComponent, AXTranslationModule],\n providers: [{ provide: AXComponent, useExisting: AXButtonItemComponent }],\n styleUrl: './button-item.component.css',\n})\nexport class AXButtonItemComponent extends classes(MXInteractiveComponent, MXColorComponent) {\n /**\n * Text displayed on the button item.\n */\n @Input()\n text: string;\n\n /**\n * @ignore\n */\n private _selected: boolean;\n\n /**\n * Indicates whether the button item is selected.\n *\n * @param v - A boolean indicating the selected state.\n * Updates the view when the value changes.\n */\n @Input()\n public get selected(): boolean {\n return this._selected;\n }\n public set selected(v: boolean) {\n this._selected = v;\n this.cdr.markForCheck();\n }\n\n /**\n * Whether the item is visually separated from other items.\n * @defaultValue false\n */\n @Input()\n divided = false;\n\n /**\n * Data associated with the button item.\n */\n @Input()\n data: unknown;\n\n /**\n * The name of the button item.\n */\n @Input()\n name: string;\n\n /**\n * Emitted when the button item is clicked.\n * @event\n * The emitted value is an `AXClickEvent` object containing event details.\n */\n @Output()\n onClick: EventEmitter<AXClickEvent> = new EventEmitter<AXClickEvent>();\n\n /**\n * Handles click events on the button item host element.\n * Emits the onClick event if the component is not disabled.\n *\n * @param e - The mouse event that triggered the click.\n * @ignore\n */\n @HostListener('click', ['$event'])\n __hostClick(e: MouseEvent) {\n if (!this.disabled) {\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n }\n }\n /**\n * Handles focus events on the button item host element.\n * Emits the onFocus event.\n *\n * @param e - The focus event that was triggered.\n * @ignore\n */\n @HostListener('focus', ['$event'])\n __hostFocus(e: FocusEvent) {\n this.emitOnFocusEvent(e);\n }\n\n /**\n * Handles blur events on the button item host element.\n * Emits the onBlur event.\n *\n * @param e - The blur event that was triggered.\n * @ignore\n */\n @HostListener('blur', ['$event'])\n __hostBlur(e: FocusEvent) {\n this.emitOnBlurEvent(e);\n }\n\n /**\n * Generates the CSS classes for the button item host element.\n * Includes classes for icon-only state, disabled state, selected state, divided state, and color.\n *\n * @returns string - The space-separated CSS class names.\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n const cssClasses = {\n 'ax-button-icon': !this.text,\n 'ax-state-disabled': this.disabled,\n 'ax-state-selected': this.selected,\n 'ax-divided': this.divided,\n 'ax-action-item': true,\n };\n cssClasses[`${this.color}`] = true;\n return Object.entries(cssClasses)\n .filter((c) => c[1])\n .map((c) => c[0])\n .join(' ');\n }\n\n /**\n * Sets the tabindex attribute for keyboard navigation.\n *\n * @ignore\n */\n @HostBinding('attr.tabindex') tabindex = '0';\n}\n","import {\n AXClickEvent,\n AXClosableComponent,\n AXComponent,\n AXItemClickEvent,\n MXInteractiveComponent,\n} from '@acorex/cdk/common';\nimport { AXDecoratorGenericComponent, AXDecoratorIconComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n EventEmitter,\n HostBinding,\n Output,\n QueryList,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\nimport { AXButtonItemComponent, AXButtonItemListItem } from './button-item.component';\n\n/**\n * A component for rendering a list of button items with optional dividers between them.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button-item-list',\n template: `\n @for (item of items(); track item.name) {\n <ax-button-item\n [text]=\"item.text\"\n [name]=\"item.name\"\n [disabled]=\"isDisabled(item)\"\n [color]=\"item.color\"\n [selected]=\"item.selected\"\n (onClick)=\"_handleOnItemClick($event)\"\n >\n @if (item.loading) {\n <ax-loading class=\"ax-button-item-loading\"></ax-loading>\n } @else if (item.icon) {\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n }\n </ax-button-item>\n @if (item.divided) {\n <ax-divider></ax-divider>\n }\n }\n <ng-content></ng-content>\n `,\n styleUrls: ['./button-item-list.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [AXButtonItemComponent, AXDecoratorGenericComponent, AXDecoratorIconComponent, AXLoadingComponent],\n providers: [{ provide: AXComponent, useExisting: AXButtonItemListComponent }],\n})\nexport class AXButtonItemListComponent extends MXInteractiveComponent {\n private parent = inject<AXClosableComponent>(AXClosableComponent, { optional: true });\n\n @ContentChildren(AXButtonItemComponent)\n protected _contentButtons: QueryList<AXButtonItemComponent>;\n\n /**\n * The list of button items to display.\n *\n * @defaultValue []\n */\n items = input<AXButtonItemListItem[]>([]);\n\n /**\n * Determines if the parent closable component should be closed automatically when\n * an item is clicked.\n *\n * @defaultValue true\n */\n closeParentOnClick = input(true);\n\n /**\n * Locks interaction for all items when any item is loading.\n *\n * @defaultValue false\n */\n lockOnLoading = input(false);\n\n /**\n * Emits an event when an item is clicked.\n * The event contains details about the clicked item.\n *\n * @event {AXItemClickEvent<AXButtonItemComponent>} - The event object containing clicked item details.\n */\n @Output()\n onItemClick: EventEmitter<AXItemClickEvent<AXButtonItemComponent>> = new EventEmitter<\n AXItemClickEvent<AXButtonItemComponent>\n >();\n\n /**\n * Initializes the button item list component.\n * Sets up content change detection and initializes content after the next render.\n *\n * @ignore\n */\n constructor() {\n super();\n afterNextRender(() => {\n this._initContents();\n this._contentButtons.changes.subscribe(() => {\n this._initContents();\n });\n });\n }\n\n protected isDisabled(item: AXButtonItemListItem): boolean {\n if (item.disabled) {\n return true;\n }\n if (item.loading) {\n return true;\n }\n if (this.lockOnLoading() && this.hasAnyLoadingItem()) {\n return true;\n }\n return false;\n }\n\n protected hasAnyLoadingItem(): boolean {\n return this.items().some((item) => !!item.loading);\n }\n /**\n * Initializes the content of the button item list.\n * Binds events and properties to content button items and marks for change detection.\n *\n * @ignore\n */\n private _initContents() {\n this._bindEvents();\n this._bindProps();\n this.cdr.markForCheck();\n }\n\n /**\n * Binds click events to content button items.\n * Subscribes to onClick events of child button items if not already subscribed.\n *\n * @ignore\n */\n private _bindEvents() {\n this._contentButtons?.forEach((b) => {\n if (!b.onClick.length)\n b.onClick.subscribe((c) => {\n this._handleOnItemClick(c);\n });\n });\n }\n\n /**\n * Binds properties to content button items.\n * Sets the disabled state of child button items based on the parent's disabled state.\n *\n * @ignore\n */\n private _bindProps() {\n this._contentButtons?.forEach((b) => {\n b.disabled = b.disabled ?? this.disabled;\n });\n }\n\n /**\n * Handles click events from button items.\n * Closes the parent component if available and emits the item click event.\n *\n * @param e - The click event from the button item.\n * @ignore\n */\n protected _handleOnItemClick(e: AXClickEvent) {\n if (this.closeParentOnClick()) {\n this.parent?.close();\n }\n this._emitOnItemClickEvent(e, e.component);\n }\n\n /**\n * Emits the onItemClick event with details about the clicked item.\n *\n * @param e - The click event from the button item.\n * @param item - The button item component that was clicked.\n * @ignore\n */\n _emitOnItemClickEvent(e: AXClickEvent, item: AXButtonItemComponent): void {\n this.onItemClick.emit({\n component: this,\n item,\n htmlElement: this.getHostElement(),\n nativeEvent: e.nativeEvent,\n name: item.name,\n data: item.data,\n });\n }\n\n /**\n * Closes the parent closable component if available.\n */\n public closeParent(): void {\n this.parent?.close();\n }\n\n /**\n * Generates the CSS classes for the button item list host element.\n * Includes classes for action list and vertical layout.\n *\n * @returns string - The space-separated CSS class names.\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-action-list ax-action-list-vertical`;\n }\n}\n","import {\n AXClickEvent,\n AXComponent,\n AXFocusableComponent,\n AXRippleDirective,\n MXButtonBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n ViewEncapsulation,\n computed,\n contentChild,\n input,\n model,\n} from '@angular/core';\nimport { AXButtonType } from './button-item.class';\nimport { AXButtonItemComponent } from './button-item.component';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.css'],\n inputs: ['disabled', 'size', 'tabIndex', 'color', 'look', 'text', 'toggleable', 'selected'],\n outputs: [\n 'onBlur',\n 'onFocus',\n 'onClick',\n 'selectedChange',\n 'toggleableChange',\n 'lookChange',\n 'colorChange',\n 'disabledChange',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n { provide: AXComponent, useExisting: AXButtonComponent },\n { provide: AXButtonItemComponent, useExisting: AXButtonComponent },\n { provide: AXFocusableComponent, useExisting: AXButtonComponent },\n ],\n imports: [AXRippleDirective, AXTranslationModule, CommonModule],\n})\nexport class AXButtonComponent extends MXButtonBaseComponent implements AfterViewInit {\n iconOnly = input(false);\n\n protected showIcon = computed(() => {\n return !this.hasLoadingIcon();\n });\n protected loadingIcon = contentChild(AXLoadingComponent);\n protected hasLoadingIcon = computed(() => this.loadingIcon() != null);\n\n /**\n * Fires each time the user clicks the button.\n * @event\n */\n onClick: EventEmitter<AXClickEvent> = new EventEmitter<AXClickEvent>();\n\n /**\n * Specifies the type of button to be used in the action sheet.\n *\n * @defaultValue 'button'\n */\n type = input<AXButtonType>('button');\n\n /**\n * Defines the text displayed while the action sheet is loading.\n *\n * @defaultValue null\n */\n loadingText = model<string | null>(null);\n\n /**\n * @ignore\n */\n ngAfterViewInit(): void {\n this.getHostElement().removeAttribute('tabindex');\n }\n\n /**\n * @ignore\n */\n private getButton(): HTMLButtonElement {\n return this.getHostElement().firstElementChild as HTMLButtonElement;\n }\n\n /**\n * @ignore\n */\n _handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n return;\n }\n if (this.toggleable) {\n this.selected = !this.selected;\n }\n this.onClick.emit({\n component: this,\n htmlElement: this.getHostElement(),\n nativeEvent: e,\n });\n\n // TODO: check keyboard event\n setTimeout(() => {\n this.blur();\n });\n }\n\n /**\n * Triggers a click event on the button element.\n */\n click() {\n this.getButton()?.click();\n }\n\n /**\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string[] {\n const list = Object.entries(this.cssClasses)\n .filter((c) => c[1])\n .map((c) => c[0]);\n if (this.iconOnly()) {\n list.push('ax-button-icon');\n }\n return list;\n }\n\n protected override emitOnFocusEvent(e?: FocusEvent): void {\n this.getButton()?.classList.add('ax-state-focus');\n super.emitOnFocusEvent(e);\n }\n\n protected override emitOnBlurEvent(e?: FocusEvent): void {\n this.getButton()?.classList.remove('ax-state-focus');\n super.emitOnBlurEvent(e);\n }\n\n override focus() {\n this.getButton()?.focus();\n }\n\n override blur() {\n this.getButton()?.blur();\n }\n}\n","<button\n [axRipple]\n [attr.type]=\"type()\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n (click)=\"_handleClick($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n class=\"{{ color }}\n {{ interactiveLook }} \n {{ selected ? 'ax-state-selected' : '' }} \n {{ disabled ? 'ax-state-disabled' : '' }}\"\n>\n <ng-content select=\"ax-loading, ax-loading-spinner\"> </ng-content>\n\n @if (showIcon()) {\n <ng-content select=\"ax-prefix, ax-icon\"> </ng-content>\n }\n\n <ng-content select=\"ax-content\"> </ng-content>\n\n @if (text && !loadingText() && !iconOnly()) {\n <span class=\"ax-button-text\">{{ text | translate | async }}</span>\n }\n\n @if (loadingText()) {\n <span class=\"ax-button-text\">{{ loadingText() }}</span>\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-content select=\"ax-dropdown-panel\"> </ng-content>\n <ng-content select=\".tab-content\"> </ng-content>\n\n <ng-content></ng-content>\n</button>\n","import { NgModule } from '@angular/core';\nimport { AXButtonItemListComponent } from './button-item-list.component';\nimport { AXButtonItemComponent } from './button-item.component';\nimport { AXButtonComponent } from './button.component';\n\n@NgModule({\n imports: [AXButtonComponent, AXButtonItemComponent, AXButtonItemListComponent],\n exports: [AXButtonComponent, AXButtonItemComponent, AXButtonItemListComponent],\n})\nexport class AXButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;AAmCA;;;;AAIG;AAyBG,MAAO,qBAAsB,SAAQ,OAAO,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAA;AAxB5F,IAAA,WAAA,GAAA;;AAmDE;;;AAGG;QAEH,IAAA,CAAA,OAAO,GAAG,KAAK;AAcf;;;;AAIG;AAEH,QAAA,IAAA,CAA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,CAAA,CAAA;AAElE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAA,EAAA,CAAA,CAAA;;2FAGlE,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAC;AAC9E,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,CAAC;AAC/E,iBAAA;;;ACRD;;AAEG;;;;"}
|
package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AXComponentCloseEvent, AXClosableComponent } from '@acorex/cdk/common';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, input, computed, EventEmitter, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
class AXConversationComposerActionChoiceDialogComponent {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.translation = inject(AXTranslationService);
|
|
9
|
+
this.actions = input.required(...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
10
|
+
this.fileCount = input(1, ...(ngDevMode ? [{ debugName: "fileCount" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.composerActionRegistry = input.required(...(ngDevMode ? [{ debugName: "composerActionRegistry" }] : /* istanbul ignore next */ []));
|
|
12
|
+
this.__popup__ = input(...(ngDevMode ? [undefined, { debugName: "__popup__" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.hintText = computed(() => {
|
|
14
|
+
const count = this.fileCount();
|
|
15
|
+
if (count === 1) {
|
|
16
|
+
return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-single');
|
|
17
|
+
}
|
|
18
|
+
return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-multiple', {
|
|
19
|
+
params: { count },
|
|
20
|
+
});
|
|
21
|
+
}, ...(ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.onClosed = new EventEmitter();
|
|
23
|
+
}
|
|
24
|
+
getActionLabel(action) {
|
|
25
|
+
return this.composerActionRegistry().getActionLabel(action);
|
|
26
|
+
}
|
|
27
|
+
getActionTooltip(action) {
|
|
28
|
+
return this.composerActionRegistry().getActionTooltip(action);
|
|
29
|
+
}
|
|
30
|
+
choose(action) {
|
|
31
|
+
const event = new AXComponentCloseEvent();
|
|
32
|
+
event.component = this;
|
|
33
|
+
event.data = action;
|
|
34
|
+
this.onClosed.emit(event);
|
|
35
|
+
}
|
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationComposerActionChoiceDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationComposerActionChoiceDialogComponent, isStandalone: true, selector: "ax-conversation-composer-action-choice-dialog", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: true, transformFunction: null }, fileCount: { classPropertyName: "fileCount", publicName: "fileCount", isSignal: true, isRequired: false, transformFunction: null }, composerActionRegistry: { classPropertyName: "composerActionRegistry", publicName: "composerActionRegistry", isSignal: true, isRequired: true, transformFunction: null }, __popup__: { classPropertyName: "__popup__", publicName: "__popup__", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }], ngImport: i0, template: `
|
|
38
|
+
<div class="composer-action-choice" role="dialog" aria-modal="true">
|
|
39
|
+
<p class="composer-action-choice__hint">{{ hintText() }}</p>
|
|
40
|
+
<ul class="composer-action-choice__list" role="listbox">
|
|
41
|
+
@for (action of actions(); track action.id) {
|
|
42
|
+
<li role="presentation">
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
class="composer-action-choice__option"
|
|
46
|
+
role="option"
|
|
47
|
+
(click)="choose(action)"
|
|
48
|
+
[attr.aria-label]="getActionLabel(action)"
|
|
49
|
+
>
|
|
50
|
+
<span class="composer-action-choice__icon" aria-hidden="true">
|
|
51
|
+
<i [class]="action.icon"></i>
|
|
52
|
+
</span>
|
|
53
|
+
<span class="composer-action-choice__text">
|
|
54
|
+
<span class="composer-action-choice__title">{{ getActionLabel(action) }}</span>
|
|
55
|
+
@if (getActionTooltip(action); as tip) {
|
|
56
|
+
<span class="composer-action-choice__subtitle">{{ tip }}</span>
|
|
57
|
+
}
|
|
58
|
+
</span>
|
|
59
|
+
<i class="fa-light fa-chevron-right composer-action-choice__chevron" aria-hidden="true"></i>
|
|
60
|
+
</button>
|
|
61
|
+
</li>
|
|
62
|
+
}
|
|
63
|
+
</ul>
|
|
64
|
+
</div>
|
|
65
|
+
`, isInline: true, styles: [":host{display:block}.composer-action-choice{display:flex;flex-direction:column;gap:.75rem;padding:.5rem;min-width:16rem}.composer-action-choice__hint{margin:0;font-size:.8125rem;line-height:1.45;color:rgba(var(--ax-sys-color-on-surface),.7)}.composer-action-choice__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.composer-action-choice__option{display:flex;align-items:center;gap:.75rem;width:100%;padding:.625rem .75rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .5rem);background:rgb(var(--ax-sys-color-surface));cursor:pointer;text-align:start;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.composer-action-choice__option:hover,.composer-action-choice__option:focus-visible{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06);outline:none;box-shadow:0 0 0 1px rgba(var(--ax-sys-color-primary-500),.25)}.composer-action-choice__icon{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.1);color:rgb(var(--ax-sys-color-primary-600));font-size:1.125rem}.composer-action-choice__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.composer-action-choice__title{font-size:.875rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.composer-action-choice__subtitle{font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer-action-choice__chevron{flex-shrink:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.45)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
66
|
+
}
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationComposerActionChoiceDialogComponent, decorators: [{
|
|
68
|
+
type: Component,
|
|
69
|
+
args: [{ selector: 'ax-conversation-composer-action-choice-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
70
|
+
<div class="composer-action-choice" role="dialog" aria-modal="true">
|
|
71
|
+
<p class="composer-action-choice__hint">{{ hintText() }}</p>
|
|
72
|
+
<ul class="composer-action-choice__list" role="listbox">
|
|
73
|
+
@for (action of actions(); track action.id) {
|
|
74
|
+
<li role="presentation">
|
|
75
|
+
<button
|
|
76
|
+
type="button"
|
|
77
|
+
class="composer-action-choice__option"
|
|
78
|
+
role="option"
|
|
79
|
+
(click)="choose(action)"
|
|
80
|
+
[attr.aria-label]="getActionLabel(action)"
|
|
81
|
+
>
|
|
82
|
+
<span class="composer-action-choice__icon" aria-hidden="true">
|
|
83
|
+
<i [class]="action.icon"></i>
|
|
84
|
+
</span>
|
|
85
|
+
<span class="composer-action-choice__text">
|
|
86
|
+
<span class="composer-action-choice__title">{{ getActionLabel(action) }}</span>
|
|
87
|
+
@if (getActionTooltip(action); as tip) {
|
|
88
|
+
<span class="composer-action-choice__subtitle">{{ tip }}</span>
|
|
89
|
+
}
|
|
90
|
+
</span>
|
|
91
|
+
<i class="fa-light fa-chevron-right composer-action-choice__chevron" aria-hidden="true"></i>
|
|
92
|
+
</button>
|
|
93
|
+
</li>
|
|
94
|
+
}
|
|
95
|
+
</ul>
|
|
96
|
+
</div>
|
|
97
|
+
`, providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }], styles: [":host{display:block}.composer-action-choice{display:flex;flex-direction:column;gap:.75rem;padding:.5rem;min-width:16rem}.composer-action-choice__hint{margin:0;font-size:.8125rem;line-height:1.45;color:rgba(var(--ax-sys-color-on-surface),.7)}.composer-action-choice__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.composer-action-choice__option{display:flex;align-items:center;gap:.75rem;width:100%;padding:.625rem .75rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .5rem);background:rgb(var(--ax-sys-color-surface));cursor:pointer;text-align:start;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.composer-action-choice__option:hover,.composer-action-choice__option:focus-visible{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06);outline:none;box-shadow:0 0 0 1px rgba(var(--ax-sys-color-primary-500),.25)}.composer-action-choice__icon{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.1);color:rgb(var(--ax-sys-color-primary-600));font-size:1.125rem}.composer-action-choice__text{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.composer-action-choice__title{font-size:.875rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.composer-action-choice__subtitle{font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer-action-choice__chevron{flex-shrink:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.45)}\n"] }]
|
|
98
|
+
}], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: true }] }], fileCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileCount", required: false }] }], composerActionRegistry: [{ type: i0.Input, args: [{ isSignal: true, alias: "composerActionRegistry", required: true }] }], __popup__: [{ type: i0.Input, args: [{ isSignal: true, alias: "__popup__", required: false }] }] } });
|
|
99
|
+
|
|
100
|
+
export { AXConversationComposerActionChoiceDialogComponent };
|
|
101
|
+
//# sourceMappingURL=acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/composer-action-choice-dialog.component.ts"],"sourcesContent":["import { AXClosableComponent, AXComponentCloseEvent } from '@acorex/cdk/common';\nimport type { AXPopupRef } from '@acorex/components/popup';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { ChangeDetectionStrategy, Component, EventEmitter, computed, inject, input } from '@angular/core';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\n\n@Component({\n selector: 'ax-conversation-composer-action-choice-dialog',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"composer-action-choice\" role=\"dialog\" aria-modal=\"true\">\n <p class=\"composer-action-choice__hint\">{{ hintText() }}</p>\n <ul class=\"composer-action-choice__list\" role=\"listbox\">\n @for (action of actions(); track action.id) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n class=\"composer-action-choice__option\"\n role=\"option\"\n (click)=\"choose(action)\"\n [attr.aria-label]=\"getActionLabel(action)\"\n >\n <span class=\"composer-action-choice__icon\" aria-hidden=\"true\">\n <i [class]=\"action.icon\"></i>\n </span>\n <span class=\"composer-action-choice__text\">\n <span class=\"composer-action-choice__title\">{{ getActionLabel(action) }}</span>\n @if (getActionTooltip(action); as tip) {\n <span class=\"composer-action-choice__subtitle\">{{ tip }}</span>\n }\n </span>\n <i class=\"fa-light fa-chevron-right composer-action-choice__chevron\" aria-hidden=\"true\"></i>\n </button>\n </li>\n }\n </ul>\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n\n .composer-action-choice {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n padding: 0.5rem;\n min-width: 16rem;\n }\n\n .composer-action-choice__hint {\n margin: 0;\n font-size: 0.8125rem;\n line-height: 1.45;\n color: rgba(var(--ax-sys-color-on-surface), 0.7);\n }\n\n .composer-action-choice__list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .composer-action-choice__option {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n width: 100%;\n padding: 0.625rem 0.75rem;\n border: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n border-radius: var(--ax-sys-border-radius, 0.5rem);\n background: rgb(var(--ax-sys-color-surface));\n cursor: pointer;\n text-align: start;\n transition:\n border-color 0.15s ease,\n background-color 0.15s ease,\n box-shadow 0.15s ease;\n }\n\n .composer-action-choice__option:hover,\n .composer-action-choice__option:focus-visible {\n border-color: rgb(var(--ax-sys-color-primary-500));\n background: rgba(var(--ax-sys-color-primary-500), 0.06);\n outline: none;\n box-shadow: 0 0 0 1px rgba(var(--ax-sys-color-primary-500), 0.25);\n }\n\n .composer-action-choice__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n flex-shrink: 0;\n border-radius: var(--ax-sys-border-radius, 0.375rem);\n background: rgba(var(--ax-sys-color-primary-500), 0.1);\n color: rgb(var(--ax-sys-color-primary-600));\n font-size: 1.125rem;\n }\n\n .composer-action-choice__text {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n\n .composer-action-choice__title {\n font-size: 0.875rem;\n font-weight: 600;\n color: rgb(var(--ax-sys-color-on-surface));\n }\n\n .composer-action-choice__subtitle {\n font-size: 0.75rem;\n color: rgba(var(--ax-sys-color-on-surface), 0.6);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .composer-action-choice__chevron {\n flex-shrink: 0;\n font-size: 0.75rem;\n color: rgba(var(--ax-sys-color-on-surface), 0.45);\n }\n `,\n ],\n providers: [{ provide: AXClosableComponent, useExisting: AXConversationComposerActionChoiceDialogComponent }],\n})\nexport class AXConversationComposerActionChoiceDialogComponent {\n private readonly translation = inject(AXTranslationService);\n\n readonly actions = input.required<AXConversationComposerAction[]>();\n readonly fileCount = input(1);\n readonly composerActionRegistry = input.required<AXConversationComposerActionRegistry>();\n readonly __popup__ = input<AXPopupRef | undefined>();\n\n readonly hintText = computed(() => {\n const count = this.fileCount();\n if (count === 1) {\n return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-single');\n }\n return this.translation.translateSync('@acorex:chat.dialog.choose-send-option.hint-multiple', {\n params: { count },\n });\n });\n\n readonly onClosed = new EventEmitter<AXComponentCloseEvent>();\n\n getActionLabel(action: AXConversationComposerAction): string {\n return this.composerActionRegistry().getActionLabel(action);\n }\n\n getActionTooltip(action: AXConversationComposerAction): string | undefined {\n return this.composerActionRegistry().getActionTooltip(action);\n }\n\n choose(action: AXConversationComposerAction): void {\n const event = new AXComponentCloseEvent();\n event.component = this;\n event.data = action;\n this.onClosed.emit(event);\n }\n}\n"],"names":[],"mappings":";;;;;MAyIa,iDAAiD,CAAA;AAnI9D,IAAA,WAAA,GAAA;AAoImB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAElD,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6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