MenuItem d.ts updates
parent
e0a415449c
commit
0bb0642be5
|
@ -28,7 +28,6 @@ export interface MenuItemCommandEvent {
|
|||
|
||||
/**
|
||||
* Defines model of MenuItem API.
|
||||
* @group Model
|
||||
*/
|
||||
export interface MenuItem {
|
||||
/**
|
||||
|
|
|
@ -58,6 +58,8 @@ export default {
|
|||
let events = this.findEvents(values);
|
||||
const interfaces = this.findOtherInterfaces(values, docName);
|
||||
|
||||
const options = this.findOptions(values, docName); // Only for MenuItem
|
||||
|
||||
if (props && props.props.length) {
|
||||
newDoc.children.push({
|
||||
id: `api.${moduleName}.props`,
|
||||
|
@ -109,7 +111,7 @@ export default {
|
|||
}
|
||||
|
||||
if (interfaces && interfaces.length > 0) {
|
||||
const isValidDirective = this.checkDirectiveInterfaces(interfaces, docName);
|
||||
const isValidDirective = this.checkDirectiveInterfaces(interfaces);
|
||||
|
||||
if (!isValidDirective) return;
|
||||
|
||||
|
@ -132,6 +134,15 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
if (options) {
|
||||
newDoc.children.push({
|
||||
id: `api.${moduleName}.options`,
|
||||
label: 'Options',
|
||||
component: DocApiTable,
|
||||
data: this.setPropsData(options[0].values.props)
|
||||
});
|
||||
}
|
||||
|
||||
newDocs.push(newDoc);
|
||||
}
|
||||
|
||||
|
@ -270,7 +281,20 @@ export default {
|
|||
|
||||
return interfaces;
|
||||
},
|
||||
checkDirectiveInterfaces(interfaces, docName) {
|
||||
findOptions(values, docName) {
|
||||
if (docName !== 'MenuItem') return;
|
||||
|
||||
const options = [];
|
||||
|
||||
for (const key of Object.keys(values)) {
|
||||
if (key === 'MenuItem') {
|
||||
options.push({ key, values: values[key] });
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
},
|
||||
checkDirectiveInterfaces(interfaces) {
|
||||
const findMainInterface = interfaces.find((interfaceData) => interfaceData.key.includes('DirectiveBinding'));
|
||||
|
||||
return !findMainInterface || findMainInterface.values.props.length > 0;
|
||||
|
|
Loading…
Reference in New Issue