siam-ui-utils 3.2.2 → 3.2.3
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Radio } from "siam-ui";
|
|
4
3
|
const CustomInputRadio = ({
|
|
5
4
|
className,
|
|
@@ -18,22 +17,14 @@ const CustomInputRadio = ({
|
|
|
18
17
|
// aceptado por compatibilidad, sin efecto visual
|
|
19
18
|
...rest
|
|
20
19
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
defaultChecked ?? false
|
|
23
|
-
);
|
|
24
|
-
const isControlled = checked !== void 0;
|
|
25
|
-
const isChecked = isControlled ? checked : internalChecked;
|
|
26
|
-
const handleChange = (e) => {
|
|
27
|
-
if (!isControlled) setInternalChecked(e.target.checked);
|
|
28
|
-
onChange?.(e);
|
|
29
|
-
};
|
|
20
|
+
const isChecked = checked !== void 0 ? checked : defaultChecked ?? false;
|
|
30
21
|
return /* @__PURE__ */ jsx(
|
|
31
22
|
Radio,
|
|
32
23
|
{
|
|
33
24
|
id,
|
|
34
25
|
name,
|
|
35
26
|
checked: isChecked,
|
|
36
|
-
onChange
|
|
27
|
+
onChange,
|
|
37
28
|
disabled,
|
|
38
29
|
className: className ?? customClassName,
|
|
39
30
|
label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomInputRadio.js","sources":["../../src/custom-input/CustomInputRadio.jsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"CustomInputRadio.js","sources":["../../src/custom-input/CustomInputRadio.jsx"],"sourcesContent":["import { Radio } from 'siam-ui';\n\nexport const CustomInputRadio = ({\n className,\n customClassName,\n checked,\n defaultChecked,\n disabled,\n id,\n label,\n name,\n onChange,\n direction = 'row',\n style,\n slotProps,\n inline: _inline, // aceptado por compatibilidad, sin efecto visual\n ...rest\n}) => {\n const isChecked = checked !== undefined ? checked : (defaultChecked ?? false);\n\n return (\n <Radio\n id={id}\n name={name}\n checked={isChecked}\n onChange={onChange}\n disabled={disabled}\n className={className ?? customClassName}\n label={label}\n direction={direction === 'column' ? 'col' : 'row'}\n style={{\n '--siam-radio-size': '19px',\n '--siam-radio-inner-size': '11px',\n marginLeft: '10px',\n marginRight: '10px',\n ...style,\n }}\n slotProps={{\n ...slotProps,\n root: {\n ...slotProps?.root,\n style: {\n flexDirection: direction === 'column' ? 'column' : 'row',\n ...slotProps?.root?.style,\n },\n },\n label: {\n ...slotProps?.label,\n style: { fontSize: '12px', ...slotProps?.label?.style },\n },\n }}\n {...rest}\n />\n );\n};\n\nexport default CustomInputRadio;\n"],"names":[],"mappings":";;AAEO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,GAAG;AACL,MAAM;AACJ,QAAM,YAAY,YAAY,SAAY,UAAW,kBAAkB;AAEvE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,WAAW,aAAa;AAAA,MACxB;AAAA,MACA,WAAW,cAAc,WAAW,QAAQ;AAAA,MAC5C,OAAO;AAAA,QACL,qBAAqB;AAAA,QACrB,2BAA2B;AAAA,QAC3B,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,GAAG;AAAA,MAAA;AAAA,MAEL,WAAW;AAAA,QACT,GAAG;AAAA,QACH,MAAM;AAAA,UACJ,GAAG,WAAW;AAAA,UACd,OAAO;AAAA,YACL,eAAe,cAAc,WAAW,WAAW;AAAA,YACnD,GAAG,WAAW,MAAM;AAAA,UAAA;AAAA,QACtB;AAAA,QAEF,OAAO;AAAA,UACL,GAAG,WAAW;AAAA,UACd,OAAO,EAAE,UAAU,QAAQ,GAAG,WAAW,OAAO,MAAA;AAAA,QAAM;AAAA,MACxD;AAAA,MAED,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|