@enos5/enos-vue-default 1.8.10 → 1.8.12

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.
Files changed (32) hide show
  1. package/dist/components/CustomSelect.vue.d.ts +27 -0
  2. package/dist/components/InputGroup.vue.d.ts +27 -0
  3. package/dist/components/SelectInput.vue.d.ts +27 -0
  4. package/dist/{index-Bsqrrc8R.js → index-6eLEqodC.js} +4 -35
  5. package/dist/index-6eLEqodC.js.map +1 -0
  6. package/dist/{index-BR_u7CCm.js → index-BHTvTOGk.js} +2 -4
  7. package/dist/{index-BR_u7CCm.js.map → index-BHTvTOGk.js.map} +1 -1
  8. package/dist/{index-ukywSRmc.js → index-BPcdR1qv.js} +9 -10
  9. package/dist/index-BPcdR1qv.js.map +1 -0
  10. package/dist/{index-BBGZQp5w.js → index-Ch9hFG6f.js} +6 -17
  11. package/dist/{index-BBGZQp5w.js.map → index-Ch9hFG6f.js.map} +1 -1
  12. package/dist/index-CiFpmPug.js.map +1 -1
  13. package/dist/{index-CuSlJQwq.js → index-Cjhk16SP.js} +8 -10
  14. package/dist/index-Cjhk16SP.js.map +1 -0
  15. package/dist/{index-D72Leh_x.js → index-D7sesyMc.js} +4 -4
  16. package/dist/{index-D72Leh_x.js.map → index-D7sesyMc.js.map} +1 -1
  17. package/dist/{index-1G1T4Qrv.js → index-G1cAlO5C.js} +203 -373
  18. package/dist/index-G1cAlO5C.js.map +1 -0
  19. package/dist/index.js +1 -1
  20. package/dist/index.node.js +1 -1
  21. package/dist/{plugin-m8XaPTjJ.js → plugin-BB5Wpvyp.js} +314 -52
  22. package/dist/plugin-BB5Wpvyp.js.map +1 -0
  23. package/dist/styles.css +156 -1598
  24. package/dist/{tinymce-Dg510HCs.js → tinymce-WPdeGquX.js} +388 -659
  25. package/dist/tinymce-WPdeGquX.js.map +1 -0
  26. package/package.json +36 -36
  27. package/dist/index-1G1T4Qrv.js.map +0 -1
  28. package/dist/index-Bsqrrc8R.js.map +0 -1
  29. package/dist/index-CuSlJQwq.js.map +0 -1
  30. package/dist/index-ukywSRmc.js.map +0 -1
  31. package/dist/plugin-m8XaPTjJ.js.map +0 -1
  32. package/dist/tinymce-Dg510HCs.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './styles.css';
