jcicl 0.0.231 → 0.0.235

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.
@@ -16,6 +16,7 @@ const p = ["loading", "hasPagination", "loadingColor"], S = d("div", { shouldFor
16
16
  justify-content: ${r ? "center" : "start"};
17
17
  align-items: center;
18
18
  width: 100%;
19
+ height: 100%;
19
20
  box-sizing: border-box;
20
21
  padding-bottom: ${e ? "114px" : "72px"};
21
22
  > * div {
@@ -35,6 +36,7 @@ const p = ["loading", "hasPagination", "loadingColor"], S = d("div", { shouldFor
35
36
  gap: 27px;
36
37
  max-width: 1300px;
37
38
  width: 100%;
39
+ height: 100%;
38
40
  box-sizing: border-box;
39
41
  `
40
42
  })), P = {
@@ -6,6 +6,7 @@ export interface LabeledCurrencyInputProps extends InputProps {
6
6
  label: string;
7
7
  grid?: boolean;
8
8
  noLabel?: boolean;
9
+ defaultValue?: string;
9
10
  }
10
11
  export declare const LabeledCurrencyInput: React.FC<LabeledCurrencyInputProps>;
11
12
  export default LabeledCurrencyInput;
@@ -1,10 +1,10 @@
1
- import { jsxs as s, jsx as m } from "react/jsx-runtime";
2
- import { useState as f } from "react";
3
- import { n as d } from "../.chunks/emotion-styled.browser.esm.js";
4
- import { c as g } from "../.chunks/emotion-react.browser.esm.js";
5
- import { Input as h } from "../Input/Input.js";
6
- const w = d("div")(({ grid: t }) => ({
7
- ...g`
1
+ import { jsxs as p, jsx as g } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import { n as w } from "../.chunks/emotion-styled.browser.esm.js";
4
+ import { c as x } from "../.chunks/emotion-react.browser.esm.js";
5
+ import { Input as y } from "../Input/Input.js";
6
+ const I = w("div")(({ grid: r }) => ({
7
+ ...x`
8
8
  display: flex;
9
9
  flex-wrap: nowrap;
10
10
  gap: 9px;
@@ -20,29 +20,35 @@ const w = d("div")(({ grid: t }) => ({
20
20
  }
21
21
 
22
22
  .MuiCurrencyInputBase-root {
23
- width: ${t && "100%"};
23
+ width: ${r && "100%"};
24
24
  }
25
25
  `
26
26
  })), j = ({
27
- label: t,
27
+ label: r,
28
28
  grid: l = !0,
29
- noLabel: p = !1,
30
- onChange: n,
31
- ...u
29
+ noLabel: m = !1,
30
+ onChange: a,
31
+ defaultValue: n,
32
+ ...c
32
33
  }) => {
33
- const [i, r] = f("");
34
- return /* @__PURE__ */ s(w, { grid: l, className: "jcLabeledCurrencyInput", children: [
35
- !p && /* @__PURE__ */ s("span", { children: [
36
- t,
34
+ let t = (n == null ? void 0 : n.replace(/[^0-9.-]+/g, "")) ?? "";
35
+ t && (t = new Intl.NumberFormat("en-US", {
36
+ style: "decimal",
37
+ maximumFractionDigits: 2
38
+ }).format(Number(t)));
39
+ const [u, o] = d(t);
40
+ return /* @__PURE__ */ p(I, { grid: l, className: "jcLabeledCurrencyInput", children: [
41
+ !m && /* @__PURE__ */ p("span", { children: [
42
+ r,
37
43
  ":"
38
44
  ] }),
39
- /* @__PURE__ */ m(h, { ...u, onChange: (a) => {
40
- const { value: c } = a.target, e = c.replace(/[^0-9.-]+/g, ""), o = new Intl.NumberFormat("en-US", {
45
+ /* @__PURE__ */ g(y, { ...c, onChange: (i) => {
46
+ const { value: f } = i.target, e = f.replace(/[^0-9.-]+/g, ""), s = new Intl.NumberFormat("en-US", {
41
47
  style: "decimal",
42
48
  maximumFractionDigits: 2
43
49
  }).format(Number(e) || 0);
44
- e && e.length > 1 && e[e.length - 1] === "." ? r(o + ".") : r(e ? o : ""), n && n(a);
45
- }, value: `$${i}` })
50
+ e && e.length > 1 && e[e.length - 1] === "." ? o(s + ".") : o(e ? s : ""), a && a(i);
51
+ }, value: `$${u}` })
46
52
  ] });
47
53
  };
48
54
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "0.0.231",
4
+ "version": "0.0.235",
5
5
  "description": "Component library for the websites of Johnson County Iowa",
6
6
  "license": "MIT",
7
7
  "homepage": "https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_git/JCComponentLibrary?path=%2FREADME.md&version=GBmaster",