@fy-/fws-vue 2.3.86 → 2.3.87
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/components/ui/DefaultGallery.vue +86 -18
- package/package.json +1 -1
|
@@ -155,6 +155,22 @@ const localEditMode = computed({
|
|
|
155
155
|
set: value => emit('update:editMode', value),
|
|
156
156
|
})
|
|
157
157
|
|
|
158
|
+
// Reorder mode - separate from delete mode
|
|
159
|
+
const localReorderMode = ref(false)
|
|
160
|
+
|
|
161
|
+
function toggleReorderMode() {
|
|
162
|
+
localReorderMode.value = !localReorderMode.value
|
|
163
|
+
if (localReorderMode.value) {
|
|
164
|
+
// Exit delete mode when entering reorder mode
|
|
165
|
+
localEditMode.value = false
|
|
166
|
+
localSelectedItems.value = new Set()
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function exitReorderMode() {
|
|
171
|
+
localReorderMode.value = false
|
|
172
|
+
}
|
|
173
|
+
|
|
158
174
|
const localSelectedItems = computed({
|
|
159
175
|
get: () => props.selectedItems,
|
|
160
176
|
set: value => emit('update:selectedItems', value),
|
|
@@ -163,6 +179,10 @@ const localSelectedItems = computed({
|
|
|
163
179
|
// Edit mode functions
|
|
164
180
|
function toggleEditMode() {
|
|
165
181
|
localEditMode.value = !localEditMode.value
|
|
182
|
+
if (localEditMode.value) {
|
|
183
|
+
// Exit reorder mode when entering delete mode
|
|
184
|
+
localReorderMode.value = false
|
|
185
|
+
}
|
|
166
186
|
if (!localEditMode.value) {
|
|
167
187
|
// Clear selections when exiting edit mode
|
|
168
188
|
localSelectedItems.value = new Set()
|
|
@@ -906,14 +926,21 @@ onUnmounted(() => {
|
|
|
906
926
|
|
|
907
927
|
<!-- Edit Mode Controls (only if editEnabled is true) -->
|
|
908
928
|
<div v-if="editEnabled && images.length > 0 && (mode === 'grid' || mode === 'mason' || mode === 'custom')">
|
|
909
|
-
<!--
|
|
910
|
-
<div v-if="!localEditMode" class="flex justify-end mb-3">
|
|
929
|
+
<!-- Mode Toggle Buttons (only show when not in any edit mode) -->
|
|
930
|
+
<div v-if="!localEditMode && !localReorderMode" class="flex justify-end mb-3 gap-2">
|
|
911
931
|
<button
|
|
912
932
|
class="px-4 py-2 rounded-lg font-medium text-sm transition-colors bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-800 dark:text-gray-200"
|
|
913
933
|
@click="toggleEditMode"
|
|
914
934
|
>
|
|
915
935
|
{{ editButtonText }}
|
|
916
936
|
</button>
|
|
937
|
+
<button
|
|
938
|
+
v-if="showSaveOrder"
|
|
939
|
+
class="px-4 py-2 rounded-lg font-medium text-sm transition-colors bg-blue-600 hover:bg-blue-700 text-white"
|
|
940
|
+
@click="toggleReorderMode"
|
|
941
|
+
>
|
|
942
|
+
{{ saveOrderText }}
|
|
943
|
+
</button>
|
|
917
944
|
</div>
|
|
918
945
|
|
|
919
946
|
<!-- Bulk Actions Bar TOP (shown when in edit mode) -->
|
|
@@ -945,13 +972,6 @@ onUnmounted(() => {
|
|
|
945
972
|
>
|
|
946
973
|
{{ cancelButtonText }}
|
|
947
974
|
</button>
|
|
948
|
-
<button
|
|
949
|
-
v-if="showSaveOrder && onSaveOrder"
|
|
950
|
-
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
951
|
-
@click="onSaveOrder()"
|
|
952
|
-
>
|
|
953
|
-
{{ saveOrderText }}
|
|
954
|
-
</button>
|
|
955
975
|
<button
|
|
956
976
|
class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
|
|
957
977
|
:disabled="localSelectedItems.size === 0"
|
|
@@ -962,6 +982,33 @@ onUnmounted(() => {
|
|
|
962
982
|
</button>
|
|
963
983
|
</div>
|
|
964
984
|
</div>
|
|
985
|
+
|
|
986
|
+
<!-- Reorder Mode Bar TOP (shown when in reorder mode) -->
|
|
987
|
+
<div
|
|
988
|
+
v-if="localReorderMode"
|
|
989
|
+
class="flex flex-wrap items-center justify-between gap-2 p-3 mb-3 bg-blue-50 dark:bg-blue-900/30 rounded-lg border border-blue-300 dark:border-blue-700"
|
|
990
|
+
>
|
|
991
|
+
<div class="flex items-center gap-3">
|
|
992
|
+
<span class="text-sm font-medium text-blue-800 dark:text-blue-200">
|
|
993
|
+
Set position numbers on images (lower = earlier)
|
|
994
|
+
</span>
|
|
995
|
+
</div>
|
|
996
|
+
<div class="flex items-center gap-2">
|
|
997
|
+
<button
|
|
998
|
+
class="px-4 py-1.5 text-sm bg-gray-600 hover:bg-gray-700 text-white rounded-md transition-colors font-medium"
|
|
999
|
+
@click="exitReorderMode"
|
|
1000
|
+
>
|
|
1001
|
+
{{ cancelButtonText }}
|
|
1002
|
+
</button>
|
|
1003
|
+
<button
|
|
1004
|
+
v-if="onSaveOrder"
|
|
1005
|
+
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
1006
|
+
@click="onSaveOrder()"
|
|
1007
|
+
>
|
|
1008
|
+
{{ saveOrderText }}
|
|
1009
|
+
</button>
|
|
1010
|
+
</div>
|
|
1011
|
+
</div>
|
|
965
1012
|
</div>
|
|
966
1013
|
|
|
967
1014
|
<!-- Thumbnail Grid/Masonry/Custom Layouts if gallery is not open -->
|
|
@@ -1076,14 +1123,14 @@ onUnmounted(() => {
|
|
|
1076
1123
|
|
|
1077
1124
|
<!-- Position input for reorder mode -->
|
|
1078
1125
|
<div
|
|
1079
|
-
v-if="
|
|
1126
|
+
v-if="localReorderMode && onPositionChange"
|
|
1080
1127
|
class="absolute top-2 right-2 z-20"
|
|
1081
1128
|
>
|
|
1082
1129
|
<input
|
|
1083
1130
|
type="number"
|
|
1084
1131
|
min="0"
|
|
1085
1132
|
:value="getItemPosition(images[i - 1], i - 1)"
|
|
1086
|
-
class="w-
|
|
1133
|
+
class="w-16 h-7 text-sm text-center rounded border border-blue-400 bg-white/95 dark:bg-black/95 dark:text-white font-medium"
|
|
1087
1134
|
@change="(e: Event) => onPositionChange(images[i - 1], parseInt((e.target as HTMLInputElement).value))"
|
|
1088
1135
|
@click.stop
|
|
1089
1136
|
>
|
|
@@ -1152,13 +1199,6 @@ onUnmounted(() => {
|
|
|
1152
1199
|
>
|
|
1153
1200
|
{{ cancelButtonText }}
|
|
1154
1201
|
</button>
|
|
1155
|
-
<button
|
|
1156
|
-
v-if="showSaveOrder && onSaveOrder"
|
|
1157
|
-
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
1158
|
-
@click="onSaveOrder()"
|
|
1159
|
-
>
|
|
1160
|
-
{{ saveOrderText }}
|
|
1161
|
-
</button>
|
|
1162
1202
|
<button
|
|
1163
1203
|
class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
|
|
1164
1204
|
:disabled="localSelectedItems.size === 0"
|
|
@@ -1171,6 +1211,34 @@ onUnmounted(() => {
|
|
|
1171
1211
|
</div>
|
|
1172
1212
|
</div>
|
|
1173
1213
|
|
|
1214
|
+
<!-- Reorder Mode Bar BOTTOM -->
|
|
1215
|
+
<div v-if="editEnabled && localReorderMode && images.length > 0 && (mode === 'grid' || mode === 'mason' || mode === 'custom')" class="mt-3">
|
|
1216
|
+
<div
|
|
1217
|
+
class="flex flex-wrap items-center justify-between gap-2 p-3 bg-blue-50 dark:bg-blue-900/30 rounded-lg border border-blue-300 dark:border-blue-700"
|
|
1218
|
+
>
|
|
1219
|
+
<div class="flex items-center gap-3">
|
|
1220
|
+
<span class="text-sm font-medium text-blue-800 dark:text-blue-200">
|
|
1221
|
+
Set position numbers on images (lower = earlier)
|
|
1222
|
+
</span>
|
|
1223
|
+
</div>
|
|
1224
|
+
<div class="flex items-center gap-2">
|
|
1225
|
+
<button
|
|
1226
|
+
class="px-4 py-1.5 text-sm bg-gray-600 hover:bg-gray-700 text-white rounded-md transition-colors font-medium"
|
|
1227
|
+
@click="exitReorderMode"
|
|
1228
|
+
>
|
|
1229
|
+
{{ cancelButtonText }}
|
|
1230
|
+
</button>
|
|
1231
|
+
<button
|
|
1232
|
+
v-if="onSaveOrder"
|
|
1233
|
+
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
1234
|
+
@click="onSaveOrder()"
|
|
1235
|
+
>
|
|
1236
|
+
{{ saveOrderText }}
|
|
1237
|
+
</button>
|
|
1238
|
+
</div>
|
|
1239
|
+
</div>
|
|
1240
|
+
</div>
|
|
1241
|
+
|
|
1174
1242
|
<!-- Button Mode -->
|
|
1175
1243
|
<button
|
|
1176
1244
|
v-if="mode === 'button'"
|