2
- import { _, a, b, c, d, e, f, g, h, i, C, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, S, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1, a2, a3 } from "./plugin-m8XaPTjJ.js";
2
+ import { _, a, b, c, d, e, f, g, h, i, C, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, S, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1, a2, a3 } from "./plugin-BB5Wpvyp.js";
3
3
  export {
4
4
  _ as ActionCard,
5
5
  a as ActionMessage,
@@ -1,4 +1,4 @@
1
- import { _, a, b, c, d, e, f, g, h, i, C, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, S, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1, a2, a3 } from "./plugin-m8XaPTjJ.js";
1
+ import { _, a, b, c, d, e, f, g, h, i, C, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, S, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1, a2, a3 } from "./plugin-BB5Wpvyp.js";
2
2
  export {
3
3
  _ as ActionCard,
4
4
  a as ActionMessage,
@@ -1,5 +1,5 @@
1
- import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, vModelText, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, createTextVNode, h, createSlots } from "vue";
2
- import { LockClosedIcon, ChevronDownIcon, PhotoIcon, EyeDropperIcon, ExclamationCircleIcon, ExclamationTriangleIcon, ChevronUpIcon, MagnifyingGlassIcon, CheckIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
1
+ import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, withModifiers, Teleport, vModelText, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, createTextVNode, h, createSlots } from "vue";
2
+ import { LockClosedIcon, XMarkIcon, ChevronDownIcon, PhotoIcon, EyeDropperIcon, ExclamationCircleIcon, ExclamationTriangleIcon, ChevronUpIcon, MagnifyingGlassIcon, CheckIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
3
3
  import Editor from "@tinymce/tinymce-vue";
4
4
  import { useI18n } from "vue-i18n";
5
5
  import { Link } from "@inertiajs/vue3";
@@ -307,7 +307,7 @@ const _hoisted_1$B = { class: "md:col-span-1 flex justify-between" };
307
307
  const _hoisted_2$m = { class: "px-4 sm:px-0" };
308
308
  const _hoisted_3$g = { class: "text-xl font-semibold tracking-tight text-neutral-950 dark:text-neutral-50" };
309
309
  const _hoisted_4$c = { class: "mt-1 max-w-2xl text-sm text-neutral-600 dark:text-neutral-200" };
310
- const _hoisted_5$9 = { class: "px-4 sm:px-0" };
310
+ const _hoisted_5$a = { class: "px-4 sm:px-0" };
311
311
  function _sfc_render(_ctx, _cache) {
312
312
  return openBlock(), createElementBlock("div", _hoisted_1$B, [
313
313
  createElementVNode("div", _hoisted_2$m, [
@@ -318,7 +318,7 @@ function _sfc_render(_ctx, _cache) {
318
318
  renderSlot(_ctx.$slots, "description")
319
319
  ])
320
320
  ]),
321
- createElementVNode("div", _hoisted_5$9, [
321
+ createElementVNode("div", _hoisted_5$a, [
322
322
  renderSlot(_ctx.$slots, "aside")
323
323
  ])
324
324
  ]);
@@ -622,7 +622,7 @@ const _hoisted_2$k = {
622
622
  };
623
623
  const _hoisted_3$e = ["type", "value", "disabled"];
624
624
  const _hoisted_4$b = ["aria-label"];
625
- const _hoisted_5$8 = {
625
+ const _hoisted_5$9 = {
626
626
  key: 0,
627
627
  class: "h-5 w-5",
628
628
  fill: "none",
@@ -719,7 +719,7 @@ const _sfc_main$I = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
719
719
  "aria-label": revealed.value ? "Hide password" : "Show password",
720
720
  onClick: toggleVisibility
721
721
  }, [
722
- revealed.value ? (openBlock(), createElementBlock("svg", _hoisted_5$8, [..._cache[2] || (_cache[2] = [
722
+ revealed.value ? (openBlock(), createElementBlock("svg", _hoisted_5$9, [..._cache[2] || (_cache[2] = [
723
723
  createElementVNode("path", {
724
724
  "stroke-linecap": "round",
725
725
  "stroke-linejoin": "round",
@@ -822,13 +822,14 @@ const _sfc_main$H = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
822
822
  };
823
823
  }
824
824
  });
825
- const _hoisted_1$t = ["placeholder"];
826
- const _hoisted_2$j = ["onClick"];
827
- const _hoisted_3$d = {
825
+ const _hoisted_1$t = { class: "flex h-5 items-center gap-1" };
826
+ const _hoisted_2$j = ["placeholder"];
827
+ const _hoisted_3$d = ["data-option-value", "onClick", "onFocus", "onKeydown"];
828
+ const _hoisted_4$a = {
828
829
  key: 0,
829
830
  class: "flex items-center gap-3"
830
831
  };
831
- const _hoisted_4$a = ["checked", "disabled", "onChange"];
832
+ const _hoisted_5$8 = ["checked", "disabled", "onChange"];
832
833
  const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
833
834
  __name: "CustomSelect",
834
835
  props: {
@@ -916,6 +917,14 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
916
917
  type: [String, Array, Object],
917
918
  default: "bg-neutral-100 font-medium text-neutral-950 dark:bg-neutral-900 dark:text-neutral-50"
918
919
  },
920
+ dropdownHighlightedClass: {
921
+ type: [String, Array, Object],
922
+ default: "bg-slate-50 text-slate-900 dark:bg-neutral-800 dark:text-neutral-50"
923
+ },
924
+ container: {
925
+ type: [String, Object],
926
+ default: "body"
927
+ },
919
928
  searchable: {
920
929
  type: Boolean,
921
930
  default: false
@@ -927,6 +936,10 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
927
936
  searchInputClass: {
928
937
  type: [String, Array, Object],
929
938
  default: "w-full border-b border-neutral-200 px-4 py-3 text-sm outline-none focus:border-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:focus:border-neutral-100"
939
+ },
940
+ noOptionsText: {
941
+ type: String,
942
+ default: "No options available"
930
943
  }
931
944
  },
932
945
  emits: ["update:modelValue"],
@@ -943,6 +956,10 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
943
956
  const isDarkMode = ref(false);
944
957
  const isMounted = ref(false);
945
958
  const searchQuery = ref("");
959
+ const searchInputRef = ref(null);
960
+ const highlightedOptionValue = ref(null);
961
+ const typeaheadQuery = ref("");
962
+ let typeaheadResetTimeout = null;
946
963
  const isObjectOption = (option) => typeof option === "object" && option !== null;
947
964
  const optionValue = (option) => {
948
965
  if (isObjectOption(option)) {
@@ -1017,6 +1034,9 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1017
1034
  }
1018
1035
  return multipleOptions.value.filter((option) => modelValueSet.value.has(String(optionValue(option) ?? "")));
1019
1036
  });
1037
+ const hasVisibleOptions = computed(() => filteredOptions.value.length > 0);
1038
+ const visibleOptions = computed(() => filteredOptions.value);
1039
+ const canClearSelection = computed(() => !props.multiple && !props.placeholderDisabled && !props.disabled && props.modelValue !== null && props.modelValue !== void 0 && props.modelValue !== "");
1020
1040
  const displayText = computed(() => {
1021
1041
  if (props.multiple) {
1022
1042
  if (selectedMultipleOptions.value.length === 0) {
@@ -1044,12 +1064,17 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1044
1064
  };
1045
1065
  const normalizeEmittedValues = (values) => values.map((value) => normalizeEmittedValue(value));
1046
1066
  const optionIsSelected = (option) => modelValueSet.value.has(String(optionValue(option) ?? ""));
1067
+ const optionIsHighlighted = (option) => highlightedOptionValue.value === String(optionValue(option) ?? "");
1047
1068
  const toggleDropdown = () => {
1048
1069
  if (!props.disabled) {
1049
1070
  isOpen.value = !isOpen.value;
1050
1071
  }
1051
1072
  };
1052
1073
  const syncTeleportTarget = () => {
1074
+ if (props.container !== "body") {
1075
+ teleportTarget.value = props.container;
1076
+ return;
1077
+ }
1053
1078
  const dialog = rootRef.value?.closest("dialog");
1054
1079
  teleportTarget.value = dialog ?? document.body;
1055
1080
  };
@@ -1058,9 +1083,9 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1058
1083
  emit("update:modelValue", normalizeEmittedValue(value));
1059
1084
  isOpen.value = false;
1060
1085
  };
1061
- const selectPlaceholder = () => {
1062
- if (!props.placeholderDisabled) {
1063
- emit("update:modelValue", props.multiple ? [] : normalizeEmittedValue(""));
1086
+ const clearSelection = () => {
1087
+ if (canClearSelection.value) {
1088
+ emit("update:modelValue", normalizeEmittedValue(""));
1064
1089
  isOpen.value = false;
1065
1090
  }
1066
1091
  };
@@ -1102,6 +1127,8 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1102
1127
  if (!clickedInsideTrigger && !clickedInsideMenu) {
1103
1128
  isOpen.value = false;
1104
1129
  searchQuery.value = "";
1130
+ highlightedOptionValue.value = null;
1131
+ typeaheadQuery.value = "";
1105
1132
  }
1106
1133
  };
1107
1134
  const syncDarkMode = () => {
@@ -1112,28 +1139,218 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1112
1139
  isDarkMode.value = document.documentElement.classList.contains("dark") || document.body.classList.contains("dark");
1113
1140
  };
1114
1141
  const darkTextStyle = computed(() => isDarkMode.value ? { color: "#ffffff" } : null);
1142
+ const clearTypeaheadQuery = () => {
1143
+ typeaheadQuery.value = "";
1144
+ if (typeaheadResetTimeout) {
1145
+ window.clearTimeout(typeaheadResetTimeout);
1146
+ typeaheadResetTimeout = null;
1147
+ }
1148
+ };
1149
+ const scheduleTypeaheadReset = () => {
1150
+ if (typeaheadResetTimeout) {
1151
+ window.clearTimeout(typeaheadResetTimeout);
1152
+ }
1153
+ typeaheadResetTimeout = window.setTimeout(() => {
1154
+ typeaheadQuery.value = "";
1155
+ typeaheadResetTimeout = null;
1156
+ }, 700);
1157
+ };
1158
+ const escapeSelectorValue = (value) => {
1159
+ if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
1160
+ return CSS.escape(value);
1161
+ }
1162
+ return value.replace(/["\\]/g, "\\$&");
1163
+ };
1164
+ const scrollOptionByValue = async (value) => {
1165
+ await nextTick();
1166
+ if (!dropdownMenuRef.value) {
1167
+ return null;
1168
+ }
1169
+ const optionElement = dropdownMenuRef.value.querySelector(
1170
+ `[data-option-value="${escapeSelectorValue(value)}"]`
1171
+ );
1172
+ if (!optionElement) {
1173
+ return null;
1174
+ }
1175
+ optionElement.scrollIntoView({ block: "nearest" });
1176
+ return optionElement;
1177
+ };
1178
+ const focusOptionByValue = async (value) => {
1179
+ const optionElement = await scrollOptionByValue(value);
1180
+ if (!optionElement) {
1181
+ return;
1182
+ }
1183
+ optionElement.focus({ preventScroll: true });
1184
+ };
1185
+ const setHighlightedOption = async (option, { focus = !props.searchable } = {}) => {
1186
+ const value = String(optionValue(option) ?? "");
1187
+ highlightedOptionValue.value = value;
1188
+ if (focus) {
1189
+ await focusOptionByValue(value);
1190
+ return;
1191
+ }
1192
+ await scrollOptionByValue(value);
1193
+ };
1194
+ const findMatchingOption = (query) => {
1195
+ const normalizedQuery = query.trimStart().toLowerCase();
1196
+ if (!normalizedQuery) {
1197
+ return null;
1198
+ }
1199
+ const options = props.multiple ? multipleOptions.value : availableOptions.value;
1200
+ return options.find((option) => String(optionText(option)).toLowerCase().startsWith(normalizedQuery)) ?? null;
1201
+ };
1202
+ const findHighlightedOptionIndex = () => {
1203
+ return visibleOptions.value.findIndex((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
1204
+ };
1205
+ const moveHighlightedOption = async (direction) => {
1206
+ if (!visibleOptions.value.length) {
1207
+ return;
1208
+ }
1209
+ const currentIndex = findHighlightedOptionIndex();
1210
+ const fallbackIndex = direction > 0 ? 0 : visibleOptions.value.length - 1;
1211
+ const nextIndex = currentIndex === -1 ? fallbackIndex : (currentIndex + direction + visibleOptions.value.length) % visibleOptions.value.length;
1212
+ await setHighlightedOption(visibleOptions.value[nextIndex]);
1213
+ };
1214
+ const selectHighlightedOption = () => {
1215
+ const highlightedOption = visibleOptions.value.find((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
1216
+ if (!highlightedOption) {
1217
+ return;
1218
+ }
1219
+ if (props.multiple) {
1220
+ toggleMultipleOption(highlightedOption);
1221
+ return;
1222
+ }
1223
+ selectOption(highlightedOption);
1224
+ };
1225
+ const syncHighlightedOption = async () => {
1226
+ if (!visibleOptions.value.length) {
1227
+ highlightedOptionValue.value = null;
1228
+ return;
1229
+ }
1230
+ const hasCurrentHighlight = visibleOptions.value.some((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
1231
+ if (hasCurrentHighlight) {
1232
+ await setHighlightedOption(
1233
+ visibleOptions.value.find((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value),
1234
+ { focus: false }
1235
+ );
1236
+ return;
1237
+ }
1238
+ await setHighlightedOption(visibleOptions.value[0], { focus: false });
1239
+ };
1240
+ const handleTypeaheadKeydown = (event) => {
1241
+ if (!isOpen.value || props.searchable) {
1242
+ return;
1243
+ }
1244
+ if (event.ctrlKey || event.altKey || event.metaKey || event.key.length !== 1) {
1245
+ return;
1246
+ }
1247
+ const target = event.target;
1248
+ const targetInsideSelect = rootRef.value?.contains(target) || dropdownMenuRef.value?.contains(target);
1249
+ if (!targetInsideSelect) {
1250
+ return;
1251
+ }
1252
+ typeaheadQuery.value += event.key;
1253
+ scheduleTypeaheadReset();
1254
+ const matchingOption = findMatchingOption(typeaheadQuery.value);
1255
+ if (!matchingOption) {
1256
+ return;
1257
+ }
1258
+ setHighlightedOption(matchingOption);
1259
+ event.preventDefault();
1260
+ event.stopPropagation();
1261
+ };
1262
+ const handleDropdownKeydown = (event) => {
1263
+ if (!isOpen.value) {
1264
+ return;
1265
+ }
1266
+ const target = event.target;
1267
+ const targetInsideSelect = rootRef.value?.contains(target) || dropdownMenuRef.value?.contains(target);
1268
+ if (!targetInsideSelect) {
1269
+ return;
1270
+ }
1271
+ if (event.key === "Escape") {
1272
+ event.preventDefault();
1273
+ event.stopPropagation();
1274
+ isOpen.value = false;
1275
+ triggerRef.value?.focus();
1276
+ return;
1277
+ }
1278
+ if (event.key === "ArrowDown") {
1279
+ event.preventDefault();
1280
+ event.stopPropagation();
1281
+ moveHighlightedOption(1);
1282
+ return;
1283
+ }
1284
+ if (event.key === "ArrowUp") {
1285
+ event.preventDefault();
1286
+ event.stopPropagation();
1287
+ moveHighlightedOption(-1);
1288
+ return;
1289
+ }
1290
+ if (event.key === "Enter" && highlightedOptionValue.value !== null) {
1291
+ event.preventDefault();
1292
+ event.stopPropagation();
1293
+ selectHighlightedOption();
1294
+ }
1295
+ };
1296
+ const handleOptionKeydown = (event, option) => {
1297
+ if (event.key !== "Enter" && event.key !== " ") {
1298
+ return;
1299
+ }
1300
+ event.preventDefault();
1301
+ event.stopPropagation();
1302
+ if (props.multiple) {
1303
+ toggleMultipleOption(option);
1304
+ return;
1305
+ }
1306
+ selectOption(option);
1307
+ };
1115
1308
  onMounted(() => {
1116
1309
  isMounted.value = true;
1117
1310
  syncTeleportTarget();
1118
1311
  syncDarkMode();
1119
1312
  document.addEventListener("click", closeDropdown);
1313
+ document.addEventListener("keydown", handleDropdownKeydown, true);
1314
+ document.addEventListener("keydown", handleTypeaheadKeydown, true);
1120
1315
  window.addEventListener("resize", updateDropdownPosition);
1121
1316
  window.addEventListener("scroll", updateDropdownPosition, true);
1122
1317
  });
1123
1318
  onBeforeUnmount(() => {
1319
+ clearTypeaheadQuery();
1124
1320
  document.removeEventListener("click", closeDropdown);
1321
+ document.removeEventListener("keydown", handleDropdownKeydown, true);
1322
+ document.removeEventListener("keydown", handleTypeaheadKeydown, true);
1125
1323
  window.removeEventListener("resize", updateDropdownPosition);
1126
1324
  window.removeEventListener("scroll", updateDropdownPosition, true);
1127
1325
  });
1128
1326
  watch(isOpen, async (open) => {
1129
1327
  if (!open) {
1130
1328
  searchQuery.value = "";
1329
+ highlightedOptionValue.value = null;
1330
+ clearTypeaheadQuery();
1131
1331
  return;
1132
1332
  }
1333
+ clearTypeaheadQuery();
1133
1334
  syncTeleportTarget();
1134
1335
  syncDarkMode();
1135
1336
  await nextTick();
1136
1337
  updateDropdownPosition();
1338
+ if (props.searchable) {
1339
+ await nextTick();
1340
+ await syncHighlightedOption();
1341
+ searchInputRef.value?.focus();
1342
+ return;
1343
+ }
1344
+ const initialOption = props.multiple ? selectedMultipleOptions.value[0] ?? multipleOptions.value[0] : props.options.find((option) => optionValue(option) === props.modelValue || String(optionValue(option)) === String(props.modelValue)) ?? availableOptions.value[0];
1345
+ if (initialOption) {
1346
+ await setHighlightedOption(initialOption);
1347
+ }
1348
+ });
1349
+ watch(filteredOptions, async () => {
1350
+ if (!isOpen.value || !props.searchable) {
1351
+ return;
1352
+ }
1353
+ await syncHighlightedOption();
1137
1354
  });
1138
1355
  return (_ctx, _cache) => {
1139
1356
  return openBlock(), createElementBlock("div", {
@@ -1157,9 +1374,22 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1157
1374
  class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null),
1158
1375
  style: normalizeStyle(darkTextStyle.value)
1159
1376
  }, toDisplayString(displayText.value), 7),
1160
- createVNode(unref(ChevronDownIcon), {
1161
- class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
1162
- }, null, 8, ["class"])
1377
+ createElementVNode("div", _hoisted_1$t, [
1378
+ canClearSelection.value ? (openBlock(), createElementBlock("button", {
1379
+ key: 0,
1380
+ type: "button",
1381
+ class: "inline-flex size-5 shrink-0 items-center justify-center rounded-full text-neutral-400 transition hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950/20 dark:hover:bg-neutral-900 dark:hover:text-neutral-200 dark:focus-visible:ring-neutral-100/20",
1382
+ "aria-label": "Clear selection",
1383
+ onClick: withModifiers(clearSelection, ["stop", "prevent"]),
1384
+ onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
1385
+ }, ["stop"]))
1386
+ }, [
1387
+ createVNode(unref(XMarkIcon), { class: "size-4" })
1388
+ ], 32)) : createCommentVNode("", true),
1389
+ createVNode(unref(ChevronDownIcon), {
1390
+ class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
1391
+ }, null, 8, ["class"])
1392
+ ])
1163
1393
  ], 16),
1164
1394
  isMounted.value ? (openBlock(), createBlock(Teleport, {
1165
1395
  key: 0,
@@ -1186,64 +1416,64 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1186
1416
  }, [
1187
1417
  __props.searchable ? withDirectives((openBlock(), createElementBlock("input", {
1188
1418
  key: 0,
1189
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
1419
+ ref_key: "searchInputRef",
1420
+ ref: searchInputRef,
1421
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
1190
1422
  type: "text",
1191
1423
  placeholder: __props.searchPlaceholder,
1192
1424
  class: normalizeClass(__props.searchInputClass),
1193
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {
1425
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {
1194
1426
  }, ["stop"])),
1195
- onKeydown: _cache[2] || (_cache[2] = withModifiers(() => {
1427
+ onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
1196
1428
  }, ["stop"]))
1197
- }, null, 42, _hoisted_1$t)), [
1429
+ }, null, 42, _hoisted_2$j)), [
1198
1430
  [vModelText, searchQuery.value]
1199
1431
  ]) : createCommentVNode("", true),
1200
- __props.placeholder && !__props.multiple ? (openBlock(), createElementBlock("div", {
1201
- key: 1,
1202
- class: normalizeClass([
1203
- __props.dropdownOptionClass,
1204
- __props.placeholderClass,
1205
- { "text-gray-400": !__props.modelValue }
1206
- ]),
1207
- onClick: withModifiers(selectPlaceholder, ["stop"])
1208
- }, [
1209
- createElementVNode("span", {
1210
- style: normalizeStyle(darkTextStyle.value)
1211
- }, toDisplayString(__props.placeholder), 5)
1212
- ], 2)) : createCommentVNode("", true),
1213
1432
  selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
1214
- key: 2,
1433
+ key: 1,
1215
1434
  class: normalizeClass([
1216
1435
  __props.dropdownOptionClass,
1217
1436
  __props.deletedOptionClass,
1218
1437
  __props.dropdownSelectedClass
1219
1438
  ])
1220
1439
  }, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
1440
+ !hasVisibleOptions.value ? (openBlock(), createElementBlock("div", {
1441
+ key: 2,
1442
+ class: normalizeClass([__props.dropdownOptionClass, __props.placeholderClass, "cursor-default"]),
1443
+ style: normalizeStyle(darkTextStyle.value)
1444
+ }, toDisplayString(__props.noOptionsText), 7)) : createCommentVNode("", true),
1221
1445
  (openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option) => {
1222
1446
  return openBlock(), createElementBlock("div", {
1223
1447
  key: String(optionValue(option)),
1448
+ "data-option-value": String(optionValue(option) ?? ""),
1449
+ "data-select-option": "true",
1450
+ tabindex: "-1",
1224
1451
  class: normalizeClass([
1225
1452
  __props.dropdownOptionClass,
1226
1453
  optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
1227
1454
  { "text-neutral-50": isDarkMode.value && !optionDeleted(option) },
1228
1455
  {
1456
+ [__props.dropdownHighlightedClass]: optionIsHighlighted(option),
1229
1457
  [__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
1230
- "rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
1231
- "rounded-lg": !__props.placeholder && availableOptions.value.length === 1
1458
+ "rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1],
1459
+ "rounded-lg": availableOptions.value.length === 1
1232
1460
  }
1233
1461
  ]),
1234
- onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
1462
+ onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"]),
1463
+ onFocus: ($event) => highlightedOptionValue.value = String(optionValue(option) ?? ""),
1464
+ onKeydown: ($event) => handleOptionKeydown($event, option)
1235
1465
  }, [
1236
- __props.multiple ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
1466
+ __props.multiple ? (openBlock(), createElementBlock("div", _hoisted_4$a, [
1237
1467
  createElementVNode("input", {
1238
1468
  type: "checkbox",
1239
1469
  class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
1240
1470
  checked: optionIsSelected(option),
1241
1471
  disabled: __props.disabled,
1242
1472
  tabindex: "-1",
1243
- onClick: _cache[3] || (_cache[3] = withModifiers(() => {
1473
+ onClick: _cache[4] || (_cache[4] = withModifiers(() => {
1244
1474
  }, ["stop"])),
1245
1475
  onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
1246
- }, null, 40, _hoisted_4$a),
1476
+ }, null, 40, _hoisted_5$8),
1247
1477
  createElementVNode("span", {
1248
1478
  style: normalizeStyle(darkTextStyle.value)
1249
1479
  }, toDisplayString(optionText(option)), 5)
@@ -1251,7 +1481,7 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1251
1481
  key: 1,
1252
1482
  style: normalizeStyle(darkTextStyle.value)
1253
1483
  }, toDisplayString(optionText(option)), 5))
1254
- ], 10, _hoisted_2$j);
1484
+ ], 42, _hoisted_3$d);
1255
1485
  }), 128))
1256
1486
  ], 2)
1257
1487
  ], 6)) : createCommentVNode("", true)
@@ -1350,6 +1580,14 @@ const _sfc_main$F = {
1350
1580
  type: [String, Array, Object],
1351
1581
  default: "bg-blue-50 text-blue-700 font-medium dark:bg-neutral-900 dark:text-neutral-50"
1352
1582
  },
1583
+ dropdownHighlightedClass: {
1584
+ type: [String, Array, Object],
1585
+ default: "bg-slate-100 text-slate-900 dark:bg-neutral-800 dark:text-neutral-50"
1586
+ },
1587
+ container: {
1588
+ type: [String, Object],
1589
+ default: "body"
1590
+ },
1353
1591
  searchable: {
1354
1592
  type: Boolean,
1355
1593
  default: false
@@ -1361,6 +1599,10 @@ const _sfc_main$F = {
1361
1599
  searchInputClass: {
1362
1600
  type: [String, Array, Object],
1363
1601
  default: "w-full border-b border-neutral-200 px-4 py-3 text-sm outline-none focus:border-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:focus:border-neutral-100"
1602
+ },
1603
+ noOptionsText: {
1604
+ type: String,
1605
+ default: "No options available"
1364
1606
  }
1365
1607
  },
1366
1608
  emits: ["update:modelValue"],
@@ -1389,11 +1631,14 @@ const _sfc_main$F = {
1389
1631
  "dropdown-class": __props.dropdownClass,
1390
1632
  "dropdown-option-class": __props.dropdownOptionClass,
1391
1633
  "dropdown-selected-class": __props.dropdownSelectedClass,
1634
+ "dropdown-highlighted-class": __props.dropdownHighlightedClass,
1635
+ container: __props.container,
1392
1636
  searchable: __props.searchable,
1393
1637
  "search-placeholder": __props.searchPlaceholder,
1394
1638
  "search-input-class": __props.searchInputClass,
1639
+ "no-options-text": __props.noOptionsText,
1395
1640
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
1396
- }, _ctx.$attrs), null, 16, ["model-value", "model-modifiers", "options", "placeholder", "placeholder-disabled", "multiple", "disabled", "soft-delete-aware", "label-key", "value-key", "deleted-key", "option-label", "base-class", "normal-text-class", "deleted-selected-class", "option-class", "deleted-option-class", "placeholder-class", "dropdown-class", "dropdown-option-class", "dropdown-selected-class", "searchable", "search-placeholder", "search-input-class"]);
1641
+ }, _ctx.$attrs), null, 16, ["model-value", "model-modifiers", "options", "placeholder", "placeholder-disabled", "multiple", "disabled", "soft-delete-aware", "label-key", "value-key", "deleted-key", "option-label", "base-class", "normal-text-class", "deleted-selected-class", "option-class", "deleted-option-class", "placeholder-class", "dropdown-class", "dropdown-option-class", "dropdown-selected-class", "dropdown-highlighted-class", "container", "searchable", "search-placeholder", "search-input-class", "no-options-text"]);
1397
1642
  };
1398
1643
  }
1399
1644
  };
@@ -1894,7 +2139,7 @@ const _sfc_main$D = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
1894
2139
  };
1895
2140
  }
1896
2141
  });
