jcicl 1.2.5 → 1.2.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.
- package/ClientMatchCard/ClientMatchCard.d.ts +1 -1
- package/ClientMatchCard/ClientMatchCard.js +1 -1
- package/package.json +1 -1
- package/utils.d.ts +1 -0
- package/utils.js +38 -33
|
@@ -4,7 +4,7 @@ export interface ClientMatchCardClient {
|
|
|
4
4
|
id: number;
|
|
5
5
|
firstName: string;
|
|
6
6
|
lastName: string;
|
|
7
|
-
email: string;
|
|
7
|
+
email: string | null;
|
|
8
8
|
phone: string | null;
|
|
9
9
|
/** Accepts either string or number to match both legacy int SSN columns and the newer string-based shape in SocialServices. */
|
|
10
10
|
ssn?: string | number | null;
|
|
@@ -99,7 +99,7 @@ const P = [
|
|
|
99
99
|
] }),
|
|
100
100
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
101
101
|
/* @__PURE__ */ a(C, { size: 22, className: "shrink-0 text-jc-gray-3" }),
|
|
102
|
-
/* @__PURE__ */ a("span", { className: "truncate", children: s.email })
|
|
102
|
+
/* @__PURE__ */ a("span", { className: "truncate", children: s.email ?? "—" })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
105
105
|
/* @__PURE__ */ a(S, { size: 22, className: "shrink-0 text-jc-gray-3" }),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcicl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.7",
|
|
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",
|
package/utils.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export declare const formattedOrMaskedTypes: Set<string>;
|
|
|
7
7
|
export declare const useIsMobile: () => boolean;
|
|
8
8
|
export declare const useIsTablet: () => boolean;
|
|
9
9
|
export declare const calculateAge: (birthDateString: string) => number;
|
|
10
|
+
export declare function enumKeyToLabel<T extends Record<string, string | number>>(enumObj: T, value: T[keyof T]): string;
|
package/utils.js
CHANGED
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { formattersByType as
|
|
3
|
-
import { formatAddress as
|
|
1
|
+
import i from "./theme.js";
|
|
2
|
+
import { formattersByType as m } from "./formatters.js";
|
|
3
|
+
import { formatAddress as T, formatCurrency as h, formatDate as k, formatDateTime as x, formatPhoneNumber as D, formatSSN as M, formatTimestamp as V, formatZipCode as Z } from "./formatters.js";
|
|
4
4
|
import { maskersByType as l } from "./maskers.js";
|
|
5
|
-
import { defaultMasker as
|
|
6
|
-
import { states as
|
|
7
|
-
import { inputValidatorsByType as
|
|
5
|
+
import { defaultMasker as w, maskSSN as A } from "./maskers.js";
|
|
6
|
+
import { states as z } from "./constants.js";
|
|
7
|
+
import { inputValidatorsByType as B, isValidCityName as O, isValidEmail as P, isValidPhoneNumber as j, isValidSSN as E, isValidZipCode as F, validateEmail as I, validatePhoneNumber as Y, validateSSN as K, validateZipCode as L } from "./validators.js";
|
|
8
8
|
import { u as s } from "./.chunks/useMediaQuery.js";
|
|
9
|
-
const
|
|
10
|
-
...Object.keys(
|
|
9
|
+
const p = /* @__PURE__ */ new Set([
|
|
10
|
+
...Object.keys(m),
|
|
11
11
|
...Object.keys(l),
|
|
12
12
|
"text"
|
|
13
|
-
]),
|
|
13
|
+
]), u = () => s(`(max-width: ${i.screenSizes.mobile})`), y = () => s(`(max-width: ${i.screenSizes.tablet})`), N = (e) => {
|
|
14
14
|
e = e.slice(0, 10) + "T00:00:00";
|
|
15
15
|
const t = /* @__PURE__ */ new Date(), a = new Date(e);
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
return (
|
|
16
|
+
let r = t.getFullYear() - a.getFullYear();
|
|
17
|
+
const o = t.getMonth() - a.getMonth();
|
|
18
|
+
return (o < 0 || o === 0 && t.getDate() < a.getDate()) && r--, r;
|
|
19
19
|
};
|
|
20
|
+
function b(e, t) {
|
|
21
|
+
const a = Object.keys(e).filter((r) => isNaN(Number(r))).find((r) => e[r] === t);
|
|
22
|
+
return a ? a.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").trim() : String(t);
|
|
23
|
+
}
|
|
20
24
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
D as
|
|
29
|
-
M as
|
|
30
|
-
V as
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
N as calculateAge,
|
|
26
|
+
w as defaultMasker,
|
|
27
|
+
b as enumKeyToLabel,
|
|
28
|
+
T as formatAddress,
|
|
29
|
+
h as formatCurrency,
|
|
30
|
+
k as formatDate,
|
|
31
|
+
x as formatDateTime,
|
|
32
|
+
D as formatPhoneNumber,
|
|
33
|
+
M as formatSSN,
|
|
34
|
+
V as formatTimestamp,
|
|
35
|
+
Z as formatZipCode,
|
|
36
|
+
p as formattedOrMaskedTypes,
|
|
37
|
+
m as formattersByType,
|
|
38
|
+
B as inputValidatorsByType,
|
|
39
|
+
O as isValidCityName,
|
|
40
|
+
P as isValidEmail,
|
|
41
|
+
j as isValidPhoneNumber,
|
|
37
42
|
E as isValidSSN,
|
|
38
43
|
F as isValidZipCode,
|
|
39
|
-
|
|
44
|
+
A as maskSSN,
|
|
40
45
|
l as maskersByType,
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
z as states,
|
|
47
|
+
u as useIsMobile,
|
|
43
48
|
y as useIsTablet,
|
|
44
49
|
I as validateEmail,
|
|
45
50
|
Y as validatePhoneNumber,
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
K as validateSSN,
|
|
52
|
+
L as validateZipCode
|
|
48
53
|
};
|