@sixbell-telco/sdk 1.2.0 → 1.3.0
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/CHANGELOG.md +88 -0
- package/README.md +183 -70
- package/_index.css +132 -53
- package/components/data-table/expandable/expandable.component.d.ts +129 -0
- package/components/data-table/index.d.ts +5 -0
- package/components/data-table/public-api.d.ts +7 -0
- package/components/data-table/selection/selection.component.d.ts +41 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +61 -0
- package/components/data-table/src/data-table-context.service.d.ts +18 -0
- package/components/data-table/src/data-table.component.d.ts +158 -0
- package/components/data-table/src/models.d.ts +58 -0
- package/components/data-table/sub-component-toggle/index.d.ts +1 -0
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +12 -0
- package/components/dialog/dialog-title/dialog-title.component.d.ts +4 -0
- package/components/dialog/src/dialog.component.d.ts +22 -8
- package/components/dropdown/dropdown-group/dropdown-group.component.d.ts +1 -1
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +2 -2
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +2 -2
- package/components/forms/datepicker/constants/datepicker.constants.d.ts +5 -0
- package/components/forms/datepicker/public-api.d.ts +2 -1
- package/components/forms/datepicker/src/datepicker.component.d.ts +155 -44
- package/components/forms/datepicker/types/datepicker.types.d.ts +7 -0
- package/components/overlay/index.d.ts +5 -0
- package/components/overlay/overlay-content/overlay-content.component.d.ts +23 -0
- package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +48 -0
- package/components/overlay/public-api.d.ts +3 -0
- package/components/overlay/src/overlay.component.d.ts +158 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +8 -3
- package/components/paginator/pipes/pagination.pipe.d.ts +40 -0
- package/components/paginator/public-api.d.ts +1 -0
- package/components/paginator/src/paginator.component.d.ts +14 -12
- package/components/table/src/table.component.d.ts +9 -6
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +103 -0
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +1091 -0
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +63 -12
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +6 -6
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +12 -10
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -5
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +439 -164
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +408 -0
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +150 -35
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +15 -6
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +154 -0
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs +84 -0
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +3 -4
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +51 -30
- package/utils/date/index.d.ts +5 -0
- package/utils/date/public-api.d.ts +1 -0
- package/utils/date/src/date-utils.d.ts +81 -0
- package/utils/sync/index.d.ts +5 -0
- package/utils/sync/public-api.d.ts +1 -0
- package/utils/sync/src/sync.d.ts +37 -0
- package/utils/translation/public-api.d.ts +3 -4
- package/components/forms/datepicker/src/datepicker-format-month.pipe.d.ts +0 -10
- package/sixbell-telco-sdk-1.2.0.tgz +0 -0
|
@@ -1,54 +1,165 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
1
|
import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
2
|
+
import { OverlayComponent } from '@sixbell-telco/sdk/components/overlay';
|
|
3
|
+
import { DateRange, QuickRangePreset } from '@sixbell-telco/sdk/utils/date';
|
|
4
|
+
import 'cally';
|
|
5
|
+
import { DatePickerValue } from '../types/datepicker.types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
/**
|
|
8
|
+
* DatePicker Component following SOLID principles
|
|
9
|
+
*
|
|
10
|
+
* Responsibilities:
|
|
11
|
+
* - Single Responsibility: Manages date/range selection UI
|
|
12
|
+
* - Open/Closed: Extensible through inputs without modification
|
|
13
|
+
* - Liskov Substitution: Implements ControlValueAccessor contract
|
|
14
|
+
* - Interface Segregation: Focused public API
|
|
15
|
+
* - Dependency Inversion: Uses DateService for date operations
|
|
16
|
+
*/
|
|
17
|
+
export declare class DatepickerComponent implements ControlValueAccessor {
|
|
18
|
+
/** Internal state for single date (ISO format) */
|
|
19
|
+
private readonly _selectedDateValue;
|
|
20
|
+
/** Internal state for date range (ISO format) */
|
|
21
|
+
private readonly _selectedRangeValue;
|
|
22
|
+
/** Disabled state */
|
|
23
|
+
private readonly _disabled;
|
|
24
|
+
/** Flag to prevent concurrent range updates */
|
|
25
|
+
private isUpdatingRange;
|
|
26
|
+
/** Form change callback */
|
|
27
|
+
private onControlChange;
|
|
28
|
+
/** Form touch callback */
|
|
29
|
+
private onControlTouch;
|
|
30
|
+
/** Overlay reference for controlling calendar popup */
|
|
31
|
+
datePickerOverlay: import("@angular/core").Signal<OverlayComponent | undefined>;
|
|
32
|
+
/** Label displayed above the fieldset legend */
|
|
20
33
|
label: import("@angular/core").InputSignal<string>;
|
|
21
|
-
|
|
34
|
+
/** Picker mode (single date or date range) */
|
|
35
|
+
mode: import("@angular/core").InputSignal<"single" | "range">;
|
|
36
|
+
/** Display / parse format */
|
|
37
|
+
format: import("@angular/core").InputSignal<"DD/MM/YYYY" | "MM/DD/YYYY" | "YYYY-MM-DD" | "DD-MM-YYYY" | "MM-DD-YYYY" | "YYYY/MM/DD" | "DD.MM.YYYY" | "MM.DD.YYYY" | "YYYY.MM.DD">;
|
|
38
|
+
/** Locale used by the calendar web component */
|
|
39
|
+
language: import("@angular/core").InputSignal<"en-US" | "en-GB" | "es-ES" | "es-MX" | "fr-FR" | "de-DE" | "it-IT" | "pt-BR" | "pt-PT" | "ja-JP" | "ko-KR" | "zh-CN" | "zh-TW" | "ru-RU" | "ar-SA" | "hi-IN" | "nl-NL" | "sv-SE" | "da-DK" | "no-NO" | "fi-FI" | "pl-PL" | "tr-TR" | "he-IL" | "th-TH" | "vi-VN">;
|
|
40
|
+
/** Optional minimum selectable date */
|
|
22
41
|
minDate: import("@angular/core").InputSignal<string | null>;
|
|
42
|
+
/** Optional maximum selectable date */
|
|
23
43
|
maxDate: import("@angular/core").InputSignal<string | null>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
/** Single date value (external binding) */
|
|
45
|
+
value: import("@angular/core").InputSignal<string>;
|
|
46
|
+
/** Date range value (external binding) */
|
|
47
|
+
rangeValue: import("@angular/core").InputSignal<DateRange | null>;
|
|
48
|
+
/** Name attribute for associated input */
|
|
49
|
+
name: import("@angular/core").InputSignal<string>;
|
|
50
|
+
/** Number of calendars to show in range mode (1 or 2) */
|
|
51
|
+
rangeCalendars: import("@angular/core").InputSignal<1 | 2>;
|
|
52
|
+
/** Whether to show quick action presets in range mode */
|
|
53
|
+
showQuickActions: import("@angular/core").InputSignal<boolean>;
|
|
54
|
+
/** Parent reactive form group (optional) */
|
|
32
55
|
parentForm: import("@angular/core").InputSignal<FormGroup<any> | null>;
|
|
56
|
+
/** Name of the form control inside the parent form (optional) */
|
|
33
57
|
formControlName: import("@angular/core").InputSignal<string>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
/** Emits formatted single date when it changes */
|
|
59
|
+
dateUpdated: import("@angular/core").OutputEmitterRef<string>;
|
|
60
|
+
/** Emits formatted date range when both start & end are selected */
|
|
61
|
+
rangeUpdated: import("@angular/core").OutputEmitterRef<DateRange>;
|
|
62
|
+
/** Emits formatted single date (alias) */
|
|
63
|
+
valueChanged: import("@angular/core").OutputEmitterRef<string>;
|
|
64
|
+
/** Emits formatted date range (alias) */
|
|
65
|
+
rangeValueChanged: import("@angular/core").OutputEmitterRef<DateRange>;
|
|
66
|
+
/** Effective minimum date (input or default 10 years ago) */
|
|
67
|
+
effectiveMinDate: import("@angular/core").Signal<string>;
|
|
68
|
+
/** Effective maximum date (input or default 10 years ahead) */
|
|
69
|
+
effectiveMaxDate: import("@angular/core").Signal<string>;
|
|
70
|
+
/** Locale for calendar components */
|
|
71
|
+
calendarLocale: import("@angular/core").Signal<"en-US" | "en-GB" | "es-ES" | "es-MX" | "fr-FR" | "de-DE" | "it-IT" | "pt-BR" | "pt-PT" | "ja-JP" | "ko-KR" | "zh-CN" | "zh-TW" | "ru-RU" | "ar-SA" | "hi-IN" | "nl-NL" | "sv-SE" | "da-DK" | "no-NO" | "fi-FI" | "pl-PL" | "tr-TR" | "he-IL" | "th-TH" | "vi-VN">;
|
|
72
|
+
/** Computed form field reference */
|
|
73
|
+
formField: import("@angular/core").Signal<FormControl<any> | null>;
|
|
74
|
+
/** Formatted display value for single date */
|
|
75
|
+
selectedDate: import("@angular/core").Signal<string>;
|
|
76
|
+
/** Formatted display value for date range */
|
|
77
|
+
selectedRange: import("@angular/core").Signal<{
|
|
78
|
+
start: string;
|
|
79
|
+
end: string;
|
|
80
|
+
} | null>;
|
|
81
|
+
/** Value for calendar-range component (ISO/ISO format) */
|
|
82
|
+
rangeCalendarValue: import("@angular/core").Signal<string>;
|
|
83
|
+
/** Unified display value for triggers */
|
|
84
|
+
displayValue: import("@angular/core").Signal<string>;
|
|
85
|
+
/** Exposed selected date value (ISO format) for template access */
|
|
86
|
+
selectedDateValue: import("@angular/core").Signal<string>;
|
|
42
87
|
constructor();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
private
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Initialize component values based on inputs
|
|
90
|
+
*/
|
|
91
|
+
private initializeValues;
|
|
92
|
+
/**
|
|
93
|
+
* Set single date value programmatically
|
|
94
|
+
*/
|
|
95
|
+
private setSingleDateValue;
|
|
96
|
+
/**
|
|
97
|
+
* Emit change events and notify form controls
|
|
98
|
+
*/
|
|
99
|
+
private emitChanges;
|
|
100
|
+
/**
|
|
101
|
+
* Close overlay if available
|
|
102
|
+
*/
|
|
103
|
+
private closeOverlay;
|
|
104
|
+
/**
|
|
105
|
+
* Handle calendar change events from Cally components
|
|
106
|
+
*/
|
|
107
|
+
onCalendarChange(calendarElement: HTMLElement): void;
|
|
108
|
+
/**
|
|
109
|
+
* Apply a predefined quick range preset
|
|
110
|
+
*/
|
|
111
|
+
selectQuickRange(preset: QuickRangePreset): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Clear the current range selection
|
|
114
|
+
*/
|
|
115
|
+
clearRange(): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Clear the current single date selection
|
|
118
|
+
*/
|
|
119
|
+
clearDate(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Set range value programmatically
|
|
122
|
+
*/
|
|
123
|
+
private setRangeValue;
|
|
124
|
+
/**
|
|
125
|
+
* Update calendar element value to ensure Cally.js synchronization
|
|
126
|
+
*/
|
|
127
|
+
private updateCalendarElementValue;
|
|
128
|
+
/**
|
|
129
|
+
* Handle single date calendar change
|
|
130
|
+
*/
|
|
131
|
+
private handleSingleCalendarChange;
|
|
132
|
+
/**
|
|
133
|
+
* Handle range calendar change
|
|
134
|
+
*/
|
|
135
|
+
private handleRangeCalendarChange;
|
|
136
|
+
/**
|
|
137
|
+
* Extract date value from calendar element
|
|
138
|
+
*/
|
|
139
|
+
private extractDateValue;
|
|
140
|
+
/**
|
|
141
|
+
* Extract range value from calendar element
|
|
142
|
+
*/
|
|
143
|
+
private extractRangeValue;
|
|
144
|
+
/**
|
|
145
|
+
* Write external model value into the component
|
|
146
|
+
*/
|
|
147
|
+
writeValue(obj: DatePickerValue): void;
|
|
148
|
+
/**
|
|
149
|
+
* Register form change callback
|
|
150
|
+
*/
|
|
151
|
+
registerOnChange(fn: (value: DatePickerValue) => void): void;
|
|
152
|
+
/**
|
|
153
|
+
* Register form touched callback
|
|
154
|
+
*/
|
|
155
|
+
registerOnTouched(fn: () => void): void;
|
|
156
|
+
/**
|
|
157
|
+
* Update disabled state from Angular forms
|
|
158
|
+
*/
|
|
159
|
+
setDisabledState(isDisabled: boolean): void;
|
|
160
|
+
/** Icons for navigation buttons */
|
|
161
|
+
readonly iconChevronLeft = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z\"></path></svg>";
|
|
162
|
+
readonly iconChevronRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z\"></path></svg>";
|
|
51
163
|
static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerComponent, never>;
|
|
52
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerComponent, "st-datepicker",
|
|
164
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerComponent, "st-datepicker", ["stDatepicker"], { "label": { "alias": "label"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "language": { "alias": "language"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "rangeValue": { "alias": "rangeValue"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "rangeCalendars": { "alias": "rangeCalendars"; "required": false; "isSignal": true; }; "showQuickActions": { "alias": "showQuickActions"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; }, { "dateUpdated": "dateUpdated"; "rangeUpdated": "rangeUpdated"; "valueChanged": "valueChanged"; "rangeValueChanged": "rangeValueChanged"; }, never, ["*"], true, never>;
|
|
53
165
|
}
|
|
54
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SUPPORTED_LOCALES } from '../constants/datepicker.constants';
|
|
2
|
+
/** Union type of all supported locale strings for the datepicker. */
|
|
3
|
+
export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Union type for datepicker component values
|
|
6
|
+
*/
|
|
7
|
+
export type DatePickerValue = string | import('@sixbell-telco/sdk/utils/date').DateRange | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* OverlayContent - Content container for overlay
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This component contains the overlay content and provides it as a template
|
|
8
|
+
* for the overlay component to display.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```html
|
|
12
|
+
* <st-overlay-content>
|
|
13
|
+
* <div class="p-4 bg-base-100 rounded-box shadow-lg">
|
|
14
|
+
* Your custom content here
|
|
15
|
+
* </div>
|
|
16
|
+
* </st-overlay-content>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class OverlayContentComponent {
|
|
20
|
+
template: TemplateRef<unknown>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayContentComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayContentComponent, "st-overlay-content", never, {}, {}, never, ["*"], true, never>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
2
|
+
import { ElementRef } from '@angular/core';
|
|
3
|
+
import { OverlayComponent } from '../src/overlay.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* OverlayTrigger - Trigger component for overlay positioning
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This component acts as the trigger that opens/closes the overlay content.
|
|
10
|
+
* It can contain any content (buttons, inputs, avatars, text, icons, etc.).
|
|
11
|
+
* Uses CdkOverlayOrigin for positioning reference.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <st-overlay>
|
|
16
|
+
* <st-overlay-trigger>
|
|
17
|
+
* <button class="btn btn-primary">Open Overlay</button>
|
|
18
|
+
* </st-overlay-trigger>
|
|
19
|
+
* <st-overlay-content>
|
|
20
|
+
* <div>Your content</div>
|
|
21
|
+
* </st-overlay-content>
|
|
22
|
+
* </st-overlay>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class OverlayTriggerComponent {
|
|
26
|
+
overlayOrigin: CdkOverlayOrigin;
|
|
27
|
+
private overlayComponent;
|
|
28
|
+
private readonly elementRef;
|
|
29
|
+
constructor(elementRef: ElementRef);
|
|
30
|
+
/**
|
|
31
|
+
* Set the parent overlay component reference
|
|
32
|
+
*/
|
|
33
|
+
setOverlayComponent(overlay: OverlayComponent): void;
|
|
34
|
+
/**
|
|
35
|
+
* Handle click events to toggle the overlay
|
|
36
|
+
*/
|
|
37
|
+
onClick(event: Event): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get the overlay origin element
|
|
40
|
+
*/
|
|
41
|
+
get triggerElement(): CdkOverlayOrigin;
|
|
42
|
+
/**
|
|
43
|
+
* Get the native DOM element for width calculations
|
|
44
|
+
*/
|
|
45
|
+
get nativeElement(): HTMLElement;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayTriggerComponent, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayTriggerComponent, "st-overlay-trigger", never, {}, {}, never, ["*"], true, never>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ConnectedOverlayPositionChange, ConnectedPosition } from '@angular/cdk/overlay';
|
|
2
|
+
import { AfterContentInit } from '@angular/core';
|
|
3
|
+
import { OverlayContentComponent } from '../overlay-content/overlay-content.component';
|
|
4
|
+
import { OverlayTriggerComponent } from '../overlay-trigger/overlay-trigger.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/** Overlay X position options for CDK overlay positioning */
|
|
7
|
+
export type OverlayXPosition = 'start' | 'center' | 'end';
|
|
8
|
+
/** Overlay Y position options for CDK overlay positioning */
|
|
9
|
+
export type OverlayYPosition = 'top' | 'bottom' | 'center';
|
|
10
|
+
/** Overlay fallback position configuration */
|
|
11
|
+
export interface OverlayFallbackPositions {
|
|
12
|
+
/** Enable automatic fallback positions */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
/** Custom fallback positions - if not provided, default fallbacks will be used */
|
|
15
|
+
positions?: ConnectedPosition[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Overlay - Shell component for creating custom overlays with positioning
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* This component provides the infrastructure for creating custom overlays with proper positioning,
|
|
22
|
+
* accessibility, and animation support. It's designed to be used as a shell where the consumer
|
|
23
|
+
* has full control over the trigger and content styling.
|
|
24
|
+
*
|
|
25
|
+
* The overlay is controlled through methods: Use `open()`, `close()`, and `toggle()` methods programmatically
|
|
26
|
+
* via template reference variables.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```html
|
|
30
|
+
* <!-- Basic usage -->
|
|
31
|
+
* <st-overlay>
|
|
32
|
+
* <st-overlay-trigger>
|
|
33
|
+
* <button>Trigger</button>
|
|
34
|
+
* </st-overlay-trigger>
|
|
35
|
+
* <st-overlay-content>
|
|
36
|
+
* <div>Content</div>
|
|
37
|
+
* </st-overlay-content>
|
|
38
|
+
* </st-overlay>
|
|
39
|
+
*
|
|
40
|
+
* <!-- Using methods for programmatic control -->
|
|
41
|
+
* <st-overlay #overlay="stOverlay">
|
|
42
|
+
* <st-overlay-trigger>
|
|
43
|
+
* <button>Trigger</button>
|
|
44
|
+
* </st-overlay-trigger>
|
|
45
|
+
* <st-overlay-content>
|
|
46
|
+
* <div>Content</div>
|
|
47
|
+
* <button (click)="overlay.close()">Close</button>
|
|
48
|
+
* </st-overlay-content>
|
|
49
|
+
* </st-overlay-content>
|
|
50
|
+
* </st-overlay>
|
|
51
|
+
* <button (click)="overlay.open()">Open</button>
|
|
52
|
+
* <button (click)="overlay.close()">Close</button>
|
|
53
|
+
*
|
|
54
|
+
* <!-- Using width sync for dropdowns/selects -->
|
|
55
|
+
* <st-overlay [syncWidth]="true">
|
|
56
|
+
* <st-overlay-trigger>
|
|
57
|
+
* <button class="w-64">Trigger with specific width</button>
|
|
58
|
+
* </st-overlay-trigger>
|
|
59
|
+
* <st-overlay-content>
|
|
60
|
+
* <div>Content will match trigger width</div>
|
|
61
|
+
* </st-overlay-content>
|
|
62
|
+
* </st-overlay>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare class OverlayComponent implements AfterContentInit {
|
|
66
|
+
trigger: OverlayTriggerComponent;
|
|
67
|
+
content: OverlayContentComponent;
|
|
68
|
+
/** Offset X in pixels */
|
|
69
|
+
offsetX: import("@angular/core").InputSignal<number>;
|
|
70
|
+
/** Offset Y in pixels */
|
|
71
|
+
offsetY: import("@angular/core").InputSignal<number>;
|
|
72
|
+
/** Origin X position */
|
|
73
|
+
originX: import("@angular/core").InputSignal<OverlayXPosition>;
|
|
74
|
+
/** Origin Y position */
|
|
75
|
+
originY: import("@angular/core").InputSignal<OverlayYPosition>;
|
|
76
|
+
/** Overlay X position */
|
|
77
|
+
overlayX: import("@angular/core").InputSignal<OverlayXPosition>;
|
|
78
|
+
/** Overlay Y position */
|
|
79
|
+
overlayY: import("@angular/core").InputSignal<OverlayYPosition>;
|
|
80
|
+
/** Fallback positions configuration */
|
|
81
|
+
fallbacks: import("@angular/core").InputSignal<OverlayFallbackPositions>;
|
|
82
|
+
/** Whether to sync the overlay content width with the trigger width */
|
|
83
|
+
syncWidth: import("@angular/core").InputSignal<boolean>;
|
|
84
|
+
/** Internal signal to track overlay state */
|
|
85
|
+
readonly _isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
86
|
+
/** Internal signal to track the synced width */
|
|
87
|
+
readonly _syncedWidth: import("@angular/core").WritableSignal<string | null>;
|
|
88
|
+
/** Current active position configuration */
|
|
89
|
+
currentPosition: import("@angular/core").WritableSignal<ConnectedPosition | null>;
|
|
90
|
+
/** Event emitted when overlay is opened */
|
|
91
|
+
opened: import("@angular/core").OutputEmitterRef<void>;
|
|
92
|
+
/** Event emitted when overlay is closed */
|
|
93
|
+
closed: import("@angular/core").OutputEmitterRef<void>;
|
|
94
|
+
constructor();
|
|
95
|
+
ngAfterContentInit(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Computed positions array based on signal inputs
|
|
98
|
+
*/
|
|
99
|
+
positions: import("@angular/core").Signal<ConnectedPosition[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Generate default fallback positions based on the primary position
|
|
102
|
+
*/
|
|
103
|
+
private generateDefaultFallbacks;
|
|
104
|
+
/**
|
|
105
|
+
* Helper to flip Y position
|
|
106
|
+
*/
|
|
107
|
+
private getOppositeY;
|
|
108
|
+
/**
|
|
109
|
+
* Helper to flip X position
|
|
110
|
+
*/
|
|
111
|
+
private getOppositeX;
|
|
112
|
+
/**
|
|
113
|
+
* Helper to create position variant
|
|
114
|
+
*/
|
|
115
|
+
private createPosition;
|
|
116
|
+
/**
|
|
117
|
+
* Add axis flip fallbacks
|
|
118
|
+
*/
|
|
119
|
+
private addAxisFlips;
|
|
120
|
+
/**
|
|
121
|
+
* Add standard overlay positions
|
|
122
|
+
*/
|
|
123
|
+
private addStandardPositions;
|
|
124
|
+
/**
|
|
125
|
+
* Check if position is duplicate
|
|
126
|
+
*/
|
|
127
|
+
private isPositionDuplicate;
|
|
128
|
+
/**
|
|
129
|
+
* Open the overlay
|
|
130
|
+
*/
|
|
131
|
+
open(): void;
|
|
132
|
+
/**
|
|
133
|
+
* Close the overlay
|
|
134
|
+
*/
|
|
135
|
+
close(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Toggle the overlay open/close state
|
|
138
|
+
*/
|
|
139
|
+
toggle(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Update the synced width based on trigger element width
|
|
142
|
+
*/
|
|
143
|
+
private updateSyncedWidth;
|
|
144
|
+
/**
|
|
145
|
+
* Handle position changes from CDK overlay
|
|
146
|
+
*/
|
|
147
|
+
onPositionChange(position: ConnectedOverlayPositionChange): void;
|
|
148
|
+
/**
|
|
149
|
+
* Handle click outside to close overlay
|
|
150
|
+
*/
|
|
151
|
+
onClickOutside(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Handle window resize to update synced width
|
|
154
|
+
*/
|
|
155
|
+
onWindowResize(): void;
|
|
156
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayComponent, never>;
|
|
157
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayComponent, "st-overlay", ["stOverlay"], { "offsetX": { "alias": "offsetX"; "required": false; "isSignal": true; }; "offsetY": { "alias": "offsetY"; "required": false; "isSignal": true; }; "originX": { "alias": "originX"; "required": false; "isSignal": true; }; "originY": { "alias": "originY"; "required": false; "isSignal": true; }; "overlayX": { "alias": "overlayX"; "required": false; "isSignal": true; }; "overlayY": { "alias": "overlayY"; "required": false; "isSignal": true; }; "fallbacks": { "alias": "fallbacks"; "required": false; "isSignal": true; }; "syncWidth": { "alias": "syncWidth"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, ["trigger", "content"], ["st-overlay-trigger"], true, never>;
|
|
158
|
+
}
|
|
@@ -4,10 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
* Generates base pagination item classes with style variants
|
|
5
5
|
*/
|
|
6
6
|
export declare const paginationItemComponent: (props?: ({
|
|
7
|
-
variant?: "numeric" | "icon" | "dots" | null | undefined;
|
|
7
|
+
variant?: "numeric" | "icon" | "dots" | "ellipsis" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
/** Possible pagination item style variants */
|
|
10
|
-
export type PaginationItemVariantProps = 'numeric' | 'icon' | 'dots' | null | undefined;
|
|
10
|
+
export type PaginationItemVariantProps = 'numeric' | 'icon' | 'dots' | 'ellipsis' | null | undefined;
|
|
11
11
|
/** Configuration object for pagination item styling */
|
|
12
12
|
export type PaginationItemProps = {
|
|
13
13
|
variant?: PaginationItemVariantProps;
|
|
@@ -69,11 +69,16 @@ export declare class PaginationItemComponent {
|
|
|
69
69
|
* @defaultValue false
|
|
70
70
|
*/
|
|
71
71
|
active: import("@angular/core").InputSignal<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Disabled state styling
|
|
74
|
+
* @defaultValue false
|
|
75
|
+
*/
|
|
76
|
+
disabled: import("@angular/core").InputSignal<boolean>;
|
|
72
77
|
/**
|
|
73
78
|
* @internal
|
|
74
79
|
* Computed class string for the pagination item
|
|
75
80
|
*/
|
|
76
81
|
componentClass: import("@angular/core").Signal<string>;
|
|
77
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationItemComponent, never>;
|
|
78
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationItemComponent, "st-pagination-item", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "number": { "alias": "number"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
83
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationItemComponent, "st-pagination-item", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "number": { "alias": "number"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
79
84
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export type Pagination = {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
itemsPerPage: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A pipe to manually paginate an array of items.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This pipe takes an array and a pagination configuration object (currentPage, itemsPerPage)
|
|
12
|
+
* and returns a sliced version of the array, representing the items for the current page.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* @for (item of items | pagination: { currentPage: 2, itemsPerPage: 10 }; track item.id) {
|
|
17
|
+
* <li>{{ item.name }}</li>
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class PaginationPipe implements PipeTransform {
|
|
22
|
+
transform<T>(items: T[], pagination: {
|
|
23
|
+
currentPage: number;
|
|
24
|
+
itemsPerPage: number;
|
|
25
|
+
}): T[];
|
|
26
|
+
transform<T>(items: T[] | null, pagination: {
|
|
27
|
+
currentPage: number;
|
|
28
|
+
itemsPerPage: number;
|
|
29
|
+
}): T[] | null;
|
|
30
|
+
transform<T>(items: T[] | undefined, pagination: {
|
|
31
|
+
currentPage: number;
|
|
32
|
+
itemsPerPage: number;
|
|
33
|
+
}): T[] | undefined;
|
|
34
|
+
transform<T>(items: T[] | null | undefined, pagination: {
|
|
35
|
+
currentPage: number;
|
|
36
|
+
itemsPerPage: number;
|
|
37
|
+
}): T[] | null | undefined;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationPipe, never>;
|
|
39
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<PaginationPipe, "paginate", true>;
|
|
40
|
+
}
|
|
@@ -6,8 +6,7 @@ export type PaginationType = 'default' | 'dots';
|
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Supports both traditional numbered pagination and dot indicators.
|
|
9
|
-
*
|
|
10
|
-
* custom styling and navigation controls.
|
|
9
|
+
* Provides custom styling and navigation controls.
|
|
11
10
|
*
|
|
12
11
|
* @example
|
|
13
12
|
* ```html
|
|
@@ -34,8 +33,9 @@ export declare class PaginatorComponent {
|
|
|
34
33
|
*/
|
|
35
34
|
paginatorId: import("@angular/core").InputSignal<string>;
|
|
36
35
|
/**
|
|
37
|
-
* Maximum number of visible page items
|
|
38
|
-
*
|
|
36
|
+
* Maximum number of visible numeric page items (excluding arrows and ellipses).
|
|
37
|
+
* This controls the window of page numbers shown around the current page.
|
|
38
|
+
* @defaultValue 4
|
|
39
39
|
*/
|
|
40
40
|
maxSize: import("@angular/core").InputSignal<number>;
|
|
41
41
|
/**
|
|
@@ -53,12 +53,7 @@ export declare class PaginatorComponent {
|
|
|
53
53
|
*/
|
|
54
54
|
pages: import("@angular/core").InputSignal<number>;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
* Computed array of page numbers
|
|
58
|
-
*/
|
|
59
|
-
pageCounter: import("@angular/core").Signal<number[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Current active page
|
|
56
|
+
* Current active page (1-based)
|
|
62
57
|
* @defaultValue 1
|
|
63
58
|
*/
|
|
64
59
|
currentPage: import("@angular/core").ModelSignal<number>;
|
|
@@ -82,12 +77,19 @@ export declare class PaginatorComponent {
|
|
|
82
77
|
* Double right arrow icon reference
|
|
83
78
|
*/
|
|
84
79
|
iconDoubleArrowRight: string;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* Computed array of page numbers and ellipses for display.
|
|
83
|
+
* Implements the logic to show a limited range of pages around the current page
|
|
84
|
+
* with '...' for skipped pages.
|
|
85
|
+
*/
|
|
86
|
+
pageNumbersForDisplay: import("@angular/core").Signal<(string | number)[]>;
|
|
85
87
|
/**
|
|
86
88
|
* @internal
|
|
87
89
|
* Handles page navigation changes
|
|
88
|
-
* @param page - New page number
|
|
90
|
+
* @param page - New page number (or '...' if clicked on ellipsis, which is ignored)
|
|
89
91
|
*/
|
|
90
|
-
handlePageChange(page: number): void;
|
|
92
|
+
handlePageChange(page: number | string): void;
|
|
91
93
|
/**
|
|
92
94
|
* @internal
|
|
93
95
|
* Navigates to previous page if available
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Pagination, PaginationType } from '@sixbell-telco/sdk/components/paginator';
|
|
1
2
|
import { TypographyVariantProps } from '@sixbell-telco/sdk/directives/typography';
|
|
2
3
|
import { TableHeaderCheckboxComponent } from '../table-header-checkbox/table-header-checkbox.component';
|
|
3
4
|
import { TableRowCheckboxComponent } from '../table-row-checkbox/table-row-checkbox.component';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/** Type definition for pagination display variants */
|
|
6
|
-
export type PaginationType = 'default' | 'dots';
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
* Generates base table classes with size variants
|
|
@@ -33,12 +33,10 @@ export type TableVariantProps = {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const tableComponent: ({ size, containerHeight }?: TableVariantProps) => string;
|
|
35
35
|
/** Pagination configuration structure */
|
|
36
|
-
export
|
|
36
|
+
export interface TablePagination extends Pagination {
|
|
37
37
|
id: string;
|
|
38
|
-
currentPage: number;
|
|
39
|
-
itemsPerPage: number;
|
|
40
38
|
search: string;
|
|
41
|
-
}
|
|
39
|
+
}
|
|
42
40
|
/**
|
|
43
41
|
* A feature-rich data table component with sorting, pagination, and row selection
|
|
44
42
|
*
|
|
@@ -111,7 +109,7 @@ export declare class TableComponent {
|
|
|
111
109
|
pagination: import("@angular/core").InputSignal<TablePagination>;
|
|
112
110
|
/**
|
|
113
111
|
* Maximum number of pagination buttons to display
|
|
114
|
-
* @defaultValue
|
|
112
|
+
* @defaultValue 4
|
|
115
113
|
*/
|
|
116
114
|
maxSize: import("@angular/core").InputSignal<number>;
|
|
117
115
|
/** Event emitted when page changes */
|
|
@@ -144,6 +142,11 @@ export declare class TableComponent {
|
|
|
144
142
|
* @defaultValue false
|
|
145
143
|
*/
|
|
146
144
|
allowHeaderOverflow: import("@angular/core").InputSignal<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* Computed total number of pages for the internal paginator.
|
|
147
|
+
* Calculated from totalItems and itemsPerPage.
|
|
148
|
+
*/
|
|
149
|
+
readonly totalPages: import("@angular/core").Signal<number>;
|
|
147
150
|
/**
|
|
148
151
|
* Computed display range for current page entries
|
|
149
152
|
* @example "1-10" of 100 entries
|