@object-ui/app-shell 4.6.0 → 4.7.0

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,21 @@
1
1
  # @object-ui/app-shell — Changelog
2
2
 
3
+ ## 4.7.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@4.7.0
8
+ - @object-ui/core@4.7.0
9
+ - @object-ui/i18n@4.7.0
10
+ - @object-ui/react@4.7.0
11
+ - @object-ui/components@4.7.0
12
+ - @object-ui/fields@4.7.0
13
+ - @object-ui/layout@4.7.0
14
+ - @object-ui/data-objectstack@4.7.0
15
+ - @object-ui/auth@4.7.0
16
+ - @object-ui/permissions@4.7.0
17
+ - @object-ui/collaboration@4.7.0
18
+
3
19
  ## 4.6.0
4
20
 
5
21
  ### Patch Changes
@@ -54,6 +54,17 @@ interface RuntimeField {
54
54
  } | string>;
55
55
  multiple?: boolean;
56
56
  defaultValue?: unknown;
57
+ reference_to?: string;
58
+ reference?: string;
59
+ display_field?: string;
60
+ reference_field?: string;
61
+ id_field?: string;
62
+ description_field?: string;
63
+ title_format?: string;
64
+ lookup_columns?: unknown[];
65
+ lookup_filters?: unknown[];
66
+ lookup_page_size?: number;
67
+ depends_on?: unknown[];
57
68
  }
58
69
  interface RuntimeObject {
59
70
  name?: string;
@@ -58,6 +58,24 @@ export function resolveActionParam(param, ctx) {
58
58
  ?? normaliseOptions(field.options, ownerName, param.field, ctx.fieldOptionLabel);
59
59
  const resolvedLabel = param.label
60
60
  ?? ctx.fieldLabel(ownerName, param.field, field.label ?? param.field);
61
+ /** Lookup/reference params carry extra picker config that the dialog
62
+ * forwards to `<LookupField>`. Without these the picker would fall back
63
+ * to a plain text input. */
64
+ const isLookupResolvedType = resolvedType === 'lookup' || resolvedType === 'reference';
65
+ const lookupExtras = isLookupResolvedType
66
+ ? {
67
+ referenceTo: field.reference_to ?? field.reference,
68
+ displayField: field.display_field ?? field.reference_field,
69
+ idField: field.id_field,
70
+ descriptionField: field.description_field,
71
+ multiple: field.multiple,
72
+ titleFormat: field.title_format,
73
+ lookupColumns: field.lookup_columns,
74
+ lookupFilters: field.lookup_filters,
75
+ lookupPageSize: field.lookup_page_size,
76
+ dependsOn: field.depends_on,
77
+ }
78
+ : {};
61
79
  return {
62
80
  name: param.name ?? param.field,
63
81
  label: resolvedLabel,
@@ -67,6 +85,7 @@ export function resolveActionParam(param, ctx) {
67
85
  placeholder: param.placeholder ?? field.placeholder,
68
86
  helpText: param.helpText ?? field.help ?? field.description,
69
87
  defaultValue: rowDefault ?? param.defaultValue ?? field.defaultValue,
88
+ ...lookupExtras,
70
89
  };
71
90
  }
72
91
  /** Resolve an array of raw action params. */
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useState, useEffect } from 'react';
14
14
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Button, Input, Label, Textarea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Checkbox, } from '@object-ui/components';
15
15
  import { useObjectTranslation } from '@object-ui/i18n';
16
+ import { LookupField } from '@object-ui/fields';
16
17
  export function ActionParamDialog({ state, onOpenChange }) {
17
18
  const { t } = useObjectTranslation();
18
19
  const [values, setValues] = useState({});
@@ -77,7 +78,21 @@ export function ActionParamDialog({ state, onOpenChange }) {
77
78
  return (_jsxs("div", { className: "grid gap-1", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(Checkbox, { id: param.name, checked: checked, onCheckedChange: (c) => updateValue(param.name, c === true), className: "mt-0.5" }), _jsxs(Label, { htmlFor: param.name, className: "font-normal cursor-pointer", children: [param.label, param.required && _jsx("span", { className: "text-destructive ml-1", children: "*" })] })] }), errors[param.name] && (_jsx("p", { className: "text-xs text-destructive ml-6", children: t('actionDialog.requiredError', { label: param.label }) })), param.helpText && (_jsx("p", { className: "text-xs text-muted-foreground ml-6", children: param.helpText }))] }, param.name));
