@fy-/fws-vue 2.3.86 → 2.3.88
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 +88 -18
- package/package.json +1 -1
|
@@ -99,6 +99,7 @@ const props = withDefaults(
|
|
|
99
99
|
selectedCountText?: string
|
|
100
100
|
// Save order support
|
|
101
101
|
saveOrderText?: string
|
|
102
|
+
reorderButtonText?: string
|
|
102
103
|
onSaveOrder?: Function
|
|
103
104
|
showSaveOrder?: boolean
|
|
104
105
|
getItemPosition?: Function
|
|
@@ -131,6 +132,7 @@ const props = withDefaults(
|
|
|
131
132
|
selectedCountText: 'selected',
|
|
132
133
|
// Save order defaults
|
|
133
134
|
saveOrderText: 'Save Order',
|
|
135
|
+
reorderButtonText: 'Reorder',
|
|
134
136
|
onSaveOrder: undefined,
|
|
135
137
|
showSaveOrder: false,
|
|
136
138
|
getItemPosition: (item: any, index: number) => item.UserIndex ?? index,
|
|
@@ -155,6 +157,22 @@ const localEditMode = computed({
|
|
|
155
157
|
set: value => emit('update:editMode', value),
|
|
156
158
|
})
|
|
157
159
|
|
|
160
|
+
// Reorder mode - separate from delete mode
|
|
161
|
+
const localReorderMode = ref(false)
|
|
162
|
+
|
|
163
|
+
function toggleReorderMode() {
|
|
164
|
+
localReorderMode.value = !localReorderMode.value
|
|
165
|
+
if (localReorderMode.value) {
|
|
166
|
+
// Exit delete mode when entering reorder mode
|
|
167
|
+
localEditMode.value = false
|
|
168
|
+
localSelectedItems.value = new Set()
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function exitReorderMode() {
|
|
173
|
+
localReorderMode.value = false
|
|
174
|
+
}
|
|
175
|
+
|
|
158
176
|
const localSelectedItems = computed({
|
|
159
177
|
get: () => props.selectedItems,
|
|
160
178
|
set: value => emit('update:selectedItems', value),
|
|
@@ -163,6 +181,10 @@ const localSelectedItems = computed({
|
|
|
163
181
|
// Edit mode functions
|
|
164
182
|
function toggleEditMode() {
|
|
165
183
|
localEditMode.value = !localEditMode.value
|
|
184
|
+
if (localEditMode.value) {
|
|
185
|
+
// Exit reorder mode when entering delete mode
|
|
186
|
+
localReorderMode.value = false
|
|
187
|
+
}
|
|
166
188
|
if (!localEditMode.value) {
|
|
167
189
|
// Clear selections when exiting edit mode
|
|
168
190
|
localSelectedItems.value = new Set()
|
|
@@ -906,14 +928,21 @@ onUnmounted(() => {
|
|
|
906
928
|
|
|
907
929
|
<!-- Edit Mode Controls (only if editEnabled is true) -->
|
|
908
930
|
<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">
|
|
931
|
+
<!-- Mode Toggle Buttons (only show when not in any edit mode) -->
|
|
932
|
+
<div v-if="!localEditMode && !localReorderMode" class="flex justify-end mb-3 gap-2">
|
|
911
933
|
<button
|
|
912
934
|
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
935
|
@click="toggleEditMode"
|
|
914
936
|
>
|
|
915
937
|
{{ editButtonText }}
|
|
916
938
|
</button>
|
|
939
|
+
<button
|
|
940
|
+
v-if="showSaveOrder"
|
|
941
|
+
class="px-4 py-2 rounded-lg font-medium text-sm transition-colors bg-blue-600 hover:bg-blue-700 text-white"
|
|
942
|
+
@click="toggleReorderMode"
|
|
943
|
+
>
|
|
944
|
+
{{ reorderButtonText }}
|
|
945
|
+
</button>
|
|
917
946
|
</div>
|
|
918
947
|
|
|
919
948
|
<!-- Bulk Actions Bar TOP (shown when in edit mode) -->
|
|
@@ -945,13 +974,6 @@ onUnmounted(() => {
|
|
|
945
974
|
>
|
|
946
975
|
{{ cancelButtonText }}
|
|
947
976
|
</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
977
|
<button
|
|
956
978
|
class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
|
|
957
979
|
:disabled="localSelectedItems.size === 0"
|
|
@@ -962,6 +984,33 @@ onUnmounted(() => {
|
|
|
962
984
|
</button>
|
|
963
985
|
</div>
|
|
964
986
|
</div>
|
|
987
|
+
|
|
988
|
+
<!-- Reorder Mode Bar TOP (shown when in reorder mode) -->
|
|
989
|
+
<div
|
|
990
|
+
v-if="localReorderMode"
|
|
991
|
+
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"
|
|
992
|
+
>
|
|
993
|
+
<div class="flex items-center gap-3">
|
|
994
|
+
<span class="text-sm font-medium text-blue-800 dark:text-blue-200">
|
|
995
|
+
Set position numbers on images (lower = earlier)
|
|
996
|
+
</span>
|
|
997
|
+
</div>
|
|
998
|
+
<div class="flex items-center gap-2">
|
|
999
|
+
<button
|
|
1000
|
+
class="px-4 py-1.5 text-sm bg-gray-600 hover:bg-gray-700 text-white rounded-md transition-colors font-medium"
|
|
1001
|
+
@click="exitReorderMode"
|
|
1002
|
+
>
|
|
1003
|
+
{{ cancelButtonText }}
|
|
1004
|
+
</button>
|
|
1005
|
+
<button
|
|
1006
|
+
v-if="onSaveOrder"
|
|
1007
|
+
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
1008
|
+
@click="onSaveOrder()"
|
|
1009
|
+
>
|
|
1010
|
+
{{ saveOrderText }}
|
|
1011
|
+
</button>
|
|
1012
|
+
</div>
|
|
1013
|
+
</div>
|
|
965
1014
|
</div>
|
|
966
1015
|
|
|
967
1016
|
<!-- Thumbnail Grid/Masonry/Custom Layouts if gallery is not open -->
|
|
@@ -1076,14 +1125,14 @@ onUnmounted(() => {
|
|
|
1076
1125
|
|
|
1077
1126
|
<!-- Position input for reorder mode -->
|
|
1078
1127
|
<div
|
|
1079
|
-
v-if="
|
|
1128
|
+
v-if="localReorderMode && onPositionChange"
|
|
1080
1129
|
class="absolute top-2 right-2 z-20"
|
|
1081
1130
|
>
|
|
1082
1131
|
<input
|
|
1083
1132
|
type="number"
|
|
1084
1133
|
min="0"
|
|
1085
1134
|
:value="getItemPosition(images[i - 1], i - 1)"
|
|
1086
|
-
class="w-
|
|
1135
|
+
class="w-20 h-8 text-base text-center rounded border-2 border-blue-400 bg-white/95 dark:bg-black/95 dark:text-white font-bold"
|
|
1087
1136
|
@change="(e: Event) => onPositionChange(images[i - 1], parseInt((e.target as HTMLInputElement).value))"
|
|
1088
1137
|
@click.stop
|
|
1089
1138
|
>
|
|
@@ -1152,13 +1201,6 @@ onUnmounted(() => {
|
|
|
1152
1201
|
>
|
|
1153
1202
|
{{ cancelButtonText }}
|
|
1154
1203
|
</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
1204
|
<button
|
|
1163
1205
|
class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
|
|
1164
1206
|
:disabled="localSelectedItems.size === 0"
|
|
@@ -1171,6 +1213,34 @@ onUnmounted(() => {
|
|
|
1171
1213
|
</div>
|
|
1172
1214
|
</div>
|
|
1173
1215
|
|
|
1216
|
+
<!-- Reorder Mode Bar BOTTOM -->
|
|
1217
|
+
<div v-if="editEnabled && localReorderMode && images.length > 0 && (mode === 'grid' || mode === 'mason' || mode === 'custom')" class="mt-3">
|
|
1218
|
+
<div
|
|
1219
|
+
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"
|
|
1220
|
+
>
|
|
1221
|
+
<div class="flex items-center gap-3">
|
|
1222
|
+
<span class="text-sm font-medium text-blue-800 dark:text-blue-200">
|
|
1223
|
+
Set position numbers on images (lower = earlier)
|
|
1224
|
+
</span>
|
|
1225
|
+
</div>
|
|
1226
|
+
<div class="flex items-center gap-2">
|
|
1227
|
+
<button
|
|
1228
|
+
class="px-4 py-1.5 text-sm bg-gray-600 hover:bg-gray-700 text-white rounded-md transition-colors font-medium"
|
|
1229
|
+
@click="exitReorderMode"
|
|
1230
|
+
>
|
|
1231
|
+
{{ cancelButtonText }}
|
|
1232
|
+
</button>
|
|
1233
|
+
<button
|
|
1234
|
+
v-if="onSaveOrder"
|
|
1235
|
+
class="px-4 py-1.5 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors font-medium"
|
|
1236
|
+
@click="onSaveOrder()"
|
|
1237
|
+
>
|
|
1238
|
+
{{ saveOrderText }}
|
|
1239
|
+
</button>
|
|
1240
|
+
</div>
|
|
1241
|
+
</div>
|
|
1242
|
+
</div>
|
|
1243
|
+
|
|
1174
1244
|
<!-- Button Mode -->
|
|
1175
1245
|
<button
|
|
1176
1246
|
v-if="mode === 'button'"
|