pdm-ui-kit 0.1.45 → 0.1.46

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.
@@ -0,0 +1,34 @@
1
+ import { AfterContentInit, ElementRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Directive used to declare an option inside `<pdm-select>` via content projection.
5
+ *
6
+ * Usage:
7
+ * ```html
8
+ * <pdm-select [(value)]="val">
9
+ * <pdm-select-option value="a">Option A</pdm-select-option>
10
+ * <pdm-select-option value="b" [disabled]="true">Option B</pdm-select-option>
11
+ * <pdm-select-option value="c" label="Option C"></pdm-select-option>
12
+ * </pdm-select>
13
+ * ```
14
+ *
15
+ * When `label` is not provided, the text content of the projected node is used.
16
+ */
17
+ export declare class PdmSelectOptionDirective implements AfterContentInit {
18
+ private readonly el;
19
+ /** The option value that will be emitted on selection. */
20
+ value: string;
21
+ /** When true, the option is rendered but cannot be selected. */
22
+ disabled: boolean;
23
+ /**
24
+ * Explicit label for the option.
25
+ * When omitted, the directive reads the element's `textContent` after content init.
26
+ */
27
+ label: string;
28
+ constructor(el: ElementRef<HTMLElement>);
29
+ ngAfterContentInit(): void;
30
+ /** Resolved label string — always non-empty after ngAfterContentInit. */
31
+ get resolvedLabel(): string;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<PdmSelectOptionDirective, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PdmSelectOptionDirective, "pdm-select-option", never, { "value": "value"; "disabled": "disabled"; "label": "label"; }, {}, never, never, false>;
34
+ }
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, ViewContainerRef } from '@angular/core';
1
+ import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, ViewContainerRef } from '@angular/core';
2
2
  import { Overlay } from '@angular/cdk/overlay';
3
3
  import * as i0 from "@angular/core";
