@m1z23r/ngx-ui 1.0.1 → 1.0.2
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/README.md +494 -0
- package/fesm2022/m1z23r-ngx-ui.mjs +1226 -770
- package/fesm2022/m1z23r-ngx-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/m1z23r-ngx-ui.d.ts +415 -3
package/README.md
CHANGED
|
@@ -468,6 +468,500 @@ The `ui-button` component supports both the directive and direct `loading` input
|
|
|
468
468
|
|
|
469
469
|
---
|
|
470
470
|
|
|
471
|
+
## Textarea
|
|
472
|
+
|
|
473
|
+
A multi-line text input with character counter and resize options.
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
import { TextareaComponent } from '@m1z23r/ngx-ui';
|
|
477
|
+
|
|
478
|
+
<ui-textarea
|
|
479
|
+
label="Description"
|
|
480
|
+
placeholder="Enter description..."
|
|
481
|
+
[maxlength]="500"
|
|
482
|
+
resize="vertical"
|
|
483
|
+
[(value)]="description"
|
|
484
|
+
/>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
| Input | Type | Default | Description |
|
|
488
|
+
|-------|------|---------|-------------|
|
|
489
|
+
| `label` | `string` | `''` | Label text |
|
|
490
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
491
|
+
| `hint` | `string` | `''` | Helper text |
|
|
492
|
+
| `error` | `string` | `''` | Error message |
|
|
493
|
+
| `rows` | `number` | `3` | Initial rows |
|
|
494
|
+
| `maxlength` | `number \| null` | `null` | Max characters (shows counter) |
|
|
495
|
+
| `resize` | `'none' \| 'vertical' \| 'horizontal' \| 'both'` | `'vertical'` | Resize behavior |
|
|
496
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
497
|
+
| `readonly` | `boolean` | `false` | Read-only state |
|
|
498
|
+
| `required` | `boolean` | `false` | Required indicator |
|
|
499
|
+
|
|
500
|
+
| Model | Type | Description |
|
|
501
|
+
|-------|------|-------------|
|
|
502
|
+
| `value` | `string` | Two-way bound value |
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## Badge
|
|
507
|
+
|
|
508
|
+
A small status indicator or label component.
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
import { BadgeComponent } from '@m1z23r/ngx-ui';
|
|
512
|
+
|
|
513
|
+
<ui-badge variant="primary">New</ui-badge>
|
|
514
|
+
<ui-badge variant="success" [rounded]="true">Active</ui-badge>
|
|
515
|
+
<ui-badge variant="danger" [removable]="true" (removed)="onRemove()">Tag</ui-badge>
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
| Input | Type | Default | Description |
|
|
519
|
+
|-------|------|---------|-------------|
|
|
520
|
+
| `variant` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'` | `'default'` | Color variant |
|
|
521
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Badge size |
|
|
522
|
+
| `rounded` | `boolean` | `false` | Pill/rounded style |
|
|
523
|
+
| `removable` | `boolean` | `false` | Show remove button |
|
|
524
|
+
|
|
525
|
+
| Output | Type | Description |
|
|
526
|
+
|--------|------|-------------|
|
|
527
|
+
| `removed` | `void` | Emitted when remove clicked |
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Progress
|
|
532
|
+
|
|
533
|
+
A linear progress bar with multiple variants.
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
import { ProgressComponent } from '@m1z23r/ngx-ui';
|
|
537
|
+
|
|
538
|
+
<ui-progress [value]="75" />
|
|
539
|
+
<ui-progress [value]="50" variant="success" [showLabel]="true" size="lg" />
|
|
540
|
+
<ui-progress [value]="60" [striped]="true" [animated]="true" />
|
|
541
|
+
<ui-progress [indeterminate]="true" />
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
| Input | Type | Default | Description |
|
|
545
|
+
|-------|------|---------|-------------|
|
|
546
|
+
| `value` | `number` | `0` | Progress value (0-100) |
|
|
547
|
+
| `variant` | `'primary' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Color variant |
|
|
548
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Bar height |
|
|
549
|
+
| `showLabel` | `boolean` | `false` | Show percentage label |
|
|
550
|
+
| `striped` | `boolean` | `false` | Striped pattern |
|
|
551
|
+
| `animated` | `boolean` | `false` | Animate stripes |
|
|
552
|
+
| `indeterminate` | `boolean` | `false` | Indeterminate loading |
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
## Circular Progress
|
|
557
|
+
|
|
558
|
+
A circular/ring progress indicator with configurable stroke width.
|
|
559
|
+
|
|
560
|
+
```typescript
|
|
561
|
+
import { CircularProgressComponent } from '@m1z23r/ngx-ui';
|
|
562
|
+
|
|
563
|
+
<ui-circular-progress [value]="75" [showLabel]="true" />
|
|
564
|
+
<ui-circular-progress [value]="50" size="lg" [strokeWidth]="6" />
|
|
565
|
+
<ui-circular-progress [indeterminate]="true" variant="primary" />
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
| Input | Type | Default | Description |
|
|
569
|
+
|-------|------|---------|-------------|
|
|
570
|
+
| `value` | `number` | `0` | Progress value (0-100) |
|
|
571
|
+
| `variant` | `'primary' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | Color variant |
|
|
572
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Circle size |
|
|
573
|
+
| `strokeWidth` | `number` | `4` | Stroke width in pixels |
|
|
574
|
+
| `showLabel` | `boolean` | `false` | Show percentage in center |
|
|
575
|
+
| `indeterminate` | `boolean` | `false` | Spinning animation |
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## Spinner
|
|
580
|
+
|
|
581
|
+
A simple loading spinner component.
|
|
582
|
+
|
|
583
|
+
```typescript
|
|
584
|
+
import { SpinnerComponent } from '@m1z23r/ngx-ui';
|
|
585
|
+
|
|
586
|
+
<ui-spinner />
|
|
587
|
+
<ui-spinner size="lg" variant="primary" />
|
|
588
|
+
<ui-spinner size="sm" variant="white" /> <!-- for dark backgrounds -->
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
| Input | Type | Default | Description |
|
|
592
|
+
|-------|------|---------|-------------|
|
|
593
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Spinner size |
|
|
594
|
+
| `variant` | `'primary' \| 'secondary' \| 'white'` | `'primary'` | Color variant |
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## Alert
|
|
599
|
+
|
|
600
|
+
A contextual feedback message component.
|
|
601
|
+
|
|
602
|
+
```typescript
|
|
603
|
+
import { AlertComponent } from '@m1z23r/ngx-ui';
|
|
604
|
+
|
|
605
|
+
<ui-alert variant="info" title="Information">
|
|
606
|
+
This is an informational message.
|
|
607
|
+
</ui-alert>
|
|
608
|
+
|
|
609
|
+
<ui-alert variant="danger" [dismissible]="true" (dismissed)="onDismiss()">
|
|
610
|
+
An error occurred.
|
|
611
|
+
</ui-alert>
|
|
612
|
+
|
|
613
|
+
<ui-alert variant="success" [showIcon]="false">
|
|
614
|
+
Success without icon.
|
|
615
|
+
</ui-alert>
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
| Input | Type | Default | Description |
|
|
619
|
+
|-------|------|---------|-------------|
|
|
620
|
+
| `variant` | `'info' \| 'success' \| 'warning' \| 'danger'` | `'info'` | Alert type |
|
|
621
|
+
| `title` | `string` | `''` | Alert title |
|
|
622
|
+
| `dismissible` | `boolean` | `false` | Show close button |
|
|
623
|
+
| `showIcon` | `boolean` | `true` | Show variant icon |
|
|
624
|
+
|
|
625
|
+
| Output | Type | Description |
|
|
626
|
+
|--------|------|-------------|
|
|
627
|
+
| `dismissed` | `void` | Emitted when dismissed |
|
|
628
|
+
|
|
629
|
+
---
|
|
630
|
+
|
|
631
|
+
## Card
|
|
632
|
+
|
|
633
|
+
A flexible container component with header/footer slots.
|
|
634
|
+
|
|
635
|
+
```typescript
|
|
636
|
+
import { CardComponent } from '@m1z23r/ngx-ui';
|
|
637
|
+
|
|
638
|
+
<ui-card>
|
|
639
|
+
<div card-header><strong>Card Title</strong></div>
|
|
640
|
+
Card content goes here.
|
|
641
|
+
<div card-footer>Footer content</div>
|
|
642
|
+
</ui-card>
|
|
643
|
+
|
|
644
|
+
<ui-card variant="elevated" [clickable]="true" (clicked)="onClick()">
|
|
645
|
+
Clickable card with shadow
|
|
646
|
+
</ui-card>
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
| Input | Type | Default | Description |
|
|
650
|
+
|-------|------|---------|-------------|
|
|
651
|
+
| `variant` | `'default' \| 'outlined' \| 'elevated'` | `'default'` | Card style |
|
|
652
|
+
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Content padding |
|
|
653
|
+
| `clickable` | `boolean` | `false` | Enable click interaction |
|
|
654
|
+
|
|
655
|
+
| Output | Type | Description |
|
|
656
|
+
|--------|------|-------------|
|
|
657
|
+
| `clicked` | `void` | Emitted when clickable card clicked |
|
|
658
|
+
|
|
659
|
+
**Slots:**
|
|
660
|
+
- `card-header` - Header section
|
|
661
|
+
- Default content - Body section
|
|
662
|
+
- `card-footer` - Footer section
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
## Tooltip
|
|
667
|
+
|
|
668
|
+
A directive that shows a tooltip on hover/focus.
|
|
669
|
+
|
|
670
|
+
```typescript
|
|
671
|
+
import { TooltipDirective } from '@m1z23r/ngx-ui';
|
|
672
|
+
|
|
673
|
+
<button uiTooltip="This is a tooltip">Hover me</button>
|
|
674
|
+
<button uiTooltip="Bottom tooltip" tooltipPosition="bottom">Bottom</button>
|
|
675
|
+
<span uiTooltip="Delayed" [tooltipDelay]="500">Delayed tooltip</span>
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
| Input | Type | Default | Description |
|
|
679
|
+
|-------|------|---------|-------------|
|
|
680
|
+
| `uiTooltip` | `string` | Required | Tooltip text |
|
|
681
|
+
| `tooltipPosition` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position |
|
|
682
|
+
| `tooltipDelay` | `number` | `200` | Delay in ms |
|
|
683
|
+
| `tooltipDisabled` | `boolean` | `false` | Disable tooltip |
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## Radio / RadioGroup
|
|
688
|
+
|
|
689
|
+
A radio button group with traditional and segmented control variants.
|
|
690
|
+
|
|
691
|
+
```typescript
|
|
692
|
+
import { RadioGroupComponent, RadioComponent } from '@m1z23r/ngx-ui';
|
|
693
|
+
|
|
694
|
+
// Traditional radio buttons
|
|
695
|
+
<ui-radio-group [(value)]="selectedOption">
|
|
696
|
+
<ui-radio value="option1">Option 1</ui-radio>
|
|
697
|
+
<ui-radio value="option2">Option 2</ui-radio>
|
|
698
|
+
<ui-radio value="option3">Option 3</ui-radio>
|
|
699
|
+
</ui-radio-group>
|
|
700
|
+
|
|
701
|
+
// Horizontal layout
|
|
702
|
+
<ui-radio-group [(value)]="size" orientation="horizontal">
|
|
703
|
+
<ui-radio value="sm">Small</ui-radio>
|
|
704
|
+
<ui-radio value="md">Medium</ui-radio>
|
|
705
|
+
<ui-radio value="lg">Large</ui-radio>
|
|
706
|
+
</ui-radio-group>
|
|
707
|
+
|
|
708
|
+
// Segmented control (button style)
|
|
709
|
+
<ui-radio-group [(value)]="view" variant="segmented">
|
|
710
|
+
<ui-radio value="list">List</ui-radio>
|
|
711
|
+
<ui-radio value="grid">Grid</ui-radio>
|
|
712
|
+
<ui-radio value="table">Table</ui-radio>
|
|
713
|
+
</ui-radio-group>
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
### RadioGroup Inputs
|
|
717
|
+
|
|
718
|
+
| Input | Type | Default | Description |
|
|
719
|
+
|-------|------|---------|-------------|
|
|
720
|
+
| `name` | `string` | auto-generated | Radio group name |
|
|
721
|
+
| `disabled` | `boolean` | `false` | Disable all radios |
|
|
722
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Layout direction (default variant) |
|
|
723
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Radio size |
|
|
724
|
+
| `variant` | `'default' \| 'segmented'` | `'default'` | Style variant |
|
|
725
|
+
| `ariaLabel` | `string` | `''` | Accessibility label |
|
|
726
|
+
|
|
727
|
+
### RadioGroup Two-way Binding
|
|
728
|
+
|
|
729
|
+
| Model | Type | Description |
|
|
730
|
+
|-------|------|-------------|
|
|
731
|
+
| `value` | `T \| null` | Selected value |
|
|
732
|
+
|
|
733
|
+
### RadioGroup Outputs
|
|
734
|
+
|
|
735
|
+
| Output | Type | Description |
|
|
736
|
+
|--------|------|-------------|
|
|
737
|
+
| `changed` | `T \| null` | Emitted when selection changes |
|
|
738
|
+
|
|
739
|
+
### Radio Inputs
|
|
740
|
+
|
|
741
|
+
| Input | Type | Default | Description |
|
|
742
|
+
|-------|------|---------|-------------|
|
|
743
|
+
| `value` | `T` | Required | Radio value |
|
|
744
|
+
| `disabled` | `boolean` | `false` | Disable this radio |
|
|
745
|
+
|
|
746
|
+
### Keyboard Navigation
|
|
747
|
+
|
|
748
|
+
- **Arrow Up/Left**: Select previous option
|
|
749
|
+
- **Arrow Down/Right**: Select next option
|
|
750
|
+
- **Space/Enter**: Select focused option
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
754
|
+
## Tabs
|
|
755
|
+
|
|
756
|
+
A tabbed interface component with multiple style variants.
|
|
757
|
+
|
|
758
|
+
```typescript
|
|
759
|
+
import { TabsComponent, TabComponent } from '@m1z23r/ngx-ui';
|
|
760
|
+
|
|
761
|
+
// Default tabs
|
|
762
|
+
<ui-tabs [(activeTab)]="activeTab">
|
|
763
|
+
<ui-tab label="Account">Account content here</ui-tab>
|
|
764
|
+
<ui-tab label="Security">Security content here</ui-tab>
|
|
765
|
+
<ui-tab label="Notifications" [disabled]="true">Disabled tab</ui-tab>
|
|
766
|
+
</ui-tabs>
|
|
767
|
+
|
|
768
|
+
// Pills variant
|
|
769
|
+
<ui-tabs [(activeTab)]="activeTab" variant="pills">
|
|
770
|
+
<ui-tab label="Overview">...</ui-tab>
|
|
771
|
+
<ui-tab label="Analytics">...</ui-tab>
|
|
772
|
+
</ui-tabs>
|
|
773
|
+
|
|
774
|
+
// Underline variant (animated indicator)
|
|
775
|
+
<ui-tabs [(activeTab)]="activeTab" variant="underline">
|
|
776
|
+
<ui-tab label="Profile">...</ui-tab>
|
|
777
|
+
<ui-tab label="Billing">...</ui-tab>
|
|
778
|
+
</ui-tabs>
|
|
779
|
+
|
|
780
|
+
// With string IDs
|
|
781
|
+
<ui-tabs [(activeTab)]="activeTabId">
|
|
782
|
+
<ui-tab id="account" label="Account">...</ui-tab>
|
|
783
|
+
<ui-tab id="security" label="Security">...</ui-tab>
|
|
784
|
+
</ui-tabs>
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
### Tabs Inputs
|
|
788
|
+
|
|
789
|
+
| Input | Type | Default | Description |
|
|
790
|
+
|-------|------|---------|-------------|
|
|
791
|
+
| `variant` | `'default' \| 'pills' \| 'underline'` | `'default'` | Tab style |
|
|
792
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Tab size |
|
|
793
|
+
| `ariaLabel` | `string` | `''` | Accessibility label |
|
|
794
|
+
|
|
795
|
+
### Tabs Two-way Binding
|
|
796
|
+
|
|
797
|
+
| Model | Type | Description |
|
|
798
|
+
|-------|------|-------------|
|
|
799
|
+
| `activeTab` | `string \| number` | Active tab ID or index |
|
|
800
|
+
|
|
801
|
+
### Tabs Outputs
|
|
802
|
+
|
|
803
|
+
| Output | Type | Description |
|
|
804
|
+
|--------|------|-------------|
|
|
805
|
+
| `changed` | `string \| number` | Emitted when active tab changes |
|
|
806
|
+
|
|
807
|
+
### Tab Inputs
|
|
808
|
+
|
|
809
|
+
| Input | Type | Default | Description |
|
|
810
|
+
|-------|------|---------|-------------|
|
|
811
|
+
| `id` | `string \| number` | auto (index) | Tab identifier |
|
|
812
|
+
| `label` | `string` | Required | Tab button text |
|
|
813
|
+
| `disabled` | `boolean` | `false` | Disable tab |
|
|
814
|
+
|
|
815
|
+
### Keyboard Navigation
|
|
816
|
+
|
|
817
|
+
- **Arrow Left/Right**: Navigate between tabs
|
|
818
|
+
- **Home**: Go to first tab
|
|
819
|
+
- **End**: Go to last tab
|
|
820
|
+
|
|
821
|
+
---
|
|
822
|
+
|
|
823
|
+
## Toast
|
|
824
|
+
|
|
825
|
+
A service-based toast notification system with multiple variants and positions.
|
|
826
|
+
|
|
827
|
+
```typescript
|
|
828
|
+
import { ToastService } from '@m1z23r/ngx-ui';
|
|
829
|
+
|
|
830
|
+
@Component({...})
|
|
831
|
+
export class MyComponent {
|
|
832
|
+
private toastService = inject(ToastService);
|
|
833
|
+
|
|
834
|
+
// Simple variants
|
|
835
|
+
save() {
|
|
836
|
+
this.toastService.success('File saved successfully', 'Success');
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
handleError() {
|
|
840
|
+
this.toastService.error('Something went wrong', 'Error');
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
warn() {
|
|
844
|
+
this.toastService.warning('Please check your input');
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
notify() {
|
|
848
|
+
this.toastService.info('New message received');
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// Custom configuration
|
|
852
|
+
showCustom() {
|
|
853
|
+
const toastRef = this.toastService.show({
|
|
854
|
+
message: 'Custom toast message',
|
|
855
|
+
title: 'Custom Title',
|
|
856
|
+
variant: 'success',
|
|
857
|
+
duration: 3000, // 0 = no auto-dismiss
|
|
858
|
+
position: 'bottom-right',
|
|
859
|
+
dismissible: true,
|
|
860
|
+
showProgress: true,
|
|
861
|
+
});
|
|
862
|
+
|
|
863
|
+
// Dismiss programmatically
|
|
864
|
+
toastRef.dismiss();
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// Dismiss all toasts
|
|
868
|
+
clearAll() {
|
|
869
|
+
this.toastService.dismissAll();
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
### ToastService Methods
|
|
875
|
+
|
|
876
|
+
| Method | Parameters | Returns | Description |
|
|
877
|
+
|--------|------------|---------|-------------|
|
|
878
|
+
| `show(config)` | `ToastConfig` | `ToastRef` | Show toast with full config |
|
|
879
|
+
| `success(message, title?)` | `string, string?` | `ToastRef` | Success toast |
|
|
880
|
+
| `error(message, title?)` | `string, string?` | `ToastRef` | Error toast |
|
|
881
|
+
| `warning(message, title?)` | `string, string?` | `ToastRef` | Warning toast |
|
|
882
|
+
| `info(message, title?)` | `string, string?` | `ToastRef` | Info toast |
|
|
883
|
+
| `dismiss(id)` | `string` | `void` | Dismiss specific toast |
|
|
884
|
+
| `dismissAll()` | - | `void` | Dismiss all toasts |
|
|
885
|
+
|
|
886
|
+
### ToastConfig
|
|
887
|
+
|
|
888
|
+
| Property | Type | Default | Description |
|
|
889
|
+
|----------|------|---------|-------------|
|
|
890
|
+
| `message` | `string` | Required | Toast message |
|
|
891
|
+
| `title` | `string` | - | Optional title |
|
|
892
|
+
| `variant` | `'success' \| 'error' \| 'warning' \| 'info'` | `'info'` | Toast type |
|
|
893
|
+
| `duration` | `number` | `5000` | Auto-dismiss delay (0 = manual) |
|
|
894
|
+
| `position` | `ToastPosition` | `'top-right'` | Screen position |
|
|
895
|
+
| `dismissible` | `boolean` | `true` | Show close button |
|
|
896
|
+
| `showProgress` | `boolean` | `true` | Show countdown bar |
|
|
897
|
+
|
|
898
|
+
### ToastPosition Values
|
|
899
|
+
|
|
900
|
+
- `'top-right'` (default)
|
|
901
|
+
- `'top-left'`
|
|
902
|
+
- `'top-center'`
|
|
903
|
+
- `'bottom-right'`
|
|
904
|
+
- `'bottom-left'`
|
|
905
|
+
- `'bottom-center'`
|
|
906
|
+
|
|
907
|
+
---
|
|
908
|
+
|
|
909
|
+
## Pagination
|
|
910
|
+
|
|
911
|
+
A pagination component for navigating through pages of content.
|
|
912
|
+
|
|
913
|
+
```typescript
|
|
914
|
+
import { PaginationComponent } from '@m1z23r/ngx-ui';
|
|
915
|
+
|
|
916
|
+
<ui-pagination
|
|
917
|
+
[(page)]="currentPage"
|
|
918
|
+
[total]="totalItems"
|
|
919
|
+
[pageSize]="10"
|
|
920
|
+
/>
|
|
921
|
+
|
|
922
|
+
// With more options
|
|
923
|
+
<ui-pagination
|
|
924
|
+
[(page)]="currentPage"
|
|
925
|
+
[total]="500"
|
|
926
|
+
[pageSize]="20"
|
|
927
|
+
[maxPages]="7"
|
|
928
|
+
[showFirstLast]="true"
|
|
929
|
+
size="md"
|
|
930
|
+
(changed)="onPageChange($event)"
|
|
931
|
+
/>
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
### Inputs
|
|
935
|
+
|
|
936
|
+
| Input | Type | Default | Description |
|
|
937
|
+
|-------|------|---------|-------------|
|
|
938
|
+
| `total` | `number` | Required | Total number of items |
|
|
939
|
+
| `pageSize` | `number` | `10` | Items per page |
|
|
940
|
+
| `maxPages` | `number` | `5` | Max page buttons to show |
|
|
941
|
+
| `showFirstLast` | `boolean` | `true` | Show first/last buttons |
|
|
942
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
|
|
943
|
+
|
|
944
|
+
### Two-way Binding
|
|
945
|
+
|
|
946
|
+
| Model | Type | Description |
|
|
947
|
+
|-------|------|-------------|
|
|
948
|
+
| `page` | `number` | Current page (1-indexed) |
|
|
949
|
+
|
|
950
|
+
### Outputs
|
|
951
|
+
|
|
952
|
+
| Output | Type | Description |
|
|
953
|
+
|--------|------|-------------|
|
|
954
|
+
| `changed` | `number` | Emitted when page changes |
|
|
955
|
+
|
|
956
|
+
### Features
|
|
957
|
+
|
|
958
|
+
- **Smart truncation**: Shows ellipsis when there are many pages
|
|
959
|
+
- **First/Last buttons**: Quick navigation to beginning/end
|
|
960
|
+
- **Prev/Next buttons**: Sequential navigation
|
|
961
|
+
- **Keyboard accessible**: Tab navigation and focus styles
|
|
962
|
+
|
|
963
|
+
---
|
|
964
|
+
|
|
471
965
|
## Dialog System
|
|
472
966
|
|
|
473
967
|
A simple, Promise-based dialog system for opening modal dialogs programmatically. No RxJS required.
|