@bloom-housing/ui-components 12.6.2 → 12.6.4
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/dist/src/forms/Field.js +17 -1
- package/dist/src/forms/Field.js.map +1 -1
- package/dist/src/page_components/listing/listing_sidebar/QuantityRowSection.d.ts +2 -1
- package/dist/src/page_components/listing/listing_sidebar/QuantityRowSection.js +2 -2
- package/dist/src/page_components/listing/listing_sidebar/QuantityRowSection.js.map +1 -1
- package/dist/src/page_components/listing/listing_sidebar/QuantityRowSection.stories.d.ts +1 -1
- package/package.json +1 -1
- package/src/forms/Field.tsx +20 -2
- package/src/page_components/listing/listing_sidebar/QuantityRowSection.tsx +3 -2
package/dist/src/forms/Field.js
CHANGED
|
@@ -53,7 +53,23 @@ var Field = function (props) {
|
|
|
53
53
|
};
|
|
54
54
|
var inputProps = __assign({}, props.inputProps);
|
|
55
55
|
if (props.type === "currency") {
|
|
56
|
-
|
|
56
|
+
var customOnBlur_1 = typeof inputProps.onBlur === "function"
|
|
57
|
+
? inputProps.onBlur
|
|
58
|
+
: function () {
|
|
59
|
+
//noop
|
|
60
|
+
};
|
|
61
|
+
var customOnFocus_1 = typeof inputProps.onFocus === "function"
|
|
62
|
+
? inputProps.onFocus
|
|
63
|
+
: function () {
|
|
64
|
+
//noop
|
|
65
|
+
};
|
|
66
|
+
inputProps = __assign(__assign({}, inputProps), { onBlur: function () {
|
|
67
|
+
formatValue();
|
|
68
|
+
customOnBlur_1();
|
|
69
|
+
}, onFocus: function () {
|
|
70
|
+
formatValue(true);
|
|
71
|
+
customOnFocus_1();
|
|
72
|
+
}, onChange: filterNumbers });
|
|
57
73
|
}
|
|
58
74
|
if (props.type === "url") {
|
|
59
75
|
inputProps = __assign(__assign({}, inputProps), { ref: props.register &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../src/forms/Field.tsx"],"names":[],"mappings":";;;;;;;;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C,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,EACvD,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,iBACX,KAAK,CAAC,UAAU,IACzB,UAAU,IACd,MAAM,EAAE,KAAK,CAAC,MAAM,IACpB;YACD,KAAK,CAAC,gBAAgB;YACtB,iBAAiB,IAAI,KAAK,CACvB;QACL,KAAK,CAAC,OAAO,IAAI,2BAAG,SAAS,EAAC,gBAAgB,IAAE,KAAK,CAAC,OAAO,CAAK;QAClE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,oBAAC,YAAY,IAAC,EAAE,EAAE,UAAG,QAAQ,WAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IACtD,KAAK,CAAC,YAAY,CACN,CAChB,CAAC,CAAC,CAAC,CACF,8BAAM,EAAE,EAAE,UAAG,QAAQ,WAAQ,GAAS,CACvC,CACG,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -7,10 +7,11 @@ export interface QuantityRow {
|
|
|
7
7
|
export interface QuantityRowSectionProps {
|
|
8
8
|
/** Any amount of number/text combinations, rendered in a list */
|
|
9
9
|
quantityRows: QuantityRow[];
|
|
10
|
+
priority?: number;
|
|
10
11
|
strings: {
|
|
11
12
|
sectionTitle: string;
|
|
12
13
|
description?: string | React.ReactNode;
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
declare const QuantityRowSection: ({ quantityRows, strings }: QuantityRowSectionProps) => JSX.Element;
|
|
16
|
+
declare const QuantityRowSection: ({ quantityRows, strings, priority }: QuantityRowSectionProps) => JSX.Element;
|
|
16
17
|
export { QuantityRowSection as default, QuantityRowSection };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Heading } from "../../../text/Heading";
|
|
3
3
|
var QuantityRowSection = function (_a) {
|
|
4
|
-
var quantityRows = _a.quantityRows, strings = _a.strings;
|
|
4
|
+
var quantityRows = _a.quantityRows, strings = _a.strings, priority = _a.priority;
|
|
5
5
|
var getRow = function (row) {
|
|
6
6
|
if (row.amount === null)
|
|
7
7
|
return null;
|
|
@@ -10,7 +10,7 @@ var QuantityRowSection = function (_a) {
|
|
|
10
10
|
React.createElement("span", { className: "text-xs" }, row.text)));
|
|
11
11
|
};
|
|
12
12
|
return (React.createElement("section", { className: "aside-block is-tinted" },
|
|
13
|
-
React.createElement(Heading, { priority: 4, styleType: "capsWeighted" }, strings.sectionTitle),
|
|
13
|
+
React.createElement(Heading, { priority: priority !== null && priority !== void 0 ? priority : 4, styleType: "capsWeighted" }, strings.sectionTitle),
|
|
14
14
|
React.createElement("div", null,
|
|
15
15
|
strings.description && (React.createElement("div", { className: "text-sm text-gray-800 pb-3" }, typeof strings.description === "string" ? (React.createElement("p", null, strings.description)) : (strings.description))),
|
|
16
16
|
quantityRows.length && React.createElement("ul", null, quantityRows.map(function (row) { return getRow(row); })))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantityRowSection.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/QuantityRowSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"QuantityRowSection.js","sourceRoot":"","sources":["../../../../../src/page_components/listing/listing_sidebar/QuantityRowSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAkB/C,IAAM,kBAAkB,GAAG,UAAC,EAA4D;QAA1D,YAAY,kBAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA;IAC3D,IAAM,MAAM,GAAG,UAAC,GAAgB;QAC9B,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,CAAC,IAAI,EACb,SAAS,EAAE,kCACT,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,6BACpB;YAE1B,8BAAM,SAAS,EAAC,+CAA+C,IAAE,GAAG,CAAC,MAAM,CAAQ;YACnF,8BAAM,SAAS,EAAE,SAAS,IAAG,GAAG,CAAC,IAAI,CAAQ,CAC1C,CACN,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,iCAAS,SAAS,EAAC,uBAAuB;QACxC,oBAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,EAAE,SAAS,EAAE,cAAc,IACxD,OAAO,CAAC,YAAY,CACb;QACV;YACG,OAAO,CAAC,WAAW,IAAI,CACtB,6BAAK,SAAS,EAAC,4BAA4B,IACxC,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,CACzC,+BAAI,OAAO,CAAC,WAAW,CAAK,CAC7B,CAAC,CAAC,CAAC,CACF,OAAO,CAAC,WAAW,CACpB,CACG,CACP;YACA,YAAY,CAAC,MAAM,IAAI,gCAAK,YAAY,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,EAAX,CAAW,CAAC,CAAM,CACrE,CACE,CACX,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,kBAAkB,IAAI,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ quantityRows, strings }: import("./QuantityRowSection").QuantityRowSectionProps) => JSX.Element;
|
|
3
|
+
component: ({ quantityRows, strings, priority }: import("./QuantityRowSection").QuantityRowSectionProps) => JSX.Element;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const OpenAndAllValuesSupplied: () => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.4",
|
|
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",
|
package/src/forms/Field.tsx
CHANGED
|
@@ -87,10 +87,28 @@ const Field = (props: FieldProps) => {
|
|
|
87
87
|
|
|
88
88
|
let inputProps = { ...props.inputProps }
|
|
89
89
|
if (props.type === "currency") {
|
|
90
|
+
const customOnBlur =
|
|
91
|
+
typeof inputProps.onBlur === "function"
|
|
92
|
+
? (inputProps.onBlur as () => void)
|
|
93
|
+
: () => {
|
|
94
|
+
//noop
|
|
95
|
+
}
|
|
96
|
+
const customOnFocus =
|
|
97
|
+
typeof inputProps.onFocus === "function"
|
|
98
|
+
? (inputProps.onFocus as () => void)
|
|
99
|
+
: () => {
|
|
100
|
+
//noop
|
|
101
|
+
}
|
|
90
102
|
inputProps = {
|
|
91
103
|
...inputProps,
|
|
92
|
-
onBlur: () =>
|
|
93
|
-
|
|
104
|
+
onBlur: () => {
|
|
105
|
+
formatValue()
|
|
106
|
+
customOnBlur()
|
|
107
|
+
},
|
|
108
|
+
onFocus: () => {
|
|
109
|
+
formatValue(true)
|
|
110
|
+
customOnFocus()
|
|
111
|
+
},
|
|
94
112
|
onChange: filterNumbers,
|
|
95
113
|
}
|
|
96
114
|
}
|
|
@@ -10,13 +10,14 @@ export interface QuantityRow {
|
|
|
10
10
|
export interface QuantityRowSectionProps {
|
|
11
11
|
/** Any amount of number/text combinations, rendered in a list */
|
|
12
12
|
quantityRows: QuantityRow[]
|
|
13
|
+
priority?: number
|
|
13
14
|
strings: {
|
|
14
15
|
sectionTitle: string
|
|
15
16
|
description?: string | React.ReactNode
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const QuantityRowSection = ({ quantityRows, strings }: QuantityRowSectionProps) => {
|
|
20
|
+
const QuantityRowSection = ({ quantityRows, strings, priority }: QuantityRowSectionProps) => {
|
|
20
21
|
const getRow = (row: QuantityRow) => {
|
|
21
22
|
if (row.amount === null) return null
|
|
22
23
|
return (
|
|
@@ -34,7 +35,7 @@ const QuantityRowSection = ({ quantityRows, strings }: QuantityRowSectionProps)
|
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
37
|
<section className="aside-block is-tinted">
|
|
37
|
-
<Heading priority={4} styleType={"capsWeighted"}>
|
|
38
|
+
<Heading priority={priority ?? 4} styleType={"capsWeighted"}>
|
|
38
39
|
{strings.sectionTitle}
|
|
39
40
|
</Heading>
|
|
40
41
|
<div>
|