@ouestfrance/sipa-bms-ui 8.25.3 → 8.26.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/dist/components/feedback/BmsLoader.vue.d.ts +4 -0
- package/dist/components/form/BmsInputText.vue.d.ts +2 -0
- package/dist/components/form/BmsSearch.vue.d.ts +2 -0
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +2 -0
- package/dist/components/table/BmsTableFilters.vue.d.ts +2 -0
- package/dist/mockServiceWorker.js +1 -1
- package/dist/sipa-bms-ui.css +16 -4
- package/dist/sipa-bms-ui.es.js +138 -47
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +137 -46
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +9 -9
- package/src/components/feedback/BmsLoader.stories.js +25 -3
- package/src/components/feedback/BmsLoader.vue +32 -6
- package/src/components/form/BmsInputNumber.vue +0 -4
- package/src/components/form/BmsInputText.spec.ts +69 -0
- package/src/components/form/BmsInputText.stories.js +12 -0
- package/src/components/form/BmsInputText.vue +39 -14
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { StatusType } from '../../models';
|
|
1
2
|
export declare function transformIntoPx(totransform: string | number): string;
|
|
2
3
|
declare const _default: import('vue').DefineComponent<{
|
|
3
4
|
size?: string | number | undefined;
|
|
5
|
+
mode?: StatusType | undefined;
|
|
4
6
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
5
7
|
size?: string | number | undefined;
|
|
8
|
+
mode?: StatusType | undefined;
|
|
6
9
|
}> & Readonly<{}>, {
|
|
10
|
+
mode: StatusType;
|
|
7
11
|
size: string | number;
|
|
8
12
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
13
|
export default _default;
|
|
@@ -9,6 +9,8 @@ export interface Props extends FieldComponentProps {
|
|
|
9
9
|
minlength?: number;
|
|
10
10
|
maxlength?: number;
|
|
11
11
|
step?: number;
|
|
12
|
+
pattern?: string;
|
|
13
|
+
patternMessage?: string;
|
|
12
14
|
}
|
|
13
15
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Props, {
|
|
14
16
|
setFocus: () => void;
|
|
@@ -26,6 +26,8 @@ declare const _default: import('vue').DefineComponent<Props, {
|
|
|
26
26
|
readonly minlength?: number | undefined;
|
|
27
27
|
readonly maxlength?: number | undefined;
|
|
28
28
|
readonly step?: number | undefined;
|
|
29
|
+
readonly pattern?: string | undefined;
|
|
30
|
+
readonly patternMessage?: string | undefined;
|
|
29
31
|
readonly label?: string | undefined;
|
|
30
32
|
readonly loading?: boolean | undefined;
|
|
31
33
|
readonly required?: boolean | undefined;
|
|
@@ -27,6 +27,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
27
27
|
readonly minlength?: number | undefined;
|
|
28
28
|
readonly maxlength?: number | undefined;
|
|
29
29
|
readonly step?: number | undefined;
|
|
30
|
+
readonly pattern?: string | undefined;
|
|
31
|
+
readonly patternMessage?: string | undefined;
|
|
30
32
|
readonly label?: string | undefined;
|
|
31
33
|
readonly loading?: boolean | undefined;
|
|
32
34
|
readonly required?: boolean | undefined;
|
|
@@ -47,6 +47,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
47
47
|
readonly minlength?: number | undefined;
|
|
48
48
|
readonly maxlength?: number | undefined;
|
|
49
49
|
readonly step?: number | undefined;
|
|
50
|
+
readonly pattern?: string | undefined;
|
|
51
|
+
readonly patternMessage?: string | undefined;
|
|
50
52
|
readonly label?: string | undefined;
|
|
51
53
|
readonly loading?: boolean | undefined;
|
|
52
54
|
readonly required?: boolean | undefined;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const PACKAGE_VERSION = '2.12.
|
|
10
|
+
const PACKAGE_VERSION = '2.12.10'
|
|
11
11
|
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
12
12
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
13
13
|
const activeClientIds = new Set()
|
package/dist/sipa-bms-ui.css
CHANGED
|
@@ -470,12 +470,24 @@
|
|
|
470
470
|
pointer-events: none;
|
|
471
471
|
user-select: none;
|
|
472
472
|
transition: opacity 0.2s ease-in-out;
|
|
473
|
-
}.bms-loader[data-v-
|
|
474
|
-
font-size: var(--
|
|
475
|
-
color: var(--bms-main-100
|
|
473
|
+
}.bms-loader[data-v-4503885b] {
|
|
474
|
+
font-size: var(--fe29ee96);
|
|
475
|
+
color: var(--bms-main-100);
|
|
476
476
|
display: inline-block;
|
|
477
477
|
}
|
|
478
|
-
.bms-loader
|
|
478
|
+
.bms-loader.warning[data-v-4503885b] {
|
|
479
|
+
color: var(--bms-orange-100);
|
|
480
|
+
}
|
|
481
|
+
.bms-loader.danger[data-v-4503885b] {
|
|
482
|
+
color: var(--bms-red-100);
|
|
483
|
+
}
|
|
484
|
+
.bms-loader.information[data-v-4503885b] {
|
|
485
|
+
color: var(--bms-grey-100);
|
|
486
|
+
}
|
|
487
|
+
.bms-loader.success[data-v-4503885b] {
|
|
488
|
+
color: var(--bms-green-100);
|
|
489
|
+
}
|
|
490
|
+
.bms-loader svg[data-v-4503885b] {
|
|
479
491
|
width: 1em;
|
|
480
492
|
height: 1em;
|
|
481
493
|
display: block;
|
package/dist/sipa-bms-ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, createElementBlock, createBlock, unref, openBlock, mergeProps, renderSlot, withCtx, createElementVNode, useAttrs, normalizeClass, normalizeProps, guardReactiveProps, createVNode, h as h$1, createCommentVNode, resolveDynamicComponent, toDisplayString, mergeModels, useModel, ref, onBeforeMount, onBeforeUnmount, normalizeStyle, useCssVars,
|
|
1
|
+
import { defineComponent, computed, resolveComponent, createElementBlock, createBlock, unref, openBlock, mergeProps, renderSlot, withCtx, createElementVNode, useAttrs, normalizeClass, normalizeProps, guardReactiveProps, createVNode, h as h$1, createCommentVNode, resolveDynamicComponent, toDisplayString, mergeModels, useModel, ref, onBeforeMount, onBeforeUnmount, normalizeStyle, useCssVars, useId, onMounted, nextTick, watch, getCurrentInstance, getCurrentScope, onScopeDispose, hasInjectionContext, inject, toValue, onUnmounted, shallowRef, watchEffect, Transition, withDirectives, vShow, Fragment, Teleport, createTextVNode, useTemplateRef, renderList, withModifiers, withKeys, createSlots, useSlots, vModelCheckbox, toRaw, vModelRadio, vModelText, reactive, isVNode, createStaticVNode, isRef, TransitionGroup, createApp } from 'vue';
|
|
2
2
|
import { useRouter, useRoute } from 'vue-router';
|
|
3
3
|
|
|
4
4
|
var CocardeBorder = /* @__PURE__ */ ((CocardeBorder2) => {
|
|
@@ -335,7 +335,7 @@ const getHeaderClasses = (header, sort) => {
|
|
|
335
335
|
};
|
|
336
336
|
|
|
337
337
|
const _hoisted_1$12 = ["href", "target"];
|
|
338
|
-
const _hoisted_2$
|
|
338
|
+
const _hoisted_2$H = ["href", "onClick", "target"];
|
|
339
339
|
const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
340
340
|
__name: "BmsLink",
|
|
341
341
|
props: {
|
|
@@ -377,7 +377,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
|
377
377
|
target: __props.target
|
|
378
378
|
}, _ctx.$attrs), [
|
|
379
379
|
renderSlot(_ctx.$slots, "default")
|
|
380
|
-
], 16, _hoisted_2$
|
|
380
|
+
], 16, _hoisted_2$H)
|
|
381
381
|
]),
|
|
382
382
|
_: 3
|
|
383
383
|
}, 8, ["to"]));
|
|
@@ -427,8 +427,8 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
427
427
|
});
|
|
428
428
|
|
|
429
429
|
const _hoisted_1$10 = { class: "start" };
|
|
430
|
-
const _hoisted_2$
|
|
431
|
-
const _hoisted_3$
|
|
430
|
+
const _hoisted_2$G = { class: "content" };
|
|
431
|
+
const _hoisted_3$o = { class: "end" };
|
|
432
432
|
const _sfc_main$1u = /* @__PURE__ */ defineComponent({
|
|
433
433
|
__name: "UiButton",
|
|
434
434
|
props: {
|
|
@@ -447,10 +447,10 @@ const _sfc_main$1u = /* @__PURE__ */ defineComponent({
|
|
|
447
447
|
createElementVNode("span", _hoisted_1$10, [
|
|
448
448
|
renderSlot(_ctx.$slots, "start")
|
|
449
449
|
]),
|
|
450
|
-
createElementVNode("span", _hoisted_2$
|
|
450
|
+
createElementVNode("span", _hoisted_2$G, [
|
|
451
451
|
renderSlot(_ctx.$slots, "default")
|
|
452
452
|
]),
|
|
453
|
-
createElementVNode("span", _hoisted_3$
|
|
453
|
+
createElementVNode("span", _hoisted_3$o, [
|
|
454
454
|
renderSlot(_ctx.$slots, "end")
|
|
455
455
|
])
|
|
456
456
|
]),
|
|
@@ -38069,8 +38069,8 @@ const lucideIcons = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePropert
|
|
|
38069
38069
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
38070
38070
|
|
|
38071
38071
|
const _hoisted_1$_ = { class: "info-line" };
|
|
38072
|
-
const _hoisted_2$
|
|
38073
|
-
const _hoisted_3$
|
|
38072
|
+
const _hoisted_2$F = { class: "icon" };
|
|
38073
|
+
const _hoisted_3$n = { class: "message" };
|
|
38074
38074
|
const _sfc_main$1q = /* @__PURE__ */ defineComponent({
|
|
38075
38075
|
__name: "BmsAlert",
|
|
38076
38076
|
props: {
|
|
@@ -38097,10 +38097,10 @@ const _sfc_main$1q = /* @__PURE__ */ defineComponent({
|
|
|
38097
38097
|
class: normalizeClass(["alert", `alert-${props.type}`])
|
|
38098
38098
|
}, [
|
|
38099
38099
|
createElementVNode("div", _hoisted_1$_, [
|
|
38100
|
-
createElementVNode("span", _hoisted_2$
|
|
38100
|
+
createElementVNode("span", _hoisted_2$F, [
|
|
38101
38101
|
(openBlock(), createBlock(resolveDynamicComponent(alertIcon.value), { size: 20 }))
|
|
38102
38102
|
]),
|
|
38103
|
-
createElementVNode("span", _hoisted_3$
|
|
38103
|
+
createElementVNode("span", _hoisted_3$n, [
|
|
38104
38104
|
renderSlot(_ctx.$slots, "message", {}, () => [
|
|
38105
38105
|
createElementVNode("strong", null, toDisplayString(__props.message), 1)
|
|
38106
38106
|
], true)
|
|
@@ -38160,7 +38160,7 @@ const _hoisted_1$Y = {
|
|
|
38160
38160
|
key: 0,
|
|
38161
38161
|
class: "icon"
|
|
38162
38162
|
};
|
|
38163
|
-
const _hoisted_2$
|
|
38163
|
+
const _hoisted_2$E = ["innerHTML"];
|
|
38164
38164
|
const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
38165
38165
|
__name: "BmsCaption",
|
|
38166
38166
|
props: {
|
|
@@ -38198,7 +38198,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
38198
38198
|
createElementVNode("span", {
|
|
38199
38199
|
class: "label",
|
|
38200
38200
|
innerHTML: unref(sanitizeHtml)(computedCaption.value.label)
|
|
38201
|
-
}, null, 8, _hoisted_2$
|
|
38201
|
+
}, null, 8, _hoisted_2$E)
|
|
38202
38202
|
], 2);
|
|
38203
38203
|
};
|
|
38204
38204
|
}
|
|
@@ -38207,21 +38207,21 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
38207
38207
|
const BmsCaption = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["__scopeId", "data-v-b08dd4e0"]]);
|
|
38208
38208
|
|
|
38209
38209
|
const _hoisted_1$X = { class: "circular-progress" };
|
|
38210
|
-
const _hoisted_2$
|
|
38210
|
+
const _hoisted_2$D = {
|
|
38211
38211
|
key: 0,
|
|
38212
38212
|
viewBox: "0 0 100 100"
|
|
38213
38213
|
};
|
|
38214
|
-
const _hoisted_3$
|
|
38215
|
-
const _hoisted_4$
|
|
38216
|
-
const _hoisted_5$
|
|
38214
|
+
const _hoisted_3$m = { transform: "rotate(-90, 50, 50)" };
|
|
38215
|
+
const _hoisted_4$d = ["stroke-dashoffset"];
|
|
38216
|
+
const _hoisted_5$9 = { class: "percent" };
|
|
38217
38217
|
const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
38218
38218
|
__name: "BmsCircularProgress",
|
|
38219
38219
|
props: ["progress"],
|
|
38220
38220
|
setup(__props) {
|
|
38221
38221
|
return (_ctx, _cache) => {
|
|
38222
38222
|
return openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
38223
|
-
__props.progress ? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
38224
|
-
createElementVNode("g", _hoisted_3$
|
|
38223
|
+
__props.progress ? (openBlock(), createElementBlock("svg", _hoisted_2$D, [
|
|
38224
|
+
createElementVNode("g", _hoisted_3$m, [
|
|
38225
38225
|
_cache[0] || (_cache[0] = createElementVNode("circle", {
|
|
38226
38226
|
opacity: ".08",
|
|
38227
38227
|
r: "45",
|
|
@@ -38240,10 +38240,10 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
38240
38240
|
"stroke-linecap": "round",
|
|
38241
38241
|
"stroke-dashoffset": 283 - __props.progress * 283 / 100,
|
|
38242
38242
|
"stroke-dasharray": "283"
|
|
38243
|
-
}, null, 8, _hoisted_4$
|
|
38243
|
+
}, null, 8, _hoisted_4$d)
|
|
38244
38244
|
])
|
|
38245
38245
|
])) : createCommentVNode("", true),
|
|
38246
|
-
createElementVNode("div", _hoisted_5$
|
|
38246
|
+
createElementVNode("div", _hoisted_5$9, toDisplayString(__props.progress) + "%", 1)
|
|
38247
38247
|
]);
|
|
38248
38248
|
};
|
|
38249
38249
|
}
|
|
@@ -38314,32 +38314,105 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
38314
38314
|
|
|
38315
38315
|
const BmsGhost = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__scopeId", "data-v-205789ac"]]);
|
|
38316
38316
|
|
|
38317
|
-
const _hoisted_1$W = {
|
|
38317
|
+
const _hoisted_1$W = {
|
|
38318
|
+
viewBox: "0 0 38 38",
|
|
38319
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
38320
|
+
};
|
|
38321
|
+
const _hoisted_2$C = ["id"];
|
|
38322
|
+
const _hoisted_3$l = {
|
|
38323
|
+
fill: "none",
|
|
38324
|
+
"fill-rule": "evenodd"
|
|
38325
|
+
};
|
|
38326
|
+
const _hoisted_4$c = { transform: "translate(1 1)" };
|
|
38327
|
+
const _hoisted_5$8 = ["stroke"];
|
|
38318
38328
|
function transformIntoPx(totransform) {
|
|
38319
38329
|
return typeof totransform === "string" ? totransform : `${totransform}px`;
|
|
38320
38330
|
}
|
|
38321
38331
|
const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
38322
38332
|
__name: "BmsLoader",
|
|
38323
38333
|
props: {
|
|
38324
|
-
size: { default: "inherit" }
|
|
38334
|
+
size: { default: "inherit" },
|
|
38335
|
+
mode: { default: StatusType.Default }
|
|
38325
38336
|
},
|
|
38326
38337
|
setup(__props) {
|
|
38327
38338
|
useCssVars((_ctx) => ({
|
|
38328
|
-
"
|
|
38339
|
+
"fe29ee96": sizeInPx.value
|
|
38329
38340
|
}));
|
|
38341
|
+
const gradientId = useId();
|
|
38330
38342
|
const props = __props;
|
|
38331
38343
|
const sizeInPx = computed(() => {
|
|
38332
38344
|
return transformIntoPx(props.size);
|
|
38333
38345
|
});
|
|
38334
38346
|
return (_ctx, _cache) => {
|
|
38335
|
-
return openBlock(), createElementBlock("div",
|
|
38336
|
-
|
|
38337
|
-
|
|
38347
|
+
return openBlock(), createElementBlock("div", {
|
|
38348
|
+
class: normalizeClass(["bms-loader", __props.mode])
|
|
38349
|
+
}, [
|
|
38350
|
+
(openBlock(), createElementBlock("svg", _hoisted_1$W, [
|
|
38351
|
+
createElementVNode("defs", null, [
|
|
38352
|
+
createElementVNode("linearGradient", {
|
|
38353
|
+
x1: "8.042%",
|
|
38354
|
+
y1: "0%",
|
|
38355
|
+
x2: "65.682%",
|
|
38356
|
+
y2: "23.865%",
|
|
38357
|
+
id: unref(gradientId)
|
|
38358
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
38359
|
+
createElementVNode("stop", {
|
|
38360
|
+
"stop-color": "currentColor",
|
|
38361
|
+
"stop-opacity": "0",
|
|
38362
|
+
offset: "0%"
|
|
38363
|
+
}, null, -1),
|
|
38364
|
+
createElementVNode("stop", {
|
|
38365
|
+
"stop-color": "currentColor",
|
|
38366
|
+
"stop-opacity": ".631",
|
|
38367
|
+
offset: "63.146%"
|
|
38368
|
+
}, null, -1),
|
|
38369
|
+
createElementVNode("stop", {
|
|
38370
|
+
"stop-color": "currentColor",
|
|
38371
|
+
offset: "100%"
|
|
38372
|
+
}, null, -1)
|
|
38373
|
+
])], 8, _hoisted_2$C)
|
|
38374
|
+
]),
|
|
38375
|
+
createElementVNode("g", _hoisted_3$l, [
|
|
38376
|
+
createElementVNode("g", _hoisted_4$c, [
|
|
38377
|
+
createElementVNode("path", {
|
|
38378
|
+
d: "M36 18c0-9.94-8.06-18-18-18",
|
|
38379
|
+
id: "Oval-2",
|
|
38380
|
+
stroke: `url(#${unref(gradientId)})`,
|
|
38381
|
+
"stroke-width": "2"
|
|
38382
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
38383
|
+
createElementVNode("animateTransform", {
|
|
38384
|
+
attributeName: "transform",
|
|
38385
|
+
type: "rotate",
|
|
38386
|
+
from: "0 18 18",
|
|
38387
|
+
to: "360 18 18",
|
|
38388
|
+
dur: "0.9s",
|
|
38389
|
+
repeatCount: "indefinite"
|
|
38390
|
+
}, null, -1)
|
|
38391
|
+
])], 8, _hoisted_5$8),
|
|
38392
|
+
_cache[2] || (_cache[2] = createElementVNode("circle", {
|
|
38393
|
+
fill: "#fff",
|
|
38394
|
+
cx: "36",
|
|
38395
|
+
cy: "18",
|
|
38396
|
+
r: "1"
|
|
38397
|
+
}, [
|
|
38398
|
+
createElementVNode("animateTransform", {
|
|
38399
|
+
attributeName: "transform",
|
|
38400
|
+
type: "rotate",
|
|
38401
|
+
from: "0 18 18",
|
|
38402
|
+
to: "360 18 18",
|
|
38403
|
+
dur: "0.9s",
|
|
38404
|
+
repeatCount: "indefinite"
|
|
38405
|
+
})
|
|
38406
|
+
], -1))
|
|
38407
|
+
])
|
|
38408
|
+
])
|
|
38409
|
+
]))
|
|
38410
|
+
], 2);
|
|
38338
38411
|
};
|
|
38339
38412
|
}
|
|
38340
38413
|
});
|
|
38341
38414
|
|
|
38342
|
-
const BmsLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-
|
|
38415
|
+
const BmsLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-4503885b"]]);
|
|
38343
38416
|
|
|
38344
38417
|
function tryOnScopeDispose(fn) {
|
|
38345
38418
|
if (getCurrentScope()) {
|
|
@@ -69322,6 +69395,8 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69322
69395
|
minlength: {},
|
|
69323
69396
|
maxlength: {},
|
|
69324
69397
|
step: {},
|
|
69398
|
+
pattern: {},
|
|
69399
|
+
patternMessage: {},
|
|
69325
69400
|
label: { default: "" },
|
|
69326
69401
|
loading: { type: Boolean },
|
|
69327
69402
|
required: { type: Boolean, default: false },
|
|
@@ -69346,35 +69421,49 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69346
69421
|
return props.captions ? internalCaptions.value.concat(props.captions) : internalCaptions.value;
|
|
69347
69422
|
});
|
|
69348
69423
|
onMounted(() => {
|
|
69424
|
+
internalErrors.value = [];
|
|
69425
|
+
internalCaptions.value = [];
|
|
69426
|
+
checkPattern();
|
|
69349
69427
|
checkLimit();
|
|
69350
69428
|
});
|
|
69351
69429
|
const $emits = __emit;
|
|
69430
|
+
const checkPattern = () => {
|
|
69431
|
+
const hasValue = props.modelValue !== null && props.modelValue !== void 0;
|
|
69432
|
+
if (hasValue && props.pattern) {
|
|
69433
|
+
const regex = new RegExp(props.pattern);
|
|
69434
|
+
if (!regex.test(String(props.modelValue))) {
|
|
69435
|
+
internalErrors.value.push(
|
|
69436
|
+
props.patternMessage || `La valeur ne correspond pas au motif attendu ( ${props.pattern} )`
|
|
69437
|
+
);
|
|
69438
|
+
}
|
|
69439
|
+
}
|
|
69440
|
+
};
|
|
69352
69441
|
const checkLimit = () => {
|
|
69353
|
-
internalErrors.value = [];
|
|
69354
|
-
internalCaptions.value = [];
|
|
69355
69442
|
const hasValue = props.modelValue !== null && props.modelValue !== void 0;
|
|
69356
69443
|
if (hasValue && props.inputType === InputType.TEXT && typeof props.modelValue === "string") {
|
|
69357
69444
|
if (props.minlength !== void 0 && props.modelValue.length < props.minlength) {
|
|
69358
|
-
internalErrors.value
|
|
69445
|
+
internalErrors.value.push(
|
|
69359
69446
|
"Longueur inférieur au minimum autorisé (min:" + props.minlength + ")"
|
|
69360
|
-
|
|
69447
|
+
);
|
|
69361
69448
|
}
|
|
69362
69449
|
if (props.maxlength !== void 0) {
|
|
69363
69450
|
if (props.modelValue.length > props.maxlength) {
|
|
69364
|
-
internalErrors.value
|
|
69451
|
+
internalErrors.value.push(
|
|
69365
69452
|
`Longueur supérieure au maximum autorisé (max:${props.maxlength})`
|
|
69366
|
-
|
|
69453
|
+
);
|
|
69367
69454
|
} else if (props.modelValue.length === props.maxlength) {
|
|
69368
|
-
internalCaptions.value
|
|
69369
|
-
{
|
|
69370
|
-
|
|
69371
|
-
|
|
69372
|
-
}
|
|
69373
|
-
];
|
|
69455
|
+
internalCaptions.value.push({
|
|
69456
|
+
label: `Attention, vous avez atteint la limite de ${props.maxlength} caractères.`,
|
|
69457
|
+
mode: StatusType.Warning
|
|
69458
|
+
});
|
|
69374
69459
|
}
|
|
69375
69460
|
}
|
|
69376
69461
|
}
|
|
69377
69462
|
};
|
|
69463
|
+
const onBlur = () => {
|
|
69464
|
+
$emits("blur");
|
|
69465
|
+
checkPattern();
|
|
69466
|
+
};
|
|
69378
69467
|
const setFocus = () => {
|
|
69379
69468
|
if (input.value) {
|
|
69380
69469
|
input.value.setFocus();
|
|
@@ -69385,7 +69474,11 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69385
69474
|
});
|
|
69386
69475
|
watch(
|
|
69387
69476
|
() => props.modelValue,
|
|
69388
|
-
() =>
|
|
69477
|
+
() => {
|
|
69478
|
+
internalErrors.value = [];
|
|
69479
|
+
internalCaptions.value = [];
|
|
69480
|
+
checkLimit();
|
|
69481
|
+
}
|
|
69389
69482
|
);
|
|
69390
69483
|
return (_ctx, _cache) => {
|
|
69391
69484
|
const _component_field = resolveComponent("field");
|
|
@@ -69411,8 +69504,9 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69411
69504
|
max: __props.max,
|
|
69412
69505
|
minlength: __props.minlength,
|
|
69413
69506
|
maxlength: __props.maxlength,
|
|
69414
|
-
|
|
69415
|
-
|
|
69507
|
+
pattern: __props.pattern,
|
|
69508
|
+
onBlur,
|
|
69509
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => $emits("focus"))
|
|
69416
69510
|
}, {
|
|
69417
69511
|
"icon-start": withCtx(() => [
|
|
69418
69512
|
renderSlot(_ctx.$slots, "icon-start")
|
|
@@ -69421,7 +69515,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
69421
69515
|
renderSlot(_ctx.$slots, "icon-end")
|
|
69422
69516
|
]),
|
|
69423
69517
|
_: 3
|
|
69424
|
-
}, 8, ["type", "modelValue", "required", "placeholder", "disabled", "errors", "small", "step", "min", "max", "minlength", "maxlength"])
|
|
69518
|
+
}, 8, ["type", "modelValue", "required", "placeholder", "disabled", "errors", "small", "step", "min", "max", "minlength", "maxlength", "pattern"])
|
|
69425
69519
|
]),
|
|
69426
69520
|
_: 3
|
|
69427
69521
|
}, 16, ["captions", "errors"]);
|
|
@@ -69690,9 +69784,6 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
69690
69784
|
if (!props.disabled)
|
|
69691
69785
|
$emits("update:modelValue", Number((e?.target).value));
|
|
69692
69786
|
};
|
|
69693
|
-
computed(() => {
|
|
69694
|
-
return { "is-error": props.errors?.length, "is-disabled": props.disabled };
|
|
69695
|
-
});
|
|
69696
69787
|
const checkLimit = () => {
|
|
69697
69788
|
internalErrors.value = [];
|
|
69698
69789
|
const hasValue = props.modelValue !== null && props.modelValue !== void 0;
|