pdm-ui-kit 0.1.34 → 0.1.36
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/esm2020/lib/components/dialog/dialog.component.mjs +56 -14
- package/fesm2015/pdm-ui-kit.mjs +55 -13
- package/fesm2015/pdm-ui-kit.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit.mjs +55 -13
- package/fesm2020/pdm-ui-kit.mjs.map +1 -1
- package/lib/components/dialog/dialog.component.d.ts +14 -6
- package/package.json +1 -1
package/fesm2020/pdm-ui-kit.mjs
CHANGED
|
@@ -2288,18 +2288,20 @@ class PdmDialogComponent {
|
|
|
2288
2288
|
constructor() {
|
|
2289
2289
|
this.open = false;
|
|
2290
2290
|
this.variant = 'default';
|
|
2291
|
+
this.size = 'desktop';
|
|
2291
2292
|
this.title = 'Edit profile';
|
|
2292
2293
|
this.description = 'Make changes to your profile here. Click save when you\'re done.';
|
|
2293
2294
|
this.closeOnBackdrop = true;
|
|
2294
2295
|
this.closeOnEsc = true;
|
|
2295
2296
|
this.showCloseButton = true;
|
|
2297
|
+
this.showHeader = true;
|
|
2298
|
+
this.showFooter = true;
|
|
2296
2299
|
this.primaryActionText = 'Save changes';
|
|
2297
2300
|
this.secondaryActionText = 'Cancel';
|
|
2298
|
-
this.
|
|
2299
|
-
this.
|
|
2300
|
-
this.
|
|
2301
|
-
this.
|
|
2302
|
-
this.linkValue = 'https://ui.shadcn.com/docs/installation';
|
|
2301
|
+
this.alignFooter = 'right';
|
|
2302
|
+
this.headerClassName = '';
|
|
2303
|
+
this.bodyClassName = '';
|
|
2304
|
+
this.footerClassName = '';
|
|
2303
2305
|
this.className = '';
|
|
2304
2306
|
this.openChange = new EventEmitter();
|
|
2305
2307
|
this.primaryAction = new EventEmitter();
|
|
@@ -2324,16 +2326,54 @@ class PdmDialogComponent {
|
|
|
2324
2326
|
this.close();
|
|
2325
2327
|
}
|
|
2326
2328
|
}
|
|
2329
|
+
get panelClassName() {
|
|
2330
|
+
const base = [
|
|
2331
|
+
'relative z-10 w-full border border-border bg-background text-foreground shadow-lg',
|
|
2332
|
+
this.size === 'desktop' ? 'max-w-[640px] max-h-[calc(100vh-2rem)] rounded-[10px] overflow-hidden' : '',
|
|
2333
|
+
this.size === 'mobile' ? 'max-w-[320px] min-h-[240px] rounded-[10px] overflow-hidden' : '',
|
|
2334
|
+
this.size === 'mobile-fullscreen'
|
|
2335
|
+
? 'max-w-[320px] h-[min(100dvh,640px)] rounded-none sm:rounded-[10px] overflow-hidden'
|
|
2336
|
+
: '',
|
|
2337
|
+
this.className
|
|
2338
|
+
];
|
|
2339
|
+
return base.filter(Boolean).join(' ');
|
|
2340
|
+
}
|
|
2341
|
+
get bodyWrapperClassName() {
|
|
2342
|
+
const base = [
|
|
2343
|
+
'min-h-0 flex-1',
|
|
2344
|
+
this.size === 'mobile-fullscreen' ? 'overflow-y-auto px-4 py-6' : 'px-6 py-6',
|
|
2345
|
+
this.bodyClassName
|
|
2346
|
+
];
|
|
2347
|
+
return base.filter(Boolean).join(' ');
|
|
2348
|
+
}
|
|
2349
|
+
get headerWrapperClassName() {
|
|
2350
|
+
return ['flex items-start justify-between gap-3 p-4', this.headerClassName].filter(Boolean).join(' ');
|
|
2351
|
+
}
|
|
2352
|
+
get footerWrapperClassName() {
|
|
2353
|
+
const effectiveAlign = this.alignFooter === 'right' && this.variant === 'custom-close' ? 'left' : this.alignFooter;
|
|
2354
|
+
const base = [
|
|
2355
|
+
'p-4',
|
|
2356
|
+
effectiveAlign === 'full-width'
|
|
2357
|
+
? 'flex flex-col gap-2'
|
|
2358
|
+
: effectiveAlign === 'left'
|
|
2359
|
+
? 'flex items-center gap-2 justify-start'
|
|
2360
|
+
: 'flex items-center gap-2 justify-end',
|
|
2361
|
+
this.footerClassName
|
|
2362
|
+
];
|
|
2363
|
+
return base.filter(Boolean).join(' ');
|
|
2364
|
+
}
|
|
2327
2365
|
}
|
|
2328
2366
|
PdmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2329
|
-
PdmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDialogComponent, selector: "pdm-dialog", inputs: { open: "open", variant: "variant", title: "title", description: "description", closeOnBackdrop: "closeOnBackdrop", closeOnEsc: "closeOnEsc", showCloseButton: "showCloseButton",
|
|
2367
|
+
PdmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDialogComponent, selector: "pdm-dialog", inputs: { open: "open", variant: "variant", size: "size", title: "title", description: "description", closeOnBackdrop: "closeOnBackdrop", closeOnEsc: "closeOnEsc", showCloseButton: "showCloseButton", showHeader: "showHeader", showFooter: "showFooter", primaryActionText: "primaryActionText", secondaryActionText: "secondaryActionText", alignFooter: "alignFooter", headerClassName: "headerClassName", bodyClassName: "bodyClassName", footerClassName: "footerClassName", className: "className" }, outputs: { openChange: "openChange", primaryAction: "primaryAction", secondaryAction: "secondaryAction" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, ngImport: i0, template: "<div *ngIf=\"open\" class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div class=\"absolute inset-0 bg-foreground/30\" (click)=\"onBackdropClick()\"></div>\n <section role=\"dialog\" aria-modal=\"true\" [ngClass]=\"panelClassName\">\n <div *ngIf=\"showHeader\" [ngClass]=\"headerWrapperClassName\">\n <div class=\"min-w-0\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 mt-2 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <button\n *ngIf=\"showCloseButton\"\n type=\"button\"\n class=\"inline-flex h-6 w-6 appearance-none items-center justify-center rounded-sm border-0 bg-transparent p-0 text-foreground opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 6L18 18M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n </button>\n </div>\n\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n\n <div *ngIf=\"showFooter\" [ngClass]=\"footerWrapperClassName\">\n <ng-container *ngIf=\"variant === 'custom-close'; else defaultActions\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n </ng-container>\n\n <ng-template #defaultActions>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm\"\n (click)=\"onPrimaryAction()\"\n >\n {{ primaryActionText }}\n </button>\n </ng-template>\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2330
2368
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDialogComponent, decorators: [{
|
|
2331
2369
|
type: Component,
|
|
2332
|
-
args: [{ selector: 'pdm-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"open\" class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div class=\"absolute inset-0 bg-foreground/30\" (click)=\"onBackdropClick()\"></div>\n <section
|
|
2370
|
+
args: [{ selector: 'pdm-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"open\" class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div class=\"absolute inset-0 bg-foreground/30\" (click)=\"onBackdropClick()\"></div>\n <section role=\"dialog\" aria-modal=\"true\" [ngClass]=\"panelClassName\">\n <div *ngIf=\"showHeader\" [ngClass]=\"headerWrapperClassName\">\n <div class=\"min-w-0\">\n <h2 class=\"m-0 text-lg font-semibold leading-none tracking-tight text-foreground\">{{ title }}</h2>\n <p *ngIf=\"description\" class=\"m-0 mt-2 text-sm text-muted-foreground\">{{ description }}</p>\n </div>\n <button\n *ngIf=\"showCloseButton\"\n type=\"button\"\n class=\"inline-flex h-6 w-6 appearance-none items-center justify-center rounded-sm border-0 bg-transparent p-0 text-foreground opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <svg viewBox=\"0 0 24 24\" class=\"h-4 w-4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 6L18 18M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n </button>\n </div>\n\n <div [ngClass]=\"bodyWrapperClassName\">\n <ng-content></ng-content>\n </div>\n\n <div *ngIf=\"showFooter\" [ngClass]=\"footerWrapperClassName\">\n <ng-container *ngIf=\"variant === 'custom-close'; else defaultActions\">\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n </ng-container>\n\n <ng-template #defaultActions>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n (click)=\"onSecondaryAction()\"\n >\n {{ secondaryActionText }}\n </button>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm\"\n (click)=\"onPrimaryAction()\"\n >\n {{ primaryActionText }}\n </button>\n </ng-template>\n </div>\n </section>\n</div>\n" }]
|
|
2333
2371
|
}], propDecorators: { open: [{
|
|
2334
2372
|
type: Input
|
|
2335
2373
|
}], variant: [{
|
|
2336
2374
|
type: Input
|
|
2375
|
+
}], size: [{
|
|
2376
|
+
type: Input
|
|
2337
2377
|
}], title: [{
|
|
2338
2378
|
type: Input
|
|
2339
2379
|
}], description: [{
|
|
@@ -2344,19 +2384,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2344
2384
|
type: Input
|
|
2345
2385
|
}], showCloseButton: [{
|
|
2346
2386
|
type: Input
|
|
2387
|
+
}], showHeader: [{
|
|
2388
|
+
type: Input
|
|
2389
|
+
}], showFooter: [{
|
|
2390
|
+
type: Input
|
|
2347
2391
|
}], primaryActionText: [{
|
|
2348
2392
|
type: Input
|
|
2349
2393
|
}], secondaryActionText: [{
|
|
2350
2394
|
type: Input
|
|
2351
|
-
}],
|
|
2395
|
+
}], alignFooter: [{
|
|
2352
2396
|
type: Input
|
|
2353
|
-
}],
|
|
2354
|
-
type: Input
|
|
2355
|
-
}], usernameLabel: [{
|
|
2397
|
+
}], headerClassName: [{
|
|
2356
2398
|
type: Input
|
|
2357
|
-
}],
|
|
2399
|
+
}], bodyClassName: [{
|
|
2358
2400
|
type: Input
|
|
2359
|
-
}],
|
|
2401
|
+
}], footerClassName: [{
|
|
2360
2402
|
type: Input
|
|
2361
2403
|
}], className: [{
|
|
2362
2404
|
type: Input
|