@builder.io/mitosis 0.5.25 → 0.5.26
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.
|
@@ -890,9 +890,10 @@ const componentToAngular = (userOptions = {}) => ({ component: _component }) =>
|
|
|
890
890
|
${Array.from(props)
|
|
891
891
|
.filter((item) => !(0, slots_1.isSlotProperty)(item) && item !== 'children')
|
|
892
892
|
.map((item) => {
|
|
893
|
+
const hasDefaultProp = json.defaultProps && json.defaultProps.hasOwnProperty(item);
|
|
893
894
|
const propType = propsTypeRef ? `${propsTypeRef}["${item}"]` : 'any';
|
|
894
|
-
let propDeclaration = `@Input() ${item}${options.typescript ?
|
|
895
|
-
if (
|
|
895
|
+
let propDeclaration = `@Input() ${item}${options.typescript ? `${hasDefaultProp ? '' : '!'}: ${propType}` : ''}`;
|
|
896
|
+
if (hasDefaultProp) {
|
|
896
897
|
propDeclaration += ` = defaultProps["${item}"]`;
|
|
897
898
|
}
|
|
898
899
|
return propDeclaration;
|