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

|
|
2
|
-
|
|
3
|
-
# XT-Plugin-Sample
|
|
4
|
-
|
|
5
|
-
This is a plugin for [ng-xtend framework](https://github.com/dont-code/ng-xtend/blob/main/README.md).
|
|
6
|
-
|
|
7
|
-
It is an example of very Simple (Hello), Simple (Currency) and Complex (Money) components supporting ng-xtend
|
|
8
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.1.4","results":[[":src/lib/country/intl-country.component.spec.ts",{"duration":93.49325200000021,"failed":false}]]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.2.4","results":[[":src/lib/currency/intl-currency.component.spec.ts",{"duration":622.5719389999977,"failed":false}],[":src/lib/country/intl-country.component.spec.ts",{"duration":401.13012100000196,"failed":false}]]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "xt-plugin-intl",
|
|
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,24 +0,0 @@
|
|
|
1
|
-
@if (isInForm() ) {
|
|
2
|
-
<ng-container [formGroup]="formGroup()">
|
|
3
|
-
<p-autocomplete [fluid]="true" optionValue="alpha3" [forceSelection]="true" [dropdown]="true" [formControlName]="formControlName()" [suggestions]="listOfCountries()" (completeMethod)="matchCountry($event)" (onUnselect)="selectionCanceled($event)" (onSelect)="selectionChange($event)">
|
|
4
|
-
<ng-template let-country #item>
|
|
5
|
-
<div class="flex items-center gap-4">
|
|
6
|
-
<img [src]="country.flag" style="width: 18px" />
|
|
7
|
-
<span>{{country.label}}</span>
|
|
8
|
-
</div>
|
|
9
|
-
</ng-template>
|
|
10
|
-
</p-autocomplete>
|
|
11
|
-
</ng-container>
|
|
12
|
-
} @else {
|
|
13
|
-
@let country=currentCountry();
|
|
14
|
-
@if (country!=null) {
|
|
15
|
-
@if (context().displayMode=='INLINE_VIEW') {
|
|
16
|
-
<img [src]="country.flag" style="width: 18px" />
|
|
17
|
-
} @else {
|
|
18
|
-
<div class="flex items-center gap-4">
|
|
19
|
-
<img [src]="country.flag" style="width: 18px" />
|
|
20
|
-
<span>{{country.label}}</span>
|
|
21
|
-
</div>
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
3
|
-
import { registerInternationalPlugin } from '../register';
|
|
4
|
-
import { XtBaseContext, XtResolverService } from 'xt-components';
|
|
5
|
-
import { IntlCountryComponent } from './intl-country.component';
|
|
6
|
-
import { provideZonelessChangeDetection } from '@angular/core';
|
|
7
|
-
|
|
8
|
-
describe('IntlCountryComponent', () => {
|
|
9
|
-
let component: IntlCountryComponent;
|
|
10
|
-
let fixture: ComponentFixture<IntlCountryComponent>;
|
|
11
|
-
|
|
12
|
-
beforeEach(async () => {
|
|
13
|
-
await TestBed.configureTestingModule({
|
|
14
|
-
imports: [IntlCountryComponent],
|
|
15
|
-
providers: [provideZonelessChangeDetection()]
|
|
16
|
-
})
|
|
17
|
-
.compileComponents();
|
|
18
|
-
|
|
19
|
-
registerInternationalPlugin(TestBed.inject(XtResolverService));
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
fixture = TestBed.createComponent(IntlCountryComponent);
|
|
24
|
-
component = fixture.componentInstance;
|
|
25
|
-
const context= new XtBaseContext<string>('FULL_VIEW');
|
|
26
|
-
context.setDisplayValue("FRA");
|
|
27
|
-
fixture.componentRef.setInput('context', context);
|
|
28
|
-
fixture.detectChanges();
|
|
29
|
-
|
|
30
|
-
expect(component).toBeTruthy();
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, OnInit, output, signal } from '@angular/core';
|
|
2
|
-
import { XtSimpleComponent } from 'xt-components';
|
|
3
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
-
AutoComplete,
|
|
6
|
-
AutoCompleteCompleteEvent,
|
|
7
|
-
AutoCompleteSelectEvent,
|
|
8
|
-
AutoCompleteUnselectEvent
|
|
9
|
-
} from 'primeng/autocomplete';
|
|
10
|
-
import countriests from 'countries-ts';
|
|
11
|
-
const { listCountries, searchCountries, alpha3Codes, getByAlpha3 } = countriests;
|
|
12
|
-
|
|
13
|
-
import { Country } from 'countries-ts';
|
|
14
|
-
|
|
15
|
-
@Component({
|
|
16
|
-
selector: 'xt-intl-country',
|
|
17
|
-
imports: [
|
|
18
|
-
ReactiveFormsModule,
|
|
19
|
-
AutoComplete
|
|
20
|
-
],
|
|
21
|
-
templateUrl: './intl-country.component.html',
|
|
22
|
-
styleUrl: './intl-country.component.css',
|
|
23
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
24
|
-
})
|
|
25
|
-
export class IntlCountryComponent extends XtSimpleComponent<string> {
|
|
26
|
-
selected= output<string|undefined>();
|
|
27
|
-
|
|
28
|
-
listOfCountries=signal<Country[]> (listCountries());
|
|
29
|
-
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
// Converts the code to alpha3 codes
|
|
33
|
-
this.toAlpha3(listCountries());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
matchCountry($event: AutoCompleteCompleteEvent) {
|
|
37
|
-
this.listOfCountries.set (searchCountries($event.query)
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
selectionChange($event: AutoCompleteSelectEvent) {
|
|
42
|
-
this.selected.emit($event.value.alpha3);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
selectionCanceled($event: AutoCompleteUnselectEvent) {
|
|
46
|
-
this.selected.emit(undefined);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
override setupInputOutput () {
|
|
50
|
-
this.outputsObject.valueSelected=this.selected;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
toAlpha3 (list:Country[]): Country[] {
|
|
54
|
-
for (const country of list) {
|
|
55
|
-
country.alpha3=alpha3Codes[country.code]??country.code;
|
|
56
|
-
}
|
|
57
|
-
return list;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
currentCountry = computed( () => {
|
|
61
|
-
const val=this.displayValue();
|
|
62
|
-
if (val!=null) {
|
|
63
|
-
return getByAlpha3(val);
|
|
64
|
-
} else return null;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
@if (isInForm() ) {
|
|
2
|
-
<ng-container [formGroup]="formGroup()">
|
|
3
|
-
<p-autocomplete [fluid]="true" [forceSelection]="true" [dropdown]="true" [formControlName]="formControlName()" [suggestions]="listOfCurrencies()" (completeMethod)="matchCurrency($event)" (onUnselect)="selectionCanceled($event)" (onSelect)="selectionChange($event)"></p-autocomplete>
|
|
4
|
-
</ng-container>
|
|
5
|
-
} @else {
|
|
6
|
-
{{ context().displayValue() }}
|
|
7
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { IntlCurrencyComponent } from './intl-currency.component';
|
|
4
|
-
import { provideZonelessChangeDetection } from '@angular/core';
|
|
5
|
-
import { HostTestTypedComponent, HostTestTypedFormComponent, XtBaseContext, XtResolverService } from 'xt-components';
|
|
6
|
-
import { registerInternationalPlugin } from '../register';
|
|
7
|
-
import { By } from '@angular/platform-browser';
|
|
8
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
9
|
-
|
|
10
|
-
describe('XtCurrencyComponent', () => {
|
|
11
|
-
|
|
12
|
-
beforeEach(async () => {
|
|
13
|
-
await TestBed.configureTestingModule({
|
|
14
|
-
imports: [IntlCurrencyComponent],
|
|
15
|
-
providers: [provideZonelessChangeDetection()]
|
|
16
|
-
})
|
|
17
|
-
.compileComponents();
|
|
18
|
-
|
|
19
|
-
registerInternationalPlugin(TestBed.inject(XtResolverService));
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
let component: IntlCurrencyComponent;
|
|
24
|
-
let fixture: ComponentFixture<IntlCurrencyComponent>;
|
|
25
|
-
fixture = TestBed.createComponent(IntlCurrencyComponent);
|
|
26
|
-
component = fixture.componentInstance;
|
|
27
|
-
const context= new XtBaseContext<string>('FULL_VIEW');
|
|
28
|
-
context.setDisplayValue("");
|
|
29
|
-
fixture.componentRef.setInput('context', context);
|
|
30
|
-
fixture.detectChanges();
|
|
31
|
-
expect(component).toBeTruthy();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should support currency display', () => {
|
|
35
|
-
const hostFixture = TestBed.createComponent(HostTestTypedComponent);
|
|
36
|
-
hostFixture.componentRef.setInput('value', 'EUR');
|
|
37
|
-
hostFixture.componentRef.setInput('valueType', 'currency');
|
|
38
|
-
|
|
39
|
-
const host = hostFixture.componentInstance;
|
|
40
|
-
expect(host).toBeTruthy();
|
|
41
|
-
hostFixture.detectChanges();
|
|
42
|
-
expect(hostFixture.nativeElement.textContent).toContain('EUR');
|
|
43
|
-
|
|
44
|
-
hostFixture.componentRef.setInput('value', 'USD');
|
|
45
|
-
hostFixture.detectChanges();
|
|
46
|
-
expect(hostFixture.nativeElement.textContent).toContain('USD');
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should support currency edit', () => {
|
|
51
|
-
const hostFixture = TestBed.createComponent(HostTestTypedFormComponent);
|
|
52
|
-
hostFixture.componentRef.setInput('formDescription', {
|
|
53
|
-
currency:'EUR'
|
|
54
|
-
});
|
|
55
|
-
hostFixture.componentRef.setInput('valueType', 'currency');
|
|
56
|
-
hostFixture.componentRef.setInput('controlName', 'currency');
|
|
57
|
-
|
|
58
|
-
const host = hostFixture.componentInstance;
|
|
59
|
-
expect(host).toBeTruthy();
|
|
60
|
-
hostFixture.detectChanges();
|
|
61
|
-
|
|
62
|
-
const currencyComponent = hostFixture.debugElement.query(By.directive(IntlCurrencyComponent));
|
|
63
|
-
expect(currencyComponent).toBeTruthy();
|
|
64
|
-
const input = currencyComponent.query(By.css('input'));
|
|
65
|
-
|
|
66
|
-
expect(input.nativeElement.value).toEqual ('EUR');
|
|
67
|
-
|
|
68
|
-
host.computeFormGroup().patchValue({'currency':"USD"});
|
|
69
|
-
hostFixture.detectChanges();
|
|
70
|
-
expect(input.nativeElement.value).toEqual ("USD");
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, output, signal } from '@angular/core';
|
|
2
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { InputNumberModule } from 'primeng/inputnumber';
|
|
4
|
-
import { XtSimpleComponent } from 'xt-components';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
7
|
-
import {
|
|
8
|
-
AutoComplete,
|
|
9
|
-
AutoCompleteCompleteEvent,
|
|
10
|
-
AutoCompleteSelectEvent,
|
|
11
|
-
AutoCompleteUnselectEvent
|
|
12
|
-
} from 'primeng/autocomplete';
|
|
13
|
-
|
|
14
|
-
@Component({
|
|
15
|
-
selector: 'xt-intl-currency',
|
|
16
|
-
standalone: true,
|
|
17
|
-
imports: [CommonModule, InputNumberModule, ReactiveFormsModule, InputTextModule, AutoComplete],
|
|
18
|
-
templateUrl: './intl-currency.component.html',
|
|
19
|
-
styleUrl: './intl-currency.component.css',
|
|
20
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
21
|
-
})
|
|
22
|
-
export class IntlCurrencyComponent extends XtSimpleComponent<string> {
|
|
23
|
-
selected= output<string|undefined>();
|
|
24
|
-
|
|
25
|
-
listOfCurrencies=signal<string[]> (Intl.supportedValuesOf('currency'));
|
|
26
|
-
|
|
27
|
-
matchCurrency($event: AutoCompleteCompleteEvent) {
|
|
28
|
-
this.listOfCurrencies.set (Intl.supportedValuesOf('currency').filter(currency => {
|
|
29
|
-
return currency.indexOf($event.query) != -1;
|
|
30
|
-
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
selectionChange($event: AutoCompleteSelectEvent) {
|
|
35
|
-
this.selected.emit($event.value);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
selectionCanceled($event: AutoCompleteUnselectEvent) {
|
|
39
|
-
this.selected.emit(undefined);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
override setupInputOutput () {
|
|
43
|
-
this.outputsObject.valueSelected=this.selected;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { XtResolverService } from 'xt-components';
|
|
2
|
-
import { IntlCurrencyComponent } from './currency/intl-currency.component';
|
|
3
|
-
import { IntlCountryComponent } from './country/intl-country.component';
|
|
4
|
-
|
|
5
|
-
export function registerInternationalPlugin (resolverService:XtResolverService):string {
|
|
6
|
-
const pluginName = "Plugin International";
|
|
7
|
-
console.info ('Registering '+pluginName);
|
|
8
|
-
resolverService.registerPlugin ({
|
|
9
|
-
name:pluginName,
|
|
10
|
-
uriLogo:'pluginicon.png',
|
|
11
|
-
components: [
|
|
12
|
-
{
|
|
13
|
-
componentName:'IntlCurrency',
|
|
14
|
-
componentClass:IntlCurrencyComponent,
|
|
15
|
-
typesHandled: ['currency'],
|
|
16
|
-
outputs: ['valueSelected']
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
componentName:'IntlCountry',
|
|
20
|
-
componentClass:IntlCountryComponent,
|
|
21
|
-
typesHandled: ['country'],
|
|
22
|
-
outputs: ['valueSelected']
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
types:
|
|
26
|
-
{
|
|
27
|
-
currency:'string',
|
|
28
|
-
country:'string'
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return pluginName;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function registerPlugin (resolverService:XtResolverService):string {
|
|
35
|
-
return registerInternationalPlugin(resolverService);
|
|
36
|
-
}
|
|
@@ -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,14 +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
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"**/*.spec.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -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,44 +0,0 @@
|
|
|
1
|
-
const { withNativeFederation, shareAll, share } = require('@angular-architects/native-federation/config');
|
|
2
|
-
|
|
3
|
-
module.exports = withNativeFederation({
|
|
4
|
-
|
|
5
|
-
name: 'intl-plugin',
|
|
6
|
-
|
|
7
|
-
exposes: {
|
|
8
|
-
'./IntlCurrencyComponent': './projects/intl/src/lib/currency/intl-currency.component.ts',
|
|
9
|
-
'./IntlCountryComponent': './projects/intl/src/lib/country/intl-country.component.ts',
|
|
10
|
-
'./Register': './projects/intl/src/lib/register.ts'
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
shared: {
|
|
14
|
-
...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
|
|
15
|
-
...share({
|
|
16
|
-
"@primeuix/themes/aura": {
|
|
17
|
-
singleton: true,
|
|
18
|
-
strictVersion: true,
|
|
19
|
-
requiredVersion: "auto",
|
|
20
|
-
includeSecondaries: false,
|
|
21
|
-
build: 'separate',
|
|
22
|
-
packageInfo: {
|
|
23
|
-
entryPoint: 'node_modules/@primeuix/themes/dist/aura/index.mjs'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
})},
|
|
27
|
-
features: {
|
|
28
|
-
ignoreUnusedDeps:true
|
|
29
|
-
},
|
|
30
|
-
skip: [
|
|
31
|
-
'rxjs/ajax',
|
|
32
|
-
'rxjs/fetch',
|
|
33
|
-
'rxjs/testing',
|
|
34
|
-
'rxjs/webSocket',
|
|
35
|
-
// Add further packages you don't need at runtime
|
|
36
|
-
'chart.js/auto',
|
|
37
|
-
'primeng/chart',
|
|
38
|
-
'primeicons'
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
// Please read our FAQ about sharing libs:
|
|
42
|
-
// https://shorturl.at/jmzH0
|
|
43
|
-
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.2.4","results":[[":src/app/app.component.spec.ts",{"duration":139.60681699999986,"failed":false}],[":src/app/test-component/test.component.spec.ts",{"duration":425.711045,"failed":false}]]}
|
|
Binary file
|