Skip to content

Commit 202d034

Browse files
committed
wip
1 parent 3020311 commit 202d034

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed
Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Div/index.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
import { parseFlexStyles, setStyle } from "../../utils";
1+
import { parseFlexStyles, setStyle, excludeKeys } from "../../utils";
2+
import SelectComponent from "../SelectComponent";
23

34
const Div = ({data}) => {
4-
const {HTML, CSS} = data.Properties;
5-
const style = {...setStyle(data.Properties), ...parseFlexStyles(CSS)};
6-
const fillBox = {width: '100%', height: '100%', position: 'absolute', top: 0, left: 0};
5+
const {HTML, CSS, Flex} = data.Properties;
6+
const style = {...setStyle(data.Properties, "absolute", Flex), ...parseFlexStyles(CSS)};
7+
8+
// If Flex is present, make both containers flex containers and don't use
9+
// any defaults - we expect the APL user to know what they're doing here.
10+
// CSS affects outer div, innerHtml is up to them and likewise with children
11+
const innerHtmlStyle = Flex ? {display: 'flex'} : {width: '100%', height: '100%', position: 'absolute', top: 0, left: 0};
12+
const childrenStyle = Flex ? {display: 'flex'} : {width: '100%', height: '100%', position: 'absolute', top: 0, left: 0};
13+
const updatedData = excludeKeys(data);
14+
715
return (
816
<div id={data.ID} style={style}>
9-
<div id={data.ID+'.$INNERHTML'} dangerouslySetInnerHTML={{__html: HTML}} style={fillBox}/>
10-
<div id={data.ID+'.$CHILDREN'} style={fillBox}>
11-
17+
<div id={data.ID+'.$INNERHTML'} dangerouslySetInnerHTML={{__html: HTML}} style={innerHtmlStyle}/>
18+
<div id={data.ID+'.$CHILDREN'} style={childrenStyle}>
19+
{Object.keys(updatedData).map((key) => (
20+
<SelectComponent key={key} data={updatedData[key]} />
21+
))}
1222
</div>
1323
</div>
1424
);

0 commit comments

Comments
 (0)