@homebound/beam 2.79.1 → 2.79.2
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.
|
@@ -10,6 +10,6 @@ export declare type DateFilterProps<O, V extends Value, DV extends DateFilterVal
|
|
|
10
10
|
};
|
|
11
11
|
export declare type DateFilterValue<V extends Value> = {
|
|
12
12
|
op: V;
|
|
13
|
-
|
|
13
|
+
value: Date;
|
|
14
14
|
};
|
|
15
15
|
export declare function dateFilter<O, V extends Key>(props: DateFilterProps<O, V, DateFilterValue<V>>): (key: string) => Filter<DateFilterValue<V>>;
|
|
@@ -29,9 +29,9 @@ class DateFilter extends BaseFilter_1.BaseFilter {
|
|
|
29
29
|
...operations,
|
|
30
30
|
], getOptionValue: (o) => (o === anyOption ? undefined : getOperationValue(o)), getOptionLabel: (o) => (o === anyOption ? "Any" : getOperationLabel(o)), value: value === null || value === void 0 ? void 0 : value.op, onSelect: (op) =>
|
|
31
31
|
// default the selected date to today if it doesn't exist in the filter's value
|
|
32
|
-
setValue(op ? { op,
|
|
32
|
+
setValue(op ? { op, value: (value === null || value === void 0 ? void 0 : value.value) ? new Date(value.value) : new Date() } : undefined), label: inModal ? `${label} date filter operation` : label, inlineLabel: !inModal && !vertical, hideLabel: inModal || vertical, nothingSelectedText: "Any" }, tid[`${(0, defaultTestId_1.defaultTestId)(this.label)}_dateOperation`], { onFocus: () => setFocusedEl("op"), onBlur: () => setFocusedEl(undefined) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(1).flexNone.bgGray300.if(focusedEl !== undefined).bgLightBlue700.$ }, void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ css: {
|
|
33
33
|
...commonStyles,
|
|
34
34
|
...Css_1.Css.fg1.br.borderRadius("0 4px 4px 0").if(focusedEl === "date").bLightBlue700.$,
|
|
35
|
-
} }, { children: (0, jsx_runtime_1.jsx)(inputs_1.DateField, Object.assign({ borderless: true, compact: true, inlineLabel: true, value: (value === null || value === void 0 ? void 0 : value.
|
|
35
|
+
} }, { children: (0, jsx_runtime_1.jsx)(inputs_1.DateField, Object.assign({ borderless: true, compact: true, inlineLabel: true, value: (value === null || value === void 0 ? void 0 : value.value) ? new Date(value.value) : new Date(), label: "Date", onChange: (d) => setValue({ ...value, value: d }), disabled: !value }, tid[`${(0, defaultTestId_1.defaultTestId)(this.label)}_dateField`], { onFocus: () => setFocusedEl("date"), onBlur: () => setFocusedEl(undefined) }), void 0) }), void 0)] }), void 0)] }, void 0));
|
|
36
36
|
}
|
|
37
37
|
}
|