@gravitee/ui-particles-angular 5.4.0 → 5.5.0-add-gio-field-wrapper-108af01

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.
@@ -45,7 +45,7 @@ import { MatSelectHarness } from '@angular/material/select/testing';
45
45
  import { toSvg } from 'jdenticon';
46
46
  import * as i1$3 from '@ngx-formly/core/json-schema';
47
47
  import * as i1$4 from '@ngx-formly/core';
48
- import { FieldType, FieldArrayType, FormlyModule } from '@ngx-formly/core';
48
+ import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-formly/core';
49
49
  import { FormlyMaterialModule } from '@ngx-formly/material';
50
50
 
51
51
  /*
@@ -2836,11 +2836,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2836
2836
  class GioFjsNullTypeComponent extends FieldType {
2837
2837
  }
2838
2838
  GioFjsNullTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2839
- GioFjsNullTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsNullTypeComponent, selector: "gio-fjs-object-type", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
2839
+ GioFjsNullTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsNullTypeComponent, selector: "gio-fjs-null-type", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
2840
2840
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, decorators: [{
2841
2841
  type: Component,
2842
2842
  args: [{
2843
- selector: 'gio-fjs-object-type',
2843
+ selector: 'gio-fjs-null-type',
2844
2844
  template: ``,
2845
2845
  }]
2846
2846
  }] });
@@ -2997,6 +2997,40 @@ function typeValidationMessage({ schemaType }) {
2997
2997
  return `Should be "${schemaType[0]}".`;
2998
2998
  }
2999
2999
 
3000
+ /*
3001
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3002
+ *
3003
+ * Licensed under the Apache License, Version 2.0 (the "License");
3004
+ * you may not use this file except in compliance with the License.
3005
+ * You may obtain a copy of the License at
3006
+ *
3007
+ * http://www.apache.org/licenses/LICENSE-2.0
3008
+ *
3009
+ * Unless required by applicable law or agreed to in writing, software
3010
+ * distributed under the License is distributed on an "AS IS" BASIS,
3011
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3012
+ * See the License for the specific language governing permissions and
3013
+ * limitations under the License.
3014
+ */
3015
+ class GioFormFieldWrapperComponent extends FieldWrapper {
3016
+ }
3017
+ GioFormFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3018
+ GioFormFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFieldWrapperComponent, selector: "gio-form-field-wrapper", 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<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\">{{ props.bannerTitle }}</div>\n <div class=\"banner__text\">{{ props.bannerText }}</div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: [".wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;margin-bottom:8px;gap:8px;background:#e7e8ef;border-radius:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"], components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFieldWrapperComponent, decorators: [{
3020
+ type: Component,
3021
+ args: [{ selector: 'gio-form-field-wrapper', 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\">{{ props.bannerTitle }}</div>\n <div class=\"banner__text\">{{ props.bannerText }}</div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: [".wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;margin-bottom:8px;gap:8px;background:#e7e8ef;border-radius:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"] }]
3022
+ }] });
3023
+
3024
+ function bannerExtension(field) {
3025
+ if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-with-banner') !== -1)) {
3026
+ return;
3027
+ }
3028
+ if (field.props.bannerTitle || field.props.bannerText) {
3029
+ // WARNING: 'gio-with-banner' must be placed before field wrappers in order to put banner before mat-form-field if exists
3030
+ field.wrappers = ['gio-with-banner', ...(field.wrappers || [])];
3031
+ }
3032
+ }
3033
+
3000
3034
  /*
3001
3035
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3002
3036
  *
@@ -3015,8 +3049,13 @@ function typeValidationMessage({ schemaType }) {
3015
3049
  class GioFormJsonSchemaModule {
3016
3050
  }
3017
3051
  GioFormJsonSchemaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3018
- GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, declarations: [GioFormJsonSchemaComponent, GioFjsNullTypeComponent, GioFjsObjectTypeComponent, GioFjsArrayTypeComponent], imports: [CommonModule,
3019
- ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3052
+ GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, declarations: [GioFormJsonSchemaComponent,
3053
+ GioFjsNullTypeComponent,
3054
+ GioFjsObjectTypeComponent,
3055
+ GioFjsArrayTypeComponent,
3056
+ GioFormFieldWrapperComponent], imports: [CommonModule,
3057
+ ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
3058
+ GioIconsModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3020
3059
  GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, imports: [[
3021
3060
  CommonModule,
3022
3061
  ReactiveFormsModule,
@@ -3036,18 +3075,27 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3036
3075
  { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3037
3076
  { name: 'const', message: constValidationMessage },
3038
3077
  ],
3078
+ wrappers: [{ name: 'gio-with-banner', component: GioFormFieldWrapperComponent }],
3039
3079
  types: [
3040
3080
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3041
3081
  { name: 'array', component: GioFjsArrayTypeComponent },
3042
3082
  { name: 'object', component: GioFjsObjectTypeComponent },
3043
3083
  ],
3084
+ extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3044
3085
  }),
3045
3086
  FormlyMaterialModule,
3087
+ GioIconsModule,
3046
3088
  ], FormlyModule] });
3047
3089
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, decorators: [{
3048
3090
  type: NgModule,
3049
3091
  args: [{
3050
- declarations: [GioFormJsonSchemaComponent, GioFjsNullTypeComponent, GioFjsObjectTypeComponent, GioFjsArrayTypeComponent],
3092
+ declarations: [
3093
+ GioFormJsonSchemaComponent,
3094
+ GioFjsNullTypeComponent,
3095
+ GioFjsObjectTypeComponent,
3096
+ GioFjsArrayTypeComponent,
3097
+ GioFormFieldWrapperComponent,
3098
+ ],
3051
3099
  imports: [
3052
3100
  CommonModule,
3053
3101
  ReactiveFormsModule,
@@ -3067,13 +3115,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3067
3115
  { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3068
3116
  { name: 'const', message: constValidationMessage },
3069
3117
  ],
3118
+ wrappers: [{ name: 'gio-with-banner', component: GioFormFieldWrapperComponent }],
3070
3119
  types: [
3071
3120
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3072
3121
  { name: 'array', component: GioFjsArrayTypeComponent },
3073
3122
  { name: 'object', component: GioFjsObjectTypeComponent },
3074
3123
  ],
3124
+ extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3075
3125
  }),
3076
3126
  FormlyMaterialModule,
3127
+ GioIconsModule,
3077
3128
  ],
3078
3129
  exports: [GioFormJsonSchemaComponent, FormlyModule],
3079
3130
  }]