adminforth 1.3.54-next.7 → 1.3.54-next.8

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.54-next.7",
3
+ "version": "1.3.54-next.8",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,6 +34,8 @@
34
34
  "autoprefixer": "^10.4.19",
35
35
  "eslint": "^8.57.0",
36
36
  "eslint-plugin-vue": "^9.23.0",
37
+ "flag-icons": "^7.2.3",
38
+ "i18n-iso-countries": "^7.12.0",
37
39
  "npm-run-all2": "^6.1.2",
38
40
  "postcss": "^8.4.38",
39
41
  "sass": "^1.77.2",
@@ -1906,6 +1908,13 @@
1906
1908
  "node": ">=0.10.0"
1907
1909
  }
1908
1910
  },
1911
+ "node_modules/diacritics": {
1912
+ "version": "1.3.0",
1913
+ "resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz",
1914
+ "integrity": "sha512-wlwEkqcsaxvPJML+rDh/2iS824jbREk6DUMUKkEaSlxdYHeS43cClJtsWglvw2RfeXGm6ohKDqsXteJ5sP5enA==",
1915
+ "dev": true,
1916
+ "license": "MIT"
1917
+ },
1909
1918
  "node_modules/didyoumean": {
1910
1919
  "version": "1.2.2",
1911
1920
  "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
@@ -2371,6 +2380,13 @@
2371
2380
  "url": "https://github.com/sponsors/sindresorhus"
2372
2381
  }
2373
2382
  },
2383
+ "node_modules/flag-icons": {
2384
+ "version": "7.2.3",
2385
+ "resolved": "https://registry.npmjs.org/flag-icons/-/flag-icons-7.2.3.tgz",
2386
+ "integrity": "sha512-X2gUdteNuqdNqob2KKTJTS+ZCvyWeLCtDz9Ty8uJP17Y4o82Y+U/Vd4JNrdwTAjagYsRznOn9DZ+E/Q52qbmqg==",
2387
+ "dev": true,
2388
+ "license": "MIT"
2389
+ },
2374
2390
  "node_modules/flat-cache": {
2375
2391
  "version": "3.2.0",
2376
2392
  "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
@@ -2622,6 +2638,19 @@
2622
2638
  "entities": "^4.4.0"
2623
2639
  }
2624
2640
  },
2641
+ "node_modules/i18n-iso-countries": {
2642
+ "version": "7.12.0",
2643
+ "resolved": "https://registry.npmjs.org/i18n-iso-countries/-/i18n-iso-countries-7.12.0.tgz",
2644
+ "integrity": "sha512-NDFf5j/raA5JrcPT/NcHP3RUMH7TkdkxQKAKdvDlgb+MS296WJzzqvV0Y5uwavSm7A6oYvBeSV0AxoHdDiHIiw==",
2645
+ "dev": true,
2646
+ "license": "MIT",
2647
+ "dependencies": {
2648
+ "diacritics": "1.3.0"
2649
+ },
2650
+ "engines": {
2651
+ "node": ">= 12"
2652
+ }
2653
+ },
2625
2654
  "node_modules/ignore": {
2626
2655
  "version": "5.3.1",
2627
2656
  "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
package/spa/package.json CHANGED
@@ -38,6 +38,8 @@
38
38
  "autoprefixer": "^10.4.19",
39
39
  "eslint": "^8.57.0",
40
40
  "eslint-plugin-vue": "^9.23.0",
41
+ "flag-icons": "^7.2.3",
42
+ "i18n-iso-countries": "^7.12.0",
41
43
  "npm-run-all2": "^6.1.2",
42
44
  "postcss": "^8.4.38",
43
45
  "sass": "^1.77.2",
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <span class="flex items-center"
3
- :data-tooltip-target="`tooltip-${id}`"
4
- data-tooltip-placement="bottom">
3
+ :data-tooltip-target="`tooltip-${id}`"
4
+ data-tooltip-placement="top"
5
+ >
5
6
  {{ visualValue }} <IconFileCopyAltSolid @click.stop="copyToCB" class="w-5 h-5 text-lightPrimary dark:text-darkPrimary"/>
6
7
 
7
8
  <div :id="`tooltip-${id}`" role="tooltip"
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <span class="flex items-center">
3
+ <span
4
+ :class="{[`fi-${countryIsoLow}`]: true, 'flag-icon': countryName}"
5
+ :data-tooltip-target="`tooltip-${id}`"
6
+ ></span>
7
+
8
+ <span v-if="meta.showCountryName" class="ms-2">{{ countryName }}</span>
9
+
10
+ <div
11
+ v-if="!meta.showCountryName && countryName"
12
+ :id="`tooltip-${id}`" role="tooltip"
13
+ class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"
14
+ >
15
+ {{ countryName }}
16
+ <div class="tooltip-arrow" data-popper-arrow></div>
17
+ </div>
18
+ </span>
19
+
20
+ </template>
21
+
22
+ <script setup>
23
+
24
+ import { computed, ref, onMounted } from 'vue';
25
+ import { initFlowbite } from 'flowbite';
26
+ import 'flag-icons/css/flag-icons.min.css';
27
+ import isoCountries from 'i18n-iso-countries';
28
+ import enLocal from 'i18n-iso-countries/langs/en.json';
29
+
30
+ isoCountries.registerLocale(enLocal);
31
+
32
+ const props = defineProps(['column', 'record', 'meta', 'resource', 'adminUser']);
33
+
34
+ const id = ref();
35
+
36
+
37
+ onMounted(async () => {
38
+ id.value = Math.random().toString(36).substring(7);
39
+ await new Promise(resolve => setTimeout(resolve, 0));
40
+ initFlowbite();
41
+ });
42
+
43
+ const countryIsoLow = computed(() => {
44
+ return props.record[props.column.name]?.toLowerCase();
45
+ });
46
+
47
+ const countryName = computed(() => {
48
+ if (!countryIsoLow.value) {
49
+ return '';
50
+ }
51
+ return isoCountries.getName(countryIsoLow.value, 'en');
52
+ });
53
+
54
+ </script>
55
+
56
+ <style scoped lang="scss">
57
+
58
+ .flag-icon {
59
+ width: 2rem;
60
+ height: 1.5rem;
61
+ flex-shrink: 0;
62
+
63
+ // border radius for background
64
+ border-radius: 3px;
65
+ // add some silkiness to the flag
66
+ box-shadow: inset -1px -1px 2px 0px rgba(50 50 50 / 0.3), inset 1px 1px 2px 0px rgba(255 255 255 / 0.3);
67
+ }
68
+
69
+ </style>
@@ -21,7 +21,6 @@
21
21
  @click="()=>{checkboxes = []}"
22
22
  v-if="checkboxes.length"
23
23
  data-tooltip-target="tooltip-remove-all"
24
- data-tooltip-placement="bottom"
25
24
  class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-darkListTable dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
26
25
  >
27
26
  <IconBanOutline class="w-5 h-5 "/>