78
79
  }
79
80
  const isLookupParam = param.type === 'lookup' || param.type === 'reference';
80
- return (_jsxs("div", { className: "grid gap-2", children: [_jsxs(Label, { htmlFor: param.name, children: [param.label, param.required && _jsx("span", { className: "text-destructive ml-1", children: "*" })] }), param.type === 'select' && param.options ? (_jsxs(Select, { value: values[param.name] ?? '', onValueChange: (val) => updateValue(param.name, val), children: [_jsx(SelectTrigger, { id: param.name, className: errors[param.name] ? 'border-destructive' : '', children: _jsx(SelectValue, { placeholder: param.placeholder || t('actionDialog.selectPlaceholder', { label: param.label }) }) }), _jsx(SelectContent, { children: param.options.map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] })) : param.type === 'textarea' ? (_jsx(Textarea, { id: param.name, value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value), placeholder: param.placeholder, className: errors[param.name] ? 'border-destructive' : '' })) : param.type === 'number' ? (_jsx(Input, { id: param.name, type: "number", value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value === '' ? undefined : e.target.valueAsNumber), placeholder: param.placeholder, className: errors[param.name] ? 'border-destructive' : '' })) : (_jsx(Input, { id: param.name, type: ['email', 'url', 'date', 'datetime-local', 'time', 'password'].includes(param.type) ? param.type : 'text', value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value), placeholder: param.placeholder ||
81
+ return (_jsxs("div", { className: "grid gap-2", children: [_jsxs(Label, { htmlFor: param.name, children: [param.label, param.required && _jsx("span", { className: "text-destructive ml-1", children: "*" })] }), param.type === 'select' && param.options ? (_jsxs(Select, { value: values[param.name] ?? '', onValueChange: (val) => updateValue(param.name, val), children: [_jsx(SelectTrigger, { id: param.name, className: errors[param.name] ? 'border-destructive' : '', children: _jsx(SelectValue, { placeholder: param.placeholder || t('actionDialog.selectPlaceholder', { label: param.label }) }) }), _jsx(SelectContent, { children: param.options.map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] })) : isLookupParam && param.referenceTo ? (_jsx(LookupField, { value: values[param.name] ?? null, onChange: (v) => updateValue(param.name, v), field: {
82
+ name: param.name,
83
+ type: 'lookup',
84
+ reference_to: param.referenceTo,
85
+ display_field: param.displayField,
86
+ id_field: param.idField,
87
+ description_field: param.descriptionField,
88
+ multiple: param.multiple,
89
+ title_format: param.titleFormat,
90
+ lookup_columns: param.lookupColumns,
91
+ lookup_filters: param.lookupFilters,
92
+ lookup_page_size: param.lookupPageSize,
93
+ depends_on: param.dependsOn,
94
+ placeholder: param.placeholder,
95
+ } })) : param.type === 'textarea' ? (_jsx(Textarea, { id: param.name, value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value), placeholder: param.placeholder, className: errors[param.name] ? 'border-destructive' : '' })) : param.type === 'number' ? (_jsx(Input, { id: param.name, type: "number", value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value === '' ? undefined : e.target.valueAsNumber), placeholder: param.placeholder, className: errors[param.name] ? 'border-destructive' : '' })) : (_jsx(Input, { id: param.name, type: ['email', 'url', 'date', 'datetime-local', 'time', 'password'].includes(param.type) ? param.type : 'text', value: values[param.name] ?? '', onChange: (e) => updateValue(param.name, e.target.value), placeholder: param.placeholder ||
81
96
  (isLookupParam ? t('actionDialog.lookupPlaceholder', { label: param.label }) : undefined), className: errors[param.name] ? 'border-destructive' : '' })), errors[param.name] && (_jsx("p", { className: "text-xs text-destructive", children: t('actionDialog.requiredError', { label: param.label }) })), param.helpText && (_jsx("p", { className: "text-xs text-muted-foreground", children: param.helpText })), isLookupParam && !param.helpText && (_jsx("p", { className: "text-xs text-muted-foreground", children: t('actionDialog.lookupHelpText') }))] }, param.name));
82
97
  }) }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: handleCancel, children: t('actionDialog.cancel') }), _jsx(Button, { onClick: handleSubmit, children: t('actionDialog.confirm') })] })] }) }));
