@yeverlibs/ds 1.1.21 → 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 CHANGED
@@ -7165,6 +7165,7 @@ var TimeInput = ({
7165
7165
  return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
7166
7166
  };
7167
7167
  const initialTime = formatMinutesToTime(defaultValue ?? 0);
7168
+ const value = reactHookForm.useWatch({ name, defaultValue: initialTime });
7168
7169
  React107.useEffect(() => {
7169
7170
  if (defaultValue !== void 0 && defaultValue !== null) {
7170
7171
  setValue(name, formatMinutesToTime(defaultValue));
@@ -7183,6 +7184,7 @@ var TimeInput = ({
7183
7184
  return formatMinutesToTime(totalMinutes);
7184
7185
  };
7185
7186
  const formatDescription = (time) => {
7187
+ if (!time) return "0 minutos";
7186
7188
  const [hours, minutes] = time.split(":").map(Number);
7187
7189
  const totalMinutes = hours * 60 + minutes;
7188
7190
  if (hours > 0) {
@@ -7195,23 +7197,23 @@ var TimeInput = ({
7195
7197
  label,
7196
7198
  tooltip ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { text: tooltip }) : null
7197
7199
  ] }),
7198
- /* @__PURE__ */ jsxRuntime.jsx(
7199
- reactHookForm.Controller,
7200
- {
7201
- name,
7202
- control,
7203
- defaultValue: initialTime,
7204
- render: ({ field }) => {
7205
- const handleIncrement = () => {
7206
- const newTime = adjustTime(field.value, step, maxTime);
7207
- setValue(name, newTime);
7208
- };
7209
- const handleDecrement = () => {
7210
- const newTime = adjustTime(field.value, -step, maxTime);
7211
- setValue(name, newTime);
7212
- };
7213
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-8", children: [
7214
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-fit items-center", children: [
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: [
7215
7217
  /* @__PURE__ */ jsxRuntime.jsx(
7216
7218
  "button",
7217
7219
  {
@@ -7257,16 +7259,16 @@ var TimeInput = ({
7257
7259
  ) })
7258
7260
  }
7259
7261
  )
7260
- ] }),
7261
- description && /* @__PURE__ */ jsxRuntime.jsxs(FeedbackBadge, { $variant: "default", children: [
7262
- "Enviado ",
7263
- formatDescription(field.value || "00:00"),
7264
- " ap\xF3s o abandono"
7265
- ] })
7266
- ] });
7262
+ ] });
7263
+ }
7267
7264
  }
7268
- }
7269
- )
7265
+ ) }),
7266
+ description && /* @__PURE__ */ jsxRuntime.jsxs(FeedbackBadge, { $variant: "default", children: [
7267
+ "Enviado ",
7268
+ formatDescription(value),
7269
+ " ap\xF3s o abandono"
7270
+ ] })
7271
+ ] })
7270
7272
  ] });
7271
7273
  };
7272
7274
  var formatTime = (time) => {