nexheal-lib 0.0.2 → 0.0.3

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 (62) hide show
  1. package/.editorconfig +17 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/README.md +15 -19
  6. package/angular.json +36 -0
  7. package/package.json +47 -23
  8. package/projects/nexheal-lib/README.md +63 -0
  9. package/projects/nexheal-lib/ng-package.json +9 -0
  10. package/projects/nexheal-lib/package.json +12 -0
  11. package/projects/nexheal-lib/src/directives/clickoutside.directive.ts +34 -0
  12. package/projects/nexheal-lib/src/lib/controls/autocomplete-control/autocomplete-control.component.html +52 -0
  13. package/projects/nexheal-lib/src/lib/controls/autocomplete-control/autocomplete-control.component.scss +22 -0
  14. package/projects/nexheal-lib/src/lib/controls/autocomplete-control/autocomplete-control.component.spec.ts +22 -0
  15. package/projects/nexheal-lib/src/lib/controls/autocomplete-control/autocomplete-control.component.ts +367 -0
  16. package/projects/nexheal-lib/src/lib/controls/calendar-control/calendar-control.component.html +152 -0
  17. package/projects/nexheal-lib/src/lib/controls/calendar-control/calendar-control.component.scss +194 -0
  18. package/projects/nexheal-lib/src/lib/controls/calendar-control/calendar-control.component.spec.ts +22 -0
  19. package/projects/nexheal-lib/src/lib/controls/calendar-control/calendar-control.component.ts +759 -0
  20. package/projects/nexheal-lib/src/lib/controls/checkbox-control/checkbox-control.component.html +4 -0
  21. package/projects/nexheal-lib/src/lib/controls/checkbox-control/checkbox-control.component.spec.ts +22 -0
  22. package/projects/nexheal-lib/src/lib/controls/checkbox-control/checkbox-control.component.ts +94 -0
  23. package/projects/nexheal-lib/src/lib/controls/input-control/input-control.component.html +61 -0
  24. package/projects/nexheal-lib/src/lib/controls/input-control/input-control.component.scss +132 -0
  25. package/projects/nexheal-lib/src/lib/controls/input-control/input-control.component.spec.ts +22 -0
  26. package/projects/nexheal-lib/src/lib/controls/input-control/input-control.component.ts +202 -0
  27. package/projects/nexheal-lib/src/lib/controls/multiselect-control/multiselect-control.component.html +72 -0
  28. package/projects/nexheal-lib/src/lib/controls/multiselect-control/multiselect-control.component.scss +90 -0
  29. package/projects/nexheal-lib/src/lib/controls/multiselect-control/multiselect-control.component.spec.ts +22 -0
  30. package/projects/nexheal-lib/src/lib/controls/multiselect-control/multiselect-control.component.ts +482 -0
  31. package/projects/nexheal-lib/src/lib/controls/select-control/select-control.component.html +53 -0
  32. package/projects/nexheal-lib/src/lib/controls/select-control/select-control.component.scss +19 -0
  33. package/projects/nexheal-lib/src/lib/controls/select-control/select-control.component.spec.ts +22 -0
  34. package/projects/nexheal-lib/src/lib/controls/select-control/select-control.component.ts +375 -0
  35. package/projects/nexheal-lib/src/lib/controls/switch-control/switch-control.component.html +4 -0
  36. package/projects/nexheal-lib/src/lib/controls/switch-control/switch-control.component.scss +53 -0
  37. package/projects/nexheal-lib/src/lib/controls/switch-control/switch-control.component.spec.ts +22 -0
  38. package/projects/nexheal-lib/src/lib/controls/switch-control/switch-control.component.ts +93 -0
  39. package/projects/nexheal-lib/src/lib/controls/text-editor/text-editor.component.html +88 -0
  40. package/projects/nexheal-lib/src/lib/controls/text-editor/text-editor.component.scss +122 -0
  41. package/projects/nexheal-lib/src/lib/controls/text-editor/text-editor.component.spec.ts +22 -0
  42. package/projects/nexheal-lib/src/lib/controls/text-editor/text-editor.component.ts +314 -0
  43. package/projects/nexheal-lib/src/lib/controls/textarea-control/textarea-control.component.html +19 -0
  44. package/projects/nexheal-lib/src/lib/controls/textarea-control/textarea-control.component.scss +15 -0
  45. package/projects/nexheal-lib/src/lib/controls/textarea-control/textarea-control.component.spec.ts +22 -0
  46. package/projects/nexheal-lib/src/lib/controls/textarea-control/textarea-control.component.ts +83 -0
  47. package/projects/nexheal-lib/src/public-api.ts +13 -0
  48. package/projects/nexheal-lib/src/styles/nexheal.scss +1 -0
  49. package/projects/nexheal-lib/tsconfig.lib.json +18 -0
  50. package/projects/nexheal-lib/tsconfig.lib.prod.json +11 -0
  51. package/projects/nexheal-lib/tsconfig.spec.json +14 -0
  52. package/tsconfig.json +39 -0
  53. package/fesm2022/nexheal-lib.mjs +0 -2837
  54. package/fesm2022/nexheal-lib.mjs.map +0 -1
  55. package/index.d.ts +0 -498
  56. package/src/styles/fonts/icomoon.eot +0 -0
  57. package/src/styles/fonts/icomoon.svg +0 -46
  58. package/src/styles/fonts/icomoon.ttf +0 -0
  59. package/src/styles/fonts/icomoon.woff +0 -0
  60. package/src/styles/icon.css +0 -133
  61. package/src/styles/nexheal.scss +0 -2
  62. /package/{src → projects/nexheal-lib/src}/styles/_formcontrols.scss +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,17 @@
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
+ ij_typescript_use_double_quotes = false
14
+
15
+ [*.md]
16
+ max_line_length = off
17
+ trim_trailing_whitespace = false
@@ -0,0 +1,4 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3
+ "recommendations": ["angular.ng-template"]
4
+ }
@@ -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": "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,6 +1,16 @@
1
- # NexhealLib
1
+ # Lib
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.0.
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.0.5.
4
+
5
+ ## Development server
6
+
7
+ To start a local development server, run:
8
+
9
+ ```bash
10
+ ng serve
11
+ ```
12
+
13
+ Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
4
14
 
