@suntelecoms/ngx-dynamic-form 1.7.10 → 1.7.15
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/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://angular.dev)
|
|
6
6
|
[](https://material.angular.io)
|
|
7
|
-
[](CHANGELOG.md)
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
[](mailto:amadoumacbookpro38@gmail.com)
|
|
10
10
|
|
|
@@ -112,6 +112,9 @@ Résultat : dans n'importe quel projet Angular, il suffit de **2 lignes** pour a
|
|
|
112
112
|
- **Locale du datepicker configurable** — le type `date` affiche `DD/MM/YYYY` par défaut (`fr-FR`, calendrier et noms de mois en français) au lieu du format US du navigateur ; personnalisable par champ (`dateLocale`) ou globalement (`provideNgxForms({ dateLocale })`) _(v1.7.6)_
|
|
113
113
|
- **Recherche dans « Mes Formulaires »** — filtre les formulaires sauvegardés par titre ou code, utile dès que le catalogue grandit _(v1.7.9)_
|
|
114
114
|
- **Filtre des options API** — propriété `optionsFilter` sur un champ `select`/`multiselect`/`radio` chargé via `url` : ne garde que les items dont une propriété correspond à une condition (ex: `status === 'ACTIF'`), avec logique ET/OU sur plusieurs conditions — même mécanique que `showWhen`, mais évaluée contre les propriétés brutes de chaque item API _(v1.7.10)_
|
|
115
|
+
- **Champ fichier fonctionnel** — le type `file` est maintenant relié au formulaire (dropzone clic/glisser-déposer, liste de fichiers choisis, `formControl.value` = `File`/`File[]`) ; avant v1.7.11 l'`<input type="file">` n'était pas connecté, aucune valeur ne remontait _(v1.7.11)_
|
|
116
|
+
- **Code ISO pays** — type `iso-country` : liste déroulante recherchable (nom ou code) avec drapeau, même référentiel que `country-dial-code` — garantit un code toujours valide au lieu d'une saisie libre _(v1.7.12, converti en liste déroulante en v1.7.14)_
|
|
117
|
+
- **Indicatif téléphonique pays** — nouveau type `country-dial-code` : recherche de pays (nom/indicatif/code) avec drapeau, stocke uniquement l'indicatif choisi (ex: `'+221'`) comme attribut autonome, réutilise le référentiel du type `phone` _(v1.7.13)_
|
|
115
118
|
|
|
116
119
|
---
|
|
117
120
|
|
|
@@ -279,8 +282,10 @@ Pour disposer du **Form Builder + gestionnaire + rendu par URL** dans votre appl
|
|
|
279
282
|
| `range` | `<mat-slider>` | Curseur de valeur — propriétés `min`, `max`, `step`, `showValue` _(v1.2.8)_ |
|
|
280
283
|
| `color` | `<input type="color">` | Sélecteur de couleur avec affichage du code hex _(v1.2.8)_ |
|
|
281
284
|
| `location` | `<input>` + bouton GPS | Champ adresse avec géolocalisation — bouton `my_location` déclenche `navigator.geolocation` _(v1.2.8)_ |
|
|
282
|
-
| `file` |
|
|
285
|
+
| `file` | Dropzone (clic ou glisser-déposer) + liste de fichiers choisis | Téléversement — `accept`, `multiple` ; `formControl.value` = `File` (ou `File[]` si `multiple`), à empaqueter en `FormData` par le consommateur dans `onSubmit` — le plugin ne fait aucun appel HTTP lui-même _(fonctionnel depuis v1.7.11 — avant cette version l'`<input>` n'était pas relié au formulaire)_ |
|
|
283
286
|
| `phone` | `mat-form-field` + menu pays | Téléphone international — sélecteur de pays (menu + recherche), masque automatique, valeur E.164 dans le FormGroup _(v1.4.0, v1.4.7)_ |
|
|
287
|
+
| `iso-country` | `mat-autocomplete` — recherche pays | Code ISO 3166-1 alpha-2 : liste déroulante recherchable (nom ou code) avec drapeau SVG (`flag-icons`, même rendu que `phone` — pas d'emoji, repli en deux lettres nues sur certains Windows/webviews), sur le même référentiel `PHONE_COUNTRIES` que `country-dial-code` (son `.code` EST le code ISO) — garantit un code toujours valide, pas de saisie libre ; validation `^[A-Za-z]{2}$` conservée en filet de sécurité si une valeur est posée par programmation _(v1.7.12 en saisie libre, converti en liste déroulante en v1.7.14, drapeau SVG en v1.7.15)_ |
|
|
288
|
+
| `country-dial-code` | `mat-autocomplete` — recherche pays | Choix de l'indicatif téléphonique d'un pays comme attribut autonome (ex: `Pays.indicatifTel = '+221'`) — distinct de `phone` (qui saisit un numéro complet E.164) ; recherche par nom, indicatif ou code sur le même référentiel `PHONE_COUNTRIES`, drapeau SVG (`flag-icons`, même rendu que `phone`) dans chaque résultat, `formControl.value` = l'indicatif choisi (ex: `'+221'`) _(v1.7.13, drapeau SVG en v1.7.15)_ |
|
|
284
289
|
|
|
285
290
|
### Mise en page
|
|
286
291
|
|
|
@@ -65,7 +65,13 @@ class DynamicFormBuilderService {
|
|
|
65
65
|
for (const field of fields) {
|
|
66
66
|
if (field.type === 'divider' || field.type === 'heading')
|
|
67
67
|
continue;
|
|
68
|
-
|
|
68
|
+
// iso-country garantit un code à 2 lettres même si l'auteur du formulaire
|
|
69
|
+
// oublie de le déclarer explicitement (nécessaire pour le rendu du drapeau
|
|
70
|
+
// dérivé du code — voir DynamicFieldComponent.isoCountryFlag).
|
|
71
|
+
const effectiveValidation = field.type === 'iso-country' && !field.validation?.pattern
|
|
72
|
+
? { ...field.validation, pattern: '^[A-Za-z]{2}$' }
|
|
73
|
+
: field.validation;
|
|
74
|
+
const validators = this.buildValidators(effectiveValidation);
|
|
69
75
|
const asyncValidators = field.uniqueCheck
|
|
70
76
|
? [this.uniqueness.build(field.uniqueCheck.url, field.uniqueCheck.message)]
|
|
71
77
|
: [];
|
|
@@ -784,6 +790,43 @@ class DynamicFieldComponent {
|
|
|
784
790
|
};
|
|
785
791
|
/** Emitted on every value change of this field */
|
|
786
792
|
this.fieldChange = new EventEmitter();
|
|
793
|
+
// ── Code ISO pays (type: 'iso-country') ──────────────────────────────────────
|
|
794
|
+
// Sélection dans une liste déroulante recherchable plutôt que saisie libre —
|
|
795
|
+
// garantit un code toujours valide (pas de faute de frappe type 'ZZ'), même
|
|
796
|
+
// pattern que 'country-dial-code' et même référentiel PHONE_COUNTRIES (dont
|
|
797
|
+
// le champ .code EST le code ISO 3166-1 alpha-2). Le pattern ^[A-Za-z]{2}$
|
|
798
|
+
// reste ajouté par défaut dans DynamicFormBuilderService.buildFormGroup() —
|
|
799
|
+
// filet de sécurité si une valeur est posée par programmation hors du picker.
|
|
800
|
+
this.isoCountrySearchCtrl = new FormControl('');
|
|
801
|
+
this.displayIsoCountry = (value) => {
|
|
802
|
+
if (value == null || value === '')
|
|
803
|
+
return '';
|
|
804
|
+
if (typeof value === 'string') {
|
|
805
|
+
const match = PHONE_COUNTRIES.find(c => c.code === value.toUpperCase());
|
|
806
|
+
return match ? `${match.flag} ${match.name} (${match.code})` : value;
|
|
807
|
+
}
|
|
808
|
+
return `${value.flag} ${value.name} (${value.code})`;
|
|
809
|
+
};
|
|
810
|
+
// ── Indicatif téléphonique pays (type: 'country-dial-code') ──────────────────
|
|
811
|
+
// Distinct de 'phone' (qui saisit un NUMÉRO complet E.164) : ici on choisit
|
|
812
|
+
// uniquement l'indicatif d'un pays comme attribut autonome (ex: Pays.indicatifTel
|
|
813
|
+
// = '+221'). Réutilise le même référentiel PHONE_COUNTRIES (avec drapeau déjà
|
|
814
|
+
// inclus) que le sélecteur de pays du champ 'phone'.
|
|
815
|
+
this.dialCodeSearchCtrl = new FormControl('');
|
|
816
|
+
this.displayDialCode = (value) => {
|
|
817
|
+
if (value == null || value === '')
|
|
818
|
+
return '';
|
|
819
|
+
if (typeof value === 'string') {
|
|
820
|
+
const match = PHONE_COUNTRIES.find(c => c.dialCode === value);
|
|
821
|
+
return match ? `${match.flag} ${match.name} (${match.dialCode})` : value;
|
|
822
|
+
}
|
|
823
|
+
return `${value.flag} ${value.name} (${value.dialCode})`;
|
|
824
|
+
};
|
|
825
|
+
// ── Fichier (type: 'file') ───────────────────────────────────────────────────
|
|
826
|
+
// formControl.value contient directement le/les File choisi(s) (File si
|
|
827
|
+
// field.multiple est faux, File[] sinon) — c'est au consommateur (onSubmit)
|
|
828
|
+
// de construire le FormData ; le plugin ne fait aucun appel HTTP lui-même.
|
|
829
|
+
this.fileDragging = false;
|
|
787
830
|
// ── Géolocalisation ────────────────────────────────────────────────────────
|
|
788
831
|
this.locating = false;
|
|
789
832
|
this.locationError = '';
|
|
@@ -819,6 +862,71 @@ class DynamicFieldComponent {
|
|
|
819
862
|
const opt = event.option.value;
|
|
820
863
|
this.formControl.setValue(opt.value, { emitEvent: true });
|
|
821
864
|
}
|
|
865
|
+
get filteredIsoCountries() {
|
|
866
|
+
const term = (this.isoCountrySearchCtrl.value ?? '').toString().trim().toLowerCase();
|
|
867
|
+
if (!term)
|
|
868
|
+
return PHONE_COUNTRIES;
|
|
869
|
+
return PHONE_COUNTRIES.filter(c => c.name.toLowerCase().includes(term) || c.code.toLowerCase().includes(term));
|
|
870
|
+
}
|
|
871
|
+
onIsoCountrySelected(event) {
|
|
872
|
+
const country = event.option.value;
|
|
873
|
+
this.formControl.setValue(country.code, { emitEvent: true });
|
|
874
|
+
}
|
|
875
|
+
get filteredDialCodeCountries() {
|
|
876
|
+
const term = (this.dialCodeSearchCtrl.value ?? '').toString().trim().toLowerCase();
|
|
877
|
+
if (!term)
|
|
878
|
+
return PHONE_COUNTRIES;
|
|
879
|
+
return PHONE_COUNTRIES.filter(c => c.name.toLowerCase().includes(term) ||
|
|
880
|
+
c.dialCode.includes(term) ||
|
|
881
|
+
c.code.toLowerCase().includes(term));
|
|
882
|
+
}
|
|
883
|
+
onDialCodeSelected(event) {
|
|
884
|
+
const country = event.option.value;
|
|
885
|
+
this.formControl.setValue(country.dialCode, { emitEvent: true });
|
|
886
|
+
}
|
|
887
|
+
get selectedFiles() {
|
|
888
|
+
const v = this.formControl.value;
|
|
889
|
+
if (!v)
|
|
890
|
+
return [];
|
|
891
|
+
return Array.isArray(v) ? v : [v];
|
|
892
|
+
}
|
|
893
|
+
onFileInputChange(event) {
|
|
894
|
+
const input = event.target;
|
|
895
|
+
if (input.files)
|
|
896
|
+
this.setFiles(input.files);
|
|
897
|
+
}
|
|
898
|
+
onFileDragOver(event) {
|
|
899
|
+
event.preventDefault();
|
|
900
|
+
this.fileDragging = true;
|
|
901
|
+
}
|
|
902
|
+
onFileDragLeave(event) {
|
|
903
|
+
event.preventDefault();
|
|
904
|
+
this.fileDragging = false;
|
|
905
|
+
}
|
|
906
|
+
onFileDrop(event) {
|
|
907
|
+
event.preventDefault();
|
|
908
|
+
this.fileDragging = false;
|
|
909
|
+
if (event.dataTransfer?.files)
|
|
910
|
+
this.setFiles(event.dataTransfer.files);
|
|
911
|
+
}
|
|
912
|
+
removeFile(index, input) {
|
|
913
|
+
const remaining = this.selectedFiles.filter((_, i) => i !== index);
|
|
914
|
+
this.formControl.setValue(this.field.multiple ? remaining : null, { emitEvent: true });
|
|
915
|
+
input.value = ''; // permet de resélectionner le même fichier après suppression
|
|
916
|
+
}
|
|
917
|
+
formatFileSize(bytes) {
|
|
918
|
+
if (bytes < 1024)
|
|
919
|
+
return `${bytes} o`;
|
|
920
|
+
if (bytes < 1024 * 1024)
|
|
921
|
+
return `${(bytes / 1024).toFixed(0)} Ko`;
|
|
922
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} Mo`;
|
|
923
|
+
}
|
|
924
|
+
setFiles(fileList) {
|
|
925
|
+
const files = Array.from(fileList);
|
|
926
|
+
if (!files.length)
|
|
927
|
+
return;
|
|
928
|
+
this.formControl.setValue(this.field.multiple ? [...this.selectedFiles, ...files] : files[0], { emitEvent: true });
|
|
929
|
+
}
|
|
822
930
|
get filteredPhoneCountries() {
|
|
823
931
|
const term = this.phoneSearch.trim().toLowerCase();
|
|
824
932
|
if (!term)
|
|
@@ -921,6 +1029,21 @@ class DynamicFieldComponent {
|
|
|
921
1029
|
PHONE_COUNTRIES.find(c => c.code === (this.field.defaultCountry ?? 'FR'))
|
|
922
1030
|
?? PHONE_COUNTRIES[0];
|
|
923
1031
|
}
|
|
1032
|
+
// Pré-remplit le texte affiché du sélecteur d'indicatif en mode édition
|
|
1033
|
+
// (valeur déjà présente sur le formControl, ex: '+221').
|
|
1034
|
+
if (this.field.type === 'country-dial-code') {
|
|
1035
|
+
const initial = this.formControl.value;
|
|
1036
|
+
if (initial) {
|
|
1037
|
+
this.dialCodeSearchCtrl.setValue(this.displayDialCode(initial), { emitEvent: false });
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
// Idem pour le sélecteur de code ISO pays en mode édition (ex: 'SN' déjà posé).
|
|
1041
|
+
if (this.field.type === 'iso-country') {
|
|
1042
|
+
const initial = this.formControl.value;
|
|
1043
|
+
if (initial) {
|
|
1044
|
+
this.isoCountrySearchCtrl.setValue(this.displayIsoCountry(initial), { emitEvent: false });
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
924
1047
|
// requiredWhen: dynamic Validators.required based on sibling field conditions
|
|
925
1048
|
if (this.field.validation?.requiredWhen) {
|
|
926
1049
|
this.setupRequiredWhen();
|
|
@@ -1575,14 +1698,53 @@ class DynamicFieldComponent {
|
|
|
1575
1698
|
}
|
|
1576
1699
|
</label>
|
|
1577
1700
|
}
|
|
1578
|
-
|
|
1701
|
+
|
|
1702
|
+
<input #fileInput
|
|
1579
1703
|
type="file"
|
|
1580
1704
|
[id]="field.key"
|
|
1581
1705
|
[accept]="field.accept || '*'"
|
|
1582
1706
|
[multiple]="field.multiple || false"
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1707
|
+
[disabled]="field.disabled || field.readonly || false"
|
|
1708
|
+
(change)="onFileInputChange($event)"
|
|
1709
|
+
class="ngx-file-input-native" />
|
|
1710
|
+
|
|
1711
|
+
@if (selectedFiles.length === 0) {
|
|
1712
|
+
<button type="button"
|
|
1713
|
+
class="ngx-file-dropzone"
|
|
1714
|
+
[class.ngx-file-dropzone-active]="fileDragging"
|
|
1715
|
+
[disabled]="field.disabled || field.readonly || false"
|
|
1716
|
+
(click)="fileInput.click()"
|
|
1717
|
+
(dragover)="onFileDragOver($event)"
|
|
1718
|
+
(dragleave)="onFileDragLeave($event)"
|
|
1719
|
+
(drop)="onFileDrop($event)"
|
|
1720
|
+
>
|
|
1721
|
+
<mat-icon>cloud_upload</mat-icon>
|
|
1722
|
+
<span><strong>Cliquez pour choisir</strong> ou glissez-déposez{{ field.multiple ? ' un ou plusieurs fichiers' : ' un fichier' }}</span>
|
|
1723
|
+
</button>
|
|
1724
|
+
} @else {
|
|
1725
|
+
<div class="ngx-file-list">
|
|
1726
|
+
@for (file of selectedFiles; track file.name + file.size; let fi = $index) {
|
|
1727
|
+
<div class="ngx-file-chip">
|
|
1728
|
+
<mat-icon>description</mat-icon>
|
|
1729
|
+
<span class="ngx-file-chip-name">{{ file.name }}</span>
|
|
1730
|
+
<span class="ngx-file-chip-size">{{ formatFileSize(file.size) }}</span>
|
|
1731
|
+
@if (!field.disabled && !field.readonly) {
|
|
1732
|
+
<button type="button" class="ngx-file-chip-remove" (click)="removeFile(fi, fileInput)" title="Retirer">
|
|
1733
|
+
<mat-icon>close</mat-icon>
|
|
1734
|
+
</button>
|
|
1735
|
+
}
|
|
1736
|
+
</div>
|
|
1737
|
+
}
|
|
1738
|
+
@if (field.multiple && !field.disabled && !field.readonly) {
|
|
1739
|
+
<button type="button" class="ngx-file-add-more" (click)="fileInput.click()">
|
|
1740
|
+
<mat-icon>add</mat-icon> Ajouter un fichier
|
|
1741
|
+
</button>
|
|
1742
|
+
}
|
|
1743
|
+
</div>
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
@if (field.hint && !hasError) { <small class="ngx-hint">{{ field.hint }}</small> }
|
|
1747
|
+
@if (hasError) { <small class="ngx-mat-standalone-error">{{ errorMessage }}</small> }
|
|
1586
1748
|
</div>
|
|
1587
1749
|
|
|
1588
1750
|
} @else if (field.type === 'phone') {
|
|
@@ -1657,6 +1819,88 @@ class DynamicFieldComponent {
|
|
|
1657
1819
|
} @else if (field.type === 'hidden') {
|
|
1658
1820
|
<input type="hidden" [formControl]="formControl" />
|
|
1659
1821
|
|
|
1822
|
+
} @else if (field.type === 'iso-country') {
|
|
1823
|
+
@if (isSimple) {
|
|
1824
|
+
<div class="ngx-simple-field">
|
|
1825
|
+
@if (field.label) {
|
|
1826
|
+
<label class="ngx-simple-label" [for]="field.key">
|
|
1827
|
+
{{ field.label }}@if (field.validation?.required) { <span class="ngx-simple-required"> *</span> }
|
|
1828
|
+
</label>
|
|
1829
|
+
}
|
|
1830
|
+
<input [id]="field.key" class="ngx-simple-input"
|
|
1831
|
+
type="text"
|
|
1832
|
+
[formControl]="isoCountrySearchCtrl"
|
|
1833
|
+
[matAutocomplete]="isoCountryAutoSimple"
|
|
1834
|
+
[placeholder]="field.placeholder || 'Nom du pays ou code…'"
|
|
1835
|
+
[readonly]="field.readonly || false" />
|
|
1836
|
+
<mat-autocomplete #isoCountryAutoSimple="matAutocomplete" [displayWith]="displayIsoCountry" (optionSelected)="onIsoCountrySelected($event)">
|
|
1837
|
+
@for (c of filteredIsoCountries; track c.code) {
|
|
1838
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.code }})</mat-option>
|
|
1839
|
+
}
|
|
1840
|
+
</mat-autocomplete>
|
|
1841
|
+
@if (field.hint && !hasError) { <small class="ngx-simple-hint">{{ field.hint }}</small> }
|
|
1842
|
+
@if (hasError) { <small class="ngx-simple-error-msg">{{ errorMessage }}</small> }
|
|
1843
|
+
</div>
|
|
1844
|
+
} @else {
|
|
1845
|
+
<mat-form-field [appearance]="matAppearance" [floatLabel]="resolvedFloatLabel" class="ngx-mat-field">
|
|
1846
|
+
@if (field.label) { <mat-label>{{ field.label }}</mat-label> }
|
|
1847
|
+
<input matInput [id]="field.key"
|
|
1848
|
+
type="text"
|
|
1849
|
+
[formControl]="isoCountrySearchCtrl"
|
|
1850
|
+
[matAutocomplete]="isoCountryAuto"
|
|
1851
|
+
[placeholder]="field.placeholder || 'Nom du pays ou code…'"
|
|
1852
|
+
[readonly]="field.readonly || false" />
|
|
1853
|
+
<mat-autocomplete #isoCountryAuto="matAutocomplete" [displayWith]="displayIsoCountry" (optionSelected)="onIsoCountrySelected($event)">
|
|
1854
|
+
@for (c of filteredIsoCountries; track c.code) {
|
|
1855
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.code }})</mat-option>
|
|
1856
|
+
}
|
|
1857
|
+
</mat-autocomplete>
|
|
1858
|
+
@if (field.hint) { <mat-hint>{{ field.hint }}</mat-hint> }
|
|
1859
|
+
<mat-error>{{ errorMessage }}</mat-error>
|
|
1860
|
+
</mat-form-field>
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
} @else if (field.type === 'country-dial-code') {
|
|
1864
|
+
@if (isSimple) {
|
|
1865
|
+
<div class="ngx-simple-field">
|
|
1866
|
+
@if (field.label) {
|
|
1867
|
+
<label class="ngx-simple-label" [for]="field.key">
|
|
1868
|
+
{{ field.label }}@if (field.validation?.required) { <span class="ngx-simple-required"> *</span> }
|
|
1869
|
+
</label>
|
|
1870
|
+
}
|
|
1871
|
+
<input [id]="field.key" class="ngx-simple-input"
|
|
1872
|
+
type="text"
|
|
1873
|
+
[formControl]="dialCodeSearchCtrl"
|
|
1874
|
+
[matAutocomplete]="dialCodeAutoSimple"
|
|
1875
|
+
[placeholder]="field.placeholder || 'Nom du pays, indicatif ou code…'"
|
|
1876
|
+
[readonly]="field.readonly || false" />
|
|
1877
|
+
<mat-autocomplete #dialCodeAutoSimple="matAutocomplete" [displayWith]="displayDialCode" (optionSelected)="onDialCodeSelected($event)">
|
|
1878
|
+
@for (c of filteredDialCodeCountries; track c.code) {
|
|
1879
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.dialCode }})</mat-option>
|
|
1880
|
+
}
|
|
1881
|
+
</mat-autocomplete>
|
|
1882
|
+
@if (field.hint && !hasError) { <small class="ngx-simple-hint">{{ field.hint }}</small> }
|
|
1883
|
+
@if (hasError) { <small class="ngx-simple-error-msg">{{ errorMessage }}</small> }
|
|
1884
|
+
</div>
|
|
1885
|
+
} @else {
|
|
1886
|
+
<mat-form-field [appearance]="matAppearance" [floatLabel]="resolvedFloatLabel" class="ngx-mat-field">
|
|
1887
|
+
@if (field.label) { <mat-label>{{ field.label }}</mat-label> }
|
|
1888
|
+
<input matInput [id]="field.key"
|
|
1889
|
+
type="text"
|
|
1890
|
+
[formControl]="dialCodeSearchCtrl"
|
|
1891
|
+
[matAutocomplete]="dialCodeAuto"
|
|
1892
|
+
[placeholder]="field.placeholder || 'Nom du pays, indicatif ou code…'"
|
|
1893
|
+
[readonly]="field.readonly || false" />
|
|
1894
|
+
<mat-autocomplete #dialCodeAuto="matAutocomplete" [displayWith]="displayDialCode" (optionSelected)="onDialCodeSelected($event)">
|
|
1895
|
+
@for (c of filteredDialCodeCountries; track c.code) {
|
|
1896
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.dialCode }})</mat-option>
|
|
1897
|
+
}
|
|
1898
|
+
</mat-autocomplete>
|
|
1899
|
+
@if (field.hint) { <mat-hint>{{ field.hint }}</mat-hint> }
|
|
1900
|
+
<mat-error>{{ errorMessage }}</mat-error>
|
|
1901
|
+
</mat-form-field>
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1660
1904
|
} @else {
|
|
1661
1905
|
@if (isSimple) {
|
|
1662
1906
|
<div class="ngx-simple-field">
|
|
@@ -1727,7 +1971,7 @@ class DynamicFieldComponent {
|
|
|
1727
1971
|
}
|
|
1728
1972
|
}
|
|
1729
1973
|
}
|
|
1730
|
-
`, isInline: true, styles: [":host{display:flex;flex-direction:column;width:100%;--ngx-field-color: inherit;--ngx-field-bg: transparent;--ngx-field-align: left}:host ::ng-deep .mat-mdc-input-element{color:var(--ngx-field-color)!important;text-align:var(--ngx-field-align)!important}:host ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--ngx-field-bg)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__leading,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__notch,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__trailing{border-color:var(--ngx-border-color)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:before,:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:after{border-bottom-color:var(--ngx-border-color)!important}:host[style*=--ngx-label-color] ::ng-deep .mdc-floating-label,:host[style*=--ngx-label-color] ::ng-deep .mat-mdc-floating-label{color:var(--ngx-label-color)!important}::ng-deep .ngx-phone-menu{min-width:280px}.ngx-affix-text{font-size:.9em;color:#0000008a;padding:0 2px}.ngx-mat-field{width:100%}.ngx-simple-field{display:flex;flex-direction:column;gap:.375rem;width:100%;padding-bottom:.75rem}.ngx-simple-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151);line-height:1.25}.ngx-simple-required{color:#ef4444}.ngx-simple-input-row{display:flex;align-items:center;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;background:#fff;transition:border-color .15s,box-shadow .15s;overflow:hidden;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-simple-error-border{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-simple-input,.ngx-simple-select,textarea.ngx-simple-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;resize:vertical;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}textarea.ngx-simple-input{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;transition:border-color .15s,box-shadow .15s;width:100%;box-sizing:border-box;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-select{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;width:100%;box-sizing:border-box;transition:border-color .15s,box-shadow .15s;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .75rem center;background-size:1.25em;appearance:none;-webkit-appearance:none;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-icon{font-size:1.1rem;width:1.1rem;height:1.1rem;color:#9ca3af;padding:0 0 0 .75rem;flex-shrink:0}.ngx-simple-affix{font-size:.9rem;color:#6b7280;flex-shrink:0;white-space:nowrap}.ngx-simple-prefix{padding-left:.75rem}.ngx-simple-suffix{padding-right:.75rem}.ngx-simple-hint{font-size:.75rem;color:#6b7280}.ngx-simple-error-msg{font-size:.75rem;color:#ef4444}.ngx-simple-loading{display:flex;align-items:center;gap:.5rem;padding:.5rem 0;font-size:.8125rem;color:#9ca3af}.ngx-radio-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.25rem 0 .75rem}.ngx-radio-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-radio-group{display:flex;flex-wrap:wrap;gap:.75rem}.ngx-checkbox-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.25rem 0}.ngx-file-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-file-label{font-size:.875rem;font-weight:500;color:#000000de}.ngx-file-input{border:1px solid rgba(0,0,0,.23);border-radius:4px;padding:.625rem .75rem;font-size:.875rem;cursor:pointer;background:transparent;transition:border-color .15s}.ngx-file-input:hover{border-color:#000000de}.ngx-geo-btn{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border:none;background:transparent;cursor:pointer;color:#6366f1;border-radius:0 7px 7px 0;flex-shrink:0;transition:background .15s;mat-icon{font-size:1.1rem;width:1.1rem;height:1.1rem}&:hover:not(:disabled){background:#6366f11a}&:disabled{color:#9ca3af;cursor:not-allowed}}.ngx-switch-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.375rem 0 .75rem}.ngx-range-wrapper{display:flex;flex-direction:column;gap:.25rem;padding-bottom:.75rem;width:100%}.ngx-range-header{display:flex;align-items:center;justify-content:space-between}.ngx-range-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-range-value{font-size:.875rem;font-weight:600;color:#6366f1;min-width:2.5rem;text-align:right}.ngx-slider{width:100%}.ngx-range-limits{display:flex;justify-content:space-between;font-size:.7rem;color:#00000061;margin-top:-.25rem}.ngx-color-field{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-color-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-color-row{display:flex;align-items:center;gap:.75rem}.ngx-color-input{width:48px;height:40px;border:1px solid rgba(0,0,0,.23);border-radius:6px;padding:2px;cursor:pointer;background:transparent}.ngx-color-hex{font-size:.875rem;color:#0009;font-family:monospace}.ngx-mat-standalone-error{font-size:.75rem;color:var(--mat-sys-error, #b00020)}.ngx-phone-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem;width:100%}.ngx-phone-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151)}.ngx-phone-row{display:flex;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-phone-error{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-phone-country{border:none;border-right:1px solid #e5e7eb;background:#f9fafb;padding:0 8px;font-size:.875rem;cursor:pointer;outline:none;min-width:90px;color:#374151;appearance:none;-webkit-appearance:none;&:focus{background:#f3f4f6}}.ngx-phone-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}.ngx-phone-flag-trigger{display:flex;align-items:center;gap:.375rem;border:none;background:transparent;padding:0 .375rem;margin-right:.375rem;cursor:pointer;border-radius:4px;&:hover{background:#0000000a}&:focus-visible{outline:2px solid rgba(99,102,241,.5);outline-offset:1px}}.ngx-phone-flag{font-size:1.25rem;vertical-align:middle;border-radius:2px;box-shadow:0 0 0 1px #00000014}.ngx-phone-menu-list .ngx-phone-flag{font-size:1.125rem}.ngx-phone-dial-code{font-size:.875rem;color:#0009}.ngx-phone-caret{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#00000073}.ngx-phone-menu-search{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-bottom:1px solid rgba(0,0,0,.08);.ngx-phone-menu-search-icon{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#0006}input{flex:1;min-width:0;border:none;outline:none;font-size:.875rem;background:transparent;&::placeholder{color:#0006}}}.ngx-phone-menu-list{max-height:260px;overflow-y:auto}.ngx-phone-menu-list ::ng-deep .mat-mdc-menu-item-text{display:flex;align-items:center;gap:.625rem;width:100%}.ngx-phone-menu-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}.ngx-phone-menu-dial{font-size:.8125rem;color:#00000080}.ngx-phone-menu-empty{padding:.75rem;text-align:center;font-size:.8125rem;color:#00000073}.ngx-options-loading,.ngx-options-loading-inline{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:#00000073}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { 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: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i4.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i4.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i5.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] }); }
|
|
1974
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;width:100%;--ngx-field-color: inherit;--ngx-field-bg: transparent;--ngx-field-align: left}:host ::ng-deep .mat-mdc-input-element{color:var(--ngx-field-color)!important;text-align:var(--ngx-field-align)!important}:host ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--ngx-field-bg)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__leading,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__notch,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__trailing{border-color:var(--ngx-border-color)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:before,:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:after{border-bottom-color:var(--ngx-border-color)!important}:host[style*=--ngx-label-color] ::ng-deep .mdc-floating-label,:host[style*=--ngx-label-color] ::ng-deep .mat-mdc-floating-label{color:var(--ngx-label-color)!important}::ng-deep .ngx-phone-menu{min-width:280px}.ngx-affix-text{font-size:.9em;color:#0000008a;padding:0 2px}.ngx-mat-field{width:100%}.ngx-simple-field{display:flex;flex-direction:column;gap:.375rem;width:100%;padding-bottom:.75rem}.ngx-simple-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151);line-height:1.25}.ngx-simple-required{color:#ef4444}.ngx-simple-input-row{display:flex;align-items:center;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;background:#fff;transition:border-color .15s,box-shadow .15s;overflow:hidden;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-simple-error-border{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-simple-input,.ngx-simple-select,textarea.ngx-simple-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;resize:vertical;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}textarea.ngx-simple-input{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;transition:border-color .15s,box-shadow .15s;width:100%;box-sizing:border-box;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-select{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;width:100%;box-sizing:border-box;transition:border-color .15s,box-shadow .15s;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .75rem center;background-size:1.25em;appearance:none;-webkit-appearance:none;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-icon{font-size:1.1rem;width:1.1rem;height:1.1rem;color:#9ca3af;padding:0 0 0 .75rem;flex-shrink:0}.ngx-simple-affix{font-size:.9rem;color:#6b7280;flex-shrink:0;white-space:nowrap}.ngx-simple-prefix{padding-left:.75rem}.ngx-simple-suffix{padding-right:.75rem}.ngx-simple-hint{font-size:.75rem;color:#6b7280}.ngx-simple-error-msg{font-size:.75rem;color:#ef4444}.ngx-simple-loading{display:flex;align-items:center;gap:.5rem;padding:.5rem 0;font-size:.8125rem;color:#9ca3af}.ngx-radio-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.25rem 0 .75rem}.ngx-radio-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-radio-group{display:flex;flex-wrap:wrap;gap:.75rem}.ngx-checkbox-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.25rem 0}.ngx-file-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-file-label{font-size:.875rem;font-weight:500;color:#000000de}.ngx-file-input-native{display:none}.ngx-file-dropzone{display:flex;flex-direction:column;align-items:center;gap:.375rem;width:100%;border:1.5px dashed rgba(0,0,0,.23);border-radius:6px;padding:1.25rem 1rem;font-size:.8125rem;color:#0009;text-align:center;cursor:pointer;background:#00000004;transition:border-color .15s,background-color .15s}.ngx-file-dropzone:hover:not(:disabled){border-color:#6366f1;background:#6366f10a}.ngx-file-dropzone-active{border-color:#6366f1;background:#6366f10f}.ngx-file-dropzone:disabled{cursor:not-allowed;opacity:.6}.ngx-file-dropzone mat-icon{color:#0006}.ngx-file-list{display:flex;flex-direction:column;gap:.375rem}.ngx-file-chip{display:flex;align-items:center;gap:.5rem;border:1px solid rgba(0,0,0,.12);border-radius:6px;padding:.5rem .625rem;background:#00000004}.ngx-file-chip mat-icon{color:#6366f1;flex-shrink:0}.ngx-file-chip-name{flex:1;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-file-chip-size{font-size:.75rem;color:#00000080;flex-shrink:0}.ngx-file-chip-remove{display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:#0006;flex-shrink:0}.ngx-file-chip-remove:hover{color:#dc2626}.ngx-file-chip-remove mat-icon{font-size:18px;width:18px;height:18px}.ngx-file-add-more{display:flex;align-items:center;gap:.25rem;align-self:flex-start;border:none;background:transparent;color:#6366f1;font-size:.8125rem;cursor:pointer;padding:.25rem 0}.ngx-geo-btn{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border:none;background:transparent;cursor:pointer;color:#6366f1;border-radius:0 7px 7px 0;flex-shrink:0;transition:background .15s;mat-icon{font-size:1.1rem;width:1.1rem;height:1.1rem}&:hover:not(:disabled){background:#6366f11a}&:disabled{color:#9ca3af;cursor:not-allowed}}.ngx-switch-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.375rem 0 .75rem}.ngx-range-wrapper{display:flex;flex-direction:column;gap:.25rem;padding-bottom:.75rem;width:100%}.ngx-range-header{display:flex;align-items:center;justify-content:space-between}.ngx-range-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-range-value{font-size:.875rem;font-weight:600;color:#6366f1;min-width:2.5rem;text-align:right}.ngx-slider{width:100%}.ngx-range-limits{display:flex;justify-content:space-between;font-size:.7rem;color:#00000061;margin-top:-.25rem}.ngx-color-field{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-color-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-color-row{display:flex;align-items:center;gap:.75rem}.ngx-color-input{width:48px;height:40px;border:1px solid rgba(0,0,0,.23);border-radius:6px;padding:2px;cursor:pointer;background:transparent}.ngx-color-hex{font-size:.875rem;color:#0009;font-family:monospace}.ngx-mat-standalone-error{font-size:.75rem;color:var(--mat-sys-error, #b00020)}.ngx-phone-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem;width:100%}.ngx-phone-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151)}.ngx-phone-row{display:flex;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-phone-error{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-phone-country{border:none;border-right:1px solid #e5e7eb;background:#f9fafb;padding:0 8px;font-size:.875rem;cursor:pointer;outline:none;min-width:90px;color:#374151;appearance:none;-webkit-appearance:none;&:focus{background:#f3f4f6}}.ngx-phone-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}.ngx-phone-flag-trigger{display:flex;align-items:center;gap:.375rem;border:none;background:transparent;padding:0 .375rem;margin-right:.375rem;cursor:pointer;border-radius:4px;&:hover{background:#0000000a}&:focus-visible{outline:2px solid rgba(99,102,241,.5);outline-offset:1px}}.ngx-phone-flag{font-size:1.25rem;vertical-align:middle;border-radius:2px;box-shadow:0 0 0 1px #00000014}.ngx-phone-menu-list .ngx-phone-flag{font-size:1.125rem}.ngx-phone-dial-code{font-size:.875rem;color:#0009}.ngx-phone-caret{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#00000073}.ngx-phone-menu-search{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-bottom:1px solid rgba(0,0,0,.08);.ngx-phone-menu-search-icon{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#0006}input{flex:1;min-width:0;border:none;outline:none;font-size:.875rem;background:transparent;&::placeholder{color:#0006}}}.ngx-phone-menu-list{max-height:260px;overflow-y:auto}.ngx-phone-menu-list ::ng-deep .mat-mdc-menu-item-text{display:flex;align-items:center;gap:.625rem;width:100%}.ngx-phone-menu-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}.ngx-phone-menu-dial{font-size:.8125rem;color:#00000080}.ngx-phone-menu-empty{padding:.75rem;text-align:center;font-size:.8125rem;color:#00000073}.ngx-options-loading,.ngx-options-loading-inline{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:#00000073}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { 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: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i4.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i4.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i5.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] }); }
|
|
1731
1975
|
}
|
|
1732
1976
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DynamicFieldComponent, decorators: [{
|
|
1733
1977
|
type: Component,
|
|
@@ -2059,14 +2303,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
2059
2303
|
}
|
|
2060
2304
|
</label>
|
|
2061
2305
|
}
|
|
2062
|
-
|
|
2306
|
+
|
|
2307
|
+
<input #fileInput
|
|
2063
2308
|
type="file"
|
|
2064
2309
|
[id]="field.key"
|
|
2065
2310
|
[accept]="field.accept || '*'"
|
|
2066
2311
|
[multiple]="field.multiple || false"
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2312
|
+
[disabled]="field.disabled || field.readonly || false"
|
|
2313
|
+
(change)="onFileInputChange($event)"
|
|
2314
|
+
class="ngx-file-input-native" />
|
|
2315
|
+
|
|
2316
|
+
@if (selectedFiles.length === 0) {
|
|
2317
|
+
<button type="button"
|
|
2318
|
+
class="ngx-file-dropzone"
|
|
2319
|
+
[class.ngx-file-dropzone-active]="fileDragging"
|
|
2320
|
+
[disabled]="field.disabled || field.readonly || false"
|
|
2321
|
+
(click)="fileInput.click()"
|
|
2322
|
+
(dragover)="onFileDragOver($event)"
|
|
2323
|
+
(dragleave)="onFileDragLeave($event)"
|
|
2324
|
+
(drop)="onFileDrop($event)"
|
|
2325
|
+
>
|
|
2326
|
+
<mat-icon>cloud_upload</mat-icon>
|
|
2327
|
+
<span><strong>Cliquez pour choisir</strong> ou glissez-déposez{{ field.multiple ? ' un ou plusieurs fichiers' : ' un fichier' }}</span>
|
|
2328
|
+
</button>
|
|
2329
|
+
} @else {
|
|
2330
|
+
<div class="ngx-file-list">
|
|
2331
|
+
@for (file of selectedFiles; track file.name + file.size; let fi = $index) {
|
|
2332
|
+
<div class="ngx-file-chip">
|
|
2333
|
+
<mat-icon>description</mat-icon>
|
|
2334
|
+
<span class="ngx-file-chip-name">{{ file.name }}</span>
|
|
2335
|
+
<span class="ngx-file-chip-size">{{ formatFileSize(file.size) }}</span>
|
|
2336
|
+
@if (!field.disabled && !field.readonly) {
|
|
2337
|
+
<button type="button" class="ngx-file-chip-remove" (click)="removeFile(fi, fileInput)" title="Retirer">
|
|
2338
|
+
<mat-icon>close</mat-icon>
|
|
2339
|
+
</button>
|
|
2340
|
+
}
|
|
2341
|
+
</div>
|
|
2342
|
+
}
|
|
2343
|
+
@if (field.multiple && !field.disabled && !field.readonly) {
|
|
2344
|
+
<button type="button" class="ngx-file-add-more" (click)="fileInput.click()">
|
|
2345
|
+
<mat-icon>add</mat-icon> Ajouter un fichier
|
|
2346
|
+
</button>
|
|
2347
|
+
}
|
|
2348
|
+
</div>
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
@if (field.hint && !hasError) { <small class="ngx-hint">{{ field.hint }}</small> }
|
|
2352
|
+
@if (hasError) { <small class="ngx-mat-standalone-error">{{ errorMessage }}</small> }
|
|
2070
2353
|
</div>
|
|
2071
2354
|
|
|
2072
2355
|
} @else if (field.type === 'phone') {
|
|
@@ -2141,6 +2424,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
2141
2424
|
} @else if (field.type === 'hidden') {
|
|
2142
2425
|
<input type="hidden" [formControl]="formControl" />
|
|
2143
2426
|
|
|
2427
|
+
} @else if (field.type === 'iso-country') {
|
|
2428
|
+
@if (isSimple) {
|
|
2429
|
+
<div class="ngx-simple-field">
|
|
2430
|
+
@if (field.label) {
|
|
2431
|
+
<label class="ngx-simple-label" [for]="field.key">
|
|
2432
|
+
{{ field.label }}@if (field.validation?.required) { <span class="ngx-simple-required"> *</span> }
|
|
2433
|
+
</label>
|
|
2434
|
+
}
|
|
2435
|
+
<input [id]="field.key" class="ngx-simple-input"
|
|
2436
|
+
type="text"
|
|
2437
|
+
[formControl]="isoCountrySearchCtrl"
|
|
2438
|
+
[matAutocomplete]="isoCountryAutoSimple"
|
|
2439
|
+
[placeholder]="field.placeholder || 'Nom du pays ou code…'"
|
|
2440
|
+
[readonly]="field.readonly || false" />
|
|
2441
|
+
<mat-autocomplete #isoCountryAutoSimple="matAutocomplete" [displayWith]="displayIsoCountry" (optionSelected)="onIsoCountrySelected($event)">
|
|
2442
|
+
@for (c of filteredIsoCountries; track c.code) {
|
|
2443
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.code }})</mat-option>
|
|
2444
|
+
}
|
|
2445
|
+
</mat-autocomplete>
|
|
2446
|
+
@if (field.hint && !hasError) { <small class="ngx-simple-hint">{{ field.hint }}</small> }
|
|
2447
|
+
@if (hasError) { <small class="ngx-simple-error-msg">{{ errorMessage }}</small> }
|
|
2448
|
+
</div>
|
|
2449
|
+
} @else {
|
|
2450
|
+
<mat-form-field [appearance]="matAppearance" [floatLabel]="resolvedFloatLabel" class="ngx-mat-field">
|
|
2451
|
+
@if (field.label) { <mat-label>{{ field.label }}</mat-label> }
|
|
2452
|
+
<input matInput [id]="field.key"
|
|
2453
|
+
type="text"
|
|
2454
|
+
[formControl]="isoCountrySearchCtrl"
|
|
2455
|
+
[matAutocomplete]="isoCountryAuto"
|
|
2456
|
+
[placeholder]="field.placeholder || 'Nom du pays ou code…'"
|
|
2457
|
+
[readonly]="field.readonly || false" />
|
|
2458
|
+
<mat-autocomplete #isoCountryAuto="matAutocomplete" [displayWith]="displayIsoCountry" (optionSelected)="onIsoCountrySelected($event)">
|
|
2459
|
+
@for (c of filteredIsoCountries; track c.code) {
|
|
2460
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.code }})</mat-option>
|
|
2461
|
+
}
|
|
2462
|
+
</mat-autocomplete>
|
|
2463
|
+
@if (field.hint) { <mat-hint>{{ field.hint }}</mat-hint> }
|
|
2464
|
+
<mat-error>{{ errorMessage }}</mat-error>
|
|
2465
|
+
</mat-form-field>
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
} @else if (field.type === 'country-dial-code') {
|
|
2469
|
+
@if (isSimple) {
|
|
2470
|
+
<div class="ngx-simple-field">
|
|
2471
|
+
@if (field.label) {
|
|
2472
|
+
<label class="ngx-simple-label" [for]="field.key">
|
|
2473
|
+
{{ field.label }}@if (field.validation?.required) { <span class="ngx-simple-required"> *</span> }
|
|
2474
|
+
</label>
|
|
2475
|
+
}
|
|
2476
|
+
<input [id]="field.key" class="ngx-simple-input"
|
|
2477
|
+
type="text"
|
|
2478
|
+
[formControl]="dialCodeSearchCtrl"
|
|
2479
|
+
[matAutocomplete]="dialCodeAutoSimple"
|
|
2480
|
+
[placeholder]="field.placeholder || 'Nom du pays, indicatif ou code…'"
|
|
2481
|
+
[readonly]="field.readonly || false" />
|
|
2482
|
+
<mat-autocomplete #dialCodeAutoSimple="matAutocomplete" [displayWith]="displayDialCode" (optionSelected)="onDialCodeSelected($event)">
|
|
2483
|
+
@for (c of filteredDialCodeCountries; track c.code) {
|
|
2484
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.dialCode }})</mat-option>
|
|
2485
|
+
}
|
|
2486
|
+
</mat-autocomplete>
|
|
2487
|
+
@if (field.hint && !hasError) { <small class="ngx-simple-hint">{{ field.hint }}</small> }
|
|
2488
|
+
@if (hasError) { <small class="ngx-simple-error-msg">{{ errorMessage }}</small> }
|
|
2489
|
+
</div>
|
|
2490
|
+
} @else {
|
|
2491
|
+
<mat-form-field [appearance]="matAppearance" [floatLabel]="resolvedFloatLabel" class="ngx-mat-field">
|
|
2492
|
+
@if (field.label) { <mat-label>{{ field.label }}</mat-label> }
|
|
2493
|
+
<input matInput [id]="field.key"
|
|
2494
|
+
type="text"
|
|
2495
|
+
[formControl]="dialCodeSearchCtrl"
|
|
2496
|
+
[matAutocomplete]="dialCodeAuto"
|
|
2497
|
+
[placeholder]="field.placeholder || 'Nom du pays, indicatif ou code…'"
|
|
2498
|
+
[readonly]="field.readonly || false" />
|
|
2499
|
+
<mat-autocomplete #dialCodeAuto="matAutocomplete" [displayWith]="displayDialCode" (optionSelected)="onDialCodeSelected($event)">
|
|
2500
|
+
@for (c of filteredDialCodeCountries; track c.code) {
|
|
2501
|
+
<mat-option [value]="c"><span class="fi fi-{{ c.code.toLowerCase() }} ngx-phone-flag"></span> {{ c.name }} ({{ c.dialCode }})</mat-option>
|
|
2502
|
+
}
|
|
2503
|
+
</mat-autocomplete>
|
|
2504
|
+
@if (field.hint) { <mat-hint>{{ field.hint }}</mat-hint> }
|
|
2505
|
+
<mat-error>{{ errorMessage }}</mat-error>
|
|
2506
|
+
</mat-form-field>
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2144
2509
|
} @else {
|
|
2145
2510
|
@if (isSimple) {
|
|
2146
2511
|
<div class="ngx-simple-field">
|
|
@@ -2211,7 +2576,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
2211
2576
|
}
|
|
2212
2577
|
}
|
|
2213
2578
|
}
|
|
2214
|
-
`, styles: [":host{display:flex;flex-direction:column;width:100%;--ngx-field-color: inherit;--ngx-field-bg: transparent;--ngx-field-align: left}:host ::ng-deep .mat-mdc-input-element{color:var(--ngx-field-color)!important;text-align:var(--ngx-field-align)!important}:host ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--ngx-field-bg)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__leading,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__notch,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__trailing{border-color:var(--ngx-border-color)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:before,:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:after{border-bottom-color:var(--ngx-border-color)!important}:host[style*=--ngx-label-color] ::ng-deep .mdc-floating-label,:host[style*=--ngx-label-color] ::ng-deep .mat-mdc-floating-label{color:var(--ngx-label-color)!important}::ng-deep .ngx-phone-menu{min-width:280px}.ngx-affix-text{font-size:.9em;color:#0000008a;padding:0 2px}.ngx-mat-field{width:100%}.ngx-simple-field{display:flex;flex-direction:column;gap:.375rem;width:100%;padding-bottom:.75rem}.ngx-simple-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151);line-height:1.25}.ngx-simple-required{color:#ef4444}.ngx-simple-input-row{display:flex;align-items:center;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;background:#fff;transition:border-color .15s,box-shadow .15s;overflow:hidden;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-simple-error-border{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-simple-input,.ngx-simple-select,textarea.ngx-simple-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;resize:vertical;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}textarea.ngx-simple-input{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;transition:border-color .15s,box-shadow .15s;width:100%;box-sizing:border-box;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-select{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;width:100%;box-sizing:border-box;transition:border-color .15s,box-shadow .15s;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .75rem center;background-size:1.25em;appearance:none;-webkit-appearance:none;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-icon{font-size:1.1rem;width:1.1rem;height:1.1rem;color:#9ca3af;padding:0 0 0 .75rem;flex-shrink:0}.ngx-simple-affix{font-size:.9rem;color:#6b7280;flex-shrink:0;white-space:nowrap}.ngx-simple-prefix{padding-left:.75rem}.ngx-simple-suffix{padding-right:.75rem}.ngx-simple-hint{font-size:.75rem;color:#6b7280}.ngx-simple-error-msg{font-size:.75rem;color:#ef4444}.ngx-simple-loading{display:flex;align-items:center;gap:.5rem;padding:.5rem 0;font-size:.8125rem;color:#9ca3af}.ngx-radio-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.25rem 0 .75rem}.ngx-radio-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-radio-group{display:flex;flex-wrap:wrap;gap:.75rem}.ngx-checkbox-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.25rem 0}.ngx-file-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-file-label{font-size:.875rem;font-weight:500;color:#000000de}.ngx-file-input{border:
|
|
2579
|
+
`, styles: [":host{display:flex;flex-direction:column;width:100%;--ngx-field-color: inherit;--ngx-field-bg: transparent;--ngx-field-align: left}:host ::ng-deep .mat-mdc-input-element{color:var(--ngx-field-color)!important;text-align:var(--ngx-field-align)!important}:host ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--ngx-field-bg)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__leading,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__notch,:host[style*=--ngx-border-color] ::ng-deep .mdc-notched-outline__trailing{border-color:var(--ngx-border-color)!important}:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:before,:host[style*=--ngx-border-color] ::ng-deep .mdc-line-ripple:after{border-bottom-color:var(--ngx-border-color)!important}:host[style*=--ngx-label-color] ::ng-deep .mdc-floating-label,:host[style*=--ngx-label-color] ::ng-deep .mat-mdc-floating-label{color:var(--ngx-label-color)!important}::ng-deep .ngx-phone-menu{min-width:280px}.ngx-affix-text{font-size:.9em;color:#0000008a;padding:0 2px}.ngx-mat-field{width:100%}.ngx-simple-field{display:flex;flex-direction:column;gap:.375rem;width:100%;padding-bottom:.75rem}.ngx-simple-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151);line-height:1.25}.ngx-simple-required{color:#ef4444}.ngx-simple-input-row{display:flex;align-items:center;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;background:#fff;transition:border-color .15s,box-shadow .15s;overflow:hidden;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-simple-error-border{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-simple-input,.ngx-simple-select,textarea.ngx-simple-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;resize:vertical;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}textarea.ngx-simple-input{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;transition:border-color .15s,box-shadow .15s;width:100%;box-sizing:border-box;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-select{border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;padding:.625rem .875rem;width:100%;box-sizing:border-box;transition:border-color .15s,box-shadow .15s;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .75rem center;background-size:1.25em;appearance:none;-webkit-appearance:none;&:focus{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f;outline:none}&.ngx-simple-error-border{border-color:#ef4444!important}}.ngx-simple-icon{font-size:1.1rem;width:1.1rem;height:1.1rem;color:#9ca3af;padding:0 0 0 .75rem;flex-shrink:0}.ngx-simple-affix{font-size:.9rem;color:#6b7280;flex-shrink:0;white-space:nowrap}.ngx-simple-prefix{padding-left:.75rem}.ngx-simple-suffix{padding-right:.75rem}.ngx-simple-hint{font-size:.75rem;color:#6b7280}.ngx-simple-error-msg{font-size:.75rem;color:#ef4444}.ngx-simple-loading{display:flex;align-items:center;gap:.5rem;padding:.5rem 0;font-size:.8125rem;color:#9ca3af}.ngx-radio-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.25rem 0 .75rem}.ngx-radio-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-radio-group{display:flex;flex-wrap:wrap;gap:.75rem}.ngx-checkbox-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.25rem 0}.ngx-file-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-file-label{font-size:.875rem;font-weight:500;color:#000000de}.ngx-file-input-native{display:none}.ngx-file-dropzone{display:flex;flex-direction:column;align-items:center;gap:.375rem;width:100%;border:1.5px dashed rgba(0,0,0,.23);border-radius:6px;padding:1.25rem 1rem;font-size:.8125rem;color:#0009;text-align:center;cursor:pointer;background:#00000004;transition:border-color .15s,background-color .15s}.ngx-file-dropzone:hover:not(:disabled){border-color:#6366f1;background:#6366f10a}.ngx-file-dropzone-active{border-color:#6366f1;background:#6366f10f}.ngx-file-dropzone:disabled{cursor:not-allowed;opacity:.6}.ngx-file-dropzone mat-icon{color:#0006}.ngx-file-list{display:flex;flex-direction:column;gap:.375rem}.ngx-file-chip{display:flex;align-items:center;gap:.5rem;border:1px solid rgba(0,0,0,.12);border-radius:6px;padding:.5rem .625rem;background:#00000004}.ngx-file-chip mat-icon{color:#6366f1;flex-shrink:0}.ngx-file-chip-name{flex:1;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-file-chip-size{font-size:.75rem;color:#00000080;flex-shrink:0}.ngx-file-chip-remove{display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:#0006;flex-shrink:0}.ngx-file-chip-remove:hover{color:#dc2626}.ngx-file-chip-remove mat-icon{font-size:18px;width:18px;height:18px}.ngx-file-add-more{display:flex;align-items:center;gap:.25rem;align-self:flex-start;border:none;background:transparent;color:#6366f1;font-size:.8125rem;cursor:pointer;padding:.25rem 0}.ngx-geo-btn{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border:none;background:transparent;cursor:pointer;color:#6366f1;border-radius:0 7px 7px 0;flex-shrink:0;transition:background .15s;mat-icon{font-size:1.1rem;width:1.1rem;height:1.1rem}&:hover:not(:disabled){background:#6366f11a}&:disabled{color:#9ca3af;cursor:not-allowed}}.ngx-switch-wrapper{display:flex;flex-direction:column;gap:.25rem;padding:.375rem 0 .75rem}.ngx-range-wrapper{display:flex;flex-direction:column;gap:.25rem;padding-bottom:.75rem;width:100%}.ngx-range-header{display:flex;align-items:center;justify-content:space-between}.ngx-range-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-range-value{font-size:.875rem;font-weight:600;color:#6366f1;min-width:2.5rem;text-align:right}.ngx-slider{width:100%}.ngx-range-limits{display:flex;justify-content:space-between;font-size:.7rem;color:#00000061;margin-top:-.25rem}.ngx-color-field{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem}.ngx-color-label{font-size:.875rem;font-weight:500;color:#0009}.ngx-color-row{display:flex;align-items:center;gap:.75rem}.ngx-color-input{width:48px;height:40px;border:1px solid rgba(0,0,0,.23);border-radius:6px;padding:2px;cursor:pointer;background:transparent}.ngx-color-hex{font-size:.875rem;color:#0009;font-family:monospace}.ngx-mat-standalone-error{font-size:.75rem;color:var(--mat-sys-error, #b00020)}.ngx-phone-wrapper{display:flex;flex-direction:column;gap:.375rem;padding-bottom:.75rem;width:100%}.ngx-phone-label{font-size:.875rem;font-weight:500;color:var(--ngx-label-color, #374151)}.ngx-phone-row{display:flex;border:1px solid var(--ngx-border-color, #d1d5db);border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s;&:focus-within{border-color:var(--ngx-border-color, #6366f1);box-shadow:0 0 0 3px #6366f11f}&.ngx-phone-error{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef44441a}}.ngx-phone-country{border:none;border-right:1px solid #e5e7eb;background:#f9fafb;padding:0 8px;font-size:.875rem;cursor:pointer;outline:none;min-width:90px;color:#374151;appearance:none;-webkit-appearance:none;&:focus{background:#f3f4f6}}.ngx-phone-input{flex:1;min-width:0;padding:.625rem .875rem;border:none;outline:none;background:transparent;font-size:.9375rem;color:#111827;font-family:inherit;&::placeholder{color:#9ca3af}&:disabled{background:#f9fafb;cursor:not-allowed;color:#6b7280}}.ngx-phone-flag-trigger{display:flex;align-items:center;gap:.375rem;border:none;background:transparent;padding:0 .375rem;margin-right:.375rem;cursor:pointer;border-radius:4px;&:hover{background:#0000000a}&:focus-visible{outline:2px solid rgba(99,102,241,.5);outline-offset:1px}}.ngx-phone-flag{font-size:1.25rem;vertical-align:middle;border-radius:2px;box-shadow:0 0 0 1px #00000014}.ngx-phone-menu-list .ngx-phone-flag{font-size:1.125rem}.ngx-phone-dial-code{font-size:.875rem;color:#0009}.ngx-phone-caret{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#00000073}.ngx-phone-menu-search{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-bottom:1px solid rgba(0,0,0,.08);.ngx-phone-menu-search-icon{width:1.125rem;height:1.125rem;font-size:1.125rem;color:#0006}input{flex:1;min-width:0;border:none;outline:none;font-size:.875rem;background:transparent;&::placeholder{color:#0006}}}.ngx-phone-menu-list{max-height:260px;overflow-y:auto}.ngx-phone-menu-list ::ng-deep .mat-mdc-menu-item-text{display:flex;align-items:center;gap:.625rem;width:100%}.ngx-phone-menu-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}.ngx-phone-menu-dial{font-size:.8125rem;color:#00000080}.ngx-phone-menu-empty{padding:.75rem;text-align:center;font-size:.8125rem;color:#00000073}.ngx-options-loading,.ngx-options-loading-inline{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:#00000073}\n"] }]
|
|
2215
2580
|
}], propDecorators: { field: [{
|
|
2216
2581
|
type: Input,
|
|
2217
2582
|
args: [{ required: true }]
|
|
@@ -2915,6 +3280,8 @@ const FIELD_TYPES = [
|
|
|
2915
3280
|
{ type: 'color', label: 'Couleur', icon: 'palette', group: 'Saisie' },
|
|
2916
3281
|
{ type: 'location', label: 'Géolocalisation', icon: 'my_location', group: 'Saisie' },
|
|
2917
3282
|
{ type: 'file', label: 'Fichier', icon: 'attach_file', group: 'Saisie' },
|
|
3283
|
+
{ type: 'iso-country', label: 'Code ISO pays', icon: 'flag', group: 'Saisie' },
|
|
3284
|
+
{ type: 'country-dial-code', label: 'Indicatif pays', icon: 'add_call', group: 'Saisie' },
|
|
2918
3285
|
// ── Choix ───────────────────────────────────────────────────────────────────
|
|
2919
3286
|
{ type: 'select', label: 'Liste déroulante', icon: 'arrow_drop_down_circle', group: 'Choix' },
|
|
2920
3287
|
{ type: 'multiselect', label: 'Multi-sélection', icon: 'checklist', group: 'Choix' },
|