adminforth 1.3.38 → 1.3.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.38",
3
+ "version": "1.3.40",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spa/src/App.vue CHANGED
@@ -313,16 +313,21 @@ function handleCustomLayout() {
313
313
  }
314
314
  }
315
315
 
316
+ function humanizeSnake(str: string): string {
317
+ if (!str) {
318
+ return '';
319
+ }
320
+ return str.split('_').map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
321
+ }
316
322
 
317
-
318
- watch(route, () => {
323
+ watch([route, () => coreStore.resourceById], async () => {
319
324
  handleCustomLayout()
320
- title.value = `${coreStore.config?.title || coreStore.config?.brandName || 'Adminforth'} | ${ Object.values(route.params)[0] || route.meta.title || ' '}`;
325
+ await new Promise((resolve) => setTimeout(resolve, 0));
326
+ const resourceTitle = coreStore.resourceById[route.params?.resourceId as string]?.label || humanizeSnake(Object.values(route.params)[0] as string);
327
+ title.value = `${coreStore.config?.title || coreStore.config?.brandName || 'Adminforth'} | ${ resourceTitle || route.meta.title || ' '}`;
321
328
  useHead({
322
329
  title: title.value,
323
330
  })
324
-
325
-
326
331
  });
327
332
 
328
333
  watch (()=>coreStore.menu, () => {
@@ -164,14 +164,17 @@
164
164
  <div class="tooltip-arrow" data-popper-arrow></div>
165
165
  </div>
166
166
 
167
- <component
168
- v-if="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons"
169
- :is="getCustomComponent(coreStore.resourceOptions?.pageInjections?.list?.customActionIcons)"
170
- :meta="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons.meta"
171
- :resource="coreStore.resource"
172
- :adminUser="coreStore.adminUser"
173
- :record="row"
174
- />
167
+
168
+ <template v-if="coreStore.resourceOptions?.pageInjections?.list?.customActionIcons">
169
+ <component
170
+ v-for="c in coreStore.resourceOptions?.pageInjections?.list?.customActionIcons"
171
+ :is="getCustomComponent(c)"
172
+ :meta="c.meta"
173
+ :resource="coreStore.resource"
174
+ :adminUser="coreStore.adminUser"
175
+ :record="row"
176
+ />
177
+ </template>
175
178
  </div>
176
179
  </td>
177
180
  </tr>
@@ -378,17 +381,19 @@ async function onClick(e,row) {
378
381
  if (window.getSelection().toString()) return;
379
382
  else {
380
383
  if (e.ctrlKey || e.metaKey) {
384
+
381
385
  if (row._clickUrl) {
382
386
  window.open(row._clickUrl, '_blank');
383
387
  } else {
384
- router.push(
388
+ window.open(
385
389
  router.resolve({
386
390
  name: 'resource-show',
387
391
  params: {
388
392
  resourceId: props.resource.resourceId,
389
393
  primaryKey: row._primaryKeyValue,
390
394
  },
391
- })
395
+ }).fullPath,
396
+ '_blank'
392
397
  );
393
398
  }
394
399
  } else {
@@ -37,7 +37,7 @@ import { useCoreStore } from '@/stores/core'
37
37
  const coreStore = useCoreStore()
38
38
 
39
39
  const props = defineProps<{
40
- threeDotsDropdownItems: any[]
40
+ threeDotsDropdownItems: any[] | undefined
41
41
  }>()
42
42
 
43
43
  </script>
@@ -25,3 +25,7 @@
25
25
  // }
26
26
  // }
27
27
 
28
+
29
+ *{
30
+ -moz-user-select: none;
31
+ }
@@ -183,6 +183,9 @@ async function getList() {
183
183
  return row;
184
184
  });
185
185
  totalRows.value = data.total;
186
+ await new Promise(resolve => setTimeout(resolve, 0));
187
+ initFlowbite(); // for tooltips in table
188
+
186
189
  }
187
190
 
188
191
  async function startBulkAction(actionId) {
@@ -1442,7 +1442,7 @@ export class Sorts {
1442
1442
  export interface IOperationalResource {
1443
1443
  get: (filter: IAdminForthFilter | IAdminForthFilter[]) => Promise<any | null>;
1444
1444
 
1445
- list: (filter: IAdminForthFilter | IAdminForthFilter[], limit: number, offset: number, sort: IAdminForthSort | IAdminForthSort[]) => Promise<any[]>;
1445
+ list: (filter: IAdminForthFilter | IAdminForthFilter[], limit?: number, offset?: number, sort?: IAdminForthSort | IAdminForthSort[]) => Promise<any[]>;
1446
1446
 
1447
1447
  count: (filter: IAdminForthFilter | IAdminForthFilter[] | undefined) => Promise<number>;
1448
1448