@ouestfrance/sipa-bms-ui 8.26.0 → 8.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sipa-bms-ui.es.js +15 -12
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +15 -12
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/feedback/BmsLoader.stories.js +5 -5
- package/src/components/form/BmsInputText.spec.ts +15 -15
- package/src/components/form/BmsInputText.vue +18 -14
- package/src/showroom/pages/index.vue +1 -1
package/dist/sipa-bms-ui.es.js
CHANGED
|
@@ -69412,17 +69412,19 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69412
69412
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
69413
69413
|
const props = __props;
|
|
69414
69414
|
const input = ref(null);
|
|
69415
|
-
const
|
|
69415
|
+
const onChangeErrors = ref([]);
|
|
69416
|
+
const onChangeCaptions = ref([]);
|
|
69417
|
+
const onBlurErrors = ref([]);
|
|
69416
69418
|
const computedErrors = computed(() => {
|
|
69417
|
-
return props.errors ?
|
|
69419
|
+
return props.errors ? onChangeErrors.value.concat(props.errors, onBlurErrors.value) : onChangeErrors.value.concat(onBlurErrors.value);
|
|
69418
69420
|
});
|
|
69419
|
-
const internalCaptions = ref([]);
|
|
69420
69421
|
const computedCaptions = computed(() => {
|
|
69421
|
-
return props.captions ?
|
|
69422
|
+
return props.captions ? onChangeCaptions.value.concat(props.captions) : onChangeCaptions.value;
|
|
69422
69423
|
});
|
|
69423
69424
|
onMounted(() => {
|
|
69424
|
-
|
|
69425
|
-
|
|
69425
|
+
onBlurErrors.value = [];
|
|
69426
|
+
onChangeErrors.value = [];
|
|
69427
|
+
onChangeCaptions.value = [];
|
|
69426
69428
|
checkPattern();
|
|
69427
69429
|
checkLimit();
|
|
69428
69430
|
});
|
|
@@ -69432,7 +69434,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69432
69434
|
if (hasValue && props.pattern) {
|
|
69433
69435
|
const regex = new RegExp(props.pattern);
|
|
69434
69436
|
if (!regex.test(String(props.modelValue))) {
|
|
69435
|
-
|
|
69437
|
+
onBlurErrors.value.push(
|
|
69436
69438
|
props.patternMessage || `La valeur ne correspond pas au motif attendu ( ${props.pattern} )`
|
|
69437
69439
|
);
|
|
69438
69440
|
}
|
|
@@ -69442,17 +69444,17 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69442
69444
|
const hasValue = props.modelValue !== null && props.modelValue !== void 0;
|
|
69443
69445
|
if (hasValue && props.inputType === InputType.TEXT && typeof props.modelValue === "string") {
|
|
69444
69446
|
if (props.minlength !== void 0 && props.modelValue.length < props.minlength) {
|
|
69445
|
-
|
|
69447
|
+
onChangeErrors.value.push(
|
|
69446
69448
|
"Longueur inférieur au minimum autorisé (min:" + props.minlength + ")"
|
|
69447
69449
|
);
|
|
69448
69450
|
}
|
|
69449
69451
|
if (props.maxlength !== void 0) {
|
|
69450
69452
|
if (props.modelValue.length > props.maxlength) {
|
|
69451
|
-
|
|
69453
|
+
onChangeErrors.value.push(
|
|
69452
69454
|
`Longueur supérieure au maximum autorisé (max:${props.maxlength})`
|
|
69453
69455
|
);
|
|
69454
69456
|
} else if (props.modelValue.length === props.maxlength) {
|
|
69455
|
-
|
|
69457
|
+
onChangeCaptions.value.push({
|
|
69456
69458
|
label: `Attention, vous avez atteint la limite de ${props.maxlength} caractères.`,
|
|
69457
69459
|
mode: StatusType.Warning
|
|
69458
69460
|
});
|
|
@@ -69462,6 +69464,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69462
69464
|
};
|
|
69463
69465
|
const onBlur = () => {
|
|
69464
69466
|
$emits("blur");
|
|
69467
|
+
onBlurErrors.value = [];
|
|
69465
69468
|
checkPattern();
|
|
69466
69469
|
};
|
|
69467
69470
|
const setFocus = () => {
|
|
@@ -69475,8 +69478,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69475
69478
|
watch(
|
|
69476
69479
|
() => props.modelValue,
|
|
69477
69480
|
() => {
|
|
69478
|
-
|
|
69479
|
-
|
|
69481
|
+
onChangeErrors.value = [];
|
|
69482
|
+
onChangeCaptions.value = [];
|
|
69480
69483
|
checkLimit();
|
|
69481
69484
|
}
|
|
69482
69485
|
);
|