@ouestfrance/sipa-bms-ui 8.25.3 → 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.
@@ -338,7 +338,7 @@
338
338
  };
339
339
 
340
340
  const _hoisted_1$12 = ["href", "target"];
341
- const _hoisted_2$G = ["href", "onClick", "target"];
341
+ const _hoisted_2$H = ["href", "onClick", "target"];
342
342
  const _sfc_main$1w = /* @__PURE__ */ vue.defineComponent({
343
343
  __name: "BmsLink",
344
344
  props: {
@@ -380,7 +380,7 @@
380
380
  target: __props.target
381
381
  }, _ctx.$attrs), [
382
382
  vue.renderSlot(_ctx.$slots, "default")
383
- ], 16, _hoisted_2$G)
383
+ ], 16, _hoisted_2$H)
384
384
  ]),
385
385
  _: 3
386
386
  }, 8, ["to"]));
@@ -430,8 +430,8 @@
430
430
  });
431
431
 
432
432
  const _hoisted_1$10 = { class: "start" };
433
- const _hoisted_2$F = { class: "content" };
434
- const _hoisted_3$n = { class: "end" };
433
+ const _hoisted_2$G = { class: "content" };
434
+ const _hoisted_3$o = { class: "end" };
435
435
  const _sfc_main$1u = /* @__PURE__ */ vue.defineComponent({
436
436
  __name: "UiButton",
437
437
  props: {
@@ -450,10 +450,10 @@
450
450
  vue.createElementVNode("span", _hoisted_1$10, [
451
451
  vue.renderSlot(_ctx.$slots, "start")
452
452
  ]),
453
- vue.createElementVNode("span", _hoisted_2$F, [
453
+ vue.createElementVNode("span", _hoisted_2$G, [
454
454
  vue.renderSlot(_ctx.$slots, "default")
455
455
  ]),
456
- vue.createElementVNode("span", _hoisted_3$n, [
456
+ vue.createElementVNode("span", _hoisted_3$o, [
457
457
  vue.renderSlot(_ctx.$slots, "end")
458
458
  ])
459
459
  ]),
@@ -38072,8 +38072,8 @@
38072
38072
  }, Symbol.toStringTag, { value: 'Module' }));
38073
38073
 
38074
38074
  const _hoisted_1$_ = { class: "info-line" };
38075
- const _hoisted_2$E = { class: "icon" };
38076
- const _hoisted_3$m = { class: "message" };
38075
+ const _hoisted_2$F = { class: "icon" };
38076
+ const _hoisted_3$n = { class: "message" };
38077
38077
  const _sfc_main$1q = /* @__PURE__ */ vue.defineComponent({
38078
38078
  __name: "BmsAlert",
38079
38079
  props: {
@@ -38100,10 +38100,10 @@
38100
38100
  class: vue.normalizeClass(["alert", `alert-${props.type}`])
38101
38101
  }, [
38102
38102
  vue.createElementVNode("div", _hoisted_1$_, [
38103
- vue.createElementVNode("span", _hoisted_2$E, [
38103
+ vue.createElementVNode("span", _hoisted_2$F, [
38104
38104
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(alertIcon.value), { size: 20 }))
38105
38105
  ]),
38106
- vue.createElementVNode("span", _hoisted_3$m, [
38106
+ vue.createElementVNode("span", _hoisted_3$n, [
38107
38107
  vue.renderSlot(_ctx.$slots, "message", {}, () => [
38108
38108
  vue.createElementVNode("strong", null, vue.toDisplayString(__props.message), 1)
38109
38109
  ], true)
@@ -38163,7 +38163,7 @@
38163
38163
  key: 0,
38164
38164
  class: "icon"
38165
38165
  };
38166
- const _hoisted_2$D = ["innerHTML"];
38166
+ const _hoisted_2$E = ["innerHTML"];
38167
38167
  const _sfc_main$1o = /* @__PURE__ */ vue.defineComponent({
38168
38168
  __name: "BmsCaption",
38169
38169
  props: {
@@ -38201,7 +38201,7 @@
38201
38201
  vue.createElementVNode("span", {
38202
38202
  class: "label",
38203
38203
  innerHTML: vue.unref(sanitizeHtml)(computedCaption.value.label)
38204
- }, null, 8, _hoisted_2$D)
38204
+ }, null, 8, _hoisted_2$E)
38205
38205
  ], 2);
38206
38206
  };
38207
38207
  }
@@ -38210,21 +38210,21 @@
38210
38210
  const BmsCaption = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["__scopeId", "data-v-b08dd4e0"]]);
38211
38211
 
38212
38212
  const _hoisted_1$X = { class: "circular-progress" };
38213
- const _hoisted_2$C = {
38213
+ const _hoisted_2$D = {
38214
38214
  key: 0,
38215
38215
  viewBox: "0 0 100 100"
38216
38216
  };
38217
- const _hoisted_3$l = { transform: "rotate(-90, 50, 50)" };
38218
- const _hoisted_4$c = ["stroke-dashoffset"];
38219
- const _hoisted_5$8 = { class: "percent" };
38217
+ const _hoisted_3$m = { transform: "rotate(-90, 50, 50)" };
38218
+ const _hoisted_4$d = ["stroke-dashoffset"];
38219
+ const _hoisted_5$9 = { class: "percent" };
38220
38220
  const _sfc_main$1n = /* @__PURE__ */ vue.defineComponent({
38221
38221
  __name: "BmsCircularProgress",
38222
38222
  props: ["progress"],
38223
38223
  setup(__props) {
38224
38224
  return (_ctx, _cache) => {
38225
38225
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
38226
- __props.progress ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$C, [
38227
- vue.createElementVNode("g", _hoisted_3$l, [
38226
+ __props.progress ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$D, [
38227
+ vue.createElementVNode("g", _hoisted_3$m, [
38228
38228
  _cache[0] || (_cache[0] = vue.createElementVNode("circle", {
38229
38229
  opacity: ".08",
38230
38230
  r: "45",
@@ -38243,10 +38243,10 @@
38243
38243
  "stroke-linecap": "round",
38244
38244
  "stroke-dashoffset": 283 - __props.progress * 283 / 100,
38245
38245
  "stroke-dasharray": "283"
38246
- }, null, 8, _hoisted_4$c)
38246
+ }, null, 8, _hoisted_4$d)
38247
38247
  ])
38248
38248
  ])) : vue.createCommentVNode("", true),
38249
- vue.createElementVNode("div", _hoisted_5$8, vue.toDisplayString(__props.progress) + "%", 1)
38249
+ vue.createElementVNode("div", _hoisted_5$9, vue.toDisplayString(__props.progress) + "%", 1)
38250
38250
  ]);
38251
38251
  };
38252
38252
  }
@@ -38317,32 +38317,105 @@
38317
38317
 
38318
38318
  const BmsGhost = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__scopeId", "data-v-205789ac"]]);
38319
38319
 
38320
- const _hoisted_1$W = { class: "bms-loader" };
38320
+ const _hoisted_1$W = {
38321
+ viewBox: "0 0 38 38",
38322
+ xmlns: "http://www.w3.org/2000/svg"
38323
+ };
38324
+ const _hoisted_2$C = ["id"];
38325
+ const _hoisted_3$l = {
38326
+ fill: "none",
38327
+ "fill-rule": "evenodd"
38328
+ };
38329
+ const _hoisted_4$c = { transform: "translate(1 1)" };
38330
+ const _hoisted_5$8 = ["stroke"];
38321
38331
  function transformIntoPx(totransform) {
38322
38332
  return typeof totransform === "string" ? totransform : `${totransform}px`;
38323
38333
  }
38324
38334
  const _sfc_main$1l = /* @__PURE__ */ vue.defineComponent({
38325
38335
  __name: "BmsLoader",
38326
38336
  props: {
38327
- size: { default: "inherit" }
38337
+ size: { default: "inherit" },
38338
+ mode: { default: StatusType.Default }
38328
38339
  },
38329
38340
  setup(__props) {
38330
38341
  vue.useCssVars((_ctx) => ({
38331
- "v71df0f7a": sizeInPx.value
38342
+ "fe29ee96": sizeInPx.value
38332
38343
  }));
38344
+ const gradientId = vue.useId();
38333
38345
  const props = __props;
38334
38346
  const sizeInPx = vue.computed(() => {
38335
38347
  return transformIntoPx(props.size);
38336
38348
  });
38337
38349
  return (_ctx, _cache) => {
38338
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [..._cache[0] || (_cache[0] = [
38339
- vue.createStaticVNode('<svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" data-v-7cc96135><defs data-v-7cc96135><linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a" data-v-7cc96135><stop stop-color="currentColor" stop-opacity="0" offset="0%" data-v-7cc96135></stop><stop stop-color="currentColor" stop-opacity=".631" offset="63.146%" data-v-7cc96135></stop><stop stop-color="currentColor" offset="100%" data-v-7cc96135></stop></linearGradient></defs><g fill="none" fill-rule="evenodd" data-v-7cc96135><g transform="translate(1 1)" data-v-7cc96135><path d="M36 18c0-9.94-8.06-18-18-18" id="Oval-2" stroke="url(#a)" stroke-width="2" data-v-7cc96135><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.9s" repeatCount="indefinite" data-v-7cc96135></animateTransform></path><circle fill="#fff" cx="36" cy="18" r="1" data-v-7cc96135><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.9s" repeatCount="indefinite" data-v-7cc96135></animateTransform></circle></g></g></svg>', 1)
38340
- ])]);
38350
+ return vue.openBlock(), vue.createElementBlock("div", {
38351
+ class: vue.normalizeClass(["bms-loader", __props.mode])
38352
+ }, [
38353
+ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$W, [
38354
+ vue.createElementVNode("defs", null, [
38355
+ vue.createElementVNode("linearGradient", {
38356
+ x1: "8.042%",
38357
+ y1: "0%",
38358
+ x2: "65.682%",
38359
+ y2: "23.865%",
38360
+ id: vue.unref(gradientId)
38361
+ }, [..._cache[0] || (_cache[0] = [
38362
+ vue.createElementVNode("stop", {
38363
+ "stop-color": "currentColor",
38364
+ "stop-opacity": "0",
38365
+ offset: "0%"
38366
+ }, null, -1),
38367
+ vue.createElementVNode("stop", {
38368
+ "stop-color": "currentColor",
38369
+ "stop-opacity": ".631",
38370
+ offset: "63.146%"
38371
+ }, null, -1),
38372
+ vue.createElementVNode("stop", {
38373
+ "stop-color": "currentColor",
38374
+ offset: "100%"
38375
+ }, null, -1)
38376
+ ])], 8, _hoisted_2$C)
38377
+ ]),
38378
+ vue.createElementVNode("g", _hoisted_3$l, [
38379
+ vue.createElementVNode("g", _hoisted_4$c, [
38380
+ vue.createElementVNode("path", {
38381
+ d: "M36 18c0-9.94-8.06-18-18-18",
38382
+ id: "Oval-2",
38383
+ stroke: `url(#${vue.unref(gradientId)})`,
38384
+ "stroke-width": "2"
38385
+ }, [..._cache[1] || (_cache[1] = [
38386
+ vue.createElementVNode("animateTransform", {
38387
+ attributeName: "transform",
38388
+ type: "rotate",
38389
+ from: "0 18 18",
38390
+ to: "360 18 18",
38391
+ dur: "0.9s",
38392
+ repeatCount: "indefinite"
38393
+ }, null, -1)
38394
+ ])], 8, _hoisted_5$8),
38395
+ _cache[2] || (_cache[2] = vue.createElementVNode("circle", {
38396
+ fill: "#fff",
38397
+ cx: "36",
38398
+ cy: "18",
38399
+ r: "1"
38400
+ }, [
38401
+ vue.createElementVNode("animateTransform", {
38402
+ attributeName: "transform",
38403
+ type: "rotate",
38404
+ from: "0 18 18",
38405
+ to: "360 18 18",
38406
+ dur: "0.9s",
38407
+ repeatCount: "indefinite"
38408
+ })
38409
+ ], -1))
38410
+ ])
38411
+ ])
38412
+ ]))
38413
+ ], 2);
38341
38414
  };
38342
38415
  }
38343
38416
  });
38344
38417
 
38345
- const BmsLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-7cc96135"]]);
38418
+ const BmsLoader = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-4503885b"]]);
38346
38419
 
38347
38420
  function tryOnScopeDispose(fn) {
38348
38421
  if (vue.getCurrentScope()) {
@@ -69325,6 +69398,8 @@
69325
69398
  minlength: {},
69326
69399
  maxlength: {},
69327
69400
  step: {},
69401
+ pattern: {},
69402
+ patternMessage: {},
69328
69403
  label: { default: "" },
69329
69404
  loading: { type: Boolean },
69330
69405
  required: { type: Boolean, default: false },
@@ -69340,44 +69415,61 @@
69340
69415
  setup(__props, { expose: __expose, emit: __emit }) {
69341
69416
  const props = __props;
69342
69417
  const input = vue.ref(null);
69343
- const internalErrors = vue.ref([]);
69418
+ const onChangeErrors = vue.ref([]);
69419
+ const onChangeCaptions = vue.ref([]);
69420
+ const onBlurErrors = vue.ref([]);
69344
69421
  const computedErrors = vue.computed(() => {
69345
- return props.errors ? internalErrors.value.concat(props.errors) : internalErrors.value;
69422
+ return props.errors ? onChangeErrors.value.concat(props.errors, onBlurErrors.value) : onChangeErrors.value.concat(onBlurErrors.value);
69346
69423
  });
69347
- const internalCaptions = vue.ref([]);
69348
69424
  const computedCaptions = vue.computed(() => {
69349
- return props.captions ? internalCaptions.value.concat(props.captions) : internalCaptions.value;
69425
+ return props.captions ? onChangeCaptions.value.concat(props.captions) : onChangeCaptions.value;
69350
69426
  });
69351
69427
  vue.onMounted(() => {
69428
+ onBlurErrors.value = [];
69429
+ onChangeErrors.value = [];
69430
+ onChangeCaptions.value = [];
69431
+ checkPattern();
69352
69432
  checkLimit();
69353
69433
  });
69354
69434
  const $emits = __emit;
69435
+ const checkPattern = () => {
69436
+ const hasValue = props.modelValue !== null && props.modelValue !== void 0;
69437
+ if (hasValue && props.pattern) {
69438
+ const regex = new RegExp(props.pattern);
69439
+ if (!regex.test(String(props.modelValue))) {
69440
+ onBlurErrors.value.push(
69441
+ props.patternMessage || `La valeur ne correspond pas au motif attendu ( ${props.pattern} )`
69442
+ );
69443
+ }
69444
+ }
69445
+ };
69355
69446
  const checkLimit = () => {
69356
- internalErrors.value = [];
69357
- internalCaptions.value = [];
69358
69447
  const hasValue = props.modelValue !== null && props.modelValue !== void 0;
69359
69448
  if (hasValue && props.inputType === InputType.TEXT && typeof props.modelValue === "string") {
69360
69449
  if (props.minlength !== void 0 && props.modelValue.length < props.minlength) {
69361
- internalErrors.value = [
69450
+ onChangeErrors.value.push(
69362
69451
  "Longueur inférieur au minimum autorisé (min:" + props.minlength + ")"
69363
- ];
69452
+ );
69364
69453
  }
69365
69454
  if (props.maxlength !== void 0) {
69366
69455
  if (props.modelValue.length > props.maxlength) {
69367
- internalErrors.value = [
69456
+ onChangeErrors.value.push(
69368
69457
  `Longueur supérieure au maximum autorisé (max:${props.maxlength})`
69369
- ];
69458
+ );
69370
69459
  } else if (props.modelValue.length === props.maxlength) {
69371
- internalCaptions.value = [
69372
- {
69373
- label: `Attention, vous avez atteint la limite de ${props.maxlength} caractères.`,
69374
- mode: StatusType.Warning
69375
- }
69376
- ];
69460
+ onChangeCaptions.value.push({
69461
+ label: `Attention, vous avez atteint la limite de ${props.maxlength} caractères.`,
69462
+ mode: StatusType.Warning
69463
+ });
69377
69464
  }
69378
69465
  }
69379
69466
  }
69380
69467
  };
69468
+ const onBlur = () => {
69469
+ $emits("blur");
69470
+ onBlurErrors.value = [];
69471
+ checkPattern();
69472
+ };
69381
69473
  const setFocus = () => {
69382
69474
  if (input.value) {
69383
69475
  input.value.setFocus();
@@ -69388,7 +69480,11 @@
69388
69480
  });
69389
69481
  vue.watch(
69390
69482
  () => props.modelValue,
69391
- () => checkLimit()
69483
+ () => {
69484
+ onChangeErrors.value = [];
69485
+ onChangeCaptions.value = [];
69486
+ checkLimit();
69487
+ }
69392
69488
  );
69393
69489
  return (_ctx, _cache) => {
69394
69490
  const _component_field = vue.resolveComponent("field");
@@ -69414,8 +69510,9 @@
69414
69510
  max: __props.max,
69415
69511
  minlength: __props.minlength,
69416
69512
  maxlength: __props.maxlength,
69417
- onBlur: _cache[1] || (_cache[1] = ($event) => $emits("blur")),
69418
- onFocus: _cache[2] || (_cache[2] = ($event) => $emits("focus"))
69513
+ pattern: __props.pattern,
69514
+ onBlur,
69515
+ onFocus: _cache[1] || (_cache[1] = ($event) => $emits("focus"))
69419
69516
  }, {
69420
69517
  "icon-start": vue.withCtx(() => [
69421
69518
  vue.renderSlot(_ctx.$slots, "icon-start")
@@ -69424,7 +69521,7 @@
69424
69521
  vue.renderSlot(_ctx.$slots, "icon-end")
69425
69522
  ]),
69426
69523
  _: 3
69427
- }, 8, ["type", "modelValue", "required", "placeholder", "disabled", "errors", "small", "step", "min", "max", "minlength", "maxlength"])
69524
+ }, 8, ["type", "modelValue", "required", "placeholder", "disabled", "errors", "small", "step", "min", "max", "minlength", "maxlength", "pattern"])
69428
69525
  ]),
69429
69526
  _: 3
69430
69527
  }, 16, ["captions", "errors"]);
@@ -69693,9 +69790,6 @@
69693
69790
  if (!props.disabled)
69694
69791
  $emits("update:modelValue", Number((e?.target).value));
69695
69792
  };
69696
- vue.computed(() => {
69697
- return { "is-error": props.errors?.length, "is-disabled": props.disabled };
69698
- });
69699
69793
  const checkLimit = () => {
69700
69794
  internalErrors.value = [];
69701
69795
  const hasValue = props.modelValue !== null && props.modelValue !== void 0;