@yeverlibs/ds 1.1.15 → 1.1.17
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 +26 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import ReactDOM from 'react-dom';
|
|
|
10
10
|
import Select from 'react-select';
|
|
11
11
|
import { isValid, format, parse, startOfMonth, subMonths, endOfMonth, subDays, startOfDay, endOfDay, startOfWeek, endOfWeek, addDays, isWithinInterval, isSameDay, addMonths } from 'date-fns';
|
|
12
12
|
import { ptBR } from 'date-fns/locale';
|
|
13
|
-
import { useFormContext, Controller, useForm, FormProvider
|
|
13
|
+
import { useFormContext, Controller, useForm, FormProvider } from 'react-hook-form';
|
|
14
14
|
import Link2 from 'next/link';
|
|
15
15
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
16
16
|
import { toast } from 'sonner';
|
|
@@ -20,6 +20,7 @@ import { ResponsivePie } from '@nivo/pie';
|
|
|
20
20
|
import Cookies from 'js-cookie';
|
|
21
21
|
import currency from 'currency.js';
|
|
22
22
|
|
|
23
|
+
// src/lib/utils.ts
|
|
23
24
|
function cn(...inputs) {
|
|
24
25
|
return twMerge(clsx(inputs));
|
|
25
26
|
}
|
|
@@ -7135,7 +7136,6 @@ var TimeInput = ({
|
|
|
7135
7136
|
return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
|
|
7136
7137
|
};
|
|
7137
7138
|
const initialTime = formatMinutesToTime(defaultValue ?? 0);
|
|
7138
|
-
const value = useWatch({ name, defaultValue: initialTime });
|
|
7139
7139
|
useEffect(() => {
|
|
7140
7140
|
if (defaultValue !== void 0 && defaultValue !== null) {
|
|
7141
7141
|
setValue(name, formatMinutesToTime(defaultValue));
|
|
@@ -7154,7 +7154,6 @@ var TimeInput = ({
|
|
|
7154
7154
|
return formatMinutesToTime(totalMinutes);
|
|
7155
7155
|
};
|
|
7156
7156
|
const formatDescription = (time) => {
|
|
7157
|
-
if (!time) return "0 minutos";
|
|
7158
7157
|
const [hours, minutes] = time.split(":").map(Number);
|
|
7159
7158
|
const totalMinutes = hours * 60 + minutes;
|
|
7160
7159
|
if (hours > 0) {
|
|
@@ -7167,23 +7166,23 @@ var TimeInput = ({
|
|
|
7167
7166
|
label,
|
|
7168
7167
|
tooltip ? /* @__PURE__ */ jsx(Tooltip, { text: tooltip }) : null
|
|
7169
7168
|
] }),
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
const
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
const
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7169
|
+
/* @__PURE__ */ jsx(
|
|
7170
|
+
Controller,
|
|
7171
|
+
{
|
|
7172
|
+
name,
|
|
7173
|
+
control,
|
|
7174
|
+
defaultValue: initialTime,
|
|
7175
|
+
render: ({ field }) => {
|
|
7176
|
+
const handleIncrement = () => {
|
|
7177
|
+
const newTime = adjustTime(field.value, step, maxTime);
|
|
7178
|
+
setValue(name, newTime);
|
|
7179
|
+
};
|
|
7180
|
+
const handleDecrement = () => {
|
|
7181
|
+
const newTime = adjustTime(field.value, -step, maxTime);
|
|
7182
|
+
setValue(name, newTime);
|
|
7183
|
+
};
|
|
7184
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-8", children: [
|
|
7185
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-fit items-center", children: [
|
|
7187
7186
|
/* @__PURE__ */ jsx(
|
|
7188
7187
|
"button",
|
|
7189
7188
|
{
|
|
@@ -7229,16 +7228,16 @@ var TimeInput = ({
|
|
|
7229
7228
|
) })
|
|
7230
7229
|
}
|
|
7231
7230
|
)
|
|
7232
|
-
] })
|
|
7233
|
-
|
|
7231
|
+
] }),
|
|
7232
|
+
description && /* @__PURE__ */ jsxs(FeedbackBadge, { $variant: "default", children: [
|
|
7233
|
+
"Enviado ",
|
|
7234
|
+
formatDescription(field.value || "00:00"),
|
|
7235
|
+
" ap\xF3s o abandono"
|
|
7236
|
+
] })
|
|
7237
|
+
] });
|
|
7234
7238
|
}
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
"Enviado ",
|
|
7238
|
-
formatDescription(value),
|
|
7239
|
-
" ap\xF3s o abandono"
|
|
7240
|
-
] })
|
|
7241
|
-
] })
|
|
7239
|
+
}
|
|
7240
|
+
)
|
|
7242
7241
|
] });
|
|
7243
7242
|
};
|
|
7244
7243
|
var formatTime = (time) => {
|