@hi-ui/time-picker 4.0.10 → 4.0.11
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/CHANGELOG.md +15 -0
- package/lib/cjs/@types/index.js +0 -4
- package/lib/cjs/Input.js +33 -63
- package/lib/cjs/Panel.js +21 -45
- package/lib/cjs/PopContent.js +46 -77
- package/lib/cjs/Selector.js +22 -44
- package/lib/cjs/TimePicker.js +80 -132
- package/lib/cjs/hooks/useFilter.js +0 -8
- package/lib/cjs/index.js +0 -5
- package/lib/cjs/styles/index.scss.js +1 -4
- package/lib/cjs/utils/analysisFormat.js +1 -8
- package/lib/cjs/utils/disposeInputValue.js +12 -19
- package/lib/cjs/utils/generateSelectorData.js +5 -16
- package/lib/cjs/utils/getFormatDefault.js +0 -5
- package/lib/cjs/utils/getNowString.js +0 -8
- package/lib/cjs/utils/getRange.js +0 -9
- package/lib/cjs/utils/valueChecker.js +8 -23
- package/lib/esm/@types/index.js +0 -2
- package/lib/esm/Input.js +28 -39
- package/lib/esm/Panel.js +16 -22
- package/lib/esm/PopContent.js +43 -53
- package/lib/esm/Selector.js +16 -22
- package/lib/esm/TimePicker.js +70 -92
- package/lib/esm/hooks/useFilter.js +0 -4
- package/lib/esm/styles/index.scss.js +1 -3
- package/lib/esm/utils/analysisFormat.js +1 -4
- package/lib/esm/utils/disposeInputValue.js +12 -15
- package/lib/esm/utils/generateSelectorData.js +5 -12
- package/lib/esm/utils/getFormatDefault.js +0 -1
- package/lib/esm/utils/getNowString.js +0 -3
- package/lib/esm/utils/getRange.js +0 -5
- package/lib/esm/utils/valueChecker.js +8 -18
- package/package.json +10 -10
package/lib/cjs/Selector.js
CHANGED
@@ -9,42 +9,24 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
13
|
-
|
14
|
-
Object.defineProperty(exports, '__esModule', {
|
15
|
-
value: true
|
16
|
-
});
|
17
|
-
|
18
12
|
var React = require('react');
|
19
|
-
|
20
13
|
var classname = require('@hi-ui/classname');
|
21
|
-
|
22
|
-
function _interopDefaultLegacy(e) {
|
23
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
24
|
-
'default': e
|
25
|
-
};
|
26
|
-
}
|
27
|
-
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
|
-
|
30
14
|
exports.SelectorPosition = void 0;
|
31
|
-
|
32
15
|
(function (SelectorPosition) {
|
33
16
|
SelectorPosition["left"] = "left";
|
34
17
|
SelectorPosition["right"] = "right";
|
35
18
|
SelectorPosition["middle"] = "middle";
|
36
19
|
SelectorPosition["single"] = "single";
|
37
20
|
})(exports.SelectorPosition || (exports.SelectorPosition = {}));
|
38
|
-
|
39
21
|
var Selector = function Selector(props) {
|
40
22
|
var prefix = props.prefix,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
23
|
+
value = props.value,
|
24
|
+
data = props.data,
|
25
|
+
onChange = props.onChange,
|
26
|
+
position = props.position;
|
45
27
|
var componentPrefix = prefix + "__selector";
|
46
|
-
var stopScrollTimeoutHandler = React.useRef(-1);
|
47
|
-
|
28
|
+
var stopScrollTimeoutHandler = React.useRef(-1);
|
29
|
+
// 滚动容器引用
|
48
30
|
var scrollContainerRef = React.useRef(null);
|
49
31
|
var topItemGagerRef = React.useRef(null);
|
50
32
|
var bottomItemGagerRef = React.useRef(null);
|
@@ -59,22 +41,20 @@ var Selector = function Selector(props) {
|
|
59
41
|
}, []);
|
60
42
|
var onScroll = React.useCallback(function (e) {
|
61
43
|
e.persist();
|
62
|
-
e.stopPropagation();
|
63
|
-
|
64
|
-
clearTimeout(stopScrollTimeoutHandler.current);
|
65
|
-
|
44
|
+
e.stopPropagation();
|
45
|
+
// 清除用做判断是否滚动停止的定时器
|
46
|
+
clearTimeout(stopScrollTimeoutHandler.current);
|
47
|
+
// 计算当前选中的 index 下标
|
66
48
|
var currentIndex = calcCurrentIndex(e.target.scrollTop);
|
67
|
-
|
68
49
|
if (currentIndex > data.length) {
|
69
50
|
currentIndex = data.length - 1;
|
70
|
-
}
|
51
|
+
}
|
52
|
+
// 200ms 后如果事件没有再次响应,则视作滚动停止
|
71
53
|
// 不论是否禁用,我们都需要自动滚动到对应 index
|
72
|
-
|
73
|
-
|
74
54
|
stopScrollTimeoutHandler.current = setTimeout(function () {
|
75
|
-
scrollToMatchIndex(currentIndex);
|
55
|
+
scrollToMatchIndex(currentIndex);
|
56
|
+
// 通知外部改变
|
76
57
|
// 如果当前 item 被禁用了,则无通知
|
77
|
-
|
78
58
|
if (!data[currentIndex].disabled) {
|
79
59
|
onChange(data[currentIndex]);
|
80
60
|
}
|
@@ -88,17 +68,17 @@ var Selector = function Selector(props) {
|
|
88
68
|
React.useEffect(function () {
|
89
69
|
var currentIndex = data.findIndex(function (item) {
|
90
70
|
return item.id === value;
|
91
|
-
});
|
71
|
+
});
|
72
|
+
// 避免非法值跳转
|
92
73
|
// 避免重复执行操作,只有当 value 对应的下标改变的时候才需要执行
|
93
|
-
|
94
74
|
if (currentIndex >= 0 && lastValueMatchIndexCache.current !== currentIndex) {
|
95
75
|
lastValueMatchIndexCache.current = currentIndex;
|
96
76
|
scrollToMatchIndex(currentIndex);
|
97
77
|
}
|
98
78
|
}, [data, value, scrollToMatchIndex]);
|
99
|
-
return /*#__PURE__*/
|
79
|
+
return /*#__PURE__*/React.createElement("div", {
|
100
80
|
className: classname.cx(componentPrefix, componentPrefix + "--position-" + position)
|
101
|
-
}, /*#__PURE__*/
|
81
|
+
}, /*#__PURE__*/React.createElement("div", {
|
102
82
|
onScroll: onScroll,
|
103
83
|
ref: scrollContainerRef,
|
104
84
|
// 此处使用了取巧的办法
|
@@ -106,15 +86,14 @@ var Selector = function Selector(props) {
|
|
106
86
|
className: classname.cx(componentPrefix + "__scroll-part", componentPrefix + "__demarcate")
|
107
87
|
}, data.map(function (item, index) {
|
108
88
|
var _cx;
|
109
|
-
|
110
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
111
90
|
className: classname.cx(componentPrefix + "__item", componentPrefix + "__demarcate", (_cx = {}, _cx[componentPrefix + "__item--disabled"] = item.disabled, _cx[componentPrefix + "__item--active"] = item.id === value, _cx)),
|
112
91
|
key: item.id,
|
113
92
|
onClick: function onClick() {
|
114
93
|
return onItemClick(item, index);
|
115
94
|
}
|
116
95
|
}, item.title);
|
117
|
-
}), /*#__PURE__*/
|
96
|
+
}), /*#__PURE__*/React.createElement("div", {
|
118
97
|
style: {
|
119
98
|
pointerEvents: 'none',
|
120
99
|
opacity: '0',
|
@@ -123,13 +102,12 @@ var Selector = function Selector(props) {
|
|
123
102
|
left: '0',
|
124
103
|
top: '0'
|
125
104
|
}
|
126
|
-
}, /*#__PURE__*/
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
127
106
|
className: componentPrefix + "__demarcate",
|
128
107
|
ref: topItemGagerRef
|
129
|
-
}), /*#__PURE__*/
|
108
|
+
}), /*#__PURE__*/React.createElement("div", {
|
130
109
|
className: componentPrefix + "__demarcate",
|
131
110
|
ref: bottomItemGagerRef
|
132
111
|
}))));
|
133
112
|
};
|
134
|
-
|
135
113
|
exports.Selector = Selector;
|
package/lib/cjs/TimePicker.js
CHANGED
@@ -9,124 +9,85 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
13
|
-
|
14
|
-
Object.defineProperty(exports, '__esModule', {
|
15
|
-
value: true
|
16
|
-
});
|
17
|
-
|
18
12
|
var React = require('react');
|
19
|
-
|
20
13
|
var classname = require('@hi-ui/classname');
|
21
|
-
|
22
14
|
var env = require('@hi-ui/env');
|
23
|
-
|
24
15
|
var core = require('@hi-ui/core');
|
25
|
-
|
26
16
|
var Input = require('./Input.js');
|
27
|
-
|
28
17
|
var useUncontrolledState = require('@hi-ui/use-uncontrolled-state');
|
29
|
-
|
30
18
|
var popper = require('@hi-ui/popper');
|
31
|
-
|
32
19
|
var icons = require('@hi-ui/icons');
|
33
|
-
|
34
20
|
var PopContent = require('./PopContent.js');
|
35
|
-
|
36
21
|
var valueChecker = require('./utils/valueChecker.js');
|
37
|
-
|
38
22
|
var useFilter = require('./hooks/useFilter.js');
|
39
|
-
|
40
23
|
var button = require('@hi-ui/button');
|
41
|
-
|
42
24
|
var getNowString = require('./utils/getNowString.js');
|
43
|
-
|
44
25
|
var DayJs = require('dayjs');
|
45
|
-
|
46
|
-
function _interopDefaultLegacy(e) {
|
47
|
-
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
48
|
-
'default': e
|
49
|
-
};
|
50
|
-
}
|
51
|
-
|
52
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
53
|
-
|
54
|
-
var DayJs__default = /*#__PURE__*/_interopDefaultLegacy(DayJs);
|
55
|
-
|
56
26
|
var _role = 'time-picker';
|
57
27
|
var timePickerPrefix = classname.getPrefixCls(_role);
|
58
28
|
var DefaultValue = ['', ''];
|
59
|
-
|
60
29
|
var DefaultDisabledFunc = function DefaultDisabledFunc() {
|
61
30
|
return [];
|
62
31
|
};
|
63
|
-
|
64
32
|
var DefaultPlaceholder = ['', ''];
|
65
|
-
|
66
33
|
var getValueMatchString = function getValueMatchString(value, format) {
|
67
34
|
if (format === void 0) {
|
68
35
|
format = 'HH:mm:ss';
|
69
36
|
}
|
70
|
-
|
71
37
|
if (!value) {
|
72
38
|
return undefined;
|
73
39
|
}
|
74
|
-
|
75
40
|
var result = Array.isArray(value) ? value : [value];
|
76
41
|
return result.map(function (item) {
|
77
|
-
return typeof item === 'string' ? item :
|
42
|
+
return typeof item === 'string' ? item : DayJs(item).format(format);
|
78
43
|
});
|
79
44
|
};
|
80
|
-
|
81
45
|
var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
82
46
|
var _cx;
|
83
|
-
|
84
47
|
var _ref$prefixCls = _ref.prefixCls,
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
48
|
+
prefixCls = _ref$prefixCls === void 0 ? timePickerPrefix : _ref$prefixCls,
|
49
|
+
_ref$role = _ref.role,
|
50
|
+
role = _ref$role === void 0 ? _role : _ref$role,
|
51
|
+
className = _ref.className,
|
52
|
+
controlledValue = _ref.value,
|
53
|
+
_ref$hourStep = _ref.hourStep,
|
54
|
+
hourStep = _ref$hourStep === void 0 ? 1 : _ref$hourStep,
|
55
|
+
_ref$minuteStep = _ref.minuteStep,
|
56
|
+
minuteStep = _ref$minuteStep === void 0 ? 1 : _ref$minuteStep,
|
57
|
+
_ref$secondStep = _ref.secondStep,
|
58
|
+
secondStep = _ref$secondStep === void 0 ? 1 : _ref$secondStep,
|
59
|
+
_ref$format = _ref.format,
|
60
|
+
format = _ref$format === void 0 ? 'HH:mm:ss' : _ref$format,
|
61
|
+
_ref$type = _ref.type,
|
62
|
+
type = _ref$type === void 0 ? 'single' : _ref$type,
|
63
|
+
_ref$appearance = _ref.appearance,
|
64
|
+
appearance = _ref$appearance === void 0 ? 'line' : _ref$appearance,
|
65
|
+
_ref$defaultValue = _ref.defaultValue,
|
66
|
+
uncontrolledValue = _ref$defaultValue === void 0 ? DefaultValue : _ref$defaultValue,
|
67
|
+
_ref$disabled = _ref.disabled,
|
68
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
69
|
+
_ref$disabledHours = _ref.disabledHours,
|
70
|
+
originalDisabledHours = _ref$disabledHours === void 0 ? DefaultDisabledFunc : _ref$disabledHours,
|
71
|
+
_ref$disabledSeconds = _ref.disabledSeconds,
|
72
|
+
originalDisabledSeconds = _ref$disabledSeconds === void 0 ? DefaultDisabledFunc : _ref$disabledSeconds,
|
73
|
+
_ref$disabledMinutes = _ref.disabledMinutes,
|
74
|
+
originalDisabledMinutes = _ref$disabledMinutes === void 0 ? DefaultDisabledFunc : _ref$disabledMinutes,
|
75
|
+
notifyOutside = _ref.onChange,
|
76
|
+
_ref$placeholder = _ref.placeholder,
|
77
|
+
originalPlaceholder = _ref$placeholder === void 0 ? DefaultPlaceholder : _ref$placeholder,
|
78
|
+
_ref$inputReadonly = _ref.inputReadonly,
|
79
|
+
inputReadonly = _ref$inputReadonly === void 0 ? false : _ref$inputReadonly,
|
80
|
+
overlay = _ref.overlay,
|
81
|
+
_ref$size = _ref.size,
|
82
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
83
|
+
_ref$invalid = _ref.invalid,
|
84
|
+
invalid = _ref$invalid === void 0 ? false : _ref$invalid;
|
122
85
|
var i18n = core.useLocaleContext();
|
123
86
|
var confirmText = i18n.get('timePicker.ok');
|
124
87
|
var nowText = i18n.get('timePicker.now');
|
125
|
-
|
126
88
|
var _useState = React.useState(null),
|
127
|
-
|
128
|
-
|
129
|
-
|
89
|
+
attachEl = _useState[0],
|
90
|
+
setAttachEl = _useState[1];
|
130
91
|
var formatUncontrolledValue = React.useMemo(function () {
|
131
92
|
return getValueMatchString(uncontrolledValue, format);
|
132
93
|
}, [format, uncontrolledValue]);
|
@@ -143,42 +104,35 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
143
104
|
var singleFormat = ['HH', 'mm', 'ss'];
|
144
105
|
return singleFormat.includes(format);
|
145
106
|
}, [format]);
|
146
|
-
|
147
107
|
var _useUncontrolledState = useUncontrolledState.useUncontrolledState(formatUncontrolledValue, formatControlledValue, formatNotifyOutside),
|
148
|
-
|
149
|
-
|
150
|
-
|
108
|
+
value = _useUncontrolledState[0],
|
109
|
+
onChange = _useUncontrolledState[1];
|
151
110
|
var placeholder = React.useMemo(function () {
|
152
111
|
return Array.isArray(originalPlaceholder) ? originalPlaceholder : [originalPlaceholder];
|
153
112
|
}, [originalPlaceholder]);
|
154
113
|
var inputRef = React.useRef(null);
|
155
|
-
|
156
114
|
var _useState2 = React.useState(true),
|
157
|
-
|
158
|
-
|
159
|
-
|
115
|
+
isInputValid = _useState2[0],
|
116
|
+
setIsInputValid = _useState2[1];
|
160
117
|
var _useState3 = React.useState(value),
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
118
|
+
cacheValue = _useState3[0],
|
119
|
+
setCacheValue = _useState3[1];
|
120
|
+
var cacheValueRef = React.useRef(cacheValue);
|
121
|
+
// 将值统一转化为函数
|
166
122
|
var _useFilter = useFilter.useFilter({
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
123
|
+
disabledHours: originalDisabledHours,
|
124
|
+
disabledMinutes: originalDisabledMinutes,
|
125
|
+
disabledSeconds: originalDisabledSeconds
|
126
|
+
}),
|
127
|
+
disabledHours = _useFilter.disabledHours,
|
128
|
+
disabledMinutes = _useFilter.disabledMinutes,
|
129
|
+
disabledSeconds = _useFilter.disabledSeconds;
|
175
130
|
React.useEffect(function () {
|
176
131
|
cacheValueRef.current = [].concat(value);
|
177
132
|
setCacheValue(function (pre) {
|
178
133
|
if (pre.join('') !== value.join('')) {
|
179
134
|
return [].concat(value);
|
180
135
|
}
|
181
|
-
|
182
136
|
return pre;
|
183
137
|
});
|
184
138
|
}, [value]);
|
@@ -188,8 +142,8 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
188
142
|
} else {
|
189
143
|
return index === 0 ? 'range-start' : 'range-end';
|
190
144
|
}
|
191
|
-
}, [type]);
|
192
|
-
|
145
|
+
}, [type]);
|
146
|
+
// 检查值是否合规
|
193
147
|
var validChecker = React.useCallback(function (checkValue) {
|
194
148
|
// 检查 range 情况下值是否正确
|
195
149
|
// 视开始结束都为空值为正确值
|
@@ -210,32 +164,30 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
210
164
|
},
|
211
165
|
panelType: getPanelType(index)
|
212
166
|
});
|
213
|
-
}) && (
|
167
|
+
}) && (
|
168
|
+
// 单选不检查前后关系
|
214
169
|
type === 'single' || rangeValid);
|
215
170
|
}, [hourStep, getPanelType, minuteStep, secondStep, disabledHours, disabledMinutes, disabledSeconds, format, type]);
|
216
171
|
var onCacheChange = React.useCallback(function (newValue) {
|
217
172
|
var result = newValue.slice(0, type === 'single' ? 1 : 2);
|
218
|
-
cacheValueRef.current = [].concat(result);
|
219
|
-
|
173
|
+
cacheValueRef.current = [].concat(result);
|
174
|
+
// 避免重复渲染
|
220
175
|
setCacheValue(function (pre) {
|
221
176
|
if (pre.join('') !== result.join('')) {
|
222
177
|
return [].concat(result);
|
223
178
|
}
|
224
|
-
|
225
179
|
return pre;
|
226
180
|
});
|
227
181
|
}, [type]);
|
228
|
-
|
229
182
|
var _useState4 = React.useState(false),
|
230
|
-
|
231
|
-
|
232
|
-
|
183
|
+
showPopper = _useState4[0],
|
184
|
+
setShowPopper = _useState4[1];
|
233
185
|
var showPopperRef = React.useRef(false);
|
234
186
|
var cls = classname.cx(prefixCls, className, prefixCls + "--appearance-" + appearance, (_cx = {}, _cx[prefixCls + "--active"] = showPopper && !disabled, _cx[prefixCls + "--disabled"] = disabled, _cx[prefixCls + "--input-not-valid"] = !isInputValid || invalid, _cx));
|
235
187
|
var functionButtons = React.useMemo(function () {
|
236
|
-
return /*#__PURE__*/
|
188
|
+
return /*#__PURE__*/React.createElement("div", {
|
237
189
|
className: prefixCls + "__pop-function-buttons"
|
238
|
-
}, /*#__PURE__*/
|
190
|
+
}, /*#__PURE__*/React.createElement(button.Button, {
|
239
191
|
className: prefixCls + "__pop-confirm-btn",
|
240
192
|
type: 'primary',
|
241
193
|
disabled: !isInputValid,
|
@@ -246,11 +198,10 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
246
198
|
onChange([].concat(cacheValue));
|
247
199
|
}
|
248
200
|
}
|
249
|
-
|
250
201
|
showPopperRef.current = false;
|
251
202
|
setShowPopper(false);
|
252
203
|
}
|
253
|
-
}, confirmText), type === 'single' && !isInSingleValueFormat && /*#__PURE__*/
|
204
|
+
}, confirmText), type === 'single' && !isInSingleValueFormat && /*#__PURE__*/React.createElement(button.Button, {
|
254
205
|
className: prefixCls + "__pop-now-btn",
|
255
206
|
appearance: "link",
|
256
207
|
type: "primary",
|
@@ -262,14 +213,14 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
262
213
|
}
|
263
214
|
}, nowText));
|
264
215
|
}, [prefixCls, isInputValid, confirmText, type, isInSingleValueFormat, nowText, validChecker, cacheValue, value, onChange, onCacheChange, format]);
|
265
|
-
return /*#__PURE__*/
|
216
|
+
return /*#__PURE__*/React.createElement("div", {
|
266
217
|
ref: ref,
|
267
218
|
role: role,
|
268
219
|
className: cls
|
269
|
-
}, /*#__PURE__*/
|
220
|
+
}, /*#__PURE__*/React.createElement("div", {
|
270
221
|
ref: setAttachEl,
|
271
222
|
className: prefixCls + "__input-wrapper"
|
272
|
-
}, /*#__PURE__*/
|
223
|
+
}, /*#__PURE__*/React.createElement(Input.Input, {
|
273
224
|
size: size,
|
274
225
|
isFitContent: appearance === 'unset',
|
275
226
|
ref: inputRef,
|
@@ -291,7 +242,7 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
291
242
|
showPopperRef.current = true;
|
292
243
|
setShowPopper(true);
|
293
244
|
}
|
294
|
-
}), /*#__PURE__*/
|
245
|
+
}), /*#__PURE__*/React.createElement("div", {
|
295
246
|
className: prefixCls + "__function-button",
|
296
247
|
onClick: function onClick() {
|
297
248
|
showPopperRef.current = !showPopperRef.current;
|
@@ -299,28 +250,28 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
299
250
|
return !pre;
|
300
251
|
});
|
301
252
|
}
|
302
|
-
}, showPopper ? /*#__PURE__*/
|
253
|
+
}, showPopper ? /*#__PURE__*/React.createElement(icons.CloseCircleFilled, {
|
303
254
|
className: prefixCls + "__close-button",
|
304
255
|
onClick: function onClick() {
|
305
256
|
onCacheChange(type === 'single' ? [''] : ['', '']);
|
306
257
|
}
|
307
|
-
}) : /*#__PURE__*/
|
258
|
+
}) : /*#__PURE__*/React.createElement(icons.TimeOutlined, null))), /*#__PURE__*/React.createElement(popper.Popper, Object.assign({}, overlay || {}, {
|
308
259
|
unmountOnClose: false,
|
309
260
|
visible: showPopper && !disabled,
|
310
261
|
attachEl: attachEl,
|
311
262
|
autoFocus: false,
|
312
263
|
onClose: function onClose() {
|
313
|
-
var _a;
|
314
|
-
|
315
|
-
|
264
|
+
var _a;
|
265
|
+
// 关闭弹窗,视作,抛弃之前的选择行为,复位
|
316
266
|
showPopperRef.current = false;
|
317
267
|
setShowPopper(false);
|
318
|
-
onCacheChange([].concat(value));
|
319
|
-
|
268
|
+
onCacheChange([].concat(value));
|
269
|
+
// 强制刷新 input 内容,复位
|
320
270
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.refresh();
|
321
271
|
},
|
322
272
|
preload: true
|
323
|
-
}), /*#__PURE__*/
|
273
|
+
}), /*#__PURE__*/React.createElement(PopContent.PopContent
|
274
|
+
// itemHeight={itemHeight}
|
324
275
|
// fullDisplayItemNumber={fullDisplayItemNumber}
|
325
276
|
, {
|
326
277
|
// itemHeight={itemHeight}
|
@@ -336,10 +287,9 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
336
287
|
disabledSeconds: disabledSeconds,
|
337
288
|
value: cacheValue,
|
338
289
|
onChange: function onChange(e) {
|
339
|
-
var _a;
|
290
|
+
var _a;
|
291
|
+
// 只有弹窗展开的时候才接受 pop content 的值改变
|
340
292
|
// WARNING: 当值错误,弹窗收起,默认会滚动到 00:00:00,并且通知外部(非期望),所以我们需要这个FLAG来避免错误值获取
|
341
|
-
|
342
|
-
|
343
293
|
if (showPopperRef.current) {
|
344
294
|
// 强制刷新 input 内容,复位
|
345
295
|
// 解决此情况:
|
@@ -351,10 +301,8 @@ var TimePicker = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
351
301
|
}
|
352
302
|
}), functionButtons));
|
353
303
|
});
|
354
|
-
|
355
304
|
if (env.__DEV__) {
|
356
305
|
TimePicker.displayName = 'TimePicker';
|
357
306
|
}
|
358
|
-
|
359
307
|
exports.TimePicker = TimePicker;
|
360
308
|
exports.timePickerPrefix = timePickerPrefix;
|
@@ -9,12 +9,7 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
13
|
-
value: true
|
14
|
-
});
|
15
|
-
|
16
12
|
var React = require('react');
|
17
|
-
|
18
13
|
var useFilter = function useFilter(original) {
|
19
14
|
return React.useMemo(function () {
|
20
15
|
function disabledCompatibility(disposeValue) {
|
@@ -23,10 +18,8 @@ var useFilter = function useFilter(original) {
|
|
23
18
|
return disposeValue;
|
24
19
|
};
|
25
20
|
}
|
26
|
-
|
27
21
|
return disposeValue;
|
28
22
|
}
|
29
|
-
|
30
23
|
return {
|
31
24
|
disabledHours: disabledCompatibility(original.disabledHours),
|
32
25
|
disabledMinutes: disabledCompatibility(original.disabledMinutes),
|
@@ -34,5 +27,4 @@ var useFilter = function useFilter(original) {
|
|
34
27
|
};
|
35
28
|
}, [original.disabledHours, original.disabledSeconds, original.disabledMinutes]);
|
36
29
|
};
|
37
|
-
|
38
30
|
exports.useFilter = useFilter;
|
package/lib/cjs/index.js
CHANGED
@@ -12,15 +12,10 @@
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
13
13
|
value: true
|
14
14
|
});
|
15
|
-
|
16
15
|
require('./styles/index.scss.js');
|
17
|
-
|
18
16
|
var PopContent = require('./PopContent.js');
|
19
|
-
|
20
17
|
var index = require('./@types/index.js');
|
21
|
-
|
22
18
|
var TimePicker = require('./TimePicker.js');
|
23
|
-
|
24
19
|
exports.TimePickerPopContent = PopContent.PopContent;
|
25
20
|
Object.defineProperty(exports, 'TimePickerSelectorType', {
|
26
21
|
enumerable: true,
|
@@ -12,10 +12,7 @@
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
13
13
|
value: true
|
14
14
|
});
|
15
|
-
var css_248z = ".hi-v4-time-picker {width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;border-radius: 4px;-webkit-box-shadow: 0 0 0 2px transparent;box-shadow: 0 0 0 2px transparent;}.hi-v4-time-picker__input-wrapper {border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-static-transparent, transparent);border-radius: var(--hi-v4-border-radius-md, 4px);width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-time-picker--appearance-line {position: relative;z-index: 0;}.hi-v4-time-picker--appearance-line .hi-v4-time-picker__input-wrapper {background: var(--hi-v4-color-static-white, #fff);border-color: var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-time-picker--appearance-line:hover .hi-v4-time-picker__input-wrapper {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker--appearance-filled {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker--appearance-filled:hover {background: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-time-picker--appearance-unset:hover {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker--active {-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));background: transparent;}.hi-v4-time-picker--active .hi-v4-time-picker__input-wrapper {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker--active:hover {background: transparent;}.hi-v4-time-picker--input-not-valid {-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-danger-100, var(--hi-v4-color-red-100, #ffd1c9));box-shadow: 0 0 0 2px var(--hi-v4-color-danger-100, var(--hi-v4-color-red-100, #ffd1c9));}.hi-v4-time-picker--input-not-valid .hi-v4-time-picker__input-wrapper, .hi-v4-time-picker--input-not-valid .hi-v4-time-picker__input-wrapper:hover {border-color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959));}.hi-v4-time-picker__pop-function-buttons {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;padding: 6px 8px;border-top: 1px solid var(--hi-v4-color-gray-100, #f2f4f7);-webkit-box-align: center;-ms-flex-align: center;align-items: center;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-box-orient: horizontal;-webkit-box-direction: reverse;-ms-flex-direction: row-reverse;flex-direction: row-reverse;}.hi-v4-time-picker__pop-function-buttons .hi-v4-time-picker__pop-now-btn {-webkit-margin-start: 0;margin-inline-start: 0;-webkit-margin-end: var(--hi-v4-spacing-6, 12px);margin-inline-end: var(--hi-v4-spacing-6, 12px);}.hi-v4-time-picker__function-button {margin-right: 8px;font-size: 14px;cursor: pointer;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--disabled {cursor: not-allowed;background: #dfe2e8;}.hi-v4-time-picker--disabled .hi-v4-time-picker__input-wrapper {pointer-events: none;opacity: 0.3;}.hi-v4-time-picker__close-button:hover {color: #5f6a7a;}.hi-v4-time-picker__selector {cursor: pointer;position: relative;z-index: 0;width: 54px;color: #5f6a7a;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__selector:hover .hi-v4-time-picker__selector__shortcut {opacity: 1;}.hi-v4-time-picker__selector--position-left {margin-right: 1px;}.hi-v4-time-picker__selector--position-left .hi-v4-time-picker__selector__item {border-radius: 4px 0 0 4px;}.hi-v4-time-picker__selector--position-right {margin-left: 1px;}.hi-v4-time-picker__selector--position-right .hi-v4-time-picker__selector__item {border-radius: 0 4px 4px 0;}.hi-v4-time-picker__selector--position-single .hi-v4-time-picker__selector__item {border-radius: 4px;}.hi-v4-time-picker__selector__item {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;font-size: 14px;}.hi-v4-time-picker__selector__item:hover {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker__selector__item.hi-v4-time-picker__selector__item--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker__selector__item.hi-v4-time-picker__selector__item--disabled {opacity: 0.2;cursor: not-allowed;background: transparent;}.hi-v4-time-picker__selector__demarcate {margin: 2px 0;height: 32px;}.hi-v4-time-picker__selector__demarcate:first-of-type {margin-top: 0;}.hi-v4-time-picker__selector__demarcate:last-of-type {margin-bottom: 0;}.hi-v4-time-picker__selector__scroll-part {overflow-y: auto;-webkit-box-sizing: content-box;box-sizing: content-box;scroll-behavior: smooth;scrollbar-width: none; /* firefox */-ms-overflow-style: none; /* IE 10+ */padding: 100px 0;width: 100%;position: relative;z-index: 0;}.hi-v4-time-picker__selector__scroll-part::-webkit-scrollbar {display: none; /* Chrome Safari */}.hi-v4-time-picker__selector__shortcut {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;height: 12px;opacity: 0;}.hi-v4-time-picker__panel {padding: 4px 8px;-webkit-box-sizing: border-box;box-sizing: border-box;height: 100%;}.hi-v4-time-picker__panel__selector-container {display: -webkit-box;display: -ms-flexbox;display: flex;position: relative;z-index: 0;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__panel__selector-content {position: relative;}.hi-v4-time-picker__panel__indicator {position: absolute;top: 50%;-webkit-transform: translateY(-50%);transform: translateY(-50%);pointer-events: none;background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));z-index: -1;width: 54px;height: 32px;}.hi-v4-time-picker__panel__indicator--left {border-top-left-radius: 4px;border-bottom-left-radius: 4px;left: 0;}.hi-v4-time-picker__panel__indicator--right {border-top-right-radius: 4px;border-bottom-right-radius: 4px;right: 0;}.hi-v4-time-picker__panel__indicator--middle {left: 0;}.hi-v4-time-picker__input {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;color: var(--hi-v4-color-gray-700, #1f2733);}.hi-v4-time-picker__input--disabled {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input--not-valid {color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959));}.hi-v4-time-picker__input--range .hi-v4-time-picker__input__interact-area {text-align: left;}.hi-v4-time-picker__input--fit-content .hi-v4-time-picker__input__wrapper {width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;}.hi-v4-time-picker__input--size-sm {line-height: var(--hi-v4-height-6, 24px);font-size: var(--hi-v4-text-size-sm, 0.75rem);}.hi-v4-time-picker__input--size-sm .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-6, 24px);}.hi-v4-time-picker__input--size-md {line-height: var(--hi-v4-height-8, 32px);font-size: var(--hi-v4-text-size-md, 0.875rem);}.hi-v4-time-picker__input--size-md .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-8, 32px);}.hi-v4-time-picker__input--size-lg {line-height: var(--hi-v4-height-10, 40px);font-size: var(--hi-v4-text-size-lg, 1rem);}.hi-v4-time-picker__input--size-lg .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-10, 40px);}.hi-v4-time-picker__input__wrapper {width: 208px;-webkit-box-sizing: border-box;box-sizing: border-box;position: relative;z-index: 0;height: 30px;line-height: 30px;padding: 0 12px;}.hi-v4-time-picker__input__shadow-text {display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;color: transparent;}.hi-v4-time-picker__input__interact-area {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;padding: 0 12px;color: inherit;border: none;outline: none;height: 100%;font-size: inherit;background: transparent;font-weight: inherit;font-family: inherit;position: absolute;left: 0;top: 0;}.hi-v4-time-picker__input__interact-area:disabled {background: transparent;}.hi-v4-time-picker__input__interact-area::-webkit-input-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::-moz-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::-ms-input-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area:-ms-input-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-webkit-input-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-moz-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-ms-input-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area:-ms-input-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker__pop-content {display: -webkit-box;display: -ms-flexbox;display: flex;width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;position: relative;-webkit-box-align: stretch;-ms-flex-align: stretch;align-items: stretch;min-width: 100%;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__pop-content__separator {width: 1px;background-color: var(--hi-v4-color-gray-100, #f2f4f7);border-left: none;border-right: none;}";
|
16
|
-
|
15
|
+
var css_248z = ".hi-v4-time-picker {width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;border-radius: 4px;-webkit-box-shadow: 0 0 0 2px transparent;box-shadow: 0 0 0 2px transparent;}.hi-v4-time-picker__input-wrapper {border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-static-transparent, transparent);border-radius: var(--hi-v4-border-radius-md, 4px);width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-time-picker--appearance-line {position: relative;z-index: 0;}.hi-v4-time-picker--appearance-line .hi-v4-time-picker__input-wrapper {background: var(--hi-v4-color-static-white, #fff);border-color: var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-time-picker--appearance-line:hover .hi-v4-time-picker__input-wrapper {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker--appearance-filled {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker--appearance-filled:hover {background: var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-time-picker--appearance-unset:hover {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker--active {-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));background: transparent;}.hi-v4-time-picker--active .hi-v4-time-picker__input-wrapper {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker--active:hover {background: transparent;}.hi-v4-time-picker--input-not-valid {-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-danger-100, var(--hi-v4-color-red-100, #ffd1c9));box-shadow: 0 0 0 2px var(--hi-v4-color-danger-100, var(--hi-v4-color-red-100, #ffd1c9));}.hi-v4-time-picker--input-not-valid .hi-v4-time-picker__input-wrapper, .hi-v4-time-picker--input-not-valid .hi-v4-time-picker__input-wrapper:hover {border-color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959));}.hi-v4-time-picker__pop-function-buttons {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;padding: 6px 8px;border-top: 1px solid var(--hi-v4-color-gray-100, #f2f4f7);-webkit-box-align: center;-ms-flex-align: center;align-items: center;-ms-flex-wrap: wrap;flex-wrap: wrap;-webkit-box-orient: horizontal;-webkit-box-direction: reverse;-ms-flex-direction: row-reverse;flex-direction: row-reverse;}.hi-v4-time-picker__pop-function-buttons .hi-v4-time-picker__pop-now-btn {-webkit-margin-start: 0;margin-inline-start: 0;-webkit-margin-end: var(--hi-v4-spacing-6, 12px);margin-inline-end: var(--hi-v4-spacing-6, 12px);}.hi-v4-time-picker__function-button {margin-right: 8px;font-size: 14px;cursor: pointer;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--disabled {cursor: not-allowed;background: #dfe2e8;}.hi-v4-time-picker--disabled .hi-v4-time-picker__input-wrapper {pointer-events: none;opacity: 0.3;}.hi-v4-time-picker__close-button:hover {color: #5f6a7a;}.hi-v4-time-picker__selector {cursor: pointer;position: relative;z-index: 0;width: 54px;color: #5f6a7a;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__selector:hover .hi-v4-time-picker__selector__shortcut {opacity: 1;}.hi-v4-time-picker__selector--position-left {margin-right: 1px;}.hi-v4-time-picker__selector--position-left .hi-v4-time-picker__selector__item {border-radius: 4px 0 0 4px;}.hi-v4-time-picker__selector--position-right {margin-left: 1px;}.hi-v4-time-picker__selector--position-right .hi-v4-time-picker__selector__item {border-radius: 0 4px 4px 0;}.hi-v4-time-picker__selector--position-single .hi-v4-time-picker__selector__item {border-radius: 4px;}.hi-v4-time-picker__selector__item {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;font-size: 14px;}.hi-v4-time-picker__selector__item:hover {background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-time-picker__selector__item.hi-v4-time-picker__selector__item--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-time-picker__selector__item.hi-v4-time-picker__selector__item--disabled {opacity: 0.2;cursor: not-allowed;background: transparent;}.hi-v4-time-picker__selector__demarcate {margin: 2px 0;height: 32px;}.hi-v4-time-picker__selector__demarcate:first-of-type {margin-top: 0;}.hi-v4-time-picker__selector__demarcate:last-of-type {margin-bottom: 0;}.hi-v4-time-picker__selector__scroll-part {overflow-y: auto;-webkit-box-sizing: content-box;box-sizing: content-box;scroll-behavior: smooth;scrollbar-width: none; /* firefox */-ms-overflow-style: none; /* IE 10+ */padding: 100px 0;width: 100%;position: relative;z-index: 0;}.hi-v4-time-picker__selector__scroll-part::-webkit-scrollbar {display: none; /* Chrome Safari */}.hi-v4-time-picker__selector__shortcut {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;height: 12px;opacity: 0;}.hi-v4-time-picker__panel {padding: 4px 8px;-webkit-box-sizing: border-box;box-sizing: border-box;height: 100%;}.hi-v4-time-picker__panel__selector-container {display: -webkit-box;display: -ms-flexbox;display: flex;position: relative;z-index: 0;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__panel__selector-content {position: relative;}.hi-v4-time-picker__panel__indicator {position: absolute;top: 50%;-webkit-transform: translateY(-50%);transform: translateY(-50%);pointer-events: none;background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));z-index: -1;width: 54px;height: 32px;}.hi-v4-time-picker__panel__indicator--left {border-top-left-radius: 4px;border-bottom-left-radius: 4px;left: 0;}.hi-v4-time-picker__panel__indicator--right {border-top-right-radius: 4px;border-bottom-right-radius: 4px;right: 0;}.hi-v4-time-picker__panel__indicator--middle {left: 0;}.hi-v4-time-picker__input {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;color: var(--hi-v4-color-gray-700, #1f2733);}.hi-v4-time-picker__input--disabled {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input--not-valid {color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959));}.hi-v4-time-picker__input--range .hi-v4-time-picker__input__interact-area {text-align: left;}.hi-v4-time-picker__input--fit-content .hi-v4-time-picker__input__wrapper {width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;}.hi-v4-time-picker__input--size-sm {line-height: var(--hi-v4-height-6, 24px);font-size: var(--hi-v4-text-size-sm, 0.75rem);}.hi-v4-time-picker__input--size-sm .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-6, 24px);}.hi-v4-time-picker__input--size-md {line-height: var(--hi-v4-height-8, 32px);font-size: var(--hi-v4-text-size-md, 0.875rem);}.hi-v4-time-picker__input--size-md .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-8, 32px);}.hi-v4-time-picker__input--size-lg {line-height: var(--hi-v4-height-10, 40px);font-size: var(--hi-v4-text-size-lg, 1rem);}.hi-v4-time-picker__input--size-lg .hi-v4-time-picker__input__wrapper {height: var(--hi-v4-height-10, 40px);}.hi-v4-time-picker__input__wrapper {width: 208px;-webkit-box-sizing: border-box;box-sizing: border-box;position: relative;z-index: 0;height: 30px;line-height: 30px;padding: 0 12px;}.hi-v4-time-picker__input__shadow-text {display: inline-block;font-size: inherit;font-weight: inherit;font-family: inherit;color: transparent;}.hi-v4-time-picker__input__interact-area {-webkit-box-sizing: border-box;box-sizing: border-box;width: 100%;padding: 0 12px;color: inherit;border: none;outline: none;height: 100%;font-size: inherit;background: transparent;font-weight: inherit;font-family: inherit;position: absolute;left: 0;top: 0;}.hi-v4-time-picker__input__interact-area:disabled {background: transparent;}.hi-v4-time-picker__input__interact-area::-webkit-input-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::-moz-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::-ms-input-placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker__input__interact-area::placeholder {color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-webkit-input-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-moz-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::-ms-input-placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker--appearance-unset .hi-v4-time-picker__input__interact-area::placeholder {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-time-picker__pop-content {display: -webkit-box;display: -ms-flexbox;display: flex;width: -webkit-fit-content;width: -moz-fit-content;width: fit-content;position: relative;-webkit-box-align: stretch;-ms-flex-align: stretch;align-items: stretch;min-width: 100%;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-time-picker__pop-content__separator {width: 1px;background-color: var(--hi-v4-color-gray-100, #f2f4f7);border-left: none;border-right: none;}";
|
17
16
|
var __styleInject__ = require('style-inject')["default"];
|
18
|
-
|
19
17
|
__styleInject__(css_248z);
|
20
|
-
|
21
18
|
exports["default"] = css_248z;
|
@@ -9,12 +9,7 @@
|
|
9
9
|
*/
|
10
10
|
'use strict';
|
11
11
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
13
|
-
value: true
|
14
|
-
});
|
15
|
-
|
16
12
|
var index = require('../@types/index.js');
|
17
|
-
|
18
13
|
var analysisFormat = function analysisFormat(format) {
|
19
14
|
var searchList = [{
|
20
15
|
identifier: 'HH',
|
@@ -29,13 +24,11 @@ var analysisFormat = function analysisFormat(format) {
|
|
29
24
|
var result = [];
|
30
25
|
searchList.forEach(function (_ref) {
|
31
26
|
var identifier = _ref.identifier,
|
32
|
-
|
33
|
-
|
27
|
+
type = _ref.type;
|
34
28
|
if (format.includes(identifier)) {
|
35
29
|
result.push(type);
|
36
30
|
}
|
37
31
|
});
|
38
32
|
return result;
|
39
33
|
};
|
40
|
-
|
41
34
|
exports.analysisFormat = analysisFormat;
|