Skip to content

Commit

Permalink
style and class
Browse files Browse the repository at this point in the history
  • Loading branch information
engalar committed Jul 25, 2022
1 parent 4168e51 commit 5ccee86
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "graph",
"widgetName": "Graph",
"version": "1.1.6",
"version": "1.1.7",
"description": "My widget description",
"packagePath": "mendixcn",
"author": "wengao.liu@siemens.com",
Expand Down
21 changes: 12 additions & 9 deletions src/Graph.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { useMemo } from "react";
// import { useMemo } from "react";
import { GraphContainerProps } from "../typings/GraphProps";
import { ValueStatus } from "mendix";
// import { ValueStatus } from "mendix";
import classNames from "classnames";

import "./ui/index.scss";

export default function (props: GraphContainerProps) {
console.log(props);
const value = useMemo(() => {
if (props.attribute && props.attribute.status === ValueStatus.Available) {
return props.attribute.value;
}
}, [props.attribute]);
// const value = useMemo(() => {
// if (props.attribute && props.attribute.status === ValueStatus.Available) {
// return props.attribute.value;
// }
// }, [props.attribute]);

return (
<div>
hello {props.sampleText} and your value is {value}
<div style={props.style} className={classNames("mendixcn-graph", props.class)}>
hello {props.sampleText} and your value is
</div>
);
}
4 changes: 2 additions & 2 deletions src/Graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<caption>Default value</caption>
<description>Sample text input</description>
</property>
<property key="attribute" type="attribute" required="false">
<!-- <property key="attribute" type="attribute" required="false">
<caption>Attribute</caption>
<description></description>
<attributeTypes>
Expand All @@ -28,7 +28,7 @@
<attributeTypes>
<attributeType name="String" />
</attributeTypes>
</property>
</property> -->
</propertyGroup>
</properties>
</widget>
7 changes: 0 additions & 7 deletions typings/GraphProps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
* @author Mendix UI Content Team
*/
import { CSSProperties } from "react";
import { EditableValue, ListValue, ListAttributeValue } from "mendix";

export interface GraphContainerProps {
name: string;
class: string;
style?: CSSProperties;
tabIndex?: number;
sampleText: string;
attribute?: EditableValue<string>;
datasource: ListValue;
att2?: ListAttributeValue<string>;
}

export interface GraphPreviewProps {
Expand All @@ -23,7 +19,4 @@ export interface GraphPreviewProps {
styleObject?: CSSProperties;
readOnly: boolean;
sampleText: string;
attribute: string;
datasource: {} | { type: string } | null;
att2: string;
}

0 comments on commit 5ccee86

Please sign in to comment.