1897
- const DateRangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-5c96a933"]]);
2142
+ const DateRangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-0612bf1a"]]);
1898
2143
  const _hoisted_1$q = { class: "relative" };
1899
2144
  const _hoisted_2$h = { class: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" };
1900
2145
  const _hoisted_3$b = ["accept"];
@@ -2279,20 +2524,20 @@ const _sfc_main$x = {
2279
2524
  }
2280
2525
  };
2281
2526
  const loadTinyMce = async () => {
2282
- const tinymceModule = await import("./tinymce-Dg510HCs.js").then((n) => n.t);
2527
+ const tinymceModule = await import("./tinymce-WPdeGquX.js").then((n) => n.t);
2283
2528
  const tinymce = tinymceModule.default ?? tinymceModule;
2284
2529
  if (typeof globalThis !== "undefined" && !globalThis.tinymce) {
2285
2530
  globalThis.tinymce = tinymce;
2286
2531
  }
2287
2532
  await Promise.all([
2288
- import("./index-BBGZQp5w.js").then((n) => n.i),
2289
- import("./index-Bsqrrc8R.js").then((n) => n.i),
2290
- import("./index-1G1T4Qrv.js").then((n) => n.i),
2533
+ import("./index-Ch9hFG6f.js").then((n) => n.i),
2534
+ import("./index-6eLEqodC.js").then((n) => n.i),
2535
+ import("./index-G1cAlO5C.js").then((n) => n.i),
2291
2536
  import("./index-CiFpmPug.js").then((n) => n.i),
2292
- import("./index-ukywSRmc.js").then((n) => n.i),
2293
- import("./index-CuSlJQwq.js").then((n) => n.i),
2294
- import("./index-D72Leh_x.js").then((n) => n.i),
2295
- import("./index-BR_u7CCm.js").then((n) => n.i)
2537
+ import("./index-BPcdR1qv.js").then((n) => n.i),
2538
+ import("./index-Cjhk16SP.js").then((n) => n.i),
2539
+ import("./index-D7sesyMc.js").then((n) => n.i),
2540
+ import("./index-BHTvTOGk.js").then((n) => n.i)
2296
2541
  ]);
2297
2542
  isEditorReady.value = true;
2298
2543
  };
