@exakt/ui 0.0.54 → 0.0.55

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,5 +1,5 @@
1
1
  {
2
2
  "name": "exakt-ui",
3
3
  "configKey": "exakt",
4
- "version": "0.0.54"
4
+ "version": "0.0.55"
5
5
  }
@@ -56,7 +56,7 @@
56
56
  </div>
57
57
  </template>
58
58
  <script setup lang="ts">
59
- import { ref, watch, reactive, computed, useId } from "#imports";
59
+ import { ref, watch, reactive, computed, useId, onMounted } from "#imports";
60
60
 
61
61
  const inputState = reactive({
62
62
  overtakeStyle: "",
@@ -88,10 +88,24 @@ const focus = () => {
88
88
  const internalText = ref('')
89
89
 
90
90
  const currentText = computed({
91
- get: () => props.modelValue ? props.modelValue : internalText.value,
91
+ get: () => {
92
+ const setValue = props.modelValue ? props.modelValue : internalText.value
93
+
94
+ if (!setValue || !setValue.length) {
95
+ return props.defaultValue || ''
96
+ }
97
+
98
+ return setValue
99
+ },
92
100
  set: (value) => { if (props.modelValue) { emit("update:modelValue", value) } else { internalText.value = value } },
93
101
  });
94
102
 
103
+ onMounted(() => {
104
+ if (props.defaultValue) {
105
+ currentText.value = props.defaultValue
106
+ }
107
+ })
108
+
95
109
  const props = withDefaults(
96
110
  defineProps<{
97
111
  icon?: string;
@@ -99,6 +113,7 @@ const props = withDefaults(
99
113
  placeholder?: string;
100
114
  name?: string;
101
115
  modelValue?: string;
116
+ defaultValue?: string;
102
117
  solid?: boolean;
103
118
  rounded?: boolean;
104
119
  type?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exakt/ui",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "A UI library for Nuxt.js",
5
5
  "license": "MIT",
6
6
  "type": "module",