@nr1e/qwik-ui 2.0.11 → 2.0.13
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.
|
@@ -3,23 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
4
4
|
const qwik = require("@builder.io/qwik");
|
|
5
5
|
const TextField = qwik.component$((props) => {
|
|
6
|
-
const value = qwik.useSignal(typeof props.value === "string" ? props.value : props.value?.value);
|
|
7
|
-
qwik.useTask$(({ track }) => {
|
|
8
|
-
if (props.value && typeof props.value !== "string") {
|
|
9
|
-
track(() => value.value);
|
|
10
|
-
if (value.value !== props.value?.value) {
|
|
11
|
-
props.value.value = value.value;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
qwik.useTask$(({ track }) => {
|
|
16
|
-
if (props.value && typeof props.value !== "string") {
|
|
17
|
-
track(() => props.value.value);
|
|
18
|
-
if (props.value.value !== value.value) {
|
|
19
|
-
value.value = props.value.value;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
6
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
24
7
|
class: "fieldset",
|
|
25
8
|
children: [
|
|
@@ -51,11 +34,18 @@ const TextField = qwik.component$((props) => {
|
|
|
51
34
|
"aria-required": props.required,
|
|
52
35
|
disabled: props.disabled,
|
|
53
36
|
maxLength: props.maxLength,
|
|
54
|
-
value: value.value,
|
|
37
|
+
value: typeof props.value === "string" ? props.value : props.value?.value,
|
|
55
38
|
class: "placeholder:opacity-50",
|
|
56
39
|
placeholder: props.placeholder,
|
|
57
40
|
onBlur$: props.onBlur$,
|
|
58
|
-
onInput$:
|
|
41
|
+
onInput$: (event, element) => {
|
|
42
|
+
if (props.value && typeof props.value !== "string") {
|
|
43
|
+
props.value.value = element.value;
|
|
44
|
+
}
|
|
45
|
+
if (props.onInput$) {
|
|
46
|
+
props.onInput$(event, element);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
59
49
|
}),
|
|
60
50
|
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
61
51
|
name: "right"
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
-
import { component$,
|
|
2
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
3
3
|
const TextField = component$((props) => {
|
|
4
|
-
const value = useSignal(typeof props.value === "string" ? props.value : props.value?.value);
|
|
5
|
-
useTask$(({ track }) => {
|
|
6
|
-
if (props.value && typeof props.value !== "string") {
|
|
7
|
-
track(() => value.value);
|
|
8
|
-
if (value.value !== props.value?.value) {
|
|
9
|
-
props.value.value = value.value;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
useTask$(({ track }) => {
|
|
14
|
-
if (props.value && typeof props.value !== "string") {
|
|
15
|
-
track(() => props.value.value);
|
|
16
|
-
if (props.value.value !== value.value) {
|
|
17
|
-
value.value = props.value.value;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
4
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
5
|
class: "fieldset",
|
|
23
6
|
children: [
|
|
@@ -49,11 +32,18 @@ const TextField = component$((props) => {
|
|
|
49
32
|
"aria-required": props.required,
|
|
50
33
|
disabled: props.disabled,
|
|
51
34
|
maxLength: props.maxLength,
|
|
52
|
-
value: value.value,
|
|
35
|
+
value: typeof props.value === "string" ? props.value : props.value?.value,
|
|
53
36
|
class: "placeholder:opacity-50",
|
|
54
37
|
placeholder: props.placeholder,
|
|
55
38
|
onBlur$: props.onBlur$,
|
|
56
|
-
onInput$:
|
|
39
|
+
onInput$: (event, element) => {
|
|
40
|
+
if (props.value && typeof props.value !== "string") {
|
|
41
|
+
props.value.value = element.value;
|
|
42
|
+
}
|
|
43
|
+
if (props.onInput$) {
|
|
44
|
+
props.onInput$(event, element);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
57
47
|
}),
|
|
58
48
|
/* @__PURE__ */ jsx(Slot, {
|
|
59
49
|
name: "right"
|
|
@@ -7,7 +7,7 @@ export interface SelectFieldProps {
|
|
|
7
7
|
error?: string;
|
|
8
8
|
required?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
-
onChange$?: QRL<(event: Event) => void>;
|
|
11
|
-
onBlur$?: QRL<(event: FocusEvent) => void>;
|
|
10
|
+
onChange$?: QRL<(event: Event, element: HTMLSelectElement) => void>;
|
|
11
|
+
onBlur$?: QRL<(event: FocusEvent, element: HTMLSelectElement) => void>;
|
|
12
12
|
}
|
|
13
13
|
export declare const SelectField: import("@builder.io/qwik").Component<SelectFieldProps>;
|
|
@@ -29,8 +29,5 @@ export interface TextFieldProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* A standardized text input field meant to be used independently or with Qwik
|
|
31
31
|
* Modular Forms.
|
|
32
|
-
*
|
|
33
|
-
* Be aware that the normalized value of the input from validation is reflected
|
|
34
|
-
* back into the text field automatically on blur.
|
|
35
32
|
*/
|
|
36
33
|
export declare const TextField: import("@builder.io/qwik").Component<TextFieldProps>;
|