@nr1e/qwik-ui 1.0.5 → 2.0.0

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
  import { jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot, useSignal, useTask$, useOnDocument, $ } from "@builder.io/qwik";
2
+ import { component$, useSignal, useTask$, useOnDocument, $, Slot } from "@builder.io/qwik";
3
3
  import { Link } from "@builder.io/qwik-city";
4
4
  const DropUpButton = component$((props) => {
5
5
  return /* @__PURE__ */ jsx("li", {
@@ -86,7 +86,7 @@ const SelectField = qwik.component$((props) => {
86
86
  "aria-required": props.required,
87
87
  disabled: disabled.value,
88
88
  class: `select ${error.value ? "select-error" : ""}`,
89
- onChange$: (e) => {
89
+ onChange$: async (e) => {
90
90
  const target = e.target;
91
91
  if (props.onChange$) {
92
92
  props.onChange$(e, target.value, error);
@@ -98,10 +98,10 @@ const SelectField = qwik.component$((props) => {
98
98
  value.value = target.value;
99
99
  }
100
100
  if (props.validate$) {
101
- props.validate$(target.value, error);
101
+ error.value = await props.validate$(target.value);
102
102
  }
103
103
  },
104
- onBlur$: (e) => {
104
+ onBlur$: async (e) => {
105
105
  touched.value = true;
106
106
  const target = e.target;
107
107
  if (props.onBlur$) {
@@ -114,7 +114,7 @@ const SelectField = qwik.component$((props) => {
114
114
  value.value = target.value;
115
115
  }
116
116
  if (props.validate$) {
117
- props.validate$(target.value, error);
117
+ error.value = await props.validate$(target.value);
118
118
  }
119
119
  },
120
120
  children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
@@ -84,7 +84,7 @@ const SelectField = component$((props) => {
84
84
  "aria-required": props.required,
85
85
  disabled: disabled.value,
86
86
  class: `select ${error.value ? "select-error" : ""}`,
87
- onChange$: (e) => {
87
+ onChange$: async (e) => {
88
88
  const target = e.target;
89
89
  if (props.onChange$) {
90
90
  props.onChange$(e, target.value, error);
@@ -96,10 +96,10 @@ const SelectField = component$((props) => {
96
96
  value.value = target.value;
97
97
  }
98
98
  if (props.validate$) {
99
- props.validate$(target.value, error);
99
+ error.value = await props.validate$(target.value);
100
100
  }
101
101
  },
102
- onBlur$: (e) => {
102
+ onBlur$: async (e) => {
103
103
  touched.value = true;
104
104
  const target = e.target;
105
105
  if (props.onBlur$) {
@@ -112,7 +112,7 @@ const SelectField = component$((props) => {
112
112
  value.value = target.value;
113
113
  }
114
114
  if (props.validate$) {
115
- props.validate$(target.value, error);
115
+ error.value = await props.validate$(target.value);
116
116
  }
117
117
  },
118
118
  children: /* @__PURE__ */ jsx(Slot, {})
@@ -96,7 +96,7 @@ const TextField = qwik.component$((props) => {
96
96
  value: value.value,
97
97
  class: "placeholder:opacity-50",
98
98
  placeholder: props.placeholder,
99
- onBlur$: (e) => {
99
+ onBlur$: async (e) => {
100
100
  touched.value = true;
101
101
  const target = e.target;
102
102
  if (props.onBlur$) {
@@ -109,10 +109,10 @@ const TextField = qwik.component$((props) => {
109
109
  value.value = target.value;
110
110
  }
111
111
  if (props.validate$) {
112
- props.validate$(target.value, error);
112
+ error.value = await props.validate$(target.value);
113
113
  }
114
114
  },
115
- onInput$: (e) => {
115
+ onInput$: async (e) => {
116
116
  const target = e.target;
117
117
  if (props.onInput$) {
118
118
  props.onInput$(e, target.value, error);
@@ -124,7 +124,7 @@ const TextField = qwik.component$((props) => {
124
124
  value.value = target.value;
125
125
  }
126
126
  if (props.validate$) {
127
- props.validate$(target.value, error);
127
+ error.value = await props.validate$(target.value);
128
128
  }
129
129
  }
130
130
  }),
@@ -94,7 +94,7 @@ const TextField = component$((props) => {
94
94
  value: value.value,
95
95
  class: "placeholder:opacity-50",
96
96
  placeholder: props.placeholder,
97
- onBlur$: (e) => {
97
+ onBlur$: async (e) => {
98
98
  touched.value = true;
99
99
  const target = e.target;
100
100
  if (props.onBlur$) {
@@ -107,10 +107,10 @@ const TextField = component$((props) => {
107
107
  value.value = target.value;
108
108
  }
109
109
  if (props.validate$) {
110
- props.validate$(target.value, error);
110
+ error.value = await props.validate$(target.value);
111
111
  }
112
112
  },
113
- onInput$: (e) => {
113
+ onInput$: async (e) => {
114
114
  const target = e.target;
115
115
  if (props.onInput$) {
116
116
  props.onInput$(e, target.value, error);
@@ -122,7 +122,7 @@ const TextField = component$((props) => {
122
122
  value.value = target.value;
123
123
  }
124
124
  if (props.validate$) {
125
- props.validate$(target.value, error);
125
+ error.value = await props.validate$(target.value);
126
126
  }
127
127
  }
128
128
  }),
@@ -10,6 +10,6 @@ export interface SelectFieldProps {
10
10
  onChange$?: QRL<(event: Event, value: string, error: Signal<string | undefined>) => void>;
11
11
  onBlur$?: QRL<(event: FocusEvent, value: string, error: Signal<string | undefined>) => void>;
12
12
  onEvent$?: QRL<(type: 'blur' | 'change', event: Event, value: string, error: Signal<string | undefined>) => void>;
13
- validate$?: QRL<(value: string, error: Signal<string | undefined>) => void>;
13
+ validate$?: QRL<(value: string) => string | undefined>;
14
14
  }
15
15
  export declare const SelectField: import("@builder.io/qwik").Component<SelectFieldProps>;
@@ -12,6 +12,6 @@ export interface TextFieldProps {
12
12
  onBlur$?: QRL<(event: FocusEvent, value: string, error: Signal<string | undefined>) => void>;
13
13
  onInput$?: QRL<(event: InputEvent, value: string, error: Signal<string | undefined>) => void>;
14
14
  onEvent$?: QRL<(type: 'blur' | 'input', event: FocusEvent | InputEvent, value: string, error: Signal<string | undefined>) => void>;
15
- validate$?: QRL<(value: string, error: Signal<string | undefined>) => void>;
15
+ validate$?: QRL<(value: string) => string | undefined>;
16
16
  }
17
17
  export declare const TextField: import("@builder.io/qwik").Component<TextFieldProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "1.0.5",
3
+ "version": "2.0.0",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {