aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/common.js
diff options
context:
space:
mode:
authorafc163 <afc163@gmail.com>2017-05-02 11:32:35 +0800
committerafc163 <afc163@gmail.com>2017-05-02 11:32:35 +0800
commitb879cfead429b717b7d89f4ceaf55973e2d96b4f (patch)
tree36b8522dc1ed920b6bb362d7e60ff86cf6fe2f99 /examples/common.js
parent09b89d6426aece18f7e3435bcf76810ca8a173e2 (diff)
downloadtime-picker-b879cfead429b717b7d89f4ceaf55973e2d96b4f.tar.gz
time-picker-b879cfead429b717b7d89f4ceaf55973e2d96b4f.tar.zst
time-picker-b879cfead429b717b7d89f4ceaf55973e2d96b4f.zip
Updates
Diffstat (limited to 'examples/common.js')
-rw-r--r--examples/common.js71
1 files changed, 48 insertions, 23 deletions
diff --git a/examples/common.js b/examples/common.js
index 6db5b5c..b019fc1 100644
--- a/examples/common.js
+++ b/examples/common.js
@@ -26087,10 +26087,40 @@
26087 }); 26087 });
26088 }; 26088 };
26089 26089
26090 Picker.prototype.setOpen = function setOpen(open) { 26090 Picker.prototype.getPopupClassName = function getPopupClassName() {
26091 var _props3 = this.props, 26091 var _props3 = this.props,
26092 onOpen = _props3.onOpen, 26092 showHour = _props3.showHour,
26093 onClose = _props3.onClose; 26093 showMinute = _props3.showMinute,
26094 showSecond = _props3.showSecond,
26095 use12Hours = _props3.use12Hours,
26096 prefixCls = _props3.prefixCls;
26097
26098 var popupClassName = this.props.popupClassName;
26099 // Keep it for old compatibility
26100 if ((!showHour || !showMinute || !showSecond) && !use12Hours) {
26101 popupClassName += ' ' + prefixCls + '-panel-narrow';
26102 }
26103 var selectColumnCount = 0;
26104 if (showHour) {
26105 selectColumnCount += 1;
26106 }
26107 if (showMinute) {
26108 selectColumnCount += 1;
26109 }
26110 if (showSecond) {
26111 selectColumnCount += 1;
26112 }
26113 if (use12Hours) {
26114 selectColumnCount += 1;
26115 }
26116 popupClassName += ' ' + prefixCls + '-panel-column-' + selectColumnCount;
26117 return popupClassName;
26118 };
26119
26120 Picker.prototype.setOpen = function setOpen(open) {
26121 var _props4 = this.props,
26122 onOpen = _props4.onOpen,
26123 onClose = _props4.onClose;
26094 26124
26095 if (this.state.open !== open) { 26125 if (this.state.open !== open) {
26096 if (!('open' in this.props)) { 26126 if (!('open' in this.props)) {
@@ -26109,30 +26139,23 @@
26109 }; 26139 };
26110 26140
26111 Picker.prototype.render = function render() { 26141 Picker.prototype.render = function render() {
26112 var _props4 = this.props, 26142 var _props5 = this.props,
26113 prefixCls = _props4.prefixCls, 26143 prefixCls = _props5.prefixCls,
26114 placeholder = _props4.placeholder, 26144 placeholder = _props5.placeholder,
26115 placement = _props4.placement, 26145 placement = _props5.placement,
26116 align = _props4.align, 26146 align = _props5.align,
26117 disabled = _props4.disabled, 26147 disabled = _props5.disabled,
26118 transitionName = _props4.transitionName, 26148 transitionName = _props5.transitionName,
26119 style = _props4.style, 26149 style = _props5.style,
26120 className = _props4.className, 26150 className = _props5.className,
26121 showHour = _props4.showHour, 26151 getPopupContainer = _props5.getPopupContainer,
26122 showMinute = _props4.showMinute, 26152 name = _props5.name,
26123 showSecond = _props4.showSecond, 26153 autoComplete = _props5.autoComplete;
26124 getPopupContainer = _props4.getPopupContainer,
26125 name = _props4.name,
26126 autoComplete = _props4.autoComplete,
26127 use12Hours = _props4.use12Hours;
26128 var _state = this.state, 26154 var _state = this.state,
26129 open = _state.open, 26155 open = _state.open,
26130 value = _state.value; 26156 value = _state.value;
26131 26157
26132 var popupClassName = void 0; 26158 var popupClassName = this.getPopupClassName();
26133 if ((!showHour || !showMinute || !showSecond) && !use12Hours) {
26134 popupClassName = prefixCls + '-panel-narrow';
26135 }
26136 return _react2.default.createElement( 26159 return _react2.default.createElement(
26137 _rcTrigger2.default, 26160 _rcTrigger2.default,
26138 { 26161 {
@@ -26192,6 +26215,7 @@
26192 showSecond: _propTypes2.default.bool, 26215 showSecond: _propTypes2.default.bool,
26193 style: _propTypes2.default.object, 26216 style: _propTypes2.default.object,
26194 className: _propTypes2.default.string, 26217 className: _propTypes2.default.string,
26218 popupClassName: _propTypes2.default.string,
26195 disabledHours: _propTypes2.default.func, 26219 disabledHours: _propTypes2.default.func,
26196 disabledMinutes: _propTypes2.default.func, 26220 disabledMinutes: _propTypes2.default.func,
26197 disabledSeconds: _propTypes2.default.func, 26221 disabledSeconds: _propTypes2.default.func,
@@ -26210,6 +26234,7 @@
26210 defaultOpen: false, 26234 defaultOpen: false,
26211 style: {}, 26235 style: {},
26212 className: '', 26236 className: '',
26237 popupClassName: '',
26213 align: {}, 26238 align: {},
26214 defaultOpenValue: (0, _moment2.default)(), 26239 defaultOpenValue: (0, _moment2.default)(),
26215 allowEmpty: true, 26240 allowEmpty: true,