jcicl 1.0.42 → 1.0.44
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/CustomAlert/CustomAlert.js +24 -23
- package/FormFields/FormFields.d.ts +2 -1
- package/FormFields/FormFields.js +52 -50
- package/FormInput/FormInput.d.ts +11 -3
- package/FormInput/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as x } from "react";
|
|
3
|
-
import { n as
|
|
3
|
+
import { n as m } from "../.chunks/emotion-styled.browser.esm.js";
|
|
4
4
|
import { Button as b } from "../Button/Button.js";
|
|
5
5
|
import { Flex as u } from "../Flex/Flex.js";
|
|
6
|
-
import
|
|
7
|
-
const g =
|
|
6
|
+
import s from "../theme.js";
|
|
7
|
+
const g = m("div")`
|
|
8
8
|
position: fixed;
|
|
9
9
|
top: 0;
|
|
10
10
|
left: 0;
|
|
@@ -12,25 +12,26 @@ const g = p("div")`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
background-color: rgba(0, 0, 0, 0.5);
|
|
14
14
|
display: flex;
|
|
15
|
-
align-items:
|
|
15
|
+
align-items: start;
|
|
16
16
|
justify-content: center;
|
|
17
|
+
padding-top: 13vh;
|
|
17
18
|
z-index: 2000;
|
|
18
|
-
`,
|
|
19
|
+
`, v = m("div")`
|
|
19
20
|
padding: 16px;
|
|
20
|
-
background-color: ${
|
|
21
|
-
color: ${
|
|
21
|
+
background-color: ${s.colors.white};
|
|
22
|
+
color: ${s.colors.black};
|
|
22
23
|
border-radius: 15px;
|
|
23
24
|
font-size: 0.875rem;
|
|
24
25
|
min-width: 300px;
|
|
25
26
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
|
26
|
-
`,
|
|
27
|
-
const
|
|
27
|
+
`, p = ({ message: i, buttonNames: c = ["OK"], buttonProps: d = [{}], onComplete: e }) => {
|
|
28
|
+
const a = (o, t) => {
|
|
28
29
|
const l = o ? o(t) : void 0;
|
|
29
|
-
|
|
30
|
+
e == null || e(l);
|
|
30
31
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ n(g, { children: /* @__PURE__ */ n(v, { role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ h(u, { column: !0, gap: "16px", children: [
|
|
33
|
+
/* @__PURE__ */ n(u, { column: !0, children: i }),
|
|
34
|
+
/* @__PURE__ */ n(u, { justifyContent: "flex-end", gap: "8px", children: c.map((o, t) => {
|
|
34
35
|
const l = o === "Cancel" || o === "Close", r = d[t] || {};
|
|
35
36
|
return /* @__PURE__ */ x(
|
|
36
37
|
b,
|
|
@@ -38,25 +39,25 @@ const g = p("div")`
|
|
|
38
39
|
...r,
|
|
39
40
|
key: t,
|
|
40
41
|
variant: l && !r.variant ? "custom" : r.variant || 1,
|
|
41
|
-
onClick: (f) =>
|
|
42
|
-
backgroundColor: l && !r.backgroundColor ?
|
|
43
|
-
hoverColor: l && !r.hoverColor ?
|
|
42
|
+
onClick: (f) => a(r.onClick, f),
|
|
43
|
+
backgroundColor: l && !r.backgroundColor ? s.colors.charcoal : r.backgroundColor,
|
|
44
|
+
hoverColor: l && !r.hoverColor ? s.colors.slate : r.hoverColor
|
|
44
45
|
},
|
|
45
46
|
o
|
|
46
47
|
);
|
|
47
48
|
}) })
|
|
48
49
|
] }) }) });
|
|
49
|
-
}, A = ({ type: i, message: c, buttonNames: d, buttonProps:
|
|
50
|
+
}, A = ({ type: i, message: c, buttonNames: d, buttonProps: e, onComplete: a }) => {
|
|
50
51
|
if (i === "alert")
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
let o = d, t =
|
|
53
|
-
return i === "confirm" && (o = ["OK", "Cancel"], t = [{ onClick: () => !0 }, { onClick: () => !1 }]), /* @__PURE__ */
|
|
54
|
-
|
|
52
|
+
return /* @__PURE__ */ n(p, { message: c, buttonProps: [{ onClick: () => !0 }], onComplete: a });
|
|
53
|
+
let o = d, t = e;
|
|
54
|
+
return i === "confirm" && (o = ["OK", "Cancel"], t = [{ onClick: () => !0 }, { onClick: () => !1 }]), /* @__PURE__ */ n(
|
|
55
|
+
p,
|
|
55
56
|
{
|
|
56
57
|
message: c,
|
|
57
58
|
buttonNames: o,
|
|
58
59
|
buttonProps: t,
|
|
59
|
-
onComplete:
|
|
60
|
+
onComplete: a
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FormInputType } from '../FormInput';
|
|
1
2
|
import { DropdownOption } from '../LabeledDropdown';
|
|
2
3
|
import { AllInputProps } from '../FormInput/FormInput';
|
|
3
4
|
export type FormField = {
|
|
4
5
|
key: string;
|
|
5
6
|
label?: string;
|
|
6
7
|
sublabel?: string;
|
|
7
|
-
type:
|
|
8
|
+
type: FormInputType;
|
|
8
9
|
options?: DropdownOption[];
|
|
9
10
|
limit?: number;
|
|
10
11
|
defaultValue?: string | number;
|
package/FormFields/FormFields.js
CHANGED
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as C, Fragment as D, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { FormInput as p } from "../FormInput/FormInput.js";
|
|
3
|
-
import { FormSectionTitle as g, FormFieldGrid as j, FormFieldCheckboxContainer as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
title: a,
|
|
3
|
+
import { FormSectionTitle as g, FormFieldGrid as j, FormFieldCheckboxContainer as T } from "../FormComponents/FormComponents.js";
|
|
4
|
+
import { isTablet as G } from "../utils.js";
|
|
5
|
+
const q = ({
|
|
6
|
+
title: t,
|
|
8
7
|
fields: h,
|
|
9
|
-
columns: v
|
|
10
|
-
columnsOverride:
|
|
11
|
-
gap:
|
|
12
|
-
noLabel:
|
|
8
|
+
columns: v,
|
|
9
|
+
columnsOverride: b,
|
|
10
|
+
gap: w = 21,
|
|
11
|
+
noLabel: a = !1,
|
|
13
12
|
checkboxContainer: F = !1,
|
|
14
13
|
formDefaults: c,
|
|
15
14
|
onChange: x
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
15
|
+
}) => {
|
|
16
|
+
const f = v ?? (G() ? 2 : 3);
|
|
17
|
+
return /* @__PURE__ */ C(D, { children: [
|
|
18
|
+
t && /* @__PURE__ */ l(g, { children: t }),
|
|
19
|
+
!F && /* @__PURE__ */ l(j, { columns: f, columnsOverride: b, gap: w, children: h.map(({ key: r, label: m, type: o, limit: d, options: u, defaultValue: i, ...e }) => {
|
|
20
|
+
const n = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
22
|
+
p,
|
|
23
|
+
{
|
|
24
|
+
onChange: (s) => x(r, s, o),
|
|
25
|
+
label: m,
|
|
26
|
+
type: o,
|
|
27
|
+
limit: d,
|
|
28
|
+
...o === "checkbox" ? { checked: !!n } : { value: n },
|
|
29
|
+
noLabel: a,
|
|
30
|
+
options: u,
|
|
31
|
+
multiple: o === "multiDropdown",
|
|
32
|
+
...e
|
|
33
|
+
},
|
|
34
|
+
r
|
|
35
|
+
);
|
|
36
|
+
}) }),
|
|
37
|
+
F && /* @__PURE__ */ l(T, { children: h.map(({ key: r, label: m, type: o, limit: d, options: u, defaultValue: i, ...e }) => {
|
|
38
|
+
const n = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
|
|
39
|
+
return /* @__PURE__ */ l(
|
|
40
|
+
p,
|
|
41
|
+
{
|
|
42
|
+
onChange: (s) => x(r, s, o),
|
|
43
|
+
label: m,
|
|
44
|
+
type: o,
|
|
45
|
+
limit: d,
|
|
46
|
+
...o === "checkbox" ? { checked: !!n } : { defaultValue: n },
|
|
47
|
+
noLabel: a,
|
|
48
|
+
options: u,
|
|
49
|
+
multiple: o === "multiDropdown",
|
|
50
|
+
...e
|
|
51
|
+
},
|
|
52
|
+
r
|
|
53
|
+
);
|
|
54
|
+
}) })
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
q as default
|
|
57
59
|
};
|
package/FormInput/FormInput.d.ts
CHANGED
|
@@ -2,11 +2,19 @@ import { LabeledInputProps } from '../LabeledInput';
|
|
|
2
2
|
import { LabeledCurrencyInputProps } from '../LabeledCurrencyInput';
|
|
3
3
|
import { LabeledCheckboxProps } from '../LabeledCheckbox';
|
|
4
4
|
import { LabeledRadioProps } from '../LabeledRadio';
|
|
5
|
-
import { LabeledDropdownProps } from '../LabeledDropdown';
|
|
5
|
+
import { LabeledDropdownProps, DropdownOption } from '../LabeledDropdown';
|
|
6
6
|
import { LabeledTextAreaProps } from '../LabeledTextArea/LabeledTextArea';
|
|
7
7
|
export type AllInputProps = LabeledInputProps & LabeledCheckboxProps & LabeledRadioProps & LabeledDropdownProps & LabeledCurrencyInputProps & LabeledTextAreaProps;
|
|
8
|
-
export type
|
|
9
|
-
|
|
8
|
+
export type FormInputType = 'checkbox' | 'currency' | 'date' | 'dropdown' | 'email' | 'multiDropdown' | 'number' | 'phone' | 'radio' | 'text' | 'textarea' | 'url' | 'zip';
|
|
9
|
+
type ConflictingKeys = 'onChange' | 'options' | 'value' | 'checked' | 'defaultValue' | 'label';
|
|
10
|
+
export type FormInputProps = Partial<Omit<AllInputProps, ConflictingKeys | 'type'>> & {
|
|
11
|
+
type?: FormInputType;
|
|
12
|
+
onChange?: (event: any, ...args: any[]) => void;
|
|
13
|
+
options?: DropdownOption[];
|
|
14
|
+
value?: unknown;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
defaultValue?: unknown;
|
|
17
|
+
label?: string;
|
|
10
18
|
};
|
|
11
19
|
export declare const FormInput: React.FC<FormInputProps>;
|
|
12
20
|
export default FormInput;
|
package/FormInput/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, type FormInputProps } from './FormInput.tsx';
|
|
1
|
+
export { default, type FormInputProps, type FormInputType } from './FormInput.tsx';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcicl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.44",
|
|
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",
|