@ctlyst.id/internal-ui 4.0.3 → 4.1.0
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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -5342,6 +5342,12 @@ var useTimescape = (options = {}) => {
|
|
5342
5342
|
|
5343
5343
|
// src/components/time-input/components/index.tsx
|
5344
5344
|
import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs29 } from "react/jsx-runtime";
|
5345
|
+
var timeDigitFormat = (number) => {
|
5346
|
+
if (number.toString().length === 1) {
|
5347
|
+
return `0${number}`;
|
5348
|
+
}
|
5349
|
+
return number;
|
5350
|
+
};
|
5345
5351
|
var Time = class {
|
5346
5352
|
constructor(hours, minutes, seconds) {
|
5347
5353
|
__publicField(this, "hours");
|
@@ -5352,9 +5358,13 @@ var Time = class {
|
|
5352
5358
|
this.seconds = seconds != null ? seconds : 0;
|
5353
5359
|
}
|
5354
5360
|
toString() {
|
5355
|
-
return `${this.hours}:${this.minutes}:${this.seconds}`;
|
5361
|
+
return `${timeDigitFormat(this.hours)}:${timeDigitFormat(this.minutes)}:${timeDigitFormat(this.seconds)}`;
|
5356
5362
|
}
|
5357
5363
|
};
|
5364
|
+
var timeFromString = (timeString) => {
|
5365
|
+
const [hours, minutes, seconds] = timeString.split(":");
|
5366
|
+
return new Time(Number(hours), Number(minutes), Number(seconds));
|
5367
|
+
};
|
5358
5368
|
var InputTimeArea = forwardRef12((props, ref) => {
|
5359
5369
|
return /* @__PURE__ */ jsx63(
|
5360
5370
|
Input3,
|
@@ -8091,6 +8101,7 @@ export {
|
|
8091
8101
|
selectStyles,
|
8092
8102
|
theme4 as theme,
|
8093
8103
|
themeSelect,
|
8104
|
+
timeFromString,
|
8094
8105
|
useAccordion,
|
8095
8106
|
useAccordionContext,
|
8096
8107
|
useAccordionItem,
|