@bloom-housing/ui-components 12.0.28 → 12.0.29
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,28 +4,30 @@ export var FormAddress = function (_a) {
|
|
|
4
4
|
var _b, _c, _d;
|
|
5
5
|
var subtitle = _a.subtitle, dataKey = _a.dataKey, _e = _a.enableMailCheckbox, enableMailCheckbox = _e === void 0 ? false : _e, register = _a.register, errors = _a.errors, required = _a.required, stateKeys = _a.stateKeys;
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement(
|
|
8
|
-
React.createElement(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
React.createElement("fieldset", null,
|
|
8
|
+
React.createElement("legend", { className: "text__caps-spaced ".concat(!subtitle ? "sr-only" : "") }, !subtitle ? t("application.preferences.options.address") : subtitle),
|
|
9
|
+
React.createElement(GridSection, null,
|
|
10
|
+
React.createElement(GridCell, { span: 2 },
|
|
11
|
+
React.createElement(ViewItem, { label: t("application.contact.streetAddress") },
|
|
12
|
+
React.createElement(Field, { id: "".concat(dataKey, ".street"), name: "".concat(dataKey, ".street"), label: t("application.contact.streetAddress"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".street"), errors), errorMessage: ((_b = resolveObject("".concat(dataKey, ".street"), errors)) === null || _b === void 0 ? void 0 : _b.type) === "maxLength"
|
|
13
|
+
? t("errors.maxLength")
|
|
14
|
+
: t("errors.streetError"), readerOnly: true }))),
|
|
15
|
+
React.createElement(GridCell, null,
|
|
16
|
+
React.createElement(ViewItem, { label: t("application.contact.apt") },
|
|
17
|
+
React.createElement(Field, { id: "".concat(dataKey, ".street2"), name: "".concat(dataKey, ".street2"), label: t("application.contact.apt"), register: register, readerOnly: true, error: !!resolveObject("".concat(dataKey, ".street2"), errors), validation: { maxLength: 64 }, errorMessage: t("errors.maxLength") }))),
|
|
18
|
+
React.createElement(GridCell, null,
|
|
19
|
+
React.createElement(ViewItem, { label: t("application.contact.city") },
|
|
20
|
+
React.createElement(Field, { id: "".concat(dataKey, ".city"), name: "".concat(dataKey, ".city"), label: t("application.contact.city"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".city"), errors), errorMessage: ((_c = resolveObject("".concat(dataKey, ".city"), errors)) === null || _c === void 0 ? void 0 : _c.type) === "maxLength"
|
|
21
|
+
? t("errors.maxLength")
|
|
22
|
+
: t("errors.cityError"), readerOnly: true }))),
|
|
23
|
+
React.createElement(GridCell, { className: "md:grid md:grid-cols-2 md:gap-8", span: 2 },
|
|
24
|
+
React.createElement(ViewItem, { label: t("application.contact.state"), className: "mb-0" },
|
|
25
|
+
React.createElement(Select, { id: "".concat(dataKey, ".state"), name: "".concat(dataKey, ".state"), label: t("application.contact.state"), labelClassName: "sr-only", register: register, controlClassName: "control", options: stateKeys, keyPrefix: "states", validation: { required: required }, error: !!resolveObject("".concat(dataKey, ".state"), errors), errorMessage: t("errors.stateError") })),
|
|
26
|
+
React.createElement(ViewItem, { label: t("application.contact.zip") },
|
|
27
|
+
React.createElement(Field, { id: "".concat(dataKey, ".zipCode"), name: "".concat(dataKey, ".zipCode"), label: t("application.contact.zip"), register: register, validation: { required: required, maxLength: 64 }, error: !!resolveObject("".concat(dataKey, ".zipCode"), errors), errorMessage: ((_d = resolveObject("".concat(dataKey, ".zipCode"), errors)) === null || _d === void 0 ? void 0 : _d.type) === "maxLength"
|
|
28
|
+
? t("errors.maxLength")
|
|
29
|
+
: t("errors.zipCodeError"), readerOnly: true }))),
|
|
30
|
+
enableMailCheckbox && (React.createElement(GridCell, { span: 2 },
|
|
31
|
+
React.createElement(Field, { id: "application.sendMailToMailingAddress", name: "application.sendMailToMailingAddress", type: "checkbox", label: t("application.contact.sendMailToMailingAddress"), register: register })))))));
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=preferences.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../src/helpers/preferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAYzF,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAQT;;QAPjB,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,0BAA0B,EAA1B,kBAAkB,mBAAG,KAAK,KAAA,EAC1B,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,SAAS,eAAA;IAET,OAAO,CACL;QACE,
|
|
1
|
+
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../src/helpers/preferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAYzF,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAQT;;QAPjB,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,0BAA0B,EAA1B,kBAAkB,mBAAG,KAAK,KAAA,EAC1B,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,SAAS,eAAA;IAET,OAAO,CACL;QACE;YACE,gCAAQ,SAAS,EAAE,4BAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,E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Q,IAAC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC;wBAC3C,oBAAC,KAAK,IACJ,EAAE,EAAE,UAAG,OAAO,aAAU,EACxB,IAAI,EAAE,UAAG,OAAO,aAAU,EAC1B,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,EACnC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,EAAE,QAAQ,UAAA,EAAE,SAAS,EAAE,EAAE,EAAE,EACvC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,UAAG,OAAO,aAAU,EAAE,MAAM,CAAC,EACpD,YAAY,EACV,CAAA,MAAA,aAAa,CAAC,UAAG,OAAO,aAAU,EAAE,MAAM,CAAC,0CAAE,IAAI,MAAK,WAAW;gCAC/D,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;gCACvB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,EAE9B,UAAU,SACV,CACO,CACF;gBAEV,kBAAkB,IAAI,CACrB,oBAAC,QAAQ,IAAC,IAAI,EAAE,CAAC;oBACf,oBAAC,KAAK,IACJ,EAAE,EAAC,sCAAsC,EACzC,IAAI,EAAC,sCAAsC,EAC3C,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,CAAC,CAAC,8CAA8C,CAAC,EACxD,QAAQ,EAAE,QAAQ,GAClB,CACO,CACZ,CACW,CACL,CACV,CACJ,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.29",
|
|
4
4
|
"author": "Sean Albert <sean.albert@exygy.com>",
|
|
5
5
|
"description": "Shared user interface components for Bloom affordable housing system",
|
|
6
6
|
"homepage": "https://github.com/bloom-housing/ui-components",
|
|
@@ -3,7 +3,7 @@ import { UseFormMethods } from "react-hook-form"
|
|
|
3
3
|
import { t, GridSection, ViewItem, GridCell, Field, Select, resolveObject } from "../../"
|
|
4
4
|
|
|
5
5
|
type FormAddressProps = {
|
|
6
|
-
subtitle
|
|
6
|
+
subtitle?: string
|
|
7
7
|
dataKey: string
|
|
8
8
|
enableMailCheckbox?: boolean
|
|
9
9
|
register: UseFormMethods["register"]
|
|
@@ -23,110 +23,111 @@ export const FormAddress = ({
|
|
|
23
23
|
}: FormAddressProps) => {
|
|
24
24
|
return (
|
|
25
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<ViewItem label={t("application.contact.city")}>
|
|
64
|
-
<Field
|
|
65
|
-
id={`${dataKey}.city`}
|
|
66
|
-
name={`${dataKey}.city`}
|
|
67
|
-
label={t("application.contact.cityName")}
|
|
68
|
-
placeholder={t("application.contact.cityName")}
|
|
69
|
-
register={register}
|
|
70
|
-
validation={{ required, maxLength: 64 }}
|
|
71
|
-
error={!!resolveObject(`${dataKey}.city`, errors)}
|
|
72
|
-
errorMessage={
|
|
73
|
-
resolveObject(`${dataKey}.city`, errors)?.type === "maxLength"
|
|
74
|
-
? t("errors.maxLength")
|
|
75
|
-
: t("errors.cityError")
|
|
76
|
-
}
|
|
77
|
-
readerOnly
|
|
78
|
-
/>
|
|
79
|
-
</ViewItem>
|
|
80
|
-
</GridCell>
|
|
26
|
+
<fieldset>
|
|
27
|
+
<legend className={`text__caps-spaced ${!subtitle ? "sr-only" : ""}`}>
|
|
28
|
+
{!subtitle ? t("application.preferences.options.address") : subtitle}
|
|
29
|
+
</legend>
|
|
30
|
+
<GridSection>
|
|
31
|
+
<GridCell span={2}>
|
|
32
|
+
<ViewItem label={t("application.contact.streetAddress")}>
|
|
33
|
+
<Field
|
|
34
|
+
id={`${dataKey}.street`}
|
|
35
|
+
name={`${dataKey}.street`}
|
|
36
|
+
label={t("application.contact.streetAddress")}
|
|
37
|
+
register={register}
|
|
38
|
+
validation={{ required, maxLength: 64 }}
|
|
39
|
+
error={!!resolveObject(`${dataKey}.street`, errors)}
|
|
40
|
+
errorMessage={
|
|
41
|
+
resolveObject(`${dataKey}.street`, errors)?.type === "maxLength"
|
|
42
|
+
? t("errors.maxLength")
|
|
43
|
+
: t("errors.streetError")
|
|
44
|
+
}
|
|
45
|
+
readerOnly
|
|
46
|
+
/>
|
|
47
|
+
</ViewItem>
|
|
48
|
+
</GridCell>
|
|
49
|
+
<GridCell>
|
|
50
|
+
<ViewItem label={t("application.contact.apt")}>
|
|
51
|
+
<Field
|
|
52
|
+
id={`${dataKey}.street2`}
|
|
53
|
+
name={`${dataKey}.street2`}
|
|
54
|
+
label={t("application.contact.apt")}
|
|
55
|
+
register={register}
|
|
56
|
+
readerOnly
|
|
57
|
+
error={!!resolveObject(`${dataKey}.street2`, errors)}
|
|
58
|
+
validation={{ maxLength: 64 }}
|
|
59
|
+
errorMessage={t("errors.maxLength")}
|
|
60
|
+
/>
|
|
61
|
+
</ViewItem>
|
|
62
|
+
</GridCell>
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
64
|
+
<GridCell>
|
|
65
|
+
<ViewItem label={t("application.contact.city")}>
|
|
66
|
+
<Field
|
|
67
|
+
id={`${dataKey}.city`}
|
|
68
|
+
name={`${dataKey}.city`}
|
|
69
|
+
label={t("application.contact.city")}
|
|
70
|
+
register={register}
|
|
71
|
+
validation={{ required, maxLength: 64 }}
|
|
72
|
+
error={!!resolveObject(`${dataKey}.city`, errors)}
|
|
73
|
+
errorMessage={
|
|
74
|
+
resolveObject(`${dataKey}.city`, errors)?.type === "maxLength"
|
|
75
|
+
? t("errors.maxLength")
|
|
76
|
+
: t("errors.cityError")
|
|
77
|
+
}
|
|
78
|
+
readerOnly
|
|
79
|
+
/>
|
|
80
|
+
</ViewItem>
|
|
81
|
+
</GridCell>
|
|
98
82
|
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</ViewItem>
|
|
116
|
-
</GridCell>
|
|
83
|
+
<GridCell className="md:grid md:grid-cols-2 md:gap-8" span={2}>
|
|
84
|
+
<ViewItem label={t("application.contact.state")} className="mb-0">
|
|
85
|
+
<Select
|
|
86
|
+
id={`${dataKey}.state`}
|
|
87
|
+
name={`${dataKey}.state`}
|
|
88
|
+
label={t("application.contact.state")}
|
|
89
|
+
labelClassName="sr-only"
|
|
90
|
+
register={register}
|
|
91
|
+
controlClassName="control"
|
|
92
|
+
options={stateKeys}
|
|
93
|
+
keyPrefix="states"
|
|
94
|
+
validation={{ required }}
|
|
95
|
+
error={!!resolveObject(`${dataKey}.state`, errors)}
|
|
96
|
+
errorMessage={t("errors.stateError")}
|
|
97
|
+
/>
|
|
98
|
+
</ViewItem>
|
|
117
99
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
100
|
+
<ViewItem label={t("application.contact.zip")}>
|
|
101
|
+
<Field
|
|
102
|
+
id={`${dataKey}.zipCode`}
|
|
103
|
+
name={`${dataKey}.zipCode`}
|
|
104
|
+
label={t("application.contact.zip")}
|
|
105
|
+
register={register}
|
|
106
|
+
validation={{ required, maxLength: 64 }}
|
|
107
|
+
error={!!resolveObject(`${dataKey}.zipCode`, errors)}
|
|
108
|
+
errorMessage={
|
|
109
|
+
resolveObject(`${dataKey}.zipCode`, errors)?.type === "maxLength"
|
|
110
|
+
? t("errors.maxLength")
|
|
111
|
+
: t("errors.zipCodeError")
|
|
112
|
+
}
|
|
113
|
+
readerOnly
|
|
114
|
+
/>
|
|
115
|
+
</ViewItem>
|
|
127
116
|
</GridCell>
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
|
|
118
|
+
{enableMailCheckbox && (
|
|
119
|
+
<GridCell span={2}>
|
|
120
|
+
<Field
|
|
121
|
+
id="application.sendMailToMailingAddress"
|
|
122
|
+
name="application.sendMailToMailingAddress"
|
|
123
|
+
type="checkbox"
|
|
124
|
+
label={t("application.contact.sendMailToMailingAddress")}
|
|
125
|
+
register={register}
|
|
126
|
+
/>
|
|
127
|
+
</GridCell>
|
|
128
|
+
)}
|
|
129
|
+
</GridSection>
|
|
130
|
+
</fieldset>
|
|
130
131
|
</>
|
|
131
132
|
)
|
|
132
133
|
}
|