@paraxe/vue 1.0.1 → 1.0.3

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": "@paraxe/vue",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -16,11 +16,13 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
+ "@nuxt/kit": "^4.5.2",
19
20
  "@paraxe/core": "^1.0.0",
20
21
  "vue": "^3.5.13"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@vitejs/plugin-vue": "^6.0.1",
25
+ "nuxt": "4.5.2",
24
26
  "typescript": "^5.9.2",
25
27
  "unplugin-vue-components": "^32.1.0",
26
28
  "vite": "^7.1.2",
File without changes
@@ -1,14 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from "vue";
3
-
4
- import type {
5
- InputType,
6
- } from "@paraxe/core";
3
+ import type { InputType } from "@paraxe/core";
7
4
 
8
5
  interface Props {
9
- type: InputType;
6
+ type?: InputType;
10
7
  placeholder?: string;
11
- value?: string;
8
+ modelValue?: string;
12
9
  required?: boolean;
13
10
  disabled?: boolean;
14
11
  readonly?: boolean;
@@ -19,7 +16,7 @@ interface Props {
19
16
  const props = withDefaults(defineProps<Props>(), {
20
17
  type: "text",
21
18
  placeholder: "",
22
- value: "",
19
+ modelValue: "",
23
20
  required: false,
24
21
  disabled: false,
25
22
  readonly: false,
@@ -28,27 +25,31 @@ const props = withDefaults(defineProps<Props>(), {
28
25
  });
29
26
 
30
27
  const emit = defineEmits<{
31
- input: [value: string];
32
- change: [value: string];
28
+ "update:modelValue": [value: string];
33
29
  }>();
34
30
 
35
31
  const inputClasses = computed(() => ({
36
32
  "input-error": props.error,
37
33
  "input-success": props.success,
38
34
  }));
35
+
36
+ function handleInput(event: Event): void {
37
+ emit(
38
+ "update:modelValue",
39
+ (event.target as HTMLInputElement).value,
40
+ );
41
+ }
39
42
  </script>
40
43
 
41
44
  <template>
42
45
  <input
43
- class="input"
44
- :class="inputClasses"
46
+ :class="['input', inputClasses]"
45
47
  :type="props.type"
46
48
  :placeholder="props.placeholder"
47
- :value="props.value"
49
+ :value="props.modelValue"
48
50
  :required="props.required"
49
51
  :disabled="props.disabled"
50
52
  :readonly="props.readonly"
51
- @input="emit('input', ($event.target as HTMLInputElement).value)"
52
- @change="emit('change', ($event.target as HTMLInputElement).value)"
53
+ @input="handleInput"
53
54
  />
54
55
  </template>