@gravitee/ui-particles-angular 16.2.1-apim-11833-llm-proxy-ui-does-not-match-designs-d7b6a16 → 16.2.1-apim-11833-llm-proxy-ui-does-not-match-designs-e2ce3f9

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.
@@ -3016,7 +3016,6 @@ class GioFormlyJsonSchemaService {
3016
3016
  mappedField = {
3017
3017
  key: mappedField.key,
3018
3018
  type: mapSource.gioConfig?.uiType,
3019
- wrappers: ['gio-currency-prefix'],
3020
3019
  props: {
3021
3020
  ...mappedField.props,
3022
3021
  ...mapSource.gioConfig?.uiTypeProps,
@@ -3073,15 +3072,6 @@ class GioFormlyJsonSchemaService {
3073
3072
  },
3074
3073
  };
3075
3074
  }
3076
- if (mapSource.gioConfig?.currency) {
3077
- mappedField.props = {
3078
- ...mappedField.props,
3079
- attributes: {
3080
- ...mappedField.props?.attributes,
3081
- currency: 1,
3082
- },
3083
- };
3084
- }
3085
3075
  return mappedField;
3086
3076
  }
3087
3077
  bannerMap(mappedField, mapSource) {
@@ -3185,64 +3175,31 @@ class GioFormlyJsonSchemaService {
3185
3175
  return mappedField;
3186
3176
  }
3187
3177
  uniqueValueMap(mappedField, mapSource) {
3188
- if (!mapSource.gioConfig?.unique) {
3189
- return mappedField;
3190
- }
3191
- mappedField.asyncValidators = {
3192
- ...mappedField.asyncValidators,
3193
- unique: {
3194
- expression: (control) => {
3195
- if (!control.value || control.value === '') {
3196
- return Promise.resolve(true); // Empty values are valid
3197
- }
3198
- let currentControl = control.parent;
3199
- let parentArrayControl = null;
3200
- while (currentControl) {
3201
- const value = currentControl.value;
3202
- if (isArray(value)) {
3203
- parentArrayControl = currentControl;
3204
- break;
3205
- }
3206
- currentControl = currentControl.parent;
3207
- }
3208
- if (!parentArrayControl) {
3209
- return Promise.resolve(true);
3210
- }
3211
- const controls = parentArrayControl.controls;
3212
- if (!controls || !isArray(controls) || controls.length <= 1) {
3213
- return Promise.resolve(true); // No duplicates possible
3214
- }
3215
- const fieldKey = mappedField.key;
3216
- const currentValue = control.value;
3217
- const occurrences = controls.filter((formGroup) => {
3218
- const siblingControl = fieldKey ? formGroup.get(fieldKey) : formGroup;
3219
- if (!siblingControl) {
3220
- return false;
3221
- }
3222
- const siblingValue = siblingControl.value;
3223
- if (isNil(siblingValue)) {
3224
- return false;
3225
- }
3226
- return siblingValue === currentValue;
3227
- }).length;
3228
- const isValid = occurrences <= 1;
3229
- if (isValid) {
3230
- setTimeout(() => {
3231
- controls.forEach((formGroup) => {
3232
- const siblingControl = fieldKey ? formGroup.get(fieldKey) : formGroup;
3233
- if (siblingControl && siblingControl !== control && siblingControl.hasError('unique')) {
3234
- siblingControl.updateValueAndValidity({ emitEvent: false });
3178
+ let fieldNameWithErrors = undefined;
3179
+ if (mapSource.gioConfig?.uniqueItemProperties) {
3180
+ mappedField = {
3181
+ ...mappedField,
3182
+ validators: {
3183
+ uniqueFields: {
3184
+ expression: (control) => {
3185
+ const items = control.value;
3186
+ const uniqueProps = mapSource.gioConfig?.uniqueItemProperties ?? [];
3187
+ if (!Array.isArray(items) || !uniqueProps.length)
3188
+ return true;
3189
+ for (const prop of uniqueProps) {
3190
+ const values = items.map(i => i?.[prop]).filter(v => v != null);
3191
+ if (new Set(values).size !== values.length) {
3192
+ fieldNameWithErrors = prop;
3193
+ return false;
3235
3194
  }
3236
- });
3237
- }, 0);
3238
- }
3239
- return Promise.resolve(isValid);
3240
- },
3241
- message: (error, field) => {
3242
- return `${field.props?.label} must be unique`;
3195
+ }
3196
+ return true;
3197
+ },
3198
+ message: (_error, _field) => `${fieldNameWithErrors || 'This field'} must be unique`,
3199
+ },
3243
3200
  },
3244
- },
3245
- };
3201
+ };
3202
+ }
3246
3203
  return mappedField;
3247
3204
  }
3248
3205
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioFormlyJsonSchemaService, deps: [{ token: i1$7.FormlyJsonschema }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -5467,47 +5424,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
5467
5424
  args: [{ selector: 'gio-banner-wrapper', standalone: false, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"wrapper\">\n <div class=\"banner\">\n <div class=\"banner__icon\"><mat-icon svgIcon=\"gio:info\"></mat-icon></div>\n <div>\n <div class=\"banner__title\" [innerHTML]=\"props.bannerTitle\"></div>\n <div class=\"banner__text\" [innerHTML]=\"props.bannerText\"></div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: ["@charset \"UTF-8\";.gio-top-bar-menu .gio-badge-accent{background-color:var(--gio-oem-palette--active, #ffc2ac);color:var(--gio-oem-palette--active-contrast, #1e1b1b)}::ng-deep gio-banner-wrapper ul{padding-inline-start:16px}.wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;border-radius:8px;margin-bottom:8px;background:#f7f7f8;gap:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#da3b00}.banner__title{font-size:14px;font-weight:700;line-height:20px;font-family:Manrope,sans-serif;letter-spacing:.4px}.banner__text{font-size:14px;font-weight:500;line-height:22px;font-family:Manrope,sans-serif;letter-spacing:.4px;color:#322f2f}\n"] }]
5468
5425
  }] });
