MCPcopy
hub / github.com/directus/directus / createLayoutWrapper

Function createLayoutWrapper

packages/composables/src/use-layout.ts:66–150  ·  view source on GitHub ↗
(layout: LayoutConfig)

Source from the content-addressed store, hash-verified

64 * ```
65 */
66export function createLayoutWrapper<Options, Query>(layout: LayoutConfig): Component {
67 return defineComponent({
68 name: `${layout.id}-${NAME_SUFFIX}`,
69 props: {
70 collection: {
71 type: String,
72 required: true,
73 },
74 selection: {
75 type: Array as PropType<(number | string)[]>,
76 default: () => [],
77 },
78 layoutOptions: {
79 type: Object as PropType<Options>,
80 default: () => ({}),
81 },
82 layoutQuery: {
83 type: Object as PropType<Query>,
84 default: () => ({}),
85 },
86 layoutProps: {
87 type: Object as PropType<any>,
88 default: () => ({}),
89 },
90 filter: {
91 type: Object as PropType<Filter>,
92 default: null,
93 },
94 filterUser: {
95 type: Object as PropType<Filter>,
96 default: null,
97 },
98 filterSystem: {
99 type: Object as PropType<Filter>,
100 default: null,
101 },
102 search: {
103 type: String as PropType<string | null>,
104 default: null,
105 },
106 showSelect: {
107 type: String as PropType<ShowSelect>,
108 default: 'multiple',
109 },
110 selectMode: {
111 type: Boolean,
112 default: false,
113 },
114 readonly: {
115 type: Boolean,
116 default: false,
117 },
118 resetPreset: {
119 type: Function as PropType<() => Promise<void>>,
120 default: null,
121 },
122 clearFilters: {
123 type: Function as PropType<() => void>,

Callers 2

use-layout.test.tsFile · 0.90
useLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected