@asteby/metacore-runtime-react 30.0.2 → 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 +13 -0
- package/dist/action-modal-dispatcher.d.ts.map +1 -1
- package/dist/action-modal-dispatcher.js +11 -4
- package/dist/dynamic-row-actions.d.ts.map +1 -1
- package/dist/dynamic-row-actions.js +7 -2
- package/dist/dynamic-select-field.d.ts +19 -1
- package/dist/dynamic-select-field.d.ts.map +1 -1
- package/dist/dynamic-select-field.js +26 -8
- package/dist/permissions-manager.d.ts +5 -0
- package/dist/permissions-manager.d.ts.map +1 -1
- package/dist/permissions-manager.js +4 -4
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/action-modal-dispatcher.tsx +11 -4
- package/src/dynamic-row-actions.tsx +7 -2
- package/src/dynamic-select-field.tsx +71 -12
- package/src/permissions-manager.tsx +16 -6
- package/src/types.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
10
|
+
## 30.0.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 05d1cef: Permisos: labels de acciones sin truncate (wrap) y grid a 2 columnas; soporta description en PermissionActionDef.
|
|
15
|
+
|
|
3
16
|
## 30.0.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-modal-dispatcher.d.ts","sourceRoot":"","sources":["../src/action-modal-dispatcher.tsx"],"names":[],"mappings":"
|
|
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
|
|
5
|
-
// 3) action.confirm → ConfirmActionDialog
|
|
6
|
-
// 4)
|
|
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
|
-
|
|
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;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,SAAS,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,+CAA+C;IAC/C,oBAAoB,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,
|
|
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;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,4EAA4E;IAC5E,SAAS,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,+CAA+C;IAC/C,oBAAoB,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
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"dynamic-select-field.d.ts","sourceRoot":"","sources":["../src/dynamic-select-field.tsx"],"names":[],"mappings":"AA0CA,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,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
|
|
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
|
-
|
|
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:
|
|
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;
|
|
@@ -4,6 +4,11 @@ export interface PermissionActionDef {
|
|
|
4
4
|
key: string;
|
|
5
5
|
/** Localized label ("Listar", "Pagar", "Acceder"). */
|
|
6
6
|
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional secondary line under the label (e.g. action name when the label
|
|
9
|
+
* is the module — used by screen → API shortcut checkboxes).
|
|
10
|
+
*/
|
|
11
|
+
description?: string;
|
|
7
12
|
/** Lucide icon name from the manifest action (optional). */
|
|
8
13
|
icon?: string;
|
|
9
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions-manager.d.ts","sourceRoot":"","sources":["../src/permissions-manager.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA6D9B,MAAM,WAAW,mBAAmB;IAChC,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAA;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAA;IAC3D;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAA;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,uEAAuE;IACvE,SAAS,CAAC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AAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAI3F;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAsB1E;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CA0BjF;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAE1E;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAYtF;AAmHD,wBAAgB,kBAAkB,CAAC,EAC/B,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAA0B,EAC1B,SAAS,GACZ,EAAE,uBAAuB,qBAguBzB"}
|
|
@@ -210,7 +210,7 @@ function CapabilityCheck({ checked, disabled, onToggle, icon, label, description
|
|
|
210
210
|
e.preventDefault();
|
|
211
211
|
onToggle();
|
|
212
212
|
}
|
|
213
|
-
}, className: cn('flex items-start gap-2.5 rounded-md border border-border/60 bg-card px-3 py-2.5 text-sm transition-colors', disabled ? 'opacity-50' : 'cursor-pointer hover:bg-muted/40', checked && 'border-primary/40 bg-primary/5'), children: [_jsx(Checkbox, { checked: checked, "aria-hidden": "true", tabIndex: -1, className: "pointer-events-none mt-0.5 shrink-0" }), icon && (_jsx(DynamicIcon, { name: icon, className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" })), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "block
|
|
213
|
+
}, className: cn('flex items-start gap-2.5 rounded-md border border-border/60 bg-card px-3 py-2.5 text-sm transition-colors', disabled ? 'opacity-50' : 'cursor-pointer hover:bg-muted/40', checked && 'border-primary/40 bg-primary/5'), children: [_jsx(Checkbox, { checked: checked, "aria-hidden": "true", tabIndex: -1, className: "pointer-events-none mt-0.5 shrink-0" }), icon && (_jsx(DynamicIcon, { name: icon, className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" })), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block break-words font-medium leading-snug text-foreground", children: label }), description && (_jsx("span", { className: "mt-0.5 block break-words text-xs leading-snug text-muted-foreground", children: description }))] })] }));
|
|
214
214
|
}
|
|
215
215
|
/** One clickable module row in the flat list (mirrors a sidebar item). */
|
|
216
216
|
function ModuleRow({ module, active, granted, total, onSelect, }) {
|
|
@@ -481,7 +481,7 @@ export function PermissionsManager({ loadModules, loadRoles, loadRolePermissions
|
|
|
481
481
|
0 && (_jsxs(Badge, { variant: "secondary", className: "ml-auto shrink-0 tabular-nums", children: [grantedCountForModule(draft, mod), "/", mod.actions.length] })), mod.key === activeModuleKey && (_jsx(Check, { className: "ml-2 h-4 w-4 shrink-0" }))] }, mod.key))) }, group.title || `__untitled_${gi}`)))] })] }) })] }) })] })] }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [activeModule && (_jsx(DynamicIcon, { name: activeModule.icon ||
|
|
482
482
|
(activeModule.kind === 'screen' ? 'Eye' : 'Square'), className: "h-4 w-4 shrink-0 text-primary" })), _jsx("span", { className: "truncate", children: activeModule ? activeModule.label : 'Acciones permitidas' })] }), _jsx(CardDescription, { children: activeModule
|
|
483
483
|
? `${activeModuleGroupTitle || 'Sistema'} · configura las acciones permitidas`
|
|
484
|
-
: 'Configura los permisos del módulo seleccionado.' })] }), activeRole && activeModule && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", className: "tabular-nums", children: [moduleGranted, "/", moduleTotal] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === moduleTotal, onClick: () => setModuleAll(true), children: [_jsx(CheckCheck, { className: "mr-1.5 h-3.5 w-3.5" }), " Marcar todo"] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === 0, onClick: () => setModuleAll(false), children: [_jsx(Eraser, { className: "mr-1.5 h-3.5 w-3.5" }), " Limpiar"] })] }))] }) }), _jsx(CardContent, { children: !activeRole ? (_jsx(EmptyHint, { text: "Selecciona un rol para configurar sus permisos." })) : loadingPerms ? (_jsx("div", { className: "grid gap-2 sm:grid-cols-2
|
|
484
|
+
: 'Configura los permisos del módulo seleccionado.' })] }), activeRole && activeModule && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", className: "tabular-nums", children: [moduleGranted, "/", moduleTotal] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === moduleTotal, onClick: () => setModuleAll(true), children: [_jsx(CheckCheck, { className: "mr-1.5 h-3.5 w-3.5" }), " Marcar todo"] }), _jsxs(Button, { variant: "outline", size: "sm", className: "h-8", disabled: checksDisabled || moduleGranted === 0, onClick: () => setModuleAll(false), children: [_jsx(Eraser, { className: "mr-1.5 h-3.5 w-3.5" }), " Limpiar"] })] }))] }) }), _jsx(CardContent, { children: !activeRole ? (_jsx(EmptyHint, { text: "Selecciona un rol para configurar sus permisos." })) : loadingPerms ? (_jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-14 w-full" }, i))) })) : !activeModule ? (_jsx(EmptyHint, { text: "Selecciona un m\u00F3dulo de la lista para ver sus acciones." })) : (_jsx(ModuleActionsPanel, { module: activeModule, draft: draft, checksDisabled: checksDisabled, onToggle: toggleCapability })) })] })] }), _jsx(AlertDialog, { open: pendingRoleId !== null, onOpenChange: (open) => !open && setPendingRoleId(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Cambios sin guardar" }), _jsx(AlertDialogDescription, { children: "Tienes cambios sin guardar en este rol. Si cambias de rol se descartar\u00E1n." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancelar" }), _jsx(AlertDialogAction, { onClick: () => {
|
|
485
485
|
setActiveRoleId(pendingRoleId);
|
|
486
486
|
setPendingRoleId(null);
|
|
487
487
|
}, children: "Descartar y cambiar" })] })] }) }), _jsx(Dialog, { open: roleDialog.open, onOpenChange: (open) => setRoleDialog((d) => ({ ...d, open })), children: _jsxs(DialogContent, { className: "sm:max-w-md", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: roleDialog.mode === 'create' ? 'Nuevo rol' : 'Editar rol' }) }), _jsxs("div", { className: "flex flex-col gap-4 py-2", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: "pm-role-name", children: "Nombre del rol" }), _jsx(Input, { id: "pm-role-name", value: roleDialog.label, placeholder: "Ej. Cajero", onChange: (e) => setRoleDialog((d) => ({ ...d, label: e.target.value })) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: "Color" }), _jsx("div", { className: "flex flex-wrap gap-2", children: ROLE_COLORS.map((c) => (_jsx("button", { type: "button", "aria-label": `Color ${c}`, onClick: () => setRoleDialog((d) => ({ ...d, color: c })), className: cn('h-7 w-7 rounded-full border-2 transition-transform', roleDialog.color === c
|
|
@@ -496,9 +496,9 @@ export function PermissionsManager({ loadModules, loadRoles, loadRolePermissions
|
|
|
496
496
|
}, children: deleting ? 'Eliminando…' : 'Eliminar' })] })] }) })] }));
|
|
497
497
|
}
|
|
498
498
|
function ActionCheckGrid({ moduleKey, actions, draft, checksDisabled, onToggle, }) {
|
|
499
|
-
return (_jsx("div", { className: "grid gap-2 sm:grid-cols-2
|
|
499
|
+
return (_jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: actions.map((action) => {
|
|
500
500
|
const cap = moduleActionCapability(moduleKey, action.key, action.capability);
|
|
501
|
-
return (_jsx(CapabilityCheck, { checked: draft?.has(cap) ?? false, disabled: checksDisabled, onToggle: () => onToggle(cap), icon: action.icon || defaultActionIcon(action.key, action.kind), label: action.label }, action.capability ?? action.key));
|
|
501
|
+
return (_jsx(CapabilityCheck, { checked: draft?.has(cap) ?? false, disabled: checksDisabled, onToggle: () => onToggle(cap), icon: action.icon || defaultActionIcon(action.key, action.kind), label: action.label, description: action.description }, action.capability ?? action.key));
|
|
502
502
|
}) }));
|
|
503
503
|
}
|
|
504
504
|
/** Flat grid, or collapsible sections when actions declare `group`. */
|
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
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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,CA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MAAM,EAAE,cAAc,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IACzB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-runtime-react",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.4",
|
|
4
4
|
"description": "React runtime for metacore hosts — renders addon contributions dynamically",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"sonner": ">=1.7",
|
|
39
39
|
"zustand": ">=5",
|
|
40
40
|
"@asteby/metacore-sdk": "^3.4.0",
|
|
41
|
-
"@asteby/metacore-ui": "^2.14.
|
|
41
|
+
"@asteby/metacore-ui": "^2.14.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@tanstack/react-router": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"vitest": "^4.0.0",
|
|
69
69
|
"zustand": "^5.0.0",
|
|
70
70
|
"@asteby/metacore-sdk": "3.4.0",
|
|
71
|
-
"@asteby/metacore-ui": "2.14.
|
|
71
|
+
"@asteby/metacore-ui": "2.14.1"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "tsc -p tsconfig.json",
|
|
@@ -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
|
|
4
|
-
// 3) action.confirm → ConfirmActionDialog
|
|
5
|
-
// 4)
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
{
|
|
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
|
-
|
|
401
|
-
<
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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"
|
|
@@ -89,6 +89,11 @@ export interface PermissionActionDef {
|
|
|
89
89
|
key: string
|
|
90
90
|
/** Localized label ("Listar", "Pagar", "Acceder"). */
|
|
91
91
|
label: string
|
|
92
|
+
/**
|
|
93
|
+
* Optional secondary line under the label (e.g. action name when the label
|
|
94
|
+
* is the module — used by screen → API shortcut checkboxes).
|
|
95
|
+
*/
|
|
96
|
+
description?: string
|
|
92
97
|
/** Lucide icon name from the manifest action (optional). */
|
|
93
98
|
icon?: string
|
|
94
99
|
/**
|
|
@@ -446,10 +451,14 @@ function CapabilityCheck({
|
|
|
446
451
|
{icon && (
|
|
447
452
|
<DynamicIcon name={icon} className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" />
|
|
448
453
|
)}
|
|
449
|
-
<span className="min-w-0">
|
|
450
|
-
<span className="block
|
|
454
|
+
<span className="min-w-0 flex-1">
|
|
455
|
+
<span className="block break-words font-medium leading-snug text-foreground">
|
|
456
|
+
{label}
|
|
457
|
+
</span>
|
|
451
458
|
{description && (
|
|
452
|
-
<span className="mt-0.5 block text-xs text-muted-foreground">
|
|
459
|
+
<span className="mt-0.5 block break-words text-xs leading-snug text-muted-foreground">
|
|
460
|
+
{description}
|
|
461
|
+
</span>
|
|
453
462
|
)}
|
|
454
463
|
</span>
|
|
455
464
|
</div>
|
|
@@ -1107,9 +1116,9 @@ export function PermissionsManager({
|
|
|
1107
1116
|
{!activeRole ? (
|
|
1108
1117
|
<EmptyHint text="Selecciona un rol para configurar sus permisos." />
|
|
1109
1118
|
) : loadingPerms ? (
|
|
1110
|
-
<div className="grid gap-2 sm:grid-cols-2
|
|
1119
|
+
<div className="grid gap-2 sm:grid-cols-2">
|
|
1111
1120
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
1112
|
-
<Skeleton key={i} className="h-
|
|
1121
|
+
<Skeleton key={i} className="h-14 w-full" />
|
|
1113
1122
|
))}
|
|
1114
1123
|
</div>
|
|
1115
1124
|
) : !activeModule ? (
|
|
@@ -1265,7 +1274,7 @@ function ActionCheckGrid({
|
|
|
1265
1274
|
onToggle: (cap: string) => void
|
|
1266
1275
|
}) {
|
|
1267
1276
|
return (
|
|
1268
|
-
<div className="grid gap-2 sm:grid-cols-2
|
|
1277
|
+
<div className="grid gap-2 sm:grid-cols-2">
|
|
1269
1278
|
{actions.map((action) => {
|
|
1270
1279
|
const cap = moduleActionCapability(moduleKey, action.key, action.capability)
|
|
1271
1280
|
return (
|
|
@@ -1276,6 +1285,7 @@ function ActionCheckGrid({
|
|
|
1276
1285
|
onToggle={() => onToggle(cap)}
|
|
1277
1286
|
icon={action.icon || defaultActionIcon(action.key, action.kind)}
|
|
1278
1287
|
label={action.label}
|
|
1288
|
+
description={action.description}
|
|
1279
1289
|
/>
|
|
1280
1290
|
)
|
|
1281
1291
|
})}
|
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
|
/**
|