@gisce/react-ooui 1.5.14 → 1.5.15-0
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/react-ooui.es.js +879 -854
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +12 -12
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +1 -1
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +1 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +34 -10
- package/src/widgets/views/searchFilter/SearchFilter.tsx +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeRangePicker.d.ts","sourceRoot":"","sources":["DateTimeRangePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimeRangePicker.d.ts","sourceRoot":"","sources":["DateTimeRangePicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,mBAAmB,UAAW,WAAW,sBAgDrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["SearchFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["SearchFilter.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,iBAAS,YAAY,CAAC,KAAK,EAAE,KAAK,qBA0HjC;AAED,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { DatePicker, TimePicker } from "antd";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
1
|
+
import { DatePicker, TimePicker, Row, Col } from "antd";
|
|
4
2
|
import Field from "@/common/Field";
|
|
5
3
|
import { Field as FieldOoui, Label as LabelOoui } from "@gisce/ooui";
|
|
6
4
|
import { WidgetProps } from "@/types";
|
|
7
5
|
import Label from "@/widgets/base/Label";
|
|
8
|
-
|
|
9
|
-
import { Row, Col } from "antd";
|
|
6
|
+
import React from "react";
|
|
10
7
|
|
|
11
8
|
export const DateTimeRangePicker = (props: WidgetProps) => {
|
|
12
9
|
const { ooui, showLabel = false } = props;
|
|
@@ -50,14 +47,41 @@ export const DateTimeRangePicker = (props: WidgetProps) => {
|
|
|
50
47
|
</Col>
|
|
51
48
|
<Col>
|
|
52
49
|
<Field {...props} ooui={fields[1]} showLabel={false}>
|
|
53
|
-
<
|
|
54
|
-
className="w-60"
|
|
55
|
-
allowEmpty={[true, true]}
|
|
56
|
-
format={"HH:mm"}
|
|
57
|
-
></TimePicker.RangePicker>
|
|
50
|
+
<TimeRangePicker />
|
|
58
51
|
</Field>
|
|
59
52
|
</Col>
|
|
60
53
|
</Row>
|
|
61
54
|
</>
|
|
62
55
|
);
|
|
63
56
|
};
|
|
57
|
+
|
|
58
|
+
const TimeRangePicker = ({
|
|
59
|
+
value,
|
|
60
|
+
onChange,
|
|
61
|
+
}: {
|
|
62
|
+
value?: any;
|
|
63
|
+
onChange?: (newValue: any) => void;
|
|
64
|
+
}) => {
|
|
65
|
+
return (
|
|
66
|
+
<div style={{ marginTop: 5 }}>
|
|
67
|
+
<TimePicker
|
|
68
|
+
placeholder="Start time"
|
|
69
|
+
style={{ width: 115, marginRight: 10 }}
|
|
70
|
+
format={"HH:mm"}
|
|
71
|
+
value={value?.[0]}
|
|
72
|
+
onChange={(newValue) => {
|
|
73
|
+
onChange?.([newValue, value?.[1]]);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
<TimePicker
|
|
77
|
+
placeholder="End time"
|
|
78
|
+
style={{ width: 115 }}
|
|
79
|
+
format={"HH:mm"}
|
|
80
|
+
value={value?.[1]}
|
|
81
|
+
onChange={(newValue) => {
|
|
82
|
+
onChange?.([value?.[0], newValue]);
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Form, Row, Col, Alert, theme } from "antd";
|
|
3
3
|
import useDeepCompareEffect from "use-deep-compare-effect";
|
|
4
4
|
|
|
@@ -15,6 +15,7 @@ import { SearchParams } from "./SearchParams";
|
|
|
15
15
|
|
|
16
16
|
import { getParamsForFields } from "@/helpers/searchHelper";
|
|
17
17
|
import Measure from "react-measure";
|
|
18
|
+
import React from "react";
|
|
18
19
|
const { useToken } = theme;
|
|
19
20
|
|
|
20
21
|
type Props = {
|
|
@@ -60,6 +61,7 @@ function SearchFilter(props: Props) {
|
|
|
60
61
|
|
|
61
62
|
useEffect(() => {
|
|
62
63
|
form.setFieldsValue(searchValues);
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
65
|
}, [searchValues]);
|
|
64
66
|
|
|
65
67
|
const getRowsAndCols = () => {
|