@exhaustive-ui/mcp 0.0.0-stage → 3.0.0-alpha.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 +23 -0
- package/README.md +167 -2
- package/data/components/accordion.md +421 -0
- package/data/components/animateonscroll.md +163 -0
- package/data/components/autocomplete.md +1077 -0
- package/data/components/autofocus.md +38 -0
- package/data/components/avatar.md +417 -0
- package/data/components/badge.md +234 -0
- package/data/components/blockui.md +108 -0
- package/data/components/breadcrumb.md +178 -0
- package/data/components/button.md +774 -0
- package/data/components/card.md +138 -0
- package/data/components/carousel.md +440 -0
- package/data/components/cascadeselect.md +1387 -0
- package/data/components/chart.md +1178 -0
- package/data/components/checkbox.md +529 -0
- package/data/components/chip.md +180 -0
- package/data/components/colorpicker.md +301 -0
- package/data/components/confirmdialog.md +287 -0
- package/data/components/confirmpopup.md +417 -0
- package/data/components/contextmenu.md +491 -0
- package/data/components/dataview.md +600 -0
- package/data/components/datepicker.md +1262 -0
- package/data/components/dialog.md +622 -0
- package/data/components/divider.md +250 -0
- package/data/components/dock.md +500 -0
- package/data/components/dragdrop.md +285 -0
- package/data/components/drawer.md +510 -0
- package/data/components/dynamicdialog.md +109 -0
- package/data/components/editor.md +291 -0
- package/data/components/fieldset.md +182 -0
- package/data/components/fileupload.md +430 -0
- package/data/components/floatlabel.md +155 -0
- package/data/components/fluid.md +72 -0
- package/data/components/focustrap.md +65 -0
- package/data/components/galleria.md +627 -0
- package/data/components/iconfield.md +246 -0
- package/data/components/iftalabel.md +105 -0
- package/data/components/imagecompare.md +97 -0
- package/data/components/inplace.md +233 -0
- package/data/components/inputgroup.md +306 -0
- package/data/components/inputmask.md +518 -0
- package/data/components/inputnumber.md +675 -0
- package/data/components/inputotp.md +336 -0
- package/data/components/inputtext.md +488 -0
- package/data/components/keyfilter.md +85 -0
- package/data/components/knob.md +462 -0
- package/data/components/listbox.md +798 -0
- package/data/components/llms.md +28 -0
- package/data/components/megamenu.md +587 -0
- package/data/components/menu.md +483 -0
- package/data/components/menubar.md +462 -0
- package/data/components/message.md +449 -0
- package/data/components/metergroup.md +241 -0
- package/data/components/multiselect.md +1047 -0
- package/data/components/orderlist.md +342 -0
- package/data/components/organizationchart.md +197 -0
- package/data/components/overlay.md +217 -0
- package/data/components/paginator.md +314 -0
- package/data/components/panel.md +214 -0
- package/data/components/panelmenu.md +699 -0
- package/data/components/password.md +570 -0
- package/data/components/picklist.md +420 -0
- package/data/components/popover.md +378 -0
- package/data/components/progressbar.md +181 -0
- package/data/components/progressspinner.md +91 -0
- package/data/components/radiobutton.md +377 -0
- package/data/components/rating.md +312 -0
- package/data/components/ripple.md +89 -0
- package/data/components/scroller.md +122 -0
- package/data/components/scrollpanel.md +149 -0
- package/data/components/scrolltop.md +105 -0
- package/data/components/select.md +1206 -0
- package/data/components/selectbutton.md +356 -0
- package/data/components/skeleton.md +242 -0
- package/data/components/slider.md +337 -0
- package/data/components/speeddial.md +589 -0
- package/data/components/splitbutton.md +945 -0
- package/data/components/splitter.md +196 -0
- package/data/components/stepper.md +411 -0
- package/data/components/styleclass.md +126 -0
- package/data/components/table.md +4557 -0
- package/data/components/tabs.md +467 -0
- package/data/components/tag.md +200 -0
- package/data/components/terminal.md +118 -0
- package/data/components/textarea.md +416 -0
- package/data/components/tieredmenu.md +578 -0
- package/data/components/timeline.md +310 -0
- package/data/components/toast.md +596 -0
- package/data/components/togglebutton.md +356 -0
- package/data/components/toggleswitch.md +285 -0
- package/data/components/toolbar.md +182 -0
- package/data/components/tooltip.md +211 -0
- package/data/components/tree.md +746 -0
- package/data/components/treeselect.md +912 -0
- package/data/components/treetable.md +2814 -0
- package/data/components.json +43751 -0
- package/data/llms-full.txt +47433 -0
- package/data/llms.txt +121 -0
- package/data/manifest.json +46513 -0
- package/data/pages/accessibility.md +28 -0
- package/data/pages/animations.md +28 -0
- package/data/pages/configuration.md +210 -0
- package/data/pages/contribution.md +20 -0
- package/data/pages/customicons.md +20 -0
- package/data/pages/faq.md +20 -0
- package/data/pages/icons.md +66 -0
- package/data/pages/installation.md +71 -0
- package/data/pages/llms.md +61 -0
- package/data/pages/passthrough.md +32 -0
- package/data/pages/philosophy.md +28 -0
- package/data/pages/primeflex.md +20 -0
- package/data/pages/rtl.md +12 -0
- package/data/pages/styled.md +132 -0
- package/data/pages/tailwind.md +40 -0
- package/data/pages/unstyled.md +39 -0
- package/data/snapshot.json +9 -0
- package/dist/index.d.mts +448 -0
- package/dist/index.mjs +2501 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -3
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# Angular Editor Component
|
|
2
|
+
|
|
3
|
+
Editor is rich text editor component based on Quill.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Quill performs generally well in terms of accessibility. The elements in the toolbar can be tabbed and have the necessary ARIA roles/attributes for screen readers. One known limitation is the lack of arrow key support for dropdowns in the toolbar that may be overcome with a custom toolbar.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
A model can be bound using the standard ngModel directive.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { FormsModule } from '@angular/forms';
|
|
16
|
+
import { EditorModule } from '@exhaustive-ui/core/editor';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
template: `
|
|
20
|
+
<div class="card">
|
|
21
|
+
<p-editor [(ngModel)]="text" [style]="{ height: '320px' }" />
|
|
22
|
+
</div>
|
|
23
|
+
`,
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [EditorModule, FormsModule]
|
|
26
|
+
})
|
|
27
|
+
export class EditorBasicDemo {
|
|
28
|
+
text: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## customtoolbar-doc
|
|
33
|
+
|
|
34
|
+
Editor provides a default toolbar with common options, to customize it define your elements inside the header element. Refer to Quill documentation for available controls.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Component } from '@angular/core';
|
|
38
|
+
import { FormsModule } from '@angular/forms';
|
|
39
|
+
import { EditorModule } from '@exhaustive-ui/core/editor';
|
|
40
|
+
|
|
41
|
+
@Component({
|
|
42
|
+
template: `
|
|
43
|
+
<div class="card">
|
|
44
|
+
<p-editor [(ngModel)]="text" [style]="{ height: '320px' }">
|
|
45
|
+
<ng-template #header>
|
|
46
|
+
<span class="ql-formats">
|
|
47
|
+
<button type="button" class="ql-bold" aria-label="Bold"></button>
|
|
48
|
+
<button type="button" class="ql-italic" aria-label="Italic"></button>
|
|
49
|
+
<button type="button" class="ql-underline" aria-label="Underline"></button>
|
|
50
|
+
</span>
|
|
51
|
+
</ng-template>
|
|
52
|
+
</p-editor>
|
|
53
|
+
</div>
|
|
54
|
+
`,
|
|
55
|
+
standalone: true,
|
|
56
|
+
imports: [EditorModule, FormsModule]
|
|
57
|
+
})
|
|
58
|
+
export class EditorCustomtoolbarDemo {
|
|
59
|
+
text: string = '<div>Hello World!</div><div>ExhaustiveUI <b>Editor</b> Rocks</div><div><br></div>';
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quill
|
|
64
|
+
|
|
65
|
+
Editor uses Quill editor underneath so it needs to be installed as a dependency.
|
|
66
|
+
|
|
67
|
+
## reactiveforms-doc
|
|
68
|
+
|
|
69
|
+
Editor can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { Component, inject } from '@angular/core';
|
|
73
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
74
|
+
import { EditorModule } from '@exhaustive-ui/core/editor';
|
|
75
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
76
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
77
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
78
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
79
|
+
|
|
80
|
+
@Component({
|
|
81
|
+
template: `
|
|
82
|
+
<p-toast />
|
|
83
|
+
<div class="card ">
|
|
84
|
+
<form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4">
|
|
85
|
+
<div class="flex flex-col gap-1">
|
|
86
|
+
<p-editor formControlName="text" [invalid]="isInvalid('text')" [style]="{ height: '320px' }" />
|
|
87
|
+
@if (isInvalid('text')) {
|
|
88
|
+
<p-message severity="error" size="small" variant="simple">Content is required.</p-message>
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
91
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
92
|
+
</form>
|
|
93
|
+
</div>
|
|
94
|
+
`,
|
|
95
|
+
standalone: true,
|
|
96
|
+
imports: [EditorModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
|
|
97
|
+
})
|
|
98
|
+
export class EditorReactiveformsDemo {
|
|
99
|
+
messageService = inject(MessageService);
|
|
100
|
+
items: any[] | undefined;
|
|
101
|
+
exampleForm: FormGroup | undefined;
|
|
102
|
+
formSubmitted: boolean = false;
|
|
103
|
+
|
|
104
|
+
constructor() {
|
|
105
|
+
this.exampleForm = this.fb.group({
|
|
106
|
+
text: ['', Validators.required]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
onSubmit() {
|
|
111
|
+
this.formSubmitted = true;
|
|
112
|
+
if (this.exampleForm.valid) {
|
|
113
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
114
|
+
this.exampleForm.reset();
|
|
115
|
+
this.formSubmitted = false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
isInvalid(controlName: string) {
|
|
120
|
+
const control = this.exampleForm.get(controlName);
|
|
121
|
+
return control?.invalid && (control.touched || this.formSubmitted);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## ReadOnly
|
|
127
|
+
|
|
128
|
+
When readonly is present, the value cannot be edited.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { Component } from '@angular/core';
|
|
132
|
+
import { FormsModule } from '@angular/forms';
|
|
133
|
+
import { EditorModule } from '@exhaustive-ui/core/editor';
|
|
134
|
+
|
|
135
|
+
@Component({
|
|
136
|
+
template: `
|
|
137
|
+
<div class="card">
|
|
138
|
+
<p-editor [(ngModel)]="text" [readonly]="true" [style]="{ height: '320px' }" />
|
|
139
|
+
</div>
|
|
140
|
+
`,
|
|
141
|
+
standalone: true,
|
|
142
|
+
imports: [EditorModule, FormsModule]
|
|
143
|
+
})
|
|
144
|
+
export class EditorReadonlyDemo {
|
|
145
|
+
text: string = 'Always bet on Prime!';
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## templatedrivenforms-doc
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { Component, inject } from '@angular/core';
|
|
153
|
+
import { FormsModule } from '@angular/forms';
|
|
154
|
+
import { EditorModule } from '@exhaustive-ui/core/editor';
|
|
155
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
156
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
157
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
158
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
159
|
+
|
|
160
|
+
@Component({
|
|
161
|
+
template: `
|
|
162
|
+
<p-toast />
|
|
163
|
+
<div class="card">
|
|
164
|
+
<form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4">
|
|
165
|
+
<div class="flex flex-col gap-1">
|
|
166
|
+
<p-editor #content="ngModel" [(ngModel)]="text" [invalid]="content.invalid && (content.touched || exampleForm.submitted)" name="content" [style]="{ height: '320px' }" required />
|
|
167
|
+
@if (content.invalid && (content.touched || exampleForm.submitted)) {
|
|
168
|
+
<p-message severity="error" size="small" variant="simple">Content is required.</p-message>
|
|
169
|
+
}
|
|
170
|
+
</div>
|
|
171
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
172
|
+
</form>
|
|
173
|
+
</div>
|
|
174
|
+
`,
|
|
175
|
+
standalone: true,
|
|
176
|
+
imports: [EditorModule, MessageModule, ToastModule, ButtonModule, FormsModule]
|
|
177
|
+
})
|
|
178
|
+
export class EditorTemplatedrivenformsDemo {
|
|
179
|
+
messageService = inject(MessageService);
|
|
180
|
+
text: string | undefined;
|
|
181
|
+
|
|
182
|
+
onSubmit(form: any) {
|
|
183
|
+
if (form.valid) {
|
|
184
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
185
|
+
form.resetForm();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Editor
|
|
192
|
+
|
|
193
|
+
Editor groups a collection of contents in tabs.
|
|
194
|
+
|
|
195
|
+
### Props
|
|
196
|
+
|
|
197
|
+
| Name | Type | Default | Description |
|
|
198
|
+
|------|------|---------|-------------|
|
|
199
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
200
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
201
|
+
| pt | InputSignal<EditorPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
202
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
203
|
+
| required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
|
|
204
|
+
| invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
|
|
205
|
+
| disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
|
|
206
|
+
| name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
|
|
207
|
+
| style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the container. |
|
|
208
|
+
| placeholder | InputSignal<string> | ... | Placeholder text to show when editor is empty. |
|
|
209
|
+
| formats | InputSignal<string[]> | ... | Whitelist of formats to display, see [here](https://quilljs.com/docs/formats/) for available options. |
|
|
210
|
+
| modules | InputSignal<object> | ... | Modules configuration of Editor, see [here](https://quilljs.com/docs/modules/) for available options. |
|
|
211
|
+
| bounds | InputSignal<string \| HTMLElement> | ... | DOM Element or a CSS selector for a DOM Element, within which the editor’s p elements (i.e. tooltips, etc.) should be confined. Currently, it only considers left and right boundaries. |
|
|
212
|
+
| scrollingContainer | InputSignal<string \| HTMLElement> | ... | DOM Element or a CSS selector for a DOM Element, specifying which container has the scrollbars (i.e. overflow-y: auto), if is has been changed from the default ql-editor with custom CSS. Necessary to fix scroll jumping bugs when Quill is set to auto grow its height, and another ancestor container is responsible from the scrolling.. |
|
|
213
|
+
| debug | InputSignal<string> | ... | Shortcut for debug. Note debug is a static method and will affect other instances of Quill editors on the page. Only warning and error messages are enabled by default. |
|
|
214
|
+
| readonly | InputSignal<boolean> | ... | Whether to instantiate the editor to read-only mode. |
|
|
215
|
+
|
|
216
|
+
### Emits
|
|
217
|
+
|
|
218
|
+
| Name | Parameters | Description |
|
|
219
|
+
|------|------------|-------------|
|
|
220
|
+
| onEditorInit | event: EditorInitEvent | Callback to invoke when the quill modules are loaded. |
|
|
221
|
+
| onTextChange | event: EditorTextChangeEvent | Callback to invoke when text of editor changes. |
|
|
222
|
+
| onSelectionChange | event: EditorSelectionChangeEvent | Callback to invoke when selection of the text changes. |
|
|
223
|
+
| onEditorChange | event: EditorChangeEvent | Callback to invoke when editor content changes (combines both text and selection changes). |
|
|
224
|
+
| onFocus | event: EditorFocusEvent | Callback to invoke when editor receives focus. |
|
|
225
|
+
| onBlur | event: EditorBlurEvent | Callback to invoke when editor loses focus. |
|
|
226
|
+
|
|
227
|
+
### Templates
|
|
228
|
+
|
|
229
|
+
| Name | Type | Description |
|
|
230
|
+
|------|------|-------------|
|
|
231
|
+
| header | TemplateRef<any> | Custom item template. |
|
|
232
|
+
|
|
233
|
+
## Pass Through Options
|
|
234
|
+
|
|
235
|
+
| Name | Type | Description |
|
|
236
|
+
|------|------|-------------|
|
|
237
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
238
|
+
| toolbar | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the toolbar's DOM element. |
|
|
239
|
+
| formats | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the formats span's DOM element. |
|
|
240
|
+
| header | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the header select's DOM element. |
|
|
241
|
+
| option | PassThroughOption<HTMLOptionElement, I> | Used to pass attributes to the option's DOM element. |
|
|
242
|
+
| bold | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the bold button's DOM element. |
|
|
243
|
+
| italic | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the italic button's DOM element. |
|
|
244
|
+
| underline | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the underline button's DOM element. |
|
|
245
|
+
| color | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the color select's DOM element. |
|
|
246
|
+
| background | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the background select's DOM element. |
|
|
247
|
+
| list | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the list button's DOM element. |
|
|
248
|
+
| select | PassThroughOption<HTMLSelectElement, I> | Used to pass attributes to the select's DOM element. |
|
|
249
|
+
| link | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the link button's DOM element. |
|
|
250
|
+
| image | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the image button's DOM element. |
|
|
251
|
+
| codeBlock | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the code block button's DOM element. |
|
|
252
|
+
| clean | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the clean button's DOM element. |
|
|
253
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
254
|
+
|
|
255
|
+
## Theming
|
|
256
|
+
|
|
257
|
+
### CSS Classes
|
|
258
|
+
|
|
259
|
+
| Class | Description |
|
|
260
|
+
|-------|-------------|
|
|
261
|
+
| p-editor | Class name of the root element |
|
|
262
|
+
| p-editor-toolbar | Class name of the toolbar element |
|
|
263
|
+
| p-editor-content | Class name of the content element |
|
|
264
|
+
|
|
265
|
+
### Design Tokens
|
|
266
|
+
|
|
267
|
+
| Token | CSS Variable | Description |
|
|
268
|
+
|-------|--------------|-------------|
|
|
269
|
+
| editor.toolbar.background | --p-editor-toolbar-background | Background of toolbar |
|
|
270
|
+
| editor.toolbar.border.color | --p-editor-toolbar-border-color | Border color of toolbar |
|
|
271
|
+
| editor.toolbar.border.radius | --p-editor-toolbar-border-radius | Border radius of toolbar |
|
|
272
|
+
| editor.toolbar.item.color | --p-editor-toolbar-item-color | Color of toolbar item |
|
|
273
|
+
| editor.toolbar.item.hover.color | --p-editor-toolbar-item-hover-color | Hover color of toolbar item |
|
|
274
|
+
| editor.toolbar.item.active.color | --p-editor-toolbar-item-active-color | Active color of toolbar item |
|
|
275
|
+
| editor.toolbar.item.padding | --p-editor-toolbar-item-padding | Padding of toolbar item |
|
|
276
|
+
| editor.overlay.background | --p-editor-overlay-background | Background of overlay |
|
|
277
|
+
| editor.overlay.border.color | --p-editor-overlay-border-color | Border color of overlay |
|
|
278
|
+
| editor.overlay.border.radius | --p-editor-overlay-border-radius | Border radius of overlay |
|
|
279
|
+
| editor.overlay.color | --p-editor-overlay-color | Color of overlay |
|
|
280
|
+
| editor.overlay.shadow | --p-editor-overlay-shadow | Shadow of overlay |
|
|
281
|
+
| editor.overlay.padding | --p-editor-overlay-padding | Padding of overlay |
|
|
282
|
+
| editor.overlay.option.focus.background | --p-editor-overlay-option-focus-background | Focus background of overlay option |
|
|
283
|
+
| editor.overlay.option.color | --p-editor-overlay-option-color | Color of overlay option |
|
|
284
|
+
| editor.overlay.option.focus.color | --p-editor-overlay-option-focus-color | Focus color of overlay option |
|
|
285
|
+
| editor.overlay.option.padding | --p-editor-overlay-option-padding | Padding of overlay option |
|
|
286
|
+
| editor.overlay.option.border.radius | --p-editor-overlay-option-border-radius | Border radius of overlay option |
|
|
287
|
+
| editor.content.background | --p-editor-content-background | Background of content |
|
|
288
|
+
| editor.content.border.color | --p-editor-content-border-color | Border color of content |
|
|
289
|
+
| editor.content.color | --p-editor-content-color | Color of content |
|
|
290
|
+
| editor.content.border.radius | --p-editor-content-border-radius | Border radius of content |
|
|
291
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Angular Fieldset Component
|
|
2
|
+
|
|
3
|
+
Fieldset is a grouping component with a content toggle feature.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Fieldset component uses the semantic fieldset element. When toggleable option is enabled, a clickable element with button role is included inside the legend element, this button has aria-controls to define the id of the content section along with aria-expanded for the visibility state. The value to read the button defaults to the value of the legend property and can be customized by defining an aria-label or aria-labelledby via the toggleButtonProps property. The content uses region , defines an id that matches the aria-controls of the content toggle button and aria-labelledby referring to the id of the header. Content Toggle Button Keyboard Support Key Function tab Moves focus to the next the focusable element in the page tab sequence. shift + tab Moves focus to the previous the focusable element in the page tab sequence. enter Toggles the visibility of the content. space Toggles the visibility of the content.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
A simple Fieldset is created with a legend property along with the content as children.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
template: `
|
|
19
|
+
<div class="card">
|
|
20
|
+
<p-fieldset legend="Header">
|
|
21
|
+
<p class="m-0">
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
23
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
24
|
+
</p>
|
|
25
|
+
</p-fieldset>
|
|
26
|
+
</div>
|
|
27
|
+
`,
|
|
28
|
+
standalone: true,
|
|
29
|
+
imports: [FieldsetModule]
|
|
30
|
+
})
|
|
31
|
+
export class FieldsetBasicDemo {}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Template
|
|
35
|
+
|
|
36
|
+
Header section can also be defined with custom content instead of primitive values.
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { Component } from '@angular/core';
|
|
40
|
+
import { AvatarModule } from '@exhaustive-ui/core/avatar';
|
|
41
|
+
import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
|
|
42
|
+
|
|
43
|
+
@Component({
|
|
44
|
+
template: `
|
|
45
|
+
<div class="card">
|
|
46
|
+
<p-fieldset>
|
|
47
|
+
<ng-template #header>
|
|
48
|
+
<div class="flex items-center gap-2 px-2">
|
|
49
|
+
<p-avatar image="https://exhaustive-ui.e-xiste.com/demo/avatar/amyelsner.png" shape="circle" />
|
|
50
|
+
<span class="font-bold">Amy Elsner</span>
|
|
51
|
+
</div>
|
|
52
|
+
</ng-template>
|
|
53
|
+
<p class="m-0">
|
|
54
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
55
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
56
|
+
</p>
|
|
57
|
+
</p-fieldset>
|
|
58
|
+
</div>
|
|
59
|
+
`,
|
|
60
|
+
standalone: true,
|
|
61
|
+
imports: [AvatarModule, FieldsetModule]
|
|
62
|
+
})
|
|
63
|
+
export class FieldsetTemplateDemo {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Toggleable
|
|
67
|
+
|
|
68
|
+
Content of the fieldset can be expanded and collapsed using toggleable option, default state is defined with collapsed option.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { Component } from '@angular/core';
|
|
72
|
+
import { FieldsetModule } from '@exhaustive-ui/core/fieldset';
|
|
73
|
+
|
|
74
|
+
@Component({
|
|
75
|
+
template: `
|
|
76
|
+
<div class="card">
|
|
77
|
+
<p-fieldset legend="Header" [toggleable]="true">
|
|
78
|
+
<p style="margin:0">
|
|
79
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
80
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
81
|
+
</p>
|
|
82
|
+
</p-fieldset>
|
|
83
|
+
</div>
|
|
84
|
+
`,
|
|
85
|
+
standalone: true,
|
|
86
|
+
imports: [FieldsetModule]
|
|
87
|
+
})
|
|
88
|
+
export class FieldsetToggleableDemo {}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Fieldset
|
|
92
|
+
|
|
93
|
+
Fieldset is a grouping component with the optional content toggle feature.
|
|
94
|
+
|
|
95
|
+
### Props
|
|
96
|
+
|
|
97
|
+
| Name | Type | Default | Description |
|
|
98
|
+
|------|------|---------|-------------|
|
|
99
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
100
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
101
|
+
| pt | InputSignal<FieldsetPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
102
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
103
|
+
| legend | InputSignal<string> | ... | Header text of the fieldset. |
|
|
104
|
+
| toggleable | InputSignalWithTransform<boolean, unknown> | false | When specified, content can toggled by clicking the legend. |
|
|
105
|
+
| style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the component. |
|
|
106
|
+
| styleClass | InputSignal<string> | ... | Style class of the component. |
|
|
107
|
+
| motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
|
|
108
|
+
| collapsed | ModelSignal<boolean> | ... | Defines the initial state of content, supports one or two-way binding as well. Emits `collapsedChange` with the new value when the collapsed state changes. |
|
|
109
|
+
|
|
110
|
+
### Emits
|
|
111
|
+
|
|
112
|
+
| Name | Parameters | Description |
|
|
113
|
+
|------|------------|-------------|
|
|
114
|
+
| onBeforeToggle | event: FieldsetBeforeToggleEvent | Callback to invoke before panel toggle. |
|
|
115
|
+
| onAfterToggle | event: FieldsetAfterToggleEvent | Callback to invoke after panel toggle. |
|
|
116
|
+
|
|
117
|
+
### Templates
|
|
118
|
+
|
|
119
|
+
| Name | Type | Description |
|
|
120
|
+
|------|------|-------------|
|
|
121
|
+
| header | TemplateRef<void> | Custom header template. |
|
|
122
|
+
| expandicon | TemplateRef<void> | Custom expand icon template. |
|
|
123
|
+
| collapseicon | TemplateRef<void> | Custom collapse icon template. |
|
|
124
|
+
| content | TemplateRef<void> | Custom content template. |
|
|
125
|
+
|
|
126
|
+
## Pass Through Options
|
|
127
|
+
|
|
128
|
+
| Name | Type | Description |
|
|
129
|
+
|------|------|-------------|
|
|
130
|
+
| root | PassThroughOption<HTMLFieldSetElement, I> | Used to pass attributes to the root's DOM element. |
|
|
131
|
+
| legend | PassThroughOption<HTMLLegendElement, I> | Used to pass attributes to the legend's DOM element. |
|
|
132
|
+
| toggleButton | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the toggle button's DOM element. |
|
|
133
|
+
| toggleIcon | PassThroughOption<SVGElement \| HTMLSpanElement, I> | Used to pass attributes to the toggle icon's DOM element. |
|
|
134
|
+
| legendLabel | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the legend label's DOM element. |
|
|
135
|
+
| contentContainer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content container's DOM element. |
|
|
136
|
+
| contentWrapper | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content wrapper DOM element. |
|
|
137
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
138
|
+
| motion | MotionOptions | Used to pass options to the motion component/directive. |
|
|
139
|
+
|
|
140
|
+
## Theming
|
|
141
|
+
|
|
142
|
+
### CSS Classes
|
|
143
|
+
|
|
144
|
+
| Class | Description |
|
|
145
|
+
|-------|-------------|
|
|
146
|
+
| p-fieldset | Class name of the root element |
|
|
147
|
+
| p-fieldset-legend | Class name of the legend element |
|
|
148
|
+
| p-fieldset-legend-label | Class name of the legend label element |
|
|
149
|
+
| p-fieldset-toggle-icon | Class name of the toggle icon element |
|
|
150
|
+
| p-fieldset-content-container | Class name of the content container element |
|
|
151
|
+
| p-fieldset-content-wrapper | Class name of the content wrapper element |
|
|
152
|
+
| p-fieldset-content | Class name of the content element |
|
|
153
|
+
|
|
154
|
+
### Design Tokens
|
|
155
|
+
|
|
156
|
+
| Token | CSS Variable | Description |
|
|
157
|
+
|-------|--------------|-------------|
|
|
158
|
+
| fieldset.background | --p-fieldset-background | Background of root |
|
|
159
|
+
| fieldset.border.color | --p-fieldset-border-color | Border color of root |
|
|
160
|
+
| fieldset.border.radius | --p-fieldset-border-radius | Border radius of root |
|
|
161
|
+
| fieldset.color | --p-fieldset-color | Color of root |
|
|
162
|
+
| fieldset.padding | --p-fieldset-padding | Padding of root |
|
|
163
|
+
| fieldset.transition.duration | --p-fieldset-transition-duration | Transition duration of root |
|
|
164
|
+
| fieldset.legend.background | --p-fieldset-legend-background | Background of legend |
|
|
165
|
+
| fieldset.legend.hover.background | --p-fieldset-legend-hover-background | Hover background of legend |
|
|
166
|
+
| fieldset.legend.color | --p-fieldset-legend-color | Color of legend |
|
|
167
|
+
| fieldset.legend.hover.color | --p-fieldset-legend-hover-color | Hover color of legend |
|
|
168
|
+
| fieldset.legend.border.radius | --p-fieldset-legend-border-radius | Border radius of legend |
|
|
169
|
+
| fieldset.legend.border.width | --p-fieldset-legend-border-width | Border width of legend |
|
|
170
|
+
| fieldset.legend.border.color | --p-fieldset-legend-border-color | Border color of legend |
|
|
171
|
+
| fieldset.legend.padding | --p-fieldset-legend-padding | Padding of legend |
|
|
172
|
+
| fieldset.legend.gap | --p-fieldset-legend-gap | Gap of legend |
|
|
173
|
+
| fieldset.legend.font.weight | --p-fieldset-legend-font-weight | Font weight of legend |
|
|
174
|
+
| fieldset.legend.focus.ring.width | --p-fieldset-legend-focus-ring-width | Focus ring width of legend |
|
|
175
|
+
| fieldset.legend.focus.ring.style | --p-fieldset-legend-focus-ring-style | Focus ring style of legend |
|
|
176
|
+
| fieldset.legend.focus.ring.color | --p-fieldset-legend-focus-ring-color | Focus ring color of legend |
|
|
177
|
+
| fieldset.legend.focus.ring.offset | --p-fieldset-legend-focus-ring-offset | Focus ring offset of legend |
|
|
178
|
+
| fieldset.legend.focus.ring.shadow | --p-fieldset-legend-focus-ring-shadow | Focus ring shadow of legend |
|
|
179
|
+
| fieldset.toggle.icon.color | --p-fieldset-toggle-icon-color | Color of toggle icon |
|
|
180
|
+
| fieldset.toggle.icon.hover.color | --p-fieldset-toggle-icon-hover-color | Hover color of toggle icon |
|
|
181
|
+
| fieldset.content.padding | --p-fieldset-content-padding | Padding of content |
|
|
182
|
+
|