ngx-wapp-components 3.4.1 → 3.4.3-alpha.1
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/fesm2022/ngx-wapp-components-schema-form.mjs +631 -0
- package/fesm2022/ngx-wapp-components-schema-form.mjs.map +1 -0
- package/fesm2022/ngx-wapp-components.mjs +389 -195
- package/fesm2022/ngx-wapp-components.mjs.map +1 -1
- package/package.json +20 -2
- package/schema-form/README.md +50 -0
- package/types/ngx-wapp-components-schema-form.d.ts +146 -0
- package/types/ngx-wapp-components.d.ts +307 -270
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, Component, NgModule, EventEmitter, Output, Input } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, ReactiveFormsModule, FormGroup } from '@angular/forms';
|
|
5
|
+
import * as i1$1 from '@ngx-formly/core';
|
|
6
|
+
import { FieldType, FieldWrapper, FormlyModule } from '@ngx-formly/core';
|
|
7
|
+
import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
|
|
8
|
+
import { FormlyPrimeNGModule } from '@ngx-formly/primeng';
|
|
9
|
+
import Ajv from 'ajv';
|
|
10
|
+
import Ajv2020 from 'ajv/dist/2020';
|
|
11
|
+
import { Subscription } from 'rxjs';
|
|
12
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
|
+
import * as i3 from 'primeng/button';
|
|
14
|
+
import { ButtonModule } from 'primeng/button';
|
|
15
|
+
import * as i2 from 'primeng/inputtext';
|
|
16
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
17
|
+
import * as i2$1 from 'primeng/tooltip';
|
|
18
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
19
|
+
|
|
20
|
+
/** Default Spanish texts. Frozen: consumers must pass their own object instead of mutating this one. */
|
|
21
|
+
const W_SCHEMA_FORM_DEFAULT_TRANSLATIONS = Object.freeze({
|
|
22
|
+
configurationError: 'No se puede mostrar el formulario: la configuración o el esquema no son válidos.',
|
|
23
|
+
invalidValues: 'Revisa los valores marcados antes de guardar.',
|
|
24
|
+
secretConfigured: 'Configurado',
|
|
25
|
+
secretPending: 'Pendiente',
|
|
26
|
+
secretReplaceHint: 'Déjalo vacío para conservar el valor actual o escribe uno nuevo para sustituirlo.',
|
|
27
|
+
showSecret: 'Mostrar valor',
|
|
28
|
+
hideSecret: 'Ocultar valor'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** Formly type name of the secret field (internal to `w-schema-form`). */
|
|
32
|
+
const W_SCHEMA_FORM_SECRET_FIELD_TYPE = 'w-schema-form-secret';
|
|
33
|
+
/**
|
|
34
|
+
* Password entry for `writeOnly` + `x-wapping-secret` fields (SF-006, SF-008). It starts empty,
|
|
35
|
+
* never receives a stored value and uses `autocomplete="new-password"` (SFC-D06).
|
|
36
|
+
*/
|
|
37
|
+
class WSchemaFormSecretFieldComponent extends FieldType {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.destroyRef = inject(DestroyRef);
|
|
41
|
+
this.control = new FormControl('', { nonNullable: true });
|
|
42
|
+
this.statusText = '';
|
|
43
|
+
this.visible = false;
|
|
44
|
+
this.inputType = 'password';
|
|
45
|
+
this.toggleLabel = '';
|
|
46
|
+
}
|
|
47
|
+
get statusId() {
|
|
48
|
+
return `${this.id}-status`;
|
|
49
|
+
}
|
|
50
|
+
get hintId() {
|
|
51
|
+
return `${this.id}-hint`;
|
|
52
|
+
}
|
|
53
|
+
get describedBy() {
|
|
54
|
+
return this.hint ? `${this.statusId} ${this.hintId}` : this.statusId;
|
|
55
|
+
}
|
|
56
|
+
ngOnInit() {
|
|
57
|
+
this.control = this.props.secretControl;
|
|
58
|
+
this.statusText = this.props.secretStatusText;
|
|
59
|
+
this.hint = this.props.secretHint;
|
|
60
|
+
this.applyVisibility(false);
|
|
61
|
+
// When `w-schema-form` discards the typed value (submit, input change, destroy) the entry hides again.
|
|
62
|
+
this.control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(value => {
|
|
63
|
+
if (value === '' && this.visible) {
|
|
64
|
+
this.applyVisibility(false);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
toggleVisibility() {
|
|
69
|
+
this.applyVisibility(!this.visible);
|
|
70
|
+
}
|
|
71
|
+
applyVisibility(visible) {
|
|
72
|
+
this.visible = visible;
|
|
73
|
+
this.inputType = visible ? 'text' : 'password';
|
|
74
|
+
this.toggleLabel = visible ? this.props.hideSecretLabel : this.props.showSecretLabel;
|
|
75
|
+
}
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormSecretFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: WSchemaFormSecretFieldComponent, isStandalone: true, selector: "w-schema-form-secret-field", usesInheritance: true, ngImport: i0, template: "<div class=\"w-schema-form-secret\">\r\n <div class=\"w-schema-form-secret__entry\">\r\n <input\r\n pInputText\r\n class=\"w-schema-form-secret__input\"\r\n [id]=\"id\"\r\n [type]=\"inputType\"\r\n autocomplete=\"new-password\"\r\n spellcheck=\"false\"\r\n [formControl]=\"control\"\r\n [attr.aria-describedby]=\"describedBy\" />\r\n <button\r\n type=\"button\"\r\n pButton\r\n [text]=\"true\"\r\n class=\"w-schema-form-secret__toggle\"\r\n [attr.aria-label]=\"toggleLabel\"\r\n [attr.aria-pressed]=\"visible\"\r\n [attr.aria-controls]=\"id\"\r\n (click)=\"toggleVisibility()\">\r\n <i pButtonIcon class=\"pi\" [class.pi-eye]=\"!visible\" [class.pi-eye-slash]=\"visible\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <small [id]=\"statusId\" class=\"w-schema-form-secret__status\">{{ statusText }}</small>\r\n @if (hint) {\r\n <small [id]=\"hintId\" class=\"w-schema-form-secret__hint\">{{ hint }}</small>\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-schema-form-secret__hint,.w-schema-form-secret__status,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form-secret{display:flex;flex-direction:column;gap:4px}.w-schema-form-secret__entry{display:flex;align-items:center;gap:8px}.w-schema-form-secret__input{flex:1 1 auto;min-width:0}.w-schema-form-secret__status{color:#1f2224;font-weight:600}.w-schema-form-secret__hint{color:#5f6468}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i3.ButtonIcon, selector: "[pButtonIcon]", inputs: ["ptButtonIcon", "pButtonIconPT", "pButtonUnstyled"] }] }); }
|
|
78
|
+
}
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormSecretFieldComponent, decorators: [{
|
|
80
|
+
type: Component,
|
|
81
|
+
args: [{ selector: 'w-schema-form-secret-field', standalone: true, imports: [ReactiveFormsModule, InputTextModule, ButtonModule], template: "<div class=\"w-schema-form-secret\">\r\n <div class=\"w-schema-form-secret__entry\">\r\n <input\r\n pInputText\r\n class=\"w-schema-form-secret__input\"\r\n [id]=\"id\"\r\n [type]=\"inputType\"\r\n autocomplete=\"new-password\"\r\n spellcheck=\"false\"\r\n [formControl]=\"control\"\r\n [attr.aria-describedby]=\"describedBy\" />\r\n <button\r\n type=\"button\"\r\n pButton\r\n [text]=\"true\"\r\n class=\"w-schema-form-secret__toggle\"\r\n [attr.aria-label]=\"toggleLabel\"\r\n [attr.aria-pressed]=\"visible\"\r\n [attr.aria-controls]=\"id\"\r\n (click)=\"toggleVisibility()\">\r\n <i pButtonIcon class=\"pi\" [class.pi-eye]=\"!visible\" [class.pi-eye-slash]=\"visible\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <small [id]=\"statusId\" class=\"w-schema-form-secret__status\">{{ statusText }}</small>\r\n @if (hint) {\r\n <small [id]=\"hintId\" class=\"w-schema-form-secret__hint\">{{ hint }}</small>\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-schema-form-secret__hint,.w-schema-form-secret__status,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form-secret{display:flex;flex-direction:column;gap:4px}.w-schema-form-secret__entry{display:flex;align-items:center;gap:8px}.w-schema-form-secret__input{flex:1 1 auto;min-width:0}.w-schema-form-secret__status{color:#1f2224;font-weight:600}.w-schema-form-secret__hint{color:#5f6468}\n"] }]
|
|
82
|
+
}] });
|
|
83
|
+
|
|
84
|
+
const DRAFT_07_URI = 'http://json-schema.org/draft-07/schema#';
|
|
85
|
+
const DRAFT_2020_12_URI = 'https://json-schema.org/draft/2020-12/schema';
|
|
86
|
+
const SECRET_KEYWORD = 'x-wapping-secret';
|
|
87
|
+
/** Internal Formly prop carrying the JSON Pointer of a property field. */
|
|
88
|
+
const POINTER_PROP = 'wSchemaFormPointer';
|
|
89
|
+
const ALLOWED_KEYWORDS = new Set([
|
|
90
|
+
'$schema', '$id', '$comment', 'title', 'description', 'type', 'properties', 'required',
|
|
91
|
+
'additionalProperties', 'enum', 'const', 'default', 'minimum', 'maximum', 'minLength',
|
|
92
|
+
'maxLength', 'pattern', 'items', 'uniqueItems', '$ref', '$defs', 'definitions', 'readOnly',
|
|
93
|
+
'writeOnly', SECRET_KEYWORD
|
|
94
|
+
]);
|
|
95
|
+
const SUPPORTED_TYPES = new Set(['object', 'string', 'number', 'integer', 'boolean', 'array']);
|
|
96
|
+
const LOCAL_REFERENCE = /^#\/(\$defs|definitions)\/[^/]+$/;
|
|
97
|
+
/** Configuration problem of the schema or of the inputs. Messages never contain values. */
|
|
98
|
+
class SchemaFormConfigurationError extends Error {
|
|
99
|
+
}
|
|
100
|
+
function isRecord(value) {
|
|
101
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
102
|
+
}
|
|
103
|
+
function escapePointerSegment(segment) {
|
|
104
|
+
return segment.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
105
|
+
}
|
|
106
|
+
function pointerSegments(pointer) {
|
|
107
|
+
return pointer.split('/').slice(1).map(segment => segment.replace(/~1/g, '/').replace(/~0/g, '~'));
|
|
108
|
+
}
|
|
109
|
+
/** SF-003: the declared `$schema` and the `dialect` input must agree; without both, draft-07 (SFC-D05). */
|
|
110
|
+
function resolveDialect(schema, dialect) {
|
|
111
|
+
if (dialect !== undefined && dialect !== 'draft-07' && dialect !== '2020-12') {
|
|
112
|
+
throw new SchemaFormConfigurationError('Unsupported dialect input.');
|
|
113
|
+
}
|
|
114
|
+
let declared;
|
|
115
|
+
if (schema.$schema !== undefined) {
|
|
116
|
+
if (schema.$schema === DRAFT_07_URI) {
|
|
117
|
+
declared = 'draft-07';
|
|
118
|
+
}
|
|
119
|
+
else if (schema.$schema === DRAFT_2020_12_URI) {
|
|
120
|
+
declared = '2020-12';
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
throw new SchemaFormConfigurationError('Unsupported JSON Schema dialect declared in $schema.');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (dialect !== undefined && declared !== undefined && dialect !== declared) {
|
|
127
|
+
throw new SchemaFormConfigurationError('The dialect input does not match the $schema declared by the schema.');
|
|
128
|
+
}
|
|
129
|
+
return declared ?? dialect ?? 'draft-07';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* SF-004/SF-005/SF-006: checks the closed list of constructions and returns the JSON Pointers of the
|
|
133
|
+
* secret fields (string + writeOnly + x-wapping-secret, only along the `properties` chain).
|
|
134
|
+
*/
|
|
135
|
+
function inspectSchema(schema) {
|
|
136
|
+
if (schema.type !== 'object') {
|
|
137
|
+
throw new SchemaFormConfigurationError('The schema root must be an object schema.');
|
|
138
|
+
}
|
|
139
|
+
const secrets = [];
|
|
140
|
+
visit(schema, '#', '', secrets);
|
|
141
|
+
return secrets;
|
|
142
|
+
}
|
|
143
|
+
function visit(node, at, instancePath, secrets) {
|
|
144
|
+
if (!isRecord(node)) {
|
|
145
|
+
throw new SchemaFormConfigurationError(`The schema at ${at} must be an object.`);
|
|
146
|
+
}
|
|
147
|
+
for (const keyword of Object.keys(node)) {
|
|
148
|
+
if (!ALLOWED_KEYWORDS.has(keyword)) {
|
|
149
|
+
throw new SchemaFormConfigurationError(`Unsupported keyword "${keyword}" at ${at}.`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const type = node['type'];
|
|
153
|
+
if (type !== undefined && (typeof type !== 'string' || !SUPPORTED_TYPES.has(type))) {
|
|
154
|
+
throw new SchemaFormConfigurationError(`Unsupported type at ${at}; a single supported type is required.`);
|
|
155
|
+
}
|
|
156
|
+
if ('additionalProperties' in node && node['additionalProperties'] !== false) {
|
|
157
|
+
throw new SchemaFormConfigurationError(`Only additionalProperties false is supported at ${at}.`);
|
|
158
|
+
}
|
|
159
|
+
if ('$ref' in node) {
|
|
160
|
+
const reference = node['$ref'];
|
|
161
|
+
if (typeof reference !== 'string' || !LOCAL_REFERENCE.test(reference)) {
|
|
162
|
+
throw new SchemaFormConfigurationError(`Only local references to $defs or definitions are supported at ${at}.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (type === 'array' || 'items' in node || 'uniqueItems' in node) {
|
|
166
|
+
const items = node['items'];
|
|
167
|
+
if (type !== 'array' || node['uniqueItems'] !== true || !isRecord(items) || !Array.isArray(items['enum'])) {
|
|
168
|
+
throw new SchemaFormConfigurationError(`Arrays are supported only with uniqueItems and an items enum at ${at}.`);
|
|
169
|
+
}
|
|
170
|
+
visit(items, `${at}/items`, null, secrets);
|
|
171
|
+
}
|
|
172
|
+
if ('properties' in node) {
|
|
173
|
+
const properties = node['properties'];
|
|
174
|
+
if (!isRecord(properties)) {
|
|
175
|
+
throw new SchemaFormConfigurationError(`properties must be an object at ${at}.`);
|
|
176
|
+
}
|
|
177
|
+
for (const [name, child] of Object.entries(properties)) {
|
|
178
|
+
const segment = escapePointerSegment(name);
|
|
179
|
+
visit(child, `${at}/properties/${segment}`, instancePath === null ? null : `${instancePath}/${segment}`, secrets);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
for (const definitionsKeyword of ['$defs', 'definitions']) {
|
|
183
|
+
if (definitionsKeyword in node) {
|
|
184
|
+
const definitions = node[definitionsKeyword];
|
|
185
|
+
if (!isRecord(definitions)) {
|
|
186
|
+
throw new SchemaFormConfigurationError(`${definitionsKeyword} must be an object at ${at}.`);
|
|
187
|
+
}
|
|
188
|
+
for (const [name, child] of Object.entries(definitions)) {
|
|
189
|
+
visit(child, `${at}/${definitionsKeyword}/${escapePointerSegment(name)}`, null, secrets);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (SECRET_KEYWORD in node) {
|
|
194
|
+
if (!isRecord(node[SECRET_KEYWORD]) || type !== 'string' || node['writeOnly'] !== true ||
|
|
195
|
+
instancePath === null || instancePath === '') {
|
|
196
|
+
throw new SchemaFormConfigurationError(`${SECRET_KEYWORD} requires a string property with writeOnly true outside arrays and definitions at ${at}.`);
|
|
197
|
+
}
|
|
198
|
+
secrets.push(instancePath);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Reads the property schema at a JSON Pointer following only `properties`. */
|
|
202
|
+
function readPropertySchema(schema, pointer) {
|
|
203
|
+
let current = schema;
|
|
204
|
+
for (const segment of pointerSegments(pointer)) {
|
|
205
|
+
const next = current.properties?.[segment];
|
|
206
|
+
if (!next) {
|
|
207
|
+
throw new SchemaFormConfigurationError('A secret path does not exist in the schema.');
|
|
208
|
+
}
|
|
209
|
+
current = next;
|
|
210
|
+
}
|
|
211
|
+
return current;
|
|
212
|
+
}
|
|
213
|
+
/** Public schema: secret properties and their `required` entries removed (design, Secretos). */
|
|
214
|
+
function buildPublicSchema(schema, secretPaths) {
|
|
215
|
+
const copy = structuredClone(schema);
|
|
216
|
+
for (const path of secretPaths) {
|
|
217
|
+
const segments = pointerSegments(path);
|
|
218
|
+
const name = segments.pop();
|
|
219
|
+
const parent = readPropertySchema(copy, segments.map(s => `/${escapePointerSegment(s)}`).join(''));
|
|
220
|
+
if (parent.properties) {
|
|
221
|
+
delete parent.properties[name];
|
|
222
|
+
}
|
|
223
|
+
if (parent.required) {
|
|
224
|
+
parent.required = parent.required.filter(required => required !== name);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return copy;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Copy for Formly where each property carries its JSON Pointer (labels by pointer and secrets). Properties that
|
|
231
|
+
* reference a local object definition (`$ref` to `$defs`/`definitions` with `properties`) are expanded per use
|
|
232
|
+
* site, so the nested fields get the pointer of the instance they edit (SF-004, SFC-D07). Validation keeps using
|
|
233
|
+
* the original schema; this copy is only rendered.
|
|
234
|
+
*/
|
|
235
|
+
function annotatePointers(schema) {
|
|
236
|
+
const copy = structuredClone(schema);
|
|
237
|
+
annotate(copy, '', schema, []);
|
|
238
|
+
return copy;
|
|
239
|
+
}
|
|
240
|
+
function annotate(node, pointer, root, expanding) {
|
|
241
|
+
const properties = node.properties ?? {};
|
|
242
|
+
for (const name of Object.keys(properties)) {
|
|
243
|
+
const childPointer = `${pointer}/${escapePointerSegment(name)}`;
|
|
244
|
+
let child = properties[name];
|
|
245
|
+
let chain = expanding;
|
|
246
|
+
const reference = child.$ref;
|
|
247
|
+
if (typeof reference === 'string') {
|
|
248
|
+
const target = resolveLocalReference(root, reference);
|
|
249
|
+
if (isRecord(target) && isRecord(target['properties'])) {
|
|
250
|
+
if (expanding.includes(reference)) {
|
|
251
|
+
throw new SchemaFormConfigurationError(`Recursive local reference ${reference} is not supported.`);
|
|
252
|
+
}
|
|
253
|
+
const { $ref: _reference, ...siblings } = child;
|
|
254
|
+
child = { ...structuredClone(target), ...siblings };
|
|
255
|
+
properties[name] = child;
|
|
256
|
+
chain = [...expanding, reference];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
child['widget'] = { formlyConfig: { props: { [POINTER_PROP]: childPointer } } };
|
|
260
|
+
annotate(child, childPointer, root, chain);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function resolveLocalReference(root, reference) {
|
|
264
|
+
const match = LOCAL_REFERENCE.exec(reference);
|
|
265
|
+
if (!match) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
const definitions = root[match[1]];
|
|
269
|
+
const name = pointerSegments(reference).pop();
|
|
270
|
+
return isRecord(definitions) ? definitions[name] : undefined;
|
|
271
|
+
}
|
|
272
|
+
/** True when the values contain an own property at the JSON Pointer (any value, including null). */
|
|
273
|
+
function hasValueAt(values, pointer) {
|
|
274
|
+
let current = values;
|
|
275
|
+
for (const segment of pointerSegments(pointer)) {
|
|
276
|
+
if (!isRecord(current) || !Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
current = current[segment];
|
|
280
|
+
}
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Formly wrapper name used by every leaf field of `w-schema-form` (internal). */
|
|
285
|
+
const W_SCHEMA_FORM_FIELD_WRAPPER = 'w-schema-form-field';
|
|
286
|
+
/**
|
|
287
|
+
* Label, required marker, validation message and `description` as a help tooltip. It follows the help icon +
|
|
288
|
+
* PrimeNG `pTooltip` pattern of the library `w-input-label` (which lives in the primary entry point and is not
|
|
289
|
+
* standalone, so it cannot be imported here without coupling the entry points).
|
|
290
|
+
*/
|
|
291
|
+
class WSchemaFormFieldWrapperComponent extends FieldWrapper {
|
|
292
|
+
get showLabel() {
|
|
293
|
+
return !!this.props.label && this.props['hideLabel'] !== true;
|
|
294
|
+
}
|
|
295
|
+
get helpId() {
|
|
296
|
+
return `${this.id}-help`;
|
|
297
|
+
}
|
|
298
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
299
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: WSchemaFormFieldWrapperComponent, isStandalone: true, selector: "w-schema-form-field-wrapper", usesInheritance: true, ngImport: i0, template: "<div class=\"w-schema-form-field\">\r\n @if (showLabel || props.description) {\r\n <div class=\"w-schema-form-field__label\">\r\n @if (showLabel) {\r\n <label class=\"w-schema-form-field__label-text\" [for]=\"id\">\r\n {{ props.label }}\r\n @if (props.required && props['hideRequiredMarker'] !== true) {\r\n <span class=\"w-schema-form-field__required\" aria-hidden=\"true\">*</span>\r\n }\r\n </label>\r\n }\r\n @if (props.description) {\r\n <span\r\n class=\"w-schema-form-field__help\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [id]=\"helpId\"\r\n [attr.aria-label]=\"props.description\"\r\n [pTooltip]=\"props.description\"\r\n tooltipPosition=\"right\"\r\n tooltipEvent=\"both\">\r\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M6 0C2.7 0 0 2.7 0 6C0 9.3 2.7 12 6 12C9.3 12 12 9.3 12 6C12 2.7 9.3 0 6 0ZM6 9.75C5.586 9.75 5.25 9.414 5.25 9C5.25 8.586 5.586 8.25 6 8.25C6.414 8.25 6.75 8.586 6.75 9C6.75 9.414 6.414 9.75 6 9.75ZM7.21725 6.069C6.8445 6.38925 6.75 6.49725 6.75 6.75C6.75 7.16475 6.414 7.5 6 7.5C5.586 7.5 5.25 7.16475 5.25 6.75C5.25 5.7795 5.84625 5.268 6.2415 4.92975C6.61425 4.611 6.70875 4.50225 6.70875 4.25025C6.70875 4.113 6.70875 3.75 6.00075 3.75C5.67375 3.768 5.325 3.918 5.05725 4.17075C4.7565 4.45425 4.281 4.44 3.99675 4.14C3.7125 3.8385 3.726 3.36375 4.0275 3.0795C4.554 2.58375 5.24025 2.289 5.96175 2.2515H5.964C7.323 2.2515 8.20875 3.05475 8.20875 4.251C8.20875 5.22075 7.6125 5.73225 7.218 6.06975L7.21725 6.069Z\" />\r\n </svg>\r\n </span>\r\n }\r\n </div>\r\n }\r\n <ng-container #fieldComponent></ng-container>\r\n @if (showError) {\r\n <small class=\"w-schema-form-field__error\">\r\n <formly-validation-message [field]=\"field\"></formly-validation-message>\r\n </small>\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-schema-form-field__label-text,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-schema-form-field__error,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-schema-form-field__label-text,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form-field{display:flex;flex-direction:column;gap:4px}.w-schema-form-field__label{display:flex;align-items:center;gap:6px}.w-schema-form-field__label-text{color:#1f2224}.w-schema-form-field__required{color:#e50000}.w-schema-form-field__help{display:inline-flex;align-items:center;cursor:help}.w-schema-form-field__help path{fill:#9aa0a7}.w-schema-form-field__help:hover path,.w-schema-form-field__help:focus-visible path{fill:#00b3eb}.w-schema-form-field__error{color:#e50000}\n"], dependencies: [{ kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$1.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] }); }
|
|
300
|
+
}
|
|
301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldWrapperComponent, decorators: [{
|
|
302
|
+
type: Component,
|
|
303
|
+
args: [{ selector: 'w-schema-form-field-wrapper', standalone: true, imports: [FormlyModule, TooltipModule], template: "<div class=\"w-schema-form-field\">\r\n @if (showLabel || props.description) {\r\n <div class=\"w-schema-form-field__label\">\r\n @if (showLabel) {\r\n <label class=\"w-schema-form-field__label-text\" [for]=\"id\">\r\n {{ props.label }}\r\n @if (props.required && props['hideRequiredMarker'] !== true) {\r\n <span class=\"w-schema-form-field__required\" aria-hidden=\"true\">*</span>\r\n }\r\n </label>\r\n }\r\n @if (props.description) {\r\n <span\r\n class=\"w-schema-form-field__help\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [id]=\"helpId\"\r\n [attr.aria-label]=\"props.description\"\r\n [pTooltip]=\"props.description\"\r\n tooltipPosition=\"right\"\r\n tooltipEvent=\"both\">\r\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M6 0C2.7 0 0 2.7 0 6C0 9.3 2.7 12 6 12C9.3 12 12 9.3 12 6C12 2.7 9.3 0 6 0ZM6 9.75C5.586 9.75 5.25 9.414 5.25 9C5.25 8.586 5.586 8.25 6 8.25C6.414 8.25 6.75 8.586 6.75 9C6.75 9.414 6.414 9.75 6 9.75ZM7.21725 6.069C6.8445 6.38925 6.75 6.49725 6.75 6.75C6.75 7.16475 6.414 7.5 6 7.5C5.586 7.5 5.25 7.16475 5.25 6.75C5.25 5.7795 5.84625 5.268 6.2415 4.92975C6.61425 4.611 6.70875 4.50225 6.70875 4.25025C6.70875 4.113 6.70875 3.75 6.00075 3.75C5.67375 3.768 5.325 3.918 5.05725 4.17075C4.7565 4.45425 4.281 4.44 3.99675 4.14C3.7125 3.8385 3.726 3.36375 4.0275 3.0795C4.554 2.58375 5.24025 2.289 5.96175 2.2515H5.964C7.323 2.2515 8.20875 3.05475 8.20875 4.251C8.20875 5.22075 7.6125 5.73225 7.218 6.06975L7.21725 6.069Z\" />\r\n </svg>\r\n </span>\r\n }\r\n </div>\r\n }\r\n <ng-container #fieldComponent></ng-container>\r\n @if (showError) {\r\n <small class=\"w-schema-form-field__error\">\r\n <formly-validation-message [field]=\"field\"></formly-validation-message>\r\n </small>\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-schema-form-field__label-text,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-schema-form-field__error,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-schema-form-field__label-text,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form-field{display:flex;flex-direction:column;gap:4px}.w-schema-form-field__label{display:flex;align-items:center;gap:6px}.w-schema-form-field__label-text{color:#1f2224}.w-schema-form-field__required{color:#e50000}.w-schema-form-field__help{display:inline-flex;align-items:center;cursor:help}.w-schema-form-field__help path{fill:#9aa0a7}.w-schema-form-field__help:hover path,.w-schema-form-field__help:focus-visible path{fill:#00b3eb}.w-schema-form-field__error{color:#e50000}\n"] }]
|
|
304
|
+
}] });
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Registers the internal secret field type and field wrapper with the same mechanism used by
|
|
308
|
+
* @ngx-formly/primeng (`FormlyModule.forChild`). Formly adds them to the root `FormlyConfig` of the consumer
|
|
309
|
+
* application (see the entry point README); the names are prefixed to avoid collisions.
|
|
310
|
+
*/
|
|
311
|
+
class WSchemaFormFieldTypesModule {
|
|
312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldTypesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
313
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldTypesModule, imports: [WSchemaFormSecretFieldComponent,
|
|
314
|
+
WSchemaFormFieldWrapperComponent, i1$1.FormlyModule] }); }
|
|
315
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldTypesModule, imports: [WSchemaFormSecretFieldComponent,
|
|
316
|
+
WSchemaFormFieldWrapperComponent,
|
|
317
|
+
FormlyModule.forChild({
|
|
318
|
+
wrappers: [{ name: W_SCHEMA_FORM_FIELD_WRAPPER, component: WSchemaFormFieldWrapperComponent }],
|
|
319
|
+
types: [
|
|
320
|
+
{
|
|
321
|
+
name: W_SCHEMA_FORM_SECRET_FIELD_TYPE,
|
|
322
|
+
component: WSchemaFormSecretFieldComponent,
|
|
323
|
+
wrappers: [W_SCHEMA_FORM_FIELD_WRAPPER]
|
|
324
|
+
}
|
|
325
|
+
]
|
|
326
|
+
})] }); }
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormFieldTypesModule, decorators: [{
|
|
329
|
+
type: NgModule,
|
|
330
|
+
args: [{
|
|
331
|
+
imports: [
|
|
332
|
+
WSchemaFormSecretFieldComponent,
|
|
333
|
+
WSchemaFormFieldWrapperComponent,
|
|
334
|
+
FormlyModule.forChild({
|
|
335
|
+
wrappers: [{ name: W_SCHEMA_FORM_FIELD_WRAPPER, component: WSchemaFormFieldWrapperComponent }],
|
|
336
|
+
types: [
|
|
337
|
+
{
|
|
338
|
+
name: W_SCHEMA_FORM_SECRET_FIELD_TYPE,
|
|
339
|
+
component: WSchemaFormSecretFieldComponent,
|
|
340
|
+
wrappers: [W_SCHEMA_FORM_FIELD_WRAPPER]
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
}]
|
|
346
|
+
}] });
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* JSON Schema form (CM-007). Emits the public configuration and the secret replacements separately and
|
|
350
|
+
* never preloads, stores or reports secret values (SF-001..SF-009).
|
|
351
|
+
*/
|
|
352
|
+
class WSchemaFormComponent {
|
|
353
|
+
constructor() {
|
|
354
|
+
this.schema = null;
|
|
355
|
+
this.values = null;
|
|
356
|
+
this.secretStates = [];
|
|
357
|
+
this.translations = W_SCHEMA_FORM_DEFAULT_TRANSLATIONS;
|
|
358
|
+
this.stateChange = new EventEmitter();
|
|
359
|
+
this.validSubmit = new EventEmitter();
|
|
360
|
+
// Internal rendering state: consumers observe `stateChange` and `validSubmit` only.
|
|
361
|
+
this.form = new FormGroup({});
|
|
362
|
+
this.fields = [];
|
|
363
|
+
this.model = {};
|
|
364
|
+
this.state = { status: 'error', errors: [], secrets: [] };
|
|
365
|
+
/** Consumer translations merged over the defaults (a null or partial input never breaks the template). */
|
|
366
|
+
this.texts = W_SCHEMA_FORM_DEFAULT_TRANSLATIONS;
|
|
367
|
+
this.formlyJsonschema = inject(FormlyJsonschema);
|
|
368
|
+
this.secrets = [];
|
|
369
|
+
this.secretSubscriptions = new Subscription();
|
|
370
|
+
}
|
|
371
|
+
ngOnChanges() {
|
|
372
|
+
this.reset();
|
|
373
|
+
this.texts = { ...W_SCHEMA_FORM_DEFAULT_TRANSLATIONS, ...(this.translations ?? {}) };
|
|
374
|
+
const secretStates = this.secretStates ?? [];
|
|
375
|
+
if (!this.schema || this.schema.type !== 'object' ||
|
|
376
|
+
!this.values || typeof this.values !== 'object' || Array.isArray(this.values)) {
|
|
377
|
+
this.fail('An object schema and explicit object values are required.');
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
try {
|
|
381
|
+
const schema = structuredClone(this.schema);
|
|
382
|
+
const dialect = resolveDialect(schema, this.dialect);
|
|
383
|
+
const secretPaths = inspectSchema(schema);
|
|
384
|
+
this.assertSecretInputs(secretPaths, this.values, secretStates);
|
|
385
|
+
const ajv = createAjv(dialect);
|
|
386
|
+
this.validator = ajv.compile(buildPublicSchema(schema, secretPaths));
|
|
387
|
+
this.secrets = secretPaths.map(path => ({
|
|
388
|
+
path,
|
|
389
|
+
hasValue: secretStates.some(state => state.path === path && state.hasValue === true),
|
|
390
|
+
control: new FormControl('', { nonNullable: true }),
|
|
391
|
+
validator: ajv.compile(structuredClone(readPropertySchema(schema, path)))
|
|
392
|
+
}));
|
|
393
|
+
this.model = structuredClone(this.values);
|
|
394
|
+
const root = this.formlyJsonschema.toFieldConfig(annotatePointers(schema), {
|
|
395
|
+
ignoreImplicitStringDefaults: true,
|
|
396
|
+
map: (field, source) => this.mapField(field, source)
|
|
397
|
+
});
|
|
398
|
+
this.fields = root.fieldGroup ?? [];
|
|
399
|
+
}
|
|
400
|
+
catch (error) {
|
|
401
|
+
this.reset();
|
|
402
|
+
this.fail(error instanceof Error ? error.message : 'The schema could not be prepared.');
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
for (const secret of this.secrets) {
|
|
406
|
+
this.secretSubscriptions.add(secret.control.valueChanges.subscribe(() => this.validate()));
|
|
407
|
+
}
|
|
408
|
+
this.validate();
|
|
409
|
+
}
|
|
410
|
+
ngOnDestroy() {
|
|
411
|
+
this.reset();
|
|
412
|
+
}
|
|
413
|
+
onModelChange(model) {
|
|
414
|
+
this.model = model;
|
|
415
|
+
this.validate();
|
|
416
|
+
}
|
|
417
|
+
submit() {
|
|
418
|
+
this.form.markAllAsTouched();
|
|
419
|
+
this.validate();
|
|
420
|
+
if (this.state.status !== 'valid') {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const submission = {
|
|
424
|
+
configuration: structuredClone(this.model),
|
|
425
|
+
secrets: this.secrets
|
|
426
|
+
.filter(secret => secret.control.value !== '')
|
|
427
|
+
.map(secret => ({ path: secret.path, value: secret.control.value }))
|
|
428
|
+
};
|
|
429
|
+
// SFC-D06: the typed secret leaves the component memory as soon as it is emitted.
|
|
430
|
+
for (const secret of this.secrets) {
|
|
431
|
+
secret.control.reset('');
|
|
432
|
+
}
|
|
433
|
+
this.validSubmit.emit(submission);
|
|
434
|
+
}
|
|
435
|
+
validate() {
|
|
436
|
+
if (!this.validator) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const configurationValid = this.validator(this.model);
|
|
440
|
+
const errors = (this.validator.errors ?? []).map(error => toDiagnostic(error, ''));
|
|
441
|
+
let secretsValid = true;
|
|
442
|
+
for (const secret of this.secrets) {
|
|
443
|
+
if (secret.control.value !== '' && !secret.validator(secret.control.value)) {
|
|
444
|
+
secretsValid = false;
|
|
445
|
+
errors.push(...(secret.validator.errors ?? []).map(error => toDiagnostic(error, secret.path)));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
this.state = {
|
|
449
|
+
status: configurationValid && secretsValid && this.form.valid && !this.form.pending ? 'valid' : 'invalid',
|
|
450
|
+
errors,
|
|
451
|
+
secrets: this.secrets.map(secret => ({
|
|
452
|
+
path: secret.path,
|
|
453
|
+
hasValue: secret.hasValue,
|
|
454
|
+
replacementPending: secret.control.value !== ''
|
|
455
|
+
}))
|
|
456
|
+
};
|
|
457
|
+
this.stateChange.emit(this.state);
|
|
458
|
+
}
|
|
459
|
+
fail(message) {
|
|
460
|
+
this.state = {
|
|
461
|
+
status: 'error',
|
|
462
|
+
errors: [{ instancePath: '', keyword: 'configuration', message }],
|
|
463
|
+
secrets: []
|
|
464
|
+
};
|
|
465
|
+
this.stateChange.emit(this.state);
|
|
466
|
+
}
|
|
467
|
+
/** Discards controls, validators and typed secret values (SF-003, SF-008). */
|
|
468
|
+
reset() {
|
|
469
|
+
this.secretSubscriptions.unsubscribe();
|
|
470
|
+
this.secretSubscriptions = new Subscription();
|
|
471
|
+
for (const secret of this.secrets) {
|
|
472
|
+
secret.control.reset('');
|
|
473
|
+
}
|
|
474
|
+
this.secrets = [];
|
|
475
|
+
this.form = new FormGroup({});
|
|
476
|
+
this.fields = [];
|
|
477
|
+
this.model = {};
|
|
478
|
+
this.validator = undefined;
|
|
479
|
+
}
|
|
480
|
+
/** SF-006/SF-007: secret states must target declared secrets and values must not carry secrets. */
|
|
481
|
+
assertSecretInputs(secretPaths, values, secretStates) {
|
|
482
|
+
for (const state of secretStates) {
|
|
483
|
+
if (!isRecord(state) || !secretPaths.includes(state.path)) {
|
|
484
|
+
throw new SchemaFormConfigurationError('secretStates contains a path that the schema does not mark as secret.');
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
for (const path of secretPaths) {
|
|
488
|
+
if (hasValueAt(values, path)) {
|
|
489
|
+
throw new SchemaFormConfigurationError(`The values contain an entry at the secret path ${path}.`);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
mapField(field, schema) {
|
|
494
|
+
// Schema defaults must not materialize overrides that the business did not edit.
|
|
495
|
+
delete field.defaultValue;
|
|
496
|
+
const props = field.props ?? (field.props = {});
|
|
497
|
+
const pointer = props[POINTER_PROP];
|
|
498
|
+
delete props[POINTER_PROP];
|
|
499
|
+
if (typeof pointer === 'string') {
|
|
500
|
+
const override = this.texts.fields?.[pointer];
|
|
501
|
+
props.label = override?.label ?? props.label ?? (typeof field.key === 'string' ? field.key : undefined);
|
|
502
|
+
props.description = override?.description ?? props.description;
|
|
503
|
+
if (schema.type !== 'object' && !(schema.type === undefined && schema.properties)) {
|
|
504
|
+
field.wrappers = [W_SCHEMA_FORM_FIELD_WRAPPER];
|
|
505
|
+
}
|
|
506
|
+
const secret = this.secrets.find(entry => entry.path === pointer);
|
|
507
|
+
if (secret) {
|
|
508
|
+
return this.mapSecretField(field, secret);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if (Object.prototype.hasOwnProperty.call(schema, 'const')) {
|
|
512
|
+
// Fixed values are shown but never edited nor materialized.
|
|
513
|
+
field.type = 'input';
|
|
514
|
+
props.type = 'text';
|
|
515
|
+
props.disabled = true;
|
|
516
|
+
props.readonly = true;
|
|
517
|
+
props.placeholder = typeof schema.const === 'string' ? schema.const : JSON.stringify(schema.const);
|
|
518
|
+
field.parsers = [];
|
|
519
|
+
return field;
|
|
520
|
+
}
|
|
521
|
+
switch (schema.type) {
|
|
522
|
+
case 'object':
|
|
523
|
+
delete field.type;
|
|
524
|
+
break;
|
|
525
|
+
case 'string':
|
|
526
|
+
case 'number':
|
|
527
|
+
case 'integer':
|
|
528
|
+
field.type = schema.enum ? 'select' : 'input';
|
|
529
|
+
props.type = schema.type === 'string' ? 'text' : 'number';
|
|
530
|
+
// Clearing a control is not an implicit request to inherit a missing override.
|
|
531
|
+
field.parsers = schema.type === 'string' || schema.enum ? [] : [
|
|
532
|
+
(value, current) => {
|
|
533
|
+
if (!current?.formControl?.dirty) {
|
|
534
|
+
return typeof current?.key === 'string' ? current.model?.[current.key] : value;
|
|
535
|
+
}
|
|
536
|
+
if (value === '' || value === undefined || value === null) {
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
return typeof value === 'string' ? Number(value) : value;
|
|
540
|
+
}
|
|
541
|
+
];
|
|
542
|
+
break;
|
|
543
|
+
case 'boolean':
|
|
544
|
+
field.type = 'checkbox';
|
|
545
|
+
break;
|
|
546
|
+
case 'array':
|
|
547
|
+
// inspectSchema only lets through uniqueItems arrays whose items are an enum.
|
|
548
|
+
field.type = 'select';
|
|
549
|
+
props['multiple'] = true;
|
|
550
|
+
field.parsers = [];
|
|
551
|
+
break;
|
|
552
|
+
case undefined:
|
|
553
|
+
if (schema.enum) {
|
|
554
|
+
field.type = 'select';
|
|
555
|
+
field.parsers = [];
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
if (schema.properties) {
|
|
559
|
+
delete field.type;
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
throw new SchemaFormConfigurationError('A field without type must declare enum, const or properties.');
|
|
563
|
+
default:
|
|
564
|
+
throw new SchemaFormConfigurationError('The schema form supports object, string, number, integer, boolean, enum, const and enum array fields only.');
|
|
565
|
+
}
|
|
566
|
+
return field;
|
|
567
|
+
}
|
|
568
|
+
mapSecretField(field, secret) {
|
|
569
|
+
// Without key the field has no control in the form nor entry in the model: the value never
|
|
570
|
+
// reaches `configuration`, `stateChange` or the diagnostics.
|
|
571
|
+
delete field.key;
|
|
572
|
+
field.type = W_SCHEMA_FORM_SECRET_FIELD_TYPE;
|
|
573
|
+
field.validators = {};
|
|
574
|
+
field.parsers = [];
|
|
575
|
+
const translations = this.texts;
|
|
576
|
+
const secretProps = {
|
|
577
|
+
secretControl: secret.control,
|
|
578
|
+
secretStatusText: secret.hasValue ? translations.secretConfigured : translations.secretPending,
|
|
579
|
+
secretHint: secret.hasValue ? translations.secretReplaceHint : undefined,
|
|
580
|
+
showSecretLabel: translations.showSecret,
|
|
581
|
+
hideSecretLabel: translations.hideSecret
|
|
582
|
+
};
|
|
583
|
+
Object.assign(field.props ?? (field.props = {}), secretProps);
|
|
584
|
+
return field;
|
|
585
|
+
}
|
|
586
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
587
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: WSchemaFormComponent, isStandalone: true, selector: "w-schema-form", inputs: { schema: "schema", values: "values", dialect: "dialect", secretStates: "secretStates", translations: "translations" }, outputs: { stateChange: "stateChange", validSubmit: "validSubmit" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-schema-form\">\r\n @if (state.status === 'error') {\r\n <p role=\"alert\" class=\"w-error-message w-schema-form__alert\">{{ texts.configurationError }}</p>\r\n } @else {\r\n <formly-form\r\n [form]=\"form\"\r\n [fields]=\"fields\"\r\n [model]=\"model\"\r\n (modelChange)=\"onModelChange($event)\">\r\n </formly-form>\r\n @if (state.status === 'invalid') {\r\n <p role=\"alert\" class=\"w-error-message w-schema-form__alert\">{{ texts.invalidValues }}</p>\r\n }\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form{display:flex;flex-direction:column;gap:20px}.w-schema-form__alert{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$1.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: FormlyPrimeNGModule }, { kind: "ngmodule", type: WSchemaFormFieldTypesModule }] }); }
|
|
588
|
+
}
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: WSchemaFormComponent, decorators: [{
|
|
590
|
+
type: Component,
|
|
591
|
+
args: [{ selector: 'w-schema-form', standalone: true, imports: [ReactiveFormsModule, FormlyModule, FormlyPrimeNGModule, WSchemaFormFieldTypesModule], template: "<div class=\"w-schema-form\">\r\n @if (state.status === 'error') {\r\n <p role=\"alert\" class=\"w-error-message w-schema-form__alert\">{{ texts.configurationError }}</p>\r\n } @else {\r\n <formly-form\r\n [form]=\"form\"\r\n [fields]=\"fields\"\r\n [model]=\"model\"\r\n (modelChange)=\"onModelChange($event)\">\r\n </formly-form>\r\n @if (state.status === 'invalid') {\r\n <p role=\"alert\" class=\"w-error-message w-schema-form__alert\">{{ texts.invalidValues }}</p>\r\n }\r\n }\r\n</div>\r\n", styles: [".heading1{font-size:2.6666666667rem;line-height:3rem;font-weight:700}.heading2{font-size:2.3333333333rem;line-height:2.6666666667rem;font-weight:700}.heading3{font-size:2rem;line-height:2.3333333333rem;font-weight:700}.heading4{font-size:1.6666666667rem;line-height:2rem;font-weight:700}.heading5,.w-sidebar-title-text{font-size:1.5rem;line-height:1.8333333333rem;font-weight:700}.heading6{font-size:1.3333333333rem;line-height:1.6666666667rem;font-weight:700}.subtitle1,.w-tab-text,.w-panel-title-text{font-size:1.1666666667rem;line-height:1.3333333333rem;font-weight:700}.subtitle2,.w-table-th-text,.w-panel-subtitle-text,.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled,.w-view-small-label-text-typography,.w-view-small-label-text,.w-button-small-text-label-text-typography,.w-button-small-text-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:600}.body,.w-image-file-uploader-navigators-text,.w-table-td-text,.w-chip-text,.w-panel-content,.w-input-small-select-options-text,.w-input-small-placeholder-text-typography,.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text,.w-view-small-value-text-typography,.w-view-small-value-text,.w-button-small-label-text-typography,.w-button-small-tertiary-label-text{font-size:1rem;line-height:1.1666666667rem;font-weight:400}.caption,.w-input-success-alert-text{font-size:.6666666667rem;line-height:1rem;font-weight:400}.light,.w-input-small-placeholder-text-only-color{font-size:.9166666667rem;line-height:1.0833333333rem;font-weight:300}.small,.w-error-message,.w-input-error-alert-text,.w-input-warning-alert-text,.w-message-note,.w-button-small-label-text-typography-sm{font-size:.8333333333rem;line-height:1rem;font-weight:400}.textMainColor{color:#1f2224}.textSoftColor{color:#5f6468}.textSofterColor{color:#9aa0a7}.textSoftestColor{color:#e8ebee}.textInverseColor{color:#fff}.spacingXXS{padding:4px}.spacingXSM{padding:6px}.spacingXSMDivider{height:6px}.spacingXS{padding:8px}.spacingS{padding:12px}.spacingM{padding:16px}.spacingL{padding:20px}.spacingXL{padding:24px}.spacingXXL{padding:28px}.spacingXXXL{padding:32px}.panel-title-gap-divider{height:20px}.panel-section-gap-divider{height:32px}.input-vertical-gap-divider{height:24px}.input-label-gap-divider{height:6px}.focusedInput{border:1px solid rgba(0,157,253,.25);box-shadow:0 0 10px #00b3eb40}.focus{box-shadow:0 0 8px #00a6e980}.hover{border-radius:8px;border:1px solid #00b3eb}.hoveredInput{border-radius:8px;border:1px solid rgba(0,179,235,.5)}.input-generic-valid{border-radius:8px;border:1px solid #B3FFD3}.input-generic-valid-focus{border-radius:8px;border:1px solid #B3FFD3!important;box-shadow:0 0 8px #46ff9b80!important;padding-left:16px}.input-generic-warning{border-radius:8px;border:1px solid #FFECB8!important}.input-generic-warning-focus{border-radius:8px;border:1px solid #FFECB8!important;box-shadow:0 0 8px #ffcd4680!important;padding-left:16px}.input-generic-error-focus{border-radius:8px;border:1px solid #FFBDBD!important;box-shadow:0 0 8px #ff555580!important;padding-left:16px}.input-generic-error{border-radius:8px;border:1px solid #FFBDBD}.toggle-small-typography{font-size:12px;line-height:16px;font-weight:600}.w-button-small-label-text-typography,.w-button-small-tertiary-label-text,.w-button-small-label-text-typography-sm{font-weight:600}.w-button-small-tertiary-label-text{color:#5f6468}.w-button-small-text-label-text{color:#1f2224}.w-button-small-icon-text{font-size:12px;font-weight:600}.w-table-button-small-icon-text{font-size:12px;color:#9aa0a7}.w-control-button-small-label-text{font-size:12px;font-weight:600;line-height:16px}.w-control-button-x-small-icon-text{font-size:10px;font-weight:700}.w-control-button-small-icon-text{font-size:8px;font-weight:700}.w-button-medium-label-text-typography,.w-button-medium-tertiary-label-text{font-size:16px;font-weight:600;line-height:16px}.w-button-medium-tertiary-label-text{color:#1f2224}.w-button-medium-icon-text{font-size:16px}.w-control-button-medium-label-text{font-size:14px;font-weight:600;line-height:16px}.w-control-button-medium-icon-text{font-size:12px;font-weight:700}.w-button-large-label-text-typography,.w-button-large-tertiary-label-text{font-size:20px;font-weight:600;line-height:24px}.w-button-large-tertiary-label-text{color:#1f2224}.w-button-x-small-label-text{font-size:10px;font-weight:600;line-height:10px}.w-button-small-only-label-text{font-size:12px;font-weight:600;line-height:16px}.w-button-large-icon-text{font-size:24px}.w-view-small-label-text{color:#1f2224}.w-view-small-value-text{color:#5f6468}.w-input-no-label-height{height:14px}.w-input-disabled{background-color:#f8f9fa!important;border-color:#e8ebee!important;opacity:.6!important}.w-input-small-label-text-typography,.w-input-small-label-text,.w-input-small-label-disabled{height:fit-content}.w-input-small-label-text,.w-input-small-label-disabled{color:#1f2224}.w-input-small-label-disabled{color:#9aa0a7}.w-input-small-label-text-content{padding:12px 8px 8px 0;margin:0}.w-input-small-label-text-content-no-top{padding-top:0}.w-input-small-placeholder-text{color:#1f2224}.w-input-small-placeholder-text-only-color{color:#9aa0a7;line-height:1.3333333333rem}.w-input-small-placeholder-text-disabled,.w-input-small-placeholder-text-disabled-only-color{color:#5f6468}.w-input-small-text-icon,.w-input-small-select-options-text{color:#1f2224}.w-input-medium-label-text-typography,.w-input-medium-label-text,.w-input-medium-label-disabled{font-size:14px;font-weight:600;line-height:16px}.w-input-medium-label-text,.w-input-medium-label-disabled{color:#1f2224}.w-input-medium-label-disabled{color:#9aa0a7}.w-input-medium-placeholder-text-typography,.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text{font-size:16px;font-weight:400;line-height:24px}.w-input-medium-placeholder-text,.w-input-medium-placeholder-text-only-color{color:#1f2224}.w-input-medium-placeholder-text-disabled,.w-input-medium-placeholder-text-disabled-only-color{color:#5f6468}.w-input-medium-text-icon{color:#1f2224}.w-input-medium-select-options-text{font-size:16px;font-weight:400;line-height:24px;color:#1f2224}.w-input-success-alert-text{color:#00db5d;padding:8px 8px 0;margin-top:0}.w-input-warning-alert-text,.w-message-note{color:#eeae00;padding:0 4px;margin-top:-2px}.w-input-error-alert-text{color:#e50000;padding:0 4px;margin-top:-2px}.w-input-alert-message-height{height:32px}.w-error-message{color:#e50000;padding:0 4px;margin-top:-2px}.w-message-note{font-weight:600;color:#e2a500}.w-sidebar-title-text,.w-panel-title-text,.w-panel-subtitle-text{color:#1f2224}.w-panel-content{color:#5f6468}.w-tab-text,.w-chip-text{color:#1f2224}.w-badge-text{font-size:10px;font-weight:700;line-height:8px}.w-table-th-text{color:#1f2224}.w-table-td-text{color:#5f6468}.w-table-height{padding:6px 8px 5px}.w-table-no-buttons-height{padding:16px 8px 15px!important}.w-tree-table-height{padding:8px 8px 7px}.w-image-file-uploader-navigators-text{font-size:12px;color:#fff}.grid{margin:0}::ng-deep .p-tooltip,.p-tooltip{filter:0px 0px 1px 0px rgba(0,0,0,.1) inset,1px 1px 5px rgba(0,0,0,.06),1px 1px 1px rgba(0,0,0,.08)}::ng-deep .p-tooltip .p-tooltip-text,.p-tooltip .p-tooltip-text{background:#fff!important;color:#1f2224;padding:12px 16px;max-width:192px;width:max-content;margin-left:3px;pointer-events:none}::ng-deep .p-tooltip.p-tooltip-left,.p-tooltip.p-tooltip-left{margin-right:6px;width:max-content;transform:translate(-6px)}::ng-deep .p-tooltip.p-tooltip-left .p-tooltip-arrow,.p-tooltip.p-tooltip-left .p-tooltip-arrow{border-left-color:#fff!important;top:50%;right:-3px;margin-top:-4px;border-width:4px 0 4px 6px!important}::ng-deep .p-tooltip.p-tooltip-right,.p-tooltip.p-tooltip-right{margin-left:6px;width:max-content;transform:translateY(-1px)}::ng-deep .p-tooltip.p-tooltip-right .p-tooltip-arrow,.p-tooltip.p-tooltip-right .p-tooltip-arrow{border-right-color:#fff!important;top:50%;left:0;margin-top:-4px;border-width:4px 6px 4px 0!important}::ng-deep .p-tooltip.p-tooltip-bottom .p-tooltip-arrow,.p-tooltip.p-tooltip-bottom .p-tooltip-arrow{border-bottom-color:#fff!important;border-width:0 4px 6px 4px!important;margin-top:-3px}:host{display:block}.w-schema-form{display:flex;flex-direction:column;gap:20px}.w-schema-form__alert{margin:0}\n"] }]
|
|
592
|
+
}], propDecorators: { schema: [{
|
|
593
|
+
type: Input,
|
|
594
|
+
args: [{ required: true }]
|
|
595
|
+
}], values: [{
|
|
596
|
+
type: Input,
|
|
597
|
+
args: [{ required: true }]
|
|
598
|
+
}], dialect: [{
|
|
599
|
+
type: Input
|
|
600
|
+
}], secretStates: [{
|
|
601
|
+
type: Input
|
|
602
|
+
}], translations: [{
|
|
603
|
+
type: Input
|
|
604
|
+
}], stateChange: [{
|
|
605
|
+
type: Output
|
|
606
|
+
}], validSubmit: [{
|
|
607
|
+
type: Output
|
|
608
|
+
}] } });
|
|
609
|
+
function createAjv(dialect) {
|
|
610
|
+
const options = { allErrors: true, ownProperties: true, verbose: false, logger: false };
|
|
611
|
+
const ajv = dialect === '2020-12' ? new Ajv2020(options) : new Ajv(options);
|
|
612
|
+
// Annotation keyword: strict mode stays enabled for every other unknown keyword.
|
|
613
|
+
ajv.addKeyword(SECRET_KEYWORD);
|
|
614
|
+
return ajv;
|
|
615
|
+
}
|
|
616
|
+
function toDiagnostic({ instancePath, keyword, message }, basePath) {
|
|
617
|
+
return { instancePath: `${basePath}${instancePath}`, keyword, message };
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/*
|
|
621
|
+
* Public API Surface of ngx-wapp-components/schema-form
|
|
622
|
+
* Secondary entry point (SFC-D02): requires the optional peers @ngx-formly/core,
|
|
623
|
+
* @ngx-formly/primeng and ajv. The primary entry point does not depend on them.
|
|
624
|
+
*/
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Generated bundle index. Do not edit.
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
export { WSchemaFormComponent, W_SCHEMA_FORM_DEFAULT_TRANSLATIONS };
|
|
631
|
+
//# sourceMappingURL=ngx-wapp-components-schema-form.mjs.map
|