@greghowe79/the-lib 0.9.3 → 0.9.4

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.
@@ -4,13 +4,15 @@ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  require("@fontsource/roboto-condensed/500.css");
6
6
  const styles = require("./styles.css.qwik.cjs");
7
- const Select = qwik.component$(({ id, label, options, selected }) => {
7
+ const Select = qwik.component$(({ id, label, options, selected, prefix }) => {
8
8
  qwik.useStylesScoped$(styles);
9
9
  const handleChange$ = qwik.$((event) => {
10
10
  const target = event.target;
11
- const rawValue = target.value;
12
- const numericPrefix = "+" + rawValue.replace(/[^\d]/g, "");
13
- selected.value = numericPrefix;
11
+ selected.value = target.value;
12
+ if (prefix) {
13
+ const numericPrefix = "+" + selected.value.replace(/[^\d]/g, "");
14
+ prefix.value = numericPrefix;
15
+ }
14
16
  });
15
17
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
16
18
  class: "select-container",
@@ -2,13 +2,15 @@ import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useStylesScoped$, $ } from "@builder.io/qwik";
3
3
  import "@fontsource/roboto-condensed/500.css";
4
4
  import styles from "./styles.css.qwik.mjs";
5
- const Select = component$(({ id, label, options, selected }) => {
5
+ const Select = component$(({ id, label, options, selected, prefix }) => {
6
6
  useStylesScoped$(styles);
7
7
  const handleChange$ = $((event) => {
8
8
  const target = event.target;
9
- const rawValue = target.value;
10
- const numericPrefix = "+" + rawValue.replace(/[^\d]/g, "");
11
- selected.value = numericPrefix;
9
+ selected.value = target.value;
10
+ if (prefix) {
11
+ const numericPrefix = "+" + selected.value.replace(/[^\d]/g, "");
12
+ prefix.value = numericPrefix;
13
+ }
12
14
  });
13
15
  return /* @__PURE__ */ jsx("div", {
14
16
  class: "select-container",
@@ -8,5 +8,6 @@ export interface SelectProps {
8
8
  }>;
9
9
  label: string;
10
10
  selected: Signal<string>;
11
+ prefix?: Signal<string>;
11
12
  }
12
13
  export declare const Select: import("@builder.io/qwik").Component<SelectProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",