@paraxe/vue 1.0.3 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  interface Props {
2
- value?: string;
2
+ modelValue?: string;
3
3
  disabled?: boolean;
4
4
  error?: boolean;
5
5
  success?: boolean;
@@ -9,14 +9,14 @@ type __VLS_Slots = {} & {
9
9
  default?: (props: typeof __VLS_1) => any;
10
10
  };
11
11
  declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
- change: (value: string) => any;
12
+ "update:modelValue": (value: string) => any;
13
13
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
14
- onChange?: ((value: string) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
15
15
  }>, {
16
16
  disabled: boolean;
17
+ modelValue: string;
17
18
  error: boolean;
18
19
  success: boolean;
19
- value: string;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
22
  declare const _default: typeof __VLS_export;
package/dist/index.js CHANGED
@@ -374,26 +374,27 @@ const Gt = /* @__PURE__ */ H(fe, [["render", be]]), ve = ["for"], he = {
374
374
  }), we = ["value", "disabled"], Wt = /* @__PURE__ */ m({
375
375
  __name: "Select",
376
376
  props: {
377
- value: { default: "" },
377
+ modelValue: { default: "" },
378
378
  disabled: { type: Boolean, default: !1 },
379
379
  error: { type: Boolean, default: !1 },
380
380
  success: { type: Boolean, default: !1 }
381
381
  },
382
- emits: ["change"],
382
+ emits: ["update:modelValue"],
383
383
  setup(a, { emit: e }) {
384
- const t = a, s = e, l = b(() => ({
384
+ const t = a, s = e;
385
+ function l(r) {
386
+ const i = r.target;
387
+ s("update:modelValue", i.value);
388
+ }
389
+ const o = b(() => ({
385
390
  "input-error": t.error,
386
391
  "input-success": t.success
387
392
  }));
388
- function o(r) {
389
- const i = r.target;
390
- s("change", i.value);
391
- }
392
393
  return (r, i) => (n(), d("select", {
393
- class: f(["select", l.value]),
394
- value: t.value,
394
+ class: f(["select", o.value]),
395
+ value: t.modelValue,
395
396
  disabled: t.disabled,
396
- onChange: o
397
+ onChange: l
397
398
  }, [
398
399
  u(r.$slots, "default")
399
400
  ], 42, we));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraxe/vue",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -0,0 +1,2 @@
1
+ allowBuilds:
2
+ esbuild: true
@@ -2,42 +2,43 @@
2
2
  import { computed } from "vue";
3
3
 
4
4
  interface Props {
5
- value?: string;
5
+ modelValue?: string;
6
6
  disabled?: boolean;
7
7
  error?: boolean;
8
8
  success?: boolean;
9
9
  }
10
10
 
11
11
  const props = withDefaults(defineProps<Props>(), {
12
- value: "",
12
+ modelValue: "",
13
13
  disabled: false,
14
14
  error: false,
15
15
  success: false,
16
16
  });
17
17
 
18
18
  const emit = defineEmits<{
19
- change: [value: string];
19
+ "update:modelValue": [value: string];
20
20
  }>();
21
21
 
22
+ function handleChange(event: Event) {
23
+ const target = event.target as HTMLSelectElement;
24
+ emit("update:modelValue", target.value);
25
+ }
26
+
22
27
  const selectClasses = computed(() => ({
23
28
  "input-error": props.error,
24
29
  "input-success": props.success,
25
30
  }));
26
31
 
27
- function handleChange(event: Event) {
28
- const target = event.target as HTMLSelectElement;
29
- emit("change", target.value);
30
- }
31
32
  </script>
32
33
 
33
34
  <template>
34
- <select
35
- class="select"
36
- :class="selectClasses"
37
- :value="props.value"
38
- :disabled="props.disabled"
39
- @change="handleChange"
40
- >
41
- <slot />
42
- </select>
35
+ <select
36
+ class="select"
37
+ :class="selectClasses"
38
+ :value="props.modelValue"
39
+ :disabled="props.disabled"
40
+ @change="handleChange"
41
+ >
42
+ <slot />
43
+ </select>
43
44
  </template>