ud-components 0.5.14 → 0.5.17

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,81 @@
1
+ import { CalendarMode, CalendarSlot, CalendarView } from './calendar.interface';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CalendarComponent {
4
+ slots: import("@angular/core").InputSignal<CalendarSlot[]>;
5
+ mode: import("@angular/core").InputSignal<CalendarMode>;
6
+ defaultView: import("@angular/core").InputSignal<CalendarView>;
7
+ slotDuration: import("@angular/core").InputSignal<number>;
8
+ minHour: import("@angular/core").InputSignal<number>;
9
+ maxHour: import("@angular/core").InputSignal<number>;
10
+ slotAdded: import("@angular/core").OutputEmitterRef<CalendarSlot>;
11
+ slotUpdated: import("@angular/core").OutputEmitterRef<CalendarSlot>;
12
+ slotRemoved: import("@angular/core").OutputEmitterRef<string>;
13
+ slotBooked: import("@angular/core").OutputEmitterRef<CalendarSlot>;
14
+ activeView: import("@angular/core").WritableSignal<CalendarView>;
15
+ navDate: import("@angular/core").WritableSignal<Date>;
16
+ readonly viewOptions: {
17
+ id: CalendarView;
18
+ label: string;
19
+ }[];
20
+ private readonly CELL_H;
21
+ private readonly TIME_COL_W;
22
+ private dialog;
23
+ private elRef;
24
+ draggingSlot: CalendarSlot | null;
25
+ dragMoved: boolean;
26
+ dragTarget: {
27
+ day: Date;
28
+ hour: number;
29
+ minute: number;
30
+ } | null;
31
+ private dragSlotDurationMin;
32
+ private dragStartPos;
33
+ constructor();
34
+ timeSlots: import("@angular/core").Signal<{
35
+ hour: number;
36
+ minute: number;
37
+ label: string;
38
+ }[]>;
39
+ weekDays: import("@angular/core").Signal<Date[]>;
40
+ monthWeeks: import("@angular/core").Signal<Date[][]>;
41
+ headerLabel: import("@angular/core").Signal<string>;
42
+ navigate(dir: -1 | 1): void;
43
+ goToday(): void;
44
+ switchView(view: CalendarView): void;
45
+ clickDay(day: Date): void;
46
+ slotsForDay(day: Date): CalendarSlot[];
47
+ slotTop(slot: CalendarSlot): number;
48
+ slotHeight(slot: CalendarSlot): number;
49
+ slotBg(slot: CalendarSlot): string;
50
+ slotTextColor(slot: CalendarSlot): string;
51
+ slotBorderColor(slot: CalendarSlot): string;
52
+ formatSlotTime(slot: CalendarSlot): string;
53
+ isToday(day: Date): boolean;
54
+ isCurrentMonth(day: Date): boolean;
55
+ dayLabel(day: Date): string;
56
+ dayNum(day: Date): number;
57
+ onCellClick(day: Date, hour: number, minute: number): void;
58
+ onSlotMouseDown(e: MouseEvent, slot: CalendarSlot): void;
59
+ onDocMouseMove(e: MouseEvent): void;
60
+ onDocMouseUp(e: MouseEvent): void;
61
+ previewTop(target: {
62
+ hour: number;
63
+ minute: number;
64
+ }): number;
65
+ previewHeight(): number;
66
+ private getGridTarget;
67
+ openAddModal(day?: Date, hour?: number, minute?: number): void;
68
+ openEditModal(slot: CalendarSlot): void;
69
+ private buildForm;
70
+ private slotForms;
71
+ private buildSlot;
72
+ private shiftTimeStr;
73
+ private applyTimeStr;
74
+ private getMonday;
75
+ isSameDay(a: Date, b: Date): boolean;
76
+ private formatHour;
77
+ private formatTime;
78
+ private hexToRgba;
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "ud-calendar", never, { "slots": { "alias": "slots"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "defaultView": { "alias": "defaultView"; "required": false; "isSignal": true; }; "slotDuration": { "alias": "slotDuration"; "required": false; "isSignal": true; }; "minHour": { "alias": "minHour"; "required": false; "isSignal": true; }; "maxHour": { "alias": "maxHour"; "required": false; "isSignal": true; }; }, { "slotAdded": "slotAdded"; "slotUpdated": "slotUpdated"; "slotRemoved": "slotRemoved"; "slotBooked": "slotBooked"; }, never, never, true, never>;
81
+ }
@@ -0,0 +1,11 @@
1
+ export interface CalendarSlot {
2
+ id: string;
3
+ title?: string;
4
+ start: Date;
5
+ end: Date;
6
+ booked?: boolean;
7
+ bookedBy?: string;
8
+ color?: string;
9
+ }
10
+ export type CalendarView = 'week' | 'month' | 'day';
11
+ export type CalendarMode = 'admin' | 'student' | 'readonly';
@@ -1,18 +1,30 @@
1
- import { AfterViewInit, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { AfterViewChecked, AfterViewInit, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { SwiperContainer } from 'swiper/element/bundle';
3
3
  import * as i0 from "@angular/core";
4
- export declare class CarouselComponent implements AfterViewInit, OnChanges {
4
+ export type CarouselObjectFit = 'cover' | 'contain' | 'fill' | 'scale-down' | 'none';
5
+ export declare class CarouselComponent implements AfterViewInit, AfterViewChecked, OnChanges {
5
6
  pictures: string[];
6
7
  height: number;
7
8
  direction: string;
8
9
  autoplay: boolean;
10
+ objectFit: CarouselObjectFit;
9
11
  swiperRef: ElementRef<SwiperContainer>;
12
+ lightboxBackdrop?: ElementRef<HTMLDivElement>;
10
13
  protected activeIndex: number;
14
+ protected lightboxIndex: number | null;
15
+ private lightboxShouldFocus;
16
+ protected get lightboxOpen(): boolean;
17
+ protected openLightbox(index: number): void;
18
+ ngAfterViewChecked(): void;
19
+ protected closeLightbox(): void;
20
+ protected lightboxPrev(): void;
21
+ protected lightboxNext(): void;
22
+ protected onLightboxKeydown(event: KeyboardEvent): void;
11
23
  ngAfterViewInit(): void;
12
24
  ngOnChanges(changes: SimpleChanges): void;
13
25
  prev(): void;
14
26
  next(): void;
15
27
  goTo(index: number): void;
16
28
  static ɵfac: i0.ɵɵFactoryDeclaration<CarouselComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ud-carousel", never, { "pictures": { "alias": "pictures"; "required": false; }; "height": { "alias": "height"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "autoplay": { "alias": "autoplay"; "required": false; }; }, {}, never, never, true, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<CarouselComponent, "ud-carousel", never, { "pictures": { "alias": "pictures"; "required": false; }; "height": { "alias": "height"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "autoplay": { "alias": "autoplay"; "required": false; }; "objectFit": { "alias": "objectFit"; "required": false; }; }, {}, never, never, true, never>;
18
30
  }
@@ -0,0 +1,23 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
3
+ import { MatChipInputEvent } from '@angular/material/chips';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChipInputComponent implements OnChanges {
6
+ controlName: string;
7
+ label: string;
8
+ placeholder: string;
9
+ icon?: string;
10
+ iconFontSet: string;
11
+ disabled: boolean;
12
+ hint: string;
13
+ focused: boolean;
14
+ readonly separatorKeysCodes: readonly [13, 188];
15
+ private controlContainer;
16
+ get control(): FormControl;
17
+ get chips(): string[];
18
+ ngOnChanges(changes: SimpleChanges): void;
19
+ addChip(event: MatChipInputEvent): void;
20
+ removeChip(index: number): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChipInputComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipInputComponent, "ud-chip-input", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
23
+ }
@@ -2,7 +2,7 @@ import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
3
  import * as i0 from "@angular/core";
4
4
  export interface PillToggleOption {
5
- value: string;
5
+ value: any;
6
6
  label: string;
7
7
  }
8
8
  /**
@@ -25,7 +25,7 @@ export declare class PillToggleComponent implements OnChanges {
25
25
  private controlContainer;
26
26
  ngOnChanges(changes: SimpleChanges): void;
27
27
  get control(): FormControl;
28
- select(value: string): void;
28
+ select(value: any): void;
29
29
  static ɵfac: i0.ɵɵFactoryDeclaration<PillToggleComponent, never>;
30
30
  static ɵcmp: i0.ɵɵComponentDeclaration<PillToggleComponent, "ud-pill-toggle", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
31
31
  }
@@ -1,43 +1,22 @@
1
- import { OnChanges, SimpleChanges } from '@angular/core';
2
- import { FormControl } from '@angular/forms';
3
- import { MatTimepickerOption } from '@angular/material/timepicker';
1
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { UdSelectOption } from '../multi-select/multi-select.component';
4
3
  import * as i0 from "@angular/core";
5
- /**
6
- * Styled time picker that participates in the parent FormGroup.
7
- *
8
- * Usage (interval mode — value is in minutes):
9
- * <ud-time-picker
10
- * controlName="checkInTime"
11
- * label="Check-in time"
12
- * [intervalMinutes]="30" />
13
- *
14
- * Usage (custom options mode):
15
- * <ud-time-picker
16
- * controlName="checkInTime"
17
- * label="Check-in time"
18
- * [options]="timeOptions" />
19
- */
20
- export declare class TimePickerComponent implements OnChanges {
4
+ export declare class TimePickerComponent implements OnInit, OnChanges {
21
5
  controlName: string;
22
6
  label: string;
23
7
  placeholder: string;
24
- icon: string;
25
- iconFontSet: string;
26
- /**
27
- * Minutes between each option in the dropdown (e.g. 30 → every half hour).
28
- * Omit to use Material's default (30 min). Ignored when `options` is provided.
29
- * Internally converted to seconds for mat-timepicker.
30
- */
31
8
  intervalMinutes?: number;
32
- /** Pre-defined list of selectable times. When set, `intervalMinutes` is ignored. */
33
- options?: readonly MatTimepickerOption<Date>[] | null;
9
+ options?: readonly {
10
+ value: Date;
11
+ label?: string;
12
+ }[] | null;
34
13
  disabled: boolean;
35
14
  hint: string;
36
- focused: boolean;
37
- private controlContainer;
38
- get control(): FormControl;
15
+ timeOptions: UdSelectOption[];
16
+ ngOnInit(): void;
39
17
  ngOnChanges(changes: SimpleChanges): void;
40
- get _intervalSeconds(): number | null;
18
+ private buildOptions;
19
+ private formatTime;
41
20
  static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerComponent, never>;
42
- static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "ud-time-picker", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "intervalMinutes": { "alias": "intervalMinutes"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "ud-time-picker", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "intervalMinutes": { "alias": "intervalMinutes"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
43
22
  }
@@ -32,6 +32,7 @@ export declare class ModalComponent {
32
32
  protected currentPictureIndex?: number;
33
33
  data: any;
34
34
  constructor(injectedData: any, dialogRef: MatDialogRef<ModalComponent> | null);
35
+ onDelete(): void;
35
36
  close(): void;
36
37
  onAction(): void;
37
38
  previous(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ud-components",
3
- "version": "0.5.14",
3
+ "version": "0.5.17",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=19",
6
6
  "@angular/common": ">=19",
@@ -21,30 +21,6 @@
21
21
  ".": {
22
22
  "types": "./index.d.ts",
23
23
  "default": "./fesm2022/ud-components.mjs"
24
- },
25
- "./enums/role.enum": {
26
- "types": "./enums/role.enum.d.ts",
27
- "default": "./enums/role.enum.js"
28
- },
29
- "./lib/kpi/kpi.enum": {
30
- "types": "./lib/kpi/kpi.enum.d.ts",
31
- "default": "./lib/kpi/kpi.enum.js"
32
- },
33
- "./lib/edit-view/edit-view-section.directive": {
34
- "types": "./lib/edit-view/edit-view-section.directive.d.ts",
35
- "default": "./lib/edit-view/edit-view-section.directive.js"
36
- },
37
- "./interfaces/page-request.interface": {
38
- "types": "./interfaces/page-request.interface.d.ts",
39
- "default": "./interfaces/page-request.interface.js"
40
- },
41
- "./interfaces/table.interface": {
42
- "types": "./interfaces/table.interface.d.ts",
43
- "default": "./interfaces/table.interface.js"
44
- },
45
- "./interfaces/table-display-column.interface": {
46
- "types": "./interfaces/table-display-column.interface.d.ts",
47
- "default": "./interfaces/table-display-column.interface.js"
48
24
  }
49
25
  }
50
- }
26
+ }
package/public-api.d.ts CHANGED
@@ -25,6 +25,9 @@ export * from './lib/form-fields/pill-toggle/pill-toggle.component';
25
25
  export * from './lib/form-fields/time-picker/time-picker.component';
26
26
  export * from './lib/form-fields/textarea/textarea.component';
27
27
  export * from './lib/form-fields/phone-input/phone-input.component';
28
+ export * from './lib/form-fields/chip-input/chip-input.component';
29
+ export * from './lib/calendar/calendar.component';
30
+ export * from './lib/calendar/calendar.interface';
28
31
  export * from './lib/button/button.component';
29
32
  export * from './lib/button-toggle/button-toggle.component';
30
33
  export * from './lib/preview-container/preview-container.component';