@cityway/basic-ui 1.0.2-beta019 → 1.0.2-beta021

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { EventEmitter, OnInit, AfterViewInit, ElementRef, AfterContentInit, OnDestroy, TemplateRef, SimpleChanges } from '@angular/core';
2
+ import { EventEmitter, OnInit, AfterViewInit, ElementRef, AfterContentInit, OnDestroy, OnChanges, TemplateRef, SimpleChanges } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { Options } from '@angular-slider/ngx-slider';
5
5
  export { Options } from '@angular-slider/ngx-slider';
@@ -581,6 +581,7 @@ declare enum SpriteIconEnum {
581
581
  declare class CardComponent implements OnInit, AfterViewInit {
582
582
  private cdRef;
583
583
  readonly title: _angular_core.InputSignal<string>;
584
+ readonly subtitle: _angular_core.InputSignal<string>;
584
585
  readonly type: _angular_core.InputSignal<CardTypeEnum>;
585
586
  readonly titleRank: _angular_core.InputSignal<CardTitleRankEnum>;
586
587
  readonly collapsible: _angular_core.ModelSignal<boolean>;
@@ -605,7 +606,7 @@ declare class CardComponent implements OnInit, AfterViewInit {
605
606
  private updateCollapseState;
606
607
  get collapsed_state(): boolean;
607
608
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardComponent, never>;
608
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "cw-card", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "titleRank": { "alias": "titleRank"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapseId": { "alias": "collapseId"; "required": false; "isSignal": true; }; "destroyOnHide": { "alias": "destroyOnHide"; "required": false; "isSignal": true; }; }, { "collapsible": "collapsibleChange"; "destroyOnHide": "destroyOnHideChange"; "collapseClicked": "collapseClicked"; }, never, ["[header-custom-area]", "*", "[card-footer]"], true, never>;
609
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "cw-card", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "titleRank": { "alias": "titleRank"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapseId": { "alias": "collapseId"; "required": false; "isSignal": true; }; "destroyOnHide": { "alias": "destroyOnHide"; "required": false; "isSignal": true; }; }, { "collapsible": "collapsibleChange"; "destroyOnHide": "destroyOnHideChange"; "collapseClicked": "collapseClicked"; }, never, ["[header-custom-area]", "*", "[card-footer]"], true, never>;
609
610
  }
610
611
 
611
612
  declare class AccordionComponent implements AfterContentInit {
@@ -977,9 +978,44 @@ interface FormFieldRangeOption {
977
978
  step: number;
978
979
  unit?: string;
979
980
  }
981
+ interface FormFieldValidationOption {
982
+ /**
983
+ * Borne minimum.
984
+ * - text/textarea/email/password : nombre min de caractères (number)
985
+ * - number : valeur min (number)
986
+ * - date/time/datetime : string ISO ("2026-01-01", "08:00", "2026-01-01T08:00")
987
+ */
988
+ min?: number | string;
989
+ /** Borne maximum. Même règle de typage que `min`. */
990
+ max?: number | string;
991
+ /** Override de `min` sur le contrôle "start" des périodes (dateToDate, timeToTime, dateTimeToDateTime). */
992
+ minStart?: number | string;
993
+ /** Override de `max` sur le contrôle "start" des périodes. */
994
+ maxStart?: number | string;
995
+ /** Override de `min` sur le contrôle "end" des périodes. */
996
+ minEnd?: number | string;
997
+ /** Override de `max` sur le contrôle "end" des périodes. */
998
+ maxEnd?: number | string;
999
+ /** Regex HTML5, appliquée aux types text/email/password/textarea. */
1000
+ pattern?: string;
1001
+ /** Pas d'incrément : number → ex. 0.01 ; date → jours ; time/datetime → secondes. */
1002
+ step?: number | string;
1003
+ /**
1004
+ * Extensions ou types MIME acceptés pour `type=file`, ex. ['.pdf', '.png', 'image/*'].
1005
+ * Mappé sur l'attribut HTML `accept` et validé côté Angular sur le nom de fichier.
1006
+ */
1007
+ accept?: string[];
1008
+ /** Taille maximale en octets pour `type=file`. */
1009
+ maxSize?: number;
1010
+ /**
1011
+ * Si true, ajoute les Validators Angular correspondants (min/max/minLength/maxLength/pattern)
1012
+ * sur le FormControl, en plus de la validation native HTML5. Sinon, seule la validation native est appliquée.
1013
+ */
1014
+ applyValidators?: boolean;
1015
+ }
980
1016
 
981
1017
  declare function rangeValidator(group: AbstractControl, type: 'date' | 'time' | 'datetime'): ValidationErrors | null;
982
- declare class FormFieldComponent implements OnInit {
1018
+ declare class FormFieldComponent implements OnInit, OnChanges {
983
1019
  control: AbstractControl;
984
1020
  formGroup: FormGroup;
985
1021
  type: FormFieldTypeEnum;
@@ -989,6 +1025,30 @@ declare class FormFieldComponent implements OnInit {
989
1025
  placeholder: string;
990
1026
  options: FormFieldOption[];
991
1027
  rangeOptions: FormFieldRangeOption;
1028
+ validationOptions?: FormFieldValidationOption;
1029
+ /**
1030
+ * Map d'un code d'erreur (clé de `control.errors`) vers une clé i18n.
1031
+ *
1032
+ * Chaque entrée est rendue dans le bloc `<div class="field-invalid">`, à la suite
1033
+ * des messages déjà gérés en dur par la lib (`required`, `rangeInvalid`,
1034
+ * `fileExtension`, `fileSize`).
1035
+ *
1036
+ * Les paramètres du `translate` proviennent de `control.errors[code]` :
1037
+ * - pour une erreur-objet (ex. `{ duplicateCode: { existing: 'ABC' } }`),
1038
+ * `{{existing}}` est interpolé dans la traduction ;
1039
+ * - pour `required` (erreur = `true`), aucun paramètre n'est passé.
1040
+ *
1041
+ * Une entrée dont le code matche un des 4 builtins **prend le pas** sur le
1042
+ * rendu hardcodé (override ponctuel, pas de doublon).
1043
+ *
1044
+ * L'ordre d'affichage suit l'ordre d'insertion des clés (cf. `keepOrder`).
1045
+ *
1046
+ * Limitation : sur les types période (`dateToDate`, `timeToTime`,
1047
+ * `dateTimeToDateTime`), l'override `required` ne porte que sur le `FormGroup`
1048
+ * lui-même — les `required` posés sur les sous-controls `start`/`end`
1049
+ * continuent d'afficher le wording natif.
1050
+ */
1051
+ errorMessages?: Record<string, string>;
992
1052
  isRequired: boolean;
993
1053
  help?: string;
994
1054
  tooltip: string;
@@ -1003,13 +1063,13 @@ declare class FormFieldComponent implements OnInit {
1003
1063
  skeletonMode?: boolean;
1004
1064
  clearable?: boolean;
1005
1065
  appendTo?: string | null;
1006
- /**
1007
- * Force l'état HTML natif `indeterminate` sur l'input checkbox (3ème état visuel,
1008
- * carré barré). Indépendant de `value` du FormControl. Ignoré pour les types
1009
- * autres que checkbox / checkboxInline / checkboxButton.
1010
- */
1011
1066
  readonly indeterminate: _angular_core.InputSignal<boolean>;
1012
1067
  private readonly checkboxInputRef;
1068
+ private readonly fileInputRef;
1069
+ /** True si on a ajouté `Validators.required` nous-mêmes — sert à ne retirer que ce qu'on a mis. */
1070
+ private requiredAppliedMain;
1071
+ private requiredAppliedStart;
1072
+ private requiredAppliedEnd;
1013
1073
  refreshEvent: EventEmitter<void>;
1014
1074
  textChanged: EventEmitter<string>;
1015
1075
  valueChange: EventEmitter<any>;
@@ -1019,6 +1079,8 @@ declare class FormFieldComponent implements OnInit {
1019
1079
  readonly spriteIcon: typeof SpriteIconEnum;
1020
1080
  readonly buttonType: typeof BoButtonTypeEnum;
1021
1081
  readonly buttonIconSize: typeof ButtonIconSizeEnum;
1082
+ /** Comparator passé au pipe `keyvalue` pour préserver l'ordre d'insertion de `errorMessages`. */
1083
+ readonly keepOrder: () => number;
1022
1084
  get hostClasses(): string;
1023
1085
  constructor();
1024
1086
  isCheckboxType(): boolean;
@@ -1032,10 +1094,61 @@ declare class FormFieldComponent implements OnInit {
1032
1094
  * pour que `control.disable()` ne soit pas écrasé par le binding du template.
1033
1095
  */
1034
1096
  get isEffectivelyDisabled(): boolean;
1097
+ /** Types dont min/max représentent un nombre de caractères (→ minlength/maxlength). */
1098
+ private isTextLengthBased;
1099
+ get minLengthAttr(): number | string | null;
1100
+ get maxLengthAttr(): number | string | null;
1101
+ get minAttr(): number | string | null;
1102
+ get maxAttr(): number | string | null;
1103
+ get minStartAttr(): number | string | null;
1104
+ get maxStartAttr(): number | string | null;
1105
+ get minEndAttr(): number | string | null;
1106
+ get maxEndAttr(): number | string | null;
1107
+ get stepAttr(): number | string | null;
1108
+ get patternAttr(): string | null;
1109
+ get acceptAttr(): string | null;
1110
+ /** Formate une taille en octets en "Ko" si < 1000 Ko, sinon en "Mo" (ex. "500 Ko", "2 Mo"). */
1111
+ formatFileSize(bytes: number): string;
1112
+ get maxSizeLabel(): string;
1113
+ get acceptLabel(): string;
1114
+ /**
1115
+ * Lignes d'aide auto-générées à partir de `validationOptions`, affichées après le `help` input.
1116
+ * Couvre : longueur min/max sur les types texte, valeur min/max sur number, et accept/maxSize sur file.
1117
+ */
1118
+ /**
1119
+ * Concatène les ids à exposer dans `aria-describedby` :
1120
+ * l'id du bloc d'erreur (si le control est invalide+touched) et l'id du bloc help (si présent).
1121
+ * Retourne `null` si aucun, pour ne pas polluer le DOM avec un attribut vide.
1122
+ */
1123
+ getDescribedBy(target: AbstractControl | null | undefined): string | null;
1124
+ get autoHelpEntries(): Array<{
1125
+ key: string;
1126
+ params?: Record<string, unknown>;
1127
+ }>;
1035
1128
  ngOnInit(): void;
1129
+ /**
1130
+ * Synchronise `Validators.required` sur le control lié en fonction de `isRequired`.
1131
+ * - Ne mute que ce qui a été ajouté ici (tracking via flags) pour ne pas écraser un validator du parent.
1132
+ * - Étend aux sous-controls `start`/`end` pour les types période.
1133
+ */
1134
+ private syncRequiredValidator;
1135
+ /** Ajoute/retire `Validators.required` selon `isRequired`, et retourne le nouveau flag "appliqué par nous". */
1136
+ private toggleRequired;
1137
+ /**
1138
+ * Reflète les options de validation HTML dans les Validators Angular du contrôle lié,
1139
+ * pour que `control.invalid` réponde aux mêmes règles que la validation native du navigateur.
1140
+ */
1141
+ private applyAngularValidators;
1142
+ /** Validator d'extension/MIME : vérifie que le File ou son nom matche l'une des entrées `accept`. */
1143
+ private makeFileExtensionValidator;
1144
+ /** Validator de taille : vérifie que le File a une taille <= maxSize (octets). */
1145
+ private makeFileSizeValidator;
1146
+ /** Validator générique de borne pour les types date/time/datetime (comparaison lexicographique sur string ISO). */
1147
+ private makeBoundValidator;
1036
1148
  ngOnChanges(changes: SimpleChanges): void;
1037
1149
  onCheckboxChange(event: Event): void;
1038
1150
  onRadioChange(value: any): void;
1151
+ onFileChange(event: Event): void;
1039
1152
  onBlur(): void;
1040
1153
  isInInputGroup(): boolean;
1041
1154
  getControl(path: 'start' | 'end'): FormControl | null;
@@ -1050,7 +1163,7 @@ declare class FormFieldComponent implements OnInit {
1050
1163
  getRangePercent(): number;
1051
1164
  onRangeStep(direction: 'increase' | 'decrease'): void;
1052
1165
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldComponent, never>;
1053
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "cw-form-field", never, { "control": { "alias": "control"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "type": { "alias": "type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "displayLabel": { "alias": "displayLabel"; "required": false; }; "name": { "alias": "name"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "rangeOptions": { "alias": "rangeOptions"; "required": false; }; "isRequired": { "alias": "isRequired"; "required": false; }; "help": { "alias": "help"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "addonLeft": { "alias": "addonLeft"; "required": false; }; "addonRight": { "alias": "addonRight"; "required": false; }; "isInAddon": { "alias": "isInAddon"; "required": false; }; "isReadonly": { "alias": "isReadonly"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "sliderValue": { "alias": "sliderValue"; "required": false; }; "sliderOptions": { "alias": "sliderOptions"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "skeletonMode": { "alias": "skeletonMode"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; }, { "refreshEvent": "refreshEvent"; "textChanged": "textChanged"; "valueChange": "valueChange"; }, ["optionTemplate", "labelTemplate"], never, true, never>;
1166
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldComponent, "cw-form-field", never, { "control": { "alias": "control"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "type": { "alias": "type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "displayLabel": { "alias": "displayLabel"; "required": false; }; "name": { "alias": "name"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "rangeOptions": { "alias": "rangeOptions"; "required": false; }; "validationOptions": { "alias": "validationOptions"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "isRequired": { "alias": "isRequired"; "required": false; }; "help": { "alias": "help"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "addonLeft": { "alias": "addonLeft"; "required": false; }; "addonRight": { "alias": "addonRight"; "required": false; }; "isInAddon": { "alias": "isInAddon"; "required": false; }; "isReadonly": { "alias": "isReadonly"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "sliderValue": { "alias": "sliderValue"; "required": false; }; "sliderOptions": { "alias": "sliderOptions"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "skeletonMode": { "alias": "skeletonMode"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; }, { "refreshEvent": "refreshEvent"; "textChanged": "textChanged"; "valueChange": "valueChange"; }, ["optionTemplate", "labelTemplate"], never, true, never>;
1054
1167
  }
1055
1168
 
1056
1169
  declare class IconComponent {
@@ -1375,6 +1488,23 @@ declare class RequiredInfoComponent {
1375
1488
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RequiredInfoComponent, "cw-required-info", never, { "allFieldsRequired": { "alias": "allFieldsRequired"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1376
1489
  }
1377
1490
 
1491
+ interface CwBreadcrumbItem {
1492
+ /** Clé i18n OU chaîne brute. La lib applique `| translate` en interne. */
1493
+ label: string;
1494
+ /** Cible RouterLink. Si `undefined` ou si `isCurrent === true`, l'item est rendu en <span> non cliquable. */
1495
+ link?: string;
1496
+ /** Marque le segment courant. Rendu en <span> avec `aria-current="page"`, même si `link` est défini. */
1497
+ isCurrent?: boolean;
1498
+ }
1499
+
1500
+ declare class BreadcrumbComponent {
1501
+ readonly items: _angular_core.InputSignal<CwBreadcrumbItem[]>;
1502
+ readonly ariaLabel: _angular_core.InputSignal<string>;
1503
+ isClickable(item: CwBreadcrumbItem): boolean;
1504
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BreadcrumbComponent, never>;
1505
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BreadcrumbComponent, "cw-breadcrumb", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1506
+ }
1507
+
1378
1508
  declare class ClickOutsideDirective {
1379
1509
  private elementRef;
1380
1510
  clickOutside: EventEmitter<void>;
@@ -1449,5 +1579,5 @@ interface DataCustomListGroup {
1449
1579
  fields: DataCustomList[];
1450
1580
  }
1451
1581
 
1452
- export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
1453
- export type { Attachment, DataCustomList, DataCustomListGroup, DataLegend, FormFieldOption, FormFieldRangeOption, Legend, ModalConfig, ModalRef, ShowToastOptions, SkipLink, Toast, ToastAction };
1582
+ export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, BreadcrumbComponent, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, DropdownPositionEnum, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TOAST_AUTOHIDE_DELAY_MS, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastItemComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
1583
+ export type { Attachment, CwBreadcrumbItem, DataCustomList, DataCustomListGroup, DataLegend, FormFieldOption, FormFieldRangeOption, FormFieldValidationOption, Legend, ModalConfig, ModalRef, ShowToastOptions, SkipLink, Toast, ToastAction };
@@ -30,6 +30,7 @@
30
30
  "IMPORT": "Import",
31
31
  "PUBLISH": "Publish",
32
32
  "REFRESH": "Refresh",
33
+ "RESET": "Reset",
33
34
  "RESTORE": "Restore",
34
35
  "SAVE": "Save",
35
36
  "SEARCH": "Search",
@@ -66,7 +67,8 @@
66
67
  "CHANGE": "Change application"
67
68
  },
68
69
  "_BREADCRUMB": {
69
- "HOME": "Home"
70
+ "HOME": "Home",
71
+ "NAV_LABEL": "Breadcrumb"
70
72
  },
71
73
  "_DATES": {
72
74
  "CALENDAR": "Calendar",
@@ -120,6 +122,16 @@
120
122
  "ERROR_INVALID_EMAIL": "Invalid email format. Example : contact@mail.com",
121
123
  "ERROR_IS_MANDATORY": " is mandatory.",
122
124
  "ERROR_IS_ONLY_NUMERIC": " must only be composed of numbers.",
125
+ "ERROR_FILE_EXTENSION": "File format not allowed. Accepted formats: {{accept}}.",
126
+ "ERROR_FILE_SIZE": "File is too large. Maximum allowed size: {{maxSize}}.",
127
+ "HELP_LENGTH_MIN": "Minimum {{min}} characters.",
128
+ "HELP_LENGTH_MAX": "Maximum {{max}} characters.",
129
+ "HELP_LENGTH_RANGE": "Between {{min}} and {{max}} characters.",
130
+ "HELP_NUMBER_MIN": "Minimum {{min}}.",
131
+ "HELP_NUMBER_MAX": "Maximum {{max}}.",
132
+ "HELP_NUMBER_RANGE": "Between {{min}} and {{max}}.",
133
+ "HELP_FILE_ACCEPT": "Accepted formats: {{accept}}.",
134
+ "HELP_FILE_SIZE": "Max size: {{maxSize}}.",
123
135
  "ERROR_REQUIRED_EMAIL": "Email is required.",
124
136
  "ERROR_REQUIRED_LANG": "Language is required.",
125
137
  "ERROR_REQUIRED_PASSWORD": "Password is required.",
@@ -30,6 +30,7 @@
30
30
  "IMPORT": "Importer",
31
31
  "PUBLISH": "Publier",
32
32
  "REFRESH": "Actualiser",
33
+ "RESET": "Réinitialiser",
33
34
  "RESTORE": "Restaurer",
34
35
  "SAVE": "Enregistrer",
35
36
  "SEARCH": "Rechercher",
@@ -66,7 +67,8 @@
66
67
  "CHANGE": "Changer d'application"
67
68
  },
68
69
  "_BREADCRUMB": {
69
- "HOME": "Accueil"
70
+ "HOME": "Accueil",
71
+ "NAV_LABEL": "Fil d'ariane"
70
72
  },
71
73
  "_DATES": {
72
74
  "CALENDAR": "Calendrier",
@@ -114,6 +116,16 @@
114
116
  "ERROR_INVALID_EMAIL": "Format d'e-mail invalide. Exemple : contact@mail.com",
115
117
  "ERROR_IS_MANDATORY": "Le champ <b>{{label}}</b> est obligatoire.",
116
118
  "ERROR_IS_ONLY_NUMERIC": " ne doit être composé que de chiffres.",
119
+ "ERROR_FILE_EXTENSION": "Format de fichier non autorisé. Formats acceptés : {{accept}}.",
120
+ "ERROR_FILE_SIZE": "Le fichier est trop volumineux. Taille maximale autorisée : {{maxSize}}.",
121
+ "HELP_LENGTH_MIN": "Minimum {{min}} caractères.",
122
+ "HELP_LENGTH_MAX": "Maximum {{max}} caractères.",
123
+ "HELP_LENGTH_RANGE": "Entre {{min}} et {{max}} caractères.",
124
+ "HELP_NUMBER_MIN": "Minimum {{min}}.",
125
+ "HELP_NUMBER_MAX": "Maximum {{max}}.",
126
+ "HELP_NUMBER_RANGE": "Entre {{min}} et {{max}}.",
127
+ "HELP_FILE_ACCEPT": "Formats acceptés : {{accept}}.",
128
+ "HELP_FILE_SIZE": "Taille max : {{maxSize}}.",
117
129
  "ERROR_REQUIRED_EMAIL": "L'e-mail est requis.",
118
130
  "ERROR_REQUIRED_LANG": "La langue est requise.",
119
131
  "ERROR_REQUIRED_PASSWORD": "Le mot de passe est requis.",
@@ -92,6 +92,16 @@ ul ol {
92
92
  .list-unstyled {
93
93
  list-style: none;
94
94
  padding: 0;
95
+
96
+ ul {
97
+ margin-left: 1.4rem;
98
+ ul {
99
+ margin-left: 2.8rem;
100
+ ul {
101
+ margin-left: 4.2.4rem;
102
+ }
103
+ }
104
+ }
95
105
  }
96
106
 
97
107
  // Description lists
@@ -2,9 +2,21 @@
2
2
  @use "@cityway/design-tokens/primitives" as p;
3
3
  @use "@cityway/design-tokens/functions" as f;
4
4
  @use "@cityway/design-tokens/theme-mapping" as tm;
5
+ @use "components/button/button" as btn;
5
6
 
6
- :root, [data-cw-theme=cw-bo] {
7
+ [data-cw-theme=cw-bo] {
7
8
  @include tm.generate-grid-vars(p.$grid);
8
9
  @include tm.generate-theme-colors(tm.$theme-bo-colors);
9
10
  @include tm.generate-theme-props(tm.$theme-bo-props);
11
+
12
+
13
+ .btn:not(.btn-ghost) {
14
+ @include btn.btn-base((
15
+ padding-x: f.size(xs),
16
+ padding-y: 0,
17
+ min-height: 2rem,
18
+ fs: f.font(fs, xs),
19
+ lh: f.font(lh, xs),
20
+ ));
21
+ }
10
22
  }
@@ -29,6 +29,7 @@
29
29
  @use "components/form-field/form-field";
30
30
  @use "components/tooltip";
31
31
  @use "components/dropdown";
32
+ @use "components/breadcrumb";
32
33
 
33
34
  // Utilities
34
35
  @use "utilities/breakpoints";
@@ -29,6 +29,7 @@
29
29
  @use "components/form-field/form-field";
30
30
  @use "components/tooltip";
31
31
  @use "components/dropdown";
32
+ @use "components/breadcrumb";
32
33
 
33
34
  // Utilities
34
35
  @use "utilities/breakpoints";
@@ -0,0 +1,51 @@
1
+ @use "@cityway/design-tokens/primitives" as p;
2
+ @use "@cityway/design-tokens/functions" as *;
3
+
4
+ .breadcrumb {
5
+ --#{p.$prefix}-breadcrumb-gap: #{size(2xs)};
6
+ --#{p.$prefix}-breadcrumb-font-size: #{font(fs, sm)};
7
+ --#{p.$prefix}-breadcrumb-color: var(--#{p.$prefix}-body-color);
8
+ --#{p.$prefix}-breadcrumb-link-color: var(--#{p.$prefix}-primary-base);
9
+ --#{p.$prefix}-breadcrumb-active-color: var(--#{p.$prefix}-body-color);
10
+ --#{p.$prefix}-breadcrumb-separator: "\203A"; // ›
11
+
12
+ font-size: var(--#{p.$prefix}-breadcrumb-font-size);
13
+ color: var(--#{p.$prefix}-breadcrumb-color);
14
+
15
+ &-list {
16
+ flex-wrap: wrap;
17
+ gap: var(--#{p.$prefix}-breadcrumb-gap);
18
+ padding: 0;
19
+ }
20
+
21
+ &-item {
22
+ display: inline-flex;
23
+ align-items: center;
24
+ gap: var(--#{p.$prefix}-breadcrumb-gap);
25
+
26
+ &:not(.breadcrumb-item-home)::before {
27
+ content: var(--#{p.$prefix}-breadcrumb-separator);
28
+ color: var(--#{p.$prefix}-breadcrumb-color);
29
+ user-select: none;
30
+ }
31
+
32
+ &.active {
33
+ font-weight: font(fw, bold);
34
+ color: var(--#{p.$prefix}-breadcrumb-active-color);
35
+ }
36
+ }
37
+
38
+ &-link {
39
+ color: var(--#{p.$prefix}-breadcrumb-link-color);
40
+ text-decoration: none;
41
+
42
+ &:hover,
43
+ &:focus-visible {
44
+ text-decoration: underline;
45
+ }
46
+ }
47
+
48
+ &-text {
49
+ color: inherit;
50
+ }
51
+ }
@@ -62,14 +62,24 @@
62
62
  }
63
63
 
64
64
  &-body {
65
+ display: flex;
66
+ flex-direction: column;
67
+ gap: size(md); // todo
65
68
  padding: var(--#{p.$prefix}-card-padding);
66
69
 
70
+ &:empty {
71
+ padding: 0;
72
+ }
73
+
67
74
  .card {
68
75
  border-radius: calc(var(--#{p.$prefix}-card-br) - 0.25rem);
69
76
  }
70
77
  }
71
78
 
72
79
  &-footer {
80
+ display: flex;
81
+ justify-content: flex-end;
82
+ gap: size(md);
73
83
  padding: 0 var(--#{p.$prefix}-card-padding) var(--#{p.$prefix}-card-padding) var(--#{p.$prefix}-card-padding);
74
84
  }
75
85
 
@@ -79,4 +89,10 @@
79
89
  }
80
90
  }
81
91
 
82
- // TODO comportement des boutons dans le footer
92
+ // BO only pour l'instant à trancher pus tard pour le FO
93
+ :root, [data-cw-theme=cw-bo] {
94
+ .card {
95
+ // Surcharge des goutiière dans les cards
96
+ --#{p.$prefix}-columns-gutter: 1rem 1.25rem;
97
+ }
98
+ }
@@ -16,11 +16,11 @@
16
16
  --#{p.$prefix}-dp-menu-zindex: 1050;
17
17
 
18
18
  --#{p.$prefix}-dp-menu-item-gap: #{size(md)};
19
- --#{p.$prefix}-dp-menu-item-padding: #{size(md)} #{size(lg)};
20
19
  --#{p.$prefix}-dp-menu-item-border: #{border(bw, xs)} solid #{color("grey", 50)};
21
20
  --#{p.$prefix}-dp-menu-item-bg-hover: #{color("grey", 100)};
22
21
 
23
22
  display: none;
23
+ line-height: var(--#{p.$prefix}-body-lh);
24
24
 
25
25
  &.show {
26
26
  display: block;
@@ -59,11 +59,12 @@
59
59
  justify-content: flex-start;
60
60
  gap: var(--#{p.$prefix}-dp-menu-item-gap);
61
61
  width: 100%;
62
- padding: var(--#{p.$prefix}-dp-menu-item-padding);
62
+ padding: var(--#{p.$prefix}-btn-padding-y) var(--#{p.$prefix}-btn-padding-x);
63
63
  text-align: left;
64
64
 
65
65
  color: currentColor;
66
66
  text-decoration: none;
67
+ border-radius: 0;
67
68
 
68
69
  &:not(:first-child) {
69
70
  border-top: var(--#{p.$prefix}-dp-menu-item-border);
@@ -6,19 +6,36 @@ cw-button {
6
6
  line-height: 0;
7
7
  }
8
8
 
9
+ // MIXIN - Base (taille, espacement, typo) — overridable par thème (FO/BO)
10
+ // ---------------------------------
11
+ @mixin btn-base($config: ()) {
12
+ $defaults: (
13
+ padding-x: size(2xl),
14
+ padding-y: size(sm),
15
+ min-width: 17rem,
16
+ min-height: auto,
17
+ fs: var(--#{p.$prefix}-body-fs),
18
+ lh: var(--#{p.$prefix}-body-lh),
19
+ fw: var(--#{p.$prefix}-body-fw),
20
+ );
21
+ $c: map.merge($defaults, $config);
22
+
23
+ --#{p.$prefix}-btn-padding-x: #{map.get($c, padding-x)};
24
+ --#{p.$prefix}-btn-padding-y: #{map.get($c, padding-y)};
25
+ --#{p.$prefix}-btn-min-width: #{map.get($c, min-width)};
26
+ --#{p.$prefix}-btn-min-height: #{map.get($c, min-height)};
27
+
28
+ --#{p.$prefix}-btn-fs: #{map.get($c, fs)};
29
+ --#{p.$prefix}-btn-lh: #{map.get($c, lh)};
30
+ --#{p.$prefix}-btn-fw: #{map.get($c, fw)};
31
+ }
32
+
9
33
  .btn {
10
- --#{p.$prefix}-btn-padding-x: #{size(2xl)};
11
- --#{p.$prefix}-btn-padding-y: #{size(sm)};
12
- --#{p.$prefix}-btn-min-width: 17rem;
13
- --#{p.$prefix}-btn-min-height: auto;
34
+ @include btn-base;
14
35
 
15
36
  --#{p.$prefix}-btn-bg: transparent;
16
37
  --#{p.$prefix}-btn-color: var(--#{p.$prefix}-body-color);
17
38
 
18
- --#{p.$prefix}-btn-fs: var(--#{p.$prefix}-body-fs);
19
- --#{p.$prefix}-btn-lh: var(--#{p.$prefix}-body-lh);;
20
- --#{p.$prefix}-btn-fw: var(--#{p.$prefix}-body-fw);
21
-
22
39
  --#{p.$prefix}-btn-border-color: transparent;
23
40
  --#{p.$prefix}-btn-border-width: 1px;
24
41
  --#{p.$prefix}-btn-br: var(--#{p.$prefix}-border-radius-input);
@@ -51,13 +68,16 @@ cw-button {
51
68
  background-color: var(--#{p.$prefix}-btn-bg);
52
69
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
53
70
 
54
- &:hover, &:active {
71
+ &:hover,
72
+ &:active {
55
73
  color: var(--#{p.$prefix}-btn-hover-color);
56
74
  background-color: var(--#{p.$prefix}-btn-hover-bg);
57
75
  border-color: var(--#{p.$prefix}-btn-hover-border-color);
58
76
  }
59
77
 
60
- &.disabled, &[disabled], &:disabled {
78
+ &.disabled,
79
+ &[disabled],
80
+ &:disabled {
61
81
  color: var(--#{p.$prefix}-btn-disabled-color);
62
82
  background-color: var(--#{p.$prefix}-btn-disabled-bg);
63
83
  border-color: var(--#{p.$prefix}-btn-disabled-border-color);
@@ -69,7 +89,9 @@ cw-button {
69
89
 
70
90
  &-link {
71
91
  text-decoration: underline;
72
- &:hover, &:active {
92
+
93
+ &:hover,
94
+ &:active {
73
95
  text-decoration: none;
74
96
  }
75
97
  }
@@ -114,13 +136,17 @@ cw-button {
114
136
  --#{p.$prefix}-btn-bg: #{map.get($colors, surface)};
115
137
  --#{p.$prefix}-btn-border-color: #{map.get($colors, border)};
116
138
 
117
- --#{p.$prefix}-btn-hover-color: #{map.get($colors, text-hover)};
139
+ --#{p.$prefix}-btn-hover-color: #{map.get($colors, text-hover)};
118
140
  --#{p.$prefix}-btn-hover-bg: #{map.get($colors, surface-hover)};
119
141
  --#{p.$prefix}-btn-hover-border-color: #{map.get($colors, border-hover)};
120
142
 
121
- --#{p.$prefix}-btn-disabled-color: #{map.get($colors, text-disabled)};
143
+ --#{p.$prefix}-btn-disabled-color: #{map.get($colors, text-disabled)};
122
144
  --#{p.$prefix}-btn-disabled-bg: #{map.get($colors, surface-disabled)};
123
145
  --#{p.$prefix}-btn-disabled-border-color: #{map.get($colors, border-disabled)};
146
+
147
+ .spinner-border {
148
+ --#{p.$prefix}-spinner-bc: var(--#{p.$prefix}-btn-color);
149
+ }
124
150
  }
125
151
  }
126
152
  }
@@ -51,11 +51,6 @@
51
51
  --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-primary-base);
52
52
  }
53
53
 
54
- &:indeterminate {
55
- --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-primary-base);
56
- --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-primary-base);
57
- }
58
-
59
54
  &[aria-invalid="true"] {
60
55
  --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-danger-base);
61
56
 
@@ -72,6 +67,8 @@
72
67
 
73
68
  // Spécificités Radio / Checkbox
74
69
  &[type="checkbox"]:checked {
70
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-primary-base);
71
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-primary-base);
75
72
  --#{p.$prefix}-field-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
76
73
  }
77
74
 
@@ -89,8 +86,9 @@
89
86
  }
90
87
 
91
88
  &-label {
92
- font-size: font(fs, md-rwd);
93
- line-height: font(lh, md-rwd);
89
+ font-size: var(--#{p.$prefix}-body-fs);
90
+ line-height: var(--#{p.$prefix}-body-lh);
91
+ font-weight: var(--#{p.$prefix}-body-fw);
94
92
  }
95
93
  }
96
94
 
@@ -33,7 +33,7 @@
33
33
 
34
34
  &-group {
35
35
  --#{p.$prefix}-field-control-height: #{size(3xl)};
36
- --#{p.$prefix}-field-control-padding-y: #{size(md)};
36
+ --#{p.$prefix}-field-control-padding-y: #{size(sm)};
37
37
  --#{p.$prefix}-field-control-border: #{border(bw, xs)} solid #{color("grey", 600)};
38
38
  --#{p.$prefix}-field-control-bg: var(--#{p.$prefix}-base-white);
39
39
  --#{p.$prefix}-field-control-br: var(--#{p.$prefix}-border-radius-input);
@@ -96,6 +96,11 @@
96
96
  }
97
97
  }
98
98
 
99
+ textarea {
100
+ min-height: 5.313rem;
101
+ padding: var(--#{p.$prefix}-field-control-padding-y);
102
+ }
103
+
99
104
  .btn-clear-field {
100
105
  padding: 0;
101
106
  padding-inline: var(--#{p.$prefix}-field-control-padding-y);