@gravitee/ui-particles-angular 5.19.1 → 5.20.0-fix-json-schema-15570d2
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/esm2020/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid-ignore.directive.mjs +30 -0
- package/esm2020/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive.mjs +49 -16
- package/esm2020/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.module.mjs +6 -5
- package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.component.mjs +38 -30
- package/esm2020/lib/gio-save-bar/gio-save-bar.component.mjs +9 -3
- package/esm2020/lib/gio-save-bar/gio-save-bar.harness.mjs +10 -5
- package/esm2020/lib/public-api.mjs +2 -1
- package/fesm2015/gravitee-ui-particles-angular.mjs +135 -54
- package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-particles-angular.mjs +131 -53
- package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid-ignore.directive.d.ts +6 -0
- package/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive.d.ts +17 -6
- package/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.module.d.ts +2 -1
- package/lib/gio-form-json-schema/gio-form-json-schema.component.d.ts +7 -4
- package/lib/gio-save-bar/gio-save-bar.component.d.ts +3 -1
- package/lib/gio-save-bar/gio-save-bar.harness.d.ts +2 -0
- package/lib/public-api.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken } from '@angular/core';
|
|
4
|
-
import { timer, Subject, fromEvent, of, BehaviorSubject,
|
|
4
|
+
import { timer, Subject, fromEvent, of, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/material/card';
|
|
6
6
|
import { MatCardModule } from '@angular/material/card';
|
|
7
7
|
import * as i2 from '@angular/material/button';
|
|
@@ -78,6 +78,8 @@ class GioSaveBarComponent {
|
|
|
78
78
|
this.invalidState = false;
|
|
79
79
|
this.creationMode = false;
|
|
80
80
|
this.hasSubmitLock = true;
|
|
81
|
+
this.hideSubmitButton = false;
|
|
82
|
+
this.hideDiscardButton = false;
|
|
81
83
|
this.resetClicked = new EventEmitter();
|
|
82
84
|
this.submitted = new EventEmitter();
|
|
83
85
|
this.submittedInvalidState = new EventEmitter();
|
|
@@ -122,7 +124,7 @@ class GioSaveBarComponent {
|
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
GioSaveBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSaveBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
-
GioSaveBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioSaveBarComponent, selector: "gio-save-bar", inputs: { opened: "opened", invalidState: "invalidState", creationMode: "creationMode", form: "form", formInitialValues: "formInitialValues" }, outputs: { resetClicked: "resetClicked", submitted: "submitted", submittedInvalidState: "submittedInvalidState" }, host: { listeners: { "disable-submit-lock": "onDisableSubmitLock()" }, properties: { "class.save-bar-sticky": "this.isSticky", "class.is-open": "this.isOpen" } }, ngImport: i0, 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\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div>\n <button
|
|
127
|
+
GioSaveBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioSaveBarComponent, selector: "gio-save-bar", inputs: { opened: "opened", invalidState: "invalidState", creationMode: "creationMode", form: "form", formInitialValues: "formInitialValues", hideSubmitButton: "hideSubmitButton", hideDiscardButton: "hideDiscardButton" }, outputs: { resetClicked: "resetClicked", submitted: "submitted", submittedInvalidState: "submittedInvalidState" }, host: { listeners: { "disable-submit-lock": "onDisableSubmitLock()" }, properties: { "class.save-bar-sticky": "this.isSticky", "class.is-open": "this.isOpen" } }, ngImport: i0, 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\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div class=\"save-bar__content__actions\">\n <button\n *ngIf=\"!creationMode && !hideDiscardButton\"\n class=\"save-bar__content__actions__reset-button\"\n mat-button\n type=\"button\"\n (click)=\"onResetClicked()\"\n >\n Discard\n </button>\n <ng-content></ng-content>\n <button\n *ngIf=\"!hideSubmitButton\"\n class=\"save-bar__content__actions__submit-button\"\n [class.invalid]=\"(form && form.invalid) || invalidState\"\n mat-flat-button\n color=\"primary\"\n [type]=\"form ? 'submit' : 'button'\"\n (click)=\"onSubmitClicked()\"\n >\n {{ creationMode ? 'Create' : 'Save' }}\n </button>\n </div>\n </mat-card>\n</div>\n", styles: [":host{z-index:1000;display:block;height:68px;margin-top:32px;visibility:hidden}:host.is-open{visibility:visible}:host(.save-bar-sticky){position:sticky;bottom:0;margin-right:-16px;margin-left:-16px}.save-bar__content{display:flex;height:100%;align-items:center;justify-content:space-between;padding:16px 24px}.save-bar__content__label{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.save-bar__content__actions{display:flex;gap:16px}.save-bar__content__actions__submit-button.invalid{background-color:#d6ffff;color:#000}.save-bar__content__actions__submit-button.invalid:hover:enabled{background-color:#099;color:#fff}\n"], components: [{ type: i1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { 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"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
|
126
128
|
trigger('slideUpDown', [
|
|
127
129
|
transition(':enter', [
|
|
128
130
|
style({ transform: 'translateY(40vh)', opacity: '0' }),
|
|
@@ -147,7 +149,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
147
149
|
animate('300ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({ transform: 'translateY(40vh)', opacity: '0' })),
|
|
148
150
|
]),
|
|
149
151
|
]),
|
|
150
|
-
], 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\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div>\n <button
|
|
152
|
+
], 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\n<div *ngIf=\"isOpen\" [@slideUpDown] [@.disabled]=\"creationMode\">\n <mat-card class=\"save-bar__content\" [class.mat-elevation-z3]=\"creationMode\" [class.mat-elevation-z6]=\"!creationMode\">\n <div class=\"save-bar__content__label\">{{ creationMode ? '' : 'You have unsaved changes' }}</div>\n <div class=\"save-bar__content__actions\">\n <button\n *ngIf=\"!creationMode && !hideDiscardButton\"\n class=\"save-bar__content__actions__reset-button\"\n mat-button\n type=\"button\"\n (click)=\"onResetClicked()\"\n >\n Discard\n </button>\n <ng-content></ng-content>\n <button\n *ngIf=\"!hideSubmitButton\"\n class=\"save-bar__content__actions__submit-button\"\n [class.invalid]=\"(form && form.invalid) || invalidState\"\n mat-flat-button\n color=\"primary\"\n [type]=\"form ? 'submit' : 'button'\"\n (click)=\"onSubmitClicked()\"\n >\n {{ creationMode ? 'Create' : 'Save' }}\n </button>\n </div>\n </mat-card>\n</div>\n", styles: [":host{z-index:1000;display:block;height:68px;margin-top:32px;visibility:hidden}:host.is-open{visibility:visible}:host(.save-bar-sticky){position:sticky;bottom:0;margin-right:-16px;margin-left:-16px}.save-bar__content{display:flex;height:100%;align-items:center;justify-content:space-between;padding:16px 24px}.save-bar__content__label{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.save-bar__content__actions{display:flex;gap:16px}.save-bar__content__actions__submit-button.invalid{background-color:#d6ffff;color:#000}.save-bar__content__actions__submit-button.invalid:hover:enabled{background-color:#099;color:#fff}\n"] }]
|
|
151
153
|
}], propDecorators: { isSticky: [{
|
|
152
154
|
type: HostBinding,
|
|
153
155
|
args: ['class.save-bar-sticky']
|
|
@@ -161,6 +163,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
161
163
|
type: Input
|
|
162
164
|
}], formInitialValues: [{
|
|
163
165
|
type: Input
|
|
166
|
+
}], hideSubmitButton: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], hideDiscardButton: [{
|
|
169
|
+
type: Input
|
|
164
170
|
}], resetClicked: [{
|
|
165
171
|
type: Output
|
|
166
172
|
}], submitted: [{
|
|
@@ -207,15 +213,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
207
213
|
class GioSaveBarHarness extends ComponentHarness {
|
|
208
214
|
constructor() {
|
|
209
215
|
super(...arguments);
|
|
210
|
-
this.
|
|
211
|
-
this.
|
|
216
|
+
this.cardSelector = '.save-bar__content';
|
|
217
|
+
this.resetButtonSelector = '.save-bar__content__actions__reset-button';
|
|
218
|
+
this.submitButtonSelector = '.save-bar__content__actions__submit-button';
|
|
212
219
|
this.getSubmitButton = this.locatorFor(this.submitButtonSelector);
|
|
213
220
|
this.getResetButton = this.locatorFor(this.resetButtonSelector);
|
|
214
221
|
}
|
|
215
222
|
isVisible() {
|
|
216
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
const
|
|
218
|
-
return
|
|
224
|
+
const card = yield this.locatorForOptional(this.cardSelector)();
|
|
225
|
+
return card !== null;
|
|
219
226
|
});
|
|
220
227
|
}
|
|
221
228
|
clickSubmit() {
|
|
@@ -232,6 +239,12 @@ class GioSaveBarHarness extends ComponentHarness {
|
|
|
232
239
|
return submitButton.hasClass('invalid');
|
|
233
240
|
});
|
|
234
241
|
}
|
|
242
|
+
isSubmitButtonVisible() {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
const submitButton = yield this.locatorForOptional(this.submitButtonSelector)();
|
|
245
|
+
return submitButton !== null;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
235
248
|
isResetButtonVisible() {
|
|
236
249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
250
|
const submitButton = yield this.locatorForOptional(this.resetButtonSelector)();
|
|
@@ -2738,6 +2751,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
2738
2751
|
* limitations under the License.
|
|
2739
2752
|
*/
|
|
2740
2753
|
|
|
2754
|
+
/*
|
|
2755
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
2756
|
+
*
|
|
2757
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2758
|
+
* you may not use this file except in compliance with the License.
|
|
2759
|
+
* You may obtain a copy of the License at
|
|
2760
|
+
*
|
|
2761
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2762
|
+
*
|
|
2763
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2764
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2765
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2766
|
+
* See the License for the specific language governing permissions and
|
|
2767
|
+
* limitations under the License.
|
|
2768
|
+
*/
|
|
2769
|
+
const GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR = 'gioFormFocusInvalidIgnore';
|
|
2770
|
+
class GioFormFocusInvalidIgnoreDirective {
|
|
2771
|
+
}
|
|
2772
|
+
GioFormFocusInvalidIgnoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidIgnoreDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2773
|
+
GioFormFocusInvalidIgnoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFocusInvalidIgnoreDirective, selector: "[gioFormFocusInvalidIgnore]", ngImport: i0 });
|
|
2774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidIgnoreDirective, decorators: [{
|
|
2775
|
+
type: Directive,
|
|
2776
|
+
args: [{
|
|
2777
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
2778
|
+
selector: `[${GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR}]`,
|
|
2779
|
+
}]
|
|
2780
|
+
}] });
|
|
2781
|
+
|
|
2741
2782
|
/*
|
|
2742
2783
|
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
2743
2784
|
*
|
|
@@ -2824,12 +2865,14 @@ const getBannerProperties = (banner) => {
|
|
|
2824
2865
|
* limitations under the License.
|
|
2825
2866
|
*/
|
|
2826
2867
|
class GioFormJsonSchemaComponent {
|
|
2827
|
-
constructor(gioFormlyJsonSchema, elRef, fm, ngControl) {
|
|
2868
|
+
constructor(gioFormlyJsonSchema, elRef, fm, changeDetectorRef, ngControl) {
|
|
2828
2869
|
this.gioFormlyJsonSchema = gioFormlyJsonSchema;
|
|
2829
2870
|
this.elRef = elRef;
|
|
2830
2871
|
this.fm = fm;
|
|
2872
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
2831
2873
|
this.ngControl = ngControl;
|
|
2832
2874
|
this.unsubscribe$ = new Subject();
|
|
2875
|
+
this.gioFormFocusInvalidIgnore = true;
|
|
2833
2876
|
this.formGroup = new FormGroup({});
|
|
2834
2877
|
this.options = {};
|
|
2835
2878
|
this.model = {};
|
|
@@ -2863,21 +2906,7 @@ class GioFormJsonSchemaComponent {
|
|
|
2863
2906
|
}
|
|
2864
2907
|
ngOnInit() {
|
|
2865
2908
|
var _a, _b, _c;
|
|
2866
|
-
//
|
|
2867
|
-
const parentControl = (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.parent;
|
|
2868
|
-
(_c = parentControl === null || parentControl === void 0 ? void 0 : parentControl.statusChanges) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this.unsubscribe$), map(() => parentControl === null || parentControl === void 0 ? void 0 : parentControl.touched), filter(touched => touched === true), distinctUntilChanged()).subscribe(() => {
|
|
2869
|
-
this.formGroup.markAllAsTouched();
|
|
2870
|
-
this.stateChanges$.next();
|
|
2871
|
-
});
|
|
2872
|
-
// To simulate the behavior of classic form controls, emit value only when the form is touched
|
|
2873
|
-
// Allow to keep the formControl pristine until the user interact with it
|
|
2874
|
-
combineLatest([this.formGroup.statusChanges, this.formGroup.valueChanges])
|
|
2875
|
-
.pipe(takeUntil(this.unsubscribe$),
|
|
2876
|
-
// Group all valueChanges events emit by formly in a single one
|
|
2877
|
-
debounceTime(100))
|
|
2878
|
-
.subscribe(() => {
|
|
2879
|
-
this.stateChanges$.next();
|
|
2880
|
-
});
|
|
2909
|
+
// Subscribe to state changes to manage touches, status and value
|
|
2881
2910
|
this.stateChanges$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2882
2911
|
var _a, _b, _c, _d;
|
|
2883
2912
|
const { status, value, touched } = this.formGroup;
|
|
@@ -2887,15 +2916,31 @@ class GioFormJsonSchemaComponent {
|
|
|
2887
2916
|
}
|
|
2888
2917
|
if (this.touched) {
|
|
2889
2918
|
this._onChange(value);
|
|
2890
|
-
if (status === 'VALID') {
|
|
2891
|
-
(_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.setErrors(null);
|
|
2892
|
-
}
|
|
2893
|
-
if (status === 'INVALID') {
|
|
2894
|
-
(_d = (_c = this.ngControl) === null || _c === void 0 ? void 0 : _c.control) === null || _d === void 0 ? void 0 : _d.setErrors({ invalid: true });
|
|
2895
|
-
}
|
|
2896
2919
|
}
|
|
2920
|
+
if (status === 'VALID') {
|
|
2921
|
+
(_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.setErrors(null);
|
|
2922
|
+
}
|
|
2923
|
+
if (status === 'INVALID') {
|
|
2924
|
+
(_d = (_c = this.ngControl) === null || _c === void 0 ? void 0 : _c.control) === null || _d === void 0 ? void 0 : _d.setErrors({ invalid: true });
|
|
2925
|
+
}
|
|
2926
|
+
this.changeDetectorRef.detectChanges();
|
|
2927
|
+
});
|
|
2928
|
+
// When the parent form is touched, mark all the sub formGroup as touched if not already touched
|
|
2929
|
+
const parentControl = (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.parent;
|
|
2930
|
+
(_c = parentControl === null || parentControl === void 0 ? void 0 : parentControl.statusChanges) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this.unsubscribe$), map(() => parentControl === null || parentControl === void 0 ? void 0 : parentControl.touched), filter(touched => touched === true), distinctUntilChanged()).subscribe(() => {
|
|
2931
|
+
this.formGroup.markAllAsTouched();
|
|
2932
|
+
this.stateChanges$.next();
|
|
2933
|
+
});
|
|
2934
|
+
// Group all valueChanges events emit by formly in a single one
|
|
2935
|
+
merge(this.formGroup.statusChanges, this.formGroup.valueChanges)
|
|
2936
|
+
.pipe(takeUntil(this.unsubscribe$), debounceTime(100))
|
|
2937
|
+
.subscribe(() => {
|
|
2938
|
+
this.stateChanges$.next();
|
|
2897
2939
|
});
|
|
2898
2940
|
}
|
|
2941
|
+
ngAfterViewInit() {
|
|
2942
|
+
this.stateChanges$.next();
|
|
2943
|
+
}
|
|
2899
2944
|
ngOnDestroy() {
|
|
2900
2945
|
this.unsubscribe$.next();
|
|
2901
2946
|
this.unsubscribe$.unsubscribe();
|
|
@@ -2919,18 +2964,21 @@ class GioFormJsonSchemaComponent {
|
|
|
2919
2964
|
throw new Error('Method not implemented.');
|
|
2920
2965
|
}
|
|
2921
2966
|
}
|
|
2922
|
-
GioFormJsonSchemaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, deps: [{ token: GioFormlyJsonSchemaService }, { token: i0.ElementRef }, { token: i2$2.FocusMonitor }, { token: i7.NgControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2923
|
-
GioFormJsonSchemaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: { jsonSchema: "jsonSchema", options: "options" }, ngImport: i0, template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, isInline: true, styles: ["::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{margin-bottom:-1.34375em}\n"], components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2967
|
+
GioFormJsonSchemaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, deps: [{ token: GioFormlyJsonSchemaService }, { token: i0.ElementRef }, { token: i2$2.FocusMonitor }, { token: i0.ChangeDetectorRef }, { token: i7.NgControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2968
|
+
GioFormJsonSchemaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormJsonSchemaComponent, selector: "gio-form-json-schema", inputs: { jsonSchema: "jsonSchema", options: "options" }, host: { properties: { "attr.gioFormFocusInvalidIgnore": "this.gioFormFocusInvalidIgnore" } }, ngImport: i0, template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, isInline: true, styles: ["::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{margin-bottom:-1.34375em}\n"], components: [{ type: i1$4.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2924
2969
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaComponent, decorators: [{
|
|
2925
2970
|
type: Component,
|
|
2926
2971
|
args: [{ selector: 'gio-form-json-schema', template: `<formly-form *ngIf="formGroup" [fields]="fields" [options]="options" [form]="formGroup" [model]="model"></formly-form>`, styles: ["::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-outline:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)){padding-bottom:0}::ng-deep gio-form-json-schema .mat-form-field.mat-form-field-appearance-fill:not(::ng-deep :has(mat-hint),::ng-deep :has(mat-error)) .mat-form-field-wrapper{margin-bottom:-1.34375em}\n"] }]
|
|
2927
2972
|
}], ctorParameters: function () {
|
|
2928
|
-
return [{ type: GioFormlyJsonSchemaService }, { type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i7.NgControl, decorators: [{
|
|
2973
|
+
return [{ type: GioFormlyJsonSchemaService }, { type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i0.ChangeDetectorRef }, { type: i7.NgControl, decorators: [{
|
|
2929
2974
|
type: Host
|
|
2930
2975
|
}, {
|
|
2931
2976
|
type: Optional
|
|
2932
2977
|
}] }];
|
|
2933
|
-
}, propDecorators: {
|
|
2978
|
+
}, propDecorators: { gioFormFocusInvalidIgnore: [{
|
|
2979
|
+
type: HostBinding,
|
|
2980
|
+
args: [`attr.${GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR}`]
|
|
2981
|
+
}], jsonSchema: [{
|
|
2934
2982
|
type: Input
|
|
2935
2983
|
}], options: [{
|
|
2936
2984
|
type: Input
|
|
@@ -3749,12 +3797,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3749
3797
|
* See the License for the specific language governing permissions and
|
|
3750
3798
|
* limitations under the License.
|
|
3751
3799
|
*/
|
|
3752
|
-
class
|
|
3753
|
-
constructor(
|
|
3754
|
-
this.
|
|
3800
|
+
class GioBaseFormFocusInvalidDirective {
|
|
3801
|
+
constructor(hostElement, formGroupDirective) {
|
|
3802
|
+
this.hostElement = hostElement;
|
|
3755
3803
|
this.formGroupDirective = formGroupDirective;
|
|
3756
3804
|
}
|
|
3757
|
-
|
|
3805
|
+
focusOnFirstInvalid() {
|
|
3758
3806
|
const selector = '.ng-invalid[formControlName],input.ng-invalid,mat-select.ng-invalid,textarea.ng-invalid,.gio-ng-invalid';
|
|
3759
3807
|
try {
|
|
3760
3808
|
// Mark all controls as touched to display errors
|
|
@@ -3762,11 +3810,9 @@ class GioFormFocusInvalidDirective {
|
|
|
3762
3810
|
this.formGroupDirective.control.markAllAsTouched();
|
|
3763
3811
|
this.formGroupDirective.control.updateValueAndValidity();
|
|
3764
3812
|
}
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
invalidControl = invalidControl.querySelector(selector);
|
|
3769
|
-
}
|
|
3813
|
+
const parentForm = this.hostElement.nativeElement.closest('form');
|
|
3814
|
+
const invalidFieldElements = parentForm === null || parentForm === void 0 ? void 0 : parentForm.querySelectorAll(selector);
|
|
3815
|
+
const invalidControl = this.getFirstInvalidControl(invalidFieldElements);
|
|
3770
3816
|
if (invalidControl) {
|
|
3771
3817
|
invalidControl.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
3772
3818
|
invalidControl.focus({ preventScroll: true });
|
|
@@ -3777,22 +3823,57 @@ class GioFormFocusInvalidDirective {
|
|
|
3777
3823
|
// 🧪 Useful to avoid som error in tests
|
|
3778
3824
|
}
|
|
3779
3825
|
}
|
|
3826
|
+
getFirstInvalidControl(invalidFieldElements, index = 0) {
|
|
3827
|
+
var _a;
|
|
3828
|
+
let invalidControl = invalidFieldElements === null || invalidFieldElements === void 0 ? void 0 : invalidFieldElements.item(index);
|
|
3829
|
+
const hasIgnoreAttribute = (_a = invalidControl === null || invalidControl === void 0 ? void 0 : invalidControl.attributes) === null || _a === void 0 ? void 0 : _a.getNamedItem(GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR);
|
|
3830
|
+
if (hasIgnoreAttribute) {
|
|
3831
|
+
invalidControl = this.getFirstInvalidControl(invalidFieldElements, index + 1);
|
|
3832
|
+
}
|
|
3833
|
+
return invalidControl;
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
GioBaseFormFocusInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, deps: [{ token: i0.ElementRef }, { token: i7.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3837
|
+
GioBaseFormFocusInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioBaseFormFocusInvalidDirective, ngImport: i0 });
|
|
3838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, decorators: [{
|
|
3839
|
+
type: Directive
|
|
3840
|
+
}], ctorParameters: function () {
|
|
3841
|
+
return [{ type: i0.ElementRef }, { type: i7.FormGroupDirective, decorators: [{
|
|
3842
|
+
type: Optional
|
|
3843
|
+
}] }];
|
|
3844
|
+
} });
|
|
3845
|
+
class GioFormFocusInvalidFormDirective extends GioBaseFormFocusInvalidDirective {
|
|
3846
|
+
onFormSubmit() {
|
|
3847
|
+
this.focusOnFirstInvalid();
|
|
3848
|
+
}
|
|
3780
3849
|
}
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
3850
|
+
GioFormFocusInvalidFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3851
|
+
GioFormFocusInvalidFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFocusInvalidFormDirective, selector: "form[gioFormFocusInvalid]", host: { listeners: { "submit": "onFormSubmit()" } }, usesInheritance: true, ngImport: i0 });
|
|
3852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, decorators: [{
|
|
3784
3853
|
type: Directive,
|
|
3785
3854
|
args: [{
|
|
3786
3855
|
selector: 'form[gioFormFocusInvalid]',
|
|
3787
3856
|
}]
|
|
3788
|
-
}],
|
|
3789
|
-
return [{ type: i0.Renderer2 }, { type: i7.FormGroupDirective, decorators: [{
|
|
3790
|
-
type: Optional
|
|
3791
|
-
}] }];
|
|
3792
|
-
}, propDecorators: { onFormSubmit: [{
|
|
3857
|
+
}], propDecorators: { onFormSubmit: [{
|
|
3793
3858
|
type: HostListener,
|
|
3794
3859
|
args: ['submit']
|
|
3795
3860
|
}] } });
|
|
3861
|
+
class GioButtonFocusInvalidButtonDirective extends GioBaseFormFocusInvalidDirective {
|
|
3862
|
+
onClick() {
|
|
3863
|
+
this.focusOnFirstInvalid();
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
GioButtonFocusInvalidButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3867
|
+
GioButtonFocusInvalidButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioButtonFocusInvalidButtonDirective, selector: "button[gioFormFocusInvalid]", host: { listeners: { "click": "onClick()" } }, usesInheritance: true, ngImport: i0 });
|
|
3868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, decorators: [{
|
|
3869
|
+
type: Directive,
|
|
3870
|
+
args: [{
|
|
3871
|
+
selector: 'button[gioFormFocusInvalid]',
|
|
3872
|
+
}]
|
|
3873
|
+
}], propDecorators: { onClick: [{
|
|
3874
|
+
type: HostListener,
|
|
3875
|
+
args: ['click']
|
|
3876
|
+
}] } });
|
|
3796
3877
|
|
|
3797
3878
|
/*
|
|
3798
3879
|
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
@@ -3812,13 +3893,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3812
3893
|
class GioFormFocusInvalidModule {
|
|
3813
3894
|
}
|
|
3814
3895
|
GioFormFocusInvalidModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3815
|
-
GioFormFocusInvalidModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, declarations: [
|
|
3896
|
+
GioFormFocusInvalidModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective], exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective] });
|
|
3816
3897
|
GioFormFocusInvalidModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule });
|
|
3817
3898
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, decorators: [{
|
|
3818
3899
|
type: NgModule,
|
|
3819
3900
|
args: [{
|
|
3820
|
-
declarations: [
|
|
3821
|
-
exports: [
|
|
3901
|
+
declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
|
|
3902
|
+
exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
|
|
3822
3903
|
}]
|
|
3823
3904
|
}] });
|
|
3824
3905
|
|
|
@@ -4368,5 +4449,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4368
4449
|
* Generated bundle index. Do not edit.
|
|
4369
4450
|
*/
|
|
4370
4451
|
|
|
4371
|
-
export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule,
|
|
4452
|
+
export { GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR, GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBaseFormFocusInvalidDirective, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioButtonFocusInvalidButtonDirective, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidFormDirective, GioFormFocusInvalidIgnoreDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioLoaderComponent, GioLoaderModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorHarness, GioMonacoEditorModule, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
|
|
4372
4453
|
//# sourceMappingURL=gravitee-ui-particles-angular.mjs.map
|