@exakt/ui 0.0.53 → 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.53"
4
+ "version": "0.0.55"
5
5
  }
@@ -178,6 +178,9 @@ const currentItem = computed({
178
178
  const select = (i: number) => {
179
179
  visibleComputed.value = false;
180
180
  currentItem.value = i;
181
+ if(props.items[i].callback){
182
+ props.items[i].callback();
183
+ }
181
184
  };
182
185
 
183
186
  const onActivatorClick = () => {
@@ -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: "",
@@ -85,11 +85,27 @@ const focus = () => {
85
85
  input.value.focus();
86
86
  };
87
87
 
88
+ const internalText = ref('')
89
+
88
90
  const currentText = computed({
89
- get: () => props.modelValue,
90
- set: (value) => emit("update:modelValue", 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
+ },
100
+ set: (value) => { if (props.modelValue) { emit("update:modelValue", value) } else { internalText.value = value } },
91
101
  });
92
102
 
103
+ onMounted(() => {
104
+ if (props.defaultValue) {
105
+ currentText.value = props.defaultValue
106
+ }
107
+ })
108
+
93
109
  const props = withDefaults(
94
110
  defineProps<{
95
111
  icon?: string;
@@ -97,6 +113,7 @@ const props = withDefaults(
97
113
  placeholder?: string;
98
114
  name?: string;
99
115
  modelValue?: string;
116
+ defaultValue?: string;
100
117
  solid?: boolean;
101
118
  rounded?: boolean;
102
119
  type?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exakt/ui",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "A UI library for Nuxt.js",
5
5
  "license": "MIT",
6
6
  "type": "module",