@semcore/time-picker 16.1.14-prerelease.9 → 16.2.0-prerelease.1
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 +3 -4
- package/lib/cjs/PickerFormat.js +81 -0
- package/lib/cjs/PickerFormat.js.map +1 -0
- package/lib/cjs/PickerInput.js +286 -0
- package/lib/cjs/PickerInput.js.map +1 -0
- package/lib/cjs/TimePicker.js +348 -0
- package/lib/cjs/TimePicker.js.map +1 -0
- package/lib/cjs/index.d.js +2 -0
- package/lib/cjs/index.d.js.map +1 -0
- package/lib/cjs/index.js +8 -9
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/time-picker.shadow.css +116 -0
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/PickerFormat.js +75 -0
- package/lib/es6/PickerFormat.js.map +1 -0
- package/lib/es6/PickerInput.js +281 -0
- package/lib/es6/PickerInput.js.map +1 -0
- package/lib/es6/TimePicker.js +339 -0
- package/lib/es6/TimePicker.js.map +1 -0
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/lib/es6/index.js +2 -2
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/time-picker.shadow.css +116 -0
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/PickerFormat.mjs +67 -0
- package/lib/esm/PickerInput.mjs +263 -0
- package/lib/esm/TimePicker.mjs +297 -0
- package/lib/esm/index.mjs +7 -2
- package/lib/esm/style/time-picker.shadow.css +116 -0
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/types/index.d.ts +63 -2
- package/package.json +8 -8
- package/vite.config.ts +4 -1
- package/lib/cjs/component/PickerFormat/PickerFormat.js +0 -84
- package/lib/cjs/component/PickerFormat/PickerFormat.js.map +0 -1
- package/lib/cjs/component/PickerFormat/PickerFormat.type.js +0 -2
- package/lib/cjs/component/PickerFormat/PickerFormat.type.js.map +0 -1
- package/lib/cjs/component/PickerFormat/picker-format.shadow.css +0 -61
- package/lib/cjs/component/PickerInput/PickerInput.js +0 -228
- package/lib/cjs/component/PickerInput/PickerInput.js.map +0 -1
- package/lib/cjs/component/PickerInput/PickerInput.type.js +0 -2
- package/lib/cjs/component/PickerInput/PickerInput.type.js.map +0 -1
- package/lib/cjs/component/PickerInput/picker-input.shadow.css +0 -11
- package/lib/cjs/component/TimePicker/TimePicker.js +0 -220
- package/lib/cjs/component/TimePicker/TimePicker.js.map +0 -1
- package/lib/cjs/component/TimePicker/TimePicker.type.js +0 -2
- package/lib/cjs/component/TimePicker/TimePicker.type.js.map +0 -1
- package/lib/cjs/component/TimePicker/time-picker.shadow.css +0 -34
- package/lib/cjs/entity/TimePickerEntity.js +0 -73
- package/lib/cjs/entity/TimePickerEntity.js.map +0 -1
- package/lib/es6/component/PickerFormat/PickerFormat.js +0 -79
- package/lib/es6/component/PickerFormat/PickerFormat.js.map +0 -1
- package/lib/es6/component/PickerFormat/PickerFormat.type.js +0 -2
- package/lib/es6/component/PickerFormat/PickerFormat.type.js.map +0 -1
- package/lib/es6/component/PickerFormat/picker-format.shadow.css +0 -61
- package/lib/es6/component/PickerInput/PickerInput.js +0 -222
- package/lib/es6/component/PickerInput/PickerInput.js.map +0 -1
- package/lib/es6/component/PickerInput/PickerInput.type.js +0 -2
- package/lib/es6/component/PickerInput/PickerInput.type.js.map +0 -1
- package/lib/es6/component/PickerInput/picker-input.shadow.css +0 -11
- package/lib/es6/component/TimePicker/TimePicker.js +0 -216
- package/lib/es6/component/TimePicker/TimePicker.js.map +0 -1
- package/lib/es6/component/TimePicker/TimePicker.type.js +0 -2
- package/lib/es6/component/TimePicker/TimePicker.type.js.map +0 -1
- package/lib/es6/component/TimePicker/time-picker.shadow.css +0 -34
- package/lib/es6/entity/TimePickerEntity.js +0 -66
- package/lib/es6/entity/TimePickerEntity.js.map +0 -1
- package/lib/esm/component/PickerFormat/PickerFormat.mjs +0 -84
- package/lib/esm/component/PickerFormat/picker-format.shadow.css +0 -61
- package/lib/esm/component/PickerInput/PickerInput.mjs +0 -227
- package/lib/esm/component/PickerInput/picker-input.shadow.css +0 -11
- package/lib/esm/component/TimePicker/TimePicker.mjs +0 -220
- package/lib/esm/component/TimePicker/time-picker.shadow.css +0 -34
- package/lib/esm/entity/TimePickerEntity.mjs +0 -65
- package/lib/types/component/PickerFormat/PickerFormat.d.ts +0 -17
- package/lib/types/component/PickerFormat/PickerFormat.type.d.ts +0 -16
- package/lib/types/component/PickerInput/PickerInput.d.ts +0 -54
- package/lib/types/component/PickerInput/PickerInput.type.d.ts +0 -13
- package/lib/types/component/TimePicker/TimePicker.d.ts +0 -3
- package/lib/types/component/TimePicker/TimePicker.type.d.ts +0 -50
- package/lib/types/entity/TimePickerEntity.d.ts +0 -22
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +0 -114
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
10
|
+
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
11
|
+
import Input from "@semcore/input";
|
|
12
|
+
import Select from "@semcore/select";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { intOrDefault, withLeadingZero } from "./TimePicker.mjs";
|
|
15
|
+
var _excluded = ["styles", "step", "onSelect", "time", "size", "disabled", "onVisibleChange"];
|
|
16
|
+
var MAP_FIELD_TO_TIME = {
|
|
17
|
+
hours: 0,
|
|
18
|
+
minutes: 1
|
|
19
|
+
};
|
|
20
|
+
var MAP_SIZE_SELECT = {
|
|
21
|
+
m: "m",
|
|
22
|
+
l: "l"
|
|
23
|
+
};
|
|
24
|
+
function getOptions(min, max) {
|
|
25
|
+
var step = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
|
|
26
|
+
var length = Number(((max + 1 - min) / step).toFixed(0));
|
|
27
|
+
var options = Array(length).fill("");
|
|
28
|
+
var numValue = min;
|
|
29
|
+
return options.map(function(_i, index) {
|
|
30
|
+
numValue = index === 0 ? numValue : numValue + step;
|
|
31
|
+
var value = withLeadingZero(String(numValue));
|
|
32
|
+
return /* @__PURE__ */ React.createElement(Select.Option, {
|
|
33
|
+
value,
|
|
34
|
+
key: value
|
|
35
|
+
}, value);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
var defaultPopperOffset = [-8, 4];
|
|
39
|
+
var ItemPicker = /* @__PURE__ */ (function(_Component) {
|
|
40
|
+
function ItemPicker2() {
|
|
41
|
+
var _this;
|
|
42
|
+
_classCallCheck(this, ItemPicker2);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = _callSuper(this, ItemPicker2, [].concat(args));
|
|
47
|
+
_defineProperty(_this, "inputRef", /* @__PURE__ */ React.createRef());
|
|
48
|
+
_defineProperty(_this, "state", {
|
|
49
|
+
dirtyValue: void 0,
|
|
50
|
+
visible: false
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(_this, "parseValueWithMinMax", function(value) {
|
|
53
|
+
var _this$minMax = _this.minMax(), _this$minMax2 = _slicedToArray(_this$minMax, 2), min = _this$minMax2[0], max = _this$minMax2[1];
|
|
54
|
+
return String(Math.max(min, Math.min(max, value)));
|
|
55
|
+
});
|
|
56
|
+
_defineProperty(_this, "handleChange", function(value, event) {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
var numberValue = intOrDefault(Number(value), Number.NaN);
|
|
59
|
+
if (!Number.isNaN(numberValue)) {
|
|
60
|
+
_this.setState({
|
|
61
|
+
dirtyValue: value.slice(-2)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(_this, "handleBlur", function(event) {
|
|
66
|
+
return _this.submitChanges(event);
|
|
67
|
+
});
|
|
68
|
+
_defineProperty(_this, "handleKeyDown", function() {
|
|
69
|
+
});
|
|
70
|
+
_defineProperty(_this, "handleSelect", function(value, event) {
|
|
71
|
+
_this.dispatchOnChange(value, event);
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(_this, "handleVisibleChange", function(visible) {
|
|
74
|
+
return _this.setState({
|
|
75
|
+
visible
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
_defineProperty(_this, "getAriaLabel", function() {
|
|
79
|
+
var getI18nText = _this.asProps._getI18nText;
|
|
80
|
+
if (_this.field === "hours") return getI18nText("hours");
|
|
81
|
+
if (_this.field === "minutes") return getI18nText("minutes");
|
|
82
|
+
return void 0;
|
|
83
|
+
});
|
|
84
|
+
return _this;
|
|
85
|
+
}
|
|
86
|
+
_inherits(ItemPicker2, _Component);
|
|
87
|
+
return _createClass(ItemPicker2, [{
|
|
88
|
+
key: "minMax",
|
|
89
|
+
value: function minMax() {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "dispatchOnChange",
|
|
94
|
+
value: function dispatchOnChange(value, event) {
|
|
95
|
+
this.setState({
|
|
96
|
+
dirtyValue: void 0
|
|
97
|
+
});
|
|
98
|
+
this.asProps.$onValueChange(value, this.field, event);
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "submitChanges",
|
|
102
|
+
value: function submitChanges(event) {
|
|
103
|
+
var dirtyValue = this.state.dirtyValue;
|
|
104
|
+
if (dirtyValue !== void 0) {
|
|
105
|
+
if (dirtyValue) dirtyValue = this.parseValueWithMinMax(dirtyValue);
|
|
106
|
+
this.dispatchOnChange(dirtyValue, event);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "render",
|
|
111
|
+
value: function render() {
|
|
112
|
+
var _ref = this.asProps, _ref2;
|
|
113
|
+
var SPickerInput = Select.Trigger;
|
|
114
|
+
var _this$asProps = this.asProps, styles = _this$asProps.styles, step = _this$asProps.step, onSelect = _this$asProps.onSelect, time = _this$asProps.time, size = _this$asProps.size, disabled = _this$asProps.disabled, onVisibleChange = _this$asProps.onVisibleChange, other = _objectWithoutProperties(_this$asProps, _excluded);
|
|
115
|
+
var _this$state = this.state, dirtyValue = _this$state.dirtyValue, visible = _this$state.visible;
|
|
116
|
+
var timeValue = time[MAP_FIELD_TO_TIME[this.field]];
|
|
117
|
+
var value = dirtyValue === void 0 ? timeValue : dirtyValue;
|
|
118
|
+
var _this$minMax3 = this.minMax(), _this$minMax4 = _slicedToArray(_this$minMax3, 2), min = _this$minMax4[0], max = _this$minMax4[1];
|
|
119
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(Select, _ref2.cn("Select", _objectSpread(_objectSpread({}, other), {}, {
|
|
120
|
+
"interaction": "focus",
|
|
121
|
+
"size": size ? MAP_SIZE_SELECT[size] : false,
|
|
122
|
+
"onChange": callAllEventHandlers(onSelect, this.handleSelect),
|
|
123
|
+
"onVisibleChange": callAllEventHandlers(onVisibleChange, this.handleVisibleChange),
|
|
124
|
+
"visible": visible,
|
|
125
|
+
"value": timeValue
|
|
126
|
+
})), /* @__PURE__ */ React.createElement(SPickerInput, _ref2.cn("SPickerInput", _objectSpread({}, assignProps({
|
|
127
|
+
"tag": Input.Value,
|
|
128
|
+
"ref": this.inputRef,
|
|
129
|
+
"inputMode": "numeric",
|
|
130
|
+
"size": size,
|
|
131
|
+
"disabled": disabled,
|
|
132
|
+
"neighborLocation": false,
|
|
133
|
+
"value": value,
|
|
134
|
+
"aria-label": this.getAriaLabel(),
|
|
135
|
+
"onChange": this.handleChange,
|
|
136
|
+
"onBlur": this.handleBlur,
|
|
137
|
+
"onKeyDown": this.handleKeyDown
|
|
138
|
+
}, _ref)))), /* @__PURE__ */ React.createElement(Select.Menu, {
|
|
139
|
+
hMax: 180
|
|
140
|
+
}, getOptions(min, max, step)));
|
|
141
|
+
}
|
|
142
|
+
}]);
|
|
143
|
+
})(Component);
|
|
144
|
+
_defineProperty(ItemPicker, "defaultProps", {
|
|
145
|
+
placeholder: "00",
|
|
146
|
+
offset: defaultPopperOffset
|
|
147
|
+
});
|
|
148
|
+
var Hours = /* @__PURE__ */ (function(_ItemPicker2) {
|
|
149
|
+
function Hours2() {
|
|
150
|
+
var _this2;
|
|
151
|
+
_classCallCheck(this, Hours2);
|
|
152
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
153
|
+
args[_key2] = arguments[_key2];
|
|
154
|
+
}
|
|
155
|
+
_this2 = _callSuper(this, Hours2, [].concat(args));
|
|
156
|
+
_defineProperty(_this2, "field", "hours");
|
|
157
|
+
_defineProperty(_this2, "handleKeyDown", function(event) {
|
|
158
|
+
var currentTarget = event.currentTarget;
|
|
159
|
+
if (event.key === "Enter") {
|
|
160
|
+
_this2.submitChanges(event);
|
|
161
|
+
}
|
|
162
|
+
if (event.key === "ArrowRight") {
|
|
163
|
+
if (currentTarget.selectionStart >= currentTarget.value.length && currentTarget.selectionStart === currentTarget.selectionEnd) {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
_this2.focusNext();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return _this2;
|
|
170
|
+
}
|
|
171
|
+
_inherits(Hours2, _ItemPicker2);
|
|
172
|
+
return _createClass(Hours2, [{
|
|
173
|
+
key: "minMax",
|
|
174
|
+
value: function minMax() {
|
|
175
|
+
var is12Hour = this.asProps.is12Hour;
|
|
176
|
+
if (is12Hour) {
|
|
177
|
+
return [1, 12];
|
|
178
|
+
} else {
|
|
179
|
+
return [0, 23];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "focusNext",
|
|
184
|
+
value: function focusNext() {
|
|
185
|
+
if (this.asProps.minutesInputRef.current) {
|
|
186
|
+
this.setState({
|
|
187
|
+
visible: false
|
|
188
|
+
});
|
|
189
|
+
this.asProps.minutesInputRef.current.focus();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
key: "componentDidUpdate",
|
|
194
|
+
value: function componentDidUpdate(_prevProps, prevState) {
|
|
195
|
+
var dirtyValue = this.state.dirtyValue;
|
|
196
|
+
if (prevState.dirtyValue === void 0 || dirtyValue === void 0) return;
|
|
197
|
+
if (prevState.dirtyValue.length === 1 && dirtyValue.length === 2) {
|
|
198
|
+
this.focusNext();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}]);
|
|
202
|
+
})(ItemPicker);
|
|
203
|
+
_defineProperty(Hours, "defaultProps", function(_ref3) {
|
|
204
|
+
var size = _ref3.size;
|
|
205
|
+
return _objectSpread(_objectSpread({}, ItemPicker.defaultProps), {}, {
|
|
206
|
+
ml: size === "l" ? 3 : void 0
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
var Minutes = /* @__PURE__ */ (function(_ItemPicker3) {
|
|
210
|
+
function Minutes2() {
|
|
211
|
+
var _this3;
|
|
212
|
+
_classCallCheck(this, Minutes2);
|
|
213
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
214
|
+
args[_key3] = arguments[_key3];
|
|
215
|
+
}
|
|
216
|
+
_this3 = _callSuper(this, Minutes2, [].concat(args));
|
|
217
|
+
_defineProperty(_this3, "field", "minutes");
|
|
218
|
+
_defineProperty(_this3, "handleKeyDown", function(event) {
|
|
219
|
+
var currentTarget = event.currentTarget;
|
|
220
|
+
if (event.key === "ArrowLeft") {
|
|
221
|
+
if (currentTarget.selectionStart <= 0 && currentTarget.selectionStart === currentTarget.selectionEnd) {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
_this3.focusPrev();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (event.key === "Backspace") {
|
|
227
|
+
if (currentTarget.value.length === 0) {
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
_this3.focusPrev();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (event.key === "Enter") _this3.submitChanges(event);
|
|
233
|
+
});
|
|
234
|
+
return _this3;
|
|
235
|
+
}
|
|
236
|
+
_inherits(Minutes2, _ItemPicker3);
|
|
237
|
+
return _createClass(Minutes2, [{
|
|
238
|
+
key: "minMax",
|
|
239
|
+
value: function minMax() {
|
|
240
|
+
return [0, 59];
|
|
241
|
+
}
|
|
242
|
+
}, {
|
|
243
|
+
key: "focusPrev",
|
|
244
|
+
value: function focusPrev() {
|
|
245
|
+
if (this.asProps.hoursInputRef.current) {
|
|
246
|
+
this.setState({
|
|
247
|
+
visible: false
|
|
248
|
+
});
|
|
249
|
+
this.asProps.hoursInputRef.current.focus();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}]);
|
|
253
|
+
})(ItemPicker);
|
|
254
|
+
_defineProperty(Minutes, "defaultProps", function(_ref4) {
|
|
255
|
+
var size = _ref4.size;
|
|
256
|
+
return _objectSpread(_objectSpread({}, ItemPicker.defaultProps), {}, {
|
|
257
|
+
mr: size === "l" ? 3 : void 0
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
export {
|
|
261
|
+
Hours,
|
|
262
|
+
Minutes
|
|
263
|
+
};
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
|
|
9
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
10
|
+
import { Box } from "@semcore/flex-box";
|
|
11
|
+
import Input from "@semcore/input";
|
|
12
|
+
import React from "react";
|
|
13
|
+
import TimePickerFormat from "./PickerFormat.mjs";
|
|
14
|
+
import { Minutes, Hours } from "./PickerInput.mjs";
|
|
15
|
+
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
16
|
+
/*!__reshadow-styles__:"./style/time-picker.shadow.css"*/
|
|
17
|
+
var style = (
|
|
18
|
+
/*__reshadow_css_start__*/
|
|
19
|
+
(sstyled.insert(
|
|
20
|
+
/*__inner_css_start__*/
|
|
21
|
+
".___STimePicker_1ecr3_gg_{position:relative;width:auto;outline:0}.___STimePicker_1ecr3_gg_ .___SPickerInput_1ecr3_gg_{box-sizing:content-box;text-align:center;z-index:1;height:1.5em}.___STimePicker_1ecr3_gg_ .___SPickerInput_1ecr3_gg_.__placeholder_1ecr3_gg_{text-overflow:initial}.___STimePicker_1ecr3_gg_ .___SPickerInput_1ecr3_gg_:focus{outline:0;background-color:var(--intergalactic-bg-highlight-focus, rgba(1, 79, 255, 0.116))}@supports (color:color(display-p3 0 0 0%)){.___STimePicker_1ecr3_gg_ .___SPickerInput_1ecr3_gg_:focus{background-color:var(--intergalactic-bg-highlight-focus, rgba(1, 79, 255, 0.116))}@media (color-gamut:p3){.___STimePicker_1ecr3_gg_ .___SPickerInput_1ecr3_gg_:focus{background-color:var(--intergalactic-bg-highlight-focus, color(display-p3 0.12361 0.30547 0.96332 / 0.116))}}}.___SPickerFormat_1ecr3_gg_,.___STimePicker_1ecr3_gg_.__disabled_1ecr3_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));cursor:default}@supports (color:color(display-p3 0 0 0%)){.___STimePicker_1ecr3_gg_.__disabled_1ecr3_gg_{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___STimePicker_1ecr3_gg_.__disabled_1ecr3_gg_{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SPickerInput_1ecr3_gg_._size_l_1ecr3_gg_,.___SPickerInput_1ecr3_gg_._size_m_1ecr3_gg_{width:19px;margin:0 var(--intergalactic-spacing-2x, 8px);padding:0}.___SPickerInput_1ecr3_gg_._size_l_1ecr3_gg_{width:21px}.___SPickerFormat_1ecr3_gg_{flex-shrink:0;position:relative;display:inline-flex;padding:0;white-space:nowrap;font-family:inherit;font-weight:var(--intergalactic-medium, 500);line-height:normal;text-decoration:none;align-items:center;border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));border-radius:0 var(--intergalactic-control-rounded, 6px) var(--intergalactic-control-rounded, 6px)0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background-color:var(--intergalactic-bg-secondary-neutral, rgb(248, 249, 248))}@supports (color:color(display-p3 0 0 0%)){.___SPickerFormat_1ecr3_gg_{border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SPickerFormat_1ecr3_gg_{border:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161));color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}@media (hover:hover){.___SPickerFormat_1ecr3_gg_:hover{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));background-color:var(--intergalactic-bg-secondary-neutral-hover, rgb(241, 242, 242))}@supports (color:color(display-p3 0 0 0%)){.___SPickerFormat_1ecr3_gg_:hover{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SPickerFormat_1ecr3_gg_:hover{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}}.___SPickerFormat_1ecr3_gg_.__active_1ecr3_gg_,.___SPickerFormat_1ecr3_gg_:active{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));background-color:var(--intergalactic-bg-secondary-neutral-active, rgb(234, 235, 235))}@supports (color:color(display-p3 0 0 0%)){.___SPickerFormat_1ecr3_gg_.__active_1ecr3_gg_,.___SPickerFormat_1ecr3_gg_:active{color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SPickerFormat_1ecr3_gg_.__active_1ecr3_gg_,.___SPickerFormat_1ecr3_gg_:active{color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SPickerFormat_1ecr3_gg_._size_m_1ecr3_gg_{height:var(--intergalactic-form-control-m, 28px);font-size:var(--intergalactic-fs-200, 14px);margin:0-1px 0 0}.___SPickerFormat_1ecr3_gg_._size_m_1ecr3_gg_ .___SPickerFormatText_1ecr3_gg_{margin:0 var(--intergalactic-spacing-2x, 8px)}.___SPickerFormat_1ecr3_gg_._size_l_1ecr3_gg_{height:var(--intergalactic-form-control-l, 40px);font-size:var(--intergalactic-fs-300, 16px);margin:0-1px 0 0}.___SPickerFormat_1ecr3_gg_._size_l_1ecr3_gg_ .___SPickerFormatText_1ecr3_gg_{margin:0 var(--intergalactic-spacing-3x, 12px)}.___SPickerFormat_1ecr3_gg_.__disabled_1ecr3_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none;border-color:transparent transparent transparent var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@supports (color:color(display-p3 0 0 0%)){.___SPickerFormat_1ecr3_gg_.__disabled_1ecr3_gg_{border-color:transparent transparent transparent var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SPickerFormat_1ecr3_gg_.__disabled_1ecr3_gg_{border-color:transparent transparent transparent var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___STimePickerSeparator_1ecr3_gg_{color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___STimePickerSeparator_1ecr3_gg_.__disabled_1ecr3_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);pointer-events:none}",
|
|
22
|
+
/*__inner_css_end__*/
|
|
23
|
+
"1ecr3_gg_"
|
|
24
|
+
), /*__reshadow_css_end__*/
|
|
25
|
+
{
|
|
26
|
+
"__STimePicker": "___STimePicker_1ecr3_gg_",
|
|
27
|
+
"_disabled": "__disabled_1ecr3_gg_",
|
|
28
|
+
"__SPickerInput": "___SPickerInput_1ecr3_gg_",
|
|
29
|
+
"_size_m": "_size_m_1ecr3_gg_",
|
|
30
|
+
"_size_l": "_size_l_1ecr3_gg_",
|
|
31
|
+
"__SPickerFormat": "___SPickerFormat_1ecr3_gg_",
|
|
32
|
+
"__STimePickerSeparator": "___STimePickerSeparator_1ecr3_gg_",
|
|
33
|
+
"_placeholder": "__placeholder_1ecr3_gg_",
|
|
34
|
+
"_active": "__active_1ecr3_gg_",
|
|
35
|
+
"__SPickerFormatText": "___SPickerFormatText_1ecr3_gg_"
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
var MAP_MERIDIEM = {
|
|
39
|
+
AM: "PM",
|
|
40
|
+
PM: "AM"
|
|
41
|
+
};
|
|
42
|
+
var MAP_FIELD_TO_TIME = {
|
|
43
|
+
hours: 0,
|
|
44
|
+
minutes: 1
|
|
45
|
+
};
|
|
46
|
+
function intOrDefault(value) {
|
|
47
|
+
var def = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
48
|
+
var number = Number.parseInt(value);
|
|
49
|
+
return Number.isNaN(number) ? def : number;
|
|
50
|
+
}
|
|
51
|
+
function withLeadingZero(value) {
|
|
52
|
+
value = String(value);
|
|
53
|
+
if (value.length === 1) return "0".concat(value);
|
|
54
|
+
return String(value);
|
|
55
|
+
}
|
|
56
|
+
function meridiemByHours(hours) {
|
|
57
|
+
return hours >= 12 ? "PM" : "AM";
|
|
58
|
+
}
|
|
59
|
+
function formatHoursTo12(hours) {
|
|
60
|
+
var nHours = intOrDefault(hours, Number.NaN);
|
|
61
|
+
if (Number.isNaN(nHours)) return hours;
|
|
62
|
+
if (nHours === 0) return 12;
|
|
63
|
+
if (nHours > 12) return nHours - 12;
|
|
64
|
+
return hours;
|
|
65
|
+
}
|
|
66
|
+
function formatHoursTo24(hours, meridiem) {
|
|
67
|
+
var nHours = intOrDefault(hours, Number.NaN);
|
|
68
|
+
if (Number.isNaN(nHours)) return hours;
|
|
69
|
+
if (meridiem === "AM") {
|
|
70
|
+
if (nHours === 12) return 0;
|
|
71
|
+
}
|
|
72
|
+
if (meridiem === "PM") {
|
|
73
|
+
if (nHours < 12) return nHours + 12;
|
|
74
|
+
}
|
|
75
|
+
return hours;
|
|
76
|
+
}
|
|
77
|
+
var TimePickerRoot = /* @__PURE__ */ (function(_Component) {
|
|
78
|
+
function TimePickerRoot2() {
|
|
79
|
+
var _this;
|
|
80
|
+
_classCallCheck(this, TimePickerRoot2);
|
|
81
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
82
|
+
args[_key] = arguments[_key];
|
|
83
|
+
}
|
|
84
|
+
_this = _callSuper(this, TimePickerRoot2, [].concat(args));
|
|
85
|
+
_defineProperty(_this, "hoursInputRef", /* @__PURE__ */ React.createRef());
|
|
86
|
+
_defineProperty(_this, "minutesInputRef", /* @__PURE__ */ React.createRef());
|
|
87
|
+
_defineProperty(_this, "_lastMeridiem", "AM");
|
|
88
|
+
_defineProperty(_this, "handleValueChange", function(value, field, event) {
|
|
89
|
+
var is12Hour = _this.asProps.is12Hour;
|
|
90
|
+
var _this2 = _this, meridiem = _this2.meridiem;
|
|
91
|
+
var time;
|
|
92
|
+
if (field) {
|
|
93
|
+
time = _this.value.split(":");
|
|
94
|
+
time[MAP_FIELD_TO_TIME[field]] = value;
|
|
95
|
+
} else {
|
|
96
|
+
time = value.split(":");
|
|
97
|
+
}
|
|
98
|
+
var _time = time, _time2 = _slicedToArray(_time, 2), _time2$ = _time2[0], hours = _time2$ === void 0 ? "" : _time2$, _time2$2 = _time2[1], minutes = _time2$2 === void 0 ? "" : _time2$2;
|
|
99
|
+
if (is12Hour) hours = String(formatHoursTo12(hours));
|
|
100
|
+
value = _this.timeToValue([hours, minutes], meridiem);
|
|
101
|
+
_this.handlers.value(value, event);
|
|
102
|
+
});
|
|
103
|
+
_defineProperty(_this, "handleMeridiemClick", function(event) {
|
|
104
|
+
var is12Hour = _this.asProps.is12Hour;
|
|
105
|
+
var _this3 = _this, value = _this3.value, meridiem = _this3.meridiem;
|
|
106
|
+
var _value$split = value.split(":"), _value$split2 = _slicedToArray(_value$split, 2), _value$split2$ = _value$split2[0], hours = _value$split2$ === void 0 ? "" : _value$split2$, _value$split2$2 = _value$split2[1], minutes = _value$split2$2 === void 0 ? "" : _value$split2$2;
|
|
107
|
+
if (is12Hour) hours = String(formatHoursTo12(hours));
|
|
108
|
+
value = _this.timeToValue([hours, minutes], MAP_MERIDIEM[meridiem]);
|
|
109
|
+
_this.handlers.value(value, event);
|
|
110
|
+
});
|
|
111
|
+
_defineProperty(_this, "_getHoursAndMinutesProps", function() {
|
|
112
|
+
var _this$asProps = _this.asProps, is12Hour = _this$asProps.is12Hour, size = _this$asProps.size, disabled = _this$asProps.disabled, getI18nText = _this$asProps.getI18nText;
|
|
113
|
+
var time = _this.valueToTime(_this.value);
|
|
114
|
+
return {
|
|
115
|
+
time,
|
|
116
|
+
size,
|
|
117
|
+
is12Hour,
|
|
118
|
+
disabled,
|
|
119
|
+
$onValueChange: _this.handleValueChange,
|
|
120
|
+
minutesInputRef: _this.minutesInputRef,
|
|
121
|
+
hoursInputRef: _this.hoursInputRef,
|
|
122
|
+
_getI18nText: getI18nText
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
_defineProperty(_this, "getHoursProps", function() {
|
|
126
|
+
return _objectSpread(_objectSpread({}, _this._getHoursAndMinutesProps()), {}, {
|
|
127
|
+
ref: _this.hoursInputRef
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
_defineProperty(_this, "getMinutesProps", function() {
|
|
131
|
+
return _objectSpread(_objectSpread({}, _this._getHoursAndMinutesProps()), {}, {
|
|
132
|
+
ref: _this.minutesInputRef
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
return _this;
|
|
136
|
+
}
|
|
137
|
+
_inherits(TimePickerRoot2, _Component);
|
|
138
|
+
return _createClass(TimePickerRoot2, [{
|
|
139
|
+
key: "uncontrolledProps",
|
|
140
|
+
value: (
|
|
141
|
+
// default AM
|
|
142
|
+
(function uncontrolledProps() {
|
|
143
|
+
return {
|
|
144
|
+
value: null,
|
|
145
|
+
title: null
|
|
146
|
+
};
|
|
147
|
+
})
|
|
148
|
+
)
|
|
149
|
+
}, {
|
|
150
|
+
key: "componentDidMount",
|
|
151
|
+
value: function componentDidMount() {
|
|
152
|
+
var _document$querySelect;
|
|
153
|
+
var _this$asProps2 = this.asProps, id = _this$asProps2.id, ariaDescribedBy = _this$asProps2["aria-describedby"];
|
|
154
|
+
var selector = "[for=".concat(id, "]");
|
|
155
|
+
var titleElement = (_document$querySelect = document.querySelector(selector)) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("#".concat(ariaDescribedBy));
|
|
156
|
+
if (titleElement) {
|
|
157
|
+
this.handlers.title(titleElement.textContent);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
key: "value",
|
|
162
|
+
get: function get() {
|
|
163
|
+
var value = this.asProps.value;
|
|
164
|
+
return value === null || value === void 0 ? ":" : value;
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "meridiem",
|
|
168
|
+
get: function get() {
|
|
169
|
+
var value = this.asProps.value;
|
|
170
|
+
var _value$split3 = value.split(":"), _value$split4 = _slicedToArray(_value$split3, 1), _value$split4$ = _value$split4[0], hours = _value$split4$ === void 0 ? "" : _value$split4$;
|
|
171
|
+
var nHours = intOrDefault(hours, Number.NaN);
|
|
172
|
+
if (!Number.isNaN(nHours)) {
|
|
173
|
+
this._lastMeridiem = meridiemByHours(nHours);
|
|
174
|
+
}
|
|
175
|
+
return this._lastMeridiem;
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "valueToTime",
|
|
179
|
+
value: function valueToTime(value) {
|
|
180
|
+
var is12Hour = this.asProps.is12Hour;
|
|
181
|
+
var _value$split5 = value.split(":"), _value$split6 = _slicedToArray(_value$split5, 2), _value$split6$ = _value$split6[0], hours = _value$split6$ === void 0 ? "" : _value$split6$, _value$split6$2 = _value$split6[1], minutes = _value$split6$2 === void 0 ? "" : _value$split6$2;
|
|
182
|
+
if (is12Hour) hours = formatHoursTo12(hours);
|
|
183
|
+
hours = withLeadingZero(hours);
|
|
184
|
+
minutes = withLeadingZero(minutes);
|
|
185
|
+
return [hours, minutes];
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
key: "timeToValue",
|
|
189
|
+
value: function timeToValue(time, meridiem) {
|
|
190
|
+
var is12Hour = this.asProps.is12Hour;
|
|
191
|
+
var _time3 = _slicedToArray(time, 2), _time3$ = _time3[0], hours = _time3$ === void 0 ? "" : _time3$, _time3$2 = _time3[1], minutes = _time3$2 === void 0 ? "" : _time3$2;
|
|
192
|
+
hours = intOrDefault(hours, hours);
|
|
193
|
+
minutes = intOrDefault(minutes, minutes);
|
|
194
|
+
if (is12Hour) hours = formatHoursTo24(hours, meridiem);
|
|
195
|
+
return "".concat(hours, ":").concat(minutes);
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "getSeparatorProps",
|
|
199
|
+
value: function getSeparatorProps() {
|
|
200
|
+
return {
|
|
201
|
+
disabled: this.asProps.disabled,
|
|
202
|
+
hoursInputRef: this.hoursInputRef
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "getFormatProps",
|
|
207
|
+
value: function getFormatProps() {
|
|
208
|
+
var _this$asProps3 = this.asProps, size = _this$asProps3.size, disabled = _this$asProps3.disabled, disablePortal = _this$asProps3.disablePortal, getI18nText = _this$asProps3.getI18nText;
|
|
209
|
+
return {
|
|
210
|
+
size,
|
|
211
|
+
disabled,
|
|
212
|
+
disablePortal,
|
|
213
|
+
meridiem: this.meridiem,
|
|
214
|
+
onClick: this.handleMeridiemClick,
|
|
215
|
+
getI18nText
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
key: "render",
|
|
220
|
+
value: function render() {
|
|
221
|
+
var _ref = this.asProps, _ref3;
|
|
222
|
+
var STimePicker = Input;
|
|
223
|
+
var _this$asProps4 = this.asProps, styles = _this$asProps4.styles, Children = _this$asProps4.Children, value = _this$asProps4.value, is12Hour = _this$asProps4.is12Hour, getI18nText = _this$asProps4.getI18nText, title = _this$asProps4.title;
|
|
224
|
+
var _this$valueToTime = this.valueToTime(this.value), _this$valueToTime2 = _slicedToArray(_this$valueToTime, 2), hours = _this$valueToTime2[0], minutes = _this$valueToTime2[1];
|
|
225
|
+
var label = value ? "".concat(title, " ").concat(getI18nText("title", {
|
|
226
|
+
time: "".concat(hours, ":").concat(withLeadingZero(minutes)),
|
|
227
|
+
meridiem: is12Hour ? this.meridiem : ""
|
|
228
|
+
})) : "".concat(title, " ").concat(getI18nText("titleEmpty"));
|
|
229
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(STimePicker, _ref3.cn("STimePicker", _objectSpread({}, assignProps({
|
|
230
|
+
"role": "group",
|
|
231
|
+
"aria-label": label,
|
|
232
|
+
"__excludeProps": ["value", "title"]
|
|
233
|
+
}, _ref))), /* @__PURE__ */ React.createElement(Children, _ref3.cn("Children", {}))));
|
|
234
|
+
}
|
|
235
|
+
}]);
|
|
236
|
+
})(Component);
|
|
237
|
+
_defineProperty(TimePickerRoot, "displayName", "TimePicker");
|
|
238
|
+
_defineProperty(TimePickerRoot, "style", style);
|
|
239
|
+
_defineProperty(TimePickerRoot, "enhance", [i18nEnhance(localizedMessages)]);
|
|
240
|
+
_defineProperty(TimePickerRoot, "defaultProps", function(_ref5) {
|
|
241
|
+
var is12Hour = _ref5.is12Hour;
|
|
242
|
+
return {
|
|
243
|
+
defaultValue: "",
|
|
244
|
+
size: "m",
|
|
245
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TimePicker.Hours, null), /* @__PURE__ */ React.createElement(TimePicker.Separator, null), /* @__PURE__ */ React.createElement(TimePicker.Minutes, null), is12Hour && /* @__PURE__ */ React.createElement(TimePicker.Format, null)),
|
|
246
|
+
i18n: localizedMessages,
|
|
247
|
+
locale: "en",
|
|
248
|
+
defaultTitle: ""
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
var Separator = /* @__PURE__ */ (function(_Component2) {
|
|
252
|
+
function Separator2() {
|
|
253
|
+
var _this4;
|
|
254
|
+
_classCallCheck(this, Separator2);
|
|
255
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
256
|
+
args[_key2] = arguments[_key2];
|
|
257
|
+
}
|
|
258
|
+
_this4 = _callSuper(this, Separator2, [].concat(args));
|
|
259
|
+
_defineProperty(_this4, "handlerClick", function() {
|
|
260
|
+
if (_this4.asProps.hoursInputRef.current) {
|
|
261
|
+
var _this4$asProps$hoursI;
|
|
262
|
+
(_this4$asProps$hoursI = _this4.asProps.hoursInputRef.current) === null || _this4$asProps$hoursI === void 0 || _this4$asProps$hoursI.focus();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
return _this4;
|
|
266
|
+
}
|
|
267
|
+
_inherits(Separator2, _Component2);
|
|
268
|
+
return _createClass(Separator2, [{
|
|
269
|
+
key: "render",
|
|
270
|
+
value: function render() {
|
|
271
|
+
var _ref2 = this.asProps, _ref4;
|
|
272
|
+
var STimePickerSeparator = Box;
|
|
273
|
+
var styles = this.asProps.styles;
|
|
274
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(STimePickerSeparator, _ref4.cn("STimePickerSeparator", _objectSpread({}, assignProps({
|
|
275
|
+
"onClick": this.handlerClick,
|
|
276
|
+
"aria-hidden": "true"
|
|
277
|
+
}, _ref2))));
|
|
278
|
+
}
|
|
279
|
+
}]);
|
|
280
|
+
})(Component);
|
|
281
|
+
_defineProperty(Separator, "defaultProps", {
|
|
282
|
+
children: ":"
|
|
283
|
+
});
|
|
284
|
+
var TimePicker = createComponent(TimePickerRoot, {
|
|
285
|
+
Hours,
|
|
286
|
+
Minutes,
|
|
287
|
+
Separator,
|
|
288
|
+
Format: TimePickerFormat
|
|
289
|
+
});
|
|
290
|
+
export {
|
|
291
|
+
TimePicker as default,
|
|
292
|
+
formatHoursTo12,
|
|
293
|
+
formatHoursTo24,
|
|
294
|
+
intOrDefault,
|
|
295
|
+
meridiemByHours,
|
|
296
|
+
withLeadingZero
|
|
297
|
+
};
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { default as default2 } from "./
|
|
1
|
+
import { default as default2, formatHoursTo12, formatHoursTo24, intOrDefault, meridiemByHours, withLeadingZero } from "./TimePicker.mjs";
|
|
2
2
|
export {
|
|
3
|
-
default2 as default
|
|
3
|
+
default2 as default,
|
|
4
|
+
formatHoursTo12,
|
|
5
|
+
formatHoursTo24,
|
|
6
|
+
intOrDefault,
|
|
7
|
+
meridiemByHours,
|
|
8
|
+
withLeadingZero
|
|
4
9
|
};
|