@rc-component/picker 1.2.1 → 1.2.3

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.
@@ -100,10 +100,9 @@ rangeValue,
100
100
  * So when `rangeValue` is `true`, order will be ignored.
101
101
  */
102
102
  order, defaultValue, value, onCalendarChange, onOk) {
103
- var isNullValue = value === null;
104
103
  // This is the root value which will sync with controlled or uncontrolled value
105
104
  var _useMergedState = useMergedState(defaultValue, {
106
- value: isNullValue ? undefined : value
105
+ value: value
107
106
  }),
108
107
  _useMergedState2 = _slicedToArray(_useMergedState, 2),
109
108
  innerValue = _useMergedState2[0],
@@ -104,11 +104,12 @@ export default function PanelBody(props) {
104
104
  rowNode.push( /*#__PURE__*/React.createElement("td", {
105
105
  key: col,
106
106
  title: title,
107
- className: classNames(cellPrefixCls, _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function (date) {
107
+ className: classNames(cellPrefixCls, pickerClassNames === null || pickerClassNames === void 0 ? void 0 : pickerClassNames.popupItem, _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function (date) {
108
108
  return isSame(generateConfig, locale, currentDate, date, type);
109
109
  })), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue &&
110
110
  // WeekPicker use row instead
111
111
  type !== 'week' && matchValues(currentDate)), getCellClassName(currentDate))),
112
+ style: styles === null || styles === void 0 ? void 0 : styles.popupItem,
112
113
  onClick: function onClick() {
113
114
  if (!disabled) {
114
115
  onSelect(currentDate);
@@ -43,7 +43,7 @@ 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';
46
+ type PanelSemanticName = 'popupBody' | 'popupContent' | 'popupItem';
47
47
  export type PickerPanelProps<DateType extends object = any> = BasePickerPanelProps<DateType> & {
48
48
  /** multiple selection. Not support time or datetime picker */
49
49
  multiple?: boolean;
package/es/interface.d.ts CHANGED
@@ -201,7 +201,7 @@ 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';
204
+ export type SemanticStructure = 'popup' | 'popupBody' | 'popupContent' | 'popupItem';
205
205
  export type CustomFormat<DateType> = (value: DateType) => string;
206
206
  export type FormatType<DateType = any> = string | CustomFormat<DateType>;
207
207
  export type SharedHTMLAttrs = Omit<React.InputHTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'onChange' | 'placeholder' | 'id' | 'onInvalid' | 'disabled' | 'onFocus' | 'onBlur' | 'onSelect' | 'min' | 'max' | 'onKeyDown' | 'size' | 'prefix'>;
@@ -111,10 +111,9 @@ rangeValue,
111
111
  * So when `rangeValue` is `true`, order will be ignored.
112
112
  */
113
113
  order, defaultValue, value, onCalendarChange, onOk) {
114
- var isNullValue = value === null;
115
114
  // This is the root value which will sync with controlled or uncontrolled value
116
115
  var _useMergedState = (0, _util.useMergedState)(defaultValue, {
117
- value: isNullValue ? undefined : value
116
+ value: value
118
117
  }),
119
118
  _useMergedState2 = _slicedToArray(_useMergedState, 2),
120
119
  innerValue = _useMergedState2[0],
@@ -113,11 +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, _objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function (date) {
116
+ className: (0, _classnames.default)(cellPrefixCls, pickerClassNames === null || pickerClassNames === void 0 ? void 0 : pickerClassNames.popupItem, _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 === null || styles === void 0 ? void 0 : styles.popupItem,
121
122
  onClick: function onClick() {
122
123
  if (!disabled) {
123
124
  onSelect(currentDate);
@@ -43,7 +43,7 @@ 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';
46
+ type PanelSemanticName = 'popupBody' | 'popupContent' | 'popupItem';
47
47
  export type PickerPanelProps<DateType extends object = any> = BasePickerPanelProps<DateType> & {
48
48
  /** multiple selection. Not support time or datetime picker */
49
49
  multiple?: boolean;
@@ -201,7 +201,7 @@ 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';
204
+ export type SemanticStructure = 'popup' | 'popupBody' | 'popupContent' | 'popupItem';
205
205
  export type CustomFormat<DateType> = (value: DateType) => string;
206
206
  export type FormatType<DateType = any> = string | CustomFormat<DateType>;
207
207
  export type SharedHTMLAttrs = Omit<React.InputHTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'onChange' | 'placeholder' | 'id' | 'onInvalid' | 'disabled' | 'onFocus' | 'onBlur' | 'onSelect' | 'min' | 'max' | 'onKeyDown' | 'size' | 'prefix'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/picker",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "React date & time picker",
5
5
  "keywords": [
6
6
  "react",