Skip to content

Commit 9e9524a

Browse files
committed
fix(selection-helper-web): fix missing class and style props
1 parent 3451aca commit 9e9524a

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

packages/pluggableWidgets/selection-helper-web/src/SelectionHelper.editorPreview.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import { SelectionHelperComponent } from "./components/SelectionHelperComponent"
44

55
export function preview(props: SelectionHelperPreviewProps): ReactElement {
66
return (
7-
<SelectionHelperComponent type={props.renderStyle} status="some">
7+
<SelectionHelperComponent
8+
type={props.renderStyle}
9+
status="some"
10+
className={props.class}
11+
cssStyles={props.styleObject}
12+
>
813
{props.renderStyle === "custom"
914
? [
1015
<props.customNoneSelected.renderer key={"none"} caption={"No items selected: Place widgets here"}>

packages/pluggableWidgets/selection-helper-web/src/SelectionHelper.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ export function SelectionHelper(props: SelectionHelperContainerProps): ReactElem
1818
const selection = contextValue.value;
1919

2020
return (
21-
<SelectionHelperComponent type={props.renderStyle} status={selection.status} onClick={selection.toggle}>
21+
<SelectionHelperComponent
22+
type={props.renderStyle}
23+
status={selection.status}
24+
onClick={selection.toggle}
25+
className={props.class}
26+
cssStyles={props.style}
27+
>
2228
{selection.status === "all" && props.customAllSelected}
2329
{selection.status === "some" && props.customSomeSelected}
2430
{selection.status === "none" && props.customNoneSelected}

packages/pluggableWidgets/selection-helper-web/src/components/SelectionHelperComponent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { createElement, ReactElement, ReactNode, useMemo } from "react";
1+
import { createElement, CSSProperties, ReactElement, ReactNode, useMemo } from "react";
22
import { ThreeStateCheckBox } from "@mendix/pluggable-widgets-commons/components/web";
33

44
interface Props {
55
type: "checkbox" | "custom";
66
status: "all" | "some" | "none";
77
onClick?: () => void;
88
children: ReactNode;
9+
className: string;
10+
cssStyles?: CSSProperties;
911
}
1012

1113
export function SelectionHelperComponent(props: Props): ReactElement {
@@ -14,7 +16,7 @@ export function SelectionHelperComponent(props: Props): ReactElement {
1416
}, []);
1517

1618
return (
17-
<div className="widget-selection-helper">
19+
<div className={`widget-selection-helper ${props.className}`} style={props.cssStyles}>
1820
{props.type === "custom" ? (
1921
<div
2022
className="selection-helper-custom"

0 commit comments

Comments
 (0)