@greghowe79/the-lib 0.5.2 → 0.5.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.
@@ -4,11 +4,14 @@ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const styles = require("./styles.css.qwik.cjs");
6
6
  require("@fontsource/roboto-condensed/500.css");
7
- const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$ }) => {
7
+ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$ }) => {
8
8
  qwik.useStylesScoped$(styles);
9
9
  const internalError = qwik.useSignal(null);
10
10
  const showError = error ?? internalError;
11
11
  const inputHandler = qwik.$(async (_, elem) => {
12
+ if (onInput$) {
13
+ await onInput$();
14
+ }
12
15
  if (onValidate$) {
13
16
  const result = await onValidate$(elem.value);
14
17
  if (!error) internalError.value = result;
@@ -2,11 +2,14 @@ import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useStylesScoped$, useSignal, $ } from "@builder.io/qwik";
3
3
  import styles from "./styles.css.qwik.mjs";
4
4
  import "@fontsource/roboto-condensed/500.css";
5
- const Input = component$(({ id, type, placeholder, value, error, onValidate$ }) => {
5
+ const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$ }) => {
6
6
  useStylesScoped$(styles);
7
7
  const internalError = useSignal(null);
8
8
  const showError = error ?? internalError;
9
9
  const inputHandler = $(async (_, elem) => {
10
+ if (onInput$) {
11
+ await onInput$();
12
+ }
10
13
  if (onValidate$) {
11
14
  const result = await onValidate$(elem.value);
12
15
  if (!error) internalError.value = result;
@@ -8,5 +8,6 @@ export interface InputProps {
8
8
  value: Signal<string>;
9
9
  error?: Signal<string | null>;
10
10
  onValidate$?: QRL<(value: string) => Promise<string>>;
11
+ onInput$?: QRL<() => void>;
11
12
  }
12
13
  export declare const Input: import("@builder.io/qwik").Component<InputProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",