83
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/app-shell",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Minimal application shell for ObjectUI - framework-agnostic rendering engine",
@@ -27,34 +27,34 @@
27
27
  "dependencies": {
28
28
  "lucide-react": "^1.16.0",
29
29
  "sonner": "^2.0.7",
30
- "@object-ui/auth": "4.6.0",
31
- "@object-ui/collaboration": "4.6.0",
32
- "@object-ui/components": "4.6.0",
33
- "@object-ui/core": "4.6.0",
34
- "@object-ui/data-objectstack": "4.6.0",
35
- "@object-ui/fields": "4.6.0",
36
- "@object-ui/i18n": "4.6.0",
37
- "@object-ui/layout": "4.6.0",
38
- "@object-ui/permissions": "4.6.0",
39
- "@object-ui/react": "4.6.0",
40
- "@object-ui/types": "4.6.0"
30
+ "@object-ui/auth": "4.7.0",
31
+ "@object-ui/collaboration": "4.7.0",
32
+ "@object-ui/components": "4.7.0",
33
+ "@object-ui/core": "4.7.0",
34
+ "@object-ui/data-objectstack": "4.7.0",
35
+ "@object-ui/fields": "4.7.0",
36
+ "@object-ui/i18n": "4.7.0",
37
+ "@object-ui/layout": "4.7.0",
38
+ "@object-ui/permissions": "4.7.0",
39
+ "@object-ui/react": "4.7.0",
40
+ "@object-ui/types": "4.7.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": "^18.0.0 || ^19.0.0",
44
44
  "react-dom": "^18.0.0 || ^19.0.0",
45
45
  "react-router-dom": "^6.0.0 || ^7.0.0",
46
- "@object-ui/plugin-calendar": "^4.6.0",
47
- "@object-ui/plugin-charts": "^4.6.0",
48
- "@object-ui/plugin-chatbot": "^4.6.0",
49
- "@object-ui/plugin-dashboard": "^4.6.0",
50
- "@object-ui/plugin-designer": "^4.6.0",
51
- "@object-ui/plugin-detail": "^4.6.0",
52
- "@object-ui/plugin-form": "^4.6.0",
53
- "@object-ui/plugin-grid": "^4.6.0",
54
- "@object-ui/plugin-kanban": "^4.6.0",
55
- "@object-ui/plugin-list": "^4.6.0",
56
- "@object-ui/plugin-report": "^4.6.0",
57
- "@object-ui/plugin-view": "^4.6.0"
46
+ "@object-ui/plugin-calendar": "^4.7.0",
47
+ "@object-ui/plugin-charts": "^4.7.0",
48
+ "@object-ui/plugin-chatbot": "^4.7.0",
49
+ "@object-ui/plugin-dashboard": "^4.7.0",
50
+ "@object-ui/plugin-designer": "^4.7.0",
51
+ "@object-ui/plugin-detail": "^4.7.0",
52
+ "@object-ui/plugin-form": "^4.7.0",
53
+ "@object-ui/plugin-grid": "^4.7.0",
54
+ "@object-ui/plugin-kanban": "^4.7.0",
55
+ "@object-ui/plugin-list": "^4.7.0",
56
+ "@object-ui/plugin-report": "^4.7.0",
57
+ "@object-ui/plugin-view": "^4.7.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^25.9.0",