@enos5/enos-vue-default 1.8.10 → 1.8.11
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/CustomSelect.vue.d.ts +18 -0
- package/dist/components/InputGroup.vue.d.ts +18 -0
- package/dist/components/SelectInput.vue.d.ts +18 -0
- package/dist/{index-Bsqrrc8R.js → index-6eLEqodC.js} +4 -35
- package/dist/index-6eLEqodC.js.map +1 -0
- package/dist/{index-BR_u7CCm.js → index-BHTvTOGk.js} +2 -4
- package/dist/{index-BR_u7CCm.js.map → index-BHTvTOGk.js.map} +1 -1
- package/dist/{index-ukywSRmc.js → index-BPcdR1qv.js} +9 -10
- package/dist/index-BPcdR1qv.js.map +1 -0
- package/dist/{index-BBGZQp5w.js → index-Ch9hFG6f.js} +6 -17
- package/dist/{index-BBGZQp5w.js.map → index-Ch9hFG6f.js.map} +1 -1
- package/dist/index-CiFpmPug.js.map +1 -1
- package/dist/{index-CuSlJQwq.js → index-Cjhk16SP.js} +8 -10
- package/dist/index-Cjhk16SP.js.map +1 -0
- package/dist/{index-D72Leh_x.js → index-D7sesyMc.js} +4 -4
- package/dist/{index-D72Leh_x.js.map → index-D7sesyMc.js.map} +1 -1
- package/dist/{index-1G1T4Qrv.js → index-G1cAlO5C.js} +203 -373
- package/dist/index-G1cAlO5C.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.node.js +1 -1
- package/dist/{plugin-m8XaPTjJ.js → plugin-Bl7pzq-e.js} +296 -52
- package/dist/plugin-Bl7pzq-e.js.map +1 -0
- package/dist/styles.css +76 -1552
- package/dist/{tinymce-Dg510HCs.js → tinymce-WPdeGquX.js} +388 -659
- package/dist/tinymce-WPdeGquX.js.map +1 -0
- package/package.json +36 -36
- package/dist/index-1G1T4Qrv.js.map +0 -1
- package/dist/index-Bsqrrc8R.js.map +0 -1
- package/dist/index-CuSlJQwq.js.map +0 -1
- package/dist/index-ukywSRmc.js.map +0 -1
- package/dist/plugin-m8XaPTjJ.js.map +0 -1
- 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-
|
|
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-Bl7pzq-e.js";
|
|
3
3
|
export {
|
|
4
4
|
_ as ActionCard,
|
|
5
5
|
a as ActionMessage,
|
package/dist/index.node.js
CHANGED
|
@@ -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-
|
|
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-Bl7pzq-e.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,
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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 =
|
|
826
|
-
const _hoisted_2$j = ["
|
|
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
|
|
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,10 @@ 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
|
+
},
|
|
919
924
|
searchable: {
|
|
920
925
|
type: Boolean,
|
|
921
926
|
default: false
|
|
@@ -927,6 +932,10 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
927
932
|
searchInputClass: {
|
|
928
933
|
type: [String, Array, Object],
|
|
929
934
|
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"
|
|
935
|
+
},
|
|
936
|
+
noOptionsText: {
|
|
937
|
+
type: String,
|
|
938
|
+
default: "No options available"
|
|
930
939
|
}
|
|
931
940
|
},
|
|
932
941
|
emits: ["update:modelValue"],
|
|
@@ -943,6 +952,10 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
943
952
|
const isDarkMode = ref(false);
|
|
944
953
|
const isMounted = ref(false);
|
|
945
954
|
const searchQuery = ref("");
|
|
955
|
+
const searchInputRef = ref(null);
|
|
956
|
+
const highlightedOptionValue = ref(null);
|
|
957
|
+
const typeaheadQuery = ref("");
|
|
958
|
+
let typeaheadResetTimeout = null;
|
|
946
959
|
const isObjectOption = (option) => typeof option === "object" && option !== null;
|
|
947
960
|
const optionValue = (option) => {
|
|
948
961
|
if (isObjectOption(option)) {
|
|
@@ -1017,6 +1030,9 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1017
1030
|
}
|
|
1018
1031
|
return multipleOptions.value.filter((option) => modelValueSet.value.has(String(optionValue(option) ?? "")));
|
|
1019
1032
|
});
|
|
1033
|
+
const hasVisibleOptions = computed(() => filteredOptions.value.length > 0);
|
|
1034
|
+
const visibleOptions = computed(() => filteredOptions.value);
|
|
1035
|
+
const canClearSelection = computed(() => !props.multiple && !props.placeholderDisabled && !props.disabled && props.modelValue !== null && props.modelValue !== void 0 && props.modelValue !== "");
|
|
1020
1036
|
const displayText = computed(() => {
|
|
1021
1037
|
if (props.multiple) {
|
|
1022
1038
|
if (selectedMultipleOptions.value.length === 0) {
|
|
@@ -1044,6 +1060,7 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1044
1060
|
};
|
|
1045
1061
|
const normalizeEmittedValues = (values) => values.map((value) => normalizeEmittedValue(value));
|
|
1046
1062
|
const optionIsSelected = (option) => modelValueSet.value.has(String(optionValue(option) ?? ""));
|
|
1063
|
+
const optionIsHighlighted = (option) => highlightedOptionValue.value === String(optionValue(option) ?? "");
|
|
1047
1064
|
const toggleDropdown = () => {
|
|
1048
1065
|
if (!props.disabled) {
|
|
1049
1066
|
isOpen.value = !isOpen.value;
|
|
@@ -1058,9 +1075,9 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1058
1075
|
emit("update:modelValue", normalizeEmittedValue(value));
|
|
1059
1076
|
isOpen.value = false;
|
|
1060
1077
|
};
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1063
|
-
emit("update:modelValue",
|
|
1078
|
+
const clearSelection = () => {
|
|
1079
|
+
if (canClearSelection.value) {
|
|
1080
|
+
emit("update:modelValue", normalizeEmittedValue(""));
|
|
1064
1081
|
isOpen.value = false;
|
|
1065
1082
|
}
|
|
1066
1083
|
};
|
|
@@ -1102,6 +1119,8 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1102
1119
|
if (!clickedInsideTrigger && !clickedInsideMenu) {
|
|
1103
1120
|
isOpen.value = false;
|
|
1104
1121
|
searchQuery.value = "";
|
|
1122
|
+
highlightedOptionValue.value = null;
|
|
1123
|
+
typeaheadQuery.value = "";
|
|
1105
1124
|
}
|
|
1106
1125
|
};
|
|
1107
1126
|
const syncDarkMode = () => {
|
|
@@ -1112,28 +1131,218 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1112
1131
|
isDarkMode.value = document.documentElement.classList.contains("dark") || document.body.classList.contains("dark");
|
|
1113
1132
|
};
|
|
1114
1133
|
const darkTextStyle = computed(() => isDarkMode.value ? { color: "#ffffff" } : null);
|
|
1134
|
+
const clearTypeaheadQuery = () => {
|
|
1135
|
+
typeaheadQuery.value = "";
|
|
1136
|
+
if (typeaheadResetTimeout) {
|
|
1137
|
+
window.clearTimeout(typeaheadResetTimeout);
|
|
1138
|
+
typeaheadResetTimeout = null;
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
const scheduleTypeaheadReset = () => {
|
|
1142
|
+
if (typeaheadResetTimeout) {
|
|
1143
|
+
window.clearTimeout(typeaheadResetTimeout);
|
|
1144
|
+
}
|
|
1145
|
+
typeaheadResetTimeout = window.setTimeout(() => {
|
|
1146
|
+
typeaheadQuery.value = "";
|
|
1147
|
+
typeaheadResetTimeout = null;
|
|
1148
|
+
}, 700);
|
|
1149
|
+
};
|
|
1150
|
+
const escapeSelectorValue = (value) => {
|
|
1151
|
+
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
|
|
1152
|
+
return CSS.escape(value);
|
|
1153
|
+
}
|
|
1154
|
+
return value.replace(/["\\]/g, "\\$&");
|
|
1155
|
+
};
|
|
1156
|
+
const scrollOptionByValue = async (value) => {
|
|
1157
|
+
await nextTick();
|
|
1158
|
+
if (!dropdownMenuRef.value) {
|
|
1159
|
+
return null;
|
|
1160
|
+
}
|
|
1161
|
+
const optionElement = dropdownMenuRef.value.querySelector(
|
|
1162
|
+
`[data-option-value="${escapeSelectorValue(value)}"]`
|
|
1163
|
+
);
|
|
1164
|
+
if (!optionElement) {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
optionElement.scrollIntoView({ block: "nearest" });
|
|
1168
|
+
return optionElement;
|
|
1169
|
+
};
|
|
1170
|
+
const focusOptionByValue = async (value) => {
|
|
1171
|
+
const optionElement = await scrollOptionByValue(value);
|
|
1172
|
+
if (!optionElement) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
optionElement.focus({ preventScroll: true });
|
|
1176
|
+
};
|
|
1177
|
+
const setHighlightedOption = async (option, { focus = !props.searchable } = {}) => {
|
|
1178
|
+
const value = String(optionValue(option) ?? "");
|
|
1179
|
+
highlightedOptionValue.value = value;
|
|
1180
|
+
if (focus) {
|
|
1181
|
+
await focusOptionByValue(value);
|
|
1182
|
+
return;
|
|
1183
|
+
}
|
|
1184
|
+
await scrollOptionByValue(value);
|
|
1185
|
+
};
|
|
1186
|
+
const findMatchingOption = (query) => {
|
|
1187
|
+
const normalizedQuery = query.trimStart().toLowerCase();
|
|
1188
|
+
if (!normalizedQuery) {
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1191
|
+
const options = props.multiple ? multipleOptions.value : availableOptions.value;
|
|
1192
|
+
return options.find((option) => String(optionText(option)).toLowerCase().startsWith(normalizedQuery)) ?? null;
|
|
1193
|
+
};
|
|
1194
|
+
const findHighlightedOptionIndex = () => {
|
|
1195
|
+
return visibleOptions.value.findIndex((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
|
|
1196
|
+
};
|
|
1197
|
+
const moveHighlightedOption = async (direction) => {
|
|
1198
|
+
if (!visibleOptions.value.length) {
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1201
|
+
const currentIndex = findHighlightedOptionIndex();
|
|
1202
|
+
const fallbackIndex = direction > 0 ? 0 : visibleOptions.value.length - 1;
|
|
1203
|
+
const nextIndex = currentIndex === -1 ? fallbackIndex : (currentIndex + direction + visibleOptions.value.length) % visibleOptions.value.length;
|
|
1204
|
+
await setHighlightedOption(visibleOptions.value[nextIndex]);
|
|
1205
|
+
};
|
|
1206
|
+
const selectHighlightedOption = () => {
|
|
1207
|
+
const highlightedOption = visibleOptions.value.find((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
|
|
1208
|
+
if (!highlightedOption) {
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
if (props.multiple) {
|
|
1212
|
+
toggleMultipleOption(highlightedOption);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
selectOption(highlightedOption);
|
|
1216
|
+
};
|
|
1217
|
+
const syncHighlightedOption = async () => {
|
|
1218
|
+
if (!visibleOptions.value.length) {
|
|
1219
|
+
highlightedOptionValue.value = null;
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
const hasCurrentHighlight = visibleOptions.value.some((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value);
|
|
1223
|
+
if (hasCurrentHighlight) {
|
|
1224
|
+
await setHighlightedOption(
|
|
1225
|
+
visibleOptions.value.find((option) => String(optionValue(option) ?? "") === highlightedOptionValue.value),
|
|
1226
|
+
{ focus: false }
|
|
1227
|
+
);
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
await setHighlightedOption(visibleOptions.value[0], { focus: false });
|
|
1231
|
+
};
|
|
1232
|
+
const handleTypeaheadKeydown = (event) => {
|
|
1233
|
+
if (!isOpen.value || props.searchable) {
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
if (event.ctrlKey || event.altKey || event.metaKey || event.key.length !== 1) {
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
const target = event.target;
|
|
1240
|
+
const targetInsideSelect = rootRef.value?.contains(target) || dropdownMenuRef.value?.contains(target);
|
|
1241
|
+
if (!targetInsideSelect) {
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
typeaheadQuery.value += event.key;
|
|
1245
|
+
scheduleTypeaheadReset();
|
|
1246
|
+
const matchingOption = findMatchingOption(typeaheadQuery.value);
|
|
1247
|
+
if (!matchingOption) {
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
setHighlightedOption(matchingOption);
|
|
1251
|
+
event.preventDefault();
|
|
1252
|
+
event.stopPropagation();
|
|
1253
|
+
};
|
|
1254
|
+
const handleDropdownKeydown = (event) => {
|
|
1255
|
+
if (!isOpen.value) {
|
|
1256
|
+
return;
|
|
1257
|
+
}
|
|
1258
|
+
const target = event.target;
|
|
1259
|
+
const targetInsideSelect = rootRef.value?.contains(target) || dropdownMenuRef.value?.contains(target);
|
|
1260
|
+
if (!targetInsideSelect) {
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
if (event.key === "Escape") {
|
|
1264
|
+
event.preventDefault();
|
|
1265
|
+
event.stopPropagation();
|
|
1266
|
+
isOpen.value = false;
|
|
1267
|
+
triggerRef.value?.focus();
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
if (event.key === "ArrowDown") {
|
|
1271
|
+
event.preventDefault();
|
|
1272
|
+
event.stopPropagation();
|
|
1273
|
+
moveHighlightedOption(1);
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
if (event.key === "ArrowUp") {
|
|
1277
|
+
event.preventDefault();
|
|
1278
|
+
event.stopPropagation();
|
|
1279
|
+
moveHighlightedOption(-1);
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
if (event.key === "Enter" && highlightedOptionValue.value !== null) {
|
|
1283
|
+
event.preventDefault();
|
|
1284
|
+
event.stopPropagation();
|
|
1285
|
+
selectHighlightedOption();
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
const handleOptionKeydown = (event, option) => {
|
|
1289
|
+
if (event.key !== "Enter" && event.key !== " ") {
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
event.preventDefault();
|
|
1293
|
+
event.stopPropagation();
|
|
1294
|
+
if (props.multiple) {
|
|
1295
|
+
toggleMultipleOption(option);
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
selectOption(option);
|
|
1299
|
+
};
|
|
1115
1300
|
onMounted(() => {
|
|
1116
1301
|
isMounted.value = true;
|
|
1117
1302
|
syncTeleportTarget();
|
|
1118
1303
|
syncDarkMode();
|
|
1119
1304
|
document.addEventListener("click", closeDropdown);
|
|
1305
|
+
document.addEventListener("keydown", handleDropdownKeydown, true);
|
|
1306
|
+
document.addEventListener("keydown", handleTypeaheadKeydown, true);
|
|
1120
1307
|
window.addEventListener("resize", updateDropdownPosition);
|
|
1121
1308
|
window.addEventListener("scroll", updateDropdownPosition, true);
|
|
1122
1309
|
});
|
|
1123
1310
|
onBeforeUnmount(() => {
|
|
1311
|
+
clearTypeaheadQuery();
|
|
1124
1312
|
document.removeEventListener("click", closeDropdown);
|
|
1313
|
+
document.removeEventListener("keydown", handleDropdownKeydown, true);
|
|
1314
|
+
document.removeEventListener("keydown", handleTypeaheadKeydown, true);
|
|
1125
1315
|
window.removeEventListener("resize", updateDropdownPosition);
|
|
1126
1316
|
window.removeEventListener("scroll", updateDropdownPosition, true);
|
|
1127
1317
|
});
|
|
1128
1318
|
watch(isOpen, async (open) => {
|
|
1129
1319
|
if (!open) {
|
|
1130
1320
|
searchQuery.value = "";
|
|
1321
|
+
highlightedOptionValue.value = null;
|
|
1322
|
+
clearTypeaheadQuery();
|
|
1131
1323
|
return;
|
|
1132
1324
|
}
|
|
1325
|
+
clearTypeaheadQuery();
|
|
1133
1326
|
syncTeleportTarget();
|
|
1134
1327
|
syncDarkMode();
|
|
1135
1328
|
await nextTick();
|
|
1136
1329
|
updateDropdownPosition();
|
|
1330
|
+
if (props.searchable) {
|
|
1331
|
+
await nextTick();
|
|
1332
|
+
await syncHighlightedOption();
|
|
1333
|
+
searchInputRef.value?.focus();
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
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];
|
|
1337
|
+
if (initialOption) {
|
|
1338
|
+
await setHighlightedOption(initialOption);
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
watch(filteredOptions, async () => {
|
|
1342
|
+
if (!isOpen.value || !props.searchable) {
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
await syncHighlightedOption();
|
|
1137
1346
|
});
|
|
1138
1347
|
return (_ctx, _cache) => {
|
|
1139
1348
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1157,9 +1366,22 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1157
1366
|
class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null),
|
|
1158
1367
|
style: normalizeStyle(darkTextStyle.value)
|
|
1159
1368
|
}, toDisplayString(displayText.value), 7),
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1369
|
+
createElementVNode("div", _hoisted_1$t, [
|
|
1370
|
+
canClearSelection.value ? (openBlock(), createElementBlock("button", {
|
|
1371
|
+
key: 0,
|
|
1372
|
+
type: "button",
|
|
1373
|
+
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",
|
|
1374
|
+
"aria-label": "Clear selection",
|
|
1375
|
+
onClick: withModifiers(clearSelection, ["stop", "prevent"]),
|
|
1376
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1377
|
+
}, ["stop"]))
|
|
1378
|
+
}, [
|
|
1379
|
+
createVNode(unref(XMarkIcon), { class: "size-4" })
|
|
1380
|
+
], 32)) : createCommentVNode("", true),
|
|
1381
|
+
createVNode(unref(ChevronDownIcon), {
|
|
1382
|
+
class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
|
|
1383
|
+
}, null, 8, ["class"])
|
|
1384
|
+
])
|
|
1163
1385
|
], 16),
|
|
1164
1386
|
isMounted.value ? (openBlock(), createBlock(Teleport, {
|
|
1165
1387
|
key: 0,
|
|
@@ -1186,64 +1408,64 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1186
1408
|
}, [
|
|
1187
1409
|
__props.searchable ? withDirectives((openBlock(), createElementBlock("input", {
|
|
1188
1410
|
key: 0,
|
|
1189
|
-
|
|
1411
|
+
ref_key: "searchInputRef",
|
|
1412
|
+
ref: searchInputRef,
|
|
1413
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
|
|
1190
1414
|
type: "text",
|
|
1191
1415
|
placeholder: __props.searchPlaceholder,
|
|
1192
1416
|
class: normalizeClass(__props.searchInputClass),
|
|
1193
|
-
onClick: _cache[
|
|
1417
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
1194
1418
|
}, ["stop"])),
|
|
1195
|
-
onKeydown: _cache[
|
|
1419
|
+
onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
|
|
1196
1420
|
}, ["stop"]))
|
|
1197
|
-
}, null, 42,
|
|
1421
|
+
}, null, 42, _hoisted_2$j)), [
|
|
1198
1422
|
[vModelText, searchQuery.value]
|
|
1199
1423
|
]) : 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
1424
|
selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
|
|
1214
|
-
key:
|
|
1425
|
+
key: 1,
|
|
1215
1426
|
class: normalizeClass([
|
|
1216
1427
|
__props.dropdownOptionClass,
|
|
1217
1428
|
__props.deletedOptionClass,
|
|
1218
1429
|
__props.dropdownSelectedClass
|
|
1219
1430
|
])
|
|
1220
1431
|
}, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
|
|
1432
|
+
!hasVisibleOptions.value ? (openBlock(), createElementBlock("div", {
|
|
1433
|
+
key: 2,
|
|
1434
|
+
class: normalizeClass([__props.dropdownOptionClass, __props.placeholderClass, "cursor-default"]),
|
|
1435
|
+
style: normalizeStyle(darkTextStyle.value)
|
|
1436
|
+
}, toDisplayString(__props.noOptionsText), 7)) : createCommentVNode("", true),
|
|
1221
1437
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option) => {
|
|
1222
1438
|
return openBlock(), createElementBlock("div", {
|
|
1223
1439
|
key: String(optionValue(option)),
|
|
1440
|
+
"data-option-value": String(optionValue(option) ?? ""),
|
|
1441
|
+
"data-select-option": "true",
|
|
1442
|
+
tabindex: "-1",
|
|
1224
1443
|
class: normalizeClass([
|
|
1225
1444
|
__props.dropdownOptionClass,
|
|
1226
1445
|
optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
|
|
1227
1446
|
{ "text-neutral-50": isDarkMode.value && !optionDeleted(option) },
|
|
1228
1447
|
{
|
|
1448
|
+
[__props.dropdownHighlightedClass]: optionIsHighlighted(option),
|
|
1229
1449
|
[__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]
|
|
1231
|
-
"rounded-lg":
|
|
1450
|
+
"rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1],
|
|
1451
|
+
"rounded-lg": availableOptions.value.length === 1
|
|
1232
1452
|
}
|
|
1233
1453
|
]),
|
|
1234
|
-
onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
|
|
1454
|
+
onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"]),
|
|
1455
|
+
onFocus: ($event) => highlightedOptionValue.value = String(optionValue(option) ?? ""),
|
|
1456
|
+
onKeydown: ($event) => handleOptionKeydown($event, option)
|
|
1235
1457
|
}, [
|
|
1236
|
-
__props.multiple ? (openBlock(), createElementBlock("div",
|
|
1458
|
+
__props.multiple ? (openBlock(), createElementBlock("div", _hoisted_4$a, [
|
|
1237
1459
|
createElementVNode("input", {
|
|
1238
1460
|
type: "checkbox",
|
|
1239
1461
|
class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
|
|
1240
1462
|
checked: optionIsSelected(option),
|
|
1241
1463
|
disabled: __props.disabled,
|
|
1242
1464
|
tabindex: "-1",
|
|
1243
|
-
onClick: _cache[
|
|
1465
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
1244
1466
|
}, ["stop"])),
|
|
1245
1467
|
onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
|
|
1246
|
-
}, null, 40,
|
|
1468
|
+
}, null, 40, _hoisted_5$8),
|
|
1247
1469
|
createElementVNode("span", {
|
|
1248
1470
|
style: normalizeStyle(darkTextStyle.value)
|
|
1249
1471
|
}, toDisplayString(optionText(option)), 5)
|
|
@@ -1251,7 +1473,7 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1251
1473
|
key: 1,
|
|
1252
1474
|
style: normalizeStyle(darkTextStyle.value)
|
|
1253
1475
|
}, toDisplayString(optionText(option)), 5))
|
|
1254
|
-
],
|
|
1476
|
+
], 42, _hoisted_3$d);
|
|
1255
1477
|
}), 128))
|
|
1256
1478
|
], 2)
|
|
1257
1479
|
], 6)) : createCommentVNode("", true)
|
|
@@ -1350,6 +1572,10 @@ const _sfc_main$F = {
|
|
|
1350
1572
|
type: [String, Array, Object],
|
|
1351
1573
|
default: "bg-blue-50 text-blue-700 font-medium dark:bg-neutral-900 dark:text-neutral-50"
|
|
1352
1574
|
},
|
|
1575
|
+
dropdownHighlightedClass: {
|
|
1576
|
+
type: [String, Array, Object],
|
|
1577
|
+
default: "bg-slate-100 text-slate-900 dark:bg-neutral-800 dark:text-neutral-50"
|
|
1578
|
+
},
|
|
1353
1579
|
searchable: {
|
|
1354
1580
|
type: Boolean,
|
|
1355
1581
|
default: false
|
|
@@ -1361,6 +1587,10 @@ const _sfc_main$F = {
|
|
|
1361
1587
|
searchInputClass: {
|
|
1362
1588
|
type: [String, Array, Object],
|
|
1363
1589
|
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"
|
|
1590
|
+
},
|
|
1591
|
+
noOptionsText: {
|
|
1592
|
+
type: String,
|
|
1593
|
+
default: "No options available"
|
|
1364
1594
|
}
|
|
1365
1595
|
},
|
|
1366
1596
|
emits: ["update:modelValue"],
|
|
@@ -1389,11 +1619,13 @@ const _sfc_main$F = {
|
|
|
1389
1619
|
"dropdown-class": __props.dropdownClass,
|
|
1390
1620
|
"dropdown-option-class": __props.dropdownOptionClass,
|
|
1391
1621
|
"dropdown-selected-class": __props.dropdownSelectedClass,
|
|
1622
|
+
"dropdown-highlighted-class": __props.dropdownHighlightedClass,
|
|
1392
1623
|
searchable: __props.searchable,
|
|
1393
1624
|
"search-placeholder": __props.searchPlaceholder,
|
|
1394
1625
|
"search-input-class": __props.searchInputClass,
|
|
1626
|
+
"no-options-text": __props.noOptionsText,
|
|
1395
1627
|
"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"]);
|
|
1628
|
+
}, _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", "searchable", "search-placeholder", "search-input-class", "no-options-text"]);
|
|
1397
1629
|
};
|
|
1398
1630
|
}
|
|
1399
1631
|
};
|
|
@@ -1894,7 +2126,7 @@ const _sfc_main$D = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1894
2126
|
};
|
|
1895
2127
|
}
|
|
1896
2128
|
});
|
|
1897
|
-
const DateRangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
2129
|
+
const DateRangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-0612bf1a"]]);
|
|
1898
2130
|
const _hoisted_1$q = { class: "relative" };
|
|
1899
2131
|
const _hoisted_2$h = { class: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" };
|
|
1900
2132
|
const _hoisted_3$b = ["accept"];
|
|
@@ -2279,20 +2511,20 @@ const _sfc_main$x = {
|
|
|
2279
2511
|
}
|
|
2280
2512
|
};
|
|
2281
2513
|
const loadTinyMce = async () => {
|
|
2282
|
-
const tinymceModule = await import("./tinymce-
|
|
2514
|
+
const tinymceModule = await import("./tinymce-WPdeGquX.js").then((n) => n.t);
|
|
2283
2515
|
const tinymce = tinymceModule.default ?? tinymceModule;
|
|
2284
2516
|
if (typeof globalThis !== "undefined" && !globalThis.tinymce) {
|
|
2285
2517
|
globalThis.tinymce = tinymce;
|
|
2286
2518
|
}
|
|
2287
2519
|
await Promise.all([
|
|
2288
|
-
import("./index-
|
|
2289
|
-
import("./index-
|
|
2290
|
-
import("./index-
|
|
2520
|
+
import("./index-Ch9hFG6f.js").then((n) => n.i),
|
|
2521
|
+
import("./index-6eLEqodC.js").then((n) => n.i),
|
|
2522
|
+
import("./index-G1cAlO5C.js").then((n) => n.i),
|
|
2291
2523
|
import("./index-CiFpmPug.js").then((n) => n.i),
|
|
2292
|
-
import("./index-
|
|
2293
|
-
import("./index-
|
|
2294
|
-
import("./index-
|
|
2295
|
-
import("./index-
|
|
2524
|
+
import("./index-BPcdR1qv.js").then((n) => n.i),
|
|
2525
|
+
import("./index-Cjhk16SP.js").then((n) => n.i),
|
|
2526
|
+
import("./index-D7sesyMc.js").then((n) => n.i),
|
|
2527
|
+
import("./index-BHTvTOGk.js").then((n) => n.i)
|
|
2296
2528
|
]);
|
|
2297
2529
|
isEditorReady.value = true;
|
|
2298
2530
|
};
|
|
@@ -3360,6 +3592,14 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
3360
3592
|
searchInputClass: {
|
|
3361
3593
|
type: [String, Array, Object],
|
|
3362
3594
|
default: void 0
|
|
3595
|
+
},
|
|
3596
|
+
dropdownHighlightedClass: {
|
|
3597
|
+
type: [String, Array, Object],
|
|
3598
|
+
default: void 0
|
|
3599
|
+
},
|
|
3600
|
+
noOptionsText: {
|
|
3601
|
+
type: String,
|
|
3602
|
+
default: void 0
|
|
3363
3603
|
}
|
|
3364
3604
|
},
|
|
3365
3605
|
emits: ["update:modelValue", "blur"],
|
|
@@ -3467,6 +3707,10 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
3467
3707
|
inputProps.searchPlaceholder = props.searchPlaceholder;
|
|
3468
3708
|
if (props.searchInputClass !== void 0)
|
|
3469
3709
|
inputProps.searchInputClass = props.searchInputClass;
|
|
3710
|
+
if (props.dropdownHighlightedClass !== void 0)
|
|
3711
|
+
inputProps.dropdownHighlightedClass = props.dropdownHighlightedClass;
|
|
3712
|
+
if (props.noOptionsText !== void 0)
|
|
3713
|
+
inputProps.noOptionsText = props.noOptionsText;
|
|
3470
3714
|
return inputProps;
|
|
3471
3715
|
});
|
|
3472
3716
|
const notationBindings = computed(() => ({
|
|
@@ -6281,4 +6525,4 @@ export {
|
|
|
6281
6525
|
_sfc_main$B as y,
|
|
6282
6526
|
_sfc_main$A as z
|
|
6283
6527
|
};
|
|
6284
|
-
//# sourceMappingURL=plugin-
|
|
6528
|
+
//# sourceMappingURL=plugin-Bl7pzq-e.js.map
|