@asteby/metacore-runtime-react 30.0.3 → 30.0.4

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,12 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 30.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 1cd72ee: fix(types): ActionDefinition.steps para que el build de release compile
8
+ - 11d12ae: DynamicSelectField: `staticOptions`, `descriptionAsBadge` y `hideCreate` para reutilizar el mismo picker en modales federados (despacho / taller) con listas filtradas en cliente.
9
+
3
10
  ## 30.0.3
4
11
 
5
12
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"action-modal-dispatcher.d.ts","sourceRoot":"","sources":["../src/action-modal-dispatcher.tsx"],"names":[],"mappings":"AA0DA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAExB,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAA;AA0FhD,wBAAgB,qBAAqB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,GACZ,EAAE,gBAAgB,sCA+DlB"}
1
+ {"version":3,"file":"action-modal-dispatcher.d.ts","sourceRoot":"","sources":["../src/action-modal-dispatcher.tsx"],"names":[],"mappings":"AA4DA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAExB,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAA;AA0FhD,wBAAgB,qBAAqB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,GACZ,EAAE,gBAAgB,sCAoElB"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // ActionModalDispatcher — renders the right modal for a custom action:
3
3
  // 1) Custom component from the SDK registry → use it
4
- // 2) action.fields[] → GenericActionModal (form)
5
- // 3) action.confirm → ConfirmActionDialog
6
- // 4) otherwise nothing (caller executes immediately)
4
+ // 2) action.fields[] / action.steps[] → GenericActionModal / WizardActionModal
5
+ // 3) action.confirm OR action.confirmMessage → ConfirmActionDialog
6
+ // 4) action.executable (host opened the modal; federated UI missing)
7
+ // ConfirmActionDialog so a click never silently no-ops
8
+ // 5) otherwise → null (caller should execute immediately without opening us)
7
9
  //
8
10
  // The host injects its axios-like client via <ApiProvider>; we no longer
9
11
  // depend on a bundler alias to `@/lib/api`.
@@ -96,7 +98,12 @@ export function ActionModalDispatcher({ open, onOpenChange, action, model, recor
96
98
  if (action.fields && action.fields.length > 0) {
97
99
  return (_jsx(GenericActionModal, { open: open, onOpenChange: onOpenChange, action: action, model: model, record: record, endpoint: endpoint, onSuccess: onSuccess }));
98
100
  }
99
- if (action.confirm) {
101
+ // confirm_message alone is confirmation intent (v3 manifests often omit the
102
+ // boolean). Hosts also mark every wasm action `executable` and open THIS
103
+ // dispatcher; without a confirm/fields/custom UI we used to return null and
104
+ // the row click did nothing. Treat message-only + executable-open as confirm.
105
+ const wantsConfirm = !!(action.confirm || action.confirmMessage);
106
+ if (wantsConfirm || (open && action.executable)) {
100
107
  return (_jsx(ConfirmActionDialog, { open: open, onOpenChange: onOpenChange, action: action, model: model, record: record, endpoint: endpoint, onSuccess: onSuccess }));
101
108
  }
102
109
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-row-actions.d.ts","sourceRoot":"","sources":["../src/dynamic-row-actions.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAA;AAE5D,MAAM,WAAW,0BAA0B;IACvC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OA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AoB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE;;;OAGG;IACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAA;CAC9B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,SAAS,GACZ,EAAE,0BAA0B,GAAG,iBAAiB,CA2HhD"}
@@ -58,7 +58,11 @@ export function useDynamicRowActions({ model, endpoint, mutationEndpoint, metada
58
58
  return;
59
59
  }
60
60
  const actionDef = metadata?.actions?.find((a) => a.key === action);
61
- if (actionDef && (actionDef.fields?.length || actionDef.confirm || actionDef.executable)) {
61
+ // Open the dispatcher when there is ANY UI surface (fields, wizard
62
+ // steps, confirm bool, confirmMessage, or host `executable`). A
63
+ // confirm_message without confirm:true used to fall through / open and
64
+ // then render null — derive confirm so the ConfirmActionDialog path wins.
65
+ if (actionDef && (actionDef.fields?.length || actionDef.steps?.length || actionDef.confirm || actionDef.confirmMessage || actionDef.executable)) {
62
66
  setActionModal({
63
67
  open: true,
64
68
  action: {
@@ -66,9 +70,10 @@ export function useDynamicRowActions({ model, endpoint, mutationEndpoint, metada
66
70
  label: actionDef.label,
67
71
  icon: actionDef.icon || 'Zap',
68
72
  color: actionDef.color,
69
- confirm: actionDef.confirm,
73
+ confirm: !!(actionDef.confirm || actionDef.confirmMessage),
70
74
  confirmMessage: actionDef.confirmMessage,
71
75
  fields: actionDef.fields,
76
+ steps: actionDef.steps,
72
77
  requiresState: actionDef.requiresState,
73
78
  executable: actionDef.executable,
74
79
  },
@@ -58,7 +58,25 @@ export interface DynamicSelectFieldProps {
58
58
  * on open) so the label resolves to the NAME instead of showing the raw id.
59
59
  */
60
60
  readonly?: boolean;
61
+ /**
62
+ * Caller-owned options (e.g. warehouses filtered by available stock for a
63
+ * dispatch line). When set, skips `/options` and filters these client-side
64
+ * by the search box. Federated process modals use this so they share the
65
+ * same DynamicSelect chrome without reinventing a lighter picker.
66
+ */
67
+ staticOptions?: readonly ResolvedOption[] | null;
68
+ /**
69
+ * Render `option.description` as a trailing Badge (stock, codes, …) instead
70
+ * of the default muted subtitle under the label.
71
+ */
72
+ descriptionAsBadge?: boolean;
73
+ /**
74
+ * Hide the inline "+" create affordance even when `field.ref` is set.
75
+ * Useful for static / filtered lists where creating a new record is not
76
+ * meaningful in context.
77
+ */
78
+ hideCreate?: boolean;
61
79
  }
62
- export declare function DynamicSelectField({ field, value, onChange, seedOption, dependsValue, dependsHint, readonly, }: DynamicSelectFieldProps): import("react").JSX.Element;
80
+ export declare function DynamicSelectField({ field, value, onChange, seedOption, dependsValue, dependsHint, readonly, staticOptions, descriptionAsBadge, hideCreate, }: DynamicSelectFieldProps): import("react").JSX.Element;
63
81
  export default DynamicSelectField;
64
82
  //# sourceMappingURL=dynamic-select-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-select-field.d.ts","sourceRoot":"","sources":["../src/dynamic-select-field.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gDAAgD,CAAA;AAEjF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,IAAI,EACJ,IAAS,GACZ,EAAE;IACC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,+BA6BA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACvB,MAAM,EACN,IAAS,GACZ,EAAE;IACC,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO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AE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAA;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,sCA4BA;AAWD,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IAClC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI,CAAA;IAChD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAgB,EAChB,aAAoB,EACpB,kBAA0B,EAC1B,UAAkB,GACrB,EAAE,uBAAuB,+BA8SzB;AAED,eAAe,kBAAkB,CAAA"}
@@ -23,7 +23,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  // value). A dedicated `?ids=` lookup is a follow-up; create flows — the common
24
24
  // case — start empty and never hit this.
25
25
  import { useEffect, useRef, useState } from 'react';
26
- import { Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Popover, PopoverContent, PopoverTrigger, InitialsAvatar, } from '@asteby/metacore-ui/primitives';
26
+ import { Badge, Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Popover, PopoverContent, PopoverTrigger, InitialsAvatar, } from '@asteby/metacore-ui/primitives';
27
27
  import { Check, ChevronsUpDown, Loader2, Plus, ScanLine } from 'lucide-react';
28
28
  import { resolveColorCss } from '@asteby/metacore-ui/lib';
29
29
  import { BarcodeScanner } from './barcode-scanner';
@@ -93,7 +93,7 @@ function useDebounced(value, ms) {
93
93
  }, [value, ms]);
94
94
  return debounced;
95
95
  }
96
- export function DynamicSelectField({ field, value, onChange, seedOption, dependsValue, dependsHint, readonly = false, }) {
96
+ export function DynamicSelectField({ field, value, onChange, seedOption, dependsValue, dependsHint, readonly = false, staticOptions = null, descriptionAsBadge = false, hideCreate = false, }) {
97
97
  const [open, setOpen] = useState(false);
98
98
  const [search, setSearch] = useState('');
99
99
  const [scanOpen, setScanOpen] = useState(false);
@@ -125,7 +125,8 @@ export function DynamicSelectField({ field, value, onChange, seedOption, depends
125
125
  const dependsOn = getDependsOn(field);
126
126
  const scope = dependsValue ? String(dependsValue) : '';
127
127
  const blockedByDependency = !!dependsOn && scope === '';
128
- const { options, loading } = useOptionsResolver({
128
+ const useStatic = Array.isArray(staticOptions);
129
+ const { options: fetchedOptions, loading: fetchLoading } = useOptionsResolver({
129
130
  modelKey: '',
130
131
  fieldKey: source.fieldKey,
131
132
  ref: source.ref,
@@ -142,8 +143,19 @@ export function DynamicSelectField({ field, value, onChange, seedOption, depends
142
143
  // changes while open). A picker blocked by an unset dependency never
143
144
  // fetches. A readonly cell fetches eagerly so its value's label resolves
144
145
  // to the name without the user ever opening it.
145
- enabled: (open || readonly) && !blockedByDependency,
146
+ // Static lists never hit the network.
147
+ enabled: !useStatic && (open || readonly) && !blockedByDependency,
146
148
  });
149
+ const options = useStatic
150
+ ? staticOptions.filter((o) => {
151
+ if (!debounced)
152
+ return true;
153
+ const q = debounced.toLowerCase();
154
+ return (String(o.label ?? '').toLowerCase().includes(q) ||
155
+ String(o.description ?? '').toLowerCase().includes(q));
156
+ })
157
+ : fetchedOptions;
158
+ const loading = useStatic ? false : fetchLoading;
147
159
  // When the depended-on value changes, the previously-picked option no longer
148
160
  // belongs to the new scope, so clear the selection (skip the initial mount).
149
161
  const prevScopeRef = useRef(scope);
@@ -209,12 +221,18 @@ export function DynamicSelectField({ field, value, onChange, seedOption, depends
209
221
  return (_jsxs("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [_jsxs(Popover, { open: open && !blockedByDependency, onOpenChange: (o) => { if (!blockedByDependency)
210
222
  setOpen(o); }, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "outline", role: "combobox", "aria-expanded": open, id: field.key, disabled: blockedByDependency, className: "min-w-0 flex-1 justify-between font-normal", "data-empty": !value, "data-depends-blocked": blockedByDependency ? '' : undefined, children: [_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2 text-left", children: [value && selectedOption ? (_jsx(OptionLead, { option: selectedOption, size: 20 })) : null, _jsx("span", { className: 'min-w-0 flex-1 truncate ' + (selectedLabel ? '' : 'text-muted-foreground'), children: blockedByDependency
211
223
  ? (dependsHint || DEFAULT_DEPENDS_HINT)
212
- : selectedLabel || field.placeholder || 'Buscar…' })] }), _jsx(ChevronsUpDown, { className: "ml-2 size-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0", align: "start",
224
+ : selectedLabel || field.placeholder || 'Buscar…' }), descriptionAsBadge && selectedOption?.description ? (_jsx(Badge, { variant: "secondary", className: "shrink-0 font-normal tabular-nums", children: selectedOption.description })) : null] }), _jsx(ChevronsUpDown, { className: "ml-2 size-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0", align: "start",
213
225
  // Match the trigger width without an arbitrary Tailwind class
214
226
  // (those don't always survive a consuming app's Tailwind scan).
215
- style: { width: 'var(--radix-popover-trigger-width)' }, children: _jsxs(Command, { shouldFilter: false, children: [_jsx(CommandInput, { placeholder: field.placeholder || 'Buscar…', value: search, onValueChange: setSearch }), _jsxs(CommandList, { children: [loading && (_jsxs("div", { className: "text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm", children: [_jsx(Loader2, { className: "size-4 animate-spin" }), "Buscando\u2026"] })), !loading && options.length === 0 && (_jsx(CommandEmpty, { children: debounced ? 'Sin resultados' : 'Escribí para buscar…' })), !loading && options.length > 0 && (_jsx(CommandGroup, { className: "max-h-64 overflow-auto", children: options.map((opt) => {
227
+ style: { width: 'var(--radix-popover-trigger-width)' }, children: _jsxs(Command, { shouldFilter: false, children: [_jsx(CommandInput, { placeholder: field.placeholder || 'Buscar…', value: search, onValueChange: setSearch }), _jsxs(CommandList, { children: [loading && (_jsxs("div", { className: "text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm", children: [_jsx(Loader2, { className: "size-4 animate-spin" }), "Buscando\u2026"] })), !loading && options.length === 0 && (_jsx(CommandEmpty, { children: useStatic
228
+ ? debounced
229
+ ? 'Sin resultados'
230
+ : 'Sin opciones'
231
+ : debounced
232
+ ? 'Sin resultados'
233
+ : 'Escribí para buscar…' })), !loading && options.length > 0 && (_jsx(CommandGroup, { className: "max-h-64 overflow-auto", children: options.map((opt) => {
216
234
  const isSel = String(opt.id) === String(value);
217
- return (_jsxs(CommandItem, { value: String(opt.id), onSelect: () => handlePick(opt), children: [_jsx(Check, { className: 'mr-2 size-4 shrink-0 ' + (isSel ? 'opacity-100' : 'opacity-0') }), _jsx(OptionLead, { option: opt, size: 24 }), _jsxs("div", { className: "ml-2 flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate", children: opt.label }), opt.description && (_jsx("span", { className: "text-muted-foreground truncate text-xs", children: opt.description }))] })] }, String(opt.id)));
218
- }) }))] })] }) })] }), scanEnabled && (_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" }) })), fieldRef && (_jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: openCreate, title: `Crear ${field.label ?? fieldRef}`, "aria-label": `Crear ${field.label ?? fieldRef}`, children: _jsx(Plus, { className: "size-4" }) })), scanEnabled && (_jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: handleScanDetected, continuous: false, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() }))] }));
235
+ return (_jsxs(CommandItem, { value: String(opt.id), onSelect: () => handlePick(opt), children: [_jsx(Check, { className: 'mr-2 size-4 shrink-0 ' + (isSel ? 'opacity-100' : 'opacity-0') }), _jsx(OptionLead, { option: opt, size: 24 }), descriptionAsBadge ? (_jsxs("div", { className: "ml-2 flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: opt.label }), opt.description ? (_jsx(Badge, { variant: "secondary", className: "shrink-0 font-normal tabular-nums", children: opt.description })) : null] })) : (_jsxs("div", { className: "ml-2 flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate", children: opt.label }), opt.description && (_jsx("span", { className: "text-muted-foreground truncate text-xs", children: opt.description }))] }))] }, String(opt.id)));
236
+ }) }))] })] }) })] }), scanEnabled && (_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" }) })), fieldRef && !hideCreate && !useStatic && (_jsx(Button, { type: "button", variant: "outline", size: "icon", className: "size-9 shrink-0", onClick: openCreate, title: `Crear ${field.label ?? fieldRef}`, "aria-label": `Crear ${field.label ?? fieldRef}`, children: _jsx(Plus, { className: "size-4" }) })), scanEnabled && (_jsx(BarcodeScanner, { open: scanOpen, onClose: () => setScanOpen(false), onDetected: handleScanDetected, continuous: false, position: "fixed", title: `Escanear ${field.label ?? ''}`.trim() }))] }));
219
237
  }
220
238
  export default DynamicSelectField;
package/dist/types.d.ts CHANGED
@@ -594,6 +594,8 @@ export interface ActionDefinition {
594
594
  confirm?: boolean;
595
595
  confirmMessage?: string;
596
596
  fields?: ActionFieldDef[];
597
+ /** Multi-step wizard form; when present the dispatcher renders a wizard. */
598
+ steps?: ActionStep[];
597
599
  requiresState?: string[];
598
600
  executable?: boolean;
599
601
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA;gCACgC;AAChC,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,UAAU,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;I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  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "30.0.3",
3
+ "version": "30.0.4",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,8 +37,8 @@
37
37
  "react-i18next": ">=13",
38
38
  "sonner": ">=1.7",
39
39
  "zustand": ">=5",
40
- "@asteby/metacore-ui": "^2.14.1",
41
- "@asteby/metacore-sdk": "^3.4.0"
40
+ "@asteby/metacore-sdk": "^3.4.0",
41
+ "@asteby/metacore-ui": "^2.14.1"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@tanstack/react-router": {
@@ -1,8 +1,10 @@
1
1
  // ActionModalDispatcher — renders the right modal for a custom action:
2
2
  // 1) Custom component from the SDK registry → use it
3
- // 2) action.fields[] → GenericActionModal (form)
4
- // 3) action.confirm → ConfirmActionDialog
5
- // 4) otherwise nothing (caller executes immediately)
3
+ // 2) action.fields[] / action.steps[] → GenericActionModal / WizardActionModal
4
+ // 3) action.confirm OR action.confirmMessage → ConfirmActionDialog
5
+ // 4) action.executable (host opened the modal; federated UI missing)
6
+ // ConfirmActionDialog so a click never silently no-ops
7
+ // 5) otherwise → null (caller should execute immediately without opening us)
6
8
  //
7
9
  // The host injects its axios-like client via <ApiProvider>; we no longer
8
10
  // depend on a bundler alias to `@/lib/api`.
@@ -208,7 +210,12 @@ export function ActionModalDispatcher({
208
210
  )
209
211
  }
210
212
 
211
- if (action.confirm) {
213
+ // confirm_message alone is confirmation intent (v3 manifests often omit the
214
+ // boolean). Hosts also mark every wasm action `executable` and open THIS
215
+ // dispatcher; without a confirm/fields/custom UI we used to return null and
216
+ // the row click did nothing. Treat message-only + executable-open as confirm.
217
+ const wantsConfirm = !!(action.confirm || action.confirmMessage)
218
+ if (wantsConfirm || (open && action.executable)) {
212
219
  return (
213
220
  <ConfirmActionDialog
214
221
  open={open}
@@ -120,7 +120,11 @@ export function useDynamicRowActions({
120
120
  return
121
121
  }
122
122
  const actionDef = metadata?.actions?.find((a) => a.key === action)
123
- if (actionDef && (actionDef.fields?.length || actionDef.confirm || actionDef.executable)) {
123
+ // Open the dispatcher when there is ANY UI surface (fields, wizard
124
+ // steps, confirm bool, confirmMessage, or host `executable`). A
125
+ // confirm_message without confirm:true used to fall through / open and
126
+ // then render null — derive confirm so the ConfirmActionDialog path wins.
127
+ if (actionDef && (actionDef.fields?.length || actionDef.steps?.length || actionDef.confirm || actionDef.confirmMessage || actionDef.executable)) {
124
128
  setActionModal({
125
129
  open: true,
126
130
  action: {
@@ -128,9 +132,10 @@ export function useDynamicRowActions({
128
132
  label: actionDef.label,
129
133
  icon: actionDef.icon || 'Zap',
130
134
  color: actionDef.color,
131
- confirm: actionDef.confirm,
135
+ confirm: !!(actionDef.confirm || actionDef.confirmMessage),
132
136
  confirmMessage: actionDef.confirmMessage,
133
137
  fields: actionDef.fields,
138
+ steps: actionDef.steps,
134
139
  requiresState: actionDef.requiresState,
135
140
  executable: actionDef.executable,
136
141
  },
@@ -23,6 +23,7 @@
23
23
  // case — start empty and never hit this.
24
24
  import { useEffect, useRef, useState } from 'react'
25
25
  import {
26
+ Badge,
26
27
  Button,
27
28
  Command,
28
29
  CommandEmpty,
@@ -177,6 +178,24 @@ export interface DynamicSelectFieldProps {
177
178
  * on open) so the label resolves to the NAME instead of showing the raw id.
178
179
  */
179
180
  readonly?: boolean
181
+ /**
182
+ * Caller-owned options (e.g. warehouses filtered by available stock for a
183
+ * dispatch line). When set, skips `/options` and filters these client-side
184
+ * by the search box. Federated process modals use this so they share the
185
+ * same DynamicSelect chrome without reinventing a lighter picker.
186
+ */
187
+ staticOptions?: readonly ResolvedOption[] | null
188
+ /**
189
+ * Render `option.description` as a trailing Badge (stock, codes, …) instead
190
+ * of the default muted subtitle under the label.
191
+ */
192
+ descriptionAsBadge?: boolean
193
+ /**
194
+ * Hide the inline "+" create affordance even when `field.ref` is set.
195
+ * Useful for static / filtered lists where creating a new record is not
196
+ * meaningful in context.
197
+ */
198
+ hideCreate?: boolean
180
199
  }
181
200
 
182
201
  export function DynamicSelectField({
@@ -187,6 +206,9 @@ export function DynamicSelectField({
187
206
  dependsValue,
188
207
  dependsHint,
189
208
  readonly = false,
209
+ staticOptions = null,
210
+ descriptionAsBadge = false,
211
+ hideCreate = false,
190
212
  }: DynamicSelectFieldProps) {
191
213
  const [open, setOpen] = useState(false)
192
214
  const [search, setSearch] = useState('')
@@ -224,7 +246,9 @@ export function DynamicSelectField({
224
246
  const scope = dependsValue ? String(dependsValue) : ''
225
247
  const blockedByDependency = !!dependsOn && scope === ''
226
248
 
227
- const { options, loading } = useOptionsResolver({
249
+ const useStatic = Array.isArray(staticOptions)
250
+
251
+ const { options: fetchedOptions, loading: fetchLoading } = useOptionsResolver({
228
252
  modelKey: '',
229
253
  fieldKey: source.fieldKey,
230
254
  ref: source.ref,
@@ -241,9 +265,22 @@ export function DynamicSelectField({
241
265
  // changes while open). A picker blocked by an unset dependency never
242
266
  // fetches. A readonly cell fetches eagerly so its value's label resolves
243
267
  // to the name without the user ever opening it.
244
- enabled: (open || readonly) && !blockedByDependency,
268
+ // Static lists never hit the network.
269
+ enabled: !useStatic && (open || readonly) && !blockedByDependency,
245
270
  })
246
271
 
272
+ const options = useStatic
273
+ ? (staticOptions as ResolvedOption[]).filter((o) => {
274
+ if (!debounced) return true
275
+ const q = debounced.toLowerCase()
276
+ return (
277
+ String(o.label ?? '').toLowerCase().includes(q) ||
278
+ String(o.description ?? '').toLowerCase().includes(q)
279
+ )
280
+ })
281
+ : fetchedOptions
282
+ const loading = useStatic ? false : fetchLoading
283
+
247
284
  // When the depended-on value changes, the previously-picked option no longer
248
285
  // belongs to the new scope, so clear the selection (skip the initial mount).
249
286
  const prevScopeRef = useRef<string>(scope)
@@ -356,6 +393,11 @@ export function DynamicSelectField({
356
393
  ? (dependsHint || DEFAULT_DEPENDS_HINT)
357
394
  : selectedLabel || field.placeholder || 'Buscar…'}
358
395
  </span>
396
+ {descriptionAsBadge && selectedOption?.description ? (
397
+ <Badge variant="secondary" className="shrink-0 font-normal tabular-nums">
398
+ {selectedOption.description}
399
+ </Badge>
400
+ ) : null}
359
401
  </span>
360
402
  <ChevronsUpDown className="ml-2 size-4 shrink-0 opacity-50" />
361
403
  </Button>
@@ -382,7 +424,13 @@ export function DynamicSelectField({
382
424
  )}
383
425
  {!loading && options.length === 0 && (
384
426
  <CommandEmpty>
385
- {debounced ? 'Sin resultados' : 'Escribí para buscar…'}
427
+ {useStatic
428
+ ? debounced
429
+ ? 'Sin resultados'
430
+ : 'Sin opciones'
431
+ : debounced
432
+ ? 'Sin resultados'
433
+ : 'Escribí para buscar…'}
386
434
  </CommandEmpty>
387
435
  )}
388
436
  {!loading && options.length > 0 && (
@@ -397,14 +445,25 @@ export function DynamicSelectField({
397
445
  >
398
446
  <Check className={'mr-2 size-4 shrink-0 ' + (isSel ? 'opacity-100' : 'opacity-0')} />
399
447
  <OptionLead option={opt} size={24} />
400
- <div className="ml-2 flex min-w-0 flex-col">
401
- <span className="truncate">{opt.label}</span>
402
- {opt.description && (
403
- <span className="text-muted-foreground truncate text-xs">
404
- {opt.description}
405
- </span>
406
- )}
407
- </div>
448
+ {descriptionAsBadge ? (
449
+ <div className="ml-2 flex min-w-0 flex-1 items-center gap-2">
450
+ <span className="min-w-0 flex-1 truncate">{opt.label}</span>
451
+ {opt.description ? (
452
+ <Badge variant="secondary" className="shrink-0 font-normal tabular-nums">
453
+ {opt.description}
454
+ </Badge>
455
+ ) : null}
456
+ </div>
457
+ ) : (
458
+ <div className="ml-2 flex min-w-0 flex-col">
459
+ <span className="truncate">{opt.label}</span>
460
+ {opt.description && (
461
+ <span className="text-muted-foreground truncate text-xs">
462
+ {opt.description}
463
+ </span>
464
+ )}
465
+ </div>
466
+ )}
408
467
  </CommandItem>
409
468
  )
410
469
  })}
@@ -427,7 +486,7 @@ export function DynamicSelectField({
427
486
  <ScanLine className="size-4" />
428
487
  </Button>
429
488
  )}
430
- {fieldRef && (
489
+ {fieldRef && !hideCreate && !useStatic && (
431
490
  <Button
432
491
  type="button"
433
492
  variant="outline"
package/src/types.ts CHANGED
@@ -651,6 +651,8 @@ export interface ActionDefinition {
651
651
  confirm?: boolean
652
652
  confirmMessage?: string
653
653
  fields?: ActionFieldDef[]
654
+ /** Multi-step wizard form; when present the dispatcher renders a wizard. */
655
+ steps?: ActionStep[]
654
656
  requiresState?: string[]
655
657
  executable?: boolean
656
658
  /**