@dsivd/prestations-ng 18.0.0-beta.3 → 18.0.0-beta.4

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/CHANGELOG.md CHANGED
@@ -2936,18 +2936,17 @@ data: {
2936
2936
  - [foehn-input-address.component.html](projects/prestations-ng/src/foehn-address/foehn-input-address.component.html)
2937
2937
 
2938
2938
  - added some inputs to affect the presence of (facultatif) on every label :
2939
-
2940
- - `@Input() countryRequired = true`
2941
- - `@Input() swissNpaLocalityRequired = true`
2942
- - `@Input() streetRequired = true`
2943
- - `@Input() streetNumberRequired = false`
2944
- - `@Input() foreignZipCodeRequired = true`
2945
- - `@Input() foreignLocalityRequired = true`
2946
- - `@Input() foreignStreetRequired = true`
2947
- - `@Input() foreignStreetNumberRequired = false`
2948
- - `@Input() postOfficeBoxTextRequired = false`
2949
- - `@Input() addressLine1Required = false`
2950
- - `@Input() addressLine2Required = false
2939
+ - `@Input() countryRequired = true`
2940
+ - `@Input() swissNpaLocalityRequired = true`
2941
+ - `@Input() streetRequired = true`
2942
+ - `@Input() streetNumberRequired = false`
2943
+ - `@Input() foreignZipCodeRequired = true`
2944
+ - `@Input() foreignLocalityRequired = true`
2945
+ - `@Input() foreignStreetRequired = true`
2946
+ - `@Input() foreignStreetNumberRequired = false`
2947
+ - `@Input() postOfficeBoxTextRequired = false`
2948
+ - `@Input() addressLine1Required = false`
2949
+ - `@Input() addressLine2Required = false`
2951
2950
 
2952
2951
  ## [11.1.4]
2953
2952
 
@@ -3443,7 +3442,7 @@ not dead
3443
3442
 
3444
3443
  ### Updated
3445
3444
 
3446
- - [public_api.ts](projects/prestations-ng/src/public_api.ts)
3445
+ - [public-api.ts](projects/prestations-ng/src/public-api.ts)
3447
3446
  - Add FoehnPageCounterComponent export
3448
3447
  - `@fortawesome/free-solid-svg-icons` and `@fortawesome/fontawesome-free` libraries to 5.11.2
3449
3448
 
@@ -5167,8 +5166,8 @@ If you've added an "Obligatoire" label somewhere in your prestation, please chan
5167
5166
  </foehn-list>
5168
5167
  `
5169
5168
  ```
5170
- - itemsPerPage is 10, if none provided
5171
- - trackBy is done on index, if no trackBy function is provided
5169
+ - itemsPerPage is 10, if none provided
5170
+ - trackBy is done on index, if no trackBy function is provided
5172
5171
 
5173
5172
  ## [7.20.0] - 2018.08.29
5174
5173
 
package/UPGRADING_V18.md CHANGED
@@ -97,6 +97,25 @@ npm remove eslint-plugin-jsdoc
97
97
  npm update
98
98
  ```
99
99
 
100
+ #### Fix proxy.conf.json
101
+
102
+ In your `proxy.conf.json` file:
103
+
104
+ - remove `/*` at the end of your api url
105
+ - remove `"changeOrigin": true`
106
+
107
+ ```diff
108
+ - "/pub/101102/api/*": {
109
+ + "/pub/101102/api": {
110
+ "target": "http://localhost:16400",
111
+ - "changeOrigin": true,
112
+ "secure": false,
113
+ "pathRewrite": {
114
+ "^/api": ""
115
+ }
116
+ }
117
+ ```
118
+
100
119
  #### NgHttpLoader migration as standalone
101
120
 
102
121
  In your `app.module.ts` file:
@@ -104,19 +123,108 @@ In your `app.module.ts` file:
104
123
  - Remove `import { NgHttpLoaderModule } from 'ng-http-loader';`
105
124
  - Remove `NgHttpLoaderModule.forRoot()` from `imports` in `@NgModule(...)`
106
125
  - Add `NgHttpLoaderComponent` to `imports` in `@NgModule(...)`
126
+ - Add `withInterceptors([pendingRequestsInterceptor$])` to `providers` in `@NgModule(...)`
107
127
 
108
128
  ```diff
109
129
  - import { NgHttpLoaderModule } from 'ng-http-loader';
110
- + import { NgHttpLoaderComponent } from 'ng-http-loader';
130
+ + import { NgHttpLoaderComponent, pendingRequestsInterceptor$ } from 'ng-http-loader';
111
131
 
112
132
  @NgModule({
113
133
  imports: [
114
134
  - NgHttpLoaderModule.forRoot(),
115
135
  + NgHttpLoaderComponent,
116
- ],
136
+ ], providers: [
137
+ provideHttpClient(
138
+ + withInterceptors([pendingRequestsInterceptor$]),
139
+ ]
117
140
  })
118
141
  ```
119
142
 
143
+ #### Move and upodate your tsconfig\*.json files
144
+
145
+ - Move your `tsconfig.app.json` and `tsconfig.spec.json` from `src` to `front` (if not already done)
146
+ - Replace your `tsconfig.json` content with:
147
+
148
+ ```json
149
+ {
150
+ "compileOnSave": false,
151
+ "compilerOptions": {
152
+ "outDir": "./dist/out-tsc",
153
+ "noImplicitOverride": true,
154
+ "noPropertyAccessFromIndexSignature": true,
155
+ "noImplicitReturns": true,
156
+ "noFallthroughCasesInSwitch": true,
157
+ "skipLibCheck": true,
158
+ "esModuleInterop": true,
159
+ "sourceMap": true,
160
+ "declaration": false,
161
+ "experimentalDecorators": true,
162
+ "moduleResolution": "bundler",
163
+ "importHelpers": true,
164
+ "target": "ES2022",
165
+ "module": "ES2022",
166
+ "paths": {
167
+ "@dsivd/prestations-ng": ["./node_modules/@dsivd/prestations-ng"]
168
+ }
169
+ },
170
+ "include": ["src/**/*"],
171
+ "angularCompilerOptions": {
172
+ "enableI18nLegacyMessageIdFormat": false,
173
+ "strictInjectionParameters": true,
174
+ "strictInputAccessModifiers": true
175
+ }
176
+ }
177
+ ```
178
+
179
+ - Replace your `tsconfig.app.json` content with:
180
+
181
+ ```json
182
+ {
183
+ "extends": "./tsconfig.json",
184
+ "compilerOptions": {
185
+ "outDir": "../out-tsc/app",
186
+ "types": []
187
+ },
188
+ "files": ["src/main.ts"],
189
+ "include": ["src/**/*.d.ts"]
190
+ }
191
+ ```
192
+
193
+ - Replace your `tsconfig.spec.json` content with:
194
+
195
+ ```json
196
+ {
197
+ "extends": "./tsconfig.json",
198
+ "compilerOptions": {
199
+ "outDir": "../out-tsc/spec",
200
+ "types": ["jasmine", "node"]
201
+ },
202
+ "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
203
+ }
204
+ ```
205
+
206
+ #### Fix your angular.json file
207
+
208
+ Because your `tsconfig.app.json` and `tsconfig.spec.json` have been moved, you need to change the path in your `angular.json` file by removing `src/`
209
+
210
+ ```diff
211
+ "projects": {
212
+ "[YOUR_APPLICATION_NAME]": {
213
+ "architect": {
214
+ "build": {
215
+ "options": {
216
+ - "tsConfig": "src/tsconfig.app.json",
217
+ + "tsConfig": "tsconfig.app.json",
218
+ }
219
+ },
220
+ "test": {
221
+ "builder": "@angular-devkit/build-angular:karma",
222
+ "options": {
223
+ - "tsConfig": "src/tsconfig.spec.json",
224
+ + "tsConfig": "tsconfig.spec.json",
225
+ }
226
+ ```
227
+
120
228
  #### Browsers list update
121
229
 
122
230
  Run update schematic:
@@ -183,6 +291,8 @@ npm install
183
291
 
184
292
  #### Build and launch your application
185
293
 
294
+ **NB: You will most probably need to fix some compilation errors such as adding `override` when needed**
295
+
186
296
  ```bash
187
297
  npm run build
188
298
  npm start
@@ -7340,6 +7340,7 @@ class FoehnPageExpirationTimerComponent {
7340
7340
  if (!!minutes && !!seconds && !hours) {
7341
7341
  return `${minutes} minutes et ${seconds} secondes`;
7342
7342
  }
7343
+ return '';
7343
7344
  }
7344
7345
  manageScreenReaderAnnouncement(timeInSeconds, hours, minutes, seconds) {
7345
7346
  const _1_hourInSeconds = 60 * 60;
@@ -9360,7 +9361,31 @@ class DatePickerHelper {
9360
9361
  this.DATE_STRING_FORMAT = 'YYYY-MM-DD';
9361
9362
  this.DATE_READABLE_FORMAT = 'D MMMM YYYY';
9362
9363
  this._displayedMonthYear = new BehaviorSubject(null);
9363
- this.loadLocale = (language) => import(/* @vite-ignore */ `dayjs/locale/${language}`).then(() => dayjs.locale(language));
9364
+ this.loadLocale = async (language) => {
9365
+ // Need static imports due to angular 19 being more strict with dynamic import for security reason and bundles optimization
9366
+ switch (language) {
9367
+ case 'fr':
9368
+ await import('dayjs/locale/fr');
9369
+ break;
9370
+ case 'en':
9371
+ await import('dayjs/locale/en');
9372
+ break;
9373
+ case 'es':
9374
+ await import('dayjs/locale/es');
9375
+ break;
9376
+ case 'it':
9377
+ await import('dayjs/locale/it');
9378
+ break;
9379
+ case 'pt':
9380
+ await import('dayjs/locale/pt');
9381
+ break;
9382
+ // ... autres cas
9383
+ default:
9384
+ console.warn(`Locale ${language} not supported`);
9385
+ language = 'en'; // fallback
9386
+ }
9387
+ dayjs.locale(language);
9388
+ };
9364
9389
  }
9365
9390
  get displayedMonthYear() {
9366
9391
  return this._displayedMonthYear.asObservable();
@@ -13874,13 +13899,11 @@ class AbstractFoehnUploaderComponent extends FoehnInputComponent {
13874
13899
  return false;
13875
13900
  }
13876
13901
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AbstractFoehnUploaderComponent, deps: [{ token: ApplicationInfoService }, { token: FoehnConfirmModalService }, { token: SdkDictionaryService }, { token: GrowlBrokerService }], target: i0.ɵɵFactoryTarget.Directive }); }
13877
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: AbstractFoehnUploaderComponent, isStandalone: true, inputs: { required: "required", dragAndDrop: "dragAndDrop", showUploadButton: "showUploadButton", readonly: "readonly", hideGlobalInfos: "hideGlobalInfos", multiple: "multiple", key: "key", chooseButtonLabel: "chooseButtonLabel", chooseButtonLabelMultiple: "chooseButtonLabelMultiple", dropZoneLabel: "dropZoneLabel", dropZoneLabelMultiple: "dropZoneLabelMultiple", overrideAcceptedExtensions: "overrideAcceptedExtensions", overrideMaxFileNameLength: "overrideMaxFileNameLength", overrideIllegalCharacters: "overrideIllegalCharacters", showDeleteConfirmationMessage: "showDeleteConfirmationMessage", deleteConfirmationMessage: "deleteConfirmationMessage", maxSimultaneousSelectedFiles: "maxSimultaneousSelectedFiles", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation", maxFilesCount: "maxFilesCount", maxFilesSizeInMo: "maxFilesSizeInMo" }, host: { listeners: { "window:dragover": "onDocumentDragOver($event)", "window:dragleave": "onDocumentDragLeave($event)", "window:drop": "onDocumentDrop($event)" } }, usesInheritance: true, ngImport: i0 }); }
13902
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: AbstractFoehnUploaderComponent, isStandalone: true, inputs: { dragAndDrop: "dragAndDrop", showUploadButton: "showUploadButton", readonly: "readonly", hideGlobalInfos: "hideGlobalInfos", multiple: "multiple", key: "key", chooseButtonLabel: "chooseButtonLabel", chooseButtonLabelMultiple: "chooseButtonLabelMultiple", dropZoneLabel: "dropZoneLabel", dropZoneLabelMultiple: "dropZoneLabelMultiple", overrideAcceptedExtensions: "overrideAcceptedExtensions", overrideMaxFileNameLength: "overrideMaxFileNameLength", overrideIllegalCharacters: "overrideIllegalCharacters", showDeleteConfirmationMessage: "showDeleteConfirmationMessage", deleteConfirmationMessage: "deleteConfirmationMessage", maxSimultaneousSelectedFiles: "maxSimultaneousSelectedFiles", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation", maxFilesCount: "maxFilesCount", maxFilesSizeInMo: "maxFilesSizeInMo" }, host: { listeners: { "window:dragover": "onDocumentDragOver($event)", "window:dragleave": "onDocumentDragLeave($event)", "window:drop": "onDocumentDrop($event)" } }, usesInheritance: true, ngImport: i0 }); }
13878
13903
  }
13879
13904
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AbstractFoehnUploaderComponent, decorators: [{
13880
13905
  type: Directive
13881
- }], ctorParameters: () => [{ type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }], propDecorators: { required: [{
13882
- type: Input
13883
- }], dragAndDrop: [{
13906
+ }], ctorParameters: () => [{ type: ApplicationInfoService }, { type: FoehnConfirmModalService }, { type: SdkDictionaryService }, { type: GrowlBrokerService }], propDecorators: { dragAndDrop: [{
13884
13907
  type: Input
13885
13908
  }], showUploadButton: [{
13886
13909
  type: Input
@@ -14804,7 +14827,7 @@ class FoehnPictureUploadComponent extends FoehnInputComponent {
14804
14827
  return acceptedFormats.includes(fileExtension);
14805
14828
  }
14806
14829
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FoehnPictureUploadComponent, deps: [{ token: MultiUploadService }, { token: SdkDictionaryService }], target: i0.ɵɵFactoryTarget.Component }); }
14807
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FoehnPictureUploadComponent, isStandalone: false, selector: "foehn-picture-upload", inputs: { name: "name", key: "key", label: "label", baseUrl: "baseUrl", croppedPictureFilename: "croppedPictureFilename", resizeToWidth: "resizeToWidth", resizeToHeight: "resizeToHeight", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation" }, providers: [
14830
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FoehnPictureUploadComponent, isStandalone: false, selector: "foehn-picture-upload", inputs: { key: "key", baseUrl: "baseUrl", croppedPictureFilename: "croppedPictureFilename", resizeToWidth: "resizeToWidth", resizeToHeight: "resizeToHeight", shouldDisplayFileSavedConfirmation: "shouldDisplayFileSavedConfirmation" }, providers: [
14808
14831
  {
14809
14832
  provide: FoehnInputComponent,
14810
14833
  useExisting: forwardRef(() => FoehnPictureUploadComponent),
@@ -14825,11 +14848,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
14825
14848
  { provide: MultiUploadService, useClass: MultiUploadService },
14826
14849
  { provide: UploadProgressService, useClass: UploadProgressService }
14827
14850
  ], standalone: false, template: "<div\n [attr.id]=\"buildId('Container')\"\n [class.has-danger]=\"hasErrors()\"\n [class.vd-form-group-danger]=\"hasErrors()\"\n class=\"form-group clearable-input-form-group\"\n tabindex=\"-1\"\n #fallBackTrigger\n>\n <label\n class=\"form-label\"\n [attr.for]=\"buildChildId()\"\n *ngIf=\"!!label\"\n [ngClass]=\"isLabelSrOnly ? 'visually-hidden' : labelStyleModifier\"\n >\n <span [innerHTML]=\"label\"></span>\n <span\n *ngIf=\"!required && !hideNotRequiredExtraLabel\"\n aria-hidden=\"true\"\n >\n {{ 'foehn-input.optional' | fromDictionary }}\n </span>\n </label>\n\n <foehn-validation-alerts [component]=\"this\"></foehn-validation-alerts>\n\n <small\n *ngIf=\"helpText\"\n [attr.id]=\"buildChildId() + 'Help'\"\n class=\"form-text text-secondary\"\n [innerHTML]=\"helpText\"\n ></small>\n\n <input type=\"hidden\" [name]=\"name || label\" [ngModel]=\"model\" />\n\n <ng-content></ng-content>\n\n <div *ngIf=\"hasPicture\" class=\"row\">\n <div class=\"col-md-6\">\n <img\n [id]=\"buildChildId('Picture')\"\n [attr.alt]=\"label\"\n [src]=\"getDownloadUrl()\"\n />\n </div>\n <div class=\"col-md-4\">\n <button\n type=\"button\"\n class=\"btn btn-danger w-100\"\n [attr.id]=\"buildChildId('DeleteButton')\"\n (click)=\"deleteFile()\"\n >\n {{\n 'foehn-picture-upload.delete-picture-label' | fromDictionary\n }}\n </button>\n </div>\n </div>\n\n <div *ngIf=\"!hasPicture && !croppedPictureAsBlob\">\n <input\n #inputFile\n type=\"file\"\n class=\"form-control d-none\"\n [attr.id]=\"name\"\n [attr.accept]=\"acceptFormats\"\n [multiple]=\"false\"\n [name]=\"name\"\n (change)=\"onPictureSelection($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-primary my-2\"\n [attr.id]=\"buildChildId('ChooseButton')\"\n [attr.aria-invalid]=\"hasErrorsToDisplay() || null\"\n [attr.aria-describedby]=\"buildId('ErrorsContainer')\"\n (click)=\"inputFile.click()\"\n [attr.disabled]=\"loading ? 'disabled' : null\"\n >\n {{ 'foehn-picture-upload.choose-button-label' | fromDictionary }}\n </button>\n </div>\n\n <div *ngIf=\"loading\">\n {{ 'foehn-picture-upload.loading-label' | fromDictionary }}\n </div>\n\n <div *ngIf=\"!hasPicture\" class=\"row\">\n <div class=\"col-md-6\">\n <image-cropper\n [id]=\"buildChildId('Cropper')\"\n (cropperReady)=\"loading = false\"\n (imageCropped)=\"onImageCropped($event)\"\n (loadImageFailed)=\"onPictureSelectionFailed()\"\n [aspectRatio]=\"3 / 4\"\n [imageChangedEvent]=\"pictureToCrop\"\n [maintainAspectRatio]=\"true\"\n [resizeToWidth]=\"resizeToWidth\"\n [resizeToHeight]=\"resizeToHeight\"\n [onlyScaleDown]=\"true\"\n format=\"png\"\n ></image-cropper>\n </div>\n\n <div *ngIf=\"!hasPicture\" class=\"col-md-4\">\n <div class=\"row mb-3\">\n <button\n *ngIf=\"croppedPictureAsBlob\"\n type=\"button\"\n class=\"btn btn-primary w-100\"\n [attr.id]=\"buildChildId('SaveButton')\"\n (click)=\"savePicture()\"\n >\n {{\n 'foehn-picture-upload.validate-selection-label'\n | fromDictionary\n }}\n </button>\n </div>\n <div class=\"row\">\n <button\n *ngIf=\"croppedPictureAsBlob\"\n type=\"button\"\n class=\"btn btn-secondary w-100\"\n [attr.id]=\"buildChildId('CancelButton')\"\n (click)=\"resetPictureSelection()\"\n >\n {{\n 'foehn-picture-upload.cancel-selection-label'\n | fromDictionary\n }}\n </button>\n </div>\n </div>\n </div>\n\n <foehn-upload-progress-bar\n [progressBarTriggerHtmlElement]=\"\n inputElement?.nativeElement || fallBackTrigger\n \"\n ></foehn-upload-progress-bar>\n</div>\n" }]
14828
- }], ctorParameters: () => [{ type: MultiUploadService }, { type: SdkDictionaryService }], propDecorators: { name: [{
14829
- type: Input
14830
- }], key: [{
14831
- type: Input
14832
- }], label: [{
14851
+ }], ctorParameters: () => [{ type: MultiUploadService }, { type: SdkDictionaryService }], propDecorators: { key: [{
14833
14852
  type: Input
14834
14853
  }], baseUrl: [{
14835
14854
  type: Input