adminforth 2.4.0-next.317 → 2.4.0-next.319

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.
@@ -46,7 +46,7 @@
46
46
 
47
47
  <div
48
48
  v-else
49
- class="flex items-center justify-center py-1 flex-wrap gap-2 w-full gap-2 mt-1 mb-4 px-4"
49
+ class="flex items-center justify-center py-1 flex-wrap gap-2 w-full mt-1 mb-4 px-4"
50
50
  >
51
51
  <template v-for="(file, index) in selectedFiles" :key="index">
52
52
  <div
@@ -54,7 +54,12 @@
54
54
  flex items-center gap-1 px-2 py-1 group"
55
55
  >
56
56
  <IconFileSolid class="w-4 h-4 flex-shrink-0" />
57
- <span class="truncate max-w-[200px]">{{ file.name }}</span>
57
+ <span
58
+ class="truncate max-w-[200px]"
59
+ :title="file.name"
60
+ >
61
+ {{ shortenFileName(file.name) }}
62
+ </span>
58
63
  <span class="text-xs">({{ humanifySize(file.size) }})</span>
59
64
  <button
60
65
  type="button"
@@ -123,6 +128,19 @@ const selectedFiles: Ref<{
123
128
 
124
129
  const storedFiles: Ref<File[]> = ref([]);
125
130
 
131
+ function shortenFileName(name: string, maxLength = 24) {
132
+ if (name.length <= maxLength) return name;
133
+
134
+ const lastDotIndex = name.lastIndexOf('.');
135
+ const hasExtension = lastDotIndex > 0 && lastDotIndex < name.length - 1;
136
+ const extension = hasExtension ? name.slice(lastDotIndex + 1) : '';
137
+ const baseName = hasExtension ? name.slice(0, lastDotIndex) : name;
138
+
139
+ const startName = baseName.slice(0, 12);
140
+ const endName = baseName.split('').reverse().slice(0, 4).reverse().join('');
141
+ return hasExtension ? `${startName}...${endName}.${extension}` : `${startName}...${endName}`;
142
+ }
143
+
126
144
  watch(() => props.modelValue, (files) => {
127
145
  if (files && files.length > 0) {
128
146
  selectedFiles.value = Array.from(files).map(file => ({
@@ -110,15 +110,15 @@
110
110
  <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
111
111
  1
112
112
  </button>
113
- <div
114
- :contenteditable="!isLoading && !props.isLoading"
113
+ <input
114
+ type="text"
115
+ v-model="pageInput"
116
+ :style="{ width: `${Math.max(1, pageInput.length+4)}ch` }"
115
117
  class="min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightTablePaginationInputText border border-lightTablePaginationInputBorder bg-lightTablePaginationInputBackground dark:border-darkTablePaginationInputBorder dark:text-darkTablePaginationInputText dark:bg-darkTablePaginationInputBackground z-10"
116
118
  @keydown="onPageKeydown($event)"
117
- @input="onPageInput($event)"
118
119
  @blur="validatePageInput()"
119
120
  >
120
- {{ pageInput }}
121
- </div>
121
+ </input>
122
122
 
123
123
  <button
124
124
  class="flex items-center py-1 px-3 text-sm font-medium text-lightUnactivePaginationButtonText focus:outline-none bg-lightUnactivePaginationButtonBackground border-l-0 border border-lightUnactivePaginationButtonBorder hover:bg-lightUnactivePaginationButtonHoverBackground hover:text-lightUnactivePaginationButtonHoverText dark:bg-darkUnactivePaginationButtonBackground dark:text-darkUnactivePaginationButtonText dark:border-darkUnactivePaginationButtonBorder dark:hover:text-darkUnactivePaginationButtonHoverText dark:hover:bg-darkUnactivePaginationButtonHoverBackground disabled:opacity-50"
@@ -245,10 +245,6 @@
245
245
  'sort-change',
246
246
  'clickTableRow'
247
247
  ]);
248
-
249
- function onPageInput(event: any) {
250
- pageInput.value = event.target.innerText;
251
- }
252
248
 
253
249
  function validatePageInput() {
254
250
  const newPage = parseInt(pageInput.value) || 1;
@@ -241,15 +241,14 @@
241
241
  <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
242
242
  1
243
243
  </button>
244
- <div
245
- contenteditable="true"
246
- class="af-pagination-input min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
244
+ <input
245
+ type="text"
246
+ v-model="pageInput"
247
+ :style="{ width: `${Math.max(1, pageInput.length+4)}ch` }"
248
+ class="af-pagination-input min-w-10 outline-none inline-block py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
247
249
  @keydown="onPageKeydown($event)"
248
- @input="onPageInput($event)"
249
250
  @blur="validatePageInput()"
250
- >
251
- {{ pageInput }}
252
- </div>
251
+ />
253
252
 
254
253
  <button
255
254
  class="af-pagination-last-page-button flex items-center py-1 px-3 text-sm font-medium text-lightListTablePaginationText focus:outline-none bg-lightListTablePaginationBackgoround border-l-0 border border-lightListTablePaginationBorder hover:bg-lightListTablePaginationBackgoroundHover hover:text-lightListTablePaginationTextHover focus:z-10 focus:ring-4 focus:ring-lightListTablePaginationFocusRing dark:focus:ring-darkListTablePaginationFocusRing dark:bg-darkListTablePaginationBackgoround dark:text-darkListTablePaginationText dark:border-darkListTablePaginationBorder dark:hover:text-white dark:hover:bg-darkListTablePaginationBackgoroundHover disabled:opacity-50"
@@ -599,10 +598,6 @@ async function startCustomAction(actionId: string, row: any) {
599
598
  }
600
599
  }
601
600
 
602
- function onPageInput(event: any) {
603
- pageInput.value = event.target.innerText;
604
- }
605
-
606
601
  function validatePageInput() {
607
602
  const newPage = parseInt(pageInput.value) || 1;
608
603
  const validPage = Math.max(1, Math.min(newPage, totalPages.value));
@@ -262,15 +262,15 @@
262
262
  <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
263
263
  1
264
264
  </button>
265
- <div
266
- contenteditable="true"
265
+ <input
266
+ type="text"
267
+ v-model="pageInput"
268
+ :style="{ width: `${Math.max(1, pageInput.length+4)}ch` }"
267
269
  class="af-pagination-input min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
268
270
  @keydown="onPageKeydown($event)"
269
- @input="onPageInput($event)"
270
271
  @blur="validatePageInput()"
271
272
  >
272
- {{ pageInput }}
273
- </div>
273
+ </input>
274
274
 
275
275
  <button
276
276
  class="af-pagination-last-page-button flex items-center py-1 px-3 text-sm font-medium text-lightListTablePaginationText focus:outline-none bg-lightListTablePaginationBackgoround border-l-0 border border-lightListTablePaginationBorder hover:bg-lightListTablePaginationBackgoroundHover hover:text-lightListTablePaginationTextHover focus:z-10 focus:ring-4 focus:ring-lightListTablePaginationFocusRing dark:focus:ring-darkListTablePaginationFocusRing dark:bg-darkListTablePaginationBackgoround dark:text-darkListTablePaginationText dark:border-darkListTablePaginationBorder dark:hover:text-white dark:hover:bg-darkListTablePaginationBackgoroundHover disabled:opacity-50"
@@ -623,9 +623,6 @@ async function startCustomAction(actionId: string, row: any) {
623
623
  }
624
624
  }
625
625
 
626
- function onPageInput(event: any) {
627
- pageInput.value = event.target.innerText;
628
- }
629
626
 
630
627
  function validatePageInput() {
631
628
  const newPage = parseInt(pageInput.value) || 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.317",
3
+ "version": "2.4.0-next.319",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",