Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
'use client';
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var getFormattedTime = require('./get-formatted-time/get-formatted-time.cjs');
function TimeValue({
value,
format = "24h",
amPmLabels = { am: "AM", pm: "PM" },
withSeconds = false
}) {
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: getFormattedTime.getFormattedTime({ value, format, amPmLabels, withSeconds }) });
}
TimeValue.displayName = "@mantine/dates/TimeValue";
exports.TimeValue = TimeValue;
//# sourceMappingURL=TimeValue.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TimeValue.cjs","sources":["../../../src/components/TimeValue/TimeValue.tsx"],"sourcesContent":["import type { TimePickerAmPmLabels, TimePickerFormat } from '../TimePicker';\nimport { getFormattedTime } from './get-formatted-time/get-formatted-time';\n\nexport interface TimeValueProps {\n /** Time to format */\n value: string | Date;\n\n /** Time format @default `'24h'` */\n format?: TimePickerFormat;\n\n /** AM/PM labels @default `{ am: 'AM', pm: 'PM' }` */\n amPmLabels?: TimePickerAmPmLabels;\n\n /** Determines whether seconds should be displayed @default `false` */\n withSeconds?: boolean;\n}\n\nexport function TimeValue({\n value,\n format = '24h',\n amPmLabels = { am: 'AM', pm: 'PM' },\n withSeconds = false,\n}: TimeValueProps) {\n return <>{getFormattedTime({ value, format, amPmLabels, withSeconds })}</>;\n}\n\nTimeValue.displayName = '@mantine/dates/TimeValue';\n"],"names":["jsx","Fragment"],"mappings":";;;;;;AAiBO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,SAAA,CAAU,CAAA;AAAA,CAAA,CACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA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;"}

View File

@@ -0,0 +1,31 @@
'use client';
'use strict';
var padTime = require('../../TimePicker/utils/pad-time/pad-time.cjs');
var splitTimeString = require('../../TimePicker/utils/split-time-string/split-time-string.cjs');
function getTimeFromDate(date, withSeconds) {
return `${date.getHours()}:${date.getMinutes()}${withSeconds ? `:${date.getSeconds()}` : ""}`;
}
function getFormattedTime({
value,
format,
amPmLabels,
withSeconds
}) {
const splitted = splitTimeString.splitTimeString(
typeof value === "string" ? value : getTimeFromDate(value, withSeconds)
);
if (splitted.hours === null || splitted.minutes === null) {
return null;
}
if (format === "24h") {
return `${padTime.padTime(splitted.hours)}:${padTime.padTime(splitted.minutes)}${withSeconds ? `:${padTime.padTime(splitted.seconds || 0)}` : ""}`;
}
const isPm = splitted.hours >= 12;
const hours = splitted.hours % 12 === 0 ? 12 : splitted.hours % 12;
return `${hours}:${padTime.padTime(splitted.minutes)}${withSeconds ? `:${padTime.padTime(splitted.seconds || 0)}` : ""} ${isPm ? amPmLabels.pm : amPmLabels.am}`;
}
exports.getFormattedTime = getFormattedTime;
//# sourceMappingURL=get-formatted-time.cjs.map

File diff suppressed because one or more lines are too long