@@ -9,12 +9,12 @@ import {
99 text ,
1010 svgImage
1111} from "@mendix/widget-plugin-platform/preview/structure-preview-api" ;
12- import { SelectionControlsPreviewProps } from "../typings/SelectionControlsProps " ;
12+ import { CheckboxRadioSelectionPreviewProps } from "../typings/CheckboxRadioSelectionProps " ;
1313import { getCustomCaption } from "./helpers/utils" ;
1414import IconRadioButtonSVG from "./assets/radiobutton.svg" ;
1515import IconCheckboxSVG from "./assets/checkbox.svg" ;
1616
17- const DATABASE_SOURCE_CONFIG : Array < keyof SelectionControlsPreviewProps > = [
17+ const DATABASE_SOURCE_CONFIG : Array < keyof CheckboxRadioSelectionPreviewProps > = [
1818 "optionsSourceDatabaseCaptionAttribute" ,
1919 "optionsSourceDatabaseCaptionExpression" ,
2020 "optionsSourceDatabaseCaptionType" ,
@@ -26,7 +26,7 @@ const DATABASE_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
2626 "onChangeDatabaseEvent"
2727] ;
2828
29- const ASSOCIATION_SOURCE_CONFIG : Array < keyof SelectionControlsPreviewProps > = [
29+ const ASSOCIATION_SOURCE_CONFIG : Array < keyof CheckboxRadioSelectionPreviewProps > = [
3030 "optionsSourceAssociationCaptionAttribute" ,
3131 "optionsSourceAssociationCaptionExpression" ,
3232 "optionsSourceAssociationCaptionType" ,
@@ -36,7 +36,7 @@ const ASSOCIATION_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
3636] ;
3737
3838export function getProperties (
39- values : SelectionControlsPreviewProps & { Editability ?: unknown } ,
39+ values : CheckboxRadioSelectionPreviewProps & { Editability ?: unknown } ,
4040 defaultProperties : Properties
4141) : Properties {
4242 // Basic property hiding logic - can be expanded later
@@ -144,24 +144,24 @@ function getIconPreview(isMultiSelect: boolean): ContainerProps {
144144 ) ;
145145}
146146
147- export function getPreview ( values : SelectionControlsPreviewProps , isDarkMode : boolean ) : StructurePreviewProps {
147+ export function getPreview ( values : CheckboxRadioSelectionPreviewProps , isDarkMode : boolean ) : StructurePreviewProps {
148148 const palette = structurePreviewPalette [ isDarkMode ? "dark" : "light" ] ;
149149 const structurePreviewChildren : StructurePreviewProps [ ] = [ ] ;
150- let readOnly = values . readOnly ;
150+ // let readOnly = values.readOnly;
151151
152152 // Handle custom content dropzones when enabled
153153 if ( values . optionsSourceCustomContentType !== "no" ) {
154154 if ( values . source === "context" && values . optionsSourceType === "association" ) {
155155 structurePreviewChildren . push (
156156 dropzone (
157- dropzone . placeholder ( "Configure the selection controls : Place widgets here" ) ,
157+ dropzone . placeholder ( "Configure the checkbox radio selection : Place widgets here" ) ,
158158 dropzone . hideDataSourceHeaderIf ( false )
159159 ) ( values . optionsSourceAssociationCustomContent )
160160 ) ;
161161 } else if ( values . source === "database" ) {
162162 structurePreviewChildren . push (
163163 dropzone (
164- dropzone . placeholder ( "Configure the selection controls : Place widgets here" ) ,
164+ dropzone . placeholder ( "Configure the checkbox radio selection : Place widgets here" ) ,
165165 dropzone . hideDataSourceHeaderIf ( false )
166166 ) ( values . optionsSourceDatabaseCustomContent )
167167 ) ;
@@ -175,7 +175,7 @@ export function getPreview(values: SelectionControlsPreviewProps, isDarkMode: bo
175175 } ) (
176176 dropzone (
177177 dropzone . placeholder (
178- `Configure the selection controls : Place widgets for option ${ value . staticDataSourceCaption } here`
178+ `Configure the checkbox radio selection : Place widgets for option ${ value . staticDataSourceCaption } here`
179179 ) ,
180180 dropzone . hideDataSourceHeaderIf ( false )
181181 ) ( value . staticDataSourceCustomContent )
@@ -186,9 +186,9 @@ export function getPreview(values: SelectionControlsPreviewProps, isDarkMode: bo
186186 }
187187
188188 // Handle database-specific read-only logic
189- if ( values . source === "database" && values . databaseAttributeString . length === 0 ) {
190- readOnly = values . customEditability === "never" ;
191- }
189+ // if (values.source === "database" && values.databaseAttributeString.length === 0) {
190+ // readOnly = values.customEditability === "never";
191+ // }
192192
193193 // If no custom content dropzones, show default preview
194194 if ( structurePreviewChildren . length === 0 ) {
0 commit comments