xt-plugin-finance 0.6.0 → 0.6.2
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/README.md +3 -3
- package/fesm2022/xt-plugin-finance.mjs +136 -0
- package/fesm2022/xt-plugin-finance.mjs.map +1 -0
- package/index.d.ts +23 -0
- package/package.json +28 -54
- package/.editorconfig +0 -16
- package/.postcssrc.json +0 -1
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build-deploy-latest.chunks.jsonl +0 -79
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build-deploy-next.chunks.jsonl +0 -29
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build.chunks.jsonl +0 -24
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.test.chunks.jsonl +0 -36
- package/.rush/temp/package-deps_test.json +0 -55
- package/.rush/temp/shrinkwrap-deps.json +0 -1082
- package/CHANGELOG.md +0 -13
- package/angular.json +0 -164
- package/projects/finance/README.md +0 -17
- package/projects/finance/ng-package.json +0 -7
- package/projects/finance/node_modules/.vite/results.json +0 -1
- package/projects/finance/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/projects/finance/package.json +0 -22
- package/projects/finance/src/lib/finance-amount/finance-amount.component.css +0 -0
- package/projects/finance/src/lib/finance-amount/finance-amount.component.html +0 -18
- package/projects/finance/src/lib/finance-amount/finance-amount.component.spec.ts +0 -38
- package/projects/finance/src/lib/finance-amount/finance-amount.component.ts +0 -68
- package/projects/finance/src/lib/money-handler/money-amount-handler.ts +0 -21
- package/projects/finance/src/lib/money-handler/money-amount.ts +0 -15
- package/projects/finance/src/lib/register.ts +0 -54
- package/projects/finance/src/public-api.ts +0 -6
- package/projects/finance/src/test-setup.ts +0 -18
- package/projects/finance/tsconfig.lib.json +0 -15
- package/projects/finance/tsconfig.lib.prod.json +0 -11
- package/projects/finance/tsconfig.spec.json +0 -18
- package/projects/finance/vitest.config.ts +0 -19
- package/projects/finance-plugin/federation.config.js +0 -43
- package/projects/finance-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/projects/finance-plugin/public/favicon.ico +0 -0
- package/projects/finance-plugin/public/pluginicon.png +0 -0
- package/projects/finance-plugin/src/app/app.component.css +0 -0
- package/projects/finance-plugin/src/app/app.component.html +0 -3
- package/projects/finance-plugin/src/app/app.component.spec.ts +0 -42
- package/projects/finance-plugin/src/app/app.component.ts +0 -37
- package/projects/finance-plugin/src/app/app.config.ts +0 -21
- package/projects/finance-plugin/src/app/app.routes.ts +0 -6
- package/projects/finance-plugin/src/app/dummy-currency/dummy-currency.component.css +0 -0
- package/projects/finance-plugin/src/app/dummy-currency/dummy-currency.component.html +0 -7
- package/projects/finance-plugin/src/app/dummy-currency/dummy-currency.component.ts +0 -36
- package/projects/finance-plugin/src/app/test-component/test.component.css +0 -0
- package/projects/finance-plugin/src/app/test-component/test.component.html +0 -24
- package/projects/finance-plugin/src/app/test-component/test.component.spec.ts +0 -46
- package/projects/finance-plugin/src/app/test-component/test.component.ts +0 -35
- package/projects/finance-plugin/src/bootstrap.ts +0 -6
- package/projects/finance-plugin/src/index.html +0 -13
- package/projects/finance-plugin/src/main.ts +0 -6
- package/projects/finance-plugin/src/styles.css +0 -12
- package/projects/finance-plugin/src/test-setup.ts +0 -18
- package/projects/finance-plugin/tsconfig.app.json +0 -15
- package/projects/finance-plugin/tsconfig.federation.json +0 -13
- package/projects/finance-plugin/tsconfig.spec.json +0 -18
- package/projects/finance-plugin/vitest.config.ts +0 -19
- package/rush-logs/xt-plugin-finance.build-deploy-latest.error.log +0 -42
- package/rush-logs/xt-plugin-finance.build-deploy-latest.log +0 -79
- package/rush-logs/xt-plugin-finance.build-deploy-next.error.log +0 -10
- package/rush-logs/xt-plugin-finance.build-deploy-next.log +0 -29
- package/rush-logs/xt-plugin-finance.build.error.log +0 -9
- package/rush-logs/xt-plugin-finance.build.log +0 -24
- package/rush-logs/xt-plugin-finance.test.log +0 -36
- package/tsconfig.json +0 -36
package/CHANGELOG.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [0.6.0](https://github.com/dont-code/ng-xtend/compare/xt-plugin-finance-v0.5.5...xt-plugin-finance-v0.6.0) (2026-01-07)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Features
|
|
7
|
-
|
|
8
|
-
* all plugins, libs to release please ([35ddd53](https://github.com/dont-code/ng-xtend/commit/35ddd5362c3350572f44ebe79824e297fd03c7eb))
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Bug Fixes
|
|
12
|
-
|
|
13
|
-
* reworked publish & deploy scripts with release-please ([aed0d88](https://github.com/dont-code/ng-xtend/commit/aed0d884c0a8bfcc85645e87d19480939737bdf6))
|
package/angular.json
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"cli": {
|
|
5
|
-
"packageManager": "pnpm",
|
|
6
|
-
"analytics": "8440f8d0-3f6c-4758-b71e-f9ee11217c7f",
|
|
7
|
-
"cache": {
|
|
8
|
-
"enabled": true
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"newProjectRoot": "projects",
|
|
12
|
-
"projects": {
|
|
13
|
-
"finance": {
|
|
14
|
-
"projectType": "library",
|
|
15
|
-
"root": "projects/finance",
|
|
16
|
-
"sourceRoot": "projects/finance/src",
|
|
17
|
-
"prefix": "lib",
|
|
18
|
-
"architect": {
|
|
19
|
-
"build": {
|
|
20
|
-
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
21
|
-
"options": {
|
|
22
|
-
"project": "projects/finance/ng-package.json"
|
|
23
|
-
},
|
|
24
|
-
"configurations": {
|
|
25
|
-
"production": {
|
|
26
|
-
"tsConfig": "projects/finance/tsconfig.lib.prod.json"
|
|
27
|
-
},
|
|
28
|
-
"development": {
|
|
29
|
-
"tsConfig": "projects/finance/tsconfig.lib.json"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"defaultConfiguration": "development"
|
|
33
|
-
},
|
|
34
|
-
"test": {
|
|
35
|
-
"builder": "@analogjs/vitest-angular:test",
|
|
36
|
-
"options": {
|
|
37
|
-
"tsConfig": "projects/finance/tsconfig.spec.json",
|
|
38
|
-
"polyfills": [
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"finance-plugin": {
|
|
45
|
-
"projectType": "application",
|
|
46
|
-
"schematics": {
|
|
47
|
-
"@schematics/angular:component": {
|
|
48
|
-
"style": "css"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"root": "projects/finance-plugin",
|
|
52
|
-
"sourceRoot": "projects/finance-plugin/src",
|
|
53
|
-
"prefix": "app",
|
|
54
|
-
"architect": {
|
|
55
|
-
"build": {
|
|
56
|
-
"builder": "@angular-architects/native-federation:build",
|
|
57
|
-
"options": {},
|
|
58
|
-
"configurations": {
|
|
59
|
-
"production": {
|
|
60
|
-
"target": "finance-plugin:esbuild:production"
|
|
61
|
-
},
|
|
62
|
-
"development": {
|
|
63
|
-
"target": "finance-plugin:esbuild:development",
|
|
64
|
-
"dev": true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"defaultConfiguration": "production"
|
|
68
|
-
},
|
|
69
|
-
"serve": {
|
|
70
|
-
"builder": "@angular-architects/native-federation:build",
|
|
71
|
-
"options": {
|
|
72
|
-
"target": "finance-plugin:serve-original:development",
|
|
73
|
-
"rebuildDelay": 0,
|
|
74
|
-
"dev": true,
|
|
75
|
-
"port": 0
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"esbuild": {
|
|
79
|
-
"builder": "@angular-devkit/build-angular:application",
|
|
80
|
-
"options": {
|
|
81
|
-
"outputPath": "dist/xt-finance-plugin",
|
|
82
|
-
"index": "projects/finance-plugin/src/index.html",
|
|
83
|
-
"browser": "projects/finance-plugin/src/main.ts",
|
|
84
|
-
"preserveSymlinks": true,
|
|
85
|
-
"polyfills": [
|
|
86
|
-
"es-module-shims"
|
|
87
|
-
],
|
|
88
|
-
"tsConfig": "projects/finance-plugin/tsconfig.app.json",
|
|
89
|
-
"inlineStyleLanguage": "css",
|
|
90
|
-
"assets": [
|
|
91
|
-
{
|
|
92
|
-
"glob": "**/*",
|
|
93
|
-
"input": "projects/finance-plugin/public"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"styles": [
|
|
97
|
-
"projects/finance-plugin/src/styles.css"
|
|
98
|
-
],
|
|
99
|
-
"scripts": []
|
|
100
|
-
},
|
|
101
|
-
"configurations": {
|
|
102
|
-
"production": {
|
|
103
|
-
"budgets": [
|
|
104
|
-
{
|
|
105
|
-
"type": "initial",
|
|
106
|
-
"maximumWarning": "1MB",
|
|
107
|
-
"maximumError": "2MB"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"type": "anyComponentStyle",
|
|
111
|
-
"maximumWarning": "4kB",
|
|
112
|
-
"maximumError": "8kB"
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"outputHashing": "all"
|
|
116
|
-
},
|
|
117
|
-
"development": {
|
|
118
|
-
"optimization": false,
|
|
119
|
-
"extractLicenses": false,
|
|
120
|
-
"sourceMap": true
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"defaultConfiguration": "development"
|
|
124
|
-
},
|
|
125
|
-
"serve-original": {
|
|
126
|
-
"builder": "@angular-devkit/build-angular:dev-server",
|
|
127
|
-
"configurations": {
|
|
128
|
-
"production": {
|
|
129
|
-
"buildTarget": "finance-plugin:esbuild:production"
|
|
130
|
-
},
|
|
131
|
-
"development": {
|
|
132
|
-
"buildTarget": "finance-plugin:esbuild:development"
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"defaultConfiguration": "development",
|
|
136
|
-
"options": {
|
|
137
|
-
"port": 4204
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"extract-i18n": {
|
|
141
|
-
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
142
|
-
},
|
|
143
|
-
"test": {
|
|
144
|
-
"builder": "@analogjs/vitest-angular:test",
|
|
145
|
-
"options": {
|
|
146
|
-
"polyfills": [],
|
|
147
|
-
"tsConfig": "projects/finance-plugin/tsconfig.spec.json",
|
|
148
|
-
"inlineStyleLanguage": "css",
|
|
149
|
-
"assets": [
|
|
150
|
-
{
|
|
151
|
-
"glob": "**/*",
|
|
152
|
-
"input": "projects/finance-plugin/public"
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
"styles": [
|
|
156
|
-
"projects/finance-plugin/src/styles.css"
|
|
157
|
-
],
|
|
158
|
-
"scripts": []
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
# Plugin xt-default
|
|
4
|
-
|
|
5
|
-
This plugin is part of the [ng-xtend framework](https://github.com/dont-code/ng-xtend/blob/main/README.md)
|
|
6
|
-
|
|
7
|
-
It enable [xt-components](https://github.com/dont-code/ng-xtend/tree/main/libs/xt-components) to
|
|
8
|
-
|
|
9
|
-
- Display and edit any primitive value
|
|
10
|
-

|
|
11
|
-
- or complex object
|
|
12
|
-

|
|
13
|
-
- or list of objects
|
|
14
|
-

|
|
15
|
-
|
|
16
|
-
With it you are sure you can display / edit any type within any xt-components application like [xt-host](https://github.com/dont-code/ng-xtend/tree/main/libs/xt-host).
|
|
17
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.1.4","results":[[":src/lib/finance-amount/finance-amount.component.spec.ts",{"duration":585.6307770000021,"failed":false}]]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.2.4","results":[[":src/lib/finance-amount/finance-amount.component.spec.ts",{"duration":458.79492799999935,"failed":false}]]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "xt-plugin-finance",
|
|
3
|
-
"version": "0.6.0",
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "^19.0.5",
|
|
6
|
-
"@angular/common": "^19.0.5",
|
|
7
|
-
"@angular/compiler": "^19.0.5",
|
|
8
|
-
"@angular/core": "^19.0.5",
|
|
9
|
-
"@angular/forms": "^19.0.5",
|
|
10
|
-
"@angular/platform-browser": "^19.0.5",
|
|
11
|
-
"@angular/platform-browser-dynamic": "^19.0.5",
|
|
12
|
-
"@angular/router": "^19.0.5",
|
|
13
|
-
"xt-components": "workspace:^",
|
|
14
|
-
"rxjs": "^7.8.0",
|
|
15
|
-
"primeng": "^19.0.2",
|
|
16
|
-
"primeicons": "^7.0.0"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"tslib": "^2.3.0"
|
|
20
|
-
},
|
|
21
|
-
"sideEffects": false
|
|
22
|
-
}
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
@if (isInForm() ) {
|
|
2
|
-
@let cur = currency();
|
|
3
|
-
<ng-container [formGroup]="formGroup()">
|
|
4
|
-
@if (!isFixedCurrency) {
|
|
5
|
-
<xt-render-sub [context]="subContext('currency', 'currency')" (outputs)="outputChanged($event)" />
|
|
6
|
-
}
|
|
7
|
-
@if (cur != null) {
|
|
8
|
-
<p-inputNumber mode="currency" [currency]="cur" formControlName="amount" />
|
|
9
|
-
} @else {
|
|
10
|
-
<p-inputNumber mode="decimal" formControlName="amount" />
|
|
11
|
-
}
|
|
12
|
-
</ng-container>
|
|
13
|
-
} @else {
|
|
14
|
-
@let displayAmount = displayValue();
|
|
15
|
-
@if ((displayAmount) && (displayAmount.amount!=null)) {
|
|
16
|
-
<span>{{ displayAmount.amount | currency : displayAmount.currency }}</span>
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FinanceAmountComponent } from './finance-amount.component';
|
|
4
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
5
|
-
import { XtBaseContext } from 'xt-components';
|
|
6
|
-
import { MoneyAmount } from '../money-handler/money-amount';
|
|
7
|
-
import { By } from '@angular/platform-browser';
|
|
8
|
-
|
|
9
|
-
describe('FinanceAmountComponent', () => {
|
|
10
|
-
let component: FinanceAmountComponent;
|
|
11
|
-
let fixture: ComponentFixture<FinanceAmountComponent>;
|
|
12
|
-
|
|
13
|
-
beforeEach(async () => {
|
|
14
|
-
await TestBed.configureTestingModule({
|
|
15
|
-
imports: [FinanceAmountComponent]
|
|
16
|
-
})
|
|
17
|
-
.compileComponents();
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should display amount', () => {
|
|
22
|
-
fixture = TestBed.createComponent(FinanceAmountComponent);
|
|
23
|
-
const context=new XtBaseContext<MoneyAmount>('FULL_VIEW');
|
|
24
|
-
context.setDisplayValue({
|
|
25
|
-
currency:'EUR',
|
|
26
|
-
amount:12.4
|
|
27
|
-
});
|
|
28
|
-
fixture.componentRef.setInput("context", context);
|
|
29
|
-
component = fixture.componentInstance;
|
|
30
|
-
fixture.detectChanges();
|
|
31
|
-
expect(component).toBeTruthy();
|
|
32
|
-
const textContent=fixture.debugElement.query(By.css('span') ).nativeElement.textContent;
|
|
33
|
-
expect(textContent).contains('12');
|
|
34
|
-
expect(textContent).contains('40');
|
|
35
|
-
expect(textContent).contains('€');
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
computed,
|
|
5
|
-
inject,
|
|
6
|
-
Injector,
|
|
7
|
-
OnInit,
|
|
8
|
-
runInInjectionContext,
|
|
9
|
-
signal
|
|
10
|
-
} from '@angular/core';
|
|
11
|
-
import { XtComponentOutput, XtCompositeComponent, XtRenderSubComponent, XtResolverService } from 'xt-components';
|
|
12
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
|
-
import { InputNumber } from 'primeng/inputnumber';
|
|
14
|
-
import { CurrencyPipe } from '@angular/common';
|
|
15
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
16
|
-
import { MoneyAmount } from '../money-handler/money-amount';
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'xt-finance-amount',
|
|
20
|
-
imports: [
|
|
21
|
-
InputNumber,
|
|
22
|
-
CurrencyPipe,
|
|
23
|
-
XtRenderSubComponent,
|
|
24
|
-
ReactiveFormsModule
|
|
25
|
-
],
|
|
26
|
-
templateUrl: './finance-amount.component.html',
|
|
27
|
-
styleUrl: './finance-amount.component.css',
|
|
28
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
29
|
-
})
|
|
30
|
-
export class FinanceAmountComponent extends XtCompositeComponent<MoneyAmount> implements OnInit {
|
|
31
|
-
isFixedCurrency=true;
|
|
32
|
-
currency= signal<string|undefined>( undefined );
|
|
33
|
-
|
|
34
|
-
override ngOnInit(): void {
|
|
35
|
-
super.ngOnInit();
|
|
36
|
-
|
|
37
|
-
// The same components support multiple types: money-amount (with currency selection), eur-amount or usd-amount
|
|
38
|
-
let value=this.context().value();
|
|
39
|
-
if ((this.context().valueType=='money-amount') || (this.context().valueType==null)) {
|
|
40
|
-
this.isFixedCurrency=false;
|
|
41
|
-
this.currency.set(value?.currency);
|
|
42
|
-
}else if (this.context().valueType?.endsWith('-amount')) {
|
|
43
|
-
this.isFixedCurrency=true;
|
|
44
|
-
const currency=this.context().valueType?.substring(0,3).toUpperCase();
|
|
45
|
-
// Enforce the currency if needed
|
|
46
|
-
if (this.isInForm()) {
|
|
47
|
-
if (value==null) {
|
|
48
|
-
value=this.resolverService.findTypeHandlerOf(this.context()).handler?.createNew()??{};
|
|
49
|
-
this.context().setFormValue(value, true);
|
|
50
|
-
}else if (value.currency==null) {
|
|
51
|
-
value.currency=currency;
|
|
52
|
-
this.context().setFormValue(value, true);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
this.currency.set(currency);
|
|
56
|
-
}
|
|
57
|
-
this.manageFormControl('amount');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
outputChanged($output:XtComponentOutput | null) {
|
|
61
|
-
if ($output?.valueSelected!=null) {
|
|
62
|
-
$output?.valueSelected.subscribe (selected => {
|
|
63
|
-
this.currency.set(selected);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AbstractTypeHandler, XtTypeHierarchy } from 'xt-type';
|
|
2
|
-
import { MoneyAmount } from './money-amount';
|
|
3
|
-
|
|
4
|
-
export class MoneyAmountHandler extends AbstractTypeHandler<MoneyAmount> {
|
|
5
|
-
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.fields.addOldField('currencyCode','currency');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
override createNew(): MoneyAmount {
|
|
12
|
-
const ret:MoneyAmount = {} as unknown as MoneyAmount;
|
|
13
|
-
if (this.type?.type?.endsWith('-amount')) {
|
|
14
|
-
if (this.type.type!='money-amount') {
|
|
15
|
-
ret.currency=this.type.type.substring(0,3).toUpperCase();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return ret;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { XtResolverService } from 'xt-components';
|
|
2
|
-
import { MoneyAmountHandler } from './money-handler/money-amount-handler';
|
|
3
|
-
import { FinanceAmountComponent } from './finance-amount/finance-amount.component';
|
|
4
|
-
|
|
5
|
-
export function registerFinancePlugin (resolverService:XtResolverService):string {
|
|
6
|
-
const pluginName = "Plugin Finance";
|
|
7
|
-
console.info ('Registering '+pluginName);
|
|
8
|
-
resolverService.registerPlugin ({
|
|
9
|
-
name:pluginName,
|
|
10
|
-
uriLogo:'pluginicon.png',
|
|
11
|
-
components: [
|
|
12
|
-
{
|
|
13
|
-
componentName:'FinanceAmount',
|
|
14
|
-
componentClass:FinanceAmountComponent,
|
|
15
|
-
typesHandled: ['money-amount','eur-amount','usd-amount'],
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
types: {
|
|
19
|
-
"money-amount":{
|
|
20
|
-
numericField: 'amount',
|
|
21
|
-
children:{
|
|
22
|
-
currency:'currency',
|
|
23
|
-
amount:'number'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"eur-amount":{
|
|
27
|
-
numericField: 'amount',
|
|
28
|
-
children: {
|
|
29
|
-
currency: 'currency',
|
|
30
|
-
amount: 'number'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"usd-amount":{
|
|
34
|
-
numericField: 'amount',
|
|
35
|
-
children: {
|
|
36
|
-
currency: 'currency',
|
|
37
|
-
amount: 'number'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
,typeHandlers:[
|
|
42
|
-
{
|
|
43
|
-
typesHandled: ['money-amount', 'eur-amount', 'usd-amount'],
|
|
44
|
-
handlerClass: MoneyAmountHandler
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
return pluginName;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function registerPlugin (resolverService:XtResolverService):string {
|
|
53
|
-
return registerFinancePlugin(resolverService);
|
|
54
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "@angular/compiler";
|
|
2
|
-
|
|
3
|
-
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
|
|
4
|
-
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import { NgModule, provideZonelessChangeDetection } from '@angular/core';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@NgModule({
|
|
10
|
-
imports: [BrowserTestingModule],
|
|
11
|
-
providers: [provideZonelessChangeDetection()],
|
|
12
|
-
})
|
|
13
|
-
export class TestingModule {}
|
|
14
|
-
|
|
15
|
-
getTestBed().initTestEnvironment(
|
|
16
|
-
[TestingModule],
|
|
17
|
-
platformBrowserTesting()
|
|
18
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../out-tsc/lib",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"types": []
|
|
11
|
-
},
|
|
12
|
-
"exclude": [
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "./tsconfig.lib.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"declarationMap": false
|
|
7
|
-
},
|
|
8
|
-
"angularCompilerOptions": {
|
|
9
|
-
"compilationMode": "partial"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../out-tsc/spec",
|
|
7
|
-
"target": "es2016",
|
|
8
|
-
"types": [
|
|
9
|
-
"vitest/globals","node"
|
|
10
|
-
],
|
|
11
|
-
"emitDecoratorMetadata": true
|
|
12
|
-
},
|
|
13
|
-
"files": ["src/test-setup.ts"],
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*.spec.ts",
|
|
16
|
-
"src/**/*.d.ts"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="vitest" />
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
|
|
4
|
-
import angular from '@analogjs/vite-plugin-angular';
|
|
5
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
6
|
-
|
|
7
|
-
export default defineConfig(({ mode }) => ({
|
|
8
|
-
plugins: [angular(), tsconfigPaths()],
|
|
9
|
-
test: {
|
|
10
|
-
globals: true,
|
|
11
|
-
setupFiles: ['src/test-setup.ts'],
|
|
12
|
-
environment: 'jsdom',
|
|
13
|
-
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
14
|
-
reporters: ['default']
|
|
15
|
-
},
|
|
16
|
-
define: {
|
|
17
|
-
'import.meta.vitest': mode !== 'production',
|
|
18
|
-
},
|
|
19
|
-
}));
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const { withNativeFederation, shareAll, share } = require('@angular-architects/native-federation/config');
|
|
2
|
-
|
|
3
|
-
module.exports = withNativeFederation({
|
|
4
|
-
|
|
5
|
-
name: 'finance-plugin',
|
|
6
|
-
|
|
7
|
-
exposes: {
|
|
8
|
-
'./FinanceAmountComponent': './projects/finance/src/lib/finance-amount/finance-amount.component.ts',
|
|
9
|
-
'./Register': './projects/finance/src/lib/register.ts'
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
shared: {
|
|
13
|
-
...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
|
|
14
|
-
...share({
|
|
15
|
-
"@primeuix/themes/aura": {
|
|
16
|
-
singleton: true,
|
|
17
|
-
strictVersion: true,
|
|
18
|
-
requiredVersion: "auto",
|
|
19
|
-
includeSecondaries: false,
|
|
20
|
-
build: 'separate',
|
|
21
|
-
packageInfo: {
|
|
22
|
-
entryPoint: 'node_modules/@primeuix/themes/dist/aura/index.mjs'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
})},
|
|
26
|
-
features: {
|
|
27
|
-
ignoreUnusedDeps:true
|
|
28
|
-
},
|
|
29
|
-
skip: [
|
|
30
|
-
'rxjs/ajax',
|
|
31
|
-
'rxjs/fetch',
|
|
32
|
-
'rxjs/testing',
|
|
33
|
-
'rxjs/webSocket',
|
|
34
|
-
// Add further packages you don't need at runtime
|
|
35
|
-
'chart.js/auto',
|
|
36
|
-
'primeng/chart',
|
|
37
|
-
'primeicons'
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
// Please read our FAQ about sharing libs:
|
|
41
|
-
// https://shorturl.at/jmzH0
|
|
42
|
-
|
|
43
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.2.4","results":[[":src/app/app.component.spec.ts",{"duration":190.44691199999943,"failed":false}],[":src/app/test-component/test.component.spec.ts",{"duration":794.0362139999997,"failed":false}]]}
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { inject, provideZonelessChangeDetection } from '@angular/core';
|
|
2
|
-
import { TestBed } from '@angular/core/testing';
|
|
3
|
-
import { AppComponent } from './app.component';
|
|
4
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
5
|
-
import { provideNoopAnimations } from '@angular/platform-browser/animations';
|
|
6
|
-
import { XtResolverService } from 'xt-components';
|
|
7
|
-
|
|
8
|
-
describe('AppComponent', () => {
|
|
9
|
-
|
|
10
|
-
let resolver:XtResolverService;
|
|
11
|
-
|
|
12
|
-
beforeEach(async () => {
|
|
13
|
-
await TestBed.configureTestingModule({
|
|
14
|
-
imports: [AppComponent],
|
|
15
|
-
providers: [provideNoopAnimations(),provideZonelessChangeDetection()]
|
|
16
|
-
}).compileComponents();
|
|
17
|
-
|
|
18
|
-
resolver = TestBed.inject(XtResolverService);
|
|
19
|
-
resolver.registerTypes({
|
|
20
|
-
currency: 'string'
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should create the app', () => {
|
|
25
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
26
|
-
const app = fixture.componentInstance;
|
|
27
|
-
expect(app).toBeTruthy();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it(`should have the 'Finance Tester' title`, () => {
|
|
31
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
32
|
-
const app = fixture.componentInstance;
|
|
33
|
-
expect(app.title).toEqual('Finance Tester');
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should render title', () => {
|
|
37
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
38
|
-
fixture.detectChanges();
|
|
39
|
-
const compiled = fixture.nativeElement as HTMLElement;
|
|
40
|
-
expect(compiled.querySelector('h1')?.textContent).toContain('Finance Plugin Testing app');
|
|
41
|
-
});
|
|
42
|
-
});
|