@gravitee/ui-particles-angular 7.25.0 → 7.26.0-fix-light-submenu-title-15b961a

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.
@@ -1305,6 +1305,10 @@ class GioFormHeadersComponent {
1305
1305
  constructor(fm, elRef) {
1306
1306
  this.fm = fm;
1307
1307
  this.elRef = elRef;
1308
+ this.headerFieldMapper = {
1309
+ keyName: 'key',
1310
+ valueName: 'value',
1311
+ };
1308
1312
  this.headersFormArray = new FormArray([
1309
1313
  new FormGroup({
1310
1314
  key: new FormControl('', Validators.pattern('^\\S*$')),
@@ -1325,18 +1329,30 @@ class GioFormHeadersComponent {
1325
1329
  if (!value) {
1326
1330
  return;
1327
1331
  }
1328
- this.headers = value ?? [];
1332
+ this.headers = [...(value ?? [])].map((header) => {
1333
+ return {
1334
+ key: header[this.headerFieldMapper.keyName],
1335
+ value: header[this.headerFieldMapper.valueName],
1336
+ };
1337
+ });
1329
1338
  this.initHeadersForm();
1330
1339
  }
1331
1340
  // From ControlValueAccessor interface
1332
1341
  registerOnChange(fn) {
1333
- const adaptOutputFn = this.adaptOutputFn;
1334
- if (adaptOutputFn) {
1335
- this._onChange = (headers) => fn(adaptOutputFn(headers));
1342
+ if (this.headerFieldMapper) {
1343
+ this._onChange = (headers) => fn(this.toHeaders(headers));
1336
1344
  return;
1337
1345
  }
1338
1346
  this._onChange = fn;
1339
1347
  }
1348
+ toHeaders(headers) {
1349
+ return [...(headers ?? [])].map(header => {
1350
+ return {
1351
+ [this.headerFieldMapper.keyName]: header.key,
1352
+ [this.headerFieldMapper.valueName]: header.value,
1353
+ };
1354
+ });
1355
+ }
1340
1356
  // From ControlValueAccessor interface
1341
1357
  registerOnTouched(fn) {
1342
1358
  this._onTouched = fn;
@@ -1429,7 +1445,7 @@ class GioFormHeadersComponent {
1429
1445
  }
1430
1446
  }
1431
1447
  GioFormHeadersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormHeadersComponent, deps: [{ token: i2$2.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1432
- GioFormHeadersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: { adaptOutputFn: "adaptOutputFn" }, host: { properties: { "class.disabled": "this.disabled" } }, providers: [
1448
+ GioFormHeadersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: { headerFieldMapper: "headerFieldMapper" }, host: { properties: { "class.disabled": "this.disabled" } }, providers: [
1433
1449
  {
1434
1450
  provide: NG_VALUE_ACCESSOR,
1435
1451
  useExisting: forwardRef(() => GioFormHeadersComponent),
@@ -1455,7 +1471,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1455
1471
  multi: true,
1456
1472
  },
1457
1473
  ], template: "<!--\n\n Copyright (C) 2015 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<table class=\"gio-form-headers__table gio-table-light\" [formGroup]=\"mainForm\">\n <thead>\n <tr>\n <th>KEY</th>\n <th>VALUE</th>\n </tr>\n </thead>\n <tbody formArrayName=\"headers\">\n <tr\n *ngFor=\"let control of headersFormArray.controls; index as headerIndex\"\n class=\"gio-form-headers__table__header-row\"\n [formGroupName]=\"headerIndex\"\n >\n <td class=\"gio-form-headers__table__header-row__td-key\">\n <mat-form-field class=\"gio-form-headers__table__header-row__td-key__field\" [floatLabel]=\"'never'\" appearance=\"standard\">\n <textarea\n formControlName=\"key\"\n matInput\n placeholder=\"Name...\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"1\"\n [matAutocomplete]=\"headerNamesAutocomplete\"\n ></textarea>\n </mat-form-field>\n <mat-error *ngIf=\"control.get('key')?.hasError('pattern')\">\n Header name must not contain spaces. (RegExp: {{ control.get('key')?.getError('pattern')?.requiredPattern }})\n </mat-error>\n <mat-autocomplete #headerNamesAutocomplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let headerName of getFilteredHeaderNames(headerIndex, control.value) | async\" [value]=\"headerName\">{{\n headerName\n }}</mat-option>\n </mat-autocomplete>\n </td>\n <td class=\"gio-form-headers__table__header-row__td-value\">\n <mat-form-field class=\"gio-form-headers__table__header-row__td-value__field\" [floatLabel]=\"'never'\" appearance=\"standard\">\n <textarea formControlName=\"value\" matInput placeholder=\"Value...\" cdkTextareaAutosize cdkAutosizeMinRows=\"1\"></textarea>\n </mat-form-field>\n <button\n class=\"gio-form-headers__table__header-row__td-value__button\"\n *ngIf=\"headersFormArray.controls.length - 1 !== headerIndex\"\n mat-icon-button\n aria-label=\"Delete\"\n (click)=\"onDeleteHeader(headerIndex)\"\n >\n <mat-icon svgIcon=\"gio:cancel\"></mat-icon>\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;overflow:hidden}.gio-form-headers__table{width:100%}.gio-form-headers__table__header-row__td-key,.gio-form-headers__table__header-row__td-value{position:relative;width:50%}.gio-form-headers__table__header-row__td-key__field,.gio-form-headers__table__header-row__td-value__field{display:flex;overflow:hidden;width:100%;max-height:32px;flex-direction:column;justify-content:center;padding-bottom:0}.gio-form-headers__table__header-row__td-key__field *,.gio-form-headers__table__header-row__td-value__field *{top:0;overflow:hidden;max-height:32px}.gio-form-headers__table__header-row__td-key__field:focus-within,.gio-form-headers__table__header-row__td-value__field:focus-within{z-index:100;height:auto;background-color:#fff}.gio-form-headers__table__header-row__td-key__field:focus-within *,.gio-form-headers__table__header-row__td-value__field:focus-within *{max-height:none}.gio-form-headers__table__header-row__td-key__button,.gio-form-headers__table__header-row__td-value__button{position:absolute;top:3px;right:3px;display:none}.gio-form-headers__table__header-row__td-remove{width:32px;height:32px;padding:0}.gio-form-headers__table__header-row:hover .gio-form-headers__table__header-row__td-value__button{z-index:110;display:block;background-color:#fff;opacity:.9}::ng-deep gio-form-headers .gio-form-headers__table__header-row .mat-form-field-infix{width:inherit}\n"] }]
1458
- }], ctorParameters: function () { return [{ type: i2$2.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { adaptOutputFn: [{
1474
+ }], ctorParameters: function () { return [{ type: i2$2.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { headerFieldMapper: [{
1459
1475
  type: Input
1460
1476
  }], disabled: [{
1461
1477
  type: HostBinding,
@@ -2497,15 +2513,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2497
2513
  class GioSubmenuGroupComponent {
2498
2514
  constructor() {
2499
2515
  this.title = '';
2516
+ this.theme = 'dark';
2500
2517
  }
2501
2518
  }
2502
2519
  GioSubmenuGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSubmenuGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2503
- GioSubmenuGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioSubmenuGroupComponent, selector: "gio-submenu-group", inputs: { title: "title" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2022 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=\"gio-submenu-group\">\n <div class=\"gio-submenu-group__title\">{{ title }}</div>\n <ng-content></ng-content>\n</div>\n", styles: [".gio-submenu-group{display:flex;flex-direction:column;margin-top:8px}.gio-submenu-group__title{height:36px;padding:8px 12px;border-radius:4px;margin:1px 0;color:#8e8f9c;letter-spacing:.4px}\n"] });
2520
+ GioSubmenuGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioSubmenuGroupComponent, selector: "gio-submenu-group", inputs: { title: "title", theme: "theme" }, ngImport: i0, template: "<!--\n\n Copyright (C) 2022 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=\"gio-submenu-group\">\n <div class=\"gio-submenu-group__title\" [class.gio-submenu-group__title__light]=\"theme === 'light'\">{{ title }}</div>\n <ng-content></ng-content>\n</div>\n", styles: [".gio-submenu-group{display:flex;flex-direction:column;margin-top:8px}.gio-submenu-group__title{height:36px;padding:8px 12px;border-radius:4px;margin:1px 0;color:#8e8f9c;letter-spacing:.4px}.gio-submenu-group__title__light{color:#d3d5dc}\n"] });
2504
2521
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSubmenuGroupComponent, decorators: [{
2505
2522
  type: Component,
2506
- args: [{ selector: 'gio-submenu-group', template: "<!--\n\n Copyright (C) 2022 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=\"gio-submenu-group\">\n <div class=\"gio-submenu-group__title\">{{ title }}</div>\n <ng-content></ng-content>\n</div>\n", styles: [".gio-submenu-group{display:flex;flex-direction:column;margin-top:8px}.gio-submenu-group__title{height:36px;padding:8px 12px;border-radius:4px;margin:1px 0;color:#8e8f9c;letter-spacing:.4px}\n"] }]
2523
+ args: [{ selector: 'gio-submenu-group', template: "<!--\n\n Copyright (C) 2022 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=\"gio-submenu-group\">\n <div class=\"gio-submenu-group__title\" [class.gio-submenu-group__title__light]=\"theme === 'light'\">{{ title }}</div>\n <ng-content></ng-content>\n</div>\n", styles: [".gio-submenu-group{display:flex;flex-direction:column;margin-top:8px}.gio-submenu-group__title{height:36px;padding:8px 12px;border-radius:4px;margin:1px 0;color:#8e8f9c;letter-spacing:.4px}.gio-submenu-group__title__light{color:#d3d5dc}\n"] }]
2507
2524
  }], propDecorators: { title: [{
2508
2525
  type: Input
2526
+ }], theme: [{
2527
+ type: Input
2509
2528
  }] } });
2510
2529
 
2511
2530
  /*
@@ -4385,21 +4404,16 @@ class GioFjsHeadersTypeComponent extends FieldType {
4385
4404
  super(...arguments);
4386
4405
  this.defaultOptions = {
4387
4406
  props: {
4388
- outputConfig: {
4389
- keyName: 'name',
4390
- valueName: 'value',
4391
- },
4407
+ outputConfig: this.outputConfig,
4392
4408
  },
4393
4409
  };
4394
4410
  this.collapse = false;
4395
4411
  }
4396
- get map() {
4397
- return (headers) => [...(headers ?? [])].map(header => {
4398
- return {
4399
- [this.props.outputConfig.keyName]: header.key,
4400
- [this.props.outputConfig.valueName]: header.value,
4401
- };
4402
- });
4412
+ get outputConfig() {
4413
+ return {
4414
+ keyName: 'name',
4415
+ valueName: 'value',
4416
+ };
4403
4417
  }
4404
4418
  }
4405
4419
  GioFjsHeadersTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -4420,10 +4434,10 @@ GioFjsHeadersTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
4420
4434
  <formly-validation-message [field]="field"></formly-validation-message>
4421
4435
  </div>
4422
4436
  <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
4423
- <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
4437
+ <gio-form-headers [headerFieldMapper]="outputConfig" [formControl]="formControl"></gio-form-headers>
4424
4438
  </div>
4425
4439
  </div>
4426
- `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: ["adaptOutputFn"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
4440
+ `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: ["headerFieldMapper"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
4427
4441
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, decorators: [{
4428
4442
  type: Component,
4429
4443
  args: [{ selector: 'gio-fjs-headers-type', template: `
@@ -4443,7 +4457,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4443
4457
  <formly-validation-message [field]="field"></formly-validation-message>
4444
4458
  </div>
4445
4459
  <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
4446
- <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
4460
+ <gio-form-headers [headerFieldMapper]="outputConfig" [formControl]="formControl"></gio-form-headers>
4447
4461
  </div>
4448
4462
  </div>
4449
4463
  `, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]