4
4
  export interface PdmSelectOption {
@@ -6,7 +6,7 @@ export interface PdmSelectOption {
6
6
  value: string;
7
7
  disabled?: boolean;
8
8
  }
9
- export declare class PdmSelectComponent implements OnDestroy {
9
+ export declare class PdmSelectComponent implements AfterContentInit, OnDestroy {
10
10
  private readonly elementRef;
11
11
  private readonly cdr;
12
12
  private readonly overlay;
@@ -22,10 +22,19 @@ export declare class PdmSelectComponent implements OnDestroy {
22
22
  valueChange: EventEmitter<string>;
23
23
  private triggerRef?;
24
24
  private panelTemplateRef;
25
+ /** Collects any `<pdm-select-option>` children projected into this component. */
26
+ private projectedOptions;
25
27
  private overlayRef;
26
28
  private backdropSub;
27
29
  constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, overlay: Overlay, viewContainerRef: ViewContainerRef);
30
+ ngAfterContentInit(): void;
28
31
  ngOnDestroy(): void;
32
+ /**
33
+ * Returns the effective list of options.
34
+ * Projected `<pdm-select-option>` children take priority over the `[options]` input.
35
+ * Falls back to `[options]` when no children are projected.
36
+ */
37
+ get resolvedOptions(): PdmSelectOption[];
29
38
  get selectedOption(): PdmSelectOption | undefined;
30
39
  get selectedLabel(): string;
31
40
  toggle(): void;
@@ -36,5 +45,5 @@ export declare class PdmSelectComponent implements OnDestroy {
36
45
  private closePanel;
37
46
  private destroyOverlay;
38
47
  static ɵfac: i0.ɵɵFactoryDeclaration<PdmSelectComponent, never>;
39
- static ɵcmp: i0.ɵɵComponentDeclaration<PdmSelectComponent, "pdm-select", never, { "id": "id"; "value": "value"; "options": "options"; "disabled": "disabled"; "invalid": "invalid"; "className": "className"; "placeholder": "placeholder"; }, { "valueChange": "valueChange"; }, never, never, false>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<PdmSelectComponent, "pdm-select", never, { "id": "id"; "value": "value"; "options": "options"; "disabled": "disabled"; "invalid": "invalid"; "className": "className"; "placeholder": "placeholder"; }, { "valueChange": "valueChange"; }, ["projectedOptions"], ["pdm-select-option"], false>;
40
49
  }
@@ -42,24 +42,25 @@ import * as i40 from "./components/progress/progress.component";
42
42
  import * as i41 from "./components/radio-group/radio-group.component";
43
43
  import * as i42 from "./components/scroll-area/scroll-area.component";
44
44
  import * as i43 from "./components/select/select.component";
45
- import * as i44 from "./components/separator/separator.component";
46
- import * as i45 from "./components/sheet/sheet.component";
47
- import * as i46 from "./components/sidebar/sidebar.component";
48
- import * as i47 from "./components/skeleton/skeleton.component";
49
- import * as i48 from "./components/slider/slider.component";
50
- import * as i49 from "./components/sonner/sonner.component";
51
- import * as i50 from "./components/spinner/spinner.component";
52
- import * as i51 from "./components/switch/switch.component";
53
- import * as i52 from "./components/table/table.component";
54
- import * as i53 from "./components/tabs/tabs.component";
55
- import * as i54 from "./components/textarea/textarea.component";
56
- import * as i55 from "./components/toggle/toggle.component";
57
- import * as i56 from "./components/toggle-group/toggle-group.component";
58
- import * as i57 from "./components/tooltip/tooltip.component";
59
- import * as i58 from "@angular/common";
60
- import * as i59 from "@angular/cdk/overlay";
45
+ import * as i44 from "./components/select/select-option.directive";
46
+ import * as i45 from "./components/separator/separator.component";
47
+ import * as i46 from "./components/sheet/sheet.component";
48
+ import * as i47 from "./components/sidebar/sidebar.component";
49
+ import * as i48 from "./components/skeleton/skeleton.component";
50
+ import * as i49 from "./components/slider/slider.component";
51
+ import * as i50 from "./components/sonner/sonner.component";
52
+ import * as i51 from "./components/spinner/spinner.component";
53
+ import * as i52 from "./components/switch/switch.component";
54
+ import * as i53 from "./components/table/table.component";
55
+ import * as i54 from "./components/tabs/tabs.component";
56
+ import * as i55 from "./components/textarea/textarea.component";
57
+ import * as i56 from "./components/toggle/toggle.component";
58
+ import * as i57 from "./components/toggle-group/toggle-group.component";
59
+ import * as i58 from "./components/tooltip/tooltip.component";
60
+ import * as i59 from "@angular/common";
61
+ import * as i60 from "@angular/cdk/overlay";
61
62
  export declare class PdmUiKitModule {
62
63
  static ɵfac: i0.ɵɵFactoryDeclaration<PdmUiKitModule, never>;
63
- static ɵmod: i0.ɵɵNgModuleDeclaration<PdmUiKitModule, [typeof i1.PdmAccordionComponent, typeof i2.PdmAlertComponent, typeof i3.PdmAlertDialogComponent, typeof i4.PdmAspectRatioComponent, typeof i5.PdmAvatarComponent, typeof i6.PdmBadgeComponent, typeof i7.PdmBreadcrumbComponent, typeof i8.PdmButtonGroupComponent, typeof i9.PdmButtonComponent, typeof i10.PdmCalendarComponent, typeof i11.PdmCarouselComponent, typeof i12.PdmCardComponent, typeof i13.PdmChartComponent, typeof i14.PdmCheckboxComponent, typeof i15.PdmCollapsibleComponent, typeof i16.PdmComboboxComponent, typeof i17.PdmCommandComponent, typeof i18.PdmContextMenuComponent, typeof i19.PdmDataTableComponent, typeof i20.PdmDatePickerComponent, typeof i21.PdmDialogComponent, typeof i22.PdmDropdownMenuComponent, typeof i23.PdmDrawerComponent, typeof i24.PdmEmptyComponent, typeof i25.PdmFieldComponent, typeof i26.PdmHoverCardComponent, typeof i27.PdmIconComponent, typeof i28.PdmItemComponent, typeof i29.PdmInputComponent, typeof i30.PdmInputPasswordComponent, typeof i31.PdmInputGroupComponent, typeof i32.PdmInputOtpComponent, typeof i33.PdmKbdComponent, typeof i34.PdmLabelComponent, typeof i35.PdmMenubarComponent, typeof i36.PdmNativeSelectComponent, typeof i37.PdmNavigationMenuComponent, typeof i38.PdmPaginationComponent, typeof i39.PdmPopoverComponent, typeof i40.PdmProgressComponent, typeof i41.PdmRadioGroupComponent, typeof i42.PdmScrollAreaComponent, typeof i43.PdmSelectComponent, typeof i44.PdmSeparatorComponent, typeof i45.PdmSheetComponent, typeof i46.PdmSidebarComponent, typeof i47.PdmSkeletonComponent, typeof i48.PdmSliderComponent, typeof i49.PdmSonnerComponent, typeof i50.PdmSpinnerComponent, typeof i51.PdmSwitchComponent, typeof i52.PdmTableComponent, typeof i53.PdmTabsComponent, typeof i54.PdmTextareaComponent, typeof i55.PdmToggleComponent, typeof i56.PdmToggleGroupComponent, typeof i57.PdmTooltipComponent], [typeof i58.CommonModule, typeof i59.OverlayModule], [typeof i1.PdmAccordionComponent, typeof i2.PdmAlertComponent, typeof i3.PdmAlertDialogComponent, typeof i4.PdmAspectRatioComponent, typeof i5.PdmAvatarComponent, typeof i6.PdmBadgeComponent, typeof i7.PdmBreadcrumbComponent, typeof i8.PdmButtonGroupComponent, typeof i9.PdmButtonComponent, typeof i10.PdmCalendarComponent, typeof i11.PdmCarouselComponent, typeof i12.PdmCardComponent, typeof i13.PdmChartComponent, typeof i14.PdmCheckboxComponent, typeof i15.PdmCollapsibleComponent, typeof i16.PdmComboboxComponent, typeof i17.PdmCommandComponent, typeof i18.PdmContextMenuComponent, typeof i19.PdmDataTableComponent, typeof i20.PdmDatePickerComponent, typeof i21.PdmDialogComponent, typeof i22.PdmDropdownMenuComponent, typeof i23.PdmDrawerComponent, typeof i24.PdmEmptyComponent, typeof i25.PdmFieldComponent, typeof i26.PdmHoverCardComponent, typeof i27.PdmIconComponent, typeof i28.PdmItemComponent, typeof i29.PdmInputComponent, typeof i30.PdmInputPasswordComponent, typeof i31.PdmInputGroupComponent, typeof i32.PdmInputOtpComponent, typeof i33.PdmKbdComponent, typeof i34.PdmLabelComponent, typeof i35.PdmMenubarComponent, typeof i36.PdmNativeSelectComponent, typeof i37.PdmNavigationMenuComponent, typeof i38.PdmPaginationComponent, typeof i39.PdmPopoverComponent, typeof i40.PdmProgressComponent, typeof i41.PdmRadioGroupComponent, typeof i42.PdmScrollAreaComponent, typeof i43.PdmSelectComponent, typeof i44.PdmSeparatorComponent, typeof i45.PdmSheetComponent, typeof i46.PdmSidebarComponent, typeof i47.PdmSkeletonComponent, typeof i48.PdmSliderComponent, typeof i49.PdmSonnerComponent, typeof i50.PdmSpinnerComponent, typeof i51.PdmSwitchComponent, typeof i52.PdmTableComponent, typeof i53.PdmTabsComponent, typeof i54.PdmTextareaComponent, typeof i55.PdmToggleComponent, typeof i56.PdmToggleGroupComponent, typeof i57.PdmTooltipComponent]>;
64
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PdmUiKitModule, [typeof i1.PdmAccordionComponent, typeof i2.PdmAlertComponent, typeof i3.PdmAlertDialogComponent, typeof i4.PdmAspectRatioComponent, typeof i5.PdmAvatarComponent, typeof i6.PdmBadgeComponent, typeof i7.PdmBreadcrumbComponent, typeof i8.PdmButtonGroupComponent, typeof i9.PdmButtonComponent, typeof i10.PdmCalendarComponent, typeof i11.PdmCarouselComponent, typeof i12.PdmCardComponent, typeof i13.PdmChartComponent, typeof i14.PdmCheckboxComponent, typeof i15.PdmCollapsibleComponent, typeof i16.PdmComboboxComponent, typeof i17.PdmCommandComponent, typeof i18.PdmContextMenuComponent, typeof i19.PdmDataTableComponent, typeof i20.PdmDatePickerComponent, typeof i21.PdmDialogComponent, typeof i22.PdmDropdownMenuComponent, typeof i23.PdmDrawerComponent, typeof i24.PdmEmptyComponent, typeof i25.PdmFieldComponent, typeof i26.PdmHoverCardComponent, typeof i27.PdmIconComponent, typeof i28.PdmItemComponent, typeof i29.PdmInputComponent, typeof i30.PdmInputPasswordComponent, typeof i31.PdmInputGroupComponent, typeof i32.PdmInputOtpComponent, typeof i33.PdmKbdComponent, typeof i34.PdmLabelComponent, typeof i35.PdmMenubarComponent, typeof i36.PdmNativeSelectComponent, typeof i37.PdmNavigationMenuComponent, typeof i38.PdmPaginationComponent, typeof i39.PdmPopoverComponent, typeof i40.PdmProgressComponent, typeof i41.PdmRadioGroupComponent, typeof i42.PdmScrollAreaComponent, typeof i43.PdmSelectComponent, typeof i44.PdmSelectOptionDirective, typeof i45.PdmSeparatorComponent, typeof i46.PdmSheetComponent, typeof i47.PdmSidebarComponent, typeof i48.PdmSkeletonComponent, typeof i49.PdmSliderComponent, typeof i50.PdmSonnerComponent, typeof i51.PdmSpinnerComponent, typeof i52.PdmSwitchComponent, typeof i53.PdmTableComponent, typeof i54.PdmTabsComponent, typeof i55.PdmTextareaComponent, typeof i56.PdmToggleComponent, typeof i57.PdmToggleGroupComponent, typeof i58.PdmTooltipComponent], [typeof i59.CommonModule, typeof i60.OverlayModule], [typeof i1.PdmAccordionComponent, typeof i2.PdmAlertComponent, typeof i3.PdmAlertDialogComponent, typeof i4.PdmAspectRatioComponent, typeof i5.PdmAvatarComponent, typeof i6.PdmBadgeComponent, typeof i7.PdmBreadcrumbComponent, typeof i8.PdmButtonGroupComponent, typeof i9.PdmButtonComponent, typeof i10.PdmCalendarComponent, typeof i11.PdmCarouselComponent, typeof i12.PdmCardComponent, typeof i13.PdmChartComponent, typeof i14.PdmCheckboxComponent, typeof i15.PdmCollapsibleComponent, typeof i16.PdmComboboxComponent, typeof i17.PdmCommandComponent, typeof i18.PdmContextMenuComponent, typeof i19.PdmDataTableComponent, typeof i20.PdmDatePickerComponent, typeof i21.PdmDialogComponent, typeof i22.PdmDropdownMenuComponent, typeof i23.PdmDrawerComponent, typeof i24.PdmEmptyComponent, typeof i25.PdmFieldComponent, typeof i26.PdmHoverCardComponent, typeof i27.PdmIconComponent, typeof i28.PdmItemComponent, typeof i29.PdmInputComponent, typeof i30.PdmInputPasswordComponent, typeof i31.PdmInputGroupComponent, typeof i32.PdmInputOtpComponent, typeof i33.PdmKbdComponent, typeof i34.PdmLabelComponent, typeof i35.PdmMenubarComponent, typeof i36.PdmNativeSelectComponent, typeof i37.PdmNavigationMenuComponent, typeof i38.PdmPaginationComponent, typeof i39.PdmPopoverComponent, typeof i40.PdmProgressComponent, typeof i41.PdmRadioGroupComponent, typeof i42.PdmScrollAreaComponent, typeof i43.PdmSelectComponent, typeof i44.PdmSelectOptionDirective, typeof i45.PdmSeparatorComponent, typeof i46.PdmSheetComponent, typeof i47.PdmSidebarComponent, typeof i48.PdmSkeletonComponent, typeof i49.PdmSliderComponent, typeof i50.PdmSonnerComponent, typeof i51.PdmSpinnerComponent, typeof i52.PdmSwitchComponent, typeof i53.PdmTableComponent, typeof i54.PdmTabsComponent, typeof i55.PdmTextareaComponent, typeof i56.PdmToggleComponent, typeof i57.PdmToggleGroupComponent, typeof i58.PdmTooltipComponent]>;
64
65
  static ɵinj: i0.ɵɵInjectorDeclaration<PdmUiKitModule>;
65
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdm-ui-kit",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "description": "PDM UI Kit Angular components",
5
5
  "author": "Corelusa",
6
6
  "license": "MIT",
package/public-api.d.ts CHANGED
@@ -42,6 +42,7 @@ export * from './lib/components/progress/progress.component';
42
42
  export * from './lib/components/radio-group/radio-group.component';
43
43
  export * from './lib/components/scroll-area/scroll-area.component';
44
44
  export * from './lib/components/select/select.component';
45
+ export * from './lib/components/select/select-option.directive';
45
46
  export * from './lib/components/separator/separator.component';
46
47
  export * from './lib/components/sheet/sheet.component';
47
48
  export * from './lib/components/sidebar/sidebar.component';