@una-ui/nuxt 0.50.2 → 0.50.4

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.50.2",
4
+ "version": "0.50.4",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -8,7 +8,7 @@ import 'unocss';
8
8
  import 'unocss-preset-animations';
9
9
 
10
10
  const name = "@una-ui/nuxt";
11
- const version = "0.50.2";
11
+ const version = "0.50.4";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -61,7 +61,7 @@ const visibleAvatars = computed(() => {
61
61
  const displayAvatars = computed(() => {
62
62
  const result = [...visibleAvatars.value]
63
63
 
64
- if (hiddenCount.value > 0) {
64
+ if (hiddenCount.value > 0 || props.overflowLabel) {
65
65
  const avatarProps = children.value.length > 0
66
66
  ? omitProps(children.value[0].props || {}, ['src', 'alt', 'label', 'icon'])
67
67
  : {}
@@ -77,28 +77,28 @@ const reverseClassVariants = computed(() => {
77
77
  })
78
78
 
79
79
  // html refs
80
- const textarea = ref<HTMLTextAreaElement>()
80
+ const inputRef = ref<HTMLTextAreaElement>()
81
81
 
82
82
  function resizeTextarea(): void {
83
- if (!(props.type === 'textarea' && props.autoresize) || !textarea.value)
83
+ if (!(props.type === 'textarea' && props.autoresize) || !inputRef.value)
84
84
  return
85
85
 
86
- textarea.value.rows = props.rows
86
+ inputRef.value.rows = props.rows
87
87
 
88
- const styles = window.getComputedStyle(textarea.value)
88
+ const styles = window.getComputedStyle(inputRef.value)
89
89
  const paddingTop = Number.parseInt(styles.paddingTop)
90
90
  const paddingBottom = Number.parseInt(styles.paddingBottom)
91
91
  const padding = paddingTop + paddingBottom
92
92
  const lineHeight = Number.parseInt(styles.lineHeight)
93
- const { scrollHeight } = textarea.value
93
+ const { scrollHeight } = inputRef.value
94
94
  const newRows = (scrollHeight - padding) / lineHeight
95
95
 
96
96
  if (newRows > props.rows)
97
- textarea.value.rows = newRows
97
+ inputRef.value.rows = newRows
98
98
 
99
99
  const maxAutoresizeRows = typeof props.autoresize === 'number' ? props.autoresize : Number.POSITIVE_INFINITY
100
- if (textarea.value.rows > maxAutoresizeRows)
101
- textarea.value.rows = maxAutoresizeRows
100
+ if (inputRef.value.rows > maxAutoresizeRows)
101
+ inputRef.value.rows = maxAutoresizeRows
102
102
  }
103
103
 
104
104
  function onInput(event: Event): void {
@@ -110,6 +110,13 @@ function onInput(event: Event): void {
110
110
  onMounted(() => {
111
111
  resizeTextarea()
112
112
  })
113
+
114
+ defineExpose({
115
+ focus: () => inputRef.value?.focus(),
116
+ blur: () => inputRef.value?.blur(),
117
+ select: () => inputRef.value?.select(),
118
+ inputRef,
119
+ })
113
120
  </script>
114
121
 
115
122
  <template>
@@ -144,7 +151,7 @@ onMounted(() => {
144
151
  <component
145
152
  :is="props.type !== 'textarea' ? 'input' : 'textarea'"
146
153
  :id
147
- ref="textarea"
154
+ ref="inputRef"
148
155
  :value="modelValue"
149
156
  :type="props.type !== 'textarea' ? props.type : undefined"
150
157
  :class="cn(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.50.2",
4
+ "version": "0.50.4",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "typescript": "5.6.3",
60
60
  "unocss": "^66.0.0",
61
61
  "unocss-preset-animations": "^1.1.1",
62
- "@una-ui/extractor-vue-script": "^0.50.2",
63
- "@una-ui/preset": "^0.50.2"
62
+ "@una-ui/extractor-vue-script": "^0.50.4",
63
+ "@una-ui/preset": "^0.50.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@iconify-json/lucide": "^1.2.34",