@sarasanalytics-com/design-system 0.0.7 → 0.0.9

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 (142) hide show
  1. package/ng-package.json +8 -0
  2. package/package.json +2 -15
  3. package/src/interfaces/avatar-interface.ts +6 -0
  4. package/src/interfaces/button-interface.ts +12 -0
  5. package/src/interfaces/chip-interface.ts +11 -0
  6. package/src/interfaces/grid-interface.ts +24 -0
  7. package/src/interfaces/select-interface.ts +20 -0
  8. package/src/interfaces/tab-interface.ts +6 -0
  9. package/src/lib/avatar/avatar.component.css +48 -0
  10. package/src/lib/avatar/avatar.component.html +5 -0
  11. package/src/lib/avatar/avatar.component.spec.ts +23 -0
  12. package/src/lib/avatar/avatar.component.ts +50 -0
  13. package/src/lib/button/button.component.css +145 -0
  14. package/src/lib/button/button.component.html +11 -0
  15. package/src/lib/button/button.component.spec.ts +23 -0
  16. package/src/lib/button/button.component.ts +68 -0
  17. package/src/lib/calendar-header/calendar-header.component.css +67 -0
  18. package/src/lib/calendar-header/calendar-header.component.html +20 -0
  19. package/src/lib/calendar-header/calendar-header.component.spec.ts +23 -0
  20. package/src/lib/calendar-header/calendar-header.component.ts +191 -0
  21. package/src/lib/card/card-body/card-body.component.css +0 -0
  22. package/src/lib/card/card-body/card-body.component.html +1 -0
  23. package/src/lib/card/card-body/card-body.component.spec.ts +23 -0
  24. package/src/lib/card/card-body/card-body.component.ts +12 -0
  25. package/src/lib/card/card-footer-actions/card-footer-actions.component.css +4 -0
  26. package/src/lib/card/card-footer-actions/card-footer-actions.component.html +3 -0
  27. package/src/lib/card/card-footer-actions/card-footer-actions.component.spec.ts +23 -0
  28. package/src/lib/card/card-footer-actions/card-footer-actions.component.ts +12 -0
  29. package/src/lib/card/card-icon/card-icon.component.css +0 -0
  30. package/src/lib/card/card-icon/card-icon.component.html +1 -0
  31. package/src/lib/card/card-icon/card-icon.component.spec.ts +23 -0
  32. package/src/lib/card/card-icon/card-icon.component.ts +12 -0
  33. package/src/lib/card/card-title-actions/card-title-actions.component.css +3 -0
  34. package/src/lib/card/card-title-actions/card-title-actions.component.html +1 -0
  35. package/src/lib/card/card-title-actions/card-title-actions.component.spec.ts +23 -0
  36. package/src/lib/card/card-title-actions/card-title-actions.component.ts +12 -0
  37. package/src/lib/card/card.component.css +84 -0
  38. package/src/lib/card/card.component.html +34 -0
  39. package/src/lib/card/card.component.spec.ts +23 -0
  40. package/src/lib/card/card.component.ts +33 -0
  41. package/src/lib/chips/chips.component.css +129 -0
  42. package/src/lib/chips/chips.component.html +17 -0
  43. package/src/lib/chips/chips.component.spec.ts +23 -0
  44. package/src/lib/chips/chips.component.ts +54 -0
  45. package/src/lib/component-library.component.spec.ts +23 -0
  46. package/src/lib/component-library.component.ts +16 -0
  47. package/src/lib/component-library.service.spec.ts +16 -0
  48. package/src/lib/component-library.service.ts +9 -0
  49. package/src/lib/datepicker/datepicker.component.css +33 -0
  50. package/src/lib/datepicker/datepicker.component.html +11 -0
  51. package/src/lib/datepicker/datepicker.component.spec.ts +23 -0
  52. package/src/lib/datepicker/datepicker.component.ts +36 -0
  53. package/src/lib/form-input/form-input.component.css +109 -0
  54. package/src/lib/form-input/form-input.component.html +27 -0
  55. package/src/lib/form-input/form-input.component.spec.ts +23 -0
  56. package/src/lib/form-input/form-input.component.ts +196 -0
  57. package/src/lib/form-select/form-select.component.css +157 -0
  58. package/src/lib/form-select/form-select.component.html +38 -0
  59. package/src/lib/form-select/form-select.component.spec.ts +23 -0
  60. package/src/lib/form-select/form-select.component.ts +54 -0
  61. package/src/lib/grid-cell/grid-cell.component.css +78 -0
  62. package/src/lib/grid-cell/grid-cell.component.html +31 -0
  63. package/src/lib/grid-cell/grid-cell.component.spec.ts +23 -0
  64. package/src/lib/grid-cell/grid-cell.component.ts +89 -0
  65. package/src/lib/header/header.component.css +62 -0
  66. package/src/lib/header/header.component.html +23 -0
  67. package/src/lib/header/header.component.spec.ts +23 -0
  68. package/src/lib/header/header.component.ts +28 -0
  69. package/src/lib/icon/icon.component.css +21 -0
  70. package/src/lib/icon/icon.component.html +5 -0
  71. package/src/lib/icon/icon.component.ts +49 -0
  72. package/src/lib/icon/icon.service.ts +27 -0
  73. package/src/lib/left-nav/left-nav.component.css +106 -0
  74. package/src/lib/left-nav/left-nav.component.html +48 -0
  75. package/src/lib/left-nav/left-nav.component.spec.ts +23 -0
  76. package/src/lib/left-nav/left-nav.component.ts +146 -0
  77. package/src/lib/stepper/stepper.component.css +96 -0
  78. package/src/lib/stepper/stepper.component.html +14 -0
  79. package/src/lib/stepper/stepper.component.spec.ts +23 -0
  80. package/src/lib/stepper/stepper.component.ts +61 -0
  81. package/src/lib/tabs/tabs.component.css +100 -0
  82. package/src/lib/tabs/tabs.component.html +16 -0
  83. package/src/lib/tabs/tabs.component.spec.ts +23 -0
  84. package/src/lib/tabs/tabs.component.ts +37 -0
  85. package/src/lib/toast/toast.component.css +107 -0
  86. package/src/lib/toast/toast.component.html +29 -0
  87. package/src/lib/toast/toast.component.spec.ts +23 -0
  88. package/src/lib/toast/toast.component.ts +87 -0
  89. package/src/lib/tool-tip/tool-tip.component.css +139 -0
  90. package/src/lib/tool-tip/tool-tip.component.html +31 -0
  91. package/src/lib/tool-tip/tool-tip.component.spec.ts +23 -0
  92. package/src/lib/tool-tip/tool-tip.component.ts +37 -0
  93. package/{public-api.d.ts → src/public-api.ts} +14 -0
  94. package/src/utils/validators.ts +68 -0
  95. package/tsconfig.lib.json +14 -0
  96. package/tsconfig.lib.prod.json +10 -0
  97. package/tsconfig.spec.json +14 -0
  98. package/esm2022/interfaces/avatar-interface.mjs +0 -2
  99. package/esm2022/interfaces/button-interface.mjs +0 -2
  100. package/esm2022/interfaces/chip-interface.mjs +0 -2
  101. package/esm2022/interfaces/grid-interface.mjs +0 -2
  102. package/esm2022/interfaces/select-interface.mjs +0 -2
  103. package/esm2022/interfaces/tab-interface.mjs +0 -2
  104. package/esm2022/lib/avatar/avatar.component.mjs +0 -56
  105. package/esm2022/lib/button/button.component.mjs +0 -84
  106. package/esm2022/lib/calendar-header/calendar-header.component.mjs +0 -168
  107. package/esm2022/lib/chips/chips.component.mjs +0 -62
  108. package/esm2022/lib/component-library.component.mjs +0 -19
  109. package/esm2022/lib/component-library.service.mjs +0 -14
  110. package/esm2022/lib/datepicker/datepicker.component.mjs +0 -40
  111. package/esm2022/lib/form-select/form-select.component.mjs +0 -59
  112. package/esm2022/lib/grid-cell/grid-cell.component.mjs +0 -84
  113. package/esm2022/lib/header/header.component.mjs +0 -37
  114. package/esm2022/lib/stepper/stepper.component.mjs +0 -64
  115. package/esm2022/lib/tabs/tabs.component.mjs +0 -38
  116. package/esm2022/lib/toast/toast.component.mjs +0 -54
  117. package/esm2022/lib/tool-tip/tool-tip.component.mjs +0 -41
  118. package/esm2022/public-api.mjs +0 -23
  119. package/esm2022/sarasanalytics-com-design-system.mjs +0 -5
  120. package/fesm2022/sarasanalytics-com-design-system.mjs +0 -760
  121. package/fesm2022/sarasanalytics-com-design-system.mjs.map +0 -1
  122. package/index.d.ts +0 -5
  123. package/interfaces/avatar-interface.d.ts +0 -6
  124. package/interfaces/button-interface.d.ts +0 -12
  125. package/interfaces/chip-interface.d.ts +0 -11
  126. package/interfaces/grid-interface.d.ts +0 -24
  127. package/interfaces/select-interface.d.ts +0 -19
  128. package/interfaces/tab-interface.d.ts +0 -6
  129. package/lib/avatar/avatar.component.d.ts +0 -18
  130. package/lib/button/button.component.d.ts +0 -26
  131. package/lib/calendar-header/calendar-header.component.d.ts +0 -31
  132. package/lib/chips/chips.component.d.ts +0 -22
  133. package/lib/component-library.component.d.ts +0 -5
  134. package/lib/component-library.service.d.ts +0 -6
  135. package/lib/datepicker/datepicker.component.d.ts +0 -9
  136. package/lib/form-select/form-select.component.d.ts +0 -17
  137. package/lib/grid-cell/grid-cell.component.d.ts +0 -20
  138. package/lib/header/header.component.d.ts +0 -14
  139. package/lib/stepper/stepper.component.d.ts +0 -17
  140. package/lib/tabs/tabs.component.d.ts +0 -15
  141. package/lib/toast/toast.component.d.ts +0 -18
  142. package/lib/tool-tip/tool-tip.component.d.ts +0 -15
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/component-library",
4
+ "assets": ["./assets"],
5
+ "lib": {
6
+ "entryFile": "src/public-api.ts"
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarasanalytics-com/design-system",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.2.0",
6
6
  "@angular/core": "^17.2.0"
@@ -8,18 +8,5 @@
8
8
  "dependencies": {
9
9
  "tslib": "^2.3.0"
10
10
  },
11
- "sideEffects": false,
12
- "module": "fesm2022/sarasanalytics-com-design-system.mjs",
13
- "typings": "index.d.ts",
14
- "exports": {
15
- "./package.json": {
16
- "default": "./package.json"
17
- },
18
- ".": {
19
- "types": "./index.d.ts",
20
- "esm2022": "./esm2022/sarasanalytics-com-design-system.mjs",
21
- "esm": "./esm2022/sarasanalytics-com-design-system.mjs",
22
- "default": "./fesm2022/sarasanalytics-com-design-system.mjs"
23
- }
24
- }
11
+ "sideEffects": false
25
12
  }
