innoboxrr-vue-datatable 2.0.0 → 2.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innoboxrr-vue-datatable",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Datatable para vue3",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,11 +40,12 @@
40
40
  "*.vue"
41
41
  ],
42
42
  "peerDependencies": {
43
- "innoboxrr-form-core": "^2.0.0",
43
+ "innoboxrr-form-core": "^2.2.0",
44
44
  "vue": "^3.5.0",
45
45
  "vue-router": "^4.5.0"
46
46
  },
47
47
  "dependencies": {
48
+ "@iconify/vue": "^5.0.0",
48
49
  "axios": "^1.7.0"
49
50
  },
50
51
  "devDependencies": {
package/src/DataTable.vue CHANGED
@@ -44,24 +44,28 @@
44
44
  <div v-if="hasFilter" class="fe-w-auto">
45
45
  <div class="fe-grid-divider fe-children-expand fe-text-center" fe-grid>
46
46
  <div>
47
- <span
47
+ <button
48
+ type="button"
48
49
  class="fe-text-right pointer"
49
- :uk-tooltip="`title: ${'Update results'}`"
50
+ data-tooltip="Update results"
51
+ aria-label="Update results"
50
52
  @click="updateFilters">
51
53
  <svg class="w-6 h-6 text-slate-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 20">
52
54
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 1v5h-5M2 19v-5h5m10-4a8 8 0 0 1-14.947 3.97M1 10a8 8 0 0 1 14.947-3.97"/>
53
55
  </svg>
54
- </span>
56
+ </button>
55
57
  </div>
56
58
  <div>
57
- <span
59
+ <button
60
+ type="button"
58
61
  class="fe-text-right pointer"
59
62
  uk-toggle="target: .filter-form; animation: uk-animation-scale-up;"
60
- uk-tooltip="title: Buscar">
63
+ data-tooltip="Buscar"
64
+ aria-label="Buscar">
61
65
  <svg class="w-6 h-6 text-slate-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
62
66
  <path d="M18.85 1.1A1.99 1.99 0 0 0 17.063 0H2.937a2 2 0 0 0-1.566 3.242L6.99 9.868 7 14a1 1 0 0 0 .4.8l4 3A1 1 0 0 0 13 17l.01-7.134 5.66-6.676a1.99 1.99 0 0 0 .18-2.09Z"/>
63
67
  </svg>
64
- </span>
68
+ </button>
65
69
  </div>
66
70
  </div>
67
71
  </div>
@@ -3,12 +3,14 @@
3
3
  <a
4
4
  href="#"
5
5
  class="disabled-link block px-4 py-2 dark:hover:text-white dark:text-slate-400"
6
- :uk-tooltip="`title: ${ 'This action is not authorized' }; pos:right`">
6
+ data-tooltip="This action is not authorized"
7
+ data-tooltip-pos="right">
7
8
 
8
- <span
9
+ <Icon
9
10
  v-if="showIcon"
10
- class="fe-mr-sm uk-icon"
11
- :uk-icon="icon"></span>
11
+ class="fe-mr-sm"
12
+ :icon="resolved"
13
+ aria-hidden="true" />
12
14
 
13
15
  <span>{{ text }}</span>
14
16
 
@@ -19,6 +21,8 @@
19
21
  <script setup>
20
22
 
21
23
  import { computed } from 'vue'
24
+ import { Icon } from '@iconify/vue'
25
+ import { iconFor } from 'innoboxrr-form-core'
22
26
 
23
27
  const props = defineProps({
24
28
 
@@ -36,4 +40,6 @@
36
40
 
37
41
  const showIcon = computed(() => props.icon !== '' && props.icon != null)
38
42
 
43
+ const resolved = computed(() => iconFor(props.icon))
44
+
39
45
  </script>
@@ -5,10 +5,12 @@
5
5
  :href="link"
6
6
  :target="target">
7
7
 
8
- <span
9
- class="fe-mr-sm uk-icon"
10
- :uk-icon="iconAttr"
11
- :style="iconStyle"></span>
8
+ <Icon
9
+ class="fe-mr-sm"
10
+ :icon="resolved"
11
+ :width="size"
12
+ :height="size"
13
+ aria-hidden="true" />
12
14
 
13
15
  <span :class="textClass">{{ text }}</span>
14
16
 
@@ -18,7 +20,20 @@
18
20
 
19
21
  <script setup>
20
22
 
21
- import { computed, nextTick, onMounted } from 'vue'
23
+ /**
24
+ * Antes esto pintaba `<span class="uk-icon" uk-icon="icon: fa-plus">` y
25
+ * llamaba a `globalThis.UIkit.update()` al montar. Para que ese icono
26
+ * apareciera hacian falta tres dependencias que ningun package.json
27
+ * declaraba: uikit, fontawesome y uikit-custom-icons, que hacia de puente
28
+ * entre las dos.
29
+ *
30
+ * Ahora el nombre se resuelve contra el mapa de innoboxrr-form-core, que
31
+ * es el mismo que usa la rama React.
32
+ */
33
+
34
+ import { computed, onScopeDispose, ref } from 'vue'
35
+ import { Icon } from '@iconify/vue'
36
+ import { iconFor, onIconChange } from 'innoboxrr-form-core'
22
37
 
23
38
  const props = defineProps({
24
39
  link: {
@@ -48,18 +63,19 @@
48
63
  }
49
64
  })
50
65
 
51
- onMounted(() => {
52
- nextTick(() => {
53
- // UIkit lo aporta la aplicacion anfitriona; sin la guarda el
54
- // componente no se puede montar en un entorno de pruebas ni en SSR.
55
- globalThis.UIkit?.update()
56
- })
57
- })
66
+ // Un cambio de mapa en caliente repinta lo ya montado.
67
+ const version = ref(0)
68
+
69
+ onScopeDispose(onIconChange(() => version.value++))
58
70
 
59
- const iconAttr = computed(() => `icon: ${props.icon}; ratio: ${props.ratio};`)
71
+ const resolved = computed(() => {
72
+ version.value
73
+
74
+ return iconFor(props.icon)
75
+ })
60
76
 
61
- const iconStyle = computed(() => ({
62
- fontSize: (props.ratio * 16) + 'px'
63
- }))
77
+ // `ratio` era el multiplicador de UIkit sobre 16px. Se conserva para no
78
+ // romper a quien ya lo pasa.
79
+ const size = computed(() => props.ratio * 16)
64
80
 
65
81
  </script>
@@ -4,10 +4,12 @@
4
4
  :to="pathObject"
5
5
  class="block px-4 py-2 dark:hover:text-white dark:text-slate-400">
6
6
 
7
- <span
8
- class="fe-mr-sm uk-icon"
9
- :uk-icon="iconAttr"
10
- :style="iconStyle"></span>
7
+ <Icon
8
+ class="fe-mr-sm"
9
+ :icon="resolved"
10
+ :width="size"
11
+ :height="size"
12
+ aria-hidden="true" />
11
13
 
12
14
  <span :class="textClass">{{ text }}</span>
13
15
 
@@ -17,7 +19,9 @@
17
19
 
18
20
  <script setup>
19
21
 
20
- import { computed } from 'vue'
22
+ import { computed, onScopeDispose, ref } from 'vue'
23
+ import { Icon } from '@iconify/vue'
24
+ import { iconFor, onIconChange } from 'innoboxrr-form-core'
21
25
 
22
26
  const props = defineProps({
23
27
  name: {
@@ -62,10 +66,19 @@
62
66
  query: props.query,
63
67
  }))
64
68
 
65
- const iconAttr = computed(() => `icon: ${props.icon}; ratio: ${props.ratio};`)
69
+ // Un cambio de mapa en caliente repinta lo ya montado.
70
+ const version = ref(0)
66
71
 
67
- const iconStyle = computed(() => ({
68
- fontSize: (props.ratio * 16) + 'px'
69
- }))
72
+ onScopeDispose(onIconChange(() => version.value++))
73
+
74
+ const resolved = computed(() => {
75
+ version.value
76
+
77
+ return iconFor(props.icon)
78
+ })
79
+
80
+ // `ratio` era el multiplicador de UIkit sobre 16px. Se conserva para no
81
+ // romper a quien ya lo pasa.
82
+ const size = computed(() => props.ratio * 16)
70
83
 
71
84
  </script>