@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,1206 @@
|
|
|
1
|
+
# Angular Select Component
|
|
2
|
+
|
|
3
|
+
Select is used to choose an item from a collection of options.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Value to describe the component can either be provided with ariaLabelledBy or ariaLabel props. The select element has a combobox role in addition to aria-haspopup and aria-expanded attributes. If the editable option is enabled aria-autocomplete is also added. The relation between the combobox and the popup is created with aria-controls and aria-activedescendant attribute is used to instruct screen reader which option to read during keyboard navigation within the popup list. The popup list has an id that refers to the aria-controls attribute of the combobox element and uses listbox as the role. Each list item has an option role, an id to match the aria-activedescendant of the input element along with aria-label , aria-selected and aria-disabled attributes. If filtering is enabled, filterInputProps can be defined to give aria-* props to the filter input element.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Select is used as a controlled component with ngModel property along with an options collection. Label and value of an option are defined with the optionLabel and optionValue properties respectively. Note that, when options are simple primitive values such as a string array, no optionLabel and optionValue would be necessary.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component, OnInit } from '@angular/core';
|
|
15
|
+
import { FormsModule } from '@angular/forms';
|
|
16
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
17
|
+
|
|
18
|
+
interface City {
|
|
19
|
+
name: string;
|
|
20
|
+
code: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
template: `
|
|
25
|
+
<div class="card flex justify-center">
|
|
26
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [SelectModule, FormsModule]
|
|
31
|
+
})
|
|
32
|
+
export class SelectBasicDemo implements OnInit {
|
|
33
|
+
cities: City[];
|
|
34
|
+
selectedCity: City | undefined;
|
|
35
|
+
|
|
36
|
+
ngOnInit() {
|
|
37
|
+
this.cities = [
|
|
38
|
+
{ name: 'New York', code: 'NY' },
|
|
39
|
+
{ name: 'Rome', code: 'RM' },
|
|
40
|
+
{ name: 'London', code: 'LDN' },
|
|
41
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
42
|
+
{ name: 'Paris', code: 'PRS' }
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Checkmark
|
|
49
|
+
|
|
50
|
+
An alternative way to highlight the selected option is displaying a checkmark instead.
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { Component, OnInit } from '@angular/core';
|
|
54
|
+
import { FormsModule } from '@angular/forms';
|
|
55
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
56
|
+
|
|
57
|
+
interface City {
|
|
58
|
+
name: string;
|
|
59
|
+
code: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@Component({
|
|
63
|
+
template: `
|
|
64
|
+
<div class="card flex justify-center">
|
|
65
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" [checkmark]="true" optionLabel="name" [showClear]="true" placeholder="Select a City" class="w-full md:w-56" />
|
|
66
|
+
</div>
|
|
67
|
+
`,
|
|
68
|
+
standalone: true,
|
|
69
|
+
imports: [SelectModule, FormsModule]
|
|
70
|
+
})
|
|
71
|
+
export class SelectCheckmarkDemo implements OnInit {
|
|
72
|
+
cities: City[];
|
|
73
|
+
selectedCity: City | undefined;
|
|
74
|
+
|
|
75
|
+
ngOnInit() {
|
|
76
|
+
this.cities = [
|
|
77
|
+
{ name: 'New York', code: 'NY' },
|
|
78
|
+
{ name: 'Rome', code: 'RM' },
|
|
79
|
+
{ name: 'London', code: 'LDN' },
|
|
80
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
81
|
+
{ name: 'Paris', code: 'PRS' }
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Clear Icon
|
|
88
|
+
|
|
89
|
+
When showClear is enabled, a clear icon is displayed to clear the value.
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { Component, OnInit } from '@angular/core';
|
|
93
|
+
import { FormsModule } from '@angular/forms';
|
|
94
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
95
|
+
|
|
96
|
+
interface City {
|
|
97
|
+
name: string;
|
|
98
|
+
code: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@Component({
|
|
102
|
+
template: `
|
|
103
|
+
<div class="card flex justify-center">
|
|
104
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" [showClear]="true" />
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
standalone: true,
|
|
108
|
+
imports: [SelectModule, FormsModule]
|
|
109
|
+
})
|
|
110
|
+
export class SelectCleariconDemo implements OnInit {
|
|
111
|
+
cities: City[];
|
|
112
|
+
selectedCity: City | undefined;
|
|
113
|
+
|
|
114
|
+
ngOnInit() {
|
|
115
|
+
this.cities = [
|
|
116
|
+
{ name: 'New York', code: 'NY' },
|
|
117
|
+
{ name: 'Rome', code: 'RM' },
|
|
118
|
+
{ name: 'London', code: 'LDN' },
|
|
119
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
120
|
+
{ name: 'Paris', code: 'PRS' }
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## customfilter-doc
|
|
127
|
+
|
|
128
|
+
Custom filter can be applied with the filterTemplate .
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { Component, OnInit } from '@angular/core';
|
|
132
|
+
import { FormsModule } from '@angular/forms';
|
|
133
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
134
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
135
|
+
import { InputGroupModule } from '@exhaustive-ui/core/inputgroup';
|
|
136
|
+
import { InputTextModule } from '@exhaustive-ui/core/inputtext';
|
|
137
|
+
import { Country } from '@/domain/customer';
|
|
138
|
+
|
|
139
|
+
interface City {
|
|
140
|
+
name: string;
|
|
141
|
+
code: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@Component({
|
|
145
|
+
template: `
|
|
146
|
+
<div class="card flex justify-center">
|
|
147
|
+
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" [filter]="true" filterBy="name" [showClear]="true" placeholder="Select a Country">
|
|
148
|
+
<ng-template pTemplate="filter" let-options="options">
|
|
149
|
+
<div class="flex gap-1">
|
|
150
|
+
<p-inputgroup (click)="$event.stopPropagation()">
|
|
151
|
+
<p-inputgroup-addon><i class="pi pi-search"></i></p-inputgroup-addon>
|
|
152
|
+
<input type="text" pInputText placeholder="Filter" [(ngModel)]="filterValue" (keyup)="customFilterFunction($event, options)" />
|
|
153
|
+
</p-inputgroup>
|
|
154
|
+
<p-button icon="pi pi-times" (click)="resetFunction(options)" severity="secondary" />
|
|
155
|
+
</div>
|
|
156
|
+
</ng-template>
|
|
157
|
+
<ng-template pTemplate="selectedItem" let-selectedOption>
|
|
158
|
+
<div class="flex items-center gap-2">
|
|
159
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedCountry.code.toLowerCase()" style="width: 18px" />
|
|
160
|
+
<div>{{ selectedOption.name }}</div>
|
|
161
|
+
</div>
|
|
162
|
+
</ng-template>
|
|
163
|
+
<ng-template let-country pTemplate="item">
|
|
164
|
+
<div class="flex items-center gap-2">
|
|
165
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
|
|
166
|
+
<div>{{ country.name }}</div>
|
|
167
|
+
</div>
|
|
168
|
+
</ng-template>
|
|
169
|
+
</p-select>
|
|
170
|
+
</div>
|
|
171
|
+
`,
|
|
172
|
+
standalone: true,
|
|
173
|
+
imports: [ButtonModule, SelectModule, InputGroupModule, InputTextModule, FormsModule]
|
|
174
|
+
})
|
|
175
|
+
export class SelectCustomfilterDemo implements OnInit {
|
|
176
|
+
countries: City[] | undefined;
|
|
177
|
+
selectedCountry: string | undefined;
|
|
178
|
+
filterValue: string | undefined = '';
|
|
179
|
+
|
|
180
|
+
ngOnInit() {
|
|
181
|
+
this.countries = [
|
|
182
|
+
{ name: 'Australia', code: 'AU' },
|
|
183
|
+
{ name: 'Brazil', code: 'BR' },
|
|
184
|
+
{ name: 'China', code: 'CN' },
|
|
185
|
+
{ name: 'Egypt', code: 'EG' },
|
|
186
|
+
{ name: 'France', code: 'FR' },
|
|
187
|
+
{ name: 'Germany', code: 'DE' },
|
|
188
|
+
{ name: 'India', code: 'IN' },
|
|
189
|
+
{ name: 'Japan', code: 'JP' },
|
|
190
|
+
{ name: 'Spain', code: 'ES' },
|
|
191
|
+
{ name: 'United States', code: 'US' }
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
resetFunction(options: SelectFilterOptions) {
|
|
196
|
+
options.reset();
|
|
197
|
+
this.filterValue = '';
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
customFilterFunction(event: KeyboardEvent, options: SelectFilterOptions) {
|
|
201
|
+
options.filter(event);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Disabled
|
|
207
|
+
|
|
208
|
+
When disabled is present, the element cannot be edited and focused.
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { Component, OnInit } from '@angular/core';
|
|
212
|
+
import { FormsModule } from '@angular/forms';
|
|
213
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
214
|
+
|
|
215
|
+
interface City {
|
|
216
|
+
name: string;
|
|
217
|
+
code: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@Component({
|
|
221
|
+
template: `
|
|
222
|
+
<div class="card flex justify-center">
|
|
223
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" placeholder="Select a City" optionLabel="name" [disabled]="true" class="w-full md:w-56" />
|
|
224
|
+
</div>
|
|
225
|
+
`,
|
|
226
|
+
standalone: true,
|
|
227
|
+
imports: [SelectModule, FormsModule]
|
|
228
|
+
})
|
|
229
|
+
export class SelectDisabledDemo implements OnInit {
|
|
230
|
+
cities: City[] | undefined;
|
|
231
|
+
selectedCity: City | undefined;
|
|
232
|
+
|
|
233
|
+
ngOnInit() {
|
|
234
|
+
this.cities = [
|
|
235
|
+
{ name: 'New York', code: 'NY' },
|
|
236
|
+
{ name: 'Rome', code: 'RM' },
|
|
237
|
+
{ name: 'London', code: 'LDN' },
|
|
238
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
239
|
+
{ name: 'Paris', code: 'PRS' }
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Editable
|
|
246
|
+
|
|
247
|
+
When editable is present, the input can also be entered with typing.
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
import { Component, OnInit } from '@angular/core';
|
|
251
|
+
import { FormsModule } from '@angular/forms';
|
|
252
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
253
|
+
|
|
254
|
+
interface City {
|
|
255
|
+
name: string;
|
|
256
|
+
code: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@Component({
|
|
260
|
+
template: `
|
|
261
|
+
<div class="card flex justify-center">
|
|
262
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" placeholder="Select a City" [editable]="true" optionLabel="name" class="w-full md:w-56" />
|
|
263
|
+
</div>
|
|
264
|
+
`,
|
|
265
|
+
standalone: true,
|
|
266
|
+
imports: [SelectModule, FormsModule]
|
|
267
|
+
})
|
|
268
|
+
export class SelectEditableDemo implements OnInit {
|
|
269
|
+
cities: City[] | undefined;
|
|
270
|
+
selectedCity: City | undefined;
|
|
271
|
+
|
|
272
|
+
ngOnInit() {
|
|
273
|
+
this.cities = [
|
|
274
|
+
{ name: 'New York', code: 'NY' },
|
|
275
|
+
{ name: 'Rome', code: 'RM' },
|
|
276
|
+
{ name: 'London', code: 'LDN' },
|
|
277
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
278
|
+
{ name: 'Paris', code: 'PRS' }
|
|
279
|
+
];
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Filled
|
|
285
|
+
|
|
286
|
+
Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
import { Component, OnInit } from '@angular/core';
|
|
290
|
+
import { FormsModule } from '@angular/forms';
|
|
291
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
292
|
+
|
|
293
|
+
interface City {
|
|
294
|
+
name: string;
|
|
295
|
+
code: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@Component({
|
|
299
|
+
template: `
|
|
300
|
+
<div class="card flex justify-center">
|
|
301
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" variant="filled" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
|
|
302
|
+
</div>
|
|
303
|
+
`,
|
|
304
|
+
standalone: true,
|
|
305
|
+
imports: [SelectModule, FormsModule]
|
|
306
|
+
})
|
|
307
|
+
export class SelectFilledDemo implements OnInit {
|
|
308
|
+
cities: City[];
|
|
309
|
+
selectedCity: City | undefined;
|
|
310
|
+
|
|
311
|
+
ngOnInit() {
|
|
312
|
+
this.cities = [
|
|
313
|
+
{ name: 'New York', code: 'NY' },
|
|
314
|
+
{ name: 'Rome', code: 'RM' },
|
|
315
|
+
{ name: 'London', code: 'LDN' },
|
|
316
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
317
|
+
{ name: 'Paris', code: 'PRS' }
|
|
318
|
+
];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Filter
|
|
324
|
+
|
|
325
|
+
Select provides built-in filtering that is enabled by adding the filter property.
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
import { Component, OnInit } from '@angular/core';
|
|
329
|
+
import { FormsModule } from '@angular/forms';
|
|
330
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
331
|
+
import { Country } from '@/domain/customer';
|
|
332
|
+
|
|
333
|
+
@Component({
|
|
334
|
+
template: `
|
|
335
|
+
<div class="card flex justify-center">
|
|
336
|
+
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" [filter]="true" filterBy="name" [showClear]="true" placeholder="Select a Country" class="w-full md:w-56">
|
|
337
|
+
<ng-template #selectedItem let-selectedOption>
|
|
338
|
+
<div class="flex items-center gap-2">
|
|
339
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedCountry.code.toLowerCase()" style="width: 18px" />
|
|
340
|
+
<div>{{ selectedOption.name }}</div>
|
|
341
|
+
</div>
|
|
342
|
+
</ng-template>
|
|
343
|
+
<ng-template let-country #item>
|
|
344
|
+
<div class="flex items-center gap-2">
|
|
345
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
|
|
346
|
+
<div>{{ country.name }}</div>
|
|
347
|
+
</div>
|
|
348
|
+
</ng-template>
|
|
349
|
+
</p-select>
|
|
350
|
+
</div>
|
|
351
|
+
`,
|
|
352
|
+
standalone: true,
|
|
353
|
+
imports: [SelectModule, FormsModule]
|
|
354
|
+
})
|
|
355
|
+
export class SelectFilterDemo implements OnInit {
|
|
356
|
+
countries: any[] | undefined;
|
|
357
|
+
selectedCountry: string | undefined;
|
|
358
|
+
|
|
359
|
+
ngOnInit() {
|
|
360
|
+
this.countries = [
|
|
361
|
+
{ name: 'Australia', code: 'AU' },
|
|
362
|
+
{ name: 'Brazil', code: 'BR' },
|
|
363
|
+
{ name: 'China', code: 'CN' },
|
|
364
|
+
{ name: 'Egypt', code: 'EG' },
|
|
365
|
+
{ name: 'France', code: 'FR' },
|
|
366
|
+
{ name: 'Germany', code: 'DE' },
|
|
367
|
+
{ name: 'India', code: 'IN' },
|
|
368
|
+
{ name: 'Japan', code: 'JP' },
|
|
369
|
+
{ name: 'Spain', code: 'ES' },
|
|
370
|
+
{ name: 'United States', code: 'US' }
|
|
371
|
+
];
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## Float Label
|
|
377
|
+
|
|
378
|
+
A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information.
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
import { Component, OnInit } from '@angular/core';
|
|
382
|
+
import { FormsModule } from '@angular/forms';
|
|
383
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
384
|
+
import { FloatLabelModule } from '@exhaustive-ui/core/floatlabel';
|
|
385
|
+
|
|
386
|
+
interface City {
|
|
387
|
+
name: string;
|
|
388
|
+
code: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@Component({
|
|
392
|
+
template: `
|
|
393
|
+
<div class="card flex flex-wrap justify-center items-end gap-4">
|
|
394
|
+
<p-floatlabel class="w-full md:w-56">
|
|
395
|
+
<p-select [(ngModel)]="value1" inputId="over_label" [options]="cities" optionLabel="name" class="w-full" />
|
|
396
|
+
<label for="over_label">Over Label</label>
|
|
397
|
+
</p-floatlabel>
|
|
398
|
+
<p-floatlabel class="w-full md:w-56" variant="in">
|
|
399
|
+
<p-select [(ngModel)]="value2" inputId="in_label" [options]="cities" optionLabel="name" class="w-full" variant="filled" />
|
|
400
|
+
<label for="in_label">In Label</label>
|
|
401
|
+
</p-floatlabel>
|
|
402
|
+
<p-floatlabel class="w-full md:w-56" variant="on">
|
|
403
|
+
<p-select [(ngModel)]="value3" inputId="on_label" [options]="cities" optionLabel="name" class="w-full" />
|
|
404
|
+
<label for="on_label">On Label</label>
|
|
405
|
+
</p-floatlabel>
|
|
406
|
+
</div>
|
|
407
|
+
`,
|
|
408
|
+
standalone: true,
|
|
409
|
+
imports: [SelectModule, FloatLabelModule, FormsModule]
|
|
410
|
+
})
|
|
411
|
+
export class SelectFloatlabelDemo implements OnInit {
|
|
412
|
+
cities: City[] | undefined;
|
|
413
|
+
value1: City | undefined;
|
|
414
|
+
value2: City | undefined;
|
|
415
|
+
value3: City | undefined;
|
|
416
|
+
|
|
417
|
+
ngOnInit() {
|
|
418
|
+
this.cities = [
|
|
419
|
+
{ name: 'New York', code: 'NY' },
|
|
420
|
+
{ name: 'Rome', code: 'RM' },
|
|
421
|
+
{ name: 'London', code: 'LDN' },
|
|
422
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
423
|
+
{ name: 'Paris', code: 'PRS' }
|
|
424
|
+
];
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## Fluid
|
|
430
|
+
|
|
431
|
+
The fluid prop makes the component take up the full width of its container when set to true.
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
import { Component, OnInit } from '@angular/core';
|
|
435
|
+
import { FormsModule } from '@angular/forms';
|
|
436
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
437
|
+
|
|
438
|
+
interface City {
|
|
439
|
+
name: string;
|
|
440
|
+
code: string;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
@Component({
|
|
444
|
+
template: `
|
|
445
|
+
<div class="card">
|
|
446
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" fluid />
|
|
447
|
+
</div>
|
|
448
|
+
`,
|
|
449
|
+
standalone: true,
|
|
450
|
+
imports: [SelectModule, FormsModule]
|
|
451
|
+
})
|
|
452
|
+
export class SelectFluidDemo implements OnInit {
|
|
453
|
+
cities: City[];
|
|
454
|
+
selectedCity: City | undefined;
|
|
455
|
+
|
|
456
|
+
ngOnInit() {
|
|
457
|
+
this.cities = [
|
|
458
|
+
{ name: 'New York', code: 'NY' },
|
|
459
|
+
{ name: 'Rome', code: 'RM' },
|
|
460
|
+
{ name: 'London', code: 'LDN' },
|
|
461
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
462
|
+
{ name: 'Paris', code: 'PRS' }
|
|
463
|
+
];
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
## Group
|
|
469
|
+
|
|
470
|
+
Options can be grouped when a nested data structures is provided.
|
|
471
|
+
|
|
472
|
+
```typescript
|
|
473
|
+
import { Component } from '@angular/core';
|
|
474
|
+
import { FormsModule } from '@angular/forms';
|
|
475
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
476
|
+
import { SelectItemGroup } from '@exhaustive-ui/core/api';
|
|
477
|
+
|
|
478
|
+
@Component({
|
|
479
|
+
template: `
|
|
480
|
+
<div class="card flex justify-center">
|
|
481
|
+
<p-select [options]="groupedCities" [(ngModel)]="selectedCity" placeholder="Select a City" [group]="true" class="w-full md:w-56">
|
|
482
|
+
<ng-template let-group #group>
|
|
483
|
+
<div class="flex items-center">
|
|
484
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'mr-2 flag flag-' + group.value" style="width: 20px" />
|
|
485
|
+
<span>{{ group.label }}</span>
|
|
486
|
+
</div>
|
|
487
|
+
</ng-template>
|
|
488
|
+
</p-select>
|
|
489
|
+
</div>
|
|
490
|
+
`,
|
|
491
|
+
standalone: true,
|
|
492
|
+
imports: [SelectModule, FormsModule]
|
|
493
|
+
})
|
|
494
|
+
export class SelectGroupDemo {
|
|
495
|
+
groupedCities: SelectItemGroup[];
|
|
496
|
+
selectedCity: string | undefined;
|
|
497
|
+
|
|
498
|
+
constructor() {
|
|
499
|
+
this.groupedCities = [
|
|
500
|
+
{
|
|
501
|
+
label: 'Germany',
|
|
502
|
+
value: 'de',
|
|
503
|
+
items: [
|
|
504
|
+
{ label: 'Berlin', value: 'Berlin' },
|
|
505
|
+
{ label: 'Frankfurt', value: 'Frankfurt' },
|
|
506
|
+
{ label: 'Hamburg', value: 'Hamburg' },
|
|
507
|
+
{ label: 'Munich', value: 'Munich' }
|
|
508
|
+
]
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
label: 'USA',
|
|
512
|
+
value: 'us',
|
|
513
|
+
items: [
|
|
514
|
+
{ label: 'Chicago', value: 'Chicago' },
|
|
515
|
+
{ label: 'Los Angeles', value: 'Los Angeles' },
|
|
516
|
+
{ label: 'New York', value: 'New York' },
|
|
517
|
+
{ label: 'San Francisco', value: 'San Francisco' }
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
label: 'Japan',
|
|
522
|
+
value: 'jp',
|
|
523
|
+
items: [
|
|
524
|
+
{ label: 'Kyoto', value: 'Kyoto' },
|
|
525
|
+
{ label: 'Osaka', value: 'Osaka' },
|
|
526
|
+
{ label: 'Tokyo', value: 'Tokyo' },
|
|
527
|
+
{ label: 'Yokohama', value: 'Yokohama' }
|
|
528
|
+
]
|
|
529
|
+
}
|
|
530
|
+
];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
## Ifta Label
|
|
536
|
+
|
|
537
|
+
IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
import { Component, OnInit } from '@angular/core';
|
|
541
|
+
import { FormsModule } from '@angular/forms';
|
|
542
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
543
|
+
import { IftaLabelModule } from '@exhaustive-ui/core/iftalabel';
|
|
544
|
+
|
|
545
|
+
interface City {
|
|
546
|
+
name: string;
|
|
547
|
+
code: string;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
@Component({
|
|
551
|
+
template: `
|
|
552
|
+
<div class="card flex justify-center">
|
|
553
|
+
<p-iftalabel class="w-full md:w-56">
|
|
554
|
+
<p-select [(ngModel)]="selectedCity" inputId="dd-city" [options]="cities" optionLabel="name" class="w-full" />
|
|
555
|
+
<label for="dd-city">City</label>
|
|
556
|
+
</p-iftalabel>
|
|
557
|
+
</div>
|
|
558
|
+
`,
|
|
559
|
+
standalone: true,
|
|
560
|
+
imports: [SelectModule, IftaLabelModule, FormsModule]
|
|
561
|
+
})
|
|
562
|
+
export class SelectIftalabelDemo implements OnInit {
|
|
563
|
+
cities: City[] | undefined;
|
|
564
|
+
selectedCity: City | undefined;
|
|
565
|
+
|
|
566
|
+
ngOnInit() {
|
|
567
|
+
this.cities = [
|
|
568
|
+
{ name: 'New York', code: 'NY' },
|
|
569
|
+
{ name: 'Rome', code: 'RM' },
|
|
570
|
+
{ name: 'London', code: 'LDN' },
|
|
571
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
572
|
+
{ name: 'Paris', code: 'PRS' }
|
|
573
|
+
];
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
## Invalid
|
|
579
|
+
|
|
580
|
+
The invalid state is applied using the invalid property to indicate failed validation, which can be integrated with Angular Forms.
|
|
581
|
+
|
|
582
|
+
```typescript
|
|
583
|
+
import { Component } from '@angular/core';
|
|
584
|
+
import { FormsModule } from '@angular/forms';
|
|
585
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
586
|
+
|
|
587
|
+
interface City {
|
|
588
|
+
name: string;
|
|
589
|
+
code: string;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
@Component({
|
|
593
|
+
template: `
|
|
594
|
+
<div class="card flex justify-center gap-4">
|
|
595
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity1" optionLabel="name" [showClear]="true" [invalid]="value1" placeholder="Select a City" class="w-full md:w-56" />
|
|
596
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity2" optionLabel="name" [showClear]="true" [invalid]="value2" placeholder="Select a City" class="w-full md:w-56" variant="filled" />
|
|
597
|
+
</div>
|
|
598
|
+
`,
|
|
599
|
+
standalone: true,
|
|
600
|
+
imports: [SelectModule, FormsModule]
|
|
601
|
+
})
|
|
602
|
+
export class SelectInvalidDemo {
|
|
603
|
+
cities: City[];
|
|
604
|
+
selectedCity1: City | undefined;
|
|
605
|
+
selectedCity2: City | undefined;
|
|
606
|
+
value1: boolean = true;
|
|
607
|
+
value2: boolean = true;
|
|
608
|
+
}
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
## Lazy Virtual Scroll
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
import { Component } from '@angular/core';
|
|
615
|
+
import { FormsModule } from '@angular/forms';
|
|
616
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
617
|
+
import { SelectItem } from '@exhaustive-ui/core/api';
|
|
618
|
+
|
|
619
|
+
@Component({
|
|
620
|
+
template: `
|
|
621
|
+
<div class="card flex justify-center">
|
|
622
|
+
<p-select [options]="items" [(ngModel)]="selectedItem" placeholder="Select Item" [virtualScroll]="true" [virtualScrollItemSize]="32" [virtualScrollOptions]="options" class="w-full md:w-56" />
|
|
623
|
+
</div>
|
|
624
|
+
`,
|
|
625
|
+
standalone: true,
|
|
626
|
+
imports: [SelectModule, FormsModule]
|
|
627
|
+
})
|
|
628
|
+
export class SelectLazyvirtualscrollDemo {
|
|
629
|
+
items: SelectItem[];
|
|
630
|
+
selectedItem: string | undefined;
|
|
631
|
+
loading: boolean = false;
|
|
632
|
+
loadLazyTimeout: any = null;
|
|
633
|
+
options: ScrollerOptions;
|
|
634
|
+
|
|
635
|
+
constructor() {
|
|
636
|
+
this.items = [];
|
|
637
|
+
for (let i = 0; i < 10000; i++) {
|
|
638
|
+
this.items.push({ label: 'Item ' + i, value: 'Item ' + i });
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
onLazyLoad(event) {
|
|
643
|
+
this.loading = true;
|
|
644
|
+
|
|
645
|
+
if (this.loadLazyTimeout) {
|
|
646
|
+
clearTimeout(this.loadLazyTimeout);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
//imitate delay of a backend call
|
|
650
|
+
this.loadLazyTimeout = setTimeout(
|
|
651
|
+
() => {
|
|
652
|
+
const { first, last } = event;
|
|
653
|
+
const items = [...this.items];
|
|
654
|
+
|
|
655
|
+
for (let i = first; i < last; i++) {
|
|
656
|
+
items[i] = { label: `Item #${i}`, value: i };
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
this.items = items;
|
|
660
|
+
this.loading = false;
|
|
661
|
+
},
|
|
662
|
+
Math.random() * 1000 + 250
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
## Loading State
|
|
669
|
+
|
|
670
|
+
Loading state can be used loading property.
|
|
671
|
+
|
|
672
|
+
```typescript
|
|
673
|
+
import { Component, OnInit } from '@angular/core';
|
|
674
|
+
import { FormsModule } from '@angular/forms';
|
|
675
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
676
|
+
|
|
677
|
+
interface City {
|
|
678
|
+
name: string;
|
|
679
|
+
code: string;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
@Component({
|
|
683
|
+
template: `
|
|
684
|
+
<div class="card flex justify-center">
|
|
685
|
+
<p-select [options]="cities" [(ngModel)]="selectedCity" [loading]="true" optionLabel="name" placeholder="Loading..." class="w-full md:w-56" />
|
|
686
|
+
</div>
|
|
687
|
+
`,
|
|
688
|
+
standalone: true,
|
|
689
|
+
imports: [SelectModule, FormsModule]
|
|
690
|
+
})
|
|
691
|
+
export class SelectLoadingstateDemo implements OnInit {
|
|
692
|
+
cities: City[];
|
|
693
|
+
selectedCity: City | undefined;
|
|
694
|
+
|
|
695
|
+
ngOnInit() {
|
|
696
|
+
this.cities = [
|
|
697
|
+
{ name: 'New York', code: 'NY' },
|
|
698
|
+
{ name: 'Rome', code: 'RM' },
|
|
699
|
+
{ name: 'London', code: 'LDN' },
|
|
700
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
701
|
+
{ name: 'Paris', code: 'PRS' }
|
|
702
|
+
];
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
## reactiveforms-doc
|
|
708
|
+
|
|
709
|
+
Select can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
|
|
710
|
+
|
|
711
|
+
```typescript
|
|
712
|
+
import { Component, inject } from '@angular/core';
|
|
713
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
714
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
715
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
716
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
717
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
718
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
719
|
+
|
|
720
|
+
interface City {
|
|
721
|
+
name: string;
|
|
722
|
+
code: string;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
@Component({
|
|
726
|
+
template: `
|
|
727
|
+
<p-toast />
|
|
728
|
+
<div class="card flex justify-center">
|
|
729
|
+
<form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4 w-full sm:w-56">
|
|
730
|
+
<div class="flex flex-col gap-1">
|
|
731
|
+
<p-select formControlName="city" [options]="cities" [invalid]="isInvalid('city')" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
|
|
732
|
+
@if (isInvalid('city')) {
|
|
733
|
+
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
|
|
734
|
+
}
|
|
735
|
+
</div>
|
|
736
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
737
|
+
</form>
|
|
738
|
+
</div>
|
|
739
|
+
`,
|
|
740
|
+
standalone: true,
|
|
741
|
+
imports: [SelectModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
|
|
742
|
+
})
|
|
743
|
+
export class SelectReactiveformsDemo {
|
|
744
|
+
messageService = inject(MessageService);
|
|
745
|
+
cities: City[];
|
|
746
|
+
exampleForm: FormGroup | undefined;
|
|
747
|
+
formSubmitted: boolean = false;
|
|
748
|
+
|
|
749
|
+
constructor() {
|
|
750
|
+
this.exampleForm = this.fb.group({
|
|
751
|
+
city: ['', Validators.required]
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
onSubmit() {
|
|
756
|
+
this.formSubmitted = true;
|
|
757
|
+
if (this.exampleForm.valid) {
|
|
758
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
|
|
759
|
+
this.exampleForm.reset();
|
|
760
|
+
this.formSubmitted = false;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
isInvalid(controlName: string) {
|
|
765
|
+
const control = this.exampleForm.get(controlName);
|
|
766
|
+
return control?.invalid && (control.touched || this.formSubmitted);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
## Sizes
|
|
772
|
+
|
|
773
|
+
Select provides small and large sizes as alternatives to the base.
|
|
774
|
+
|
|
775
|
+
```typescript
|
|
776
|
+
import { Component, OnInit } from '@angular/core';
|
|
777
|
+
import { FormsModule } from '@angular/forms';
|
|
778
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
779
|
+
|
|
780
|
+
interface City {
|
|
781
|
+
name: string;
|
|
782
|
+
code: string;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
@Component({
|
|
786
|
+
template: `
|
|
787
|
+
<div class="card flex flex-col items-center gap-4">
|
|
788
|
+
<p-select [(ngModel)]="value1" [options]="cities" optionLabel="name" size="small" placeholder="Small" class="w-full md:w-56" />
|
|
789
|
+
<p-select [(ngModel)]="value2" [options]="cities" optionLabel="name" placeholder="Normal" class="w-full md:w-56" />
|
|
790
|
+
<p-select [(ngModel)]="value3" [options]="cities" optionLabel="name" size="large" placeholder="Large" class="w-full md:w-56" />
|
|
791
|
+
</div>
|
|
792
|
+
`,
|
|
793
|
+
standalone: true,
|
|
794
|
+
imports: [SelectModule, FormsModule]
|
|
795
|
+
})
|
|
796
|
+
export class SelectSizesDemo implements OnInit {
|
|
797
|
+
value1: City | undefined;
|
|
798
|
+
value2: City | undefined;
|
|
799
|
+
value3: City | undefined;
|
|
800
|
+
cities: City[];
|
|
801
|
+
|
|
802
|
+
ngOnInit() {
|
|
803
|
+
this.cities = [
|
|
804
|
+
{ name: 'New York', code: 'NY' },
|
|
805
|
+
{ name: 'Rome', code: 'RM' },
|
|
806
|
+
{ name: 'London', code: 'LDN' },
|
|
807
|
+
{ name: 'Istanbul', code: 'IST' },
|
|
808
|
+
{ name: 'Paris', code: 'PRS' }
|
|
809
|
+
];
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
## Template
|
|
815
|
+
|
|
816
|
+
Both the selected option and the options list can be templated to provide customizated representation. Use selectedItem template to customize the selected label display and the item template to change the content of the options in the select panel. In addition when grouping is enabled, group template is available to customize the option groups. All templates get the option instance as the default local template variable.
|
|
817
|
+
|
|
818
|
+
```typescript
|
|
819
|
+
import { Component, OnInit } from '@angular/core';
|
|
820
|
+
import { FormsModule } from '@angular/forms';
|
|
821
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
822
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
823
|
+
|
|
824
|
+
@Component({
|
|
825
|
+
template: `
|
|
826
|
+
<div class="card flex justify-center">
|
|
827
|
+
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" placeholder="Select a country" class="w-full md:w-56">
|
|
828
|
+
<ng-template #selectedItem let-selectedOption>
|
|
829
|
+
<div class="flex items-center gap-2" *ngIf="selectedOption">
|
|
830
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedOption.code.toLowerCase()" style="width: 18px" />
|
|
831
|
+
<div>{{ selectedOption.name }}</div>
|
|
832
|
+
</div>
|
|
833
|
+
</ng-template>
|
|
834
|
+
<ng-template let-country #item>
|
|
835
|
+
<div class="flex items-center gap-2">
|
|
836
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
|
|
837
|
+
<div>{{ country.name }}</div>
|
|
838
|
+
</div>
|
|
839
|
+
</ng-template>
|
|
840
|
+
<ng-template #dropdownicon>
|
|
841
|
+
<i class="pi pi-map"></i>
|
|
842
|
+
</ng-template>
|
|
843
|
+
<ng-template #header>
|
|
844
|
+
<div class="font-medium p-3">Available Countries</div>
|
|
845
|
+
</ng-template>
|
|
846
|
+
<ng-template #footer>
|
|
847
|
+
<div class="p-3">
|
|
848
|
+
<p-button label="Add New" fluid severity="secondary" text size="small" icon="pi pi-plus" />
|
|
849
|
+
</div>
|
|
850
|
+
</ng-template>
|
|
851
|
+
</p-select>
|
|
852
|
+
</div>
|
|
853
|
+
`,
|
|
854
|
+
standalone: true,
|
|
855
|
+
imports: [ButtonModule, SelectModule, FormsModule]
|
|
856
|
+
})
|
|
857
|
+
export class SelectTemplateDemo implements OnInit {
|
|
858
|
+
countries: any[] | undefined;
|
|
859
|
+
selectedCountry: string | undefined;
|
|
860
|
+
|
|
861
|
+
ngOnInit() {
|
|
862
|
+
this.countries = [
|
|
863
|
+
{ name: 'Australia', code: 'AU' },
|
|
864
|
+
{ name: 'Brazil', code: 'BR' },
|
|
865
|
+
{ name: 'China', code: 'CN' },
|
|
866
|
+
{ name: 'Egypt', code: 'EG' },
|
|
867
|
+
{ name: 'France', code: 'FR' },
|
|
868
|
+
{ name: 'Germany', code: 'DE' },
|
|
869
|
+
{ name: 'India', code: 'IN' },
|
|
870
|
+
{ name: 'Japan', code: 'JP' },
|
|
871
|
+
{ name: 'Spain', code: 'ES' },
|
|
872
|
+
{ name: 'United States', code: 'US' }
|
|
873
|
+
];
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
## templatedrivenforms-doc
|
|
879
|
+
|
|
880
|
+
```typescript
|
|
881
|
+
import { Component, inject } from '@angular/core';
|
|
882
|
+
import { FormsModule } from '@angular/forms';
|
|
883
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
884
|
+
import { MessageModule } from '@exhaustive-ui/core/message';
|
|
885
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
886
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
887
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
888
|
+
|
|
889
|
+
interface City {
|
|
890
|
+
name: string;
|
|
891
|
+
code: string;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
@Component({
|
|
895
|
+
template: `
|
|
896
|
+
<p-toast />
|
|
897
|
+
<div class="card flex justify-center">
|
|
898
|
+
<form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4 w-full sm:w-56">
|
|
899
|
+
<div class="flex flex-col gap-1">
|
|
900
|
+
<p-select
|
|
901
|
+
#city="ngModel"
|
|
902
|
+
[(ngModel)]="selectedCity"
|
|
903
|
+
[options]="cities"
|
|
904
|
+
[invalid]="city.invalid && (city.touched || exampleForm.submitted)"
|
|
905
|
+
optionLabel="name"
|
|
906
|
+
name="city"
|
|
907
|
+
placeholder="Select a City"
|
|
908
|
+
class="w-full md:w-56"
|
|
909
|
+
required
|
|
910
|
+
/>
|
|
911
|
+
@if (city.invalid && (city.touched || exampleForm.submitted)) {
|
|
912
|
+
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
|
|
913
|
+
}
|
|
914
|
+
</div>
|
|
915
|
+
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
|
|
916
|
+
</form>
|
|
917
|
+
</div>
|
|
918
|
+
`,
|
|
919
|
+
standalone: true,
|
|
920
|
+
imports: [SelectModule, MessageModule, ToastModule, ButtonModule, FormsModule]
|
|
921
|
+
})
|
|
922
|
+
export class SelectTemplatedrivenformsDemo {
|
|
923
|
+
messageService = inject(MessageService);
|
|
924
|
+
cities: City[];
|
|
925
|
+
selectedCity: City | undefined;
|
|
926
|
+
|
|
927
|
+
onSubmit(form: any) {
|
|
928
|
+
if (form.valid) {
|
|
929
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
|
|
930
|
+
form.resetForm();
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
## Virtual Scroll
|
|
937
|
+
|
|
938
|
+
VirtualScrolling is an efficient way of rendering the options by displaying a small subset of data in the viewport at any time. When dealing with huge number of options, it is suggested to enable VirtualScrolling to avoid performance issues. Usage is simple as setting virtualScroll property to true and defining virtualScrollItemSize to specify the height of an item.
|
|
939
|
+
|
|
940
|
+
```typescript
|
|
941
|
+
import { Component } from '@angular/core';
|
|
942
|
+
import { FormsModule } from '@angular/forms';
|
|
943
|
+
import { SelectModule } from '@exhaustive-ui/core/select';
|
|
944
|
+
import { SelectItem } from '@exhaustive-ui/core/api';
|
|
945
|
+
|
|
946
|
+
@Component({
|
|
947
|
+
template: `
|
|
948
|
+
<div class="card flex justify-center">
|
|
949
|
+
<p-select [options]="items" [(ngModel)]="selectedItem" placeholder="Select Item" [virtualScroll]="true" [virtualScrollItemSize]="32" class="w-full md:w-56" />
|
|
950
|
+
</div>
|
|
951
|
+
`,
|
|
952
|
+
standalone: true,
|
|
953
|
+
imports: [SelectModule, FormsModule]
|
|
954
|
+
})
|
|
955
|
+
export class SelectVirtualscrollDemo {
|
|
956
|
+
items: SelectItem[];
|
|
957
|
+
selectedItem: string | undefined;
|
|
958
|
+
|
|
959
|
+
constructor() {
|
|
960
|
+
this.items = [];
|
|
961
|
+
for (let i = 0; i < 10000; i++) {
|
|
962
|
+
this.items.push({ label: 'Item ' + i, value: 'Item ' + i });
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
## Select
|
|
969
|
+
|
|
970
|
+
Select is used to choose an item from a collection of options.
|
|
971
|
+
|
|
972
|
+
### Props
|
|
973
|
+
|
|
974
|
+
| Name | Type | Default | Description |
|
|
975
|
+
|------|------|---------|-------------|
|
|
976
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
977
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
978
|
+
| pt | InputSignal<SelectPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
979
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
980
|
+
| required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
|
|
981
|
+
| invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
|
|
982
|
+
| disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
|
|
983
|
+
| name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
|
|
984
|
+
| fluid | InputSignalWithTransform<boolean, unknown> | false | Spans 100% width of the container when enabled. |
|
|
985
|
+
| variant | InputSignal<"outlined" \| "filled"> | 'outlined' | Specifies the input variant of the component. |
|
|
986
|
+
| size | InputSignal<"small" \| "large"> | undefined | Specifies the size of the component. |
|
|
987
|
+
| inputSize | InputSignal<number> | undefined | Specifies the visible width of the input element in characters. |
|
|
988
|
+
| pattern | InputSignal<string> | undefined | Specifies the value must match the pattern. |
|
|
989
|
+
| min | InputSignal<number> | undefined | The value must be greater than or equal to the value. |
|
|
990
|
+
| max | InputSignal<number> | undefined | The value must be less than or equal to the value. |
|
|
991
|
+
| step | InputSignal<number> | undefined | Unless the step is set to the any literal, the value must be min + an integral multiple of the step. |
|
|
992
|
+
| minlength | InputSignal<number> | undefined | The number of characters (code points) must not be less than the value of the attribute, if non-empty. |
|
|
993
|
+
| maxlength | InputSignal<number> | undefined | The number of characters (code points) must not exceed the value of the attribute. |
|
|
994
|
+
| id | InputSignal<string> | ... | Unique identifier of the component |
|
|
995
|
+
| scrollHeight | InputSignal<string> | ... | Height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. |
|
|
996
|
+
| filter | InputSignalWithTransform<boolean, unknown> | ... | When specified, displays an input field to filter the items on keyup. |
|
|
997
|
+
| panelStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the overlay panel element. |
|
|
998
|
+
| panelStyleClass | InputSignal<string> | ... | Style class of the overlay panel element. |
|
|
999
|
+
| readonly | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component cannot be edited. |
|
|
1000
|
+
| editable | InputSignalWithTransform<boolean, unknown> | ... | When present, custom value instead of predefined options can be entered using the editable input field. |
|
|
1001
|
+
| tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
|
|
1002
|
+
| placeholder | InputSignal<string> | ... | Default text to display when no option is selected. |
|
|
1003
|
+
| loadingIcon | InputSignal<string> | ... | Icon to display in loading state. |
|
|
1004
|
+
| filterPlaceholder | InputSignal<string> | ... | Placeholder text to show when filter input is empty. |
|
|
1005
|
+
| filterLocale | InputSignal<string> | ... | Locale to use in filtering. The default locale is the host environment's current locale. |
|
|
1006
|
+
| inputId | InputSignal<string> | ... | Identifier of the accessible input element. |
|
|
1007
|
+
| dataKey | InputSignal<string> | ... | A property to uniquely identify a value in options. |
|
|
1008
|
+
| filterBy | InputSignal<string> | ... | When filtering is enabled, filterBy decides which field or fields (comma separated) to search against. |
|
|
1009
|
+
| filterFields | InputSignal<any[]> | ... | Fields used when filtering the options, defaults to optionLabel. |
|
|
1010
|
+
| autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
|
|
1011
|
+
| resetFilterOnHide | InputSignalWithTransform<boolean, unknown> | ... | Clears the filter value when hiding the select. |
|
|
1012
|
+
| checkmark | InputSignalWithTransform<boolean, unknown> | ... | Whether the selected option will be shown with a check mark. |
|
|
1013
|
+
| dropdownIcon | InputSignal<string> | ... | Icon class of the select icon. |
|
|
1014
|
+
| loading | InputSignalWithTransform<boolean, unknown> | ... | Whether the select is in loading state. |
|
|
1015
|
+
| optionLabel | InputSignal<string> | ... | Name of the label field of an option. |
|
|
1016
|
+
| optionValue | InputSignal<string> | ... | Name of the value field of an option. |
|
|
1017
|
+
| optionDisabled | InputSignal<string> | ... | Name of the disabled field of an option. |
|
|
1018
|
+
| optionGroupLabel | InputSignal<string> | ... | Name of the label field of an option group. |
|
|
1019
|
+
| optionGroupChildren | InputSignal<string> | ... | Name of the options field of an option group. |
|
|
1020
|
+
| group | InputSignalWithTransform<boolean, unknown> | ... | Whether to display options as grouped when nested options are provided. |
|
|
1021
|
+
| showClear | InputSignalWithTransform<boolean, unknown> | ... | When enabled, a clear icon is displayed to clear the value. |
|
|
1022
|
+
| emptyFilterMessage | InputSignal<string> | ... | Text to display when filtering does not return any results. Defaults to global value in i18n translation configuration. |
|
|
1023
|
+
| emptyMessage | InputSignal<string> | ... | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
|
|
1024
|
+
| lazy | InputSignalWithTransform<boolean, unknown> | ... | Defines if data is loaded and interacted with in lazy manner. |
|
|
1025
|
+
| virtualScroll | InputSignalWithTransform<boolean, unknown> | ... | Whether the data should be loaded on demand during scroll. |
|
|
1026
|
+
| virtualScrollItemSize | InputSignalWithTransform<number, unknown> | ... | Height of an item in the list for VirtualScrolling. |
|
|
1027
|
+
| virtualScrollOptions | InputSignal<ScrollerOptions> | ... | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
|
|
1028
|
+
| overlayOptions | InputSignal<OverlayOptions> | ... | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
|
|
1029
|
+
| ariaFilterLabel | InputSignal<string> | ... | Defines a string that labels the filter input. |
|
|
1030
|
+
| ariaLabel | InputSignal<string> | ... | Used to define a aria label attribute the current element. |
|
|
1031
|
+
| ariaLabelledBy | InputSignal<string> | ... | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
|
|
1032
|
+
| filterMatchMode | InputSignal<"gt" \| "lt" \| "in" \| "startsWith" \| "contains" \| "endsWith" \| "equals" \| "notEquals" \| "lte" \| "gte"> | ... | Defines how the items are filtered. |
|
|
1033
|
+
| tooltip | InputSignal<string> | ... | Advisory information to display in a tooltip on hover. |
|
|
1034
|
+
| tooltipPosition | InputSignal<"top" \| "bottom" \| "left" \| "right"> | ... | Position of the tooltip. |
|
|
1035
|
+
| tooltipPositionStyle | InputSignal<string> | ... | Type of CSS position. |
|
|
1036
|
+
| tooltipStyleClass | InputSignal<string> | ... | Style class of the tooltip. |
|
|
1037
|
+
| focusOnHover | InputSignalWithTransform<boolean, unknown> | ... | Fields used when filtering the options, defaults to optionLabel. |
|
|
1038
|
+
| selectOnFocus | InputSignalWithTransform<boolean, unknown> | ... | Determines if the option will be selected on focus. |
|
|
1039
|
+
| autoOptionFocus | InputSignalWithTransform<boolean, unknown> | ... | Whether to focus on the first visible or selected element when the overlay panel is shown. |
|
|
1040
|
+
| autofocusFilter | InputSignalWithTransform<boolean, unknown> | ... | Applies focus to the filter element when the overlay is shown. |
|
|
1041
|
+
| filterValue | InputSignal<string> | ... | When specified, filter displays with this value. |
|
|
1042
|
+
| options | InputSignal<any[]> | ... | An array of objects to display as the available options. |
|
|
1043
|
+
| appendTo | InputSignal<any> | 'self' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
|
|
1044
|
+
| motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
|
|
1045
|
+
|
|
1046
|
+
### Emits
|
|
1047
|
+
|
|
1048
|
+
| Name | Parameters | Description |
|
|
1049
|
+
|------|------------|-------------|
|
|
1050
|
+
| onChange | event: SelectChangeEvent | Callback to invoke when value of select changes. |
|
|
1051
|
+
| onFilter | event: SelectFilterEvent | Callback to invoke when data is filtered. |
|
|
1052
|
+
| onFocus | event: Event | Callback to invoke when select gets focus. |
|
|
1053
|
+
| onBlur | event: Event | Callback to invoke when select loses focus. |
|
|
1054
|
+
| onClick | event: MouseEvent | Callback to invoke when component is clicked. |
|
|
1055
|
+
| onShow | event: AnimationEvent | Callback to invoke when select overlay gets visible. |
|
|
1056
|
+
| onHide | event: AnimationEvent | Callback to invoke when select overlay gets hidden. |
|
|
1057
|
+
| onClear | event: Event | Callback to invoke when select clears the value. |
|
|
1058
|
+
| onLazyLoad | event: SelectLazyLoadEvent | Callback to invoke in lazy mode to load new data. |
|
|
1059
|
+
|
|
1060
|
+
### Templates
|
|
1061
|
+
|
|
1062
|
+
| Name | Type | Description |
|
|
1063
|
+
|------|------|-------------|
|
|
1064
|
+
| item | TemplateRef<SelectItemTemplateContext<any>> | Custom item template. |
|
|
1065
|
+
| group | TemplateRef<SelectGroupTemplateContext<any>> | Custom group template. |
|
|
1066
|
+
| loader | TemplateRef<SelectLoaderTemplateContext> | Custom loader template. |
|
|
1067
|
+
| selecteditem | TemplateRef<SelectSelectedItemTemplateContext<any>> | Custom selected item template. |
|
|
1068
|
+
| header | TemplateRef<void> | Custom header template. |
|
|
1069
|
+
| filter | TemplateRef<SelectFilterTemplateContext> | Custom filter template. |
|
|
1070
|
+
| footer | TemplateRef<void> | Custom footer template. |
|
|
1071
|
+
| emptyfilter | TemplateRef<void> | Custom empty filter template. |
|
|
1072
|
+
| empty | TemplateRef<void> | Custom empty template. |
|
|
1073
|
+
| dropdownicon | TemplateRef<SelectIconTemplateContext> | Custom dropdown icon template. |
|
|
1074
|
+
| loadingicon | TemplateRef<void> | Custom loading icon template. |
|
|
1075
|
+
| clearicon | TemplateRef<SelectIconTemplateContext> | Custom clear icon template. |
|
|
1076
|
+
| filtericon | TemplateRef<void> | Custom filter icon template. |
|
|
1077
|
+
|
|
1078
|
+
### Methods
|
|
1079
|
+
|
|
1080
|
+
| Name | Parameters | Return Type | Description |
|
|
1081
|
+
|------|------------|-------------|-------------|
|
|
1082
|
+
| resetFilter | | void | Callback to invoke on filter reset. |
|
|
1083
|
+
| show | isFocus: any | void | Displays the panel. |
|
|
1084
|
+
| hide | isFocus: any | void | Hides the panel. |
|
|
1085
|
+
| focus | | void | Applies focus. |
|
|
1086
|
+
| clear | event: Event | void | Clears the model. |
|
|
1087
|
+
|
|
1088
|
+
## Pass Through Options
|
|
1089
|
+
|
|
1090
|
+
| Name | Type | Description |
|
|
1091
|
+
|------|------|-------------|
|
|
1092
|
+
| root | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the root's DOM element. |
|
|
1093
|
+
| label | PassThroughOption<HTMLInputElement \| HTMLSpanElement, I> | Used to pass attributes to the label's DOM element. |
|
|
1094
|
+
| clearIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the clear icon's DOM element. |
|
|
1095
|
+
| dropdown | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the dropdown's DOM element. |
|
|
1096
|
+
| loadingIcon | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the loading icon's DOM element. |
|
|
1097
|
+
| dropdownIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the dropdown icon's DOM element. |
|
|
1098
|
+
| pcOverlay | OverlayPassThrough | Used to pass attributes to the Overlay component. |
|
|
1099
|
+
| header | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the header's DOM element. |
|
|
1100
|
+
| pcFilterContainer | IconFieldPassThrough | Used to pass attributes to the filter container's DOM element. |
|
|
1101
|
+
| pcFilter | InputTextPassThrough | Used to pass attributes to the filter input's DOM element. |
|
|
1102
|
+
| pcFilterIconContainer | InputIconPassThrough | Used to pass attributes to the filter icon container's DOM element. |
|
|
1103
|
+
| filterIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the filter icon's DOM element. |
|
|
1104
|
+
| listContainer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the list container's DOM element. |
|
|
1105
|
+
| virtualScroller | VirtualScrollerPassThrough | Used to pass attributes to the VirtualScroller component. |
|
|
1106
|
+
| list | PassThroughOption<HTMLUListElement, I> | Used to pass attributes to the list's DOM element. |
|
|
1107
|
+
| optionGroup | PassThroughOption<HTMLLIElement, I> | Used to pass attributes to the option group's DOM element. |
|
|
1108
|
+
| optionGroupLabel | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the option group label's DOM element. |
|
|
1109
|
+
| option | PassThroughOption<HTMLLIElement, I> | Used to pass attributes to the option's DOM element. |
|
|
1110
|
+
| optionCheckIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the option check icon's DOM element. |
|
|
1111
|
+
| optionBlankIcon | PassThroughOption<HTMLElement, I> | Used to pass attributes to the option blank icon's DOM element. |
|
|
1112
|
+
| optionLabel | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the option label's DOM element. |
|
|
1113
|
+
| emptyMessage | PassThroughOption<HTMLLIElement, I> | Used to pass attributes to the empty message's DOM element. |
|
|
1114
|
+
| hiddenFirstFocusableEl | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden first focusable element's DOM element. |
|
|
1115
|
+
| hiddenFilterResult | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden filter result's DOM element. |
|
|
1116
|
+
| hiddenEmptyMessage | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden empty message's DOM element. |
|
|
1117
|
+
| hiddenSelectedMessage | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden selected message's DOM element. |
|
|
1118
|
+
| hiddenLastFocusableEl | PassThroughOption<HTMLSpanElement, I> | Used to pass attributes to the hidden last focusable element's DOM element. |
|
|
1119
|
+
|
|
1120
|
+
## Theming
|
|
1121
|
+
|
|
1122
|
+
### CSS Classes
|
|
1123
|
+
|
|
1124
|
+
| Class | Description |
|
|
1125
|
+
|-------|-------------|
|
|
1126
|
+
| p-select | Class name of the root element |
|
|
1127
|
+
| p-select-label | Class name of the label element |
|
|
1128
|
+
| p-select-clear-icon | Class name of the clear icon element |
|
|
1129
|
+
| p-select-dropdown | Class name of the dropdown element |
|
|
1130
|
+
| p-select-loading-icon | Class name of the loadingicon element |
|
|
1131
|
+
| p-select-dropdown-icon | Class name of the dropdown icon element |
|
|
1132
|
+
| p-select-overlay | Class name of the overlay element |
|
|
1133
|
+
| p-select-header | Class name of the header element |
|
|
1134
|
+
| p-select-filter | Class name of the filter element |
|
|
1135
|
+
| p-select-list-container | Class name of the list container element |
|
|
1136
|
+
| p-select-list | Class name of the list element |
|
|
1137
|
+
| p-select-option-group | Class name of the option group element |
|
|
1138
|
+
| p-select-option-group-label | Class name of the option group label element |
|
|
1139
|
+
| p-select-option | Class name of the option element |
|
|
1140
|
+
| p-select-option-label | Class name of the option label element |
|
|
1141
|
+
| p-select-option-check-icon | Class name of the option check icon element |
|
|
1142
|
+
| p-select-option-blank-icon | Class name of the option blank icon element |
|
|
1143
|
+
| p-select-empty-message | Class name of the empty message element |
|
|
1144
|
+
|
|
1145
|
+
### Design Tokens
|
|
1146
|
+
|
|
1147
|
+
| Token | CSS Variable | Description |
|
|
1148
|
+
|-------|--------------|-------------|
|
|
1149
|
+
| select.background | --p-select-background | Background of root |
|
|
1150
|
+
| select.disabled.background | --p-select-disabled-background | Disabled background of root |
|
|
1151
|
+
| select.filled.background | --p-select-filled-background | Filled background of root |
|
|
1152
|
+
| select.filled.hover.background | --p-select-filled-hover-background | Filled hover background of root |
|
|
1153
|
+
| select.filled.focus.background | --p-select-filled-focus-background | Filled focus background of root |
|
|
1154
|
+
| select.border.color | --p-select-border-color | Border color of root |
|
|
1155
|
+
| select.hover.border.color | --p-select-hover-border-color | Hover border color of root |
|
|
1156
|
+
| select.focus.border.color | --p-select-focus-border-color | Focus border color of root |
|
|
1157
|
+
| select.invalid.border.color | --p-select-invalid-border-color | Invalid border color of root |
|
|
1158
|
+
| select.color | --p-select-color | Color of root |
|
|
1159
|
+
| select.disabled.color | --p-select-disabled-color | Disabled color of root |
|
|
1160
|
+
| select.placeholder.color | --p-select-placeholder-color | Placeholder color of root |
|
|
1161
|
+
| select.invalid.placeholder.color | --p-select-invalid-placeholder-color | Invalid placeholder color of root |
|
|
1162
|
+
| select.shadow | --p-select-shadow | Shadow of root |
|
|
1163
|
+
| select.padding.x | --p-select-padding-x | Padding x of root |
|
|
1164
|
+
| select.padding.y | --p-select-padding-y | Padding y of root |
|
|
1165
|
+
| select.border.radius | --p-select-border-radius | Border radius of root |
|
|
1166
|
+
| select.focus.ring.width | --p-select-focus-ring-width | Focus ring width of root |
|
|
1167
|
+
| select.focus.ring.style | --p-select-focus-ring-style | Focus ring style of root |
|
|
1168
|
+
| select.focus.ring.color | --p-select-focus-ring-color | Focus ring color of root |
|
|
1169
|
+
| select.focus.ring.offset | --p-select-focus-ring-offset | Focus ring offset of root |
|
|
1170
|
+
| select.focus.ring.shadow | --p-select-focus-ring-shadow | Focus ring shadow of root |
|
|
1171
|
+
| select.transition.duration | --p-select-transition-duration | Transition duration of root |
|
|
1172
|
+
| select.sm.font.size | --p-select-sm-font-size | Sm font size of root |
|
|
1173
|
+
| select.sm.padding.x | --p-select-sm-padding-x | Sm padding x of root |
|
|
1174
|
+
| select.sm.padding.y | --p-select-sm-padding-y | Sm padding y of root |
|
|
1175
|
+
| select.lg.font.size | --p-select-lg-font-size | Lg font size of root |
|
|
1176
|
+
| select.lg.padding.x | --p-select-lg-padding-x | Lg padding x of root |
|
|
1177
|
+
| select.lg.padding.y | --p-select-lg-padding-y | Lg padding y of root |
|
|
1178
|
+
| select.dropdown.width | --p-select-dropdown-width | Width of dropdown |
|
|
1179
|
+
| select.dropdown.color | --p-select-dropdown-color | Color of dropdown |
|
|
1180
|
+
| select.overlay.background | --p-select-overlay-background | Background of overlay |
|
|
1181
|
+
| select.overlay.border.color | --p-select-overlay-border-color | Border color of overlay |
|
|
1182
|
+
| select.overlay.border.radius | --p-select-overlay-border-radius | Border radius of overlay |
|
|
1183
|
+
| select.overlay.color | --p-select-overlay-color | Color of overlay |
|
|
1184
|
+
| select.overlay.shadow | --p-select-overlay-shadow | Shadow of overlay |
|
|
1185
|
+
| select.list.padding | --p-select-list-padding | Padding of list |
|
|
1186
|
+
| select.list.gap | --p-select-list-gap | Gap of list |
|
|
1187
|
+
| select.list.header.padding | --p-select-list-header-padding | Header padding of list |
|
|
1188
|
+
| select.option.focus.background | --p-select-option-focus-background | Focus background of option |
|
|
1189
|
+
| select.option.selected.background | --p-select-option-selected-background | Selected background of option |
|
|
1190
|
+
| select.option.selected.focus.background | --p-select-option-selected-focus-background | Selected focus background of option |
|
|
1191
|
+
| select.option.color | --p-select-option-color | Color of option |
|
|
1192
|
+
| select.option.focus.color | --p-select-option-focus-color | Focus color of option |
|
|
1193
|
+
| select.option.selected.color | --p-select-option-selected-color | Selected color of option |
|
|
1194
|
+
| select.option.selected.focus.color | --p-select-option-selected-focus-color | Selected focus color of option |
|
|
1195
|
+
| select.option.padding | --p-select-option-padding | Padding of option |
|
|
1196
|
+
| select.option.border.radius | --p-select-option-border-radius | Border radius of option |
|
|
1197
|
+
| select.option.group.background | --p-select-option-group-background | Background of option group |
|
|
1198
|
+
| select.option.group.color | --p-select-option-group-color | Color of option group |
|
|
1199
|
+
| select.option.group.font.weight | --p-select-option-group-font-weight | Font weight of option group |
|
|
1200
|
+
| select.option.group.padding | --p-select-option-group-padding | Padding of option group |
|
|
1201
|
+
| select.clear.icon.color | --p-select-clear-icon-color | Color of clear icon |
|
|
1202
|
+
| select.checkmark.color | --p-select-checkmark-color | Color of checkmark |
|
|
1203
|
+
| select.checkmark.gutter.start | --p-select-checkmark-gutter-start | Gutter start of checkmark |
|
|
1204
|
+
| select.checkmark.gutter.end | --p-select-checkmark-gutter-end | Gutter end of checkmark |
|
|
1205
|
+
| select.empty.message.padding | --p-select-empty-message-padding | Padding of empty message |
|
|
1206
|
+
|