├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ └── text-editable.directive.ts ├── favicon.ico ├── index.html ├── main.ts ├── material.module.ts └── styles.css ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular-List 2 | 3 | Live: https://angular-list.netlify.app/ 4 | 5 | 6 | 7 | ![image](https://user-images.githubusercontent.com/119447423/229065739-f9ef4a52-04e3-4d53-9c09-f266d1a9812b.png) 8 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular.io-example": { 7 | "projectType": "application", 8 | "root": "", 9 | "sourceRoot": "src", 10 | "prefix": "app", 11 | "architect": { 12 | "build": { 13 | "builder": "@angular-devkit/build-angular:browser", 14 | "options": { 15 | "outputPath": "dist", 16 | "index": "src/index.html", 17 | "main": "src/main.ts", 18 | "polyfills": ["zone.js"], 19 | "tsConfig": "tsconfig.app.json", 20 | "assets": [ 21 | "src/favicon.ico", 22 | "src/assets" 23 | ], 24 | "styles": [ 25 | "@angular/material/prebuilt-themes/indigo-pink.css", 26 | "src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "budgets": [ 33 | { 34 | "type": "initial", 35 | "maximumWarning": "500kb", 36 | "maximumError": "1mb" 37 | }, 38 | { 39 | "type": "anyComponentStyle", 40 | "maximumWarning": "2kb", 41 | "maximumError": "4kb" 42 | } 43 | ], 44 | "outputHashing": "all" 45 | }, 46 | "development": { 47 | "buildOptimizer": false, 48 | "optimization": false, 49 | "vendorChunk": true, 50 | "extractLicenses": false, 51 | "sourceMap": true, 52 | "namedChunks": true 53 | } 54 | }, 55 | "defaultConfiguration": "production" 56 | }, 57 | "serve": { 58 | "builder": "@angular-devkit/build-angular:dev-server", 59 | "configurations": { 60 | "production": { 61 | "browserTarget": "angular.io-example:build:production" 62 | }, 63 | "development": { 64 | "browserTarget": "angular.io-example:build:development" 65 | } 66 | }, 67 | "defaultConfiguration": "development" 68 | }, 69 | "extract-i18n": { 70 | "builder": "@angular-devkit/build-angular:extract-i18n", 71 | "options": { 72 | "browserTarget": "angular.io-example:build" 73 | } 74 | }, 75 | "test": { 76 | "builder": "@angular-devkit/build-angular:karma", 77 | "options": { 78 | "polyfills": ["zone.js", "zone.js/testing"], 79 | "tsConfig": "tsconfig.spec.json", 80 | "assets": [ 81 | "src/favicon.ico", 82 | "src/assets" 83 | ], 84 | "styles": [ 85 | "@angular/material/prebuilt-themes/indigo-pink.css", 86 | "src/styles.css" 87 | ], 88 | "scripts": [] 89 | } 90 | }, 91 | "e2e": { 92 | "builder": "@angular-devkit/build-angular:protractor", 93 | "options": { 94 | "protractorConfig": "e2e/protractor.conf.js", 95 | "devServerTarget": "angular.io-example:serve" 96 | }, 97 | "configurations": { 98 | "production": { 99 | "devServerTarget": "angular.io-example:serve:production" 100 | } 101 | } 102 | } 103 | } 104 | } 105 | }, 106 | "cli": { 107 | "analytics": "c34c60ca-e566-46da-8a20-5c3ce920ef89" 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | describe('Tour of Heroes', () => { 4 | beforeEach(() => browser.get('/')); 5 | 6 | it('should display "Tour of Heroes"', async () => { 7 | const title = await element(by.css('app-root h1')).getText(); 8 | expect(title).toEqual('Tour of Heroes'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular.io-example", 3 | "version": "0.0.0", 4 | "description": "Example project from an angular.io guide.", 5 | "license": "MIT", 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "build": "ng build", 10 | "watch": "ng build --watch --configuration development", 11 | "test": "ng test", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/animations": "^15.2.0-rc.0", 17 | "@angular/cdk": "^15.2.0", 18 | "@angular/common": "^15.2.0-rc.0", 19 | "@angular/compiler": "^15.2.0-rc.0", 20 | "@angular/core": "^15.2.0-rc.0", 21 | "@angular/forms": "^15.2.0-rc.0", 22 | "@angular/material": "^15.2.0", 23 | "@angular/platform-browser": "^15.2.0-rc.0", 24 | "@angular/platform-browser-dynamic": "^15.2.0-rc.0", 25 | "@angular/router": "^15.2.0-rc.0", 26 | "angular-in-memory-web-api": "~0.15.0", 27 | "rxjs": "~7.8.0", 28 | "tslib": "^2.3.0", 29 | "zone.js": "~0.12.0" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/build-angular": "^15.2.0-rc.0", 33 | "@angular/cli": "^15.2.0-rc.0", 34 | "@angular/compiler-cli": "^15.2.0-rc.0", 35 | "@types/jasmine": "~4.3.0", 36 | "@types/node": "^16.11.35", 37 | "copyfiles": "^2.4.1", 38 | "jasmine-core": "~4.5.0", 39 | "jasmine-marbles": "~0.9.2", 40 | "jasmine-spec-reporter": "~7.0.0", 41 | "karma": "~6.4.0", 42 | "karma-chrome-launcher": "~3.1.0", 43 | "karma-coverage": "~2.2.0", 44 | "karma-jasmine": "~5.1.0", 45 | "karma-jasmine-html-reporter": "~2.0.0", 46 | "protractor": "~7.0.0", 47 | "ts-node": "~10.9.0", 48 | "typescript": "~4.9.3" 49 | } 50 | } -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .table-head-row { 2 | display: flex; 3 | height: 40px; 4 | border: solid 1px #ccc; 5 | border-bottom: none; 6 | } 7 | 8 | .col { 9 | flex: 1; 10 | text-align: center; 11 | } 12 | .head-col { 13 | display: flex; 14 | align-items: center; 15 | justify-content: center; 16 | border-left: solid 1px #ccc; 17 | } 18 | 19 | .table-container { 20 | width: 700px; 21 | } 22 | .col-btn { 23 | width: 48px; 24 | display: flex; 25 | align-items: center; 26 | justify-content: center; 27 | } 28 | .delete-btn { 29 | display: none; 30 | } 31 | 32 | .example-list { 33 | width: 100%; 34 | max-width: 100%; 35 | border: solid 1px #ccc; 36 | min-height: 48px; 37 | display: block; 38 | background: white; 39 | border-radius: 4px; 40 | overflow: hidden; 41 | } 42 | 43 | .cdk-drag-preview { 44 | box-sizing: border-box; 45 | border-radius: 4px; 46 | box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 47 | 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12); 48 | } 49 | 50 | .cdk-drag-placeholder { 51 | opacity: 0; 52 | } 53 | 54 | .cdk-drag-animating { 55 | transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); 56 | } 57 | 58 | .example-box:last-child { 59 | border: none; 60 | } 61 | 62 | .example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder) { 63 | transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); 64 | } 65 | 66 | .mat-form-field { 67 | font-size: 14px; 68 | width: 100%; 69 | } 70 | 71 | .mat-form-field-appearance-outline .mat-form-field-outline { 72 | color: rgb(255, 255, 255); 73 | } 74 | input.mat-input-element { 75 | color: rgb(0, 0, 0); 76 | } 77 | 78 | .action-btn { 79 | margin: 0 !important; 80 | } 81 | 82 | .edit-field { 83 | height: 40px; 84 | min-height: 40px; 85 | width: 100% !important; 86 | max-width: 232px; 87 | } 88 | .action-container { 89 | width: 120px; 90 | display: flex; 91 | height: 52px; 92 | margin-left: auto; 93 | align-items: center; 94 | justify-content: center; 95 | position: relative; 96 | } 97 | 98 | .alarm-colum { 99 | width: 150px; 100 | } 101 | 102 | .alarm-selector { 103 | width: 100%; 104 | padding: 0.5rem; 105 | } 106 | 107 | ::ng-deep .mdc-notched-outline__leading { 108 | border: none !important; 109 | } 110 | ::ng-deep .mdc-notched-outline__trailing { 111 | border: none !important; 112 | } 113 | 114 | ::ng-deep .mat-mdc-form-field-subscript-wrapper { 115 | display: none; 116 | } 117 | 118 | ::ng-deep .mat-mdc-form-field-infix { 119 | padding-top: 0 !important; 120 | padding-bottom: 0 !important; 121 | min-height: 40px; 122 | width: 100% !important; 123 | } 124 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

