@greghowe79/the-lib 0.7.7 → 0.7.8

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.
@@ -43,6 +43,12 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
43
43
  if (!error) internalError.value = result;
44
44
  }
45
45
  });
46
+ const beforeInputHandler = qwik.$((event) => {
47
+ const e = event;
48
+ if (e.data && /[^0-9]/.test(e.data)) {
49
+ e.preventDefault();
50
+ }
51
+ });
46
52
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
47
53
  class: "input-container",
48
54
  children: [
@@ -109,12 +115,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
109
115
  e.preventDefault();
110
116
  }
111
117
  },
112
- onBeforeInput$: (event) => {
113
- const e = event;
114
- if (e.data && /[^0-9]/.test(e.data)) {
115
- e.preventDefault();
116
- }
117
- }
118
+ onBeforeInput$: beforeInputHandler
118
119
  })
119
120
  ]
120
121
  })
@@ -41,6 +41,12 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
41
41
  if (!error) internalError.value = result;
42
42
  }
43
43
  });
44
+ const beforeInputHandler = $((event) => {
45
+ const e = event;
46
+ if (e.data && /[^0-9]/.test(e.data)) {
47
+ e.preventDefault();
48
+ }
49
+ });
44
50
  return /* @__PURE__ */ jsxs("div", {
45
51
  class: "input-container",
46
52
  children: [
@@ -107,12 +113,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
107
113
  e.preventDefault();
108
114
  }
109
115
  },
110
- onBeforeInput$: (event) => {
111
- const e = event;
112
- if (e.data && /[^0-9]/.test(e.data)) {
113
- e.preventDefault();
114
- }
115
- }
116
+ onBeforeInput$: beforeInputHandler
116
117
  })
117
118
  ]
118
119
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",