@enos5/enos-vue-default 1.6.0 → 1.6.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.
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, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-
|
|
2
|
+
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-D5KJd0xy.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, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-
|
|
1
|
+
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-D5KJd0xy.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as ActionCard,
|
|
4
4
|
a as ActionMessage,
|
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, createTextVNode, h, vModelText, createSlots } from "vue";
|
|
2
2
|
import { LockClosedIcon, ChevronDownIcon, PhotoIcon, ExclamationCircleIcon, ExclamationTriangleIcon, ChevronUpIcon, MagnifyingGlassIcon, CheckIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
|
3
3
|
import Editor from "@tinymce/tinymce-vue";
|
|
4
4
|
import { Link } from "@inertiajs/vue3";
|
|
@@ -925,6 +925,7 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
925
925
|
const triggerRef = ref(null);
|
|
926
926
|
const dropdownMenuRef = ref(null);
|
|
927
927
|
const dropdownStyle = ref({});
|
|
928
|
+
const isDarkMode = ref(false);
|
|
928
929
|
const isObjectOption = (option) => typeof option === "object" && option !== null;
|
|
929
930
|
const optionValue = (option) => {
|
|
930
931
|
if (isObjectOption(option)) {
|
|
@@ -1070,7 +1071,16 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1070
1071
|
isOpen.value = false;
|
|
1071
1072
|
}
|
|
1072
1073
|
};
|
|
1074
|
+
const syncDarkMode = () => {
|
|
1075
|
+
if (rootRef.value?.closest(".dark")) {
|
|
1076
|
+
isDarkMode.value = true;
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
isDarkMode.value = document.documentElement.classList.contains("dark") || document.body.classList.contains("dark");
|
|
1080
|
+
};
|
|
1081
|
+
const darkTextStyle = computed(() => isDarkMode.value ? { color: "#ffffff" } : null);
|
|
1073
1082
|
onMounted(() => {
|
|
1083
|
+
syncDarkMode();
|
|
1074
1084
|
document.addEventListener("click", closeDropdown);
|
|
1075
1085
|
window.addEventListener("resize", updateDropdownPosition);
|
|
1076
1086
|
window.addEventListener("scroll", updateDropdownPosition, true);
|
|
@@ -1084,6 +1094,7 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1084
1094
|
if (!open) {
|
|
1085
1095
|
return;
|
|
1086
1096
|
}
|
|
1097
|
+
syncDarkMode();
|
|
1087
1098
|
await nextTick();
|
|
1088
1099
|
updateDropdownPosition();
|
|
1089
1100
|
});
|
|
@@ -1100,13 +1111,15 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1100
1111
|
class: [
|
|
1101
1112
|
__props.baseClass,
|
|
1102
1113
|
selectedDeletedOption.value || __props.multiple && selectedMultipleOptions.value.some(optionDeleted) ? __props.deletedSelectedClass : __props.normalTextClass,
|
|
1114
|
+
{ "text-neutral-50": isDarkMode.value && !(selectedDeletedOption.value || __props.multiple && selectedMultipleOptions.value.some(optionDeleted)) },
|
|
1103
1115
|
"flex items-center justify-between cursor-pointer",
|
|
1104
1116
|
unref(attrs).class
|
|
1105
1117
|
]
|
|
1106
1118
|
}, unref(attrs), { tabindex: "0" }), [
|
|
1107
1119
|
createElementVNode("span", {
|
|
1108
|
-
class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null)
|
|
1109
|
-
|
|
1120
|
+
class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null),
|
|
1121
|
+
style: normalizeStyle(darkTextStyle.value)
|
|
1122
|
+
}, toDisplayString(displayText.value), 7),
|
|
1110
1123
|
createVNode(unref(ChevronDownIcon), {
|
|
1111
1124
|
class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
|
|
1112
1125
|
}, null, 8, ["class"])
|
|
@@ -1125,57 +1138,69 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1125
1138
|
key: 0,
|
|
1126
1139
|
ref_key: "dropdownMenuRef",
|
|
1127
1140
|
ref: dropdownMenuRef,
|
|
1128
|
-
class: normalizeClass(
|
|
1141
|
+
class: normalizeClass({ dark: isDarkMode.value }),
|
|
1129
1142
|
style: normalizeStyle(dropdownStyle.value)
|
|
1130
1143
|
}, [
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
{ "text-gray-400": !__props.modelValue }
|
|
1137
|
-
]),
|
|
1138
|
-
onClick: withModifiers(selectPlaceholder, ["stop"])
|
|
1139
|
-
}, toDisplayString(__props.placeholder), 3)) : createCommentVNode("", true),
|
|
1140
|
-
selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
|
|
1141
|
-
key: 1,
|
|
1142
|
-
class: normalizeClass([
|
|
1143
|
-
__props.dropdownOptionClass,
|
|
1144
|
-
__props.deletedOptionClass,
|
|
1145
|
-
__props.dropdownSelectedClass
|
|
1146
|
-
])
|
|
1147
|
-
}, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
|
|
1148
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.multiple ? multipleOptions.value : availableOptions.value, (option) => {
|
|
1149
|
-
return openBlock(), createElementBlock("div", {
|
|
1150
|
-
key: String(optionValue(option)),
|
|
1144
|
+
createElementVNode("div", {
|
|
1145
|
+
class: normalizeClass([__props.dropdownClass, { "bg-neutral-950 border-neutral-800": isDarkMode.value }])
|
|
1146
|
+
}, [
|
|
1147
|
+
__props.placeholder && !__props.multiple ? (openBlock(), createElementBlock("div", {
|
|
1148
|
+
key: 0,
|
|
1151
1149
|
class: normalizeClass([
|
|
1152
1150
|
__props.dropdownOptionClass,
|
|
1153
|
-
|
|
1154
|
-
{
|
|
1155
|
-
[__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
|
|
1156
|
-
"rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
|
|
1157
|
-
"rounded-lg": !__props.placeholder && availableOptions.value.length === 1
|
|
1158
|
-
}
|
|
1151
|
+
__props.placeholderClass,
|
|
1152
|
+
{ "text-gray-400": !__props.modelValue }
|
|
1159
1153
|
]),
|
|
1160
|
-
onClick: withModifiers(
|
|
1154
|
+
onClick: withModifiers(selectPlaceholder, ["stop"])
|
|
1161
1155
|
}, [
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1156
|
+
createElementVNode("span", {
|
|
1157
|
+
style: normalizeStyle(darkTextStyle.value)
|
|
1158
|
+
}, toDisplayString(__props.placeholder), 5)
|
|
1159
|
+
], 2)) : createCommentVNode("", true),
|
|
1160
|
+
selectedDeletedOption.value ? (openBlock(), createElementBlock("div", {
|
|
1161
|
+
key: 1,
|
|
1162
|
+
class: normalizeClass([
|
|
1163
|
+
__props.dropdownOptionClass,
|
|
1164
|
+
__props.deletedOptionClass,
|
|
1165
|
+
__props.dropdownSelectedClass
|
|
1166
|
+
])
|
|
1167
|
+
}, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
|
|
1168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.multiple ? multipleOptions.value : availableOptions.value, (option) => {
|
|
1169
|
+
return openBlock(), createElementBlock("div", {
|
|
1170
|
+
key: String(optionValue(option)),
|
|
1171
|
+
class: normalizeClass([
|
|
1172
|
+
__props.dropdownOptionClass,
|
|
1173
|
+
optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
|
|
1174
|
+
{ "text-neutral-50": isDarkMode.value && !optionDeleted(option) },
|
|
1175
|
+
{
|
|
1176
|
+
[__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
|
|
1177
|
+
"rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
|
|
1178
|
+
"rounded-lg": !__props.placeholder && availableOptions.value.length === 1
|
|
1179
|
+
}
|
|
1180
|
+
]),
|
|
1181
|
+
onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
|
|
1182
|
+
}, [
|
|
1183
|
+
__props.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
1184
|
+
createElementVNode("input", {
|
|
1185
|
+
type: "checkbox",
|
|
1186
|
+
class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
|
|
1187
|
+
checked: optionIsSelected(option),
|
|
1188
|
+
disabled: __props.disabled,
|
|
1189
|
+
tabindex: "-1",
|
|
1190
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1191
|
+
}, ["stop"])),
|
|
1192
|
+
onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
|
|
1193
|
+
}, null, 40, _hoisted_3$b),
|
|
1194
|
+
createElementVNode("span", {
|
|
1195
|
+
style: normalizeStyle(darkTextStyle.value)
|
|
1196
|
+
}, toDisplayString(optionText(option)), 5)
|
|
1197
|
+
])) : (openBlock(), createElementBlock("span", {
|
|
1198
|
+
key: 1,
|
|
1199
|
+
style: normalizeStyle(darkTextStyle.value)
|
|
1200
|
+
}, toDisplayString(optionText(option)), 5))
|
|
1201
|
+
], 10, _hoisted_1$r);
|
|
1202
|
+
}), 128))
|
|
1203
|
+
], 2)
|
|
1179
1204
|
], 6)) : createCommentVNode("", true)
|
|
1180
1205
|
]))
|
|
1181
1206
|
]),
|
|
@@ -1238,39 +1263,39 @@ const _sfc_main$D = {
|
|
|
1238
1263
|
},
|
|
1239
1264
|
baseClass: {
|
|
1240
1265
|
type: [String, Array, Object],
|
|
1241
|
-
default: "block w-full rounded-lg border border-slate-300 bg-white px-4 py-3 text-sm text-slate-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
1266
|
+
default: "block w-full rounded-lg border border-slate-300 bg-white px-4 py-3 text-sm text-slate-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 dark:focus:border-neutral-100 dark:focus:ring-neutral-100/10"
|
|
1242
1267
|
},
|
|
1243
1268
|
normalTextClass: {
|
|
1244
1269
|
type: [String, Array, Object],
|
|
1245
|
-
default: "text-slate-900"
|
|
1270
|
+
default: "text-slate-900 dark:text-neutral-50"
|
|
1246
1271
|
},
|
|
1247
1272
|
deletedSelectedClass: {
|
|
1248
1273
|
type: [String, Array, Object],
|
|
1249
|
-
default: "text-red-600"
|
|
1274
|
+
default: "text-red-600 dark:text-neutral-100"
|
|
1250
1275
|
},
|
|
1251
1276
|
optionClass: {
|
|
1252
1277
|
type: [String, Array, Object],
|
|
1253
|
-
default: "text-slate-900"
|
|
1278
|
+
default: "text-slate-900 dark:text-neutral-50"
|
|
1254
1279
|
},
|
|
1255
1280
|
deletedOptionClass: {
|
|
1256
1281
|
type: [String, Array, Object],
|
|
1257
|
-
default: "text-rose-700"
|
|
1282
|
+
default: "text-rose-700 dark:text-neutral-100"
|
|
1258
1283
|
},
|
|
1259
1284
|
placeholderClass: {
|
|
1260
1285
|
type: [String, Array, Object],
|
|
1261
|
-
default: "text-slate-500"
|
|
1286
|
+
default: "text-slate-500 dark:text-neutral-200"
|
|
1262
1287
|
},
|
|
1263
1288
|
dropdownClass: {
|
|
1264
1289
|
type: [String, Array, Object],
|
|
1265
|
-
default: "bg-white
|
|
1290
|
+
default: "bg-white border border-slate-200 rounded-xl shadow-xl max-h-60 overflow-auto z-50 backdrop-blur-sm dark:bg-neutral-950 dark:border-neutral-800"
|
|
1266
1291
|
},
|
|
1267
1292
|
dropdownOptionClass: {
|
|
1268
1293
|
type: [String, Array, Object],
|
|
1269
|
-
default: "px-4 py-3 hover:bg-slate-100 cursor-pointer transition-colors"
|
|
1294
|
+
default: "px-4 py-3 hover:bg-slate-100 cursor-pointer transition-colors dark:hover:bg-neutral-900"
|
|
1270
1295
|
},
|
|
1271
1296
|
dropdownSelectedClass: {
|
|
1272
1297
|
type: [String, Array, Object],
|
|
1273
|
-
default: "bg-blue-50 text-blue-700 font-medium"
|
|
1298
|
+
default: "bg-blue-50 text-blue-700 font-medium dark:bg-neutral-900 dark:text-neutral-50"
|
|
1274
1299
|
}
|
|
1275
1300
|
},
|
|
1276
1301
|
emits: ["update:modelValue"],
|
|
@@ -4848,4 +4873,4 @@ export {
|
|
|
4848
4873
|
_sfc_main$z as y,
|
|
4849
4874
|
_sfc_main$x as z
|
|
4850
4875
|
};
|
|
4851
|
-
//# sourceMappingURL=plugin-
|
|
4876
|
+
//# sourceMappingURL=plugin-D5KJd0xy.js.map
|