adminforth 3.12.4 → 3.13.0

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="inline-flex items-center gap-1">
3
- <Tooltip>
3
+ <Tooltip v-if="tooltipText">
4
4
  <div
5
5
  class="overflow-hidden max-h-[20px] rounded-default"
6
6
  :class="{ 'shrink-0 w-[90px]': compact }"
@@ -21,10 +21,39 @@
21
21
  <span class="whitespace-nowrap">{{ tooltipText }}</span>
22
22
  </template>
23
23
  </Tooltip>
24
+ <div
25
+ v-else
26
+ class="overflow-hidden max-h-[20px] rounded-default"
27
+ :class="{ 'shrink-0 w-[90px]': compact }"
28
+ @click="toggle"
29
+ >
30
+ <span
31
+ class="cursor-pointer select-none transition-all duration-200 text-lightListTableText dark:text-darkListTableText"
32
+ :class="{
33
+ 'block truncate': compact,
34
+ 'blur-[7px] hover:blur-[5px] brightness-50 dark:brightness-150': !show,
35
+ }"
36
+ >
37
+ <template v-if="compact">{{ visualValue }}</template>
38
+ <ValueRenderer v-else :column="column" :record="record" />
39
+ </span>
40
+ </div>
41
+
42
+ <span v-if="eyeButton" class="shrink-0 w-5 h-5">
43
+ <IconEyeSolid
44
+ v-if="!show"
45
+ @click.stop="toggle"
46
+ class="w-5 h-5 cursor-pointer text-lightPrimary dark:text-darkPrimary"
47
+ />
48
+ <IconEyeSlashSolid
49
+ v-else
50
+ @click.stop="toggle"
51
+ class="w-5 h-5 cursor-pointer text-lightPrimary dark:text-darkPrimary"
52
+ />
53
+ </span>
24
54
 
25
55
  <span v-if="showCopy && rawValue" class="shrink-0 w-5 h-5">
26
56
  <IconFileCopyAltSolid
27
- v-if="show"
28
57
  @click.stop="copyToCB"
29
58
  class="w-5 h-5 cursor-pointer text-lightPrimary dark:text-darkPrimary"
30
59
  />
@@ -35,7 +64,7 @@
35
64
  <script setup lang="ts">
36
65
  import { ref, computed } from 'vue';
37
66
  import { useI18n } from 'vue-i18n';
38
- import { IconFileCopyAltSolid } from '@iconify-prerendered/vue-flowbite';
67
+ import { IconFileCopyAltSolid, IconEyeSolid, IconEyeSlashSolid } from '@iconify-prerendered/vue-flowbite';
39
68
  import ValueRenderer from '@/components/ValueRenderer.vue';
40
69
  import Tooltip from '@/afcl/Tooltip.vue';
41
70
  import { useAdminforth } from '@/adminforth';
@@ -44,7 +73,7 @@ import type { AdminForthResourceColumnCommon, AdminForthResourceCommon, AdminUse
44
73
  const props = defineProps<{
45
74
  column: AdminForthResourceColumnCommon;
46
75
  record: any;
47
- meta: { compact?: boolean; copy?: boolean } | any;
76
+ meta: { compact?: boolean; copy?: boolean; eyeButton?: boolean } | any;
48
77
  resource: AdminForthResourceCommon;
49
78
  adminUser: AdminUser;
50
79
  }>();
@@ -57,7 +86,8 @@ const show = ref(false);
57
86
  const rawValue = computed(() => props.record[props.column.name]);
58
87
 
59
88
  const compact = computed(() => props.meta?.compact);
60
- const showCopy = computed(() => compact.value && props.meta?.copy);
89
+ const showCopy = computed(() => props.meta?.copy);
90
+ const eyeButton = computed(() => props.meta?.eyeButton);
61
91
  const visualValue = computed(() => {
62
92
  const val = rawValue.value;
63
93
  if (val && String(val).length > 8) {
@@ -71,6 +101,9 @@ const tooltipText = computed(() => {
71
101
  if (compact.value && show.value) {
72
102
  return rawValue.value;
73
103
  }
104
+ if (eyeButton.value) {
105
+ return '';
106
+ }
74
107
  return show.value ? t('Click to hide') : t('Click to show');
75
108
  });
76
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "3.12.4",
3
+ "version": "3.13.0",
4
4
  "description": "OpenSource Agent-Native forth-generation admin panel",
5
5
  "keywords": [
6
6
  "adminforth",