pdm-ui-kit 1.3.0 → 1.5.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/README.md +28 -0
- package/alert/alert-dialog.component.d.ts +14 -2
- package/alert/alert.module.d.ts +2 -1
- package/calendar/date-picker.component.d.ts +2 -1
- package/dialog/dialog.component.d.ts +18 -26
- package/dialog/dialog.module.d.ts +1 -1
- package/esm2020/alert/alert-dialog.component.mjs +101 -11
- package/esm2020/alert/alert.module.mjs +5 -4
- package/esm2020/calendar/date-picker.component.mjs +15 -5
- package/esm2020/dialog/dialog.component.mjs +43 -85
- package/esm2020/dialog/dialog.module.mjs +10 -4
- package/esm2020/src/alert/alert-dialog.component.mjs +101 -11
- package/esm2020/src/alert/alert.module.mjs +5 -4
- package/esm2020/src/calendar/date-picker.component.mjs +15 -5
- package/esm2020/src/dialog/dialog.component.mjs +43 -85
- package/esm2020/src/dialog/dialog.module.mjs +10 -4
- package/esm2020/src/utils/cn.mjs +19 -0
- package/esm2020/src/utils/public-api.mjs +2 -1
- package/fesm2015/pdm-ui-kit-src-alert.mjs +103 -12
- package/fesm2015/pdm-ui-kit-src-alert.mjs.map +1 -1
- package/fesm2015/pdm-ui-kit-src-calendar.mjs +14 -4
- package/fesm2015/pdm-ui-kit-src-calendar.mjs.map +1 -1
- package/fesm2015/pdm-ui-kit-src-dialog.mjs +50 -85
- package/fesm2015/pdm-ui-kit-src-dialog.mjs.map +1 -1
- package/fesm2015/pdm-ui-kit-src-utils.mjs +21 -1
- package/fesm2015/pdm-ui-kit-src-utils.mjs.map +1 -1
- package/fesm2015/pdm-ui-kit.mjs +175 -112
- package/fesm2015/pdm-ui-kit.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit-src-alert.mjs +103 -12
- package/fesm2020/pdm-ui-kit-src-alert.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit-src-calendar.mjs +14 -4
- package/fesm2020/pdm-ui-kit-src-calendar.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit-src-dialog.mjs +50 -85
- package/fesm2020/pdm-ui-kit-src-dialog.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit-src-utils.mjs +21 -1
- package/fesm2020/pdm-ui-kit-src-utils.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit.mjs +175 -112
- package/fesm2020/pdm-ui-kit.mjs.map +1 -1
- package/package.json +3 -1
- package/src/alert/alert-dialog.component.d.ts +14 -2
- package/src/alert/alert.module.d.ts +2 -1
- package/src/calendar/date-picker.component.d.ts +2 -1
- package/src/dialog/dialog.component.d.ts +18 -26
- package/src/dialog/dialog.module.d.ts +1 -1
- package/src/utils/cn.d.ts +15 -0
- package/src/utils/public-api.d.ts +1 -0
|
@@ -2,6 +2,9 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { responsive, Z_INDEX, cn } from 'pdm-ui-kit/src/utils';
|
|
6
|
+
import * as i2 from '@angular/cdk/a11y';
|
|
7
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
5
8
|
|
|
6
9
|
class PdmAlertComponent {
|
|
7
10
|
constructor() {
|
|
@@ -39,12 +42,17 @@ class PdmAlertDialogComponent {
|
|
|
39
42
|
constructor() {
|
|
40
43
|
this.open = false;
|
|
41
44
|
this.showTrigger = false;
|
|
42
|
-
this.triggerText =
|
|
43
|
-
this.title =
|
|
44
|
-
this.description =
|
|
45
|
-
this.confirmText =
|
|
46
|
-
this.cancelText =
|
|
47
|
-
this.
|
|
45
|
+
this.triggerText = "Show dialog";
|
|
46
|
+
this.title = "Are you absolutely sure?";
|
|
47
|
+
this.description = "";
|
|
48
|
+
this.confirmText = "Continue";
|
|
49
|
+
this.cancelText = "Cancel";
|
|
50
|
+
this.size = "responsive";
|
|
51
|
+
this.maxWidth = "";
|
|
52
|
+
this.className = "";
|
|
53
|
+
this.bodyClassName = "";
|
|
54
|
+
this.showFooter = true;
|
|
55
|
+
this.closeOnBackdrop = true;
|
|
48
56
|
/** Close when the ESC key is pressed. Default: `true`. */
|
|
49
57
|
this.closeOnEsc = true;
|
|
50
58
|
this.openChange = new EventEmitter();
|
|
@@ -59,6 +67,70 @@ class PdmAlertDialogComponent {
|
|
|
59
67
|
get isControlled() {
|
|
60
68
|
return this.openChange.observed;
|
|
61
69
|
}
|
|
70
|
+
get panelClassName() {
|
|
71
|
+
if (this.size === "desktop") {
|
|
72
|
+
return this.buildPanelClasses([
|
|
73
|
+
"max-w-[640px]",
|
|
74
|
+
"max-h-[calc(100vh-2rem)]",
|
|
75
|
+
"rounded-[10px]",
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
if (this.size === "mobile") {
|
|
79
|
+
return this.buildPanelClasses([
|
|
80
|
+
"max-w-[320px]",
|
|
81
|
+
"min-h-[240px]",
|
|
82
|
+
"rounded-[10px]",
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
if (this.size === "mobile-fullscreen") {
|
|
86
|
+
return this.buildPanelClasses([
|
|
87
|
+
"max-w-[320px]",
|
|
88
|
+
"h-[min(100dvh,640px)]",
|
|
89
|
+
"rounded-none",
|
|
90
|
+
"sm:rounded-[10px]",
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
93
|
+
if (this.size === "responsive") {
|
|
94
|
+
return this.buildPanelClasses([
|
|
95
|
+
"w-full",
|
|
96
|
+
"h-full",
|
|
97
|
+
"max-h-[100dvh]",
|
|
98
|
+
"rounded-t-[10px]",
|
|
99
|
+
"sm:rounded-[10px]",
|
|
100
|
+
"sm:w-auto",
|
|
101
|
+
"sm:h-auto",
|
|
102
|
+
"sm:max-w-[640px]",
|
|
103
|
+
"sm:max-h-[calc(100vh-4rem)]",
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
const sizeMap = {
|
|
107
|
+
sm: "sm:max-w-[400px]",
|
|
108
|
+
md: "sm:max-w-[500px]",
|
|
109
|
+
lg: "sm:max-w-[640px]",
|
|
110
|
+
xl: "sm:max-w-[800px]",
|
|
111
|
+
};
|
|
112
|
+
const maxWidth = sizeMap[this.size] || sizeMap.lg;
|
|
113
|
+
return this.buildPanelClasses([
|
|
114
|
+
"w-full",
|
|
115
|
+
"h-full",
|
|
116
|
+
"max-h-[100dvh]",
|
|
117
|
+
"rounded-t-[10px]",
|
|
118
|
+
"sm:rounded-[10px]",
|
|
119
|
+
"sm:w-auto",
|
|
120
|
+
"sm:h-auto",
|
|
121
|
+
maxWidth,
|
|
122
|
+
"sm:max-h-[calc(100vh-4rem)]",
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
125
|
+
get containerClassName() {
|
|
126
|
+
return responsive({
|
|
127
|
+
default: `fixed inset-x-0 bottom-0 ${Z_INDEX.modalBackdrop} flex items-end justify-center`,
|
|
128
|
+
sm: `fixed inset-0 ${Z_INDEX.modalBackdrop} flex items-center justify-center p-4`,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
get bodyWrapperClassName() {
|
|
132
|
+
return cn("flex-1 min-h-0 overflow-y-auto px-4 py-4 sm:px-6", this.bodyClassName);
|
|
133
|
+
}
|
|
62
134
|
onTriggerClick() {
|
|
63
135
|
if (!this.isControlled) {
|
|
64
136
|
this.open = true;
|
|
@@ -79,17 +151,26 @@ class PdmAlertDialogComponent {
|
|
|
79
151
|
}
|
|
80
152
|
this.openChange.emit(false);
|
|
81
153
|
}
|
|
154
|
+
onBackdropClick() {
|
|
155
|
+
if (this.closeOnBackdrop) {
|
|
156
|
+
this.onCancel();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
82
159
|
onEsc() {
|
|
83
160
|
if (this.open && this.closeOnEsc) {
|
|
84
161
|
this.onCancel();
|
|
85
162
|
}
|
|
86
163
|
}
|
|
164
|
+
buildPanelClasses(sizeClasses) {
|
|
165
|
+
const maxWidthClass = this.maxWidth ? `sm:max-w-[${this.maxWidth}]` : "";
|
|
166
|
+
return cn("relative", Z_INDEX.modal, "flex flex-col border border-solid border-border bg-background text-foreground shadow-lg overflow-hidden", ...sizeClasses, maxWidthClass, this.className);
|
|
167
|
+
}
|
|
87
168
|
}
|
|
88
169
|
PdmAlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
-
PdmAlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmAlertDialogComponent, selector: "pdm-alert-dialog", inputs: { open: "open", showTrigger: "showTrigger", triggerText: "triggerText", title: "title", description: "description", confirmText: "confirmText", cancelText: "cancelText", className: "className", closeOnEsc: "closeOnEsc" }, outputs: { openChange: "openChange", confirm: "confirm", cancel: "cancel" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, ngImport: i0, template: "<button\n *ngIf=\"showTrigger && !open\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onTriggerClick()\"\n>\n {{ triggerText }}\n</button>\n\n<div *ngIf=\"open\"
|
|
170
|
+
PdmAlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmAlertDialogComponent, selector: "pdm-alert-dialog", inputs: { open: "open", showTrigger: "showTrigger", triggerText: "triggerText", title: "title", description: "description", confirmText: "confirmText", cancelText: "cancelText", size: "size", maxWidth: "maxWidth", className: "className", bodyClassName: "bodyClassName", showFooter: "showFooter", closeOnBackdrop: "closeOnBackdrop", closeOnEsc: "closeOnEsc" }, outputs: { openChange: "openChange", confirm: "confirm", cancel: "cancel" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, ngImport: i0, template: "<button\n *ngIf=\"showTrigger && !open\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onTriggerClick()\"\n>\n {{ triggerText }}\n</button>\n\n<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n <section role=\"alertdialog\" aria-modal=\"true\" cdkTrapFocus [ngClass]=\"panelClassName\">\n <div class=\"flex flex-col gap-2 p-4 sm:p-6\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"showFooter\" class=\"flex flex-col gap-2 p-4 sm:p-6 border-t border-border sm:flex-row sm:justify-end\">\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\" (click)=\"onCancel()\">{{ cancelText }}</button>\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\" (click)=\"onConfirm()\">{{ confirmText }}</button>\n </div>\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
90
171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertDialogComponent, decorators: [{
|
|
91
172
|
type: Component,
|
|
92
|
-
args: [{ selector:
|
|
173
|
+
args: [{ selector: "pdm-alert-dialog", changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n *ngIf=\"showTrigger && !open\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onTriggerClick()\"\n>\n {{ triggerText }}\n</button>\n\n<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n <section role=\"alertdialog\" aria-modal=\"true\" cdkTrapFocus [ngClass]=\"panelClassName\">\n <div class=\"flex flex-col gap-2 p-4 sm:p-6\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"showFooter\" class=\"flex flex-col gap-2 p-4 sm:p-6 border-t border-border sm:flex-row sm:justify-end\">\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\" (click)=\"onCancel()\">{{ cancelText }}</button>\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\" (click)=\"onConfirm()\">{{ confirmText }}</button>\n </div>\n </section>\n</div>\n" }]
|
|
93
174
|
}], propDecorators: { open: [{
|
|
94
175
|
type: Input
|
|
95
176
|
}], showTrigger: [{
|
|
@@ -104,8 +185,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
104
185
|
type: Input
|
|
105
186
|
}], cancelText: [{
|
|
106
187
|
type: Input
|
|
188
|
+
}], size: [{
|
|
189
|
+
type: Input
|
|
190
|
+
}], maxWidth: [{
|
|
191
|
+
type: Input
|
|
107
192
|
}], className: [{
|
|
108
193
|
type: Input
|
|
194
|
+
}], bodyClassName: [{
|
|
195
|
+
type: Input
|
|
196
|
+
}], showFooter: [{
|
|
197
|
+
type: Input
|
|
198
|
+
}], closeOnBackdrop: [{
|
|
199
|
+
type: Input
|
|
109
200
|
}], closeOnEsc: [{
|
|
110
201
|
type: Input
|
|
111
202
|
}], openChange: [{
|
|
@@ -116,7 +207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
116
207
|
type: Output
|
|
117
208
|
}], onEsc: [{
|
|
118
209
|
type: HostListener,
|
|
119
|
-
args: [
|
|
210
|
+
args: ["document:keydown.escape"]
|
|
120
211
|
}] } });
|
|
121
212
|
|
|
122
213
|
const COMPONENTS = [
|
|
@@ -127,13 +218,13 @@ class PdmAlertModule {
|
|
|
127
218
|
}
|
|
128
219
|
PdmAlertModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
129
220
|
PdmAlertModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertModule, declarations: [PdmAlertComponent,
|
|
130
|
-
PdmAlertDialogComponent], imports: [CommonModule], exports: [PdmAlertComponent,
|
|
221
|
+
PdmAlertDialogComponent], imports: [CommonModule, A11yModule], exports: [PdmAlertComponent,
|
|
131
222
|
PdmAlertDialogComponent] });
|
|
132
|
-
PdmAlertModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertModule, imports: [CommonModule] });
|
|
223
|
+
PdmAlertModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertModule, imports: [CommonModule, A11yModule] });
|
|
133
224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmAlertModule, decorators: [{
|
|
134
225
|
type: NgModule,
|
|
135
226
|
args: [{
|
|
136
|
-
imports: [CommonModule],
|
|
227
|
+
imports: [CommonModule, A11yModule],
|
|
137
228
|
declarations: COMPONENTS,
|
|
138
229
|
exports: COMPONENTS
|
|
139
230
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdm-ui-kit-src-alert.mjs","sources":["../../../src/alert/alert.component.ts","../../../src/alert/alert.component.html","../../../src/alert/alert-dialog.component.ts","../../../src/alert/alert-dialog.component.html","../../../src/alert/alert.module.ts","../../../src/alert/pdm-ui-kit-src-alert.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nexport type PdmAlertVariant = 'default' | 'title-only' | 'destructive';\n\n@Component({\n selector: 'pdm-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PdmAlertComponent {\n @Input() variant: PdmAlertVariant = 'default';\n @Input() title = 'Success! Your changes have been saved';\n @Input() description = 'This is an alert with icon, title and description.';\n @Input() details: string[] = [];\n @Input() className = '';\n\n get isDestructive(): boolean {\n return this.variant === 'destructive';\n }\n\n get isTitleOnly(): boolean {\n return this.variant === 'title-only';\n }\n}\n\n","<section\n role=\"alert\"\n [ngClass]=\"[\n 'w-full rounded-lg border border-solid border-border bg-background p-4',\n className\n ]\"\n>\n <div [ngClass]=\"['flex gap-3', isDestructive ? 'items-start' : 'items-center']\">\n <span class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center\">\n <svg *ngIf=\"!isDestructive && !isTitleOnly\" aria-label=\"Success\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-foreground\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" stroke-width=\"1.5\"></circle>\n <path d=\"M8.5 12.5L10.8 14.8L15.8 9.8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <svg *ngIf=\"isTitleOnly\" aria-label=\"Info\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-foreground\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 8H19\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <path d=\"M9 8V6.5C9 5.67 9.67 5 10.5 5H13.5C14.33 5 15 5.67 15 6.5V8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <path d=\"M7 8L8 18.5C8.07 19.33 8.77 20 9.6 20H14.4C15.23 20 15.93 19.33 16 18.5L17 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n <svg *ngIf=\"isDestructive\" aria-label=\"Error\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-destructive\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" stroke-width=\"1.5\"></circle>\n <path d=\"M12 8V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <circle cx=\"12\" cy=\"16\" r=\"1\" fill=\"currentColor\"></circle>\n </svg>\n </span>\n\n <div class=\"min-w-0 flex-1\">\n <h4\n [ngClass]=\"[\n 'm-0 text-sm font-medium',\n isDestructive ? 'text-destructive' : 'text-foreground'\n ]\"\n >\n {{ title }}\n </h4>\n\n <p\n *ngIf=\"!isTitleOnly && description\"\n [ngClass]=\"[\n 'm-0 mt-0.5 text-sm',\n isDestructive ? 'text-destructive' : 'text-muted-foreground'\n ]\"\n >\n {{ description }}\n </p>\n\n <ul *ngIf=\"isDestructive && details.length\" class=\"m-0 mt-1 pl-5 text-sm text-destructive\">\n <li *ngFor=\"let item of details\">{{ item }}</li>\n </ul>\n </div>\n </div>\n</section>\n","import { ChangeDetectionStrategy, Component, EventEmitter, HostListener, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'pdm-alert-dialog',\n templateUrl: './alert-dialog.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PdmAlertDialogComponent {\n @Input() open = false;\n @Input() showTrigger = false;\n @Input() triggerText = 'Show dialog';\n @Input() title = 'Are you absolutely sure?';\n @Input() description = '';\n @Input() confirmText = 'Continue';\n @Input() cancelText = 'Cancel';\n @Input() className = '';\n\n /** Close when the ESC key is pressed. Default: `true`. */\n @Input() closeOnEsc = true;\n\n @Output() openChange = new EventEmitter<boolean>();\n @Output() confirm = new EventEmitter<void>();\n @Output() cancel = new EventEmitter<void>();\n\n /**\n * Returns `true` when at least one consumer listens to `openChange`.\n * - **Controlled** (has observers): parent manages `open` via two-way binding → only emit.\n * - **Uncontrolled** (no observers): we own the `open` state → mutate it locally.\n */\n private get isControlled(): boolean {\n return this.openChange.observed;\n }\n\n onTriggerClick(): void {\n if (!this.isControlled) {\n this.open = true;\n }\n this.openChange.emit(true);\n }\n\n onCancel(): void {\n this.cancel.emit();\n if (!this.isControlled) {\n this.open = false;\n }\n this.openChange.emit(false);\n }\n\n onConfirm(): void {\n this.confirm.emit();\n if (!this.isControlled) {\n this.open = false;\n }\n this.openChange.emit(false);\n }\n\n @HostListener('document:keydown.escape')\n onEsc(): void {\n if (this.open && this.closeOnEsc) {\n this.onCancel();\n }\n }\n}\n","<button\n *ngIf=\"showTrigger && !open\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onTriggerClick()\"\n>\n {{ triggerText }}\n</button>\n\n<div *ngIf=\"open\" class=\"fixed inset-0 z-50 flex items-center justify-center p-5\">\n <div class=\"absolute inset-0 bg-foreground/30\" (click)=\"onCancel()\"></div>\n <section\n role=\"alertdialog\"\n aria-modal=\"true\"\n [ngClass]=\"[\n 'relative z-[60] w-full max-w-lg rounded-lg border border-solid border-border bg-background p-6 text-foreground shadow-lg',\n className\n ]\"\n >\n <div class=\"flex flex-col gap-2\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <div class=\"mt-4 flex items-center justify-end gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onCancel()\"\n >\n {{ cancelText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm\"\n (click)=\"onConfirm()\"\n >\n {{ confirmText }}\n </button>\n </div>\n </section>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { PdmAlertComponent } from './alert.component';\nimport { PdmAlertDialogComponent } from './alert-dialog.component';\n\nconst COMPONENTS = [\n PdmAlertComponent,\n PdmAlertDialogComponent,\n];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class PdmAlertModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MASa,iBAAiB,CAAA;AAL9B,IAAA,WAAA,GAAA;QAMW,IAAO,CAAA,OAAA,GAAoB,SAAS,CAAC;QACrC,IAAK,CAAA,KAAA,GAAG,uCAAuC,CAAC;QAChD,IAAW,CAAA,WAAA,GAAG,oDAAoD,CAAC;QACnE,IAAO,CAAA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cAAc,YAJf,YAAY,CAAA,EAAA,CAAA,CAAA;2FAIX,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,YAAY,EAAE,UAAU;AACxB,oBAAA,OAAO,EAAE,UAAU;AACpB,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"pdm-ui-kit-src-alert.mjs","sources":["../../../src/alert/alert.component.ts","../../../src/alert/alert.component.html","../../../src/alert/alert-dialog.component.ts","../../../src/alert/alert-dialog.component.html","../../../src/alert/alert.module.ts","../../../src/alert/pdm-ui-kit-src-alert.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nexport type PdmAlertVariant = 'default' | 'title-only' | 'destructive';\n\n@Component({\n selector: 'pdm-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PdmAlertComponent {\n @Input() variant: PdmAlertVariant = 'default';\n @Input() title = 'Success! Your changes have been saved';\n @Input() description = 'This is an alert with icon, title and description.';\n @Input() details: string[] = [];\n @Input() className = '';\n\n get isDestructive(): boolean {\n return this.variant === 'destructive';\n }\n\n get isTitleOnly(): boolean {\n return this.variant === 'title-only';\n }\n}\n\n","<section\n role=\"alert\"\n [ngClass]=\"[\n 'w-full rounded-lg border border-solid border-border bg-background p-4',\n className\n ]\"\n>\n <div [ngClass]=\"['flex gap-3', isDestructive ? 'items-start' : 'items-center']\">\n <span class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center\">\n <svg *ngIf=\"!isDestructive && !isTitleOnly\" aria-label=\"Success\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-foreground\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" stroke-width=\"1.5\"></circle>\n <path d=\"M8.5 12.5L10.8 14.8L15.8 9.8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <svg *ngIf=\"isTitleOnly\" aria-label=\"Info\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-foreground\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5 8H19\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <path d=\"M9 8V6.5C9 5.67 9.67 5 10.5 5H13.5C14.33 5 15 5.67 15 6.5V8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <path d=\"M7 8L8 18.5C8.07 19.33 8.77 20 9.6 20H14.4C15.23 20 15.93 19.33 16 18.5L17 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n <svg *ngIf=\"isDestructive\" aria-label=\"Error\" viewBox=\"0 0 24 24\" class=\"h-5 w-5 text-destructive\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" stroke-width=\"1.5\"></circle>\n <path d=\"M12 8V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <circle cx=\"12\" cy=\"16\" r=\"1\" fill=\"currentColor\"></circle>\n </svg>\n </span>\n\n <div class=\"min-w-0 flex-1\">\n <h4\n [ngClass]=\"[\n 'm-0 text-sm font-medium',\n isDestructive ? 'text-destructive' : 'text-foreground'\n ]\"\n >\n {{ title }}\n </h4>\n\n <p\n *ngIf=\"!isTitleOnly && description\"\n [ngClass]=\"[\n 'm-0 mt-0.5 text-sm',\n isDestructive ? 'text-destructive' : 'text-muted-foreground'\n ]\"\n >\n {{ description }}\n </p>\n\n <ul *ngIf=\"isDestructive && details.length\" class=\"m-0 mt-1 pl-5 text-sm text-destructive\">\n <li *ngFor=\"let item of details\">{{ item }}</li>\n </ul>\n </div>\n </div>\n</section>\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tEventEmitter,\n\tHostListener,\n\tInput,\n\tOutput,\n} from \"@angular/core\";\nimport { cn, responsive, Z_INDEX } from \"pdm-ui-kit/src/utils\";\n\ntype PdmAlertDialogSize =\n\t| \"desktop\"\n\t| \"mobile\"\n\t| \"mobile-fullscreen\"\n\t| \"sm\"\n\t| \"md\"\n\t| \"lg\"\n\t| \"xl\"\n\t| \"responsive\";\n\n@Component({\n\tselector: \"pdm-alert-dialog\",\n\ttemplateUrl: \"./alert-dialog.component.html\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PdmAlertDialogComponent {\n\t@Input() open = false;\n\t@Input() showTrigger = false;\n\t@Input() triggerText = \"Show dialog\";\n\t@Input() title = \"Are you absolutely sure?\";\n\t@Input() description = \"\";\n\t@Input() confirmText = \"Continue\";\n\t@Input() cancelText = \"Cancel\";\n\t@Input() size: PdmAlertDialogSize = \"responsive\";\n\t@Input() maxWidth = \"\";\n\t@Input() className = \"\";\n\t@Input() bodyClassName = \"\";\n\t@Input() showFooter = true;\n\t@Input() closeOnBackdrop = true;\n\n\t/** Close when the ESC key is pressed. Default: `true`. */\n\t@Input() closeOnEsc = true;\n\n\t@Output() openChange = new EventEmitter<boolean>();\n\t@Output() confirm = new EventEmitter<void>();\n\t@Output() cancel = new EventEmitter<void>();\n\n\t/**\n\t * Returns `true` when at least one consumer listens to `openChange`.\n\t * - **Controlled** (has observers): parent manages `open` via two-way binding → only emit.\n\t * - **Uncontrolled** (no observers): we own the `open` state → mutate it locally.\n\t */\n\tprivate get isControlled(): boolean {\n\t\treturn this.openChange.observed;\n\t}\n\n\tget panelClassName(): string {\n\t\tif (this.size === \"desktop\") {\n\t\t\treturn this.buildPanelClasses([\n\t\t\t\t\"max-w-[640px]\",\n\t\t\t\t\"max-h-[calc(100vh-2rem)]\",\n\t\t\t\t\"rounded-[10px]\",\n\t\t\t]);\n\t\t}\n\n\t\tif (this.size === \"mobile\") {\n\t\t\treturn this.buildPanelClasses([\n\t\t\t\t\"max-w-[320px]\",\n\t\t\t\t\"min-h-[240px]\",\n\t\t\t\t\"rounded-[10px]\",\n\t\t\t]);\n\t\t}\n\n\t\tif (this.size === \"mobile-fullscreen\") {\n\t\t\treturn this.buildPanelClasses([\n\t\t\t\t\"max-w-[320px]\",\n\t\t\t\t\"h-[min(100dvh,640px)]\",\n\t\t\t\t\"rounded-none\",\n\t\t\t\t\"sm:rounded-[10px]\",\n\t\t\t]);\n\t\t}\n\n\t\tif (this.size === \"responsive\") {\n\t\t\treturn this.buildPanelClasses([\n\t\t\t\t\"w-full\",\n\t\t\t\t\"h-full\",\n\t\t\t\t\"max-h-[100dvh]\",\n\t\t\t\t\"rounded-t-[10px]\",\n\t\t\t\t\"sm:rounded-[10px]\",\n\t\t\t\t\"sm:w-auto\",\n\t\t\t\t\"sm:h-auto\",\n\t\t\t\t\"sm:max-w-[640px]\",\n\t\t\t\t\"sm:max-h-[calc(100vh-4rem)]\",\n\t\t\t]);\n\t\t}\n\n\t\tconst sizeMap = {\n\t\t\tsm: \"sm:max-w-[400px]\",\n\t\t\tmd: \"sm:max-w-[500px]\",\n\t\t\tlg: \"sm:max-w-[640px]\",\n\t\t\txl: \"sm:max-w-[800px]\",\n\t\t};\n\t\tconst maxWidth = sizeMap[this.size as keyof typeof sizeMap] || sizeMap.lg;\n\n\t\treturn this.buildPanelClasses([\n\t\t\t\"w-full\",\n\t\t\t\"h-full\",\n\t\t\t\"max-h-[100dvh]\",\n\t\t\t\"rounded-t-[10px]\",\n\t\t\t\"sm:rounded-[10px]\",\n\t\t\t\"sm:w-auto\",\n\t\t\t\"sm:h-auto\",\n\t\t\tmaxWidth,\n\t\t\t\"sm:max-h-[calc(100vh-4rem)]\",\n\t\t]);\n\t}\n\n\tget containerClassName(): string {\n\t\treturn responsive({\n\t\t\tdefault: `fixed inset-x-0 bottom-0 ${Z_INDEX.modalBackdrop} flex items-end justify-center`,\n\t\t\tsm: `fixed inset-0 ${Z_INDEX.modalBackdrop} flex items-center justify-center p-4`,\n\t\t});\n\t}\n\n\tget bodyWrapperClassName(): string {\n\t\treturn cn(\n\t\t\t\"flex-1 min-h-0 overflow-y-auto px-4 py-4 sm:px-6\",\n\t\t\tthis.bodyClassName,\n\t\t);\n\t}\n\n\tonTriggerClick(): void {\n\t\tif (!this.isControlled) {\n\t\t\tthis.open = true;\n\t\t}\n\t\tthis.openChange.emit(true);\n\t}\n\n\tonCancel(): void {\n\t\tthis.cancel.emit();\n\t\tif (!this.isControlled) {\n\t\t\tthis.open = false;\n\t\t}\n\t\tthis.openChange.emit(false);\n\t}\n\n\tonConfirm(): void {\n\t\tthis.confirm.emit();\n\t\tif (!this.isControlled) {\n\t\t\tthis.open = false;\n\t\t}\n\t\tthis.openChange.emit(false);\n\t}\n\n\tonBackdropClick(): void {\n\t\tif (this.closeOnBackdrop) {\n\t\t\tthis.onCancel();\n\t\t}\n\t}\n\n\t@HostListener(\"document:keydown.escape\")\n\tonEsc(): void {\n\t\tif (this.open && this.closeOnEsc) {\n\t\t\tthis.onCancel();\n\t\t}\n\t}\n\n\tprivate buildPanelClasses(sizeClasses: string[]): string {\n\t\tconst maxWidthClass = this.maxWidth ? `sm:max-w-[${this.maxWidth}]` : \"\";\n\n\t\treturn cn(\n\t\t\t\"relative\",\n\t\t\tZ_INDEX.modal,\n\t\t\t\"flex flex-col border border-solid border-border bg-background text-foreground shadow-lg overflow-hidden\",\n\t\t\t...sizeClasses,\n\t\t\tmaxWidthClass,\n\t\t\tthis.className,\n\t\t);\n\t}\n}\n","<button\n *ngIf=\"showTrigger && !open\"\n type=\"button\"\n class=\"inline-flex h-9 appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onTriggerClick()\"\n>\n {{ triggerText }}\n</button>\n\n<div *ngIf=\"open\" [ngClass]=\"containerClassName\">\n <div class=\"absolute inset-0 bg-foreground/30 backdrop-blur-sm\" (click)=\"onBackdropClick()\"></div>\n <section role=\"alertdialog\" aria-modal=\"true\" cdkTrapFocus [ngClass]=\"panelClassName\">\n <div class=\"flex flex-col gap-2 p-4 sm:p-6\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"showFooter\" class=\"flex flex-col gap-2 p-4 sm:p-6 border-t border-border sm:flex-row sm:justify-end\">\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md border border-solid border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm sm:w-auto\" (click)=\"onCancel()\">{{ cancelText }}</button>\n <button type=\"button\" class=\"inline-flex h-9 w-full appearance-none box-border items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm sm:w-auto\" (click)=\"onConfirm()\">{{ confirmText }}</button>\n </div>\n </section>\n</div>\n","import { A11yModule } from '@angular/cdk/a11y';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { PdmAlertComponent } from './alert.component';\nimport { PdmAlertDialogComponent } from './alert-dialog.component';\n\nconst COMPONENTS = [\n PdmAlertComponent,\n PdmAlertDialogComponent,\n];\n\n@NgModule({\n imports: [CommonModule, A11yModule],\n declarations: COMPONENTS,\n exports: COMPONENTS\n})\nexport class PdmAlertModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,iBAAiB,CAAA;AAL9B,IAAA,WAAA,GAAA;QAMW,IAAO,CAAA,OAAA,GAAoB,SAAS,CAAC;QACrC,IAAK,CAAA,KAAA,GAAG,uCAAuC,CAAC;QAChD,IAAW,CAAA,WAAA,GAAG,oDAAoD,CAAC;QACnE,IAAO,CAAA,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A,CAAA,CAAA;4GAQZ,cAAc,EAAA,OAAA,EAAA,CAJf,YAAY,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;2FAIvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACnC,oBAAA,YAAY,EAAE,UAAU;AACxB,oBAAA,OAAO,EAAE,UAAU;AACpB,iBAAA,CAAA;;;ACfD;;AAEG;;;;"}
|
|
@@ -555,6 +555,7 @@ class PdmDatePickerComponent {
|
|
|
555
555
|
this.labelClassName = "";
|
|
556
556
|
this.className = "";
|
|
557
557
|
this.triggerClassName = "";
|
|
558
|
+
this.iconOnly = false;
|
|
558
559
|
/**
|
|
559
560
|
* Additional CSS classes applied to the overlay panel.
|
|
560
561
|
* Backward-compatible: mapped to `overlayOptions.panelClass` when `overlayOptions` is not set.
|
|
@@ -657,15 +658,22 @@ class PdmDatePickerComponent {
|
|
|
657
658
|
get rootClasses() {
|
|
658
659
|
return [
|
|
659
660
|
"grid gap-2",
|
|
660
|
-
this.
|
|
661
|
+
this.iconOnly
|
|
662
|
+
? "inline-grid w-auto"
|
|
663
|
+
: this.resolvedVariant === "range"
|
|
664
|
+
? "w-[280px]"
|
|
665
|
+
: "w-[197px]",
|
|
661
666
|
this.className,
|
|
662
667
|
];
|
|
663
668
|
}
|
|
664
669
|
get triggerClasses() {
|
|
665
670
|
const focusStyle = this._open || this.triggerFocused;
|
|
666
671
|
return [
|
|
667
|
-
"border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive relative flex
|
|
672
|
+
"border-input focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:ring-2 aria-invalid:ring-destructive aria-invalid:border-destructive relative flex appearance-none box-border items-center overflow-hidden rounded-lg border border-solid bg-background text-sm shadow-sm outline-none transition-colors",
|
|
668
673
|
"min-h-[36px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
674
|
+
this.iconOnly
|
|
675
|
+
? "size-9 justify-center p-0"
|
|
676
|
+
: "w-full gap-2 px-3 py-[7.5px] text-left",
|
|
669
677
|
focusStyle ? "border-ring ring-2 ring-ring/50" : "",
|
|
670
678
|
this.invalid ? "border-destructive ring-destructive/20" : "",
|
|
671
679
|
this.triggerClassName,
|
|
@@ -813,10 +821,10 @@ class PdmDatePickerComponent {
|
|
|
813
821
|
}
|
|
814
822
|
}
|
|
815
823
|
PdmDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
816
|
-
PdmDatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDatePickerComponent, selector: "pdm-date-picker", inputs: { id: "id", variant: "variant", label: "label", labelClassName: "labelClassName", className: "className", triggerClassName: "triggerClassName", panelClassName: "panelClassName", overlayOptions: "overlayOptions", placeholder: "placeholder", rangePlaceholder: "rangePlaceholder", format: "format", disabled: "disabled", readonly: "readonly", required: "required", invalid: "invalid", allowSameDayRange: "allowSameDayRange", closeOnSelect: "closeOnSelect", minDate: "minDate", maxDate: "maxDate", minYear: "minYear", maxYear: "maxYear", disabledDates: "disabledDates", isDateDisabled: "isDateDisabled", open: "open", value: "value", rangeValue: "rangeValue" }, outputs: { valueChange: "valueChange", rangeValueChange: "rangeValueChange", openChange: "openChange", monthChange: "monthChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.PdmLabelComponent, selector: "pdm-label", inputs: ["forId", "required", "className"] }, { kind: "component", type: PdmCalendarComponent, selector: "pdm-calendar", inputs: ["variant", "className", "disabledDates", "minDate", "maxDate", "minYear", "maxYear", "isDateDisabled", "allowSameDayRange", "readonly", "value", "rangeValue", "month"], outputs: ["valueChange", "rangeValueChange", "monthChange", "dateClick", "disabledDateClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
824
|
+
PdmDatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDatePickerComponent, selector: "pdm-date-picker", inputs: { id: "id", variant: "variant", label: "label", labelClassName: "labelClassName", className: "className", triggerClassName: "triggerClassName", iconOnly: "iconOnly", panelClassName: "panelClassName", overlayOptions: "overlayOptions", placeholder: "placeholder", rangePlaceholder: "rangePlaceholder", format: "format", disabled: "disabled", readonly: "readonly", required: "required", invalid: "invalid", allowSameDayRange: "allowSameDayRange", closeOnSelect: "closeOnSelect", minDate: "minDate", maxDate: "maxDate", minYear: "minYear", maxYear: "maxYear", disabledDates: "disabledDates", isDateDisabled: "isDateDisabled", open: "open", value: "value", rangeValue: "rangeValue" }, outputs: { valueChange: "valueChange", rangeValueChange: "rangeValueChange", openChange: "openChange", monthChange: "monthChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-label]=\"iconOnly ? displayText : null\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span *ngIf=\"!iconOnly\" [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.PdmLabelComponent, selector: "pdm-label", inputs: ["forId", "required", "className"] }, { kind: "component", type: PdmCalendarComponent, selector: "pdm-calendar", inputs: ["variant", "className", "disabledDates", "minDate", "maxDate", "minYear", "maxYear", "isDateDisabled", "allowSameDayRange", "readonly", "value", "rangeValue", "month"], outputs: ["valueChange", "rangeValueChange", "monthChange", "dateClick", "disabledDateClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
817
825
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, decorators: [{
|
|
818
826
|
type: Component,
|
|
819
|
-
args: [{ selector: "pdm-date-picker", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n" }]
|
|
827
|
+
args: [{ selector: "pdm-date-picker", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"rootClasses\">\n <pdm-label *ngIf=\"label\" [forId]=\"triggerId\" [required]=\"required\" [className]=\"labelClassName\">\n {{ label }}\n </pdm-label>\n\n <button\n #triggerEl\n type=\"button\"\n [id]=\"triggerId\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-label]=\"iconOnly ? displayText : null\"\n [ngClass]=\"triggerClasses\"\n [attr.title]=\"displayText\"\n (click)=\"toggleOpen()\"\n (focus)=\"onTriggerFocus()\"\n (blur)=\"onTriggerBlur()\"\n >\n <span class=\"flex h-5 w-5 shrink-0 items-center justify-center p-0.5 text-muted-foreground\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\">\n <path d=\"M8 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M16 2v4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"16.5\" rx=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></rect>\n <path d=\"M3 9.5h18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </span>\n\n <span *ngIf=\"!iconOnly\" [ngClass]=\"textClasses\">{{ displayText }}</span>\n </button>\n</div>\n\n<ng-template #panelTemplate>\n <div [id]=\"panelId\" role=\"dialog\" [attr.aria-labelledby]=\"label ? triggerId : null\">\n <pdm-calendar\n [variant]=\"resolvedVariant\"\n [value]=\"value\"\n [rangeValue]=\"rangeValue\"\n [readonly]=\"readonly\"\n [allowSameDayRange]=\"allowSameDayRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [minYear]=\"minYear\"\n [maxYear]=\"maxYear\"\n [disabledDates]=\"disabledDates\"\n [isDateDisabled]=\"isDateDisabled\"\n (valueChange)=\"onCalendarValueChange($event)\"\n (rangeValueChange)=\"onCalendarRangeValueChange($event)\"\n (monthChange)=\"onCalendarMonthChange($event)\"\n ></pdm-calendar>\n </div>\n</ng-template>\n" }]
|
|
820
828
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { triggerRef: [{
|
|
821
829
|
type: ViewChild,
|
|
822
830
|
args: ["triggerEl"]
|
|
@@ -835,6 +843,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
835
843
|
type: Input
|
|
836
844
|
}], triggerClassName: [{
|
|
837
845
|
type: Input
|
|
846
|
+
}], iconOnly: [{
|
|
847
|
+
type: Input
|
|
838
848
|
}], panelClassName: [{
|
|
839
849
|
type: Input
|
|
840
850
|
}], overlayOptions: [{
|