@nr1e/qwik-ui 2.0.16 → 2.0.17
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,6 +3,8 @@ 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 = props.value;
|
|
7
|
+
const onInputHandler = props.onInput$;
|
|
6
8
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
7
9
|
class: "fieldset",
|
|
8
10
|
children: [
|
|
@@ -22,6 +24,10 @@ const TextField = qwik.component$((props) => {
|
|
|
22
24
|
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
23
25
|
name: "left"
|
|
24
26
|
}),
|
|
27
|
+
props.icon && /* @__PURE__ */ jsxRuntime.jsx(props.icon, {
|
|
28
|
+
size: 18,
|
|
29
|
+
class: "opacity-50"
|
|
30
|
+
}),
|
|
25
31
|
/* @__PURE__ */ jsxRuntime.jsx("input", {
|
|
26
32
|
type: props.type || "text",
|
|
27
33
|
...props.id && {
|
|
@@ -39,11 +45,11 @@ const TextField = qwik.component$((props) => {
|
|
|
39
45
|
placeholder: props.placeholder,
|
|
40
46
|
onBlur$: props.onBlur$,
|
|
41
47
|
onInput$: (event, element) => {
|
|
42
|
-
if (
|
|
43
|
-
|
|
48
|
+
if (value && typeof value !== "string") {
|
|
49
|
+
value.value = element.value;
|
|
44
50
|
}
|
|
45
|
-
if (
|
|
46
|
-
|
|
51
|
+
if (onInputHandler) {
|
|
52
|
+
onInputHandler(event, element);
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
}),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
2
|
import { component$, Slot } from "@builder.io/qwik";
|
|
3
3
|
const TextField = component$((props) => {
|
|
4
|
+
const value = props.value;
|
|
5
|
+
const onInputHandler = props.onInput$;
|
|
4
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
5
7
|
class: "fieldset",
|
|
6
8
|
children: [
|
|
@@ -20,6 +22,10 @@ const TextField = component$((props) => {
|
|
|
20
22
|
/* @__PURE__ */ jsx(Slot, {
|
|
21
23
|
name: "left"
|
|
22
24
|
}),
|
|
25
|
+
props.icon && /* @__PURE__ */ jsx(props.icon, {
|
|
26
|
+
size: 18,
|
|
27
|
+
class: "opacity-50"
|
|
28
|
+
}),
|
|
23
29
|
/* @__PURE__ */ jsx("input", {
|
|
24
30
|
type: props.type || "text",
|
|
25
31
|
...props.id && {
|
|
@@ -37,11 +43,11 @@ const TextField = component$((props) => {
|
|
|
37
43
|
placeholder: props.placeholder,
|
|
38
44
|
onBlur$: props.onBlur$,
|
|
39
45
|
onInput$: (event, element) => {
|
|
40
|
-
if (
|
|
41
|
-
|
|
46
|
+
if (value && typeof value !== "string") {
|
|
47
|
+
value.value = element.value;
|
|
42
48
|
}
|
|
43
|
-
if (
|
|
44
|
-
|
|
49
|
+
if (onInputHandler) {
|
|
50
|
+
onInputHandler(event, element);
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
}),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { QRL, Signal } from '@builder.io/qwik';
|
|
1
|
+
import { QRL, Signal, Component } from '@builder.io/qwik';
|
|
2
|
+
import { IconProps } from '@nr1e/qwik-icons';
|
|
2
3
|
/**
|
|
3
4
|
* The type of the input field.
|
|
4
5
|
*/
|
|
@@ -25,9 +26,10 @@ export interface TextFieldProps {
|
|
|
25
26
|
* Called when the input value changes.
|
|
26
27
|
*/
|
|
27
28
|
onInput$?: QRL<(event: InputEvent, element: HTMLInputElement) => void>;
|
|
29
|
+
icon?: Component<IconProps>;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* A standardized text input field meant to be used independently or with Qwik
|
|
31
33
|
* Modular Forms.
|
|
32
34
|
*/
|
|
33
|
-
export declare const TextField:
|
|
35
|
+
export declare const TextField: Component<TextFieldProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nr1e/qwik-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"description": "NR1E Qwik UI Library",
|
|
5
5
|
"author": "NR1E, Inc.",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@builder.io/qwik-city": "1.19.2",
|
|
38
38
|
"tailwindcss-animated": "2.0.0",
|
|
39
|
-
"@nr1e/qwik-icons": "0.0.
|
|
39
|
+
"@nr1e/qwik-icons": "0.0.32"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@builder.io/qwik": "1.19.1",
|