@rc-component/picker 1.2.4 → 1.3.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/es/PickerInput/Popup/Footer.js +7 -4
- package/es/PickerInput/RangePicker.js +21 -8
- package/es/PickerInput/Selector/Icon.js +4 -4
- package/es/PickerInput/Selector/Input.js +6 -5
- package/es/PickerInput/Selector/RangeSelector.js +5 -5
- package/es/PickerInput/Selector/SingleSelector/index.js +5 -5
- package/es/PickerInput/Selector/hooks/useClearIcon.d.ts +1 -1
- package/es/PickerInput/SinglePicker.js +21 -8
- package/es/PickerInput/context.d.ts +4 -3
- package/es/PickerPanel/PanelBody.js +10 -10
- package/es/PickerPanel/PanelHeader.js +9 -6
- package/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +7 -8
- package/es/PickerPanel/TimePanel/TimePanelBody/index.js +6 -6
- package/es/PickerPanel/context.d.ts +9 -3
- package/es/PickerPanel/context.js +10 -0
- package/es/PickerPanel/index.d.ts +1 -2
- package/es/PickerPanel/index.js +14 -9
- package/es/hooks/useSemantic.d.ts +13 -0
- package/es/hooks/useSemantic.js +21 -0
- package/es/interface.d.ts +9 -3
- package/es/utils/getClearIcon.d.ts +1 -1
- package/lib/PickerInput/Popup/Footer.js +5 -2
- package/lib/PickerInput/RangePicker.js +21 -8
- package/lib/PickerInput/Selector/Icon.js +3 -3
- package/lib/PickerInput/Selector/Input.js +5 -4
- package/lib/PickerInput/Selector/RangeSelector.js +3 -3
- package/lib/PickerInput/Selector/SingleSelector/index.js +3 -3
- package/lib/PickerInput/Selector/hooks/useClearIcon.d.ts +1 -1
- package/lib/PickerInput/SinglePicker.js +21 -8
- package/lib/PickerInput/context.d.ts +4 -3
- package/lib/PickerPanel/PanelBody.js +9 -9
- package/lib/PickerPanel/PanelHeader.js +4 -1
- package/lib/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js +5 -6
- package/lib/PickerPanel/TimePanel/TimePanelBody/index.js +5 -5
- package/lib/PickerPanel/context.d.ts +9 -3
- package/lib/PickerPanel/context.js +11 -1
- package/lib/PickerPanel/index.d.ts +1 -2
- package/lib/PickerPanel/index.js +13 -8
- package/lib/hooks/useSemantic.d.ts +13 -0
- package/lib/hooks/useSemantic.js +27 -0
- package/lib/interface.d.ts +9 -3
- package/lib/utils/getClearIcon.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export var SharedPanelContext = /*#__PURE__*/React.createContext(null);
|
|
2
3
|
/** Used for each single Panel. e.g. DatePanel */
|
|
3
4
|
export var PanelContext = /*#__PURE__*/React.createContext(null);
|
|
4
5
|
export function usePanelContext() {
|
|
@@ -9,6 +10,8 @@ export function usePanelContext() {
|
|
|
9
10
|
* Get shared props for the SharedPanelProps interface.
|
|
10
11
|
*/
|
|
11
12
|
export function useInfo(props, panelType) {
|
|
13
|
+
// TODO: this is not good to get from each props.
|
|
14
|
+
// Should move to `SharedPanelContext` instead.
|
|
12
15
|
var prefixCls = props.prefixCls,
|
|
13
16
|
generateConfig = props.generateConfig,
|
|
14
17
|
locale = props.locale,
|
|
@@ -27,6 +30,11 @@ export function useInfo(props, panelType) {
|
|
|
27
30
|
superPrevIcon = props.superPrevIcon,
|
|
28
31
|
superNextIcon = props.superNextIcon;
|
|
29
32
|
|
|
33
|
+
// ======================= Context ========================
|
|
34
|
+
var _React$useContext = React.useContext(SharedPanelContext),
|
|
35
|
+
classNames = _React$useContext.classNames,
|
|
36
|
+
styles = _React$useContext.styles;
|
|
37
|
+
|
|
30
38
|
// ========================= MISC =========================
|
|
31
39
|
var now = generateConfig.getNow();
|
|
32
40
|
|
|
@@ -36,6 +44,8 @@ export function useInfo(props, panelType) {
|
|
|
36
44
|
values: values,
|
|
37
45
|
pickerValue: pickerValue,
|
|
38
46
|
prefixCls: prefixCls,
|
|
47
|
+
classNames: classNames,
|
|
48
|
+
styles: styles,
|
|
39
49
|
disabledDate: disabledDate,
|
|
40
50
|
minDate: minDate,
|
|
41
51
|
maxDate: maxDate,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { CellRender, Components, Locale, OnPanelChange, PanelMode, PickerMode, SharedPanelProps, SharedTimeProps } from '../interface';
|
|
2
|
+
import type { CellRender, Components, Locale, OnPanelChange, PanelMode, PanelSemanticName, PickerMode, SharedPanelProps, SharedTimeProps } from '../interface';
|
|
3
3
|
export interface PickerPanelRef {
|
|
4
4
|
nativeElement: HTMLDivElement;
|
|
5
5
|
}
|
|
@@ -43,7 +43,6 @@ export interface SinglePickerPanelProps<DateType extends object = any> extends B
|
|
|
43
43
|
value?: DateType | null;
|
|
44
44
|
onChange?: (date: DateType) => void;
|
|
45
45
|
}
|
|
46
|
-
type PanelSemanticName = 'popupBody' | 'popupContent' | 'popupItem';
|
|
47
46
|
export type PickerPanelProps<DateType extends object = any> = BasePickerPanelProps<DateType> & {
|
|
48
47
|
/** multiple selection. Not support time or datetime picker */
|
|
49
48
|
multiple?: boolean;
|
package/es/PickerPanel/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import PickerContext from "../PickerInput/context";
|
|
|
25
25
|
import useCellRender from "../PickerInput/hooks/useCellRender";
|
|
26
26
|
import { isSame } from "../utils/dateUtil";
|
|
27
27
|
import { pickProps, toArray } from "../utils/miscUtil";
|
|
28
|
-
import { PickerHackContext } from "./context";
|
|
28
|
+
import { PickerHackContext, SharedPanelContext } from "./context";
|
|
29
29
|
import DatePanel from "./DatePanel";
|
|
30
30
|
import DateTimePanel from "./DateTimePanel";
|
|
31
31
|
import DecadePanel from "./DecadePanel";
|
|
@@ -255,16 +255,19 @@ function PickerPanel(props, ref) {
|
|
|
255
255
|
var PanelComponent = components[internalMode] || DefaultComponents[internalMode] || DatePanel;
|
|
256
256
|
|
|
257
257
|
// ======================== Context =========================
|
|
258
|
-
var
|
|
259
|
-
|
|
258
|
+
var sharedPanelContext = React.useMemo(function () {
|
|
259
|
+
var _ref2, _pickerClassNames$pop, _ref3, _pickerStyles$popup;
|
|
260
|
+
return {
|
|
261
|
+
classNames: (_ref2 = (_pickerClassNames$pop = pickerClassNames === null || pickerClassNames === void 0 ? void 0 : pickerClassNames.popup) !== null && _pickerClassNames$pop !== void 0 ? _pickerClassNames$pop : panelClassNames) !== null && _ref2 !== void 0 ? _ref2 : {},
|
|
262
|
+
styles: (_ref3 = (_pickerStyles$popup = pickerStyles === null || pickerStyles === void 0 ? void 0 : pickerStyles.popup) !== null && _pickerStyles$popup !== void 0 ? _pickerStyles$popup : panelStyles) !== null && _ref3 !== void 0 ? _ref3 : {}
|
|
263
|
+
};
|
|
264
|
+
}, [pickerClassNames, panelClassNames, pickerStyles, panelStyles]);
|
|
260
265
|
var parentHackContext = React.useContext(PickerHackContext);
|
|
261
266
|
var pickerPanelContext = React.useMemo(function () {
|
|
262
267
|
return _objectSpread(_objectSpread({}, parentHackContext), {}, {
|
|
263
|
-
hideHeader: hideHeader
|
|
264
|
-
classNames: mergedClassNames,
|
|
265
|
-
styles: mergedStyles
|
|
268
|
+
hideHeader: hideHeader
|
|
266
269
|
});
|
|
267
|
-
}, [parentHackContext, hideHeader
|
|
270
|
+
}, [parentHackContext, hideHeader]);
|
|
268
271
|
|
|
269
272
|
// ======================== Warnings ========================
|
|
270
273
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -284,7 +287,9 @@ function PickerPanel(props, ref) {
|
|
|
284
287
|
'disabledDate', 'minDate', 'maxDate',
|
|
285
288
|
// Hover
|
|
286
289
|
'onHover']);
|
|
287
|
-
return /*#__PURE__*/React.createElement(
|
|
290
|
+
return /*#__PURE__*/React.createElement(SharedPanelContext.Provider, {
|
|
291
|
+
value: sharedPanelContext
|
|
292
|
+
}, /*#__PURE__*/React.createElement(PickerHackContext.Provider, {
|
|
288
293
|
value: pickerPanelContext
|
|
289
294
|
}, /*#__PURE__*/React.createElement("div", {
|
|
290
295
|
ref: rootRef,
|
|
@@ -317,7 +322,7 @@ function PickerPanel(props, ref) {
|
|
|
317
322
|
,
|
|
318
323
|
hoverRangeValue: hoverRangeDate,
|
|
319
324
|
hoverValue: hoverValue
|
|
320
|
-
}))));
|
|
325
|
+
})))));
|
|
321
326
|
}
|
|
322
327
|
var RefPanelPicker = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(PickerPanel));
|
|
323
328
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SharedPickerProps } from '../interface';
|
|
2
|
+
export type FilledPanelClassNames = NonNullable<SharedPickerProps['classNames']>['popup'];
|
|
3
|
+
export type FilledPanelStyles = NonNullable<SharedPickerProps['styles']>['popup'];
|
|
4
|
+
export type FilledClassNames = NonNullable<SharedPickerProps['classNames']> & {
|
|
5
|
+
popup: FilledPanelClassNames;
|
|
6
|
+
};
|
|
7
|
+
export type FilledStyles = NonNullable<SharedPickerProps['styles']> & {
|
|
8
|
+
popup: FilledPanelStyles;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Convert `classNames` & `styles` to a fully filled object
|
|
12
|
+
*/
|
|
13
|
+
export default function useSemantic(classNames?: SharedPickerProps['classNames'], styles?: SharedPickerProps['styles']): readonly [FilledClassNames, FilledStyles];
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { useMemo } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Convert `classNames` & `styles` to a fully filled object
|
|
10
|
+
*/
|
|
11
|
+
export default function useSemantic(classNames, styles) {
|
|
12
|
+
return useMemo(function () {
|
|
13
|
+
var mergedClassNames = _objectSpread(_objectSpread({}, classNames), {}, {
|
|
14
|
+
popup: (classNames === null || classNames === void 0 ? void 0 : classNames.popup) || {}
|
|
15
|
+
});
|
|
16
|
+
var mergedStyles = _objectSpread(_objectSpread({}, styles), {}, {
|
|
17
|
+
popup: (styles === null || styles === void 0 ? void 0 : styles.popup) || {}
|
|
18
|
+
});
|
|
19
|
+
return [mergedClassNames, mergedStyles];
|
|
20
|
+
}, [classNames, styles]);
|
|
21
|
+
}
|
package/es/interface.d.ts
CHANGED
|
@@ -201,19 +201,25 @@ export type Components<DateType extends object = any> = Partial<Record<InternalM
|
|
|
201
201
|
button?: React.ComponentType<any> | string;
|
|
202
202
|
input?: React.ComponentType<any> | string;
|
|
203
203
|
}>;
|
|
204
|
-
export type SemanticStructure = 'popup' | 'popupBody' | 'popupContent' | 'popupItem' | 'suffix' | 'prefix' | 'input';
|
|
205
204
|
export type CustomFormat<DateType> = (value: DateType) => string;
|
|
206
205
|
export type FormatType<DateType = any> = string | CustomFormat<DateType>;
|
|
207
206
|
export type SharedHTMLAttrs = Omit<React.InputHTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'onChange' | 'placeholder' | 'id' | 'onInvalid' | 'disabled' | 'onFocus' | 'onBlur' | 'onSelect' | 'min' | 'max' | 'onKeyDown' | 'size' | 'prefix'>;
|
|
208
207
|
export type PickerFocusEventHandler = (e: React.FocusEvent<HTMLElement>, info: BaseInfo) => void;
|
|
209
208
|
export type LegacyOnKeyDown = (event: React.KeyboardEvent<HTMLElement>, preventDefault: VoidFunction) => void;
|
|
209
|
+
export type SemanticName = 'root' | 'prefix' | 'input' | 'suffix';
|
|
210
|
+
export type PanelSemanticName = 'root' | 'header' | 'body' | 'content' | 'item' | 'footer';
|
|
210
211
|
export interface SharedPickerProps<DateType extends object = any> extends SharedHTMLAttrs, Pick<SharedPanelProps<DateType>, 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon'> {
|
|
211
212
|
direction?: 'ltr' | 'rtl';
|
|
212
213
|
prefixCls?: string;
|
|
213
214
|
className?: string;
|
|
214
215
|
style?: React.CSSProperties;
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
rootClassName?: string;
|
|
217
|
+
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
|
|
218
|
+
popup?: Partial<Record<PanelSemanticName, React.CSSProperties>>;
|
|
219
|
+
};
|
|
220
|
+
classNames?: Partial<Record<SemanticName, string>> & {
|
|
221
|
+
popup?: Partial<Record<PanelSemanticName, string>>;
|
|
222
|
+
};
|
|
217
223
|
locale: Locale;
|
|
218
224
|
generateConfig: GenerateConfig<DateType>;
|
|
219
225
|
picker?: PickerMode;
|
|
@@ -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 |
|
|
5
|
+
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element | Iterable<ReactNode>;
|
|
@@ -34,7 +34,9 @@ function Footer(props) {
|
|
|
34
34
|
prefixCls = _React$useContext.prefixCls,
|
|
35
35
|
locale = _React$useContext.locale,
|
|
36
36
|
_React$useContext$but = _React$useContext.button,
|
|
37
|
-
Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but
|
|
37
|
+
Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but,
|
|
38
|
+
classNames = _React$useContext.classNames,
|
|
39
|
+
styles = _React$useContext.styles;
|
|
38
40
|
|
|
39
41
|
// >>> Now
|
|
40
42
|
var now = generateConfig.getNow();
|
|
@@ -81,7 +83,8 @@ function Footer(props) {
|
|
|
81
83
|
return null;
|
|
82
84
|
}
|
|
83
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "".concat(prefixCls, "-footer")
|
|
86
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-footer"), classNames.popup.footer),
|
|
87
|
+
style: styles.popup.footer
|
|
85
88
|
}, extraNode && /*#__PURE__*/React.createElement("div", {
|
|
86
89
|
className: "".concat(prefixCls, "-footer-extra")
|
|
87
90
|
}, extraNode), rangeNode);
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _util = require("@rc-component/util");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _useLayoutEffect = _interopRequireDefault(require("@rc-component/util/lib/hooks/useLayoutEffect"));
|
|
10
11
|
var _omit = _interopRequireDefault(require("@rc-component/util/lib/omit"));
|
|
11
12
|
var _pickAttrs = _interopRequireDefault(require("@rc-component/util/lib/pickAttrs"));
|
|
@@ -28,6 +29,7 @@ var _useRangeValue3 = _interopRequireWildcard(require("./hooks/useRangeValue"));
|
|
|
28
29
|
var _useShowNow = _interopRequireDefault(require("./hooks/useShowNow"));
|
|
29
30
|
var _Popup = _interopRequireDefault(require("./Popup"));
|
|
30
31
|
var _RangeSelector = _interopRequireDefault(require("./Selector/RangeSelector"));
|
|
32
|
+
var _useSemantic3 = _interopRequireDefault(require("../hooks/useSemantic"));
|
|
31
33
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
32
34
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -80,8 +82,9 @@ function RangePicker(props, ref) {
|
|
|
80
82
|
maskFormat = _useFilledProps2[4],
|
|
81
83
|
isInvalidateDate = _useFilledProps2[5];
|
|
82
84
|
var prefixCls = filledProps.prefixCls,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
rootClassName = filledProps.rootClassName,
|
|
86
|
+
propStyles = filledProps.styles,
|
|
87
|
+
propClassNames = filledProps.classNames,
|
|
85
88
|
defaultValue = filledProps.defaultValue,
|
|
86
89
|
value = filledProps.value,
|
|
87
90
|
needConfirm = filledProps.needConfirm,
|
|
@@ -122,6 +125,12 @@ function RangePicker(props, ref) {
|
|
|
122
125
|
// ========================= Refs =========================
|
|
123
126
|
var selectorRef = (0, _usePickerRef.default)(ref);
|
|
124
127
|
|
|
128
|
+
// ======================= Semantic =======================
|
|
129
|
+
var _useSemantic = (0, _useSemantic3.default)(propClassNames, propStyles),
|
|
130
|
+
_useSemantic2 = _slicedToArray(_useSemantic, 2),
|
|
131
|
+
mergedClassNames = _useSemantic2[0],
|
|
132
|
+
mergedStyles = _useSemantic2[1];
|
|
133
|
+
|
|
125
134
|
// ========================= Open =========================
|
|
126
135
|
var _useOpen = (0, _useOpen3.default)(open, defaultOpen, disabled, onOpenChange),
|
|
127
136
|
_useOpen2 = _slicedToArray(_useOpen, 2),
|
|
@@ -410,7 +419,7 @@ function RangePicker(props, ref) {
|
|
|
410
419
|
});
|
|
411
420
|
var panelProps = React.useMemo(function () {
|
|
412
421
|
var domProps = (0, _pickAttrs.default)(filledProps, false);
|
|
413
|
-
var restProps = (0, _omit.default)(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange', 'disabledTime']));
|
|
422
|
+
var restProps = (0, _omit.default)(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange', 'disabledTime', 'classNames', 'styles']));
|
|
414
423
|
return restProps;
|
|
415
424
|
}, [filledProps]);
|
|
416
425
|
|
|
@@ -534,10 +543,10 @@ function RangePicker(props, ref) {
|
|
|
534
543
|
generateConfig: generateConfig,
|
|
535
544
|
button: components.button,
|
|
536
545
|
input: components.input,
|
|
537
|
-
|
|
538
|
-
|
|
546
|
+
classNames: mergedClassNames,
|
|
547
|
+
styles: mergedStyles
|
|
539
548
|
};
|
|
540
|
-
}, [prefixCls, locale, generateConfig, components.button, components.input,
|
|
549
|
+
}, [prefixCls, locale, generateConfig, components.button, components.input, mergedClassNames, mergedStyles]);
|
|
541
550
|
|
|
542
551
|
// ======================== Effect ========================
|
|
543
552
|
// >>> Mode
|
|
@@ -588,8 +597,8 @@ function RangePicker(props, ref) {
|
|
|
588
597
|
value: context
|
|
589
598
|
}, /*#__PURE__*/React.createElement(_PickerTrigger.default, _extends({}, (0, _util2.pickTriggerProps)(filledProps), {
|
|
590
599
|
popupElement: panel,
|
|
591
|
-
popupStyle:
|
|
592
|
-
popupClassName:
|
|
600
|
+
popupStyle: mergedStyles.popup.root,
|
|
601
|
+
popupClassName: (0, _classnames.default)(rootClassName, mergedClassNames.popup.root)
|
|
593
602
|
// Visible
|
|
594
603
|
,
|
|
595
604
|
visible: mergedOpen,
|
|
@@ -602,6 +611,10 @@ function RangePicker(props, ref) {
|
|
|
602
611
|
, _extends({}, filledProps, {
|
|
603
612
|
// Ref
|
|
604
613
|
ref: selectorRef
|
|
614
|
+
// Style
|
|
615
|
+
,
|
|
616
|
+
className: (0, _classnames.default)(filledProps.className, rootClassName, mergedClassNames.root),
|
|
617
|
+
style: _objectSpread(_objectSpread({}, mergedStyles.root), filledProps.style)
|
|
605
618
|
// Icon
|
|
606
619
|
,
|
|
607
620
|
suffixIcon: suffixIcon
|
|
@@ -23,11 +23,11 @@ function Icon(props) {
|
|
|
23
23
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
24
24
|
var _React$useContext = React.useContext(_context.default),
|
|
25
25
|
prefixCls = _React$useContext.prefixCls,
|
|
26
|
-
|
|
26
|
+
classNames = _React$useContext.classNames,
|
|
27
27
|
styles = _React$useContext.styles;
|
|
28
28
|
return icon ? /*#__PURE__*/React.createElement("span", _extends({
|
|
29
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-").concat(type),
|
|
30
|
-
style: styles
|
|
29
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-").concat(type), classNames.suffix),
|
|
30
|
+
style: styles.suffix
|
|
31
31
|
}, restProps), icon) : null;
|
|
32
32
|
}
|
|
33
33
|
function ClearIcon(_ref) {
|
|
@@ -71,7 +71,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
71
71
|
prefixCls = _React$useContext.prefixCls,
|
|
72
72
|
_React$useContext$inp = _React$useContext.input,
|
|
73
73
|
Component = _React$useContext$inp === void 0 ? 'input' : _React$useContext$inp,
|
|
74
|
-
|
|
74
|
+
classNames = _React$useContext.classNames,
|
|
75
75
|
styles = _React$useContext.styles;
|
|
76
76
|
var inputPrefixCls = "".concat(prefixCls, "-input");
|
|
77
77
|
|
|
@@ -364,8 +364,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
364
364
|
} : {};
|
|
365
365
|
return /*#__PURE__*/React.createElement("div", {
|
|
366
366
|
ref: holderRef,
|
|
367
|
-
className: (0, _classnames.default)(inputPrefixCls,
|
|
368
|
-
style: styles === null || styles === void 0 ? void 0 : styles.input
|
|
367
|
+
className: (0, _classnames.default)(inputPrefixCls, _defineProperty(_defineProperty({}, "".concat(inputPrefixCls, "-active"), active && showActiveCls), "".concat(inputPrefixCls, "-placeholder"), helped), className)
|
|
369
368
|
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
370
369
|
ref: inputRef,
|
|
371
370
|
"aria-invalid": invalid,
|
|
@@ -377,7 +376,9 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
377
376
|
}, inputProps, {
|
|
378
377
|
// Value
|
|
379
378
|
value: inputValue,
|
|
380
|
-
onChange: onInternalChange
|
|
379
|
+
onChange: onInternalChange,
|
|
380
|
+
className: classNames.input,
|
|
381
|
+
style: styles.input
|
|
381
382
|
})), /*#__PURE__*/React.createElement(_Icon.default, {
|
|
382
383
|
type: "suffix",
|
|
383
384
|
icon: suffixIcon
|
|
@@ -80,7 +80,7 @@ function RangeSelector(props, ref) {
|
|
|
80
80
|
// ======================== Prefix ========================
|
|
81
81
|
var _React$useContext = React.useContext(_context.default),
|
|
82
82
|
prefixCls = _React$useContext.prefixCls,
|
|
83
|
-
|
|
83
|
+
classNames = _React$useContext.classNames,
|
|
84
84
|
styles = _React$useContext.styles;
|
|
85
85
|
|
|
86
86
|
// ========================== Id ==========================
|
|
@@ -196,8 +196,8 @@ function RangeSelector(props, ref) {
|
|
|
196
196
|
_onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
|
|
197
197
|
}
|
|
198
198
|
}), prefix && /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-prefix"),
|
|
200
|
-
style: styles
|
|
199
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-prefix"), classNames.prefix),
|
|
200
|
+
style: styles.prefix
|
|
201
201
|
}, prefix), /*#__PURE__*/React.createElement(_Input.default, _extends({
|
|
202
202
|
ref: inputStartRef
|
|
203
203
|
}, getInputProps(0), {
|
|
@@ -79,7 +79,7 @@ function SingleSelector(props, ref) {
|
|
|
79
79
|
// ======================== Prefix ========================
|
|
80
80
|
var _React$useContext = React.useContext(_context.default),
|
|
81
81
|
prefixCls = _React$useContext.prefixCls,
|
|
82
|
-
|
|
82
|
+
classNames = _React$useContext.classNames,
|
|
83
83
|
styles = _React$useContext.styles;
|
|
84
84
|
|
|
85
85
|
// ========================= Refs =========================
|
|
@@ -188,8 +188,8 @@ function SingleSelector(props, ref) {
|
|
|
188
188
|
_onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
|
|
189
189
|
}
|
|
190
190
|
}), prefix && /*#__PURE__*/React.createElement("div", {
|
|
191
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-prefix"),
|
|
192
|
-
style: styles
|
|
191
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-prefix"), classNames.prefix),
|
|
192
|
+
style: styles.prefix
|
|
193
193
|
}, prefix), selectorNode);
|
|
194
194
|
}
|
|
195
195
|
var RefSingleSelector = /*#__PURE__*/React.forwardRef(SingleSelector);
|
|
@@ -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 |
|
|
8
|
+
}, clearIcon?: ReactNode): string | number | true | React.JSX.Element | Iterable<ReactNode>;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _util = require("@rc-component/util");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _useLayoutEffect = _interopRequireDefault(require("@rc-component/util/lib/hooks/useLayoutEffect"));
|
|
10
11
|
var _omit = _interopRequireDefault(require("@rc-component/util/lib/omit"));
|
|
11
12
|
var _pickAttrs = _interopRequireDefault(require("@rc-component/util/lib/pickAttrs"));
|
|
@@ -27,6 +28,7 @@ var _useRangeValue3 = _interopRequireWildcard(require("./hooks/useRangeValue"));
|
|
|
27
28
|
var _useShowNow = _interopRequireDefault(require("./hooks/useShowNow"));
|
|
28
29
|
var _Popup = _interopRequireDefault(require("./Popup"));
|
|
29
30
|
var _SingleSelector = _interopRequireDefault(require("./Selector/SingleSelector"));
|
|
31
|
+
var _useSemantic3 = _interopRequireDefault(require("../hooks/useSemantic"));
|
|
30
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
31
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -62,8 +64,9 @@ function Picker(props, ref) {
|
|
|
62
64
|
isInvalidateDate = _useFilledProps2[5];
|
|
63
65
|
var _ref = filledProps,
|
|
64
66
|
prefixCls = _ref.prefixCls,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
rootClassName = _ref.rootClassName,
|
|
68
|
+
propStyles = _ref.styles,
|
|
69
|
+
propClassNames = _ref.classNames,
|
|
67
70
|
order = _ref.order,
|
|
68
71
|
defaultValue = _ref.defaultValue,
|
|
69
72
|
value = _ref.value,
|
|
@@ -115,6 +118,12 @@ function Picker(props, ref) {
|
|
|
115
118
|
}
|
|
116
119
|
var toggleDates = (0, _useToggleDates.default)(generateConfig, locale, internalPicker);
|
|
117
120
|
|
|
121
|
+
// ======================= Semantic =======================
|
|
122
|
+
var _useSemantic = (0, _useSemantic3.default)(propClassNames, propStyles),
|
|
123
|
+
_useSemantic2 = _slicedToArray(_useSemantic, 2),
|
|
124
|
+
mergedClassNames = _useSemantic2[0],
|
|
125
|
+
mergedStyles = _useSemantic2[1];
|
|
126
|
+
|
|
118
127
|
// ========================= Open =========================
|
|
119
128
|
var _useOpen = (0, _useOpen3.default)(open, defaultOpen, [disabled], onOpenChange),
|
|
120
129
|
_useOpen2 = _slicedToArray(_useOpen, 2),
|
|
@@ -358,7 +367,7 @@ function Picker(props, ref) {
|
|
|
358
367
|
|
|
359
368
|
var panelProps = React.useMemo(function () {
|
|
360
369
|
var domProps = (0, _pickAttrs.default)(filledProps, false);
|
|
361
|
-
var restProps = (0, _omit.default)(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange']));
|
|
370
|
+
var restProps = (0, _omit.default)(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange', 'classNames', 'styles']));
|
|
362
371
|
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
363
372
|
multiple: filledProps.multiple
|
|
364
373
|
});
|
|
@@ -455,10 +464,10 @@ function Picker(props, ref) {
|
|
|
455
464
|
generateConfig: generateConfig,
|
|
456
465
|
button: components.button,
|
|
457
466
|
input: components.input,
|
|
458
|
-
|
|
459
|
-
|
|
467
|
+
classNames: mergedClassNames,
|
|
468
|
+
styles: mergedStyles
|
|
460
469
|
};
|
|
461
|
-
}, [prefixCls, locale, generateConfig, components.button, components.input,
|
|
470
|
+
}, [prefixCls, locale, generateConfig, components.button, components.input, mergedClassNames, mergedStyles]);
|
|
462
471
|
|
|
463
472
|
// ======================== Effect ========================
|
|
464
473
|
// >>> Mode
|
|
@@ -491,8 +500,8 @@ function Picker(props, ref) {
|
|
|
491
500
|
value: context
|
|
492
501
|
}, /*#__PURE__*/React.createElement(_PickerTrigger.default, _extends({}, (0, _util2.pickTriggerProps)(filledProps), {
|
|
493
502
|
popupElement: panel,
|
|
494
|
-
popupStyle:
|
|
495
|
-
popupClassName:
|
|
503
|
+
popupStyle: mergedStyles.popup.root,
|
|
504
|
+
popupClassName: (0, _classnames.default)(rootClassName, mergedClassNames.popup.root)
|
|
496
505
|
// Visible
|
|
497
506
|
,
|
|
498
507
|
visible: mergedOpen,
|
|
@@ -502,6 +511,10 @@ function Picker(props, ref) {
|
|
|
502
511
|
, _extends({}, filledProps, {
|
|
503
512
|
// Ref
|
|
504
513
|
ref: selectorRef
|
|
514
|
+
// Style
|
|
515
|
+
,
|
|
516
|
+
className: (0, _classnames.default)(filledProps.className, rootClassName, mergedClassNames.root),
|
|
517
|
+
style: _objectSpread(_objectSpread({}, mergedStyles.root), filledProps.style)
|
|
505
518
|
// Icon
|
|
506
519
|
,
|
|
507
520
|
suffixIcon: suffixIcon,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { GenerateConfig } from '../generate';
|
|
3
|
-
import type { Components, Locale
|
|
3
|
+
import type { Components, Locale } from '../interface';
|
|
4
|
+
import type { FilledClassNames, FilledStyles } from '../hooks/useSemantic';
|
|
4
5
|
export interface PickerContextProps<DateType = any> {
|
|
5
6
|
prefixCls: string;
|
|
6
7
|
locale: Locale;
|
|
@@ -8,8 +9,8 @@ export interface PickerContextProps<DateType = any> {
|
|
|
8
9
|
/** Customize button component */
|
|
9
10
|
button?: Components['button'];
|
|
10
11
|
input?: Components['input'];
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
classNames: FilledClassNames;
|
|
13
|
+
styles: FilledStyles;
|
|
13
14
|
}
|
|
14
15
|
declare const PickerContext: React.Context<PickerContextProps<any>>;
|
|
15
16
|
export default PickerContext;
|
|
@@ -39,6 +39,8 @@ function PanelBody(props) {
|
|
|
39
39
|
disabledDate = props.disabledDate;
|
|
40
40
|
var _usePanelContext = (0, _context.usePanelContext)(),
|
|
41
41
|
prefixCls = _usePanelContext.prefixCls,
|
|
42
|
+
classNames = _usePanelContext.classNames,
|
|
43
|
+
styles = _usePanelContext.styles,
|
|
42
44
|
type = _usePanelContext.panelType,
|
|
43
45
|
now = _usePanelContext.now,
|
|
44
46
|
contextDisabledDate = _usePanelContext.disabledDate,
|
|
@@ -55,9 +57,7 @@ function PanelBody(props) {
|
|
|
55
57
|
|
|
56
58
|
// ============================= Context ==============================
|
|
57
59
|
var _React$useContext = React.useContext(_context.PickerHackContext),
|
|
58
|
-
onCellDblClick = _React$useContext.onCellDblClick
|
|
59
|
-
pickerClassNames = _React$useContext.classNames,
|
|
60
|
-
styles = _React$useContext.styles;
|
|
60
|
+
onCellDblClick = _React$useContext.onCellDblClick;
|
|
61
61
|
|
|
62
62
|
// ============================== Value ===============================
|
|
63
63
|
var matchValues = function matchValues(date) {
|
|
@@ -113,12 +113,12 @@ function PanelBody(props) {
|
|
|
113
113
|
rowNode.push( /*#__PURE__*/React.createElement("td", {
|
|
114
114
|
key: col,
|
|
115
115
|
title: title,
|
|
116
|
-
className: (0, _classnames.default)(cellPrefixCls,
|
|
116
|
+
className: (0, _classnames.default)(cellPrefixCls, classNames.item, _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function (date) {
|
|
117
117
|
return (0, _dateUtil.isSame)(generateConfig, locale, currentDate, date, type);
|
|
118
118
|
})), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue &&
|
|
119
119
|
// WeekPicker use row instead
|
|
120
120
|
type !== 'week' && matchValues(currentDate)), getCellClassName(currentDate))),
|
|
121
|
-
style: styles
|
|
121
|
+
style: styles.item,
|
|
122
122
|
onClick: function onClick() {
|
|
123
123
|
if (!disabled) {
|
|
124
124
|
onSelect(currentDate);
|
|
@@ -158,10 +158,10 @@ function PanelBody(props) {
|
|
|
158
158
|
|
|
159
159
|
// ============================== Render ==============================
|
|
160
160
|
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-body"),
|
|
162
|
-
style: styles
|
|
161
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-body"), classNames.body),
|
|
162
|
+
style: styles.body
|
|
163
163
|
}, /*#__PURE__*/React.createElement("table", {
|
|
164
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-content"),
|
|
165
|
-
style: styles
|
|
164
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-content"), classNames.content),
|
|
165
|
+
style: styles.content
|
|
166
166
|
}, headerCells && /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, headerCells)), /*#__PURE__*/React.createElement("tbody", null, rows)));
|
|
167
167
|
}
|
|
@@ -24,6 +24,8 @@ function PanelHeader(props) {
|
|
|
24
24
|
children = props.children;
|
|
25
25
|
var _usePanelContext = (0, _context.usePanelContext)(),
|
|
26
26
|
prefixCls = _usePanelContext.prefixCls,
|
|
27
|
+
classNames = _usePanelContext.classNames,
|
|
28
|
+
styles = _usePanelContext.styles,
|
|
27
29
|
_usePanelContext$prev = _usePanelContext.prevIcon,
|
|
28
30
|
prevIcon = _usePanelContext$prev === void 0 ? "\u2039" : _usePanelContext$prev,
|
|
29
31
|
_usePanelContext$next = _usePanelContext.nextIcon,
|
|
@@ -95,7 +97,8 @@ function PanelHeader(props) {
|
|
|
95
97
|
var superPrevBtnCls = "".concat(headerPrefixCls, "-super-prev-btn");
|
|
96
98
|
var superNextBtnCls = "".concat(headerPrefixCls, "-super-next-btn");
|
|
97
99
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
|
-
className: headerPrefixCls
|
|
100
|
+
className: (0, _classnames.default)(headerPrefixCls, classNames.header),
|
|
101
|
+
style: styles.header
|
|
99
102
|
}, superOffset && /*#__PURE__*/React.createElement("button", {
|
|
100
103
|
type: "button",
|
|
101
104
|
"aria-label": locale.previousYear,
|
|
@@ -49,10 +49,9 @@ function TimeColumn(props) {
|
|
|
49
49
|
prefixCls = _usePanelContext.prefixCls,
|
|
50
50
|
cellRender = _usePanelContext.cellRender,
|
|
51
51
|
now = _usePanelContext.now,
|
|
52
|
-
locale = _usePanelContext.locale
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
styles = _React$useContext.styles;
|
|
52
|
+
locale = _usePanelContext.locale,
|
|
53
|
+
classNames = _usePanelContext.classNames,
|
|
54
|
+
styles = _usePanelContext.styles;
|
|
56
55
|
var panelPrefixCls = "".concat(prefixCls, "-time-panel");
|
|
57
56
|
var cellPrefixCls = "".concat(prefixCls, "-time-panel-cell");
|
|
58
57
|
|
|
@@ -131,8 +130,8 @@ function TimeColumn(props) {
|
|
|
131
130
|
}, label);
|
|
132
131
|
return /*#__PURE__*/React.createElement("li", {
|
|
133
132
|
key: unitValue,
|
|
134
|
-
style: styles
|
|
135
|
-
className: (0, _classnames.default)(cellPrefixCls,
|
|
133
|
+
style: styles.item,
|
|
134
|
+
className: (0, _classnames.default)(cellPrefixCls, classNames.item, _defineProperty(_defineProperty({}, "".concat(cellPrefixCls, "-selected"), value === unitValue), "".concat(cellPrefixCls, "-disabled"), disabled)),
|
|
136
135
|
onClick: function onClick() {
|
|
137
136
|
if (!disabled) {
|
|
138
137
|
onChange(unitValue);
|
|
@@ -33,6 +33,8 @@ function TimePanelBody(props) {
|
|
|
33
33
|
changeOnScroll = props.changeOnScroll;
|
|
34
34
|
var _usePanelContext = (0, _context.usePanelContext)(),
|
|
35
35
|
prefixCls = _usePanelContext.prefixCls,
|
|
36
|
+
classNames = _usePanelContext.classNames,
|
|
37
|
+
styles = _usePanelContext.styles,
|
|
36
38
|
values = _usePanelContext.values,
|
|
37
39
|
generateConfig = _usePanelContext.generateConfig,
|
|
38
40
|
locale = _usePanelContext.locale,
|
|
@@ -42,9 +44,7 @@ function TimePanelBody(props) {
|
|
|
42
44
|
pickerValue = _usePanelContext.pickerValue;
|
|
43
45
|
var value = (values === null || values === void 0 ? void 0 : values[0]) || null;
|
|
44
46
|
var _React$useContext = React.useContext(_context.PickerHackContext),
|
|
45
|
-
onCellDblClick = _React$useContext.onCellDblClick
|
|
46
|
-
pickerClassNames = _React$useContext.classNames,
|
|
47
|
-
styles = _React$useContext.styles;
|
|
47
|
+
onCellDblClick = _React$useContext.onCellDblClick;
|
|
48
48
|
|
|
49
49
|
// ========================== Info ==========================
|
|
50
50
|
var _useTimeInfo = (0, _useTimeInfo3.default)(generateConfig, props, value),
|
|
@@ -257,8 +257,8 @@ function TimePanelBody(props) {
|
|
|
257
257
|
changeOnScroll: changeOnScroll
|
|
258
258
|
};
|
|
259
259
|
return /*#__PURE__*/React.createElement("div", {
|
|
260
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-content"),
|
|
261
|
-
style: styles
|
|
260
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-content"), classNames.content),
|
|
261
|
+
style: styles.content
|
|
262
262
|
}, showHour && /*#__PURE__*/React.createElement(_TimeColumn.default, _extends({
|
|
263
263
|
units: hourUnits,
|
|
264
264
|
value: hour,
|