@sixbell-telco/sdk 1.2.1 → 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 +60 -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/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-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/package.json +56 -35
- 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/components/forms/datepicker/src/datepicker-format-month.pipe.d.ts +0 -10
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { PaginationType } from '@sixbell-telco/sdk/components/paginator';
|
|
2
|
+
import { TableContainerHeightProps, TableContentSizeProps } from '@sixbell-telco/sdk/components/table';
|
|
3
|
+
import { TypographyVariantProps } from '@sixbell-telco/sdk/directives/typography';
|
|
4
|
+
import { TranslateService } from '@sixbell-telco/sdk/utils/translation';
|
|
5
|
+
import { DataTableContextService } from './data-table-context.service';
|
|
6
|
+
import { DataTablePagination } from './models';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/** Configuration object for data table styling variants */
|
|
9
|
+
export type DataTableVariantProps = {
|
|
10
|
+
size?: TableContentSizeProps;
|
|
11
|
+
containerHeight?: TableContainerHeightProps;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
* Generates data table classes with size and height variants
|
|
16
|
+
*/
|
|
17
|
+
export declare const dataTableContent: (props?: ({
|
|
18
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
/**
|
|
21
|
+
* A styled container component for data tables - provides styling shell only
|
|
22
|
+
*
|
|
23
|
+
* This component is similar to st-table but with additional data table specific styling.
|
|
24
|
+
* Users should compose their own table structure using TanStack Table and SDK components.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```html
|
|
28
|
+
* <st-data-table-container size="md" height="lg">
|
|
29
|
+
* <table>
|
|
30
|
+
* <thead>
|
|
31
|
+
* <tr>
|
|
32
|
+
* <th><st-data-table-sortable-header>Name</st-data-table-sortable-header></th>
|
|
33
|
+
* </tr>
|
|
34
|
+
* </thead>
|
|
35
|
+
* <tbody>
|
|
36
|
+
* <tr>
|
|
37
|
+
* <td>John Doe</td>
|
|
38
|
+
* </tr>
|
|
39
|
+
* </tbody>
|
|
40
|
+
* </table>
|
|
41
|
+
* </st-data-table-container>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class DataTableContainerComponent {
|
|
45
|
+
readonly translationService: TranslateService;
|
|
46
|
+
readonly dataTableContext: DataTableContextService;
|
|
47
|
+
readonly noDataIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\"></path></svg>";
|
|
48
|
+
readonly noResultsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" style=\"stroke-width:var(--ng-icon__stroke-width, 1.5)\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"></path></svg>";
|
|
49
|
+
/**
|
|
50
|
+
* Table size variant
|
|
51
|
+
* @defaultValue 'sm'
|
|
52
|
+
*/
|
|
53
|
+
size: import("@angular/core").InputSignal<TableContentSizeProps>;
|
|
54
|
+
constructor();
|
|
55
|
+
/**
|
|
56
|
+
* Enable sticky header row
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
pinRows: import("@angular/core").InputSignal<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Enable sticky first column
|
|
62
|
+
* @defaultValue false
|
|
63
|
+
*/
|
|
64
|
+
pinColumns: import("@angular/core").InputSignal<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Apply zebra-striping to rows
|
|
67
|
+
* @defaultValue false
|
|
68
|
+
*/
|
|
69
|
+
zebra: import("@angular/core").InputSignal<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Pagination control display variant
|
|
72
|
+
* @defaultValue 'default'
|
|
73
|
+
*/
|
|
74
|
+
paginatorType: import("@angular/core").InputSignal<PaginationType>;
|
|
75
|
+
/**
|
|
76
|
+
* Total number of items across all pages
|
|
77
|
+
* @defaultValue 0
|
|
78
|
+
*/
|
|
79
|
+
totalItems: import("@angular/core").InputSignal<number>;
|
|
80
|
+
/**
|
|
81
|
+
* Pagination configuration
|
|
82
|
+
* @defaultValue { id: 'paginator', currentPage: 1, itemsPerPage: 10, search: '', sortColumn: null, sortDirection: null, filters: {} }
|
|
83
|
+
*/
|
|
84
|
+
pagination: import("@angular/core").InputSignal<DataTablePagination>;
|
|
85
|
+
/**
|
|
86
|
+
* Maximum number of pagination buttons to display
|
|
87
|
+
* @defaultValue 4
|
|
88
|
+
*/
|
|
89
|
+
maxSize: import("@angular/core").InputSignal<number>;
|
|
90
|
+
/** Event emitted when page changes */
|
|
91
|
+
pageChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
92
|
+
/** Event emitted when page size changes */
|
|
93
|
+
pageSizeChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
94
|
+
readonly ENTRIES: readonly [5, 10, 20, 50, 100];
|
|
95
|
+
readonly entriesPerPageOptions: import("@angular/core").Signal<{
|
|
96
|
+
value: 10 | 5 | 20 | 50 | 100;
|
|
97
|
+
text: any;
|
|
98
|
+
}[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Computed total number of pages for the internal paginator.
|
|
101
|
+
* Calculated from totalItems and itemsPerPage.
|
|
102
|
+
*/
|
|
103
|
+
readonly totalPages: import("@angular/core").Signal<number>;
|
|
104
|
+
/**
|
|
105
|
+
* Computed display range for current page entries
|
|
106
|
+
* @example "1-10" of 100 entries
|
|
107
|
+
*/
|
|
108
|
+
paginationRange: import("@angular/core").Signal<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Function to determine if any filters are currently active
|
|
111
|
+
* This allows the parent component to define what constitutes an "active filter"
|
|
112
|
+
*/
|
|
113
|
+
hasActiveFiltersCallback: import("@angular/core").InputSignal<(() => boolean) | undefined>;
|
|
114
|
+
/**
|
|
115
|
+
* Computed boolean indicating if any filters are currently active
|
|
116
|
+
*/
|
|
117
|
+
readonly hasActiveFilters: import("@angular/core").Signal<boolean>;
|
|
118
|
+
/**
|
|
119
|
+
* Computed boolean indicating if we should show "no results" vs "no data"
|
|
120
|
+
*/
|
|
121
|
+
readonly hasNoResults: import("@angular/core").Signal<boolean>;
|
|
122
|
+
/**
|
|
123
|
+
* Computed boolean indicating if we should show "no data" state
|
|
124
|
+
*/
|
|
125
|
+
readonly hasNoData: import("@angular/core").Signal<boolean>;
|
|
126
|
+
/**
|
|
127
|
+
* Handles page navigation events
|
|
128
|
+
* @param page - New page number
|
|
129
|
+
*/
|
|
130
|
+
handlePageChange(page: number): void;
|
|
131
|
+
/**
|
|
132
|
+
* Handles page size changes
|
|
133
|
+
* @param size - New items per page value
|
|
134
|
+
*/
|
|
135
|
+
handlePageSizeChange(size: unknown): void;
|
|
136
|
+
/**
|
|
137
|
+
* @internal
|
|
138
|
+
* Computes typography variant for paginator text based on table size
|
|
139
|
+
*/
|
|
140
|
+
readonly paginatorTextSize: import("@angular/core").Signal<TypographyVariantProps>;
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
* Computes table element classes based on current configuration
|
|
144
|
+
*/
|
|
145
|
+
readonly tableClass: import("@angular/core").Signal<string>;
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
* Computes table container classes based on height input
|
|
149
|
+
*/
|
|
150
|
+
readonly tableContainerClass: import("@angular/core").Signal<string>;
|
|
151
|
+
/**
|
|
152
|
+
* @internal
|
|
153
|
+
* Computes outer container classes based on size
|
|
154
|
+
*/
|
|
155
|
+
readonly containerClass: import("@angular/core").Signal<string>;
|
|
156
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataTableContainerComponent, never>;
|
|
157
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableContainerComponent, "st-data-table", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "pinRows": { "alias": "pinRows"; "required": false; "isSignal": true; }; "pinColumns": { "alias": "pinColumns"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "paginatorType": { "alias": "paginatorType"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "hasActiveFiltersCallback": { "alias": "hasActiveFiltersCallback"; "required": false; "isSignal": true; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; }, never, ["*"], true, never>;
|
|
158
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface FilterOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PaginatedFilterOptions {
|
|
6
|
+
results: FilterOption[];
|
|
7
|
+
total: number;
|
|
8
|
+
hasMore: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type FilterType = 'text' | 'numberRange' | 'multiSelect' | 'multiSelectCombobox';
|
|
11
|
+
export interface FilterMetadataBase {
|
|
12
|
+
type: FilterType;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TextFilterMetadata extends FilterMetadataBase {
|
|
16
|
+
type: 'text';
|
|
17
|
+
}
|
|
18
|
+
export interface NumberRangeFilterMetadata extends FilterMetadataBase {
|
|
19
|
+
type: 'numberRange';
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MultiSelectFilterMetadata extends FilterMetadataBase {
|
|
24
|
+
type: 'multiSelect';
|
|
25
|
+
options: FilterOption[];
|
|
26
|
+
searchable?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface MultiSelectComboboxFilterMetadata extends FilterMetadataBase {
|
|
29
|
+
type: 'multiSelectCombobox';
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
}
|
|
32
|
+
export type FilterMetadata = TextFilterMetadata | NumberRangeFilterMetadata | MultiSelectFilterMetadata | MultiSelectComboboxFilterMetadata;
|
|
33
|
+
export type AllFilterMetadata = Record<string, FilterMetadata>;
|
|
34
|
+
export interface TextFilterState {
|
|
35
|
+
value: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface NumberRangeFilterState {
|
|
38
|
+
min: number | null;
|
|
39
|
+
max: number | null;
|
|
40
|
+
}
|
|
41
|
+
export interface MultiSelectFilterState {
|
|
42
|
+
values: string[];
|
|
43
|
+
}
|
|
44
|
+
export type ColumnFilterState = TextFilterState | NumberRangeFilterState | MultiSelectFilterState;
|
|
45
|
+
export type FiltersState = Record<string, ColumnFilterState>;
|
|
46
|
+
export interface DataTablePagination {
|
|
47
|
+
id: string;
|
|
48
|
+
currentPage: number;
|
|
49
|
+
itemsPerPage: number;
|
|
50
|
+
search: string;
|
|
51
|
+
sortColumn: string | null;
|
|
52
|
+
sortDirection: 'asc' | 'desc' | null;
|
|
53
|
+
filters: FiltersState;
|
|
54
|
+
}
|
|
55
|
+
export interface BackendPagination<T> {
|
|
56
|
+
total: number;
|
|
57
|
+
results: T[];
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sub-component-toggle.component';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Row, RowData } from '@tanstack/angular-table';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DataTableSubComponentToggleCellComponent<T extends RowData> {
|
|
4
|
+
readonly row: import("@angular/core").InputSignal<Row<T>>;
|
|
5
|
+
readonly isExpanded: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
readonly toggled: import("@angular/core").OutputEmitterRef<string>;
|
|
7
|
+
readonly canToggleSubComponent: import("@angular/core").InputSignal<boolean>;
|
|
8
|
+
readonly iconChevronDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z\"></path></svg>";
|
|
9
|
+
readonly iconInfo = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"></path></svg>";
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataTableSubComponentToggleCellComponent<any>, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableSubComponentToggleCellComponent<any>, "st-data-table-sub-component-toggle-cell", never, { "row": { "alias": "row"; "required": true; "isSignal": true; }; "isExpanded": { "alias": "isExpanded"; "required": true; "isSignal": true; }; "canToggleSubComponent": { "alias": "canToggleSubComponent"; "required": false; "isSignal": true; }; }, { "toggled": "toggled"; }, never, never, true, never>;
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
/**
|
|
3
3
|
* DropdownGroup - Groups related dropdown items together
|
|
4
|
-
* Provides semantic grouping for dropdown items
|
|
4
|
+
* Provides semantic grouping for dropdown items without rendering a wrapper element
|
|
5
5
|
*/
|
|
6
6
|
export declare class DropdownGroupComponent {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownGroupComponent, never>;
|
|
@@ -27,7 +27,7 @@ export declare class DropdownItemCheckboxComponent {
|
|
|
27
27
|
/**
|
|
28
28
|
* Emitted when the checkbox state changes
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
checkedChanged: import("@angular/core").OutputEmitterRef<boolean>;
|
|
31
31
|
/**
|
|
32
32
|
* Emitted when the menu item is triggered/clicked
|
|
33
33
|
*/
|
|
@@ -45,5 +45,5 @@ export declare class DropdownItemCheckboxComponent {
|
|
|
45
45
|
*/
|
|
46
46
|
itemClass: () => string;
|
|
47
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownItemCheckboxComponent, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownItemCheckboxComponent, "st-dropdown-item-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownItemCheckboxComponent, "st-dropdown-item-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "checkedChanged": "checkedChanged"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
49
49
|
}
|
|
@@ -31,7 +31,7 @@ export declare class DropdownItemRadioComponent {
|
|
|
31
31
|
/**
|
|
32
32
|
* Emitted when the radio state changes
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
checkedChanged: import("@angular/core").OutputEmitterRef<string>;
|
|
35
35
|
/**
|
|
36
36
|
* Emitted when the menu item is triggered/clicked
|
|
37
37
|
*/
|
|
@@ -49,5 +49,5 @@ export declare class DropdownItemRadioComponent {
|
|
|
49
49
|
*/
|
|
50
50
|
itemClass: () => string;
|
|
51
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownItemRadioComponent, never>;
|
|
52
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownItemRadioComponent, "st-dropdown-item-radio", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownItemRadioComponent, "st-dropdown-item-radio", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "checkedChanged": "checkedChanged"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
53
53
|
}
|
|
@@ -32,7 +32,7 @@ export declare class DropdownMenuBarItemCheckboxComponent {
|
|
|
32
32
|
/**
|
|
33
33
|
* Emitted when the checkbox state changes
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
checkedChanged: import("@angular/core").OutputEmitterRef<boolean>;
|
|
36
36
|
/**
|
|
37
37
|
* Emitted when the menu item is triggered/clicked
|
|
38
38
|
*/
|
|
@@ -50,5 +50,5 @@ export declare class DropdownMenuBarItemCheckboxComponent {
|
|
|
50
50
|
*/
|
|
51
51
|
itemClass: () => string;
|
|
52
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenuBarItemCheckboxComponent, never>;
|
|
53
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemCheckboxComponent, "st-dropdown-menu-bar-item-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemCheckboxComponent, "st-dropdown-menu-bar-item-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "checkedChanged": "checkedChanged"; "triggered": "triggered"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemCheckbox; inputs: { "cdkMenuItemChecked": "checked"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
54
54
|
}
|
|
@@ -32,7 +32,7 @@ export declare class DropdownMenuBarItemRadioComponent {
|
|
|
32
32
|
/**
|
|
33
33
|
* Emitted when the radio state changes
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
checkedChanged: import("@angular/core").OutputEmitterRef<string>;
|
|
36
36
|
/**
|
|
37
37
|
* Emitted when the menu item is triggered/clicked
|
|
38
38
|
*/
|
|
@@ -54,5 +54,5 @@ export declare class DropdownMenuBarItemRadioComponent {
|
|
|
54
54
|
*/
|
|
55
55
|
itemClass: () => string;
|
|
56
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenuBarItemRadioComponent, never>;
|
|
57
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemRadioComponent, "st-dropdown-menu-bar-item-radio", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemRadioComponent, "st-dropdown-menu-bar-item-radio", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "showIndicator": { "alias": "showIndicator"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "checkedChanged": "checkedChanged"; "triggered": "triggered"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemRadio; inputs: { "cdkMenuItemChecked": "checked"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
58
58
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported locales (BCP 47) for the date picker.
|
|
3
|
+
* These map directly to the underlying calendar web component locale attribute.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORTED_LOCALES: readonly ["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"];
|
|
@@ -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
|
+
}
|