adminforth 1.15.0-next.4 → 1.15.0-next.5

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.
@@ -227,7 +227,8 @@
227
227
  contenteditable="true"
228
228
  class="min-w-10 outline-none inline-block w-auto min-w-10 py-1.5 px-3 text-sm text-center text-gray-700 border border-gray-300 dark:border-gray-700 dark:text-gray-400 dark:bg-gray-800 z-10"
229
229
  @keydown="onPageKeydown($event)"
230
- @input="page = parseInt($event.target.innerText) || ''"
230
+ @input="onPageInput($event)"
231
+ @blur="validatePageInput()"
231
232
  >
232
233
  {{ pageInput }}
233
234
  </div>
@@ -355,6 +356,10 @@ async function onPageKeydown(event) {
355
356
  (!['Backspace', 'ArrowRight', 'ArrowLeft'].includes(event.code)
356
357
  && isNaN(String.fromCharCode(event.keyCode)))) {
357
358
  event.preventDefault();
359
+ if (event.code === 'Enter') {
360
+ validatePageInput();
361
+ event.target.blur();
362
+ }
358
363
  }
359
364
  }
360
365
 
@@ -575,6 +580,16 @@ async function startCustomAction(actionId, row) {
575
580
  }
576
581
  }
577
582
 
583
+ function onPageInput(event) {
584
+ pageInput.value = event.target.innerText;
585
+ }
586
+
587
+ function validatePageInput() {
588
+ const newPage = parseInt(pageInput.value) || 1;
589
+ const validPage = Math.max(1, Math.min(newPage, totalPages.value));
590
+ page.value = validPage;
591
+ pageInput.value = validPage.toString();
592
+ }
578
593
 
579
594
  </script>
580
595
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.15.0-next.4",
3
+ "version": "1.15.0-next.5",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",