@fy-/fws-vue 2.3.84 → 2.3.86

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.
@@ -97,6 +97,12 @@ const props = withDefaults(
97
97
  selectAllText?: string
98
98
  clearSelectionText?: string
99
99
  selectedCountText?: string
100
+ // Save order support
101
+ saveOrderText?: string
102
+ onSaveOrder?: Function
103
+ showSaveOrder?: boolean
104
+ getItemPosition?: Function
105
+ onPositionChange?: Function
100
106
  }>(),
101
107
  {
102
108
  modelValue: 0,
@@ -123,6 +129,12 @@ const props = withDefaults(
123
129
  selectAllText: 'Select All',
124
130
  clearSelectionText: 'Clear',
125
131
  selectedCountText: 'selected',
132
+ // Save order defaults
133
+ saveOrderText: 'Save Order',
134
+ onSaveOrder: undefined,
135
+ showSaveOrder: false,
136
+ getItemPosition: (item: any, index: number) => item.UserIndex ?? index,
137
+ onPositionChange: undefined,
126
138
  },
127
139
  )
128
140
 
@@ -933,6 +945,13 @@ onUnmounted(() => {
933
945
  >
934
946
  {{ cancelButtonText }}
935
947
  </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>
936
955
  <button
937
956
  class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
938
957
  :disabled="localSelectedItems.size === 0"
@@ -1055,6 +1074,21 @@ onUnmounted(() => {
1055
1074
  </div>
1056
1075
  </div>
1057
1076
 
1077
+ <!-- Position input for reorder mode -->
1078
+ <div
1079
+ v-if="showSaveOrder && onPositionChange"
1080
+ class="absolute top-2 right-2 z-20"
1081
+ >
1082
+ <input
1083
+ type="number"
1084
+ min="0"
1085
+ :value="getItemPosition(images[i - 1], i - 1)"
1086
+ class="w-12 h-6 text-xs text-center rounded border border-gray-400 bg-white/90 dark:bg-black/90 dark:text-white"
1087
+ @change="(e: Event) => onPositionChange(images[i - 1], parseInt((e.target as HTMLInputElement).value))"
1088
+ @click.stop
1089
+ >
1090
+ </div>
1091
+
1058
1092
  <!-- Selection overlay -->
1059
1093
  <div
1060
1094
  v-if="localEditMode && isItemSelected(images[i - 1], i - 1)"
@@ -1118,6 +1152,13 @@ onUnmounted(() => {
1118
1152
  >
1119
1153
  {{ cancelButtonText }}
1120
1154
  </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>
1121
1162
  <button
1122
1163
  class="px-4 py-1.5 text-sm bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors font-medium"
1123
1164
  :disabled="localSelectedItems.size === 0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.3.84",
3
+ "version": "2.3.86",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/fy-to/FWJS#readme",