siam-ui-utils 3.2.1 → 3.2.2

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.
@@ -11,7 +11,9 @@ const CustomInputCheckbox = ({
11
11
  onChange,
12
12
  direction = "row",
13
13
  style,
14
- slotProps
14
+ slotProps,
15
+ inline: _inline
16
+ // aceptado por compatibilidad, sin efecto visual
15
17
  }) => {
16
18
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17
19
  /* @__PURE__ */ jsx(
@@ -27,6 +29,8 @@ const CustomInputCheckbox = ({
27
29
  direction,
28
30
  style: {
29
31
  "--siam-checkbox-size": "19px",
32
+ marginLeft: "10px",
33
+ marginRight: "10px",
30
34
  ...style
31
35
  },
32
36
  slotProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"CustomInputCheckbox.js","sources":["../../src/custom-input/CustomInputCheckbox.jsx"],"sourcesContent":["import { Checkbox } from 'siam-ui';\n\nexport const CustomInputCheckbox = ({\n className,\n id,\n checked,\n children,\n defaultChecked,\n disabled,\n label,\n onChange,\n direction = 'row',\n style,\n slotProps,\n}) => {\n return (\n <>\n <Checkbox\n id={`check_${id}`}\n className={className}\n checked={checked}\n onChange={onChange}\n defaultChecked={defaultChecked}\n disabled={disabled}\n label={label}\n direction={direction}\n style={{\n '--siam-checkbox-size': '19px',\n ...style,\n }}\n slotProps={{\n ...slotProps,\n root: {\n ...slotProps?.root,\n style: {\n flexDirection: direction,\n ...slotProps?.root?.style,\n },\n },\n label: {\n ...slotProps?.label,\n style: { fontSize: '12px', ...slotProps?.label?.style },\n },\n }}\n />\n {children}\n </>\n );\n};\n\nexport default CustomInputCheckbox;\n"],"names":[],"mappings":";;AAEO,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AACF,MAAM;AACJ,SACE,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,SAAS,EAAE;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,UACL,wBAAwB;AAAA,UACxB,GAAG;AAAA,QAAA;AAAA,QAEL,WAAW;AAAA,UACT,GAAG;AAAA,UACH,MAAM;AAAA,YACJ,GAAG,WAAW;AAAA,YACd,OAAO;AAAA,cACL,eAAe;AAAA,cACf,GAAG,WAAW,MAAM;AAAA,YAAA;AAAA,UACtB;AAAA,UAEF,OAAO;AAAA,YACL,GAAG,WAAW;AAAA,YACd,OAAO,EAAE,UAAU,QAAQ,GAAG,WAAW,OAAO,MAAA;AAAA,UAAM;AAAA,QACxD;AAAA,MACF;AAAA,IAAA;AAAA,IAED;AAAA,EAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"CustomInputCheckbox.js","sources":["../../src/custom-input/CustomInputCheckbox.jsx"],"sourcesContent":["import { Checkbox } from 'siam-ui';\n\nexport const CustomInputCheckbox = ({\n className,\n id,\n checked,\n children,\n defaultChecked,\n disabled,\n label,\n onChange,\n direction = 'row',\n style,\n slotProps,\n inline: _inline, // aceptado por compatibilidad, sin efecto visual\n}) => {\n return (\n <>\n <Checkbox\n id={`check_${id}`}\n className={className}\n checked={checked}\n onChange={onChange}\n defaultChecked={defaultChecked}\n disabled={disabled}\n label={label}\n direction={direction}\n style={{\n '--siam-checkbox-size': '19px',\n marginLeft: '10px',\n marginRight: '10px',\n ...style,\n }}\n slotProps={{\n ...slotProps,\n root: {\n ...slotProps?.root,\n style: {\n flexDirection: direction,\n ...slotProps?.root?.style,\n },\n },\n label: {\n ...slotProps?.label,\n style: { fontSize: '12px', ...slotProps?.label?.style },\n },\n }}\n />\n {children}\n </>\n );\n};\n\nexport default CustomInputCheckbox;\n"],"names":[],"mappings":";;AAEO,MAAM,sBAAsB,CAAC;AAAA,EAClC;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;AACV,MAAM;AACJ,SACE,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,SAAS,EAAE;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,UACL,wBAAwB;AAAA,UACxB,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,GAAG;AAAA,QAAA;AAAA,QAEL,WAAW;AAAA,UACT,GAAG;AAAA,UACH,MAAM;AAAA,YACJ,GAAG,WAAW;AAAA,YACd,OAAO;AAAA,cACL,eAAe;AAAA,cACf,GAAG,WAAW,MAAM;AAAA,YAAA;AAAA,UACtB;AAAA,UAEF,OAAO;AAAA,YACL,GAAG,WAAW;AAAA,YACd,OAAO,EAAE,UAAU,QAAQ,GAAG,WAAW,OAAO,MAAA;AAAA,UAAM;AAAA,QACxD;AAAA,MACF;AAAA,IAAA;AAAA,IAED;AAAA,EAAA,GACH;AAEJ;"}
@@ -1,9 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { Radio } from "siam-ui";
3
4
  const CustomInputRadio = ({
4
5
  className,
5
6
  customClassName,
6
7
  checked,
8
+ defaultChecked,
7
9
  disabled,
8
10
  id,
9
11
  label,
@@ -11,15 +13,27 @@ const CustomInputRadio = ({
11
13
  onChange,
12
14
  direction = "row",
13
15
  style,
14
- slotProps
16
+ slotProps,
17
+ inline: _inline,
18
+ // aceptado por compatibilidad, sin efecto visual
19
+ ...rest
15
20
  }) => {
21
+ const [internalChecked, setInternalChecked] = useState(
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
+ };
16
30
  return /* @__PURE__ */ jsx(
17
31
  Radio,
18
32
  {
19
33
  id,
20
34
  name,
21
- checked: checked ?? false,
22
- onChange,
35
+ checked: isChecked,
36
+ onChange: handleChange,
23
37
  disabled,
24
38
  className: className ?? customClassName,
25
39
  label,
@@ -27,6 +41,8 @@ const CustomInputRadio = ({
27
41
  style: {
28
42
  "--siam-radio-size": "19px",
29
43
  "--siam-radio-inner-size": "11px",
44
+ marginLeft: "10px",
45
+ marginRight: "10px",
30
46
  ...style
31
47
  },
32
48
  slotProps: {
@@ -42,7 +58,8 @@ const CustomInputRadio = ({
42
58
  ...slotProps?.label,
43
59
  style: { fontSize: "12px", ...slotProps?.label?.style }
44
60
  }
45
- }
61
+ },
62
+ ...rest
46
63
  }
47
64
  );
48
65
  };
@@ -1 +1 @@
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 disabled,\n id,\n label,\n name,\n onChange,\n direction = 'row',\n style,\n slotProps,\n}) => {\n return (\n <Radio\n id={id}\n name={name}\n checked={checked ?? false}\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 ...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 />\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,YAAY;AAAA,EACZ;AAAA,EACA;AACF,MAAM;AACJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS,WAAW;AAAA,MACpB;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,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,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"CustomInputRadio.js","sources":["../../src/custom-input/CustomInputRadio.jsx"],"sourcesContent":["import { useState } from 'react';\nimport { 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 [internalChecked, setInternalChecked] = useState(\n defaultChecked ?? false\n );\n const isControlled = checked !== undefined;\n const isChecked = isControlled ? checked : internalChecked;\n\n const handleChange = (e) => {\n if (!isControlled) setInternalChecked(e.target.checked);\n onChange?.(e);\n };\n\n return (\n <Radio\n id={id}\n name={name}\n checked={isChecked}\n onChange={handleChange}\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":";;;AAGO,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,CAAC,iBAAiB,kBAAkB,IAAI;AAAA,IAC5C,kBAAkB;AAAA,EAAA;AAEpB,QAAM,eAAe,YAAY;AACjC,QAAM,YAAY,eAAe,UAAU;AAE3C,QAAM,eAAe,CAAC,MAAM;AAC1B,QAAI,CAAC,aAAc,oBAAmB,EAAE,OAAO,OAAO;AACtD,eAAW,CAAC;AAAA,EACd;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,MACV;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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siam-ui-utils",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "keywords": [
5
5
  "ampf-react",
6
6
  "ampf-utils",
@@ -102,7 +102,7 @@
102
102
  "react-intl": "^7.1.14",
103
103
  "react-notifications": "^1.7.4",
104
104
  "react-select": "^5.10.2",
105
- "siam-ui": "^1.2.1",
105
+ "siam-ui": "^1.2.2",
106
106
  "siam-utils": "^1.1.4",
107
107
  "styled-components": "^6.1.12"
108
108
  },