@@ -3360,6 +3605,18 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
3360
3605
  searchInputClass: {
3361
3606
  type: [String, Array, Object],
3362
3607
  default: void 0
3608
+ },
3609
+ dropdownHighlightedClass: {
3610
+ type: [String, Array, Object],
3611
+ default: void 0
3612
+ },
3613
+ container: {
3614
+ type: [String, Object],
3615
+ default: void 0
3616
+ },
3617
+ noOptionsText: {
3618
+ type: String,
3619
+ default: void 0
3363
3620
  }
3364
3621
  },
3365
3622
  emits: ["update:modelValue", "blur"],
@@ -3467,6 +3724,11 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
3467
3724
  inputProps.searchPlaceholder = props.searchPlaceholder;
3468
3725
  if (props.searchInputClass !== void 0)
3469
3726
  inputProps.searchInputClass = props.searchInputClass;
3727
+ if (props.dropdownHighlightedClass !== void 0)
3728
+ inputProps.dropdownHighlightedClass = props.dropdownHighlightedClass;
3729
+ if (props.container !== void 0) inputProps.container = props.container;
3730
+ if (props.noOptionsText !== void 0)
3731
+ inputProps.noOptionsText = props.noOptionsText;
3470
3732
  return inputProps;
3471
3733
  });
3472
3734
  const notationBindings = computed(() => ({
@@ -6281,4 +6543,4 @@ export {
6281
6543
  _sfc_main$B as y,
6282
6544
  _sfc_main$A as z
6283
6545
  };
6284
- //# sourceMappingURL=plugin-m8XaPTjJ.js.map
6546
+ //# sourceMappingURL=plugin-BB5Wpvyp.js.map