diff --git a/packages/client/src/components/admin-layout/Permissions/index.tsx b/packages/client/src/components/admin-layout/Permissions/index.tsx index 8c9c2ea8b..2b3740ea0 100644 --- a/packages/client/src/components/admin-layout/Permissions/index.tsx +++ b/packages/client/src/components/admin-layout/Permissions/index.tsx @@ -92,14 +92,13 @@ const useActionPermissionResource = ({ onSuccess }) => { console.log('actionPermissions', data); onSuccess({ actionPermissions: data.map((permission) => { - const item: any = {} - Object.keys(permission).forEach(key => { + const item: any = {}; + Object.keys(permission).forEach((key) => { if (isValid(permission[key])) { item[key] = permission[key]; } }); - item.fields = - permission?.fields.map((field) => field.key) || []; + item.fields = permission?.fields.map((field) => field.key) || []; return item; }), }); @@ -162,63 +161,6 @@ const collectionSchema: ISchema = { collectionName: 'collections', }, properties: { - [uid()]: { - type: 'void', - title: '操作', - 'x-component': 'Table.Operation', - 'x-component-props': { - className: 'nb-table-operation', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action', - 'x-component-props': { - icon: 'EllipsisOutlined', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action.Dropdown', - 'x-component-props': {}, - properties: { - [uid()]: { - type: 'void', - title: '配置', - 'x-component': 'Menu.Action', - 'x-component-props': { - style: { - minWidth: 150, - }, - }, - 'x-action-type': 'view', - properties: { - [uid()]: { - type: 'void', - title: '数据表操作权限', - 'x-component': 'Action.Drawer', - 'x-decorator': 'Form', - 'x-decorator-props': { - useResource: useActionPermissionResource, - }, - 'x-component-props': { - useOkAction: useActionPermissionSubmit, - }, - properties: { - actionPermissions: { - type: 'array', - 'x-component': 'ActionPermissionField', - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, column1: { type: 'void', title: '数据表名称', @@ -243,6 +185,54 @@ const collectionSchema: ISchema = { }, }, }, + column3: { + type: 'void', + title: '操作', + 'x-component': 'Table.Column', + 'x-component-props': { + width: 60, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action.Group', + 'x-component-props': { + type: 'link', + }, + properties: { + [uid()]: { + type: 'void', + title: '配置', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-action-type': 'view', + properties: { + [uid()]: { + type: 'void', + title: '数据表操作权限', + 'x-component': 'Action.Drawer', + 'x-decorator': 'Form', + 'x-decorator-props': { + useResource: useActionPermissionResource, + }, + 'x-component-props': { + useOkAction: useActionPermissionSubmit, + }, + properties: { + actionPermissions: { + type: 'array', + 'x-component': 'ActionPermissionField', + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }; @@ -342,121 +332,6 @@ const schema: ISchema = { }, }, }, - [uid()]: { - type: 'void', - title: '操作', - 'x-component': 'Table.Operation', - 'x-component-props': { - className: 'nb-table-operation', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action', - 'x-component-props': { - icon: 'EllipsisOutlined', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action.Dropdown', - 'x-component-props': {}, - properties: { - [uid()]: { - type: 'void', - title: '配置', - 'x-component': 'Menu.Action', - 'x-component-props': { - style: { - minWidth: 150, - }, - }, - 'x-action-type': 'view', - properties: { - [uid()]: { - type: 'void', - title: '权限配置', - 'x-decorator': 'RoleProvider', - 'x-component': 'Action.Drawer', - 'x-component-props': { - bodyStyle: { - background: '#f0f2f5', - paddingTop: 0, - }, - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Tabs', - properties: { - [uid()]: { - type: 'void', - title: '数据表操作权限', - 'x-component': 'Tabs.TabPane', - 'x-component-props': {}, - properties: { - collectionSchema, - }, - }, - [uid()]: { - type: 'void', - title: '菜单访问权限', - 'x-component': 'Tabs.TabPane', - 'x-component-props': {}, - properties: { - menuSchema, - }, - }, - }, - }, - }, - }, - }, - }, - [uid()]: { - type: 'void', - title: '编辑', - 'x-component': 'Menu.Action', - 'x-action-type': 'update', - properties: { - [uid()]: { - type: 'void', - title: '编辑数据', - 'x-decorator': 'Form', - 'x-decorator-props': { - useResource: useDetailsResource, - }, - 'x-component': 'Action.Drawer', - 'x-component-props': { - useOkAction: '{{ Table.useTableUpdateAction }}', - }, - properties: { - title: { - type: 'string', - title: '权限名称', - 'x-component': 'Input', - 'x-decorator': 'FormilyFormItem', - }, - }, - }, - }, - }, - [uid()]: { - type: 'void', - title: '删除', - 'x-component': 'Menu.Action', - 'x-designable-bar': 'Table.Action.DesignableBar', - 'x-action-type': 'destroy', - 'x-component-props': { - useAction: '{{ Table.useTableDestroyAction }}', - }, - }, - }, - }, - }, - }, - }, - }, column1: { type: 'void', title: '权限名称', @@ -481,6 +356,116 @@ const schema: ISchema = { }, }, }, + [uid()]: { + type: 'void', + title: '操作', + 'x-component': 'Table.Column', + 'x-component-props': { + width: 160, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action.Group', + 'x-component-props': { + type: 'link', + }, + properties: { + [uid()]: { + type: 'void', + title: '配置', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-action-type': 'view', + properties: { + [uid()]: { + type: 'void', + title: '权限配置', + 'x-decorator': 'RoleProvider', + 'x-component': 'Action.Drawer', + 'x-component-props': { + bodyStyle: { + background: '#f0f2f5', + paddingTop: 0, + }, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Tabs', + properties: { + [uid()]: { + type: 'void', + title: '数据表操作权限', + 'x-component': 'Tabs.TabPane', + 'x-component-props': {}, + properties: { + collectionSchema, + }, + }, + [uid()]: { + type: 'void', + title: '菜单访问权限', + 'x-component': 'Tabs.TabPane', + 'x-component-props': {}, + properties: { + menuSchema, + }, + }, + }, + }, + }, + }, + }, + }, + [uid()]: { + type: 'void', + title: '编辑', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-action-type': 'update', + properties: { + [uid()]: { + type: 'void', + title: '编辑数据', + 'x-decorator': 'Form', + 'x-decorator-props': { + useResource: useDetailsResource, + }, + 'x-component': 'Action.Drawer', + 'x-component-props': { + useOkAction: '{{ Table.useTableUpdateAction }}', + }, + properties: { + title: { + type: 'string', + title: '权限名称', + 'x-component': 'Input', + 'x-decorator': 'FormilyFormItem', + }, + }, + }, + }, + }, + [uid()]: { + type: 'void', + title: '删除', + 'x-component': 'Action', + 'x-designable-bar': 'Table.Action.DesignableBar', + 'x-action-type': 'destroy', + 'x-component-props': { + type: 'link', + useAction: '{{ Table.useTableDestroyAction }}', + }, + }, + }, + }, + }, + }, }, }, }, diff --git a/packages/client/src/schemas/add-new/index.tsx b/packages/client/src/schemas/add-new/index.tsx index e6f7b85bd..dad87cac8 100644 --- a/packages/client/src/schemas/add-new/index.tsx +++ b/packages/client/src/schemas/add-new/index.tsx @@ -196,7 +196,7 @@ function generateCardItemSchema(component) { type: 'void', title: '新增数据', 'x-decorator': 'Form', - 'x-component': 'Action.Modal', + 'x-component': 'Action.Drawer', 'x-component-props': { useOkAction: '{{ Table.useTableCreateAction }}', }, @@ -217,79 +217,56 @@ function generateCardItemSchema(component) { [uid()]: { type: 'void', title: '操作', - 'x-component': 'Table.Operation', - 'x-component-props': { - className: 'nb-table-operation', - }, + 'x-component': 'Table.Column', + 'x-component-props': {}, 'x-designable-bar': 'Table.Operation.DesignableBar', properties: { [uid()]: { type: 'void', - 'x-component': 'Action', + 'x-component': 'Action.Group', 'x-component-props': { - icon: 'EllipsisOutlined', + type: 'link', }, properties: { [uid()]: { type: 'void', - 'x-component': 'Action.Dropdown', - 'x-component-props': {}, + name: 'action1', + title: '查看', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-designable-bar': 'Table.Action.DesignableBar', + 'x-action-type': 'view', properties: { - // [uid()]: { - // type: 'void', - // title: '操作 1', - // 'x-component': 'Menu.Action', - // 'x-component-props': { - // style: { - // minWidth: 150, - // }, - // disabled: true, - // }, - // }, [uid()]: { type: 'void', - name: 'action1', - title: '查看', - 'x-component': 'Menu.Action', + title: '查看数据', + 'x-component': 'Action.Drawer', 'x-component-props': { - style: { - minWidth: 150, + bodyStyle: { + background: '#f0f2f5', + // paddingTop: 0, }, }, - 'x-designable-bar': 'Table.Action.DesignableBar', - 'x-action-type': 'view', properties: { [uid()]: { type: 'void', - title: '查看', - 'x-component': 'Action.Modal', - 'x-component-props': { - bodyStyle: { - background: '#f0f2f5', - // paddingTop: 0, - }, - }, + 'x-component': 'Tabs', + 'x-designable-bar': 'Tabs.DesignableBar', properties: { [uid()]: { type: 'void', - 'x-component': 'Tabs', - 'x-designable-bar': 'Tabs.DesignableBar', + title: '详情', + 'x-designable-bar': 'Tabs.TabPane.DesignableBar', + 'x-component': 'Tabs.TabPane', + 'x-component-props': {}, properties: { [uid()]: { type: 'void', - title: '详情', - 'x-designable-bar': - 'Tabs.TabPane.DesignableBar', - 'x-component': 'Tabs.TabPane', - 'x-component-props': {}, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Grid', - 'x-component-props': { - addNewComponent: 'AddNew.PaneItem', - }, - }, + 'x-component': 'Grid', + 'x-component-props': { + addNewComponent: 'AddNew.PaneItem', }, }, }, @@ -298,47 +275,51 @@ function generateCardItemSchema(component) { }, }, }, + }, + }, + [uid()]: { + type: 'void', + title: '编辑', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, + 'x-designable-bar': 'Table.Action.DesignableBar', + 'x-action-type': 'update', + properties: { [uid()]: { type: 'void', - title: '编辑', - 'x-component': 'Menu.Action', - 'x-designable-bar': 'Table.Action.DesignableBar', - 'x-action-type': 'update', + title: '编辑数据', + 'x-decorator': 'Form', + 'x-decorator-props': { + useResource: '{{ Table.useResource }}', + useValues: '{{ Table.useTableRowRecord }}', + }, + 'x-component': 'Action.Drawer', + 'x-component-props': { + useOkAction: '{{ Table.useTableUpdateAction }}', + }, properties: { [uid()]: { type: 'void', - title: '编辑数据', - 'x-decorator': 'Form', - 'x-decorator-props': { - useResource: '{{ Table.useResource }}', - useValues: '{{ Table.useTableRowRecord }}', - }, - 'x-component': 'Action.Modal', + 'x-component': 'Grid', 'x-component-props': { - useOkAction: '{{ Table.useTableUpdateAction }}', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Grid', - 'x-component-props': { - addNewComponent: 'AddNew.FormItem', - }, - }, + addNewComponent: 'AddNew.FormItem', }, }, }, }, - [uid()]: { - type: 'void', - title: '删除', - 'x-component': 'Menu.Action', - 'x-designable-bar': 'Table.Action.DesignableBar', - 'x-action-type': 'destroy', - 'x-component-props': { - useAction: '{{ Table.useTableDestroyAction }}', - }, - }, + }, + }, + [uid()]: { + type: 'void', + title: '删除', + 'x-component': 'Action', + 'x-designable-bar': 'Table.Action.DesignableBar', + 'x-action-type': 'destroy', + 'x-component-props': { + type: 'link', + useAction: '{{ Table.useTableDestroyAction }}', }, }, }, @@ -471,179 +452,6 @@ function generateCardItemSchema(component) { }, }, }, - [uid()]: { - type: 'void', - title: '操作', - 'x-component': 'Table.Operation', - 'x-component-props': { - className: 'nb-table-operation', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action', - 'x-component-props': { - icon: 'EllipsisOutlined', - }, - properties: { - [uid()]: { - type: 'void', - 'x-component': 'Action.Dropdown', - 'x-component-props': {}, - properties: { - [uid()]: { - type: 'void', - name: 'action1', - title: '查看', - 'x-component': 'Menu.Action', - 'x-component-props': { - style: { - minWidth: 150, - }, - }, - 'x-action-type': 'view', - properties: { - [uid()]: { - type: 'void', - title: '查看数据', - 'x-read-pretty': true, - 'x-decorator': 'Form', - 'x-decorator-props': { - useResource: - '{{ Table.useActionLogDetailsResource }}', - }, - 'x-component': 'Action.Drawer', - 'x-component-props': { - // bodyStyle: { - // background: '#f0f2f5', - // // paddingTop: 0, - // }, - }, - properties: { - created_at: { - type: 'string', - title: '操作时间', - 'x-decorator': 'FormItem', - 'x-component': 'DatePicker', - 'x-read-pretty': true, - 'x-component-props': { - format: 'YYYY-MM-DD HH:mm:ss', - }, - }, - 'user.nickname': { - type: 'string', - title: '操作用户', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-read-pretty': true, - }, - 'collection.title': { - type: 'string', - title: '所属数据表', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-read-pretty': true, - }, - type: { - type: 'string', - title: '操作类型', - 'x-decorator': 'FormItem', - 'x-component': 'Select', - 'x-read-pretty': true, - enum: [ - { - label: '新增', - value: 'create', - color: 'green', - }, - { - label: '更新', - value: 'update', - color: 'blue', - }, - { - label: '删除', - value: 'destroy', - color: 'red', - }, - ], - }, - changes: { - type: 'array', - title: '数据变动', - 'x-decorator': 'FormItem', - 'x-component': 'ArrayTable', - 'x-component-props': { - pagination: false, - // scroll: { x: '100%' }, - }, - // 'x-reactions': ['{{ filterActionLogs }}'], - items: { - type: 'object', - properties: { - column0: { - type: 'void', - 'x-component': 'ArrayTable.Column', - 'x-component-props': { - width: 80, - align: 'center', - }, - properties: { - index: { - type: 'void', - 'x-component': 'ArrayTable.Index', - }, - }, - }, - column1: { - type: 'void', - 'x-component': 'ArrayTable.Column', - 'x-component-props': { title: '字段名称' }, - properties: { - field: { - type: 'string', - 'x-decorator': 'FormilyFormItem', - 'x-component': 'ActionLogs.Field', - }, - }, - }, - column3: { - type: 'void', - 'x-component': 'ArrayTable.Column', - 'x-component-props': { title: '操作前' }, - properties: { - before: { - type: 'string', - 'x-decorator': 'FormilyFormItem', - 'x-component': 'ActionLogs.FieldValue', - }, - }, - }, - column4: { - type: 'void', - 'x-component': 'ArrayTable.Column', - 'x-component-props': { title: '操作后' }, - properties: { - after: { - type: 'string', - 'x-decorator': 'FormilyFormItem', - 'x-component': 'ActionLogs.FieldValue', - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, column1: { type: 'void', title: '操作时间', @@ -700,6 +508,165 @@ function generateCardItemSchema(component) { }, }, }, + [uid()]: { + type: 'void', + title: '操作', + 'x-component': 'Table.Column', + 'x-component-props': { + width: 60, + align: 'center', + }, + properties: { + [uid()]: { + type: 'void', + name: 'action1', + title: '查看', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + style: { + padding: '0', + height: 'auto', + }, + }, + 'x-action-type': 'view', + properties: { + [uid()]: { + type: 'void', + title: '查看数据', + 'x-read-pretty': true, + 'x-decorator': 'Form', + 'x-decorator-props': { + useResource: '{{ Table.useActionLogDetailsResource }}', + }, + 'x-component': 'Action.Drawer', + 'x-component-props': { + // bodyStyle: { + // background: '#f0f2f5', + // // paddingTop: 0, + // }, + }, + properties: { + created_at: { + type: 'string', + title: '操作时间', + 'x-decorator': 'FormItem', + 'x-component': 'DatePicker', + 'x-read-pretty': true, + 'x-component-props': { + format: 'YYYY-MM-DD HH:mm:ss', + }, + }, + 'user.nickname': { + type: 'string', + title: '操作用户', + 'x-decorator': 'FormItem', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + 'collection.title': { + type: 'string', + title: '所属数据表', + 'x-decorator': 'FormItem', + 'x-component': 'Input', + 'x-read-pretty': true, + }, + type: { + type: 'string', + title: '操作类型', + 'x-decorator': 'FormItem', + 'x-component': 'Select', + 'x-read-pretty': true, + enum: [ + { + label: '新增', + value: 'create', + color: 'green', + }, + { + label: '更新', + value: 'update', + color: 'blue', + }, + { + label: '删除', + value: 'destroy', + color: 'red', + }, + ], + }, + changes: { + type: 'array', + title: '数据变动', + 'x-decorator': 'FormItem', + 'x-component': 'ArrayTable', + 'x-component-props': { + pagination: false, + // scroll: { x: '100%' }, + }, + // 'x-reactions': ['{{ filterActionLogs }}'], + items: { + type: 'object', + properties: { + column0: { + type: 'void', + 'x-component': 'ArrayTable.Column', + 'x-component-props': { + width: 80, + align: 'center', + }, + properties: { + index: { + type: 'void', + 'x-component': 'ArrayTable.Index', + }, + }, + }, + column1: { + type: 'void', + 'x-component': 'ArrayTable.Column', + 'x-component-props': { title: '字段名称' }, + properties: { + field: { + type: 'string', + 'x-decorator': 'FormilyFormItem', + 'x-component': 'ActionLogs.Field', + }, + }, + }, + column3: { + type: 'void', + 'x-component': 'ArrayTable.Column', + 'x-component-props': { title: '操作前' }, + properties: { + before: { + type: 'string', + 'x-decorator': 'FormilyFormItem', + 'x-component': 'ActionLogs.FieldValue', + }, + }, + }, + column4: { + type: 'void', + 'x-component': 'ArrayTable.Column', + 'x-component-props': { title: '操作后' }, + properties: { + after: { + type: 'string', + 'x-decorator': 'FormilyFormItem', + 'x-component': 'ActionLogs.FieldValue', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }; @@ -935,7 +902,11 @@ AddNew.CardItem = observer((props: any) => { {ghost ? ( ) : ( - )} @@ -1122,7 +1093,11 @@ AddNew.FormItem = observer((props: any) => { {ghost ? ( ) : ( - )} @@ -1326,7 +1301,12 @@ AddNew.PaneItem = observer((props: any) => { {ghost ? ( ) : ( - )} diff --git a/packages/client/src/schemas/table/index.tsx b/packages/client/src/schemas/table/index.tsx index 9bbbd77d1..223ed7859 100644 --- a/packages/client/src/schemas/table/index.tsx +++ b/packages/client/src/schemas/table/index.tsx @@ -370,7 +370,7 @@ const useTableColumns = () => { const { getField } = useCollectionContext(); - const operation = useTableOperation(); + // const operation = useTableOperation(); const columnSchemas = schema.reduceProperties((columns, current) => { if (isColumn(current)) { @@ -379,7 +379,7 @@ const useTableColumns = () => { return [...columns]; }, []); - const columns: any[] = [operation].concat( + const columns: any[] = [].concat( columnSchemas.map((column: Schema) => { const columnProps = column['x-component-props'] || {}; const collectionField = getField(columnProps.fieldName); @@ -905,7 +905,7 @@ function generateActionSchema(type) { type: 'void', title: '新增数据', 'x-decorator': 'Form', - 'x-component': 'Action.Modal', + 'x-component': 'Action.Drawer', 'x-component-props': { useOkAction: '{{ Table.useTableCreateAction }}', }, @@ -951,14 +951,17 @@ function generateMenuActionSchema(type) { name: uid(), type: 'void', title: '查看', - 'x-component': 'Menu.Action', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, 'x-designable-bar': 'Table.Action.DesignableBar', 'x-action-type': 'view', properties: { [uid()]: { type: 'void', title: '查看数据', - 'x-component': 'Action.Modal', + 'x-component': 'Action.Drawer', 'x-component-props': { bodyStyle: { background: '#f0f2f5', @@ -998,7 +1001,10 @@ function generateMenuActionSchema(type) { name: uid(), type: 'void', title: '编辑', - 'x-component': 'Menu.Action', + 'x-component': 'Action', + 'x-component-props': { + type: 'link', + }, 'x-designable-bar': 'Table.Action.DesignableBar', 'x-action-type': 'update', properties: { @@ -1010,7 +1016,7 @@ function generateMenuActionSchema(type) { useResource: '{{ Table.useResource }}', useValues: '{{ Table.useTableRowRecord }}', }, - 'x-component': 'Action.Modal', + 'x-component': 'Action.Drawer', 'x-component-props': { useOkAction: '{{ Table.useTableUpdateAction }}', }, @@ -1031,11 +1037,12 @@ function generateMenuActionSchema(type) { name: uid(), type: 'void', title: '删除', - 'x-component': 'Menu.Action', + 'x-component': 'Action', 'x-designable-bar': 'Table.Action.DesignableBar', 'x-action-type': 'destroy', 'x-component-props': { useAction: '{{ Table.useTableDestroyAction }}', + type: 'link', }, }, }; @@ -1611,15 +1618,12 @@ Table.Operation.Cell = observer((props: any) => { ); }); -Table.Operation.DesignableBar = (props) => { - const { designable, schema, remove, refresh, appendChild } = useDesignable( - props.path, - ); +Table.Operation.DesignableBar = () => { + const { schema: columnSchema } = useDesignable(); + const groupSchema = Object.values(columnSchema.properties || {}).shift(); + const groupPath = getSchemaPath(groupSchema); + const { schema, remove, refresh, appendChild } = useDesignable(groupPath); const [visible, setVisible] = useState(false); - if (!designable || !schema?.parent?.parent['x-designable-bar']) { - return null; - } - console.log('Table.Operation.DesignableBar', schema?.parent?.parent); const map = new Map(); schema.mapProperties((s) => { if (!s['x-action-type']) { @@ -1627,6 +1631,7 @@ Table.Operation.DesignableBar = (props) => { } map.set(s['x-action-type'], s.name); }); + const path = getSchemaPath(schema); return (
{ const data = appendChild(s); await createSchema(data); } else if (map.get(item.name)) { - const removed = remove([ - ...props.path, - map.get(item.name), - ]); + const removed = remove([...path, map.get(item.name)]); await removeSchema(removed); } }} @@ -1672,7 +1674,7 @@ Table.Operation.DesignableBar = (props) => { ))} - + 函数操作 弹窗表单 复杂弹窗 @@ -1694,9 +1696,11 @@ Table.Action.DesignableBar = () => { const { schema, remove, refresh, insertAfter } = useDesignable(); const [visible, setVisible] = useState(false); const isPopup = Object.keys(schema.properties || {}).length > 0; + const popupSchema = Object.values(schema.properties || {}).shift(); const inActionBar = schema.parent['x-component'] === 'Table.ActionBar'; const displayed = useDisplayedMapContext(); const field = useField(); + const popupComponent = popupSchema?.['x-component'] || 'Action.Drawer'; return (
{