Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Initial creation of input-field. (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-H11 committed Mar 22, 2022
1 parent 07e2f63 commit 7d9c9df
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/base-components/base-components.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ <h2>Buttons - Text only</h2>
Info disabled
</design-button-text>
</div>
<div class="componentContainer">
<design-text-input>
</design-text-input>
</div>
</div>
4 changes: 3 additions & 1 deletion src/app/base-components/base-components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { BaseComponentsComponent } from './base-components.component';
import {ButtonModule} from "../../core/components/buttons/button/button.module";
import {ButtonOutlineModule} from "../../core/components/buttons/button-outline/button-outline.module";
import {ButtonTextModule} from "../../core/components/buttons/button-text/button-text.module";
import {TextInputModule} from "../../core/components/inputs/text-input/text-input.module";


@NgModule({
Expand All @@ -17,7 +18,8 @@ import {ButtonTextModule} from "../../core/components/buttons/button-text/button
BaseComponentsRoutingModule,
ButtonModule,
ButtonOutlineModule,
ButtonTextModule
ButtonTextModule,
TextInputModule
]
})
export class BaseComponentsModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<input type="text" placeholder="test" (change)="onChange.emit()">
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "src/global-styles/_theme-colors.scss";

input {
border: $primary-default
}
25 changes: 25 additions & 0 deletions src/core/components/inputs/text-input/text-input.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TextInputComponent } from './text-input.component';

describe('TextInputComponent', () => {
let component: TextInputComponent;
let fixture: ComponentFixture<TextInputComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ TextInputComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(TextInputComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions src/core/components/inputs/text-input/text-input.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Component, EventEmitter, Output} from '@angular/core';

@Component({
selector: 'design-text-input',
templateUrl: './text-input.component.html',
styleUrls: ['./text-input.component.scss']
})
export class TextInputComponent {

// eslint-disable-next-line @angular-eslint/no-output-on-prefix
@Output() public onChange = new EventEmitter<InputEvent>();
}
18 changes: 18 additions & 0 deletions src/core/components/inputs/text-input/text-input.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TextInputComponent } from './text-input.component';



@NgModule({
declarations: [
TextInputComponent
],
imports: [
CommonModule
],
exports: [
TextInputComponent
]
})
export class TextInputModule { }

0 comments on commit 7d9c9df

Please sign in to comment.