@praxisui/expansion 0.0.1
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/LICENSE +7 -0
- package/README.md +165 -0
- package/fesm2022/praxisui-expansion.mjs +648 -0
- package/fesm2022/praxisui-expansion.mjs.map +1 -0
- package/index.d.ts +133 -0
- package/package.json +40 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# @praxis/expansion — Praxis Expansion Panel
|
|
2
|
+
|
|
3
|
+
Widget baseado em Angular Material (MatAccordion/MatExpansionPanel) com configuração via metadata, editor embutido e integração com o `ComponentMetadataRegistry` para uso no `praxis-dynamic-gridster-page`.
|
|
4
|
+
|
|
5
|
+
## Instalação e Providers
|
|
6
|
+
|
|
7
|
+
- Registrar o metadata do componente:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { providePraxisExpansionMetadata } from '@praxis/expansion';
|
|
11
|
+
|
|
12
|
+
bootstrapApplication(AppComponent, {
|
|
13
|
+
providers: [providePraxisExpansionMetadata()],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- (Opcional) Definir defaults globais do painel:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { providePraxisExpansionDefaults } from '@praxis/expansion';
|
|
21
|
+
|
|
22
|
+
bootstrapApplication(AppComponent, {
|
|
23
|
+
providers: [
|
|
24
|
+
providePraxisExpansionDefaults({ collapsedHeight: '48px', expandedHeight: '64px', hideToggle: false }),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Exemplo básico (metadata)
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { ExpansionMetadata } from '@praxis/expansion';
|
|
33
|
+
|
|
34
|
+
const expansionConfig: ExpansionMetadata = {
|
|
35
|
+
accordion: { multi: true, displayMode: 'default', togglePosition: 'after' },
|
|
36
|
+
panels: [
|
|
37
|
+
{ id: 'general', title: 'Geral', description: 'Informações principais', expanded: true },
|
|
38
|
+
{ id: 'advanced', title: 'Avançado', description: 'Opções avançadas' },
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<praxis-expansion [config]="expansionConfig" [editModeEnabled]="true"></praxis-expansion>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Lazy loading de conteúdo (por painel)
|
|
48
|
+
|
|
49
|
+
O componente utiliza `<ng-template matExpansionPanelContent>`, logo o conteúdo interno de cada painel é criado apenas quando o painel é aberto. Não é necessário habilitar um flag: basta declarar `content` (campos) e/ou `widgets` (widgets dinâmicos) no painel.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const expansionConfig: ExpansionMetadata = {
|
|
53
|
+
accordion: { multi: true },
|
|
54
|
+
panels: [
|
|
55
|
+
{
|
|
56
|
+
id: 'general',
|
|
57
|
+
title: 'Geral',
|
|
58
|
+
expanded: true,
|
|
59
|
+
// Campos dinâmicos (renderizados ao abrir)
|
|
60
|
+
content: [
|
|
61
|
+
{ id: 'text', inputs: { field: { name: 'nome', label: 'Nome' } } },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'advanced',
|
|
66
|
+
title: 'Avançado',
|
|
67
|
+
// Widgets dinâmicos (renderizados ao abrir)
|
|
68
|
+
widgets: [
|
|
69
|
+
{ id: 'praxis-table', inputs: { config: { /* ... */ } } },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Action Row por painel
|
|
77
|
+
|
|
78
|
+
Adicione botões de ação no rodapé do painel com `actionButtons`. O evento é reemitido via `widgetEvent` com `output: 'action'`.
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
const expansionConfig: ExpansionMetadata = {
|
|
82
|
+
panels: [
|
|
83
|
+
{
|
|
84
|
+
id: 'general',
|
|
85
|
+
title: 'Geral',
|
|
86
|
+
actionButtons: [
|
|
87
|
+
{ label: 'Salvar', icon: 'save', action: 'save-general' },
|
|
88
|
+
{ label: 'Cancelar', icon: 'close', action: 'cancel-general' },
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<praxis-expansion
|
|
97
|
+
[config]="expansionConfig"
|
|
98
|
+
(widgetEvent)="onExpansionEvent($event)">
|
|
99
|
+
</praxis-expansion>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
onExpansionEvent(ev: { panelId?: string; panelIndex?: number; sourceId: string; output?: string; payload?: any }) {
|
|
104
|
+
if (ev.output === 'action') {
|
|
105
|
+
// ev.payload.action -> 'save-general' | 'cancel-general' | ...
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Defaults (heights e toggle) por instância
|
|
111
|
+
|
|
112
|
+
Você pode passar `defaultOptions` direto no componente, que tem precedência sobre os valores providos globalmente via provider.
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<praxis-expansion
|
|
116
|
+
[config]="expansionConfig"
|
|
117
|
+
[defaultOptions]="{ collapsedHeight: '48px', expandedHeight: '64px', hideToggle: false }">
|
|
118
|
+
</praxis-expansion>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Controle programático: open/close/toggle/openAll/closeAll
|
|
122
|
+
|
|
123
|
+
O componente expõe métodos para controlar a expansão por índice (numérico) ou por id (string):
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<praxis-expansion #expRef [config]="expansionConfig"></praxis-expansion>
|
|
127
|
+
|
|
128
|
+
<button (click)="expRef.open('general')">Abrir Geral</button>
|
|
129
|
+
<button (click)="expRef.close(1)">Fechar painel 2</button>
|
|
130
|
+
<button (click)="expRef.toggle('advanced')">Alternar Avançado</button>
|
|
131
|
+
<button (click)="expRef.openAll()">Abrir todos</button>
|
|
132
|
+
<button (click)="expRef.closeAll()">Fechar todos</button>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Eventos suportados
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<praxis-expansion
|
|
139
|
+
[config]="expansionConfig"
|
|
140
|
+
(opened)="onOpened($event)"
|
|
141
|
+
(afterExpand)="onAfterExpand($event)"
|
|
142
|
+
(expandedChange)="onExpandedChange($event)"
|
|
143
|
+
(afterCollapse)="onAfterCollapse($event)"
|
|
144
|
+
(closed)="onClosed($event)"
|
|
145
|
+
(destroyed)="onDestroyed($event)">
|
|
146
|
+
</praxis-expansion>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Cada evento inclui `{ panelId?: string; panelIndex: number }` (ou `expanded: boolean` no caso de `expandedChange`).
|
|
150
|
+
|
|
151
|
+
## Tokens de Estilo por instância
|
|
152
|
+
|
|
153
|
+
Os tokens opcionais em `appearance.tokens` permitem customizações rápidas por instância; por exemplo:
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
const expansionConfig: ExpansionMetadata = {
|
|
157
|
+
appearance: { tokens: { 'header-background-color': 'rgba(0,0,0,0.04)' } },
|
|
158
|
+
panels: [ /* ... */ ],
|
|
159
|
+
};
|
|
160
|
+
``;
|
|
161
|
+
|
|
162
|
+
## Integração via Registry / Gridster
|
|
163
|
+
|
|
164
|
+
Ao registrar `providePraxisExpansionMetadata()`, o widget `praxis-expansion` fica disponível para o `DynamicWidgetLoader` e pode ser usado em páginas dinâmicas (incl. `praxis-dynamic-gridster-page`). Basta fornecer um `WidgetDefinition` com `id: 'praxis-expansion'` e `inputs.config` com o `ExpansionMetadata` desejado.
|
|
165
|
+
|
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { EventEmitter, inject, DestroyRef, ViewChildren, ViewChild, Output, Input, ChangeDetectionStrategy, Component, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import * as i2 from '@angular/material/expansion';
|
|
7
|
+
import { MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, MatExpansionModule, MatExpansionPanel } from '@angular/material/expansion';
|
|
8
|
+
import * as i3 from '@angular/material/icon';
|
|
9
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
+
import * as i4 from '@angular/material/button';
|
|
11
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
12
|
+
import { CONFIG_STORAGE, DynamicWidgetLoaderDirective, PraxisIconDirective, ComponentMetadataRegistry } from '@praxisui/core';
|
|
13
|
+
import { SettingsPanelService } from '@praxisui/settings-panel';
|
|
14
|
+
|
|
15
|
+
class PraxisExpansion {
|
|
16
|
+
config;
|
|
17
|
+
expansionId;
|
|
18
|
+
context = {};
|
|
19
|
+
strictValidation = true;
|
|
20
|
+
editModeEnabled = false;
|
|
21
|
+
defaultOptions;
|
|
22
|
+
opened = new EventEmitter();
|
|
23
|
+
closed = new EventEmitter();
|
|
24
|
+
expandedChange = new EventEmitter();
|
|
25
|
+
afterExpand = new EventEmitter();
|
|
26
|
+
afterCollapse = new EventEmitter();
|
|
27
|
+
destroyed = new EventEmitter();
|
|
28
|
+
widgetEvent = new EventEmitter();
|
|
29
|
+
settings = inject(SettingsPanelService);
|
|
30
|
+
storage = inject(CONFIG_STORAGE);
|
|
31
|
+
destroyRef = inject(DestroyRef);
|
|
32
|
+
accordionRef;
|
|
33
|
+
panels;
|
|
34
|
+
injectedDefaults = inject(MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, { optional: true });
|
|
35
|
+
hasMultiple = () => (this.config?.panels?.length || 0) > 1;
|
|
36
|
+
single = () => (this.config?.panels && this.config.panels[0]) || null;
|
|
37
|
+
styleCss() {
|
|
38
|
+
const t = this.config?.appearance?.tokens;
|
|
39
|
+
if (!t)
|
|
40
|
+
return null;
|
|
41
|
+
const scope = `.praxis-expansion-root[data-expansion-id="${(this.expansionId || 'default').replace(/"/g, '')}"]`;
|
|
42
|
+
const rules = [];
|
|
43
|
+
const push = (selector, decls) => { rules.push(`${scope} ${selector}{${decls.join('')}}`); };
|
|
44
|
+
// Example: header background color
|
|
45
|
+
const bg = t['header-background-color'];
|
|
46
|
+
if (bg) {
|
|
47
|
+
const safe = /^#[0-9a-fA-F]{3,8}$/.test(bg) || /^var\(--[\w-]+\)$/.test(bg);
|
|
48
|
+
if (safe) {
|
|
49
|
+
push(' .mat-expansion-panel-header', [`background-color:${bg}!important;`]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (rules.length === 0)
|
|
53
|
+
return null;
|
|
54
|
+
return rules.join('\n');
|
|
55
|
+
}
|
|
56
|
+
emitOpened(p, index) {
|
|
57
|
+
this.opened.emit({ panelId: p.id, panelIndex: index });
|
|
58
|
+
}
|
|
59
|
+
emitClosed(p, index) {
|
|
60
|
+
this.closed.emit({ panelId: p.id, panelIndex: index });
|
|
61
|
+
}
|
|
62
|
+
emitExpandedChange(p, index, expanded) {
|
|
63
|
+
this.expandedChange.emit({ panelId: p.id, panelIndex: index, expanded });
|
|
64
|
+
}
|
|
65
|
+
emitAfterExpand(p, index) {
|
|
66
|
+
this.afterExpand.emit({ panelId: p.id, panelIndex: index });
|
|
67
|
+
}
|
|
68
|
+
emitAfterCollapse(p, index) {
|
|
69
|
+
this.afterCollapse.emit({ panelId: p.id, panelIndex: index });
|
|
70
|
+
}
|
|
71
|
+
emitDestroyed(p, index) {
|
|
72
|
+
this.destroyed.emit({ panelId: p.id, panelIndex: index });
|
|
73
|
+
}
|
|
74
|
+
onWidgetEvent(loc, ev) {
|
|
75
|
+
this.widgetEvent.emit({ ...loc, ...ev });
|
|
76
|
+
}
|
|
77
|
+
// Public API to control panels
|
|
78
|
+
open(indexOrId) {
|
|
79
|
+
const panel = this.findPanel(indexOrId);
|
|
80
|
+
panel?.open();
|
|
81
|
+
}
|
|
82
|
+
close(indexOrId) {
|
|
83
|
+
const panel = this.findPanel(indexOrId);
|
|
84
|
+
panel?.close();
|
|
85
|
+
}
|
|
86
|
+
toggle(indexOrId) {
|
|
87
|
+
const panel = this.findPanel(indexOrId);
|
|
88
|
+
panel?.toggle();
|
|
89
|
+
}
|
|
90
|
+
openAll() { this.accordionRef?.openAll(); }
|
|
91
|
+
closeAll() { this.accordionRef?.closeAll(); }
|
|
92
|
+
findPanel(indexOrId) {
|
|
93
|
+
if (!this.panels)
|
|
94
|
+
return undefined;
|
|
95
|
+
if (typeof indexOrId === 'number')
|
|
96
|
+
return this.panels.get(indexOrId);
|
|
97
|
+
const idx = (this.config?.panels || []).findIndex((p) => (p.id || this.panelDomId(p, 0)) === indexOrId);
|
|
98
|
+
return idx >= 0 ? this.panels.get(idx) : undefined;
|
|
99
|
+
}
|
|
100
|
+
panelDomId(p, index) {
|
|
101
|
+
const base = p?.id || `${this.expansionId || 'exp'}-panel-${index + 1}`;
|
|
102
|
+
return base.replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
103
|
+
}
|
|
104
|
+
openEditor() {
|
|
105
|
+
const ref = this.settings.open({
|
|
106
|
+
id: `praxis-expansion-editor:${this.expansionId || 'default'}`,
|
|
107
|
+
title: 'Configurar Painéis',
|
|
108
|
+
content: { component: PraxisExpansionConfigEditor, inputs: { config: this.config, expansionId: this.expansionId } },
|
|
109
|
+
});
|
|
110
|
+
const apply = (value) => {
|
|
111
|
+
const nextCfg = value?.config || value;
|
|
112
|
+
if (nextCfg) {
|
|
113
|
+
this.config = { ...nextCfg };
|
|
114
|
+
if (this.expansionId)
|
|
115
|
+
this.storage.saveConfig(this.storageKey(), this.config);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
ref.applied$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(apply);
|
|
119
|
+
ref.saved$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(apply);
|
|
120
|
+
}
|
|
121
|
+
storageKey() {
|
|
122
|
+
return `expansion:${this.expansionId}`;
|
|
123
|
+
}
|
|
124
|
+
emitAction(p, index, action) {
|
|
125
|
+
this.widgetEvent.emit({ panelId: p.id, panelIndex: index, sourceId: 'praxis-expansion', output: 'action', payload: { action } });
|
|
126
|
+
}
|
|
127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisExpansion, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
128
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: PraxisExpansion, isStandalone: true, selector: "praxis-expansion", inputs: { config: "config", expansionId: "expansionId", context: "context", strictValidation: "strictValidation", editModeEnabled: "editModeEnabled", defaultOptions: "defaultOptions" }, outputs: { opened: "opened", closed: "closed", expandedChange: "expandedChange", afterExpand: "afterExpand", afterCollapse: "afterCollapse", destroyed: "destroyed", widgetEvent: "widgetEvent" }, viewQueries: [{ propertyName: "accordionRef", first: true, predicate: ["accordion"], descendants: true }, { propertyName: "panels", predicate: ["panel"], descendants: true, read: MatExpansionPanel }], ngImport: i0, template: `
|
|
129
|
+
<div
|
|
130
|
+
class="praxis-expansion-root"
|
|
131
|
+
[class.density-compact]="config?.appearance?.density === 'compact'"
|
|
132
|
+
[class.density-comfortable]="config?.appearance?.density === 'comfortable'"
|
|
133
|
+
[class.density-spacious]="config?.appearance?.density === 'spacious'"
|
|
134
|
+
[ngClass]="config?.appearance?.themeClass || ''"
|
|
135
|
+
[attr.data-expansion-id]="expansionId || 'default'"
|
|
136
|
+
>
|
|
137
|
+
<style *ngIf="config?.appearance?.customCss" [innerHTML]="config?.appearance?.customCss"></style>
|
|
138
|
+
<style *ngIf="styleCss() as s" [innerHTML]="s"></style>
|
|
139
|
+
|
|
140
|
+
@if (hasMultiple()) {
|
|
141
|
+
<mat-accordion
|
|
142
|
+
#accordion
|
|
143
|
+
[id]="config?.accordion?.id || ''"
|
|
144
|
+
[multi]="config?.accordion?.multi || false"
|
|
145
|
+
[displayMode]="config?.accordion?.displayMode || 'default'"
|
|
146
|
+
[togglePosition]="config?.accordion?.togglePosition || 'after'"
|
|
147
|
+
[hideToggle]="config?.accordion?.hideToggle || false"
|
|
148
|
+
>
|
|
149
|
+
@for (p of (config?.panels || []); let i = $index; track p.id ?? i) {
|
|
150
|
+
@let id = panelDomId(p, i);
|
|
151
|
+
<mat-expansion-panel
|
|
152
|
+
#panel
|
|
153
|
+
[id]="id"
|
|
154
|
+
[disabled]="p.disabled || false"
|
|
155
|
+
[expanded]="p.expanded || false"
|
|
156
|
+
[hideToggle]="p.hideToggle ?? config?.accordion?.hideToggle ?? false"
|
|
157
|
+
(opened)="emitOpened(p, i)"
|
|
158
|
+
(closed)="emitClosed(p, i)"
|
|
159
|
+
(expandedChange)="emitExpandedChange(p, i, $event)"
|
|
160
|
+
(afterExpand)="emitAfterExpand(p, i)"
|
|
161
|
+
(afterCollapse)="emitAfterCollapse(p, i)"
|
|
162
|
+
(destroyed)="emitDestroyed(p, i)"
|
|
163
|
+
>
|
|
164
|
+
<mat-expansion-panel-header
|
|
165
|
+
[collapsedHeight]="p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''"
|
|
166
|
+
[expandedHeight]="p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''"
|
|
167
|
+
>
|
|
168
|
+
<mat-panel-title>{{ p.title }}</mat-panel-title>
|
|
169
|
+
<mat-panel-description *ngIf="p.description">{{ p.description }}</mat-panel-description>
|
|
170
|
+
</mat-expansion-panel-header>
|
|
171
|
+
|
|
172
|
+
<ng-template matExpansionPanelContent>
|
|
173
|
+
@if (p.widgets?.length) {
|
|
174
|
+
@for (w of p.widgets; let wi = $index; track wi) {
|
|
175
|
+
<ng-container
|
|
176
|
+
[dynamicWidgetLoader]="w"
|
|
177
|
+
[context]="context"
|
|
178
|
+
[strictValidation]="strictValidation"
|
|
179
|
+
(widgetEvent)="onWidgetEvent({ panelId: p.id, panelIndex: i }, $event)"
|
|
180
|
+
></ng-container>
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@if (p.actionButtons?.length) {
|
|
185
|
+
<mat-action-row>
|
|
186
|
+
@for (a of p.actionButtons; track a.label) {
|
|
187
|
+
<button mat-stroked-button (click)="emitAction(p, i, a.action)">
|
|
188
|
+
<mat-icon *ngIf="a.icon" [praxisIcon]="a.icon"></mat-icon>
|
|
189
|
+
{{ a.label }}
|
|
190
|
+
</button>
|
|
191
|
+
}
|
|
192
|
+
</mat-action-row>
|
|
193
|
+
}
|
|
194
|
+
</ng-template>
|
|
195
|
+
</mat-expansion-panel>
|
|
196
|
+
}
|
|
197
|
+
</mat-accordion>
|
|
198
|
+
} @else {
|
|
199
|
+
@if (single(); as p) {
|
|
200
|
+
<mat-expansion-panel
|
|
201
|
+
#panel
|
|
202
|
+
[id]="panelDomId(p, 0)"
|
|
203
|
+
[disabled]="p.disabled || false"
|
|
204
|
+
[expanded]="p.expanded || false"
|
|
205
|
+
[hideToggle]="p.hideToggle ?? config?.accordion?.hideToggle ?? false"
|
|
206
|
+
(opened)="emitOpened(p, 0)"
|
|
207
|
+
(closed)="emitClosed(p, 0)"
|
|
208
|
+
(expandedChange)="emitExpandedChange(p, 0, $event)"
|
|
209
|
+
(afterExpand)="emitAfterExpand(p, 0)"
|
|
210
|
+
(afterCollapse)="emitAfterCollapse(p, 0)"
|
|
211
|
+
(destroyed)="emitDestroyed(p, 0)"
|
|
212
|
+
>
|
|
213
|
+
<mat-expansion-panel-header
|
|
214
|
+
[collapsedHeight]="p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''"
|
|
215
|
+
[expandedHeight]="p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''"
|
|
216
|
+
>
|
|
217
|
+
<mat-panel-title>{{ p.title }}</mat-panel-title>
|
|
218
|
+
<mat-panel-description *ngIf="p.description">{{ p.description }}</mat-panel-description>
|
|
219
|
+
</mat-expansion-panel-header>
|
|
220
|
+
|
|
221
|
+
<ng-template matExpansionPanelContent>
|
|
222
|
+
@if (p.widgets?.length) {
|
|
223
|
+
@for (w of p.widgets; let wi = $index; track wi) {
|
|
224
|
+
<ng-container
|
|
225
|
+
[dynamicWidgetLoader]="w"
|
|
226
|
+
[context]="context"
|
|
227
|
+
[strictValidation]="strictValidation"
|
|
228
|
+
(widgetEvent)="onWidgetEvent({ panelId: p.id, panelIndex: 0 }, $event)"
|
|
229
|
+
></ng-container>
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@if (p.actionButtons?.length) {
|
|
234
|
+
<mat-action-row>
|
|
235
|
+
@for (a of p.actionButtons; track a.label) {
|
|
236
|
+
<button mat-stroked-button (click)="emitAction(p, 0, a.action)">
|
|
237
|
+
<mat-icon *ngIf="a.icon" [praxisIcon]="a.icon"></mat-icon>
|
|
238
|
+
{{ a.label }}
|
|
239
|
+
</button>
|
|
240
|
+
}
|
|
241
|
+
</mat-action-row>
|
|
242
|
+
}
|
|
243
|
+
</ng-template>
|
|
244
|
+
</mat-expansion-panel>
|
|
245
|
+
} @else {
|
|
246
|
+
<div class="praxis-expansion-empty">
|
|
247
|
+
<span>Nenhum painel configurado</span>
|
|
248
|
+
<button mat-stroked-button color="primary" *ngIf="editModeEnabled" (click)="openEditor()">
|
|
249
|
+
<mat-icon [praxisIcon]="'tune'"></mat-icon> Configurar
|
|
250
|
+
</button>
|
|
251
|
+
</div>
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
</div>
|
|
255
|
+
<!-- Edit button -->
|
|
256
|
+
<button
|
|
257
|
+
*ngIf="editModeEnabled"
|
|
258
|
+
mat-fab
|
|
259
|
+
class="edit-fab"
|
|
260
|
+
aria-label="Editar painéis"
|
|
261
|
+
(click)="openEditor()"
|
|
262
|
+
>
|
|
263
|
+
<mat-icon fontIcon="edit"></mat-icon>
|
|
264
|
+
</button>
|
|
265
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.praxis-expansion-root{display:block}.praxis-expansion-empty{display:flex;gap:8px;align-items:center;padding:8px;opacity:.8}.edit-fab{position:absolute;right:12px;bottom:12px;z-index:2}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i2.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "directive", type: i2.MatExpansionPanelActionRow, selector: "mat-action-row" }, { kind: "component", type: i2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i2.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "directive", type: i2.MatExpansionPanelContent, selector: "ng-template[matExpansionPanelContent]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: DynamicWidgetLoaderDirective, selector: "[dynamicWidgetLoader]", inputs: ["dynamicWidgetLoader", "context", "strictValidation", "autoWireOutputs"], outputs: ["widgetEvent"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
266
|
+
}
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisExpansion, decorators: [{
|
|
268
|
+
type: Component,
|
|
269
|
+
args: [{ selector: 'praxis-expansion', standalone: true, imports: [
|
|
270
|
+
CommonModule,
|
|
271
|
+
MatExpansionModule,
|
|
272
|
+
MatIconModule,
|
|
273
|
+
MatButtonModule,
|
|
274
|
+
DynamicWidgetLoaderDirective,
|
|
275
|
+
PraxisIconDirective,
|
|
276
|
+
], template: `
|
|
277
|
+
<div
|
|
278
|
+
class="praxis-expansion-root"
|
|
279
|
+
[class.density-compact]="config?.appearance?.density === 'compact'"
|
|
280
|
+
[class.density-comfortable]="config?.appearance?.density === 'comfortable'"
|
|
281
|
+
[class.density-spacious]="config?.appearance?.density === 'spacious'"
|
|
282
|
+
[ngClass]="config?.appearance?.themeClass || ''"
|
|
283
|
+
[attr.data-expansion-id]="expansionId || 'default'"
|
|
284
|
+
>
|
|
285
|
+
<style *ngIf="config?.appearance?.customCss" [innerHTML]="config?.appearance?.customCss"></style>
|
|
286
|
+
<style *ngIf="styleCss() as s" [innerHTML]="s"></style>
|
|
287
|
+
|
|
288
|
+
@if (hasMultiple()) {
|
|
289
|
+
<mat-accordion
|
|
290
|
+
#accordion
|
|
291
|
+
[id]="config?.accordion?.id || ''"
|
|
292
|
+
[multi]="config?.accordion?.multi || false"
|
|
293
|
+
[displayMode]="config?.accordion?.displayMode || 'default'"
|
|
294
|
+
[togglePosition]="config?.accordion?.togglePosition || 'after'"
|
|
295
|
+
[hideToggle]="config?.accordion?.hideToggle || false"
|
|
296
|
+
>
|
|
297
|
+
@for (p of (config?.panels || []); let i = $index; track p.id ?? i) {
|
|
298
|
+
@let id = panelDomId(p, i);
|
|
299
|
+
<mat-expansion-panel
|
|
300
|
+
#panel
|
|
301
|
+
[id]="id"
|
|
302
|
+
[disabled]="p.disabled || false"
|
|
303
|
+
[expanded]="p.expanded || false"
|
|
304
|
+
[hideToggle]="p.hideToggle ?? config?.accordion?.hideToggle ?? false"
|
|
305
|
+
(opened)="emitOpened(p, i)"
|
|
306
|
+
(closed)="emitClosed(p, i)"
|
|
307
|
+
(expandedChange)="emitExpandedChange(p, i, $event)"
|
|
308
|
+
(afterExpand)="emitAfterExpand(p, i)"
|
|
309
|
+
(afterCollapse)="emitAfterCollapse(p, i)"
|
|
310
|
+
(destroyed)="emitDestroyed(p, i)"
|
|
311
|
+
>
|
|
312
|
+
<mat-expansion-panel-header
|
|
313
|
+
[collapsedHeight]="p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''"
|
|
314
|
+
[expandedHeight]="p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''"
|
|
315
|
+
>
|
|
316
|
+
<mat-panel-title>{{ p.title }}</mat-panel-title>
|
|
317
|
+
<mat-panel-description *ngIf="p.description">{{ p.description }}</mat-panel-description>
|
|
318
|
+
</mat-expansion-panel-header>
|
|
319
|
+
|
|
320
|
+
<ng-template matExpansionPanelContent>
|
|
321
|
+
@if (p.widgets?.length) {
|
|
322
|
+
@for (w of p.widgets; let wi = $index; track wi) {
|
|
323
|
+
<ng-container
|
|
324
|
+
[dynamicWidgetLoader]="w"
|
|
325
|
+
[context]="context"
|
|
326
|
+
[strictValidation]="strictValidation"
|
|
327
|
+
(widgetEvent)="onWidgetEvent({ panelId: p.id, panelIndex: i }, $event)"
|
|
328
|
+
></ng-container>
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@if (p.actionButtons?.length) {
|
|
333
|
+
<mat-action-row>
|
|
334
|
+
@for (a of p.actionButtons; track a.label) {
|
|
335
|
+
<button mat-stroked-button (click)="emitAction(p, i, a.action)">
|
|
336
|
+
<mat-icon *ngIf="a.icon" [praxisIcon]="a.icon"></mat-icon>
|
|
337
|
+
{{ a.label }}
|
|
338
|
+
</button>
|
|
339
|
+
}
|
|
340
|
+
</mat-action-row>
|
|
341
|
+
}
|
|
342
|
+
</ng-template>
|
|
343
|
+
</mat-expansion-panel>
|
|
344
|
+
}
|
|
345
|
+
</mat-accordion>
|
|
346
|
+
} @else {
|
|
347
|
+
@if (single(); as p) {
|
|
348
|
+
<mat-expansion-panel
|
|
349
|
+
#panel
|
|
350
|
+
[id]="panelDomId(p, 0)"
|
|
351
|
+
[disabled]="p.disabled || false"
|
|
352
|
+
[expanded]="p.expanded || false"
|
|
353
|
+
[hideToggle]="p.hideToggle ?? config?.accordion?.hideToggle ?? false"
|
|
354
|
+
(opened)="emitOpened(p, 0)"
|
|
355
|
+
(closed)="emitClosed(p, 0)"
|
|
356
|
+
(expandedChange)="emitExpandedChange(p, 0, $event)"
|
|
357
|
+
(afterExpand)="emitAfterExpand(p, 0)"
|
|
358
|
+
(afterCollapse)="emitAfterCollapse(p, 0)"
|
|
359
|
+
(destroyed)="emitDestroyed(p, 0)"
|
|
360
|
+
>
|
|
361
|
+
<mat-expansion-panel-header
|
|
362
|
+
[collapsedHeight]="p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''"
|
|
363
|
+
[expandedHeight]="p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''"
|
|
364
|
+
>
|
|
365
|
+
<mat-panel-title>{{ p.title }}</mat-panel-title>
|
|
366
|
+
<mat-panel-description *ngIf="p.description">{{ p.description }}</mat-panel-description>
|
|
367
|
+
</mat-expansion-panel-header>
|
|
368
|
+
|
|
369
|
+
<ng-template matExpansionPanelContent>
|
|
370
|
+
@if (p.widgets?.length) {
|
|
371
|
+
@for (w of p.widgets; let wi = $index; track wi) {
|
|
372
|
+
<ng-container
|
|
373
|
+
[dynamicWidgetLoader]="w"
|
|
374
|
+
[context]="context"
|
|
375
|
+
[strictValidation]="strictValidation"
|
|
376
|
+
(widgetEvent)="onWidgetEvent({ panelId: p.id, panelIndex: 0 }, $event)"
|
|
377
|
+
></ng-container>
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@if (p.actionButtons?.length) {
|
|
382
|
+
<mat-action-row>
|
|
383
|
+
@for (a of p.actionButtons; track a.label) {
|
|
384
|
+
<button mat-stroked-button (click)="emitAction(p, 0, a.action)">
|
|
385
|
+
<mat-icon *ngIf="a.icon" [praxisIcon]="a.icon"></mat-icon>
|
|
386
|
+
{{ a.label }}
|
|
387
|
+
</button>
|
|
388
|
+
}
|
|
389
|
+
</mat-action-row>
|
|
390
|
+
}
|
|
391
|
+
</ng-template>
|
|
392
|
+
</mat-expansion-panel>
|
|
393
|
+
} @else {
|
|
394
|
+
<div class="praxis-expansion-empty">
|
|
395
|
+
<span>Nenhum painel configurado</span>
|
|
396
|
+
<button mat-stroked-button color="primary" *ngIf="editModeEnabled" (click)="openEditor()">
|
|
397
|
+
<mat-icon [praxisIcon]="'tune'"></mat-icon> Configurar
|
|
398
|
+
</button>
|
|
399
|
+
</div>
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
</div>
|
|
403
|
+
<!-- Edit button -->
|
|
404
|
+
<button
|
|
405
|
+
*ngIf="editModeEnabled"
|
|
406
|
+
mat-fab
|
|
407
|
+
class="edit-fab"
|
|
408
|
+
aria-label="Editar painéis"
|
|
409
|
+
(click)="openEditor()"
|
|
410
|
+
>
|
|
411
|
+
<mat-icon fontIcon="edit"></mat-icon>
|
|
412
|
+
</button>
|
|
413
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;position:relative}.praxis-expansion-root{display:block}.praxis-expansion-empty{display:flex;gap:8px;align-items:center;padding:8px;opacity:.8}.edit-fab{position:absolute;right:12px;bottom:12px;z-index:2}\n"] }]
|
|
414
|
+
}], propDecorators: { config: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], expansionId: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}], context: [{
|
|
419
|
+
type: Input
|
|
420
|
+
}], strictValidation: [{
|
|
421
|
+
type: Input
|
|
422
|
+
}], editModeEnabled: [{
|
|
423
|
+
type: Input
|
|
424
|
+
}], defaultOptions: [{
|
|
425
|
+
type: Input
|
|
426
|
+
}], opened: [{
|
|
427
|
+
type: Output
|
|
428
|
+
}], closed: [{
|
|
429
|
+
type: Output
|
|
430
|
+
}], expandedChange: [{
|
|
431
|
+
type: Output
|
|
432
|
+
}], afterExpand: [{
|
|
433
|
+
type: Output
|
|
434
|
+
}], afterCollapse: [{
|
|
435
|
+
type: Output
|
|
436
|
+
}], destroyed: [{
|
|
437
|
+
type: Output
|
|
438
|
+
}], widgetEvent: [{
|
|
439
|
+
type: Output
|
|
440
|
+
}], accordionRef: [{
|
|
441
|
+
type: ViewChild,
|
|
442
|
+
args: ['accordion']
|
|
443
|
+
}], panels: [{
|
|
444
|
+
type: ViewChildren,
|
|
445
|
+
args: ['panel', { read: MatExpansionPanel }]
|
|
446
|
+
}] } });
|
|
447
|
+
// Minimal editor component (standalone)
|
|
448
|
+
class PraxisExpansionConfigEditor {
|
|
449
|
+
config;
|
|
450
|
+
expansionId;
|
|
451
|
+
addPanel() {
|
|
452
|
+
const next = { ...(this.config || {}), panels: [...(this.config?.panels || []), { title: 'Novo painel' }] };
|
|
453
|
+
this.config = next;
|
|
454
|
+
}
|
|
455
|
+
removePanel(index) {
|
|
456
|
+
if (!this.config?.panels)
|
|
457
|
+
return;
|
|
458
|
+
const next = { ...this.config, panels: this.config.panels.filter((_, i) => i !== index) };
|
|
459
|
+
this.config = next;
|
|
460
|
+
}
|
|
461
|
+
move(index, delta) {
|
|
462
|
+
if (!this.config?.panels)
|
|
463
|
+
return;
|
|
464
|
+
const arr = [...this.config.panels];
|
|
465
|
+
const to = index + delta;
|
|
466
|
+
if (to < 0 || to >= arr.length)
|
|
467
|
+
return;
|
|
468
|
+
const [m] = arr.splice(index, 1);
|
|
469
|
+
arr.splice(to, 0, m);
|
|
470
|
+
this.config = { ...(this.config || {}), panels: arr };
|
|
471
|
+
}
|
|
472
|
+
setAccordion(key, value) {
|
|
473
|
+
const acc = { ...(this.config?.accordion || {}) };
|
|
474
|
+
acc[key] = value;
|
|
475
|
+
this.config = { ...(this.config || {}), accordion: acc };
|
|
476
|
+
}
|
|
477
|
+
setPanel(index, key, value) {
|
|
478
|
+
if (!this.config?.panels)
|
|
479
|
+
return;
|
|
480
|
+
const arr = this.config.panels.map((p, i) => i === index ? { ...p, [key]: value } : p);
|
|
481
|
+
this.config = { ...(this.config || {}), panels: arr };
|
|
482
|
+
}
|
|
483
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisExpansionConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
484
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: PraxisExpansionConfigEditor, isStandalone: true, selector: "praxis-expansion-config-editor", inputs: { config: "config", expansionId: "expansionId" }, ngImport: i0, template: `
|
|
485
|
+
<div class="pdx-expansion-editor">
|
|
486
|
+
<section class="sec">
|
|
487
|
+
<h4>Configuração do Acordeão</h4>
|
|
488
|
+
<div class="grid">
|
|
489
|
+
<label>
|
|
490
|
+
<span>ID</span>
|
|
491
|
+
<input type="text" [value]="config?.accordion?.id || ''" (input)="setAccordion('id', $any($event.target).value)" />
|
|
492
|
+
</label>
|
|
493
|
+
<label>
|
|
494
|
+
<span>Display Mode</span>
|
|
495
|
+
<select [value]="config?.accordion?.displayMode || 'default'" (change)="setAccordion('displayMode', $any($event.target).value)">
|
|
496
|
+
<option value="default">default</option>
|
|
497
|
+
<option value="flat">flat</option>
|
|
498
|
+
</select>
|
|
499
|
+
</label>
|
|
500
|
+
<label>
|
|
501
|
+
<span>Toggle Position</span>
|
|
502
|
+
<select [value]="config?.accordion?.togglePosition || 'after'" (change)="setAccordion('togglePosition', $any($event.target).value)">
|
|
503
|
+
<option value="after">after</option>
|
|
504
|
+
<option value="before">before</option>
|
|
505
|
+
</select>
|
|
506
|
+
</label>
|
|
507
|
+
<label class="chk"><input type="checkbox" [checked]="config?.accordion?.multi || false" (change)="setAccordion('multi', $any($event.target).checked)"/> Multi</label>
|
|
508
|
+
<label class="chk"><input type="checkbox" [checked]="config?.accordion?.hideToggle || false" (change)="setAccordion('hideToggle', $any($event.target).checked)"/> Hide Toggle</label>
|
|
509
|
+
</div>
|
|
510
|
+
<div class="row">
|
|
511
|
+
<button mat-stroked-button color="primary" (click)="addPanel()"><mat-icon [praxisIcon]="'add'"></mat-icon> Adicionar painel</button>
|
|
512
|
+
</div>
|
|
513
|
+
</section>
|
|
514
|
+
|
|
515
|
+
<section class="sec" *ngFor="let p of (config?.panels || []); let i = index">
|
|
516
|
+
<div class="panel-row">
|
|
517
|
+
<strong>{{ p.title || ('Painel ' + (i + 1)) }}</strong>
|
|
518
|
+
<span class="grow"></span>
|
|
519
|
+
<button mat-button (click)="move(i, -1)" [disabled]="i===0"><mat-icon [praxisIcon]="'arrow_upward'"></mat-icon> Mover</button>
|
|
520
|
+
<button mat-button (click)="move(i, 1)" [disabled]="i>=(config!.panels!.length-1)"><mat-icon [praxisIcon]="'arrow_downward'"></mat-icon> Mover</button>
|
|
521
|
+
<button mat-button color="warn" (click)="removePanel(i)"><mat-icon [praxisIcon]="'delete'"></mat-icon> Remover</button>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="grid">
|
|
524
|
+
<label><span>Id</span><input type="text" [value]="p.id || ''" (input)="setPanel(i, 'id', $any($event.target).value)" /></label>
|
|
525
|
+
<label><span>Título</span><input type="text" [value]="p.title || ''" (input)="setPanel(i, 'title', $any($event.target).value)" /></label>
|
|
526
|
+
<label><span>Descrição</span><input type="text" [value]="p.description || ''" (input)="setPanel(i, 'description', $any($event.target).value)" /></label>
|
|
527
|
+
<label><span>Collapsed Height</span><input type="text" placeholder="48px" [value]="p.collapsedHeight || ''" (input)="setPanel(i, 'collapsedHeight', $any($event.target).value)" /></label>
|
|
528
|
+
<label><span>Expanded Height</span><input type="text" placeholder="64px" [value]="p.expandedHeight || ''" (input)="setPanel(i, 'expandedHeight', $any($event.target).value)" /></label>
|
|
529
|
+
<label class="chk"><input type="checkbox" [checked]="p.disabled || false" (change)="setPanel(i, 'disabled', $any($event.target).checked)"/> Disabled</label>
|
|
530
|
+
<label class="chk"><input type="checkbox" [checked]="p.expanded || false" (change)="setPanel(i, 'expanded', $any($event.target).checked)"/> Expanded</label>
|
|
531
|
+
<label class="chk"><input type="checkbox" [checked]="p.hideToggle || false" (change)="setPanel(i, 'hideToggle', $any($event.target).checked)"/> Hide Toggle</label>
|
|
532
|
+
</div>
|
|
533
|
+
</section>
|
|
534
|
+
</div>
|
|
535
|
+
`, isInline: true, styles: [".pdx-expansion-editor{display:grid;gap:16px}.sec{border:1px dashed rgba(0,0,0,.12);padding:12px;border-radius:8px}.row{display:flex;gap:8px;align-items:center}.panel-row{display:flex;gap:8px;align-items:center;width:100%}.grow{flex:1 1 auto}.grid{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:8px;align-items:center}label{display:flex;flex-direction:column;gap:4px;font-size:12px}label.chk{flex-direction:row;align-items:center;gap:6px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
536
|
+
}
|
|
537
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisExpansionConfigEditor, decorators: [{
|
|
538
|
+
type: Component,
|
|
539
|
+
args: [{ selector: 'praxis-expansion-config-editor', standalone: true, imports: [CommonModule, MatButtonModule, MatIconModule, PraxisIconDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
540
|
+
<div class="pdx-expansion-editor">
|
|
541
|
+
<section class="sec">
|
|
542
|
+
<h4>Configuração do Acordeão</h4>
|
|
543
|
+
<div class="grid">
|
|
544
|
+
<label>
|
|
545
|
+
<span>ID</span>
|
|
546
|
+
<input type="text" [value]="config?.accordion?.id || ''" (input)="setAccordion('id', $any($event.target).value)" />
|
|
547
|
+
</label>
|
|
548
|
+
<label>
|
|
549
|
+
<span>Display Mode</span>
|
|
550
|
+
<select [value]="config?.accordion?.displayMode || 'default'" (change)="setAccordion('displayMode', $any($event.target).value)">
|
|
551
|
+
<option value="default">default</option>
|
|
552
|
+
<option value="flat">flat</option>
|
|
553
|
+
</select>
|
|
554
|
+
</label>
|
|
555
|
+
<label>
|
|
556
|
+
<span>Toggle Position</span>
|
|
557
|
+
<select [value]="config?.accordion?.togglePosition || 'after'" (change)="setAccordion('togglePosition', $any($event.target).value)">
|
|
558
|
+
<option value="after">after</option>
|
|
559
|
+
<option value="before">before</option>
|
|
560
|
+
</select>
|
|
561
|
+
</label>
|
|
562
|
+
<label class="chk"><input type="checkbox" [checked]="config?.accordion?.multi || false" (change)="setAccordion('multi', $any($event.target).checked)"/> Multi</label>
|
|
563
|
+
<label class="chk"><input type="checkbox" [checked]="config?.accordion?.hideToggle || false" (change)="setAccordion('hideToggle', $any($event.target).checked)"/> Hide Toggle</label>
|
|
564
|
+
</div>
|
|
565
|
+
<div class="row">
|
|
566
|
+
<button mat-stroked-button color="primary" (click)="addPanel()"><mat-icon [praxisIcon]="'add'"></mat-icon> Adicionar painel</button>
|
|
567
|
+
</div>
|
|
568
|
+
</section>
|
|
569
|
+
|
|
570
|
+
<section class="sec" *ngFor="let p of (config?.panels || []); let i = index">
|
|
571
|
+
<div class="panel-row">
|
|
572
|
+
<strong>{{ p.title || ('Painel ' + (i + 1)) }}</strong>
|
|
573
|
+
<span class="grow"></span>
|
|
574
|
+
<button mat-button (click)="move(i, -1)" [disabled]="i===0"><mat-icon [praxisIcon]="'arrow_upward'"></mat-icon> Mover</button>
|
|
575
|
+
<button mat-button (click)="move(i, 1)" [disabled]="i>=(config!.panels!.length-1)"><mat-icon [praxisIcon]="'arrow_downward'"></mat-icon> Mover</button>
|
|
576
|
+
<button mat-button color="warn" (click)="removePanel(i)"><mat-icon [praxisIcon]="'delete'"></mat-icon> Remover</button>
|
|
577
|
+
</div>
|
|
578
|
+
<div class="grid">
|
|
579
|
+
<label><span>Id</span><input type="text" [value]="p.id || ''" (input)="setPanel(i, 'id', $any($event.target).value)" /></label>
|
|
580
|
+
<label><span>Título</span><input type="text" [value]="p.title || ''" (input)="setPanel(i, 'title', $any($event.target).value)" /></label>
|
|
581
|
+
<label><span>Descrição</span><input type="text" [value]="p.description || ''" (input)="setPanel(i, 'description', $any($event.target).value)" /></label>
|
|
582
|
+
<label><span>Collapsed Height</span><input type="text" placeholder="48px" [value]="p.collapsedHeight || ''" (input)="setPanel(i, 'collapsedHeight', $any($event.target).value)" /></label>
|
|
583
|
+
<label><span>Expanded Height</span><input type="text" placeholder="64px" [value]="p.expandedHeight || ''" (input)="setPanel(i, 'expandedHeight', $any($event.target).value)" /></label>
|
|
584
|
+
<label class="chk"><input type="checkbox" [checked]="p.disabled || false" (change)="setPanel(i, 'disabled', $any($event.target).checked)"/> Disabled</label>
|
|
585
|
+
<label class="chk"><input type="checkbox" [checked]="p.expanded || false" (change)="setPanel(i, 'expanded', $any($event.target).checked)"/> Expanded</label>
|
|
586
|
+
<label class="chk"><input type="checkbox" [checked]="p.hideToggle || false" (change)="setPanel(i, 'hideToggle', $any($event.target).checked)"/> Hide Toggle</label>
|
|
587
|
+
</div>
|
|
588
|
+
</section>
|
|
589
|
+
</div>
|
|
590
|
+
`, styles: [".pdx-expansion-editor{display:grid;gap:16px}.sec{border:1px dashed rgba(0,0,0,.12);padding:12px;border-radius:8px}.row{display:flex;gap:8px;align-items:center}.panel-row{display:flex;gap:8px;align-items:center;width:100%}.grow{flex:1 1 auto}.grid{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:8px;align-items:center}label{display:flex;flex-direction:column;gap:4px;font-size:12px}label.chk{flex-direction:row;align-items:center;gap:6px}\n"] }]
|
|
591
|
+
}], propDecorators: { config: [{
|
|
592
|
+
type: Input
|
|
593
|
+
}], expansionId: [{
|
|
594
|
+
type: Input
|
|
595
|
+
}] } });
|
|
596
|
+
|
|
597
|
+
const PRAXIS_EXPANSION_COMPONENT_METADATA = {
|
|
598
|
+
id: 'praxis-expansion',
|
|
599
|
+
selector: 'praxis-expansion',
|
|
600
|
+
component: PraxisExpansion,
|
|
601
|
+
friendlyName: 'Praxis Expansion Panel',
|
|
602
|
+
description: 'Acordeão/Painéis de expansão configuráveis por metadata, baseados em Angular Material.',
|
|
603
|
+
icon: 'unfold_more',
|
|
604
|
+
inputs: [
|
|
605
|
+
{ name: 'config', type: 'ExpansionMetadata', label: 'Configuração', description: 'Configuração JSON (acordeão e painéis)' },
|
|
606
|
+
{ name: 'expansionId', type: 'string', label: 'ID', description: 'Identificador para persistência local' },
|
|
607
|
+
{ name: 'editModeEnabled', type: 'boolean', default: false, label: 'Modo de edição' },
|
|
608
|
+
{ name: 'context', type: 'Record<string, any>', label: 'Contexto' },
|
|
609
|
+
{ name: 'strictValidation', type: 'boolean', default: true },
|
|
610
|
+
{ name: 'defaultOptions', type: 'MatExpansionPanelDefaultOptions', label: 'Opções padrão do painel' },
|
|
611
|
+
],
|
|
612
|
+
outputs: [
|
|
613
|
+
{ name: 'opened', type: '{ panelId?: string; panelIndex: number }', label: 'Painel aberto' },
|
|
614
|
+
{ name: 'closed', type: '{ panelId?: string; panelIndex: number }', label: 'Painel fechado' },
|
|
615
|
+
{ name: 'expandedChange', type: '{ panelId?: string; panelIndex: number; expanded: boolean }', label: 'Alterou expansão' },
|
|
616
|
+
{ name: 'afterExpand', type: '{ panelId?: string; panelIndex: number }', label: 'Após expandir' },
|
|
617
|
+
{ name: 'afterCollapse', type: '{ panelId?: string; panelIndex: number }', label: 'Após colapsar' },
|
|
618
|
+
{ name: 'destroyed', type: '{ panelId?: string; panelIndex: number }', label: 'Destruído' },
|
|
619
|
+
{ name: 'widgetEvent', type: '{ panelId?: string; panelIndex?: number; sourceId: string; output?: string; payload?: any }', label: 'Evento interno' },
|
|
620
|
+
],
|
|
621
|
+
tags: ['widget', 'expansion', 'accordion', 'configurable'],
|
|
622
|
+
lib: '@praxisui/expansion',
|
|
623
|
+
};
|
|
624
|
+
function providePraxisExpansionMetadata() {
|
|
625
|
+
return {
|
|
626
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
627
|
+
multi: true,
|
|
628
|
+
useFactory: (registry) => () => {
|
|
629
|
+
registry.register(PRAXIS_EXPANSION_COMPONENT_METADATA);
|
|
630
|
+
},
|
|
631
|
+
deps: [ComponentMetadataRegistry],
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
function providePraxisExpansionDefaults(opts) {
|
|
635
|
+
return { provide: MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, useValue: opts };
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/*
|
|
639
|
+
* Public API Surface of praxis-expansion
|
|
640
|
+
*/
|
|
641
|
+
// Editor é exportado pelo mesmo arquivo de componente (praxis-expansion.ts)
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Generated bundle index. Do not edit.
|
|
645
|
+
*/
|
|
646
|
+
|
|
647
|
+
export { PRAXIS_EXPANSION_COMPONENT_METADATA, PraxisExpansion, PraxisExpansionConfigEditor, providePraxisExpansionDefaults, providePraxisExpansionMetadata };
|
|
648
|
+
//# sourceMappingURL=praxisui-expansion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"praxisui-expansion.mjs","sources":["../../../projects/praxis-expansion/src/lib/praxis-expansion.ts","../../../projects/praxis-expansion/src/lib/praxis-expansion.metadata.ts","../../../projects/praxis-expansion/src/public-api.ts","../../../projects/praxis-expansion/src/praxisui-expansion.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, Output, ChangeDetectionStrategy, ViewChild, ViewChildren, QueryList, inject, DestroyRef } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatAccordion, MatAccordionDisplayMode, MatAccordionTogglePosition, MatExpansionModule, MatExpansionPanel, MatExpansionPanelDefaultOptions, MAT_EXPANSION_PANEL_DEFAULT_OPTIONS } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DynamicWidgetLoaderDirective, WidgetDefinition, PraxisIconDirective } from '@praxisui/core';\nimport { SettingsPanelService } from '@praxisui/settings-panel';\nimport { CONFIG_STORAGE, ConfigStorage } from '@praxisui/core';\n\nexport interface ExpansionMetadata {\n appearance?: {\n density?: 'compact' | 'comfortable' | 'spacious';\n themeClass?: string;\n customCss?: string;\n tokens?: { [key: string]: string };\n };\n accordion?: {\n multi?: boolean;\n displayMode?: MatAccordionDisplayMode;\n togglePosition?: MatAccordionTogglePosition;\n hideToggle?: boolean;\n id?: string;\n };\n panels?: PanelMetadata[];\n}\n\nexport interface PanelMetadata {\n id?: string;\n title: string;\n description?: string;\n disabled?: boolean;\n expanded?: boolean;\n hideToggle?: boolean;\n collapsedHeight?: string;\n expandedHeight?: string;\n content?: any[]; // DynamicFieldMetadata[]\n widgets?: WidgetDefinition[];\n actionButtons?: Array<{ label: string; icon?: string; action?: string }>;\n}\n\n@Component({\n selector: 'praxis-expansion',\n standalone: true,\n imports: [\n CommonModule,\n MatExpansionModule,\n MatIconModule,\n MatButtonModule,\n DynamicWidgetLoaderDirective,\n PraxisIconDirective,\n ],\n template: `\n <div\n class=\"praxis-expansion-root\"\n [class.density-compact]=\"config?.appearance?.density === 'compact'\"\n [class.density-comfortable]=\"config?.appearance?.density === 'comfortable'\"\n [class.density-spacious]=\"config?.appearance?.density === 'spacious'\"\n [ngClass]=\"config?.appearance?.themeClass || ''\"\n [attr.data-expansion-id]=\"expansionId || 'default'\"\n >\n <style *ngIf=\"config?.appearance?.customCss\" [innerHTML]=\"config?.appearance?.customCss\"></style>\n <style *ngIf=\"styleCss() as s\" [innerHTML]=\"s\"></style>\n\n @if (hasMultiple()) {\n <mat-accordion\n #accordion\n [id]=\"config?.accordion?.id || ''\"\n [multi]=\"config?.accordion?.multi || false\"\n [displayMode]=\"config?.accordion?.displayMode || 'default'\"\n [togglePosition]=\"config?.accordion?.togglePosition || 'after'\"\n [hideToggle]=\"config?.accordion?.hideToggle || false\"\n >\n @for (p of (config?.panels || []); let i = $index; track p.id ?? i) {\n @let id = panelDomId(p, i);\n <mat-expansion-panel\n #panel\n [id]=\"id\"\n [disabled]=\"p.disabled || false\"\n [expanded]=\"p.expanded || false\"\n [hideToggle]=\"p.hideToggle ?? config?.accordion?.hideToggle ?? false\"\n (opened)=\"emitOpened(p, i)\"\n (closed)=\"emitClosed(p, i)\"\n (expandedChange)=\"emitExpandedChange(p, i, $event)\"\n (afterExpand)=\"emitAfterExpand(p, i)\"\n (afterCollapse)=\"emitAfterCollapse(p, i)\"\n (destroyed)=\"emitDestroyed(p, i)\"\n >\n <mat-expansion-panel-header\n [collapsedHeight]=\"p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''\"\n [expandedHeight]=\"p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''\"\n >\n <mat-panel-title>{{ p.title }}</mat-panel-title>\n <mat-panel-description *ngIf=\"p.description\">{{ p.description }}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-template matExpansionPanelContent>\n @if (p.widgets?.length) {\n @for (w of p.widgets; let wi = $index; track wi) {\n <ng-container\n [dynamicWidgetLoader]=\"w\"\n [context]=\"context\"\n [strictValidation]=\"strictValidation\"\n (widgetEvent)=\"onWidgetEvent({ panelId: p.id, panelIndex: i }, $event)\"\n ></ng-container>\n }\n }\n\n @if (p.actionButtons?.length) {\n <mat-action-row>\n @for (a of p.actionButtons; track a.label) {\n <button mat-stroked-button (click)=\"emitAction(p, i, a.action)\">\n <mat-icon *ngIf=\"a.icon\" [praxisIcon]=\"a.icon\"></mat-icon>\n {{ a.label }}\n </button>\n }\n </mat-action-row>\n }\n </ng-template>\n </mat-expansion-panel>\n }\n </mat-accordion>\n } @else {\n @if (single(); as p) {\n <mat-expansion-panel\n #panel\n [id]=\"panelDomId(p, 0)\"\n [disabled]=\"p.disabled || false\"\n [expanded]=\"p.expanded || false\"\n [hideToggle]=\"p.hideToggle ?? config?.accordion?.hideToggle ?? false\"\n (opened)=\"emitOpened(p, 0)\"\n (closed)=\"emitClosed(p, 0)\"\n (expandedChange)=\"emitExpandedChange(p, 0, $event)\"\n (afterExpand)=\"emitAfterExpand(p, 0)\"\n (afterCollapse)=\"emitAfterCollapse(p, 0)\"\n (destroyed)=\"emitDestroyed(p, 0)\"\n >\n <mat-expansion-panel-header\n [collapsedHeight]=\"p.collapsedHeight || (defaultOptions?.collapsedHeight || injectedDefaults?.collapsedHeight) || ''\"\n [expandedHeight]=\"p.expandedHeight || (defaultOptions?.expandedHeight || injectedDefaults?.expandedHeight) || ''\"\n >\n <mat-panel-title>{{ p.title }}</mat-panel-title>\n <mat-panel-description *ngIf=\"p.description\">{{ p.description }}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-template matExpansionPanelContent>\n @if (p.widgets?.length) {\n @for (w of p.widgets; let wi = $index; track wi) {\n <ng-container\n [dynamicWidgetLoader]=\"w\"\n [context]=\"context\"\n [strictValidation]=\"strictValidation\"\n (widgetEvent)=\"onWidgetEvent({ panelId: p.id, panelIndex: 0 }, $event)\"\n ></ng-container>\n }\n }\n\n @if (p.actionButtons?.length) {\n <mat-action-row>\n @for (a of p.actionButtons; track a.label) {\n <button mat-stroked-button (click)=\"emitAction(p, 0, a.action)\">\n <mat-icon *ngIf=\"a.icon\" [praxisIcon]=\"a.icon\"></mat-icon>\n {{ a.label }}\n </button>\n }\n </mat-action-row>\n }\n </ng-template>\n </mat-expansion-panel>\n } @else {\n <div class=\"praxis-expansion-empty\">\n <span>Nenhum painel configurado</span>\n <button mat-stroked-button color=\"primary\" *ngIf=\"editModeEnabled\" (click)=\"openEditor()\">\n <mat-icon [praxisIcon]=\"'tune'\"></mat-icon> Configurar\n </button>\n </div>\n }\n }\n </div>\n <!-- Edit button -->\n <button\n *ngIf=\"editModeEnabled\"\n mat-fab\n class=\"edit-fab\"\n aria-label=\"Editar painéis\"\n (click)=\"openEditor()\"\n >\n <mat-icon fontIcon=\"edit\"></mat-icon>\n </button>\n `,\n styles: [\n `\n :host { display: block; position: relative; }\n .praxis-expansion-root { display: block; }\n .praxis-expansion-empty { display: flex; gap: 8px; align-items: center; padding: 8px; opacity: 0.8; }\n .edit-fab { position: absolute; right: 12px; bottom: 12px; z-index: 2; }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PraxisExpansion {\n @Input() config?: ExpansionMetadata | null;\n @Input() expansionId?: string | null;\n @Input() context: Record<string, any> = {};\n @Input() strictValidation = true;\n @Input() editModeEnabled = false;\n @Input() defaultOptions?: MatExpansionPanelDefaultOptions;\n\n @Output() opened = new EventEmitter<{ panelId?: string; panelIndex: number }>();\n @Output() closed = new EventEmitter<{ panelId?: string; panelIndex: number }>();\n @Output() expandedChange = new EventEmitter<{ panelId?: string; panelIndex: number; expanded: boolean }>();\n @Output() afterExpand = new EventEmitter<{ panelId?: string; panelIndex: number }>();\n @Output() afterCollapse = new EventEmitter<{ panelId?: string; panelIndex: number }>();\n @Output() destroyed = new EventEmitter<{ panelId?: string; panelIndex: number }>();\n @Output() widgetEvent = new EventEmitter<{ panelId?: string; panelIndex?: number; sourceId: string; output?: string; payload?: any }>();\n\n private readonly settings = inject(SettingsPanelService);\n private readonly storage = inject<ConfigStorage>(CONFIG_STORAGE);\n private readonly destroyRef = inject(DestroyRef);\n @ViewChild('accordion') accordionRef?: MatAccordion;\n @ViewChildren('panel', { read: MatExpansionPanel }) panels?: QueryList<MatExpansionPanel>;\n injectedDefaults = inject(MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, { optional: true }) as MatExpansionPanelDefaultOptions | null;\n\n hasMultiple = () => (this.config?.panels?.length || 0) > 1;\n single = () => (this.config?.panels && this.config.panels[0]) || null;\n\n styleCss(): string | null {\n const t = this.config?.appearance?.tokens;\n if (!t) return null;\n const scope = `.praxis-expansion-root[data-expansion-id=\"${(this.expansionId || 'default').replace(/\"/g, '')}\"]`;\n const rules: string[] = [];\n const push = (selector: string, decls: string[]) => { rules.push(`${scope} ${selector}{${decls.join('')}}`); };\n // Example: header background color\n const bg = t['header-background-color'];\n if (bg) {\n const safe = /^#[0-9a-fA-F]{3,8}$/.test(bg) || /^var\\(--[\\w-]+\\)$/.test(bg);\n if (safe) {\n push(' .mat-expansion-panel-header', [`background-color:${bg}!important;`]);\n }\n }\n if (rules.length === 0) return null;\n return rules.join('\\n');\n }\n\n emitOpened(p: PanelMetadata, index: number): void {\n this.opened.emit({ panelId: p.id, panelIndex: index });\n }\n emitClosed(p: PanelMetadata, index: number): void {\n this.closed.emit({ panelId: p.id, panelIndex: index });\n }\n emitExpandedChange(p: PanelMetadata, index: number, expanded: boolean): void {\n this.expandedChange.emit({ panelId: p.id, panelIndex: index, expanded });\n }\n emitAfterExpand(p: PanelMetadata, index: number): void {\n this.afterExpand.emit({ panelId: p.id, panelIndex: index });\n }\n emitAfterCollapse(p: PanelMetadata, index: number): void {\n this.afterCollapse.emit({ panelId: p.id, panelIndex: index });\n }\n emitDestroyed(p: PanelMetadata, index: number): void {\n this.destroyed.emit({ panelId: p.id, panelIndex: index });\n }\n\n onWidgetEvent(loc: { panelId?: string; panelIndex?: number }, ev: { sourceId: string; output?: string; payload?: any }): void {\n this.widgetEvent.emit({ ...loc, ...ev });\n }\n\n // Public API to control panels\n open(indexOrId: number | string): void {\n const panel = this.findPanel(indexOrId);\n panel?.open();\n }\n close(indexOrId: number | string): void {\n const panel = this.findPanel(indexOrId);\n panel?.close();\n }\n toggle(indexOrId: number | string): void {\n const panel = this.findPanel(indexOrId);\n panel?.toggle();\n }\n openAll(): void { this.accordionRef?.openAll(); }\n closeAll(): void { this.accordionRef?.closeAll(); }\n\n private findPanel(indexOrId: number | string): MatExpansionPanel | undefined {\n if (!this.panels) return undefined;\n if (typeof indexOrId === 'number') return this.panels.get(indexOrId);\n const idx = (this.config?.panels || []).findIndex((p) => (p.id || this.panelDomId(p, 0)) === indexOrId);\n return idx >= 0 ? this.panels.get(idx) : undefined;\n }\n\n panelDomId(p: PanelMetadata | null, index: number): string {\n const base = p?.id || `${this.expansionId || 'exp'}-panel-${index + 1}`;\n return base.replace(/[^a-zA-Z0-9_-]/g, '-');\n }\n\n openEditor(): void {\n const ref = this.settings.open({\n id: `praxis-expansion-editor:${this.expansionId || 'default'}`,\n title: 'Configurar Painéis',\n content: { component: PraxisExpansionConfigEditor, inputs: { config: this.config, expansionId: this.expansionId } },\n });\n const apply = (value: any) => {\n const nextCfg: ExpansionMetadata = value?.config || value;\n if (nextCfg) {\n this.config = { ...nextCfg };\n if (this.expansionId) this.storage.saveConfig(this.storageKey(), this.config);\n }\n };\n ref.applied$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(apply);\n ref.saved$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(apply);\n }\n\n private storageKey(): string {\n return `expansion:${this.expansionId}`;\n }\n\n emitAction(p: PanelMetadata, index: number, action?: string | undefined): void {\n this.widgetEvent.emit({ panelId: p.id, panelIndex: index, sourceId: 'praxis-expansion', output: 'action', payload: { action } });\n }\n}\n\n// Minimal editor component (standalone)\n@Component({\n selector: 'praxis-expansion-config-editor',\n standalone: true,\n imports: [CommonModule, MatButtonModule, MatIconModule, PraxisIconDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"pdx-expansion-editor\">\n <section class=\"sec\">\n <h4>Configuração do Acordeão</h4>\n <div class=\"grid\">\n <label>\n <span>ID</span>\n <input type=\"text\" [value]=\"config?.accordion?.id || ''\" (input)=\"setAccordion('id', $any($event.target).value)\" />\n </label>\n <label>\n <span>Display Mode</span>\n <select [value]=\"config?.accordion?.displayMode || 'default'\" (change)=\"setAccordion('displayMode', $any($event.target).value)\">\n <option value=\"default\">default</option>\n <option value=\"flat\">flat</option>\n </select>\n </label>\n <label>\n <span>Toggle Position</span>\n <select [value]=\"config?.accordion?.togglePosition || 'after'\" (change)=\"setAccordion('togglePosition', $any($event.target).value)\">\n <option value=\"after\">after</option>\n <option value=\"before\">before</option>\n </select>\n </label>\n <label class=\"chk\"><input type=\"checkbox\" [checked]=\"config?.accordion?.multi || false\" (change)=\"setAccordion('multi', $any($event.target).checked)\"/> Multi</label>\n <label class=\"chk\"><input type=\"checkbox\" [checked]=\"config?.accordion?.hideToggle || false\" (change)=\"setAccordion('hideToggle', $any($event.target).checked)\"/> Hide Toggle</label>\n </div>\n <div class=\"row\">\n <button mat-stroked-button color=\"primary\" (click)=\"addPanel()\"><mat-icon [praxisIcon]=\"'add'\"></mat-icon> Adicionar painel</button>\n </div>\n </section>\n\n <section class=\"sec\" *ngFor=\"let p of (config?.panels || []); let i = index\">\n <div class=\"panel-row\">\n <strong>{{ p.title || ('Painel ' + (i + 1)) }}</strong>\n <span class=\"grow\"></span>\n <button mat-button (click)=\"move(i, -1)\" [disabled]=\"i===0\"><mat-icon [praxisIcon]=\"'arrow_upward'\"></mat-icon> Mover</button>\n <button mat-button (click)=\"move(i, 1)\" [disabled]=\"i>=(config!.panels!.length-1)\"><mat-icon [praxisIcon]=\"'arrow_downward'\"></mat-icon> Mover</button>\n <button mat-button color=\"warn\" (click)=\"removePanel(i)\"><mat-icon [praxisIcon]=\"'delete'\"></mat-icon> Remover</button>\n </div>\n <div class=\"grid\">\n <label><span>Id</span><input type=\"text\" [value]=\"p.id || ''\" (input)=\"setPanel(i, 'id', $any($event.target).value)\" /></label>\n <label><span>Título</span><input type=\"text\" [value]=\"p.title || ''\" (input)=\"setPanel(i, 'title', $any($event.target).value)\" /></label>\n <label><span>Descrição</span><input type=\"text\" [value]=\"p.description || ''\" (input)=\"setPanel(i, 'description', $any($event.target).value)\" /></label>\n <label><span>Collapsed Height</span><input type=\"text\" placeholder=\"48px\" [value]=\"p.collapsedHeight || ''\" (input)=\"setPanel(i, 'collapsedHeight', $any($event.target).value)\" /></label>\n <label><span>Expanded Height</span><input type=\"text\" placeholder=\"64px\" [value]=\"p.expandedHeight || ''\" (input)=\"setPanel(i, 'expandedHeight', $any($event.target).value)\" /></label>\n <label class=\"chk\"><input type=\"checkbox\" [checked]=\"p.disabled || false\" (change)=\"setPanel(i, 'disabled', $any($event.target).checked)\"/> Disabled</label>\n <label class=\"chk\"><input type=\"checkbox\" [checked]=\"p.expanded || false\" (change)=\"setPanel(i, 'expanded', $any($event.target).checked)\"/> Expanded</label>\n <label class=\"chk\"><input type=\"checkbox\" [checked]=\"p.hideToggle || false\" (change)=\"setPanel(i, 'hideToggle', $any($event.target).checked)\"/> Hide Toggle</label>\n </div>\n </section>\n </div>\n `,\n styles: [\n `\n .pdx-expansion-editor { display: grid; gap: 16px; }\n .sec { border: 1px dashed rgba(0,0,0,.12); padding: 12px; border-radius: 8px; }\n .row { display: flex; gap: 8px; align-items: center; }\n .panel-row { display: flex; gap: 8px; align-items: center; width: 100%; }\n .grow { flex: 1 1 auto; }\n .grid { display: grid; grid-template-columns: repeat(2, minmax(180px,1fr)); gap: 8px; align-items: center; }\n label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }\n label.chk { flex-direction: row; align-items: center; gap: 6px; }\n `,\n ],\n})\nexport class PraxisExpansionConfigEditor {\n @Input() config: ExpansionMetadata | null | undefined;\n @Input() expansionId?: string | null;\n\n addPanel(): void {\n const next = { ...(this.config || {}), panels: [...(this.config?.panels || []), { title: 'Novo painel' } as PanelMetadata] };\n this.config = next;\n }\n\n removePanel(index: number): void {\n if (!this.config?.panels) return;\n const next = { ...this.config, panels: this.config.panels.filter((_, i) => i !== index) };\n this.config = next;\n }\n\n move(index: number, delta: number): void {\n if (!this.config?.panels) return;\n const arr = [...this.config.panels];\n const to = index + delta;\n if (to < 0 || to >= arr.length) return;\n const [m] = arr.splice(index, 1);\n arr.splice(to, 0, m);\n this.config = { ...(this.config || {}), panels: arr };\n }\n\n setAccordion<K extends keyof NonNullable<ExpansionMetadata['accordion']>>(key: K, value: any): void {\n const acc = { ...(this.config?.accordion || {}) } as any;\n acc[key] = value;\n this.config = { ...(this.config || {}), accordion: acc } as ExpansionMetadata;\n }\n\n setPanel(index: number, key: keyof PanelMetadata, value: any): void {\n if (!this.config?.panels) return;\n const arr = this.config.panels.map((p, i) => i === index ? ({ ...p, [key]: value } as PanelMetadata) : p);\n this.config = { ...(this.config || {}), panels: arr };\n }\n}\n","import { ComponentDocMeta, ComponentMetadataRegistry } from '@praxisui/core';\nimport { ENVIRONMENT_INITIALIZER, Provider } from '@angular/core';\nimport { MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, MatExpansionPanelDefaultOptions } from '@angular/material/expansion';\nimport { PraxisExpansion } from './praxis-expansion';\n\nexport const PRAXIS_EXPANSION_COMPONENT_METADATA: ComponentDocMeta = {\n id: 'praxis-expansion',\n selector: 'praxis-expansion',\n component: PraxisExpansion,\n friendlyName: 'Praxis Expansion Panel',\n description: 'Acordeão/Painéis de expansão configuráveis por metadata, baseados em Angular Material.',\n icon: 'unfold_more',\n inputs: [\n { name: 'config', type: 'ExpansionMetadata', label: 'Configuração', description: 'Configuração JSON (acordeão e painéis)' },\n { name: 'expansionId', type: 'string', label: 'ID', description: 'Identificador para persistência local' },\n { name: 'editModeEnabled', type: 'boolean', default: false, label: 'Modo de edição' },\n { name: 'context', type: 'Record<string, any>', label: 'Contexto' },\n { name: 'strictValidation', type: 'boolean', default: true },\n { name: 'defaultOptions', type: 'MatExpansionPanelDefaultOptions', label: 'Opções padrão do painel' },\n ],\n outputs: [\n { name: 'opened', type: '{ panelId?: string; panelIndex: number }', label: 'Painel aberto' },\n { name: 'closed', type: '{ panelId?: string; panelIndex: number }', label: 'Painel fechado' },\n { name: 'expandedChange', type: '{ panelId?: string; panelIndex: number; expanded: boolean }', label: 'Alterou expansão' },\n { name: 'afterExpand', type: '{ panelId?: string; panelIndex: number }', label: 'Após expandir' },\n { name: 'afterCollapse', type: '{ panelId?: string; panelIndex: number }', label: 'Após colapsar' },\n { name: 'destroyed', type: '{ panelId?: string; panelIndex: number }', label: 'Destruído' },\n { name: 'widgetEvent', type: '{ panelId?: string; panelIndex?: number; sourceId: string; output?: string; payload?: any }', label: 'Evento interno' },\n ],\n tags: ['widget', 'expansion', 'accordion', 'configurable'],\n lib: '@praxisui/expansion',\n};\n\nexport function providePraxisExpansionMetadata(): Provider {\n return {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: (registry: ComponentMetadataRegistry) => () => {\n registry.register(PRAXIS_EXPANSION_COMPONENT_METADATA);\n },\n deps: [ComponentMetadataRegistry],\n } as Provider;\n}\n\nexport function providePraxisExpansionDefaults(opts: MatExpansionPanelDefaultOptions): Provider {\n return { provide: MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, useValue: opts } as Provider;\n}\n","/*\n * Public API Surface of praxis-expansion\n */\n\nexport * from './lib/praxis-expansion';\nexport * from './lib/praxis-expansion.metadata';\n// Editor é exportado pelo mesmo arquivo de componente (praxis-expansion.ts)\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAwMa,eAAe,CAAA;AACjB,IAAA,MAAM;AACN,IAAA,WAAW;IACX,OAAO,GAAwB,EAAE;IACjC,gBAAgB,GAAG,IAAI;IACvB,eAAe,GAAG,KAAK;AACvB,IAAA,cAAc;AAEb,IAAA,MAAM,GAAG,IAAI,YAAY,EAA4C;AACrE,IAAA,MAAM,GAAG,IAAI,YAAY,EAA4C;AACrE,IAAA,cAAc,GAAG,IAAI,YAAY,EAA+D;AAChG,IAAA,WAAW,GAAG,IAAI,YAAY,EAA4C;AAC1E,IAAA,aAAa,GAAG,IAAI,YAAY,EAA4C;AAC5E,IAAA,SAAS,GAAG,IAAI,YAAY,EAA4C;AACxE,IAAA,WAAW,GAAG,IAAI,YAAY,EAA+F;AAEtH,IAAA,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACvC,IAAA,OAAO,GAAG,MAAM,CAAgB,cAAc,CAAC;AAC/C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACxB,IAAA,YAAY;AACgB,IAAA,MAAM;IAC1D,gBAAgB,GAAG,MAAM,CAAC,mCAAmC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAA2C;AAE5H,IAAA,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC;IAC1D,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI;IAErE,QAAQ,GAAA;QACN,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,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;ACNA;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, QueryList, Provider } from '@angular/core';
|
|
3
|
+
import { MatAccordionDisplayMode, MatAccordionTogglePosition, MatExpansionPanelDefaultOptions, MatAccordion, MatExpansionPanel } from '@angular/material/expansion';
|
|
4
|
+
import { WidgetDefinition, ComponentDocMeta } from '@praxisui/core';
|
|
5
|
+
|
|
6
|
+
interface ExpansionMetadata {
|
|
7
|
+
appearance?: {
|
|
8
|
+
density?: 'compact' | 'comfortable' | 'spacious';
|
|
9
|
+
themeClass?: string;
|
|
10
|
+
customCss?: string;
|
|
11
|
+
tokens?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
accordion?: {
|
|
16
|
+
multi?: boolean;
|
|
17
|
+
displayMode?: MatAccordionDisplayMode;
|
|
18
|
+
togglePosition?: MatAccordionTogglePosition;
|
|
19
|
+
hideToggle?: boolean;
|
|
20
|
+
id?: string;
|
|
21
|
+
};
|
|
22
|
+
panels?: PanelMetadata[];
|
|
23
|
+
}
|
|
24
|
+
interface PanelMetadata {
|
|
25
|
+
id?: string;
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
expanded?: boolean;
|
|
30
|
+
hideToggle?: boolean;
|
|
31
|
+
collapsedHeight?: string;
|
|
32
|
+
expandedHeight?: string;
|
|
33
|
+
content?: any[];
|
|
34
|
+
widgets?: WidgetDefinition[];
|
|
35
|
+
actionButtons?: Array<{
|
|
36
|
+
label: string;
|
|
37
|
+
icon?: string;
|
|
38
|
+
action?: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
declare class PraxisExpansion {
|
|
42
|
+
config?: ExpansionMetadata | null;
|
|
43
|
+
expansionId?: string | null;
|
|
44
|
+
context: Record<string, any>;
|
|
45
|
+
strictValidation: boolean;
|
|
46
|
+
editModeEnabled: boolean;
|
|
47
|
+
defaultOptions?: MatExpansionPanelDefaultOptions;
|
|
48
|
+
opened: EventEmitter<{
|
|
49
|
+
panelId?: string;
|
|
50
|
+
panelIndex: number;
|
|
51
|
+
}>;
|
|
52
|
+
closed: EventEmitter<{
|
|
53
|
+
panelId?: string;
|
|
54
|
+
panelIndex: number;
|
|
55
|
+
}>;
|
|
56
|
+
expandedChange: EventEmitter<{
|
|
57
|
+
panelId?: string;
|
|
58
|
+
panelIndex: number;
|
|
59
|
+
expanded: boolean;
|
|
60
|
+
}>;
|
|
61
|
+
afterExpand: EventEmitter<{
|
|
62
|
+
panelId?: string;
|
|
63
|
+
panelIndex: number;
|
|
64
|
+
}>;
|
|
65
|
+
afterCollapse: EventEmitter<{
|
|
66
|
+
panelId?: string;
|
|
67
|
+
panelIndex: number;
|
|
68
|
+
}>;
|
|
69
|
+
destroyed: EventEmitter<{
|
|
70
|
+
panelId?: string;
|
|
71
|
+
panelIndex: number;
|
|
72
|
+
}>;
|
|
73
|
+
widgetEvent: EventEmitter<{
|
|
74
|
+
panelId?: string;
|
|
75
|
+
panelIndex?: number;
|
|
76
|
+
sourceId: string;
|
|
77
|
+
output?: string;
|
|
78
|
+
payload?: any;
|
|
79
|
+
}>;
|
|
80
|
+
private readonly settings;
|
|
81
|
+
private readonly storage;
|
|
82
|
+
private readonly destroyRef;
|
|
83
|
+
accordionRef?: MatAccordion;
|
|
84
|
+
panels?: QueryList<MatExpansionPanel>;
|
|
85
|
+
injectedDefaults: MatExpansionPanelDefaultOptions | null;
|
|
86
|
+
hasMultiple: () => boolean;
|
|
87
|
+
single: () => PanelMetadata | null;
|
|
88
|
+
styleCss(): string | null;
|
|
89
|
+
emitOpened(p: PanelMetadata, index: number): void;
|
|
90
|
+
emitClosed(p: PanelMetadata, index: number): void;
|
|
91
|
+
emitExpandedChange(p: PanelMetadata, index: number, expanded: boolean): void;
|
|
92
|
+
emitAfterExpand(p: PanelMetadata, index: number): void;
|
|
93
|
+
emitAfterCollapse(p: PanelMetadata, index: number): void;
|
|
94
|
+
emitDestroyed(p: PanelMetadata, index: number): void;
|
|
95
|
+
onWidgetEvent(loc: {
|
|
96
|
+
panelId?: string;
|
|
97
|
+
panelIndex?: number;
|
|
98
|
+
}, ev: {
|
|
99
|
+
sourceId: string;
|
|
100
|
+
output?: string;
|
|
101
|
+
payload?: any;
|
|
102
|
+
}): void;
|
|
103
|
+
open(indexOrId: number | string): void;
|
|
104
|
+
close(indexOrId: number | string): void;
|
|
105
|
+
toggle(indexOrId: number | string): void;
|
|
106
|
+
openAll(): void;
|
|
107
|
+
closeAll(): void;
|
|
108
|
+
private findPanel;
|
|
109
|
+
panelDomId(p: PanelMetadata | null, index: number): string;
|
|
110
|
+
openEditor(): void;
|
|
111
|
+
private storageKey;
|
|
112
|
+
emitAction(p: PanelMetadata, index: number, action?: string | undefined): void;
|
|
113
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisExpansion, never>;
|
|
114
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PraxisExpansion, "praxis-expansion", never, { "config": { "alias": "config"; "required": false; }; "expansionId": { "alias": "expansionId"; "required": false; }; "context": { "alias": "context"; "required": false; }; "strictValidation": { "alias": "strictValidation"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "required": false; }; "defaultOptions": { "alias": "defaultOptions"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; "expandedChange": "expandedChange"; "afterExpand": "afterExpand"; "afterCollapse": "afterCollapse"; "destroyed": "destroyed"; "widgetEvent": "widgetEvent"; }, never, never, true, never>;
|
|
115
|
+
}
|
|
116
|
+
declare class PraxisExpansionConfigEditor {
|
|
117
|
+
config: ExpansionMetadata | null | undefined;
|
|
118
|
+
expansionId?: string | null;
|
|
119
|
+
addPanel(): void;
|
|
120
|
+
removePanel(index: number): void;
|
|
121
|
+
move(index: number, delta: number): void;
|
|
122
|
+
setAccordion<K extends keyof NonNullable<ExpansionMetadata['accordion']>>(key: K, value: any): void;
|
|
123
|
+
setPanel(index: number, key: keyof PanelMetadata, value: any): void;
|
|
124
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisExpansionConfigEditor, never>;
|
|
125
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PraxisExpansionConfigEditor, "praxis-expansion-config-editor", never, { "config": { "alias": "config"; "required": false; }; "expansionId": { "alias": "expansionId"; "required": false; }; }, {}, never, never, true, never>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare const PRAXIS_EXPANSION_COMPONENT_METADATA: ComponentDocMeta;
|
|
129
|
+
declare function providePraxisExpansionMetadata(): Provider;
|
|
130
|
+
declare function providePraxisExpansionDefaults(opts: MatExpansionPanelDefaultOptions): Provider;
|
|
131
|
+
|
|
132
|
+
export { PRAXIS_EXPANSION_COMPONENT_METADATA, PraxisExpansion, PraxisExpansionConfigEditor, providePraxisExpansionDefaults, providePraxisExpansionMetadata };
|
|
133
|
+
export type { ExpansionMetadata, PanelMetadata };
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@praxisui/expansion",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.0.0",
|
|
6
|
+
"@angular/core": "^20.0.0",
|
|
7
|
+
"@angular/material": "^20.0.0",
|
|
8
|
+
"@angular/cdk": "^20.0.0",
|
|
9
|
+
"@praxisui/core": "^0.0.1",
|
|
10
|
+
"@praxisui/dynamic-fields": "^0.0.1",
|
|
11
|
+
"@praxisui/settings-panel": "^0.0.1"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"tslib": "^2.3.0"
|
|
15
|
+
},
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/codexrodrigues/praxis"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/codexrodrigues/praxis#readme",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/codexrodrigues/praxis/issues"
|
|
27
|
+
},
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"module": "fesm2022/praxisui-expansion.mjs",
|
|
30
|
+
"typings": "index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
"./package.json": {
|
|
33
|
+
"default": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"default": "./fesm2022/praxisui-expansion.mjs"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|