adminforth 2.22.0-next.3 → 2.22.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.
@@ -22,7 +22,7 @@
22
22
  class="bg-lightForm dark:bg-darkForm dark:border-darkFormBorder block md:table-row"
23
23
  :class="{ 'border-b': i !== group.columns.length - 1}"
24
24
  >
25
- <td class="px-6 py-4 flex items-center block md:table-cell pb-0 md:pb-4"
25
+ <td class="px-6 py-4 flex items-center block pb-0 md:pb-4"
26
26
  :class="{'rounded-bl-lg border-b-none': i === group.columns.length - 1}"> <!--align-top-->
27
27
  <span class="flex items-center gap-1">
28
28
  {{ column.label }}
@@ -32,7 +32,7 @@
32
32
  :record="coreStore.record"
33
33
  />
34
34
  <template v-else-if="checkShowIf(column, record, resource?.columns || [])">
35
- <td class="px-6 py-4 relative block md:table-cell font-bold md:font-normal pb-0 md:pb-4">
35
+ <td class="px-6 py-4 relative block flex justify-start font-bold md:font-normal pb-0 md:pb-4">
36
36
  {{ column.label }}
37
37
  </td>
38
38
  <td class="px-6 py-4 whitespace-pre-wrap" :data-af-column="column.name">
@@ -529,20 +529,22 @@ export function compareOldAndNewRecord(oldRecord: Record<string, any>, newRecord
529
529
  const coreStore = useCoreStore();
530
530
 
531
531
  for (const key of newKeys) {
532
- if (oldRecord[key] !== newRecord[key]) {
532
+ const oldValue = typeof oldRecord[key] === 'object' && oldRecord[key] !== null ? JSON.stringify(oldRecord[key]) : oldRecord[key];
533
+ const newValue = typeof newRecord[key] === 'object' && newRecord[key] !== null ? JSON.stringify(newRecord[key]) : newRecord[key];
534
+ if (oldValue !== newValue) {
533
535
  if (
534
536
  (
535
- oldRecord[key] === undefined ||
536
- oldRecord[key] === null ||
537
- oldRecord[key] === '' ||
538
- (Array.isArray(oldRecord[key]) && oldRecord[key].length === 0)
537
+ oldValue === undefined ||
538
+ oldValue === null ||
539
+ oldValue === '' ||
540
+ (Array.isArray(oldValue) && oldValue.length === 0)
539
541
  )
540
542
  &&
541
543
  (
542
- newRecord[key] === undefined ||
543
- newRecord[key] === null ||
544
- newRecord[key] === '' ||
545
- (Array.isArray(newRecord[key]) && newRecord[key].length === 0)
544
+ newValue === undefined ||
545
+ newValue === null ||
546
+ newValue === '' ||
547
+ (Array.isArray(newValue) && newValue.length === 0)
546
548
  )
547
549
  ) {
548
550
  // console.log(`Value for key ${key} is considered equal (empty)`)
@@ -556,7 +558,7 @@ export function compareOldAndNewRecord(oldRecord: Record<string, any>, newRecord
556
558
  continue;
557
559
  }
558
560
  }
559
- // console.log(`Value for key ${key} is different`, { oldValue: oldRecord[key], newValue: newRecord[key] });
561
+ // console.log(`Value for key ${key} is different`, { oldValue: oldValue, newValue: newValue });
560
562
  return false;
561
563
  }
562
564
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.22.0-next.3",
3
+ "version": "2.22.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",