@tekus/design-system 5.30.0 → 5.31.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.
@@ -45,6 +45,10 @@ type TkCardLayout = 'vertical' | 'horizontal';
45
45
  declare class CardComponent {
46
46
  /** The primary title of the card. Required. */
47
47
  title: _angular_core.InputSignal<string>;
48
+ /** Optional link (routerLink or URL) for the title. */
49
+ titleLink: _angular_core.InputSignal<string | unknown[] | null | undefined>;
50
+ /** Optional external link (href) for the title. */
51
+ titleHref: _angular_core.InputSignal<string | null | undefined>;
48
52
  /** Optional icon to display next to the title. */
49
53
  titleIcon: _angular_core.InputSignal<string | undefined>;
50
54
  /** Optional secondary description. */
@@ -63,6 +67,10 @@ declare class CardComponent {
63
67
  badgeText: _angular_core.InputSignal<string | undefined>;
64
68
  /** Optional secondary metadata text (e.g. file size) displayed next to the badge. */
65
69
  secondaryBadgeText: _angular_core.InputSignal<string | undefined>;
70
+ /** Optional date/time value for connection status. */
71
+ connectionStatusDate: _angular_core.InputSignal<string | number | Date | null | undefined>;
72
+ /** Optional connection status severity: 'success' | 'warn' | 'danger' | 'gray'. */
73
+ connectionStatusSeverity: _angular_core.InputSignal<"danger" | "success" | "warn" | "gray">;
66
74
  /** List of actions associated with the card. */
67
75
  actions: _angular_core.InputSignal<TkCardAction[]>;
68
76
  /** Action group list to be used with tk-action-group */
@@ -93,7 +101,7 @@ declare class CardComponent {
93
101
  */
94
102
  getStatusBarSeverity(severity?: string): 'primary' | 'secondary' | 'success' | 'error';
95
103
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardComponent, never>;
96
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "tk-card", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "titleIcon": { "alias": "titleIcon"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "showImage": { "alias": "showImage"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "badgeText": { "alias": "badgeText"; "required": false; "isSignal": true; }; "secondaryBadgeText": { "alias": "secondaryBadgeText"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "actionGroup": { "alias": "actionGroup"; "required": false; "isSignal": true; }; "actionGroupMaxVisible": { "alias": "actionGroupMaxVisible"; "required": false; "isSignal": true; }; "infoElements": { "alias": "infoElements"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; }, never, never, true, never>;
104
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "tk-card", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "titleLink": { "alias": "titleLink"; "required": false; "isSignal": true; }; "titleHref": { "alias": "titleHref"; "required": false; "isSignal": true; }; "titleIcon": { "alias": "titleIcon"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "showImage": { "alias": "showImage"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "badgeText": { "alias": "badgeText"; "required": false; "isSignal": true; }; "secondaryBadgeText": { "alias": "secondaryBadgeText"; "required": false; "isSignal": true; }; "connectionStatusDate": { "alias": "connectionStatusDate"; "required": false; "isSignal": true; }; "connectionStatusSeverity": { "alias": "connectionStatusSeverity"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "actionGroup": { "alias": "actionGroup"; "required": false; "isSignal": true; }; "actionGroupMaxVisible": { "alias": "actionGroupMaxVisible"; "required": false; "isSignal": true; }; "infoElements": { "alias": "infoElements"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; }, never, never, true, never>;
97
105
  }
98
106
 
99
107
  export { CardComponent };
@@ -0,0 +1,117 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef } from '@angular/core';
3
+
4
+ /**
5
+ * Interface representing a button action in the stepper step's footer.
6
+ */
7
+ interface StepAction {
8
+ /** Text label displayed on the button */
9
+ label: string;
10
+ /** Action handler invoked when the button is clicked */
11
+ action: () => void;
12
+ /**
13
+ * Status of whether the action is disabled.
14
+ * Can be a static boolean or a callback function (useful to bind to form validity).
15
+ */
16
+ disabled?: boolean | (() => boolean);
17
+ /** Styled color severity for the button matching tk-button inputs */
18
+ severity?: 'primary' | 'secondary' | 'danger';
19
+ /** Button visual style variant matching tk-button inputs */
20
+ variant?: 'text' | 'outlined';
21
+ /** Optional icon to display on the button */
22
+ icon?: string;
23
+ }
24
+ /**
25
+ * Interface representing data for each step configuration.
26
+ */
27
+ interface StepData {
28
+ /** Optional identifier for the step */
29
+ id?: string;
30
+ /** Header label for the step */
31
+ label: string;
32
+ /** Whether the step header is disabled */
33
+ disabled?: boolean;
34
+ /** Whether the step has been completed successfully */
35
+ completed?: boolean;
36
+ /** The TemplateRef containing the step content form or markup */
37
+ content: TemplateRef<unknown>;
38
+ /** Optional list of primary actions (displayed right/bottom) */
39
+ actionsPrimary?: StepAction[];
40
+ /** Optional list of secondary actions (displayed left/bottom) */
41
+ actionsSecondary?: StepAction[];
42
+ }
43
+
44
+ /**
45
+ * @component StepperComponent
46
+ * @description
47
+ * Reusable stepper component that acts as a wrapper around PrimeNG's Stepper.
48
+ * Supports horizontal and vertical orientations, linear step completion rules,
49
+ * and automated footer action buttons.
50
+ *
51
+ * @usage
52
+ * ```html
53
+ * <tk-stepper
54
+ * [steps]="steps"
55
+ * [(activeStep)]="currentStep"
56
+ * [linear]="true"
57
+ * orientation="horizontal">
58
+ * </tk-stepper>
59
+ * ```
60
+ */
61
+ declare class StepperComponent {
62
+ /**
63
+ * @property {InputSignal<StepData[]>} steps
64
+ * @description Array of step configurations to display.
65
+ */
66
+ steps: _angular_core.InputSignal<StepData[]>;
67
+ /**
68
+ * @property {ModelSignal<number>} activeStep
69
+ * @description The 0-based index of the currently active step. Supports two-way binding.
70
+ * @default 0
71
+ */
72
+ activeStep: _angular_core.ModelSignal<number>;
73
+ /**
74
+ * @property {InputSignal<boolean>} linear
75
+ * @description If true, blocks navigation to steps ahead of the active step.
76
+ * @default true
77
+ */
78
+ linear: _angular_core.InputSignal<boolean>;
79
+ /**
80
+ * @property {InputSignal<'horizontal' | 'vertical'>} orientation
81
+ * @description Defines the layout orientation of the stepper.
82
+ * @default 'horizontal'
83
+ */
84
+ orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
85
+ /**
86
+ * @property {InputSignal<boolean>} showFooter
87
+ * @description Whether to render the default footer action buttons for each step.
88
+ * @default true
89
+ */
90
+ showFooter: _angular_core.InputSignal<boolean>;
91
+ /**
92
+ * @event stepChange
93
+ * @description Emitted when the active step changes.
94
+ */
95
+ stepChange: _angular_core.OutputEmitterRef<{
96
+ index: number;
97
+ step: StepData;
98
+ }>;
99
+ /**
100
+ * Checks if a step header should be disabled.
101
+ * Steps ahead of the active index are disabled in linear mode.
102
+ */
103
+ isStepDisabled(index: number): boolean;
104
+ /**
105
+ * Helper to evaluate button disabled states dynamically.
106
+ */
107
+ evalDisabled(disabled: boolean | (() => boolean) | undefined): boolean;
108
+ /**
109
+ * Handles step transition events.
110
+ */
111
+ onStepChange(index: number): void;
112
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StepperComponent, never>;
113
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StepperComponent, "tk-stepper", never, { "steps": { "alias": "steps"; "required": false; "isSignal": true; }; "activeStep": { "alias": "activeStep"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; }, { "activeStep": "activeStepChange"; "stepChange": "stepChange"; }, never, never, true, never>;
114
+ }
115
+
116
+ export { StepperComponent };
117
+ export type { StepAction, StepData };
@@ -4,7 +4,7 @@ import { TagSeverity } from '@tekus/design-system/components/tag';
4
4
  import { SortEvent } from 'primeng/api';
5
5
  import { TkAction } from '@tekus/design-system/components/action-group';
6
6
 
7
- type TableColumnType = 'text' | 'tag' | 'actions' | 'selection' | 'checkbox' | 'action-group';
7
+ type TableColumnType = 'text' | 'tag' | 'actions' | 'selection' | 'checkbox' | 'action-group' | 'connection-status';
8
8
  interface TableColumn<T = unknown> {
9
9
  field?: string;
10
10
  header: string;
@@ -13,6 +13,8 @@ interface TableColumn<T = unknown> {
13
13
  type?: TableColumnType;
14
14
  width?: string;
15
15
  tagSeverity?: (row: T) => TagSeverity;
16
+ connectionStatusSeverity?: (row: T) => 'success' | 'warn' | 'danger' | 'gray';
17
+ connectionStatusTooltipText?: (row: T) => string;
16
18
  actions?: Array<{
17
19
  icon: string;
18
20
  action?: (row: T) => void;
@@ -0,0 +1,53 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit } from '@angular/core';
3
+
4
+ type TimeAgoSeverity = 'success' | 'warn' | 'danger' | 'gray';
5
+ declare class TimeAgoComponent implements OnInit {
6
+ /**
7
+ * The date to calculate the relative time from.
8
+ * Can be a Date object, an ISO string, a timestamp number,
9
+ * or a custom string format like 'dd/MM/yyyy HH:mm:ss' / 'dd/MM/yyyy HH:mm'.
10
+ */
11
+ dateTime: _angular_core.InputSignal<string | number | Date | null | undefined>;
12
+ /**
13
+ * The severity of the state, determining its dot and label colors.
14
+ * Options: 'success' | 'warn' | 'danger' | 'gray'
15
+ * @default 'success'
16
+ */
17
+ severity: _angular_core.InputSignal<TimeAgoSeverity>;
18
+ /**
19
+ * Custom tooltip text to display instead of the formatted date.
20
+ */
21
+ tooltipText: _angular_core.InputSignal<string | null | undefined>;
22
+ /**
23
+ * Format pattern for the fallback tooltip date representation.
24
+ * @default 'dd/MM/yyyy h:mm a'
25
+ */
26
+ tooltipFormat: _angular_core.InputSignal<string>;
27
+ private readonly destroyRef;
28
+ private readonly localeId;
29
+ private readonly datePipe;
30
+ private readonly nowSignal;
31
+ readonly parsedDate: _angular_core.Signal<Date | null>;
32
+ readonly relativeTime: _angular_core.Signal<string>;
33
+ readonly tooltipContent: _angular_core.Signal<string>;
34
+ ngOnInit(): void;
35
+ /**
36
+ * Checks if a date object represents a valid timestamp.
37
+ */
38
+ private isValidDate;
39
+ /**
40
+ * Parses legacy custom format 'DD/MM/YYYY HH:mm:ss' or 'DD/MM/YYYY HH:mm'.
41
+ */
42
+ private parseCustomFormat;
43
+ /**
44
+ * Robust date parser supporting Date, timestamp number, ISO strings,
45
+ * and custom DD/MM/YYYY formatting commonly used in the platform.
46
+ */
47
+ private parseDate;
48
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TimeAgoComponent, never>;
49
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TimeAgoComponent, "tk-time-ago", never, { "dateTime": { "alias": "dateTime"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "tooltipText": { "alias": "tooltipText"; "required": false; "isSignal": true; }; "tooltipFormat": { "alias": "tooltipFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
50
+ }
51
+
52
+ export { TimeAgoComponent };
53
+ export type { TimeAgoSeverity };