origam 2.41.1 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/dist/src/assets/locales/en.json +10 -1
- package/dist/src/assets/locales/fr.json +10 -1
- package/dist/src/components/Btn/OrigamBtn.vue +57 -12
- package/dist/src/components/Chip/OrigamChip.vue +12 -12
- package/dist/src/components/List/OrigamListItem.vue +7 -0
- package/dist/src/components/NumberField/OrigamNumberField.vue +14 -10
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +28 -8
- package/dist/src/components/Progress/OrigamProgressLinear.vue +7 -6
- package/dist/src/components/Radio/OrigamRadio.vue +5 -2
- package/dist/src/components/Radio/OrigamRadioBtn.vue +5 -2
- package/dist/src/components/Select/OrigamSelect.vue +44 -7
- package/dist/src/components/SliderField/OrigamSliderField.vue +1 -2
- package/dist/src/components/Table/OrigamTable.vue +1 -1
- package/dist/src/consts/PasswordField/password-field.const.cjs +19 -10
- package/dist/src/consts/PasswordField/password-field.const.d.ts +10 -5
- package/dist/src/consts/PasswordField/password-field.const.js +16 -9
- package/dist/src/directives/Contrast/contrast.directive.cjs +47 -14
- package/dist/src/directives/Contrast/contrast.directive.js +42 -9
- package/dist/src/interfaces/NumberField/number-field.interface.d.ts +8 -0
- package/dist/src/interfaces/PasswordField/password-field.interface.d.ts +5 -1
- package/dist/src/interfaces/PasswordField/password-requirement.interface.d.ts +8 -0
- package/dist/src/interfaces/Radio/radio-btn.interface.d.ts +2 -2
- package/dist/src/interfaces/Radio/radio.interface.d.ts +2 -1
- package/dist/src/interfaces/Select/select.interface.d.ts +1 -0
- package/dist/src/interfaces/SelectionControl/selection-control.interface.d.ts +5 -1
- package/dist/src/interfaces/Table/table.interface.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,83 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.43.0] - 2026-11-22
|
|
22
|
+
|
|
23
|
+
### Changed — complexité de `v-contrast` (#1398)
|
|
24
|
+
|
|
25
|
+
- `resolvePaintedBackground` passait à 16 de complexité cognitive (seuil Sonar 15) après #1427 et #1131. Refactor pur : l'abstention (`mustAbstain`) et la composition des couches (`compositeLayers`) sont extraites, comportement identique. Complexité 16 → 10.
|
|
26
|
+
|
|
27
|
+
### Fixed — `OrigamNumberField` : plus de retrait vide avec `hideControls`, plus d'écriture du modèle au montage, bornage désactivable (#1327)
|
|
28
|
+
|
|
29
|
+
- Cause : le gabarit `#prependInner` était toujours passé à `OrigamField`, même vide ; `useAdjacentInner` le comptait comme présent et `.origam-field__prepend-inner` réservait ~27 px à gauche du texte.
|
|
30
|
+
- Correctif : le gabarit n'est passé que si les contrôles sont affichés ou si l'appelant fournit son propre slot `prependInner`.
|
|
31
|
+
- Le montage ne borne plus la valeur : aucune écriture du modèle sans interaction (`27` avec `min=2000` reste `27`, la validation le signale).
|
|
32
|
+
- Nouvelle prop `clamp` (défaut `true`) : `false` désactive le bornage à la sortie du champ et à l'écriture, pour refuser une valeur hors bornes avec un message. Rupture assumée : le bornage au montage disparaît.
|
|
33
|
+
|
|
34
|
+
### Fixed — `OrigamTable` : `update:hover` est déclaré (#1155)
|
|
35
|
+
|
|
36
|
+
- Cause : `ITableEmits` était vide alors que `useStateFlag(props, {state: 'hover'})` émet `update:hover` ; le descripteur `emits` compilé était donc `undefined`, Vue restait silencieux et un handler `onUpdate:hover` du consommateur retombait dans `$attrs`, donc sur la racine.
|
|
37
|
+
- Correctif : `ITableEmits extends IHoverEmits`, comme `ICardEmits` / `ISheetEmits`. Story `Events - update:hover` et ligne de doc ajoutées ; cas ajouté à `relay-emits-declaration.spec.ts`.
|
|
38
|
+
|
|
39
|
+
### Fixed — `v-contrast` : un fond `oklab()` / `oklch()` n'est plus sauté (#1131)
|
|
40
|
+
|
|
41
|
+
- Cause : pendant une transition (`1e-05s` sous `prefers-reduced-motion: reduce`) et à l'hydratation, Chromium rapporte `background-color` en `oklab(…)`. `rgbaParts` ne lisait que `rgb(`, la couche était ignorée, le fond de page mesuré, et `#000` / `#fff` forcé en `!important`.
|
|
42
|
+
- `oklab()` / `oklch()` sont désormais convertis en sRGB ; une couleur de fond non convertible fait **s'abstenir** la directive au lieu de mesurer la couche du dessous.
|
|
43
|
+
|
|
44
|
+
## [2.42.0] - 2026-11-22
|
|
45
|
+
|
|
46
|
+
### Fixed — `OrigamBtn` en chargement circulaire : le libellé reste visible (#1086)
|
|
47
|
+
|
|
48
|
+
- Cause : `--loader-circular` posait `opacity: 0` sur `__content` / `__prepend` / `__append` et centrait le spinner en absolu par-dessus.
|
|
49
|
+
- Correctif : le libellé reste visible, nom accessible inchangé. Avec une icône/un avatar `prepend`, ou sur un bouton `icon`, le spinner PREND LA PLACE de l'élément (même boîte : largeur identique au repos, mesuré 73,95 px -> 73,95 px). Sans, il s'ajoute avant le libellé et le bouton s'élargit (56,7 -> 85,7 px).
|
|
50
|
+
|
|
51
|
+
### Fixed — `OrigamProgressLinear` : plus de `<div>` dans un `<button>` en chargement `line` (#1087)
|
|
52
|
+
|
|
53
|
+
- Cause : l'arrière-plan, le flux, la zone de chargement et les barres de `OrigamProgressLinear` étaient des `<div>` ; `OrigamBtn` en `loading` de type `line` les rendait dans un `<button>` (contenu phrasé uniquement).
|
|
54
|
+
- Correctif : ces quatre éléments passent en `<span>` (`__loader` reçoit `display: block`, les autres sont déjà positionnés en absolu). Le conteneur `__content` (slot consommateur) reste un `<div>`. Test : `OrigamBtn.loading-content-model.spec.ts`.
|
|
55
|
+
|
|
56
|
+
### Fixed — `OrigamPasswordField` : `aria-invalid` / `aria-describedby` suivent la validation du consommateur (#1110)
|
|
57
|
+
|
|
58
|
+
- Cause : `filterInputAttrs(attrs)` était appelé une fois dans `setup()` ; les attributs posés après le montage n'atteignaient jamais l'`<input>`.
|
|
59
|
+
- Correctif : la distribution est un `computed` sur `attrs`, comme `OrigamTextField` (#938).
|
|
60
|
+
|
|
61
|
+
### Fixed — `OrigamPasswordField` : la règle de longueur n'est plus imposée par défaut (#1334)
|
|
62
|
+
|
|
63
|
+
- Cause : `minLength` valait 8 par défaut et une règle de validation était toujours ajoutée, même sans `requirements`, et même à vide.
|
|
64
|
+
- Correctif : la règle de longueur n'est construite que si `min-length` est fourni explicitement, ou avec `requirements` / `strengthBar` (défaut 8 alors). Une valeur vide n'échoue plus sur les règles d'exigence : elle est laissée à `rules` / `required`. **Rupture assumée** : `min-length` n'a plus de défaut de prop.
|
|
65
|
+
- Nouvelle prop `minLengthMessage` : remplace le message de la règle de longueur pour ce champ.
|
|
66
|
+
|
|
67
|
+
### Fixed — `OrigamPasswordField` : plus aucune chaîne anglaise en dur dans les exigences (#1434)
|
|
68
|
+
|
|
69
|
+
- Cause : `password-field.const.ts` portait « At least 8 characters », « 8 characters », « a tiny »… en dur ; en français : « Ce champ doit contenir : 8 characters ».
|
|
70
|
+
- Correctif : clés `origam.password_field.requirement_*` / `message_*` dans `en.json` et `fr.json` (paramètre `{count}`), résolues par `t()` au rendu ; `IPasswordRequirement` gagne `labelKey` / `labelParams` (les `label` fournis par le consommateur restent inchangés).
|
|
71
|
+
|
|
72
|
+
### Fixed — `OrigamSelect` : les items `subheader` / `divider` ne sont plus des options (#1426)
|
|
73
|
+
|
|
74
|
+
- Cause : `itemType` figurait dans les `withDefaults` mais pas dans `ISelectProps` — jamais une vraie prop, donc `type` n'était jamais lu par `useItems`, et le gabarit rendait chaque entrée en `origam-list-item` `role="option"`.
|
|
75
|
+
- Correctif : `itemType` déclaré dans `ISelectProps` ; le gabarit rend `origam-list-subheader` / `origam-divider` (comme `OrigamListChildren`) ; flèches, Home/End et type-ahead sautent ces lignes, le filtre les écarte.
|
|
76
|
+
|
|
77
|
+
### Fixed — OrigamRadio : le slot `#label` reçoit enfin ses props (#1359)
|
|
78
|
+
|
|
79
|
+
- Cause : `OrigamRadio` et `OrigamRadioBtn` ré-exposaient `<slot name="label"/>` sans `v-bind` ; le scope `{ text, color, props: { id, onClick, … } }` d'`OrigamSelectionControl` était perdu, d'où un `TypeError` à l'accès de `props.id` et une radio sans nom accessible.
|
|
80
|
+
- Correctif : le scope est transmis à chaque niveau ; types `IRadioSlots` / `IRadioBtnSlots` et doc mis à jour (utiliser `props.id` comme `for` du `<label>` personnalisé).
|
|
81
|
+
|
|
82
|
+
### Fixed — `OrigamChip` : la prop `density` agit enfin sur la hauteur (#1105)
|
|
83
|
+
|
|
84
|
+
- Cause : le SCSS écrivait `--origam-chip---density` (`-8px` en compact) mais aucun `height` ne la lisait ; `compact` et `default` rendaient la même hauteur (24px mesuré sur `size=small`, Chromium).
|
|
85
|
+
- Correctif : les cinq `height` de palier sont `calc(height-palier + var(--origam-chip---density, 0px))`, comme `OrigamBtn`. Ajout de `&--density-comfortable` (`+8px`, miroir de Btn ; la classe était émise sans règle). Entrée retirée de la baseline `token-var-channels-dormant`.
|
|
86
|
+
- Rupture de rendu assumée : `density="compact"` / `"comfortable"` change maintenant la hauteur.
|
|
87
|
+
|
|
88
|
+
### Fixed — `OrigamListItem` : anneau `:focus-visible` sur les lignes cliquables (#1358)
|
|
89
|
+
|
|
90
|
+
- Cause : le focus clavier d'une ligne `link` ne produisait que le voile d'overlay (opacité 0,08, ~1,1:1), sans anneau (WCAG 1.4.11 / 2.4.7).
|
|
91
|
+
- Correctif : `outline` 2px solid `--origam-color__border---focus` (même jeton sémantique que Btn et FileField, donc réglable par thème), décalé vers l'intérieur pour ne pas être rogné par le conteneur. Aucun nouveau jeton.
|
|
92
|
+
|
|
93
|
+
### Fixed — SliderField vertical : fin de `appearance: slider-vertical` (#1129)
|
|
94
|
+
|
|
95
|
+
- Cause : `.origam-slider-field--vertical .origam-slider-field__input` déclarait `appearance: slider-vertical`, non standard (Chromium loggait un warning à chaque chargement de page, la feuille étant dans l'entrée CSS). Mesuré en plus : avec `writing-mode: vertical-lr` seul, un clic en haut du rail donnait la valeur MIN alors que le thumb visuel est ancré en bas pour le min (sens inversé).
|
|
96
|
+
- Correctif : `writing-mode: vertical-lr` + `direction: rtl` (recommandation de Chromium). Bas = min, haut = max, flèches haut/bas inchangées, plus de warning.
|
|
97
|
+
|
|
21
98
|
## [2.41.1] - 2026-11-22
|
|
22
99
|
|
|
23
100
|
### Changed — complexité cognitive : `scatterExtent` et `compareBySortItem` (#1398)
|
|
@@ -123,7 +123,16 @@
|
|
|
123
123
|
},
|
|
124
124
|
"password_field": {
|
|
125
125
|
"show": "Show password",
|
|
126
|
-
"hide": "Hide password"
|
|
126
|
+
"hide": "Hide password",
|
|
127
|
+
"requirement_min_length": "At least {count} characters",
|
|
128
|
+
"requirement_uppercase": "At least 1 uppercase letter",
|
|
129
|
+
"requirement_number": "At least 1 number",
|
|
130
|
+
"requirement_special": "At least 1 special character",
|
|
131
|
+
"message_min_length": "{count} characters",
|
|
132
|
+
"message_tiny": "a lowercase letter",
|
|
133
|
+
"message_uppercase": "an uppercase letter",
|
|
134
|
+
"message_number": "a number",
|
|
135
|
+
"message_special": "a special character (!@#$%)"
|
|
127
136
|
},
|
|
128
137
|
"file_field": {
|
|
129
138
|
"counter": "{0} files",
|
|
@@ -123,7 +123,16 @@
|
|
|
123
123
|
},
|
|
124
124
|
"password_field": {
|
|
125
125
|
"show": "Afficher le mot de passe",
|
|
126
|
-
"hide": "Masquer le mot de passe"
|
|
126
|
+
"hide": "Masquer le mot de passe",
|
|
127
|
+
"requirement_min_length": "Au moins {count} caractères",
|
|
128
|
+
"requirement_uppercase": "Au moins 1 majuscule",
|
|
129
|
+
"requirement_number": "Au moins 1 chiffre",
|
|
130
|
+
"requirement_special": "Au moins 1 caractère spécial",
|
|
131
|
+
"message_min_length": "{count} caractères",
|
|
132
|
+
"message_tiny": "une minuscule",
|
|
133
|
+
"message_uppercase": "une majuscule",
|
|
134
|
+
"message_number": "un chiffre",
|
|
135
|
+
"message_special": "un caractère spécial (!@#$%)"
|
|
127
136
|
},
|
|
128
137
|
"file_field": {
|
|
129
138
|
"counter": "{0} fichier(s)",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/>
|
|
28
28
|
|
|
29
29
|
<slot
|
|
30
|
-
v-if="isOverlayLoading"
|
|
30
|
+
v-if="isOverlayLoading && spinnerHost === 'root'"
|
|
31
31
|
name="loader"
|
|
32
32
|
v-bind="progressProps"
|
|
33
33
|
>
|
|
@@ -64,6 +64,22 @@
|
|
|
64
64
|
:icon="prependIcon"
|
|
65
65
|
/>
|
|
66
66
|
</slot>
|
|
67
|
+
<slot
|
|
68
|
+
v-if="isOverlayLoading && spinnerHost === 'prepend'"
|
|
69
|
+
name="loader"
|
|
70
|
+
v-bind="progressProps"
|
|
71
|
+
>
|
|
72
|
+
<origam-progress
|
|
73
|
+
ref="origamProgressRef"
|
|
74
|
+
class="origam-btn__progress"
|
|
75
|
+
v-bind="progressProps"
|
|
76
|
+
tag="span"
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
:thickness="loaderKind === 'line' ? 3 : undefined"
|
|
79
|
+
:color="color"
|
|
80
|
+
:active="true"
|
|
81
|
+
/>
|
|
82
|
+
</slot>
|
|
67
83
|
</span>
|
|
68
84
|
|
|
69
85
|
<span
|
|
@@ -81,6 +97,22 @@
|
|
|
81
97
|
{{ text }}
|
|
82
98
|
</template>
|
|
83
99
|
</slot>
|
|
100
|
+
<slot
|
|
101
|
+
v-if="isOverlayLoading && spinnerHost === 'content'"
|
|
102
|
+
name="loader"
|
|
103
|
+
v-bind="progressProps"
|
|
104
|
+
>
|
|
105
|
+
<origam-progress
|
|
106
|
+
ref="origamProgressRef"
|
|
107
|
+
class="origam-btn__progress"
|
|
108
|
+
v-bind="progressProps"
|
|
109
|
+
tag="span"
|
|
110
|
+
aria-hidden="true"
|
|
111
|
+
:thickness="loaderKind === 'line' ? 3 : undefined"
|
|
112
|
+
:color="color"
|
|
113
|
+
:active="true"
|
|
114
|
+
/>
|
|
115
|
+
</slot>
|
|
84
116
|
</span>
|
|
85
117
|
|
|
86
118
|
<span
|
|
@@ -1002,6 +1034,11 @@ if (import.meta.env?.DEV) {
|
|
|
1002
1034
|
* `skeleton` is refused at compile time (`TControlLoadingValue`); a value that slips past the types at runtime degrades to the spinner rather than to a placeholder.
|
|
1003
1035
|
********************************************************/
|
|
1004
1036
|
const isOverlayLoading = computed(() => loaderConfig.value.isActive);
|
|
1037
|
+
const spinnerHost = computed(() => {
|
|
1038
|
+
if (loaderKind.value !== "circular") return "root";
|
|
1039
|
+
if (hasPrepend.value) return "prepend";
|
|
1040
|
+
return hasIcon.value ? "content" : "root";
|
|
1041
|
+
});
|
|
1005
1042
|
const loaderKind = computed(() => loaderConfig.value.kind === "line" ? "line" : "circular");
|
|
1006
1043
|
/*********************************************************
|
|
1007
1044
|
* aria-busy
|
|
@@ -1071,6 +1108,7 @@ const btnClasses = computed(() => {
|
|
|
1071
1108
|
// so consumers can pick either spelling.
|
|
1072
1109
|
"origam-btn--flat": props.flat,
|
|
1073
1110
|
"origam-btn--icon": !!props.icon,
|
|
1111
|
+
[`origam-btn--spinner-${spinnerHost.value}`]: isLoading.value,
|
|
1074
1112
|
// `origam-btn--loading` comes from `loaderClasses` below: one
|
|
1075
1113
|
// source, emitted once.
|
|
1076
1114
|
// Loader-kind discriminator so SCSS can branch per kind:
|
|
@@ -1688,24 +1726,31 @@ defineExpose({
|
|
|
1688
1726
|
}
|
|
1689
1727
|
}
|
|
1690
1728
|
|
|
1691
|
-
// Circular spinner
|
|
1692
|
-
// (
|
|
1693
|
-
// `margin: auto` pattern centres an absolutely-positioned
|
|
1694
|
-
// element when it has intrinsic width/height (the spinner is
|
|
1695
|
-
// 16-23 px square from its `size` prop). Hiding the label via
|
|
1696
|
-
// opacity preserves the btn's natural width.
|
|
1729
|
+
// Circular spinner (#1086, decision n°2 of #1073): the label stays visible and keeps its accessible name.
|
|
1730
|
+
// Default host (no prepend, no icon): in flow before the label, the button grows by spinner + gap.
|
|
1697
1731
|
&--loader-circular {
|
|
1698
|
-
#{$this}
|
|
1699
|
-
|
|
1700
|
-
|
|
1732
|
+
:deep(#{$this}__progress) {
|
|
1733
|
+
flex: none;
|
|
1734
|
+
margin-inline-end: 0.5em;
|
|
1735
|
+
pointer-events: none;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// With a prepend (or an icon-only button) the spinner REPLACES it: same box, so the width is unchanged.
|
|
1740
|
+
&--spinner-prepend #{$this}__prepend,
|
|
1741
|
+
&--spinner-content #{$this}__content {
|
|
1742
|
+
position: relative;
|
|
1743
|
+
|
|
1744
|
+
> :not(#{$this}__progress) {
|
|
1701
1745
|
opacity: 0;
|
|
1702
1746
|
}
|
|
1703
1747
|
|
|
1704
1748
|
:deep(#{$this}__progress) {
|
|
1705
1749
|
position: absolute !important;
|
|
1706
1750
|
inset: 0 !important;
|
|
1707
|
-
|
|
1708
|
-
|
|
1751
|
+
width: 100% !important;
|
|
1752
|
+
height: 100% !important;
|
|
1753
|
+
margin: 0 !important;
|
|
1709
1754
|
}
|
|
1710
1755
|
}
|
|
1711
1756
|
|
|
@@ -1250,40 +1250,40 @@ defineExpose({
|
|
|
1250
1250
|
&--size-x-small {
|
|
1251
1251
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-xs, 0.625rem));
|
|
1252
1252
|
line-height: 1;
|
|
1253
|
-
height: var(--origam-chip---height-xs, 20px);
|
|
1253
|
+
height: calc(var(--origam-chip---height-xs, 20px) + var(--origam-chip---density, 0px));
|
|
1254
1254
|
padding: 0 var(--origam-chip---padding-xs, 8px);
|
|
1255
1255
|
}
|
|
1256
1256
|
|
|
1257
1257
|
&--size-small {
|
|
1258
1258
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-sm, 0.75rem));
|
|
1259
1259
|
line-height: 1;
|
|
1260
|
-
height: var(--origam-chip---height-sm, 24px);
|
|
1260
|
+
height: calc(var(--origam-chip---height-sm, 24px) + var(--origam-chip---density, 0px));
|
|
1261
1261
|
padding: 0 var(--origam-chip---padding-sm, 10px);
|
|
1262
1262
|
}
|
|
1263
1263
|
|
|
1264
1264
|
&--size-default {
|
|
1265
1265
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-md, 0.875rem));
|
|
1266
1266
|
line-height: 1;
|
|
1267
|
-
height: var(--origam-chip---height-md, 32px);
|
|
1267
|
+
height: calc(var(--origam-chip---height-md, 32px) + var(--origam-chip---density, 0px));
|
|
1268
1268
|
padding: 0 var(--origam-chip---padding-md, 12px);
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
1271
|
&--size-large {
|
|
1272
1272
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-lg, 1rem));
|
|
1273
1273
|
line-height: 1;
|
|
1274
|
-
height: var(--origam-chip---height-lg, 38px);
|
|
1274
|
+
height: calc(var(--origam-chip---height-lg, 38px) + var(--origam-chip---density, 0px));
|
|
1275
1275
|
padding: 0 var(--origam-chip---padding-lg, 14px);
|
|
1276
1276
|
}
|
|
1277
1277
|
|
|
1278
1278
|
&--size-x-large {
|
|
1279
1279
|
font-size: var(--origam-chip---font-size, var(--origam-chip---font-size-xl, 1.125rem));
|
|
1280
1280
|
line-height: 1;
|
|
1281
|
-
height: var(--origam-chip---height-xl, 44px);
|
|
1281
|
+
height: calc(var(--origam-chip---height-xl, 44px) + var(--origam-chip---density, 0px));
|
|
1282
1282
|
padding: 0 var(--origam-chip---padding-xl, 17px);
|
|
1283
1283
|
}
|
|
1284
1284
|
|
|
1285
1285
|
/*
|
|
1286
|
-
* ⛔ #595 —
|
|
1286
|
+
* ⛔ #595 — QUATORZE tokens `--origam-chip--*` que les feuilles declarent
|
|
1287
1287
|
* et que ce SCSS ne lit PAS. Ils restent en baseline
|
|
1288
1288
|
* `token-var-channels-dormant.json`, voici pourquoi :
|
|
1289
1289
|
*
|
|
@@ -1297,13 +1297,13 @@ defineExpose({
|
|
|
1297
1297
|
* `!important` — empecherait la prop de peindre : c est exactement
|
|
1298
1298
|
* l incident qui a produit l ADR-005 et le garde `no-variant-css`.
|
|
1299
1299
|
* La classe emise reste un point d accroche CONSOMMATEUR ;
|
|
1300
|
-
* · `---density`
|
|
1301
|
-
*
|
|
1302
|
-
* distinct de C2 — la prop `density` de Chip est inerte, aucune
|
|
1303
|
-
* hauteur ni marge ne consomme la variable — et le corriger
|
|
1304
|
-
* changerait le rendu de `density="compact"`. Hors perimetre de ce
|
|
1305
|
-
* lot, signale sans ticket ouvert (consigne du lot).
|
|
1300
|
+
* · `---density` est desormais LU par les cinq `height` (#1105), comme
|
|
1301
|
+
* `--origam-btn---density` : `calc(height-palier + density)`.
|
|
1306
1302
|
*/
|
|
1303
|
+
&--density-comfortable {
|
|
1304
|
+
--origam-chip---density: 8px;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
1307
|
&--density-default {
|
|
1308
1308
|
--origam-chip---density: 0px;
|
|
1309
1309
|
}
|
|
@@ -1365,6 +1365,13 @@ defineExpose({
|
|
|
1365
1365
|
&--link {
|
|
1366
1366
|
cursor: var(--origam-list-item---cursor, pointer);
|
|
1367
1367
|
|
|
1368
|
+
// Focus ring (#1358) — same semantic token as Btn / FileField: a theme re-colours it
|
|
1369
|
+
// via `--origam-color__border---focus`. Inset so the list's overflow can't clip it.
|
|
1370
|
+
&:focus-visible {
|
|
1371
|
+
outline: var(--origam-border__width---2, 2px) solid var(--origam-color__border---focus, currentColor);
|
|
1372
|
+
outline-offset: calc(-1 * var(--origam-border__width---2, 2px));
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1368
1375
|
&:hover,
|
|
1369
1376
|
&:focus-visible {
|
|
1370
1377
|
> #{$this}__overlay {
|
|
@@ -112,7 +112,10 @@
|
|
|
112
112
|
<slot name="loader"/>
|
|
113
113
|
</template>
|
|
114
114
|
|
|
115
|
-
<template
|
|
115
|
+
<template
|
|
116
|
+
v-if="!hideControls || slots.prependInner"
|
|
117
|
+
#prependInner
|
|
118
|
+
>
|
|
116
119
|
<div
|
|
117
120
|
v-if="!hideControls"
|
|
118
121
|
class="origam-number-field__control"
|
|
@@ -282,7 +285,7 @@
|
|
|
282
285
|
</template>
|
|
283
286
|
|
|
284
287
|
<script lang="ts" setup>
|
|
285
|
-
import { computed, getCurrentInstance, nextTick,
|
|
288
|
+
import { computed, getCurrentInstance, nextTick, ref, shallowRef, StyleValue, useSlots, watch, watchEffect } from "vue";
|
|
286
289
|
import OrigamBtn from "../Btn/OrigamBtn.vue";
|
|
287
290
|
import OrigamDivider from "../Divider/OrigamDivider.vue";
|
|
288
291
|
import OrigamInput from "../Input/OrigamInput.vue";
|
|
@@ -389,6 +392,11 @@ const props = defineProps({
|
|
|
389
392
|
type: Boolean,
|
|
390
393
|
required: false
|
|
391
394
|
},
|
|
395
|
+
clamp: {
|
|
396
|
+
type: Boolean,
|
|
397
|
+
required: false,
|
|
398
|
+
default: true
|
|
399
|
+
},
|
|
392
400
|
compact: {
|
|
393
401
|
type: Boolean,
|
|
394
402
|
required: false,
|
|
@@ -1178,7 +1186,7 @@ const controlsDisabled = computed(() => !!(props.disabled || props.readonly));
|
|
|
1178
1186
|
/*********************************************************
|
|
1179
1187
|
* Value
|
|
1180
1188
|
********************************************************/
|
|
1181
|
-
const model = useVModel(props, "modelValue", null, (val) => val ?? null, (val) => val == null ? val ?? null : clamp(Number(val), props.min, props.max));
|
|
1189
|
+
const model = useVModel(props, "modelValue", null, (val) => val ?? null, (val) => val == null ? val ?? null : props.clamp ? clamp(Number(val), props.min, props.max) : Number(val));
|
|
1182
1190
|
/*********************************************************
|
|
1183
1191
|
* effectiveValidationValue (#696)
|
|
1184
1192
|
*
|
|
@@ -1299,7 +1307,7 @@ const inputText = computed({
|
|
|
1299
1307
|
if (val === null || val === "") {
|
|
1300
1308
|
model.value = null;
|
|
1301
1309
|
_inputText.value = null;
|
|
1302
|
-
} else if (!isNaN(Number(val)) && Number(val) <= props.max && Number(val) >= props.min) {
|
|
1310
|
+
} else if (!isNaN(Number(val)) && (!props.clamp || Number(val) <= props.max && Number(val) >= props.min)) {
|
|
1303
1311
|
model.value = Number(val);
|
|
1304
1312
|
_inputText.value = val;
|
|
1305
1313
|
}
|
|
@@ -1323,9 +1331,6 @@ const canDecrease = computed(() => {
|
|
|
1323
1331
|
return (model.value ?? 0) - props.step >= props.min;
|
|
1324
1332
|
});
|
|
1325
1333
|
watch(() => props.precision, () => formatInputValue());
|
|
1326
|
-
onMounted(() => {
|
|
1327
|
-
clampModel();
|
|
1328
|
-
});
|
|
1329
1334
|
/*********************************************************
|
|
1330
1335
|
* Spinbutton role (non-compact input)
|
|
1331
1336
|
*
|
|
@@ -1471,7 +1476,7 @@ const handleClear = (e) => {
|
|
|
1471
1476
|
emits("click:clear", e);
|
|
1472
1477
|
};
|
|
1473
1478
|
const clampModel = () => {
|
|
1474
|
-
if (controlsDisabled.value) return;
|
|
1479
|
+
if (controlsDisabled.value || !props.clamp) return;
|
|
1475
1480
|
const actualText = _inputText.value ?? origamTextFieldRef.value?.value ?? null;
|
|
1476
1481
|
if (actualText && !isNaN(Number(actualText))) {
|
|
1477
1482
|
const clamped = clamp(Number(actualText), props.min, props.max);
|
|
@@ -1569,8 +1574,7 @@ const compactInputText = computed({
|
|
|
1569
1574
|
if (val === "") {
|
|
1570
1575
|
model.value = null;
|
|
1571
1576
|
} else if (!isNaN(Number(val))) {
|
|
1572
|
-
|
|
1573
|
-
model.value = clamped;
|
|
1577
|
+
model.value = props.clamp ? clamp(Number(val), props.min, props.max) : Number(val);
|
|
1574
1578
|
}
|
|
1575
1579
|
}
|
|
1576
1580
|
});
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
class="origam-password-field__requirement-icon"
|
|
252
252
|
:icon="isRuleSatisfied(rule) ? 'mdi:mdi-check-circle-outline' : 'mdi:mdi-close-circle-outline'"
|
|
253
253
|
/>
|
|
254
|
-
<span class="origam-password-field__requirement-label">{{ rule
|
|
254
|
+
<span class="origam-password-field__requirement-label">{{ ruleLabel(rule) }}</span>
|
|
255
255
|
</li>
|
|
256
256
|
</ul>
|
|
257
257
|
<div
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
]"
|
|
268
268
|
:bg-color="isRuleSatisfied(rule) ? 'success' : undefined"
|
|
269
269
|
:prepend-icon="isRuleSatisfied(rule) ? 'mdi:mdi-check-circle-outline' : 'mdi:mdi-close-circle-outline'"
|
|
270
|
-
:text="rule
|
|
270
|
+
:text="ruleLabel(rule)"
|
|
271
271
|
:data-requirement-id="rule.id"
|
|
272
272
|
:data-satisfied="isRuleSatisfied(rule) ? 'true' : 'false'"
|
|
273
273
|
/>
|
|
@@ -319,7 +319,7 @@ import { filterPropsOf, useProps } from "../../composables/Commons/props.composa
|
|
|
319
319
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
320
320
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
321
321
|
import { BORDER_PROP_KEYS } from "../../consts/Commons/border.const";
|
|
322
|
-
import { DEFAULT_PASSWORD_REQUIREMENTS, REQUIREMENT_MIN_LENGTH, REQUIREMENT_NUMBER, REQUIREMENT_SPECIAL, REQUIREMENT_TINY, REQUIREMENT_UPPERCASE } from "../../consts/PasswordField/password-field.const";
|
|
322
|
+
import { DEFAULT_MIN_LENGTH, DEFAULT_PASSWORD_REQUIREMENTS, REQUIREMENT_MIN_LENGTH, REQUIREMENT_NUMBER, REQUIREMENT_SPECIAL, REQUIREMENT_TINY, REQUIREMENT_UPPERCASE } from "../../consts/PasswordField/password-field.const";
|
|
323
323
|
import vIntersect from "../../directives/Intersect/intersect.directive";
|
|
324
324
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
325
325
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
@@ -364,8 +364,11 @@ const props = defineProps({
|
|
|
364
364
|
},
|
|
365
365
|
minLength: {
|
|
366
366
|
type: Number,
|
|
367
|
-
required: false
|
|
368
|
-
|
|
367
|
+
required: false
|
|
368
|
+
},
|
|
369
|
+
minLengthMessage: {
|
|
370
|
+
type: String,
|
|
371
|
+
required: false
|
|
369
372
|
},
|
|
370
373
|
needTiny: {
|
|
371
374
|
type: Boolean,
|
|
@@ -1308,7 +1311,7 @@ const hasDetails = computed(() => {
|
|
|
1308
1311
|
* `isChecked` evaluates each rule against the current value.
|
|
1309
1312
|
********************************************************/
|
|
1310
1313
|
const infos = computed(() => {
|
|
1311
|
-
const localeInfos = { minLength: REQUIREMENT_MIN_LENGTH(props.minLength) };
|
|
1314
|
+
const localeInfos = { minLength: REQUIREMENT_MIN_LENGTH(props.minLength ?? DEFAULT_MIN_LENGTH) };
|
|
1312
1315
|
if (props.needTiny) localeInfos.tiny = REQUIREMENT_TINY;
|
|
1313
1316
|
if (props.needUppercase) localeInfos.uppercase = REQUIREMENT_UPPERCASE;
|
|
1314
1317
|
if (props.needNumber) localeInfos.number = REQUIREMENT_NUMBER;
|
|
@@ -1375,6 +1378,9 @@ const hasInlineFooter = computed(() => {
|
|
|
1375
1378
|
if (props.minimal) return false;
|
|
1376
1379
|
return !!props.strengthBar || hasInlineRequirements.value;
|
|
1377
1380
|
});
|
|
1381
|
+
const ruleLabel = (rule) => {
|
|
1382
|
+
return rule.labelKey ? t(rule.labelKey, rule.labelParams) : rule.label;
|
|
1383
|
+
};
|
|
1378
1384
|
const isRuleSatisfied = (rule) => {
|
|
1379
1385
|
const v = (model.value ?? "").toString();
|
|
1380
1386
|
try {
|
|
@@ -1425,10 +1431,18 @@ const handleToggleKeydown = (e) => {
|
|
|
1425
1431
|
********************************************************/
|
|
1426
1432
|
const enrichedRules = computed(() => {
|
|
1427
1433
|
const base = Array.isArray(props.rules) ? [...props.rules] : [];
|
|
1434
|
+
/*********************************************************
|
|
1435
|
+
* #1334 — the length rule is opt-in: explicit `minLength`, `requirements`
|
|
1436
|
+
* or `strengthBar`. An empty value is left to the caller's `rules` / `required`.
|
|
1437
|
+
********************************************************/
|
|
1438
|
+
const lengthEnforced = props.minLength != null || props.requirements === true || !!props.strengthBar;
|
|
1428
1439
|
Object.keys(infos.value).forEach((key) => {
|
|
1440
|
+
if (key === "minLength" && !lengthEnforced) return;
|
|
1429
1441
|
const info = infos.value[key];
|
|
1430
1442
|
base.push((value) => {
|
|
1431
|
-
|
|
1443
|
+
if (!value || info.reg.test(value)) return true;
|
|
1444
|
+
if (key === "minLength" && props.minLengthMessage) return props.minLengthMessage;
|
|
1445
|
+
return t("origam.validation.must_contains", { value: t(info.messageKey, { count: info.count }) });
|
|
1432
1446
|
});
|
|
1433
1447
|
});
|
|
1434
1448
|
return base;
|
|
@@ -1436,7 +1450,13 @@ const enrichedRules = computed(() => {
|
|
|
1436
1450
|
/*********************************************************
|
|
1437
1451
|
* Props passed down
|
|
1438
1452
|
********************************************************/
|
|
1439
|
-
|
|
1453
|
+
/*********************************************************
|
|
1454
|
+
* #1110 — computed, not a setup snapshot: attrs set after mount
|
|
1455
|
+
* (aria-invalid…) must reach the <input>.
|
|
1456
|
+
********************************************************/
|
|
1457
|
+
const filteredAttrs = computed(() => filterInputAttrs(attrs));
|
|
1458
|
+
const rootAttrs = computed(() => filteredAttrs.value[0]);
|
|
1459
|
+
const inputAttrs = computed(() => filteredAttrs.value[1]);
|
|
1440
1460
|
/*********************************************************
|
|
1441
1461
|
* inputProps
|
|
1442
1462
|
*
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
role="progressbar"
|
|
15
15
|
@click="handleClick"
|
|
16
16
|
>
|
|
17
|
-
<
|
|
17
|
+
<span
|
|
18
18
|
v-if="stream"
|
|
19
19
|
key="stream"
|
|
20
20
|
:style="streamStyles"
|
|
21
21
|
class="origam-progress__stream"
|
|
22
22
|
/>
|
|
23
|
-
<
|
|
23
|
+
<span
|
|
24
24
|
:class="progressBackgroundClasses"
|
|
25
25
|
:style="backgroundStyles"
|
|
26
26
|
/>
|
|
27
27
|
|
|
28
28
|
<origam-transition :transition="transition">
|
|
29
|
-
<
|
|
29
|
+
<span :class="progressLoaderClasses">
|
|
30
30
|
<template v-if="indeterminate">
|
|
31
|
-
<
|
|
31
|
+
<span
|
|
32
32
|
v-for="bar in ['long', 'short']"
|
|
33
33
|
:key="bar"
|
|
34
34
|
:class="`origam-progress__bar--${bar}`"
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
/>
|
|
38
38
|
</template>
|
|
39
39
|
<template v-else>
|
|
40
|
-
<
|
|
40
|
+
<span
|
|
41
41
|
:style="loaderStyles"
|
|
42
42
|
class="origam-progress__bar"
|
|
43
43
|
/>
|
|
44
44
|
</template>
|
|
45
|
-
</
|
|
45
|
+
</span>
|
|
46
46
|
</origam-transition>
|
|
47
47
|
|
|
48
48
|
<div
|
|
@@ -627,6 +627,7 @@ defineExpose({
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
#{$this}__loader {
|
|
630
|
+
display: block;
|
|
630
631
|
color: var(--origam-progress-linear__loader---color, inherit);
|
|
631
632
|
|
|
632
633
|
> * {
|
|
@@ -121,7 +121,16 @@
|
|
|
121
121
|
renderless
|
|
122
122
|
>
|
|
123
123
|
<template #item.renderless="{item, index, itemRef}">
|
|
124
|
+
<origam-divider
|
|
125
|
+
v-if="isDivider(item)"
|
|
126
|
+
v-bind="item.props"
|
|
127
|
+
/>
|
|
128
|
+
<origam-list-subheader
|
|
129
|
+
v-else-if="isSubheader(item)"
|
|
130
|
+
v-bind="item.props"
|
|
131
|
+
/>
|
|
124
132
|
<slot
|
|
133
|
+
v-else
|
|
125
134
|
name="item"
|
|
126
135
|
v-bind="{item, index, props: menuListItemProps(item, itemRef, index)}"
|
|
127
136
|
>
|
|
@@ -272,10 +281,12 @@ import { computed, getCurrentInstance, inject, mergeProps, nextTick, onBeforeUnm
|
|
|
272
281
|
import OrigamAvatar from "../Avatar/OrigamAvatar.vue";
|
|
273
282
|
import OrigamCheckboxBtn from "../Checkbox/OrigamCheckboxBtn.vue";
|
|
274
283
|
import OrigamChip from "../Chip/OrigamChip.vue";
|
|
284
|
+
import OrigamDivider from "../Divider/OrigamDivider.vue";
|
|
275
285
|
import OrigamExpandY from "../Transition/OrigamExpandY.vue";
|
|
276
286
|
import OrigamIcon from "../Icon/OrigamIcon.vue";
|
|
277
287
|
import OrigamList from "../List/OrigamList.vue";
|
|
278
288
|
import OrigamListItem from "../List/OrigamListItem.vue";
|
|
289
|
+
import OrigamListSubheader from "../List/OrigamListSubheader.vue";
|
|
279
290
|
import OrigamMenu from "../Menu/OrigamMenu.vue";
|
|
280
291
|
import OrigamTextField from "../TextField/OrigamTextField.vue";
|
|
281
292
|
import OrigamTranslateScale from "../Transition/OrigamTranslateScale.vue";
|
|
@@ -297,6 +308,7 @@ import { DENSITY } from "../../enums/Commons/density.enum";
|
|
|
297
308
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
298
309
|
import { FILTERS_MODE } from "../../enums/Commons/filters.enum";
|
|
299
310
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
311
|
+
import { LIST_ITEM_TYPE } from "../../enums/List/list-item.enum";
|
|
300
312
|
import { SELECT_STRATEGY } from "../../enums/Commons/nested.enum";
|
|
301
313
|
import { SIZES } from "../../enums/Commons/size.enum";
|
|
302
314
|
import { TEXT_FIELD_TYPE } from "../../enums/TextField/text-field.enum";
|
|
@@ -330,6 +342,11 @@ const props = defineProps({
|
|
|
330
342
|
type: Object,
|
|
331
343
|
required: false
|
|
332
344
|
},
|
|
345
|
+
itemType: {
|
|
346
|
+
type: String,
|
|
347
|
+
required: false,
|
|
348
|
+
default: "type"
|
|
349
|
+
},
|
|
333
350
|
menu: {
|
|
334
351
|
type: Boolean,
|
|
335
352
|
required: false
|
|
@@ -1379,11 +1396,24 @@ let keyboardLookupLastTime;
|
|
|
1379
1396
|
const listHasFocus = shallowRef(false);
|
|
1380
1397
|
const selectionIndex = shallowRef(-1);
|
|
1381
1398
|
const isSelecting = shallowRef(false);
|
|
1399
|
+
/*********************************************************
|
|
1400
|
+
* Structural rows (#1426)
|
|
1401
|
+
*
|
|
1402
|
+
* @description
|
|
1403
|
+
* `subheader` / `divider` entries are structure, not options: same
|
|
1404
|
+
* discriminant as `OrigamListChildren` (`item.type`, read through the
|
|
1405
|
+
* `itemType` prop). They are dropped while searching (a header title
|
|
1406
|
+
* would match the query) and stepped over by the arrow keys, Home/End.
|
|
1407
|
+
********************************************************/
|
|
1408
|
+
const isDivider = (item) => item.type === LIST_ITEM_TYPE.DIVIDER;
|
|
1409
|
+
const isSubheader = (item) => item.type === LIST_ITEM_TYPE.SUBHEADER;
|
|
1410
|
+
const isStructural = (item) => isDivider(item) || isSubheader(item);
|
|
1382
1411
|
const displayItems = computed(() => {
|
|
1412
|
+
let result = isPristine.value ? filteredItems.value : filteredItems.value.filter((item) => !isStructural(item));
|
|
1383
1413
|
if (props.hideSelected) {
|
|
1384
|
-
|
|
1414
|
+
result = result.filter((filteredItem) => !model.value.some((s) => s.value === filteredItem.value));
|
|
1385
1415
|
}
|
|
1386
|
-
return
|
|
1416
|
+
return result;
|
|
1387
1417
|
});
|
|
1388
1418
|
const menuDisabled = computed(() => {
|
|
1389
1419
|
return props.hideNoData && !displayItems.value.length || props.readonly || form?.isReadonly.value;
|
|
@@ -1674,14 +1704,21 @@ const handleMousedownMenuIcon = (e) => {
|
|
|
1674
1704
|
const handleHighlightNavigation = (e) => {
|
|
1675
1705
|
const itemCount = displayItems.value.length;
|
|
1676
1706
|
if (!menu.value || itemCount <= 0) return false;
|
|
1707
|
+
const step = (from, dir) => {
|
|
1708
|
+
for (let n = 1; n <= itemCount; n++) {
|
|
1709
|
+
const i = ((from + dir * n) % itemCount + itemCount) % itemCount;
|
|
1710
|
+
if (!isStructural(displayItems.value[i])) return i;
|
|
1711
|
+
}
|
|
1712
|
+
return -1;
|
|
1713
|
+
};
|
|
1677
1714
|
if (e.key === KEYBOARD_VALUES.DOWN) {
|
|
1678
|
-
highlightIndex.value = highlightIndex.value
|
|
1715
|
+
highlightIndex.value = step(highlightIndex.value, 1);
|
|
1679
1716
|
} else if (e.key === KEYBOARD_VALUES.UP) {
|
|
1680
|
-
highlightIndex.value = highlightIndex.value
|
|
1717
|
+
highlightIndex.value = step(highlightIndex.value < 0 ? 0 : highlightIndex.value, -1);
|
|
1681
1718
|
} else if (e.key === KEYBOARD_VALUES.HOME) {
|
|
1682
|
-
highlightIndex.value =
|
|
1719
|
+
highlightIndex.value = step(-1, 1);
|
|
1683
1720
|
} else if (e.key === KEYBOARD_VALUES.END) {
|
|
1684
|
-
highlightIndex.value =
|
|
1721
|
+
highlightIndex.value = step(0, -1);
|
|
1685
1722
|
} else if (e.key === KEYBOARD_VALUES.ENTER && highlightIndex.value >= 0) {
|
|
1686
1723
|
handleSelect(displayItems.value[highlightIndex.value], null);
|
|
1687
1724
|
highlightIndex.value = -1;
|
|
@@ -1754,7 +1791,7 @@ const handleTypeAheadKeydown = (e) => {
|
|
|
1754
1791
|
}
|
|
1755
1792
|
keyboardLookupPrefix += e.key.toLowerCase();
|
|
1756
1793
|
keyboardLookupLastTime = now;
|
|
1757
|
-
const item = items.value.find((item) => item.title?.toLowerCase().startsWith(keyboardLookupPrefix));
|
|
1794
|
+
const item = items.value.find((item) => !isStructural(item) && item.title?.toLowerCase().startsWith(keyboardLookupPrefix));
|
|
1758
1795
|
if (item !== undefined) {
|
|
1759
1796
|
model.value = [item];
|
|
1760
1797
|
const index = displayItems.value.indexOf(item);
|
|
@@ -2045,8 +2045,7 @@ defineExpose({
|
|
|
2045
2045
|
|
|
2046
2046
|
#{$this}__input {
|
|
2047
2047
|
writing-mode: vertical-lr;
|
|
2048
|
-
|
|
2049
|
-
appearance: slider-vertical;
|
|
2048
|
+
direction: rtl;
|
|
2050
2049
|
width: var(--origam-slider-field__thumb---size, 20px);
|
|
2051
2050
|
height: 100%;
|
|
2052
2051
|
top: 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.REQUIREMENT_UPPERCASE = exports.REQUIREMENT_TINY = exports.REQUIREMENT_SPECIAL = exports.REQUIREMENT_NUMBER = exports.REQUIREMENT_MIN_LENGTH = exports.PASSWORD_STRONG_LENGTH = exports.PASSWORD_STRENGTH_MAX_SCORE = exports.PASSWORD_STRENGTH_LEVEL_BY_SCORE = exports.PASSWORD_PATTERN_UPPERCASE = exports.PASSWORD_PATTERN_SPECIAL = exports.PASSWORD_PATTERN_LOWERCASE = exports.PASSWORD_PATTERN_DIGIT = exports.PASSWORD_MIN_LENGTH = exports.DEFAULT_PASSWORD_REQUIREMENTS = void 0;
|
|
6
|
+
exports.REQUIREMENT_UPPERCASE = exports.REQUIREMENT_TINY = exports.REQUIREMENT_SPECIAL = exports.REQUIREMENT_NUMBER = exports.REQUIREMENT_MIN_LENGTH = exports.PASSWORD_STRONG_LENGTH = exports.PASSWORD_STRENGTH_MAX_SCORE = exports.PASSWORD_STRENGTH_LEVEL_BY_SCORE = exports.PASSWORD_PATTERN_UPPERCASE = exports.PASSWORD_PATTERN_SPECIAL = exports.PASSWORD_PATTERN_LOWERCASE = exports.PASSWORD_PATTERN_DIGIT = exports.PASSWORD_MIN_LENGTH = exports.DEFAULT_PASSWORD_REQUIREMENTS = exports.DEFAULT_MIN_LENGTH = void 0;
|
|
7
7
|
var _passwordField = require("../../enums/PasswordField/password-field.enum.cjs");
|
|
8
8
|
const PASSWORD_MIN_LENGTH = exports.PASSWORD_MIN_LENGTH = 8;
|
|
9
9
|
const PASSWORD_STRONG_LENGTH = exports.PASSWORD_STRONG_LENGTH = 12;
|
|
@@ -21,49 +21,58 @@ const PASSWORD_STRENGTH_LEVEL_BY_SCORE = exports.PASSWORD_STRENGTH_LEVEL_BY_SCOR
|
|
|
21
21
|
};
|
|
22
22
|
const DEFAULT_PASSWORD_REQUIREMENTS = exports.DEFAULT_PASSWORD_REQUIREMENTS = [{
|
|
23
23
|
id: "min-length",
|
|
24
|
-
label:
|
|
24
|
+
label: "",
|
|
25
|
+
labelKey: "origam.password_field.requirement_min_length",
|
|
26
|
+
labelParams: {
|
|
27
|
+
count: PASSWORD_MIN_LENGTH
|
|
28
|
+
},
|
|
25
29
|
test: v => (v ?? "").length >= PASSWORD_MIN_LENGTH
|
|
26
30
|
}, {
|
|
27
31
|
id: "uppercase",
|
|
28
|
-
label: "
|
|
32
|
+
label: "",
|
|
33
|
+
labelKey: "origam.password_field.requirement_uppercase",
|
|
29
34
|
test: v => PASSWORD_PATTERN_UPPERCASE.test(v ?? "")
|
|
30
35
|
}, {
|
|
31
36
|
id: "number",
|
|
32
|
-
label: "
|
|
37
|
+
label: "",
|
|
38
|
+
labelKey: "origam.password_field.requirement_number",
|
|
33
39
|
test: v => PASSWORD_PATTERN_DIGIT.test(v ?? "")
|
|
34
40
|
}, {
|
|
35
41
|
id: "special",
|
|
36
|
-
label: "
|
|
42
|
+
label: "",
|
|
43
|
+
labelKey: "origam.password_field.requirement_special",
|
|
37
44
|
test: v => PASSWORD_PATTERN_SPECIAL.test(v ?? "")
|
|
38
45
|
}];
|
|
46
|
+
const DEFAULT_MIN_LENGTH = exports.DEFAULT_MIN_LENGTH = 8;
|
|
39
47
|
const REQUIREMENT_MIN_LENGTH = length => ({
|
|
40
48
|
key: "minLength",
|
|
41
|
-
|
|
49
|
+
messageKey: "origam.password_field.message_min_length",
|
|
50
|
+
count: length,
|
|
42
51
|
icon: `+${length}`,
|
|
43
52
|
reg: new RegExp(`(.{${length},})`)
|
|
44
53
|
});
|
|
45
54
|
exports.REQUIREMENT_MIN_LENGTH = REQUIREMENT_MIN_LENGTH;
|
|
46
55
|
const REQUIREMENT_TINY = exports.REQUIREMENT_TINY = {
|
|
47
56
|
key: "tiny",
|
|
48
|
-
|
|
57
|
+
messageKey: "origam.password_field.message_tiny",
|
|
49
58
|
icon: "a",
|
|
50
59
|
reg: /(?=.*[a-z])/
|
|
51
60
|
};
|
|
52
61
|
const REQUIREMENT_UPPERCASE = exports.REQUIREMENT_UPPERCASE = {
|
|
53
62
|
key: "uppercase",
|
|
54
|
-
|
|
63
|
+
messageKey: "origam.password_field.message_uppercase",
|
|
55
64
|
icon: "A",
|
|
56
65
|
reg: /(?=.*[A-Z])/
|
|
57
66
|
};
|
|
58
67
|
const REQUIREMENT_NUMBER = exports.REQUIREMENT_NUMBER = {
|
|
59
68
|
key: "number",
|
|
60
|
-
|
|
69
|
+
messageKey: "origam.password_field.message_number",
|
|
61
70
|
icon: "1",
|
|
62
71
|
reg: /(?=.*\d)/
|
|
63
72
|
};
|
|
64
73
|
const REQUIREMENT_SPECIAL = exports.REQUIREMENT_SPECIAL = {
|
|
65
74
|
key: "special",
|
|
66
|
-
|
|
75
|
+
messageKey: "origam.password_field.message_special",
|
|
67
76
|
icon: "@",
|
|
68
77
|
reg: /(?=.*[^a-zA-Z0-9\s])/
|
|
69
78
|
};
|
|
@@ -88,33 +88,38 @@ export declare const DEFAULT_PASSWORD_REQUIREMENTS: IPasswordRequirement[];
|
|
|
88
88
|
* factory so the message / icon / regex can interpolate the configured
|
|
89
89
|
* length per-instance.
|
|
90
90
|
********************************************************/
|
|
91
|
+
/*********************************************************
|
|
92
|
+
* Length shown / enforced when `requirements` is on and no `minLength` is given.
|
|
93
|
+
********************************************************/
|
|
94
|
+
export declare const DEFAULT_MIN_LENGTH = 8;
|
|
91
95
|
export declare const REQUIREMENT_MIN_LENGTH: (length: number) => {
|
|
92
96
|
key: string;
|
|
93
|
-
|
|
97
|
+
messageKey: string;
|
|
98
|
+
count: number;
|
|
94
99
|
icon: string;
|
|
95
100
|
reg: RegExp;
|
|
96
101
|
};
|
|
97
102
|
export declare const REQUIREMENT_TINY: {
|
|
98
103
|
readonly key: "tiny";
|
|
99
|
-
readonly
|
|
104
|
+
readonly messageKey: "origam.password_field.message_tiny";
|
|
100
105
|
readonly icon: "a";
|
|
101
106
|
readonly reg: RegExp;
|
|
102
107
|
};
|
|
103
108
|
export declare const REQUIREMENT_UPPERCASE: {
|
|
104
109
|
readonly key: "uppercase";
|
|
105
|
-
readonly
|
|
110
|
+
readonly messageKey: "origam.password_field.message_uppercase";
|
|
106
111
|
readonly icon: "A";
|
|
107
112
|
readonly reg: RegExp;
|
|
108
113
|
};
|
|
109
114
|
export declare const REQUIREMENT_NUMBER: {
|
|
110
115
|
readonly key: "number";
|
|
111
|
-
readonly
|
|
116
|
+
readonly messageKey: "origam.password_field.message_number";
|
|
112
117
|
readonly icon: "1";
|
|
113
118
|
readonly reg: RegExp;
|
|
114
119
|
};
|
|
115
120
|
export declare const REQUIREMENT_SPECIAL: {
|
|
116
121
|
readonly key: "special";
|
|
117
|
-
readonly
|
|
122
|
+
readonly messageKey: "origam.password_field.message_special";
|
|
118
123
|
readonly icon: "@";
|
|
119
124
|
readonly reg: RegExp;
|
|
120
125
|
};
|
|
@@ -16,52 +16,59 @@ export const PASSWORD_STRENGTH_LEVEL_BY_SCORE = {
|
|
|
16
16
|
export const DEFAULT_PASSWORD_REQUIREMENTS = [
|
|
17
17
|
{
|
|
18
18
|
id: "min-length",
|
|
19
|
-
label:
|
|
19
|
+
label: "",
|
|
20
|
+
labelKey: "origam.password_field.requirement_min_length",
|
|
21
|
+
labelParams: { count: PASSWORD_MIN_LENGTH },
|
|
20
22
|
test: (v) => (v ?? "").length >= PASSWORD_MIN_LENGTH
|
|
21
23
|
},
|
|
22
24
|
{
|
|
23
25
|
id: "uppercase",
|
|
24
|
-
label: "
|
|
26
|
+
label: "",
|
|
27
|
+
labelKey: "origam.password_field.requirement_uppercase",
|
|
25
28
|
test: (v) => PASSWORD_PATTERN_UPPERCASE.test(v ?? "")
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
id: "number",
|
|
29
|
-
label: "
|
|
32
|
+
label: "",
|
|
33
|
+
labelKey: "origam.password_field.requirement_number",
|
|
30
34
|
test: (v) => PASSWORD_PATTERN_DIGIT.test(v ?? "")
|
|
31
35
|
},
|
|
32
36
|
{
|
|
33
37
|
id: "special",
|
|
34
|
-
label: "
|
|
38
|
+
label: "",
|
|
39
|
+
labelKey: "origam.password_field.requirement_special",
|
|
35
40
|
test: (v) => PASSWORD_PATTERN_SPECIAL.test(v ?? "")
|
|
36
41
|
}
|
|
37
42
|
];
|
|
43
|
+
export const DEFAULT_MIN_LENGTH = 8;
|
|
38
44
|
export const REQUIREMENT_MIN_LENGTH = (length) => ({
|
|
39
45
|
key: "minLength",
|
|
40
|
-
|
|
46
|
+
messageKey: "origam.password_field.message_min_length",
|
|
47
|
+
count: length,
|
|
41
48
|
icon: `+${length}`,
|
|
42
49
|
reg: new RegExp(`(.{${length},})`)
|
|
43
50
|
});
|
|
44
51
|
export const REQUIREMENT_TINY = {
|
|
45
52
|
key: "tiny",
|
|
46
|
-
|
|
53
|
+
messageKey: "origam.password_field.message_tiny",
|
|
47
54
|
icon: "a",
|
|
48
55
|
reg: /(?=.*[a-z])/
|
|
49
56
|
};
|
|
50
57
|
export const REQUIREMENT_UPPERCASE = {
|
|
51
58
|
key: "uppercase",
|
|
52
|
-
|
|
59
|
+
messageKey: "origam.password_field.message_uppercase",
|
|
53
60
|
icon: "A",
|
|
54
61
|
reg: /(?=.*[A-Z])/
|
|
55
62
|
};
|
|
56
63
|
export const REQUIREMENT_NUMBER = {
|
|
57
64
|
key: "number",
|
|
58
|
-
|
|
65
|
+
messageKey: "origam.password_field.message_number",
|
|
59
66
|
icon: "1",
|
|
60
67
|
reg: /(?=.*\d)/
|
|
61
68
|
};
|
|
62
69
|
export const REQUIREMENT_SPECIAL = {
|
|
63
70
|
key: "special",
|
|
64
|
-
|
|
71
|
+
messageKey: "origam.password_field.message_special",
|
|
65
72
|
icon: "@",
|
|
66
73
|
reg: /(?=.*[^a-zA-Z0-9\s])/
|
|
67
74
|
};
|
|
@@ -34,6 +34,33 @@ function srgbToRgb(color) {
|
|
|
34
34
|
const a = m[4] !== void 0 ? parseFloat(m[4]) : 1;
|
|
35
35
|
return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
|
|
36
36
|
}
|
|
37
|
+
function oklabToRgb(color) {
|
|
38
|
+
const m = /^\s*(oklab|oklch)\(\s*([^\s/)]+)\s+([^\s/)]+)\s+([^\s/)]+)(?:\s*\/\s*([^\s)]+))?\s*\)\s*$/i.exec(color);
|
|
39
|
+
if (!m) return null;
|
|
40
|
+
const num = (v, pct) => /^-?[\d.]+(?:e-?\d+)?%$/i.test(v) ? parseFloat(v) / 100 * pct : /^-?[\d.]+(?:e-?\d+)?(?:deg)?$/i.test(v) ? parseFloat(v) : NaN;
|
|
41
|
+
const L = num(m[2], 1);
|
|
42
|
+
let a = num(m[3], m[1].toLowerCase() === "oklab" ? 0.4 : 0.4);
|
|
43
|
+
let b = num(m[4], 0.4);
|
|
44
|
+
const alpha = m[5] === void 0 ? 1 : num(m[5], 1);
|
|
45
|
+
if ([L, a, b, alpha].some(Number.isNaN)) return null;
|
|
46
|
+
if (m[1].toLowerCase() === "oklch") {
|
|
47
|
+
const h = b * Math.PI / 180;
|
|
48
|
+
b = a * Math.sin(h);
|
|
49
|
+
a = a * Math.cos(h);
|
|
50
|
+
}
|
|
51
|
+
const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
52
|
+
const mm = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
53
|
+
const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
54
|
+
const enc = c => {
|
|
55
|
+
const v = Math.min(1, Math.max(0, c));
|
|
56
|
+
return Math.round((v <= 31308e-7 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055) * 255);
|
|
57
|
+
};
|
|
58
|
+
const r = enc(4.0767416621 * l - 3.3077115913 * mm + 0.2309699292 * s);
|
|
59
|
+
const g = enc(-1.2684380046 * l + 2.6097574011 * mm - 0.3413193965 * s);
|
|
60
|
+
const bl = enc(-0.0041960863 * l - 0.7034186147 * mm + 1.707614701 * s);
|
|
61
|
+
const al = Math.min(1, Math.max(0, alpha));
|
|
62
|
+
return al < 1 ? `rgba(${r}, ${g}, ${bl}, ${al})` : `rgb(${r}, ${g}, ${bl})`;
|
|
63
|
+
}
|
|
37
64
|
function hexToRgb(hex) {
|
|
38
65
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(hex);
|
|
39
66
|
if (!m) return null;
|
|
@@ -49,7 +76,7 @@ function hexToRgb(hex) {
|
|
|
49
76
|
}
|
|
50
77
|
function toRgb(color) {
|
|
51
78
|
if (!color) return null;
|
|
52
|
-
const direct = srgbToRgb(color);
|
|
79
|
+
const direct = srgbToRgb(color) ?? oklabToRgb(color);
|
|
53
80
|
if (direct) return direct;
|
|
54
81
|
if (/^rgba?\(/i.test(color)) return color;
|
|
55
82
|
if (typeof document === "undefined") return color;
|
|
@@ -86,31 +113,37 @@ function over(top, bottom) {
|
|
|
86
113
|
a: 1
|
|
87
114
|
};
|
|
88
115
|
}
|
|
116
|
+
function mustAbstain(style, parts) {
|
|
117
|
+
if (style.backgroundImage && style.backgroundImage !== "none") return true;
|
|
118
|
+
return !parts && !!style.backgroundColor && style.backgroundColor !== "transparent";
|
|
119
|
+
}
|
|
120
|
+
function compositeLayers(layers) {
|
|
121
|
+
const deepest = layers[layers.length - 1];
|
|
122
|
+
let acc = deepest.a >= 1 ? layers.pop() : {
|
|
123
|
+
r: 255,
|
|
124
|
+
g: 255,
|
|
125
|
+
b: 255,
|
|
126
|
+
a: 1
|
|
127
|
+
};
|
|
128
|
+
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
129
|
+
acc = over(layers[i], acc);
|
|
130
|
+
}
|
|
131
|
+
return `rgb(${Math.round(acc.r)}, ${Math.round(acc.g)}, ${Math.round(acc.b)})`;
|
|
132
|
+
}
|
|
89
133
|
function resolvePaintedBackground(el) {
|
|
90
134
|
const layers = [];
|
|
91
135
|
let node = el;
|
|
92
136
|
while (node) {
|
|
93
137
|
const style = getComputedStyle(node);
|
|
94
|
-
if (style.backgroundImage && style.backgroundImage !== "none") return null;
|
|
95
138
|
const parts = rgbaParts(toRgb(style.backgroundColor));
|
|
139
|
+
if (mustAbstain(style, parts)) return null;
|
|
96
140
|
if (parts && parts.a > 0) {
|
|
97
141
|
layers.push(parts);
|
|
98
142
|
if (parts.a >= 1) break;
|
|
99
143
|
}
|
|
100
144
|
node = node.parentElement;
|
|
101
145
|
}
|
|
102
|
-
|
|
103
|
-
const deepest = layers[layers.length - 1];
|
|
104
|
-
let acc = deepest.a >= 1 ? layers.pop() : {
|
|
105
|
-
r: 255,
|
|
106
|
-
g: 255,
|
|
107
|
-
b: 255,
|
|
108
|
-
a: 1
|
|
109
|
-
};
|
|
110
|
-
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
111
|
-
acc = over(layers[i], acc);
|
|
112
|
-
}
|
|
113
|
-
return `rgb(${Math.round(acc.r)}, ${Math.round(acc.g)}, ${Math.round(acc.b)})`;
|
|
146
|
+
return layers.length ? compositeLayers(layers) : null;
|
|
114
147
|
}
|
|
115
148
|
function channelsOf(rgb) {
|
|
116
149
|
if (!rgb) return null;
|
|
@@ -22,6 +22,33 @@ function srgbToRgb(color) {
|
|
|
22
22
|
const a = m[4] !== void 0 ? parseFloat(m[4]) : 1;
|
|
23
23
|
return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
|
|
24
24
|
}
|
|
25
|
+
function oklabToRgb(color) {
|
|
26
|
+
const m = /^\s*(oklab|oklch)\(\s*([^\s/)]+)\s+([^\s/)]+)\s+([^\s/)]+)(?:\s*\/\s*([^\s)]+))?\s*\)\s*$/i.exec(color);
|
|
27
|
+
if (!m) return null;
|
|
28
|
+
const num = (v, pct) => /^-?[\d.]+(?:e-?\d+)?%$/i.test(v) ? parseFloat(v) / 100 * pct : /^-?[\d.]+(?:e-?\d+)?(?:deg)?$/i.test(v) ? parseFloat(v) : NaN;
|
|
29
|
+
const L = num(m[2], 1);
|
|
30
|
+
let a = num(m[3], m[1].toLowerCase() === "oklab" ? 0.4 : 0.4);
|
|
31
|
+
let b = num(m[4], 0.4);
|
|
32
|
+
const alpha = m[5] === void 0 ? 1 : num(m[5], 1);
|
|
33
|
+
if ([L, a, b, alpha].some(Number.isNaN)) return null;
|
|
34
|
+
if (m[1].toLowerCase() === "oklch") {
|
|
35
|
+
const h = b * Math.PI / 180;
|
|
36
|
+
b = a * Math.sin(h);
|
|
37
|
+
a = a * Math.cos(h);
|
|
38
|
+
}
|
|
39
|
+
const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
40
|
+
const mm = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
41
|
+
const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
42
|
+
const enc = (c) => {
|
|
43
|
+
const v = Math.min(1, Math.max(0, c));
|
|
44
|
+
return Math.round((v <= 31308e-7 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055) * 255);
|
|
45
|
+
};
|
|
46
|
+
const r = enc(4.0767416621 * l - 3.3077115913 * mm + 0.2309699292 * s);
|
|
47
|
+
const g = enc(-1.2684380046 * l + 2.6097574011 * mm - 0.3413193965 * s);
|
|
48
|
+
const bl = enc(-0.0041960863 * l - 0.7034186147 * mm + 1.707614701 * s);
|
|
49
|
+
const al = Math.min(1, Math.max(0, alpha));
|
|
50
|
+
return al < 1 ? `rgba(${r}, ${g}, ${bl}, ${al})` : `rgb(${r}, ${g}, ${bl})`;
|
|
51
|
+
}
|
|
25
52
|
function hexToRgb(hex) {
|
|
26
53
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(hex);
|
|
27
54
|
if (!m) return null;
|
|
@@ -37,7 +64,7 @@ function hexToRgb(hex) {
|
|
|
37
64
|
}
|
|
38
65
|
function toRgb(color) {
|
|
39
66
|
if (!color) return null;
|
|
40
|
-
const direct = srgbToRgb(color);
|
|
67
|
+
const direct = srgbToRgb(color) ?? oklabToRgb(color);
|
|
41
68
|
if (direct) return direct;
|
|
42
69
|
if (/^rgba?\(/i.test(color)) return color;
|
|
43
70
|
if (typeof document === "undefined") return color;
|
|
@@ -69,26 +96,32 @@ function over(top, bottom) {
|
|
|
69
96
|
a: 1
|
|
70
97
|
};
|
|
71
98
|
}
|
|
99
|
+
function mustAbstain(style, parts) {
|
|
100
|
+
if (style.backgroundImage && style.backgroundImage !== "none") return true;
|
|
101
|
+
return !parts && !!style.backgroundColor && style.backgroundColor !== "transparent";
|
|
102
|
+
}
|
|
103
|
+
function compositeLayers(layers) {
|
|
104
|
+
const deepest = layers[layers.length - 1];
|
|
105
|
+
let acc = deepest.a >= 1 ? layers.pop() : { r: 255, g: 255, b: 255, a: 1 };
|
|
106
|
+
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
107
|
+
acc = over(layers[i], acc);
|
|
108
|
+
}
|
|
109
|
+
return `rgb(${Math.round(acc.r)}, ${Math.round(acc.g)}, ${Math.round(acc.b)})`;
|
|
110
|
+
}
|
|
72
111
|
function resolvePaintedBackground(el) {
|
|
73
112
|
const layers = [];
|
|
74
113
|
let node = el;
|
|
75
114
|
while (node) {
|
|
76
115
|
const style = getComputedStyle(node);
|
|
77
|
-
if (style.backgroundImage && style.backgroundImage !== "none") return null;
|
|
78
116
|
const parts = rgbaParts(toRgb(style.backgroundColor));
|
|
117
|
+
if (mustAbstain(style, parts)) return null;
|
|
79
118
|
if (parts && parts.a > 0) {
|
|
80
119
|
layers.push(parts);
|
|
81
120
|
if (parts.a >= 1) break;
|
|
82
121
|
}
|
|
83
122
|
node = node.parentElement;
|
|
84
123
|
}
|
|
85
|
-
|
|
86
|
-
const deepest = layers[layers.length - 1];
|
|
87
|
-
let acc = deepest.a >= 1 ? layers.pop() : { r: 255, g: 255, b: 255, a: 1 };
|
|
88
|
-
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
89
|
-
acc = over(layers[i], acc);
|
|
90
|
-
}
|
|
91
|
-
return `rgb(${Math.round(acc.r)}, ${Math.round(acc.g)}, ${Math.round(acc.b)})`;
|
|
124
|
+
return layers.length ? compositeLayers(layers) : null;
|
|
92
125
|
}
|
|
93
126
|
function channelsOf(rgb) {
|
|
94
127
|
if (!rgb) return null;
|
|
@@ -23,6 +23,14 @@ export interface INumberFieldProps extends IFieldProps, IInputProps, IInputVaria
|
|
|
23
23
|
holdRepeat?: number;
|
|
24
24
|
split?: boolean;
|
|
25
25
|
hideControls?: boolean;
|
|
26
|
+
/*********************************************************
|
|
27
|
+
* clamp
|
|
28
|
+
*
|
|
29
|
+
* @description
|
|
30
|
+
* Bounds the value to `min`/`max` on blur and on write (default `true`).
|
|
31
|
+
* `false` keeps an out-of-range value so validation can reject it.
|
|
32
|
+
********************************************************/
|
|
33
|
+
clamp?: boolean;
|
|
26
34
|
compact?: boolean;
|
|
27
35
|
/*********************************************************
|
|
28
36
|
* decrementAriaLabel / incrementAriaLabel
|
|
@@ -38,8 +38,12 @@ export interface IPasswordFieldProps extends ITextFieldProps {
|
|
|
38
38
|
* Useful for forms that want the requirements always visible.
|
|
39
39
|
*/
|
|
40
40
|
persistentRequirements?: boolean;
|
|
41
|
-
/** Minimum
|
|
41
|
+
/** Minimum length. Enforced only when set explicitly, or with `requirements` / `strengthBar` (default 8 there). */
|
|
42
42
|
minLength?: number;
|
|
43
|
+
/*********************************************************
|
|
44
|
+
* Replaces the default (translated) message of the length rule for this field.
|
|
45
|
+
********************************************************/
|
|
46
|
+
minLengthMessage?: string;
|
|
43
47
|
/** Require at least one lowercase letter. */
|
|
44
48
|
needTiny?: boolean;
|
|
45
49
|
/** Require at least one uppercase letter. */
|
|
@@ -21,6 +21,14 @@ export interface IPasswordRequirement {
|
|
|
21
21
|
id: string;
|
|
22
22
|
/** Human-readable label rendered next to the check/cross icon. */
|
|
23
23
|
label: string;
|
|
24
|
+
/*********************************************************
|
|
25
|
+
* Locale key resolved with `t()` instead of `label` (used by the DS defaults).
|
|
26
|
+
********************************************************/
|
|
27
|
+
labelKey?: string;
|
|
28
|
+
/*********************************************************
|
|
29
|
+
* Params for `labelKey` (e.g. `{count}`).
|
|
30
|
+
********************************************************/
|
|
31
|
+
labelParams?: Record<string, string | number>;
|
|
24
32
|
/**
|
|
25
33
|
* Predicate evaluated against the current password value.
|
|
26
34
|
* Return `true` when the rule is satisfied.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IClickLabelEmits, ICommonsComponentEmits, ICommonsComponentProps } from '../Commons/commons.interface';
|
|
2
|
-
import type { ISelectionControlProps } from '../SelectionControl/selection-control.interface';
|
|
2
|
+
import type { ISelectionControlProps, ISelectionControlSlots } from '../SelectionControl/selection-control.interface';
|
|
3
3
|
import type { TColor } from '../../types/Commons/color.type';
|
|
4
4
|
import type { TIcon } from '../../types/Icon/icon.type';
|
|
5
5
|
export interface IRadioBtnProps extends ICommonsComponentProps, ISelectionControlProps {
|
|
@@ -32,5 +32,5 @@ export interface IRadioBtnSlots {
|
|
|
32
32
|
icon?: TIcon;
|
|
33
33
|
props: any;
|
|
34
34
|
}) => any;
|
|
35
|
-
label?:
|
|
35
|
+
label?: ISelectionControlSlots['label'];
|
|
36
36
|
}
|
|
@@ -12,6 +12,7 @@ import type { IMarginProps } from '../Commons/margin.interface';
|
|
|
12
12
|
import type { IPaddingProps } from '../Commons/padding.interface';
|
|
13
13
|
import type { IRadioBtnProps } from './radio-btn.interface';
|
|
14
14
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
15
|
+
import type { ISelectionControlSlots } from '../SelectionControl/selection-control.interface';
|
|
15
16
|
import type { TIcon } from '../../types/Icon/icon.type';
|
|
16
17
|
export interface IRadioProps extends ICommonsComponentProps, IInputProps, IRadioBtnProps, IDensityProps, IPaddingProps, IMarginProps, IRoundedProps, IColorProps, IBorderProps, IElevationProps, IActiveProps, IHoverProps {
|
|
17
18
|
}
|
|
@@ -41,7 +42,7 @@ export interface IRadioSlots extends IAdjacentSlots {
|
|
|
41
42
|
icon?: TIcon;
|
|
42
43
|
model: any;
|
|
43
44
|
}) => any;
|
|
44
|
-
label?:
|
|
45
|
+
label?: ISelectionControlSlots['label'];
|
|
45
46
|
details?: (props: any) => any;
|
|
46
47
|
messages?: (data: {
|
|
47
48
|
hasMessages: boolean;
|
|
@@ -3,7 +3,7 @@ import type { ICommonsComponentProps, ITagProps } from '../Commons/commons.inter
|
|
|
3
3
|
import type { IDensityProps } from '../Commons/density.interface';
|
|
4
4
|
import type { IDimensionProps } from '../Commons/dimension.interface';
|
|
5
5
|
import type { IElevationProps } from '../Commons/elevation.interface';
|
|
6
|
-
import type { IHoverProps } from '../Commons/hover.interface';
|
|
6
|
+
import type { IHoverEmits, IHoverProps } from '../Commons/hover.interface';
|
|
7
7
|
import type { IMarginProps } from '../Commons/margin.interface';
|
|
8
8
|
import type { IPaddingProps } from '../Commons/padding.interface';
|
|
9
9
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
@@ -15,7 +15,7 @@ export interface ITableProps extends ICommonsComponentProps, IBorderProps, IRoun
|
|
|
15
15
|
captionVisible?: boolean;
|
|
16
16
|
ariaRowcount?: number;
|
|
17
17
|
}
|
|
18
|
-
export interface ITableEmits {
|
|
18
|
+
export interface ITableEmits extends IHoverEmits {
|
|
19
19
|
}
|
|
20
20
|
/** Slot signatures for `<OrigamTable>`. */
|
|
21
21
|
export interface ITableSlots {
|