@greghowe79/the-lib 1.8.6 → 1.8.7

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, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password" }) => {
29
+ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password", lowercaseOnBlur = false }) => {
30
30
  qwik.useStylesScoped$(styles);
31
31
  const internalError = qwik.useSignal(null);
32
32
  const isPasswordVisible = qwik.useSignal(false);
@@ -35,6 +35,10 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
35
35
  isPasswordVisible.value = !isPasswordVisible.value;
36
36
  });
37
37
  const inputHandler = qwik.$(async (_, elem) => {
38
+ if (type === "url" && _.type === "blur" && lowercaseOnBlur) {
39
+ elem.value = elem.value.toLowerCase();
40
+ if (value) value.value = elem.value.toLowerCase();
41
+ }
38
42
  if (type === "number") {
39
43
  if (value) value.value = elem.value;
40
44
  if (!/^\d+$/.test(elem.value)) {
@@ -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, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password" }) => {
27
+ const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false, color, nameAttribute, label, selectedValue, imgUrl, autocomplete, iconPasswordShow, iconPasswordHide, labelShowPassword = "Show password", labelHidePassword = "Hide password", lowercaseOnBlur = false }) => {
28
28
  useStylesScoped$(styles);
29
29
  const internalError = useSignal(null);
30
30
  const isPasswordVisible = useSignal(false);
@@ -33,6 +33,10 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
33
33
  isPasswordVisible.value = !isPasswordVisible.value;
34
34
  });
35
35
  const inputHandler = $(async (_, elem) => {
36
+ if (type === "url" && _.type === "blur" && lowercaseOnBlur) {
37
+ elem.value = elem.value.toLowerCase();
38
+ if (value) value.value = elem.value.toLowerCase();
39
+ }
36
40
  if (type === "number") {
37
41
  if (value) value.value = elem.value;
38
42
  if (!/^\d+$/.test(elem.value)) {
@@ -27,6 +27,7 @@ export interface InputProps {
27
27
  iconPasswordHide?: JSXOutput | Component<unknown>;
28
28
  labelShowPassword?: string;
29
29
  labelHidePassword?: string;
30
+ lowercaseOnBlur?: boolean;
30
31
  }
31
32
  export declare const displayLocalImage: QRL<(file: File, imageUrl?: Signal<string>) => void>;
32
33
  export declare const uploadImage: QRL<(_event: Event, input: HTMLInputElement, currentFile?: Signal<any>, selectedFile?: Signal<string>, imageUrl?: Signal<string>) => Promise<void>>;
@@ -13,3 +13,4 @@ export declare const PasswordWithToggle: Story;
13
13
  export declare const EmailAutocomplete: Story;
14
14
  export declare const PasswordAutocomplete: Story;
15
15
  export declare const LoginFormComplete: Story;
16
+ export declare const UrlWithLowercaseConversion: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",