@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.
Files changed (66) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +183 -70
  3. package/_index.css +132 -53
  4. package/components/data-table/expandable/expandable.component.d.ts +129 -0
  5. package/components/data-table/index.d.ts +5 -0
  6. package/components/data-table/public-api.d.ts +7 -0
  7. package/components/data-table/selection/selection.component.d.ts +41 -0
  8. package/components/data-table/sortable-header/sortable-header.component.d.ts +61 -0
  9. package/components/data-table/src/data-table-context.service.d.ts +18 -0
  10. package/components/data-table/src/data-table.component.d.ts +158 -0
  11. package/components/data-table/src/models.d.ts +58 -0
  12. package/components/data-table/sub-component-toggle/index.d.ts +1 -0
  13. package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +12 -0
  14. package/components/dropdown/dropdown-group/dropdown-group.component.d.ts +1 -1
  15. package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +2 -2
  16. package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +2 -2
  17. package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +2 -2
  18. package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +2 -2
  19. package/components/forms/datepicker/constants/datepicker.constants.d.ts +5 -0
  20. package/components/forms/datepicker/public-api.d.ts +2 -1
  21. package/components/forms/datepicker/src/datepicker.component.d.ts +155 -44
  22. package/components/forms/datepicker/types/datepicker.types.d.ts +7 -0
  23. package/components/overlay/index.d.ts +5 -0
  24. package/components/overlay/overlay-content/overlay-content.component.d.ts +23 -0
  25. package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +48 -0
  26. package/components/overlay/public-api.d.ts +3 -0
  27. package/components/overlay/src/overlay.component.d.ts +158 -0
  28. package/components/paginator/components/pagination-item/pagination-item.component.d.ts +8 -3
  29. package/components/paginator/pipes/pagination.pipe.d.ts +40 -0
  30. package/components/paginator/public-api.d.ts +1 -0
  31. package/components/paginator/src/paginator.component.d.ts +14 -12
  32. package/components/table/src/table.component.d.ts +9 -6
  33. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +103 -0
  34. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -0
  35. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +1091 -0
  36. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -0
  37. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +6 -6
  38. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
  39. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +12 -10
  40. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  41. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -5
  42. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  43. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +439 -164
  44. package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
  45. package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
  46. package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
  47. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -3
  48. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  49. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +408 -0
  50. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -0
  51. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +150 -35
  52. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
  53. package/fesm2022/sixbell-telco-sdk-components-table.mjs +15 -6
  54. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  55. package/fesm2022/sixbell-telco-sdk-utils-date.mjs +154 -0
  56. package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -0
  57. package/fesm2022/sixbell-telco-sdk-utils-sync.mjs +84 -0
  58. package/fesm2022/sixbell-telco-sdk-utils-sync.mjs.map +1 -0
  59. package/package.json +56 -35
  60. package/utils/date/index.d.ts +5 -0
  61. package/utils/date/public-api.d.ts +1 -0
  62. package/utils/date/src/date-utils.d.ts +81 -0
  63. package/utils/sync/index.d.ts +5 -0
  64. package/utils/sync/public-api.d.ts +1 -0
  65. package/utils/sync/src/sync.d.ts +37 -0
  66. package/components/forms/datepicker/src/datepicker-format-month.pipe.d.ts +0 -10
@@ -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,3 @@
1
+ export * from './overlay-content/overlay-content.component';
2
+ export * from './overlay-trigger/overlay-trigger.component';
3
+ export * from './src/overlay.component';
@@ -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
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './components/pagination-item/pagination-item.component';
2
+ export * from './pipes/pagination.pipe';
2
3
  export * from './src/paginator.component';