List

2 | 5 | 6 |
7 | 8 | 17 | 18 | 19 | 20 | 39 | 40 | 41 | 42 | 43 | 44 | 63 | 64 | 65 | 66 | 67 | 68 | 87 | 88 | 89 | 92 | 120 | 121 | 122 | 123 | 124 | 174 | 175 | 176 | 177 | 183 |
Sensor Name 25 | 31 | 37 | 38 | Group 49 | 55 | 61 | 62 | Reference Value 73 | 79 | 85 | 86 | 90 | Alarm Enabled 91 | 97 | 103 | 108 | true 109 | false 110 | 111 | 118 | 119 | Action 130 | 140 | 141 | 151 | 152 | 162 | 163 | 173 |
184 |
185 |
186 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { 3 | AbstractControl, 4 | FormArray, 5 | FormBuilder, 6 | FormControl, 7 | FormGroup, 8 | } from '@angular/forms'; 9 | import { MatTable, MatTableDataSource } from '@angular/material/table'; 10 | 11 | export interface PeriodicElement { 12 | name: string; 13 | group: string; 14 | reference: number; 15 | alarm: string; 16 | } 17 | 18 | @Component({ 19 | selector: 'app-root', 20 | templateUrl: './app.component.html', 21 | styleUrls: ['./app.component.css'], 22 | }) 23 | export class AppComponent { 24 | @ViewChild('table') table!: MatTable; 25 | dataSource = new MatTableDataSource(); 26 | VOForm!: FormGroup; 27 | isLoading = true; 28 | previousValues = null; 29 | 30 | displayedColumns: string[] = [ 31 | 'name', 32 | 'group', 33 | 'reference', 34 | 'alarm', 35 | 'action', 36 | ]; 37 | 38 | mainData: PeriodicElement[] = []; 39 | 40 | constructor(private fb: FormBuilder, private _formBuilder: FormBuilder) {} 41 | 42 | ngOnInit(): void { 43 | this.VOForm = this._formBuilder.group({ 44 | VORows: this._formBuilder.array([]), 45 | }); 46 | 47 | this.VOForm = this.fb.group({ 48 | VORows: this.fb.array( 49 | this.mainData.map((val) => 50 | this.fb.group({ 51 | name: new FormControl(val.name), 52 | group: new FormControl(val.group), 53 | reference: new FormControl(val.reference), 54 | alarm: new FormControl(val.alarm), 55 | action: new FormControl('existingRecord'), 56 | isEditable: new FormControl(true), 57 | isNewRow: new FormControl(false), 58 | }) 59 | ) 60 | ), 61 | }); 62 | 63 | this.isLoading = false; 64 | this.dataSource = new MatTableDataSource( 65 | (this.VOForm.get('VORows') as FormArray).controls 66 | ); 67 | 68 | const filterPredicate = this.dataSource.filterPredicate; 69 | this.dataSource.filterPredicate = (data: AbstractControl, filter) => { 70 | return filterPredicate.call(this.dataSource, data.value, filter); 71 | }; 72 | } 73 | 74 | onAddNewRow() { 75 | const control = this.VOForm.get('VORows') as FormArray; 76 | control.insert(0, this.initiateVOForm()); 77 | this.dataSource = new MatTableDataSource(control.controls); 78 | } 79 | 80 | onEditSVO(VOFormElement: any, i: number) { 81 | this.previousValues = VOFormElement.get('VORows').at(i).value; 82 | VOFormElement.get('VORows').at(i).get('isEditable').patchValue(false); 83 | } 84 | 85 | onSaveVO(VOFormElement: any, i: number) { 86 | VOFormElement.get('VORows').at(i).get('isEditable').patchValue(true); 87 | } 88 | 89 | onCancelSVO(VOFormElement: any, i: number) { 90 | if (this.previousValues) { 91 | VOFormElement.get('VORows').at(i).reset(this.previousValues); 92 | } 93 | VOFormElement.get('VORows').at(i).get('isEditable').patchValue(true); 94 | this.previousValues = null; 95 | } 96 | 97 | onDelete(VOFormElement: any, i: number) { 98 | const control = this.VOForm.get('VORows') as FormArray; 99 | control.removeAt(i); 100 | this.dataSource = new MatTableDataSource(control.controls); 101 | } 102 | 103 | initiateVOForm(): FormGroup { 104 | return this.fb.group({ 105 | name: new FormControl(''), 106 | group: new FormControl(''), 107 | reference: new FormControl(''), 108 | alarm: new FormControl(''), 109 | action: new FormControl('newRecord'), 110 | isEditable: new FormControl(false), 111 | isNewRow: new FormControl(true), 112 | }); 113 | } 114 | 115 | dropTable(event: any, VOFormElement: any) { 116 | const prevIndex = event.previousIndex; 117 | const currentIndex = event.currentIndex; 118 | const control = this.VOForm.get('VORows') as FormArray; 119 | const item = VOFormElement.get('VORows').at(prevIndex); 120 | 121 | if (prevIndex !== currentIndex) { 122 | control.removeAt(prevIndex); 123 | control.insert(currentIndex, item); 124 | 125 | this.dataSource = new MatTableDataSource(control.controls); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 5 | import { MatNativeDateModule } from '@angular/material/core'; 6 | import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; 7 | import { HttpClientModule } from '@angular/common/http'; 8 | import { DemoMaterialModule } from '../material.module'; 9 | import { AppComponent } from './app.component'; 10 | import { TextEditableComponent } from './text-editable.directive'; 11 | 12 | @NgModule({ 13 | declarations: [AppComponent, TextEditableComponent], 14 | imports: [ 15 | BrowserModule, 16 | FormsModule, 17 | BrowserAnimationsModule, 18 | MatNativeDateModule, 19 | DemoMaterialModule, 20 | ReactiveFormsModule, 21 | HttpClientModule, 22 | ], 23 | providers: [ 24 | { 25 | provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, 26 | useValue: { appearance: 'fill' }, 27 | }, 28 | ], 29 | bootstrap: [AppComponent], 30 | }) 31 | export class AppModule {} 32 | -------------------------------------------------------------------------------- /src/app/text-editable.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ElementRef, 4 | HostListener, 5 | forwardRef, 6 | AfterViewInit, 7 | } from '@angular/core'; 8 | 9 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; 10 | 11 | @Component({ 12 | selector: '[text-editable]', 13 | template: '', 14 | providers: [ 15 | { 16 | provide: NG_VALUE_ACCESSOR, 17 | useExisting: forwardRef(() => TextEditableComponent), 18 | multi: true, 19 | }, 20 | ], 21 | styles: [ 22 | ` 23 | :host { 24 | padding: 2px 4px; 25 | } 26 | :host[disabled='true'] { 27 | pointer-events: none; 28 | background: #f9f9f9; 29 | } 30 | :host:empty::before { 31 | content: attr(placeholder); 32 | color: #9d9d9d; 33 | } 34 | `, 35 | ], 36 | }) 37 | export class TextEditableComponent 38 | implements ControlValueAccessor, AfterViewInit 39 | { 40 | @HostListener('input') callOnChange() { 41 | this.onChange(this.el.nativeElement.textContent); 42 | } 43 | @HostListener('blur') callOnTouched() { 44 | this.onTouched(); 45 | } 46 | constructor(private el: ElementRef) {} 47 | 48 | onChange!: (value: string) => void; 49 | onTouched!: () => void; 50 | 51 | ngAfterViewInit() { 52 | this.el.nativeElement.setAttribute('contenteditable', 'true'); 53 | } 54 | 55 | writeValue(value: string) { 56 | this.el.nativeElement.textContent = value || ''; 57 | } 58 | 59 | registerOnChange(fn: (value: string) => void) { 60 | console.log(fn); 61 | this.onChange = fn; 62 | } 63 | registerOnTouched(fn: () => void) { 64 | this.onTouched = fn; 65 | } 66 | 67 | setDisabledState(val: boolean): void { 68 | this.el.nativeElement.setAttribute('disabled', String(val)); 69 | this.el.nativeElement.setAttribute('contenteditable', String(!val)); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- 1 | �PNG 2 |  3 | IHDR?�~� pHYs  ��~�fIDATH��WKLQ���̔�uG�� e�n�. 6qcb�l?���D`�F#� Ku�F 1Qc� 4 | ��!���� ��C�P�|B?$���ܱ3����I&}��}�̽s�[*�ɀU�A��K��yx�gY�Ajq��3L Š���˫�OD�4��3Ϗ:X�3��o�P J�ğo#IH�a����,{>1/�2$�R AR]�)w��?�sZw^��q�Y�m_��e���r[8�^� 5 | �&p��-���A}c��- ������!����2_) E�)㊪j���v�m��ZOi� g�nW�{�n.|�e2�a&�0aŸ����be�̀��C�fˤE%-{�ֺ��׮C��N��jXi�~c�C,t��T�����r�{� �L)s��V��6%�(�#ᤙ!�]��H�ҐH$R���^R�A�61(?Y舚�>���(Z����Qm�L2�K�ZIc�� 6 | ���̧�C��2!⅄�(����"�Go��>�q��=��$%�z`ѯ��T�&����PHh�Z!=���z��O��������,*VVV�1�f*CJ�]EE��K�k��d�#5���`2yT!�}7���߈~�,���zs�����y�T��V������D��C2�G��@%̑72Y�޾{oJ�"@��^h�~ ��fĬ�!a�D��6���Ha|�3��� [>�����]7U2п���]�ė 7 | ��PU� �.Wejq�in�g��+p<ߺQH����總j[������.��� Q���p _�K�� 1(��+��bB8�\ra 8 | �́�v.l���(���ǽ�w���L��w�8�C��IEND�B`� -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule) 6 | .catch(err => console.error(err)); 7 | -------------------------------------------------------------------------------- /src/material.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { A11yModule } from '@angular/cdk/a11y'; 3 | import { ClipboardModule } from '@angular/cdk/clipboard'; 4 | import { DragDropModule } from '@angular/cdk/drag-drop'; 5 | import { PortalModule } from '@angular/cdk/portal'; 6 | import { ScrollingModule } from '@angular/cdk/scrolling'; 7 | import { CdkStepperModule } from '@angular/cdk/stepper'; 8 | import { CdkTableModule } from '@angular/cdk/table'; 9 | import { CdkTreeModule } from '@angular/cdk/tree'; 10 | import { MatAutocompleteModule } from '@angular/material/autocomplete'; 11 | import { MatBadgeModule } from '@angular/material/badge'; 12 | import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; 13 | import { MatButtonModule } from '@angular/material/button'; 14 | import { MatButtonToggleModule } from '@angular/material/button-toggle'; 15 | import { MatCardModule } from '@angular/material/card'; 16 | import { MatCheckboxModule } from '@angular/material/checkbox'; 17 | import { MatChipsModule } from '@angular/material/chips'; 18 | import { MatStepperModule } from '@angular/material/stepper'; 19 | import { MatDatepickerModule } from '@angular/material/datepicker'; 20 | import { MatDialogModule } from '@angular/material/dialog'; 21 | import { MatDividerModule } from '@angular/material/divider'; 22 | import { MatExpansionModule } from '@angular/material/expansion'; 23 | import { MatGridListModule } from '@angular/material/grid-list'; 24 | import { MatIconModule } from '@angular/material/icon'; 25 | import { MatInputModule } from '@angular/material/input'; 26 | import { MatListModule } from '@angular/material/list'; 27 | import { MatMenuModule } from '@angular/material/menu'; 28 | import { MatNativeDateModule, MatRippleModule } from '@angular/material/core'; 29 | import { MatPaginatorModule } from '@angular/material/paginator'; 30 | import { MatProgressBarModule } from '@angular/material/progress-bar'; 31 | import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; 32 | import { MatRadioModule } from '@angular/material/radio'; 33 | import { MatSelectModule } from '@angular/material/select'; 34 | import { MatSidenavModule } from '@angular/material/sidenav'; 35 | import { MatSliderModule } from '@angular/material/slider'; 36 | import { MatSlideToggleModule } from '@angular/material/slide-toggle'; 37 | import { MatSnackBarModule } from '@angular/material/snack-bar'; 38 | import { MatSortModule } from '@angular/material/sort'; 39 | import { MatTableModule } from '@angular/material/table'; 40 | import { MatTabsModule } from '@angular/material/tabs'; 41 | import { MatToolbarModule } from '@angular/material/toolbar'; 42 | import { MatTooltipModule } from '@angular/material/tooltip'; 43 | import { MatTreeModule } from '@angular/material/tree'; 44 | import { OverlayModule } from '@angular/cdk/overlay'; 45 | 46 | @NgModule({ 47 | exports: [ 48 | A11yModule, 49 | ClipboardModule, 50 | CdkStepperModule, 51 | CdkTableModule, 52 | CdkTreeModule, 53 | DragDropModule, 54 | MatAutocompleteModule, 55 | MatBadgeModule, 56 | MatBottomSheetModule, 57 | MatButtonModule, 58 | MatButtonToggleModule, 59 | MatCardModule, 60 | MatCheckboxModule, 61 | MatChipsModule, 62 | MatStepperModule, 63 | MatDatepickerModule, 64 | MatDialogModule, 65 | MatDividerModule, 66 | MatExpansionModule, 67 | MatGridListModule, 68 | MatIconModule, 69 | MatInputModule, 70 | MatListModule, 71 | MatMenuModule, 72 | MatNativeDateModule, 73 | MatPaginatorModule, 74 | MatProgressBarModule, 75 | MatProgressSpinnerModule, 76 | MatRadioModule, 77 | MatRippleModule, 78 | MatSelectModule, 79 | MatSidenavModule, 80 | MatSliderModule, 81 | MatSlideToggleModule, 82 | MatSnackBarModule, 83 | MatSortModule, 84 | MatTableModule, 85 | MatTabsModule, 86 | MatToolbarModule, 87 | MatTooltipModule, 88 | MatTreeModule, 89 | OverlayModule, 90 | PortalModule, 91 | ScrollingModule, 92 | ], 93 | }) 94 | export class DemoMaterialModule {} 95 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* Global Styles */ 2 | * { 3 | font-family: Arial, Helvetica, sans-serif; 4 | } 5 | h1 { 6 | color: #264d73; 7 | font-size: 2.5rem; 8 | } 9 | h2, 10 | h3 { 11 | color: #444; 12 | font-weight: lighter; 13 | } 14 | h3 { 15 | font-size: 1.3rem; 16 | } 17 | body { 18 | padding: 0.5rem; 19 | max-width: 1000px; 20 | margin: auto; 21 | } 22 | @media (min-width: 600px) { 23 | body { 24 | padding: 2rem; 25 | } 26 | } 27 | body, 28 | input[text] { 29 | color: #333; 30 | font-family: Cambria, Georgia, serif; 31 | } 32 | a { 33 | cursor: pointer; 34 | } 35 | button { 36 | background-color: #eee; 37 | border: none; 38 | border-radius: 4px; 39 | cursor: pointer; 40 | color: black; 41 | font-size: 1.2rem; 42 | padding: 1rem; 43 | margin-right: 1rem; 44 | margin-bottom: 1rem; 45 | margin-top: 1rem; 46 | } 47 | button:hover { 48 | background-color: black; 49 | color: white; 50 | } 51 | button:disabled { 52 | background-color: #eee; 53 | color: #aaa; 54 | cursor: auto; 55 | } 56 | 57 | /* Navigation link styles */ 58 | nav a { 59 | padding: 5px 10px; 60 | text-decoration: none; 61 | margin-right: 10px; 62 | margin-top: 10px; 63 | display: inline-block; 64 | background-color: #e8e8e8; 65 | color: #3d3d3d; 66 | border-radius: 4px; 67 | } 68 | 69 | nav a:hover { 70 | color: white; 71 | background-color: #42545c; 72 | } 73 | nav a.active { 74 | background-color: black; 75 | color: white; 76 | } 77 | hr { 78 | margin: 1.5rem 0; 79 | } 80 | input[type="text"], 81 | input[type="number"] { 82 | box-sizing: border-box; 83 | width: 100%; 84 | padding: 0.5rem; 85 | } 86 | 87 | html, 88 | body { 89 | height: 100%; 90 | } 91 | body { 92 | margin: 0; 93 | font-family: Roboto, "Helvetica Neue", sans-serif; 94 | } 95 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ], 14 | "exclude": [ 15 | "src/test.ts", 16 | "src/**/*.spec.ts", 17 | "src/**/*-specs.ts", 18 | "src/**/*.avoid.ts", 19 | "src/**/*.0.ts", 20 | "src/**/*.1.ts", 21 | "src/**/*.1b.ts", 22 | "src/**/*.2.ts", 23 | "src/**/*.3.ts", 24 | "src/**/*.4.ts", 25 | "src/**/*.5.ts", 26 | "src/**/*.6.ts", 27 | "src/**/*.7.ts", 28 | "src/**/testing" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "useDefineForClassFields": false, 20 | "target": "ES2022", 21 | "module": "ES2022", 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | --------------------------------------------------------------------------------