pdm-ui-kit 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/select/select.component.mjs +63 -11
- package/esm2020/src/select/select.component.mjs +63 -11
- package/fesm2015/pdm-ui-kit-src-select.mjs +62 -10
- package/fesm2015/pdm-ui-kit-src-select.mjs.map +1 -1
- package/fesm2015/pdm-ui-kit.mjs +62 -10
- package/fesm2015/pdm-ui-kit.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit-src-select.mjs +62 -10
- package/fesm2020/pdm-ui-kit-src-select.mjs.map +1 -1
- package/fesm2020/pdm-ui-kit.mjs +62 -10
- package/fesm2020/pdm-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/select/select.component.d.ts +12 -3
- package/src/select/select.component.d.ts +12 -3
|
@@ -70,7 +70,6 @@ class PdmSelectComponent {
|
|
|
70
70
|
this.viewContainerRef = viewContainerRef;
|
|
71
71
|
this.id = "";
|
|
72
72
|
this.value = "";
|
|
73
|
-
this.options = [];
|
|
74
73
|
this.disabled = false;
|
|
75
74
|
this.invalid = false;
|
|
76
75
|
this.className = "";
|
|
@@ -79,12 +78,37 @@ class PdmSelectComponent {
|
|
|
79
78
|
this.valueChange = new EventEmitter();
|
|
80
79
|
this.overlayRef = null;
|
|
81
80
|
this.backdropSub = null;
|
|
81
|
+
this.projectedOptionsSub = null;
|
|
82
|
+
this.inputOptions = [];
|
|
83
|
+
this.projectedOptionCache = new WeakMap();
|
|
84
|
+
this.cachedProjectedOptions = [];
|
|
85
|
+
this.trackByOptionValue = (index, option) => {
|
|
86
|
+
return this.optionKey(option, index);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
set options(value) {
|
|
90
|
+
this.inputOptions = value ?? [];
|
|
91
|
+
this.cdr.markForCheck();
|
|
92
|
+
}
|
|
93
|
+
get options() {
|
|
94
|
+
return this.inputOptions;
|
|
82
95
|
}
|
|
83
96
|
ngAfterContentInit() {
|
|
97
|
+
this.syncProjectedOptions();
|
|
84
98
|
// Re-render when projected options change (e.g. *ngFor on pdm-select-option).
|
|
85
|
-
this.projectedOptions.changes.subscribe(() =>
|
|
99
|
+
this.projectedOptionsSub = this.projectedOptions.changes.subscribe(() => {
|
|
100
|
+
this.syncProjectedOptions();
|
|
101
|
+
this.cdr.markForCheck();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
ngDoCheck() {
|
|
105
|
+
this.syncProjectedOptions();
|
|
86
106
|
}
|
|
87
107
|
ngOnDestroy() {
|
|
108
|
+
if (this.projectedOptionsSub) {
|
|
109
|
+
this.projectedOptionsSub.unsubscribe();
|
|
110
|
+
this.projectedOptionsSub = null;
|
|
111
|
+
}
|
|
88
112
|
this.destroyOverlay();
|
|
89
113
|
}
|
|
90
114
|
/**
|
|
@@ -94,13 +118,9 @@ class PdmSelectComponent {
|
|
|
94
118
|
*/
|
|
95
119
|
get resolvedOptions() {
|
|
96
120
|
if (this.projectedOptions && this.projectedOptions.length > 0) {
|
|
97
|
-
return this.
|
|
98
|
-
label: d.resolvedLabel,
|
|
99
|
-
value: d.value,
|
|
100
|
-
disabled: d.disabled,
|
|
101
|
-
}));
|
|
121
|
+
return this.cachedProjectedOptions;
|
|
102
122
|
}
|
|
103
|
-
return this.
|
|
123
|
+
return this.inputOptions;
|
|
104
124
|
}
|
|
105
125
|
get selectedOption() {
|
|
106
126
|
return this.resolvedOptions.find((option) => option.value === this.value);
|
|
@@ -132,6 +152,38 @@ class PdmSelectComponent {
|
|
|
132
152
|
this.closePanel();
|
|
133
153
|
}
|
|
134
154
|
}
|
|
155
|
+
syncProjectedOptions() {
|
|
156
|
+
if (!this.projectedOptions || this.projectedOptions.length === 0) {
|
|
157
|
+
if (this.cachedProjectedOptions.length > 0) {
|
|
158
|
+
this.cachedProjectedOptions.length = 0;
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
let index = 0;
|
|
163
|
+
this.projectedOptions.forEach((directive) => {
|
|
164
|
+
let option = this.projectedOptionCache.get(directive);
|
|
165
|
+
if (!option) {
|
|
166
|
+
option = {
|
|
167
|
+
label: directive.resolvedLabel,
|
|
168
|
+
value: directive.value,
|
|
169
|
+
disabled: directive.disabled,
|
|
170
|
+
};
|
|
171
|
+
this.projectedOptionCache.set(directive, option);
|
|
172
|
+
}
|
|
173
|
+
option.label = directive.resolvedLabel;
|
|
174
|
+
option.value = directive.value;
|
|
175
|
+
option.disabled = directive.disabled;
|
|
176
|
+
this.cachedProjectedOptions[index] = option;
|
|
177
|
+
index += 1;
|
|
178
|
+
});
|
|
179
|
+
if (this.cachedProjectedOptions.length !== index) {
|
|
180
|
+
this.cachedProjectedOptions.length = index;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
optionKey(option, index) {
|
|
184
|
+
const value = option?.value;
|
|
185
|
+
return value == null ? `index:${index}` : `value:${String(value)}`;
|
|
186
|
+
}
|
|
135
187
|
openPanel() {
|
|
136
188
|
if (this.overlayRef)
|
|
137
189
|
return;
|
|
@@ -182,10 +234,10 @@ class PdmSelectComponent {
|
|
|
182
234
|
}
|
|
183
235
|
}
|
|
184
236
|
PdmSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
-
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 box-border items-center justify-between rounded-md border border-solid 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=\"w-full overflow-y-auto rounded-md border border-solid 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 box-border 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", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
237
|
+
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 box-border items-center justify-between rounded-md border border-solid 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; trackBy: trackByOptionValue\"\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=\"w-full overflow-y-auto rounded-md border border-solid border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions; trackBy: trackByOptionValue\"\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 box-border 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", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, decorators: [{
|
|
187
239
|
type: Component,
|
|
188
|
-
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 box-border items-center justify-between rounded-md border border-solid 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=\"w-full overflow-y-auto rounded-md border border-solid 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 box-border 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", styles: [":host{display:block}\n"] }]
|
|
240
|
+
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 box-border items-center justify-between rounded-md border border-solid 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; trackBy: trackByOptionValue\"\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=\"w-full overflow-y-auto rounded-md border border-solid border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions; trackBy: trackByOptionValue\"\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 box-border 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", styles: [":host{display:block}\n"] }]
|
|
189
241
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { id: [{
|
|
190
242
|
type: Input
|
|
191
243
|
}], value: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdm-ui-kit-src-select.mjs","sources":["../../../src/select/select-option.directive.ts","../../../src/select/select.component.ts","../../../src/select/select.component.html","../../../src/select/select.module.ts","../../../src/select/pdm-ui-kit-src-select.ts"],"sourcesContent":["import {\n AfterContentInit,\n Directive,\n ElementRef,\n Input\n} from '@angular/core';\n\n/**\n * Directive used to declare an option inside `<pdm-select>` via content projection.\n *\n * Usage:\n * ```html\n * <pdm-select [(value)]=\"val\">\n * <pdm-select-option value=\"a\">Option A</pdm-select-option>\n * <pdm-select-option value=\"b\" [disabled]=\"true\">Option B</pdm-select-option>\n * <pdm-select-option value=\"c\" label=\"Option C\"></pdm-select-option>\n * </pdm-select>\n * ```\n *\n * When `label` is not provided, the text content of the projected node is used.\n */\n@Directive({\n selector: 'pdm-select-option'\n})\nexport class PdmSelectOptionDirective implements AfterContentInit {\n /** The option value that will be emitted on selection. */\n @Input() value = '';\n\n /** When true, the option is rendered but cannot be selected. */\n @Input() disabled = false;\n\n /**\n * Explicit label for the option.\n * When omitted, the directive reads the element's `textContent` after content init.\n */\n @Input() label = '';\n\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n ngAfterContentInit(): void {\n // If no explicit label, harvest text from the projected node.\n if (!this.label) {\n this.label = (this.el.nativeElement.textContent ?? '').trim();\n }\n }\n\n /** Resolved label string — always non-empty after ngAfterContentInit. */\n get resolvedLabel(): string {\n return this.label || this.value;\n }\n}\n","import {\n\tAfterContentInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tContentChildren,\n\tElementRef,\n\tEventEmitter,\n\tHostListener,\n\tInput,\n\tOnDestroy,\n\tOutput,\n\tQueryList,\n\tViewChild,\n\tViewContainerRef,\n} from \"@angular/core\";\nimport { Overlay, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Subscription } from \"rxjs\";\nimport { PdmSelectOptionDirective } from \"./select-option.directive\";\nimport { PdmOverlayOptions } from \"pdm-ui-kit/src/overlay\";\nimport { createFlexiblePositionStrategy } from \"pdm-ui-kit/src/overlay\";\nimport { Z_INDEX } from \"pdm-ui-kit/src/utils\";\n\nexport interface PdmSelectOption {\n\tlabel: string;\n\tvalue: string;\n\tdisabled?: boolean;\n}\n\n@Component({\n\tselector: \"pdm-select\",\n\ttemplateUrl: \"./select.component.html\",\n\tstyles: [\":host { display: block; }\"],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PdmSelectComponent implements AfterContentInit, OnDestroy {\n\t@Input() id = \"\";\n\t@Input() value = \"\";\n\t@Input() options: PdmSelectOption[] = [];\n\t@Input() disabled = false;\n\t@Input() invalid = false;\n\t@Input() className = \"\";\n\t@Input() placeholder = \"Select an option\";\n\t/**\n\t * Optional CDK OverlayConfig overrides.\n\t * Shallow-merged on top of component defaults — consumer always wins.\n\t * Providing `positionStrategy` or `scrollStrategy` replaces the component default entirely.\n\t */\n\t@Input() overlayOptions?: PdmOverlayOptions;\n\n\topen = false;\n\n\t@Output() valueChange = new EventEmitter<string>();\n\n\t@ViewChild(\"triggerEl\") private triggerRef?: ElementRef<HTMLElement>;\n\t@ViewChild(\"panelTemplate\") private panelTemplateRef!: any;\n\n\t/** Collects any `<pdm-select-option>` children projected into this component. */\n\t@ContentChildren(PdmSelectOptionDirective)\n\tprivate projectedOptions!: QueryList<PdmSelectOptionDirective>;\n\n\tprivate overlayRef: OverlayRef | null = null;\n\tprivate backdropSub: Subscription | null = null;\n\n\tconstructor(\n\t\tprivate readonly cdr: ChangeDetectorRef,\n\t\tprivate readonly overlay: Overlay,\n\t\tprivate readonly viewContainerRef: ViewContainerRef,\n\t) {}\n\n\tngAfterContentInit(): void {\n\t\t// Re-render when projected options change (e.g. *ngFor on pdm-select-option).\n\t\tthis.projectedOptions.changes.subscribe(() => this.cdr.markForCheck());\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.destroyOverlay();\n\t}\n\n\t/**\n\t * Returns the effective list of options.\n\t * Projected `<pdm-select-option>` children take priority over the `[options]` input.\n\t * Falls back to `[options]` when no children are projected.\n\t */\n\tget resolvedOptions(): PdmSelectOption[] {\n\t\tif (this.projectedOptions && this.projectedOptions.length > 0) {\n\t\t\treturn this.projectedOptions.map((d) => ({\n\t\t\t\tlabel: d.resolvedLabel,\n\t\t\t\tvalue: d.value,\n\t\t\t\tdisabled: d.disabled,\n\t\t\t}));\n\t\t}\n\t\treturn this.options;\n\t}\n\n\tget selectedOption(): PdmSelectOption | undefined {\n\t\treturn this.resolvedOptions.find((option) => option.value === this.value);\n\t}\n\n\tget selectedLabel(): string {\n\t\treturn this.selectedOption?.label || this.placeholder;\n\t}\n\n\ttoggle(): void {\n\t\tif (this.disabled) return;\n\t\tif (this.open) {\n\t\t\tthis.closePanel();\n\t\t} else {\n\t\t\tthis.openPanel();\n\t\t}\n\t}\n\n\tonChange(event: Event): void {\n\t\tthis.valueChange.emit((event.target as HTMLSelectElement).value);\n\t}\n\n\tselectOption(option: PdmSelectOption): void {\n\t\tif (option.disabled) return;\n\t\tthis.valueChange.emit(option.value);\n\t\tthis.closePanel();\n\t}\n\n\t@HostListener(\"document:keydown.escape\")\n\tonEscape(): void {\n\t\tif (this.open) {\n\t\t\tthis.closePanel();\n\t\t}\n\t}\n\n\tprivate openPanel(): void {\n\t\tif (this.overlayRef) return;\n\n\t\tconst triggerEl = this.triggerRef?.nativeElement;\n\t\tif (!triggerEl) return;\n\n\t\tthis.open = true;\n\t\tthis.cdr.markForCheck();\n\n\t\tconst positionStrategy = createFlexiblePositionStrategy(\n\t\t\tthis.overlay,\n\t\t\ttriggerEl,\n\t\t\t4,\n\t\t);\n\n\t\tthis.overlayRef = this.overlay.create({\n\t\t\t// CRÍTICO: z-[70] para aparecer SOBRE modals (z-[60])\n\t\t\t// panelClass se aplica al cdk-overlay-pane wrapper\n\t\t\tpanelClass: [Z_INDEX.popover],\n\t\t\tpositionStrategy,\n\t\t\tscrollStrategy: this.overlay.scrollStrategies.reposition(),\n\t\t\twidth: triggerEl.offsetWidth,\n\t\t\t// Consumer overrides are spread last — they win over every default above.\n\t\t\t...this.overlayOptions,\n\t\t});\n\n\t\tconst portal = new TemplatePortal(\n\t\t\tthis.panelTemplateRef,\n\t\t\tthis.viewContainerRef,\n\t\t);\n\t\tthis.overlayRef.attach(portal);\n\n\t\tthis.backdropSub = this.overlayRef\n\t\t\t.outsidePointerEvents()\n\t\t\t.subscribe((event) => {\n\t\t\t\tconst target = event.target as Node;\n\t\t\t\tif (!triggerEl.contains(target)) {\n\t\t\t\t\tthis.closePanel();\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.cdr.markForCheck();\n\t}\n\n\tprivate closePanel(): void {\n\t\tif (!this.overlayRef) return;\n\n\t\tthis.open = false;\n\t\tthis.destroyOverlay();\n\t\tthis.cdr.markForCheck();\n\t}\n\n\tprivate destroyOverlay(): void {\n\t\tif (this.backdropSub) {\n\t\t\tthis.backdropSub.unsubscribe();\n\t\t\tthis.backdropSub = null;\n\t\t}\n\t\tif (this.overlayRef) {\n\t\t\tthis.overlayRef.dispose();\n\t\t\tthis.overlayRef = null;\n\t\t}\n\t}\n}\n","<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 box-border items-center justify-between rounded-md border border-solid 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=\"w-full overflow-y-auto rounded-md border border-solid 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 box-border 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","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PdmIconModule } from \"pdm-ui-kit/src/icon\";\nimport { PdmSelectComponent } from \"./select.component\";\nimport { PdmSelectOptionDirective } from \"./select-option.directive\";\n\nconst COMPONENTS = [PdmSelectComponent, PdmSelectOptionDirective];\n\n@NgModule({\n\timports: [CommonModule, OverlayModule, PdmIconModule],\n\tdeclarations: COMPONENTS,\n\texports: COMPONENTS,\n})\nexport class PdmSelectModule {}\n","/**\n * Generated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A,CAAA;2FAIxC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC;AACrD,oBAAA,YAAY,EAAE,UAAU;AACxB,oBAAA,OAAO,EAAE,UAAU;AACnB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"pdm-ui-kit-src-select.mjs","sources":["../../../src/select/select-option.directive.ts","../../../src/select/select.component.ts","../../../src/select/select.component.html","../../../src/select/select.module.ts","../../../src/select/pdm-ui-kit-src-select.ts"],"sourcesContent":["import {\n AfterContentInit,\n Directive,\n ElementRef,\n Input\n} from '@angular/core';\n\n/**\n * Directive used to declare an option inside `<pdm-select>` via content projection.\n *\n * Usage:\n * ```html\n * <pdm-select [(value)]=\"val\">\n * <pdm-select-option value=\"a\">Option A</pdm-select-option>\n * <pdm-select-option value=\"b\" [disabled]=\"true\">Option B</pdm-select-option>\n * <pdm-select-option value=\"c\" label=\"Option C\"></pdm-select-option>\n * </pdm-select>\n * ```\n *\n * When `label` is not provided, the text content of the projected node is used.\n */\n@Directive({\n selector: 'pdm-select-option'\n})\nexport class PdmSelectOptionDirective implements AfterContentInit {\n /** The option value that will be emitted on selection. */\n @Input() value = '';\n\n /** When true, the option is rendered but cannot be selected. */\n @Input() disabled = false;\n\n /**\n * Explicit label for the option.\n * When omitted, the directive reads the element's `textContent` after content init.\n */\n @Input() label = '';\n\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n ngAfterContentInit(): void {\n // If no explicit label, harvest text from the projected node.\n if (!this.label) {\n this.label = (this.el.nativeElement.textContent ?? '').trim();\n }\n }\n\n /** Resolved label string — always non-empty after ngAfterContentInit. */\n get resolvedLabel(): string {\n return this.label || this.value;\n }\n}\n","import {\n\tAfterContentInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tContentChildren,\n\tDoCheck,\n\tElementRef,\n\tEventEmitter,\n\tHostListener,\n\tInput,\n\tOnDestroy,\n\tOutput,\n\tQueryList,\n\tViewChild,\n\tViewContainerRef,\n} from \"@angular/core\";\nimport { Overlay, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Subscription } from \"rxjs\";\nimport { PdmSelectOptionDirective } from \"./select-option.directive\";\nimport { PdmOverlayOptions } from \"pdm-ui-kit/src/overlay\";\nimport { createFlexiblePositionStrategy } from \"pdm-ui-kit/src/overlay\";\nimport { Z_INDEX } from \"pdm-ui-kit/src/utils\";\n\nexport interface PdmSelectOption {\n\tlabel: string;\n\tvalue: string;\n\tdisabled?: boolean;\n}\n\n@Component({\n\tselector: \"pdm-select\",\n\ttemplateUrl: \"./select.component.html\",\n\tstyles: [\":host { display: block; }\"],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PdmSelectComponent implements AfterContentInit, DoCheck, OnDestroy {\n\t@Input() id = \"\";\n\t@Input() value = \"\";\n\t@Input()\n\tset options(value: PdmSelectOption[] | null | undefined) {\n\t\tthis.inputOptions = value ?? [];\n\t\tthis.cdr.markForCheck();\n\t}\n\tget options(): PdmSelectOption[] {\n\t\treturn this.inputOptions;\n\t}\n\t@Input() disabled = false;\n\t@Input() invalid = false;\n\t@Input() className = \"\";\n\t@Input() placeholder = \"Select an option\";\n\t/**\n\t * Optional CDK OverlayConfig overrides.\n\t * Shallow-merged on top of component defaults — consumer always wins.\n\t * Providing `positionStrategy` or `scrollStrategy` replaces the component default entirely.\n\t */\n\t@Input() overlayOptions?: PdmOverlayOptions;\n\n\topen = false;\n\n\t@Output() valueChange = new EventEmitter<string>();\n\n\t@ViewChild(\"triggerEl\") private triggerRef?: ElementRef<HTMLElement>;\n\t@ViewChild(\"panelTemplate\") private panelTemplateRef!: any;\n\n\t/** Collects any `<pdm-select-option>` children projected into this component. */\n\t@ContentChildren(PdmSelectOptionDirective)\n\tprivate projectedOptions!: QueryList<PdmSelectOptionDirective>;\n\n\tprivate overlayRef: OverlayRef | null = null;\n\tprivate backdropSub: Subscription | null = null;\n\tprivate projectedOptionsSub: Subscription | null = null;\n\tprivate inputOptions: PdmSelectOption[] = [];\n\tprivate readonly projectedOptionCache = new WeakMap<\n\t\tPdmSelectOptionDirective,\n\t\tPdmSelectOption\n\t>();\n\tprivate readonly cachedProjectedOptions: PdmSelectOption[] = [];\n\n\tconstructor(\n\t\tprivate readonly cdr: ChangeDetectorRef,\n\t\tprivate readonly overlay: Overlay,\n\t\tprivate readonly viewContainerRef: ViewContainerRef,\n\t) {}\n\n\tngAfterContentInit(): void {\n\t\tthis.syncProjectedOptions();\n\t\t// Re-render when projected options change (e.g. *ngFor on pdm-select-option).\n\t\tthis.projectedOptionsSub = this.projectedOptions.changes.subscribe(() => {\n\t\t\tthis.syncProjectedOptions();\n\t\t\tthis.cdr.markForCheck();\n\t\t});\n\t}\n\n\tngDoCheck(): void {\n\t\tthis.syncProjectedOptions();\n\t}\n\n\tngOnDestroy(): void {\n\t\tif (this.projectedOptionsSub) {\n\t\t\tthis.projectedOptionsSub.unsubscribe();\n\t\t\tthis.projectedOptionsSub = null;\n\t\t}\n\t\tthis.destroyOverlay();\n\t}\n\n\t/**\n\t * Returns the effective list of options.\n\t * Projected `<pdm-select-option>` children take priority over the `[options]` input.\n\t * Falls back to `[options]` when no children are projected.\n\t */\n\tget resolvedOptions(): PdmSelectOption[] {\n\t\tif (this.projectedOptions && this.projectedOptions.length > 0) {\n\t\t\treturn this.cachedProjectedOptions;\n\t\t}\n\t\treturn this.inputOptions;\n\t}\n\n\tget selectedOption(): PdmSelectOption | undefined {\n\t\treturn this.resolvedOptions.find((option) => option.value === this.value);\n\t}\n\n\tget selectedLabel(): string {\n\t\treturn this.selectedOption?.label || this.placeholder;\n\t}\n\n\ttoggle(): void {\n\t\tif (this.disabled) return;\n\t\tif (this.open) {\n\t\t\tthis.closePanel();\n\t\t} else {\n\t\t\tthis.openPanel();\n\t\t}\n\t}\n\n\tonChange(event: Event): void {\n\t\tthis.valueChange.emit((event.target as HTMLSelectElement).value);\n\t}\n\n\tselectOption(option: PdmSelectOption): void {\n\t\tif (option.disabled) return;\n\t\tthis.valueChange.emit(option.value);\n\t\tthis.closePanel();\n\t}\n\n\ttrackByOptionValue = (index: number, option: PdmSelectOption): string => {\n\t\treturn this.optionKey(option, index);\n\t};\n\n\t@HostListener(\"document:keydown.escape\")\n\tonEscape(): void {\n\t\tif (this.open) {\n\t\t\tthis.closePanel();\n\t\t}\n\t}\n\n\tprivate syncProjectedOptions(): void {\n\t\tif (!this.projectedOptions || this.projectedOptions.length === 0) {\n\t\t\tif (this.cachedProjectedOptions.length > 0) {\n\t\t\t\tthis.cachedProjectedOptions.length = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet index = 0;\n\t\tthis.projectedOptions.forEach((directive) => {\n\t\t\tlet option = this.projectedOptionCache.get(directive);\n\t\t\tif (!option) {\n\t\t\t\toption = {\n\t\t\t\t\tlabel: directive.resolvedLabel,\n\t\t\t\t\tvalue: directive.value,\n\t\t\t\t\tdisabled: directive.disabled,\n\t\t\t\t};\n\t\t\t\tthis.projectedOptionCache.set(directive, option);\n\t\t\t}\n\n\t\t\toption.label = directive.resolvedLabel;\n\t\t\toption.value = directive.value;\n\t\t\toption.disabled = directive.disabled;\n\t\t\tthis.cachedProjectedOptions[index] = option;\n\t\t\tindex += 1;\n\t\t});\n\n\t\tif (this.cachedProjectedOptions.length !== index) {\n\t\t\tthis.cachedProjectedOptions.length = index;\n\t\t}\n\t}\n\n\tprivate optionKey(option: PdmSelectOption | null | undefined, index: number): string {\n\t\tconst value = option?.value;\n\t\treturn value == null ? `index:${index}` : `value:${String(value)}`;\n\t}\n\n\tprivate openPanel(): void {\n\t\tif (this.overlayRef) return;\n\n\t\tconst triggerEl = this.triggerRef?.nativeElement;\n\t\tif (!triggerEl) return;\n\n\t\tthis.open = true;\n\t\tthis.cdr.markForCheck();\n\n\t\tconst positionStrategy = createFlexiblePositionStrategy(\n\t\t\tthis.overlay,\n\t\t\ttriggerEl,\n\t\t\t4,\n\t\t);\n\n\t\tthis.overlayRef = this.overlay.create({\n\t\t\t// CRÍTICO: z-[70] para aparecer SOBRE modals (z-[60])\n\t\t\t// panelClass se aplica al cdk-overlay-pane wrapper\n\t\t\tpanelClass: [Z_INDEX.popover],\n\t\t\tpositionStrategy,\n\t\t\tscrollStrategy: this.overlay.scrollStrategies.reposition(),\n\t\t\twidth: triggerEl.offsetWidth,\n\t\t\t// Consumer overrides are spread last — they win over every default above.\n\t\t\t...this.overlayOptions,\n\t\t});\n\n\t\tconst portal = new TemplatePortal(\n\t\t\tthis.panelTemplateRef,\n\t\t\tthis.viewContainerRef,\n\t\t);\n\t\tthis.overlayRef.attach(portal);\n\n\t\tthis.backdropSub = this.overlayRef\n\t\t\t.outsidePointerEvents()\n\t\t\t.subscribe((event) => {\n\t\t\t\tconst target = event.target as Node;\n\t\t\t\tif (!triggerEl.contains(target)) {\n\t\t\t\t\tthis.closePanel();\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.cdr.markForCheck();\n\t}\n\n\tprivate closePanel(): void {\n\t\tif (!this.overlayRef) return;\n\n\t\tthis.open = false;\n\t\tthis.destroyOverlay();\n\t\tthis.cdr.markForCheck();\n\t}\n\n\tprivate destroyOverlay(): void {\n\t\tif (this.backdropSub) {\n\t\t\tthis.backdropSub.unsubscribe();\n\t\t\tthis.backdropSub = null;\n\t\t}\n\t\tif (this.overlayRef) {\n\t\t\tthis.overlayRef.dispose();\n\t\t\tthis.overlayRef = null;\n\t\t}\n\t}\n}\n","<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 box-border items-center justify-between rounded-md border border-solid 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; trackBy: trackByOptionValue\"\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=\"w-full overflow-y-auto rounded-md border border-solid border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions; trackBy: trackByOptionValue\"\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 box-border 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","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PdmIconModule } from \"pdm-ui-kit/src/icon\";\nimport { PdmSelectComponent } from \"./select.component\";\nimport { PdmSelectOptionDirective } from \"./select-option.directive\";\n\nconst COMPONENTS = [PdmSelectComponent, PdmSelectOptionDirective];\n\n@NgModule({\n\timports: [CommonModule, OverlayModule, PdmIconModule],\n\tdeclarations: COMPONENTS,\n\texports: COMPONENTS,\n})\nexport class PdmSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAOA;;;;;;;;;;;;;AAaG;MAIU,wBAAwB,CAAA;AAanC,IAAA,WAAA,CAA6B,EAA2B,EAAA;QAA3B,IAAE,CAAA,EAAA,GAAF,EAAE,CAAyB;;QAX/C,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAE1B;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;KAEwC;IAE5D,kBAAkB,GAAA;;AAEhB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACf,YAAA,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AAC/D,SAAA;KACF;;AAGD,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,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EAAA,CAAA,kBAAkB,EAAE,wBAAwB,CAAA,EAAA,CAAA,CAAA;AAOnD,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAJjB,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,aAAa,CAAA,EAAA,CAAA,CAAA;2FAIxC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC;AACrD,oBAAA,YAAY,EAAE,UAAU;AACxB,oBAAA,OAAO,EAAE,UAAU;AACnB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
package/fesm2020/pdm-ui-kit.mjs
CHANGED
|
@@ -6149,7 +6149,6 @@ class PdmSelectComponent {
|
|
|
6149
6149
|
this.viewContainerRef = viewContainerRef;
|
|
6150
6150
|
this.id = "";
|
|
6151
6151
|
this.value = "";
|
|
6152
|
-
this.options = [];
|
|
6153
6152
|
this.disabled = false;
|
|
6154
6153
|
this.invalid = false;
|
|
6155
6154
|
this.className = "";
|
|
@@ -6158,12 +6157,37 @@ class PdmSelectComponent {
|
|
|
6158
6157
|
this.valueChange = new EventEmitter();
|
|
6159
6158
|
this.overlayRef = null;
|
|
6160
6159
|
this.backdropSub = null;
|
|
6160
|
+
this.projectedOptionsSub = null;
|
|
6161
|
+
this.inputOptions = [];
|
|
6162
|
+
this.projectedOptionCache = new WeakMap();
|
|
6163
|
+
this.cachedProjectedOptions = [];
|
|
6164
|
+
this.trackByOptionValue = (index, option) => {
|
|
6165
|
+
return this.optionKey(option, index);
|
|
6166
|
+
};
|
|
6167
|
+
}
|
|
6168
|
+
set options(value) {
|
|
6169
|
+
this.inputOptions = value ?? [];
|
|
6170
|
+
this.cdr.markForCheck();
|
|
6171
|
+
}
|
|
6172
|
+
get options() {
|
|
6173
|
+
return this.inputOptions;
|
|
6161
6174
|
}
|
|
6162
6175
|
ngAfterContentInit() {
|
|
6176
|
+
this.syncProjectedOptions();
|
|
6163
6177
|
// Re-render when projected options change (e.g. *ngFor on pdm-select-option).
|
|
6164
|
-
this.projectedOptions.changes.subscribe(() =>
|
|
6178
|
+
this.projectedOptionsSub = this.projectedOptions.changes.subscribe(() => {
|
|
6179
|
+
this.syncProjectedOptions();
|
|
6180
|
+
this.cdr.markForCheck();
|
|
6181
|
+
});
|
|
6182
|
+
}
|
|
6183
|
+
ngDoCheck() {
|
|
6184
|
+
this.syncProjectedOptions();
|
|
6165
6185
|
}
|
|
6166
6186
|
ngOnDestroy() {
|
|
6187
|
+
if (this.projectedOptionsSub) {
|
|
6188
|
+
this.projectedOptionsSub.unsubscribe();
|
|
6189
|
+
this.projectedOptionsSub = null;
|
|
6190
|
+
}
|
|
6167
6191
|
this.destroyOverlay();
|
|
6168
6192
|
}
|
|
6169
6193
|
/**
|
|
@@ -6173,13 +6197,9 @@ class PdmSelectComponent {
|
|
|
6173
6197
|
*/
|
|
6174
6198
|
get resolvedOptions() {
|
|
6175
6199
|
if (this.projectedOptions && this.projectedOptions.length > 0) {
|
|
6176
|
-
return this.
|
|
6177
|
-
label: d.resolvedLabel,
|
|
6178
|
-
value: d.value,
|
|
6179
|
-
disabled: d.disabled,
|
|
6180
|
-
}));
|
|
6200
|
+
return this.cachedProjectedOptions;
|
|
6181
6201
|
}
|
|
6182
|
-
return this.
|
|
6202
|
+
return this.inputOptions;
|
|
6183
6203
|
}
|
|
6184
6204
|
get selectedOption() {
|
|
6185
6205
|
return this.resolvedOptions.find((option) => option.value === this.value);
|
|
@@ -6211,6 +6231,38 @@ class PdmSelectComponent {
|
|
|
6211
6231
|
this.closePanel();
|
|
6212
6232
|
}
|
|
6213
6233
|
}
|
|
6234
|
+
syncProjectedOptions() {
|
|
6235
|
+
if (!this.projectedOptions || this.projectedOptions.length === 0) {
|
|
6236
|
+
if (this.cachedProjectedOptions.length > 0) {
|
|
6237
|
+
this.cachedProjectedOptions.length = 0;
|
|
6238
|
+
}
|
|
6239
|
+
return;
|
|
6240
|
+
}
|
|
6241
|
+
let index = 0;
|
|
6242
|
+
this.projectedOptions.forEach((directive) => {
|
|
6243
|
+
let option = this.projectedOptionCache.get(directive);
|
|
6244
|
+
if (!option) {
|
|
6245
|
+
option = {
|
|
6246
|
+
label: directive.resolvedLabel,
|
|
6247
|
+
value: directive.value,
|
|
6248
|
+
disabled: directive.disabled,
|
|
6249
|
+
};
|
|
6250
|
+
this.projectedOptionCache.set(directive, option);
|
|
6251
|
+
}
|
|
6252
|
+
option.label = directive.resolvedLabel;
|
|
6253
|
+
option.value = directive.value;
|
|
6254
|
+
option.disabled = directive.disabled;
|
|
6255
|
+
this.cachedProjectedOptions[index] = option;
|
|
6256
|
+
index += 1;
|
|
6257
|
+
});
|
|
6258
|
+
if (this.cachedProjectedOptions.length !== index) {
|
|
6259
|
+
this.cachedProjectedOptions.length = index;
|
|
6260
|
+
}
|
|
6261
|
+
}
|
|
6262
|
+
optionKey(option, index) {
|
|
6263
|
+
const value = option?.value;
|
|
6264
|
+
return value == null ? `index:${index}` : `value:${String(value)}`;
|
|
6265
|
+
}
|
|
6214
6266
|
openPanel() {
|
|
6215
6267
|
if (this.overlayRef)
|
|
6216
6268
|
return;
|
|
@@ -6261,10 +6313,10 @@ class PdmSelectComponent {
|
|
|
6261
6313
|
}
|
|
6262
6314
|
}
|
|
6263
6315
|
PdmSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6264
|
-
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 box-border items-center justify-between rounded-md border border-solid 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=\"w-full overflow-y-auto rounded-md border border-solid 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 box-border 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", styles: [":host{display:block}\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: i2$1.PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6316
|
+
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 box-border items-center justify-between rounded-md border border-solid 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; trackBy: trackByOptionValue\"\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=\"w-full overflow-y-auto rounded-md border border-solid border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions; trackBy: trackByOptionValue\"\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 box-border 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", styles: [":host{display:block}\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: i2$1.PdmIconComponent, selector: "pdm-icon", inputs: ["name", "library", "assetUrl", "size", "strokeWidth", "className", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6265
6317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PdmSelectComponent, decorators: [{
|
|
6266
6318
|
type: Component,
|
|
6267
|
-
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 box-border items-center justify-between rounded-md border border-solid 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=\"w-full overflow-y-auto rounded-md border border-solid 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 box-border 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", styles: [":host{display:block}\n"] }]
|
|
6319
|
+
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 box-border items-center justify-between rounded-md border border-solid 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; trackBy: trackByOptionValue\"\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=\"w-full overflow-y-auto rounded-md border border-solid border-border bg-popover p-1 text-popover-foreground shadow-md max-h-96\"\n >\n <button\n *ngFor=\"let option of resolvedOptions; trackBy: trackByOptionValue\"\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 box-border 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", styles: [":host{display:block}\n"] }]
|
|
6268
6320
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }]; }, propDecorators: { id: [{
|
|
6269
6321
|
type: Input
|
|
6270
6322
|
}], value: [{
|