@@ -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
- * Integrates with NgxPagination for advanced features while providing
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
- * @defaultValue 5
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
- * @internal
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 type TablePagination = {
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 7
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
@@ -0,0 +1,103 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, output, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
5
+ import { IconComponent } from '@sixbell-telco/sdk/components/icon';
6
+ import { matKeyboardArrowDown, matInfo } from '@sixbell-telco/sdk/components/icon/material/baseline';
7
+
8
+ class DataTableSubComponentToggleCellComponent {
9
+ row = input.required();
10
+ isExpanded = input.required(); // Current state of the sub-component for this row
11
+ toggled = output(); // Emits row.id when clicked to trigger parent component update
12
+ // Input to determine if this specific row is eligible to display a sub-component
13
+ canToggleSubComponent = input(false);
14
+ iconChevronDown = matKeyboardArrowDown;
15
+ iconInfo = matInfo;
16
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: DataTableSubComponentToggleCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: DataTableSubComponentToggleCellComponent, isStandalone: true, selector: "st-data-table-sub-component-toggle-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, isExpanded: { classPropertyName: "isExpanded", publicName: "isExpanded", isSignal: true, isRequired: true, transformFunction: null }, canToggleSubComponent: { classPropertyName: "canToggleSubComponent", publicName: "canToggleSubComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled" }, ngImport: i0, template: `
18
+ @if (canToggleSubComponent()) {
19
+ <st-button
20
+ variant="secondary"
21
+ size="xs"
22
+ [circle]="true"
23
+ [ghost]="true"
24
+ class="group"
25
+ (click)="toggled.emit(row().id)"
26
+ [attr.aria-expanded]="isExpanded()"
27
+ title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
28
+ >
29
+ <st-icon
30
+ class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
31
+ [icon]="iconChevronDown"
32
+ size="sm"
33
+ ></st-icon>
34
+ <span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
35
+ </st-button>
36
+ } @else {
37
+ <!-- Display an informational icon if a sub-component cannot be shown for this row -->
38
+ <st-button
39
+ variant="secondary"
40
+ size="xs"
41
+ [circle]="true"
42
+ [ghost]="true"
43
+ [attr.aria-expanded]="isExpanded()"
44
+ title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
45
+ [disabled]="true"
46
+ >
47
+ <st-icon [icon]="iconInfo" size="sm"></st-icon>
48
+ <span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
49
+ </st-button>
50
+ }
51
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
52
+ }
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: DataTableSubComponentToggleCellComponent, decorators: [{
54
+ type: Component,
55
+ args: [{
56
+ standalone: true,
57
+ selector: 'st-data-table-sub-component-toggle-cell',
58
+ imports: [CommonModule, IconComponent, ButtonComponent],
59
+ template: `
60
+ @if (canToggleSubComponent()) {
61
+ <st-button
62
+ variant="secondary"
63
+ size="xs"
64
+ [circle]="true"
65
+ [ghost]="true"
66
+ class="group"
67
+ (click)="toggled.emit(row().id)"
68
+ [attr.aria-expanded]="isExpanded()"
69
+ title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
70
+ >
71
+ <st-icon
72
+ class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
73
+ [icon]="iconChevronDown"
74
+ size="sm"
75
+ ></st-icon>
76
+ <span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
77
+ </st-button>
78
+ } @else {
79
+ <!-- Display an informational icon if a sub-component cannot be shown for this row -->
80
+ <st-button
81
+ variant="secondary"
82
+ size="xs"
83
+ [circle]="true"
84
+ [ghost]="true"
85
+ [attr.aria-expanded]="isExpanded()"
86
+ title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
87
+ [disabled]="true"
88
+ >
89
+ <st-icon [icon]="iconInfo" size="sm"></st-icon>
90
+ <span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
91
+ </st-button>
92
+ }
93
+ `,
94
+ changeDetection: ChangeDetectionStrategy.OnPush,
95
+ }]
96
+ }] });
97
+
98
+ /**
99
+ * Generated bundle index. Do not edit.
100
+ */
101
+
102
+ export { DataTableSubComponentToggleCellComponent };
103
+ //# sourceMappingURL=sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs","sources":["../../../projects/sdk/components/data-table/sub-component-toggle/sub-component-toggle.component.ts","../../../projects/sdk/components/data-table/sub-component-toggle/sixbell-telco-sdk-components-data-table-sub-component-toggle.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { ButtonComponent } from '@sixbell-telco/sdk/components/button';\nimport { IconComponent } from '@sixbell-telco/sdk/components/icon';\nimport { matInfo, matKeyboardArrowDown } from '@sixbell-telco/sdk/components/icon/material/baseline';\nimport { Row, RowData } from '@tanstack/angular-table';\n\n@Component({\n\tstandalone: true,\n\tselector: 'st-data-table-sub-component-toggle-cell',\n\timports: [CommonModule, IconComponent, ButtonComponent],\n\ttemplate: `\n\t\t@if (canToggleSubComponent()) {\n\t\t\t<st-button\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\t[circle]=\"true\"\n\t\t\t\t[ghost]=\"true\"\n\t\t\t\tclass=\"group\"\n\t\t\t\t(click)=\"toggled.emit(row().id)\"\n\t\t\t\t[attr.aria-expanded]=\"isExpanded()\"\n\t\t\t\ttitle=\"{{ isExpanded() ? 'Hide Details' : 'Show Details' }}\"\n\t\t\t>\n\t\t\t\t<st-icon\n\t\t\t\t\tclass=\"transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180\"\n\t\t\t\t\t[icon]=\"iconChevronDown\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t></st-icon>\n\t\t\t\t<span class=\"sr-only\">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>\n\t\t\t</st-button>\n\t\t} @else {\n\t\t\t<!-- Display an informational icon if a sub-component cannot be shown for this row -->\n\t\t\t<st-button\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\t[circle]=\"true\"\n\t\t\t\t[ghost]=\"true\"\n\t\t\t\t[attr.aria-expanded]=\"isExpanded()\"\n\t\t\t\ttitle=\"{{ isExpanded() ? 'Hide Details' : 'Show Details' }}\"\n\t\t\t\t[disabled]=\"true\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconInfo\" size=\"sm\"></st-icon>\n\t\t\t\t<span class=\"sr-only\">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>\n\t\t\t</st-button>\n\t\t}\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataTableSubComponentToggleCellComponent<T extends RowData> {\n\treadonly row = input.required<Row<T>>();\n\treadonly isExpanded = input.required<boolean>(); // Current state of the sub-component for this row\n\treadonly toggled = output<string>(); // Emits row.id when clicked to trigger parent component update\n\n\t// Input to determine if this specific row is eligible to display a sub-component\n\treadonly canToggleSubComponent = input<boolean>(false);\n\n\treadonly iconChevronDown = matKeyboardArrowDown;\n\treadonly iconInfo = matInfo;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAgDa,wCAAwC,CAAA;AAC3C,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAU;AAC9B,IAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,EAAW,CAAC;AACvC,IAAA,OAAO,GAAG,MAAM,EAAU,CAAC;;AAG3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