@gravitee/ui-components 3.37.1 → 3.38.0
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/package.json +17 -17
- package/src/organisms/gv-schema-form/gv-schema-form.d.ts +2 -0
- package/src/organisms/gv-schema-form/gv-schema-form.js +7 -0
- package/src/organisms/gv-schema-form/gv-schema-form.js.map +1 -1
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.d.ts +131 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.js +628 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.js.map +1 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.stories.d.ts +124 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.stories.js +220 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.stories.js.map +1 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.test.d.ts +1 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.test.js +458 -0
- package/src/organisms/gv-schema-form-group/gv-schema-form-group.test.js.map +1 -0
- package/src/organisms/gv-schema-form-group/index.d.ts +1 -0
- package/src/organisms/gv-schema-form-group/index.js +17 -0
- package/src/organisms/gv-schema-form-group/index.js.map +1 -0
- package/wc/gv-schema-form-group.d.ts +1 -0
- package/wc/gv-schema-form-group.js +2 -0
- package/wc/gv-schema-form-group.js.map +1 -0
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/*
|
|
11
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
import { LitElement, html, css } from 'lit';
|
|
26
|
+
import { get, set, del } from 'object-path';
|
|
27
|
+
import { dispatchCustomEvent } from '../../lib/events';
|
|
28
|
+
import { deepClone, deepEqual } from '../../lib/utils';
|
|
29
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
30
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
31
|
+
import { Validator } from 'jsonschema';
|
|
32
|
+
import { empty } from '../../styles/empty';
|
|
33
|
+
import '../gv-schema-form-control';
|
|
34
|
+
/**
|
|
35
|
+
* Schema form group component
|
|
36
|
+
* Create a form (without submit and cancel button) with a schema and work with Angular
|
|
37
|
+
*
|
|
38
|
+
* @fires gv-schema-form-group:error - event when user touch invalid form
|
|
39
|
+
* @fires gv-schema-form-group:change - event when when form change
|
|
40
|
+
*
|
|
41
|
+
* @attr {Object} schema - the schema form configuration
|
|
42
|
+
* @attr {Object} value - the value of fields
|
|
43
|
+
* @attr {Object} errors - the map of errors by input key
|
|
44
|
+
* @attr {Boolean} validate - to force validation on first render
|
|
45
|
+
* @attr {Boolean} readonly - true if readonly
|
|
46
|
+
* @attr {Boolean} scrollable - useful for making content scrollable with fixed headers / footers
|
|
47
|
+
*
|
|
48
|
+
* @cssprop {Color} [--gv-schema-form-group--bgc=#ffffff] - Background color
|
|
49
|
+
* @cssprop {Length} [--gv-schema-form-group-control--m=0.4rem] - Control margin
|
|
50
|
+
*/
|
|
51
|
+
export class GvSchemaFormGroup extends LitElement {
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
schema: { type: Object },
|
|
55
|
+
errors: { type: Object },
|
|
56
|
+
value: { type: Object },
|
|
57
|
+
_confirm: { type: Object },
|
|
58
|
+
_value: { type: Object, attribute: false },
|
|
59
|
+
dirty: { type: Boolean, reflect: true },
|
|
60
|
+
hideDeprecated: { type: Boolean, attribute: 'hide-deprecated' },
|
|
61
|
+
_validatorResults: { type: Object },
|
|
62
|
+
skeleton: { type: Boolean, reflect: true },
|
|
63
|
+
_touch: { type: Boolean },
|
|
64
|
+
readonly: { type: Boolean, reflect: true },
|
|
65
|
+
scrollable: { type: Boolean, reflect: true },
|
|
66
|
+
groups: { type: Array },
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
constructor() {
|
|
70
|
+
super();
|
|
71
|
+
this.hideDeprecated = false;
|
|
72
|
+
this._value = {};
|
|
73
|
+
this._touch = false;
|
|
74
|
+
this._validator = new Validator();
|
|
75
|
+
this._validatorResults = {};
|
|
76
|
+
this._ignoreProperties = [];
|
|
77
|
+
this._dynamicControls = [];
|
|
78
|
+
this._dynamicAttributes = ['disabled', 'required', 'hidden'];
|
|
79
|
+
this.groups = null;
|
|
80
|
+
this.addEventListener('gv-schema-form-control:default-value', this._onDefaultValue.bind(this));
|
|
81
|
+
this.addEventListener('gv-schema-form-control:change', this._onChange.bind(this));
|
|
82
|
+
this.addEventListener('gv-schema-form-control:control-ready', this._onControlReady.bind(this));
|
|
83
|
+
}
|
|
84
|
+
set value(value) {
|
|
85
|
+
if (!deepEqual(this._value, value)) {
|
|
86
|
+
if (value) {
|
|
87
|
+
this._initialValue = Object.assign({}, value);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this._initialValue = {};
|
|
91
|
+
}
|
|
92
|
+
this._value = deepClone(this._initialValue);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
get value() {
|
|
96
|
+
return this._value;
|
|
97
|
+
}
|
|
98
|
+
reset(value = null) {
|
|
99
|
+
this._value = deepClone(value || this._initialValue);
|
|
100
|
+
this._touch = false;
|
|
101
|
+
this._setDirty(false);
|
|
102
|
+
this.getControls().forEach((s) => {
|
|
103
|
+
s.requestUpdate();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
_onReset() {
|
|
107
|
+
this.reset();
|
|
108
|
+
dispatchCustomEvent(this, 'reset');
|
|
109
|
+
}
|
|
110
|
+
requestValidation() {
|
|
111
|
+
clearTimeout(this._validateTimeout);
|
|
112
|
+
this._validateTimeout = setTimeout(() => {
|
|
113
|
+
this.validate();
|
|
114
|
+
}, 350);
|
|
115
|
+
}
|
|
116
|
+
_setDirty(dirty = true) {
|
|
117
|
+
this.dirty = !!dirty;
|
|
118
|
+
}
|
|
119
|
+
_setTouch(touch = true) {
|
|
120
|
+
this._touch = !!touch;
|
|
121
|
+
}
|
|
122
|
+
confirm(force = false) {
|
|
123
|
+
if (this.isTouch() || force) {
|
|
124
|
+
if (this._confirm && this._confirm.promise) {
|
|
125
|
+
return this._confirm.promise;
|
|
126
|
+
}
|
|
127
|
+
const promise = new Promise((resolve, reject) => (this._confirm = { resolve, reject }));
|
|
128
|
+
this._confirm.promise = promise;
|
|
129
|
+
return promise;
|
|
130
|
+
}
|
|
131
|
+
return Promise.resolve();
|
|
132
|
+
}
|
|
133
|
+
_onConfirmReset() {
|
|
134
|
+
const { resolve } = this._confirm;
|
|
135
|
+
this._confirm = null;
|
|
136
|
+
this._onReset();
|
|
137
|
+
this.requestUpdate();
|
|
138
|
+
this.updateComplete.then(() => {
|
|
139
|
+
resolve(this);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
_onConfirmEdit() {
|
|
143
|
+
this._confirm.reject(this);
|
|
144
|
+
this._confirm = null;
|
|
145
|
+
this._updateChildren();
|
|
146
|
+
}
|
|
147
|
+
_dispatchChange() {
|
|
148
|
+
clearTimeout(this._changeTimeout);
|
|
149
|
+
this._changeTimeout = setTimeout(() => {
|
|
150
|
+
dispatchCustomEvent(this, 'change', { target: this, value: this._value, validation: this._validatorResults });
|
|
151
|
+
}, 50);
|
|
152
|
+
}
|
|
153
|
+
_onDefaultValue({ detail: { currentTarget, value, control } }) {
|
|
154
|
+
if (control.type === 'integer' && value != null && ((value.trim && value.length > 0) || value.length > 0)) {
|
|
155
|
+
value = parseInt(value, 10);
|
|
156
|
+
}
|
|
157
|
+
set(this._value, currentTarget.id, value);
|
|
158
|
+
}
|
|
159
|
+
_onChange({ detail: { currentTarget, value, control } }) {
|
|
160
|
+
this._setTouch(true);
|
|
161
|
+
if (control.type === 'integer') {
|
|
162
|
+
if (typeof value === 'string' && value.trim().length === 0) {
|
|
163
|
+
value = null;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
const intValue = Number(value).valueOf();
|
|
167
|
+
if (!isNaN(intValue)) {
|
|
168
|
+
value = intValue;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
value = null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if (control.type === 'array' && value.length === 0) {
|
|
176
|
+
// For an array of complex objects it's possible that the sub objects have required fields,
|
|
177
|
+
// the null allows validation
|
|
178
|
+
value = control.enum || control.items.enum ? [] : null;
|
|
179
|
+
}
|
|
180
|
+
else if (control.type === 'string' && value.trim().length === 0 && !control.enum) {
|
|
181
|
+
value = null;
|
|
182
|
+
}
|
|
183
|
+
else if (control.type === 'object') {
|
|
184
|
+
if (Object.keys(value).length === 0) {
|
|
185
|
+
value = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (value == null) {
|
|
189
|
+
del(this._value, currentTarget.id);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
set(this._value, currentTarget.id, value);
|
|
193
|
+
}
|
|
194
|
+
this._updateDynamicControls();
|
|
195
|
+
this.validate();
|
|
196
|
+
this.dirty = true;
|
|
197
|
+
this._dispatchChange();
|
|
198
|
+
}
|
|
199
|
+
_onControlReady(e) {
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
const controlElement = e.detail.control;
|
|
203
|
+
const control = controlElement.control;
|
|
204
|
+
if (control['x-schema-form']) {
|
|
205
|
+
if (control['x-schema-form'].event) {
|
|
206
|
+
const event = control['x-schema-form'].event;
|
|
207
|
+
dispatchCustomEvent(this, event.name, Object.assign(Object.assign({}, event), e.detail));
|
|
208
|
+
}
|
|
209
|
+
else if (this._hasCondition(control)) {
|
|
210
|
+
this._dynamicControls.push(controlElement);
|
|
211
|
+
this._updateDynamicControl(controlElement);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
_updateDynamicControls() {
|
|
216
|
+
this._ignoreProperties = [];
|
|
217
|
+
this._dynamicControls.forEach((controlElement) => {
|
|
218
|
+
this._updateDynamicControl(controlElement);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
_updateDynamicControl(controlElement) {
|
|
222
|
+
const control = controlElement.control;
|
|
223
|
+
if (control['x-schema-form']) {
|
|
224
|
+
this._dynamicAttributes.forEach((attribute) => {
|
|
225
|
+
const is = this._evaluateCondition(control, attribute);
|
|
226
|
+
if (is) {
|
|
227
|
+
controlElement.setAttribute(attribute, '');
|
|
228
|
+
if (attribute === 'hidden') {
|
|
229
|
+
this._ignoreProperties.push(controlElement.id);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
controlElement.removeAttribute(attribute);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
performUpdate() {
|
|
240
|
+
const _super = Object.create(null, {
|
|
241
|
+
performUpdate: { get: () => super.performUpdate }
|
|
242
|
+
});
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
yield Promise.all(this.getControls().map((e) => e.updateComplete));
|
|
245
|
+
this.getControls().forEach((s) => {
|
|
246
|
+
s.requestUpdate();
|
|
247
|
+
});
|
|
248
|
+
_super.performUpdate.call(this);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
_renderControl(key) {
|
|
252
|
+
// This is require to clean cache of <gv-schema-form-control>
|
|
253
|
+
const control = Object.assign({}, this.schema.properties[key]);
|
|
254
|
+
const isRequired = (this.schema.required && this.schema.required.includes(key)) || this._evaluateCondition(control, 'required');
|
|
255
|
+
const isDisabled = (this.schema.disabled && this.schema.disabled.includes(key)) || this._evaluateCondition(control, 'disabled');
|
|
256
|
+
const isHidden = this._evaluateCondition(control, 'hidden');
|
|
257
|
+
if (isHidden) {
|
|
258
|
+
this._ignoreProperties.push(key);
|
|
259
|
+
}
|
|
260
|
+
const isReadonly = this.readonly || control.readOnly === true;
|
|
261
|
+
const isWriteOnly = control.writeOnly === true;
|
|
262
|
+
const value = get(this._value, key);
|
|
263
|
+
return html `<gv-schema-form-control
|
|
264
|
+
.id="${key}"
|
|
265
|
+
.errors="${this.errors}"
|
|
266
|
+
.control="${control}"
|
|
267
|
+
.skeleton="${this.skeleton}"
|
|
268
|
+
.value="${value}"
|
|
269
|
+
?readonly="${isReadonly}"
|
|
270
|
+
?writeonly="${isWriteOnly}"
|
|
271
|
+
?required="${isRequired}"
|
|
272
|
+
?disabled="${isDisabled}"
|
|
273
|
+
?hidden="${isHidden}"
|
|
274
|
+
></gv-schema-form-control>`;
|
|
275
|
+
}
|
|
276
|
+
_hasCondition(control) {
|
|
277
|
+
if (control['x-schema-form']) {
|
|
278
|
+
return this._dynamicAttributes.find((condition) => control['x-schema-form'][condition] != null) != null;
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
_evaluateCondition(control, conditionKey) {
|
|
283
|
+
if (control['x-schema-form'] == null || control['x-schema-form'][conditionKey] == null) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const condition = control['x-schema-form'][conditionKey];
|
|
287
|
+
if (typeof condition === 'boolean') {
|
|
288
|
+
return condition;
|
|
289
|
+
}
|
|
290
|
+
if (!Array.isArray(condition)) {
|
|
291
|
+
// condition isn't an array, ignore the condition
|
|
292
|
+
console.warn(`'${conditionKey}' attribute of 'x-schema-form' should be an array`);
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
let result = true;
|
|
296
|
+
for (const operation of condition) {
|
|
297
|
+
// operation only have one operator with a single object containing operand value
|
|
298
|
+
const operator = Object.keys(operation)[0];
|
|
299
|
+
switch (operator) {
|
|
300
|
+
case '$neq':
|
|
301
|
+
result = result && this._evaluateNotEqualsCondition(control, operation);
|
|
302
|
+
break;
|
|
303
|
+
case '$eq':
|
|
304
|
+
result = result && this._evaluateEqualsCondition(control, operation);
|
|
305
|
+
break;
|
|
306
|
+
case '$nodef':
|
|
307
|
+
result = result && this._evaluateNotDefCondition(control, operation);
|
|
308
|
+
break;
|
|
309
|
+
case '$def':
|
|
310
|
+
result = result && this._evaluateDefCondition(control, operation);
|
|
311
|
+
break;
|
|
312
|
+
default:
|
|
313
|
+
console.warn(`Unsupported operator '${operator}' on disable condition`);
|
|
314
|
+
result = false;
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
_evaluateNotEqualsCondition(control, condition) {
|
|
321
|
+
return !this._evaluateEqualsCondition(control, condition);
|
|
322
|
+
}
|
|
323
|
+
_evaluateEqualsCondition(control, condition) {
|
|
324
|
+
const operator = Object.keys(condition)[0];
|
|
325
|
+
const operands = condition[operator];
|
|
326
|
+
const modelAttributes = Object.keys(operands);
|
|
327
|
+
return modelAttributes
|
|
328
|
+
.map((modelAttribute) => {
|
|
329
|
+
const testValue = operands[modelAttribute];
|
|
330
|
+
let value = get(this._value, modelAttribute);
|
|
331
|
+
if (value == null && control.type === 'string') {
|
|
332
|
+
value = '';
|
|
333
|
+
}
|
|
334
|
+
if (Array.isArray(testValue)) {
|
|
335
|
+
return testValue.includes(value);
|
|
336
|
+
}
|
|
337
|
+
return value === testValue;
|
|
338
|
+
})
|
|
339
|
+
.reduce((acc, current) => acc || current);
|
|
340
|
+
}
|
|
341
|
+
_evaluateNotDefCondition(control, condition) {
|
|
342
|
+
const operator = Object.keys(condition)[0];
|
|
343
|
+
const modelAttribute = condition[operator];
|
|
344
|
+
return get(this._value, modelAttribute) === undefined || get(this._value, modelAttribute) === null;
|
|
345
|
+
}
|
|
346
|
+
_evaluateDefCondition(control, condition) {
|
|
347
|
+
return !this._evaluateNotDefCondition(control, condition);
|
|
348
|
+
}
|
|
349
|
+
_renderPart() {
|
|
350
|
+
if (this._confirm) {
|
|
351
|
+
return html `<div class="confirm-box">
|
|
352
|
+
<div class="error">The configuration is not valid and cannot be saved.</div>
|
|
353
|
+
<div class="confirm-box_actions">
|
|
354
|
+
<gv-button @gv-button:click="${this._onConfirmReset}" outlined icon="general:update" danger>Lose changes</gv-button>
|
|
355
|
+
<gv-button @gv-button:click="${this._onConfirmEdit}" icon="design:edit">Edit</gv-button>
|
|
356
|
+
</div>
|
|
357
|
+
</div>`;
|
|
358
|
+
}
|
|
359
|
+
const keys = this.schema.properties ? Object.keys(this.schema.properties) : [];
|
|
360
|
+
this._ignoreProperties = [];
|
|
361
|
+
if (this.groups) {
|
|
362
|
+
// Remove undefined group items
|
|
363
|
+
const groupsCleaned = this.groups.reduce((prev, group) => {
|
|
364
|
+
const itemsExistingInSchemaKeys = keys.filter((key) => [...(group.items || [])].includes(key));
|
|
365
|
+
prev.push(Object.assign(Object.assign({}, group), { items: itemsExistingInSchemaKeys || [] }));
|
|
366
|
+
return prev;
|
|
367
|
+
}, []);
|
|
368
|
+
// Add non grouped items inside default group
|
|
369
|
+
const defaultGroup = groupsCleaned.find((g) => g.default) || { default: true, items: [] };
|
|
370
|
+
const zipGroupedItems = groupsCleaned.reduce((prev, group) => [...prev, ...group.items], []);
|
|
371
|
+
defaultGroup.items = keys.filter((key) => !zipGroupedItems.includes(key));
|
|
372
|
+
return repeat(groupsCleaned, (group) => html `${group.name
|
|
373
|
+
? html `<h2 class="group-title">${group.name}</h2>
|
|
374
|
+
${repeat(group.items, (key) => this._renderControl(key))}`
|
|
375
|
+
: repeat(group.items, (key) => this._renderControl(key))} `);
|
|
376
|
+
}
|
|
377
|
+
return html `${repeat([1], () => repeat(keys, (key) => key, (key) => this._renderControl(key)))}`;
|
|
378
|
+
}
|
|
379
|
+
getControls() {
|
|
380
|
+
return Array.from(this.shadowRoot.querySelectorAll('gv-schema-form-control'));
|
|
381
|
+
}
|
|
382
|
+
getControl(id) {
|
|
383
|
+
return this.shadowRoot.querySelector(`[id="${id}"]`);
|
|
384
|
+
}
|
|
385
|
+
_getErrors() {
|
|
386
|
+
return (this._validatorResults.errors || []).filter((error) => {
|
|
387
|
+
let id = `${error.property.replace('instance.', '')}`;
|
|
388
|
+
if (!Array.isArray(error.argument)) {
|
|
389
|
+
id = `${id}.${error.argument}`;
|
|
390
|
+
}
|
|
391
|
+
const errorKey = `x-schema-form.errors.${id}.${error.name}`;
|
|
392
|
+
const errorMessage = get(this.schema, errorKey);
|
|
393
|
+
if (errorMessage) {
|
|
394
|
+
error.message = errorMessage;
|
|
395
|
+
}
|
|
396
|
+
return !this._ignoreProperties.includes(id);
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
validate() {
|
|
400
|
+
if (this.schema) {
|
|
401
|
+
// Additional properties should not block the validation of the form
|
|
402
|
+
this._validatorResults = this._validator.validate(this._value, Object.assign(Object.assign({}, this.schema), { additionalProperties: {} }));
|
|
403
|
+
this.errors = this._getErrors();
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this._validatorResults = {};
|
|
407
|
+
}
|
|
408
|
+
dispatchCustomEvent(this, 'error', this._validatorResults.valid ? null : this._validatorResults.errors);
|
|
409
|
+
}
|
|
410
|
+
isValid() {
|
|
411
|
+
if (this._validatorResults.valid) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
return this._getErrors().length === 0;
|
|
415
|
+
}
|
|
416
|
+
isTouch() {
|
|
417
|
+
return this._touch || this.dirty;
|
|
418
|
+
}
|
|
419
|
+
_updateChildren(withValidation) {
|
|
420
|
+
if (withValidation) {
|
|
421
|
+
this._validatorResults = {};
|
|
422
|
+
this.errors = null;
|
|
423
|
+
this.requestValidation();
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
firstUpdated() {
|
|
427
|
+
this.validate();
|
|
428
|
+
}
|
|
429
|
+
updated(changedProperties) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
if (changedProperties.has('_value')) {
|
|
432
|
+
this.getControls().forEach((control) => {
|
|
433
|
+
control.value = get(this._value, control.id);
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
this._updateChildren(changedProperties.has('_value') || changedProperties.has('schema'));
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
getUpdateComplete() {
|
|
440
|
+
const _super = Object.create(null, {
|
|
441
|
+
getUpdateComplete: { get: () => super.getUpdateComplete }
|
|
442
|
+
});
|
|
443
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
+
const result = yield _super.getUpdateComplete.call(this);
|
|
445
|
+
yield Promise.all(this.getControls().map((e) => e.updateComplete));
|
|
446
|
+
return result;
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
render() {
|
|
450
|
+
return html `
|
|
451
|
+
<div class="${classMap({ container: true, confirm: this._confirm })}">
|
|
452
|
+
<div class="content">${this.schema != null ? this._renderPart() : html ``}</div>
|
|
453
|
+
</div>
|
|
454
|
+
`;
|
|
455
|
+
}
|
|
456
|
+
static get styles() {
|
|
457
|
+
return [
|
|
458
|
+
empty,
|
|
459
|
+
// language=CSS
|
|
460
|
+
css `
|
|
461
|
+
:host {
|
|
462
|
+
box-sizing: border-box;
|
|
463
|
+
margin: 0.2rem;
|
|
464
|
+
--bgc: var(--gv-schema-form--bgc, #ffffff);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
form {
|
|
468
|
+
display: flex;
|
|
469
|
+
flex-direction: column;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
form.scrollable {
|
|
473
|
+
position: absolute;
|
|
474
|
+
width: 100%;
|
|
475
|
+
top: 0;
|
|
476
|
+
bottom: 0;
|
|
477
|
+
left: 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.container {
|
|
481
|
+
flex-grow: 1;
|
|
482
|
+
|
|
483
|
+
background-color: var(--bgc);
|
|
484
|
+
display: flex;
|
|
485
|
+
flex-direction: column;
|
|
486
|
+
|
|
487
|
+
/* for Firefox */
|
|
488
|
+
min-height: 0;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.header,
|
|
492
|
+
.footer,
|
|
493
|
+
.content {
|
|
494
|
+
background-color: var(--bgc);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.content {
|
|
498
|
+
flex-grow: 1;
|
|
499
|
+
display: flex;
|
|
500
|
+
flex-direction: column;
|
|
501
|
+
align-self: center;
|
|
502
|
+
width: 100%;
|
|
503
|
+
|
|
504
|
+
/* for Firefox */
|
|
505
|
+
min-height: 0;
|
|
506
|
+
|
|
507
|
+
/* add padding when save bar is open */
|
|
508
|
+
padding-bottom: var(--gv-policy-studio--pb);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.content > gv-schema-form-control {
|
|
512
|
+
align-self: center;
|
|
513
|
+
width: 100%;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
form.scrollable .content {
|
|
517
|
+
overflow: auto;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
form.scrollable .content > gv-schema-form-control,
|
|
521
|
+
form.scrollable .content > .group-title {
|
|
522
|
+
max-width: 775px;
|
|
523
|
+
width: 95%;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.header,
|
|
527
|
+
.footer {
|
|
528
|
+
display: flex;
|
|
529
|
+
box-sizing: border-box;
|
|
530
|
+
min-height: 45px;
|
|
531
|
+
--gv-icon--s: 26px;
|
|
532
|
+
--gv-icon--c: #bfbfbf;
|
|
533
|
+
align-items: center;
|
|
534
|
+
padding: 0 0.5rem;
|
|
535
|
+
position: relative;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.header {
|
|
539
|
+
border-bottom: 1px solid #d9d9d9;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.footer {
|
|
543
|
+
display: flex;
|
|
544
|
+
justify-content: space-between;
|
|
545
|
+
padding: 1rem;
|
|
546
|
+
border-top: 1px solid #d9d9d9;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
form.scrollable .footer {
|
|
550
|
+
justify-content: center;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.footer .left,
|
|
554
|
+
.footer .right {
|
|
555
|
+
max-width: 400px;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.header .left,
|
|
559
|
+
.footer .left,
|
|
560
|
+
.header .right,
|
|
561
|
+
.footer .right {
|
|
562
|
+
display: flex;
|
|
563
|
+
flex: 1;
|
|
564
|
+
z-index: 10;
|
|
565
|
+
align-items: center;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.header .right,
|
|
569
|
+
.footer .right {
|
|
570
|
+
justify-content: flex-end;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.header .title {
|
|
574
|
+
color: #28444f;
|
|
575
|
+
font-size: 18px;
|
|
576
|
+
display: flex;
|
|
577
|
+
width: 100%;
|
|
578
|
+
align-items: center;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.header .title.center {
|
|
582
|
+
position: absolute;
|
|
583
|
+
top: 0;
|
|
584
|
+
left: 0;
|
|
585
|
+
bottom: 0;
|
|
586
|
+
justify-content: center;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.confirm-box {
|
|
590
|
+
height: 100%;
|
|
591
|
+
padding: 1rem;
|
|
592
|
+
font-style: italic;
|
|
593
|
+
display: flex;
|
|
594
|
+
flex-direction: column;
|
|
595
|
+
|
|
596
|
+
justify-content: center;
|
|
597
|
+
align-items: center;
|
|
598
|
+
text-align: center;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.confirm-box_actions {
|
|
602
|
+
padding: 1rem 0;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.confirm .header .left,
|
|
606
|
+
.confirm .header .right,
|
|
607
|
+
.confirm .footer .left,
|
|
608
|
+
.confirm .footer .right {
|
|
609
|
+
display: none;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.group-title {
|
|
613
|
+
align-self: center;
|
|
614
|
+
width: 100%;
|
|
615
|
+
color: var(--gv-theme-font-color-dark);
|
|
616
|
+
font-size: 21px;
|
|
617
|
+
font-weight: 600;
|
|
618
|
+
padding-bottom: 0.3em;
|
|
619
|
+
border-bottom: 1px solid var(--gv-theme-font-color-dark);
|
|
620
|
+
margin-top: 24px;
|
|
621
|
+
margin-bottom: 16px;
|
|
622
|
+
}
|
|
623
|
+
`,
|
|
624
|
+
];
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
window.customElements.define('gv-schema-form-group', GvSchemaFormGroup);
|
|
628
|
+
//# sourceMappingURL=gv-schema-form-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gv-schema-form-group.js","sourceRoot":"","sources":["../../../../src/organisms/gv-schema-form-group/gv-schema-form-group.js"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,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