@asteby/metacore-runtime-react 29.2.6 → 29.2.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 29.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 89e79b0: fix(barcode-scanner): cerrar al escanear en formularios (modal crear/editar)
8
+
9
+ `continuous={false}` en dynamic-form y dynamic-record: al llenar SKU/código el
10
+ overlay se cierra. El POS sigue con continuous (default) para varios productos.
11
+
3
12
  ## 29.2.6
4
13
 
5
14
  ### Patch Changes
@@ -1034,7 +1034,10 @@ function ScannableRecordInput({ field, value, onChange, inputType, }) {
1034
1034
  const input = (_jsx(Input, { type: inputType, value: value ?? '', onChange: (e) => onChange(inputType === 'number' ? (e.target.value === '' ? '' : Number(e.target.value)) : e.target.value), placeholder: field.placeholder }));
1035
1035
  if (!scanEnabled)
1036
1036
  return input;
1037
- return (_jsxs("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [_jsx("div", { className: "min-w-0 flex-1", children: input }), _jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: () => setScanOpen(true), title: "Escanear con la c\u00E1mara", "aria-label": "Escanear c\u00F3digo de barras con la c\u00E1mara", children: _jsx(ScanLine, { className: "size-4" }) }), _jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: (code) => onChange(code), continuous: true, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() })] }));
1037
+ return (_jsxs("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [_jsx("div", { className: "min-w-0 flex-1", children: input }), _jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: () => setScanOpen(true), title: "Escanear con la c\u00E1mara", "aria-label": "Escanear c\u00F3digo de barras con la c\u00E1mara", children: _jsx(ScanLine, { className: "size-4" }) }), _jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: (code) => onChange(code),
1038
+ // Un campo = un código: cerrar al detectar. El POS usa continuous
1039
+ // (default) porque suma varios productos seguidos.
1040
+ continuous: false, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() })] }));
1038
1041
  }
1039
1042
  function ImageUploadField({ field: _field, value, onChange }) {
1040
1043
  const { t } = useTranslation();
@@ -264,7 +264,10 @@ function ScannableInput({ field, value, onChange, type, }) {
264
264
  const input = (_jsx(Input, { id: field.key, type: type, value: value ?? '', onChange: (e) => onChange(type === 'number' ? e.target.valueAsNumber || '' : e.target.value), placeholder: field.placeholder }));
265
265
  if (!scanEnabled)
266
266
  return input;
267
- return (_jsxs("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [_jsx("div", { className: "min-w-0 flex-1", children: input }), _jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: () => setScanOpen(true), title: "Escanear con la c\u00E1mara", "aria-label": "Escanear c\u00F3digo de barras con la c\u00E1mara", children: _jsx(ScanLine, { className: "size-4" }) }), _jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: (code) => onChange(code), continuous: true, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() })] }));
267
+ return (_jsxs("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [_jsx("div", { className: "min-w-0 flex-1", children: input }), _jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: () => setScanOpen(true), title: "Escanear con la c\u00E1mara", "aria-label": "Escanear c\u00F3digo de barras con la c\u00E1mara", children: _jsx(ScanLine, { className: "size-4" }) }), _jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: (code) => onChange(code),
268
+ // Un campo = un código: cerrar al detectar. El POS usa continuous
269
+ // (default) porque suma varios productos seguidos.
270
+ continuous: false, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() })] }));
268
271
  }
269
272
  function RefSelect({ field, value, onChange }) {
270
273
  const { options, loading } = useOptionsResolver({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "29.2.6",
3
+ "version": "29.2.7",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1886,7 +1886,9 @@ function ScannableRecordInput({
1886
1886
  open={scanOpen}
1887
1887
  onClose={() => setScanOpen(false)}
1888
1888
  onDetected={(code) => onChange(code)}
1889
- continuous
1889
+ // Un campo = un código: cerrar al detectar. El POS usa continuous
1890
+ // (default) porque suma varios productos seguidos.
1891
+ continuous={false}
1890
1892
  position="fixed"
1891
1893
  title={`Escanear ${field.label ?? ''}`.trim()}
1892
1894
  />
@@ -480,7 +480,9 @@ function ScannableInput({
480
480
  open={scanOpen}
481
481
  onClose={() => setScanOpen(false)}
482
482
  onDetected={(code) => onChange(code)}
483
- continuous
483
+ // Un campo = un código: cerrar al detectar. El POS usa continuous
484
+ // (default) porque suma varios productos seguidos.
485
+ continuous={false}
484
486
  position="fixed"
485
487
  title={`Escanear ${field.label ?? ''}`.trim()}
486
488
  />