adminforth 1.3.12 → 1.3.13

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.12",
3
+ "version": "1.3.13",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -70,7 +70,7 @@
70
70
  </td>
71
71
  </tr>
72
72
 
73
- <tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
73
+ <tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="`row_${row._primaryKeyValue}`"
74
74
  class="bg-lightListTable dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover cursor-pointer"
75
75
  :class="{'border-b': rowI !== rows.length - 1}"
76
76
  >
@@ -80,8 +80,8 @@
80
80
  @click="(e)=>{e.stopPropagation()}"
81
81
  id="checkbox-table-search-1"
82
82
  type="checkbox"
83
- :checked="checkboxesInternal.includes(row.id)"
84
- @change="(e)=>{addToCheckedValues(row.id)}"
83
+ :checked="checkboxesInternal.includes(row._primaryKeyValue)"
84
+ @change="(e)=>{addToCheckedValues(row._primaryKeyValue)}"
85
85
  class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 cursor-pointer">
86
86
  <label for="checkbox-table-search-1" class="sr-only">checkbox</label>
87
87
  </div>
@@ -299,6 +299,7 @@ watch(() => props.sort, (newSort) => {
299
299
  });
300
300
 
301
301
  function addToCheckedValues(id) {
302
+ console.log('checking', checkboxesInternal.value, 'id', id)
302
303
  if (checkboxesInternal.value.includes(id)) {
303
304
  checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== id);
304
305
  } else {
@@ -312,13 +313,13 @@ const columnsListed = computed(() => props.resource?.columns?.filter(c => c.show
312
313
  async function selectAll(value) {
313
314
  if (!allFromThisPageChecked.value) {
314
315
  props.rows.forEach((r) => {
315
- if (!checkboxesInternal.value.includes(r.id)) {
316
- checkboxesInternal.value.push(r.id)
316
+ if (!checkboxesInternal.value.includes(r._primaryKeyValue)) {
317
+ checkboxesInternal.value.push(r._primaryKeyValue)
317
318
  }
318
319
  });
319
320
  } else {
320
321
  props.rows.forEach((r) => {
321
- checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== r.id);
322
+ checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== r._primaryKeyValue);
322
323
  });
323
324
  }
324
325
  checkboxesInternal.value = [ ...checkboxesInternal.value ];
@@ -328,7 +329,7 @@ const totalPages = computed(() => Math.ceil(props.totalRows / props.pageSize));
328
329
 
329
330
  const allFromThisPageChecked = computed(() => {
330
331
  if (!props.rows) return false;
331
- return props.rows.every((r) => checkboxesInternal.value.includes(r.id));
332
+ return props.rows.every((r) => checkboxesInternal.value.includes(r._primaryKeyValue));
332
333
  });
333
334
  const ascArr = computed(() => sort.value.filter((s) => s.direction === 'asc').map((s) => s.field));
334
335
  const descArr = computed(() => sort.value.filter((s) => s.direction === 'desc').map((s) => s.field));
@@ -226,7 +226,7 @@ export interface IAdminForthDataSourceConnectorBase extends IAdminForthDataSourc
226
226
  resource: AdminForthResource,
227
227
  record: any
228
228
  adminUser: AdminUser
229
- }): Promise<void>;
229
+ }): Promise<any>;
230
230
 
231
231
  getMinMaxForColumns({ resource, columns }: { resource: AdminForthResource, columns: AdminForthResourceColumn[] }): Promise<{ [key: string]: { min: any, max: any } }>;
232
232
  }