@suntelecoms/ngx-dynamic-form 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DynamicFormConfig, DynamicFormField, FieldCondition, FieldType, FieldValidation, RemoteSearchConfig, SelectOption, StepGuard, StepperFormConfig, ValueRule, QuestionItem } from '../../models/form-field.model';
|
|
1
|
+
import type { DynamicFormConfig, DynamicFormField, FieldCondition, FieldType, FieldValidation, RemoteSearchConfig, SelectOption, StepGuard, StepperFormConfig, ValueRule, QuestionItem, RechercheConfig } from '../../models/form-field.model';
|
|
2
2
|
import type { SavedFormSchema } from '../../models/saved-form.model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
interface FieldTypeDef {
|
|
@@ -10,6 +10,7 @@ interface FieldTypeDef {
|
|
|
10
10
|
interface BuilderStep {
|
|
11
11
|
label: string;
|
|
12
12
|
icon?: string;
|
|
13
|
+
description?: string;
|
|
13
14
|
fields: DynamicFormField[];
|
|
14
15
|
atLeastOneOf?: string[];
|
|
15
16
|
atLeastOneOfMessage?: string;
|
|
@@ -47,6 +48,14 @@ export declare class FormBuilderComponent {
|
|
|
47
48
|
formFloatLabel: import("@angular/core").WritableSignal<"auto" | "always">;
|
|
48
49
|
formAtLeastOneOfKeys: import("@angular/core").WritableSignal<string>;
|
|
49
50
|
formAtLeastOneOfMsg: import("@angular/core").WritableSignal<string>;
|
|
51
|
+
showSubmit: import("@angular/core").WritableSignal<boolean>;
|
|
52
|
+
formLayout: import("@angular/core").WritableSignal<"vertical" | "horizontal" | "inline">;
|
|
53
|
+
formDebug: import("@angular/core").WritableSignal<boolean>;
|
|
54
|
+
stepperLinear: import("@angular/core").WritableSignal<boolean>;
|
|
55
|
+
stepperOrientation: import("@angular/core").WritableSignal<"vertical" | "horizontal">;
|
|
56
|
+
stepperSummaryLabel: import("@angular/core").WritableSignal<string>;
|
|
57
|
+
/** Clés de la config que le constructeur n'édite pas (cssClass…) : gardées telles quelles à l'enregistrement. */
|
|
58
|
+
private configReste;
|
|
50
59
|
formCode: import("@angular/core").WritableSignal<string>;
|
|
51
60
|
currentId: import("@angular/core").WritableSignal<string | null>;
|
|
52
61
|
showExport: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -64,6 +73,8 @@ export declare class FormBuilderComponent {
|
|
|
64
73
|
readonly selectedField: import("@angular/core").Signal<DynamicFormField | null>;
|
|
65
74
|
readonly previewConfig: import("@angular/core").Signal<DynamicFormConfig>;
|
|
66
75
|
readonly stepperPreviewConfig: import("@angular/core").Signal<StepperFormConfig>;
|
|
76
|
+
/** Clés de config éditées par le constructeur (les autres vont dans configReste). */
|
|
77
|
+
private static readonly CLES_CONFIG;
|
|
67
78
|
readonly groupedTypes: import("@angular/core").Signal<{
|
|
68
79
|
label: "Saisie" | "Choix" | "Mise en page";
|
|
69
80
|
types: FieldTypeDef[];
|
|
@@ -88,7 +99,7 @@ export declare class FormBuilderComponent {
|
|
|
88
99
|
updateValidation(prop: keyof FieldValidation, value: any): void;
|
|
89
100
|
getOptions(): SelectOption[];
|
|
90
101
|
addOption(): void;
|
|
91
|
-
updateOption(idx: number, prop: 'label' | 'value' | 'dependsOnValue' | 'locked', value: string | boolean): void;
|
|
102
|
+
updateOption(idx: number, prop: 'label' | 'value' | 'dependsOnValue' | 'locked' | 'disabled' | 'group', value: string | boolean): void;
|
|
92
103
|
/** Options cochées en même temps que l'option idx (includes) ; « griser » : includesLocked. */
|
|
93
104
|
updateOptionIncludes(idx: number, values: any[]): void;
|
|
94
105
|
updateOptionIncludesLocked(idx: number, locked: boolean): void;
|
|
@@ -123,6 +134,36 @@ export declare class FormBuilderComponent {
|
|
|
123
134
|
/** Source des questions : saisies ici ('static') ou chargées depuis une API ('api'). */
|
|
124
135
|
questionSource(): 'static' | 'api';
|
|
125
136
|
setQuestionSource(source: 'static' | 'api'): void;
|
|
137
|
+
/** Clés de RechercheConfig éditées en JSON (« Avancé ») plutôt qu'en champs dédiés. */
|
|
138
|
+
private static readonly RCH_AVANCE;
|
|
139
|
+
rchAvanceErreur: import("@angular/core").WritableSignal<string>;
|
|
140
|
+
rch(): RechercheConfig;
|
|
141
|
+
/** Propriété de `recherche` ; valeur vide = propriété retirée (défaut du plugin). */
|
|
142
|
+
setRch(prop: keyof RechercheConfig, value: any): void;
|
|
143
|
+
/** Mode d'après l'URL : recherche serveur avec {{q}}, sinon liste filtrée dans le navigateur. */
|
|
144
|
+
rchServeur(): boolean;
|
|
145
|
+
getRchDetails(): {
|
|
146
|
+
label: string;
|
|
147
|
+
path: string;
|
|
148
|
+
format?: "badge" | "date";
|
|
149
|
+
}[];
|
|
150
|
+
addRchDetail(): void;
|
|
151
|
+
removeRchDetail(i: number): void;
|
|
152
|
+
updateRchDetail(i: number, prop: 'label' | 'path' | 'format', value: any): void;
|
|
153
|
+
/** `champs` en lignes éditables (clé du formulaire → source). */
|
|
154
|
+
getRchChamps(): {
|
|
155
|
+
cle: string;
|
|
156
|
+
source: string;
|
|
157
|
+
}[];
|
|
158
|
+
private setRchChamps;
|
|
159
|
+
addRchChamp(): void;
|
|
160
|
+
removeRchChamp(i: number): void;
|
|
161
|
+
updateRchChamp(i: number, prop: 'cle' | 'source', value: string): void;
|
|
162
|
+
toggleRchAjout(on: boolean): void;
|
|
163
|
+
setRchAjout(prop: string, value: any): void;
|
|
164
|
+
rchAvanceText(): string;
|
|
165
|
+
/** Options avancées (JSON) : remplace les clés RCH_AVANCE de `recherche`, garde les autres. */
|
|
166
|
+
updateRchAvance(text: string): void;
|
|
126
167
|
/** Valeur saisie dans le constructeur : 'true' / 'false' deviennent des booléens (cases à cocher). */
|
|
127
168
|
private valeurSaisie;
|
|
128
169
|
getValueRules(): ValueRule[];
|
|
@@ -131,7 +172,28 @@ export declare class FormBuilderComponent {
|
|
|
131
172
|
addValueRule(): void;
|
|
132
173
|
removeValueRule(index: number): void;
|
|
133
174
|
updateValueRule(index: number, prop: 'value' | 'lock', value: any): void;
|
|
134
|
-
|
|
175
|
+
/** Toutes les conditions d'une règle (`when` objet ou tableau). */
|
|
176
|
+
ruleConditions(rule: ValueRule): FieldCondition[];
|
|
177
|
+
/** Réécrit les conditions d'une règle : objet seul s'il n'y en a qu'une, tableau sinon (logic retirée). */
|
|
178
|
+
private setRuleConditions;
|
|
179
|
+
updateValueRuleCondition(index: number, key: keyof FieldCondition, value: any, ci?: number): void;
|
|
180
|
+
addValueRuleCondition(index: number): void;
|
|
181
|
+
removeValueRuleCondition(index: number, ci: number): void;
|
|
182
|
+
setValueRuleLogic(index: number, logic: 'AND' | 'OR'): void;
|
|
183
|
+
setUpload(prop: string, value: any): void;
|
|
184
|
+
setUploadJson(prop: 'params' | 'headers', text: string): void;
|
|
185
|
+
/** maxFileSize saisi en Mo, gardé en octets. */
|
|
186
|
+
maxFileSizeMo(): number | '';
|
|
187
|
+
setMaxFileSizeMo(v: any): void;
|
|
188
|
+
toggleUpload(on: boolean): void;
|
|
189
|
+
/** Liste séparée par des virgules (keepKeys). */
|
|
190
|
+
setUploadList(prop: string, text: string): void;
|
|
191
|
+
/** Objets JSON (headers, params de l'upload, params de remoteSearch) : texte affiché et erreur par clé. */
|
|
192
|
+
jsonErreurs: import("@angular/core").WritableSignal<Record<string, string>>;
|
|
193
|
+
jsonText(v: any): string;
|
|
194
|
+
/** Analyse un objet JSON saisi ; appelle `apply` avec l'objet (undefined si vide), ou note l'erreur sous `cle`. */
|
|
195
|
+
setJsonObject(cle: string, text: string, apply: (v: Record<string, any> | undefined) => void): void;
|
|
196
|
+
setRemoteSearchParams(text: string): void;
|
|
135
197
|
getDisabledConditions(): FieldCondition[];
|
|
136
198
|
addDisabledCondition(): void;
|
|
137
199
|
removeDisabledCondition(index: number): void;
|
|
@@ -166,7 +228,7 @@ export declare class FormBuilderComponent {
|
|
|
166
228
|
setStepAtLeastOneOf(text: string): void;
|
|
167
229
|
getStepBeforeNext(): StepGuard | undefined;
|
|
168
230
|
toggleBeforeNext(enabled: boolean): void;
|
|
169
|
-
setBeforeNextProp(key: keyof StepGuard, value:
|
|
231
|
+
setBeforeNextProp(key: keyof StepGuard, value: any): void;
|
|
170
232
|
/** Presets de masques de saisie courants */
|
|
171
233
|
readonly maskPresets: {
|
|
172
234
|
label: string;
|
|
@@ -77,6 +77,8 @@ export interface FieldValidation {
|
|
|
77
77
|
ageReferenceField?: string;
|
|
78
78
|
messages?: {
|
|
79
79
|
required?: string;
|
|
80
|
+
/** Champ rendu obligatoire par requiredWhen (repli : required). */
|
|
81
|
+
requiredWhen?: string;
|
|
80
82
|
minLength?: string;
|
|
81
83
|
maxLength?: string;
|
|
82
84
|
min?: string;
|
|
@@ -423,6 +425,7 @@ export interface DynamicFormField {
|
|
|
423
425
|
message?: string;
|
|
424
426
|
};
|
|
425
427
|
defaultCountry?: string;
|
|
428
|
+
/** @deprecated Non lu par le rendu (aucun effet) — gardé pour la compatibilité des configs existantes. */
|
|
426
429
|
attrs?: Record<string, any>;
|
|
427
430
|
}
|
|
428
431
|
export interface DynamicFormConfig {
|
package/package.json
CHANGED