@ecoding/components.antd 0.1.35 → 0.2.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.
|
@@ -9,6 +9,7 @@ export interface IDrawerProps {
|
|
|
9
9
|
open?: boolean;
|
|
10
10
|
width?: string;
|
|
11
11
|
zIndex?: number;
|
|
12
|
+
placement?: string;
|
|
12
13
|
okDanger?: boolean;
|
|
13
14
|
title?: React.ReactNode;
|
|
14
15
|
okType?: "text" | "link" | "ghost" | "default" | "primary" | "dashed" | undefined;
|
|
@@ -33,6 +34,7 @@ export declare class Drawers extends React.Component<IDrawerProps> {
|
|
|
33
34
|
mask: boolean;
|
|
34
35
|
title: string;
|
|
35
36
|
okType: string;
|
|
37
|
+
placement: string;
|
|
36
38
|
okDanger: boolean;
|
|
37
39
|
okText: string;
|
|
38
40
|
cancelText: string;
|
package/lib/core/drawer/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RangePickerProps } from "antd/es/date-picker";
|
|
3
|
+
import type { Dayjs } from "dayjs";
|
|
4
|
+
declare type RangeValue = [Dayjs | null, Dayjs | null] | null;
|
|
5
|
+
declare type IProps = RangePickerProps & {
|
|
6
|
+
value?: RangeValue;
|
|
7
|
+
rangeDay?: number;
|
|
8
|
+
onChange?: any;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const Picker: React.FC<IProps>;
|
|
14
|
+
export default Picker;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { DatePicker } from "antd";
|
|
4
|
+
const { RangePicker } = DatePicker;
|
|
5
|
+
const Picker = (props) => {
|
|
6
|
+
const [dates, setDates] = useState(props.value || null);
|
|
7
|
+
const disabledDate = (current) => {
|
|
8
|
+
if (!dates) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const tooLate = dates[0] && current.diff(dates[0], "days") > props.rangeDay;
|
|
12
|
+
const tooEarly = dates[1] && dates[1].diff(current, "days") > props.rangeDay;
|
|
13
|
+
return !!tooEarly || !!tooLate;
|
|
14
|
+
};
|
|
15
|
+
return (React.createElement(RangePicker, { showTime: {
|
|
16
|
+
defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("23:59:59", "HH:mm:ss")]
|
|
17
|
+
}, onCalendarChange: (val) => setDates(val), disabledDate: disabledDate, onChange: (v) => props.onChange(v) }));
|
|
18
|
+
};
|
|
19
|
+
Picker.defaultProps = {
|
|
20
|
+
rangeDay: 30
|
|
21
|
+
};
|
|
22
|
+
export default Picker;
|
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as InjectNotification } from "./core/inject-notification";
|
|
|
6
6
|
export { default as Confirm } from "./core/confirm";
|
|
7
7
|
export { default as AsyncCascader } from "./core/async-cascader";
|
|
8
8
|
export { default as LengthInput } from "./core/length-input";
|
|
9
|
+
export { default as RangePicker } from "./core/range-picker";
|
|
9
10
|
export { default as SingleImgUpload } from "./core/single-img-upload";
|
|
10
11
|
export { default as SingleFileUpload } from "./core/single-file-upload";
|
|
11
12
|
export { default as AsyncSelect } from "./core/async-select";
|
package/lib/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as InjectNotification } from "./core/inject-notification";
|
|
|
6
6
|
export { default as Confirm } from "./core/confirm";
|
|
7
7
|
export { default as AsyncCascader } from "./core/async-cascader";
|
|
8
8
|
export { default as LengthInput } from "./core/length-input";
|
|
9
|
+
export { default as RangePicker } from "./core/range-picker";
|
|
9
10
|
export { default as SingleImgUpload } from "./core/single-img-upload";
|
|
10
11
|
export { default as SingleFileUpload } from "./core/single-file-upload";
|
|
11
12
|
export { default as AsyncSelect } from "./core/async-select";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@ecoding/helper.json": ">=0.0.5",
|
|
30
30
|
"@ecoding/helper.request.hook": ">=0.0.6",
|
|
31
31
|
"@ecoding/helper.url": ">=0.0.5",
|
|
32
|
-
"antd": ">=5.
|
|
32
|
+
"antd": ">=5.1.2",
|
|
33
33
|
"axios": ">=1.1.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"@ecoding/helper.json": "^0.0.5",
|
|
39
39
|
"@ecoding/helper.request.hook": "^0.0.6",
|
|
40
40
|
"@ecoding/helper.url": "^0.0.5",
|
|
41
|
+
"antd": "^5.1.2",
|
|
41
42
|
"axios": "^1.1.2"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"react-quill": "^2.0.0"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3f3b0513d86ee87701c9736b626c2e4bd7651f67"
|
|
47
48
|
}
|