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

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.
@@ -2964,9 +2964,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
2964
2964
  * limitations under the License.
2965
2965
  */
2966
2966
  class GioFormlyJsonSchemaService {
2967
- constructor(formlyJsonschema, builder) {
2967
+ constructor(formlyJsonschema) {
2968
2968
  this.formlyJsonschema = formlyJsonschema;
2969
- this.builder = builder;
2970
2969
  }
2971
2970
  toFormlyFieldConfig(jsonSchema, context) {
2972
2971
  return this.formlyJsonschema.toFieldConfig(jsonSchema, {
@@ -2981,6 +2980,7 @@ class GioFormlyJsonSchemaService {
2981
2980
  mappedField = this.enumLabelMap(mappedField, mapSource);
2982
2981
  mappedField = this.sanitizeOneOf(mappedField, mapSource);
2983
2982
  mappedField = this.deprecatedMap(mappedField, mapSource);
2983
+ mappedField = this.uniqueValueMap(mappedField, mapSource);
2984
2984
  return mappedField;
2985
2985
  },
2986
2986
  });
@@ -3016,6 +3016,7 @@ class GioFormlyJsonSchemaService {
3016
3016
  mappedField = {
3017
3017
  key: mappedField.key,
3018
3018
  type: mapSource.gioConfig?.uiType,
3019
+ wrappers: ['gio-currency-prefix'],
3019
3020
  props: {
3020
3021
  ...mappedField.props,
3021
3022
  ...mapSource.gioConfig?.uiTypeProps,
@@ -3072,6 +3073,15 @@ class GioFormlyJsonSchemaService {
3072
3073
  },
3073
3074
  };
3074
3075
  }
3076
+ if (mapSource.gioConfig?.currency) {
3077
+ mappedField.props = {
3078
+ ...mappedField.props,
3079
+ attributes: {
3080
+ ...mappedField.props?.attributes,
3081
+ currency: 1,
3082
+ },
3083
+ };
3084
+ }
3075
3085
  return mappedField;
3076
3086
  }
3077
3087
  bannerMap(mappedField, mapSource) {
@@ -3174,12 +3184,73 @@ class GioFormlyJsonSchemaService {
3174
3184
  }
3175
3185
  return mappedField;
3176
3186
  }
3177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioFormlyJsonSchemaService, deps: [{ token: i1$7.FormlyJsonschema }, { token: i1$8.FormlyFormBuilder }], target: i0.ɵɵFactoryTarget.Injectable }); }
3187
+ 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 });
3235
+ }
3236
+ });
3237
+ }, 0);
3238
+ }
3239
+ return Promise.resolve(isValid);
3240
+ },
3241
+ message: (error, field) => {
3242
+ return `${field.props?.label} must be unique`;
3243
+ },
3244
+ },
3245
+ };
3246
+ return mappedField;
3247
+ }
3248
+ 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 }); }
3178
3249
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioFormlyJsonSchemaService }); }
3179
3250
  }
3180
3251
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioFormlyJsonSchemaService, decorators: [{
3181
3252
  type: Injectable
3182
- }], ctorParameters: () => [{ type: i1$7.FormlyJsonschema }, { type: i1$8.FormlyFormBuilder }] });
3253
+ }], ctorParameters: () => [{ type: i1$7.FormlyJsonschema }] });
3183
3254
  const getBannerProperties = (banner) => {
3184
3255
  return {
3185
3256
  bannerText: banner.text,
@@ -5396,6 +5467,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
5396
5467
  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"] }]
5397
5468
  }] });
5398
5469
 
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
+
5399
5511
  function bannerExtension(field) {
5400
5512
  if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-with-banner') !== -1)) {
5401
5513
  return;
@@ -5870,7 +5982,8 @@ class GioFormJsonSchemaModule {
5870
5982
  GioFjsCronTypeComponent,
5871
5983
  GioBannerWrapperComponent,
5872
5984
  GioPasswordEyeWrapperComponent,
5873
- GioElHelperWrapperComponent], imports: [CommonModule,
5985
+ GioElHelperWrapperComponent,
5986
+ GioCurrencyPrefixWrapperComponent], imports: [CommonModule,
5874
5987
  A11yModule,
5875
5988
  ReactiveFormsModule, i1$8.FormlyModule, FormlyMaterialModule,
5876
5989
  MatInputModule,
@@ -5907,6 +6020,7 @@ class GioFormJsonSchemaModule {
5907
6020
  { name: 'gio-with-banner', component: GioBannerWrapperComponent },
5908
6021
  { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
5909
6022
  { name: 'gio-el-help', component: GioElHelperWrapperComponent },
6023
+ { name: 'gio-currency-prefix', component: GioCurrencyPrefixWrapperComponent },
5910
6024
  ],
5911
6025
  types: [
5912
6026
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
@@ -5935,6 +6049,7 @@ class GioFormJsonSchemaModule {
5935
6049
  { name: 'banner', extension: { onPopulate: bannerExtension } },
5936
6050
  { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
5937
6051
  { name: 'el-help', extension: { onPopulate: elHelpExtension } },
6052
+ { name: 'gio-currency-prefix', extension: { onPopulate: currencyPrefixExtension } },
5938
6053
  ],
5939
6054
  extras: {
5940
6055
  checkExpressionOn: 'changeDetectionCheck',
@@ -5971,6 +6086,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
5971
6086
  GioBannerWrapperComponent,
5972
6087
  GioPasswordEyeWrapperComponent,
5973
6088
  GioElHelperWrapperComponent,
6089
+ GioCurrencyPrefixWrapperComponent,
5974
6090
  ],
5975
6091
  imports: [
5976
6092
  CommonModule,
@@ -5997,6 +6113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
5997
6113
  { name: 'gio-with-banner', component: GioBannerWrapperComponent },
5998
6114
  { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
5999
6115
  { name: 'gio-el-help', component: GioElHelperWrapperComponent },
6116
+ { name: 'gio-currency-prefix', component: GioCurrencyPrefixWrapperComponent },
6000
6117
  ],
6001
6118
  types: [
6002
6119
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
@@ -6025,6 +6142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
6025
6142
  { name: 'banner', extension: { onPopulate: bannerExtension } },
6026
6143
  { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
6027
6144
  { name: 'el-help', extension: { onPopulate: elHelpExtension } },
6145
+ { name: 'gio-currency-prefix', extension: { onPopulate: currencyPrefixExtension } },
6028
6146
  ],
6029
6147
  extras: {
6030
6148
  checkExpressionOn: 'changeDetectionCheck',