@sarasanalytics-com/design-system 0.0.3 → 0.0.4

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 (181) hide show
  1. package/README.md +9 -12
  2. package/esm2022/interfaces/avatar-interface.mjs +2 -0
  3. package/esm2022/interfaces/button-interface.mjs +2 -0
  4. package/esm2022/interfaces/chip-interface.mjs +2 -0
  5. package/esm2022/interfaces/grid-interface.mjs +2 -0
  6. package/esm2022/interfaces/select-interface.mjs +2 -0
  7. package/esm2022/interfaces/tab-interface.mjs +2 -0
  8. package/esm2022/lib/avatar/avatar.component.mjs +56 -0
  9. package/esm2022/lib/button/button.component.mjs +84 -0
  10. package/esm2022/lib/calendar-header/calendar-header.component.mjs +170 -0
  11. package/esm2022/lib/chips/chips.component.mjs +62 -0
  12. package/esm2022/lib/component-library.component.mjs +19 -0
  13. package/esm2022/lib/component-library.service.mjs +14 -0
  14. package/esm2022/lib/datepicker/datepicker.component.mjs +39 -0
  15. package/esm2022/lib/form-select/form-select.component.mjs +59 -0
  16. package/esm2022/lib/grid-cell/grid-cell.component.mjs +84 -0
  17. package/esm2022/lib/header/header.component.mjs +37 -0
  18. package/esm2022/lib/stepper/stepper.component.mjs +64 -0
  19. package/esm2022/lib/tabs/tabs.component.mjs +38 -0
  20. package/esm2022/lib/toast/toast.component.mjs +54 -0
  21. package/esm2022/lib/tool-tip/tool-tip.component.mjs +41 -0
  22. package/esm2022/public-api.mjs +23 -0
  23. package/esm2022/sarasanalytics-com-design-system.mjs +5 -0
  24. package/fesm2022/sarasanalytics-com-design-system.mjs +760 -0
  25. package/fesm2022/sarasanalytics-com-design-system.mjs.map +1 -0
  26. package/index.d.ts +5 -0
  27. package/interfaces/avatar-interface.d.ts +6 -0
  28. package/interfaces/button-interface.d.ts +12 -0
  29. package/interfaces/chip-interface.d.ts +11 -0
  30. package/interfaces/grid-interface.d.ts +24 -0
  31. package/interfaces/select-interface.d.ts +19 -0
  32. package/interfaces/tab-interface.d.ts +6 -0
  33. package/lib/avatar/avatar.component.d.ts +18 -0
  34. package/lib/button/button.component.d.ts +26 -0
  35. package/lib/calendar-header/calendar-header.component.d.ts +31 -0
  36. package/lib/chips/chips.component.d.ts +22 -0
  37. package/lib/component-library.component.d.ts +5 -0
  38. package/lib/component-library.service.d.ts +6 -0
  39. package/lib/datepicker/datepicker.component.d.ts +9 -0
  40. package/lib/form-select/form-select.component.d.ts +17 -0
  41. package/lib/grid-cell/grid-cell.component.d.ts +20 -0
  42. package/lib/header/header.component.d.ts +14 -0
  43. package/lib/stepper/stepper.component.d.ts +17 -0
  44. package/lib/tabs/tabs.component.d.ts +15 -0
  45. package/lib/toast/toast.component.d.ts +18 -0
  46. package/lib/tool-tip/tool-tip.component.d.ts +15 -0
  47. package/package.json +19 -68
  48. package/{projects/component-library/src/public-api.ts → public-api.d.ts} +1 -7
  49. package/.editorconfig +0 -16
  50. package/.eslintrc.json +0 -22
  51. package/.storybook/main.ts +0 -21
  52. package/.storybook/manager.ts +0 -17
  53. package/.storybook/preview-head.html +0 -5
  54. package/.storybook/preview.ts +0 -65
  55. package/.storybook/tsconfig.doc.json +0 -10
  56. package/.storybook/tsconfig.json +0 -11
  57. package/.storybook/typings.d.ts +0 -4
  58. package/.vscode/extensions.json +0 -7
  59. package/.vscode/launch.json +0 -20
  60. package/.vscode/settings.json +0 -13
  61. package/.vscode/tasks.json +0 -42
  62. package/angular.json +0 -189
  63. package/build-storybook.log +0 -39
  64. package/documentation.json +0 -0
  65. package/projects/component-library/README.md +0 -24
  66. package/projects/component-library/ng-package.json +0 -8
  67. package/projects/component-library/package.json +0 -12
  68. package/projects/component-library/src/interfaces/avatar-interface.ts +0 -6
  69. package/projects/component-library/src/interfaces/button-interface.ts +0 -12
  70. package/projects/component-library/src/interfaces/chip-interface.ts +0 -11
  71. package/projects/component-library/src/interfaces/grid-interface.ts +0 -24
  72. package/projects/component-library/src/interfaces/select-interface.ts +0 -19
  73. package/projects/component-library/src/interfaces/tab-interface.ts +0 -6
  74. package/projects/component-library/src/lib/avatar/avatar.component.css +0 -48
  75. package/projects/component-library/src/lib/avatar/avatar.component.html +0 -5
  76. package/projects/component-library/src/lib/avatar/avatar.component.spec.ts +0 -23
  77. package/projects/component-library/src/lib/avatar/avatar.component.ts +0 -50
  78. package/projects/component-library/src/lib/button/button.component.css +0 -145
  79. package/projects/component-library/src/lib/button/button.component.html +0 -11
  80. package/projects/component-library/src/lib/button/button.component.spec.ts +0 -23
  81. package/projects/component-library/src/lib/button/button.component.ts +0 -68
  82. package/projects/component-library/src/lib/calendar-header/calendar-header.component.css +0 -67
  83. package/projects/component-library/src/lib/calendar-header/calendar-header.component.html +0 -20
  84. package/projects/component-library/src/lib/calendar-header/calendar-header.component.spec.ts +0 -23
  85. package/projects/component-library/src/lib/calendar-header/calendar-header.component.ts +0 -196
  86. package/projects/component-library/src/lib/chips/chips.component.css +0 -129
  87. package/projects/component-library/src/lib/chips/chips.component.html +0 -17
  88. package/projects/component-library/src/lib/chips/chips.component.spec.ts +0 -23
  89. package/projects/component-library/src/lib/chips/chips.component.ts +0 -55
  90. package/projects/component-library/src/lib/component-library.component.spec.ts +0 -23
  91. package/projects/component-library/src/lib/component-library.component.ts +0 -16
  92. package/projects/component-library/src/lib/component-library.service.spec.ts +0 -16
  93. package/projects/component-library/src/lib/component-library.service.ts +0 -9
  94. package/projects/component-library/src/lib/datepicker/datepicker.component.css +0 -33
  95. package/projects/component-library/src/lib/datepicker/datepicker.component.html +0 -11
  96. package/projects/component-library/src/lib/datepicker/datepicker.component.spec.ts +0 -23
  97. package/projects/component-library/src/lib/datepicker/datepicker.component.ts +0 -37
  98. package/projects/component-library/src/lib/form-select/form-select.component.css +0 -156
  99. package/projects/component-library/src/lib/form-select/form-select.component.html +0 -38
  100. package/projects/component-library/src/lib/form-select/form-select.component.spec.ts +0 -23
  101. package/projects/component-library/src/lib/form-select/form-select.component.ts +0 -54
  102. package/projects/component-library/src/lib/grid-cell/grid-cell.component.css +0 -78
  103. package/projects/component-library/src/lib/grid-cell/grid-cell.component.html +0 -31
  104. package/projects/component-library/src/lib/grid-cell/grid-cell.component.spec.ts +0 -23
  105. package/projects/component-library/src/lib/grid-cell/grid-cell.component.ts +0 -89
  106. package/projects/component-library/src/lib/header/header.component.css +0 -62
  107. package/projects/component-library/src/lib/header/header.component.html +0 -23
  108. package/projects/component-library/src/lib/header/header.component.spec.ts +0 -23
  109. package/projects/component-library/src/lib/header/header.component.ts +0 -28
  110. package/projects/component-library/src/lib/stepper/stepper.component.css +0 -96
  111. package/projects/component-library/src/lib/stepper/stepper.component.html +0 -14
  112. package/projects/component-library/src/lib/stepper/stepper.component.spec.ts +0 -23
  113. package/projects/component-library/src/lib/stepper/stepper.component.ts +0 -61
  114. package/projects/component-library/src/lib/tabs/tabs.component.css +0 -100
  115. package/projects/component-library/src/lib/tabs/tabs.component.html +0 -16
  116. package/projects/component-library/src/lib/tabs/tabs.component.spec.ts +0 -23
  117. package/projects/component-library/src/lib/tabs/tabs.component.ts +0 -37
  118. package/projects/component-library/src/lib/toast/toast.component.css +0 -108
  119. package/projects/component-library/src/lib/toast/toast.component.html +0 -25
  120. package/projects/component-library/src/lib/toast/toast.component.spec.ts +0 -23
  121. package/projects/component-library/src/lib/toast/toast.component.ts +0 -37
  122. package/projects/component-library/src/lib/tool-tip/tool-tip.component.css +0 -139
  123. package/projects/component-library/src/lib/tool-tip/tool-tip.component.html +0 -31
  124. package/projects/component-library/src/lib/tool-tip/tool-tip.component.spec.ts +0 -23
  125. package/projects/component-library/src/lib/tool-tip/tool-tip.component.ts +0 -37
  126. package/projects/component-library/tsconfig.lib.json +0 -14
  127. package/projects/component-library/tsconfig.lib.prod.json +0 -10
  128. package/projects/component-library/tsconfig.spec.json +0 -14
  129. package/src/Saras-logo.svg +0 -15
  130. package/src/app/app.component.css +0 -13
  131. package/src/app/app.component.html +0 -77
  132. package/src/app/app.component.spec.ts +0 -29
  133. package/src/app/app.component.ts +0 -505
  134. package/src/app/app.config.ts +0 -27
  135. package/src/app/app.routes.ts +0 -3
  136. package/src/app/data.ts +0 -52
  137. package/src/app/kitchen-sink/kitchen-sink.component.css +0 -29
  138. package/src/app/kitchen-sink/kitchen-sink.component.html +0 -7
  139. package/src/app/kitchen-sink/kitchen-sink.component.spec.ts +0 -23
  140. package/src/app/kitchen-sink/kitchen-sink.component.ts +0 -92
  141. package/src/assets/.gitkeep +0 -0
  142. package/src/assets/Chevron.svg +0 -5
  143. package/src/assets/Frame.svg +0 -5
  144. package/src/assets/Grid.svg +0 -5
  145. package/src/assets/Location.svg +0 -5
  146. package/src/assets/Mail.svg +0 -5
  147. package/src/assets/Person.svg +0 -5
  148. package/src/assets/Scan.svg +0 -5
  149. package/src/assets/Sources.svg +0 -5
  150. package/src/assets/arrow.svg +0 -5
  151. package/src/assets/avatar.svg +0 -12
  152. package/src/assets/checkmark.svg +0 -5
  153. package/src/assets/crossmark.svg +0 -5
  154. package/src/assets/dot.svg +0 -5
  155. package/src/assets/negativemark.svg +0 -5
  156. package/src/assets/pointer-polygon.svg +0 -3
  157. package/src/assets/tick-icon.svg +0 -5
  158. package/src/assets/tick.svg +0 -8
  159. package/src/assets/warningmark.svg +0 -5
  160. package/src/custom-theme.scss +0 -37
  161. package/src/favicon.ico +0 -0
  162. package/src/index.html +0 -23
  163. package/src/main.ts +0 -6
  164. package/src/stories/GettingStarted.mdx +0 -233
  165. package/src/stories/KitchenSink.stories.ts +0 -86
  166. package/src/stories/avatar.stories.ts +0 -45
  167. package/src/stories/chips.stories.ts +0 -61
  168. package/src/stories/custom-button.stories.ts +0 -74
  169. package/src/stories/datepicker.stories.ts +0 -78
  170. package/src/stories/gridCell.stories.ts +0 -234
  171. package/src/stories/header.stories.ts +0 -61
  172. package/src/stories/selectInput.stories.ts +0 -158
  173. package/src/stories/stepper.stories.ts +0 -92
  174. package/src/stories/tabs.stories.ts +0 -97
  175. package/src/stories/toast.stories.ts +0 -54
  176. package/src/stories/tool-tip.stories.ts +0 -45
  177. package/src/styles.css +0 -204
  178. package/src/svg.d.ts +0 -1
  179. package/tsconfig.app.json +0 -14
  180. package/tsconfig.json +0 -42
  181. package/tsconfig.spec.json +0 -14
