@ruc-lib/timeline 2.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruc-lib-timeline.mjs","sources":["../../src/lib/ruclib-timeline/ruclib-timeline.component.ts","../../src/lib/ruclib-timeline/ruclib-timeline.component.html","../../src/lib/ruclib-timeline.module.ts","../../src/ruc-lib-timeline.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\r\nimport { RucTimelineInput, RucTimelineItemData } from '../../model/ruclib-timeline.model';\r\n\r\n@Component({\r\n selector: 'uxp-ruclib-timeline',\r\n templateUrl: './ruclib-timeline.component.html',\r\n styleUrls: ['./ruclib-timeline.component.scss'],\r\n})\r\nexport class RuclibTimelineComponent {\r\n @Input() customTheme!: string;\r\n @Input() rucInputData?: RucTimelineInput;\r\n data: RucTimelineItemData[] | undefined;\r\n\r\n constructor() {}\r\n\r\n /**\r\n * To get position of the timeline\r\n * @param position \r\n * @param index \r\n * @returns default: left\r\n */\r\n private getItemPosition(position: string, index: number): string {\r\n switch (position) {\r\n case 'alternate': {\r\n const layout = this.getLayout();\r\n if(index % 2 == 0) {\r\n return layout === 'horizontal' ? 'top' :'left';\r\n } else {\r\n return layout === 'horizontal' ? 'bottom' :'right';\r\n }\r\n }\r\n case 'top':\r\n return 'top';\r\n case 'bottom':\r\n return 'bottom';\r\n case 'right':\r\n return 'right';\r\n case 'left':\r\n default: \r\n return 'left'\r\n }\r\n }\r\n \r\n\r\n /**\r\n * To get layout of the timeline\r\n * @param layout \r\n * @returns default: vertical\r\n */\r\n private getItemLayout(layout: string = ''): string {\r\n switch (layout) {\r\n case 'horizontal':\r\n return 'horizontal';\r\n case 'vertical':\r\n default: \r\n return 'vertical';\r\n }\r\n } \r\n \r\n \r\n /**\r\n * To get data from the input\r\n */\r\n getData(): RucTimelineItemData[] | any {\r\n if (this.rucInputData?.data) {\r\n this.data = this.rucInputData.data?.sort((a: RucTimelineItemData, b: RucTimelineItemData) => a?.id - b?.id) || [];\r\n }\r\n return typeof this.data !== 'undefined' ? this.data : [];\r\n }\r\n\r\n /**\r\n * To get position of the timeline\r\n * @returns default: left\r\n */\r\n getPosition(index: number = -1): string | undefined {\r\n if(index === -1) {\r\n return this.rucInputData?.position;\r\n }\r\n return this.getItemPosition(this.rucInputData?.position || 'left', index); // Provide a default if position is undefined\r\n } \r\n \r\n\r\n /**\r\n * To get layout of the timeline\r\n * @returns default: vertical\r\n */\r\n getLayout(): string {\r\n return this.getItemLayout(this.rucInputData?.layout) // Provide a default if layout is undefined\r\n } \r\n \r\n /**\r\n * To get highlight color of the timeline\r\n * @returns default: undefined\r\n */\r\n getHighlightColor(): string | undefined {\r\n return this.rucInputData?.highlightColor;\r\n }\r\n\r\n /**\r\n * To get title font color of the timeline\r\n * @returns default: undefined\r\n */\r\n getTitleColor(): string | undefined {\r\n return this.rucInputData?.titleFontColor;\r\n }\r\n\r\n /**\r\n * To get sub title font color of the timeline\r\n * @returns default: undefined\r\n */\r\n getSubTitleColor(): string | undefined {\r\n return this.rucInputData?.subTitleFontColor;\r\n } \r\n \r\n /**\r\n * To get title font size of the timeline\r\n * @returns default: undefined\r\n */\r\n getTitleFontSize(): string | undefined {\r\n return this.rucInputData?.titleFontSize;\r\n }\r\n\r\n /**\r\n * To get subtitle font size of the timeline\r\n * @returns default: undefined\r\n */\r\n getSubTitleFontSize(): string | undefined {\r\n return this.rucInputData?.subTitleFontSize;\r\n }\r\n\r\n /**\r\n * To get title background color of the timeline\r\n * @returns default: undefined\r\n */\r\n getTitleBackgroundColor(): string | undefined {\r\n return this.rucInputData?.titleBackgroundColor;\r\n }\r\n\r\n /**\r\n * To get subtitle background color of the timeline\r\n * @returns default: undefined\r\n */\r\n getSubTitleBackgroundColor(): string | undefined {\r\n return this.rucInputData?.subTitleBackgroundColor;\r\n }\r\n \r\n /**\r\n * To get max title length of the timeline\r\n * @returns default: undefined\r\n */\r\n getMaxTitleLength(): number | any {\r\n return this.rucInputData?.maxTitleLength;\r\n }\r\n\r\n /**\r\n * To get max sub title length of the timeline\r\n * @returns default: undefined\r\n */\r\n getMaxSubtitleLength(): number | any {\r\n return this.rucInputData?.maxSubTitleLength;\r\n }\r\n\r\n /**\r\n * To check if the isInfo variable is defined and value is true|false in timeline\r\n * @returns default: undefined\r\n */\r\n isInfo() {\r\n return this.rucInputData?.isInfo;\r\n }\r\n\r\n /**\r\n * To get title in timeline\r\n * @param title \r\n * @param key \r\n * @returns default: title\r\n */\r\n getTitle(title: string = '', key: 'title' | 'subtitle' | '' = ''): string {\r\n switch(key) {\r\n case 'title': {\r\n const checkLength = this.getMaxTitleLength();\r\n return this.isLengthDefined(title, checkLength);\r\n }\r\n case 'subtitle': {\r\n const checkLength = this.getMaxSubtitleLength();\r\n return this.isLengthDefined(title, checkLength);\r\n }\r\n default: {\r\n return title;\r\n }\r\n } \r\n } \r\n \r\n /**\r\n * To check if the length is defined\r\n * @param title \r\n * @param checkLength \r\n * @returns default: title\r\n */\r\n isLengthDefined(title: string = '', checkLength: number | undefined): string { \r\n if(typeof checkLength !== 'undefined' && checkLength > 0 && title !== '') {\r\n const str = title.substring(0, checkLength);\r\n return title.length === checkLength ? str : str+'...';\r\n }\r\n return title;\r\n }\r\n\r\n /**\r\n * To check if the template variable is defined and value is true|false in timeline\r\n * @returns default: false\r\n */\r\n isCard() {\r\n return typeof this.rucInputData?.isTemplate !== 'undefined' ? this.rucInputData?.isTemplate : false;\r\n }\r\n\r\n /**\r\n * To get the color of icon\r\n * @returns default: false\r\n */\r\n getIconColor(): string {\r\n return this.rucInputData?.iconColor || 'primary';\r\n }\r\n}\r\n","<div class={{customTheme}}>\r\n <ul class=\"w-full timeline timeline-{{getPosition()}} timeline-{{getLayout()}}\"\r\n [ngClass]=\"{'timeline-card': !!isCard()}\">\r\n <li class=\"timeline-event\" *ngFor=\"let item of getData(); let i = index\">\r\n <ng-container *ngIf=\"getPosition() === 'opposite' then oppositeTemplate else simpleOppositeTemplate\"></ng-container>\r\n <ng-template #oppositeTemplate>\r\n <div class=\"timeline-event-opposite divya\">\r\n <ng-template *ngIf=\"true then titleTemplate\"></ng-template>\r\n </div>\r\n </ng-template>\r\n <ng-template #simpleOppositeTemplate>\r\n <div class=\"timeline-event-opposite rajput\"></div>\r\n </ng-template>\r\n \r\n <div class=\"timeline-event-separator\">\r\n <div class=\"timeline-event-marker\" [ngClass]=\"{'timeline-event-marker-active': !item.icon}\">\r\n <mat-icon\r\n color=\"{{getIconColor()}}\"\r\n class=\"timeline-icon-circle\"\r\n *ngIf=\"item.icon\"\r\n role=\"img\"\r\n [attr.aria-label]=\"item.iconAriaLabel || item.icon\"\r\n >{{item.icon}}</mat-icon>\r\n </div>\r\n <div class=\"timeline-event-connector\" *ngIf=\"i !== (getData()?.length - 1)\"></div>\r\n </div>\r\n <div class=\"timeline-event-content\" [style.background-color]=\"getHighlightColor()\">\r\n <ng-container *ngIf=\"isCard(); then cardTemplate\"></ng-container>\r\n\r\n <ng-container *ngIf=\"getPosition() === 'opposite' then subtitleTemplate\"></ng-container>\r\n\r\n <ng-container *ngIf=\"(!isCard() && getPosition() !== 'opposite') then dataTemplate\"></ng-container>\r\n \r\n <ng-template #cardTemplate>\r\n <!-- Fot Template -->\r\n <mat-card class=\"m-mat-card\" appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title-group>\r\n <mat-card-title>{{item.title}}</mat-card-title>\r\n <mat-card-subtitle>{{item.subtitle}}</mat-card-subtitle>\r\n <img\r\n mat-card-lg-image\r\n src=\"{{item.imageUrl}}\"\r\n [alt]=\"item.imageAltText || item.title || 'Timeline event image'\"\r\n >\r\n </mat-card-title-group>\r\n </mat-card-header>\r\n <mat-card-content>\r\n {{item.content}}\r\n </mat-card-content>\r\n </mat-card>\r\n </ng-template>\r\n\r\n <ng-template #dataTemplate>\r\n <ng-template *ngIf=\"true then titleTemplate\"></ng-template>\r\n \r\n <ng-template *ngIf=\"true then subtitleTemplate\"></ng-template>\r\n </ng-template>\r\n\r\n <ng-template #titleTemplate>\r\n <!-- Fot Title -->\r\n <div \r\n class=\"timeline-event-title\"\r\n [ngClass]=\"{'timeline-icon-question-mark-active': !!item.iconTitle}\" \r\n [style.background-color]=\"getTitleBackgroundColor()\"\r\n *ngIf=\"!!item.title\"\r\n >\r\n <span \r\n [ngClass]=\"{'description-ellipsis-active': !!getMaxTitleLength()}\"\r\n [style.color]=\"getTitleColor()\"\r\n [style.font-size]=\"getTitleFontSize()\"\r\n [matTooltipDisabled]=\"!(item?.title && item?.title?.length > getMaxTitleLength())\"\r\n [matTooltip]=\"item.title\"\r\n matTooltipPosition=\"above\">\r\n {{getTitle(item.title, 'title')}}\r\n </span>\r\n <span *ngIf=\"!!item.iconTitle\" class=\"timeline-icon-question-mark\" aria-hidden=\"true\">\r\n <mat-icon\r\n color=\"{{getIconColor()}}\"\r\n class=\"timeline-icon-circle timeline-icon\"\r\n >{{item.iconTitle}}</mat-icon>\r\n </span>\r\n <span *ngIf=\"isInfo()\" class=\"timeline-icon-question-mark\">\r\n <mat-icon\r\n color=\"{{getIconColor()}}\"\r\n class=\"timeline-icon-question-mark-icon\"\r\n [matTooltip]=\"item?.titleInfo\"\r\n matTooltipPosition=\"above\" \r\n role=\"button\" \r\n aria-label=\"More information about title\"\r\n >{{item.titleInfoIcon}}</mat-icon> \r\n </span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #subtitleTemplate>\r\n <!-- Fot Sub Title -->\r\n <div\r\n class=\"timeline-event-sub-title\"\r\n [ngClass]=\"{'timeline-icon-question-mark-active': !!item.iconSubTitle}\"\r\n [style.background-color]=\"getSubTitleBackgroundColor()\"\r\n *ngIf=\"!!item.subtitle\"\r\n >\r\n <span \r\n [ngClass]=\"{'description-ellipsis-active': !!getMaxSubtitleLength()}\"\r\n [style.color]=\"getSubTitleColor()\"\r\n [style.font-size]=\"getSubTitleFontSize()\"\r\n [matTooltipDisabled]=\"!(item.subtitle && item.subtitle.length > getMaxSubtitleLength())\"\r\n [matTooltip]=\"item.subtitle\"\r\n matTooltipPosition=\"above\"\r\n >\r\n {{getTitle(item.subtitle, 'subtitle')}}\r\n </span>\r\n <span *ngIf=\"!!item.iconSubTitle\" class=\"timeline-icon-question-mark\" aria-hidden=\"true\">\r\n <mat-icon\r\n color=\"{{getIconColor()}}\"\r\n class=\"timeline-icon-circle timeline-icon\"\r\n >{{item.iconSubTitle}}</mat-icon>\r\n </span>\r\n <span *ngIf=\"isInfo()\" class=\"timeline-icon-question-mark\">\r\n <mat-icon\r\n color=\"{{getIconColor()}}\"\r\n class=\"timeline-icon-question-mark-icon\"\r\n [matTooltip]=\"item?.subTitleInfo\"\r\n matTooltipPosition=\"above\" \r\n role=\"button\"\r\n aria-label=\"More information about subtitle\"\r\n >{{item.subTitleInfoIcon}}</mat-icon>\r\n </span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </li>\r\n </ul>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RuclibTimelineComponent } from './ruclib-timeline/ruclib-timeline.component';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport {MatCardModule} from '@angular/material/card';\r\n\r\n@NgModule({\r\n imports: [CommonModule, MatIconModule, MatTooltipModule, MatCardModule],\r\n declarations: [RuclibTimelineComponent],\r\n exports: [RuclibTimelineComponent],\r\n})\r\nexport class RuclibTimelineModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAQa,uBAAuB,CAAA;AAKlC,IAAA,WAAA,GAAA,GAAgB;AAEhB;;;;;AAKG;IACK,eAAe,CAAC,QAAgB,EAAE,KAAa,EAAA;AACrD,QAAA,QAAQ,QAAQ;YACd,KAAK,WAAW,EAAE;AACd,gBAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;AAChC,gBAAA,IAAG,KAAK,GA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YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAA,EAAA,CAAA,CAAA;4FAI3D,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC;oBACvE,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;AACnC,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lib/ruclib-timeline.module';
2
+ export * from './lib/ruclib-timeline/ruclib-timeline.component';
@@ -0,0 +1,111 @@
1
+ import { RucTimelineInput, RucTimelineItemData } from '../../model/ruclib-timeline.model';
2
+ import * as i0 from "@angular/core";
3
+ export declare class RuclibTimelineComponent {
4
+ customTheme: string;
5
+ rucInputData?: RucTimelineInput;
6
+ data: RucTimelineItemData[] | undefined;
7
+ constructor();
8
+ /**
9
+ * To get position of the timeline
10
+ * @param position
11
+ * @param index
12
+ * @returns default: left
13
+ */
14
+ private getItemPosition;
15
+ /**
16
+ * To get layout of the timeline
17
+ * @param layout
18
+ * @returns default: vertical
19
+ */
20
+ private getItemLayout;
21
+ /**
22
+ * To get data from the input
23
+ */
24
+ getData(): RucTimelineItemData[] | any;
25
+ /**
26
+ * To get position of the timeline
27
+ * @returns default: left
28
+ */
29
+ getPosition(index?: number): string | undefined;
30
+ /**
31
+ * To get layout of the timeline
32
+ * @returns default: vertical
33
+ */
34
+ getLayout(): string;
35
+ /**
36
+ * To get highlight color of the timeline
37
+ * @returns default: undefined
38
+ */
39
+ getHighlightColor(): string | undefined;
40
+ /**
41
+ * To get title font color of the timeline
42
+ * @returns default: undefined
43
+ */
44
+ getTitleColor(): string | undefined;
45
+ /**
46
+ * To get sub title font color of the timeline
47
+ * @returns default: undefined
48
+ */
49
+ getSubTitleColor(): string | undefined;
50
+ /**
51
+ * To get title font size of the timeline
52
+ * @returns default: undefined
53
+ */
54
+ getTitleFontSize(): string | undefined;
55
+ /**
56
+ * To get subtitle font size of the timeline
57
+ * @returns default: undefined
58
+ */
59
+ getSubTitleFontSize(): string | undefined;
60
+ /**
61
+ * To get title background color of the timeline
62
+ * @returns default: undefined
63
+ */
64
+ getTitleBackgroundColor(): string | undefined;
65
+ /**
66
+ * To get subtitle background color of the timeline
67
+ * @returns default: undefined
68
+ */
69
+ getSubTitleBackgroundColor(): string | undefined;
70
+ /**
71
+ * To get max title length of the timeline
72
+ * @returns default: undefined
73
+ */
74
+ getMaxTitleLength(): number | any;
75
+ /**
76
+ * To get max sub title length of the timeline
77
+ * @returns default: undefined
78
+ */
79
+ getMaxSubtitleLength(): number | any;
80
+ /**
81
+ * To check if the isInfo variable is defined and value is true|false in timeline
82
+ * @returns default: undefined
83
+ */
84
+ isInfo(): boolean | undefined;
85
+ /**
86
+ * To get title in timeline
87
+ * @param title
88
+ * @param key
89
+ * @returns default: title
90
+ */
91
+ getTitle(title?: string, key?: 'title' | 'subtitle' | ''): string;
92
+ /**
93
+ * To check if the length is defined
94
+ * @param title
95
+ * @param checkLength
96
+ * @returns default: title
97
+ */
98
+ isLengthDefined(title: string | undefined, checkLength: number | undefined): string;
99
+ /**
100
+ * To check if the template variable is defined and value is true|false in timeline
101
+ * @returns default: false
102
+ */
103
+ isCard(): boolean;
104
+ /**
105
+ * To get the color of icon
106
+ * @returns default: false
107
+ */
108
+ getIconColor(): string;
109
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuclibTimelineComponent, never>;
110
+ static ɵcmp: i0.ɵɵComponentDeclaration<RuclibTimelineComponent, "uxp-ruclib-timeline", never, { "customTheme": "customTheme"; "rucInputData": "rucInputData"; }, {}, never, never, false, never>;
111
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./ruclib-timeline/ruclib-timeline.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/material/icon";
5
+ import * as i4 from "@angular/material/tooltip";
6
+ import * as i5 from "@angular/material/card";
7
+ export declare class RuclibTimelineModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuclibTimelineModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RuclibTimelineModule, [typeof i1.RuclibTimelineComponent], [typeof i2.CommonModule, typeof i3.MatIconModule, typeof i4.MatTooltipModule, typeof i5.MatCardModule], [typeof i1.RuclibTimelineComponent]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<RuclibTimelineModule>;
11
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ *Interface for defining the Timeline Data
3
+ */
4
+ export interface RucTimelineItemData {
5
+ id: number;
6
+ title: string;
7
+ subtitle?: string;
8
+ content?: string;
9
+ icon?: string;
10
+ iconAriaLabel?: string;
11
+ imageUrl?: string;
12
+ imageAltText?: string;
13
+ titleInfo?: string;
14
+ subTitleInfo?: string;
15
+ iconTitle?: string;
16
+ iconSubTitle?: string;
17
+ titleInfoIcon?: string;
18
+ subTitleInfoIcon?: string;
19
+ }
20
+ /**
21
+ *Interface for defining the Timeline Property
22
+ */
23
+ export interface RucTimelineInput {
24
+ layout?: 'vertical' | 'horizontal' | undefined;
25
+ position?: 'left' | 'right' | 'top' | 'bottom' | 'alternate' | 'opposite';
26
+ titleFontColor?: string | undefined;
27
+ subTitleFontColor?: string | undefined;
28
+ titleFontSize?: string | undefined;
29
+ subTitleFontSize?: string | undefined;
30
+ titleBackgroundColor?: string | undefined;
31
+ subTitleBackgroundColor?: string | undefined;
32
+ highlightColor?: string | undefined;
33
+ iconColor?: 'primary' | 'accent' | 'warn';
34
+ maxTitleLength?: number;
35
+ maxSubTitleLength?: number;
36
+ isInfo?: boolean | undefined;
37
+ isTemplate?: boolean | undefined;
38
+ data?: RucTimelineItemData[];
39
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@ruc-lib/timeline",
3
+ "version": "2.0.0",
4
+ "license": "MIT",
5
+ "peerDependencies": {
6
+ "@angular/common": "^17.0.0 || ^16.0.0 || ^15.0.0",
7
+ "@angular/core": "^17.0.0 || ^16.0.0 || ^15.0.0",
8
+ "@angular/material": "^15.2.9 || ^14.0.0 || ^13.0.0"
9
+ },
10
+ "dependencies": {
11
+ "tslib": "^2.3.0"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "sideEffects": false,
17
+ "module": "fesm2015/ruc-lib-timeline.mjs",
18
+ "es2020": "fesm2020/ruc-lib-timeline.mjs",
19
+ "esm2020": "esm2020/ruc-lib-timeline.mjs",
20
+ "fesm2020": "fesm2020/ruc-lib-timeline.mjs",
21
+ "fesm2015": "fesm2015/ruc-lib-timeline.mjs",
22
+ "typings": "index.d.ts",
23
+ "exports": {
24
+ "./package.json": {
25
+ "default": "./package.json"
26
+ },
27
+ ".": {
28
+ "types": "./index.d.ts",
29
+ "esm2020": "./esm2020/ruc-lib-timeline.mjs",
30
+ "es2020": "./fesm2020/ruc-lib-timeline.mjs",
31
+ "es2015": "./fesm2015/ruc-lib-timeline.mjs",
32
+ "node": "./fesm2015/ruc-lib-timeline.mjs",
33
+ "default": "./fesm2020/ruc-lib-timeline.mjs"
34
+ }
35
+ }
36
+ }