@@ -0,0 +1,6 @@
1
+ export interface AvatarInterface {
2
+ id: string | number,
3
+ size: string,
4
+ imagePath: string,
5
+ altText: string
6
+ }
@@ -0,0 +1,12 @@
1
+ export interface ButtonInterface {
2
+ id: string | number,
3
+ text: string,
4
+ type: string,
5
+ size: string,
6
+ state: string,
7
+ imagePath?: string,
8
+ iconPosition?: string,
9
+ href?: string,
10
+ hrefTarget?: string,
11
+ isSubmit?: boolean,
12
+ }
@@ -0,0 +1,11 @@
1
+ export interface ChipInterface {
2
+ id: string | number,
3
+ text: string,
4
+ type: string,
5
+ state: string,
6
+ filling: string,
7
+ iconPosition?: string,
8
+ iconPath?: string,
9
+ largeStateIcon?: string,
10
+ largeStateText?: string
11
+ }
@@ -0,0 +1,24 @@
1
+ import { ButtonInterface } from "./button-interface";
2
+ import { ChipInterface } from "./chip-interface";
3
+ import { AvatarInterface } from "./avatar-interface";
4
+ export interface GridInterface {
5
+ cellType: string,
6
+ viewText: boolean,
7
+ viewLeadingIcon: boolean,
8
+ viewTrailingIcon: boolean,
9
+ viewButton: boolean,
10
+ viewChip: boolean,
11
+ viewAvatar: boolean,
12
+ iconPath?: string,
13
+ chipConfig?: ChipInterface[],
14
+ buttonConfig?: ButtonInterface,
15
+ avatarConfig?: AvatarInterface,
16
+ text?: string | number,
17
+ subText?: string | number,
18
+ interactiveLink?: string,
19
+ interactiveLinkTarget?: string,
20
+ chipClicked?(evt: any): any,
21
+ linkClicked?(evt: any): any,
22
+ buttonClicked?(evt: any): any,
23
+ avatarClicked?(evt: any): any
24
+ }
@@ -0,0 +1,20 @@
1
+ import { FormlyFieldProps } from "@ngx-formly/core"
2
+ interface SelectSubInterface {
3
+ label: string,
4
+ supportText: string,
5
+ dropIcon: string,
6
+ dropIconPosition: string,
7
+ multiple: boolean,
8
+ iconPath: string,
9
+ type: string,
10
+ text?: string,
11
+ state: string,
12
+ filling: string,
13
+ iconPosition: string,
14
+ }
15
+
16
+ export interface SelectInterface extends FormlyFieldProps {
17
+ options: any,
18
+ disabled: boolean,
19
+ params: SelectSubInterface
20
+ }
@@ -0,0 +1,6 @@
1
+ export interface TabInterface {
2
+ tabName: string,
3
+ tabIcon?: string,
4
+ iconPosition?: string,
5
+ badgeContent?: string,
6
+ }
@@ -0,0 +1,48 @@
1
+ .extra-small {
2
+ --width: var(--medium-24px);
3
+ --height: var(--medium-24px);
4
+ }
5
+
6
+ .small {
7
+ --width: 28px;
8
+ --height: 28px;
9
+ }
10
+
11
+ .medium {
12
+ --width: 32px;
13
+ --height: 32px;
14
+ }
15
+
16
+ .large {
17
+ --width: 36px;
18
+ --height: 36px;
19
+ }
20
+
21
+ .extra-large {
22
+ --width: 40px;
23
+ --height: 40px;
24
+ }
25
+
26
+ .avatar {
27
+ display: flex;
28
+ }
29
+
30
+ .avatar-img {
31
+ background-color: var(--primary-50);
32
+ height: var(--height);
33
+ width: var(--width);
34
+ border-radius: var(--height);
35
+ object-fit: cover;
36
+
37
+ font-family: var(--font);
38
+ font-size: 11px;
39
+ font-weight: 500;
40
+ line-height: var(--height);
41
+ letter-spacing: 0.5px;
42
+ text-align: center;
43
+ overflow: none;
44
+ }
45
+
46
+ .avatar:hover {
47
+ cursor: pointer;
48
+ }
@@ -0,0 +1,5 @@
1
+ <div class="avatar {{size}}" (click)="avatarClicked($event)" (mouseenter)="mouseEnter($event)"
2
+ (mouseleave)="mouseLeave($event)">
3
+ <img *ngIf="imagePath" class="avatar-img" alt="{{altText}}" src="{{imagePath}}">
4
+ <p *ngIf="!imagePath" class="avatar-img">{{altText}}</p>
5
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { AvatarComponent } from './avatar.component';
4
+
5
+ describe('AvatarComponent', () => {
6
+ let component: AvatarComponent;
7
+ let fixture: ComponentFixture<AvatarComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [AvatarComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(AvatarComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,50 @@
1
+ import { Component, EventEmitter } from '@angular/core';
2
+ import { Input, Output } from '@angular/core';
3
+ import { NgIf } from '@angular/common';
4
+
5
+ @Component({
6
+ selector: 'sa-avatar',
7
+ standalone: true,
8
+ imports: [NgIf],
9
+ templateUrl: './avatar.component.html',
10
+ styleUrl: './avatar.component.css'
11
+ })
12
+ export class AvatarComponent {
13
+ @Input() id: string | number;
14
+ @Input() imagePath: string;
15
+ @Input() altText: string;
16
+ @Input() size: string;
17
+
18
+ @Output() onClickEvent = new EventEmitter
19
+ @Output() onMouseInEvent = new EventEmitter
20
+ @Output() onMouseOutEvent = new EventEmitter
21
+
22
+ eventEmitObject = {}
23
+
24
+ ngOnChanges(): void {
25
+ this.eventEmitObject = {
26
+ id: this.id
27
+ }
28
+ }
29
+
30
+ avatarClicked(evt: Event) {
31
+ this.onClickEvent.emit({
32
+ ...this.eventEmitObject,
33
+ evt
34
+ })
35
+ }
36
+
37
+ mouseEnter(evt: Event) {
38
+ this.onMouseInEvent.emit({
39
+ ...this.eventEmitObject,
40
+ evt
41
+ })
42
+ }
43
+
44
+ mouseLeave(evt: Event) {
45
+ this.onMouseOutEvent.emit({
46
+ ...this.eventEmitObject,
47
+ evt
48
+ })
49
+ }
50
+ }
@@ -0,0 +1,145 @@
1
+ .primary {
2
+ --default-bg: var(--primary-500);
3
+ --default-color: var(--text-white);
4
+ --default-border: transparent;
5
+ --hover-bg: var(--primary-700);
6
+ --hover-color: var(--text-white);
7
+ --hover-border: transparent;
8
+ --disabled-bg: var(--grey-100);
9
+ --disabled-color: var(--text-white);
10
+ --disabled-border: transparent;
11
+ --error-default-bg: var(--semantic-error-500);
12
+ --error-hover-bg: var(--semantic-error-600);
13
+ --error-default-color: var(--text-white);
14
+ --error-hover-color: var(--text-white);
15
+ --error-default-border: var(--semantic-error-500);
16
+ --error-hover-border: var(--semantic-error-500);
17
+ --svg-icon-color: var(--default-color);
18
+ }
19
+
20
+ .outline {
21
+ --default-bg: none;
22
+ --default-color: var(--primary-500);
23
+ --default-border: var(--primary-500);
24
+ --hover-bg: var(--primary-50);
25
+ --hover-color: var(--primary-700);
26
+ --hover-border: var(--primary-700);
27
+ --disabled-bg: none;
28
+ --disabled-color: var(--grey-100);
29
+ --disabled-border: var(--grey-100);
30
+ --error-default-bg: none;
31
+ --error-hover-bg: var(--semantic-error-50);
32
+ --error-default-color: var(--semantic-error-500);
33
+ --error-hover-color: var(--semantic-error-600);
34
+ --error-default-border: var(--semantic-error-500);
35
+ --error-hover-border: var(--semantic-error-600);
36
+ --svg-icon-color: var(--default-color);
37
+ }
38
+
39
+ .transparent {
40
+ --default-bg: none;
41
+ --default-color: var(--primary-500);
42
+ --default-border: transparent;
43
+ --hover-bg: var(--primary-50);
44
+ --hover-color: var(--primary-700);
45
+ --hover-border: transparent;
46
+ --disabled-bg: none;
47
+ --disabled-color: var(--grey-100);
48
+ --disabled-border: transparent;
49
+ --error-default-bg: none;
50
+ --error-hover-bg: var(--semantic-error-50);
51
+ --error-default-color: var(--semantic-error-500);
52
+ --error-hover-color: var(--semantic-error-600);
53
+ --error-default-border: transparent;
54
+ --error-hover-border: transparent;
55
+ --svg-icon-color: var(--default-color);
56
+ }
57
+
58
+ .large {
59
+ --sizing-1: var(--small-8px);
60
+ --sizing-2: var(--small-16px);
61
+ --sizing-3: var(--small-8px);
62
+ --height: var(--medium-36px);
63
+ --font-size: var(--small-14px);
64
+ }
65
+
66
+ .medium {
67
+ --sizing-1: var(--small-6px);
68
+ --sizing-2: var(--small-12px);
69
+ --sizing-3: var(--small-8px);
70
+ --height: var(--medium-32px);
71
+ --font-size: var(--small-14px);
72
+ }
73
+
74
+ .small {
75
+ --sizing-1: var(--small-4px);
76
+ --sizing-2: var(--small-8px);
77
+ --sizing-3: var(--small-8px);
78
+ --height: var(--medium-24px);
79
+ --font-size: var(--small-12px);
80
+ }
81
+
82
+ .disabled {
83
+ background-color: var(--disabled-bg) !important;
84
+ color: var(--disabled-color) !important;
85
+ border: 1px solid var(--disabled-border) !important;
86
+ cursor: default !important;
87
+ --svg-icon-color: var(--disabled-color) !important;
88
+ }
89
+
90
+ .error {
91
+ background-color: var(--error-default-bg) !important;
92
+ color: var(--error-default-color) !important;
93
+ border: 1px solid var(--error-default-border) !important;
94
+ --svg-icon-color: var(--error-default-color) !important;
95
+ }
96
+
97
+ .error:hover {
98
+ background-color: var(--error-hover-bg) !important;
99
+ color: var(--error-hover-color) !important;
100
+ --svg-icon-color: var(--error-hover-color) !important;
101
+ }
102
+
103
+ .sa-button {
104
+ display: flex;
105
+ width: max-content;
106
+ padding: var(--sizing-1) var(--sizing-2);
107
+ justify-content: center;
108
+ align-items: center;
109
+ gap: var(--sizing-3);
110
+ box-sizing: border-box;
111
+ height: var(--height);
112
+
113
+ border-radius: 4px;
114
+ font-family: var(--font);
115
+ font-size: var(--font-size);
116
+ cursor: pointer;
117
+
118
+ background-color: var(--default-bg);
119
+ border: 1px solid var(--default-border);
120
+ color: var(--default-color);
121
+
122
+ -webkit-user-select: none;
123
+ -khtml-user-select: none;
124
+ -moz-user-select: none;
125
+ -o-user-select: none;
126
+ user-select: none;
127
+ }
128
+
129
+ .sa-button:hover {
130
+ background-color: var(--hover-bg);
131
+ border: 1px solid var(--hover-border);
132
+ color: var(--hover-color);
133
+ --svg-icon-color: var(--hover-color);
134
+ }
135
+
136
+ .svg-icon {
137
+ mask-size: contain;
138
+ width: 16px;
139
+ height: 16px;
140
+ background-color: var(--svg-icon-color);
141
+ }
142
+
143
+ .btn-hide {
144
+ display: none;
145
+ }
@@ -0,0 +1,11 @@
1
+ <button (click)="buttonClicked($event)" id="sa-button-{{uuid}}" class="btn-hide"
2
+ [type]="isSubmit ? 'submit' : 'button'"></button>
3
+ <!-- (click)="buttonClicked()" on button instead of label breaks whole thing -->
4
+ <label for="sa-button-{{uuid}}" role="button" tabindex="0" (mouseenter)="mouseIn()" (mouseleave)="mouseOut()"
5
+ (keydown.enter)="buttonClicked($event)" for="sa-button" class="sa-button {{state}} {{type}} {{size}}">
6
+ <div class="svg-icon" [style]="svgStyle"
7
+ [style.display]="(iconPosition == 'left' || iconPosition == 'both') ? 'block' : 'none'"></div>
8
+ {{text}}
9
+ <div class="svg-icon" [style]="svgStyle"
10
+ [style.display]="(iconPosition == 'right' || iconPosition == 'both') ? 'block' : 'none'"></div>
11
+ </label>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ButtonComponent } from './button.component';
4
+
5
+ describe('ButtonComponent', () => {
6
+ let component: ButtonComponent;
7
+ let fixture: ComponentFixture<ButtonComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [ButtonComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ButtonComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,68 @@
1
+ import { Component, Output } from '@angular/core';
2
+ import { Input } from '@angular/core';
3
+ import { EventEmitter } from '@angular/core';
4
+ import { NgIf } from '@angular/common';
5
+ import { NgStyle } from '@angular/common';
6
+
7
+ let nextId = 0; // used to give unique ids to inputs used in html
8
+
9
+ @Component({
10
+ selector: 'sa-button',
11
+ standalone: true,
12
+ imports: [NgIf, NgStyle],
13
+ templateUrl: './button.component.html',
14
+ styleUrl: './button.component.css'
15
+ })
16
+
17
+ export class ButtonComponent {
18
+ @Input() id: string | number;
19
+ @Input() type: string;
20
+ @Input() state: string;
21
+ @Input() size: string;
22
+ @Input() text: string | number;
23
+ @Input() ImagePath: string;
24
+ @Input() iconPosition: string;
25
+ @Input() href: string;
26
+ @Input() hrefTarget: string;
27
+ @Input() isSubmit: boolean = false;
28
+
29
+ @Output() onClickEvent = new EventEmitter();
30
+ @Output() onMouseInEvent = new EventEmitter();
31
+ @Output() onMouseOutEvent = new EventEmitter();
32
+
33
+ svgStyle = {}
34
+ eventEmitObject = {}
35
+ uuid: number = nextId++;
36
+
37
+ ngOnChanges(): void {
38
+ this.svgStyle = {
39
+ '-webkit-mask-image': `url(${this.ImagePath})`,
40
+ 'mask-image': `url(${this.ImagePath})`,
41
+ }
42
+ this.eventEmitObject = {
43
+ id: this.id
44
+ }
45
+ }
46
+
47
+ buttonClicked(evt: Event) {
48
+ if (this.state == "disabled") return;
49
+ this.onClickEvent.emit({
50
+ ...this.eventEmitObject,
51
+ evt
52
+ });
53
+ if (this.href != "") {
54
+ if (this.hrefTarget == "blank") window.open(this.href);
55
+ else if (this.hrefTarget == "self") location.href = this.href;
56
+ }
57
+ }
58
+
59
+ mouseIn() {
60
+ if (this.state == "disabled") return;
61
+ this.onMouseInEvent.emit();
62
+ }
63
+
64
+ mouseOut() {
65
+ if (this.state == "disabled") return;
66
+ this.onMouseOutEvent.emit();
67
+ }
68
+ }
@@ -0,0 +1,67 @@
1
+ .header {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ border-bottom: 1px solid var(--grey-50);
6
+ margin-top: -4px;
7
+ margin-bottom: var(--small-8px, 8px);
8
+ }
9
+
10
+ .header-label {
11
+ font-family: Roboto;
12
+ font-size: 14px;
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ line-height: 20px;
16
+ letter-spacing: 0.25px;
17
+ }
18
+
19
+ .range-preset {
20
+ width: 180px;
21
+ position: absolute;
22
+
23
+ padding: var(--small-12px, 12px) 0 0 var(--medium-24px, 24px);
24
+ box-sizing: border-box;
25
+
26
+
27
+ margin-top: -9px;
28
+ margin-left: -180px;
29
+
30
+ height: 356px;
31
+ background-color: white;
32
+ border-top: 1px solid var(--grey-50);
33
+ border-left: 1px solid var(--grey-50);
34
+ border-bottom: 1px solid var(--grey-50);
35
+ border-bottom-left-radius: var(--small-8px, 8px);
36
+ border-top-left-radius: var(--small-8px, 8px);
37
+
38
+ gap: var(--small-8px, 8px);
39
+
40
+ display: flex;
41
+ flex-direction: column;
42
+ }
43
+
44
+ .preset {
45
+ padding: var(--small-8px, 8px);
46
+ display: flex;
47
+ gap: var(--small-4px, 4px);
48
+ font-size: 14px;
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ line-height: 20px;
52
+ letter-spacing: 0.25px;
53
+ color: var(--text-mediumemphasis);
54
+ margin-bottom: -5px;
55
+ }
56
+
57
+ .preset-radio {
58
+ cursor: pointer;
59
+ }
60
+
61
+ .preset-label {
62
+ cursor: pointer;
63
+ }
64
+
65
+ .preset-selected {
66
+ color: var(--primary-500);
67
+ }
@@ -0,0 +1,20 @@
1
+ <div class="range-preset">
2
+ <div class="preset" *ngFor="let preset of presets, let i = index">
3
+ <label class="preset-label {{preset == selectedPreset ? 'preset-selected' : ''}}"
4
+ for="preset-radio-{{i}}">{{preset}}</label>
5
+ <input class="preset-radio" (change)="presetChanged($event)" [checked]="preset == selectedPreset"
6
+ id="preset-radio-{{i}}" type="radio" name="preset-radios-{{uuid}}" value="{{preset}}">
7
+ </div>
8
+ </div>
9
+
10
+ <div class="header">
11
+ <button mat-icon-button (click)="previousClicked('month')">
12
+ <mat-icon>keyboard_arrow_left</mat-icon>
13
+ </button>
14
+
15
+ <button mat-button class="header-label" (click)="changeView()">{{ periodLabel }}</button>
16
+
17
+ <button mat-icon-button (click)="nextClicked('month')">
18
+ <mat-icon>keyboard_arrow_right</mat-icon>
19
+ </button>
20
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CalendarHeaderComponent } from './calendar-header.component';
4
+
5
+ describe('CalendarHeaderComponent', () => {
6
+ let component: CalendarHeaderComponent;
7
+ let fixture: ComponentFixture<CalendarHeaderComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [CalendarHeaderComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CalendarHeaderComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });