adminforth 2.4.0-next.290 → 2.4.0-next.292

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.
@@ -52,7 +52,7 @@
52
52
  <label v-if="!$slots.item" :for="item.value">{{ item.label }}</label>
53
53
  </div>
54
54
  <div v-if="!filteredItems.length" class="px-4 py-2 cursor-pointer text-lightDropdownOptionsText dark:text-darkDropdownOptionsText">
55
- {{ options?.length ? $t('No results found') : $t('No items here') }}
55
+ {{ $t('No results found') }}
56
56
  </div>
57
57
 
58
58
  <div v-if="$slots['extra-item']" class="px-4 py-2 dark:text-gray-400">
@@ -148,6 +148,10 @@ const props = defineProps({
148
148
  type: Boolean,
149
149
  default: false,
150
150
  },
151
+ searchDebounceMs: {
152
+ type: Number,
153
+ default: 300,
154
+ },
151
155
  });
152
156
 
153
157
  const emit = defineEmits(['update:modelValue', 'scroll-near-end', 'search']);
@@ -165,6 +169,7 @@ const dropdownStyle = ref<{ top?: string; }>({
165
169
 
166
170
  const selectedItems: Ref<any[]> = ref([]);
167
171
  const internalSelect = ref<HTMLElement | null>(null);
172
+ let searchDebounceHandle: ReturnType<typeof setTimeout> | null = null;
168
173
 
169
174
  function inputInput() {
170
175
  if (!props.multiple && selectedItems.value.length) {
@@ -172,7 +177,12 @@ function inputInput() {
172
177
  emit('update:modelValue', null);
173
178
  }
174
179
  if (!props.searchDisabled) {
175
- emit('search', search.value);
180
+ if (searchDebounceHandle) {
181
+ clearTimeout(searchDebounceHandle);
182
+ }
183
+ searchDebounceHandle = setTimeout(() => {
184
+ emit('search', search.value);
185
+ }, props.searchDebounceMs);
176
186
  }
177
187
  }
178
188
 
@@ -329,6 +339,10 @@ onUnmounted(() => {
329
339
  if (props.teleportToBody) {
330
340
  window.removeEventListener('scroll', handleScroll, true);
331
341
  }
342
+ if (searchDebounceHandle) {
343
+ clearTimeout(searchDebounceHandle);
344
+ searchDebounceHandle = null;
345
+ }
332
346
  });
333
347
 
334
348
  const getDropdownPosition = computed(() => {
@@ -17,7 +17,7 @@
17
17
  <Select
18
18
  v-else-if="column.foreignResource"
19
19
  ref="input"
20
- :key="`${column.name}-${(columnOptions[column.name] || []).length}`"
20
+ :key="`select-${column.name}-${source}-${column.foreignResource?.name || column.foreignResource?.table || ''}`"
21
21
  class="w-full min-w-24"
22
22
  :options="columnOptions[column.name] || []"
23
23
  :searchDisabled="!column.foreignResource.searchableFields"
@@ -5,17 +5,17 @@
5
5
  :class="toast.variant == 'info' ? 'border-lightPrimary dark:border-darkPrimary' : toast.variant == 'danger' ? 'border-red-500 dark:border-red-800' : toast.variant == 'warning' ? 'border-orange-500 dark:border-orange-700' : 'border-green-500 dark:border-green-800'"
6
6
  role="alert"
7
7
  >
8
- <div v-if="toast.variant == 'info'" class=" inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-lightPrimary dark:text-darkPrimary bg-lightPrimaryOpacity rounded-lg dark:bg-darkPrimary dark:!text-blue-100">
8
+ <div v-if="toast.variant == 'info'" class="af-toast-icon inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-lightPrimary dark:text-darkPrimary bg-lightPrimaryOpacity rounded-lg dark:bg-darkPrimary dark:!text-blue-100">
9
9
  <IconInfoCircleSolid class="w-5 h-5" aria-hidden="true" />
10
10
  </div>
11
- <div v-else-if="toast.variant == 'danger'" class="inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200">
11
+ <div v-else-if="toast.variant == 'danger'" class="af-toast-icon inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200">
12
12
  <IconCloseCircleSolid class="w-5 h-5" aria-hidden="true" />
13
13
  </div>
14
- <div v-else-if="toast.variant == 'warning'"class="inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-orange-500 bg-orange-100 rounded-lg dark:bg-orange-700 dark:text-orange-200">
14
+ <div v-else-if="toast.variant == 'warning'" class="af-toast-icon inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-orange-500 bg-orange-100 rounded-lg dark:bg-orange-700 dark:text-orange-200">
15
15
  <IconExclamationCircleSolid class="w-5 h-5" aria-hidden="true" />
16
16
 
17
17
  </div>
18
- <div v-else class="inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200">
18
+ <div v-else class="af-toast-icon inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200">
19
19
  <IconCheckCircleSolid class="w-5 h-5" aria-hidden="true" />
20
20
  </div>
21
21
 
@@ -24,7 +24,7 @@
24
24
  <div class="flex flex-col items-center justify-center">
25
25
  {{toast.message}}
26
26
  <div v-if="toast.buttons" class="flex justify-center mt-2 gap-2">
27
- <div v-for="button in toast.buttons" class="rounded-md bg-lightButtonsBackground hover:bg-lightButtonsHover text-lightButtonsText dark:bg-darkPrimary dark:hover:bg-darkButtonsBackground dark:text-darkButtonsText">
27
+ <div v-for="button in toast.buttons" class="af-toast-button rounded-md bg-lightButtonsBackground hover:bg-lightButtonsHover text-lightButtonsText dark:bg-darkPrimary dark:hover:bg-darkButtonsBackground dark:text-darkButtonsText">
28
28
  <button @click="onButtonClick(button.value)" class="px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/10">
29
29
  {{ button.label }}
30
30
  </button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.290",
3
+ "version": "2.4.0-next.292",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",