@ikatec/nebula-react 1.0.21 → 1.0.23

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/dist/index.js CHANGED
@@ -4243,9 +4243,21 @@ var InputDateTimePickerSingle = ({
4243
4243
  return;
4244
4244
  }
4245
4245
  const [hour, minutes] = hourSlice.split(":");
4246
+ const padStart = (str, shouldPad = false) => {
4247
+ if (shouldPad) {
4248
+ return str.padStart(2, "0");
4249
+ }
4250
+ return str;
4251
+ };
4246
4252
  const normalizedTime = [
4247
- hour ? Math.min(Math.max(+hour, 0), 23).toString() : "",
4248
- minutes ? Math.min(Math.max(+minutes, 0), 59).toString() : ""
4253
+ hour ? padStart(
4254
+ Math.min(Math.max(+hour, 0), 23).toString(),
4255
+ hour.length === 2
4256
+ ) : "",
4257
+ minutes ? padStart(
4258
+ Math.min(Math.max(+minutes, 0), 59).toString(),
4259
+ minutes.length === 2
4260
+ ) : ""
4249
4261
  ].filter(Boolean).join(":");
4250
4262
  setInnerTimeValue(normalizedTime);
4251
4263
  const [dateStr] = text.split(DATA_TIME_SEPARATOR);
@@ -4298,9 +4310,7 @@ var InputDateTimePickerSingle = ({
4298
4310
  date,
4299
4311
  innerTimeValue
4300
4312
  );
4301
- if (!innerTimeValue) {
4302
- setTimeout(() => inputTimeRef.current?.focus(), 100);
4303
- }
4313
+ setTimeout(() => inputTimeRef.current?.focus(), 100);
4304
4314
  };
4305
4315
  const normalizedCalendarDate = React8.useMemo(() => {
4306
4316
  return dateFns.isValid(innerDate) ? innerDate : void 0;
package/dist/index.mjs CHANGED
@@ -4203,9 +4203,21 @@ var InputDateTimePickerSingle = ({
4203
4203
  return;
4204
4204
  }
4205
4205
  const [hour, minutes] = hourSlice.split(":");
4206
+ const padStart = (str, shouldPad = false) => {
4207
+ if (shouldPad) {
4208
+ return str.padStart(2, "0");
4209
+ }
4210
+ return str;
4211
+ };
4206
4212
  const normalizedTime = [
4207
- hour ? Math.min(Math.max(+hour, 0), 23).toString() : "",
4208
- minutes ? Math.min(Math.max(+minutes, 0), 59).toString() : ""
4213
+ hour ? padStart(
4214
+ Math.min(Math.max(+hour, 0), 23).toString(),
4215
+ hour.length === 2
4216
+ ) : "",
4217
+ minutes ? padStart(
4218
+ Math.min(Math.max(+minutes, 0), 59).toString(),
4219
+ minutes.length === 2
4220
+ ) : ""
4209
4221
  ].filter(Boolean).join(":");
4210
4222
  setInnerTimeValue(normalizedTime);
4211
4223
  const [dateStr] = text.split(DATA_TIME_SEPARATOR);
@@ -4258,9 +4270,7 @@ var InputDateTimePickerSingle = ({
4258
4270
  date,
4259
4271
  innerTimeValue
4260
4272
  );
4261
- if (!innerTimeValue) {
4262
- setTimeout(() => inputTimeRef.current?.focus(), 100);
4263
- }
4273
+ setTimeout(() => inputTimeRef.current?.focus(), 100);
4264
4274
  };
4265
4275
  const normalizedCalendarDate = useMemo(() => {
4266
4276
  return isValid(innerDate) ? innerDate : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikatec/nebula-react",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "React components",
5
5
  "publishConfig": {
6
6
  "access": "public"