@@ -1,156 +0,0 @@
1
- .idle {
2
- --border: 1px solid var(--grey-50);
3
- }
4
-
5
- .activated {
6
- --border: 1px solid var(--primary-300);
7
- }
8
-
9
- .disabled {
10
- border: 1px solid var(--grey-50) !important;
11
- }
12
-
13
- .ng-select-field:hover {
14
- --border: 1px solid var(--primary-300);
15
- --font-color: var(--text-highemphasis);
16
- }
17
-
18
- .ng-select-field {
19
- position: relative;
20
- display: inline-flex;
21
- padding: 0px var(--small-12px);
22
- height: 40px;
23
- justify-content: center;
24
- align-items: center;
25
- border: var(--border);
26
- border-radius: var(--small-4px);
27
- font-family: var(--font);
28
- font-size: 14px;
29
- font-style: normal;
30
- font-weight: 400;
31
- line-height: 20px;
32
- letter-spacing: 0.25px;
33
- --font-color: var(--text-lowemphasis);
34
- }
35
-
36
- .ng-select {
37
- width: min-content;
38
- min-width: 100px;
39
- display: inline-flex;
40
- justify-content: center;
41
- align-items: center;
42
- flex-shrink: 0;
43
- }
44
-
45
- .ng-select ::ng-deep .ng-select-container {
46
- display: inline-flex;
47
-
48
- justify-content: center;
49
- align-items: center;
50
- flex-shrink: 0;
51
- font-family: var(--font);
52
- box-sizing: border-box;
53
- border: none;
54
- }
55
-
56
- .ng-select ::ng-deep .ng-dropdown-panel {
57
- margin-top: 2px;
58
- border: 1px solid var(--grey-50);
59
- box-shadow: none !important;
60
- }
61
-
62
- .ng-select ::ng-deep .ng-select-container {
63
- box-shadow: none !important;
64
- position: relative !important;
65
- z-index: 1 !important;
66
- }
67
-
68
- .ng-select ::ng-deep .ng-value-container {
69
- padding: 0 !important;
70
- flex-wrap: nowrap !important;
71
- display: flex;
72
- justify-content: flex-start;
73
- gap: 5px;
74
- overflow-x: hidden;
75
- }
76
-
77
- .ng-select ::ng-deep .ng-value {
78
- flex: none;
79
- margin: 0 !important;
80
- }
81
-
82
- .overflow-label {
83
- padding: 0px 5px;
84
- cursor: pointer;
85
- }
86
-
87
- .ng-select ::ng-deep .ng-placeholder {
88
- padding: 0 !important;
89
- position: inherit !important;
90
- color: var(--text-lowemphasis);
91
- }
92
-
93
- .ng-select ::ng-deep .ng-input {
94
- padding: 0 !important;
95
- position: inherit !important;
96
- }
97
-
98
- .ng-select ::ng-deep .ng-clear-wrapper {
99
- z-index: 9;
100
- display: flex;
101
- margin-left: 5px;
102
- }
103
-
104
-
105
- .ng-select ::ng-deep .ng-arrow {
106
- border-color: none !important;
107
- border-style: none !important;
108
- border-width: 0 !important;
109
- }
110
-
111
- .svg-icon {
112
- mask-size: contain;
113
- width: 20px;
114
- height: 20px;
115
- background-color: grey;
116
- }
117
-
118
- .svg-icon:hover {
119
- cursor: pointer;
120
- }
121
-
122
- .ng-select ::ng-deep .ng-arrow-wrapper {
123
- display: none;
124
- }
125
-
126
- .support-label {
127
- font-family: var(--font);
128
- font-size: 11px;
129
- font-style: normal;
130
- font-weight: 400;
131
- line-height: 16px;
132
- letter-spacing: 0.5px;
133
- color: var(--text-lowemphasis);
134
- padding: var(--small-4px) var(--small-16px) 0px var(--small-16px);
135
- }
136
-
137
- .clicked-label {
138
- position: relative;
139
- width: max-content;
140
-
141
- font-family: var(--font);
142
- font-size: 11px;
143
- font-style: normal;
144
- font-weight: 500;
145
- line-height: 16px;
146
- letter-spacing: 0.5px;
147
-
148
- color: var(--text-lowemphasis);
149
-
150
- padding: 0 var(--small-8px);
151
- margin-left: 12px;
152
- margin-bottom: -8px;
153
- z-index: 99;
154
-
155
- background-color: white;
156
- }
@@ -1,38 +0,0 @@
1
- <div [style.visibility]="(openState || topLabel) ? 'visible' : 'hidden'" class="clicked-label">{{params.label}}</div>
2
- <div class="ng-select-field {{openState ? 'activated' : 'idle'}} {{field.props.disabled ? 'disabled' : ''}}">
3
-
4
- <div role="button" title="drop-button" tabindex="0" class="left-icon svg-icon" [style]="svgStyle"
5
- (click)="openClose(true)" (blur)="openClose(false)"
6
- *ngIf="(params.dropIconPosition == 'left' || params.dropIconPosition == 'both')">
7
- </div>
8
-
9
- <ng-select (change)="checkForZero($event)" (remove)="shiftLabel('removed')" (clear)="shiftLabel('cleared')"
10
- (search)="openClose(true)" (focus)="openClose(true)" (blur)=" openClose(false)" [isOpen]="openState"
11
- placeholder={{params.label}} bindLabel="name" [items]="selectables" [multiple]="params.multiple"
12
- [formControl]="formControl" [style] [formlyAttributes]="field">
13
- <ng-template ng-multi-label-tmp let-items="items" let-clear="clear">
14
- <div *ngFor="let item of (items ? items.slice(startInd,startInd+labelLimit): [])">
15
- <sa-chip (onClickEvent)=" (!field.props.disabled) ? clear(item) : null" [id]="item.id"
16
- [iconPath]="params.iconPath" [text]="item.name" [type]="params.type"
17
- [state]="field.props.disabled ? 'neutral' : params.state" [filling]="params.filling"
18
- [iconPosition]="params.iconPosition">
19
- </sa-chip>
20
- </div>
21
- <div (click)="shiftLabel('clicked')" class="ng-value overflow-label" *ngIf="items.length > (startInd+labelLimit)">
22
- <sa-chip text="+{{items.length-(startInd+labelLimit)}}" type="regular" state="default" filling="filled">
23
- </sa-chip>
24
- </div>
25
- <div (click)="shiftLabel('cleared')" *ngIf="startInd == items.length-labelLimit" class="ng-value overflow-label">
26
- <sa-chip text="..." type="regular" state="default" filling="filled">
27
- </sa-chip>
28
- </div>
29
- </ng-template>
30
- </ng-select>
31
-
32
- <div role="button" title="drop-button" tabindex="0" class="right-icon svg-icon" [style]="svgStyle"
33
- (click)="openClose(true)" (blur)="openClose(false)"
34
- *ngIf="(params.dropIconPosition == 'right' || params.dropIconPosition == 'both')">
35
- </div>
36
-
37
- </div>
38
- <div class="support-label">{{params.supportText}}</div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { FormSelectComponent } from './form-select.component';
4
-
5
- describe('FormSelectComponent', () => {
6
- let component: FormSelectComponent;
7
- let fixture: ComponentFixture<FormSelectComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [FormSelectComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(FormSelectComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,54 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ReactiveFormsModule } from '@angular/forms';
3
- import { FormlyModule } from '@ngx-formly/core';
4
- import { FieldType, FieldTypeConfig } from '@ngx-formly/core';
5
- import { NgSelectModule } from '@ng-select/ng-select';
6
- import { ChipsComponent } from '../chips/chips.component';
7
- import { NgIf, NgFor } from '@angular/common';
8
-
9
- @Component({
10
- selector: 'lib-form-select',
11
- standalone: true,
12
- imports: [
13
- ReactiveFormsModule,
14
- FormlyModule,
15
- ReactiveFormsModule,
16
- NgSelectModule,
17
- ChipsComponent,
18
- NgIf,
19
- NgFor
20
- ],
21
- templateUrl: './form-select.component.html',
22
- styleUrl: './form-select.component.css'
23
- })
24
- export class FormSelectComponent extends FieldType<FieldTypeConfig> {
25
- selectables: any;
26
- params: any;
27
-
28
- svgStyle = {};
29
- openState: boolean = false;
30
- topLabel: boolean;
31
- startInd: number = 0;
32
- labelLimit: number = 2;
33
-
34
- ngOnInit() {
35
- this.selectables = this.field.props.options;
36
- this.params = this.field.props['params'];
37
- this.svgStyle = {
38
- '-webkit-mask-image': `url(${this.params.dropIcon})})`,
39
- 'mask-image': `url(${this.params.dropIcon})`,
40
- }
41
- }
42
- openClose(state: boolean) {
43
- if (this.field.props.disabled) return;
44
- this.openState = state;
45
- }
46
- shiftLabel(action: string) {
47
- if (action == 'clicked') this.startInd++;
48
- if (action == 'cleared') this.startInd = 0;
49
- if (action == 'removed' && this.startInd > 0) this.startInd--;
50
- }
51
- checkForZero(selected: any) {
52
- this.topLabel = selected.length == 0 ? false : true;
53
- }
54
- }
@@ -1,78 +0,0 @@
1
- .header {
2
- --bg: var(--primary-50);
3
- --color: var(--text-highemphasis);
4
- --border: none;
5
- --flex-direction: left;
6
- }
7
-
8
- .header:hover {
9
- cursor: pointer;
10
- }
11
-
12
- .row {
13
- --color: var(--text-highemphasis);
14
- --cursor: default;
15
- --border: var(--grey-50);
16
- --flex-direction: left;
17
- }
18
-
19
- .numeric {
20
- --color: var(--text-highemphasis);
21
- --cursor: default;
22
- --border: var(--grey-50);
23
- --flex-direction: right;
24
- }
25
-
26
- .interactive {
27
- --color: var(--primary-500);
28
- --cursor: pointer;
29
- --border: var(--grey-50);
30
- --flex-direction: left;
31
- }
32
-
33
- .grid-cell {
34
- display: flex;
35
- height: 48px;
36
- padding: var(--small-12px);
37
- justify-content: var(--flex-direction);
38
- align-items: center;
39
- gap: var(--small-8px);
40
- flex-shrink: 0;
41
-
42
- font-family: var(--font);
43
- box-sizing: border-box;
44
- border-bottom: 1px solid var(--border);
45
-
46
- width: calc(100% - 20px);
47
- background-color: var(--bg);
48
- }
49
-
50
- .grid-text {
51
- display: flex;
52
- flex-direction: column;
53
- }
54
-
55
- .main-text {
56
- color: var(--color);
57
- font-size: 14px;
58
- font-weight: 400;
59
- height: 20px;
60
- line-height: 20px;
61
- }
62
-
63
- .main-text:hover {
64
- cursor: var(--cursor);
65
- }
66
-
67
- .sub-text {
68
- font-size: 11px;
69
- font-weight: 400;
70
- height: 16px;
71
- line-height: 16px;
72
- color: var(--text-mediumemphasis);
73
- }
74
-
75
- .icons {
76
- width: var(--medium-20px);
77
- height: var(--medium-20px);
78
- }
@@ -1,31 +0,0 @@
1
- <div class="grid-cell {{params.cellType}}">
2
-
3
- <img class="icons" src={{params.iconPath}} [style.display]="(params.viewLeadingIcon) ? 'block' : 'none'" alt="">
4
-
5
- <sa-avatar [id]="params.avatarConfig?.id" [altText]="params.avatarConfig?.altText"
6
- [imagePath]="params.avatarConfig?.imagePath" [size]="params.avatarConfig?.size"
7
- [style.display]="(params.viewAvatar) ? 'block' : 'none'" (onClickEvent)="avatarClicked($event)">
8
- </sa-avatar>
9
-
10
- <div class="grid-text" [style.display]="(params.viewText) ? 'block' : 'none'">
11
- <div [style.display]="(params.text) ? 'block' : 'none'" (click)="linkClicked()" class="main-text">{{params.text}}
12
- </div>
13
-
14
- <div [style.display]="(params.subText) ? 'block' : 'none'" class="sub-text">{{params.subText}}</div>
15
- </div>
16
-
17
- <img class="icons" src={{params.iconPath}} [style.display]="(params.viewTrailingIcon) ? 'block' : 'none'" alt="">
18
-
19
-
20
- <sa-chip *ngFor="let config of params.chipConfig, let i = index" [id]="config.id" [filling]="config.filling"
21
- id="chip_{{rowNum}}_{{config.id}}" [iconPath]="config.iconPath" [iconPosition]="config.iconPosition"
22
- [largeStateIcon]="config.largeStateIcon" [state]="config.state" [type]="config.type" [text]="config.text"
23
- [style.display]="(params.viewChip) ? 'block' : 'none'" (onClickEvent)="chipClicked($event)"></sa-chip>
24
-
25
- <sa-button [iconPosition]="params.buttonConfig?.iconPosition" [ImagePath]="params.buttonConfig?.imagePath"
26
- [id]="params.buttonConfig?.id" [size]="params.buttonConfig?.size" [state]="params.buttonConfig?.state"
27
- [type]="params.buttonConfig?.type" [text]="params.buttonConfig?.text" [href]="params.buttonConfig?.href"
28
- [hrefTarget]="params.buttonConfig?.hrefTarget" [style.display]="(params.viewButton) ? 'block' : 'none'"
29
- (onClickEvent)="buttonClicked($event)"></sa-button>
30
-
31
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { GridCellComponent } from './grid-cell.component';
4
-
5
- describe('GridCellComponent', () => {
6
- let component: GridCellComponent;
7
- let fixture: ComponentFixture<GridCellComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [GridCellComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(GridCellComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,89 +0,0 @@
1
- import { Component, EventEmitter, input } from '@angular/core';
2
- import { Output } from '@angular/core';
3
- import { AvatarComponent } from '../avatar/avatar.component';
4
- import { ChipsComponent } from '../chips/chips.component';
5
- import { ButtonComponent } from '../button/button.component';
6
- import { NgFor } from '@angular/common';
7
- import { ICellRendererAngularComp, IHeaderAngularComp } from 'ag-grid-angular';
8
- import { GridInterface } from '../../interfaces/grid-interface';
9
-
10
- @Component({
11
- selector: 'lib-grid-cell',
12
- standalone: true,
13
- imports: [
14
- AvatarComponent,
15
- ChipsComponent,
16
- ButtonComponent,
17
- NgFor
18
- ],
19
- templateUrl: './grid-cell.component.html',
20
- styleUrl: './grid-cell.component.css'
21
- })
22
- export class GridCellComponent implements ICellRendererAngularComp, IHeaderAngularComp {
23
- params: GridInterface;
24
- rowNum: number;
25
-
26
- @Output() onClickButtonEvent = new EventEmitter();
27
- @Output() onClickChipEvent = new EventEmitter();
28
- @Output() onClickLinkEvent = new EventEmitter();
29
- @Output() onClickAvatarEvent = new EventEmitter();
30
-
31
- buttonClicked(evt: Event) {
32
- this.params.buttonClicked && this.params.buttonClicked({ // calls the function passed via params in gridInterface.
33
- ...evt,
34
- rowId: this.rowNum
35
- });
36
- this.onClickButtonEvent.emit({ ...evt, rowId: this.rowNum }); // this event isn't caught by anything.
37
- }
38
-
39
- // above function behavior is same for all functions in this class
40
-
41
- chipClicked(evt: Event) {
42
- this.params.chipClicked && this.params.chipClicked({
43
- ...evt,
44
- rowId: this.rowNum
45
- });
46
- this.onClickChipEvent.emit({ ...evt, rowId: this.rowNum });
47
- }
48
-
49
- linkClicked() {
50
- if (this.params.cellType != "interactive") return;
51
-
52
- this.params.linkClicked && this.params.linkClicked({ //calling function passed in params with rowId object in arguments
53
- rowId: this.rowNum
54
- });
55
-
56
- if (this.params.interactiveLink != "") {
57
- if (this.params.interactiveLinkTarget == "blank") {
58
- window.open(this.params.interactiveLink)!;
59
- }
60
- else if (this.params.interactiveLinkTarget == "self") {
61
- location.href = this.params.interactiveLink!;
62
- }
63
- }
64
- this.onClickLinkEvent.emit({ rowId: this.rowNum });
65
- }
66
-
67
- avatarClicked(evt: Event) {
68
- this.params.avatarClicked && this.params.avatarClicked({
69
- ...evt,
70
- rowId: this.rowNum
71
- });
72
- this.onClickChipEvent.emit({ ...evt, rowId: this.rowNum });
73
- }
74
-
75
- agInit(inParams: any): void { // must exist when class implements ICellRendererAngularComp / IHeaderAngularComp
76
-
77
- this.rowNum = inParams.rowIndex;
78
- this.params = inParams.value; // inParams.value exists when gridCell is rendered as cell, `cellRenderer: GridCellComponent`
79
- if (inParams.value == undefined) { // inParams.value is undefined when gridCell is rendered as header, `headerComponent: GridCellComponent`,
80
- this.params = inParams
81
- }
82
- // console.log(this.params);
83
- }
84
-
85
- refresh(params: any) { // must exist when class implements ICellRendererAngularComp / IHeaderAngularComp
86
- return false; // not sure what this return value does.
87
- }
88
-
89
- }
@@ -1,62 +0,0 @@
1
- .header {
2
- width: 100%;
3
- height: 96px;
4
- font-family: var(--font);
5
- padding: var(--medium-20px, 20px) var(--medium-32px, 32px);
6
- display: flex;
7
-
8
- justify-content: space-between;
9
- align-items: center;
10
-
11
- box-sizing: border-box;
12
- border-radius: var(--small-8px, 8px);
13
- border: 1px solid var(--grey-50, #E9EAEB);
14
- background: var(--Structural-White, #FFF);
15
- }
16
-
17
- .header-content {
18
- display: flex;
19
- flex-direction: column;
20
- gap: var(--small-8px, 8px);
21
- }
22
-
23
- .heading {
24
- display: flex;
25
- justify-content: flex-start;
26
- align-items: center;
27
- gap: var(--small-8px, 8px);
28
- }
29
-
30
- .header-name {
31
- font-size: 22px;
32
- font-style: normal;
33
- font-weight: 500;
34
- line-height: 28px;
35
- }
36
-
37
- .header-info {
38
- display: flex;
39
- gap: var(--small-12px, 12px);
40
- }
41
-
42
- .info-item {
43
- display: flex;
44
- justify-content: center;
45
- align-items: center;
46
- gap: var(--small-4px, 4px);
47
- font-size: 12px;
48
- font-style: normal;
49
- font-weight: 400;
50
- line-height: 16px;
51
- color: var(--text-mediumemphasis);
52
- }
53
-
54
- .info-item img {
55
- width: 20px;
56
- height: 20px;
57
- }
58
-
59
- .actions {
60
- display: flex;
61
- gap: var(--small-12px, 12px);
62
- }
@@ -1,23 +0,0 @@
1
- <div class="header">
2
- <div class="header-content">
3
- <div class="heading">
4
- <div class="header-name">{{headerName}}</div>
5
- <div *ngFor="let chip of chipConfig">
6
- <sa-chip type="regular" [state]="chip[1]" filling="filled" [text]="chip[0]"></sa-chip>
7
- </div>
8
- </div>
9
- <div class="header-info">
10
- <div class="info-item" *ngFor="let item of info">
11
- <img [src]="item[1]" alt="">
12
- {{item[0]}}
13
- </div>
14
- </div>
15
- </div>
16
- <div class="actions">
17
- <sa-button *ngIf="buttonHelper" (onClickEvent)="clicked(0)" [text]="buttonHelper" type="transparent" size="medium"
18
- state="default">
19
- </sa-button>
20
- <sa-button *ngIf="buttonMain" (onClickEvent)="clicked(1)" [text]="buttonMain" type="primary" size="medium"
21
- state="default"></sa-button>
22
- </div>
23
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { HeaderComponent } from './header.component';
4
-
5
- describe('HeaderComponent', () => {
6
- let component: HeaderComponent;
7
- let fixture: ComponentFixture<HeaderComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [HeaderComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(HeaderComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,28 +0,0 @@
1
- import { Component, EventEmitter, Output, input } from '@angular/core';
2
- import { ChipsComponent } from '../chips/chips.component';
3
- import { Input } from '@angular/core';
4
- import { NgFor } from '@angular/common';
5
- import { ButtonComponent } from '../button/button.component';
6
- import { NgIf } from '@angular/common';
7
-
8
- @Component({
9
- selector: 'sa-header',
10
- standalone: true,
11
- imports: [ChipsComponent, NgFor, ButtonComponent, NgIf],
12
- templateUrl: './header.component.html',
13
- styleUrl: './header.component.css'
14
- })
15
- export class HeaderComponent {
16
- @Input() info: string[][];
17
- @Input() headerName: string;
18
- @Input() chipConfig: string[][];
19
- @Input() buttonHelper: string;
20
- @Input() buttonMain: string;
21
-
22
- @Output() mainButtonClicked = new EventEmitter();
23
- @Output() helperButtonClicked = new EventEmitter();
24
-
25
- clicked(num: number) {
26
- num ? this.mainButtonClicked.emit() : this.helperButtonClicked.emit();
27
- }
28
- }