@seniorsistemas/angular-components 19.5.5 → 19.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +95 -59
- package/calendar-mask/lib/calendar-mask/calendar-mask.directive.d.ts +4 -0
- package/datepicker/README.md +175 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/lib/datepicker/date.utils.d.ts +21 -0
- package/datepicker/lib/datepicker/datepicker.component.d.ts +254 -0
- package/datepicker/lib/datepicker/models/index.d.ts +16 -0
- package/datepicker/public-api.d.ts +2 -0
- package/dynamic-form/dynamic-form/components/lookup/lookup.component.d.ts +3 -1
- package/dynamic-form/dynamic-form/components/lookup/models/lookup-alert-config.d.ts +5 -0
- package/dynamic-form/dynamic-form/form-field/configurations/fields/calendar-field.d.ts +119 -24
- package/dynamic-form/dynamic-form/form-field/configurations/fields/lookup-field.d.ts +6 -0
- package/dynamic-form/dynamic-form/form-field/fields/calendar/calendar-field.component.d.ts +6 -23
- package/dynamic-form/public-api.d.ts +1 -0
- package/editor/README.md +229 -0
- package/editor/index.d.ts +5 -0
- package/editor/lib/editor/editor.component.d.ts +127 -0
- package/editor/lib/editor/link-dialog/link-dialog.component.d.ts +18 -0
- package/editor/lib/editor/models/index.d.ts +12 -0
- package/editor/lib/editor/toolbar-button/editor-toolbar-button.component.d.ts +10 -0
- package/editor/public-api.d.ts +2 -0
- package/esm2022/calendar-mask/lib/calendar-mask/calendar-mask.directive.mjs +5 -1
- package/esm2022/datepicker/lib/datepicker/date.utils.mjs +182 -0
- package/esm2022/datepicker/lib/datepicker/datepicker.component.mjs +1062 -0
- package/esm2022/datepicker/lib/datepicker/models/index.mjs +2 -0
- package/esm2022/datepicker/public-api.mjs +2 -0
- package/esm2022/datepicker/seniorsistemas-angular-components-datepicker.mjs +5 -0
- package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +11 -5
- package/esm2022/dynamic-form/dynamic-form/components/lookup/models/lookup-alert-config.mjs +2 -0
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/calendar-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/lookup-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/autocomplete/autocomplete-field.component.mjs +2 -2
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/calendar/calendar-field.component.mjs +23 -116
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/lookup/lookup-field.component.mjs +3 -3
- package/esm2022/dynamic-form/public-api.mjs +1 -1
- package/esm2022/editor/lib/editor/editor.component.mjs +375 -0
- package/esm2022/editor/lib/editor/link-dialog/link-dialog.component.mjs +48 -0
- package/esm2022/editor/lib/editor/models/index.mjs +3 -0
- package/esm2022/editor/lib/editor/toolbar-button/editor-toolbar-button.component.mjs +17 -0
- package/esm2022/editor/public-api.mjs +3 -0
- package/esm2022/editor/seniorsistemas-angular-components-editor.mjs +5 -0
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-calendar/inline-edit-calendar.component.mjs +22 -12
- package/esm2022/inline-edit/lib/inline-edit/inline-edit.module.mjs +5 -5
- package/esm2022/lib/locale/fallback.mjs +82 -3
- package/esm2022/optional-fields/editor/editor-field/editor-field.component.mjs +5 -6
- package/esm2022/optional-fields/editor/editor-field.mjs +1 -1
- package/esm2022/panel/lib/panel/panel.component.mjs +7 -3
- package/esm2022/select/lib/select/select.component.mjs +4 -8
- package/esm2022/shared/lib/accessibility/datepicker-no-period-tab.directive.mjs +5 -1
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs +4 -0
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs +1250 -0
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs.map +1 -0
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +49 -135
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-editor.mjs +437 -0
- package/fesm2022/seniorsistemas-angular-components-editor.mjs.map +1 -0
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +24 -15
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-optional-fields-editor.mjs +4 -5
- package/fesm2022/seniorsistemas-angular-components-optional-fields-editor.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-panel.mjs +6 -2
- package/fesm2022/seniorsistemas-angular-components-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select.mjs +3 -7
- package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-shared.mjs +4 -0
- package/fesm2022/seniorsistemas-angular-components-shared.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components.mjs +81 -2
- package/fesm2022/seniorsistemas-angular-components.mjs.map +1 -1
- package/inline-edit/lib/inline-edit/components/fields/inline-edit-calendar/inline-edit-calendar.component.d.ts +6 -4
- package/inline-edit/lib/inline-edit/inline-edit.module.d.ts +2 -2
- package/loading-state/README.md +57 -17
- package/optional-fields/editor/editor-field.d.ts +9 -6
- package/package.json +74 -8
- package/panel/README.md +12 -1
- package/panel/lib/panel/panel.component.d.ts +3 -1
- package/schematics/collection.json +4 -0
- package/schematics/migrations/migrate-p-datepicker/index.d.ts +2 -0
- package/schematics/migrations/migrate-p-datepicker/index.js +141 -0
- package/schematics/migrations/migrate-p-datepicker/index.js.map +1 -0
- package/schematics/migrations/migrate-p-datepicker/index.test.d.ts +1 -0
- package/schematics/migrations/migrate-p-datepicker/index.test.js +392 -0
- package/schematics/migrations/migrate-p-datepicker/index.test.js.map +1 -0
- package/schematics/migrations.json +10 -0
- package/schematics/utils/ast-utils.d.ts +28 -0
- package/schematics/utils/ast-utils.js +116 -0
- package/schematics/utils/ast-utils.js.map +1 -0
- package/schematics/utils/ast-utils.test.d.ts +1 -0
- package/schematics/utils/ast-utils.test.js +138 -0
- package/schematics/utils/ast-utils.test.js.map +1 -0
- package/schematics/utils/workspace-utils.d.ts +6 -0
- package/schematics/utils/workspace-utils.js +37 -0
- package/schematics/utils/workspace-utils.js.map +1 -0
- package/schematics/utils/workspace-utils.test.d.ts +1 -0
- package/schematics/utils/workspace-utils.test.js +152 -0
- package/schematics/utils/workspace-utils.test.js.map +1 -0
- package/shared/lib/accessibility/datepicker-no-period-tab.directive.d.ts +4 -0
- package/stats-card/README.md +80 -45
package/editor/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Editor
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Editor de texto rico (WYSIWYG) construído sobre o **Tiptap/ProseMirror** (licença MIT). Substitui o `p-editor` do PrimeNG sem dependências comerciais e implementa `ControlValueAccessor` para integração nativa com Angular Forms.
|
|
6
|
+
|
|
7
|
+
## Quando usar
|
|
8
|
+
|
|
9
|
+
- Campos de formulário que exigem formatação de texto (descrições, observações, contratos, e-mails)
|
|
10
|
+
- Substituição do `p-editor` do PrimeNG em formulários existentes
|
|
11
|
+
- Exibição de conteúdo HTML salvo em modo somente leitura
|
|
12
|
+
|
|
13
|
+
## Quando não usar
|
|
14
|
+
|
|
15
|
+
- Entrada de texto simples sem formatação — use `<textarea>` ou `s-text-area`
|
|
16
|
+
- Edição colaborativa em tempo real — o componente não possui suporte a operações concorrentes
|
|
17
|
+
|
|
18
|
+
## Instalação
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { EditorComponent } from '@seniorsistemas/angular-components/editor';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [EditorComponent],
|
|
26
|
+
})
|
|
27
|
+
export class MeuComponent {}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Uso básico
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<s-editor [(ngModel)]="htmlContent" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<s-editor formControlName="descricao" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
### Inputs
|
|
43
|
+
|
|
44
|
+
| Propriedade | Tipo | Padrão | Obrigatório | Descrição |
|
|
45
|
+
|-------------|------|--------|:-----------:|-----------|
|
|
46
|
+
| `readonly` | `boolean` | `false` | Não | Desabilita edição e oculta a toolbar |
|
|
47
|
+
| `formats` | `EditorFormat[]` | `undefined` | Não | Lista de formatos exibidos na toolbar. Quando omitido, todos os formatos são exibidos |
|
|
48
|
+
| `style` | `{ [klass: string]: unknown }` | `undefined` | Não | Estilos inline aplicados ao container do editor (ex: `{ 'min-height': '200px' }`) |
|
|
49
|
+
| `extensions` | `Extension[]` | `[]` | Não | Extensões Tiptap adicionais para estender o comportamento padrão |
|
|
50
|
+
|
|
51
|
+
### Outputs
|
|
52
|
+
|
|
53
|
+
| Evento | Tipo | Descrição |
|
|
54
|
+
|--------|------|-----------|
|
|
55
|
+
| `editorInit` | `OutputEmitterRef<Editor>` | Emitido quando o editor está inicializado e pronto para uso. Entrega a instância do Tiptap `Editor` |
|
|
56
|
+
| `textChange` | `OutputEmitterRef<EditorTextChangeEvent>` | Emitido sempre que o conteúdo é alterado pelo usuário |
|
|
57
|
+
|
|
58
|
+
### Tipos
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
type EditorFormat =
|
|
62
|
+
| 'header' // Dropdown de títulos (Normal, Título 1, 2, 3)
|
|
63
|
+
| 'bold' // Negrito (Ctrl+B)
|
|
64
|
+
| 'italic' // Itálico (Ctrl+I)
|
|
65
|
+
| 'underline' // Sublinhado (Ctrl+U)
|
|
66
|
+
| 'strike' // Tachado
|
|
67
|
+
| 'color' // Cor do texto (seletor nativo do sistema)
|
|
68
|
+
| 'list' // Listas com marcadores e numeradas
|
|
69
|
+
| 'align' // Alinhamento (esquerda, centro, direita)
|
|
70
|
+
| 'blockquote' // Citação
|
|
71
|
+
| 'code-block' // Código inline
|
|
72
|
+
| 'link' // Inserir/editar link
|
|
73
|
+
| 'image' // Inserir imagem (base64)
|
|
74
|
+
| 'subscript' // Subscrito
|
|
75
|
+
| 'superscript' // Sobrescrito
|
|
76
|
+
| 'clean'; // Limpar toda a formatação
|
|
77
|
+
|
|
78
|
+
interface EditorTextChangeEvent {
|
|
79
|
+
htmlValue: string; // Conteúdo como HTML
|
|
80
|
+
textValue: string; // Conteúdo como texto plano
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Exemplos
|
|
85
|
+
|
|
86
|
+
### Com todos os formatos (padrão)
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<s-editor [(ngModel)]="content" />
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Toolbar simplificada
|
|
93
|
+
|
|
94
|
+
Use o input `formats` para exibir apenas os formatos necessários:
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<s-editor
|
|
98
|
+
[(ngModel)]="content"
|
|
99
|
+
[formats]="['bold', 'italic', 'underline', 'list']"
|
|
100
|
+
/>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Modo somente leitura
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<s-editor [(ngModel)]="content" [readonly]="true" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Com altura personalizada
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<s-editor
|
|
113
|
+
[(ngModel)]="content"
|
|
114
|
+
[style]="{ 'min-height': '300px' }"
|
|
115
|
+
/>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Reactive Forms
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<form [formGroup]="form">
|
|
122
|
+
<s-editor formControlName="descricao" />
|
|
123
|
+
</form>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
form = new FormGroup({
|
|
128
|
+
descricao: new FormControl(''),
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Reagindo à inicialização do editor
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<s-editor [(ngModel)]="content" (editorInit)="onEditorReady($event)" />
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
onEditorReady(editor: Editor): void {
|
|
140
|
+
// instância Tiptap disponível para operações programáticas
|
|
141
|
+
editor.commands.focus();
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Reagindo a mudanças de conteúdo
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<s-editor [(ngModel)]="content" (textChange)="onTextChange($event)" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
onTextChange(event: EditorTextChangeEvent): void {
|
|
153
|
+
console.log(event.htmlValue); // '<p>Texto com <strong>negrito</strong></p>'
|
|
154
|
+
console.log(event.textValue); // 'Texto com negrito'
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Com extensões Tiptap customizadas
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
import CharacterCount from '@tiptap/extension-character-count';
|
|
162
|
+
|
|
163
|
+
extensions = [CharacterCount.configure({ limit: 500 })];
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<s-editor [(ngModel)]="content" [extensions]="extensions" />
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Toolbar
|
|
171
|
+
|
|
172
|
+
Os botões de **Desfazer** e **Refazer** são sempre exibidos quando a toolbar está visível, independente do input `formats`.
|
|
173
|
+
|
|
174
|
+
| Formato | Valor em `formats` | Atalho | Descrição |
|
|
175
|
+
|---------|-------------------|--------|-----------|
|
|
176
|
+
| Títulos | `'header'` | — | Dropdown: Normal, Título 1, 2, 3 |
|
|
177
|
+
| Negrito | `'bold'` | Ctrl+B | |
|
|
178
|
+
| Itálico | `'italic'` | Ctrl+I | |
|
|
179
|
+
| Sublinhado | `'underline'` | Ctrl+U | |
|
|
180
|
+
| Tachado | `'strike'` | — | |
|
|
181
|
+
| Cor do texto | `'color'` | — | Abre o seletor de cores nativo do sistema |
|
|
182
|
+
| Subscrito | `'subscript'` | — | |
|
|
183
|
+
| Sobrescrito | `'superscript'` | — | |
|
|
184
|
+
| Listas | `'list'` | — | Com marcadores e numerada |
|
|
185
|
+
| Alinhamento | `'align'` | — | Esquerda, centro, direita |
|
|
186
|
+
| Citação | `'blockquote'` | — | |
|
|
187
|
+
| Código | `'code-block'` | — | Código inline |
|
|
188
|
+
| Link | `'link'` | — | Abre dialog para inserir/editar URL |
|
|
189
|
+
| Imagem | `'image'` | — | Seleciona arquivo local e insere como base64 |
|
|
190
|
+
| Limpar formatação | `'clean'` | — | Remove toda a formatação do texto selecionado |
|
|
191
|
+
| Desfazer | sempre visível | Ctrl+Z | |
|
|
192
|
+
| Refazer | sempre visível | Ctrl+Y | |
|
|
193
|
+
|
|
194
|
+
## Formato de dados
|
|
195
|
+
|
|
196
|
+
O componente produz e consome **HTML**. O valor salvo em `ngModel` ou `FormControl` é a string HTML gerada pelo Tiptap, compatível com o HTML produzido pelo `p-editor` do PrimeNG para os formatos comuns.
|
|
197
|
+
|
|
198
|
+
## Migração do `p-editor`
|
|
199
|
+
|
|
200
|
+
### Substituição do import e seletor
|
|
201
|
+
|
|
202
|
+
```html
|
|
203
|
+
<!-- Antes (p-editor) -->
|
|
204
|
+
<p-editor formControlName="descricao" [formats]="formats" />
|
|
205
|
+
|
|
206
|
+
<!-- Depois (s-editor) -->
|
|
207
|
+
<s-editor formControlName="descricao" [formats]="formats" />
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Diferença semântica do input `formats`
|
|
211
|
+
|
|
212
|
+
No `p-editor`, `formats` era uma whitelist de formatos permitidos **no conteúdo** (comportamento do Quill). No `s-editor`, `formats` controla a **visibilidade dos botões na toolbar**. O efeito prático é equivalente: o usuário não consegue aplicar formatos que não estão listados.
|
|
213
|
+
|
|
214
|
+
### Input `modules` removido
|
|
215
|
+
|
|
216
|
+
O input `modules` do `p-editor` era específico do Quill e não tem equivalente no Tiptap. Use o input `extensions` para adicionar extensões Tiptap customizadas.
|
|
217
|
+
|
|
218
|
+
## Acessibilidade
|
|
219
|
+
|
|
220
|
+
- A área editável recebe `role="textbox"` e `aria-multiline="true"` automaticamente
|
|
221
|
+
- O `aria-label` da área editável é traduzível via `@ngx-translate`
|
|
222
|
+
- A toolbar tem `role="toolbar"` com `aria-label` traduzível
|
|
223
|
+
- O controle fica `touched` ao perder o foco (comportamento correto com formulários reativos e validação)
|
|
224
|
+
- O seletor de títulos tem `aria-label` traduzível
|
|
225
|
+
|
|
226
|
+
## Componentes relacionados
|
|
227
|
+
|
|
228
|
+
- [`DynamicFormComponent`](../dynamic-form/README.md) — use `provideEditorField()` para integrar o editor como campo do formulário dinâmico
|
|
229
|
+
- [`DialogComponent`](../dialog/README.md) — usado internamente para o dialog de inserção de links
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { Editor } from '@tiptap/core';
|
|
4
|
+
import { EditorFormat, EditorSelectionChangeEvent, EditorTextChangeEvent, Extension } from './models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* @description Componente de editor de texto rico (WYSIWYG) construído sobre o Tiptap/ProseMirror.
|
|
8
|
+
* Substitui o `p-editor` do PrimeNG sem dependência externa de licença comercial.
|
|
9
|
+
* Implementa {@link ControlValueAccessor} para integração com Angular Forms.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <s-editor
|
|
14
|
+
* formControlName="descricao"
|
|
15
|
+
* [readonly]="false"
|
|
16
|
+
* (textChange)="onTextChange($event)" />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class EditorComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
20
|
+
private readonly cdr;
|
|
21
|
+
private readonly dialogService;
|
|
22
|
+
private readonly translateService;
|
|
23
|
+
private readonly destroyRef;
|
|
24
|
+
/**
|
|
25
|
+
* @description Coloca o editor em modo somente leitura.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
readonly: import("@angular/core").InputSignal<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* @description Lista de formatos habilitados na toolbar. Quando vazio, todos os formatos são exibidos.
|
|
31
|
+
*/
|
|
32
|
+
formats: import("@angular/core").InputSignal<EditorFormat[] | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* @description Texto de dica exibido quando o editor está vazio.
|
|
35
|
+
*/
|
|
36
|
+
placeholder: import("@angular/core").InputSignal<string | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* @description Estilos inline aplicados ao container do editor.
|
|
39
|
+
*/
|
|
40
|
+
style: import("@angular/core").InputSignal<{
|
|
41
|
+
[klass: string]: unknown;
|
|
42
|
+
} | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* @description Classes CSS adicionais aplicadas ao container do editor.
|
|
45
|
+
*/
|
|
46
|
+
styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* @description Extensões Tiptap adicionais para estender o comportamento padrão do editor.
|
|
49
|
+
*/
|
|
50
|
+
extensions: import("@angular/core").InputSignal<Extension<any, any>[]>;
|
|
51
|
+
/**
|
|
52
|
+
* @description Emitido quando o editor é inicializado e está pronto para uso.
|
|
53
|
+
*/
|
|
54
|
+
editorInit: import("@angular/core").OutputEmitterRef<Editor>;
|
|
55
|
+
/**
|
|
56
|
+
* @description Emitido sempre que o conteúdo do editor é alterado.
|
|
57
|
+
*/
|
|
58
|
+
textChange: import("@angular/core").OutputEmitterRef<EditorTextChangeEvent>;
|
|
59
|
+
/**
|
|
60
|
+
* @description Emitido quando a seleção de texto no editor muda.
|
|
61
|
+
*/
|
|
62
|
+
selectionChange: import("@angular/core").OutputEmitterRef<EditorSelectionChangeEvent>;
|
|
63
|
+
private editorContainer;
|
|
64
|
+
private imageInput;
|
|
65
|
+
private editor?;
|
|
66
|
+
private _formDisabled;
|
|
67
|
+
private _currentPlaceholder;
|
|
68
|
+
activeStates: {
|
|
69
|
+
isBold: boolean;
|
|
70
|
+
isItalic: boolean;
|
|
71
|
+
isUnderline: boolean;
|
|
72
|
+
isStrike: boolean;
|
|
73
|
+
isBulletList: boolean;
|
|
74
|
+
isOrderedList: boolean;
|
|
75
|
+
isBlockquote: boolean;
|
|
76
|
+
isCode: boolean;
|
|
77
|
+
isSubscript: boolean;
|
|
78
|
+
isSuperscript: boolean;
|
|
79
|
+
isAlignLeft: boolean;
|
|
80
|
+
isAlignCenter: boolean;
|
|
81
|
+
isAlignRight: boolean;
|
|
82
|
+
currentHeading: number;
|
|
83
|
+
currentColor: string;
|
|
84
|
+
currentHighlight: string;
|
|
85
|
+
canUndo: boolean;
|
|
86
|
+
canRedo: boolean;
|
|
87
|
+
};
|
|
88
|
+
private _value;
|
|
89
|
+
private _onChange;
|
|
90
|
+
private _onTouched;
|
|
91
|
+
constructor();
|
|
92
|
+
ngAfterViewInit(): void;
|
|
93
|
+
ngOnDestroy(): void;
|
|
94
|
+
writeValue(value: string): void;
|
|
95
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
96
|
+
registerOnTouched(fn: () => void): void;
|
|
97
|
+
setDisabledState(isDisabled: boolean): void;
|
|
98
|
+
isFormatAllowed(format: EditorFormat): boolean;
|
|
99
|
+
hasAnyFormatBeforeUndoRedo(): boolean;
|
|
100
|
+
toggleBold(): void;
|
|
101
|
+
toggleItalic(): void;
|
|
102
|
+
toggleUnderline(): void;
|
|
103
|
+
toggleStrike(): void;
|
|
104
|
+
toggleBulletList(): void;
|
|
105
|
+
toggleOrderedList(): void;
|
|
106
|
+
toggleBlockquote(): void;
|
|
107
|
+
toggleCode(): void;
|
|
108
|
+
toggleSubscript(): void;
|
|
109
|
+
toggleSuperscript(): void;
|
|
110
|
+
setTextAlign(align: 'left' | 'center' | 'right'): void;
|
|
111
|
+
setColor(color: string): void;
|
|
112
|
+
setHighlight(color: string): void;
|
|
113
|
+
clearFormatting(): void;
|
|
114
|
+
onHeadingChange(event: Event): void;
|
|
115
|
+
setLink(): void;
|
|
116
|
+
setImage(): void;
|
|
117
|
+
onImageFileSelected(event: Event): void;
|
|
118
|
+
undo(): void;
|
|
119
|
+
redo(): void;
|
|
120
|
+
onToolbarKeydown(event: KeyboardEvent): void;
|
|
121
|
+
onToolbarFocusIn(event: FocusEvent): void;
|
|
122
|
+
private getToolbarFocusable;
|
|
123
|
+
private initEditor;
|
|
124
|
+
private syncActiveStates;
|
|
125
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditorComponent, never>;
|
|
126
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorComponent, "s-editor", never, { "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "formats": { "alias": "formats"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "extensions": { "alias": "extensions"; "required": false; "isSignal": true; }; }, { "editorInit": "editorInit"; "textChange": "textChange"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
127
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { DynamicStructure } from '@seniorsistemas/angular-components/dynamic-form';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class LinkDialogComponent implements OnInit {
|
|
6
|
+
private readonly activeDialog;
|
|
7
|
+
private readonly translateService;
|
|
8
|
+
initialUrl: string;
|
|
9
|
+
form: FormGroup<{
|
|
10
|
+
url: FormControl<string | null>;
|
|
11
|
+
}>;
|
|
12
|
+
configs: DynamicStructure[];
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
confirm(): void;
|
|
15
|
+
cancel(): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LinkDialogComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LinkDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export type EditorFormat = 'header' | 'bold' | 'italic' | 'underline' | 'strike' | 'color' | 'highlight' | 'list' | 'align' | 'blockquote' | 'code-block' | 'link' | 'image' | 'subscript' | 'superscript' | 'clean';
|
|
3
|
+
export interface EditorTextChangeEvent {
|
|
4
|
+
htmlValue: string;
|
|
5
|
+
textValue: string;
|
|
6
|
+
}
|
|
7
|
+
export interface EditorSelectionChangeEvent {
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
empty: boolean;
|
|
11
|
+
}
|
|
12
|
+
export { Extension };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class EditorToolbarButtonComponent {
|
|
3
|
+
icon: import("@angular/core").InputSignal<string>;
|
|
4
|
+
label: import("@angular/core").InputSignal<string>;
|
|
5
|
+
active: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
disabled: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
clicked: import("@angular/core").OutputEmitterRef<void>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditorToolbarButtonComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditorToolbarButtonComponent, "s-editor-toolbar-button", never, { "icon": { "alias": "icon"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
10
|
+
}
|