@ouestfrance/sipa-bms-ui 8.5.3 → 8.5.4

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.
@@ -587,7 +587,7 @@ ul li[data-v-413e6742]:hover, ul li.selected[data-v-413e6742] {
587
587
  line-height: 1;
588
588
  width: 100%;
589
589
  background-color: transparent;
590
- }.field__input .autocomplete-wrapper[data-v-9b0bf4fb] {
590
+ }.field__input .autocomplete-wrapper[data-v-5d665f68] {
591
591
  width: 100%;
592
592
  padding: 0.7em;
593
593
  margin: 0.5em 0;
@@ -596,22 +596,22 @@ ul li[data-v-413e6742]:hover, ul li.selected[data-v-413e6742] {
596
596
  background-color: var(--input-background-color);
597
597
  height: 48px;
598
598
  }
599
- .field__input .autocomplete-wrapper[data-v-9b0bf4fb]:hover {
599
+ .field__input .autocomplete-wrapper[data-v-5d665f68]:hover {
600
600
  --field-border-color: var(--bms-grey-100);
601
601
  }
602
- .field__input .autocomplete-wrapper[data-v-9b0bf4fb]:has(input:focus) {
602
+ .field__input .autocomplete-wrapper[data-v-5d665f68]:has(input:focus) {
603
603
  --field-border-color: var(--field-border-color-active);
604
604
  }
605
- .field__input .autocomplete-wrapper.is-error[data-v-9b0bf4fb] {
605
+ .field__input .autocomplete-wrapper.is-error[data-v-5d665f68] {
606
606
  --field-border-color: var(--bms-red-100);
607
607
  --input-background-color: var(--bms-red-25);
608
608
  }
609
- .field__input .autocomplete-wrapper.is-disabled[data-v-9b0bf4fb] {
609
+ .field__input .autocomplete-wrapper.is-disabled[data-v-5d665f68] {
610
610
  --field-border-color: var(--bms-grey-25);
611
611
  --input-background-color: var(--bms-grey-25);
612
612
  pointer-events: none;
613
613
  }
614
- .field__input .autocomplete-wrapper input[data-v-9b0bf4fb] {
614
+ .field__input .autocomplete-wrapper input[data-v-5d665f68] {
615
615
  outline: none;
616
616
  appearance: none;
617
617
  border: 0;
@@ -624,7 +624,7 @@ ul li[data-v-413e6742]:hover, ul li.selected[data-v-413e6742] {
624
624
  width: 100%;
625
625
  background-color: transparent;
626
626
  }
627
- .icon[data-v-9b0bf4fb] {
627
+ .icon[data-v-5d665f68] {
628
628
  height: 1em;
629
629
  width: 1em;
630
630
  cursor: pointer;
@@ -1080,12 +1080,12 @@ input[type=radio][data-v-cb26402d]:checked::before {
1080
1080
  }
1081
1081
  .input-toggle[data-v-9570e0a9]:hover {
1082
1082
  cursor: var(--cursor);
1083
- }.field__input[data-v-3898a72d] {
1083
+ }.field__input[data-v-6e3f7aab] {
1084
1084
  --field-border-color: var(--bms-grey-50);
1085
1085
  --field-border-color-active: var(--bms-main-100);
1086
1086
  --input-background-color: var(--bms-white);
1087
1087
  }
1088
- .field__input .select-wrapper[data-v-3898a72d] {
1088
+ .field__input .select-wrapper[data-v-6e3f7aab] {
1089
1089
  width: 100%;
1090
1090
  padding: 0 0 0 1em;
1091
1091
  border-radius: var(--bms-border-radius);
@@ -1096,35 +1096,35 @@ input[type=radio][data-v-cb26402d]:checked::before {
1096
1096
  align-items: center;
1097
1097
  justify-content: space-between;
1098
1098
  }
1099
- .field__input .select-wrapper .icon-down-container[data-v-3898a72d] {
1099
+ .field__input .select-wrapper .icon-down-container[data-v-6e3f7aab] {
1100
1100
  height: 100%;
1101
1101
  display: flex;
1102
1102
  align-items: center;
1103
1103
  }
1104
- .field__input .select-wrapper .icon-down-container[data-v-3898a72d]:hover {
1104
+ .field__input .select-wrapper .icon-down-container[data-v-6e3f7aab]:hover {
1105
1105
  cursor: pointer;
1106
1106
  }
1107
- .field__input .select-wrapper .icon-down-button[data-v-3898a72d] {
1107
+ .field__input .select-wrapper .icon-down-button[data-v-6e3f7aab] {
1108
1108
  width: 1em;
1109
1109
  margin: 0 var(--field-padding);
1110
1110
  display: block;
1111
1111
  }
1112
- .field__input .select-wrapper[data-v-3898a72d]:hover {
1112
+ .field__input .select-wrapper[data-v-6e3f7aab]:hover {
1113
1113
  --field-border-color: var(--bms-grey-100);
1114
1114
  }
1115
- .field__input .select-wrapper[data-v-3898a72d]:has(input:focus) {
1115
+ .field__input .select-wrapper[data-v-6e3f7aab]:has(input:focus) {
1116
1116
  --field-border-color: var(--field-border-color-active);
1117
1117
  }
1118
- .field__input .select-wrapper.is-error[data-v-3898a72d] {
1118
+ .field__input .select-wrapper.is-error[data-v-6e3f7aab] {
1119
1119
  --field-border-color: var(--bms-red-100);
1120
1120
  --input-background-color: var(--bms-red-25);
1121
1121
  }
1122
- .field__input .select-wrapper.is-disabled[data-v-3898a72d] {
1122
+ .field__input .select-wrapper.is-disabled[data-v-6e3f7aab] {
1123
1123
  --field-border-color: var(--bms-grey-25);
1124
1124
  --input-background-color: var(--bms-grey-25);
1125
1125
  pointer-events: none;
1126
1126
  }
1127
- .field__input .select-wrapper input[data-v-3898a72d] {
1127
+ .field__input .select-wrapper input[data-v-6e3f7aab] {
1128
1128
  border: none;
1129
1129
  background-color: transparent;
1130
1130
  caret-color: transparent;
@@ -38069,7 +38069,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38069
38069
  const inputText = ref(
38070
38070
  getValidOptionByValue(modelValue.value)?.label ?? ""
38071
38071
  );
38072
- const isInputFocused = ref(props.open);
38072
+ const showDataList = ref(props.open);
38073
38073
  const autocompleteInput = ref(null);
38074
38074
  const classes = computed(() => {
38075
38075
  return { "is-error": props.errors?.length, "is-disabled": props.disabled };
@@ -38081,7 +38081,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38081
38081
  emits("select", option);
38082
38082
  const existingOption = getValidOptionByLabel(option.label) || getValidOptionByValue(option.value);
38083
38083
  modelValue.value = existingOption?.value ?? null;
38084
- isInputFocused.value = false;
38084
+ showDataList.value = false;
38085
+ setFocus();
38085
38086
  };
38086
38087
  const displayItem = (option) => {
38087
38088
  const existingOption = getValidOptionByLabel(option.label) || getValidOptionByValue(option.value);
@@ -38106,19 +38107,24 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38106
38107
  }
38107
38108
  );
38108
38109
  const onInput = () => {
38109
- isInputFocused.value = true;
38110
+ showDataList.value = true;
38110
38111
  if (inputText.value === "") {
38111
38112
  clearInput();
38112
38113
  }
38113
38114
  };
38114
38115
  const setFocus = () => {
38115
38116
  if (autocompleteInput.value) {
38116
- autocompleteInput.value.focus();
38117
+ autocompleteInput.value.setFocus();
38117
38118
  }
38118
38119
  };
38119
38120
  const clearInput = () => {
38120
38121
  inputText.value = "";
38121
38122
  modelValue.value = null;
38123
+ setFocus();
38124
+ };
38125
+ const toggleList = () => {
38126
+ showDataList.value = !showDataList.value;
38127
+ setFocus();
38122
38128
  };
38123
38129
  __expose({
38124
38130
  setFocus
@@ -38129,13 +38135,13 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38129
38135
  datalist: withCtx(() => [
38130
38136
  withDirectives(createVNode(FieldDatalist, {
38131
38137
  "data-testid": "autocomplete-menu",
38132
- "is-input-focused": isInputFocused.value,
38138
+ "is-input-focused": showDataList.value,
38133
38139
  "can-add-new-option": _ctx.canAddNewOption,
38134
38140
  "new-option": inputText.value,
38135
38141
  options: filteredMenuItems.value,
38136
38142
  small: _ctx.small,
38137
38143
  onSelect: selectItem,
38138
- onAddNewOption: _cache[3] || (_cache[3] = (option) => emits("addNewOption", option))
38144
+ onAddNewOption: _cache[1] || (_cache[1] = (option) => emits("addNewOption", option))
38139
38145
  }, {
38140
38146
  option: withCtx(({ option }) => [
38141
38147
  renderSlot(_ctx.$slots, "option", { option }, () => [
@@ -38144,7 +38150,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38144
38150
  ]),
38145
38151
  _: 3
38146
38152
  }, 8, ["is-input-focused", "can-add-new-option", "new-option", "options", "small"]), [
38147
- [vShow, isInputFocused.value]
38153
+ [vShow, showDataList.value]
38148
38154
  ])
38149
38155
  ]),
38150
38156
  default: withCtx(() => [
@@ -38152,16 +38158,14 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38152
38158
  ref_key: "autocompleteInput",
38153
38159
  ref: autocompleteInput,
38154
38160
  modelValue: inputText.value,
38155
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputText.value = $event),
38161
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputText.value = $event),
38156
38162
  type: unref(InputType).TEXT,
38157
38163
  disabled: _ctx.disabled,
38158
38164
  class: normalizeClass(classes.value),
38159
38165
  placeholder: _ctx.placeholder,
38160
38166
  required: _ctx.required,
38161
38167
  small: _ctx.small,
38162
- onInput,
38163
- focus: isInputFocused.value,
38164
- "onUpdate:focus": _cache[2] || (_cache[2] = ($event) => isInputFocused.value = $event)
38168
+ onInput
38165
38169
  }, {
38166
38170
  "icon-start": withCtx(() => [
38167
38171
  renderSlot(_ctx.$slots, "icon-start", {}, void 0, true)
@@ -38177,14 +38181,14 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38177
38181
  ])) : (openBlock(), createElementBlock("span", {
38178
38182
  key: 1,
38179
38183
  class: "icon",
38180
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => isInputFocused.value = !isInputFocused.value, ["stop"]))
38184
+ onClick: withModifiers(toggleList, ["stop"])
38181
38185
  }, [
38182
- !isInputFocused.value ? (openBlock(), createBlock(unref(ChevronDown), { key: 0 })) : (openBlock(), createBlock(unref(ChevronUp), { key: 1 }))
38186
+ !showDataList.value ? (openBlock(), createBlock(unref(ChevronDown), { key: 0 })) : (openBlock(), createBlock(unref(ChevronUp), { key: 1 }))
38183
38187
  ]))
38184
38188
  ], true)
38185
38189
  ]),
38186
38190
  _: 3
38187
- }, 8, ["modelValue", "type", "disabled", "class", "placeholder", "required", "small", "focus"])
38191
+ }, 8, ["modelValue", "type", "disabled", "class", "placeholder", "required", "small"])
38188
38192
  ]),
38189
38193
  _: 3
38190
38194
  }, 16);
@@ -38192,7 +38196,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
38192
38196
  }
38193
38197
  });
38194
38198
 
38195
- const RawAutocomplete = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-9b0bf4fb"]]);
38199
+ const RawAutocomplete = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-5d665f68"]]);
38196
38200
 
38197
38201
  const _hoisted_1$N = ["innerHTML"];
38198
38202
  const _hoisted_2$v = ["innerHTML"];
@@ -85450,6 +85454,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
85450
85454
  });
85451
85455
  const selectItem = (option) => {
85452
85456
  modelValue.value = option.value;
85457
+ setFocus();
85453
85458
  open.value = false;
85454
85459
  };
85455
85460
  const setFocus = () => {
@@ -85508,7 +85513,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
85508
85513
  }
85509
85514
  });
85510
85515
 
85511
- const BmsSelect = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-3898a72d"]]);
85516
+ const BmsSelect = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-6e3f7aab"]]);
85512
85517
 
85513
85518
  const _hoisted_1$E = { class: "dismiss-button" };
85514
85519
  const _sfc_main$M = /* @__PURE__ */ defineComponent({