5469
5426
 
5470
- /*
5471
- * Copyright (C) 2025 The Gravitee team (http://gravitee.io)
5472
- *
5473
- * Licensed under the Apache License, Version 2.0 (the "License");
5474
- * you may not use this file except in compliance with the License.
5475
- * You may obtain a copy of the License at
5476
- *
5477
- * http://www.apache.org/licenses/LICENSE-2.0
5478
- *
5479
- * Unless required by applicable law or agreed to in writing, software
5480
- * distributed under the License is distributed on an "AS IS" BASIS,
5481
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5482
- * See the License for the specific language governing permissions and
5483
- * limitations under the License.
5484
- */
5485
- class GioCurrencyPrefixWrapperComponent extends FieldWrapper {
5486
- constructor() {
5487
- super(...arguments);
5488
- this.hide = true;
5489
- }
5490
- ngAfterViewInit() {
5491
- if (this.matPrefix) {
5492
- this.props.prefix = this.matPrefix;
5493
- }
5494
- }
5495
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioCurrencyPrefixWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5496
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.3", type: GioCurrencyPrefixWrapperComponent, isStandalone: false, selector: "gio-currency-prefix-wrapper", viewQueries: [{ propertyName: "matPrefix", first: true, predicate: ["matPrefix"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<ng-container #fieldComponent></ng-container>\n\n<ng-template #matPrefix>\n <span class=\"currency-prefix\">&nbsp; $</span>\n</ng-template>\n", styles: [".currency-prefix{margin-left:8px}\n"] }); }
5497
- }
5498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioCurrencyPrefixWrapperComponent, decorators: [{
5499
- type: Component,
5500
- args: [{ selector: 'gio-currency-prefix-wrapper', standalone: false, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<ng-container #fieldComponent></ng-container>\n\n<ng-template #matPrefix>\n <span class=\"currency-prefix\">&nbsp; $</span>\n</ng-template>\n", styles: [".currency-prefix{margin-left:8px}\n"] }]
5501
- }], propDecorators: { matPrefix: [{
5502
- type: ViewChild,
5503
- args: ['matPrefix', { static: true }]
5504
- }] } });
5505
- function currencyPrefixExtension(field) {
5506
- if (field.props?.attributes?.currency) {
5507
- field.wrappers = [...(field.wrappers || []), 'gio-currency-prefix'];
5508
- }
5509
- }
5510
-
5511
5427
  function bannerExtension(field) {
5512
5428
  if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-with-banner') !== -1)) {
5513
5429
  return;
@@ -5982,8 +5898,7 @@ class GioFormJsonSchemaModule {
5982
5898
  GioFjsCronTypeComponent,
5983
5899
  GioBannerWrapperComponent,
5984
5900
  GioPasswordEyeWrapperComponent,
5985
- GioElHelperWrapperComponent,
5986
- GioCurrencyPrefixWrapperComponent], imports: [CommonModule,
5901
+ GioElHelperWrapperComponent], imports: [CommonModule,
5987
5902
  A11yModule,
5988
5903
  ReactiveFormsModule, i1$8.FormlyModule, FormlyMaterialModule,
5989
5904
  MatInputModule,
@@ -6020,7 +5935,6 @@ class GioFormJsonSchemaModule {
6020
5935
  { name: 'gio-with-banner', component: GioBannerWrapperComponent },
6021
5936
  { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
6022
5937
  { name: 'gio-el-help', component: GioElHelperWrapperComponent },
6023
- { name: 'gio-currency-prefix', component: GioCurrencyPrefixWrapperComponent },
6024
5938
  ],
6025
5939
  types: [
6026
5940
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
@@ -6049,7 +5963,6 @@ class GioFormJsonSchemaModule {
6049
5963
  { name: 'banner', extension: { onPopulate: bannerExtension } },
6050
5964
  { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
6051
5965
  { name: 'el-help', extension: { onPopulate: elHelpExtension } },
6052
- { name: 'gio-currency-prefix', extension: { onPopulate: currencyPrefixExtension } },
6053
5966
  ],
6054
5967
  extras: {
6055
5968
  checkExpressionOn: 'changeDetectionCheck',
@@ -6086,7 +5999,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
6086
5999
  GioBannerWrapperComponent,
6087
6000
  GioPasswordEyeWrapperComponent,
6088
6001
  GioElHelperWrapperComponent,
6089
- GioCurrencyPrefixWrapperComponent,
6090
6002
  ],
6091
6003
  imports: [
6092
6004
  CommonModule,
@@ -6113,7 +6025,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
6113
6025
  { name: 'gio-with-banner', component: GioBannerWrapperComponent },
6114
6026
  { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
6115
6027
  { name: 'gio-el-help', component: GioElHelperWrapperComponent },
6116
- { name: 'gio-currency-prefix', component: GioCurrencyPrefixWrapperComponent },
6117
6028
  ],
6118
6029
  types: [
6119
6030
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
@@ -6142,7 +6053,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
6142
6053
  { name: 'banner', extension: { onPopulate: bannerExtension } },
6143
6054
  { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
6144
6055
  { name: 'el-help', extension: { onPopulate: elHelpExtension } },
6145
- { name: 'gio-currency-prefix', extension: { onPopulate: currencyPrefixExtension } },
6146
6056
  ],
6147
6057
  extras: {
6148
6058
  checkExpressionOn: 'changeDetectionCheck',