jcicl 0.0.271 → 0.0.275

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.
@@ -15,6 +15,7 @@ export type FormFieldsProps = {
15
15
  columnsOverride?: string;
16
16
  gap?: number;
17
17
  noLabel?: boolean;
18
+ checkboxContainer?: boolean;
18
19
  formDefaults: Record<string, any>;
19
20
  onChange: (key: string, e: React.ChangeEvent<HTMLInputElement>, type?: string) => void;
20
21
  };
@@ -1,34 +1,42 @@
1
- import { jsxs as h, Fragment as g, jsx as e } from "react/jsx-runtime";
2
- import { FormInput as x } from "../FormInput/FormInput.js";
3
- import { FormSectionTitle as w, FormFieldGrid as j } from "../FormComponents/FormComponents.js";
4
- import D from "../theme.js";
5
- import { u as S } from "../.chunks/useMediaQuery.js";
6
- const K = ({
7
- title: m,
8
- fields: l,
9
- columns: t = S(`(max-width: ${D.screenSizes.tablet})`) ? 2 : 3,
10
- columnsOverride: n,
11
- gap: d = 21,
12
- noLabel: s = !1,
13
- formDefaults: i,
14
- onChange: a
15
- }) => /* @__PURE__ */ h(g, { children: [
16
- m && /* @__PURE__ */ e(w, { children: m }),
17
- /* @__PURE__ */ e(j, { columns: t, columnsOverride: n, gap: d, children: l.map(({ key: o, label: u, type: r, limit: F, options: c, defaultValue: p }) => (console.log("Form Defaults:", i), console.log("Field Key:", o), /* @__PURE__ */ e(
18
- x,
19
- {
20
- onChange: (f) => a(o, f, r),
21
- label: u,
22
- type: r,
23
- limit: F,
24
- defaultValue: i[o] || r === "multiDropdown" ? [] : p,
25
- noLabel: s,
26
- options: c,
27
- multiple: r === "multiDropdown"
28
- },
29
- o
30
- ))) })
31
- ] });
1
+ import { jsxs as g, Fragment as j, jsx as r } from "react/jsx-runtime";
2
+ import { FormInput as C } from "../FormInput/FormInput.js";
3
+ import { FormSectionTitle as D, FormFieldGrid as S, FormFieldCheckboxContainer as b } from "../FormComponents/FormComponents.js";
4
+ import z from "../theme.js";
5
+ import { u as G } from "../.chunks/useMediaQuery.js";
6
+ const $ = ({
7
+ title: i,
8
+ fields: d,
9
+ columns: s = G(`(max-width: ${z.screenSizes.tablet})`) ? 2 : 3,
10
+ columnsOverride: u,
11
+ gap: a = 21,
12
+ noLabel: F = !1,
13
+ checkboxContainer: m = !1,
14
+ formDefaults: t,
15
+ onChange: p
16
+ }) => {
17
+ const n = () => d.map(({ key: o, label: c, type: e, limit: f, options: h, defaultValue: l }) => {
18
+ const x = t[o] ? t[o] : l || (e === "multiDropdown" ? [] : "");
19
+ return /* @__PURE__ */ r(
20
+ C,
21
+ {
22
+ onChange: (w) => p(o, w, e),
23
+ label: c,
24
+ type: e,
25
+ limit: f,
26
+ defaultValue: x,
27
+ noLabel: F,
28
+ options: h,
29
+ multiple: e === "multiDropdown"
30
+ },
31
+ o
32
+ );
33
+ });
34
+ return /* @__PURE__ */ g(j, { children: [
35
+ i && /* @__PURE__ */ r(D, { children: i }),
36
+ !m && /* @__PURE__ */ r(S, { columns: s, columnsOverride: u, gap: a, children: /* @__PURE__ */ r(n, {}) }),
37
+ m && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(n, {}) })
38
+ ] });
39
+ };
32
40
  export {
33
- K as default
41
+ $ as default
34
42
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "0.0.271",
4
+ "version": "0.0.275",
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",