ng-thaana 1.3.0 → 1.4.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.
- package/.editorconfig +16 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +14 -88
- package/angular.json +132 -0
- package/package.json +33 -19
- package/projects/app/.browserslistrc +17 -0
- package/projects/app/karma.conf.js +44 -0
- package/projects/app/src/app/app.component.html +8 -0
- package/projects/app/src/app/app.component.scss +0 -0
- package/projects/app/src/app/app.component.spec.ts +31 -0
- package/projects/app/src/app/app.component.ts +20 -0
- package/projects/app/src/app/app.module.ts +20 -0
- package/projects/app/src/assets/.gitkeep +0 -0
- package/projects/app/src/environments/environment.prod.ts +3 -0
- package/projects/app/src/environments/environment.ts +16 -0
- package/projects/app/src/favicon.ico +0 -0
- package/projects/app/src/index.html +13 -0
- package/projects/app/src/main.ts +12 -0
- package/projects/app/src/polyfills.ts +65 -0
- package/projects/app/src/styles.css +1 -0
- package/projects/app/src/test.ts +25 -0
- package/projects/app/tsconfig.app.json +15 -0
- package/projects/app/tsconfig.spec.json +18 -0
- package/projects/ng-thaana/README.md +24 -0
- package/projects/ng-thaana/karma.conf.js +44 -0
- package/projects/ng-thaana/ng-package.json +7 -0
- package/projects/ng-thaana/node_modules/.modules.yaml +21 -0
- package/projects/ng-thaana/node_modules/.pnpm/dhivehi@1.2.8/node_modules/dhivehi/lib/index.d.ts +9 -0
- package/projects/ng-thaana/node_modules/.pnpm/dhivehi@1.2.8/node_modules/dhivehi/lib/index.esm.js +1 -0
- package/projects/ng-thaana/node_modules/.pnpm/dhivehi@1.2.8/node_modules/dhivehi/lib/index.js +1 -0
- package/projects/ng-thaana/node_modules/.pnpm/dhivehi@1.2.8/node_modules/dhivehi/lib/index.test.d.ts +1 -0
- package/projects/ng-thaana/node_modules/.pnpm/dhivehi@1.2.8/node_modules/dhivehi/package.json +27 -0
- package/projects/ng-thaana/node_modules/.pnpm/lock.yaml +23 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/LICENSE.txt +12 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/README.md +164 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/SECURITY.md +41 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts +38 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.js +70 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/package.json +3 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/package.json +47 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts +460 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.html +1 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +402 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs +401 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.html +1 -0
- package/projects/ng-thaana/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.js +484 -0
- package/projects/ng-thaana/package.json +12 -0
- package/projects/ng-thaana/pnpm-lock.yaml +23 -0
- package/projects/ng-thaana/src/lib/ng-thaana.directive.ts +28 -0
- package/projects/ng-thaana/src/lib/ng-thaana.module.ts +16 -0
- package/{public-api.d.ts → projects/ng-thaana/src/public-api.ts} +4 -0
- package/projects/ng-thaana/src/test.ts +27 -0
- package/projects/ng-thaana/tsconfig.lib.json +15 -0
- package/projects/ng-thaana/tsconfig.lib.prod.json +10 -0
- package/projects/ng-thaana/tsconfig.spec.json +17 -0
- package/tsconfig.json +38 -0
- package/esm2022/lib/ng-thaana.directive.mjs +0 -38
- package/esm2022/lib/ng-thaana.module.mjs +0 -21
- package/esm2022/ng-thaana.mjs +0 -5
- package/esm2022/public-api.mjs +0 -6
- package/fesm2022/ng-thaana.mjs +0 -66
- package/fesm2022/ng-thaana.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/ng-thaana.directive.d.ts +0 -14
- package/lib/ng-thaana.module.d.ts +0 -7
package/.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"configurations": [
|
|
5
|
+
{
|
|
6
|
+
"name": "ng serve",
|
|
7
|
+
"type": "pwa-chrome",
|
|
8
|
+
"request": "launch",
|
|
9
|
+
"preLaunchTask": "npm: start",
|
|
10
|
+
"url": "http://localhost:4200/"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "ng test",
|
|
14
|
+
"type": "chrome",
|
|
15
|
+
"request": "launch",
|
|
16
|
+
"preLaunchTask": "npm: test",
|
|
17
|
+
"url": "http://localhost:9876/debug.html"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"tasks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "npm",
|
|
7
|
+
"script": "start",
|
|
8
|
+
"isBackground": true,
|
|
9
|
+
"problemMatcher": {
|
|
10
|
+
"owner": "typescript",
|
|
11
|
+
"pattern": "$tsc",
|
|
12
|
+
"background": {
|
|
13
|
+
"activeOnStart": true,
|
|
14
|
+
"beginsPattern": {
|
|
15
|
+
"regexp": "(.*?)"
|
|
16
|
+
},
|
|
17
|
+
"endsPattern": {
|
|
18
|
+
"regexp": "bundle generation complete"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "npm",
|
|
25
|
+
"script": "test",
|
|
26
|
+
"isBackground": true,
|
|
27
|
+
"problemMatcher": {
|
|
28
|
+
"owner": "typescript",
|
|
29
|
+
"pattern": "$tsc",
|
|
30
|
+
"background": {
|
|
31
|
+
"activeOnStart": true,
|
|
32
|
+
"beginsPattern": {
|
|
33
|
+
"regexp": "(.*?)"
|
|
34
|
+
},
|
|
35
|
+
"endsPattern": {
|
|
36
|
+
"regexp": "bundle generation complete"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
package/README.md
CHANGED
|
@@ -1,101 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NgThaana
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.4.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Development server
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
## Code scaffolding
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
## Build
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Running unit tests
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
$ yarn add ng-thaana
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
$ npm i ng-thaana
|
|
21
|
+
## Running end-to-end tests
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
```javascript
|
|
30
|
-
// import the module
|
|
31
|
-
import { NgThaanaModule } from 'ng-thaana';
|
|
25
|
+
## Further help
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@NgModule({
|
|
36
|
-
declarations: [
|
|
37
|
-
AppComponent,
|
|
38
|
-
],
|
|
39
|
-
imports: [
|
|
40
|
-
BrowserModule,
|
|
41
|
-
FormsModule,
|
|
42
|
-
// as such
|
|
43
|
-
NgThaanaModule,
|
|
44
|
-
],
|
|
45
|
-
providers: [],
|
|
46
|
-
bootstrap: [AppComponent]
|
|
47
|
-
})
|
|
48
|
-
export class AppModule { }
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
`ng-thaana` supports pasting latin characters which on the fly will transliterate the provide string into the preferred `flavor`. Here flavors are `phonetic` (default), `typewriter` and `faseyha`
|
|
52
|
-
|
|
53
|
-
For example when `divehi` is pasted it will be `ދިވެހި` in `phonetic` flavor however the same will be `ިިހެވިދ` in `faseyha` flavor. In each flavor the keyboard layout is slightly different.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### In the template
|
|
57
|
-
```html
|
|
58
|
-
<div>
|
|
59
|
-
|
|
60
|
-
<input [(ngModel)]='name' ng-thaana placeholder="Your name please..." />
|
|
61
|
-
|
|
62
|
-
<!-- With explicit flavor -->
|
|
63
|
-
<input [(ngModel)]='name' flavor='faseyha' ng-thaana placeholder="Your name please..." />
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<!-- With post callback -->
|
|
67
|
-
<input [(ngModel)]='name' (ng-thaana)='postCallback($event)' placeholder="Your name please..." />
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Toggling
|
|
73
|
-
ng-thaana now supports toggling its effective state. Meaning you can turn off ng-thaana and vise-versa. This can be done by pressing shift key twice under a second.
|
|
74
|
-
|
|
75
|
-
This has several interesting use cases such as when a charactor from English/Any language is required maybe in the middle of a word or sentence. For instance ID card number requires an `A` prefixed. There are plenty of such if you think about it.
|
|
76
|
-
|
|
77
|
-
You will want to indicate the toggling of `ng-thaana` which can be handled like so.
|
|
78
|
-
|
|
79
|
-
In the template/view
|
|
80
|
-
```html
|
|
81
|
-
<input [(ngModel)]='name' (thaana-toggled)="toggled($event)" ng-thaana placeholder="Search..." />
|
|
82
|
-
```
|
|
83
|
-
And on the js side
|
|
84
|
-
```javascript
|
|
85
|
-
toggled(e: boolean) {
|
|
86
|
-
// Maybe show something like a toast or indicate it on the input itself
|
|
87
|
-
console.log('You toggled ng-thaana: ', e);
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Todos
|
|
92
|
-
|
|
93
|
-
- Write Tests
|
|
94
|
-
- Better doc
|
|
95
|
-
|
|
96
|
-
License
|
|
97
|
-
----
|
|
98
|
-
MIT
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
**Free Software, Hell Yeah!**
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
package/angular.json
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"ng-thaana": {
|
|
7
|
+
"projectType": "library",
|
|
8
|
+
"root": "projects/ng-thaana",
|
|
9
|
+
"sourceRoot": "projects/ng-thaana/src",
|
|
10
|
+
"prefix": "lib",
|
|
11
|
+
"architect": {
|
|
12
|
+
"build": {
|
|
13
|
+
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
14
|
+
"options": {
|
|
15
|
+
"project": "projects/ng-thaana/ng-package.json"
|
|
16
|
+
},
|
|
17
|
+
"configurations": {
|
|
18
|
+
"production": {
|
|
19
|
+
"tsConfig": "projects/ng-thaana/tsconfig.lib.prod.json"
|
|
20
|
+
},
|
|
21
|
+
"development": {
|
|
22
|
+
"tsConfig": "projects/ng-thaana/tsconfig.lib.json"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"defaultConfiguration": "production"
|
|
26
|
+
},
|
|
27
|
+
"test": {
|
|
28
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
29
|
+
"options": {
|
|
30
|
+
"main": "projects/ng-thaana/src/test.ts",
|
|
31
|
+
"tsConfig": "projects/ng-thaana/tsconfig.spec.json",
|
|
32
|
+
"karmaConfig": "projects/ng-thaana/karma.conf.js"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"app": {
|
|
38
|
+
"projectType": "application",
|
|
39
|
+
"schematics": {},
|
|
40
|
+
"root": "projects/app",
|
|
41
|
+
"sourceRoot": "projects/app/src",
|
|
42
|
+
"prefix": "app",
|
|
43
|
+
"architect": {
|
|
44
|
+
"build": {
|
|
45
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
46
|
+
"options": {
|
|
47
|
+
"outputPath": "dist/app",
|
|
48
|
+
"index": "projects/app/src/index.html",
|
|
49
|
+
"main": "projects/app/src/main.ts",
|
|
50
|
+
"polyfills": "projects/app/src/polyfills.ts",
|
|
51
|
+
"tsConfig": "projects/app/tsconfig.app.json",
|
|
52
|
+
"assets": [
|
|
53
|
+
"projects/app/src/favicon.ico",
|
|
54
|
+
"projects/app/src/assets"
|
|
55
|
+
],
|
|
56
|
+
"styles": [
|
|
57
|
+
"projects/app/src/styles.css"
|
|
58
|
+
],
|
|
59
|
+
"scripts": []
|
|
60
|
+
},
|
|
61
|
+
"configurations": {
|
|
62
|
+
"production": {
|
|
63
|
+
"budgets": [
|
|
64
|
+
{
|
|
65
|
+
"type": "initial",
|
|
66
|
+
"maximumWarning": "500kb",
|
|
67
|
+
"maximumError": "1mb"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "anyComponentStyle",
|
|
71
|
+
"maximumWarning": "2kb",
|
|
72
|
+
"maximumError": "4kb"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"fileReplacements": [
|
|
76
|
+
{
|
|
77
|
+
"replace": "projects/app/src/environments/environment.ts",
|
|
78
|
+
"with": "projects/app/src/environments/environment.prod.ts"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"outputHashing": "all"
|
|
82
|
+
},
|
|
83
|
+
"development": {
|
|
84
|
+
"buildOptimizer": false,
|
|
85
|
+
"optimization": false,
|
|
86
|
+
"vendorChunk": true,
|
|
87
|
+
"extractLicenses": false,
|
|
88
|
+
"sourceMap": true,
|
|
89
|
+
"namedChunks": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"defaultConfiguration": "production"
|
|
93
|
+
},
|
|
94
|
+
"serve": {
|
|
95
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
96
|
+
"configurations": {
|
|
97
|
+
"production": {
|
|
98
|
+
"browserTarget": "app:build:production"
|
|
99
|
+
},
|
|
100
|
+
"development": {
|
|
101
|
+
"browserTarget": "app:build:development"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"defaultConfiguration": "development"
|
|
105
|
+
},
|
|
106
|
+
"extract-i18n": {
|
|
107
|
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
108
|
+
"options": {
|
|
109
|
+
"browserTarget": "app:build"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"test": {
|
|
113
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
114
|
+
"options": {
|
|
115
|
+
"main": "projects/app/src/test.ts",
|
|
116
|
+
"polyfills": "projects/app/src/polyfills.ts",
|
|
117
|
+
"tsConfig": "projects/app/tsconfig.spec.json",
|
|
118
|
+
"karmaConfig": "projects/app/karma.conf.js",
|
|
119
|
+
"assets": [
|
|
120
|
+
"projects/app/src/favicon.ico",
|
|
121
|
+
"projects/app/src/assets"
|
|
122
|
+
],
|
|
123
|
+
"styles": [
|
|
124
|
+
"projects/app/src/styles.css"
|
|
125
|
+
],
|
|
126
|
+
"scripts": []
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-thaana",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"
|
|
5
|
-
"@angular/common": "^17.0.5",
|
|
6
|
-
"@angular/core": "^17.0.5"
|
|
7
|
-
},
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"private": false,
|
|
8
5
|
"dependencies": {
|
|
9
|
-
"
|
|
6
|
+
"@angular/animations": "^14.0.0",
|
|
7
|
+
"@angular/common": "^14.0.0",
|
|
8
|
+
"@angular/compiler": "^14.0.0",
|
|
9
|
+
"@angular/core": "^14.0.0",
|
|
10
|
+
"@angular/forms": "^14.0.0",
|
|
11
|
+
"@angular/platform-browser": "^14.0.0",
|
|
12
|
+
"@angular/platform-browser-dynamic": "^14.0.0",
|
|
13
|
+
"@angular/router": "^14.0.0",
|
|
14
|
+
"rxjs": "~7.5.0",
|
|
15
|
+
"tslib": "^2.3.0",
|
|
16
|
+
"zone.js": "~0.11.4"
|
|
10
17
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@angular-devkit/build-angular": "^14.0.7",
|
|
20
|
+
"@angular/cli": "~14.0.4",
|
|
21
|
+
"@angular/compiler-cli": "^14.0.0",
|
|
22
|
+
"@types/jasmine": "~4.0.0",
|
|
23
|
+
"jasmine-core": "~4.1.0",
|
|
24
|
+
"karma": "~6.3.0",
|
|
25
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
26
|
+
"karma-coverage": "~2.2.0",
|
|
27
|
+
"karma-jasmine": "~5.0.0",
|
|
28
|
+
"karma-jasmine-html-reporter": "~1.7.0",
|
|
29
|
+
"ng-packagr": "^14.0.0",
|
|
30
|
+
"typescript": "~4.7.2"
|
|
23
31
|
},
|
|
24
|
-
"
|
|
32
|
+
"scripts": {
|
|
33
|
+
"ng": "ng",
|
|
34
|
+
"start": "ng serve",
|
|
35
|
+
"build": "ng build",
|
|
36
|
+
"watch": "ng build --watch --configuration development",
|
|
37
|
+
"test": "ng test"
|
|
38
|
+
}
|
|
25
39
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
+
# For additional information regarding the format and rule options, please see:
|
|
3
|
+
# https://github.com/browserslist/browserslist#queries
|
|
4
|
+
|
|
5
|
+
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
+
# https://angular.io/guide/browser-support
|
|
7
|
+
|
|
8
|
+
# You can see what browsers were selected by your queries by running:
|
|
9
|
+
# npx browserslist
|
|
10
|
+
|
|
11
|
+
last 1 Chrome version
|
|
12
|
+
last 1 Firefox version
|
|
13
|
+
last 2 Edge major versions
|
|
14
|
+
last 2 Safari major versions
|
|
15
|
+
last 2 iOS major versions
|
|
16
|
+
Firefox ESR
|
|
17
|
+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
jasmine: {
|
|
17
|
+
// you can add configuration options for Jasmine here
|
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
|
20
|
+
// or set a specific seed with `seed: 4321`
|
|
21
|
+
},
|
|
22
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
+
},
|
|
24
|
+
jasmineHtmlReporter: {
|
|
25
|
+
suppressAll: true // removes the duplicated traces
|
|
26
|
+
},
|
|
27
|
+
coverageReporter: {
|
|
28
|
+
dir: require('path').join(__dirname, '../../coverage/thaana-tester'),
|
|
29
|
+
subdir: '.',
|
|
30
|
+
reporters: [
|
|
31
|
+
{ type: 'html' },
|
|
32
|
+
{ type: 'text-summary' }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
reporters: ['progress', 'kjhtml'],
|
|
36
|
+
port: 9876,
|
|
37
|
+
colors: true,
|
|
38
|
+
logLevel: config.LOG_INFO,
|
|
39
|
+
autoWatch: true,
|
|
40
|
+
browsers: ['Chrome'],
|
|
41
|
+
singleRun: false,
|
|
42
|
+
restartOnFileChange: true
|
|
43
|
+
});
|
|
44
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { AppComponent } from './app.component';
|
|
3
|
+
|
|
4
|
+
describe('AppComponent', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await TestBed.configureTestingModule({
|
|
7
|
+
declarations: [
|
|
8
|
+
AppComponent
|
|
9
|
+
],
|
|
10
|
+
}).compileComponents();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should create the app', () => {
|
|
14
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
15
|
+
const app = fixture.componentInstance;
|
|
16
|
+
expect(app).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it(`should have as title 'thaana-tester'`, () => {
|
|
20
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
21
|
+
const app = fixture.componentInstance;
|
|
22
|
+
expect(app.title).toEqual('thaana-tester');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should render title', () => {
|
|
26
|
+
const fixture = TestBed.createComponent(AppComponent);
|
|
27
|
+
fixture.detectChanges();
|
|
28
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
29
|
+
expect(compiled.querySelector('.content span')?.textContent).toContain('thaana-tester app is running!');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-root',
|
|
5
|
+
templateUrl: './app.component.html',
|
|
6
|
+
styleUrls: ['./app.component.scss']
|
|
7
|
+
})
|
|
8
|
+
export class AppComponent {
|
|
9
|
+
title = 'thaana-tester';
|
|
10
|
+
|
|
11
|
+
name!: string
|
|
12
|
+
|
|
13
|
+
postCallback(e: any) {
|
|
14
|
+
console.log('You typed: ', e);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toggled(e: any) {
|
|
18
|
+
console.log('You typed: ', e);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
4
|
+
import { NgThaanaModule } from '../../../ng-thaana/src/lib/ng-thaana.module';
|
|
5
|
+
|
|
6
|
+
import { AppComponent } from './app.component';
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
declarations: [
|
|
10
|
+
AppComponent,
|
|
11
|
+
],
|
|
12
|
+
imports: [
|
|
13
|
+
BrowserModule,
|
|
14
|
+
NgThaanaModule,
|
|
15
|
+
FormsModule,
|
|
16
|
+
],
|
|
17
|
+
providers: [],
|
|
18
|
+
bootstrap: [AppComponent]
|
|
19
|
+
})
|
|
20
|
+
export class AppModule { }
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
+
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
+
// The list of file replacements can be found in `angular.json`.
|
|
4
|
+
|
|
5
|
+
export const environment = {
|
|
6
|
+
production: false
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* For easier debugging in development mode, you can import the following file
|
|
11
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
12
|
+
*
|
|
13
|
+
* This import should be commented out in production mode because it will have a negative impact
|
|
14
|
+
* on performance if an error is thrown.
|
|
15
|
+
*/
|
|
16
|
+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>ThaanaTester</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-root></app-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { enableProdMode } from '@angular/core';
|
|
2
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
+
|
|
4
|
+
import { AppModule } from './app/app.module';
|
|
5
|
+
import { environment } from './environments/environment';
|
|
6
|
+
|
|
7
|
+
if (environment.production) {
|
|
8
|
+
enableProdMode();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
platformBrowserDynamic().bootstrapModule(AppModule)
|
|
12
|
+
.catch(err => console.error(err));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
+
* You can add your own extra polyfills to this file.
|
|
4
|
+
*
|
|
5
|
+
* This file is divided into 2 sections:
|
|
6
|
+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
+
* file.
|
|
9
|
+
*
|
|
10
|
+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
12
|
+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
13
|
+
*
|
|
14
|
+
* Learn more in https://angular.io/guide/browser-support
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/***************************************************************************************************
|
|
18
|
+
* BROWSER POLYFILLS
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* IE11 requires the following for NgClass support on SVG elements
|
|
23
|
+
*/
|
|
24
|
+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Web Animations `@angular/platform-browser/animations`
|
|
28
|
+
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
29
|
+
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
30
|
+
*/
|
|
31
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* By default, zone.js will patch all possible macroTask and DomEvents
|
|
35
|
+
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
|
36
|
+
* because those flags need to be set before `zone.js` being loaded, and webpack
|
|
37
|
+
* will put import in the top of bundle, so user need to create a separate file
|
|
38
|
+
* in this directory (for example: zone-flags.ts), and put the following flags
|
|
39
|
+
* into that file, and then add the following code before importing zone.js.
|
|
40
|
+
* import './zone-flags';
|
|
41
|
+
*
|
|
42
|
+
* The flags allowed in zone-flags.ts are listed here.
|
|
43
|
+
*
|
|
44
|
+
* The following flags will work for all browsers.
|
|
45
|
+
*
|
|
46
|
+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
|
47
|
+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
|
48
|
+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
|
49
|
+
*
|
|
50
|
+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
|
51
|
+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
|
52
|
+
*
|
|
53
|
+
* (window as any).__Zone_enable_cross_context_check = true;
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/***************************************************************************************************
|
|
58
|
+
* Zone JS is required by default for Angular itself.
|
|
59
|
+
*/
|
|
60
|
+
import 'zone.js'; // Included with Angular CLI.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/***************************************************************************************************
|
|
64
|
+
* APPLICATION IMPORTS
|
|
65
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|