5
15
  ## Code scaffolding
6
16
 
@@ -18,27 +28,13 @@ ng generate --help
18
28
 
19
29
  ## Building
20
30
 
21
- To build the library, run:
31
+ To build the project run:
22
32
 
23
33
  ```bash
24
- ng build nexheal-lib
34
+ ng build
25
35
  ```
26
36
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
-
29
- ### Publishing the Library
30
-
31
- Once the project is built, you can publish your library by following these steps:
32
-
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/nexheal-lib
36
- ```
37
-
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
37
+ This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
42
38
 
43
39
  ## Running unit tests
44
40
 
package/angular.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "nexheal-lib": {
7
+ "projectType": "library",
8
+ "root": "projects/nexheal-lib",
9
+ "sourceRoot": "projects/nexheal-lib/src",
10
+ "prefix": "lib",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular/build:ng-packagr",
14
+ "configurations": {
15
+ "production": {
16
+ "tsConfig": "projects/nexheal-lib/tsconfig.lib.prod.json"
17
+ },
18
+ "development": {
19
+ "tsConfig": "projects/nexheal-lib/tsconfig.lib.json"
20
+ }
21
+ },
22
+ "defaultConfiguration": "production"
23
+ },
24
+ "test": {
25
+ "builder": "@angular/build:karma",
26
+ "options": {
27
+ "tsConfig": "projects/nexheal-lib/tsconfig.spec.json"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ },
33
+ "cli": {
34
+ "analytics": "fb79a96b-c8e6-48b5-b3da-6b972d806f12"
35
+ }
36
+ }
package/package.json CHANGED
@@ -1,23 +1,47 @@
1
- {
2
- "name": "nexheal-lib",
3
- "version": "0.0.2",
4
- "peerDependencies": {
5
- "@angular/common": "^20.1.0",
6
- "@angular/core": "^20.1.0"
7
- },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "sideEffects": false,
12
- "module": "fesm2022/nexheal-lib.mjs",
13
- "typings": "index.d.ts",
14
- "exports": {
15
- "./package.json": {
16
- "default": "./package.json"
17
- },
18
- ".": {
19
- "types": "./index.d.ts",
20
- "default": "./fesm2022/nexheal-lib.mjs"
21
- }
22
- }
23
- }
1
+ {
2
+ "name": "nexheal-lib",
3
+ "version": "0.0.3",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "start": "ng serve",
7
+ "build": "ng build",
8
+ "watch": "ng build --watch --configuration development",
9
+ "test": "ng test"
10
+ },
11
+ "prettier": {
12
+ "overrides": [
13
+ {
14
+ "files": "*.html",
15
+ "options": {
16
+ "parser": "angular"
17
+ }
18
+ }
19
+ ]
20
+ },
21
+ "private": false,
22
+ "dependencies": {
23
+ "@angular/common": "^20.0.0",
24
+ "@angular/compiler": "^20.0.0",
25
+ "@angular/core": "^20.0.0",
26
+ "@angular/forms": "^20.0.0",
27
+ "@angular/platform-browser": "^20.0.0",
28
+ "@angular/router": "^20.0.0",
29
+ "@popperjs/core": "^2.11.8",
30
+ "rxjs": "~7.8.0",
31
+ "tslib": "^2.3.0"
32
+ },
33
+ "devDependencies": {
34
+ "@angular/build": "^20.1.3",
35
+ "@angular/cli": "^20.0.5",
36
+ "@angular/compiler-cli": "^20.0.0",
37
+ "@types/jasmine": "~5.1.0",
38
+ "jasmine-core": "~5.7.0",
39
+ "karma": "~6.4.0",
40
+ "karma-chrome-launcher": "~3.2.0",
41
+ "karma-coverage": "~2.2.0",
42
+ "karma-jasmine": "~5.1.0",
43
+ "karma-jasmine-html-reporter": "~2.1.0",
44
+ "ng-packagr": "^20.1.0",
45
+ "typescript": "~5.8.2"
46
+ }
47
+ }
@@ -0,0 +1,63 @@
1
+ # NexhealLib
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build nexheal-lib
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/nexheal-lib
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/nexheal-lib",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts",
6
+ "styleIncludePaths": ["src/styles"]
7
+ },
8
+ "assets": ["src/styles"]
9
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "nexheal-lib",
3
+ "version": "0.0.3",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.1.0",
6
+ "@angular/core": "^20.1.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false
12
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Directive,
3
+ ElementRef,
4
+ EventEmitter,
5
+ Output,
6
+ inject,
7
+ DestroyRef,
8
+ } from '@angular/core';
9
+ import { DOCUMENT } from '@angular/common';
10
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
11
+ import { fromEvent } from 'rxjs';
12
+
13
+ @Directive({
14
+ selector: '[clickOutside]',
15
+ standalone: true,
16
+ })
17
+ export class ClickOutsideDirective {
18
+ @Output() clickOutside = new EventEmitter<MouseEvent>();
19
+
20
+ private host = inject(ElementRef);
21
+ private document = inject(DOCUMENT);
22
+ private destroyRef = inject(DestroyRef);
23
+
24
+ constructor() {
25
+ fromEvent<MouseEvent>(this.document, 'click')
26
+ .pipe(takeUntilDestroyed(this.destroyRef))
27
+ .subscribe((event: MouseEvent) => {
28
+ const clickedInside = this.host.nativeElement.contains(event.target);
29
+ if (!clickedInside) {
30
+ this.clickOutside.emit(event);
31
+ }
32
+ });
33
+ }
34
+ }
@@ -0,0 +1,52 @@
1
+ <div class="form-group auto-complete" [ngClass]="customClass">
2
+ @if (title) {
3
+ <label class="inp-label" [ngClass]="{ 'required': required }">{{ title }}</label>
4
+ }
5
+
6
+ <input #inputElement type="text" class="form-control" [placeholder]="placeholder" [formControl]="inputControl"
7
+ (blur)="onBlur()" (keydown)="onKeyDown($event)" (focus)="onFocus()" [ngClass]="{'is-invalid': error}"
8
+ [attr.autocomplete]="autocomplete || null" />
9
+
10
+ <span class="focus-border"></span>
11
+
12
+ @if (!inputLoader && inputControl.value && clearVal && hasFocus) {
13
+ <label class="clear" (click)="resetInput()">
14
+ <i class="he he-close"></i>
15
+ </label>
16
+ }
17
+ @if (isDropdownOpen) {
18
+ <div #dropdownElement class="option-list">
19
+ @if (filteredSuggestions.length === 0) {
20
+ <div class="no-results">
21
+ <div>No results found</div>
22
+ @if (isAddNewItem) {
23
+ <div (click)="onAddNewItemClick()" class="btn-new">
24
+ Add New Item
25
+ </div>
26
+ }
27
+ </div>
28
+ } @else {
29
+ @for (suggestion of filteredSuggestions; track suggestion[optionDisplayProperty]; let i = $index) {
30
+ <div class="list-item" [ngClass]="{
31
+ 'active': suggestion === selectedItems,
32
+ 'highlighted': highlightedIndex === i
33
+ }" (mousedown)="onOptionMouseDown()" (click)="selectSuggestion(suggestion)" (mouseover)="onMouseOver(i)">
34
+ @if (suggestion.countryCode) {
35
+ <img src="https://flagcdn.com/w80/{{ suggestion.countryCode }}.png" width="20"
36
+ alt="{{ suggestion.countryCode }} flag" loading="lazy" />
37
+ }
38
+ {{ suggestion[optionDisplayProperty] }}
39
+ </div>
40
+ }
41
+ }
42
+ </div>
43
+ }
44
+
45
+ @if (inputLoader) {
46
+ <label class="loader input-loader"></label>
47
+ }
48
+
49
+ @if (error) {
50
+ <div class="val-msg">{{ errorMessage }}</div>
51
+ }
52
+ </div>
@@ -0,0 +1,22 @@
1
+ .form-group {
2
+ &.auto-complete {
3
+ .form-control {
4
+ padding-right: unset;
5
+ }
6
+ .clear {
7
+ right: 7px;
8
+ }
9
+ .option-list {
10
+ .no-results {
11
+ padding: 10px;
12
+ color: #9b9b9b;
13
+ text-align: center;
14
+ .btn-new {
15
+ padding: 5px 0;
16
+ cursor: pointer;
17
+ color: #0d6efd;
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { AutocompleteControl } from './autocomplete-control.component';
3
+
4
+ describe('AutocompleteControl', () => {
5
+ let component: AutocompleteControl;
6
+ let fixture: ComponentFixture<AutocompleteControl>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [AutocompleteControl]
11
+ })
12
+ .compileComponents();
13
+
14
+ fixture = TestBed.createComponent(AutocompleteControl);
15
+ component = fixture.componentInstance;
16
+ fixture.detectChanges();
17
+ });
18
+
19
+ it('should create', () => {
20
+ expect(component).toBeTruthy();
21
+ });
22
+ });