@aloudata/aloudata-design 1.5.3 → 1.6.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/Button/index.js +17 -6
- package/dist/Button/style/index.less +60 -114
- package/dist/Button/style/variables.less +0 -1
- package/dist/ColorPicker/style/index.less +2 -2
- package/dist/ConfigProvider/index.d.ts +2 -1
- package/dist/ConfigProvider/index.js +1 -0
- package/dist/DatePicker/index.d.ts +20 -11
- package/dist/DatePicker/index.js +216 -13
- package/dist/DatePicker/style/index.less +13 -0
- package/dist/Dropdown/style/index.less +3 -0
- package/dist/Empty/style/index.less +11 -13
- package/dist/Input/components/Input/index.js +16 -3
- package/dist/Input/style/index.less +11 -10
- package/dist/MemberPicker/components/MultipleOption.js +5 -1
- package/dist/MemberPicker/components/NickLabel.js +1 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +5 -1
- package/dist/MemberPicker/components/SingleOption.js +5 -1
- package/dist/MemberPicker/index.js +9 -3
- package/dist/MemberPicker/interface.d.ts +3 -3
- package/dist/MemberPicker/style/index.less +11 -3
- package/dist/Modal/style/index.less +2 -5
- package/dist/Select/components/SingleOption.js +3 -9
- package/dist/Select/index.js +34 -15
- package/dist/Select/style/single.less +11 -7
- package/dist/Select/style/size.less +19 -0
- package/dist/Select/style/status.less +2 -1
- package/dist/Table/style/index.less +2 -2
- package/dist/Table/style/variable.less +0 -1
- package/dist/Tabs/index.d.ts +5 -0
- package/dist/Tabs/index.js +4 -2
- package/dist/Tabs/style/index.less +6 -0
- package/dist/message/style/index.less +8 -7
- package/dist/style/mixins/index.less +4 -3
- package/dist/style/themes/default/scrollBar.less +3 -2
- package/package.json +10 -3
package/dist/Button/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["type", "size", "shape", "loading", "disabled", "icon", "className"];
|
|
1
|
+
var _excluded = ["type", "size", "shape", "loading", "disabled", "icon", "className", "prefixCls"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -14,10 +14,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
14
14
|
|
|
15
15
|
import { LoadingLine } from '@aloudata/icons-react';
|
|
16
16
|
import { Button as AntdButton } from 'antd';
|
|
17
|
+
import { useCompactItemContext } from 'antd/lib/space/Compact';
|
|
17
18
|
import classNames from 'classnames';
|
|
18
19
|
import React, { useContext } from 'react';
|
|
20
|
+
import { ConfigContext } from "../ConfigProvider";
|
|
19
21
|
import SizeContext from "../ConfigProvider/sizeContext";
|
|
20
|
-
var iconPrefixCls = 'aldicon';
|
|
21
22
|
var ICON_LARGE = 20;
|
|
22
23
|
var ICON_MIDDLE = 16;
|
|
23
24
|
var ICON_SMALL = 14;
|
|
@@ -73,7 +74,6 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
73
74
|
fill: 'currentColor'
|
|
74
75
|
}, iconNode.props);
|
|
75
76
|
|
|
76
|
-
p.className = classNames("".concat(iconPrefixCls, "-icon-left"), p.className, iconPrefixCls);
|
|
77
77
|
p.size = getIconSize(size);
|
|
78
78
|
return /*#__PURE__*/React.cloneElement(iconNode, p);
|
|
79
79
|
}
|
|
@@ -82,7 +82,6 @@ export var setIcon = function setIcon(iconNode, size, loading) {
|
|
|
82
82
|
return /*#__PURE__*/React.createElement(LoadingLine, {
|
|
83
83
|
spin: true,
|
|
84
84
|
size: getIconSize(size),
|
|
85
|
-
className: classNames("".concat(iconPrefixCls, "-icon-left"), iconPrefixCls),
|
|
86
85
|
fill: "currentColor"
|
|
87
86
|
});
|
|
88
87
|
}
|
|
@@ -101,15 +100,27 @@ function Button(props) {
|
|
|
101
100
|
disabled = props.disabled,
|
|
102
101
|
icon = props.icon,
|
|
103
102
|
className = props.className,
|
|
103
|
+
customizePrefixCls = props.prefixCls,
|
|
104
104
|
rest = _objectWithoutProperties(props, _excluded);
|
|
105
105
|
|
|
106
106
|
var contentSize = useContext(SizeContext);
|
|
107
|
-
|
|
107
|
+
|
|
108
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
109
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
110
|
+
direction = _React$useContext.direction;
|
|
111
|
+
|
|
112
|
+
var prefixCls = getPrefixCls('btn', customizePrefixCls); // ===================== Compact Item =====================
|
|
113
|
+
|
|
114
|
+
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
115
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
116
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
117
|
+
|
|
118
|
+
var size = compactSize || customSize || contentSize || 'middle';
|
|
108
119
|
return /*#__PURE__*/React.createElement(AntdButton, _extends({}, rest, {
|
|
109
120
|
disabled: loading ? true : disabled,
|
|
110
121
|
icon: setIcon(icon, size, loading),
|
|
111
122
|
type: getButtonType(type),
|
|
112
|
-
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), className, getButtonSizeClass(size)),
|
|
123
|
+
className: classNames(btnPrefix, "".concat(btnPrefix, "-").concat(type), className, getButtonSizeClass(size), compactItemClassnames),
|
|
113
124
|
danger: getDangerStatus(type),
|
|
114
125
|
shape: getShape(shape)
|
|
115
126
|
}), props.children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
@import './variables.less';
|
|
3
3
|
|
|
4
|
-
.
|
|
4
|
+
.ant-btn.ald-btn {
|
|
5
5
|
&.ald-btn {
|
|
6
6
|
// &-loading::before{
|
|
7
7
|
// // display: none !important;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
text-shadow: none;
|
|
21
21
|
text-decoration: none;
|
|
22
22
|
|
|
23
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
23
24
|
&:focus-visible {
|
|
24
25
|
outline: none;
|
|
25
26
|
}
|
|
@@ -236,139 +237,84 @@
|
|
|
236
237
|
padding: 0;
|
|
237
238
|
vertical-align: baseline;
|
|
238
239
|
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&-large {
|
|
243
|
+
min-width: auto;
|
|
244
|
+
height: @button-height-large;
|
|
245
|
+
padding: @button-border-padding-large;
|
|
246
|
+
font-size: @button-text-size-large;
|
|
247
|
+
line-height: 24px;
|
|
248
|
+
border-radius: @button-border-radius-large;
|
|
239
249
|
|
|
240
|
-
|
|
241
|
-
min-width:
|
|
250
|
+
&.ant-btn-icon-only {
|
|
251
|
+
min-width: @button-height-large;
|
|
242
252
|
height: @button-height-large;
|
|
243
|
-
padding: @button-border-padding-large;
|
|
244
|
-
font-size: @button-text-size-large;
|
|
245
|
-
line-height: 24px;
|
|
246
253
|
border-radius: @button-border-radius-large;
|
|
254
|
+
}
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
&.ant-btn-circle {
|
|
257
|
+
min-width: @button-height-large;
|
|
258
|
+
height: @button-height-large;
|
|
259
|
+
border-radius: 50%;
|
|
260
|
+
}
|
|
253
261
|
|
|
254
|
-
|
|
255
|
-
min-width: @button-height-large;
|
|
256
|
-
height: @button-height-large;
|
|
257
|
-
border-radius: 50%;
|
|
258
|
-
}
|
|
262
|
+
gap: @button-left-icon-margin-right-large;
|
|
259
263
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// vertical-align: -4px;
|
|
263
|
-
// }
|
|
264
|
-
// }
|
|
265
|
-
|
|
266
|
-
gap: @button-left-icon-margin-right-large;
|
|
267
|
-
// .aldicon-icon-left + span {
|
|
268
|
-
// margin-left: @button-left-icon-margin-right-large;
|
|
269
|
-
// }
|
|
270
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
271
|
-
min-width: @button-text-min-width-large;
|
|
272
|
-
}
|
|
264
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
265
|
+
min-width: @button-text-min-width-large;
|
|
273
266
|
}
|
|
267
|
+
}
|
|
274
268
|
|
|
275
|
-
|
|
276
|
-
|
|
269
|
+
&-middle {
|
|
270
|
+
min-width: auto;
|
|
271
|
+
height: @button-height-middle;
|
|
272
|
+
padding: @button-border-padding-middle;
|
|
273
|
+
font-size: @button-text-size-middle;
|
|
274
|
+
border-radius: @button-border-radius-middle;
|
|
275
|
+
|
|
276
|
+
&.ant-btn-icon-only {
|
|
277
|
+
min-width: @button-height-middle;
|
|
277
278
|
height: @button-height-middle;
|
|
278
|
-
padding: @button-border-padding-middle;
|
|
279
|
-
font-size: @button-text-size-middle;
|
|
280
279
|
border-radius: @button-border-radius-middle;
|
|
280
|
+
}
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
&.ant-btn-circle {
|
|
283
|
+
min-width: @button-height-middle;
|
|
284
|
+
height: @button-height-middle;
|
|
285
|
+
border-radius: 50%;
|
|
286
|
+
}
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
min-width: @button-height-middle;
|
|
290
|
-
height: @button-height-middle;
|
|
291
|
-
border-radius: 50%;
|
|
292
|
-
}
|
|
288
|
+
gap: @button-left-icon-margin-right-middle;
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
// vertical-align: -3px;
|
|
297
|
-
// }
|
|
298
|
-
// }
|
|
299
|
-
|
|
300
|
-
gap: @button-left-icon-margin-right-middle;
|
|
301
|
-
// .aldicon-icon-left + span {
|
|
302
|
-
// margin-left: @button-left-icon-margin-right-middle;
|
|
303
|
-
// }
|
|
304
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
305
|
-
min-width: @button-text-min-width-middle;
|
|
306
|
-
}
|
|
290
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
291
|
+
min-width: @button-text-min-width-middle;
|
|
307
292
|
}
|
|
293
|
+
}
|
|
308
294
|
|
|
309
|
-
|
|
295
|
+
&-small {
|
|
296
|
+
height: @button-height-small;
|
|
297
|
+
padding: @button-border-padding-small;
|
|
298
|
+
font-size: @button-text-size-small;
|
|
299
|
+
line-height: 22px;
|
|
300
|
+
border-radius: @button-border-radius-small;
|
|
301
|
+
|
|
302
|
+
&.ant-btn-icon-only {
|
|
303
|
+
min-width: @button-height-small;
|
|
310
304
|
height: @button-height-small;
|
|
311
|
-
padding: @button-border-padding-small;
|
|
312
|
-
font-size: @button-text-size-small;
|
|
313
|
-
line-height: 22px;
|
|
314
305
|
border-radius: @button-border-radius-small;
|
|
306
|
+
}
|
|
315
307
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
308
|
+
&.ant-btn-circle {
|
|
309
|
+
min-width: @button-height-small;
|
|
310
|
+
height: @button-height-small;
|
|
311
|
+
border-radius: 50%;
|
|
312
|
+
}
|
|
321
313
|
|
|
322
|
-
|
|
323
|
-
min-width: @button-height-small;
|
|
324
|
-
height: @button-height-small;
|
|
325
|
-
border-radius: 50%;
|
|
326
|
-
}
|
|
314
|
+
gap: @button-left-icon-margin-right-small;
|
|
327
315
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// vertical-align: -2px;
|
|
331
|
-
// }
|
|
332
|
-
// }
|
|
333
|
-
|
|
334
|
-
gap: @button-left-icon-margin-right-small;
|
|
335
|
-
// .aldicon-icon-left + span {
|
|
336
|
-
// margin-left: @button-left-icon-margin-right-small;
|
|
337
|
-
// }
|
|
338
|
-
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
339
|
-
min-width: @button-text-min-width-small;
|
|
340
|
-
}
|
|
316
|
+
&:not(.ant-btn-circle):not(.ant-btn-icon-only):not(.ald-btn-link) {
|
|
317
|
+
min-width: @button-text-min-width-small;
|
|
341
318
|
}
|
|
342
|
-
|
|
343
|
-
// &-mini {
|
|
344
|
-
// height: @button-height-mini;
|
|
345
|
-
// padding: @button-border-padding-mini;
|
|
346
|
-
// font-size: @button-text-size-mini;
|
|
347
|
-
// line-height: 22px;
|
|
348
|
-
// border-radius: @button-border-radius-mini;
|
|
349
|
-
|
|
350
|
-
// &.ant-btn-icon-only {
|
|
351
|
-
// min-width: @button-height-mini;
|
|
352
|
-
// height: @button-height-mini;
|
|
353
|
-
// border-radius: @button-border-radius-mini;
|
|
354
|
-
// }
|
|
355
|
-
|
|
356
|
-
// &.ant-btn-circle {
|
|
357
|
-
// min-width: @button-height-mini;
|
|
358
|
-
// height: @button-height-mini;
|
|
359
|
-
// border-radius: 50%;
|
|
360
|
-
// }
|
|
361
|
-
|
|
362
|
-
// .aldicon-icon-left {
|
|
363
|
-
// svg {
|
|
364
|
-
// vertical-align: -2px;
|
|
365
|
-
// }
|
|
366
|
-
// }
|
|
367
|
-
|
|
368
|
-
// gap:@button-left-icon-margin-right-mini;
|
|
369
|
-
// // .aldicon-icon-left + span {
|
|
370
|
-
// // margin-left: @button-left-icon-margin-right-mini;
|
|
371
|
-
// // }
|
|
372
|
-
// }
|
|
373
319
|
}
|
|
374
320
|
}
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
background: #fff;
|
|
51
51
|
border: 1px solid #dbdbdb;
|
|
52
52
|
box-sizing: border-box;
|
|
53
|
-
box-shadow: 0 4px 6px -2px rgb(16 24 40 /
|
|
54
|
-
0 12px 16px -4px rgb(16 24 40 /
|
|
53
|
+
box-shadow: 0 4px 6px -2px rgb(16 24 40 / 0.03),
|
|
54
|
+
0 12px 16px -4px rgb(16 24 40 / 0.08);
|
|
55
55
|
border-radius: 2px;
|
|
56
56
|
padding: 8px 7px;
|
|
57
57
|
|
|
@@ -4,7 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import { getUsersByIdsType, getUsersByKeywordsType } from './getUserList';
|
|
5
5
|
import useGetUserList from './hooks/useGetUserList';
|
|
6
6
|
import SizeContext from './sizeContext';
|
|
7
|
-
export
|
|
7
|
+
export { ConfigContext } from 'antd/lib/config-provider';
|
|
8
|
+
export type { ConfigConsumer, ConfigConsumerProps, configConsumerProps, CSPConfig, DirectionType, globalConfig, RenderEmptyHandler, } from 'antd/lib/config-provider/';
|
|
8
9
|
interface AldCustomConfigProviderProps extends ConfigProviderProps {
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
getUsersByIds?: getUsersByIdsType;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import getUserListContext from "./getUserList";
|
|
4
4
|
import useGetUserList from "./hooks/useGetUserList";
|
|
5
5
|
import SizeContext from "./sizeContext";
|
|
6
|
+
export { ConfigContext } from 'antd/lib/config-provider';
|
|
6
7
|
|
|
7
8
|
var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
|
|
8
9
|
var children = props.children,
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { DatePickerProps } from 'antd';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const _default: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").PickerProps<import("dayjs").Dayjs> & {
|
|
1
|
+
import { DatePicker as AntdDatePicker, DatePickerProps as AntdDatePickerProps } from 'antd';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
declare const DatePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
5
4
|
status?: "" | "warning" | "error" | undefined;
|
|
6
5
|
hashId?: string | undefined;
|
|
7
6
|
popupClassName?: string | undefined;
|
|
8
7
|
rootClassName?: string | undefined;
|
|
9
8
|
}, unknown> & {
|
|
10
|
-
WeekPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<
|
|
9
|
+
WeekPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
11
10
|
status?: "" | "warning" | "error" | undefined;
|
|
12
11
|
hashId?: string | undefined;
|
|
13
12
|
popupClassName?: string | undefined;
|
|
14
13
|
rootClassName?: string | undefined;
|
|
15
14
|
}, "picker">, unknown>;
|
|
16
|
-
MonthPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<
|
|
15
|
+
MonthPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
17
16
|
status?: "" | "warning" | "error" | undefined;
|
|
18
17
|
hashId?: string | undefined;
|
|
19
18
|
popupClassName?: string | undefined;
|
|
20
19
|
rootClassName?: string | undefined;
|
|
21
20
|
}, "picker">, unknown>;
|
|
22
|
-
YearPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<
|
|
21
|
+
YearPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
23
22
|
status?: "" | "warning" | "error" | undefined;
|
|
24
23
|
hashId?: string | undefined;
|
|
25
24
|
popupClassName?: string | undefined;
|
|
26
25
|
rootClassName?: string | undefined;
|
|
27
26
|
}, "picker">, unknown>;
|
|
28
|
-
RangePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").RangePickerProps<
|
|
27
|
+
RangePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").RangePickerProps<Dayjs> & {
|
|
29
28
|
dropdownClassName?: string | undefined;
|
|
30
29
|
popupClassName?: string | undefined;
|
|
31
30
|
}, unknown>;
|
|
32
|
-
TimePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<
|
|
31
|
+
TimePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
33
32
|
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
34
33
|
size?: import("antd/es/button").ButtonSize;
|
|
35
34
|
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
|
|
@@ -41,7 +40,7 @@ declare const _default: import("antd/es/date-picker/generatePicker/interface").P
|
|
|
41
40
|
popupClassName?: string | undefined;
|
|
42
41
|
rootClassName?: string | undefined;
|
|
43
42
|
}, "picker">, unknown>;
|
|
44
|
-
QuarterPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<
|
|
43
|
+
QuarterPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
45
44
|
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
46
45
|
size?: import("antd/es/button").ButtonSize;
|
|
47
46
|
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
|
|
@@ -56,5 +55,15 @@ declare const _default: import("antd/es/date-picker/generatePicker/interface").P
|
|
|
56
55
|
} & {
|
|
57
56
|
_InternalPanelDoNotUseOrYouWillBeFired: any;
|
|
58
57
|
_InternalRangePanelDoNotUseOrYouWillBeFired: any;
|
|
58
|
+
} & {
|
|
59
|
+
WeekPicker: typeof AntdDatePicker.WeekPicker;
|
|
60
|
+
MonthPicker: typeof AntdDatePicker.MonthPicker;
|
|
61
|
+
YearPicker: typeof AntdDatePicker.YearPicker;
|
|
62
|
+
RangePicker: typeof AntdDatePicker.RangePicker;
|
|
63
|
+
TimePicker: typeof AntdDatePicker.TimePicker;
|
|
64
|
+
QuarterPicker: typeof AntdDatePicker.QuarterPicker;
|
|
59
65
|
};
|
|
60
|
-
export
|
|
66
|
+
export declare type DatePickerProps = AntdDatePickerProps;
|
|
67
|
+
export declare type YearPickerProps = typeof AntdDatePicker.YearPicker;
|
|
68
|
+
export declare type QuarterPickerProps = typeof AntdDatePicker.QuarterPicker;
|
|
69
|
+
export default DatePicker;
|
package/dist/DatePicker/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
var _excluded = ["size", "disabled"]
|
|
1
|
+
var _excluded = ["size", "disabled", "prefixCls", "className"],
|
|
2
|
+
_excluded2 = ["size", "disabled", "prefixCls", "className"],
|
|
3
|
+
_excluded3 = ["size", "disabled", "prefixCls", "className"],
|
|
4
|
+
_excluded4 = ["size", "disabled", "prefixCls", "className"],
|
|
5
|
+
_excluded5 = ["size", "disabled", "prefixCls", "className"],
|
|
6
|
+
_excluded6 = ["size", "disabled", "prefixCls", "className"],
|
|
7
|
+
_excluded7 = ["size", "disabled", "prefixCls", "className"];
|
|
2
8
|
|
|
3
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
10
|
|
|
@@ -7,31 +13,228 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
7
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
14
|
|
|
9
15
|
import { DatePicker as AntdDatePicker } from 'antd';
|
|
16
|
+
import { ConfigContext } from 'antd/lib/config-provider';
|
|
10
17
|
import DisabledContext from 'antd/lib/config-provider/DisabledContext';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
18
|
+
import { useCompactItemContext } from 'antd/lib/space/Compact';
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import React, { forwardRef, useContext } from 'react';
|
|
21
|
+
import SizeContext from "../ConfigProvider/sizeContext"; // export type {
|
|
22
|
+
// MonthPickerProps,
|
|
23
|
+
// RangePickerProps,
|
|
24
|
+
// WeekPickerProps,
|
|
25
|
+
// } from 'antd/lib/date-picker';
|
|
26
|
+
// export type { DatePickerProps };
|
|
13
27
|
|
|
14
|
-
var DatePicker = function
|
|
28
|
+
var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
15
29
|
var customSize = props.size,
|
|
16
30
|
customDisabled = props.disabled,
|
|
17
|
-
|
|
31
|
+
customizePrefixCls = props.prefixCls,
|
|
32
|
+
className = props.className,
|
|
33
|
+
restProps = _objectWithoutProperties(props, _excluded); // ===================== Compact Item =====================
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
37
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
38
|
+
direction = _React$useContext.direction;
|
|
39
|
+
|
|
40
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
41
|
+
|
|
42
|
+
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
43
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
44
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
18
45
|
|
|
19
46
|
var contentSize = useContext(SizeContext);
|
|
20
|
-
var size = customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
47
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
21
48
|
|
|
22
49
|
var disabled = useContext(DisabledContext);
|
|
23
50
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
24
51
|
return /*#__PURE__*/React.createElement(AntdDatePicker, _extends({
|
|
52
|
+
ref: ref,
|
|
53
|
+
size: size,
|
|
54
|
+
className: classNames(compactItemClassnames, className),
|
|
55
|
+
disabled: mergedDisabled
|
|
56
|
+
}, restProps));
|
|
57
|
+
});
|
|
58
|
+
DatePicker.RangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
59
|
+
var customSize = props.size,
|
|
60
|
+
customDisabled = props.disabled,
|
|
61
|
+
customizePrefixCls = props.prefixCls,
|
|
62
|
+
className = props.className,
|
|
63
|
+
restProps = _objectWithoutProperties(props, _excluded2); // ===================== Compact Item =====================
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
var _React$useContext2 = React.useContext(ConfigContext),
|
|
67
|
+
getPrefixCls = _React$useContext2.getPrefixCls,
|
|
68
|
+
direction = _React$useContext2.direction;
|
|
69
|
+
|
|
70
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
71
|
+
|
|
72
|
+
var _useCompactItemContex2 = useCompactItemContext(prefixCls, direction),
|
|
73
|
+
compactSize = _useCompactItemContex2.compactSize,
|
|
74
|
+
compactItemClassnames = _useCompactItemContex2.compactItemClassnames;
|
|
75
|
+
|
|
76
|
+
var contentSize = useContext(SizeContext);
|
|
77
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
78
|
+
|
|
79
|
+
var disabled = useContext(DisabledContext);
|
|
80
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
81
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.RangePicker, _extends({
|
|
82
|
+
ref: ref,
|
|
83
|
+
size: size,
|
|
84
|
+
className: classNames(compactItemClassnames, className),
|
|
85
|
+
disabled: mergedDisabled
|
|
86
|
+
}, restProps));
|
|
87
|
+
});
|
|
88
|
+
DatePicker.WeekPicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
89
|
+
var customSize = props.size,
|
|
90
|
+
customDisabled = props.disabled,
|
|
91
|
+
customizePrefixCls = props.prefixCls,
|
|
92
|
+
className = props.className,
|
|
93
|
+
restProps = _objectWithoutProperties(props, _excluded3); // ===================== Compact Item =====================
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
var _React$useContext3 = React.useContext(ConfigContext),
|
|
97
|
+
getPrefixCls = _React$useContext3.getPrefixCls,
|
|
98
|
+
direction = _React$useContext3.direction;
|
|
99
|
+
|
|
100
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
101
|
+
|
|
102
|
+
var _useCompactItemContex3 = useCompactItemContext(prefixCls, direction),
|
|
103
|
+
compactSize = _useCompactItemContex3.compactSize,
|
|
104
|
+
compactItemClassnames = _useCompactItemContex3.compactItemClassnames;
|
|
105
|
+
|
|
106
|
+
var contentSize = useContext(SizeContext);
|
|
107
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
108
|
+
|
|
109
|
+
var disabled = useContext(DisabledContext);
|
|
110
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
111
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.WeekPicker, _extends({
|
|
112
|
+
ref: ref,
|
|
113
|
+
size: size,
|
|
114
|
+
className: classNames(compactItemClassnames, className),
|
|
115
|
+
disabled: mergedDisabled
|
|
116
|
+
}, restProps));
|
|
117
|
+
});
|
|
118
|
+
DatePicker.MonthPicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
119
|
+
var customSize = props.size,
|
|
120
|
+
customDisabled = props.disabled,
|
|
121
|
+
customizePrefixCls = props.prefixCls,
|
|
122
|
+
className = props.className,
|
|
123
|
+
restProps = _objectWithoutProperties(props, _excluded4); // ===================== Compact Item =====================
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
var _React$useContext4 = React.useContext(ConfigContext),
|
|
127
|
+
getPrefixCls = _React$useContext4.getPrefixCls,
|
|
128
|
+
direction = _React$useContext4.direction;
|
|
129
|
+
|
|
130
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
131
|
+
|
|
132
|
+
var _useCompactItemContex4 = useCompactItemContext(prefixCls, direction),
|
|
133
|
+
compactSize = _useCompactItemContex4.compactSize,
|
|
134
|
+
compactItemClassnames = _useCompactItemContex4.compactItemClassnames;
|
|
135
|
+
|
|
136
|
+
var contentSize = useContext(SizeContext);
|
|
137
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
138
|
+
|
|
139
|
+
var disabled = useContext(DisabledContext);
|
|
140
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
141
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.MonthPicker, _extends({
|
|
142
|
+
ref: ref,
|
|
143
|
+
size: size,
|
|
144
|
+
className: classNames(compactItemClassnames, className),
|
|
145
|
+
disabled: mergedDisabled
|
|
146
|
+
}, restProps));
|
|
147
|
+
});
|
|
148
|
+
DatePicker.YearPicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
149
|
+
var customSize = props.size,
|
|
150
|
+
customDisabled = props.disabled,
|
|
151
|
+
customizePrefixCls = props.prefixCls,
|
|
152
|
+
className = props.className,
|
|
153
|
+
restProps = _objectWithoutProperties(props, _excluded5); // ===================== Compact Item =====================
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
var _React$useContext5 = React.useContext(ConfigContext),
|
|
157
|
+
getPrefixCls = _React$useContext5.getPrefixCls,
|
|
158
|
+
direction = _React$useContext5.direction;
|
|
159
|
+
|
|
160
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
161
|
+
|
|
162
|
+
var _useCompactItemContex5 = useCompactItemContext(prefixCls, direction),
|
|
163
|
+
compactSize = _useCompactItemContex5.compactSize,
|
|
164
|
+
compactItemClassnames = _useCompactItemContex5.compactItemClassnames;
|
|
165
|
+
|
|
166
|
+
var contentSize = useContext(SizeContext);
|
|
167
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
168
|
+
|
|
169
|
+
var disabled = useContext(DisabledContext);
|
|
170
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
171
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.YearPicker, _extends({
|
|
172
|
+
ref: ref,
|
|
25
173
|
size: size,
|
|
174
|
+
className: classNames(compactItemClassnames, className),
|
|
26
175
|
disabled: mergedDisabled
|
|
27
176
|
}, restProps));
|
|
28
|
-
};
|
|
177
|
+
});
|
|
178
|
+
DatePicker.TimePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
179
|
+
var customSize = props.size,
|
|
180
|
+
customDisabled = props.disabled,
|
|
181
|
+
customizePrefixCls = props.prefixCls,
|
|
182
|
+
className = props.className,
|
|
183
|
+
restProps = _objectWithoutProperties(props, _excluded6); // ===================== Compact Item =====================
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
var _React$useContext6 = React.useContext(ConfigContext),
|
|
187
|
+
getPrefixCls = _React$useContext6.getPrefixCls,
|
|
188
|
+
direction = _React$useContext6.direction;
|
|
189
|
+
|
|
190
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
29
191
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
DatePicker.RangePicker = AntdDatePicker.RangePicker;
|
|
34
|
-
DatePicker.TimePicker = AntdDatePicker.TimePicker;
|
|
35
|
-
DatePicker.QuarterPicker = AntdDatePicker.QuarterPicker; // 基于DatePicker的组件,prop都一样,类型保持一致
|
|
192
|
+
var _useCompactItemContex6 = useCompactItemContext(prefixCls, direction),
|
|
193
|
+
compactSize = _useCompactItemContex6.compactSize,
|
|
194
|
+
compactItemClassnames = _useCompactItemContex6.compactItemClassnames;
|
|
36
195
|
|
|
196
|
+
var contentSize = useContext(SizeContext);
|
|
197
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
198
|
+
|
|
199
|
+
var disabled = useContext(DisabledContext);
|
|
200
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
201
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.TimePicker, _extends({
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
ref: ref,
|
|
204
|
+
size: size,
|
|
205
|
+
className: classNames(compactItemClassnames, className),
|
|
206
|
+
disabled: mergedDisabled
|
|
207
|
+
}, restProps));
|
|
208
|
+
});
|
|
209
|
+
DatePicker.QuarterPicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
210
|
+
var customSize = props.size,
|
|
211
|
+
customDisabled = props.disabled,
|
|
212
|
+
customizePrefixCls = props.prefixCls,
|
|
213
|
+
className = props.className,
|
|
214
|
+
restProps = _objectWithoutProperties(props, _excluded7); // ===================== Compact Item =====================
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
var _React$useContext7 = React.useContext(ConfigContext),
|
|
218
|
+
getPrefixCls = _React$useContext7.getPrefixCls,
|
|
219
|
+
direction = _React$useContext7.direction;
|
|
220
|
+
|
|
221
|
+
var prefixCls = getPrefixCls('picker', customizePrefixCls);
|
|
222
|
+
|
|
223
|
+
var _useCompactItemContex7 = useCompactItemContext(prefixCls, direction),
|
|
224
|
+
compactSize = _useCompactItemContex7.compactSize,
|
|
225
|
+
compactItemClassnames = _useCompactItemContex7.compactItemClassnames;
|
|
226
|
+
|
|
227
|
+
var contentSize = useContext(SizeContext);
|
|
228
|
+
var size = compactSize || customSize || contentSize || 'middle'; // ===================== Disabled =====================
|
|
229
|
+
|
|
230
|
+
var disabled = useContext(DisabledContext);
|
|
231
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
232
|
+
return /*#__PURE__*/React.createElement(AntdDatePicker.QuarterPicker, _extends({
|
|
233
|
+
// @ts-ignore
|
|
234
|
+
ref: ref,
|
|
235
|
+
size: size,
|
|
236
|
+
className: classNames(compactItemClassnames, className),
|
|
237
|
+
disabled: mergedDisabled
|
|
238
|
+
}, restProps));
|
|
239
|
+
});
|
|
37
240
|
export default DatePicker;
|