assui 3.0.10 → 3.0.12
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.
|
@@ -14,6 +14,8 @@ export interface LabelCustomizeRangePickerProps extends Omit<LabelRangePickerPro
|
|
|
14
14
|
label?: React.ReactNode;
|
|
15
15
|
/** 最大时间范围 */
|
|
16
16
|
maxScope?: number;
|
|
17
|
+
/** 如果有MaxScope,在没有默认值的情况下自动填充默认值 */
|
|
18
|
+
fillDefaultDate?: boolean;
|
|
17
19
|
showShortcutPanel?: boolean;
|
|
18
20
|
}
|
|
19
21
|
declare const LabelCustomizeRangePicker: (props: LabelCustomizeRangePickerProps) => JSX.Element;
|
|
@@ -64,23 +64,26 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
64
64
|
rangePickerType = _a === void 0 ? 'label' : _a,
|
|
65
65
|
label = props.label,
|
|
66
66
|
showTime = props.showTime,
|
|
67
|
+
allowClear = props.allowClear,
|
|
67
68
|
maxScope = props.maxScope,
|
|
68
69
|
onOpenChange = props.onOpenChange,
|
|
69
|
-
_b = props.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
_b = props.fillDefaultDate,
|
|
71
|
+
fillDefaultDate = _b === void 0 ? true : _b,
|
|
72
|
+
_c = props.showShortcutPanel,
|
|
73
|
+
showShortcutPanel = _c === void 0 ? true : _c,
|
|
74
|
+
restProps = __rest(props, ["customizeTimeList", "radioList", "rangePickerType", "label", "showTime", "allowClear", "maxScope", "onOpenChange", "fillDefaultDate", "showShortcutPanel"]);
|
|
75
|
+
var _d = __read(useControllableValue(props), 2),
|
|
76
|
+
date = _d[0],
|
|
77
|
+
setDate = _d[1];
|
|
78
|
+
var _e = __read(useState(false), 2),
|
|
79
|
+
isVisiblePanel = _e[0],
|
|
80
|
+
setIsVisiblePanel = _e[1];
|
|
81
|
+
var _f = __read(useState(), 2),
|
|
82
|
+
radioKey = _f[0],
|
|
83
|
+
setRadioKey = _f[1];
|
|
84
|
+
var _g = __read(useState(false), 2),
|
|
85
|
+
open = _g[0],
|
|
86
|
+
setOpen = _g[1];
|
|
84
87
|
var messages = useContext(LocaleContext);
|
|
85
88
|
var dataSource = radioList !== null && radioList !== void 0 ? radioList : getDefaultRadioList(messages);
|
|
86
89
|
useEffect(function () {
|
|
@@ -115,7 +118,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
115
118
|
var _a = __read(date || [], 2),
|
|
116
119
|
startTime = _a[0],
|
|
117
120
|
endTime = _a[1];
|
|
118
|
-
if (maxScope) {
|
|
121
|
+
if (maxScope && fillDefaultDate) {
|
|
119
122
|
var _b = __read(formatMaxScope(date, maxScope), 2),
|
|
120
123
|
newStartDate = _b[0],
|
|
121
124
|
newEndDate = _b[1];
|
|
@@ -130,6 +133,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
130
133
|
};
|
|
131
134
|
var onDateChange = function onDateChange(nextValue) {
|
|
132
135
|
var _a, _b;
|
|
136
|
+
console.log('nextValue', nextValue);
|
|
133
137
|
var _c = __read(nextValue || [], 2),
|
|
134
138
|
start = _c[0],
|
|
135
139
|
end = _c[1];
|
|
@@ -14,6 +14,8 @@ export interface LabelCustomizeRangePickerProps extends Omit<LabelRangePickerPro
|
|
|
14
14
|
label?: React.ReactNode;
|
|
15
15
|
/** 最大时间范围 */
|
|
16
16
|
maxScope?: number;
|
|
17
|
+
/** 如果有MaxScope,在没有默认值的情况下自动填充默认值 */
|
|
18
|
+
fillDefaultDate?: boolean;
|
|
17
19
|
showShortcutPanel?: boolean;
|
|
18
20
|
}
|
|
19
21
|
declare const LabelCustomizeRangePicker: (props: LabelCustomizeRangePickerProps) => JSX.Element;
|
|
@@ -107,23 +107,26 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
107
107
|
rangePickerType = _a === void 0 ? 'label' : _a,
|
|
108
108
|
label = props.label,
|
|
109
109
|
showTime = props.showTime,
|
|
110
|
+
allowClear = props.allowClear,
|
|
110
111
|
maxScope = props.maxScope,
|
|
111
112
|
onOpenChange = props.onOpenChange,
|
|
112
|
-
_b = props.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
_b = props.fillDefaultDate,
|
|
114
|
+
fillDefaultDate = _b === void 0 ? true : _b,
|
|
115
|
+
_c = props.showShortcutPanel,
|
|
116
|
+
showShortcutPanel = _c === void 0 ? true : _c,
|
|
117
|
+
restProps = __rest(props, ["customizeTimeList", "radioList", "rangePickerType", "label", "showTime", "allowClear", "maxScope", "onOpenChange", "fillDefaultDate", "showShortcutPanel"]);
|
|
118
|
+
var _d = __read((0, useControllableValue_1["default"])(props), 2),
|
|
119
|
+
date = _d[0],
|
|
120
|
+
setDate = _d[1];
|
|
121
|
+
var _e = __read((0, react_1.useState)(false), 2),
|
|
122
|
+
isVisiblePanel = _e[0],
|
|
123
|
+
setIsVisiblePanel = _e[1];
|
|
124
|
+
var _f = __read((0, react_1.useState)(), 2),
|
|
125
|
+
radioKey = _f[0],
|
|
126
|
+
setRadioKey = _f[1];
|
|
127
|
+
var _g = __read((0, react_1.useState)(false), 2),
|
|
128
|
+
open = _g[0],
|
|
129
|
+
setOpen = _g[1];
|
|
127
130
|
var messages = (0, react_1.useContext)(context_1["default"]);
|
|
128
131
|
var dataSource = radioList !== null && radioList !== void 0 ? radioList : (0, defaultRadioList_1["default"])(messages);
|
|
129
132
|
(0, react_1.useEffect)(function () {
|
|
@@ -158,7 +161,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
158
161
|
var _a = __read(date || [], 2),
|
|
159
162
|
startTime = _a[0],
|
|
160
163
|
endTime = _a[1];
|
|
161
|
-
if (maxScope) {
|
|
164
|
+
if (maxScope && fillDefaultDate) {
|
|
162
165
|
var _b = __read((0, utils_1.formatMaxScope)(date, maxScope), 2),
|
|
163
166
|
newStartDate = _b[0],
|
|
164
167
|
newEndDate = _b[1];
|
|
@@ -173,6 +176,7 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
173
176
|
};
|
|
174
177
|
var onDateChange = function onDateChange(nextValue) {
|
|
175
178
|
var _a, _b;
|
|
179
|
+
console.log('nextValue', nextValue);
|
|
176
180
|
var _c = __read(nextValue || [], 2),
|
|
177
181
|
start = _c[0],
|
|
178
182
|
end = _c[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.12",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
36
|
"@types/react-color": "^3.0.6",
|
|
37
37
|
"@types/react-resizable": "^3.0.0",
|
|
38
|
-
"a-icons": "^1.1.
|
|
38
|
+
"a-icons": "^1.1.4",
|
|
39
39
|
"aa-utils": "^2.1.7",
|
|
40
40
|
"ahooks": "^3.0.8",
|
|
41
41
|
"bignumber.js": "^9.0.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"node": ">=10.0.0"
|
|
81
81
|
},
|
|
82
82
|
"license": "MIT",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "1b51045614b9c69f7e1e9db9b5b5d3976d2d64f0"
|
|
84
84
|
}
|