pdm-ui-kit 0.1.46 → 0.1.47
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/date-picker/date-picker.component.mjs +101 -73
- package/esm2020/lib/components/dropdown-menu/dropdown-menu.component.mjs +109 -21
- package/esm2020/lib/components/pagination/pagination.component.mjs +1 -1
- package/esm2020/lib/components/select/select.component.mjs +7 -3
- package/esm2020/lib/overlay/pdm-overlay-options.mjs +2 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/pdm-ui-kit.mjs +196 -97
- package/fesm2015/pdm-ui-kit.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit.mjs +207 -91
- package/fesm2020/pdm-ui-kit.mjs.map +1 -1
- package/lib/components/date-picker/date-picker.component.d.ts +26 -11
- package/lib/components/dropdown-menu/dropdown-menu.component.d.ts +33 -6
- package/lib/components/select/select.component.d.ts +8 -1
- package/lib/overlay/pdm-overlay-options.d.ts +21 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/fesm2015/pdm-ui-kit.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import * as i1$2 from '@angular/cdk/overlay';
|
|
|
6
6
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
7
7
|
import { icons } from 'lucide';
|
|
8
8
|
import * as i1$1 from '@angular/platform-browser';
|
|
9
|
-
import { format } from 'date-fns';
|
|
10
9
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
10
|
+
import { format } from 'date-fns';
|
|
11
11
|
|
|
12
12
|
class PdmAccordionComponent {
|
|
13
13
|
constructor() {
|
|
@@ -1965,21 +1965,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1965
1965
|
|
|
1966
1966
|
let nextDatePickerId = 0;
|
|
1967
1967
|
class PdmDatePickerComponent {
|
|
1968
|
-
constructor(elementRef, cdr) {
|
|
1968
|
+
constructor(elementRef, cdr, overlay, viewContainerRef) {
|
|
1969
1969
|
this.elementRef = elementRef;
|
|
1970
1970
|
this.cdr = cdr;
|
|
1971
|
+
this.overlay = overlay;
|
|
1972
|
+
this.viewContainerRef = viewContainerRef;
|
|
1971
1973
|
this._value = null;
|
|
1972
1974
|
this._rangeValue = null;
|
|
1973
1975
|
this._open = false;
|
|
1974
1976
|
this.instanceId = `pdm-date-picker-${++nextDatePickerId}`;
|
|
1975
1977
|
this.triggerFocused = false;
|
|
1976
|
-
this.
|
|
1978
|
+
this.overlayRef = null;
|
|
1979
|
+
this.backdropSub = null;
|
|
1977
1980
|
this.id = '';
|
|
1978
1981
|
this.variant = 'single';
|
|
1979
1982
|
this.label = '';
|
|
1980
1983
|
this.labelClassName = '';
|
|
1981
1984
|
this.className = '';
|
|
1982
1985
|
this.triggerClassName = '';
|
|
1986
|
+
/**
|
|
1987
|
+
* Additional CSS classes applied to the overlay panel.
|
|
1988
|
+
* Backward-compatible: mapped to `overlayOptions.panelClass` when `overlayOptions` is not set.
|
|
1989
|
+
* When both are supplied, `overlayOptions.panelClass` takes precedence.
|
|
1990
|
+
*/
|
|
1983
1991
|
this.panelClassName = '';
|
|
1984
1992
|
this.placeholder = 'Pick a date';
|
|
1985
1993
|
this.rangePlaceholder = 'Pick a date range';
|
|
@@ -2002,14 +2010,14 @@ class PdmDatePickerComponent {
|
|
|
2002
2010
|
this.monthChange = new EventEmitter();
|
|
2003
2011
|
}
|
|
2004
2012
|
set open(value) {
|
|
2005
|
-
this._open
|
|
2006
|
-
|
|
2007
|
-
|
|
2013
|
+
if (this._open === !!value)
|
|
2014
|
+
return;
|
|
2015
|
+
if (!!value) {
|
|
2016
|
+
this.openPanel();
|
|
2008
2017
|
}
|
|
2009
2018
|
else {
|
|
2010
|
-
this.
|
|
2019
|
+
this.closePanel();
|
|
2011
2020
|
}
|
|
2012
|
-
this.cdr.markForCheck();
|
|
2013
2021
|
}
|
|
2014
2022
|
get open() {
|
|
2015
2023
|
return this._open;
|
|
@@ -2033,6 +2041,9 @@ class PdmDatePickerComponent {
|
|
|
2033
2041
|
get rangeValue() {
|
|
2034
2042
|
return this._rangeValue;
|
|
2035
2043
|
}
|
|
2044
|
+
ngOnDestroy() {
|
|
2045
|
+
this.destroyOverlay();
|
|
2046
|
+
}
|
|
2036
2047
|
get resolvedVariant() {
|
|
2037
2048
|
return this.variant === 'range' ? 'range' : 'single';
|
|
2038
2049
|
}
|
|
@@ -2079,7 +2090,7 @@ class PdmDatePickerComponent {
|
|
|
2079
2090
|
];
|
|
2080
2091
|
}
|
|
2081
2092
|
get triggerClasses() {
|
|
2082
|
-
const focusStyle = this.
|
|
2093
|
+
const focusStyle = this._open || this.triggerFocused;
|
|
2083
2094
|
return [
|
|
2084
2095
|
'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 w-full appearance-none items-center gap-2 overflow-hidden rounded-lg border bg-background px-3 py-[7.5px] text-left text-sm shadow-sm outline-none transition-colors',
|
|
2085
2096
|
'min-h-[36px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
@@ -2090,19 +2101,11 @@ class PdmDatePickerComponent {
|
|
|
2090
2101
|
this.triggerClassName
|
|
2091
2102
|
];
|
|
2092
2103
|
}
|
|
2093
|
-
get panelClasses() {
|
|
2094
|
-
return [
|
|
2095
|
-
this.panelPlacement === 'top'
|
|
2096
|
-
? 'absolute bottom-full left-0 z-50 mb-2'
|
|
2097
|
-
: 'absolute left-0 top-full z-50 mt-2',
|
|
2098
|
-
this.panelClassName
|
|
2099
|
-
];
|
|
2100
|
-
}
|
|
2101
2104
|
toggleOpen() {
|
|
2102
2105
|
if (this.disabled || this.readonly) {
|
|
2103
2106
|
return;
|
|
2104
2107
|
}
|
|
2105
|
-
this.setOpen(!this.
|
|
2108
|
+
this.setOpen(!this._open);
|
|
2106
2109
|
}
|
|
2107
2110
|
onTriggerFocus() {
|
|
2108
2111
|
this.triggerFocused = true;
|
|
@@ -2146,59 +2149,83 @@ class PdmDatePickerComponent {
|
|
|
2146
2149
|
this.monthChange.emit(this.cloneDate(month));
|
|
2147
2150
|
}
|
|
2148
2151
|
onEscape() {
|
|
2149
|
-
if (this.
|
|
2150
|
-
this.setOpen(false);
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
onDocumentClick(event) {
|
|
2154
|
-
if (!this.open) {
|
|
2155
|
-
return;
|
|
2156
|
-
}
|
|
2157
|
-
const target = event.target;
|
|
2158
|
-
if (target && !this.elementRef.nativeElement.contains(target)) {
|
|
2152
|
+
if (this._open) {
|
|
2159
2153
|
this.setOpen(false);
|
|
2160
2154
|
}
|
|
2161
2155
|
}
|
|
2162
|
-
onViewportChange() {
|
|
2163
|
-
this.updatePanelPlacement();
|
|
2164
|
-
}
|
|
2165
2156
|
setOpen(nextOpen) {
|
|
2166
2157
|
if (this._open === nextOpen) {
|
|
2167
2158
|
return;
|
|
2168
2159
|
}
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
if (this._open) {
|
|
2172
|
-
this.schedulePanelPlacementUpdate();
|
|
2160
|
+
if (nextOpen) {
|
|
2161
|
+
this.openPanel();
|
|
2173
2162
|
}
|
|
2174
2163
|
else {
|
|
2175
|
-
this.
|
|
2164
|
+
this.closePanel();
|
|
2176
2165
|
}
|
|
2177
|
-
this.cdr.markForCheck();
|
|
2178
|
-
}
|
|
2179
|
-
schedulePanelPlacementUpdate() {
|
|
2180
|
-
setTimeout(() => this.updatePanelPlacement());
|
|
2181
2166
|
}
|
|
2182
|
-
|
|
2183
|
-
var _a, _b;
|
|
2184
|
-
if (
|
|
2167
|
+
openPanel() {
|
|
2168
|
+
var _a, _b, _c;
|
|
2169
|
+
if (this.overlayRef)
|
|
2185
2170
|
return;
|
|
2186
|
-
}
|
|
2187
2171
|
const triggerEl = (_a = this.triggerRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2188
|
-
|
|
2189
|
-
if (!triggerEl || !panelEl || typeof window === 'undefined') {
|
|
2172
|
+
if (!triggerEl)
|
|
2190
2173
|
return;
|
|
2174
|
+
this._open = true;
|
|
2175
|
+
this.openChange.emit(true);
|
|
2176
|
+
this.cdr.markForCheck();
|
|
2177
|
+
const positionStrategy = this.overlay
|
|
2178
|
+
.position()
|
|
2179
|
+
.flexibleConnectedTo(triggerEl)
|
|
2180
|
+
.withPositions([
|
|
2181
|
+
{
|
|
2182
|
+
originX: 'start',
|
|
2183
|
+
originY: 'bottom',
|
|
2184
|
+
overlayX: 'start',
|
|
2185
|
+
overlayY: 'top',
|
|
2186
|
+
offsetY: 8
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
originX: 'start',
|
|
2190
|
+
originY: 'top',
|
|
2191
|
+
overlayX: 'start',
|
|
2192
|
+
overlayY: 'bottom',
|
|
2193
|
+
offsetY: -8
|
|
2194
|
+
}
|
|
2195
|
+
])
|
|
2196
|
+
.withFlexibleDimensions(false)
|
|
2197
|
+
.withPush(true);
|
|
2198
|
+
// Resolve panelClass: overlayOptions.panelClass wins; otherwise map panelClassName.
|
|
2199
|
+
const resolvedPanelClass = (_c = (_b = this.overlayOptions) === null || _b === void 0 ? void 0 : _b.panelClass) !== null && _c !== void 0 ? _c : (this.panelClassName ? ['block', this.panelClassName] : ['block']);
|
|
2200
|
+
this.overlayRef = this.overlay.create(Object.assign(Object.assign({ positionStrategy, scrollStrategy: this.overlay.scrollStrategies.reposition() }, this.overlayOptions), {
|
|
2201
|
+
// panelClass always overrides last: it already merges panelClassName + overlayOptions.
|
|
2202
|
+
panelClass: resolvedPanelClass }));
|
|
2203
|
+
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
2204
|
+
this.overlayRef.attach(portal);
|
|
2205
|
+
this.backdropSub = this.overlayRef.outsidePointerEvents().subscribe((event) => {
|
|
2206
|
+
const target = event.target;
|
|
2207
|
+
if (!triggerEl.contains(target)) {
|
|
2208
|
+
this.closePanel();
|
|
2209
|
+
}
|
|
2210
|
+
});
|
|
2211
|
+
this.cdr.markForCheck();
|
|
2212
|
+
}
|
|
2213
|
+
closePanel() {
|
|
2214
|
+
if (!this.overlayRef && !this._open)
|
|
2215
|
+
return;
|
|
2216
|
+
this._open = false;
|
|
2217
|
+
this.openChange.emit(false);
|
|
2218
|
+
this.destroyOverlay();
|
|
2219
|
+
this.cdr.markForCheck();
|
|
2220
|
+
}
|
|
2221
|
+
destroyOverlay() {
|
|
2222
|
+
if (this.backdropSub) {
|
|
2223
|
+
this.backdropSub.unsubscribe();
|
|
2224
|
+
this.backdropSub = null;
|
|
2191
2225
|
}
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
const panelHeight = panelEl.offsetHeight;
|
|
2196
|
-
const spaceBelow = Math.max(0, viewportHeight - triggerRect.bottom - gap);
|
|
2197
|
-
const spaceAbove = Math.max(0, triggerRect.top - gap);
|
|
2198
|
-
const nextPlacement = spaceBelow < panelHeight && spaceAbove > spaceBelow ? 'top' : 'bottom';
|
|
2199
|
-
if (this.panelPlacement !== nextPlacement) {
|
|
2200
|
-
this.panelPlacement = nextPlacement;
|
|
2201
|
-
this.cdr.markForCheck();
|
|
2226
|
+
if (this.overlayRef) {
|
|
2227
|
+
this.overlayRef.dispose();
|
|
2228
|
+
this.overlayRef = null;
|
|
2202
2229
|
}
|
|
2203
2230
|
}
|
|
2204
2231
|
formatDate(date) {
|
|
@@ -2219,17 +2246,17 @@ class PdmDatePickerComponent {
|
|
|
2219
2246
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
2220
2247
|
}
|
|
2221
2248
|
}
|
|
2222
|
-
PdmDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2223
|
-
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", 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()"
|
|
2249
|
+
PdmDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2250
|
+
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: PdmCalendarComponent, selector: "pdm-calendar", inputs: ["variant", "className", "disabledDates", "minDate", "maxDate", "minYear", "maxYear", "isDateDisabled", "allowSameDayRange", "readonly", "value", "rangeValue", "month"], outputs: ["valueChange", "rangeValueChange", "monthChange", "dateClick", "disabledDateClick"] }, { kind: "component", type: PdmLabelComponent, selector: "pdm-label", inputs: ["forId", "required", "className"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2224
2251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDatePickerComponent, decorators: [{
|
|
2225
2252
|
type: Component,
|
|
2226
|
-
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 <
|
|
2227
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { triggerRef: [{
|
|
2253
|
+
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" }]
|
|
2254
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$2.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { triggerRef: [{
|
|
2228
2255
|
type: ViewChild,
|
|
2229
2256
|
args: ['triggerEl']
|
|
2230
|
-
}],
|
|
2257
|
+
}], panelTemplateRef: [{
|
|
2231
2258
|
type: ViewChild,
|
|
2232
|
-
args: ['
|
|
2259
|
+
args: ['panelTemplate']
|
|
2233
2260
|
}], id: [{
|
|
2234
2261
|
type: Input
|
|
2235
2262
|
}], variant: [{
|
|
@@ -2244,6 +2271,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2244
2271
|
type: Input
|
|
2245
2272
|
}], panelClassName: [{
|
|
2246
2273
|
type: Input
|
|
2274
|
+
}], overlayOptions: [{
|
|
2275
|
+
type: Input
|
|
2247
2276
|
}], placeholder: [{
|
|
2248
2277
|
type: Input
|
|
2249
2278
|
}], rangePlaceholder: [{
|
|
@@ -2291,15 +2320,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2291
2320
|
}], onEscape: [{
|
|
2292
2321
|
type: HostListener,
|
|
2293
2322
|
args: ['document:keydown.escape']
|
|
2294
|
-
}], onDocumentClick: [{
|
|
2295
|
-
type: HostListener,
|
|
2296
|
-
args: ['document:click', ['$event']]
|
|
2297
|
-
}], onViewportChange: [{
|
|
2298
|
-
type: HostListener,
|
|
2299
|
-
args: ['window:resize']
|
|
2300
|
-
}, {
|
|
2301
|
-
type: HostListener,
|
|
2302
|
-
args: ['window:scroll']
|
|
2303
2323
|
}] } });
|
|
2304
2324
|
|
|
2305
2325
|
class PdmDialogComponent {
|
|
@@ -2432,20 +2452,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2432
2452
|
}] } });
|
|
2433
2453
|
|
|
2434
2454
|
class PdmDropdownMenuComponent {
|
|
2435
|
-
constructor(elementRef) {
|
|
2455
|
+
constructor(elementRef, cdr, overlay, viewContainerRef) {
|
|
2436
2456
|
this.elementRef = elementRef;
|
|
2457
|
+
this.cdr = cdr;
|
|
2458
|
+
this.overlay = overlay;
|
|
2459
|
+
this.viewContainerRef = viewContainerRef;
|
|
2437
2460
|
this.triggerText = 'Open';
|
|
2438
2461
|
this.variant = 'default';
|
|
2439
2462
|
this.items = [];
|
|
2440
2463
|
this.closeOnSelect = true;
|
|
2441
|
-
|
|
2464
|
+
/**
|
|
2465
|
+
* Additional CSS classes applied to the trigger wrapper element.
|
|
2466
|
+
* Preserved for backward compatibility.
|
|
2467
|
+
*/
|
|
2442
2468
|
this.className = '';
|
|
2469
|
+
/**
|
|
2470
|
+
* Additional CSS classes applied to the overlay panel.
|
|
2471
|
+
* Backward-compatible: mapped to `overlayOptions.panelClass` when `overlayOptions` is not set.
|
|
2472
|
+
* When both are supplied, `overlayOptions.panelClass` takes precedence.
|
|
2473
|
+
*/
|
|
2474
|
+
this.panelClassName = '';
|
|
2443
2475
|
this.itemSelect = new EventEmitter();
|
|
2444
2476
|
this.itemsChange = new EventEmitter();
|
|
2445
2477
|
this.open = false;
|
|
2478
|
+
this.overlayRef = null;
|
|
2479
|
+
this.backdropSub = null;
|
|
2480
|
+
}
|
|
2481
|
+
ngOnDestroy() {
|
|
2482
|
+
this.destroyOverlay();
|
|
2446
2483
|
}
|
|
2447
2484
|
toggle() {
|
|
2448
|
-
this.open
|
|
2485
|
+
if (this.open) {
|
|
2486
|
+
this.closePanel();
|
|
2487
|
+
}
|
|
2488
|
+
else {
|
|
2489
|
+
this.openPanel();
|
|
2490
|
+
}
|
|
2449
2491
|
}
|
|
2450
2492
|
get resolvedItems() {
|
|
2451
2493
|
if (this.items.length) {
|
|
@@ -2503,27 +2545,81 @@ class PdmDropdownMenuComponent {
|
|
|
2503
2545
|
this.itemSelect.emit(item.value);
|
|
2504
2546
|
const shouldClose = this.variant === 'default' ? this.closeOnSelect : false;
|
|
2505
2547
|
if (shouldClose) {
|
|
2506
|
-
this.
|
|
2548
|
+
this.closePanel();
|
|
2507
2549
|
}
|
|
2508
2550
|
}
|
|
2509
2551
|
onEsc() {
|
|
2510
|
-
this.
|
|
2552
|
+
this.closePanel();
|
|
2511
2553
|
}
|
|
2512
|
-
|
|
2513
|
-
|
|
2554
|
+
openPanel() {
|
|
2555
|
+
var _a, _b, _c;
|
|
2556
|
+
if (this.overlayRef)
|
|
2514
2557
|
return;
|
|
2515
|
-
const
|
|
2516
|
-
if (
|
|
2517
|
-
|
|
2558
|
+
const triggerEl = (_a = this.triggerRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2559
|
+
if (!triggerEl)
|
|
2560
|
+
return;
|
|
2561
|
+
this.open = true;
|
|
2562
|
+
this.cdr.markForCheck();
|
|
2563
|
+
const positionStrategy = this.overlay
|
|
2564
|
+
.position()
|
|
2565
|
+
.flexibleConnectedTo(triggerEl)
|
|
2566
|
+
.withPositions([
|
|
2567
|
+
{
|
|
2568
|
+
originX: 'start',
|
|
2569
|
+
originY: 'bottom',
|
|
2570
|
+
overlayX: 'start',
|
|
2571
|
+
overlayY: 'top',
|
|
2572
|
+
offsetY: 8
|
|
2573
|
+
},
|
|
2574
|
+
{
|
|
2575
|
+
originX: 'start',
|
|
2576
|
+
originY: 'top',
|
|
2577
|
+
overlayX: 'start',
|
|
2578
|
+
overlayY: 'bottom',
|
|
2579
|
+
offsetY: -8
|
|
2580
|
+
}
|
|
2581
|
+
])
|
|
2582
|
+
.withFlexibleDimensions(false)
|
|
2583
|
+
.withPush(true);
|
|
2584
|
+
// Resolve panelClass: overlayOptions.panelClass wins; otherwise map panelClassName.
|
|
2585
|
+
const resolvedPanelClass = (_c = (_b = this.overlayOptions) === null || _b === void 0 ? void 0 : _b.panelClass) !== null && _c !== void 0 ? _c : (this.panelClassName ? ['block', this.panelClassName] : ['block']);
|
|
2586
|
+
this.overlayRef = this.overlay.create(Object.assign(Object.assign({ positionStrategy, scrollStrategy: this.overlay.scrollStrategies.reposition() }, this.overlayOptions), {
|
|
2587
|
+
// panelClass always overrides last: it already merges panelClassName + overlayOptions.
|
|
2588
|
+
panelClass: resolvedPanelClass }));
|
|
2589
|
+
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
2590
|
+
this.overlayRef.attach(portal);
|
|
2591
|
+
this.backdropSub = this.overlayRef.outsidePointerEvents().subscribe((event) => {
|
|
2592
|
+
const target = event.target;
|
|
2593
|
+
if (!triggerEl.contains(target)) {
|
|
2594
|
+
this.closePanel();
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
this.cdr.markForCheck();
|
|
2598
|
+
}
|
|
2599
|
+
closePanel() {
|
|
2600
|
+
if (!this.overlayRef)
|
|
2601
|
+
return;
|
|
2602
|
+
this.open = false;
|
|
2603
|
+
this.destroyOverlay();
|
|
2604
|
+
this.cdr.markForCheck();
|
|
2605
|
+
}
|
|
2606
|
+
destroyOverlay() {
|
|
2607
|
+
if (this.backdropSub) {
|
|
2608
|
+
this.backdropSub.unsubscribe();
|
|
2609
|
+
this.backdropSub = null;
|
|
2610
|
+
}
|
|
2611
|
+
if (this.overlayRef) {
|
|
2612
|
+
this.overlayRef.dispose();
|
|
2613
|
+
this.overlayRef = null;
|
|
2518
2614
|
}
|
|
2519
2615
|
}
|
|
2520
2616
|
}
|
|
2521
|
-
PdmDropdownMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2522
|
-
PdmDropdownMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDropdownMenuComponent, selector: "pdm-dropdown-menu", inputs: { triggerText: "triggerText", variant: "variant", items: "items", closeOnSelect: "closeOnSelect", panelClassName: "panelClassName",
|
|
2617
|
+
PdmDropdownMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2618
|
+
PdmDropdownMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmDropdownMenuComponent, selector: "pdm-dropdown-menu", inputs: { triggerText: "triggerText", variant: "variant", items: "items", closeOnSelect: "closeOnSelect", className: "className", panelClassName: "panelClassName", overlayOptions: "overlayOptions" }, outputs: { itemSelect: "itemSelect", itemsChange: "itemsChange" }, host: { listeners: { "document:keydown.escape": "onEsc()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<button\n #triggerEl\n type=\"button\"\n [ngClass]=\"[\n '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 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n className\n ]\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggle()\"\n>\n {{ triggerText }}\n</button>\n\n<ng-template #panelTemplate>\n <div\n class=\"min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\"\n >\n <ng-container *ngFor=\"let item of resolvedItems\">\n <div *ngIf=\"item.type === 'separator'\" class=\"-mx-1 my-1 h-px bg-muted\"></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n [ngClass]=\"['px-2 py-1.5 text-sm font-semibold text-foreground', item.inset ? 'pl-8' : '']\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative flex w-full appearance-none cursor-default select-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',\n item.inset ? 'pl-8' : ''\n ]\"\n (click)=\"select(item)\"\n >\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center\">\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5 12.5L9.2 16.7L19 7\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <span *ngIf=\"item.radioSelected\" class=\"h-2 w-2 rounded-full bg-foreground\"></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{ item.shortcut }}</span>\n <span *ngIf=\"item.showChevron\" class=\"text-sm text-muted-foreground\">\u203A</span>\n </button>\n </ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2523
2619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmDropdownMenuComponent, decorators: [{
|
|
2524
2620
|
type: Component,
|
|
2525
|
-
args: [{ selector: 'pdm-dropdown-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
2526
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { triggerText: [{
|
|
2621
|
+
args: [{ selector: 'pdm-dropdown-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #triggerEl\n type=\"button\"\n [ngClass]=\"[\n '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 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n className\n ]\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggle()\"\n>\n {{ triggerText }}\n</button>\n\n<ng-template #panelTemplate>\n <div\n class=\"min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\"\n >\n <ng-container *ngFor=\"let item of resolvedItems\">\n <div *ngIf=\"item.type === 'separator'\" class=\"-mx-1 my-1 h-px bg-muted\"></div>\n\n <div\n *ngIf=\"item.type === 'label'\"\n [ngClass]=\"['px-2 py-1.5 text-sm font-semibold text-foreground', item.inset ? 'pl-8' : '']\"\n >\n {{ item.label }}\n </div>\n\n <button\n *ngIf=\"!item.type || item.type === 'item'\"\n type=\"button\"\n [disabled]=\"item.disabled\"\n [ngClass]=\"[\n 'relative flex w-full appearance-none cursor-default select-none items-center gap-2 rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',\n item.inset ? 'pl-8' : ''\n ]\"\n (click)=\"select(item)\"\n >\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center\">\n <svg\n *ngIf=\"item.checked\"\n viewBox=\"0 0 24 24\"\n class=\"h-3.5 w-3.5 text-foreground\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5 12.5L9.2 16.7L19 7\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n <span *ngIf=\"item.radioSelected\" class=\"h-2 w-2 rounded-full bg-foreground\"></span>\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span *ngIf=\"item.shortcut\" class=\"text-xs text-muted-foreground\">{{ item.shortcut }}</span>\n <span *ngIf=\"item.showChevron\" class=\"text-sm text-muted-foreground\">\u203A</span>\n </button>\n </ng-container>\n </div>\n</ng-template>\n" }]
|
|
2622
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$2.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { triggerText: [{
|
|
2527
2623
|
type: Input
|
|
2528
2624
|
}], variant: [{
|
|
2529
2625
|
type: Input
|
|
@@ -2531,20 +2627,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
2531
2627
|
type: Input
|
|
2532
2628
|
}], closeOnSelect: [{
|
|
2533
2629
|
type: Input
|
|
2630
|
+
}], className: [{
|
|
2631
|
+
type: Input
|
|
2534
2632
|
}], panelClassName: [{
|
|
2535
2633
|
type: Input
|
|
2536
|
-
}],
|
|
2634
|
+
}], overlayOptions: [{
|
|
2537
2635
|
type: Input
|
|
2538
2636
|
}], itemSelect: [{
|
|
2539
2637
|
type: Output
|
|
2540
2638
|
}], itemsChange: [{
|
|
2541
2639
|
type: Output
|
|
2640
|
+
}], triggerRef: [{
|
|
2641
|
+
type: ViewChild,
|
|
2642
|
+
args: ['triggerEl']
|
|
2643
|
+
}], panelTemplateRef: [{
|
|
2644
|
+
type: ViewChild,
|
|
2645
|
+
args: ['panelTemplate']
|
|
2542
2646
|
}], onEsc: [{
|
|
2543
2647
|
type: HostListener,
|
|
2544
2648
|
args: ['document:keydown.escape']
|
|
2545
|
-
}], onDocumentClick: [{
|
|
2546
|
-
type: HostListener,
|
|
2547
|
-
args: ['document:click', ['$event']]
|
|
2548
2649
|
}] } });
|
|
2549
2650
|
|
|
2550
2651
|
class PdmDrawerComponent {
|
|
@@ -3405,13 +3506,9 @@ class PdmSelectComponent {
|
|
|
3405
3506
|
])
|
|
3406
3507
|
.withFlexibleDimensions(false)
|
|
3407
3508
|
.withPush(true);
|
|
3408
|
-
this.overlayRef = this.overlay.create({
|
|
3509
|
+
this.overlayRef = this.overlay.create(Object.assign({
|
|
3409
3510
|
// Fix: use a token array — DOMTokenList.add() rejects space-containing strings.
|
|
3410
|
-
panelClass: ['block'],
|
|
3411
|
-
positionStrategy,
|
|
3412
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
3413
|
-
width: triggerEl.offsetWidth
|
|
3414
|
-
});
|
|
3511
|
+
panelClass: ['block'], positionStrategy, scrollStrategy: this.overlay.scrollStrategies.reposition(), width: triggerEl.offsetWidth }, this.overlayOptions));
|
|
3415
3512
|
const portal = new TemplatePortal(this.panelTemplateRef, this.viewContainerRef);
|
|
3416
3513
|
this.overlayRef.attach(portal);
|
|
3417
3514
|
this.backdropSub = this.overlayRef.outsidePointerEvents().subscribe((event) => {
|
|
@@ -3441,7 +3538,7 @@ class PdmSelectComponent {
|
|
|
3441
3538
|
}
|
|
3442
3539
|
}
|
|
3443
3540
|
PdmSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$2.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3444
|
-
PdmSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmSelectComponent, selector: "pdm-select", inputs: { id: "id", value: "value", options: "options", disabled: "disabled", invalid: "invalid", className: "className", placeholder: "placeholder" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "projectedOptions", predicate: PdmSelectOptionDirective }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n '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 flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3541
|
+
PdmSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmSelectComponent, selector: "pdm-select", inputs: { id: "id", value: "value", options: "options", disabled: "disabled", invalid: "invalid", className: "className", placeholder: "placeholder", overlayOptions: "overlayOptions" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "projectedOptions", predicate: PdmSelectOptionDirective }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true }], ngImport: i0, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n '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 flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3445
3542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, decorators: [{
|
|
3446
3543
|
type: Component,
|
|
3447
3544
|
args: [{ selector: 'pdm-select', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"['relative', className || 'w-full']\">\n <button\n #triggerEl\n type=\"button\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-expanded]=\"open\"\n [attr.data-state]=\"open ? 'open' : 'closed'\"\n aria-haspopup=\"listbox\"\n (click)=\"toggle()\"\n [ngClass]=\"[\n '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 flex h-9 w-full appearance-none items-center justify-between rounded-md border bg-background px-3 py-2 text-sm shadow-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',\n ]\"\n >\n <span\n [ngClass]=\"[\n 'min-w-0 flex-1 truncate text-left leading-5',\n selectedOption\n ? 'font-medium text-foreground'\n : 'font-normal text-muted-foreground',\n ]\"\n >\n {{ selectedLabel }}\n </span>\n <pdm-icon\n name=\"chevron-down\"\n [size]=\"16\"\n className=\"shrink-0 text-muted-foreground\"\n ></pdm-icon>\n </button>\n\n <!-- Hidden native select kept for screen-reader / form fallback -->\n <select\n class=\"sr-only\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [value]=\"value\"\n (change)=\"onChange($event)\"\n >\n <option\n *ngFor=\"let option of resolvedOptions\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n\n <!-- Slot for content-projected pdm-select-option elements (hidden from layout) -->\n <span class=\"hidden\">\n <ng-content select=\"pdm-select-option\"></ng-content>\n </span>\n</div>\n\n<ng-template #panelTemplate>\n <div\n role=\"listbox\"\n [attr.aria-labelledby]=\"id || null\"\n class=\"overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions\"\n type=\"button\"\n role=\"option\"\n [attr.aria-selected]=\"option.value === value\"\n [disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [ngClass]=\"[\n 'flex w-full appearance-none items-center justify-between rounded-sm border-0 bg-transparent px-2 py-1.5 text-left text-sm outline-none transition-colors',\n option.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',\n option.value === value ? 'text-foreground' : '',\n ]\"\n >\n <span class=\"min-w-0 flex-1 truncate leading-5\">{{ option.label }}</span>\n <span\n *ngIf=\"option.value === value\"\n class=\"ml-2 flex shrink-0 items-center justify-end\"\n >\n <pdm-icon\n name=\"check\"\n [size]=\"16\"\n className=\"shrink-0 text-current\"\n ></pdm-icon>\n </span>\n </button>\n </div>\n</ng-template>\n" }]
|
|
@@ -3459,6 +3556,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
3459
3556
|
type: Input
|
|
3460
3557
|
}], placeholder: [{
|
|
3461
3558
|
type: Input
|
|
3559
|
+
}], overlayOptions: [{
|
|
3560
|
+
type: Input
|
|
3462
3561
|
}], valueChange: [{
|
|
3463
3562
|
type: Output
|
|
3464
3563
|
}], triggerRef: [{
|
|
@@ -3518,7 +3617,7 @@ class PdmPaginationComponent {
|
|
|
3518
3617
|
}
|
|
3519
3618
|
}
|
|
3520
3619
|
PdmPaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3521
|
-
PdmPaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmPaginationComponent, selector: "pdm-pagination", inputs: { page: "page", pageCount: "pageCount", maxVisible: "maxVisible", className: "className", rowsPerPageLabel: "rowsPerPageLabel", rowsPerPage: "rowsPerPage", rowsPerPageOptions: "rowsPerPageOptions" }, outputs: { pageChange: "pageChange", rowsPerPageChange: "rowsPerPageChange" }, ngImport: i0, template: "<nav\n aria-label=\"Pagination\"\n [ngClass]=\"[\n 'mx-auto flex w-full flex-wrap items-center justify-center gap-4',\n className,\n ]\"\n>\n <div class=\"flex items-center gap-3\" *ngIf=\"rowsPerPageOptions.length > 0\">\n <span class=\"text-sm font-medium text-foreground\">{{\n rowsPerPageLabel\n }}</span>\n <pdm-select\n [value]=\"rowsPerPageValue\"\n [options]=\"rowsPerPageSelectOptions\"\n [placeholder]=\"rowsPerPageValue\"\n className=\"w-[120px]\"\n (valueChange)=\"onRowsPerPageChangeValue($event)\"\n ></pdm-select>\n </div>\n\n <ul class=\"m-0 flex list-none items-center gap-1 p-0\">\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page <= 1\"\n (click)=\"setPage(page - 1)\"\n >\n <pdm-icon name=\"chevron-left\" [size]=\"14\"></pdm-icon>\n Previous\n </button>\n </li>\n <li *ngFor=\"let pageNumber of visiblePages\">\n <ng-container *ngIf=\"pageNumber === 'ellipsis'; else pageButton\">\n <span\n class=\"inline-flex h-9 min-w-9 items-center justify-center px-2 text-sm text-muted-foreground\"\n >...</span\n >\n </ng-container>\n <ng-template #pageButton>\n <button\n type=\"button\"\n [ngClass]=\"[\n 'inline-flex h-9 min-w-9 items-center justify-center rounded-md px-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n pageNumber === page\n ? 'appearance-none border border-border bg-muted text-foreground shadow-sm'\n : 'appearance-none border-0 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground',\n ]\"\n (click)=\"setPage(+pageNumber)\"\n >\n {{ pageNumber }}\n </button>\n </ng-template>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page >= pageCount\"\n (click)=\"setPage(page + 1)\"\n >\n Next\n <pdm-icon name=\"chevron-right\" [size]=\"14\"></pdm-icon>\n </button>\n </li>\n </ul>\n</nav>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }, { kind: "component", type: PdmSelectComponent, selector: "pdm-select", inputs: ["id", "value", "options", "disabled", "invalid", "className", "placeholder"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3620
|
+
PdmPaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PdmPaginationComponent, selector: "pdm-pagination", inputs: { page: "page", pageCount: "pageCount", maxVisible: "maxVisible", className: "className", rowsPerPageLabel: "rowsPerPageLabel", rowsPerPage: "rowsPerPage", rowsPerPageOptions: "rowsPerPageOptions" }, outputs: { pageChange: "pageChange", rowsPerPageChange: "rowsPerPageChange" }, ngImport: i0, template: "<nav\n aria-label=\"Pagination\"\n [ngClass]=\"[\n 'mx-auto flex w-full flex-wrap items-center justify-center gap-4',\n className,\n ]\"\n>\n <div class=\"flex items-center gap-3\" *ngIf=\"rowsPerPageOptions.length > 0\">\n <span class=\"text-sm font-medium text-foreground\">{{\n rowsPerPageLabel\n }}</span>\n <pdm-select\n [value]=\"rowsPerPageValue\"\n [options]=\"rowsPerPageSelectOptions\"\n [placeholder]=\"rowsPerPageValue\"\n className=\"w-[120px]\"\n (valueChange)=\"onRowsPerPageChangeValue($event)\"\n ></pdm-select>\n </div>\n\n <ul class=\"m-0 flex list-none items-center gap-1 p-0\">\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page <= 1\"\n (click)=\"setPage(page - 1)\"\n >\n <pdm-icon name=\"chevron-left\" [size]=\"14\"></pdm-icon>\n Previous\n </button>\n </li>\n <li *ngFor=\"let pageNumber of visiblePages\">\n <ng-container *ngIf=\"pageNumber === 'ellipsis'; else pageButton\">\n <span\n class=\"inline-flex h-9 min-w-9 items-center justify-center px-2 text-sm text-muted-foreground\"\n >...</span\n >\n </ng-container>\n <ng-template #pageButton>\n <button\n type=\"button\"\n [ngClass]=\"[\n 'inline-flex h-9 min-w-9 items-center justify-center rounded-md px-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n pageNumber === page\n ? 'appearance-none border border-border bg-muted text-foreground shadow-sm'\n : 'appearance-none border-0 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground',\n ]\"\n (click)=\"setPage(+pageNumber)\"\n >\n {{ pageNumber }}\n </button>\n </ng-template>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page >= pageCount\"\n (click)=\"setPage(page + 1)\"\n >\n Next\n <pdm-icon name=\"chevron-right\" [size]=\"14\"></pdm-icon>\n </button>\n </li>\n </ul>\n</nav>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }, { kind: "component", type: PdmSelectComponent, selector: "pdm-select", inputs: ["id", "value", "options", "disabled", "invalid", "className", "placeholder", "overlayOptions"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3522
3621
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmPaginationComponent, decorators: [{
|
|
3523
3622
|
type: Component,
|
|
3524
3623
|
args: [{ selector: 'pdm-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav\n aria-label=\"Pagination\"\n [ngClass]=\"[\n 'mx-auto flex w-full flex-wrap items-center justify-center gap-4',\n className,\n ]\"\n>\n <div class=\"flex items-center gap-3\" *ngIf=\"rowsPerPageOptions.length > 0\">\n <span class=\"text-sm font-medium text-foreground\">{{\n rowsPerPageLabel\n }}</span>\n <pdm-select\n [value]=\"rowsPerPageValue\"\n [options]=\"rowsPerPageSelectOptions\"\n [placeholder]=\"rowsPerPageValue\"\n className=\"w-[120px]\"\n (valueChange)=\"onRowsPerPageChangeValue($event)\"\n ></pdm-select>\n </div>\n\n <ul class=\"m-0 flex list-none items-center gap-1 p-0\">\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page <= 1\"\n (click)=\"setPage(page - 1)\"\n >\n <pdm-icon name=\"chevron-left\" [size]=\"14\"></pdm-icon>\n Previous\n </button>\n </li>\n <li *ngFor=\"let pageNumber of visiblePages\">\n <ng-container *ngIf=\"pageNumber === 'ellipsis'; else pageButton\">\n <span\n class=\"inline-flex h-9 min-w-9 items-center justify-center px-2 text-sm text-muted-foreground\"\n >...</span\n >\n </ng-container>\n <ng-template #pageButton>\n <button\n type=\"button\"\n [ngClass]=\"[\n 'inline-flex h-9 min-w-9 items-center justify-center rounded-md px-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',\n pageNumber === page\n ? 'appearance-none border border-border bg-muted text-foreground shadow-sm'\n : 'appearance-none border-0 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground',\n ]\"\n (click)=\"setPage(+pageNumber)\"\n >\n {{ pageNumber }}\n </button>\n </ng-template>\n </li>\n <li>\n <button\n type=\"button\"\n class=\"inline-flex h-9 appearance-none items-center justify-center gap-1 rounded-md border-0 bg-transparent px-2 text-sm text-foreground hover:bg-accent disabled:opacity-50 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n [disabled]=\"page >= pageCount\"\n (click)=\"setPage(page + 1)\"\n >\n Next\n <pdm-icon name=\"chevron-right\" [size]=\"14\"></pdm-icon>\n </button>\n </li>\n </ul>\n</nav>\n" }]
|