adminforth 2.1.0-next.17 → 2.1.0-next.19

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.
@@ -8,6 +8,7 @@
8
8
  "name": "spa",
9
9
  "version": "0.0.0",
10
10
  "dependencies": {
11
+ "@iconify-prerendered/vue-flag": "^0.28.1748584105",
11
12
  "@iconify-prerendered/vue-flowbite": "^0.23.1714023977",
12
13
  "@unhead/vue": "^1.9.12",
13
14
  "@vueuse/core": "^10.10.0",
@@ -610,6 +611,18 @@
610
611
  "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
611
612
  "dev": true
612
613
  },
614
+ "node_modules/@iconify-prerendered/vue-flag": {
615
+ "version": "0.28.1748584105",
616
+ "resolved": "https://registry.npmjs.org/@iconify-prerendered/vue-flag/-/vue-flag-0.28.1748584105.tgz",
617
+ "integrity": "sha512-7wJ9UsXJ1h10S4Y/qZsnK3pFkwh6R0542PTv8SykD+80M9i9Iw7xUI9H65Qbcvmk0oNSuHTb/aoFXxqMpuEfnA==",
618
+ "license": "MIT",
619
+ "funding": {
620
+ "url": "https://www.buymeacoffee.com/kozack/"
621
+ },
622
+ "peerDependencies": {
623
+ "vue": "^3.0.0"
624
+ }
625
+ },
613
626
  "node_modules/@iconify-prerendered/vue-flowbite": {
614
627
  "version": "0.23.1714023977",
615
628
  "resolved": "https://registry.npmjs.org/@iconify-prerendered/vue-flowbite/-/vue-flowbite-0.23.1714023977.tgz",
@@ -13,6 +13,7 @@
13
13
  "i18n:extract": "echo '{}' > i18n-empty.json && vue-i18n-extract report --vueFiles './src/**/*.?(js|vue)' --output ./i18n-messages.json --languageFiles 'i18n-empty.json' --add"
14
14
  },
15
15
  "dependencies": {
16
+ "@iconify-prerendered/vue-flag": "^0.28.1748584105",
16
17
  "@iconify-prerendered/vue-flowbite": "^0.23.1714023977",
17
18
  "@unhead/vue": "^1.9.12",
18
19
  "@vueuse/core": "^10.10.0",
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <component v-if="getFlagComponent(countryCode)" class="flag-icon rounded-sm" :is="getFlagComponent(countryCode)" />
3
+ <span v-else-if="countryCode">{{ countryCode }}</span>
4
+ </template>
5
+
6
+ <script setup lang="ts">
7
+ import * as FlagIcons from '@iconify-prerendered/vue-flag';
8
+
9
+ defineProps(['countryCode']);
10
+
11
+ const getFlagComponent = (countryCode: string) => {
12
+ if (!countryCode) return null;
13
+
14
+ const normalizedCode = countryCode.charAt(0).toUpperCase() + countryCode.slice(1).toLowerCase();
15
+ const iconName = `Icon${normalizedCode}4x3`; // 4:3 aspect ratio flags
16
+ return FlagIcons[iconName as keyof typeof FlagIcons] || null;
17
+ };
18
+ </script>
19
+
20
+ <style scoped>
21
+ .flag-icon {
22
+ box-shadow: inset -0.3px -0.3px 0.3px 0px rgba(0 0 0 / 0.2),
23
+ inset 0.3px 0.3px 0.3px 0px rgba(255 255 255 / 0.2),
24
+ 0px 0px 3px #00000030;
25
+ }
26
+ </style>
@@ -18,5 +18,7 @@ export { default as Spinner } from './Spinner.vue';
18
18
  export { default as Skeleton } from './Skeleton.vue';
19
19
  export { default as Dialog } from './Dialog.vue';
20
20
  export { default as MixedChart } from './MixedChart.vue';
21
+ export { default as CountryFlag } from './CountryFlag.vue';
22
+
21
23
 
22
24
 
@@ -27,9 +27,9 @@
27
27
  </span>
28
28
 
29
29
  <span v-else-if="column.type === 'boolean'">
30
- <span v-if="record[column.name] === true" class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">{{ $t('Yes') }}</span>
31
- <span v-else-if="record[column.name] === false" class="bg-red-100 text-red-800gg text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">{{ $t('No') }}</span>
32
- <span v-else class="bg-gray-100 text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-400 border border-gray-400">{{ $t('Unset') }}</span>
30
+ <span v-if="record[column.name] === true" class="bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">{{ $t('Yes') }}</span>
31
+ <span v-else-if="record[column.name] === false" class="bg-red-100 whitespace-nowrap text-red-800gg text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">{{ $t('No') }}</span>
32
+ <span v-else class="bg-gray-100 whitespace-nowrap text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-400 border border-gray-400">{{ $t('Unset') }}</span>
33
33
  </span>
34
34
  <span
35
35
  v-else-if="column.type === 'json' && column.isArray?.enabled"
@@ -39,13 +39,13 @@
39
39
  <span
40
40
  v-if="column.isArray.itemType === 'boolean' && arrayItem"
41
41
  :key="`${column.name}-${arrayItemIndex}`"
42
- class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">
42
+ class="bg-green-100 whitespace-nowrap text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">
43
43
  {{ $t('Yes') }}
44
44
  </span>
45
45
  <span
46
46
  v-else-if="column.isArray.itemType === 'boolean'"
47
47
  :key="`${column.name}-${arrayItemIndex}`"
48
- class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">
48
+ class="bg-red-100 whitespace-nowrap text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">
49
49
  {{ $t('No') }}
50
50
  </span>
51
51
  <span
@@ -1,9 +1,7 @@
1
1
  <template>
2
2
  <Tooltip>
3
3
  <span class="flex items-center">
4
- <span
5
- :class="{[`fi-${countryIsoLow}`]: true, 'flag-icon': countryName}"
6
- ></span>
4
+ <CountryFlag class="w-[1.6rem] h-[1.2rem]" :countryCode="countryIsoLow" />
7
5
  <span v-if="meta.showCountryName" class="ms-2">{{ countryName }}</span>
8
6
  </span>
9
7
 
@@ -16,10 +14,10 @@
16
14
  <script setup>
17
15
 
18
16
  import { computed, ref, onMounted } from 'vue';
19
- import 'flag-icons/css/flag-icons.min.css';
20
17
  import isoCountries from 'i18n-iso-countries';
21
18
  import enLocal from 'i18n-iso-countries/langs/en.json';
22
19
  import Tooltip from '@/afcl/Tooltip.vue';
20
+ import CountryFlag from '@/afcl/CountryFlag.vue';
23
21
 
24
22
  isoCountries.registerLocale(enLocal);
25
23
 
@@ -47,19 +45,3 @@ const countryName = computed(() => {
47
45
  });
48
46
 
49
47
  </script>
50
-
51
- <style scoped lang="scss">
52
-
53
- .flag-icon {
54
- width: 1.6rem;
55
- height: 1.2rem;
56
- flex-shrink: 0;
57
-
58
- // border radius for background
59
- border-radius: 2px;
60
- box-shadow: inset -0.3px -0.3px 0.3px 0px rgba(0 0 0 / 0.2),
61
- inset 0.3px 0.3px 0.3px 0px rgba(255 255 255 / 0.2),
62
- 0px 0px 3px #00000030;
63
- }
64
-
65
- </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.1.0-next.17",
3
+ "version": "2.1.0-next.19",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",