@@ -9,12 +9,12 @@ import {
9
9
text ,
10
10
svgImage
11
11
} from "@mendix/widget-plugin-platform/preview/structure-preview-api" ;
12
- import { SelectionControlsPreviewProps } from "../typings/SelectionControlsProps " ;
12
+ import { CheckboxRadioSelectionPreviewProps } from "../typings/CheckboxRadioSelectionProps " ;
13
13
import { getCustomCaption } from "./helpers/utils" ;
14
14
import IconRadioButtonSVG from "./assets/radiobutton.svg" ;
15
15
import IconCheckboxSVG from "./assets/checkbox.svg" ;
16
16
17
- const DATABASE_SOURCE_CONFIG : Array < keyof SelectionControlsPreviewProps > = [
17
+ const DATABASE_SOURCE_CONFIG : Array < keyof CheckboxRadioSelectionPreviewProps > = [
18
18
"optionsSourceDatabaseCaptionAttribute" ,
19
19
"optionsSourceDatabaseCaptionExpression" ,
20
20
"optionsSourceDatabaseCaptionType" ,
@@ -26,7 +26,7 @@ const DATABASE_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
26
26
"onChangeDatabaseEvent"
27
27
] ;
28
28
29
- const ASSOCIATION_SOURCE_CONFIG : Array < keyof SelectionControlsPreviewProps > = [
29
+ const ASSOCIATION_SOURCE_CONFIG : Array < keyof CheckboxRadioSelectionPreviewProps > = [
30
30
"optionsSourceAssociationCaptionAttribute" ,
31
31
"optionsSourceAssociationCaptionExpression" ,
32
32
"optionsSourceAssociationCaptionType" ,
@@ -36,7 +36,7 @@ const ASSOCIATION_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
36
36
] ;
37
37
38
38
export function getProperties (
39
- values : SelectionControlsPreviewProps & { Editability ?: unknown } ,
39
+ values : CheckboxRadioSelectionPreviewProps & { Editability ?: unknown } ,
40
40
defaultProperties : Properties
41
41
) : Properties {
42
42
// Basic property hiding logic - can be expanded later
@@ -144,24 +144,24 @@ function getIconPreview(isMultiSelect: boolean): ContainerProps {
144
144
) ;
145
145
}
146
146
147
- export function getPreview ( values : SelectionControlsPreviewProps , isDarkMode : boolean ) : StructurePreviewProps {
147
+ export function getPreview ( values : CheckboxRadioSelectionPreviewProps , isDarkMode : boolean ) : StructurePreviewProps {
148
148
const palette = structurePreviewPalette [ isDarkMode ? "dark" : "light" ] ;
149
149
const structurePreviewChildren : StructurePreviewProps [ ] = [ ] ;
150
- let readOnly = values . readOnly ;
150
+ // let readOnly = values.readOnly;
151
151
152
152
// Handle custom content dropzones when enabled
153
153
if ( values . optionsSourceCustomContentType !== "no" ) {
154
154
if ( values . source === "context" && values . optionsSourceType === "association" ) {
155
155
structurePreviewChildren . push (
156
156
dropzone (
157
- dropzone . placeholder ( "Configure the selection controls : Place widgets here" ) ,
157
+ dropzone . placeholder ( "Configure the checkbox radio selection : Place widgets here" ) ,
158
158
dropzone . hideDataSourceHeaderIf ( false )
159
159
) ( values . optionsSourceAssociationCustomContent )
160
160
) ;
161
161
} else if ( values . source === "database" ) {
162
162
structurePreviewChildren . push (
163
163
dropzone (
164
- dropzone . placeholder ( "Configure the selection controls : Place widgets here" ) ,
164
+ dropzone . placeholder ( "Configure the checkbox radio selection : Place widgets here" ) ,
165
165
dropzone . hideDataSourceHeaderIf ( false )
166
166
) ( values . optionsSourceDatabaseCustomContent )
167
167
) ;
@@ -175,7 +175,7 @@ export function getPreview(values: SelectionControlsPreviewProps, isDarkMode: bo
175
175
} ) (
176
176
dropzone (
177
177
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`
179
179
) ,
180
180
dropzone . hideDataSourceHeaderIf ( false )
181
181
) ( value . staticDataSourceCustomContent )
@@ -186,9 +186,9 @@ export function getPreview(values: SelectionControlsPreviewProps, isDarkMode: bo
186
186
}
187
187
188
188
// 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
+ // }
192
192
193
193
// If no custom content dropzones, show default preview
194
194
if ( structurePreviewChildren . length === 0 ) {
0 commit comments