Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-tooling-modules): webcomponents - support for getters and methods #1081

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/ui5-tooling-modules/lib/utils/WebComponentRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,10 @@ class RegistryEntry {
console.warn(`[unclear type 🤔] ${classDef.name} - property '${propDef.name}' has unclear type '${ui5TypeInfo.origType}' -> defaulting to 'any', multiple: ${ui5TypeInfo.multiple}`);
}

// TODO: What to do with "readonly" and/or interface and class types for fields?
// They seem to be calculated fields that don't map to a property/aggregation.
// We could make them into just a getter, which returns the queried attribute of the webc DOM (?)
if (propDef.readonly) {
// s.a.
console.log(`[readonly field] ${classDef.name} - property ${propDef.name}`);
// calculated readonly fields -> WebC base class will generate getters
// e.g. AvatarGroup#getColorScheme
ui5metadata.getters.push(propDef.name);
} else if (ui5TypeInfo.isInterfaceOrClassType) {
console.warn(`[interface or class type given for property] ${classDef.name} - property ${propDef.name}`);
} else if (ui5TypeInfo.isAssociation) {
Expand Down Expand Up @@ -262,7 +260,9 @@ class RegistryEntry {
};
}
} else if (propDef.kind === "method") {
// TODO: methods
// Methods are proxied through the core.WebComponent base class
// e.g. DatePicker#isValid or Toolbar#isOverflowOpen
ui5metadata.methods.push(propDef.name);
}
}

Expand Down
Loading