@rc-component/picker 1.3.0 → 1.4.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/README.md +3 -1
- package/es/PickerInput/RangePicker.js +10 -4
- package/es/PickerInput/Selector/hooks/useClearIcon.d.ts +1 -1
- package/es/PickerInput/SinglePicker.js +10 -4
- package/es/PickerInput/hooks/useFilledProps.d.ts +1 -1
- package/es/PickerInput/hooks/useFilledProps.js +3 -0
- package/es/PickerPanel/index.d.ts +1 -9
- package/es/interface.d.ts +7 -0
- package/es/locale/te_IN.d.ts +3 -0
- package/es/locale/te_IN.js +33 -0
- package/es/utils/getClearIcon.d.ts +1 -1
- package/lib/PickerInput/RangePicker.js +10 -4
- package/lib/PickerInput/Selector/hooks/useClearIcon.d.ts +1 -1
- package/lib/PickerInput/SinglePicker.js +10 -4
- package/lib/PickerInput/hooks/useFilledProps.d.ts +1 -1
- package/lib/PickerInput/hooks/useFilledProps.js +3 -0
- package/lib/PickerPanel/index.d.ts +1 -9
- package/lib/interface.d.ts +7 -0
- package/lib/locale/te_IN.d.ts +3 -0
- package/lib/locale/te_IN.js +39 -0
- package/lib/utils/getClearIcon.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ render(<Picker />, mountNode);
|
|
|
54
54
|
| autoFocus | boolean | false | whether auto focus |
|
|
55
55
|
| showTime | boolean \| Object | [showTime options](#showTime-options) | to provide an additional time selection |
|
|
56
56
|
| picker | time \| date \| week \| month \| year | | control which kind of panel should be shown |
|
|
57
|
+
| previewValue | false \| hover | hover | When the user selects the date hover option, the value of the input field undergoes a temporary change |
|
|
57
58
|
| format | String \| String[] | depends on whether you set timePicker and your locale | use to format/parse date(without time) value to/from input. When an array is provided, all values are used for parsing and first value for display |
|
|
58
59
|
| use12Hours | boolean | false | 12 hours display mode |
|
|
59
60
|
| value | moment | | current value like input's value |
|
|
@@ -102,7 +103,7 @@ render(<Picker />, mountNode);
|
|
|
102
103
|
### RangePicker
|
|
103
104
|
|
|
104
105
|
| Property | Type | Default | Description |
|
|
105
|
-
| --- | --- | --- | --- |
|
|
106
|
+
| --- | --- | --- | --- | --- |
|
|
106
107
|
| prefixCls | String | rc-picker | prefixCls of this component |
|
|
107
108
|
| className | String | '' | additional css class of root dom |
|
|
108
109
|
| style | React.CSSProperties | | additional style of root dom node |
|
|
@@ -112,6 +113,7 @@ render(<Picker />, mountNode);
|
|
|
112
113
|
| defaultPickerValue | moment | | Set default display picker view date |
|
|
113
114
|
| separator | String | '~' | set separator between inputs |
|
|
114
115
|
| picker | time \| date \| week \| month \| year | | control which kind of panel |
|
|
116
|
+
| previewValue | false \| hover | hover | When the user selects the date hover option, the value of the input field undergoes a temporary change |
|
|
115
117
|
| placeholder | [String, String] | | placeholder of date input |
|
|
116
118
|
| showTime | boolean \| Object | [showTime options](#showTime-options) | to provide an additional time selection |
|
|
117
119
|
| showTime.defaultValue | [moment, moment] | | to set default time of selected date |
|
|
@@ -76,6 +76,7 @@ function RangePicker(props, ref) {
|
|
|
76
76
|
rootClassName = filledProps.rootClassName,
|
|
77
77
|
propStyles = filledProps.styles,
|
|
78
78
|
propClassNames = filledProps.classNames,
|
|
79
|
+
previewValue = filledProps.previewValue,
|
|
79
80
|
defaultValue = filledProps.defaultValue,
|
|
80
81
|
value = filledProps.value,
|
|
81
82
|
needConfirm = filledProps.needConfirm,
|
|
@@ -340,12 +341,18 @@ function RangePicker(props, ref) {
|
|
|
340
341
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
341
342
|
activeInfo = _React$useState6[0],
|
|
342
343
|
setActiveInfo = _React$useState6[1];
|
|
344
|
+
var onSetHover = function onSetHover(date, source) {
|
|
345
|
+
if (previewValue !== 'hover') {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
setInternalHoverValues(date);
|
|
349
|
+
setHoverSource(source);
|
|
350
|
+
};
|
|
343
351
|
|
|
344
352
|
// ======================= Presets ========================
|
|
345
353
|
var presetList = usePresets(presets, ranges);
|
|
346
354
|
var onPresetHover = function onPresetHover(nextValues) {
|
|
347
|
-
|
|
348
|
-
setHoverSource('preset');
|
|
355
|
+
onSetHover(nextValues, 'preset');
|
|
349
356
|
};
|
|
350
357
|
var onPresetSubmit = function onPresetSubmit(nextValues) {
|
|
351
358
|
var passed = triggerSubmitChange(nextValues);
|
|
@@ -361,8 +368,7 @@ function RangePicker(props, ref) {
|
|
|
361
368
|
|
|
362
369
|
// ======================== Panel =========================
|
|
363
370
|
var onPanelHover = function onPanelHover(date) {
|
|
364
|
-
|
|
365
|
-
setHoverSource('cell');
|
|
371
|
+
onSetHover(date ? fillCalendarValue(date, activeIndex) : null, 'cell');
|
|
366
372
|
};
|
|
367
373
|
|
|
368
374
|
// >>> Focus
|
|
@@ -5,4 +5,4 @@ import * as React from 'react';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function fillClearIcon(prefixCls: string, allowClear?: boolean | {
|
|
7
7
|
clearIcon?: ReactNode;
|
|
8
|
-
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element
|
|
8
|
+
}, clearIcon?: ReactNode): string | number | true | Iterable<ReactNode> | React.JSX.Element;
|
|
@@ -59,6 +59,7 @@ function Picker(props, ref) {
|
|
|
59
59
|
rootClassName = _ref.rootClassName,
|
|
60
60
|
propStyles = _ref.styles,
|
|
61
61
|
propClassNames = _ref.classNames,
|
|
62
|
+
previewValue = _ref.previewValue,
|
|
62
63
|
order = _ref.order,
|
|
63
64
|
defaultValue = _ref.defaultValue,
|
|
64
65
|
value = _ref.value,
|
|
@@ -289,6 +290,13 @@ function Picker(props, ref) {
|
|
|
289
290
|
setInternalHoverValue(null);
|
|
290
291
|
}
|
|
291
292
|
}, [mergedOpen]);
|
|
293
|
+
var onSetHover = function onSetHover(date, source) {
|
|
294
|
+
if (previewValue !== 'hover') {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
setInternalHoverValue(date);
|
|
298
|
+
setHoverSource(source);
|
|
299
|
+
};
|
|
292
300
|
|
|
293
301
|
// ========================================================
|
|
294
302
|
// == Panels ==
|
|
@@ -296,8 +304,7 @@ function Picker(props, ref) {
|
|
|
296
304
|
// ======================= Presets ========================
|
|
297
305
|
var presetList = usePresets(presets);
|
|
298
306
|
var onPresetHover = function onPresetHover(nextValue) {
|
|
299
|
-
|
|
300
|
-
setHoverSource('preset');
|
|
307
|
+
onSetHover(nextValue, 'preset');
|
|
301
308
|
};
|
|
302
309
|
|
|
303
310
|
// TODO: handle this
|
|
@@ -316,8 +323,7 @@ function Picker(props, ref) {
|
|
|
316
323
|
|
|
317
324
|
// ======================== Panel =========================
|
|
318
325
|
var onPanelHover = function onPanelHover(date) {
|
|
319
|
-
|
|
320
|
-
setHoverSource('cell');
|
|
326
|
+
onSetHover(date, 'cell');
|
|
321
327
|
};
|
|
322
328
|
|
|
323
329
|
// >>> Focus
|
|
@@ -2,7 +2,7 @@ import type { FormatType, InternalMode, PickerMode } from '../../interface';
|
|
|
2
2
|
import type { RangePickerProps } from '../RangePicker';
|
|
3
3
|
import useInvalidate from './useInvalidate';
|
|
4
4
|
type UseInvalidate<DateType extends object = any> = typeof useInvalidate<DateType>;
|
|
5
|
-
type PickedProps<DateType extends object = any> = Pick<RangePickerProps<DateType>, 'generateConfig' | 'locale' | 'picker' | 'prefixCls' | 'styles' | 'classNames' | 'order' | 'components' | 'inputRender' | 'clearIcon' | 'allowClear' | 'needConfirm' | 'format' | 'inputReadOnly' | 'disabledDate' | 'minDate' | 'maxDate' | 'defaultOpenValue'> & {
|
|
5
|
+
type PickedProps<DateType extends object = any> = Pick<RangePickerProps<DateType>, 'generateConfig' | 'locale' | 'picker' | 'prefixCls' | 'styles' | 'classNames' | 'order' | 'components' | 'inputRender' | 'clearIcon' | 'allowClear' | 'needConfirm' | 'format' | 'inputReadOnly' | 'disabledDate' | 'minDate' | 'maxDate' | 'defaultOpenValue' | 'previewValue'> & {
|
|
6
6
|
multiple?: boolean;
|
|
7
7
|
showTime?: any;
|
|
8
8
|
value?: any;
|
|
@@ -45,6 +45,8 @@ export default function useFilledProps(props, updater) {
|
|
|
45
45
|
picker = _props$picker === void 0 ? 'date' : _props$picker,
|
|
46
46
|
_props$prefixCls = props.prefixCls,
|
|
47
47
|
prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,
|
|
48
|
+
_props$previewValue = props.previewValue,
|
|
49
|
+
previewValue = _props$previewValue === void 0 ? 'hover' : _props$previewValue,
|
|
48
50
|
_props$styles = props.styles,
|
|
49
51
|
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
50
52
|
_props$classNames = props.classNames,
|
|
@@ -110,6 +112,7 @@ export default function useFilledProps(props, updater) {
|
|
|
110
112
|
// ======================== Props =========================
|
|
111
113
|
var filledProps = React.useMemo(function () {
|
|
112
114
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
115
|
+
previewValue: previewValue,
|
|
113
116
|
prefixCls: prefixCls,
|
|
114
117
|
locale: mergedLocale,
|
|
115
118
|
picker: picker,
|
|
@@ -52,13 +52,5 @@ export type PickerPanelProps<DateType extends object = any> = BasePickerPanelPro
|
|
|
52
52
|
styles?: Partial<Record<PanelSemanticName, React.CSSProperties>>;
|
|
53
53
|
classNames?: Partial<Record<PanelSemanticName, string>>;
|
|
54
54
|
};
|
|
55
|
-
declare const _default: <DateType extends object = any>(props:
|
|
56
|
-
/** multiple selection. Not support time or datetime picker */
|
|
57
|
-
multiple?: boolean;
|
|
58
|
-
defaultValue?: DateType | DateType[];
|
|
59
|
-
value?: DateType | DateType[];
|
|
60
|
-
onChange?: (date: DateType | DateType[]) => void;
|
|
61
|
-
styles?: Partial<Record<PanelSemanticName, React.CSSProperties>>;
|
|
62
|
-
classNames?: Partial<Record<PanelSemanticName, string>>;
|
|
63
|
-
} & React.RefAttributes<PickerPanelRef>) => React.ReactElement;
|
|
55
|
+
declare const _default: <DateType extends object = any>(props: PickerPanelProps<DateType> & React.RefAttributes<PickerPanelRef>) => React.ReactElement;
|
|
64
56
|
export default _default;
|
package/es/interface.d.ts
CHANGED
|
@@ -207,6 +207,7 @@ export type SharedHTMLAttrs = Omit<React.InputHTMLAttributes<HTMLDivElement>, 'v
|
|
|
207
207
|
export type PickerFocusEventHandler = (e: React.FocusEvent<HTMLElement>, info: BaseInfo) => void;
|
|
208
208
|
export type LegacyOnKeyDown = (event: React.KeyboardEvent<HTMLElement>, preventDefault: VoidFunction) => void;
|
|
209
209
|
export type SemanticName = 'root' | 'prefix' | 'input' | 'suffix';
|
|
210
|
+
export type PreviewValueType = 'hover';
|
|
210
211
|
export type PanelSemanticName = 'root' | 'header' | 'body' | 'content' | 'item' | 'footer';
|
|
211
212
|
export interface SharedPickerProps<DateType extends object = any> extends SharedHTMLAttrs, Pick<SharedPanelProps<DateType>, 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon'> {
|
|
212
213
|
direction?: 'ltr' | 'rtl';
|
|
@@ -281,6 +282,12 @@ export interface SharedPickerProps<DateType extends object = any> extends Shared
|
|
|
281
282
|
* This is only used for strong a11y requirement which do not want modify after blur.
|
|
282
283
|
*/
|
|
283
284
|
preserveInvalidOnBlur?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* When the user selects the date hover option, the value of the input field undergoes a temporary change.
|
|
287
|
+
* `false` will not preview value.
|
|
288
|
+
* `hover` will preview value when hover.
|
|
289
|
+
*/
|
|
290
|
+
previewValue?: false | PreviewValueType;
|
|
284
291
|
transitionName?: string;
|
|
285
292
|
components?: Components<DateType>;
|
|
286
293
|
/** @deprecated Please use `components.input` instead. */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { commonLocale } from "./common";
|
|
8
|
+
var locale = _objectSpread(_objectSpread({}, commonLocale), {}, {
|
|
9
|
+
locale: 'te_IN',
|
|
10
|
+
today: 'నేడు',
|
|
11
|
+
now: 'ఇప్పుడు',
|
|
12
|
+
backToToday: 'తిరిగి నేటికి',
|
|
13
|
+
ok: 'సరే',
|
|
14
|
+
clear: 'స్పష్టమైన',
|
|
15
|
+
week: 'వారం',
|
|
16
|
+
month: 'నెల',
|
|
17
|
+
year: 'సంవత్సరం',
|
|
18
|
+
timeSelect: 'సమయం ఎంపిక',
|
|
19
|
+
dateSelect: 'తేదీ ఎంపిక',
|
|
20
|
+
weekSelect: 'వారం ఎంపిక',
|
|
21
|
+
monthSelect: 'నెల ఎంపిక',
|
|
22
|
+
yearSelect: 'సంవత్సరం ఎంపిక',
|
|
23
|
+
decadeSelect: 'దశాబ్దం ఎంపిక',
|
|
24
|
+
previousMonth: 'మునుపటి నెల',
|
|
25
|
+
nextMonth: 'వచ్చే నెల',
|
|
26
|
+
previousYear: 'మునుపటి సంవత్సరం',
|
|
27
|
+
nextYear: 'తదుపరి సంవత్సరం',
|
|
28
|
+
previousDecade: 'మునుపటి దశాబ్దం',
|
|
29
|
+
nextDecade: 'తదుపరి దశాబ్దం',
|
|
30
|
+
previousCentury: 'మునుపటి శతాబ్దం',
|
|
31
|
+
nextCentury: 'తదుపరి శతాబ్దం'
|
|
32
|
+
});
|
|
33
|
+
export default locale;
|
|
@@ -2,4 +2,4 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare function getClearIcon(prefixCls: string, allowClear?: boolean | {
|
|
4
4
|
clearIcon?: ReactNode;
|
|
5
|
-
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element
|
|
5
|
+
}, clearIcon?: ReactNode): string | number | true | Iterable<ReactNode> | React.JSX.Element;
|
|
@@ -85,6 +85,7 @@ function RangePicker(props, ref) {
|
|
|
85
85
|
rootClassName = filledProps.rootClassName,
|
|
86
86
|
propStyles = filledProps.styles,
|
|
87
87
|
propClassNames = filledProps.classNames,
|
|
88
|
+
previewValue = filledProps.previewValue,
|
|
88
89
|
defaultValue = filledProps.defaultValue,
|
|
89
90
|
value = filledProps.value,
|
|
90
91
|
needConfirm = filledProps.needConfirm,
|
|
@@ -349,12 +350,18 @@ function RangePicker(props, ref) {
|
|
|
349
350
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
350
351
|
activeInfo = _React$useState6[0],
|
|
351
352
|
setActiveInfo = _React$useState6[1];
|
|
353
|
+
var onSetHover = function onSetHover(date, source) {
|
|
354
|
+
if (previewValue !== 'hover') {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
setInternalHoverValues(date);
|
|
358
|
+
setHoverSource(source);
|
|
359
|
+
};
|
|
352
360
|
|
|
353
361
|
// ======================= Presets ========================
|
|
354
362
|
var presetList = (0, _usePresets.default)(presets, ranges);
|
|
355
363
|
var onPresetHover = function onPresetHover(nextValues) {
|
|
356
|
-
|
|
357
|
-
setHoverSource('preset');
|
|
364
|
+
onSetHover(nextValues, 'preset');
|
|
358
365
|
};
|
|
359
366
|
var onPresetSubmit = function onPresetSubmit(nextValues) {
|
|
360
367
|
var passed = triggerSubmitChange(nextValues);
|
|
@@ -370,8 +377,7 @@ function RangePicker(props, ref) {
|
|
|
370
377
|
|
|
371
378
|
// ======================== Panel =========================
|
|
372
379
|
var onPanelHover = function onPanelHover(date) {
|
|
373
|
-
|
|
374
|
-
setHoverSource('cell');
|
|
380
|
+
onSetHover(date ? fillCalendarValue(date, activeIndex) : null, 'cell');
|
|
375
381
|
};
|
|
376
382
|
|
|
377
383
|
// >>> Focus
|
|
@@ -5,4 +5,4 @@ import * as React from 'react';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function fillClearIcon(prefixCls: string, allowClear?: boolean | {
|
|
7
7
|
clearIcon?: ReactNode;
|
|
8
|
-
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element
|
|
8
|
+
}, clearIcon?: ReactNode): string | number | true | Iterable<ReactNode> | React.JSX.Element;
|
|
@@ -67,6 +67,7 @@ function Picker(props, ref) {
|
|
|
67
67
|
rootClassName = _ref.rootClassName,
|
|
68
68
|
propStyles = _ref.styles,
|
|
69
69
|
propClassNames = _ref.classNames,
|
|
70
|
+
previewValue = _ref.previewValue,
|
|
70
71
|
order = _ref.order,
|
|
71
72
|
defaultValue = _ref.defaultValue,
|
|
72
73
|
value = _ref.value,
|
|
@@ -297,6 +298,13 @@ function Picker(props, ref) {
|
|
|
297
298
|
setInternalHoverValue(null);
|
|
298
299
|
}
|
|
299
300
|
}, [mergedOpen]);
|
|
301
|
+
var onSetHover = function onSetHover(date, source) {
|
|
302
|
+
if (previewValue !== 'hover') {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
setInternalHoverValue(date);
|
|
306
|
+
setHoverSource(source);
|
|
307
|
+
};
|
|
300
308
|
|
|
301
309
|
// ========================================================
|
|
302
310
|
// == Panels ==
|
|
@@ -304,8 +312,7 @@ function Picker(props, ref) {
|
|
|
304
312
|
// ======================= Presets ========================
|
|
305
313
|
var presetList = (0, _usePresets.default)(presets);
|
|
306
314
|
var onPresetHover = function onPresetHover(nextValue) {
|
|
307
|
-
|
|
308
|
-
setHoverSource('preset');
|
|
315
|
+
onSetHover(nextValue, 'preset');
|
|
309
316
|
};
|
|
310
317
|
|
|
311
318
|
// TODO: handle this
|
|
@@ -324,8 +331,7 @@ function Picker(props, ref) {
|
|
|
324
331
|
|
|
325
332
|
// ======================== Panel =========================
|
|
326
333
|
var onPanelHover = function onPanelHover(date) {
|
|
327
|
-
|
|
328
|
-
setHoverSource('cell');
|
|
334
|
+
onSetHover(date, 'cell');
|
|
329
335
|
};
|
|
330
336
|
|
|
331
337
|
// >>> Focus
|
|
@@ -2,7 +2,7 @@ import type { FormatType, InternalMode, PickerMode } from '../../interface';
|
|
|
2
2
|
import type { RangePickerProps } from '../RangePicker';
|
|
3
3
|
import useInvalidate from './useInvalidate';
|
|
4
4
|
type UseInvalidate<DateType extends object = any> = typeof useInvalidate<DateType>;
|
|
5
|
-
type PickedProps<DateType extends object = any> = Pick<RangePickerProps<DateType>, 'generateConfig' | 'locale' | 'picker' | 'prefixCls' | 'styles' | 'classNames' | 'order' | 'components' | 'inputRender' | 'clearIcon' | 'allowClear' | 'needConfirm' | 'format' | 'inputReadOnly' | 'disabledDate' | 'minDate' | 'maxDate' | 'defaultOpenValue'> & {
|
|
5
|
+
type PickedProps<DateType extends object = any> = Pick<RangePickerProps<DateType>, 'generateConfig' | 'locale' | 'picker' | 'prefixCls' | 'styles' | 'classNames' | 'order' | 'components' | 'inputRender' | 'clearIcon' | 'allowClear' | 'needConfirm' | 'format' | 'inputReadOnly' | 'disabledDate' | 'minDate' | 'maxDate' | 'defaultOpenValue' | 'previewValue'> & {
|
|
6
6
|
multiple?: boolean;
|
|
7
7
|
showTime?: any;
|
|
8
8
|
value?: any;
|
|
@@ -54,6 +54,8 @@ function useFilledProps(props, updater) {
|
|
|
54
54
|
picker = _props$picker === void 0 ? 'date' : _props$picker,
|
|
55
55
|
_props$prefixCls = props.prefixCls,
|
|
56
56
|
prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,
|
|
57
|
+
_props$previewValue = props.previewValue,
|
|
58
|
+
previewValue = _props$previewValue === void 0 ? 'hover' : _props$previewValue,
|
|
57
59
|
_props$styles = props.styles,
|
|
58
60
|
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
59
61
|
_props$classNames = props.classNames,
|
|
@@ -119,6 +121,7 @@ function useFilledProps(props, updater) {
|
|
|
119
121
|
// ======================== Props =========================
|
|
120
122
|
var filledProps = React.useMemo(function () {
|
|
121
123
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
124
|
+
previewValue: previewValue,
|
|
122
125
|
prefixCls: prefixCls,
|
|
123
126
|
locale: mergedLocale,
|
|
124
127
|
picker: picker,
|
|
@@ -52,13 +52,5 @@ export type PickerPanelProps<DateType extends object = any> = BasePickerPanelPro
|
|
|
52
52
|
styles?: Partial<Record<PanelSemanticName, React.CSSProperties>>;
|
|
53
53
|
classNames?: Partial<Record<PanelSemanticName, string>>;
|
|
54
54
|
};
|
|
55
|
-
declare const _default: <DateType extends object = any>(props:
|
|
56
|
-
/** multiple selection. Not support time or datetime picker */
|
|
57
|
-
multiple?: boolean;
|
|
58
|
-
defaultValue?: DateType | DateType[];
|
|
59
|
-
value?: DateType | DateType[];
|
|
60
|
-
onChange?: (date: DateType | DateType[]) => void;
|
|
61
|
-
styles?: Partial<Record<PanelSemanticName, React.CSSProperties>>;
|
|
62
|
-
classNames?: Partial<Record<PanelSemanticName, string>>;
|
|
63
|
-
} & React.RefAttributes<PickerPanelRef>) => React.ReactElement;
|
|
55
|
+
declare const _default: <DateType extends object = any>(props: PickerPanelProps<DateType> & React.RefAttributes<PickerPanelRef>) => React.ReactElement;
|
|
64
56
|
export default _default;
|
package/lib/interface.d.ts
CHANGED
|
@@ -207,6 +207,7 @@ export type SharedHTMLAttrs = Omit<React.InputHTMLAttributes<HTMLDivElement>, 'v
|
|
|
207
207
|
export type PickerFocusEventHandler = (e: React.FocusEvent<HTMLElement>, info: BaseInfo) => void;
|
|
208
208
|
export type LegacyOnKeyDown = (event: React.KeyboardEvent<HTMLElement>, preventDefault: VoidFunction) => void;
|
|
209
209
|
export type SemanticName = 'root' | 'prefix' | 'input' | 'suffix';
|
|
210
|
+
export type PreviewValueType = 'hover';
|
|
210
211
|
export type PanelSemanticName = 'root' | 'header' | 'body' | 'content' | 'item' | 'footer';
|
|
211
212
|
export interface SharedPickerProps<DateType extends object = any> extends SharedHTMLAttrs, Pick<SharedPanelProps<DateType>, 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon'> {
|
|
212
213
|
direction?: 'ltr' | 'rtl';
|
|
@@ -281,6 +282,12 @@ export interface SharedPickerProps<DateType extends object = any> extends Shared
|
|
|
281
282
|
* This is only used for strong a11y requirement which do not want modify after blur.
|
|
282
283
|
*/
|
|
283
284
|
preserveInvalidOnBlur?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* When the user selects the date hover option, the value of the input field undergoes a temporary change.
|
|
287
|
+
* `false` will not preview value.
|
|
288
|
+
* `hover` will preview value when hover.
|
|
289
|
+
*/
|
|
290
|
+
previewValue?: false | PreviewValueType;
|
|
284
291
|
transitionName?: string;
|
|
285
292
|
components?: Components<DateType>;
|
|
286
293
|
/** @deprecated Please use `components.input` instead. */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _common = require("./common");
|
|
8
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
var locale = _objectSpread(_objectSpread({}, _common.commonLocale), {}, {
|
|
15
|
+
locale: 'te_IN',
|
|
16
|
+
today: 'నేడు',
|
|
17
|
+
now: 'ఇప్పుడు',
|
|
18
|
+
backToToday: 'తిరిగి నేటికి',
|
|
19
|
+
ok: 'సరే',
|
|
20
|
+
clear: 'స్పష్టమైన',
|
|
21
|
+
week: 'వారం',
|
|
22
|
+
month: 'నెల',
|
|
23
|
+
year: 'సంవత్సరం',
|
|
24
|
+
timeSelect: 'సమయం ఎంపిక',
|
|
25
|
+
dateSelect: 'తేదీ ఎంపిక',
|
|
26
|
+
weekSelect: 'వారం ఎంపిక',
|
|
27
|
+
monthSelect: 'నెల ఎంపిక',
|
|
28
|
+
yearSelect: 'సంవత్సరం ఎంపిక',
|
|
29
|
+
decadeSelect: 'దశాబ్దం ఎంపిక',
|
|
30
|
+
previousMonth: 'మునుపటి నెల',
|
|
31
|
+
nextMonth: 'వచ్చే నెల',
|
|
32
|
+
previousYear: 'మునుపటి సంవత్సరం',
|
|
33
|
+
nextYear: 'తదుపరి సంవత్సరం',
|
|
34
|
+
previousDecade: 'మునుపటి దశాబ్దం',
|
|
35
|
+
nextDecade: 'తదుపరి దశాబ్దం',
|
|
36
|
+
previousCentury: 'మునుపటి శతాబ్దం',
|
|
37
|
+
nextCentury: 'తదుపరి శతాబ్దం'
|
|
38
|
+
});
|
|
39
|
+
var _default = exports.default = locale;
|
|
@@ -2,4 +2,4 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare function getClearIcon(prefixCls: string, allowClear?: boolean | {
|
|
4
4
|
clearIcon?: ReactNode;
|
|
5
|
-
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element
|
|
5
|
+
}, clearIcon?: ReactNode): string | number | true | Iterable<ReactNode> | React.JSX.Element;
|