mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-11 14:52:54 +01:00
feat(runtime): Add "data-testId" attribute to Columns node (#44)
This commit is contained in:
@@ -7,6 +7,8 @@ export interface ColumnsProps extends Noodl.ReactProps {
|
|||||||
marginX: string;
|
marginX: string;
|
||||||
marginY: string;
|
marginY: string;
|
||||||
|
|
||||||
|
attrs: React.Attributes;
|
||||||
|
|
||||||
justifyContent: 'flex-start' | 'flex-end' | 'center';
|
justifyContent: 'flex-start' | 'flex-end' | 'center';
|
||||||
direction: 'row' | 'column';
|
direction: 'row' | 'column';
|
||||||
minWidth: string;
|
minWidth: string;
|
||||||
@@ -123,6 +125,7 @@ export function Columns(props: ColumnsProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
{...props.attrs}
|
||||||
className={['columns-container', props.className].join(' ')}
|
className={['columns-container', props.className].join(' ')}
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const ColumnsNode = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize() {
|
initialize() { this.props.attrs = {};
|
||||||
this.props.layoutString = '1 2 1';
|
this.props.layoutString = '1 2 1';
|
||||||
this.props.minWidth = 0;
|
this.props.minWidth = 0;
|
||||||
this.props.marginX = 16;
|
this.props.marginX = 16;
|
||||||
@@ -62,6 +62,16 @@ const ColumnsNode = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.forceUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
testId: {
|
||||||
|
index: 100009,
|
||||||
|
displayName: 'Test ID Attribute',
|
||||||
|
group: 'Advanced HTML',
|
||||||
|
type: 'string',
|
||||||
|
set(value) {
|
||||||
|
this.props.attrs["data-testid"] = value;
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user