@exhaustive-ui/mcp 0.0.0-stage → 22.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,138 @@
|
|
|
1
|
+
# Angular Card Component
|
|
2
|
+
|
|
3
|
+
Card is a flexible container component.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader A card can be utilized in many use cases as a result no role is enforced, in fact a role may not be necessary if the card is used for presentational purposes only. Any valid attribute is passed to the container element so if you require to use one of the landmark roles like region , you may use the role property. Keyboard Support Component does not include any interactive elements.
|
|
8
|
+
|
|
9
|
+
## Advanced
|
|
10
|
+
|
|
11
|
+
Card content can be customized further with subHeader , header and footer properties.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
16
|
+
import { CardModule } from '@exhaustive-ui/core/card';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
template: `
|
|
20
|
+
<div class="mb-4 p-8 flex items-center justify-center">
|
|
21
|
+
<p-card [style]="{ width: '25rem', overflow: 'hidden' }">
|
|
22
|
+
<ng-template #header>
|
|
23
|
+
<img alt="Card" class="w-full" src="https://exhaustive-ui.e-xiste.com/demo/card-ng.jpg" />
|
|
24
|
+
</ng-template>
|
|
25
|
+
<ng-template #title> Advanced Card </ng-template>
|
|
26
|
+
<ng-template #subtitle> Card subtitle </ng-template>
|
|
27
|
+
<p>
|
|
28
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
|
|
29
|
+
quas!
|
|
30
|
+
</p>
|
|
31
|
+
<ng-template #footer>
|
|
32
|
+
<div class="flex gap-4 mt-1">
|
|
33
|
+
<p-button label="Cancel" severity="secondary" class="w-full" [outlined]="true" styleClass="w-full" />
|
|
34
|
+
<p-button label="Save" class="w-full" styleClass="w-full" />
|
|
35
|
+
</div>
|
|
36
|
+
</ng-template>
|
|
37
|
+
</p-card>
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
standalone: true,
|
|
41
|
+
imports: [ButtonModule, CardModule]
|
|
42
|
+
})
|
|
43
|
+
export class CardAdvancedDemo {}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Basic
|
|
47
|
+
|
|
48
|
+
A simple Card is created with a header property along with the content as children.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { Component } from '@angular/core';
|
|
52
|
+
import { CardModule } from '@exhaustive-ui/core/card';
|
|
53
|
+
|
|
54
|
+
@Component({
|
|
55
|
+
template: `
|
|
56
|
+
<div class="mb-4 p-8">
|
|
57
|
+
<p-card header="Simple Card">
|
|
58
|
+
<p class="m-0">
|
|
59
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
|
|
60
|
+
quas!
|
|
61
|
+
</p>
|
|
62
|
+
</p-card>
|
|
63
|
+
</div>
|
|
64
|
+
`,
|
|
65
|
+
standalone: true,
|
|
66
|
+
imports: [CardModule]
|
|
67
|
+
})
|
|
68
|
+
export class CardBasicDemo {}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Card
|
|
72
|
+
|
|
73
|
+
Card is a flexible container component.
|
|
74
|
+
|
|
75
|
+
### Props
|
|
76
|
+
|
|
77
|
+
| Name | Type | Default | Description |
|
|
78
|
+
|------|------|---------|-------------|
|
|
79
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
80
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
81
|
+
| pt | InputSignal<CardPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
82
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
83
|
+
| header | InputSignal<string> | ... | Header of the card. |
|
|
84
|
+
| subheader | InputSignal<string> | ... | Subheader of the card. |
|
|
85
|
+
| style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the element. |
|
|
86
|
+
|
|
87
|
+
### Templates
|
|
88
|
+
|
|
89
|
+
| Name | Type | Description |
|
|
90
|
+
|------|------|-------------|
|
|
91
|
+
| header | TemplateRef<void> | Custom header template. |
|
|
92
|
+
| title | TemplateRef<void> | Custom title template. |
|
|
93
|
+
| subtitle | TemplateRef<void> | Custom subtitle template. |
|
|
94
|
+
| content | TemplateRef<void> | Custom content template. |
|
|
95
|
+
| footer | TemplateRef<void> | Custom footer template. |
|
|
96
|
+
|
|
97
|
+
## Pass Through Options
|
|
98
|
+
|
|
99
|
+
| Name | Type | Description |
|
|
100
|
+
|------|------|-------------|
|
|
101
|
+
| root | PassThroughOption<HTMLElement, I> | Used to pass attributes to the root's DOM element. |
|
|
102
|
+
| header | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the header's DOM element. |
|
|
103
|
+
| body | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the body's DOM element. |
|
|
104
|
+
| subtitle | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the subtitle's DOM element. |
|
|
105
|
+
| title | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the title's DOM element. |
|
|
106
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
107
|
+
| footer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the footer's DOM element. |
|
|
108
|
+
|
|
109
|
+
## Theming
|
|
110
|
+
|
|
111
|
+
### CSS Classes
|
|
112
|
+
|
|
113
|
+
| Class | Description |
|
|
114
|
+
|-------|-------------|
|
|
115
|
+
| p-card | Class name of the root element |
|
|
116
|
+
| p-card-header | Class name of the header element |
|
|
117
|
+
| p-card-body | Class name of the body element |
|
|
118
|
+
| p-card-caption | Class name of the caption element |
|
|
119
|
+
| p-card-title | Class name of the title element |
|
|
120
|
+
| p-card-subtitle | Class name of the subtitle element |
|
|
121
|
+
| p-card-content | Class name of the content element |
|
|
122
|
+
| p-card-footer | Class name of the footer element |
|
|
123
|
+
|
|
124
|
+
### Design Tokens
|
|
125
|
+
|
|
126
|
+
| Token | CSS Variable | Description |
|
|
127
|
+
|-------|--------------|-------------|
|
|
128
|
+
| card.background | --p-card-background | Background of root |
|
|
129
|
+
| card.border.radius | --p-card-border-radius | Border radius of root |
|
|
130
|
+
| card.color | --p-card-color | Color of root |
|
|
131
|
+
| card.shadow | --p-card-shadow | Shadow of root |
|
|
132
|
+
| card.body.padding | --p-card-body-padding | Padding of body |
|
|
133
|
+
| card.body.gap | --p-card-body-gap | Gap of body |
|
|
134
|
+
| card.caption.gap | --p-card-caption-gap | Gap of caption |
|
|
135
|
+
| card.title.font.size | --p-card-title-font-size | Font size of title |
|
|
136
|
+
| card.title.font.weight | --p-card-title-font-weight | Font weight of title |
|
|
137
|
+
| card.subtitle.color | --p-card-subtitle-color | Color of subtitle |
|
|
138
|
+
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# Angular Carousel Component
|
|
2
|
+
|
|
3
|
+
Carousel is a content slider featuring various customization options.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Carousel uses region role and since any attribute is passed to the main container element, attributes such as aria-label and aria-roledescription can be used as well. The slides container has aria-live attribute set as "polite" if carousel is not in autoplay mode, otherwise "off" would be the value in autoplay. A slide has a group role with an aria-label that refers to the aria.slideNumber property of the locale API. Similarly aria.slide is used as the aria-roledescription of the item. Inactive slides are hidden from the readers with aria-hidden . Next and Previous navigators are button elements with aria-label attributes referring to the aria.nextPageLabel and aria.firstPageLabel properties of the locale API by default respectively, you may still use your own aria roles and attributes as any valid attribute is passed to the button elements implicitly by using nextButtonProps and prevButtonProps . Quick navigation elements are button elements with an aria-label attribute referring to the aria.pageLabel of the locale API. Current page is marked with aria-current . Next/Prev Keyboard Support Key Function tab Moves focus through interactive elements in the carousel. enter Activates navigation. space Activates navigation. Quick Navigation Keyboard Support Key Function tab Moves focus through the active slide link. enter Activates the focused slide link. space Activates the focused slide link. right arrow Moves focus to the next slide link. left arrow Moves focus to the previous slide link. home Moves focus to the first slide link. end Moves focus to the last slide link.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Carousel requires a collection of items as its value along with a template to render each item.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
15
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
16
|
+
import { CarouselModule } from '@exhaustive-ui/core/carousel';
|
|
17
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
18
|
+
import { ProductService } from '@/service/productservice';
|
|
19
|
+
import { Product } from '@/domain/product';
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
template: `
|
|
23
|
+
<div class="card">
|
|
24
|
+
<p-carousel [value]="products()" [numVisible]="3" [numScroll]="3" [circular]="false" [responsiveOptions]="responsiveOptions">
|
|
25
|
+
<ng-template let-product #item>
|
|
26
|
+
<div class="border border-surface rounded-border m-2 p-4">
|
|
27
|
+
<div class="mb-4">
|
|
28
|
+
<div class="relative mx-auto">
|
|
29
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/{{ product.image }}" [alt]="product.name" class="w-full rounded-border" />
|
|
30
|
+
<p-tag [value]="product.inventoryStatus" [severity]="getSeverity(product.inventoryStatus)" class="absolute dark:!bg-surface-900" [ngStyle]="{ 'left.px': 5, 'top.px': 5 }" />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="mb-4 font-medium">{{ product.name }}</div>
|
|
34
|
+
<div class="flex justify-between items-center">
|
|
35
|
+
<div class="mt-0 font-semibold text-xl">{{ '$' + product.price }}</div>
|
|
36
|
+
<span>
|
|
37
|
+
<p-button icon="pi pi-heart" severity="secondary" [outlined]="true" />
|
|
38
|
+
<p-button icon="pi pi-shopping-cart" styleClass="ml-2" />
|
|
39
|
+
</span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</ng-template>
|
|
43
|
+
</p-carousel>
|
|
44
|
+
</div>
|
|
45
|
+
`,
|
|
46
|
+
standalone: true,
|
|
47
|
+
imports: [ButtonModule, CarouselModule, TagModule],
|
|
48
|
+
providers: [ProductService]
|
|
49
|
+
})
|
|
50
|
+
export class CarouselBasicDemo implements OnInit {
|
|
51
|
+
private productService = inject(ProductService);
|
|
52
|
+
products = signal<Product[]>([]);
|
|
53
|
+
responsiveOptions: any[] | undefined;
|
|
54
|
+
|
|
55
|
+
ngOnInit() {
|
|
56
|
+
this.productService.getProductsSmall().then((data) => {
|
|
57
|
+
this.products.set(data.slice(0, 9));
|
|
58
|
+
});
|
|
59
|
+
this.responsiveOptions = [
|
|
60
|
+
{
|
|
61
|
+
breakpoint: '1400px',
|
|
62
|
+
numVisible: 2,
|
|
63
|
+
numScroll: 1
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
breakpoint: '1199px',
|
|
67
|
+
numVisible: 3,
|
|
68
|
+
numScroll: 1
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
breakpoint: '767px',
|
|
72
|
+
numVisible: 2,
|
|
73
|
+
numScroll: 1
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
breakpoint: '575px',
|
|
77
|
+
numVisible: 1,
|
|
78
|
+
numScroll: 1
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getSeverity(status: string) {
|
|
84
|
+
switch (status) {
|
|
85
|
+
case 'INSTOCK':
|
|
86
|
+
return 'success';
|
|
87
|
+
case 'LOWSTOCK':
|
|
88
|
+
return 'warn';
|
|
89
|
+
case 'OUTOFSTOCK':
|
|
90
|
+
return 'danger';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Circular
|
|
97
|
+
|
|
98
|
+
When autoplayInterval is defined in milliseconds, items are scrolled automatically. In addition, for infinite scrolling circular property needs to be added which is enabled automatically in auto play mode.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
102
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
103
|
+
import { CarouselModule } from '@exhaustive-ui/core/carousel';
|
|
104
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
105
|
+
import { ProductService } from '@/service/productservice';
|
|
106
|
+
import { Product } from '@/domain/product';
|
|
107
|
+
|
|
108
|
+
@Component({
|
|
109
|
+
template: `
|
|
110
|
+
<div class="card">
|
|
111
|
+
<p-carousel [value]="products()" [numVisible]="3" [numScroll]="1" [circular]="true" [responsiveOptions]="responsiveOptions" autoplayInterval="3000">
|
|
112
|
+
<ng-template let-product #item>
|
|
113
|
+
<div class="border border-surface-200 dark:border-surface-700 rounded m-2 p-4">
|
|
114
|
+
<div class="mb-4">
|
|
115
|
+
<div class="relative mx-auto">
|
|
116
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/{{ product.image }}" [alt]="product.name" class="w-full rounded-border" />
|
|
117
|
+
<p-tag [value]="product.inventoryStatus" [severity]="getSeverity(product.inventoryStatus)" class="absolute dark:!bg-surface-900" [ngStyle]="{ 'left.px': 5, 'top.px': 5 }" />
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="mb-4 font-medium">{{ product.name }}</div>
|
|
121
|
+
<div class="flex justify-between items-center">
|
|
122
|
+
<div class="mt-0 font-semibold text-xl">{{ '$' + product.price }}</div>
|
|
123
|
+
<span>
|
|
124
|
+
<p-button icon="pi pi-heart" severity="secondary" [outlined]="true" />
|
|
125
|
+
<p-button icon="pi pi-shopping-cart" styleClass="ml-2" />
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</ng-template>
|
|
130
|
+
</p-carousel>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
standalone: true,
|
|
134
|
+
imports: [ButtonModule, CarouselModule, TagModule],
|
|
135
|
+
providers: [ProductService]
|
|
136
|
+
})
|
|
137
|
+
export class CarouselCircularDemo implements OnInit {
|
|
138
|
+
private productService = inject(ProductService);
|
|
139
|
+
products = signal<Product[]>([]);
|
|
140
|
+
responsiveOptions: any[] | undefined;
|
|
141
|
+
|
|
142
|
+
ngOnInit() {
|
|
143
|
+
this.productService.getProductsSmall().then((data) => {
|
|
144
|
+
this.products.set(data.slice(0, 9));
|
|
145
|
+
});
|
|
146
|
+
this.responsiveOptions = [
|
|
147
|
+
{
|
|
148
|
+
breakpoint: '1400px',
|
|
149
|
+
numVisible: 2,
|
|
150
|
+
numScroll: 1
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
breakpoint: '1199px',
|
|
154
|
+
numVisible: 3,
|
|
155
|
+
numScroll: 1
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
breakpoint: '767px',
|
|
159
|
+
numVisible: 2,
|
|
160
|
+
numScroll: 1
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
breakpoint: '575px',
|
|
164
|
+
numVisible: 1,
|
|
165
|
+
numScroll: 1
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
getSeverity(status: string) {
|
|
171
|
+
switch (status) {
|
|
172
|
+
case 'INSTOCK':
|
|
173
|
+
return 'success';
|
|
174
|
+
case 'LOWSTOCK':
|
|
175
|
+
return 'warn';
|
|
176
|
+
case 'OUTOFSTOCK':
|
|
177
|
+
return 'danger';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Responsive
|
|
184
|
+
|
|
185
|
+
Carousel supports specific configuration per screen size with the responsiveOptions property that takes an array of objects where each object defines the max-width breakpoint , numVisible for the number of items items per page and numScroll for number of items to scroll. When responsiveOptions is defined, the numScroll and numVisible properties of the Carousel are used as default when there is breakpoint that applies.
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
189
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
190
|
+
import { CarouselModule } from '@exhaustive-ui/core/carousel';
|
|
191
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
192
|
+
import { ProductService } from '@/service/productservice';
|
|
193
|
+
import { Product } from '@/domain/product';
|
|
194
|
+
|
|
195
|
+
@Component({
|
|
196
|
+
template: `
|
|
197
|
+
<div class="card">
|
|
198
|
+
<p-carousel [value]="products()" [numVisible]="3" [numScroll]="1" [responsiveOptions]="responsiveOptions">
|
|
199
|
+
<ng-template let-product #item>
|
|
200
|
+
<div class="border border-surface-200 dark:border-surface-700 rounded m-2 p-4">
|
|
201
|
+
<div class="mb-4">
|
|
202
|
+
<div class="relative mx-auto">
|
|
203
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/{{ product.image }}" [alt]="product.name" class="w-full rounded-border" />
|
|
204
|
+
<p-tag [value]="product.inventoryStatus" [severity]="getSeverity(product.inventoryStatus)" class="absolute dark:!bg-surface-900" [ngStyle]="{ 'left.px': 5, 'top.px': 5 }" />
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
<div class="mb-4 font-medium">{{ product.name }}</div>
|
|
208
|
+
<div class="flex justify-between items-center">
|
|
209
|
+
<div class="mt-0 font-semibold text-xl">{{ '$' + product.price }}</div>
|
|
210
|
+
<span>
|
|
211
|
+
<p-button icon="pi pi-heart" severity="secondary" [outlined]="true" />
|
|
212
|
+
<p-button icon="pi pi-shopping-cart" styleClass="ml-2" />
|
|
213
|
+
</span>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</ng-template>
|
|
217
|
+
</p-carousel>
|
|
218
|
+
</div>
|
|
219
|
+
`,
|
|
220
|
+
standalone: true,
|
|
221
|
+
imports: [ButtonModule, CarouselModule, TagModule],
|
|
222
|
+
providers: [ProductService]
|
|
223
|
+
})
|
|
224
|
+
export class CarouselResponsiveDemo implements OnInit {
|
|
225
|
+
private productService = inject(ProductService);
|
|
226
|
+
products = signal<Product[]>([]);
|
|
227
|
+
responsiveOptions: any[] | undefined;
|
|
228
|
+
|
|
229
|
+
ngOnInit() {
|
|
230
|
+
this.productService.getProductsSmall().then((products) => {
|
|
231
|
+
this.products.set(products);
|
|
232
|
+
});
|
|
233
|
+
this.responsiveOptions = [
|
|
234
|
+
{
|
|
235
|
+
breakpoint: '1400px',
|
|
236
|
+
numVisible: 2,
|
|
237
|
+
numScroll: 1
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
breakpoint: '1199px',
|
|
241
|
+
numVisible: 3,
|
|
242
|
+
numScroll: 1
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
breakpoint: '767px',
|
|
246
|
+
numVisible: 2,
|
|
247
|
+
numScroll: 1
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
breakpoint: '575px',
|
|
251
|
+
numVisible: 1,
|
|
252
|
+
numScroll: 1
|
|
253
|
+
}
|
|
254
|
+
];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
getSeverity(status: string) {
|
|
258
|
+
switch (status) {
|
|
259
|
+
case 'INSTOCK':
|
|
260
|
+
return 'success';
|
|
261
|
+
case 'LOWSTOCK':
|
|
262
|
+
return 'warn';
|
|
263
|
+
case 'OUTOFSTOCK':
|
|
264
|
+
return 'danger';
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Vertical
|
|
271
|
+
|
|
272
|
+
To create a vertical Carousel, orientation needs to be set to vertical along with a verticalViewPortHeight .
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
276
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
277
|
+
import { CarouselModule } from '@exhaustive-ui/core/carousel';
|
|
278
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
279
|
+
import { ProductService } from '@/service/productservice';
|
|
280
|
+
import { Product } from '@/domain/product';
|
|
281
|
+
|
|
282
|
+
@Component({
|
|
283
|
+
template: `
|
|
284
|
+
<div class="card">
|
|
285
|
+
<p-carousel [value]="products()" [numVisible]="1" [numScroll]="1" orientation="vertical" verticalViewPortHeight="330px" contentClass="flex items-center">
|
|
286
|
+
<ng-template let-product #item>
|
|
287
|
+
<div class="border border-surface-200 dark:border-surface-700 rounded m-2 p-4">
|
|
288
|
+
<div class="mb-4">
|
|
289
|
+
<div class="relative mx-auto">
|
|
290
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/{{ product.image }}" [alt]="product.name" class="w-full rounded" />
|
|
291
|
+
<p-tag [value]="product.inventoryStatus" [severity]="getSeverity(product.inventoryStatus)" class="absolute dark:!bg-surface-900" [ngStyle]="{ 'left.px': 5, 'top.px': 5 }" />
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
<div class="mb-4 font-medium">{{ product.name }}</div>
|
|
295
|
+
<div class="flex justify-between items-center">
|
|
296
|
+
<div class="mt-0 font-semibold text-xl">{{ '$' + product.price }}</div>
|
|
297
|
+
<span>
|
|
298
|
+
<p-button icon="pi pi-heart" severity="secondary" [outlined]="true" />
|
|
299
|
+
<p-button icon="pi pi-shopping-cart" styleClass="ml-2" />
|
|
300
|
+
</span>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
</ng-template>
|
|
304
|
+
</p-carousel>
|
|
305
|
+
</div>
|
|
306
|
+
`,
|
|
307
|
+
standalone: true,
|
|
308
|
+
imports: [ButtonModule, CarouselModule, TagModule],
|
|
309
|
+
providers: [ProductService]
|
|
310
|
+
})
|
|
311
|
+
export class CarouselVerticalDemo implements OnInit {
|
|
312
|
+
private productService = inject(ProductService);
|
|
313
|
+
products = signal<Product[]>([]);
|
|
314
|
+
|
|
315
|
+
ngOnInit() {
|
|
316
|
+
this.productService.getProductsSmall().then((products) => {
|
|
317
|
+
this.products.set(products);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
getSeverity(status: string) {
|
|
322
|
+
switch (status) {
|
|
323
|
+
case 'INSTOCK':
|
|
324
|
+
return 'success';
|
|
325
|
+
case 'LOWSTOCK':
|
|
326
|
+
return 'warn';
|
|
327
|
+
case 'OUTOFSTOCK':
|
|
328
|
+
return 'danger';
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Carousel
|
|
335
|
+
|
|
336
|
+
Carousel is a content slider featuring various customization options.
|
|
337
|
+
|
|
338
|
+
### Props
|
|
339
|
+
|
|
340
|
+
| Name | Type | Default | Description |
|
|
341
|
+
|------|------|---------|-------------|
|
|
342
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
343
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
344
|
+
| pt | InputSignal<any> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
345
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
346
|
+
| page | InputSignal<number> | 0 | Index of the first item. |
|
|
347
|
+
| numVisible | InputSignal<number> | 1 | Number of items per page. |
|
|
348
|
+
| numScroll | InputSignal<number> | 1 | Number of items to scroll. |
|
|
349
|
+
| responsiveOptions | InputSignal<CarouselResponsiveOptions[]> | ... | An array of options for responsive design. |
|
|
350
|
+
| orientation | InputSignal<"vertical" \| "horizontal"> | ... | Specifies the layout of the component. |
|
|
351
|
+
| verticalViewPortHeight | InputSignal<string> | ... | Height of the viewport in vertical layout. |
|
|
352
|
+
| contentClass | InputSignal<string> | ... | Style class of main content. |
|
|
353
|
+
| indicatorsContentClass | InputSignal<string> | ... | Style class of the indicator items. |
|
|
354
|
+
| indicatorsContentStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the indicator items. |
|
|
355
|
+
| indicatorStyleClass | InputSignal<string> | ... | Style class of the indicators. |
|
|
356
|
+
| indicatorStyle | InputSignal<{ [klass: string]: any }> | ... | Style of the indicators. |
|
|
357
|
+
| value | InputSignal<any[]> | null | An array of objects to display. |
|
|
358
|
+
| circular | InputSignalWithTransform<boolean, unknown> | ... | Defines if scrolling would be infinite. |
|
|
359
|
+
| showIndicators | InputSignalWithTransform<boolean, unknown> | ... | Whether to display indicator container. |
|
|
360
|
+
| showNavigators | InputSignalWithTransform<boolean, unknown> | ... | Whether to display navigation buttons in container. |
|
|
361
|
+
| autoplayInterval | InputSignalWithTransform<number, unknown> | ... | Time in milliseconds to scroll items automatically. |
|
|
362
|
+
| prevButtonProps | InputSignal<ButtonProps> | ... | Used to pass all properties of the ButtonProps to the Button component. |
|
|
363
|
+
| nextButtonProps | InputSignal<ButtonProps> | ... | Used to pass all properties of the ButtonProps to the Button component. |
|
|
364
|
+
|
|
365
|
+
### Emits
|
|
366
|
+
|
|
367
|
+
| Name | Parameters | Description |
|
|
368
|
+
|------|------------|-------------|
|
|
369
|
+
| onPage | event: CarouselPageEvent | Callback to invoke after scroll. |
|
|
370
|
+
|
|
371
|
+
### Templates
|
|
372
|
+
|
|
373
|
+
| Name | Type | Description |
|
|
374
|
+
|------|------|-------------|
|
|
375
|
+
| item | TemplateRef<CarouselItemTemplateContext<any>> | Custom item template. |
|
|
376
|
+
| header | TemplateRef<void> | Custom header template. |
|
|
377
|
+
| footer | TemplateRef<void> | Custom footer template. |
|
|
378
|
+
| previousicon | TemplateRef<void> | Custom previous icon template. |
|
|
379
|
+
| nexticon | TemplateRef<void> | Custom next icon template. |
|
|
380
|
+
|
|
381
|
+
## Pass Through Options
|
|
382
|
+
|
|
383
|
+
| Name | Type | Description |
|
|
384
|
+
|------|------|-------------|
|
|
385
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
386
|
+
| header | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the header's DOM element. |
|
|
387
|
+
| contentContainer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content container's DOM element. |
|
|
388
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
389
|
+
| pcPrevButton | ButtonPassThroughOptions | Used to pass attributes to the previous button's DOM element. |
|
|
390
|
+
| viewport | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the viewport's DOM element. |
|
|
391
|
+
| itemList | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the item list's DOM element. |
|
|
392
|
+
| item | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the item's DOM element. |
|
|
393
|
+
| itemClone | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the item clone's DOM element. |
|
|
394
|
+
| pcNextButton | ButtonPassThroughOptions | Used to pass attributes to the next button's DOM element. |
|
|
395
|
+
| indicatorList | PassThroughOption<HTMLUListElement, I> | Used to pass attributes to the indicator list's DOM element. |
|
|
396
|
+
| indicator | PassThroughOption<HTMLLIElement, I> | Used to pass attributes to the indicator's DOM element. |
|
|
397
|
+
| indicatorButton | PassThroughOption<HTMLButtonElement, I> | Used to pass attributes to the indicator button's DOM element. |
|
|
398
|
+
| footer | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the footer's DOM element. |
|
|
399
|
+
|
|
400
|
+
## Theming
|
|
401
|
+
|
|
402
|
+
### CSS Classes
|
|
403
|
+
|
|
404
|
+
| Class | Description |
|
|
405
|
+
|-------|-------------|
|
|
406
|
+
| p-carousel | Class name of the root element |
|
|
407
|
+
| p-carousel-header | Class name of the header element |
|
|
408
|
+
| p-carousel-content-container | Class name of the content container element |
|
|
409
|
+
| p-carousel-content | Class name of the content element |
|
|
410
|
+
| p-carousel-prev-button | Class name of the previous button element |
|
|
411
|
+
| p-carousel-viewport | Class name of the viewport element |
|
|
412
|
+
| p-carousel-item-list | Class name of the item list element |
|
|
413
|
+
| p-carousel-item-clone | Class name of the item clone element |
|
|
414
|
+
| p-carousel-item | Class name of the item element |
|
|
415
|
+
| p-carousel-next-button | Class name of the next button element |
|
|
416
|
+
| p-carousel-indicator-list | Class name of the indicator list element |
|
|
417
|
+
| p-carousel-indicator | Class name of the indicator element |
|
|
418
|
+
| p-carousel-indicator-button | Class name of the indicator button element |
|
|
419
|
+
| p-carousel-footer | Class name of the footer element |
|
|
420
|
+
|
|
421
|
+
### Design Tokens
|
|
422
|
+
|
|
423
|
+
| Token | CSS Variable | Description |
|
|
424
|
+
|-------|--------------|-------------|
|
|
425
|
+
| carousel.transition.duration | --p-carousel-transition-duration | Transition duration of root |
|
|
426
|
+
| carousel.content.gap | --p-carousel-content-gap | Gap of content |
|
|
427
|
+
| carousel.indicator.list.padding | --p-carousel-indicator-list-padding | Padding of indicator list |
|
|
428
|
+
| carousel.indicator.list.gap | --p-carousel-indicator-list-gap | Gap of indicator list |
|
|
429
|
+
| carousel.indicator.width | --p-carousel-indicator-width | Width of indicator |
|
|
430
|
+
| carousel.indicator.height | --p-carousel-indicator-height | Height of indicator |
|
|
431
|
+
| carousel.indicator.border.radius | --p-carousel-indicator-border-radius | Border radius of indicator |
|
|
432
|
+
| carousel.indicator.focus.ring.width | --p-carousel-indicator-focus-ring-width | Focus ring width of indicator |
|
|
433
|
+
| carousel.indicator.focus.ring.style | --p-carousel-indicator-focus-ring-style | Focus ring style of indicator |
|
|
434
|
+
| carousel.indicator.focus.ring.color | --p-carousel-indicator-focus-ring-color | Focus ring color of indicator |
|
|
435
|
+
| carousel.indicator.focus.ring.offset | --p-carousel-indicator-focus-ring-offset | Focus ring offset of indicator |
|
|
436
|
+
| carousel.indicator.focus.ring.shadow | --p-carousel-indicator-focus-ring-shadow | Focus ring shadow of indicator |
|
|
437
|
+
| carousel.indicator.background | --p-carousel-indicator-background | Background of indicator |
|
|
438
|
+
| carousel.indicator.hover.background | --p-carousel-indicator-hover-background | Hover background of indicator |
|
|
439
|
+
| carousel.indicator.active.background | --p-carousel-indicator-active-background | Active background of indicator |
|
|
440
|
+
|