@featherk/ui 0.9.1 → 0.9.2

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/README.md CHANGED
@@ -20,7 +20,7 @@ Component styles ship with `@featherk/ui` and are automatically loaded from the
20
20
 
21
21
  ```vue
22
22
  <script setup lang="ts">
23
- import { ref, toRef, watchEffect } from "vue";
23
+ import { ref, toRef } from "vue";
24
24
  import { USAddress } from "@featherk/ui";
25
25
  import { useUSAddress } from "@featherk/composables/address";
26
26
 
@@ -31,17 +31,9 @@ const billingAddress = useUSAddress({
31
31
  addressId: "billing-address",
32
32
  });
33
33
 
34
- watchEffect((onCleanup) => {
35
- const fieldset = billingFieldsetRef.value;
36
- if (!fieldset) return;
37
-
38
- const handleFocusout = (event: Event) => {
39
- billingAddress.onFieldsetFocusout(event as FocusEvent);
40
- };
41
-
42
- fieldset.addEventListener("focusout", handleFocusout);
43
- onCleanup(() => fieldset.removeEventListener("focusout", handleFocusout));
44
- });
34
+ const onFieldsetFocusout = (event: FocusEvent) => {
35
+ billingAddress.onFieldsetFocusout(event);
36
+ };
45
37
 
46
38
  function onReset() {
47
39
  billingAddress.reset();
@@ -57,7 +49,7 @@ async function onSubmit() {
57
49
 
58
50
  <template>
59
51
  <form @submit.prevent="onSubmit">
60
- <fieldset ref="billingFieldsetRef">
52
+ <fieldset ref="billingFieldsetRef" @focusout="onFieldsetFocusout">
61
53
  <USAddress id="billing-address" :address="billingAddress" />
62
54
 
63
55
  <label for="billing-attn">Attention</label>
@@ -22,7 +22,7 @@ import { useUSAddress } from "@featherk/composables/address";
22
22
 
23
23
  ```vue
24
24
  <script setup lang="ts">
25
- import { ref, toRef, watchEffect } from "vue";
25
+ import { ref, toRef } from "vue";
26
26
  import { USAddress } from "@featherk/ui";
27
27
  import { useUSAddress } from "@featherk/composables/address";
28
28
 
@@ -33,17 +33,9 @@ const shippingAddress = useUSAddress({
33
33
  addressId: "shipping-address",
34
34
  });
35
35
 
36
- watchEffect((onCleanup) => {
37
- const fieldset = shippingFieldsetRef.value;
38
- if (!fieldset) return;
39
-
40
- const handleFocusout = (event: Event) => {
41
- shippingAddress.onFieldsetFocusout(event as FocusEvent);
42
- };
43
-
44
- fieldset.addEventListener("focusout", handleFocusout);
45
- onCleanup(() => fieldset.removeEventListener("focusout", handleFocusout));
46
- });
36
+ const onFieldsetFocusout = (event: FocusEvent) => {
37
+ shippingAddress.onFieldsetFocusout(event);
38
+ };
47
39
 
48
40
  function onReset() {
49
41
  shippingAddress.reset();
@@ -59,7 +51,7 @@ async function onSubmit() {
59
51
 
60
52
  <template>
61
53
  <form @submit.prevent="onSubmit">
62
- <fieldset ref="shippingFieldsetRef">
54
+ <fieldset ref="shippingFieldsetRef" @focusout="onFieldsetFocusout">
63
55
  <USAddress id="shipping-address" :address="shippingAddress" />
64
56
 
65
57
  <label for="shipping-attn">Attention</label>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featherk/ui",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "main": "dist/featherk-ui.umd.js",
5
5
  "module": "dist/featherk-ui.es.js",
6
6
  "types": "dist/index.d.ts",