@homebound/beam 2.231.0 → 2.231.1

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,6 +4,7 @@ export type NumberRangeFilterProps<DV extends NumberRangeFilterValue> = {
4
4
  label: string;
5
5
  numberFieldType?: NumberFieldType;
6
6
  defaultValue?: DV;
7
+ numberFormatOptions?: Intl.NumberFormatOptions;
7
8
  };
8
9
  export type NumberRangeFilterValue = {
9
10
  min: number;
@@ -15,21 +15,21 @@ exports.numberRangeFilter = numberRangeFilter;
15
15
  class NumberRangeFilter extends BaseFilter_1.BaseFilter {
16
16
  render(value, setValue, tid, inModal, vertical) {
17
17
  var _a, _b;
18
- const { label, numberFieldType } = this.props;
18
+ const { label, numberFieldType, numberFormatOptions } = this.props;
19
19
  const min = (_a = value === null || value === void 0 ? void 0 : value.min) !== null && _a !== void 0 ? _a : undefined;
20
20
  const max = (_b = value === null || value === void 0 ? void 0 : value.max) !== null && _b !== void 0 ? _b : undefined;
21
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vertical && ((0, jsx_runtime_1.jsxs)("div", { ...tid, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.pb1.$, children: (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { labelStyle: "inline", clearable: true, label: "Min", value: min, type: numberFieldType, onChange: (minVal) => {
21
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vertical && ((0, jsx_runtime_1.jsxs)("div", { ...tid, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.pb1.$, children: (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { labelStyle: "inline", clearable: true, label: "Min", value: min, type: numberFieldType, numberFormatOptions: numberFormatOptions, onChange: (minVal) => {
22
22
  const maxValue = max ? { max } : {};
23
23
  setValue(minVal || max ? { min: minVal, ...maxValue } : undefined);
24
- }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_min_vertical`] }) }), (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { labelStyle: "inline", clearable: true, label: "Max", value: max, type: numberFieldType, onChange: (maxVal) => {
24
+ }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_min_vertical`] }) }), (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { labelStyle: "inline", clearable: true, label: "Max", value: max, type: numberFieldType, numberFormatOptions: numberFormatOptions, onChange: (maxVal) => {
25
25
  const minValue = min ? { min } : {};
26
26
  setValue(maxVal || min ? { max: maxVal, ...minValue } : undefined);
27
27
  }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_max_vertical`] })] })), !vertical && ((0, jsx_runtime_1.jsxs)(CompoundField_1.CompoundField, { ...tid, children: [(0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { compact: true, sizeToContent: !inModal, labelStyle: "inline", clearable: true,
28
28
  // When in horizontal view, we combine the filter label with the min / max labels as all filter labels are displayed inline
29
- label: !inModal ? `${label} Min` : "Min", value: min, type: numberFieldType, onChange: (minVal) => {
29
+ label: !inModal ? `${label} Min` : "Min", value: min, type: numberFieldType, numberFormatOptions: numberFormatOptions, onChange: (minVal) => {
30
30
  const maxValue = max ? { max } : {};
31
31
  setValue(minVal || max ? { min: minVal, ...maxValue } : undefined);
32
- }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_min`] }), (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { compact: true, sizeToContent: !inModal, labelStyle: "inline", clearable: true, label: !inModal ? `${label} Max` : "Max", value: max, type: numberFieldType, onChange: (maxVal) => {
32
+ }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_min`] }), (0, jsx_runtime_1.jsx)(NumberField_1.NumberField, { compact: true, sizeToContent: !inModal, labelStyle: "inline", clearable: true, label: !inModal ? `${label} Max` : "Max", value: max, type: numberFieldType, numberFormatOptions: numberFormatOptions, onChange: (maxVal) => {
33
33
  const minValue = min ? { min } : {};
34
34
  setValue(maxVal || min ? { max: maxVal, ...minValue } : undefined);
35
35
  }, ...tid[`${(0, defaultTestId_1.defaultTestId)(label)}_max`] })] }))] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.231.0",
3
+ "version": "2.231.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",