pdm-ui-kit 0.1.0 → 0.1.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 +115 -59
- package/esm2020/lib/components/accordion/accordion.component.mjs +42 -0
- package/esm2020/lib/components/alert/alert.component.mjs +35 -0
- package/esm2020/lib/components/alert-dialog/alert-dialog.component.mjs +69 -0
- package/esm2020/lib/components/aspect-ratio/aspect-ratio.component.mjs +31 -0
- package/esm2020/lib/components/avatar/avatar.component.mjs +46 -0
- package/esm2020/lib/components/badge/badge.component.mjs +23 -0
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +29 -0
- package/esm2020/lib/components/button/button.component.mjs +82 -0
- package/esm2020/lib/components/button-group/button-group.component.mjs +23 -0
- package/esm2020/lib/components/calendar/calendar.component.mjs +71 -0
- package/esm2020/lib/components/card/card.component.mjs +65 -0
- package/esm2020/lib/components/carousel/carousel.component.mjs +97 -0
- package/esm2020/lib/components/chart/chart.component.mjs +174 -0
- package/esm2020/lib/components/checkbox/checkbox.component.mjs +47 -0
- package/esm2020/lib/components/collapsible/collapsible.component.mjs +43 -0
- package/esm2020/lib/components/combobox/combobox.component.mjs +51 -0
- package/esm2020/lib/components/command/command.component.mjs +75 -0
- package/esm2020/lib/components/context-menu/context-menu.component.mjs +78 -0
- package/esm2020/lib/components/data-table/data-table.component.mjs +89 -0
- package/esm2020/lib/components/date-picker/date-picker.component.mjs +63 -0
- package/esm2020/lib/components/dialog/dialog.component.mjs +90 -0
- package/esm2020/lib/components/drawer/drawer.component.mjs +72 -0
- package/esm2020/lib/components/dropdown-menu/dropdown-menu.component.mjs +120 -0
- package/esm2020/lib/components/empty/empty.component.mjs +58 -0
- package/esm2020/lib/components/field/field.component.mjs +52 -0
- package/esm2020/lib/components/hover-card/hover-card.component.mjs +44 -0
- package/esm2020/lib/components/icon/icon.component.mjs +94 -0
- package/esm2020/lib/components/input/input.component.mjs +65 -0
- package/esm2020/lib/components/input-group/input-group.component.mjs +54 -0
- package/esm2020/lib/components/input-otp/input-otp.component.mjs +140 -0
- package/esm2020/lib/components/input-password/input-password.component.mjs +72 -0
- package/esm2020/lib/components/item/item.component.mjs +23 -0
- package/esm2020/lib/components/kbd/kbd.component.mjs +17 -0
- package/esm2020/lib/components/label/label.component.mjs +23 -0
- package/esm2020/lib/components/menubar/menubar.component.mjs +31 -0
- package/esm2020/lib/components/native-select/native-select.component.mjs +42 -0
- package/esm2020/lib/components/navigation-menu/navigation-menu.component.mjs +20 -0
- package/esm2020/lib/components/pagination/pagination.component.mjs +47 -0
- package/esm2020/lib/components/popover/popover.component.mjs +58 -0
- package/esm2020/lib/components/progress/progress.component.mjs +33 -0
- package/esm2020/lib/components/radio-group/radio-group.component.mjs +38 -0
- package/esm2020/lib/components/scroll-area/scroll-area.component.mjs +20 -0
- package/esm2020/lib/components/select/select.component.mjs +38 -0
- package/esm2020/lib/components/separator/separator.component.mjs +26 -0
- package/esm2020/lib/components/sheet/sheet.component.mjs +39 -0
- package/esm2020/lib/components/sidebar/sidebar.component.mjs +20 -0
- package/esm2020/lib/components/skeleton/skeleton.component.mjs +17 -0
- package/esm2020/lib/components/slider/slider.component.mjs +46 -0
- package/esm2020/lib/components/sonner/sonner.component.mjs +39 -0
- package/esm2020/lib/components/spinner/spinner.component.mjs +20 -0
- package/esm2020/lib/components/switch/switch.component.mjs +35 -0
- package/esm2020/lib/components/table/table.component.mjs +17 -0
- package/esm2020/lib/components/tabs/tabs.component.mjs +31 -0
- package/esm2020/lib/components/textarea/textarea.component.mjs +59 -0
- package/esm2020/lib/components/toggle/toggle.component.mjs +41 -0
- package/esm2020/lib/components/toggle-group/toggle-group.component.mjs +31 -0
- package/esm2020/lib/components/tooltip/tooltip.component.mjs +33 -0
- package/esm2020/lib/pdm-ui-kit.module.mjs +245 -0
- package/esm2020/pdm-ui-kit.mjs +5 -0
- package/esm2020/public-api.mjs +59 -0
- package/fesm2015/pdm-ui-kit.mjs +2959 -0
- package/fesm2015/pdm-ui-kit.mjs.map +1 -0
- package/fesm2020/pdm-ui-kit.mjs +2954 -0
- package/fesm2020/pdm-ui-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/accordion/accordion.component.d.ts +19 -0
- package/lib/components/alert/alert.component.d.ts +13 -0
- package/lib/components/alert-dialog/alert-dialog.component.d.ts +21 -0
- package/lib/components/aspect-ratio/aspect-ratio.component.d.ts +10 -0
- package/lib/components/avatar/avatar.component.d.ts +20 -0
- package/lib/components/badge/badge.component.d.ts +9 -0
- package/lib/components/breadcrumb/breadcrumb.component.d.ts +10 -0
- package/lib/components/button/button.component.d.ts +24 -0
- package/lib/components/button-group/button-group.component.d.ts +9 -0
- package/lib/components/calendar/calendar.component.d.ts +28 -0
- package/lib/components/card/card.component.d.ts +24 -0
- package/lib/components/carousel/carousel.component.d.ts +25 -0
- package/lib/components/chart/chart.component.d.ts +41 -0
- package/lib/components/checkbox/checkbox.component.d.ts +17 -0
- package/lib/components/collapsible/collapsible.component.d.ts +14 -0
- package/lib/components/combobox/combobox.component.d.ts +18 -0
- package/lib/components/command/command.component.d.ts +33 -0
- package/lib/components/context-menu/context-menu.component.d.ts +26 -0
- package/lib/components/data-table/data-table.component.d.ts +36 -0
- package/lib/components/date-picker/date-picker.component.d.ts +23 -0
- package/lib/components/dialog/dialog.component.d.ts +30 -0
- package/lib/components/drawer/drawer.component.d.ts +27 -0
- package/lib/components/dropdown-menu/dropdown-menu.component.d.ts +34 -0
- package/lib/components/empty/empty.component.d.ts +19 -0
- package/lib/components/field/field.component.d.ts +18 -0
- package/lib/components/hover-card/hover-card.component.d.ts +14 -0
- package/lib/components/icon/icon.component.d.ts +18 -0
- package/lib/components/input/input.component.d.ts +23 -0
- package/lib/components/input-group/input-group.component.d.ts +19 -0
- package/lib/components/input-otp/input-otp.component.d.ts +26 -0
- package/lib/components/input-password/input-password.component.d.ts +25 -0
- package/lib/components/item/item.component.d.ts +8 -0
- package/lib/components/kbd/kbd.component.d.ts +6 -0
- package/lib/components/label/label.component.d.ts +8 -0
- package/lib/components/menubar/menubar.component.d.ts +17 -0
- package/lib/components/native-select/native-select.component.d.ts +20 -0
- package/lib/components/navigation-menu/navigation-menu.component.d.ts +12 -0
- package/lib/components/pagination/pagination.component.d.ts +13 -0
- package/lib/components/popover/popover.component.d.ts +17 -0
- package/lib/components/progress/progress.component.d.ts +10 -0
- package/lib/components/radio-group/radio-group.component.d.ts +19 -0
- package/lib/components/scroll-area/scroll-area.component.d.ts +7 -0
- package/lib/components/select/select.component.d.ts +19 -0
- package/lib/components/separator/separator.component.d.ts +9 -0
- package/lib/components/sheet/sheet.component.d.ts +13 -0
- package/lib/components/sidebar/sidebar.component.d.ts +7 -0
- package/lib/components/skeleton/skeleton.component.d.ts +6 -0
- package/lib/components/slider/slider.component.d.ts +15 -0
- package/lib/components/sonner/sonner.component.d.ts +13 -0
- package/lib/components/spinner/spinner.component.d.ts +7 -0
- package/lib/components/switch/switch.component.d.ts +13 -0
- package/lib/components/table/table.component.d.ts +6 -0
- package/lib/components/tabs/tabs.component.d.ts +16 -0
- package/lib/components/textarea/textarea.component.d.ts +21 -0
- package/lib/components/toggle/toggle.component.d.ts +14 -0
- package/lib/components/toggle-group/toggle-group.component.d.ts +16 -0
- package/lib/components/tooltip/tooltip.component.d.ts +10 -0
- package/lib/pdm-ui-kit.module.d.ts +64 -0
- package/package.json +25 -10
- package/FIGMA_COMPONENT_AUDIT.md +0 -154
- package/ng-package.json +0 -7
- package/src/lib/components/accordion/accordion.component.html +0 -34
- package/src/lib/components/accordion/accordion.component.ts +0 -38
- package/src/lib/components/alert/alert.component.html +0 -52
- package/src/lib/components/alert/alert.component.ts +0 -25
- package/src/lib/components/alert-dialog/alert-dialog.component.html +0 -41
- package/src/lib/components/alert-dialog/alert-dialog.component.ts +0 -45
- package/src/lib/components/aspect-ratio/aspect-ratio.component.html +0 -11
- package/src/lib/components/aspect-ratio/aspect-ratio.component.ts +0 -18
- package/src/lib/components/avatar/avatar.component.html +0 -21
- package/src/lib/components/avatar/avatar.component.ts +0 -32
- package/src/lib/components/badge/badge.component.html +0 -28
- package/src/lib/components/badge/badge.component.ts +0 -23
- package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -39
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -26
- package/src/lib/components/button/button.component.html +0 -15
- package/src/lib/components/button/button.component.ts +0 -84
- package/src/lib/components/button-group/button-group.component.html +0 -39
- package/src/lib/components/button-group/button-group.component.ts +0 -15
- package/src/lib/components/calendar/calendar.component.html +0 -73
- package/src/lib/components/calendar/calendar.component.ts +0 -78
- package/src/lib/components/card/card.component.html +0 -77
- package/src/lib/components/card/card.component.ts +0 -39
- package/src/lib/components/carousel/carousel.component.html +0 -86
- package/src/lib/components/carousel/carousel.component.ts +0 -100
- package/src/lib/components/chart/chart.component.html +0 -143
- package/src/lib/components/chart/chart.component.ts +0 -147
- package/src/lib/components/checkbox/checkbox.component.html +0 -38
- package/src/lib/components/checkbox/checkbox.component.ts +0 -32
- package/src/lib/components/collapsible/collapsible.component.html +0 -26
- package/src/lib/components/collapsible/collapsible.component.ts +0 -29
- package/src/lib/components/combobox/combobox.component.html +0 -42
- package/src/lib/components/combobox/combobox.component.ts +0 -32
- package/src/lib/components/command/command.component.html +0 -55
- package/src/lib/components/command/command.component.ts +0 -67
- package/src/lib/components/context-menu/context-menu.component.html +0 -47
- package/src/lib/components/context-menu/context-menu.component.ts +0 -67
- package/src/lib/components/data-table/data-table.component.html +0 -63
- package/src/lib/components/data-table/data-table.component.ts +0 -78
- package/src/lib/components/date-picker/date-picker.component.html +0 -38
- package/src/lib/components/date-picker/date-picker.component.ts +0 -34
- package/src/lib/components/dialog/dialog.component.html +0 -78
- package/src/lib/components/dialog/dialog.component.ts +0 -55
- package/src/lib/components/drawer/drawer.component.html +0 -56
- package/src/lib/components/drawer/drawer.component.ts +0 -43
- package/src/lib/components/dropdown-menu/dropdown-menu.component.html +0 -56
- package/src/lib/components/dropdown-menu/dropdown-menu.component.ts +0 -126
- package/src/lib/components/empty/empty.component.html +0 -29
- package/src/lib/components/empty/empty.component.ts +0 -35
- package/src/lib/components/field/field.component.html +0 -22
- package/src/lib/components/field/field.component.ts +0 -28
- package/src/lib/components/hover-card/hover-card.component.html +0 -24
- package/src/lib/components/hover-card/hover-card.component.ts +0 -36
- package/src/lib/components/icon/icon.component.html +0 -286
- package/src/lib/components/icon/icon.component.ts +0 -133
- package/src/lib/components/input/input.component.html +0 -22
- package/src/lib/components/input/input.component.ts +0 -33
- package/src/lib/components/input-group/input-group.component.html +0 -31
- package/src/lib/components/input-group/input-group.component.ts +0 -26
- package/src/lib/components/input-otp/input-otp.component.html +0 -25
- package/src/lib/components/input-otp/input-otp.component.ts +0 -146
- package/src/lib/components/input-password/input-password.component.html +0 -64
- package/src/lib/components/input-password/input-password.component.ts +0 -46
- package/src/lib/components/item/item.component.html +0 -10
- package/src/lib/components/item/item.component.ts +0 -12
- package/src/lib/components/kbd/kbd.component.html +0 -3
- package/src/lib/components/kbd/kbd.component.ts +0 -10
- package/src/lib/components/label/label.component.html +0 -7
- package/src/lib/components/label/label.component.ts +0 -12
- package/src/lib/components/menubar/menubar.component.html +0 -16
- package/src/lib/components/menubar/menubar.component.ts +0 -29
- package/src/lib/components/native-select/native-select.component.html +0 -17
- package/src/lib/components/native-select/native-select.component.ts +0 -28
- package/src/lib/components/navigation-menu/navigation-menu.component.html +0 -15
- package/src/lib/components/navigation-menu/navigation-menu.component.ts +0 -17
- package/src/lib/components/pagination/pagination.component.html +0 -30
- package/src/lib/components/pagination/pagination.component.ts +0 -37
- package/src/lib/components/popover/popover.component.html +0 -6
- package/src/lib/components/popover/popover.component.ts +0 -40
- package/src/lib/components/progress/progress.component.html +0 -9
- package/src/lib/components/progress/progress.component.ts +0 -20
- package/src/lib/components/radio-group/radio-group.component.html +0 -25
- package/src/lib/components/radio-group/radio-group.component.ts +0 -30
- package/src/lib/components/scroll-area/scroll-area.component.html +0 -5
- package/src/lib/components/scroll-area/scroll-area.component.ts +0 -11
- package/src/lib/components/select/select.component.html +0 -14
- package/src/lib/components/select/select.component.ts +0 -27
- package/src/lib/components/separator/separator.component.html +0 -5
- package/src/lib/components/separator/separator.component.ts +0 -16
- package/src/lib/components/sheet/sheet.component.html +0 -10
- package/src/lib/components/sheet/sheet.component.ts +0 -28
- package/src/lib/components/sidebar/sidebar.component.html +0 -3
- package/src/lib/components/sidebar/sidebar.component.ts +0 -11
- package/src/lib/components/skeleton/skeleton.component.html +0 -1
- package/src/lib/components/skeleton/skeleton.component.ts +0 -10
- package/src/lib/components/slider/slider.component.html +0 -15
- package/src/lib/components/slider/slider.component.ts +0 -31
- package/src/lib/components/sonner/sonner.component.html +0 -10
- package/src/lib/components/sonner/sonner.component.ts +0 -25
- package/src/lib/components/spinner/spinner.component.html +0 -6
- package/src/lib/components/spinner/spinner.component.ts +0 -11
- package/src/lib/components/switch/switch.component.html +0 -14
- package/src/lib/components/switch/switch.component.ts +0 -20
- package/src/lib/components/table/table.component.html +0 -5
- package/src/lib/components/table/table.component.ts +0 -10
- package/src/lib/components/tabs/tabs.component.html +0 -21
- package/src/lib/components/tabs/tabs.component.ts +0 -26
- package/src/lib/components/textarea/textarea.component.html +0 -21
- package/src/lib/components/textarea/textarea.component.ts +0 -28
- package/src/lib/components/toggle/toggle.component.html +0 -16
- package/src/lib/components/toggle/toggle.component.ts +0 -29
- package/src/lib/components/toggle-group/toggle-group.component.html +0 -17
- package/src/lib/components/toggle-group/toggle-group.component.ts +0 -26
- package/src/lib/components/tooltip/tooltip.component.html +0 -6
- package/src/lib/components/tooltip/tooltip.component.ts +0 -20
- package/src/lib/pdm-ui-kit.module.ts +0 -126
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -9
- /package/{src/public-api.ts → public-api.d.ts} +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export interface PdmNativeSelectOption {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pdm-native-select',
|
|
11
|
-
templateUrl: './native-select.component.html',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
-
})
|
|
14
|
-
export class PdmNativeSelectComponent {
|
|
15
|
-
@Input() id = '';
|
|
16
|
-
@Input() value = '';
|
|
17
|
-
@Input() disabled = false;
|
|
18
|
-
@Input() invalid = false;
|
|
19
|
-
@Input() options: PdmNativeSelectOption[] = [];
|
|
20
|
-
@Input() placeholder = 'Select an option';
|
|
21
|
-
@Input() className = '';
|
|
22
|
-
|
|
23
|
-
@Output() valueChange = new EventEmitter<string>();
|
|
24
|
-
|
|
25
|
-
onChange(event: Event): void {
|
|
26
|
-
this.valueChange.emit((event.target as HTMLSelectElement).value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<nav [ngClass]="['relative z-10 flex max-w-max flex-1 items-center justify-center', className]">
|
|
2
|
-
<ul class="group flex flex-1 list-none items-center justify-center space-x-1">
|
|
3
|
-
<li *ngFor="let item of items">
|
|
4
|
-
<a
|
|
5
|
-
[href]="item.href || '#'"
|
|
6
|
-
[ngClass]="[
|
|
7
|
-
'group inline-flex h-9 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]',
|
|
8
|
-
item.active ? 'bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))]' : 'text-[hsl(var(--foreground))]'
|
|
9
|
-
]"
|
|
10
|
-
>
|
|
11
|
-
{{ item.label }}
|
|
12
|
-
</a>
|
|
13
|
-
</li>
|
|
14
|
-
</ul>
|
|
15
|
-
</nav>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export interface PdmNavigationItem {
|
|
4
|
-
label: string;
|
|
5
|
-
href?: string;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pdm-navigation-menu',
|
|
11
|
-
templateUrl: './navigation-menu.component.html',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
-
})
|
|
14
|
-
export class PdmNavigationMenuComponent {
|
|
15
|
-
@Input() items: PdmNavigationItem[] = [];
|
|
16
|
-
@Input() className = '';
|
|
17
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<nav aria-label="Pagination" [ngClass]="['mx-auto flex w-full justify-center', className]">
|
|
2
|
-
<ul class="flex items-center gap-1">
|
|
3
|
-
<li>
|
|
4
|
-
<button type="button" class="inline-flex h-8 items-center justify-center gap-1 rounded-md px-2 text-sm text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] disabled:opacity-50" [disabled]="page <= 1" (click)="setPage(page - 1)">
|
|
5
|
-
<pdm-icon name="chevron-left" [size]="14"></pdm-icon>
|
|
6
|
-
Previous
|
|
7
|
-
</button>
|
|
8
|
-
</li>
|
|
9
|
-
<li *ngFor="let pageNumber of visiblePages">
|
|
10
|
-
<button
|
|
11
|
-
type="button"
|
|
12
|
-
[ngClass]="[
|
|
13
|
-
'inline-flex h-6 min-w-[24px] items-center justify-center rounded-md px-2 text-sm',
|
|
14
|
-
pageNumber === page
|
|
15
|
-
? 'border border-[hsl(var(--border))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-[0_1px_2px_rgba(0,0,0,0.1)]'
|
|
16
|
-
: 'text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]'
|
|
17
|
-
]"
|
|
18
|
-
(click)="setPage(pageNumber)"
|
|
19
|
-
>
|
|
20
|
-
{{ pageNumber }}
|
|
21
|
-
</button>
|
|
22
|
-
</li>
|
|
23
|
-
<li>
|
|
24
|
-
<button type="button" class="inline-flex h-8 items-center justify-center gap-1 rounded-md px-2 text-sm text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] disabled:opacity-50" [disabled]="page >= pageCount" (click)="setPage(page + 1)">
|
|
25
|
-
Next
|
|
26
|
-
<pdm-icon name="chevron-right" [size]="14"></pdm-icon>
|
|
27
|
-
</button>
|
|
28
|
-
</li>
|
|
29
|
-
</ul>
|
|
30
|
-
</nav>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-pagination',
|
|
5
|
-
templateUrl: './pagination.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmPaginationComponent {
|
|
9
|
-
@Input() page = 1;
|
|
10
|
-
@Input() pageCount = 1;
|
|
11
|
-
@Input() maxVisible = 5;
|
|
12
|
-
@Input() className = '';
|
|
13
|
-
|
|
14
|
-
@Output() pageChange = new EventEmitter<number>();
|
|
15
|
-
|
|
16
|
-
get visiblePages(): number[] {
|
|
17
|
-
const total = Math.max(1, this.pageCount);
|
|
18
|
-
const visible = Math.max(1, this.maxVisible);
|
|
19
|
-
const half = Math.floor(visible / 2);
|
|
20
|
-
let start = Math.max(1, this.page - half);
|
|
21
|
-
let end = Math.min(total, start + visible - 1);
|
|
22
|
-
|
|
23
|
-
if (end - start + 1 < visible) {
|
|
24
|
-
start = Math.max(1, end - visible + 1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
setPage(next: number): void {
|
|
31
|
-
if (next < 1 || next > this.pageCount || next === this.page) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
this.pageChange.emit(next);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<div class="relative inline-block" [ngClass]="className">
|
|
2
|
-
<button *ngIf="showTrigger" type="button" class="inline-flex h-8 items-center justify-center rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--background))] px-3 text-sm font-medium leading-5 text-[hsl(var(--foreground))] shadow-[0_1px_2px_rgba(0,0,0,0.1)]" [attr.aria-expanded]="open" (click)="toggle()">{{ triggerText }}</button>
|
|
3
|
-
<div *ngIf="open || !showTrigger" [ngClass]="['absolute left-0 top-full z-30 mt-2 min-w-[320px] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-4 text-[hsl(var(--popover-foreground))] shadow-[0px_4px_6px_0px_rgba(0,0,0,0.09)]', panelClassName]">
|
|
4
|
-
<ng-content></ng-content>
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-popover',
|
|
5
|
-
templateUrl: './popover.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmPopoverComponent {
|
|
9
|
-
@Input() open = false;
|
|
10
|
-
@Input() triggerText = 'Open';
|
|
11
|
-
@Input() className = '';
|
|
12
|
-
@Input() panelClassName = '';
|
|
13
|
-
@Input() showTrigger = true;
|
|
14
|
-
@Output() openChange = new EventEmitter<boolean>();
|
|
15
|
-
|
|
16
|
-
constructor(private readonly elementRef: ElementRef<HTMLElement>) {}
|
|
17
|
-
|
|
18
|
-
toggle(): void {
|
|
19
|
-
this.open = !this.open;
|
|
20
|
-
this.openChange.emit(this.open);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@HostListener('document:keydown.escape')
|
|
24
|
-
onEsc(): void {
|
|
25
|
-
if (this.open) {
|
|
26
|
-
this.open = false;
|
|
27
|
-
this.openChange.emit(false);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@HostListener('document:click', ['$event'])
|
|
32
|
-
onDocumentClick(event: MouseEvent): void {
|
|
33
|
-
if (!this.open) return;
|
|
34
|
-
const target = event.target as Node | null;
|
|
35
|
-
if (target && !this.elementRef.nativeElement.contains(target)) {
|
|
36
|
-
this.open = false;
|
|
37
|
-
this.openChange.emit(false);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
role="progressbar"
|
|
3
|
-
[attr.aria-valuemin]="0"
|
|
4
|
-
[attr.aria-valuemax]="max"
|
|
5
|
-
[attr.aria-valuenow]="indeterminate ? null : value"
|
|
6
|
-
[ngClass]="['relative h-1.5 w-full overflow-hidden rounded-full bg-[hsl(var(--muted))]', className]"
|
|
7
|
-
>
|
|
8
|
-
<div [ngClass]="['h-full bg-[hsl(var(--foreground))] transition-all', indeterminate ? 'animate-pulse' : '']" [style.width]="width"></div>
|
|
9
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-progress',
|
|
5
|
-
templateUrl: './progress.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmProgressComponent {
|
|
9
|
-
@Input() value = 0;
|
|
10
|
-
@Input() max = 100;
|
|
11
|
-
@Input() indeterminate = false;
|
|
12
|
-
@Input() className = '';
|
|
13
|
-
|
|
14
|
-
get width(): string {
|
|
15
|
-
if (this.indeterminate) return '100%';
|
|
16
|
-
const safeMax = this.max > 0 ? this.max : 100;
|
|
17
|
-
const pct = Math.min(100, Math.max(0, (this.value / safeMax) * 100));
|
|
18
|
-
return pct + '%';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
role="radiogroup"
|
|
3
|
-
[ngClass]="[
|
|
4
|
-
'gap-2',
|
|
5
|
-
direction === 'horizontal' ? 'inline-flex items-center' : 'grid',
|
|
6
|
-
className
|
|
7
|
-
]"
|
|
8
|
-
>
|
|
9
|
-
<label *ngFor="let option of options" [attr.for]="optionId(option)" class="inline-flex cursor-pointer items-center gap-2">
|
|
10
|
-
<input
|
|
11
|
-
[id]="optionId(option)"
|
|
12
|
-
type="radio"
|
|
13
|
-
[name]="name"
|
|
14
|
-
[value]="option.value"
|
|
15
|
-
[checked]="value === option.value"
|
|
16
|
-
[disabled]="option.disabled"
|
|
17
|
-
class="peer sr-only"
|
|
18
|
-
(change)="onChange($event)"
|
|
19
|
-
/>
|
|
20
|
-
<span class="relative block h-4 w-4 rounded-full border border-[hsl(var(--input))] bg-[hsl(var(--background))] peer-checked:border-[hsl(var(--foreground))] peer-focus-visible:ring-1 peer-focus-visible:ring-[hsl(var(--foreground))]">
|
|
21
|
-
<span class="absolute left-1/2 top-1/2 hidden h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-[hsl(var(--foreground))] peer-checked:block"></span>
|
|
22
|
-
</span>
|
|
23
|
-
<span class="text-sm leading-5 text-[hsl(var(--foreground))]">{{ option.label }}</span>
|
|
24
|
-
</label>
|
|
25
|
-
</div>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export interface PdmRadioOption {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pdm-radio-group',
|
|
11
|
-
templateUrl: './radio-group.component.html',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
-
})
|
|
14
|
-
export class PdmRadioGroupComponent {
|
|
15
|
-
@Input() name = 'pdm-radio-group';
|
|
16
|
-
@Input() value = '';
|
|
17
|
-
@Input() options: PdmRadioOption[] = [];
|
|
18
|
-
@Input() direction: 'vertical' | 'horizontal' = 'vertical';
|
|
19
|
-
@Input() className = '';
|
|
20
|
-
|
|
21
|
-
@Output() valueChange = new EventEmitter<string>();
|
|
22
|
-
|
|
23
|
-
optionId(option: PdmRadioOption): string {
|
|
24
|
-
return `${this.name}-${option.value}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
onChange(event: Event): void {
|
|
28
|
-
this.valueChange.emit((event.target as HTMLInputElement).value);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-scroll-area',
|
|
5
|
-
templateUrl: './scroll-area.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmScrollAreaComponent {
|
|
9
|
-
@Input() maxHeight = '16rem';
|
|
10
|
-
@Input() className = '';
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<select
|
|
2
|
-
[id]="id"
|
|
3
|
-
[value]="value"
|
|
4
|
-
[disabled]="disabled"
|
|
5
|
-
[attr.aria-invalid]="invalid"
|
|
6
|
-
[ngClass]="[
|
|
7
|
-
'flex h-9 w-full rounded-[8px] border bg-[hsl(var(--background))] px-3 py-2 text-sm leading-5 text-[hsl(var(--foreground))] shadow-[0_1px_2px_rgba(0,0,0,0.1)] ring-offset-[hsl(var(--background))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--foreground))] disabled:cursor-not-allowed disabled:opacity-50',
|
|
8
|
-
invalid ? 'border-[hsl(var(--destructive))]' : 'border-[hsl(var(--input))]',
|
|
9
|
-
className
|
|
10
|
-
]"
|
|
11
|
-
(change)="onChange($event)"
|
|
12
|
-
>
|
|
13
|
-
<option *ngFor="let option of options" [value]="option.value" [disabled]="option.disabled">{{ option.label }}</option>
|
|
14
|
-
</select>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export interface PdmSelectOption {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pdm-select',
|
|
11
|
-
templateUrl: './select.component.html',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
-
})
|
|
14
|
-
export class PdmSelectComponent {
|
|
15
|
-
@Input() id = '';
|
|
16
|
-
@Input() value = '';
|
|
17
|
-
@Input() options: PdmSelectOption[] = [];
|
|
18
|
-
@Input() disabled = false;
|
|
19
|
-
@Input() invalid = false;
|
|
20
|
-
@Input() className = '';
|
|
21
|
-
|
|
22
|
-
@Output() valueChange = new EventEmitter<string>();
|
|
23
|
-
|
|
24
|
-
onChange(event: Event): void {
|
|
25
|
-
this.valueChange.emit((event.target as HTMLSelectElement).value);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-separator',
|
|
5
|
-
templateUrl: './separator.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSeparatorComponent {
|
|
9
|
-
@Input() orientation: 'horizontal' | 'vertical' = 'horizontal';
|
|
10
|
-
@Input() decorative = true;
|
|
11
|
-
@Input() className = '';
|
|
12
|
-
|
|
13
|
-
get orientationClass(): string {
|
|
14
|
-
return this.orientation === 'vertical' ? 'h-full w-px' : 'h-px w-full';
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<div *ngIf="open" class="fixed inset-0 z-50">
|
|
2
|
-
<button type="button" class="absolute inset-0 bg-black/55" aria-label="Close sheet" (click)="close()"></button>
|
|
3
|
-
|
|
4
|
-
<section [ngClass]="['absolute bg-[hsl(var(--background))] border-[hsl(var(--border))] p-6 shadow-[0_4px_6px_rgba(0,0,0,0.09)]', panelClass, className]" role="dialog" aria-modal="true">
|
|
5
|
-
<button type="button" class="absolute right-3 top-3 rounded-sm opacity-70 transition-opacity hover:opacity-100" (click)="close()">
|
|
6
|
-
<pdm-icon name="x" [size]="16"></pdm-icon>
|
|
7
|
-
</button>
|
|
8
|
-
<ng-content></ng-content>
|
|
9
|
-
</section>
|
|
10
|
-
</div>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export type PdmSheetSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'pdm-sheet',
|
|
7
|
-
templateUrl: './sheet.component.html',
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
9
|
-
})
|
|
10
|
-
export class PdmSheetComponent {
|
|
11
|
-
@Input() open = false;
|
|
12
|
-
@Input() side: PdmSheetSide = 'right';
|
|
13
|
-
@Input() className = '';
|
|
14
|
-
|
|
15
|
-
@Output() openChange = new EventEmitter<boolean>();
|
|
16
|
-
|
|
17
|
-
close(): void {
|
|
18
|
-
this.openChange.emit(false);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
get panelClass(): string {
|
|
22
|
-
if (this.side === 'left') return 'left-0 top-0 h-full w-full max-w-[360px] border-r';
|
|
23
|
-
if (this.side === 'top') return 'top-0 left-0 w-full border-b';
|
|
24
|
-
if (this.side === 'bottom') return 'bottom-0 left-0 w-full border-t';
|
|
25
|
-
|
|
26
|
-
return 'right-0 top-0 h-full w-full max-w-[360px] border-l';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-sidebar',
|
|
5
|
-
templateUrl: './sidebar.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSidebarComponent {
|
|
9
|
-
@Input() collapsed = false;
|
|
10
|
-
@Input() className = '';
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div [ngClass]="['animate-pulse rounded-md bg-[hsl(var(--muted))]', className]"></div>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-skeleton',
|
|
5
|
-
templateUrl: './skeleton.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSkeletonComponent {
|
|
9
|
-
@Input() className = '';
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<div [ngClass]="['relative h-5 w-full', className]">
|
|
2
|
-
<div class="absolute left-0 right-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-[hsl(var(--muted))]"></div>
|
|
3
|
-
<div class="absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-[hsl(var(--foreground))]" [style.width.%]="percentage"></div>
|
|
4
|
-
<div class="absolute top-1/2 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[hsl(var(--foreground))] bg-[hsl(var(--background))] shadow-[0_1px_2px_rgba(0,0,0,0.1)]" [style.left.%]="percentage"></div>
|
|
5
|
-
<input
|
|
6
|
-
type="range"
|
|
7
|
-
[min]="min"
|
|
8
|
-
[max]="max"
|
|
9
|
-
[step]="step"
|
|
10
|
-
[value]="value"
|
|
11
|
-
[disabled]="disabled"
|
|
12
|
-
class="absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
|
|
13
|
-
(input)="onInput($event)"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-slider',
|
|
5
|
-
templateUrl: './slider.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSliderComponent {
|
|
9
|
-
@Input() min = 0;
|
|
10
|
-
@Input() max = 100;
|
|
11
|
-
@Input() step = 1;
|
|
12
|
-
@Input() value = 0;
|
|
13
|
-
@Input() disabled = false;
|
|
14
|
-
@Input() className = '';
|
|
15
|
-
|
|
16
|
-
@Output() valueChange = new EventEmitter<number>();
|
|
17
|
-
|
|
18
|
-
get percentage(): number {
|
|
19
|
-
const safeRange = this.max - this.min;
|
|
20
|
-
if (safeRange <= 0) {
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const bounded = Math.min(this.max, Math.max(this.min, this.value));
|
|
25
|
-
return ((bounded - this.min) / safeRange) * 100;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
onInput(event: Event): void {
|
|
29
|
-
this.valueChange.emit(Number((event.target as HTMLInputElement).value));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<div [ngClass]="['flex w-full max-w-sm items-start gap-3 rounded-lg border p-4 shadow-lg', toneClass, className]" role="status" aria-live="polite">
|
|
2
|
-
<div class="grid gap-0.5">
|
|
3
|
-
<p *ngIf="title" class="text-sm font-semibold">{{ title }}</p>
|
|
4
|
-
<p *ngIf="description" class="text-sm opacity-90">{{ description }}</p>
|
|
5
|
-
<ng-content></ng-content>
|
|
6
|
-
</div>
|
|
7
|
-
<button type="button" class="ml-auto rounded-sm opacity-70 transition-opacity hover:opacity-100" (click)="dismissed.emit()" aria-label="Dismiss">
|
|
8
|
-
<pdm-icon name="x" [size]="14"></pdm-icon>
|
|
9
|
-
</button>
|
|
10
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export type PdmToastTone = 'default' | 'success' | 'error' | 'warning';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'pdm-sonner',
|
|
7
|
-
templateUrl: './sonner.component.html',
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
9
|
-
})
|
|
10
|
-
export class PdmSonnerComponent {
|
|
11
|
-
@Input() title = '';
|
|
12
|
-
@Input() description = '';
|
|
13
|
-
@Input() tone: PdmToastTone = 'default';
|
|
14
|
-
@Input() className = '';
|
|
15
|
-
|
|
16
|
-
@Output() dismissed = new EventEmitter<void>();
|
|
17
|
-
|
|
18
|
-
get toneClass(): string {
|
|
19
|
-
if (this.tone === 'success') return 'border-emerald-200 bg-emerald-50 text-emerald-900';
|
|
20
|
-
if (this.tone === 'error') return 'border-red-200 bg-red-50 text-red-900';
|
|
21
|
-
if (this.tone === 'warning') return 'border-amber-200 bg-amber-50 text-amber-900';
|
|
22
|
-
|
|
23
|
-
return 'border-[hsl(var(--border))] bg-[hsl(var(--background))] text-[hsl(var(--foreground))]';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-spinner',
|
|
5
|
-
templateUrl: './spinner.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSpinnerComponent {
|
|
9
|
-
@Input() size = 16;
|
|
10
|
-
@Input() className = '';
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<label [attr.for]="id" [ngClass]="['inline-flex items-center gap-2', className]">
|
|
2
|
-
<input
|
|
3
|
-
[id]="id"
|
|
4
|
-
type="checkbox"
|
|
5
|
-
class="peer sr-only"
|
|
6
|
-
[checked]="checked"
|
|
7
|
-
[disabled]="disabled"
|
|
8
|
-
(change)="onToggle($event)"
|
|
9
|
-
/>
|
|
10
|
-
<span class="relative inline-flex h-6 w-11 items-center rounded-full border border-transparent bg-[hsl(var(--muted))] transition-colors peer-focus-visible:ring-1 peer-focus-visible:ring-[hsl(var(--foreground))] peer-disabled:opacity-50 peer-checked:bg-[hsl(var(--foreground))]">
|
|
11
|
-
<span class="h-5 w-5 translate-x-0.5 rounded-full bg-white shadow-[0_1px_2px_rgba(0,0,0,0.1)] transition-transform peer-checked:translate-x-5"></span>
|
|
12
|
-
</span>
|
|
13
|
-
<span *ngIf="label" class="text-sm leading-5 text-[hsl(var(--foreground))]">{{ label }}</span>
|
|
14
|
-
</label>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-switch',
|
|
5
|
-
templateUrl: './switch.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmSwitchComponent {
|
|
9
|
-
@Input() id = '';
|
|
10
|
-
@Input() checked = false;
|
|
11
|
-
@Input() disabled = false;
|
|
12
|
-
@Input() label = '';
|
|
13
|
-
@Input() className = '';
|
|
14
|
-
|
|
15
|
-
@Output() checkedChange = new EventEmitter<boolean>();
|
|
16
|
-
|
|
17
|
-
onToggle(event: Event): void {
|
|
18
|
-
this.checkedChange.emit((event.target as HTMLInputElement).checked);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'pdm-table',
|
|
5
|
-
templateUrl: './table.component.html',
|
|
6
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
-
})
|
|
8
|
-
export class PdmTableComponent {
|
|
9
|
-
@Input() className = '';
|
|
10
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<div [ngClass]="['w-full', className]">
|
|
2
|
-
<div role="tablist" class="inline-flex items-start rounded-[6px] bg-[hsl(var(--muted))] p-[5px]">
|
|
3
|
-
<button
|
|
4
|
-
*ngFor="let item of items"
|
|
5
|
-
role="tab"
|
|
6
|
-
[attr.aria-selected]="value === item.value"
|
|
7
|
-
[disabled]="item.disabled"
|
|
8
|
-
[ngClass]="[
|
|
9
|
-
'inline-flex items-center justify-center whitespace-nowrap rounded-[3px] px-3 py-1.5 text-sm font-medium leading-5 ring-offset-[hsl(var(--background))] transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--foreground))] disabled:pointer-events-none disabled:opacity-50',
|
|
10
|
-
value === item.value ? 'bg-[hsl(var(--background))] text-[hsl(var(--foreground))] shadow-[0_1px_2px_rgba(0,0,0,0.1)]' : 'text-[hsl(var(--muted-foreground))]'
|
|
11
|
-
]"
|
|
12
|
-
(click)="select(item)"
|
|
13
|
-
type="button"
|
|
14
|
-
>
|
|
15
|
-
{{ item.label }}
|
|
16
|
-
</button>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="mt-4">
|
|
19
|
-
<ng-content></ng-content>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
export interface PdmTabItem {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'pdm-tabs',
|
|
11
|
-
templateUrl: './tabs.component.html',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
-
})
|
|
14
|
-
export class PdmTabsComponent {
|
|
15
|
-
@Input() items: PdmTabItem[] = [];
|
|
16
|
-
@Input() value = '';
|
|
17
|
-
@Input() className = '';
|
|
18
|
-
|
|
19
|
-
@Output() valueChange = new EventEmitter<string>();
|
|
20
|
-
|
|
21
|
-
select(item: PdmTabItem): void {
|
|
22
|
-
if (!item.disabled) {
|
|
23
|
-
this.valueChange.emit(item.value);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|