oasys-lib 1.1.4 → 1.2.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 (93) hide show
  1. package/.browserslistrc +17 -0
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +10 -0
  4. package/package.json +3 -10
  5. package/src/assets/bloomandwild/variables.css +21 -13
  6. package/src/assets/bloomon/variables.css +21 -13
  7. package/src/assets/global/scss-breakpoints.scss +1 -1
  8. package/src/assets/global/typography.scss +4 -6
  9. package/src/assets/global/variables.css +5 -2
  10. package/src/lib/components/button/button.component.html +16 -0
  11. package/src/lib/components/button/button.component.scss +188 -0
  12. package/src/lib/components/button/button.component.spec.ts +25 -0
  13. package/src/lib/components/button/button.component.ts +95 -0
  14. package/src/lib/components/button/button.modifiers.scss +101 -0
  15. package/src/lib/components/button/button.ts +48 -0
  16. package/src/lib/components/icon/icon.component.html +5 -0
  17. package/src/lib/components/icon/icon.component.scss +5 -0
  18. package/src/lib/components/icon/icon.component.spec.ts +25 -0
  19. package/src/lib/components/icon/icon.component.ts +50 -0
  20. package/src/lib/components/icon/icon.ts +25 -0
  21. package/src/lib/components/layout/Layout.ts +64 -0
  22. package/src/lib/components/layout/_layout.scss +105 -0
  23. package/src/lib/components/layout/box/box.component.scss +124 -0
  24. package/src/lib/components/layout/box/box.component.ts +103 -0
  25. package/src/lib/components/layout/container/container.component.scss +66 -0
  26. package/src/lib/components/layout/container/container.component.ts +70 -0
  27. package/src/lib/components/layout/grid/grid.component.scss +162 -0
  28. package/src/lib/components/layout/grid/grid.component.ts +103 -0
  29. package/src/lib/components/layout/stack/stack.component.scss +60 -0
  30. package/src/lib/components/layout/stack/stack.component.ts +58 -0
  31. package/src/lib/components/text/text.component.html +1 -0
  32. package/src/lib/components/text/text.component.scss +33 -0
  33. package/src/lib/components/text/text.component.spec.ts +25 -0
  34. package/src/lib/components/text/text.component.ts +29 -0
  35. package/src/lib/components/text/text.ts +1 -0
  36. package/src/lib/oasys-lib.module.ts +42 -0
  37. package/src/lib/oasys-lib.service.spec.ts +16 -0
  38. package/src/lib/oasys-lib.service.ts +9 -0
  39. package/src/lib/services/token.service.ts +37 -0
  40. package/src/lib/services/window.service.ts +16 -0
  41. package/{public-api.d.ts → src/public-api.ts} +7 -1
  42. package/src/test.ts +27 -0
  43. package/tsconfig.lib.json +17 -0
  44. package/tsconfig.lib.prod.json +7 -0
  45. package/tsconfig.spec.json +17 -0
  46. package/bundles/oasys-lib.umd.js +0 -629
  47. package/bundles/oasys-lib.umd.js.map +0 -1
  48. package/esm2015/lib/components/button/button.component.js +0 -97
  49. package/esm2015/lib/components/button/button.js +0 -2
  50. package/esm2015/lib/components/icon/icon.component.js +0 -58
  51. package/esm2015/lib/components/icon/icon.js +0 -2
  52. package/esm2015/lib/components/layout/Layout.js +0 -2
  53. package/esm2015/lib/components/layout/box/box.component.js +0 -99
  54. package/esm2015/lib/components/layout/container/container.component.js +0 -81
  55. package/esm2015/lib/components/layout/grid/grid.component.js +0 -104
  56. package/esm2015/lib/components/layout/stack/stack.component.js +0 -65
  57. package/esm2015/lib/components/text/text.js +0 -2
  58. package/esm2015/lib/oasys-lib.module.js +0 -66
  59. package/esm2015/lib/services/token.service.js +0 -41
  60. package/esm2015/lib/services/window.service.js +0 -19
  61. package/esm2015/oasys-lib.js +0 -5
  62. package/esm2015/public-api.js +0 -11
  63. package/fesm2015/oasys-lib.js +0 -601
  64. package/fesm2015/oasys-lib.js.map +0 -1
  65. package/lib/components/button/button.component.d.ts +0 -32
  66. package/lib/components/button/button.component.d.ts.map +0 -1
  67. package/lib/components/button/button.d.ts +0 -18
  68. package/lib/components/button/button.d.ts.map +0 -1
  69. package/lib/components/icon/icon.component.d.ts +0 -26
  70. package/lib/components/icon/icon.component.d.ts.map +0 -1
  71. package/lib/components/icon/icon.d.ts +0 -3
  72. package/lib/components/icon/icon.d.ts.map +0 -1
  73. package/lib/components/layout/Layout.d.ts +0 -27
  74. package/lib/components/layout/Layout.d.ts.map +0 -1
  75. package/lib/components/layout/box/box.component.d.ts +0 -28
  76. package/lib/components/layout/box/box.component.d.ts.map +0 -1
  77. package/lib/components/layout/container/container.component.d.ts +0 -21
  78. package/lib/components/layout/container/container.component.d.ts.map +0 -1
  79. package/lib/components/layout/grid/grid.component.d.ts +0 -31
  80. package/lib/components/layout/grid/grid.component.d.ts.map +0 -1
  81. package/lib/components/layout/stack/stack.component.d.ts +0 -21
  82. package/lib/components/layout/stack/stack.component.d.ts.map +0 -1
  83. package/lib/components/text/text.d.ts +0 -2
  84. package/lib/components/text/text.d.ts.map +0 -1
  85. package/lib/oasys-lib.module.d.ts +0 -15
  86. package/lib/oasys-lib.module.d.ts.map +0 -1
  87. package/lib/services/token.service.d.ts +0 -12
  88. package/lib/services/token.service.d.ts.map +0 -1
  89. package/lib/services/window.service.d.ts +0 -7
  90. package/lib/services/window.service.d.ts.map +0 -1
  91. package/oasys-lib.d.ts +0 -6
  92. package/oasys-lib.d.ts.map +0 -1
  93. package/public-api.d.ts.map +0 -1
