@yeverlibs/ds 1.1.20 → 1.1.22
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 +28 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -50,7 +50,6 @@ var Link2__default = /*#__PURE__*/_interopDefault(Link2);
|
|
|
50
50
|
var Cookies__default = /*#__PURE__*/_interopDefault(Cookies);
|
|
51
51
|
var currency__default = /*#__PURE__*/_interopDefault(currency);
|
|
52
52
|
|
|
53
|
-
// src/lib/utils.ts
|
|
54
53
|
function cn(...inputs) {
|
|
55
54
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
56
55
|
}
|
|
@@ -7166,6 +7165,7 @@ var TimeInput = ({
|
|
|
7166
7165
|
return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
|
|
7167
7166
|
};
|
|
7168
7167
|
const initialTime = formatMinutesToTime(defaultValue ?? 0);
|
|
7168
|
+
const value = reactHookForm.useWatch({ name, defaultValue: initialTime });
|
|
7169
7169
|
React107.useEffect(() => {
|
|
7170
7170
|
if (defaultValue !== void 0 && defaultValue !== null) {
|
|
7171
7171
|
setValue(name, formatMinutesToTime(defaultValue));
|
|
@@ -7184,6 +7184,7 @@ var TimeInput = ({
|
|
|
7184
7184
|
return formatMinutesToTime(totalMinutes);
|
|
7185
7185
|
};
|
|
7186
7186
|
const formatDescription = (time) => {
|
|
7187
|
+
if (!time) return "0 minutos";
|
|
7187
7188
|
const [hours, minutes] = time.split(":").map(Number);
|
|
7188
7189
|
const totalMinutes = hours * 60 + minutes;
|
|
7189
7190
|
if (hours > 0) {
|
|
@@ -7196,23 +7197,23 @@ var TimeInput = ({
|
|
|
7196
7197
|
label,
|
|
7197
7198
|
tooltip ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { text: tooltip }) : null
|
|
7198
7199
|
] }),
|
|
7199
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
const
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
const
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7200
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-8", children: [
|
|
7201
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-fit items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7202
|
+
reactHookForm.Controller,
|
|
7203
|
+
{
|
|
7204
|
+
name,
|
|
7205
|
+
control,
|
|
7206
|
+
defaultValue: initialTime,
|
|
7207
|
+
render: ({ field }) => {
|
|
7208
|
+
const handleIncrement = () => {
|
|
7209
|
+
const newTime = adjustTime(field.value, step, maxTime);
|
|
7210
|
+
setValue(name, newTime);
|
|
7211
|
+
};
|
|
7212
|
+
const handleDecrement = () => {
|
|
7213
|
+
const newTime = adjustTime(field.value, -step, maxTime);
|
|
7214
|
+
setValue(name, newTime);
|
|
7215
|
+
};
|
|
7216
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7216
7217
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7217
7218
|
"button",
|
|
7218
7219
|
{
|
|
@@ -7258,16 +7259,16 @@ var TimeInput = ({
|
|
|
7258
7259
|
) })
|
|
7259
7260
|
}
|
|
7260
7261
|
)
|
|
7261
|
-
] })
|
|
7262
|
-
|
|
7263
|
-
"Enviado ",
|
|
7264
|
-
formatDescription(field.value || "00:00"),
|
|
7265
|
-
" ap\xF3s o abandono"
|
|
7266
|
-
] })
|
|
7267
|
-
] });
|
|
7262
|
+
] });
|
|
7263
|
+
}
|
|
7268
7264
|
}
|
|
7269
|
-
}
|
|
7270
|
-
|
|
7265
|
+
) }),
|
|
7266
|
+
description && /* @__PURE__ */ jsxRuntime.jsxs(FeedbackBadge, { $variant: "default", children: [
|
|
7267
|
+
"Enviado ",
|
|
7268
|
+
formatDescription(value),
|
|
7269
|
+
" ap\xF3s o abandono"
|
|
7270
|
+
] })
|
|
7271
|
+
] })
|
|
7271
7272
|
] });
|
|
7272
7273
|
};
|
|
7273
7274
|
var formatTime = (time) => {
|