@greghowe79/the-lib 1.0.4 → 1.0.6

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.
@@ -26,7 +26,7 @@ const uploadImage = qwik.$(async (_event, input, currentFile, selectedFile, imag
26
26
  if (selectedFile) selectedFile.value = file.name;
27
27
  }
28
28
  });
29
- const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, name }) => {
29
+ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, name, checked }) => {
30
30
  qwik.useStylesScoped$(styles);
31
31
  const internalError = qwik.useSignal(null);
32
32
  const showError = error ?? internalError;
@@ -117,13 +117,8 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
117
117
  id,
118
118
  type: "radio",
119
119
  name,
120
- value: placeholder,
121
- checked: value ? value.value === placeholder : false,
122
- required,
123
- onChange$: (event) => {
124
- if (value) value.value = event.target.value;
125
- if (onInput$) onInput$();
126
- }
120
+ checked: checked?.value,
121
+ required
127
122
  }) : /* @__PURE__ */ jsxRuntime.jsx("label", {
128
123
  class: `input-label ${bgLight ? "bg_light" : ""}`,
129
124
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
@@ -24,7 +24,7 @@ const uploadImage = $(async (_event, input, currentFile, selectedFile, imageUrl)
24
24
  if (selectedFile) selectedFile.value = file.name;
25
25
  }
26
26
  });
27
- const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, name }) => {
27
+ const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, name, checked }) => {
28
28
  useStylesScoped$(styles);
29
29
  const internalError = useSignal(null);
30
30
  const showError = error ?? internalError;
@@ -115,13 +115,8 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
115
115
  id,
116
116
  type: "radio",
117
117
  name,
118
- value: placeholder,
119
- checked: value ? value.value === placeholder : false,
120
- required,
121
- onChange$: (event) => {
122
- if (value) value.value = event.target.value;
123
- if (onInput$) onInput$();
124
- }
118
+ checked: checked?.value,
119
+ required
125
120
  }) : /* @__PURE__ */ jsx("label", {
126
121
  class: `input-label ${bgLight ? "bg_light" : ""}`,
127
122
  children: /* @__PURE__ */ jsxs("div", {
@@ -16,6 +16,7 @@ export interface InputProps {
16
16
  icon?: JSXOutput | Component<unknown>;
17
17
  prefix?: string;
18
18
  required?: boolean;
19
+ checked?: Signal<boolean>;
19
20
  }
20
21
  export declare const displayLocalImage: QRL<(file: File, imageUrl?: Signal<string>) => void>;
21
22
  export declare const uploadImage: QRL<(_event: Event, input: HTMLInputElement, currentFile?: Signal<any>, selectedFile?: Signal<string>, imageUrl?: Signal<string>) => Promise<void>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",