@@ -0,0 +1,66 @@
1
+ @use './../layout';
2
+ @import './../../../../assets/global/responsive.scss';
3
+
4
+ $mobile-container-width: $mobile-max;
5
+ $tablet-container-width: $tablet-min;
6
+ $laptop-container-width: $laptop-min;
7
+ $desktop-container-width: $desktop-min;
8
+
9
+
10
+ ui-container {
11
+
12
+ /* ---------------------
13
+ Responsive Gutter Size
14
+ --------------------- */
15
+
16
+ --container-component-gutter-size: var(--semantic-spacing-container-gutter-size-small);
17
+
18
+ @include mobile(){
19
+ --container-component-gutter-size: var(--semantic-spacing-container-gutter-size-small);
20
+ }
21
+
22
+ @include tablet(){
23
+ --container-component-gutter-size: var(--semantic-spacing-container-gutter-size-small);
24
+ }
25
+
26
+ @include laptop(){
27
+ --container-component-gutter-size: var(--semantic-spacing-container-gutter-size-large);
28
+ }
29
+
30
+ @include desktop(){
31
+ --container-component-gutter-size: var(--semantic-spacing-container-gutter-size-large);
32
+ }
33
+
34
+ display: block;
35
+
36
+ width: 100%;
37
+ max-width: $global-breakpoint-desktop;
38
+ margin: 0 auto;
39
+
40
+
41
+ /* ---------------------
42
+ Responsive Container Widths
43
+ --------------------- */
44
+
45
+ @include mobile(){
46
+ max-width: 100%;
47
+ }
48
+ @include tablet(){
49
+ max-width: calc(#{$tablet-container-width} - var(--container-component-gutter-size));
50
+ }
51
+ @include laptop(){
52
+ max-width: calc(#{$laptop-container-width} - var(--container-component-gutter-size));
53
+ }
54
+ @include desktop(){
55
+ max-width: calc(#{$desktop-container-width} - var(--container-component-gutter-size));
56
+ }
57
+
58
+
59
+ /* ---------------------
60
+ Fluid Container Widths
61
+ --------------------- */
62
+
63
+ &.ui-layout-container-fluid {
64
+ max-width: 100%;
65
+ }
66
+ }
@@ -0,0 +1,70 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';
2
+ import { Component} from '@angular/core';
3
+ import { TokenService } from '../../../services/token.service';
4
+ import { LayoutContainerSizes } from '../Layout';
5
+ @Component({
6
+ selector:'ui-container',
7
+ template: `
8
+ <ui-box
9
+ [boxSpaceRight]="containerHorizontalSizes"
10
+ [boxSpaceLeft]="containerHorizontalSizes"
11
+ boxSpaceTop="none"
12
+ boxSpaceBottom="none">
13
+
14
+ <ng-content></ng-content>
15
+
16
+ </ui-box>
17
+ `,
18
+ host: {
19
+ '[class]' : 'containerLayoutClasses'
20
+ },
21
+ styleUrls: ['./container.component.scss'],
22
+ encapsulation: ViewEncapsulation.None,
23
+ changeDetection: ChangeDetectionStrategy.OnPush
24
+ })
25
+ export class LayoutContainerComponent implements OnInit, OnChanges {
26
+ @Input() containerFluid: boolean = false;
27
+ @Input() containerGutter: boolean = true;
28
+ prefix = 'ui-layout-container';
29
+ containerLayoutClasses?: string[];
30
+
31
+ containerGutterNameLarge: string;
32
+ containerGutterNameSmall: string;
33
+ containerHorizontalSizes: LayoutContainerSizes;
34
+
35
+ constructor(private changes: ChangeDetectorRef, private tokenService: TokenService) { }
36
+
37
+ ngOnChanges(): void {
38
+ this.ngOnInit();
39
+ this.changes.markForCheck();
40
+ }
41
+
42
+ ngOnInit(): void {
43
+
44
+ if(this.containerGutter){
45
+
46
+
47
+ this.containerGutterNameSmall = this.tokenService.getTokenValue('--semantic-spacing-container-gutter-box-name-small');
48
+ this.containerGutterNameLarge = this.tokenService.getTokenValue('--semantic-spacing-container-gutter-box-name-large');
49
+
50
+ this.containerHorizontalSizes = {
51
+ desktop: this.containerGutterNameLarge,
52
+ tablet: this.containerGutterNameLarge,
53
+ mobile: this.containerGutterNameSmall
54
+ }
55
+
56
+ } else {
57
+ this.containerHorizontalSizes = {
58
+ desktop: 'none',
59
+ tablet: 'none',
60
+ mobile: 'none'
61
+ }
62
+ }
63
+
64
+ this.containerLayoutClasses = [
65
+ this.prefix,
66
+ `${this.prefix}-${this.containerFluid ? 'fluid' : ''}`
67
+ ]
68
+ }
69
+
70
+ }
@@ -0,0 +1,162 @@
1
+ @use './../layout';
2
+ @import './../../../../assets/global/responsive.scss';
3
+
4
+ $twelveColumnGridSizes: 1, 2,3,4,5,6,7,8,9,10,11,12;
5
+ $layoutDevices: 'mobile', 'tablet', 'laptop', 'desktop';
6
+
7
+ /* ---------------------
8
+ Grid Gap Sizes
9
+ --------------------- */
10
+ ui-grid {
11
+
12
+
13
+ /* ---------------------
14
+ Grid Gap Sizes
15
+ --------------------- */
16
+
17
+ width: 100%;
18
+ &.ui-layout-grid {
19
+ &-default {
20
+ gap: var(--semantic-spacing-grid-default);
21
+ }
22
+
23
+ &-none {
24
+ gap: var(--semantic-spacing-grid-none);
25
+ }
26
+
27
+ }
28
+
29
+
30
+
31
+ /* ---------------------
32
+ Even-Width Grid
33
+ Uses Flexbox and does not wrap
34
+ --------------------- */
35
+
36
+ &.ui-layout-grid-width-auto {
37
+ display: flex;
38
+ flex-wrap: nowrap;
39
+ }
40
+
41
+ /* ---------------------
42
+ Even-width columns
43
+ --------------------- */
44
+ &.ui-layout-grid-width-auto {
45
+ ui-column {
46
+ flex: 1 1 0;
47
+ }
48
+
49
+ }
50
+
51
+
52
+
53
+ /* ---------------------
54
+ 12-Column grid
55
+ Uses grid to define 12 columns
56
+ --------------------- */
57
+ &:not(.ui-layout-grid-width-auto){
58
+ display: grid;
59
+ grid-template-columns: repeat(12, 1fr);
60
+ }
61
+
62
+ /* ---------------------
63
+ 12-column Columns
64
+ Responsive
65
+ --------------------- */
66
+ &:not(.ui-layout-grid-width-auto){
67
+
68
+ ui-column {
69
+ grid-column: span 12;
70
+
71
+ @each $columnSize in $twelveColumnGridSizes {
72
+ &.ui-layout-column-col-#{$columnSize} {
73
+ grid-column: span #{$columnSize};
74
+ }
75
+ }
76
+
77
+ // Responsive Columns
78
+ @each $device in $layoutDevices {
79
+ &.ui-layout-column-#{$device} {
80
+ @if $device== 'mobile' {
81
+ @include mobile() {
82
+
83
+ @each $columnSize in $twelveColumnGridSizes {
84
+ &-#{$columnSize} {
85
+ grid-column: span #{$columnSize};
86
+ }
87
+ }
88
+
89
+ }
90
+ }
91
+ @if $device== 'tablet' {
92
+ @include tablet() {
93
+
94
+ @each $columnSize in $twelveColumnGridSizes {
95
+ &-#{$columnSize} {
96
+ grid-column: span #{$columnSize};
97
+ }
98
+ }
99
+
100
+ }
101
+ }
102
+ @if $device== 'laptop' {
103
+ @include laptop() {
104
+
105
+ @each $columnSize in $twelveColumnGridSizes {
106
+ &-#{$columnSize} {
107
+ grid-column: span #{$columnSize};
108
+ }
109
+ }
110
+
111
+ }
112
+ }
113
+ @if $device== 'desktop' {
114
+ @include desktop() {
115
+
116
+ @each $columnSize in $twelveColumnGridSizes {
117
+ &-#{$columnSize} {
118
+ grid-column: span #{$columnSize};
119
+ }
120
+ }
121
+
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+
130
+
131
+
132
+ /* ---------------------
133
+ Collapse-Below
134
+ Collapses grids into 1 column
135
+ Typically used for Mobile grids
136
+ --------------------- */
137
+
138
+ &.ui-layout-grid-collapse-below-tablet {
139
+ @include mobile(){
140
+ display: flex;
141
+ flex-direction: column;
142
+ }
143
+ }
144
+
145
+ &.ui-layout-grid-collapse-below-laptop {
146
+ @include tablet(false){
147
+ display: flex;
148
+ flex-direction: column;
149
+ }
150
+ }
151
+
152
+ &.ui-layout-grid-collapse-below-desktop {
153
+
154
+ @include laptop(false){
155
+ display: flex;
156
+ flex-direction: column;
157
+ }
158
+ }
159
+
160
+
161
+
162
+ }
@@ -0,0 +1,103 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';
2
+ import { Component} from '@angular/core';
3
+ import { LayoutGapSizes, ResponsiveGridColumns } from '../Layout';
4
+
5
+ @Component({
6
+ selector:'ui-grid',
7
+ template: '<ng-content></ng-content>',
8
+ host: {
9
+ '[class]' : 'gridLayoutClasses'
10
+ },
11
+ styleUrls: ['./grid.component.scss'],
12
+ encapsulation: ViewEncapsulation.None,
13
+ changeDetection: ChangeDetectionStrategy.OnPush
14
+ })
15
+ export class LayoutGridComponent implements OnInit, OnChanges {
16
+ didFirstInit: boolean = false;
17
+ prefix = 'ui-layout-grid';
18
+ gridLayoutClasses?: string[];
19
+
20
+ @Input() gridAuto: boolean = false;
21
+ @Input() gridCollapseBelow: 'tablet' | 'laptop' | 'desktop' | 'none' = 'tablet';
22
+ @Input() gridGap: 'default' | 'none' = 'default';
23
+
24
+ constructor(private changes: ChangeDetectorRef) { }
25
+
26
+ ngOnChanges(): void {
27
+ if(!this.didFirstInit){
28
+ return;
29
+ }
30
+ this.ngOnInit();
31
+ this.changes.markForCheck();
32
+ }
33
+
34
+ ngOnInit(): void {
35
+ this.gridLayoutClasses = [
36
+ this.prefix,
37
+ `${this.prefix}-${this.gridGap}`,
38
+ `${this.prefix}-${this.gridAuto ? 'width-auto' : ''}`,
39
+ `${this.prefix}-collapse-below-${this.gridCollapseBelow}`,
40
+ ]
41
+ this.didFirstInit = true;
42
+ }
43
+
44
+ }
45
+
46
+ @Component({
47
+ selector:'ui-column',
48
+ template: '<ng-content></ng-content>',
49
+ host: {
50
+ '[class]' : 'columnLayoutClasses'
51
+ },
52
+ styleUrls: ['./grid.component.scss'],
53
+ encapsulation: ViewEncapsulation.None,
54
+ changeDetection: ChangeDetectionStrategy.OnPush
55
+ })
56
+ export class LayoutGridColumnComponent implements OnInit, OnChanges {
57
+ didFirstInit: boolean = false;
58
+ prefix = 'ui-layout-column';
59
+ columnLayoutClasses?: string[];
60
+
61
+ @Input() columns: ResponsiveGridColumns = 12;
62
+
63
+ constructor(private changes: ChangeDetectorRef) { }
64
+
65
+ getSizeClasses(columns?: ResponsiveGridColumns): string[] {
66
+
67
+ if(!columns) {
68
+ return [''];
69
+ }
70
+
71
+ if(typeof columns === 'object'){
72
+
73
+ return Object.keys(columns).map((key) => {
74
+ return `${this.prefix}-${key}-${columns[key]}`
75
+ });
76
+
77
+ }
78
+
79
+ return [
80
+ this.prefix,
81
+ `${this.prefix}-col-${columns}`
82
+ ];
83
+
84
+ }
85
+
86
+ ngOnChanges(): void {
87
+ if(!this.didFirstInit){
88
+ return;
89
+ }
90
+ this.ngOnInit();
91
+ this.changes.markForCheck();
92
+ }
93
+
94
+ ngOnInit(): void {
95
+ this.columnLayoutClasses = [
96
+ this.prefix,
97
+ this.getSizeClasses(this.columns)
98
+ ].flat(10).filter(Boolean);
99
+ this.didFirstInit = true;
100
+ }
101
+
102
+ }
103
+
@@ -0,0 +1,60 @@
1
+ @use './../layout';
2
+
3
+ .ui-layout-stack {
4
+ display: flex;
5
+ position: relative;
6
+ align-items: inherit;
7
+ justify-content: inherit;
8
+ width: 100%;
9
+
10
+ @include layout.layoutGapSizes();
11
+ @include layout.layoutAlignmentClasses('x');
12
+ @include layout.layoutAlignmentClasses('y');
13
+
14
+
15
+ /* ---------------------
16
+ Stack Directions
17
+ --------------------- */
18
+
19
+ &-direction-x {
20
+ flex-direction: row;
21
+ }
22
+
23
+ &-direction-y {
24
+ flex-direction: column;
25
+ }
26
+
27
+
28
+ /* ---------------------
29
+ Stack Distribution Modes
30
+ --------------------- */
31
+
32
+ &-distribute-fill {
33
+ > * {
34
+ flex: 1 1 auto;
35
+ }
36
+ }
37
+
38
+ &-distribute-fit {
39
+ > ui-stack {
40
+ flex-basis: 0%;
41
+ }
42
+ }
43
+
44
+
45
+ /* ---------------------
46
+ Stack Wrap Options
47
+ --------------------- */
48
+
49
+ &-wrap {
50
+ flex-wrap: wrap;
51
+ }
52
+
53
+ &-no-wrap {
54
+ flex-wrap: nowrap;
55
+ }
56
+
57
+ &.ui-layout-stack-direction-y.ui-layout-stack-wrap {
58
+ height: 100%;
59
+ }
60
+ }
@@ -0,0 +1,58 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';
2
+ import { LayoutDirections, LayoutAlignment, LayoutGapSizes, LayoutDistribute } from '../Layout';
3
+
4
+ @Component({
5
+ selector:'ui-stack',
6
+ template: '<ng-content></ng-content>',
7
+ host: {
8
+ '[class]' : 'stackLayoutClasses'
9
+ },
10
+ styleUrls: ['./stack.component.scss'],
11
+ encapsulation: ViewEncapsulation.None,
12
+ changeDetection: ChangeDetectionStrategy.OnPush
13
+ })
14
+ export class LayoutStackComponent implements OnInit, OnChanges {
15
+ didFirstInit: boolean = false;
16
+ prefix = 'ui-layout-stack';
17
+ stackLayoutClasses?: string[];
18
+
19
+ @Input() stackGap: LayoutGapSizes = 'default';
20
+ @Input() stackAlign: LayoutAlignment = 'start';
21
+ @Input() stackDirection: LayoutDirections = 'y';
22
+ @Input() stackDistribute?: LayoutDistribute = 'start';
23
+ @Input() stackWrap?: Boolean = false;
24
+
25
+ constructor(private changes: ChangeDetectorRef) {
26
+
27
+ }
28
+
29
+ defaultDistribution(): LayoutDistribute {
30
+ if(this.stackDistribute) {
31
+ return this.stackDistribute;
32
+ }
33
+
34
+ return this.stackDirection === 'x' ? 'fit' : 'fill';
35
+ }
36
+
37
+ ngOnChanges(): void {
38
+ if(!this.didFirstInit){
39
+ return;
40
+ }
41
+ this.ngOnInit();
42
+ this.changes.markForCheck();
43
+ }
44
+
45
+ ngOnInit(): void {
46
+ this.stackDistribute = this.defaultDistribution();
47
+ this.stackLayoutClasses = [
48
+ this.prefix,
49
+ `${this.prefix}-${this.stackGap}`,
50
+ `${this.prefix}-align-${this.stackAlign}`,
51
+ `${this.prefix}-distribute-${this.stackDistribute}`,
52
+ `${this.prefix}-direction-${this.stackDirection}`,
53
+ `${this.prefix}-${this.stackWrap ? 'wrap' : 'no-wrap'}`,
54
+ ]
55
+ this.didFirstInit = true;
56
+ }
57
+
58
+ }
@@ -0,0 +1 @@
1
+ <span class="ui-text" [ngClass]="uiTextClasses"><ng-content></ng-content></span>
@@ -0,0 +1,33 @@
1
+
2
+ .ui-text {
3
+ font-size: var(--size-font-base);
4
+ font-family: var(--font-family-body);
5
+
6
+ font-weight: var(--font-weight-normal);
7
+
8
+ &.ui-text--weight-medium {
9
+ font-weight: var(--font-weight-medium);
10
+ }
11
+
12
+ &.ui-text--weight-bold {
13
+ font-weight: var(--font-weight-bold);
14
+ }
15
+
16
+ &.ui-text--transform-uppercase {
17
+ text-transform: uppercase;
18
+ }
19
+ }
20
+
21
+
22
+ // Modifiers
23
+ .ui-text {
24
+ &.ui-text--align-left {
25
+ text-align: left;
26
+ }
27
+ &.ui-text--align-center {
28
+ text-align: center;
29
+ }
30
+ &.ui-text--align-right {
31
+ text-align: right;
32
+ }
33
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { TextComponent } from './text.component';
4
+
5
+ describe('TextComponent', () => {
6
+ let component: TextComponent;
7
+ let fixture: ComponentFixture<TextComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ TextComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(TextComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,29 @@
1
+ import { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
2
+ import { TextTransform } from './text';
3
+
4
+ @Component({
5
+ selector:'ui-text',
6
+ templateUrl: './text.component.html',
7
+ styleUrls: ['./text.component.scss'],
8
+ encapsulation: ViewEncapsulation.None,
9
+ changeDetection: ChangeDetectionStrategy.OnPush
10
+ })
11
+ export class TextComponent implements OnInit {
12
+
13
+ @Input() textAlign: 'left' | 'center' | 'right' = 'left';
14
+ @Input() textWeight: 'normal' | 'medium' | 'bold' = 'normal';
15
+ @Input() textTransform: TextTransform = 'none';
16
+
17
+ uiTextClasses!: string;
18
+
19
+ constructor() { }
20
+
21
+ ngOnInit(): void {
22
+ this.uiTextClasses = [
23
+ `ui-text--align-${this.textAlign}`,
24
+ `ui-text--weight-${this.textWeight}`,
25
+ `ui-text--transform-${this.textTransform}`,
26
+ ].join(' ');
27
+ }
28
+
29
+ }
@@ -0,0 +1 @@
1
+ export type TextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
@@ -0,0 +1,42 @@
1
+ import { APP_BASE_HREF, CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { RouterModule } from '@angular/router';
4
+ import { OasysButtonComponent } from './components/button/button.component';
5
+ import { IconComponent } from './components/icon/icon.component';
6
+ import { LayoutBoxComponent } from './components/layout/box/box.component';
7
+ import { WindowService } from './services/window.service';
8
+ import { TokenService } from './services/token.service';
9
+ import { LayoutStackComponent } from './components/layout/stack/stack.component';
10
+ import { LayoutGridComponent, LayoutGridColumnComponent } from './components/layout/grid/grid.component';
11
+ import { LayoutContainerComponent } from './components/layout/container/container.component';
12
+
13
+
14
+
15
+ @NgModule({
16
+ declarations: [
17
+ OasysButtonComponent,
18
+ IconComponent,
19
+ LayoutBoxComponent,
20
+ LayoutStackComponent,
21
+ LayoutGridComponent,
22
+ LayoutGridColumnComponent,
23
+ LayoutContainerComponent
24
+ ],
25
+ imports: [
26
+ CommonModule,
27
+ RouterModule.forChild([])
28
+ ],
29
+ exports: [
30
+ OasysButtonComponent,
31
+ LayoutBoxComponent,
32
+ LayoutStackComponent,
33
+ LayoutGridComponent,
34
+ LayoutGridColumnComponent,
35
+ LayoutContainerComponent
36
+ ],
37
+ providers: [
38
+ WindowService,
39
+ TokenService
40
+ ]
41
+ })
42
+ export class OasysLibModule { }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { OasysLibService } from './oasys-lib.service';
4
+
5
+ describe('OasysLibService', () => {
6
+ let service: OasysLibService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(OasysLibService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,9 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root'
5
+ })
6
+ export class OasysLibService {
7
+
8
+ constructor() { }
9
+ }