@indielayer/ui 1.7.4 → 1.7.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.
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.7.4";
1
+ declare const _default: "1.7.5";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const e = "1.7.4";
1
+ const e = "1.7.5";
2
2
  export {
3
3
  e as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indielayer/ui",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Indielayer UI Components with Tailwind CSS build for Vue 3",
5
5
  "author": {
6
6
  "name": "João Teixeira",
@@ -42,7 +42,7 @@ export default {
42
42
  </script>
43
43
 
44
44
  <script setup lang="ts">
45
- import { ref, type PropType, type ExtractPublicPropTypes, watch } from 'vue'
45
+ import { ref, type PropType, type ExtractPublicPropTypes, watch, useAttrs, computed } from 'vue'
46
46
  import { useTheme, type ThemeComponent } from '../../composables/useTheme'
47
47
  import { useColors } from '../../composables/useColors'
48
48
  import { useCommon } from '../../composables/useCommon'
@@ -58,6 +58,15 @@ const props = defineProps(inputProps)
58
58
 
59
59
  const emit = defineEmits(useInputtable.emits())
60
60
 
61
+ const attrs = useAttrs()
62
+ const dataAttrs = computed(() => {
63
+ return Object.keys(attrs).reduce((acc, key) => {
64
+ if (key.startsWith('data-')) acc[key] = attrs[key]
65
+
66
+ return acc
67
+ }, {} as Record<string, any>)
68
+ })
69
+
61
70
  const elRef = ref<HTMLInputElement | null>(null)
62
71
  const currentType = ref(props.type)
63
72
 
@@ -153,6 +162,7 @@ defineExpose({ focus, blur, reset, validate, setError })
153
162
  :readonly="readonly"
154
163
  :type="currentType"
155
164
  :value="typeof modelValue !== 'undefined' ? modelValue : ''"
165
+ v-bind="dataAttrs"
156
166
  v-on="inputListeners"
157
167
  @change="onChange"
158
168
  />
@@ -38,7 +38,7 @@ export default {
38
38
  </script>
39
39
 
40
40
  <script setup lang="ts">
41
- import { ref, watch, type ExtractPublicPropTypes, type Ref } from 'vue'
41
+ import { ref, watch, type ExtractPublicPropTypes, type Ref, useAttrs, computed } from 'vue'
42
42
  import { useResizeObserver, useEventListener } from '@vueuse/core'
43
43
  import { useCSS } from '../../composables/useCSS'
44
44
  import { useTheme, type ThemeComponent } from '../../composables/useTheme'
@@ -54,6 +54,15 @@ const props = defineProps(textareaProps)
54
54
 
55
55
  const emit = defineEmits(useInputtable.emits())
56
56
 
57
+ const attrs = useAttrs()
58
+ const dataAttrs = computed(() => {
59
+ return Object.keys(attrs).reduce((acc, key) => {
60
+ if (key.startsWith('data-')) acc[key] = attrs[key]
61
+
62
+ return acc
63
+ }, {} as Record<string, any>)
64
+ })
65
+
57
66
  const elRef = ref<HTMLTextAreaElement | null>(null)
58
67
 
59
68
  useResizeObserver(elRef, resize)
@@ -139,6 +148,7 @@ defineExpose({ focus, blur, reset, validate, setError })
139
148
  :placeholder="placeholder"
140
149
  :readonly="readonly"
141
150
  :value="typeof modelValue !== 'undefined' ? String(modelValue) : ''"
151
+ v-bind="dataAttrs"
142
152
  v-on="inputListeners"
143
153
  @keydown.enter="onEnter"
144
154
  @input="onInput"
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export default '1.7.4'
1
+ export default '1.7.5'