shadcn-zod-formkit 3.8.1 → 3.9.1
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.cjs +1519 -1330
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +693 -485
- package/dist/index.d.ts +693 -485
- package/dist/index.mjs +1479 -1333
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-3.9.1.tgz +0 -0
- package/package.json +1 -1
- package/dist/shadcn-zod-formkit-3.8.1.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -6,11 +6,9 @@ var lucideReact = require('lucide-react');
|
|
|
6
6
|
var reactIcons = require('@radix-ui/react-icons');
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
9
|
-
var reactSlot = require('@radix-ui/react-slot');
|
|
10
|
-
var zustand = require('zustand');
|
|
11
|
-
var reactHookForm = require('react-hook-form');
|
|
12
9
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
13
10
|
var radixUi = require('radix-ui');
|
|
11
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
14
12
|
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
15
13
|
var reactDayPicker = require('react-day-picker');
|
|
16
14
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
@@ -20,6 +18,7 @@ require('react-color-palette/css');
|
|
|
20
18
|
var cmdk = require('cmdk');
|
|
21
19
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
22
20
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
21
|
+
var reactHookForm = require('react-hook-form');
|
|
23
22
|
var inputOtp = require('input-otp');
|
|
24
23
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
25
24
|
var ResizablePrimitive = require('react-resizable-panels');
|
|
@@ -31,6 +30,7 @@ var sonner = require('sonner');
|
|
|
31
30
|
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
32
31
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
33
32
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
33
|
+
var zustand = require('zustand');
|
|
34
34
|
var dateFns = require('date-fns');
|
|
35
35
|
var core = require('@dnd-kit/core');
|
|
36
36
|
var sortable = require('@dnd-kit/sortable');
|
|
@@ -9868,6 +9868,60 @@ var CustomAlert = ({
|
|
|
9868
9868
|
}
|
|
9869
9869
|
);
|
|
9870
9870
|
};
|
|
9871
|
+
function Accordion({
|
|
9872
|
+
...props
|
|
9873
|
+
}) {
|
|
9874
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
9875
|
+
}
|
|
9876
|
+
function AccordionItem({
|
|
9877
|
+
className,
|
|
9878
|
+
...props
|
|
9879
|
+
}) {
|
|
9880
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9881
|
+
AccordionPrimitive__namespace.Item,
|
|
9882
|
+
{
|
|
9883
|
+
"data-slot": "accordion-item",
|
|
9884
|
+
className: cn("border-b last:border-b-0", className),
|
|
9885
|
+
...props
|
|
9886
|
+
}
|
|
9887
|
+
);
|
|
9888
|
+
}
|
|
9889
|
+
function AccordionTrigger({
|
|
9890
|
+
className,
|
|
9891
|
+
children,
|
|
9892
|
+
...props
|
|
9893
|
+
}) {
|
|
9894
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9895
|
+
AccordionPrimitive__namespace.Trigger,
|
|
9896
|
+
{
|
|
9897
|
+
"data-slot": "accordion-trigger",
|
|
9898
|
+
className: cn(
|
|
9899
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
9900
|
+
className
|
|
9901
|
+
),
|
|
9902
|
+
...props,
|
|
9903
|
+
children: [
|
|
9904
|
+
children,
|
|
9905
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
9906
|
+
]
|
|
9907
|
+
}
|
|
9908
|
+
) });
|
|
9909
|
+
}
|
|
9910
|
+
function AccordionContent({
|
|
9911
|
+
className,
|
|
9912
|
+
children,
|
|
9913
|
+
...props
|
|
9914
|
+
}) {
|
|
9915
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9916
|
+
AccordionPrimitive__namespace.Content,
|
|
9917
|
+
{
|
|
9918
|
+
"data-slot": "accordion-content",
|
|
9919
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
9920
|
+
...props,
|
|
9921
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
9922
|
+
}
|
|
9923
|
+
);
|
|
9924
|
+
}
|
|
9871
9925
|
var buttonVariants = classVarianceAuthority.cva(
|
|
9872
9926
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9873
9927
|
{
|
|
@@ -9914,1026 +9968,301 @@ function Button({
|
|
|
9914
9968
|
}
|
|
9915
9969
|
);
|
|
9916
9970
|
}
|
|
9917
|
-
function
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
}
|
|
9922
|
-
return { width: border.width ?? defaultWidth, color: border.color };
|
|
9971
|
+
function AlertDialog({
|
|
9972
|
+
...props
|
|
9973
|
+
}) {
|
|
9974
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Root, { "data-slot": "alert-dialog", ...props });
|
|
9923
9975
|
}
|
|
9924
|
-
function
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
const left = normalizeBorder(borders.left) ?? allBorder;
|
|
9929
|
-
const right = normalizeBorder(borders.right) ?? allBorder;
|
|
9930
|
-
const top = normalizeBorder(borders.top) ?? allBorder;
|
|
9931
|
-
const bottom = normalizeBorder(borders.bottom) ?? allBorder;
|
|
9932
|
-
if (left?.color) {
|
|
9933
|
-
shadows.push(`inset ${left.width}px 0 0 0 ${left.color}`);
|
|
9934
|
-
}
|
|
9935
|
-
if (right?.color) {
|
|
9936
|
-
shadows.push(`inset -${right.width}px 0 0 0 ${right.color}`);
|
|
9937
|
-
}
|
|
9938
|
-
if (top?.color) {
|
|
9939
|
-
shadows.push(`inset 0 ${top.width}px 0 0 ${top.color}`);
|
|
9940
|
-
}
|
|
9941
|
-
if (bottom?.color) {
|
|
9942
|
-
shadows.push(`inset 0 -${bottom.width}px 0 0 ${bottom.color}`);
|
|
9943
|
-
}
|
|
9944
|
-
return shadows.length > 0 ? shadows.join(", ") : "none";
|
|
9976
|
+
function AlertDialogTrigger({
|
|
9977
|
+
...props
|
|
9978
|
+
}) {
|
|
9979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
9945
9980
|
}
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9981
|
+
function AlertDialogPortal({
|
|
9982
|
+
...props
|
|
9983
|
+
}) {
|
|
9984
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
9985
|
+
}
|
|
9986
|
+
function AlertDialogOverlay({
|
|
9952
9987
|
className,
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
withLabel = true,
|
|
9956
|
-
isActive = false,
|
|
9957
|
-
fontSize = "text-sm",
|
|
9958
|
-
icons,
|
|
9959
|
-
borders,
|
|
9960
|
-
// iconSize = 72,
|
|
9961
|
-
iconClassName = "w-8 h-8"
|
|
9962
|
-
}) => {
|
|
9963
|
-
let content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9964
|
-
withLabel && label,
|
|
9965
|
-
shortcut && ` (${shortcut})`
|
|
9966
|
-
] });
|
|
9967
|
-
if (children) content = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
9968
|
-
const borderShadow = generateBorderShadows(borders);
|
|
9969
|
-
const hasBorders = borders && borderShadow !== "none";
|
|
9988
|
+
...props
|
|
9989
|
+
}) {
|
|
9970
9990
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9971
|
-
|
|
9991
|
+
radixUi.AlertDialog.Overlay,
|
|
9972
9992
|
{
|
|
9973
|
-
|
|
9974
|
-
onDoubleClick,
|
|
9975
|
-
onClick: (e) => onClick?.(label ?? e.currentTarget.textContent ?? ""),
|
|
9976
|
-
style: {
|
|
9977
|
-
...style,
|
|
9978
|
-
...hasBorders && { boxShadow: borderShadow }
|
|
9979
|
-
},
|
|
9993
|
+
"data-slot": "alert-dialog-overlay",
|
|
9980
9994
|
className: cn(
|
|
9981
|
-
|
|
9982
|
-
"shadow-md shadow-black/20",
|
|
9983
|
-
"flex flex-1 items-center justify-center rounded-lg h-full w-full",
|
|
9984
|
-
"font-mono font-bold transition-all duration-100",
|
|
9985
|
-
"active:scale-95",
|
|
9986
|
-
fontSize,
|
|
9987
|
-
// Estados base (soft UI)
|
|
9988
|
-
"border border-(--color-border)",
|
|
9989
|
-
"bg-(--color-secondary-soft) text-(--color-foreground)",
|
|
9990
|
-
// Hover
|
|
9991
|
-
"hover:bg-(--color-accent-soft)",
|
|
9992
|
-
// Active click (presionado)
|
|
9993
|
-
"active:bg-(--color-primary) active:text-(--color-primary-foreground)",
|
|
9994
|
-
// Estado activo (seleccionado)
|
|
9995
|
-
isActive && "bg-(--color-primary) text-(--color-primary-foreground) border-(--color-primary)",
|
|
9996
|
-
// Backspace especial
|
|
9997
|
-
// label === '⌫' &&
|
|
9998
|
-
// 'bg-(--color-destructive) text-white hover:opacity-90',
|
|
9999
|
-
// Overflow hidden para que los bordes respeten el border-radius
|
|
10000
|
-
"overflow-hidden",
|
|
9995
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
10001
9996
|
className
|
|
10002
9997
|
),
|
|
10003
|
-
|
|
10004
|
-
icons && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row justify-center text-3xl", children: icons.map((IconComponent, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10005
|
-
IconComponent,
|
|
10006
|
-
{
|
|
10007
|
-
className: iconClassName
|
|
10008
|
-
},
|
|
10009
|
-
index
|
|
10010
|
-
)) }),
|
|
10011
|
-
content
|
|
10012
|
-
] })
|
|
9998
|
+
...props
|
|
10013
9999
|
}
|
|
10014
10000
|
);
|
|
10015
|
-
}
|
|
10016
|
-
|
|
10017
|
-
if (!label || label.length !== 1 || !/[a-z]/.test(label)) return label;
|
|
10018
|
-
return upper ? label.toUpperCase() : label;
|
|
10019
|
-
};
|
|
10020
|
-
var letter = (l, isUpper, handleKey) => ({
|
|
10021
|
-
label: applyCase(l, isUpper),
|
|
10022
|
-
onClick: handleKey,
|
|
10023
|
-
className: "flex-1"
|
|
10024
|
-
});
|
|
10025
|
-
|
|
10026
|
-
// src/components/custom/keyboard/keyboard-base.tsx
|
|
10027
|
-
var BaseKeyboard = class {
|
|
10028
|
-
constructor() {
|
|
10029
|
-
}
|
|
10030
|
-
};
|
|
10031
|
-
var KeyboardBuilder = ({
|
|
10032
|
-
keys,
|
|
10033
|
-
withCard = false,
|
|
10001
|
+
}
|
|
10002
|
+
function AlertDialogContent({
|
|
10034
10003
|
className,
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
if (key && !key.disabled) {
|
|
10051
|
-
key.onClick?.(pressedKey);
|
|
10052
|
-
const keyboardEvent = new KeyboardEvent("keydown", {
|
|
10053
|
-
key: pressedKey,
|
|
10054
|
-
bubbles: true
|
|
10055
|
-
});
|
|
10056
|
-
window.dispatchEvent(keyboardEvent);
|
|
10057
|
-
}
|
|
10058
|
-
}, [keyMap]);
|
|
10059
|
-
React3.useEffect(() => {
|
|
10060
|
-
const handleKeyDown = (event) => {
|
|
10061
|
-
const active = document.activeElement;
|
|
10062
|
-
if (active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement || active && active.getAttribute("contenteditable") === "true") {
|
|
10063
|
-
console.log("\u{1F680} ~ Ignorando tecla porque el foco est\xE1 en un input:", event.key);
|
|
10064
|
-
return;
|
|
10004
|
+
size = "default",
|
|
10005
|
+
...props
|
|
10006
|
+
}) {
|
|
10007
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
10008
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
10009
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10010
|
+
radixUi.AlertDialog.Content,
|
|
10011
|
+
{
|
|
10012
|
+
"data-slot": "alert-dialog-content",
|
|
10013
|
+
"data-size": size,
|
|
10014
|
+
className: cn(
|
|
10015
|
+
"group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",
|
|
10016
|
+
className
|
|
10017
|
+
),
|
|
10018
|
+
...props
|
|
10065
10019
|
}
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
10020
|
+
)
|
|
10021
|
+
] });
|
|
10022
|
+
}
|
|
10023
|
+
function AlertDialogHeader({
|
|
10024
|
+
className,
|
|
10025
|
+
...props
|
|
10026
|
+
}) {
|
|
10027
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10075
10028
|
"div",
|
|
10076
10029
|
{
|
|
10030
|
+
"data-slot": "alert-dialog-header",
|
|
10077
10031
|
className: cn(
|
|
10078
|
-
|
|
10032
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
10079
10033
|
className
|
|
10080
10034
|
),
|
|
10081
|
-
|
|
10082
|
-
const handleClick = () => {
|
|
10083
|
-
triggerKey(key.label ?? "");
|
|
10084
|
-
key.onClick?.(key.label ?? "");
|
|
10085
|
-
if (!key.shortcut) return;
|
|
10086
|
-
triggerKey(key.shortcut);
|
|
10087
|
-
};
|
|
10088
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10089
|
-
key.label == "" && !key.icons?.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${key.className}` }, indx),
|
|
10090
|
-
(key.label != "" || key.icons?.length) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10091
|
-
Key,
|
|
10092
|
-
{
|
|
10093
|
-
borders: {
|
|
10094
|
-
left: key.disabled ? "grey" : "",
|
|
10095
|
-
bottom: key.disabled ? "grey" : ""
|
|
10096
|
-
},
|
|
10097
|
-
label: key.label,
|
|
10098
|
-
onClick: handleClick,
|
|
10099
|
-
shortcut: key.shortcut,
|
|
10100
|
-
icons: key.icons,
|
|
10101
|
-
className: `${key.className} ${key.disabled ? "bg-muted-foreground h-full" : "h-full"}`,
|
|
10102
|
-
iconClassName: key.iconClassName,
|
|
10103
|
-
iconSize: key.iconSize,
|
|
10104
|
-
fontSize: keyFontSize3,
|
|
10105
|
-
isActive: key.isActive,
|
|
10106
|
-
disabled: key.disabled,
|
|
10107
|
-
children: key.children
|
|
10108
|
-
},
|
|
10109
|
-
indx
|
|
10110
|
-
)
|
|
10111
|
-
] });
|
|
10112
|
-
}) }, ri))
|
|
10035
|
+
...props
|
|
10113
10036
|
}
|
|
10114
10037
|
);
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
activeInput: null,
|
|
10130
|
-
inputs: {},
|
|
10131
|
-
type: "qwerty" /* QWERTY */,
|
|
10132
|
-
currentInputField: null,
|
|
10133
|
-
setCurrentInputField(inputField) {
|
|
10134
|
-
set({ currentInputField: inputField });
|
|
10135
|
-
},
|
|
10136
|
-
isOpen: false,
|
|
10137
|
-
setIsOpen(open) {
|
|
10138
|
-
set({ isOpen: open ?? !get().isOpen });
|
|
10139
|
-
},
|
|
10140
|
-
registerInput: (id, initialValue = "") => set((state) => ({
|
|
10141
|
-
inputs: {
|
|
10142
|
-
...state.inputs,
|
|
10143
|
-
[id]: initialValue
|
|
10038
|
+
}
|
|
10039
|
+
function AlertDialogFooter({
|
|
10040
|
+
className,
|
|
10041
|
+
...props
|
|
10042
|
+
}) {
|
|
10043
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10044
|
+
"div",
|
|
10045
|
+
{
|
|
10046
|
+
"data-slot": "alert-dialog-footer",
|
|
10047
|
+
className: cn(
|
|
10048
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
10049
|
+
className
|
|
10050
|
+
),
|
|
10051
|
+
...props
|
|
10144
10052
|
}
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
// ...current,
|
|
10161
|
-
// field: {
|
|
10162
|
-
// ...current.field,
|
|
10163
|
-
// value: newValue
|
|
10164
|
-
// }
|
|
10165
|
-
// }
|
|
10166
|
-
// };
|
|
10167
|
-
// }),
|
|
10168
|
-
write: (char) => set((state) => {
|
|
10169
|
-
let currentInputField = state.currentInputField;
|
|
10170
|
-
if (currentInputField && currentInputField.field) {
|
|
10171
|
-
currentInputField.field.value += char;
|
|
10172
|
-
const newValue = currentInputField.field.value;
|
|
10173
|
-
set({ currentInputField });
|
|
10174
|
-
currentInputField.field.onChange(newValue);
|
|
10053
|
+
);
|
|
10054
|
+
}
|
|
10055
|
+
function AlertDialogTitle({
|
|
10056
|
+
className,
|
|
10057
|
+
...props
|
|
10058
|
+
}) {
|
|
10059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10060
|
+
radixUi.AlertDialog.Title,
|
|
10061
|
+
{
|
|
10062
|
+
"data-slot": "alert-dialog-title",
|
|
10063
|
+
className: cn(
|
|
10064
|
+
"text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
10065
|
+
className
|
|
10066
|
+
),
|
|
10067
|
+
...props
|
|
10175
10068
|
}
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
const newValue = currentInputField.field.value.slice(0, -1);
|
|
10189
|
-
currentInputField.field.value = newValue;
|
|
10190
|
-
set({ currentInputField });
|
|
10191
|
-
currentInputField.field.onChange(newValue);
|
|
10069
|
+
);
|
|
10070
|
+
}
|
|
10071
|
+
function AlertDialogDescription({
|
|
10072
|
+
className,
|
|
10073
|
+
...props
|
|
10074
|
+
}) {
|
|
10075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10076
|
+
radixUi.AlertDialog.Description,
|
|
10077
|
+
{
|
|
10078
|
+
"data-slot": "alert-dialog-description",
|
|
10079
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
10080
|
+
...props
|
|
10192
10081
|
}
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
[state.activeInput]: ""
|
|
10209
|
-
}
|
|
10210
|
-
};
|
|
10211
|
-
}),
|
|
10212
|
-
setValue: (id, value) => set((state) => ({
|
|
10213
|
-
inputs: {
|
|
10214
|
-
...state.inputs,
|
|
10215
|
-
[id]: value
|
|
10082
|
+
);
|
|
10083
|
+
}
|
|
10084
|
+
function AlertDialogMedia({
|
|
10085
|
+
className,
|
|
10086
|
+
...props
|
|
10087
|
+
}) {
|
|
10088
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10089
|
+
"div",
|
|
10090
|
+
{
|
|
10091
|
+
"data-slot": "alert-dialog-media",
|
|
10092
|
+
className: cn(
|
|
10093
|
+
"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
10094
|
+
className
|
|
10095
|
+
),
|
|
10096
|
+
...props
|
|
10216
10097
|
}
|
|
10217
|
-
|
|
10218
|
-
}
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10098
|
+
);
|
|
10099
|
+
}
|
|
10100
|
+
function AlertDialogAction({
|
|
10101
|
+
className,
|
|
10102
|
+
variant = "default",
|
|
10103
|
+
size = "default",
|
|
10104
|
+
...props
|
|
10105
|
+
}) {
|
|
10106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10107
|
+
radixUi.AlertDialog.Action,
|
|
10108
|
+
{
|
|
10109
|
+
"data-slot": "alert-dialog-action",
|
|
10110
|
+
className: cn(className),
|
|
10111
|
+
...props
|
|
10231
10112
|
}
|
|
10232
|
-
}
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
};
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
if (key === "Enter") {
|
|
10259
|
-
e.preventDefault();
|
|
10260
|
-
onEnter?.();
|
|
10261
|
-
return;
|
|
10113
|
+
) });
|
|
10114
|
+
}
|
|
10115
|
+
function AlertDialogCancel({
|
|
10116
|
+
className,
|
|
10117
|
+
variant = "outline",
|
|
10118
|
+
size = "default",
|
|
10119
|
+
...props
|
|
10120
|
+
}) {
|
|
10121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10122
|
+
radixUi.AlertDialog.Cancel,
|
|
10123
|
+
{
|
|
10124
|
+
"data-slot": "alert-dialog-cancel",
|
|
10125
|
+
className: cn(className),
|
|
10126
|
+
...props
|
|
10127
|
+
}
|
|
10128
|
+
) });
|
|
10129
|
+
}
|
|
10130
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
10131
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
10132
|
+
{
|
|
10133
|
+
variants: {
|
|
10134
|
+
variant: {
|
|
10135
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
10136
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
10137
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
10138
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
10262
10139
|
}
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
onDelete?.();
|
|
10267
|
-
return;
|
|
10268
|
-
}
|
|
10269
|
-
if (key === " ") {
|
|
10270
|
-
e.preventDefault();
|
|
10271
|
-
handleKey(" ");
|
|
10272
|
-
return;
|
|
10273
|
-
}
|
|
10274
|
-
if (key === "Shift") {
|
|
10275
|
-
handleShift();
|
|
10276
|
-
return;
|
|
10277
|
-
}
|
|
10278
|
-
if (key === "CapsLock") {
|
|
10279
|
-
handleCaps();
|
|
10280
|
-
return;
|
|
10281
|
-
}
|
|
10282
|
-
if (key === "Tab") {
|
|
10283
|
-
e.preventDefault();
|
|
10284
|
-
return;
|
|
10285
|
-
}
|
|
10286
|
-
if (key === "Escape") {
|
|
10287
|
-
setIsOpen(false);
|
|
10288
|
-
return;
|
|
10289
|
-
}
|
|
10290
|
-
if (key.length === 1) {
|
|
10291
|
-
handleKey(key);
|
|
10292
|
-
}
|
|
10293
|
-
};
|
|
10294
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
10295
|
-
return () => {
|
|
10296
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
10297
|
-
};
|
|
10298
|
-
}, [currentInputField, shiftMode]);
|
|
10299
|
-
const handleShift = () => {
|
|
10300
|
-
const now = Date.now();
|
|
10301
|
-
if (now - lastShiftPress.current < 300) {
|
|
10302
|
-
setShiftMode((prev) => prev === "caps" ? "off" : "caps");
|
|
10303
|
-
} else {
|
|
10304
|
-
setShiftMode((prev) => prev === "once" ? "off" : "once");
|
|
10140
|
+
},
|
|
10141
|
+
defaultVariants: {
|
|
10142
|
+
variant: "default"
|
|
10305
10143
|
}
|
|
10306
|
-
lastShiftPress.current = now;
|
|
10307
|
-
};
|
|
10308
|
-
const handleKey = (key) => {
|
|
10309
|
-
const output = isUpper ? key.toUpperCase() : key;
|
|
10310
|
-
onKeyPress?.(output);
|
|
10311
|
-
write(output);
|
|
10312
|
-
if (shiftMode === "once") setShiftMode("off");
|
|
10313
|
-
};
|
|
10314
|
-
const handleCaps = () => {
|
|
10315
|
-
setShiftMode((prev) => prev === "caps" ? "off" : "caps");
|
|
10316
|
-
};
|
|
10317
|
-
const shiftLabel = shiftMode === "caps" ? lucideReact.ArrowBigUpDash : lucideReact.ArrowBigUp;
|
|
10318
|
-
const shiftActive = shiftMode !== "off";
|
|
10319
|
-
const textField = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: currentInputField && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 h-full min-h-16 flex-1 flex flex-row text-2xl font-bold justify-center text-center items-center gap-2 rounded-xl border-2 transition-all outline-none border-amber-400 bg-amber-50 ", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: currentInputField.input && currentInputField.input.keyboardType == "password" /* PASSWORD */ ? "\u2022".repeat(currentInputField.field?.value.toString().length) : currentInputField.field?.value || "" }) }) });
|
|
10320
|
-
if (mode === "symbols") {
|
|
10321
|
-
const keys = [
|
|
10322
|
-
["!", "@", "#", "$", "%", "^", "&", "*", "(", ")"],
|
|
10323
|
-
["~", "`", "|", "\\", "/", "{", "}", "[", "]"],
|
|
10324
|
-
["+", "=", "<", ">", "?", "'", '"', ":", ";"]
|
|
10325
|
-
].map(
|
|
10326
|
-
(row) => row.map((k) => ({
|
|
10327
|
-
label: k,
|
|
10328
|
-
onClick: () => handleKey(k)
|
|
10329
|
-
}))
|
|
10330
|
-
);
|
|
10331
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
10332
|
-
textField,
|
|
10333
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10334
|
-
KeyboardBuilder,
|
|
10335
|
-
{
|
|
10336
|
-
className: "w-full h-full",
|
|
10337
|
-
keyFontSize: keyFontSize3,
|
|
10338
|
-
keys: [
|
|
10339
|
-
...keys,
|
|
10340
|
-
[
|
|
10341
|
-
{ label: "ABC", onClick: () => setMode("letters"), className: "flex-[2]" },
|
|
10342
|
-
{ label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
|
|
10343
|
-
{ label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200 " }
|
|
10344
|
-
]
|
|
10345
|
-
]
|
|
10346
|
-
}
|
|
10347
|
-
)
|
|
10348
|
-
] });
|
|
10349
10144
|
}
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
[
|
|
10395
|
-
{ label: "?123", onClick: () => setMode("symbols"), className: "flex-[2]" },
|
|
10396
|
-
{ label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
|
|
10397
|
-
{ label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200" }
|
|
10398
|
-
]
|
|
10399
|
-
]
|
|
10145
|
+
);
|
|
10146
|
+
function Badge({
|
|
10147
|
+
className,
|
|
10148
|
+
variant,
|
|
10149
|
+
asChild = false,
|
|
10150
|
+
...props
|
|
10151
|
+
}) {
|
|
10152
|
+
const Comp = asChild ? reactSlot.Slot : "span";
|
|
10153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10154
|
+
Comp,
|
|
10155
|
+
{
|
|
10156
|
+
"data-slot": "badge",
|
|
10157
|
+
className: cn(badgeVariants({ variant }), className),
|
|
10158
|
+
...props
|
|
10159
|
+
}
|
|
10160
|
+
);
|
|
10161
|
+
}
|
|
10162
|
+
function Separator({
|
|
10163
|
+
className,
|
|
10164
|
+
orientation: orientation2 = "horizontal",
|
|
10165
|
+
decorative = true,
|
|
10166
|
+
...props
|
|
10167
|
+
}) {
|
|
10168
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10169
|
+
SeparatorPrimitive__namespace.Root,
|
|
10170
|
+
{
|
|
10171
|
+
"data-slot": "separator",
|
|
10172
|
+
decorative,
|
|
10173
|
+
orientation: orientation2,
|
|
10174
|
+
className: cn(
|
|
10175
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
10176
|
+
className
|
|
10177
|
+
),
|
|
10178
|
+
...props
|
|
10179
|
+
}
|
|
10180
|
+
);
|
|
10181
|
+
}
|
|
10182
|
+
var buttonGroupVariants = classVarianceAuthority.cva(
|
|
10183
|
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
10184
|
+
{
|
|
10185
|
+
variants: {
|
|
10186
|
+
orientation: {
|
|
10187
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
10188
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
10400
10189
|
}
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
var keyboardMap = {
|
|
10405
|
-
["qwerty" /* QWERTY */]: QwertyKeyboard,
|
|
10406
|
-
["qwerty_not_chars" /* QWERTY_NOT_CHARS */]: QwertyKeyboard,
|
|
10407
|
-
["number" /* NUMBER */]: QwertyKeyboard
|
|
10408
|
-
};
|
|
10409
|
-
var KeyboardFactory = class {
|
|
10410
|
-
static create(typeKeyboard, input) {
|
|
10411
|
-
const inputKbType = input?.keyboardType;
|
|
10412
|
-
let keyboardType = typeKeyboard ?? "qwerty" /* QWERTY */;
|
|
10413
|
-
if (inputKbType) {
|
|
10414
|
-
if (inputKbType == "number" /* NUMBER */) keyboardType = "number" /* NUMBER */;
|
|
10190
|
+
},
|
|
10191
|
+
defaultVariants: {
|
|
10192
|
+
orientation: "horizontal"
|
|
10415
10193
|
}
|
|
10416
|
-
const keyboardClass = keyboardMap[keyboardType] ?? QwertyKeyboard;
|
|
10417
|
-
const instance = new keyboardClass();
|
|
10418
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: instance.render() });
|
|
10419
|
-
}
|
|
10420
|
-
};
|
|
10421
|
-
|
|
10422
|
-
// src/components/custom/form/input-errors.ts
|
|
10423
|
-
var validationMessages = {
|
|
10424
|
-
required: "Este campo es obligatorio",
|
|
10425
|
-
email: "El correo electr\xF3nico no es v\xE1lido",
|
|
10426
|
-
invalidFormat: "Formato inv\xE1lido",
|
|
10427
|
-
onlyPositive: "Solo n\xFAmeros positivos",
|
|
10428
|
-
minLength: (length) => `Debe tener al menos ${length} caracteres`,
|
|
10429
|
-
maxLength: (length) => `No puede tener m\xE1s de ${length} caracteres`,
|
|
10430
|
-
passwordMismatch: "Las contrase\xF1as no coinciden",
|
|
10431
|
-
invalidPhone: "El n\xFAmero de tel\xE9fono no es v\xE1lido"
|
|
10432
|
-
};
|
|
10433
|
-
|
|
10434
|
-
// src/components/custom/form/inputs/base/base-input.ts
|
|
10435
|
-
var BaseInput = class {
|
|
10436
|
-
constructor(input, form, isSubmitting) {
|
|
10437
|
-
this.input = input;
|
|
10438
|
-
this.form = form;
|
|
10439
|
-
this.isSubmitting = isSubmitting;
|
|
10440
|
-
}
|
|
10441
|
-
};
|
|
10442
|
-
var entityToInputOption = (entitiy, name = "name", description = "description", groupedLabel, optionLabel = "label") => ({
|
|
10443
|
-
id: entitiy["id"],
|
|
10444
|
-
name: entitiy[name],
|
|
10445
|
-
label: entitiy[optionLabel],
|
|
10446
|
-
description: entitiy[description],
|
|
10447
|
-
groupedLabel
|
|
10448
|
-
});
|
|
10449
|
-
var entitiesToInputOption = (data, optionValue = "name", groupedLabel, optionLabel = "description") => {
|
|
10450
|
-
const entities = [];
|
|
10451
|
-
for (const key of data) {
|
|
10452
|
-
const entidad = entityToInputOption(key, optionValue, optionLabel, groupedLabel);
|
|
10453
|
-
if (entidad) entities.push(entidad);
|
|
10454
|
-
}
|
|
10455
|
-
return entities;
|
|
10456
|
-
};
|
|
10457
|
-
var entityToGroupedOption = (entitiy, name = "name") => ({
|
|
10458
|
-
id: entitiy["id"],
|
|
10459
|
-
label: entitiy[name] || entitiy["label"],
|
|
10460
|
-
options: entitiy["options"] || [],
|
|
10461
|
-
selectedOptions: []
|
|
10462
|
-
});
|
|
10463
|
-
var entitiesToGroupedOption = (data, optionValue = "name") => {
|
|
10464
|
-
const entities = [];
|
|
10465
|
-
for (const key of data) {
|
|
10466
|
-
const entidad = entityToGroupedOption(key, optionValue);
|
|
10467
|
-
if (entidad) entities.push(entidad);
|
|
10468
|
-
}
|
|
10469
|
-
return entities;
|
|
10470
|
-
};
|
|
10471
|
-
var handleOnChage = (event, input, field) => {
|
|
10472
|
-
let value = event;
|
|
10473
|
-
if (event && typeof event === "object" && "target" in event) {
|
|
10474
|
-
value = event.target.value;
|
|
10475
|
-
}
|
|
10476
|
-
field?.onChange(value);
|
|
10477
|
-
const data = input.form?.getValues();
|
|
10478
|
-
input.onChange?.(value, data);
|
|
10479
|
-
input.onAnyFieldChange?.(data);
|
|
10480
|
-
};
|
|
10481
|
-
var isValidField = (input, form, defaultValue) => {
|
|
10482
|
-
const value = defaultValue ?? form.getValues(input.name);
|
|
10483
|
-
const fieldState = form.getFieldState(input.name);
|
|
10484
|
-
if (input.zodType) {
|
|
10485
|
-
const result = input.zodType.safeParse(value);
|
|
10486
|
-
return result.success;
|
|
10487
10194
|
}
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
// src/components/custom/form/inputs/base/input-types.ts
|
|
10492
|
-
var InputTypes = /* @__PURE__ */ ((InputTypes3) => {
|
|
10493
|
-
InputTypes3["HIDDEN"] = "hidden";
|
|
10494
|
-
InputTypes3["TEXT"] = "text";
|
|
10495
|
-
InputTypes3["TEXT_GROUP"] = "text_group";
|
|
10496
|
-
InputTypes3["NUMBER"] = "number";
|
|
10497
|
-
InputTypes3["SWITCH"] = "switch";
|
|
10498
|
-
InputTypes3["CHECKBOX"] = "checkbox";
|
|
10499
|
-
InputTypes3["SELECT"] = "select";
|
|
10500
|
-
InputTypes3["SIMPLE_CHECK_LIST"] = "siple_checklist";
|
|
10501
|
-
InputTypes3["CHECK_LIST"] = "checklist";
|
|
10502
|
-
InputTypes3["GROUPED_SWITCH_LIST"] = "grouped_switchlist";
|
|
10503
|
-
InputTypes3["ACCORDION_GROUPED_SWITCH_LIST"] = "accordion_grouped_switchlist";
|
|
10504
|
-
InputTypes3["DATE"] = "date";
|
|
10505
|
-
InputTypes3["TEXTAREA"] = "textarea";
|
|
10506
|
-
InputTypes3["FILE"] = "file";
|
|
10507
|
-
InputTypes3["OTP"] = "otp";
|
|
10508
|
-
InputTypes3["FORM"] = "form";
|
|
10509
|
-
InputTypes3["COLOR"] = "color";
|
|
10510
|
-
InputTypes3["RADIO_GROUP"] = "radio_group";
|
|
10511
|
-
InputTypes3["TAGS"] = "tags";
|
|
10512
|
-
InputTypes3["DATE_TIME"] = "date_time";
|
|
10513
|
-
InputTypes3["TIME"] = "time";
|
|
10514
|
-
InputTypes3["FILE_MULTI_UPLOAD"] = "file_multi_upload";
|
|
10515
|
-
InputTypes3["SLIDER"] = "slider";
|
|
10516
|
-
InputTypes3["BUTTON_GROUP"] = "button_group";
|
|
10517
|
-
InputTypes3["CURRENCY"] = "currency";
|
|
10518
|
-
InputTypes3["KEY_VALUE"] = "key_value";
|
|
10519
|
-
InputTypes3["REPEATER"] = "repeater";
|
|
10520
|
-
InputTypes3["MULTI_SELECT"] = "multi_select";
|
|
10521
|
-
InputTypes3["COMBOBOX"] = "COMBO_BOX";
|
|
10522
|
-
InputTypes3["SORTABLE_LIST"] = "sortable_list";
|
|
10523
|
-
InputTypes3["REPEATER_TABS"] = "repeater_tabs";
|
|
10524
|
-
InputTypes3["STRING_LIST"] = "string_list";
|
|
10525
|
-
InputTypes3["RATING"] = "rating";
|
|
10526
|
-
InputTypes3["PHONE"] = "phone";
|
|
10527
|
-
InputTypes3["URL"] = "url";
|
|
10528
|
-
InputTypes3["PASSWORD"] = "password";
|
|
10529
|
-
InputTypes3["AUTOCOMPLETE"] = "autocomplete";
|
|
10530
|
-
InputTypes3["EMAIL"] = "email";
|
|
10531
|
-
InputTypes3["SEARCH"] = "search";
|
|
10532
|
-
InputTypes3["LOCATION_PICKER"] = "location_picker";
|
|
10533
|
-
InputTypes3["DATE_RANGE"] = "date_range";
|
|
10534
|
-
InputTypes3["COUNTRY_SELECT"] = "country_select";
|
|
10535
|
-
InputTypes3["RANGE"] = "range";
|
|
10536
|
-
InputTypes3["FILE_UPLOAD"] = "file_upload";
|
|
10537
|
-
return InputTypes3;
|
|
10538
|
-
})(InputTypes || {});
|
|
10539
|
-
var inputFieldComp = [
|
|
10540
|
-
"string_list" /* STRING_LIST */,
|
|
10541
|
-
"repeater_tabs" /* REPEATER_TABS */,
|
|
10542
|
-
"sortable_list" /* SORTABLE_LIST */,
|
|
10543
|
-
"COMBO_BOX" /* COMBOBOX */,
|
|
10544
|
-
"multi_select" /* MULTI_SELECT */,
|
|
10545
|
-
"repeater" /* REPEATER */,
|
|
10546
|
-
"key_value" /* KEY_VALUE */,
|
|
10547
|
-
"currency" /* CURRENCY */,
|
|
10548
|
-
"button_group" /* BUTTON_GROUP */,
|
|
10549
|
-
"slider" /* SLIDER */,
|
|
10550
|
-
"file_multi_upload" /* FILE_MULTI_UPLOAD */,
|
|
10551
|
-
"time" /* TIME */,
|
|
10552
|
-
"date_time" /* DATE_TIME */,
|
|
10553
|
-
"tags" /* TAGS */,
|
|
10554
|
-
"radio_group" /* RADIO_GROUP */,
|
|
10555
|
-
"text_group" /* TEXT_GROUP */,
|
|
10556
|
-
"accordion_grouped_switchlist" /* ACCORDION_GROUPED_SWITCH_LIST */,
|
|
10557
|
-
"grouped_switchlist" /* GROUPED_SWITCH_LIST */,
|
|
10558
|
-
"text" /* TEXT */,
|
|
10559
|
-
"switch" /* SWITCH */,
|
|
10560
|
-
"siple_checklist" /* SIMPLE_CHECK_LIST */,
|
|
10561
|
-
"checkbox" /* CHECKBOX */,
|
|
10562
|
-
"color" /* COLOR */,
|
|
10563
|
-
"otp" /* OTP */,
|
|
10564
|
-
"select" /* SELECT */,
|
|
10565
|
-
"date" /* DATE */,
|
|
10566
|
-
"file" /* FILE */,
|
|
10567
|
-
"form" /* FORM */,
|
|
10568
|
-
"number" /* NUMBER */,
|
|
10569
|
-
"textarea" /* TEXTAREA */,
|
|
10570
|
-
// InputTypes.SWITCH_LIST,
|
|
10571
|
-
"hidden" /* HIDDEN */,
|
|
10572
|
-
// ✨ New input types (v1.35.0)
|
|
10573
|
-
"rating" /* RATING */,
|
|
10574
|
-
"phone" /* PHONE */,
|
|
10575
|
-
"url" /* URL */,
|
|
10576
|
-
"password" /* PASSWORD */,
|
|
10577
|
-
"autocomplete" /* AUTOCOMPLETE */,
|
|
10578
|
-
// ✨ New input types (v1.36.0)
|
|
10579
|
-
"email" /* EMAIL */,
|
|
10580
|
-
"search" /* SEARCH */,
|
|
10581
|
-
"location_picker" /* LOCATION_PICKER */,
|
|
10582
|
-
"date_range" /* DATE_RANGE */,
|
|
10583
|
-
"country_select" /* COUNTRY_SELECT */,
|
|
10584
|
-
"range" /* RANGE */,
|
|
10585
|
-
// ✨ New input types (v1.37.0)
|
|
10586
|
-
"file_upload" /* FILE_UPLOAD */
|
|
10587
|
-
];
|
|
10588
|
-
function Accordion({
|
|
10589
|
-
...props
|
|
10590
|
-
}) {
|
|
10591
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
10592
|
-
}
|
|
10593
|
-
function AccordionItem({
|
|
10594
|
-
className,
|
|
10595
|
-
...props
|
|
10596
|
-
}) {
|
|
10597
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10598
|
-
AccordionPrimitive__namespace.Item,
|
|
10599
|
-
{
|
|
10600
|
-
"data-slot": "accordion-item",
|
|
10601
|
-
className: cn("border-b last:border-b-0", className),
|
|
10602
|
-
...props
|
|
10603
|
-
}
|
|
10604
|
-
);
|
|
10605
|
-
}
|
|
10606
|
-
function AccordionTrigger({
|
|
10607
|
-
className,
|
|
10608
|
-
children,
|
|
10609
|
-
...props
|
|
10610
|
-
}) {
|
|
10611
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10612
|
-
AccordionPrimitive__namespace.Trigger,
|
|
10613
|
-
{
|
|
10614
|
-
"data-slot": "accordion-trigger",
|
|
10615
|
-
className: cn(
|
|
10616
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
10617
|
-
className
|
|
10618
|
-
),
|
|
10619
|
-
...props,
|
|
10620
|
-
children: [
|
|
10621
|
-
children,
|
|
10622
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
10623
|
-
]
|
|
10624
|
-
}
|
|
10625
|
-
) });
|
|
10626
|
-
}
|
|
10627
|
-
function AccordionContent({
|
|
10628
|
-
className,
|
|
10629
|
-
children,
|
|
10630
|
-
...props
|
|
10631
|
-
}) {
|
|
10632
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10633
|
-
AccordionPrimitive__namespace.Content,
|
|
10634
|
-
{
|
|
10635
|
-
"data-slot": "accordion-content",
|
|
10636
|
-
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
10637
|
-
...props,
|
|
10638
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
10639
|
-
}
|
|
10640
|
-
);
|
|
10641
|
-
}
|
|
10642
|
-
function AlertDialog({
|
|
10643
|
-
...props
|
|
10644
|
-
}) {
|
|
10645
|
-
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Root, { "data-slot": "alert-dialog", ...props });
|
|
10646
|
-
}
|
|
10647
|
-
function AlertDialogTrigger({
|
|
10648
|
-
...props
|
|
10649
|
-
}) {
|
|
10650
|
-
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
10651
|
-
}
|
|
10652
|
-
function AlertDialogPortal({
|
|
10653
|
-
...props
|
|
10654
|
-
}) {
|
|
10655
|
-
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
10656
|
-
}
|
|
10657
|
-
function AlertDialogOverlay({
|
|
10195
|
+
);
|
|
10196
|
+
function ButtonGroup({
|
|
10658
10197
|
className,
|
|
10198
|
+
orientation: orientation2,
|
|
10659
10199
|
...props
|
|
10660
10200
|
}) {
|
|
10661
10201
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10662
|
-
|
|
10202
|
+
"div",
|
|
10663
10203
|
{
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
),
|
|
10204
|
+
role: "group",
|
|
10205
|
+
"data-slot": "button-group",
|
|
10206
|
+
"data-orientation": orientation2,
|
|
10207
|
+
className: cn(buttonGroupVariants({ orientation: orientation2 }), className),
|
|
10669
10208
|
...props
|
|
10670
10209
|
}
|
|
10671
10210
|
);
|
|
10672
10211
|
}
|
|
10673
|
-
function
|
|
10674
|
-
className,
|
|
10675
|
-
size = "default",
|
|
10676
|
-
...props
|
|
10677
|
-
}) {
|
|
10678
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
10679
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
10680
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10681
|
-
radixUi.AlertDialog.Content,
|
|
10682
|
-
{
|
|
10683
|
-
"data-slot": "alert-dialog-content",
|
|
10684
|
-
"data-size": size,
|
|
10685
|
-
className: cn(
|
|
10686
|
-
"group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",
|
|
10687
|
-
className
|
|
10688
|
-
),
|
|
10689
|
-
...props
|
|
10690
|
-
}
|
|
10691
|
-
)
|
|
10692
|
-
] });
|
|
10693
|
-
}
|
|
10694
|
-
function AlertDialogHeader({
|
|
10212
|
+
function ButtonGroupText({
|
|
10695
10213
|
className,
|
|
10214
|
+
asChild = false,
|
|
10696
10215
|
...props
|
|
10697
10216
|
}) {
|
|
10217
|
+
const Comp = asChild ? reactSlot.Slot : "div";
|
|
10698
10218
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10699
|
-
|
|
10219
|
+
Comp,
|
|
10700
10220
|
{
|
|
10701
|
-
"data-slot": "alert-dialog-header",
|
|
10702
10221
|
className: cn(
|
|
10703
|
-
"
|
|
10222
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
10704
10223
|
className
|
|
10705
10224
|
),
|
|
10706
10225
|
...props
|
|
10707
10226
|
}
|
|
10708
10227
|
);
|
|
10709
10228
|
}
|
|
10710
|
-
function
|
|
10229
|
+
function ButtonGroupSeparator({
|
|
10711
10230
|
className,
|
|
10231
|
+
orientation: orientation2 = "vertical",
|
|
10712
10232
|
...props
|
|
10713
10233
|
}) {
|
|
10714
10234
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10715
|
-
|
|
10235
|
+
Separator,
|
|
10716
10236
|
{
|
|
10717
|
-
"data-slot": "
|
|
10237
|
+
"data-slot": "button-group-separator",
|
|
10238
|
+
orientation: orientation2,
|
|
10718
10239
|
className: cn(
|
|
10719
|
-
"
|
|
10240
|
+
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
10720
10241
|
className
|
|
10721
10242
|
),
|
|
10722
10243
|
...props
|
|
10723
10244
|
}
|
|
10724
10245
|
);
|
|
10725
10246
|
}
|
|
10726
|
-
function
|
|
10247
|
+
function Calendar({
|
|
10727
10248
|
className,
|
|
10249
|
+
classNames,
|
|
10250
|
+
showOutsideDays = true,
|
|
10251
|
+
captionLayout = "label",
|
|
10252
|
+
buttonVariant = "ghost",
|
|
10253
|
+
formatters,
|
|
10254
|
+
components,
|
|
10728
10255
|
...props
|
|
10729
10256
|
}) {
|
|
10257
|
+
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
10730
10258
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10731
|
-
|
|
10259
|
+
reactDayPicker.DayPicker,
|
|
10732
10260
|
{
|
|
10733
|
-
|
|
10261
|
+
showOutsideDays,
|
|
10734
10262
|
className: cn(
|
|
10735
|
-
"
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
...props
|
|
10739
|
-
}
|
|
10740
|
-
);
|
|
10741
|
-
}
|
|
10742
|
-
function AlertDialogDescription({
|
|
10743
|
-
className,
|
|
10744
|
-
...props
|
|
10745
|
-
}) {
|
|
10746
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10747
|
-
radixUi.AlertDialog.Description,
|
|
10748
|
-
{
|
|
10749
|
-
"data-slot": "alert-dialog-description",
|
|
10750
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
10751
|
-
...props
|
|
10752
|
-
}
|
|
10753
|
-
);
|
|
10754
|
-
}
|
|
10755
|
-
function AlertDialogMedia({
|
|
10756
|
-
className,
|
|
10757
|
-
...props
|
|
10758
|
-
}) {
|
|
10759
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10760
|
-
"div",
|
|
10761
|
-
{
|
|
10762
|
-
"data-slot": "alert-dialog-media",
|
|
10763
|
-
className: cn(
|
|
10764
|
-
"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
10765
|
-
className
|
|
10766
|
-
),
|
|
10767
|
-
...props
|
|
10768
|
-
}
|
|
10769
|
-
);
|
|
10770
|
-
}
|
|
10771
|
-
function AlertDialogAction({
|
|
10772
|
-
className,
|
|
10773
|
-
variant = "default",
|
|
10774
|
-
size = "default",
|
|
10775
|
-
...props
|
|
10776
|
-
}) {
|
|
10777
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10778
|
-
radixUi.AlertDialog.Action,
|
|
10779
|
-
{
|
|
10780
|
-
"data-slot": "alert-dialog-action",
|
|
10781
|
-
className: cn(className),
|
|
10782
|
-
...props
|
|
10783
|
-
}
|
|
10784
|
-
) });
|
|
10785
|
-
}
|
|
10786
|
-
function AlertDialogCancel({
|
|
10787
|
-
className,
|
|
10788
|
-
variant = "outline",
|
|
10789
|
-
size = "default",
|
|
10790
|
-
...props
|
|
10791
|
-
}) {
|
|
10792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10793
|
-
radixUi.AlertDialog.Cancel,
|
|
10794
|
-
{
|
|
10795
|
-
"data-slot": "alert-dialog-cancel",
|
|
10796
|
-
className: cn(className),
|
|
10797
|
-
...props
|
|
10798
|
-
}
|
|
10799
|
-
) });
|
|
10800
|
-
}
|
|
10801
|
-
var badgeVariants = classVarianceAuthority.cva(
|
|
10802
|
-
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
10803
|
-
{
|
|
10804
|
-
variants: {
|
|
10805
|
-
variant: {
|
|
10806
|
-
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
10807
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
10808
|
-
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
10809
|
-
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
10810
|
-
}
|
|
10811
|
-
},
|
|
10812
|
-
defaultVariants: {
|
|
10813
|
-
variant: "default"
|
|
10814
|
-
}
|
|
10815
|
-
}
|
|
10816
|
-
);
|
|
10817
|
-
function Badge({
|
|
10818
|
-
className,
|
|
10819
|
-
variant,
|
|
10820
|
-
asChild = false,
|
|
10821
|
-
...props
|
|
10822
|
-
}) {
|
|
10823
|
-
const Comp = asChild ? reactSlot.Slot : "span";
|
|
10824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10825
|
-
Comp,
|
|
10826
|
-
{
|
|
10827
|
-
"data-slot": "badge",
|
|
10828
|
-
className: cn(badgeVariants({ variant }), className),
|
|
10829
|
-
...props
|
|
10830
|
-
}
|
|
10831
|
-
);
|
|
10832
|
-
}
|
|
10833
|
-
function Separator({
|
|
10834
|
-
className,
|
|
10835
|
-
orientation: orientation2 = "horizontal",
|
|
10836
|
-
decorative = true,
|
|
10837
|
-
...props
|
|
10838
|
-
}) {
|
|
10839
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10840
|
-
SeparatorPrimitive__namespace.Root,
|
|
10841
|
-
{
|
|
10842
|
-
"data-slot": "separator",
|
|
10843
|
-
decorative,
|
|
10844
|
-
orientation: orientation2,
|
|
10845
|
-
className: cn(
|
|
10846
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
10847
|
-
className
|
|
10848
|
-
),
|
|
10849
|
-
...props
|
|
10850
|
-
}
|
|
10851
|
-
);
|
|
10852
|
-
}
|
|
10853
|
-
var buttonGroupVariants = classVarianceAuthority.cva(
|
|
10854
|
-
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
10855
|
-
{
|
|
10856
|
-
variants: {
|
|
10857
|
-
orientation: {
|
|
10858
|
-
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
10859
|
-
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
10860
|
-
}
|
|
10861
|
-
},
|
|
10862
|
-
defaultVariants: {
|
|
10863
|
-
orientation: "horizontal"
|
|
10864
|
-
}
|
|
10865
|
-
}
|
|
10866
|
-
);
|
|
10867
|
-
function ButtonGroup({
|
|
10868
|
-
className,
|
|
10869
|
-
orientation: orientation2,
|
|
10870
|
-
...props
|
|
10871
|
-
}) {
|
|
10872
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10873
|
-
"div",
|
|
10874
|
-
{
|
|
10875
|
-
role: "group",
|
|
10876
|
-
"data-slot": "button-group",
|
|
10877
|
-
"data-orientation": orientation2,
|
|
10878
|
-
className: cn(buttonGroupVariants({ orientation: orientation2 }), className),
|
|
10879
|
-
...props
|
|
10880
|
-
}
|
|
10881
|
-
);
|
|
10882
|
-
}
|
|
10883
|
-
function ButtonGroupText({
|
|
10884
|
-
className,
|
|
10885
|
-
asChild = false,
|
|
10886
|
-
...props
|
|
10887
|
-
}) {
|
|
10888
|
-
const Comp = asChild ? reactSlot.Slot : "div";
|
|
10889
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10890
|
-
Comp,
|
|
10891
|
-
{
|
|
10892
|
-
className: cn(
|
|
10893
|
-
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
10894
|
-
className
|
|
10895
|
-
),
|
|
10896
|
-
...props
|
|
10897
|
-
}
|
|
10898
|
-
);
|
|
10899
|
-
}
|
|
10900
|
-
function ButtonGroupSeparator({
|
|
10901
|
-
className,
|
|
10902
|
-
orientation: orientation2 = "vertical",
|
|
10903
|
-
...props
|
|
10904
|
-
}) {
|
|
10905
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10906
|
-
Separator,
|
|
10907
|
-
{
|
|
10908
|
-
"data-slot": "button-group-separator",
|
|
10909
|
-
orientation: orientation2,
|
|
10910
|
-
className: cn(
|
|
10911
|
-
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
10912
|
-
className
|
|
10913
|
-
),
|
|
10914
|
-
...props
|
|
10915
|
-
}
|
|
10916
|
-
);
|
|
10917
|
-
}
|
|
10918
|
-
function Calendar({
|
|
10919
|
-
className,
|
|
10920
|
-
classNames,
|
|
10921
|
-
showOutsideDays = true,
|
|
10922
|
-
captionLayout = "label",
|
|
10923
|
-
buttonVariant = "ghost",
|
|
10924
|
-
formatters,
|
|
10925
|
-
components,
|
|
10926
|
-
...props
|
|
10927
|
-
}) {
|
|
10928
|
-
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
10929
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10930
|
-
reactDayPicker.DayPicker,
|
|
10931
|
-
{
|
|
10932
|
-
showOutsideDays,
|
|
10933
|
-
className: cn(
|
|
10934
|
-
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
10935
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
10936
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
10263
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
10264
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
10265
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
10937
10266
|
className
|
|
10938
10267
|
),
|
|
10939
10268
|
captionLayout,
|
|
@@ -12378,6 +11707,16 @@ function SelectScrollDownButton({
|
|
|
12378
11707
|
function Sheet({ ...props }) {
|
|
12379
11708
|
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "sheet", ...props });
|
|
12380
11709
|
}
|
|
11710
|
+
function SheetTrigger({
|
|
11711
|
+
...props
|
|
11712
|
+
}) {
|
|
11713
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
11714
|
+
}
|
|
11715
|
+
function SheetClose({
|
|
11716
|
+
...props
|
|
11717
|
+
}) {
|
|
11718
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "sheet-close", ...props });
|
|
11719
|
+
}
|
|
12381
11720
|
function SheetPortal({
|
|
12382
11721
|
...props
|
|
12383
11722
|
}) {
|
|
@@ -12413,7 +11752,7 @@ function SheetContent({
|
|
|
12413
11752
|
{
|
|
12414
11753
|
"data-slot": "sheet-content",
|
|
12415
11754
|
className: cn(
|
|
12416
|
-
"fixed z-50 flex flex-col gap-
|
|
11755
|
+
"fixed z-50 flex flex-col gap-2 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
12417
11756
|
side === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
12418
11757
|
side === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
12419
11758
|
side === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
@@ -12437,7 +11776,7 @@ function SheetHeader({ className, ...props }) {
|
|
|
12437
11776
|
"div",
|
|
12438
11777
|
{
|
|
12439
11778
|
"data-slot": "sheet-header",
|
|
12440
|
-
className: cn("flex flex-col gap-1.5 p-
|
|
11779
|
+
className: cn("flex flex-col gap-1.5 p-2", className),
|
|
12441
11780
|
...props
|
|
12442
11781
|
}
|
|
12443
11782
|
);
|
|
@@ -12447,7 +11786,7 @@ function SheetFooter({ className, ...props }) {
|
|
|
12447
11786
|
"div",
|
|
12448
11787
|
{
|
|
12449
11788
|
"data-slot": "sheet-footer",
|
|
12450
|
-
className: cn("mt-auto flex flex-col gap-2 p-
|
|
11789
|
+
className: cn("mt-auto flex flex-col gap-2 p-2", className),
|
|
12451
11790
|
...props
|
|
12452
11791
|
}
|
|
12453
11792
|
);
|
|
@@ -12734,6 +12073,975 @@ function TooltipContent({
|
|
|
12734
12073
|
}
|
|
12735
12074
|
) });
|
|
12736
12075
|
}
|
|
12076
|
+
|
|
12077
|
+
// src/components/custom/keyboard/keyboard-types.ts
|
|
12078
|
+
var KeyboardTypes = /* @__PURE__ */ ((KeyboardTypes3) => {
|
|
12079
|
+
KeyboardTypes3["QWERTY"] = "qwerty";
|
|
12080
|
+
KeyboardTypes3["NUMBER"] = "number";
|
|
12081
|
+
KeyboardTypes3["QWERTY_NOT_CHARS"] = "qwerty_not_chars";
|
|
12082
|
+
return KeyboardTypes3;
|
|
12083
|
+
})(KeyboardTypes || {});
|
|
12084
|
+
|
|
12085
|
+
// src/components/custom/keyboard/providers/keyboard.store.ts
|
|
12086
|
+
var useKeyboardStore = zustand.create((set, get) => ({
|
|
12087
|
+
isInputRequired: false,
|
|
12088
|
+
activeInput: null,
|
|
12089
|
+
inputs: {},
|
|
12090
|
+
type: "qwerty" /* QWERTY */,
|
|
12091
|
+
currentInputField: null,
|
|
12092
|
+
children: void 0,
|
|
12093
|
+
isOpen: false,
|
|
12094
|
+
isOpenDynamic: false,
|
|
12095
|
+
value: "",
|
|
12096
|
+
onEnter: void 0,
|
|
12097
|
+
setChildren(children) {
|
|
12098
|
+
set({ children });
|
|
12099
|
+
},
|
|
12100
|
+
setOnEnter(onEnter) {
|
|
12101
|
+
set({ onEnter });
|
|
12102
|
+
},
|
|
12103
|
+
setCurrentInputField(inputField) {
|
|
12104
|
+
set({ currentInputField: inputField, isInputRequired: true });
|
|
12105
|
+
},
|
|
12106
|
+
setIsOpen(open) {
|
|
12107
|
+
if (!open) set({ value: "" });
|
|
12108
|
+
set({ isOpen: open ?? !get().isOpen, children: void 0 });
|
|
12109
|
+
if (!get().isOpen) {
|
|
12110
|
+
set({
|
|
12111
|
+
children: void 0,
|
|
12112
|
+
value: "",
|
|
12113
|
+
currentInputField: null,
|
|
12114
|
+
isInputRequired: false,
|
|
12115
|
+
onEnter: void 0
|
|
12116
|
+
});
|
|
12117
|
+
}
|
|
12118
|
+
},
|
|
12119
|
+
setIsOpenDynamic(open) {
|
|
12120
|
+
if (!open) set({ value: "" });
|
|
12121
|
+
set({ isOpenDynamic: open ?? !get().isOpenDynamic });
|
|
12122
|
+
if (!get().isOpenDynamic) {
|
|
12123
|
+
set({
|
|
12124
|
+
children: void 0,
|
|
12125
|
+
value: "",
|
|
12126
|
+
currentInputField: null,
|
|
12127
|
+
isInputRequired: false
|
|
12128
|
+
});
|
|
12129
|
+
}
|
|
12130
|
+
},
|
|
12131
|
+
registerInput: (id, initialValue = "") => set((state) => ({
|
|
12132
|
+
inputs: {
|
|
12133
|
+
...state.inputs,
|
|
12134
|
+
[id]: initialValue
|
|
12135
|
+
}
|
|
12136
|
+
})),
|
|
12137
|
+
unregisterInput: (id) => set((state) => {
|
|
12138
|
+
const newInputs = { ...state.inputs };
|
|
12139
|
+
delete newInputs[id];
|
|
12140
|
+
return { inputs: newInputs };
|
|
12141
|
+
}),
|
|
12142
|
+
focusInput: (id) => set({ activeInput: id }),
|
|
12143
|
+
// write: (char) =>
|
|
12144
|
+
// set((state) => {
|
|
12145
|
+
// const current = state.currentInputField;
|
|
12146
|
+
// if (!current?.field) return state;
|
|
12147
|
+
// const newValue = (current.field.value ?? "") + char;
|
|
12148
|
+
// current.field.onChange(newValue); // 🔥 RHF update
|
|
12149
|
+
// return {
|
|
12150
|
+
// currentInputField: {
|
|
12151
|
+
// ...current,
|
|
12152
|
+
// field: {
|
|
12153
|
+
// ...current.field,
|
|
12154
|
+
// value: newValue
|
|
12155
|
+
// }
|
|
12156
|
+
// }
|
|
12157
|
+
// };
|
|
12158
|
+
// }),
|
|
12159
|
+
write: (char) => set((state) => {
|
|
12160
|
+
if (!state.isInputRequired) {
|
|
12161
|
+
const newValue = get().value + char;
|
|
12162
|
+
set({ value: newValue });
|
|
12163
|
+
state.value = newValue;
|
|
12164
|
+
return state;
|
|
12165
|
+
}
|
|
12166
|
+
let currentInputField = state.currentInputField;
|
|
12167
|
+
if (currentInputField && currentInputField.field) {
|
|
12168
|
+
currentInputField.field.value += char;
|
|
12169
|
+
const newValue = currentInputField.field.value;
|
|
12170
|
+
set({ currentInputField });
|
|
12171
|
+
currentInputField.field.onChange(newValue);
|
|
12172
|
+
}
|
|
12173
|
+
if (!state.activeInput) return state;
|
|
12174
|
+
const current = state.inputs[state.activeInput] || "";
|
|
12175
|
+
return {
|
|
12176
|
+
inputs: {
|
|
12177
|
+
...state.inputs,
|
|
12178
|
+
[state.activeInput]: current + char
|
|
12179
|
+
}
|
|
12180
|
+
};
|
|
12181
|
+
}),
|
|
12182
|
+
backspace: () => set((state) => {
|
|
12183
|
+
if (!state.isInputRequired) {
|
|
12184
|
+
set({ value: state.value.slice(0, -1) });
|
|
12185
|
+
state.value = state.value.slice(0, -1);
|
|
12186
|
+
}
|
|
12187
|
+
let currentInputField = state.currentInputField;
|
|
12188
|
+
if (currentInputField && currentInputField.field) {
|
|
12189
|
+
const newValue = currentInputField.field.value.slice(0, -1);
|
|
12190
|
+
currentInputField.field.value = newValue;
|
|
12191
|
+
set({ currentInputField });
|
|
12192
|
+
currentInputField.field.onChange(newValue);
|
|
12193
|
+
}
|
|
12194
|
+
if (!state.activeInput) return state;
|
|
12195
|
+
const current = state.inputs[state.activeInput] || "";
|
|
12196
|
+
console.log("RUN BACKSPACE - current value:", current);
|
|
12197
|
+
return {
|
|
12198
|
+
inputs: {
|
|
12199
|
+
...state.inputs,
|
|
12200
|
+
[state.activeInput]: current.slice(0, -1)
|
|
12201
|
+
}
|
|
12202
|
+
};
|
|
12203
|
+
}),
|
|
12204
|
+
clear: () => set((state) => {
|
|
12205
|
+
if (!state.isInputRequired) {
|
|
12206
|
+
set({ value: "" });
|
|
12207
|
+
state.value = "";
|
|
12208
|
+
}
|
|
12209
|
+
if (!state.activeInput) return state;
|
|
12210
|
+
return {
|
|
12211
|
+
inputs: {
|
|
12212
|
+
...state.inputs,
|
|
12213
|
+
[state.activeInput]: ""
|
|
12214
|
+
}
|
|
12215
|
+
};
|
|
12216
|
+
}),
|
|
12217
|
+
setValue: (id, value) => set((state) => ({
|
|
12218
|
+
inputs: {
|
|
12219
|
+
...state.inputs,
|
|
12220
|
+
[id]: value
|
|
12221
|
+
}
|
|
12222
|
+
}))
|
|
12223
|
+
}));
|
|
12224
|
+
var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom" }) => {
|
|
12225
|
+
const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
|
|
12226
|
+
const storeIsOpen = useKeyboardStore((state) => state.isOpen);
|
|
12227
|
+
const controlledIsOpen = typeof isOpen === "boolean" ? isOpen : storeIsOpen;
|
|
12228
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: controlledIsOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsx(SheetContent, { side, className, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
|
|
12229
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
|
|
12230
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetDescription, { children: [
|
|
12231
|
+
childrenHeader,
|
|
12232
|
+
children
|
|
12233
|
+
] })
|
|
12234
|
+
] }) }) });
|
|
12235
|
+
};
|
|
12236
|
+
var DynamicDialog = ({
|
|
12237
|
+
open,
|
|
12238
|
+
onOpenChange,
|
|
12239
|
+
trigger,
|
|
12240
|
+
title = "Are you absolutely sure?",
|
|
12241
|
+
description = "This action cannot be undone.",
|
|
12242
|
+
cancelText = "Cerrar",
|
|
12243
|
+
actionText = "Procesar",
|
|
12244
|
+
className = "bg-red-600 text-white font-bold",
|
|
12245
|
+
variant = "info",
|
|
12246
|
+
loading = false,
|
|
12247
|
+
autoCloseOnFinish = true,
|
|
12248
|
+
onAction,
|
|
12249
|
+
children,
|
|
12250
|
+
listBtnConfig = [],
|
|
12251
|
+
btnGroupDirection = "flex-end",
|
|
12252
|
+
submitBtnClass = "h-16",
|
|
12253
|
+
iconSize = "w-16 h-16",
|
|
12254
|
+
btnHeightClass = "h-16 text-xl",
|
|
12255
|
+
showActionBtn = true,
|
|
12256
|
+
centerContent = false
|
|
12257
|
+
}) => {
|
|
12258
|
+
const isLoading = variant === "loading" || loading;
|
|
12259
|
+
React3.useEffect(() => {
|
|
12260
|
+
if (!isLoading && open && autoCloseOnFinish) {
|
|
12261
|
+
onOpenChange?.(false);
|
|
12262
|
+
}
|
|
12263
|
+
}, [isLoading]);
|
|
12264
|
+
const getVariantStyles = () => {
|
|
12265
|
+
switch (variant) {
|
|
12266
|
+
case "info":
|
|
12267
|
+
return {
|
|
12268
|
+
container: "!bg-blue-100 !text-blue-800 dark:!bg-blue-900 dark:!text-blue-200",
|
|
12269
|
+
border: "!border-blue-500/30 dark:!border-blue-300/30",
|
|
12270
|
+
media: "bg-blue-500/10 dark:bg-blue-300/10",
|
|
12271
|
+
action: "text-blue-200 bg-blue-500 dark:bg-blue-300",
|
|
12272
|
+
icon: "text-blue-500 dark:text-blue-300",
|
|
12273
|
+
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleWarning, { className: iconSize })
|
|
12274
|
+
};
|
|
12275
|
+
case "warning":
|
|
12276
|
+
return {
|
|
12277
|
+
container: "!bg-yellow-100 !text-yellow-800 dark:!bg-yellow-900 dark:!text-yellow-200",
|
|
12278
|
+
border: "!border-yellow-500/30 dark:!border-yellow-300/30",
|
|
12279
|
+
media: "bg-yellow-500/10 dark:bg-yellow-300/10",
|
|
12280
|
+
action: "text-yellow-200 bg-yellow-500 dark:bg-yellow-300",
|
|
12281
|
+
icon: "text-yellow-500 dark:text-yellow-300",
|
|
12282
|
+
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: iconSize })
|
|
12283
|
+
};
|
|
12284
|
+
case "error":
|
|
12285
|
+
case "delete":
|
|
12286
|
+
return {
|
|
12287
|
+
container: "!bg-red-100 !text-red-800 dark:!bg-red-900 dark:!text-red-200",
|
|
12288
|
+
border: "!border-red-500/30 dark:!border-red-300/30",
|
|
12289
|
+
media: "bg-red-500/10 dark:bg-red-300/10",
|
|
12290
|
+
action: "text-red-200 bg-red-500 dark:bg-red-300",
|
|
12291
|
+
icon: "text-red-500 dark:text-red-300",
|
|
12292
|
+
iconNode: variant === "delete" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonX, { className: iconSize })
|
|
12293
|
+
};
|
|
12294
|
+
case "success":
|
|
12295
|
+
return {
|
|
12296
|
+
container: "!bg-green-100 !text-green-800 dark:!bg-green-900 dark:!text-green-200",
|
|
12297
|
+
border: "!border-green-500/30 dark:!border-green-300/30",
|
|
12298
|
+
media: "bg-green-500/10 dark:bg-green-300/10",
|
|
12299
|
+
action: "text-green-200 bg-green-500 dark:bg-green-300",
|
|
12300
|
+
icon: "text-green-500 dark:text-green-300",
|
|
12301
|
+
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: iconSize })
|
|
12302
|
+
};
|
|
12303
|
+
case "confirm":
|
|
12304
|
+
return {
|
|
12305
|
+
container: "!bg-purple-100 !text-purple-800 dark:!bg-purple-900 dark:!text-purple-200",
|
|
12306
|
+
border: "!border-purple-500/30 dark:!border-purple-300/30",
|
|
12307
|
+
media: "bg-purple-500/10 dark:bg-purple-300/10",
|
|
12308
|
+
action: "text-purple-200 bg-purple-500 dark:bg-purple-300",
|
|
12309
|
+
icon: "text-purple-500 dark:text-purple-300",
|
|
12310
|
+
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleQuestionMark, { className: iconSize })
|
|
12311
|
+
};
|
|
12312
|
+
case "loading":
|
|
12313
|
+
return {
|
|
12314
|
+
container: "!bg-gray-100 !text-gray-800 dark:!bg-gray-900 dark:!text-gray-200",
|
|
12315
|
+
border: "!border-gray-500/30 dark:!border-gray-300/30",
|
|
12316
|
+
media: "bg-gray-500/10 dark:bg-gray-300/10",
|
|
12317
|
+
action: "text-gray-200 bg-gray-500 dark:bg-gray-300",
|
|
12318
|
+
icon: "text-gray-500 dark:text-gray-300",
|
|
12319
|
+
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: cn(iconSize, "animate-spin") })
|
|
12320
|
+
};
|
|
12321
|
+
}
|
|
12322
|
+
};
|
|
12323
|
+
const styles = getVariantStyles();
|
|
12324
|
+
const handleActionClick = async () => {
|
|
12325
|
+
if (!onAction) return;
|
|
12326
|
+
const result = onAction();
|
|
12327
|
+
if (result instanceof Promise) {
|
|
12328
|
+
await result;
|
|
12329
|
+
}
|
|
12330
|
+
};
|
|
12331
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog, { open, onOpenChange, children: [
|
|
12332
|
+
trigger && /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTrigger, { asChild: true, children: trigger }),
|
|
12333
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12334
|
+
AlertDialogContent,
|
|
12335
|
+
{
|
|
12336
|
+
className: cn(
|
|
12337
|
+
"w-full h-fit font-mono border-x-8",
|
|
12338
|
+
styles.container,
|
|
12339
|
+
styles.border
|
|
12340
|
+
),
|
|
12341
|
+
children: [
|
|
12342
|
+
/* @__PURE__ */ jsxRuntime.jsxs(AlertDialogHeader, { className: "flex flex-col justify-center w-full text-center", children: [
|
|
12343
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12344
|
+
AlertDialogMedia,
|
|
12345
|
+
{
|
|
12346
|
+
className: cn(
|
|
12347
|
+
styles.media,
|
|
12348
|
+
"rounded-full flex items-center justify-center",
|
|
12349
|
+
iconSize
|
|
12350
|
+
),
|
|
12351
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.icon, children: styles.iconNode })
|
|
12352
|
+
}
|
|
12353
|
+
) }),
|
|
12354
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogTitle, { className: "text-2xl text-center w-full", children: title }),
|
|
12355
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { className: cn("text-xl w-full flex-row", centerContent ? "text-center" : "text-left"), children: description })
|
|
12356
|
+
] }),
|
|
12357
|
+
children,
|
|
12358
|
+
!isLoading && /* @__PURE__ */ jsxRuntime.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12359
|
+
ButtonGroup,
|
|
12360
|
+
{
|
|
12361
|
+
className: "flex w-full",
|
|
12362
|
+
style: {
|
|
12363
|
+
justifyContent: btnGroupDirection,
|
|
12364
|
+
alignItems: "center"
|
|
12365
|
+
},
|
|
12366
|
+
children: [
|
|
12367
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { className: cn("flex-1", btnHeightClass), children: cancelText }),
|
|
12368
|
+
listBtnConfig.map((btn, key) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12369
|
+
Button,
|
|
12370
|
+
{
|
|
12371
|
+
type: btn.btnType,
|
|
12372
|
+
size: "lg",
|
|
12373
|
+
className: cn(btnHeightClass, submitBtnClass),
|
|
12374
|
+
variant: btn.variant,
|
|
12375
|
+
onClick: btn.onClick,
|
|
12376
|
+
disabled: btn.disabled,
|
|
12377
|
+
children: btn.label
|
|
12378
|
+
},
|
|
12379
|
+
key
|
|
12380
|
+
)),
|
|
12381
|
+
onAction && showActionBtn && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12382
|
+
AlertDialogAction,
|
|
12383
|
+
{
|
|
12384
|
+
onClick: handleActionClick,
|
|
12385
|
+
className: cn(
|
|
12386
|
+
"flex-1",
|
|
12387
|
+
btnHeightClass,
|
|
12388
|
+
className,
|
|
12389
|
+
styles.action
|
|
12390
|
+
),
|
|
12391
|
+
children: actionText
|
|
12392
|
+
}
|
|
12393
|
+
)
|
|
12394
|
+
]
|
|
12395
|
+
}
|
|
12396
|
+
) })
|
|
12397
|
+
]
|
|
12398
|
+
}
|
|
12399
|
+
)
|
|
12400
|
+
] });
|
|
12401
|
+
};
|
|
12402
|
+
var InputList = ({ handleAddInput, inputsTypes }) => {
|
|
12403
|
+
const [inputSetups, setInputSetups] = React3.useState(
|
|
12404
|
+
() => Object.fromEntries(
|
|
12405
|
+
inputsTypes.map((type) => [type, { required: false, disabled: false }])
|
|
12406
|
+
)
|
|
12407
|
+
);
|
|
12408
|
+
const toggleConfig = (type, key) => {
|
|
12409
|
+
setInputSetups((prev) => ({
|
|
12410
|
+
...prev,
|
|
12411
|
+
[type]: { ...prev[type], [key]: !prev[type][key] }
|
|
12412
|
+
}));
|
|
12413
|
+
};
|
|
12414
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-1", children: inputsTypes.map((type) => {
|
|
12415
|
+
const setup = inputSetups[type];
|
|
12416
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12417
|
+
"div",
|
|
12418
|
+
{
|
|
12419
|
+
className: "border rounded-lg p-2 flex flex-col-2 gap-1 shadow-sm",
|
|
12420
|
+
children: [
|
|
12421
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "icon", onClick: () => handleAddInput(type, setup), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
|
|
12422
|
+
/* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(AccordionItem, { value: "item-1", children: [
|
|
12423
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccordionTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row justify-center w-full content-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-xl", children: type }) }) }),
|
|
12424
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
12425
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12426
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12427
|
+
Switch,
|
|
12428
|
+
{
|
|
12429
|
+
checked: setup.required,
|
|
12430
|
+
onCheckedChange: () => toggleConfig(type, "required")
|
|
12431
|
+
}
|
|
12432
|
+
),
|
|
12433
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Required" })
|
|
12434
|
+
] }),
|
|
12435
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2", children: [
|
|
12436
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12437
|
+
Switch,
|
|
12438
|
+
{
|
|
12439
|
+
checked: setup.disabled,
|
|
12440
|
+
onCheckedChange: () => toggleConfig(type, "disabled")
|
|
12441
|
+
}
|
|
12442
|
+
),
|
|
12443
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Disabled" })
|
|
12444
|
+
] })
|
|
12445
|
+
] }) })
|
|
12446
|
+
] }) })
|
|
12447
|
+
]
|
|
12448
|
+
},
|
|
12449
|
+
type
|
|
12450
|
+
);
|
|
12451
|
+
}) });
|
|
12452
|
+
};
|
|
12453
|
+
|
|
12454
|
+
// src/components/custom/form/input-errors.ts
|
|
12455
|
+
var validationMessages = {
|
|
12456
|
+
required: "Este campo es obligatorio",
|
|
12457
|
+
email: "El correo electr\xF3nico no es v\xE1lido",
|
|
12458
|
+
invalidFormat: "Formato inv\xE1lido",
|
|
12459
|
+
onlyPositive: "Solo n\xFAmeros positivos",
|
|
12460
|
+
minLength: (length) => `Debe tener al menos ${length} caracteres`,
|
|
12461
|
+
maxLength: (length) => `No puede tener m\xE1s de ${length} caracteres`,
|
|
12462
|
+
passwordMismatch: "Las contrase\xF1as no coinciden",
|
|
12463
|
+
invalidPhone: "El n\xFAmero de tel\xE9fono no es v\xE1lido"
|
|
12464
|
+
};
|
|
12465
|
+
function normalizeBorder(border, defaultWidth = 4) {
|
|
12466
|
+
if (!border) return null;
|
|
12467
|
+
if (typeof border === "string") {
|
|
12468
|
+
return { width: defaultWidth, color: border };
|
|
12469
|
+
}
|
|
12470
|
+
return { width: border.width ?? defaultWidth, color: border.color };
|
|
12471
|
+
}
|
|
12472
|
+
function generateBorderShadows(borders) {
|
|
12473
|
+
if (!borders) return "none";
|
|
12474
|
+
const shadows = [];
|
|
12475
|
+
const allBorder = normalizeBorder(borders.all);
|
|
12476
|
+
const left = normalizeBorder(borders.left) ?? allBorder;
|
|
12477
|
+
const right = normalizeBorder(borders.right) ?? allBorder;
|
|
12478
|
+
const top = normalizeBorder(borders.top) ?? allBorder;
|
|
12479
|
+
const bottom = normalizeBorder(borders.bottom) ?? allBorder;
|
|
12480
|
+
if (left?.color) {
|
|
12481
|
+
shadows.push(`inset ${left.width}px 0 0 0 ${left.color}`);
|
|
12482
|
+
}
|
|
12483
|
+
if (right?.color) {
|
|
12484
|
+
shadows.push(`inset -${right.width}px 0 0 0 ${right.color}`);
|
|
12485
|
+
}
|
|
12486
|
+
if (top?.color) {
|
|
12487
|
+
shadows.push(`inset 0 ${top.width}px 0 0 ${top.color}`);
|
|
12488
|
+
}
|
|
12489
|
+
if (bottom?.color) {
|
|
12490
|
+
shadows.push(`inset 0 -${bottom.width}px 0 0 ${bottom.color}`);
|
|
12491
|
+
}
|
|
12492
|
+
return shadows.length > 0 ? shadows.join(", ") : "none";
|
|
12493
|
+
}
|
|
12494
|
+
var Key = ({
|
|
12495
|
+
label,
|
|
12496
|
+
onClick,
|
|
12497
|
+
onDoubleClick,
|
|
12498
|
+
style,
|
|
12499
|
+
disabled = false,
|
|
12500
|
+
className,
|
|
12501
|
+
shortcut,
|
|
12502
|
+
children,
|
|
12503
|
+
withLabel = true,
|
|
12504
|
+
isActive = false,
|
|
12505
|
+
fontSize = "text-sm",
|
|
12506
|
+
icons,
|
|
12507
|
+
borders,
|
|
12508
|
+
// iconSize = 72,
|
|
12509
|
+
iconClassName = "w-8 h-8"
|
|
12510
|
+
}) => {
|
|
12511
|
+
let content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12512
|
+
withLabel && label,
|
|
12513
|
+
shortcut && ` (${shortcut})`
|
|
12514
|
+
] });
|
|
12515
|
+
if (children) content = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
12516
|
+
const borderShadow = generateBorderShadows(borders);
|
|
12517
|
+
const hasBorders = borders && borderShadow !== "none";
|
|
12518
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12519
|
+
Button,
|
|
12520
|
+
{
|
|
12521
|
+
disabled,
|
|
12522
|
+
onDoubleClick,
|
|
12523
|
+
onClick: (e) => onClick?.(label ?? e.currentTarget.textContent ?? ""),
|
|
12524
|
+
style: {
|
|
12525
|
+
...style,
|
|
12526
|
+
...hasBorders && { boxShadow: borderShadow }
|
|
12527
|
+
},
|
|
12528
|
+
className: cn(
|
|
12529
|
+
// Base
|
|
12530
|
+
"shadow-md shadow-black/20",
|
|
12531
|
+
"flex flex-1 items-center justify-center rounded-lg h-full w-full",
|
|
12532
|
+
"font-mono font-bold transition-all duration-100",
|
|
12533
|
+
"active:scale-95",
|
|
12534
|
+
fontSize,
|
|
12535
|
+
// Estados base (soft UI)
|
|
12536
|
+
"border border-(--color-border)",
|
|
12537
|
+
"bg-(--color-secondary-soft) text-(--color-foreground)",
|
|
12538
|
+
// Hover
|
|
12539
|
+
"hover:bg-(--color-accent-soft)",
|
|
12540
|
+
// Active click (presionado)
|
|
12541
|
+
"active:bg-(--color-primary) active:text-(--color-primary-foreground)",
|
|
12542
|
+
// Estado activo (seleccionado)
|
|
12543
|
+
isActive && "bg-(--color-primary) text-(--color-primary-foreground) border-(--color-primary)",
|
|
12544
|
+
// Backspace especial
|
|
12545
|
+
// label === '⌫' &&
|
|
12546
|
+
// 'bg-(--color-destructive) text-white hover:opacity-90',
|
|
12547
|
+
// Overflow hidden para que los bordes respeten el border-radius
|
|
12548
|
+
"overflow-hidden",
|
|
12549
|
+
className
|
|
12550
|
+
),
|
|
12551
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center items-center", children: [
|
|
12552
|
+
icons && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row justify-center text-3xl", children: icons.map((IconComponent, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12553
|
+
IconComponent,
|
|
12554
|
+
{
|
|
12555
|
+
className: iconClassName
|
|
12556
|
+
},
|
|
12557
|
+
index
|
|
12558
|
+
)) }),
|
|
12559
|
+
content
|
|
12560
|
+
] })
|
|
12561
|
+
}
|
|
12562
|
+
);
|
|
12563
|
+
};
|
|
12564
|
+
var applyCase = (label, upper) => {
|
|
12565
|
+
if (!label || label.length !== 1 || !/[a-z]/.test(label)) return label;
|
|
12566
|
+
return upper ? label.toUpperCase() : label;
|
|
12567
|
+
};
|
|
12568
|
+
var letter = (l, isUpper, handleKey) => ({
|
|
12569
|
+
label: applyCase(l, isUpper),
|
|
12570
|
+
onClick: handleKey,
|
|
12571
|
+
className: "flex-1"
|
|
12572
|
+
});
|
|
12573
|
+
|
|
12574
|
+
// src/components/custom/keyboard/keyboard-base.tsx
|
|
12575
|
+
var BaseKeyboard = class {
|
|
12576
|
+
constructor(input, children, className, keyFontSize) {
|
|
12577
|
+
this.input = input;
|
|
12578
|
+
this.children = children;
|
|
12579
|
+
this.className = className;
|
|
12580
|
+
this.keyFontSize = keyFontSize;
|
|
12581
|
+
}
|
|
12582
|
+
};
|
|
12583
|
+
var KeyboardBuilder = ({
|
|
12584
|
+
keys,
|
|
12585
|
+
withCard = false,
|
|
12586
|
+
className,
|
|
12587
|
+
keyFontSize
|
|
12588
|
+
}) => {
|
|
12589
|
+
const keyMap = React3.useMemo(() => {
|
|
12590
|
+
const map = /* @__PURE__ */ new Map();
|
|
12591
|
+
keys?.forEach((row) => {
|
|
12592
|
+
row.forEach((k) => {
|
|
12593
|
+
if (k.shortcut) {
|
|
12594
|
+
map.set(k.shortcut.toLowerCase(), k);
|
|
12595
|
+
}
|
|
12596
|
+
});
|
|
12597
|
+
});
|
|
12598
|
+
return map;
|
|
12599
|
+
}, [keys]);
|
|
12600
|
+
const triggerKey = React3.useCallback((pressedKey) => {
|
|
12601
|
+
const key = keyMap.get(pressedKey.toLowerCase());
|
|
12602
|
+
if (key && !key.disabled) {
|
|
12603
|
+
key.onClick?.(pressedKey);
|
|
12604
|
+
const keyboardEvent = new KeyboardEvent("keydown", {
|
|
12605
|
+
key: pressedKey,
|
|
12606
|
+
bubbles: true
|
|
12607
|
+
});
|
|
12608
|
+
window.dispatchEvent(keyboardEvent);
|
|
12609
|
+
}
|
|
12610
|
+
}, [keyMap]);
|
|
12611
|
+
React3.useEffect(() => {
|
|
12612
|
+
const handleKeyDown = (event) => {
|
|
12613
|
+
const active = document.activeElement;
|
|
12614
|
+
if (active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement || active && active.getAttribute("contenteditable") === "true") {
|
|
12615
|
+
console.log("\u{1F680} ~ Ignorando tecla porque el foco est\xE1 en un input:", event.key);
|
|
12616
|
+
return;
|
|
12617
|
+
}
|
|
12618
|
+
triggerKey(event.key);
|
|
12619
|
+
event.preventDefault();
|
|
12620
|
+
};
|
|
12621
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
12622
|
+
return () => {
|
|
12623
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
12624
|
+
};
|
|
12625
|
+
}, [triggerKey]);
|
|
12626
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
12627
|
+
"div",
|
|
12628
|
+
{
|
|
12629
|
+
className: cn(
|
|
12630
|
+
`flex-1 grid grid-rows-${keys?.length} py-0.5 h-full`,
|
|
12631
|
+
className
|
|
12632
|
+
),
|
|
12633
|
+
children: keys?.map((row, ri) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row py-0.5 gap-1 h-full", children: row.map((key, indx) => {
|
|
12634
|
+
const handleClick = () => {
|
|
12635
|
+
triggerKey(key.label ?? "");
|
|
12636
|
+
key.onClick?.(key.label ?? "");
|
|
12637
|
+
if (!key.shortcut) return;
|
|
12638
|
+
triggerKey(key.shortcut);
|
|
12639
|
+
};
|
|
12640
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12641
|
+
key.label == "" && !key.icons?.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${key.className}` }, indx),
|
|
12642
|
+
(key.label != "" || key.icons?.length) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12643
|
+
Key,
|
|
12644
|
+
{
|
|
12645
|
+
borders: {
|
|
12646
|
+
left: key.disabled ? "grey" : "",
|
|
12647
|
+
bottom: key.disabled ? "grey" : ""
|
|
12648
|
+
},
|
|
12649
|
+
label: key.label,
|
|
12650
|
+
onClick: handleClick,
|
|
12651
|
+
shortcut: key.shortcut,
|
|
12652
|
+
icons: key.icons,
|
|
12653
|
+
className: `${key.className} ${key.disabled ? "bg-muted-foreground h-full" : "h-full"}`,
|
|
12654
|
+
iconClassName: key.iconClassName,
|
|
12655
|
+
iconSize: key.iconSize,
|
|
12656
|
+
fontSize: keyFontSize,
|
|
12657
|
+
isActive: key.isActive,
|
|
12658
|
+
disabled: key.disabled,
|
|
12659
|
+
style: key.style,
|
|
12660
|
+
children: key.children
|
|
12661
|
+
},
|
|
12662
|
+
indx
|
|
12663
|
+
)
|
|
12664
|
+
] });
|
|
12665
|
+
}) }, ri))
|
|
12666
|
+
}
|
|
12667
|
+
);
|
|
12668
|
+
if (!withCard) return content;
|
|
12669
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full h-full m-0.5 p-1", className), children: content });
|
|
12670
|
+
};
|
|
12671
|
+
|
|
12672
|
+
// src/components/custom/form/inputs/base/definitions.ts
|
|
12673
|
+
var flattenFields = (fields, onAnyFieldChange) => {
|
|
12674
|
+
const result = [];
|
|
12675
|
+
for (const field of fields) {
|
|
12676
|
+
if (Array.isArray(field)) {
|
|
12677
|
+
result.push(...flattenFields(field));
|
|
12678
|
+
} else if (field.fields) {
|
|
12679
|
+
result.push(...flattenFields(field.fields));
|
|
12680
|
+
} else {
|
|
12681
|
+
if (onAnyFieldChange) field.onAnyFieldChange = (data) => onAnyFieldChange(data);
|
|
12682
|
+
result.push(field);
|
|
12683
|
+
}
|
|
12684
|
+
}
|
|
12685
|
+
return result;
|
|
12686
|
+
};
|
|
12687
|
+
var TextInputType = /* @__PURE__ */ ((TextInputType3) => {
|
|
12688
|
+
TextInputType3["DEFAULT"] = "default";
|
|
12689
|
+
TextInputType3["NUMBER"] = "number";
|
|
12690
|
+
TextInputType3["EMAIL"] = "email";
|
|
12691
|
+
TextInputType3["PHONE"] = "phone";
|
|
12692
|
+
TextInputType3["PASSWORD"] = "password";
|
|
12693
|
+
return TextInputType3;
|
|
12694
|
+
})(TextInputType || {});
|
|
12695
|
+
var QwertyKeyboard = class extends BaseKeyboard {
|
|
12696
|
+
render() {
|
|
12697
|
+
const { input, children, className, keyFontSize } = this;
|
|
12698
|
+
return /* @__PURE__ */ jsxRuntime.jsx(KeyboardQwerty, { children, input, className, keyFontSize });
|
|
12699
|
+
}
|
|
12700
|
+
};
|
|
12701
|
+
var KeyboardQwerty = ({ onKeyPress, onEnter, keyFontSize = "text-2xl", onDelete, input, children, className }) => {
|
|
12702
|
+
const [shiftMode, setShiftMode] = React3.useState("off");
|
|
12703
|
+
const [mode, setMode] = React3.useState("letters");
|
|
12704
|
+
const lastShiftPress = React3.useRef(0);
|
|
12705
|
+
const { currentInputField, write, setIsOpen, backspace, isInputRequired } = useKeyboardStore();
|
|
12706
|
+
const storeonEnter = useKeyboardStore((state) => state.onEnter);
|
|
12707
|
+
const isUpper = shiftMode !== "off";
|
|
12708
|
+
React3.useEffect(() => {
|
|
12709
|
+
const handleKeyDown = (e) => {
|
|
12710
|
+
if (isInputRequired && !currentInputField) return;
|
|
12711
|
+
const key = e.key;
|
|
12712
|
+
if (key === "Enter") {
|
|
12713
|
+
e.preventDefault();
|
|
12714
|
+
onEnter?.();
|
|
12715
|
+
storeonEnter?.();
|
|
12716
|
+
return;
|
|
12717
|
+
}
|
|
12718
|
+
if (key === "Backspace") {
|
|
12719
|
+
backspace();
|
|
12720
|
+
e.preventDefault();
|
|
12721
|
+
onDelete?.();
|
|
12722
|
+
return;
|
|
12723
|
+
}
|
|
12724
|
+
if (key === " ") {
|
|
12725
|
+
e.preventDefault();
|
|
12726
|
+
handleKey(" ");
|
|
12727
|
+
return;
|
|
12728
|
+
}
|
|
12729
|
+
if (key === "Shift") {
|
|
12730
|
+
handleShift();
|
|
12731
|
+
return;
|
|
12732
|
+
}
|
|
12733
|
+
if (key === "CapsLock") {
|
|
12734
|
+
handleCaps();
|
|
12735
|
+
return;
|
|
12736
|
+
}
|
|
12737
|
+
if (key === "Tab") {
|
|
12738
|
+
e.preventDefault();
|
|
12739
|
+
return;
|
|
12740
|
+
}
|
|
12741
|
+
if (key === "Escape") {
|
|
12742
|
+
setIsOpen(false);
|
|
12743
|
+
return;
|
|
12744
|
+
}
|
|
12745
|
+
if (key.length === 1) {
|
|
12746
|
+
handleKey(key);
|
|
12747
|
+
}
|
|
12748
|
+
};
|
|
12749
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
12750
|
+
return () => {
|
|
12751
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
12752
|
+
};
|
|
12753
|
+
}, [currentInputField, shiftMode]);
|
|
12754
|
+
const handleShift = () => {
|
|
12755
|
+
const now = Date.now();
|
|
12756
|
+
if (now - lastShiftPress.current < 300) {
|
|
12757
|
+
setShiftMode((prev) => prev === "caps" ? "off" : "caps");
|
|
12758
|
+
} else {
|
|
12759
|
+
setShiftMode((prev) => prev === "once" ? "off" : "once");
|
|
12760
|
+
}
|
|
12761
|
+
lastShiftPress.current = now;
|
|
12762
|
+
};
|
|
12763
|
+
const handleKey = (key) => {
|
|
12764
|
+
const output = isUpper ? key.toUpperCase() : key;
|
|
12765
|
+
onKeyPress?.(output);
|
|
12766
|
+
write(output);
|
|
12767
|
+
if (shiftMode === "once") setShiftMode("off");
|
|
12768
|
+
};
|
|
12769
|
+
const handleCaps = () => {
|
|
12770
|
+
setShiftMode((prev) => prev === "caps" ? "off" : "caps");
|
|
12771
|
+
};
|
|
12772
|
+
const shiftLabel = shiftMode === "caps" ? lucideReact.ArrowBigUpDash : lucideReact.ArrowBigUp;
|
|
12773
|
+
const shiftActive = shiftMode !== "off";
|
|
12774
|
+
const textField = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12775
|
+
children && children,
|
|
12776
|
+
!children && currentInputField && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 h-full min-h-16 flex-1 flex flex-row text-2xl font-bold justify-center text-center items-center gap-2 rounded-xl border-2 transition-all outline-none border-amber-400 bg-amber-50 ", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: currentInputField.input && currentInputField.input.keyboardType == "password" /* PASSWORD */ ? "\u2022".repeat(currentInputField.field?.value.toString().length) : currentInputField.field?.value || "" }) })
|
|
12777
|
+
] });
|
|
12778
|
+
const btnDelete = { label: "delete", icons: [lucideReact.DeleteIcon], onClick: () => {
|
|
12779
|
+
backspace();
|
|
12780
|
+
}, className: "bg-red-200 text-xs", style: { backgroundColor: "#faba005e" } };
|
|
12781
|
+
const btnEsc = { label: "esc", onClick: () => {
|
|
12782
|
+
setIsOpen(false);
|
|
12783
|
+
}, className: "", style: { backgroundColor: "#ffc0c0" } };
|
|
12784
|
+
const btnEnter = { label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200", style: { backgroundColor: "#008f003d" } };
|
|
12785
|
+
if (mode === "symbols") {
|
|
12786
|
+
const keys = [
|
|
12787
|
+
["esc", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"],
|
|
12788
|
+
["~", "`", "|", "\\", "/", "{", "}", "[", "]"],
|
|
12789
|
+
["+", "=", "<", ">", "?", "'", '"', ":", ";"]
|
|
12790
|
+
].map(
|
|
12791
|
+
(row, index) => row.map(
|
|
12792
|
+
(k, idx) => {
|
|
12793
|
+
const isEsc = k == "esc";
|
|
12794
|
+
if (index == 0 && idx == row.length - 1) return btnDelete;
|
|
12795
|
+
if (isEsc) return btnEsc;
|
|
12796
|
+
return {
|
|
12797
|
+
label: k,
|
|
12798
|
+
onClick: () => isEsc ? setIsOpen(false) : handleKey(k),
|
|
12799
|
+
className: isEsc ? "bg-red-600" : ""
|
|
12800
|
+
};
|
|
12801
|
+
}
|
|
12802
|
+
)
|
|
12803
|
+
);
|
|
12804
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full h-full flex flex-col", className), children: [
|
|
12805
|
+
textField,
|
|
12806
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12807
|
+
KeyboardBuilder,
|
|
12808
|
+
{
|
|
12809
|
+
className: "w-full h-full",
|
|
12810
|
+
keyFontSize,
|
|
12811
|
+
keys: [
|
|
12812
|
+
...keys,
|
|
12813
|
+
[
|
|
12814
|
+
{ label: "ABC", onClick: () => setMode("letters"), className: "flex-[2]" },
|
|
12815
|
+
{ label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
|
|
12816
|
+
btnEnter
|
|
12817
|
+
]
|
|
12818
|
+
]
|
|
12819
|
+
}
|
|
12820
|
+
)
|
|
12821
|
+
] });
|
|
12822
|
+
}
|
|
12823
|
+
const fila1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"].map((l) => letter(l, isUpper, handleKey));
|
|
12824
|
+
const fila2 = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"].map((l) => letter(l, isUpper, handleKey));
|
|
12825
|
+
const fila3 = ["a", "s", "d", "f", "g", "h", "j", "k", "l"].map((l) => letter(l, isUpper, handleKey));
|
|
12826
|
+
const fila4 = ["z", "x", "c", "v", "b", "n", "m"].map((l) => letter(l, isUpper, handleKey));
|
|
12827
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
12828
|
+
textField,
|
|
12829
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12830
|
+
KeyboardBuilder,
|
|
12831
|
+
{
|
|
12832
|
+
className: "w-full h-full flex-3",
|
|
12833
|
+
keyFontSize,
|
|
12834
|
+
keys: [
|
|
12835
|
+
[
|
|
12836
|
+
btnEsc,
|
|
12837
|
+
...fila1,
|
|
12838
|
+
btnDelete
|
|
12839
|
+
],
|
|
12840
|
+
[
|
|
12841
|
+
{ label: "tab", onClick: () => {
|
|
12842
|
+
} },
|
|
12843
|
+
...fila2
|
|
12844
|
+
// { icons:[Delete], onClick: backspace, className: 'text-xs' },
|
|
12845
|
+
],
|
|
12846
|
+
[
|
|
12847
|
+
{ label: "caps", onClick: handleCaps },
|
|
12848
|
+
...fila3
|
|
12849
|
+
],
|
|
12850
|
+
[
|
|
12851
|
+
{
|
|
12852
|
+
label: "",
|
|
12853
|
+
icons: [shiftLabel],
|
|
12854
|
+
onClick: handleShift,
|
|
12855
|
+
className: "flex-1",
|
|
12856
|
+
isActive: shiftActive
|
|
12857
|
+
},
|
|
12858
|
+
...fila4,
|
|
12859
|
+
{ label: ".", onClick: () => handleKey(".") },
|
|
12860
|
+
{ label: "-", onClick: () => handleKey("-") },
|
|
12861
|
+
{ label: "_", onClick: () => handleKey("_") }
|
|
12862
|
+
],
|
|
12863
|
+
[
|
|
12864
|
+
{ label: "?123", onClick: () => setMode("symbols"), className: "flex-[2]" },
|
|
12865
|
+
{ label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
|
|
12866
|
+
btnEnter
|
|
12867
|
+
]
|
|
12868
|
+
]
|
|
12869
|
+
}
|
|
12870
|
+
)
|
|
12871
|
+
] });
|
|
12872
|
+
};
|
|
12873
|
+
var keyboardMap = {
|
|
12874
|
+
["qwerty" /* QWERTY */]: QwertyKeyboard,
|
|
12875
|
+
["qwerty_not_chars" /* QWERTY_NOT_CHARS */]: QwertyKeyboard,
|
|
12876
|
+
["number" /* NUMBER */]: QwertyKeyboard
|
|
12877
|
+
};
|
|
12878
|
+
var KeyboardFactory = class {
|
|
12879
|
+
static create(typeKeyboard, input, children, className, keyFontSize) {
|
|
12880
|
+
const inputKbType = input?.keyboardType;
|
|
12881
|
+
let keyboardType = typeKeyboard ?? "qwerty" /* QWERTY */;
|
|
12882
|
+
if (inputKbType) {
|
|
12883
|
+
if (inputKbType == "number" /* NUMBER */) keyboardType = "number" /* NUMBER */;
|
|
12884
|
+
}
|
|
12885
|
+
const keyboardClass = keyboardMap[keyboardType] ?? QwertyKeyboard;
|
|
12886
|
+
const instance = new keyboardClass(input, children, className, keyFontSize);
|
|
12887
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: instance.render() });
|
|
12888
|
+
}
|
|
12889
|
+
};
|
|
12890
|
+
|
|
12891
|
+
// src/components/custom/form/inputs/base/base-input.ts
|
|
12892
|
+
var BaseInput = class {
|
|
12893
|
+
constructor(input, form, isSubmitting) {
|
|
12894
|
+
this.input = input;
|
|
12895
|
+
this.form = form;
|
|
12896
|
+
this.isSubmitting = isSubmitting;
|
|
12897
|
+
}
|
|
12898
|
+
};
|
|
12899
|
+
var entityToInputOption = (entitiy, name = "name", description = "description", groupedLabel, optionLabel = "label") => ({
|
|
12900
|
+
id: entitiy["id"],
|
|
12901
|
+
name: entitiy[name],
|
|
12902
|
+
label: entitiy[optionLabel],
|
|
12903
|
+
description: entitiy[description],
|
|
12904
|
+
groupedLabel
|
|
12905
|
+
});
|
|
12906
|
+
var entitiesToInputOption = (data, optionValue = "name", groupedLabel, optionLabel = "description") => {
|
|
12907
|
+
const entities = [];
|
|
12908
|
+
for (const key of data) {
|
|
12909
|
+
const entidad = entityToInputOption(key, optionValue, optionLabel, groupedLabel);
|
|
12910
|
+
if (entidad) entities.push(entidad);
|
|
12911
|
+
}
|
|
12912
|
+
return entities;
|
|
12913
|
+
};
|
|
12914
|
+
var entityToGroupedOption = (entitiy, name = "name") => ({
|
|
12915
|
+
id: entitiy["id"],
|
|
12916
|
+
label: entitiy[name] || entitiy["label"],
|
|
12917
|
+
options: entitiy["options"] || [],
|
|
12918
|
+
selectedOptions: []
|
|
12919
|
+
});
|
|
12920
|
+
var entitiesToGroupedOption = (data, optionValue = "name") => {
|
|
12921
|
+
const entities = [];
|
|
12922
|
+
for (const key of data) {
|
|
12923
|
+
const entidad = entityToGroupedOption(key, optionValue);
|
|
12924
|
+
if (entidad) entities.push(entidad);
|
|
12925
|
+
}
|
|
12926
|
+
return entities;
|
|
12927
|
+
};
|
|
12928
|
+
var handleOnChage = (event, input, field) => {
|
|
12929
|
+
let value = event;
|
|
12930
|
+
if (event && typeof event === "object" && "target" in event) {
|
|
12931
|
+
value = event.target.value;
|
|
12932
|
+
}
|
|
12933
|
+
field?.onChange(value);
|
|
12934
|
+
const data = input.form?.getValues();
|
|
12935
|
+
input.onChange?.(value, data);
|
|
12936
|
+
input.onAnyFieldChange?.(data);
|
|
12937
|
+
};
|
|
12938
|
+
var isValidField = (input, form, defaultValue) => {
|
|
12939
|
+
const value = defaultValue ?? form.getValues(input.name);
|
|
12940
|
+
const fieldState = form.getFieldState(input.name);
|
|
12941
|
+
if (input.zodType) {
|
|
12942
|
+
const result = input.zodType.safeParse(value);
|
|
12943
|
+
return result.success;
|
|
12944
|
+
}
|
|
12945
|
+
return !fieldState.error && value !== void 0 && value !== "";
|
|
12946
|
+
};
|
|
12947
|
+
|
|
12948
|
+
// src/components/custom/form/inputs/base/input-types.ts
|
|
12949
|
+
var InputTypes = /* @__PURE__ */ ((InputTypes3) => {
|
|
12950
|
+
InputTypes3["HIDDEN"] = "hidden";
|
|
12951
|
+
InputTypes3["TEXT"] = "text";
|
|
12952
|
+
InputTypes3["TEXT_GROUP"] = "text_group";
|
|
12953
|
+
InputTypes3["NUMBER"] = "number";
|
|
12954
|
+
InputTypes3["SWITCH"] = "switch";
|
|
12955
|
+
InputTypes3["CHECKBOX"] = "checkbox";
|
|
12956
|
+
InputTypes3["SELECT"] = "select";
|
|
12957
|
+
InputTypes3["SIMPLE_CHECK_LIST"] = "siple_checklist";
|
|
12958
|
+
InputTypes3["CHECK_LIST"] = "checklist";
|
|
12959
|
+
InputTypes3["GROUPED_SWITCH_LIST"] = "grouped_switchlist";
|
|
12960
|
+
InputTypes3["ACCORDION_GROUPED_SWITCH_LIST"] = "accordion_grouped_switchlist";
|
|
12961
|
+
InputTypes3["DATE"] = "date";
|
|
12962
|
+
InputTypes3["TEXTAREA"] = "textarea";
|
|
12963
|
+
InputTypes3["FILE"] = "file";
|
|
12964
|
+
InputTypes3["OTP"] = "otp";
|
|
12965
|
+
InputTypes3["FORM"] = "form";
|
|
12966
|
+
InputTypes3["COLOR"] = "color";
|
|
12967
|
+
InputTypes3["RADIO_GROUP"] = "radio_group";
|
|
12968
|
+
InputTypes3["TAGS"] = "tags";
|
|
12969
|
+
InputTypes3["DATE_TIME"] = "date_time";
|
|
12970
|
+
InputTypes3["TIME"] = "time";
|
|
12971
|
+
InputTypes3["FILE_MULTI_UPLOAD"] = "file_multi_upload";
|
|
12972
|
+
InputTypes3["SLIDER"] = "slider";
|
|
12973
|
+
InputTypes3["BUTTON_GROUP"] = "button_group";
|
|
12974
|
+
InputTypes3["CURRENCY"] = "currency";
|
|
12975
|
+
InputTypes3["KEY_VALUE"] = "key_value";
|
|
12976
|
+
InputTypes3["REPEATER"] = "repeater";
|
|
12977
|
+
InputTypes3["MULTI_SELECT"] = "multi_select";
|
|
12978
|
+
InputTypes3["COMBOBOX"] = "COMBO_BOX";
|
|
12979
|
+
InputTypes3["SORTABLE_LIST"] = "sortable_list";
|
|
12980
|
+
InputTypes3["REPEATER_TABS"] = "repeater_tabs";
|
|
12981
|
+
InputTypes3["STRING_LIST"] = "string_list";
|
|
12982
|
+
InputTypes3["RATING"] = "rating";
|
|
12983
|
+
InputTypes3["PHONE"] = "phone";
|
|
12984
|
+
InputTypes3["URL"] = "url";
|
|
12985
|
+
InputTypes3["PASSWORD"] = "password";
|
|
12986
|
+
InputTypes3["AUTOCOMPLETE"] = "autocomplete";
|
|
12987
|
+
InputTypes3["EMAIL"] = "email";
|
|
12988
|
+
InputTypes3["SEARCH"] = "search";
|
|
12989
|
+
InputTypes3["LOCATION_PICKER"] = "location_picker";
|
|
12990
|
+
InputTypes3["DATE_RANGE"] = "date_range";
|
|
12991
|
+
InputTypes3["COUNTRY_SELECT"] = "country_select";
|
|
12992
|
+
InputTypes3["RANGE"] = "range";
|
|
12993
|
+
InputTypes3["FILE_UPLOAD"] = "file_upload";
|
|
12994
|
+
return InputTypes3;
|
|
12995
|
+
})(InputTypes || {});
|
|
12996
|
+
var inputFieldComp = [
|
|
12997
|
+
"string_list" /* STRING_LIST */,
|
|
12998
|
+
"repeater_tabs" /* REPEATER_TABS */,
|
|
12999
|
+
"sortable_list" /* SORTABLE_LIST */,
|
|
13000
|
+
"COMBO_BOX" /* COMBOBOX */,
|
|
13001
|
+
"multi_select" /* MULTI_SELECT */,
|
|
13002
|
+
"repeater" /* REPEATER */,
|
|
13003
|
+
"key_value" /* KEY_VALUE */,
|
|
13004
|
+
"currency" /* CURRENCY */,
|
|
13005
|
+
"button_group" /* BUTTON_GROUP */,
|
|
13006
|
+
"slider" /* SLIDER */,
|
|
13007
|
+
"file_multi_upload" /* FILE_MULTI_UPLOAD */,
|
|
13008
|
+
"time" /* TIME */,
|
|
13009
|
+
"date_time" /* DATE_TIME */,
|
|
13010
|
+
"tags" /* TAGS */,
|
|
13011
|
+
"radio_group" /* RADIO_GROUP */,
|
|
13012
|
+
"text_group" /* TEXT_GROUP */,
|
|
13013
|
+
"accordion_grouped_switchlist" /* ACCORDION_GROUPED_SWITCH_LIST */,
|
|
13014
|
+
"grouped_switchlist" /* GROUPED_SWITCH_LIST */,
|
|
13015
|
+
"text" /* TEXT */,
|
|
13016
|
+
"switch" /* SWITCH */,
|
|
13017
|
+
"siple_checklist" /* SIMPLE_CHECK_LIST */,
|
|
13018
|
+
"checkbox" /* CHECKBOX */,
|
|
13019
|
+
"color" /* COLOR */,
|
|
13020
|
+
"otp" /* OTP */,
|
|
13021
|
+
"select" /* SELECT */,
|
|
13022
|
+
"date" /* DATE */,
|
|
13023
|
+
"file" /* FILE */,
|
|
13024
|
+
"form" /* FORM */,
|
|
13025
|
+
"number" /* NUMBER */,
|
|
13026
|
+
"textarea" /* TEXTAREA */,
|
|
13027
|
+
// InputTypes.SWITCH_LIST,
|
|
13028
|
+
"hidden" /* HIDDEN */,
|
|
13029
|
+
// ✨ New input types (v1.35.0)
|
|
13030
|
+
"rating" /* RATING */,
|
|
13031
|
+
"phone" /* PHONE */,
|
|
13032
|
+
"url" /* URL */,
|
|
13033
|
+
"password" /* PASSWORD */,
|
|
13034
|
+
"autocomplete" /* AUTOCOMPLETE */,
|
|
13035
|
+
// ✨ New input types (v1.36.0)
|
|
13036
|
+
"email" /* EMAIL */,
|
|
13037
|
+
"search" /* SEARCH */,
|
|
13038
|
+
"location_picker" /* LOCATION_PICKER */,
|
|
13039
|
+
"date_range" /* DATE_RANGE */,
|
|
13040
|
+
"country_select" /* COUNTRY_SELECT */,
|
|
13041
|
+
"range" /* RANGE */,
|
|
13042
|
+
// ✨ New input types (v1.37.0)
|
|
13043
|
+
"file_upload" /* FILE_UPLOAD */
|
|
13044
|
+
];
|
|
12737
13045
|
var GroupedSwitchInput = class extends BaseInput {
|
|
12738
13046
|
render() {
|
|
12739
13047
|
const { input, isSubmitting } = this;
|
|
@@ -13697,13 +14005,18 @@ var FakeInput = ({ input, field, form, isValid, isSubmitting, isPasswordField, s
|
|
|
13697
14005
|
onBlur: handleBlur,
|
|
13698
14006
|
onClick: () => ref.current?.focus(),
|
|
13699
14007
|
className: `
|
|
13700
|
-
p-
|
|
14008
|
+
p-1 min-h-8 w-full flex justify-items-center justify-between flex-row
|
|
13701
14009
|
text-2xl font-bold rounded-xl border-2
|
|
13702
14010
|
outline-none transition-all
|
|
13703
|
-
${isFocused ? "border-
|
|
14011
|
+
${isFocused ? "border-amber-400 bg-amber-50" : "border-blue-200 bg-blue-50"}
|
|
13704
14012
|
`,
|
|
13705
14013
|
children: [
|
|
13706
|
-
/* @__PURE__ */ jsxRuntime.
|
|
14014
|
+
value.toString().length == 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex-1 text-left self-center text-gray-400", children: [
|
|
14015
|
+
" ",
|
|
14016
|
+
input.placeHolder ?? input.label,
|
|
14017
|
+
" "
|
|
14018
|
+
] }),
|
|
14019
|
+
value.toString().length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-left self-center ", children: input && (isPasswordField && !showPassword) ? "\u2022".repeat(value.toString().length) : value || "" }),
|
|
13707
14020
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 self-center", children: [
|
|
13708
14021
|
isPasswordField && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13709
14022
|
Button,
|
|
@@ -13862,8 +14175,6 @@ var CustomInputGroup = ({
|
|
|
13862
14175
|
value: field?.value ?? value ?? "",
|
|
13863
14176
|
onChange: (e) => {
|
|
13864
14177
|
let value2 = e.target.value;
|
|
13865
|
-
console.log("\u{1F680} ~ CustomInputGroup ~ value:", value2);
|
|
13866
|
-
console.log("Valor raw del input:", value2);
|
|
13867
14178
|
if (isNumberField) {
|
|
13868
14179
|
const numConfig = input.inputNumberConfig;
|
|
13869
14180
|
const cleanValue = value2.replace(/[^\d.-]/g, "");
|
|
@@ -15744,7 +16055,7 @@ var SearchInputClass = class extends BaseInput {
|
|
|
15744
16055
|
}
|
|
15745
16056
|
};
|
|
15746
16057
|
var FieldSearch = ({ input, form, isSubmitting }) => {
|
|
15747
|
-
const debounceRef = React3.useRef();
|
|
16058
|
+
const debounceRef = React3.useRef(void 0);
|
|
15748
16059
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15749
16060
|
FormField,
|
|
15750
16061
|
{
|
|
@@ -16863,166 +17174,21 @@ var FormFieldsGrid = ({
|
|
|
16863
17174
|
);
|
|
16864
17175
|
}) });
|
|
16865
17176
|
};
|
|
16866
|
-
var
|
|
16867
|
-
const
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
/* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
|
|
16872
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
|
|
16873
|
-
/* @__PURE__ */ jsxRuntime.jsxs(SheetDescription, { children: [
|
|
16874
|
-
childrenHeader,
|
|
16875
|
-
children
|
|
16876
|
-
] })
|
|
16877
|
-
] }),
|
|
16878
|
-
/* @__PURE__ */ jsxRuntime.jsx(SheetFooter, {})
|
|
16879
|
-
] }) });
|
|
16880
|
-
};
|
|
16881
|
-
var DynamicDialog = ({
|
|
16882
|
-
trigger,
|
|
16883
|
-
title = "Are you absolutely sure?",
|
|
16884
|
-
description = "This action cannot be undone.",
|
|
16885
|
-
cancelText = "Cancel",
|
|
16886
|
-
actionText = "Confirmar",
|
|
16887
|
-
className = "bg-red-600 text-white font-bold",
|
|
16888
|
-
variant = "info",
|
|
16889
|
-
onAction,
|
|
16890
|
-
children,
|
|
16891
|
-
listBtnConfig = [],
|
|
16892
|
-
btnGroupDirection = "flex-end",
|
|
16893
|
-
submitBtnClass = "h-16",
|
|
16894
|
-
iconSize = "w-16 h-16",
|
|
16895
|
-
btnHeightClass = "h-16",
|
|
16896
|
-
showActionBtn = true
|
|
16897
|
-
}) => {
|
|
16898
|
-
const getVariantStyles = () => {
|
|
16899
|
-
switch (variant) {
|
|
16900
|
-
case "info":
|
|
16901
|
-
return {
|
|
16902
|
-
container: "!bg-blue-100 !text-blue-800 dark:!bg-blue-900 dark:!text-blue-200",
|
|
16903
|
-
border: "!border-blue-500/30 dark:!border-blue-300/30",
|
|
16904
|
-
media: "bg-blue-500/10 dark:bg-blue-300/10",
|
|
16905
|
-
action: "text-blue-200 bg-blue-500 dark:bg-blue-300",
|
|
16906
|
-
icon: "text-blue-500 dark:text-blue-300",
|
|
16907
|
-
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleWarning, { className: iconSize })
|
|
16908
|
-
};
|
|
16909
|
-
case "warning":
|
|
16910
|
-
return {
|
|
16911
|
-
container: "!bg-yellow-100 !text-yellow-800 dark:!bg-yellow-900 dark:!text-yellow-200",
|
|
16912
|
-
border: "!border-yellow-500/30 dark:!border-yellow-300/30",
|
|
16913
|
-
media: "bg-yellow-500/10 dark:bg-yellow-300/10",
|
|
16914
|
-
action: "text-yellow-200 bg-yellow-500 dark:bg-yellow-300",
|
|
16915
|
-
icon: "text-yellow-500 dark:text-yellow-300",
|
|
16916
|
-
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: iconSize })
|
|
16917
|
-
};
|
|
16918
|
-
case "error":
|
|
16919
|
-
case "delete":
|
|
16920
|
-
return {
|
|
16921
|
-
container: "!bg-red-100 !text-red-800 dark:!bg-red-900 dark:!text-red-200",
|
|
16922
|
-
border: "!border-red-500/30 dark:!border-red-300/30",
|
|
16923
|
-
media: "bg-red-500/10 dark:bg-red-300/10",
|
|
16924
|
-
action: "text-red-200 bg-red-500 dark:bg-red-300",
|
|
16925
|
-
icon: "text-red-500 dark:text-red-300",
|
|
16926
|
-
iconNode: variant === "delete" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonX, { className: iconSize })
|
|
16927
|
-
};
|
|
16928
|
-
case "success":
|
|
16929
|
-
return {
|
|
16930
|
-
container: "!bg-green-100 !text-green-800 dark:!bg-green-900 dark:!text-green-200",
|
|
16931
|
-
border: "!border-green-500/30 dark:!border-green-300/30",
|
|
16932
|
-
media: "bg-green-500/10 dark:bg-green-300/10",
|
|
16933
|
-
action: "text-green-200 bg-green-500 dark:bg-green-300",
|
|
16934
|
-
icon: "text-green-500 dark:text-green-300",
|
|
16935
|
-
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: iconSize })
|
|
16936
|
-
};
|
|
16937
|
-
case "confirm":
|
|
16938
|
-
return {
|
|
16939
|
-
container: "!bg-purple-100 !text-purple-800 dark:!bg-purple-900 dark:!text-purple-200",
|
|
16940
|
-
border: "!border-purple-500/30 dark:!border-purple-300/30",
|
|
16941
|
-
media: "bg-purple-500/10 dark:bg-purple-300/10",
|
|
16942
|
-
action: "text-purple-200 bg-purple-500 dark:bg-purple-300",
|
|
16943
|
-
icon: "text-purple-500 dark:text-purple-300",
|
|
16944
|
-
iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleQuestionMark, { className: iconSize })
|
|
16945
|
-
};
|
|
16946
|
-
}
|
|
16947
|
-
};
|
|
16948
|
-
const styles = getVariantStyles();
|
|
16949
|
-
console.log("onAction", onAction);
|
|
16950
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog, { children: [
|
|
16951
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", children: "Show Dialog" }) }),
|
|
16952
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16953
|
-
AlertDialogContent,
|
|
16954
|
-
{
|
|
16955
|
-
className: cn(
|
|
16956
|
-
"w-50 h-fit font-mono border-x-8",
|
|
16957
|
-
styles.container,
|
|
16958
|
-
styles.border
|
|
16959
|
-
),
|
|
16960
|
-
children: [
|
|
16961
|
-
/* @__PURE__ */ jsxRuntime.jsxs(AlertDialogHeader, { className: "justify-center w-full text-center", children: [
|
|
16962
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16963
|
-
AlertDialogMedia,
|
|
16964
|
-
{
|
|
16965
|
-
className: cn(
|
|
16966
|
-
styles.media,
|
|
16967
|
-
"rounded-full flex items-center justify-center",
|
|
16968
|
-
iconSize
|
|
16969
|
-
// 🔥 ahora controla también el contenedor
|
|
16970
|
-
),
|
|
16971
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.icon, children: styles.iconNode })
|
|
16972
|
-
}
|
|
16973
|
-
) }),
|
|
16974
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTitle, { className: "text-2xl", children: title }) }),
|
|
16975
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { className: "text-xl text-center", children: description })
|
|
16976
|
-
] }),
|
|
16977
|
-
children,
|
|
16978
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16979
|
-
ButtonGroup,
|
|
16980
|
-
{
|
|
16981
|
-
className: "flex w-full",
|
|
16982
|
-
style: {
|
|
16983
|
-
justifyContent: btnGroupDirection,
|
|
16984
|
-
alignItems: "center"
|
|
16985
|
-
},
|
|
16986
|
-
children: [
|
|
16987
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { className: cn("flex-1", btnHeightClass), children: cancelText }),
|
|
16988
|
-
listBtnConfig.map((btn, key) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16989
|
-
Button,
|
|
16990
|
-
{
|
|
16991
|
-
type: btn.btnType,
|
|
16992
|
-
size: "lg",
|
|
16993
|
-
className: cn(btnHeightClass, submitBtnClass),
|
|
16994
|
-
variant: btn.variant,
|
|
16995
|
-
onClick: btn.onClick,
|
|
16996
|
-
disabled: btn.disabled,
|
|
16997
|
-
children: btn.label
|
|
16998
|
-
},
|
|
16999
|
-
key
|
|
17000
|
-
)),
|
|
17001
|
-
onAction && showActionBtn && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17002
|
-
AlertDialogAction,
|
|
17003
|
-
{
|
|
17004
|
-
onClick: (e) => {
|
|
17005
|
-
e.preventDefault();
|
|
17006
|
-
if (onAction) {
|
|
17007
|
-
onAction();
|
|
17008
|
-
}
|
|
17009
|
-
},
|
|
17010
|
-
className: cn(
|
|
17011
|
-
"flex-1",
|
|
17012
|
-
btnHeightClass,
|
|
17013
|
-
className,
|
|
17014
|
-
styles.action
|
|
17015
|
-
),
|
|
17016
|
-
children: actionText
|
|
17017
|
-
}
|
|
17018
|
-
)
|
|
17019
|
-
]
|
|
17020
|
-
}
|
|
17021
|
-
) })
|
|
17022
|
-
]
|
|
17023
|
-
}
|
|
17024
|
-
)
|
|
17177
|
+
var DynamicSheetKeyboard = ({ currentInputField, children, input, className, childClassName, keyFontSize = "text-base" }) => {
|
|
17178
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17179
|
+
" ",
|
|
17180
|
+
KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */, input, children),
|
|
17181
|
+
" "
|
|
17025
17182
|
] });
|
|
17183
|
+
const [container, setContainer] = React3.useState(content);
|
|
17184
|
+
React3.useEffect(() => {
|
|
17185
|
+
setContainer(/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17186
|
+
" ",
|
|
17187
|
+
KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */, input, children, childClassName, keyFontSize),
|
|
17188
|
+
" "
|
|
17189
|
+
] }));
|
|
17190
|
+
}, [children]);
|
|
17191
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomSheet, { children: container, className });
|
|
17026
17192
|
};
|
|
17027
17193
|
var DynamicForm = ({
|
|
17028
17194
|
formTitle,
|
|
@@ -17113,12 +17279,7 @@ var DynamicForm = ({
|
|
|
17113
17279
|
}
|
|
17114
17280
|
);
|
|
17115
17281
|
const formBody = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17116
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17117
|
-
CustomSheet,
|
|
17118
|
-
{
|
|
17119
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */) })
|
|
17120
|
-
}
|
|
17121
|
-
),
|
|
17282
|
+
/* @__PURE__ */ jsxRuntime.jsx(DynamicSheetKeyboard, { currentInputField }),
|
|
17122
17283
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full grid grid-cols-1", children: [
|
|
17123
17284
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17124
17285
|
FormFieldsGrid,
|
|
@@ -17222,53 +17383,120 @@ var FormWrapper = ({ form, handleSubmit, children, readOnly, debug, isWrapInWiza
|
|
|
17222
17383
|
}
|
|
17223
17384
|
) });
|
|
17224
17385
|
};
|
|
17225
|
-
var
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17386
|
+
var GenericFilter = ({
|
|
17387
|
+
filters = [],
|
|
17388
|
+
pagination,
|
|
17389
|
+
autoSubmit = false,
|
|
17390
|
+
defaultValues = {},
|
|
17391
|
+
initPage = 1,
|
|
17392
|
+
initLimit = 10,
|
|
17393
|
+
rangeLimit = [10, 25, 50, 100],
|
|
17394
|
+
onChange,
|
|
17395
|
+
withSearch = true,
|
|
17396
|
+
withInitDate = true,
|
|
17397
|
+
withEndDate = true,
|
|
17398
|
+
withActive = true,
|
|
17399
|
+
withLimit = true,
|
|
17400
|
+
wrapInCard = true
|
|
17232
17401
|
}) => {
|
|
17233
|
-
const
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
);
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17402
|
+
const record = {
|
|
17403
|
+
page: initPage,
|
|
17404
|
+
limit: initLimit,
|
|
17405
|
+
...defaultValues
|
|
17406
|
+
};
|
|
17407
|
+
const [values, setValues] = React3.useState(record);
|
|
17408
|
+
const isFirstRender = React3.useRef(true);
|
|
17409
|
+
React3.useEffect(() => {
|
|
17410
|
+
if (isFirstRender.current) {
|
|
17411
|
+
isFirstRender.current = false;
|
|
17412
|
+
return;
|
|
17413
|
+
}
|
|
17414
|
+
}, [values]);
|
|
17415
|
+
const handleChange = (name, value) => {
|
|
17416
|
+
setValues((prev) => ({ ...prev, [name]: value }));
|
|
17417
|
+
if (autoSubmit && onChange) onChange({ ...values, [name]: value });
|
|
17418
|
+
};
|
|
17419
|
+
const baseFields = [
|
|
17420
|
+
...withSearch ? [
|
|
17244
17421
|
{
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17422
|
+
name: "search",
|
|
17423
|
+
label: "Buscar",
|
|
17424
|
+
inputType: "text_group" /* TEXT_GROUP */,
|
|
17425
|
+
inputGroupConfig: { iconsLeft: [lucideReact.Search] },
|
|
17426
|
+
onChange: (value) => handleChange("search", value)
|
|
17249
17427
|
}
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17256
|
-
|
|
17257
|
-
|
|
17428
|
+
] : [],
|
|
17429
|
+
...withInitDate ? [
|
|
17430
|
+
{
|
|
17431
|
+
name: "initDate",
|
|
17432
|
+
label: "Fecha de Inicio",
|
|
17433
|
+
inputType: "date" /* DATE */,
|
|
17434
|
+
onChange: (value) => handleChange("initDate", value)
|
|
17435
|
+
}
|
|
17436
|
+
] : [],
|
|
17437
|
+
...withEndDate ? [
|
|
17438
|
+
{
|
|
17439
|
+
name: "endDate",
|
|
17440
|
+
label: "Fecha Final",
|
|
17441
|
+
inputType: "date" /* DATE */,
|
|
17442
|
+
onChange: (value) => handleChange("endDate", value)
|
|
17443
|
+
}
|
|
17444
|
+
] : [],
|
|
17445
|
+
...withActive ? [
|
|
17446
|
+
{
|
|
17447
|
+
wrapInCard: true,
|
|
17448
|
+
name: "active",
|
|
17449
|
+
label: "",
|
|
17450
|
+
inputType: "button_group" /* BUTTON_GROUP */,
|
|
17451
|
+
description: "Estado",
|
|
17452
|
+
listConfig: {
|
|
17453
|
+
list: [
|
|
17454
|
+
{ id: 1, name: "Activo", value: true },
|
|
17455
|
+
{ id: 2, name: "Inactivo", value: false },
|
|
17456
|
+
{ id: 3, name: "Todos", value: void 0 }
|
|
17457
|
+
],
|
|
17458
|
+
onOptionChange: (item) => {
|
|
17459
|
+
if (Array.isArray(item) && item[0]) handleChange("active", item[0].value);
|
|
17460
|
+
else if (item && "value" in item) handleChange("active", item.value);
|
|
17461
|
+
}
|
|
17462
|
+
}
|
|
17463
|
+
}
|
|
17464
|
+
] : [],
|
|
17465
|
+
...withLimit ? [
|
|
17258
17466
|
{
|
|
17259
|
-
|
|
17260
|
-
|
|
17261
|
-
|
|
17262
|
-
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17467
|
+
name: "limit",
|
|
17468
|
+
label: "L\xEDmite por p\xE1gina",
|
|
17469
|
+
inputType: "select" /* SELECT */,
|
|
17470
|
+
listConfig: {
|
|
17471
|
+
list: rangeLimit.map((num) => ({
|
|
17472
|
+
value: String(num),
|
|
17473
|
+
id: num,
|
|
17474
|
+
name: String(num)
|
|
17475
|
+
})),
|
|
17476
|
+
onOptionChange: (item) => handleChange("limit", Number(item?.value ?? 10))
|
|
17477
|
+
}
|
|
17269
17478
|
}
|
|
17270
|
-
|
|
17271
|
-
]
|
|
17479
|
+
] : []
|
|
17480
|
+
];
|
|
17481
|
+
const fieldsConfig = [
|
|
17482
|
+
...filters,
|
|
17483
|
+
baseFields
|
|
17484
|
+
];
|
|
17485
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col md:flex-row md:items-end gap-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17486
|
+
DynamicForm,
|
|
17487
|
+
{
|
|
17488
|
+
withCard: wrapInCard,
|
|
17489
|
+
withSubmitBtn: !autoSubmit,
|
|
17490
|
+
formTitle: "",
|
|
17491
|
+
submitBtnLabel: "Buscar",
|
|
17492
|
+
fields: fieldsConfig,
|
|
17493
|
+
record: values,
|
|
17494
|
+
showFormHeader: false,
|
|
17495
|
+
onSubmit: ({ data }) => {
|
|
17496
|
+
if (onChange && !autoSubmit) onChange(data);
|
|
17497
|
+
}
|
|
17498
|
+
}
|
|
17499
|
+
) }) });
|
|
17272
17500
|
};
|
|
17273
17501
|
var DynamicFormExample = () => {
|
|
17274
17502
|
const record = {
|
|
@@ -17393,171 +17621,89 @@ var mockFields = [
|
|
|
17393
17621
|
zodType: z2__default.default.string().min(4, "Debe tener al menos 4 d\xEDgitos").max(6, "Debe tener m\xE1ximo 6 d\xEDgitos")
|
|
17394
17622
|
}
|
|
17395
17623
|
];
|
|
17396
|
-
var
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
setInputSetups((prev) => ({
|
|
17404
|
-
...prev,
|
|
17405
|
-
[type]: { ...prev[type], [key]: !prev[type][key] }
|
|
17406
|
-
}));
|
|
17407
|
-
};
|
|
17408
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-1", children: inputsTypes.map((type) => {
|
|
17409
|
-
const setup = inputSetups[type];
|
|
17410
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17411
|
-
"div",
|
|
17412
|
-
{
|
|
17413
|
-
className: "border rounded-lg p-2 flex flex-col-2 gap-1 shadow-sm",
|
|
17414
|
-
children: [
|
|
17415
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "icon", onClick: () => handleAddInput(type, setup), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
|
|
17416
|
-
/* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(AccordionItem, { value: "item-1", children: [
|
|
17417
|
-
/* @__PURE__ */ jsxRuntime.jsx(AccordionTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row justify-center w-full content-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-xl", children: type }) }) }),
|
|
17418
|
-
/* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
17419
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2", children: [
|
|
17420
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17421
|
-
Switch,
|
|
17422
|
-
{
|
|
17423
|
-
checked: setup.required,
|
|
17424
|
-
onCheckedChange: () => toggleConfig(type, "required")
|
|
17425
|
-
}
|
|
17426
|
-
),
|
|
17427
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Required" })
|
|
17428
|
-
] }),
|
|
17429
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2", children: [
|
|
17430
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17431
|
-
Switch,
|
|
17432
|
-
{
|
|
17433
|
-
checked: setup.disabled,
|
|
17434
|
-
onCheckedChange: () => toggleConfig(type, "disabled")
|
|
17435
|
-
}
|
|
17436
|
-
),
|
|
17437
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Disabled" })
|
|
17438
|
-
] })
|
|
17439
|
-
] }) })
|
|
17440
|
-
] }) })
|
|
17441
|
-
]
|
|
17442
|
-
},
|
|
17443
|
-
type
|
|
17444
|
-
);
|
|
17445
|
-
}) });
|
|
17446
|
-
};
|
|
17447
|
-
var GenericFilter = ({
|
|
17448
|
-
filters = [],
|
|
17449
|
-
pagination,
|
|
17450
|
-
autoSubmit = false,
|
|
17451
|
-
defaultValues = {},
|
|
17452
|
-
initPage = 1,
|
|
17453
|
-
initLimit = 10,
|
|
17454
|
-
rangeLimit = [10, 25, 50, 100],
|
|
17455
|
-
onChange,
|
|
17456
|
-
withSearch = true,
|
|
17457
|
-
withInitDate = true,
|
|
17458
|
-
withEndDate = true,
|
|
17459
|
-
withActive = true,
|
|
17460
|
-
withLimit = true,
|
|
17461
|
-
wrapInCard = true
|
|
17624
|
+
var WizardForm = ({
|
|
17625
|
+
fields,
|
|
17626
|
+
record,
|
|
17627
|
+
onSubmit,
|
|
17628
|
+
children,
|
|
17629
|
+
isWrapInWizard = true,
|
|
17630
|
+
skipSteps = false
|
|
17462
17631
|
}) => {
|
|
17463
|
-
const
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
}
|
|
17475
|
-
}, [values]);
|
|
17476
|
-
const handleChange = (name, value) => {
|
|
17477
|
-
setValues((prev) => ({ ...prev, [name]: value }));
|
|
17478
|
-
if (autoSubmit && onChange) onChange({ ...values, [name]: value });
|
|
17479
|
-
};
|
|
17480
|
-
const baseFields = [
|
|
17481
|
-
...withSearch ? [
|
|
17482
|
-
{
|
|
17483
|
-
name: "search",
|
|
17484
|
-
label: "Buscar",
|
|
17485
|
-
inputType: "text_group" /* TEXT_GROUP */,
|
|
17486
|
-
inputGroupConfig: { iconsLeft: [lucideReact.Search] },
|
|
17487
|
-
onChange: (value) => handleChange("search", value)
|
|
17488
|
-
}
|
|
17489
|
-
] : [],
|
|
17490
|
-
...withInitDate ? [
|
|
17491
|
-
{
|
|
17492
|
-
name: "initDate",
|
|
17493
|
-
label: "Fecha de Inicio",
|
|
17494
|
-
inputType: "date" /* DATE */,
|
|
17495
|
-
onChange: (value) => handleChange("initDate", value)
|
|
17496
|
-
}
|
|
17497
|
-
] : [],
|
|
17498
|
-
...withEndDate ? [
|
|
17499
|
-
{
|
|
17500
|
-
name: "endDate",
|
|
17501
|
-
label: "Fecha Final",
|
|
17502
|
-
inputType: "date" /* DATE */,
|
|
17503
|
-
onChange: (value) => handleChange("endDate", value)
|
|
17504
|
-
}
|
|
17505
|
-
] : [],
|
|
17506
|
-
...withActive ? [
|
|
17632
|
+
const [currentStep, setCurrentStep] = React3.useState(1);
|
|
17633
|
+
const flattenFields4 = (list) => list.flatMap((f) => Array.isArray(f) ? flattenFields4(f) : f);
|
|
17634
|
+
const allFields = flattenFields4(fields);
|
|
17635
|
+
const totalSteps = allFields.reduce(
|
|
17636
|
+
(max, f) => Math.max(max, f.step ?? 1),
|
|
17637
|
+
1
|
|
17638
|
+
);
|
|
17639
|
+
const stepFields = allFields.filter((f) => (f.step ?? 1) === currentStep);
|
|
17640
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "flex flex-col gap-4 px-4", children: [
|
|
17641
|
+
/* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between mb-4 gap-2 px-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17642
|
+
Stepper,
|
|
17507
17643
|
{
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
description: "Estado",
|
|
17513
|
-
listConfig: {
|
|
17514
|
-
list: [
|
|
17515
|
-
{ id: 1, name: "Activo", value: true },
|
|
17516
|
-
{ id: 2, name: "Inactivo", value: false },
|
|
17517
|
-
{ id: 3, name: "Todos", value: void 0 }
|
|
17518
|
-
],
|
|
17519
|
-
onOptionChange: (item) => {
|
|
17520
|
-
if (Array.isArray(item) && item[0]) handleChange("active", item[0].value);
|
|
17521
|
-
else if (item && "value" in item) handleChange("active", item.value);
|
|
17522
|
-
}
|
|
17523
|
-
}
|
|
17644
|
+
steps: Array(totalSteps).fill({}),
|
|
17645
|
+
currentStep,
|
|
17646
|
+
clickable: skipSteps,
|
|
17647
|
+
onStepClick: setCurrentStep
|
|
17524
17648
|
}
|
|
17525
|
-
|
|
17526
|
-
|
|
17649
|
+
) }) }),
|
|
17650
|
+
children ? children({
|
|
17651
|
+
stepFields,
|
|
17652
|
+
currentStep,
|
|
17653
|
+
totalSteps,
|
|
17654
|
+
setCurrentStep
|
|
17655
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17656
|
+
DynamicForm,
|
|
17527
17657
|
{
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
}
|
|
17539
|
-
}
|
|
17540
|
-
] : []
|
|
17541
|
-
];
|
|
17542
|
-
const fieldsConfig = [
|
|
17543
|
-
...filters,
|
|
17544
|
-
baseFields
|
|
17545
|
-
];
|
|
17546
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col md:flex-row md:items-end gap-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17547
|
-
DynamicForm,
|
|
17548
|
-
{
|
|
17549
|
-
withCard: wrapInCard,
|
|
17550
|
-
withSubmitBtn: !autoSubmit,
|
|
17551
|
-
formTitle: "",
|
|
17552
|
-
submitBtnLabel: "Buscar",
|
|
17553
|
-
fields: fieldsConfig,
|
|
17554
|
-
record: values,
|
|
17555
|
-
showFormHeader: false,
|
|
17556
|
-
onSubmit: ({ data }) => {
|
|
17557
|
-
if (onChange && !autoSubmit) onChange(data);
|
|
17658
|
+
record,
|
|
17659
|
+
formSubTitle: "This is a subtitle",
|
|
17660
|
+
formTitle: "Wizard Form Example",
|
|
17661
|
+
withCard: false,
|
|
17662
|
+
errorAlertPosition: "down",
|
|
17663
|
+
fields: stepFields,
|
|
17664
|
+
onSubmit,
|
|
17665
|
+
isWrapInWizard: true,
|
|
17666
|
+
currentStep,
|
|
17667
|
+
totalSteps
|
|
17558
17668
|
}
|
|
17559
|
-
|
|
17560
|
-
|
|
17669
|
+
)
|
|
17670
|
+
] });
|
|
17671
|
+
};
|
|
17672
|
+
|
|
17673
|
+
// src/components/custom/form/theme/theme-config.ts
|
|
17674
|
+
var defaultTheme = {
|
|
17675
|
+
colors: {
|
|
17676
|
+
primary: "hsl(var(--primary))",
|
|
17677
|
+
error: "hsl(var(--destructive))",
|
|
17678
|
+
success: "hsl(var(--success))",
|
|
17679
|
+
warning: "hsl(var(--warning))"
|
|
17680
|
+
},
|
|
17681
|
+
spacing: "normal",
|
|
17682
|
+
borderRadius: "md",
|
|
17683
|
+
labelPosition: "top",
|
|
17684
|
+
fontSize: "base"
|
|
17685
|
+
};
|
|
17686
|
+
var spacingClasses = {
|
|
17687
|
+
compact: "gap-1",
|
|
17688
|
+
normal: "gap-2",
|
|
17689
|
+
comfortable: "gap-4"
|
|
17690
|
+
};
|
|
17691
|
+
var borderRadiusClasses = {
|
|
17692
|
+
none: "rounded-none",
|
|
17693
|
+
sm: "rounded-sm",
|
|
17694
|
+
md: "rounded-md",
|
|
17695
|
+
lg: "rounded-lg",
|
|
17696
|
+
full: "rounded-full"
|
|
17697
|
+
};
|
|
17698
|
+
var fontSizeClasses = {
|
|
17699
|
+
sm: "text-sm",
|
|
17700
|
+
base: "text-base",
|
|
17701
|
+
lg: "text-lg"
|
|
17702
|
+
};
|
|
17703
|
+
var labelPositionClasses = {
|
|
17704
|
+
top: "flex-col",
|
|
17705
|
+
left: "flex-row items-center",
|
|
17706
|
+
floating: "relative"
|
|
17561
17707
|
};
|
|
17562
17708
|
function useDynamicForm({
|
|
17563
17709
|
fields,
|
|
@@ -17667,7 +17813,20 @@ exports.AccordionItem = AccordionItem;
|
|
|
17667
17813
|
exports.AccordionTrigger = AccordionTrigger;
|
|
17668
17814
|
exports.Alert = Alert;
|
|
17669
17815
|
exports.AlertDescription = AlertDescription;
|
|
17816
|
+
exports.AlertDialog = AlertDialog;
|
|
17817
|
+
exports.AlertDialogAction = AlertDialogAction;
|
|
17818
|
+
exports.AlertDialogCancel = AlertDialogCancel;
|
|
17819
|
+
exports.AlertDialogContent = AlertDialogContent;
|
|
17820
|
+
exports.AlertDialogDescription = AlertDialogDescription;
|
|
17821
|
+
exports.AlertDialogFooter = AlertDialogFooter;
|
|
17822
|
+
exports.AlertDialogHeader = AlertDialogHeader;
|
|
17823
|
+
exports.AlertDialogMedia = AlertDialogMedia;
|
|
17824
|
+
exports.AlertDialogOverlay = AlertDialogOverlay;
|
|
17825
|
+
exports.AlertDialogPortal = AlertDialogPortal;
|
|
17826
|
+
exports.AlertDialogTitle = AlertDialogTitle;
|
|
17827
|
+
exports.AlertDialogTrigger = AlertDialogTrigger;
|
|
17670
17828
|
exports.AlertTitle = AlertTitle;
|
|
17829
|
+
exports.AutocompleteInput = AutocompleteInput;
|
|
17671
17830
|
exports.Badge = Badge;
|
|
17672
17831
|
exports.BaseInput = BaseInput;
|
|
17673
17832
|
exports.BaseKeyboard = BaseKeyboard;
|
|
@@ -17700,11 +17859,13 @@ exports.CommandItem = CommandItem;
|
|
|
17700
17859
|
exports.CommandList = CommandList;
|
|
17701
17860
|
exports.CommandSeparator = CommandSeparator;
|
|
17702
17861
|
exports.CommandShortcut = CommandShortcut;
|
|
17862
|
+
exports.CountrySelectInput = CountrySelectInput;
|
|
17703
17863
|
exports.CurrencyInput = CurrencyInput;
|
|
17704
17864
|
exports.CustomAlert = CustomAlert;
|
|
17705
17865
|
exports.CustomInputGroup = CustomInputGroup;
|
|
17706
17866
|
exports.CustomSheet = CustomSheet;
|
|
17707
17867
|
exports.DateInput = DateInput;
|
|
17868
|
+
exports.DateRangeInput = DateRangeInput;
|
|
17708
17869
|
exports.DateTimeInput = DateTimeInput;
|
|
17709
17870
|
exports.Dialog = Dialog;
|
|
17710
17871
|
exports.DialogClose = DialogClose;
|
|
@@ -17716,8 +17877,12 @@ exports.DialogOverlay = DialogOverlay;
|
|
|
17716
17877
|
exports.DialogPortal = DialogPortal;
|
|
17717
17878
|
exports.DialogTitle = DialogTitle;
|
|
17718
17879
|
exports.DialogTrigger = DialogTrigger;
|
|
17880
|
+
exports.DynamicDialog = DynamicDialog;
|
|
17719
17881
|
exports.DynamicForm = DynamicForm;
|
|
17720
17882
|
exports.DynamicFormExample = DynamicFormExample;
|
|
17883
|
+
exports.DynamicSheetKeyboard = DynamicSheetKeyboard;
|
|
17884
|
+
exports.EmailInput = EmailInput;
|
|
17885
|
+
exports.FakeInput = FakeInput;
|
|
17721
17886
|
exports.Field = Field;
|
|
17722
17887
|
exports.FieldButtonGroup = FieldButtonGroup;
|
|
17723
17888
|
exports.FieldContent = FieldContent;
|
|
@@ -17726,10 +17891,12 @@ exports.FieldDateTimeInput = FieldDateTimeInput;
|
|
|
17726
17891
|
exports.FieldDescription = FieldDescription;
|
|
17727
17892
|
exports.FieldError = FieldError;
|
|
17728
17893
|
exports.FieldFileMultiUpload = FieldFileMultiUpload;
|
|
17894
|
+
exports.FieldFileUpload = FieldFileUpload;
|
|
17729
17895
|
exports.FieldGroup = FieldGroup;
|
|
17730
17896
|
exports.FieldKeyValueList = FieldKeyValueList;
|
|
17731
17897
|
exports.FieldLabel = FieldLabel;
|
|
17732
17898
|
exports.FieldLegend = FieldLegend;
|
|
17899
|
+
exports.FieldRange = FieldRange;
|
|
17733
17900
|
exports.FieldRepeater = FieldRepeater;
|
|
17734
17901
|
exports.FieldSeparator = FieldSeparator;
|
|
17735
17902
|
exports.FieldSet = FieldSet;
|
|
@@ -17741,6 +17908,7 @@ exports.FieldTimeInput = FieldTimeInput2;
|
|
|
17741
17908
|
exports.FieldTitle = FieldTitle;
|
|
17742
17909
|
exports.FileInput = FileInput;
|
|
17743
17910
|
exports.FileMultiUploadInput = FileMultiUploadInput;
|
|
17911
|
+
exports.FileUploadInput = FileUploadInput;
|
|
17744
17912
|
exports.Form = Form;
|
|
17745
17913
|
exports.FormControl = FormControl;
|
|
17746
17914
|
exports.FormDescription = FormDescription;
|
|
@@ -17774,9 +17942,12 @@ exports.KeyboardFactory = KeyboardFactory;
|
|
|
17774
17942
|
exports.KeyboardQwerty = KeyboardQwerty;
|
|
17775
17943
|
exports.KeyboardTypes = KeyboardTypes;
|
|
17776
17944
|
exports.Label = Label;
|
|
17945
|
+
exports.LocationPickerInput = LocationPickerInput;
|
|
17777
17946
|
exports.MultiSelectInput = MultiSelectInput;
|
|
17778
17947
|
exports.NumberInput = NumberInput;
|
|
17779
17948
|
exports.OTPInput = OTPInput2;
|
|
17949
|
+
exports.PasswordInput = PasswordInput;
|
|
17950
|
+
exports.PhoneInput = PhoneInput;
|
|
17780
17951
|
exports.Popover = Popover;
|
|
17781
17952
|
exports.PopoverAnchor = PopoverAnchor;
|
|
17782
17953
|
exports.PopoverContent = PopoverContent;
|
|
@@ -17785,6 +17956,8 @@ exports.QwertyKeyboard = QwertyKeyboard;
|
|
|
17785
17956
|
exports.RadioGroup = RadioGroup;
|
|
17786
17957
|
exports.RadioGroupInput = RadioGroupInput;
|
|
17787
17958
|
exports.RadioGroupItem = RadioGroupItem;
|
|
17959
|
+
exports.RangeInput = RangeInput;
|
|
17960
|
+
exports.RatingInput = RatingInput;
|
|
17788
17961
|
exports.RepeaterInput = RepeaterInput;
|
|
17789
17962
|
exports.RepeaterTabsInput = RepeaterTabsInput;
|
|
17790
17963
|
exports.ResizableHandle = ResizableHandle;
|
|
@@ -17792,6 +17965,7 @@ exports.ResizablePanel = ResizablePanel;
|
|
|
17792
17965
|
exports.ResizablePanelGroup = ResizablePanelGroup;
|
|
17793
17966
|
exports.ScrollArea = ScrollArea;
|
|
17794
17967
|
exports.ScrollBar = ScrollBar;
|
|
17968
|
+
exports.SearchInputClass = SearchInputClass;
|
|
17795
17969
|
exports.Select = Select;
|
|
17796
17970
|
exports.SelectContent = SelectContent;
|
|
17797
17971
|
exports.SelectGroup = SelectGroup;
|
|
@@ -17804,10 +17978,19 @@ exports.SelectSeparator = SelectSeparator;
|
|
|
17804
17978
|
exports.SelectTrigger = SelectTrigger;
|
|
17805
17979
|
exports.SelectValue = SelectValue;
|
|
17806
17980
|
exports.Separator = Separator;
|
|
17981
|
+
exports.Sheet = Sheet;
|
|
17982
|
+
exports.SheetClose = SheetClose;
|
|
17983
|
+
exports.SheetContent = SheetContent;
|
|
17984
|
+
exports.SheetDescription = SheetDescription;
|
|
17985
|
+
exports.SheetFooter = SheetFooter;
|
|
17986
|
+
exports.SheetHeader = SheetHeader;
|
|
17987
|
+
exports.SheetTitle = SheetTitle;
|
|
17988
|
+
exports.SheetTrigger = SheetTrigger;
|
|
17807
17989
|
exports.SimpleCheckListInput = SimpleCheckListInput;
|
|
17808
17990
|
exports.Slider = Slider;
|
|
17809
17991
|
exports.SliderInput = SliderInput;
|
|
17810
17992
|
exports.SortableListInput = SortableListInput;
|
|
17993
|
+
exports.Stepper = Stepper;
|
|
17811
17994
|
exports.StringValueListInput = StringValueListInput;
|
|
17812
17995
|
exports.Switch = Switch;
|
|
17813
17996
|
exports.SwitchInput = SwitchInput;
|
|
@@ -17827,18 +18010,22 @@ exports.Tooltip = Tooltip;
|
|
|
17827
18010
|
exports.TooltipContent = TooltipContent;
|
|
17828
18011
|
exports.TooltipProvider = TooltipProvider;
|
|
17829
18012
|
exports.TooltipTrigger = TooltipTrigger;
|
|
18013
|
+
exports.UrlInput = UrlInput;
|
|
17830
18014
|
exports.WizardForm = WizardForm;
|
|
17831
18015
|
exports.applyCase = applyCase;
|
|
17832
18016
|
exports.applyInputFilter = applyInputFilter;
|
|
17833
18017
|
exports.badgeVariants = badgeVariants;
|
|
18018
|
+
exports.borderRadiusClasses = borderRadiusClasses;
|
|
17834
18019
|
exports.buttonGroupVariants = buttonGroupVariants;
|
|
17835
18020
|
exports.buttonVariants = buttonVariants;
|
|
17836
18021
|
exports.cn = cn;
|
|
18022
|
+
exports.defaultTheme = defaultTheme;
|
|
17837
18023
|
exports.entitiesToGroupedOption = entitiesToGroupedOption;
|
|
17838
18024
|
exports.entitiesToInputOption = entitiesToInputOption;
|
|
17839
18025
|
exports.entityToGroupedOption = entityToGroupedOption;
|
|
17840
18026
|
exports.entityToInputOption = entityToInputOption;
|
|
17841
18027
|
exports.flattenFields = flattenFields;
|
|
18028
|
+
exports.fontSizeClasses = fontSizeClasses;
|
|
17842
18029
|
exports.getDefaultValues = getDefaultValues;
|
|
17843
18030
|
exports.getDynamicSchema = getDynamicSchema;
|
|
17844
18031
|
exports.getFieldLabel = getFieldLabel;
|
|
@@ -17846,8 +18033,10 @@ exports.handleOnChage = handleOnChage;
|
|
|
17846
18033
|
exports.inputFieldComp = inputFieldComp;
|
|
17847
18034
|
exports.inputMap = inputMap;
|
|
17848
18035
|
exports.isValidField = isValidField;
|
|
18036
|
+
exports.labelPositionClasses = labelPositionClasses;
|
|
17849
18037
|
exports.letter = letter;
|
|
17850
18038
|
exports.mockFields = mockFields;
|
|
18039
|
+
exports.spacingClasses = spacingClasses;
|
|
17851
18040
|
exports.useDynamicForm = useDynamicForm;
|
|
17852
18041
|
exports.useFormField = useFormField;
|
|
17853
18042
|
exports.useFormPersist = useFormPersist;
|