Initial commit
This commit is contained in:
30
src/MountEvent.tsx
Normal file
30
src/MountEvent.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Component, ReactNode, createElement } from "react";
|
||||
import { TextStyle, ViewStyle, View } from "react-native";
|
||||
|
||||
import { Style } from "@mendix/pluggable-widgets-tools";
|
||||
|
||||
import { MountEventProps } from "../typings/MountEventProps";
|
||||
|
||||
export interface CustomStyle extends Style {
|
||||
container: ViewStyle;
|
||||
label: TextStyle;
|
||||
}
|
||||
|
||||
export class MountEvent extends Component<MountEventProps<CustomStyle>> {
|
||||
constructor(props: MountEventProps<CustomStyle>){
|
||||
super(props)
|
||||
}
|
||||
|
||||
//We have to have a render block, or else Mendix Native will crash. Render block is expected.
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View></View>
|
||||
)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.onMount?.execute();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
17
src/MountEvent.xml
Normal file
17
src/MountEvent.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<widget id="incentro.mountevent.MountEvent" pluginWidget="true" needsEntityContext="true" offlineCapable="true"
|
||||
supportedPlatform="Native"
|
||||
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../node_modules/mendix/custom_widget.xsd">
|
||||
<name>Mount Event</name>
|
||||
<description>Perform an action on widget mount.</description>
|
||||
<icon/>
|
||||
<properties>
|
||||
<propertyGroup caption="Events">
|
||||
<property key="onMount" type="action" required="false">
|
||||
<caption>On mount</caption>
|
||||
<description>Action when widget mounts.</description>
|
||||
</property>
|
||||
</propertyGroup>
|
||||
</properties>
|
||||
</widget>
|
||||
11
src/package.xml
Normal file
11
src/package.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<package xmlns="http://www.mendix.com/package/1.0/">
|
||||
<clientModule name="MountEvent" version="1.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
|
||||
<widgetFiles>
|
||||
<widgetFile path="MountEvent.xml"/>
|
||||
</widgetFiles>
|
||||
<files>
|
||||
<file path="incentro/mountevent"/>
|
||||
</files>
|
||||
</clientModule>
|
||||
</package>
|
||||
Reference in New Issue
Block a user