Skip to content

Commit 500749c

Browse files
yordan-stgjulivan
authored andcommitted
feat: enhance properties and add ariaLabel support
1 parent 197dc48 commit 500749c

File tree

7 files changed

+83
-53
lines changed

7 files changed

+83
-53
lines changed

packages/pluggableWidgets/checkbox-radio-selection-web/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Added
1010

1111
- We added a missing validation alert.
12+
- Added aria-label property
13+
14+
### Changed
15+
16+
- The Caption property now appears below Entity.
17+
- The Caption property is now only visible if Custom content is set to 'No'.
18+
- Moved the Group name attribute to the General tab in the General property group.
1219

1320
## [1.0.0] - 2025-08-25
1421

packages/pluggableWidgets/checkbox-radio-selection-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/checkbox-radio-selection-web",
33
"widgetName": "CheckboxRadioSelection",
4-
"version": "1.0.0",
4+
"version": "1.1.0",
55
"description": "Configurable radio buttons and check box widget",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/checkbox-radio-selection-web/src/CheckboxRadioSelection.editorConfig.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,22 @@ export function getProperties(
133133
});
134134
}
135135

136+
if (values.optionsSourceCustomContentType === "yes") {
137+
if (values.source === "context" && values.optionsSourceType === "association") {
138+
hidePropertiesIn(defaultProperties, values, [
139+
"optionsSourceAssociationCaptionType",
140+
"optionsSourceAssociationCaptionAttribute",
141+
"optionsSourceAssociationCaptionExpression"
142+
]);
143+
} else if (values.source === "database") {
144+
hidePropertiesIn(defaultProperties, values, [
145+
"optionsSourceDatabaseCaptionType",
146+
"optionsSourceDatabaseCaptionAttribute",
147+
"optionsSourceDatabaseCaptionExpression"
148+
]);
149+
}
150+
}
151+
136152
return defaultProperties;
137153
}
138154

packages/pluggableWidgets/checkbox-radio-selection-web/src/CheckboxRadioSelection.xml

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,44 @@
5959
</selectionTypes>
6060
</property>
6161
</propertyGroup>
62+
<propertyGroup caption="Store value">
63+
<property key="optionsSourceDatabaseValueAttribute" type="attribute" dataSource="optionsSourceDatabaseDataSource">
64+
<caption>Value</caption>
65+
<description />
66+
<attributeTypes>
67+
<attributeType name="String" />
68+
<attributeType name="Integer" />
69+
<attributeType name="Long" />
70+
<attributeType name="Enum" />
71+
</attributeTypes>
72+
</property>
73+
<property key="databaseAttributeString" type="attribute" setLabel="true" required="false">
74+
<caption>Target attribute</caption>
75+
<description />
76+
<attributeTypes>
77+
<attributeType name="String" />
78+
<attributeType name="Integer" />
79+
<attributeType name="Long" />
80+
<attributeType name="Enum" />
81+
</attributeTypes>
82+
</property>
83+
</propertyGroup>
84+
<!-- END DATABASE / STRING -->
85+
<propertyGroup caption="Attribute">
86+
<!-- ASSOCIATION -->
87+
<property key="attributeAssociation" type="association" selectableObjects="optionsSourceAssociationDataSource" required="true" setLabel="true">
88+
<caption>Entity</caption>
89+
<description />
90+
<associationTypes>
91+
<associationType name="Reference" />
92+
<associationType name="ReferenceSet" />
93+
</associationTypes>
94+
</property>
95+
<property key="optionsSourceAssociationDataSource" type="datasource" isList="true" required="false">
96+
<caption>Selectable objects</caption>
97+
<description />
98+
</property>
99+
</propertyGroup>
62100
<propertyGroup caption="Caption">
63101
<!-- CAPTIONS -->
64102
<property key="optionsSourceAssociationCaptionType" type="enumeration" defaultValue="attribute">
@@ -103,44 +141,6 @@
103141
</property>
104142
<!-- END CAPTIONS -->
105143
</propertyGroup>
106-
<propertyGroup caption="Store value">
107-
<property key="optionsSourceDatabaseValueAttribute" type="attribute" dataSource="optionsSourceDatabaseDataSource">
108-
<caption>Value</caption>
109-
<description />
110-
<attributeTypes>
111-
<attributeType name="String" />
112-
<attributeType name="Integer" />
113-
<attributeType name="Long" />
114-
<attributeType name="Enum" />
115-
</attributeTypes>
116-
</property>
117-
<property key="databaseAttributeString" type="attribute" setLabel="true" required="false">
118-
<caption>Target attribute</caption>
119-
<description />
120-
<attributeTypes>
121-
<attributeType name="String" />
122-
<attributeType name="Integer" />
123-
<attributeType name="Long" />
124-
<attributeType name="Enum" />
125-
</attributeTypes>
126-
</property>
127-
</propertyGroup>
128-
<!-- END DATABASE / STRING -->
129-
<propertyGroup caption="Attribute">
130-
<!-- ASSOCIATION -->
131-
<property key="attributeAssociation" type="association" selectableObjects="optionsSourceAssociationDataSource" required="true" setLabel="true">
132-
<caption>Entity</caption>
133-
<description />
134-
<associationTypes>
135-
<associationType name="Reference" />
136-
<associationType name="ReferenceSet" />
137-
</associationTypes>
138-
</property>
139-
<property key="optionsSourceAssociationDataSource" type="datasource" isList="true" required="false">
140-
<caption>Selectable objects</caption>
141-
<description />
142-
</property>
143-
</propertyGroup>
144144
<!-- END OPTIONS SOURCE -->
145145
<!-- STATIC-->
146146
<propertyGroup caption="Values">
@@ -214,6 +214,11 @@
214214
<enumerationValue key="radio">Radio button</enumerationValue>
215215
</enumerationValues>
216216
</property>
217+
<property key="groupName" type="expression" required="false">
218+
<caption>Group name</caption>
219+
<description>Name for the group of associated inputs</description>
220+
<returnType type="String" />
221+
</property>
217222
<!-- END MISC PROPS -->
218223
</propertyGroup>
219224
<!-- END GENERAL -->
@@ -271,10 +276,9 @@
271276
<description />
272277
<returnType type="Boolean" />
273278
</property>
274-
<property key="groupName" type="expression" required="false">
275-
<caption>Group name</caption>
279+
<property key="ariaLabel" type="string" defaultValue="" required="false">
280+
<caption>Aria label</caption>
276281
<description />
277-
<returnType type="String" />
278282
</property>
279283
</propertyGroup>
280284
</propertyGroup>

packages/pluggableWidgets/checkbox-radio-selection-web/src/__tests__/CheckboxRadioSelection.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe("CheckboxRadioSelection", () => {
6868
customEditabilityExpression: { status: "available", value: false } as any,
6969
readOnlyStyle: "bordered" as const,
7070
ariaRequired: { status: "available", value: false } as any,
71+
ariaLabel: "",
7172
controlType: "checkbox" as const
7273
};
7374

packages/pluggableWidgets/checkbox-radio-selection-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="CheckboxRadioSelection" version="1.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="CheckboxRadioSelection" version="1.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="CheckboxRadioSelection.xml" />
66
</widgetFiles>

packages/pluggableWidgets/checkbox-radio-selection-web/typings/CheckboxRadioSelectionProps.d.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,30 @@ export interface CheckboxRadioSelectionContainerProps {
4545
attributeBoolean: EditableValue<boolean>;
4646
optionsSourceDatabaseDataSource?: ListValue;
4747
optionsSourceDatabaseItemSelection?: SelectionSingleValue | SelectionMultiValue;
48+
optionsSourceDatabaseValueAttribute?: ListAttributeValue<string | Big>;
49+
databaseAttributeString?: EditableValue<string | Big>;
50+
attributeAssociation: ReferenceValue | ReferenceSetValue;
51+
optionsSourceAssociationDataSource?: ListValue;
4852
optionsSourceAssociationCaptionType: OptionsSourceAssociationCaptionTypeEnum;
4953
optionsSourceDatabaseCaptionType: OptionsSourceDatabaseCaptionTypeEnum;
5054
optionsSourceAssociationCaptionAttribute?: ListAttributeValue<string>;
5155
optionsSourceDatabaseCaptionAttribute?: ListAttributeValue<string>;
5256
optionsSourceAssociationCaptionExpression?: ListExpressionValue<string>;
5357
optionsSourceDatabaseCaptionExpression?: ListExpressionValue<string>;
54-
optionsSourceDatabaseValueAttribute?: ListAttributeValue<string | Big>;
55-
databaseAttributeString?: EditableValue<string | Big>;
56-
attributeAssociation: ReferenceValue | ReferenceSetValue;
57-
optionsSourceAssociationDataSource?: ListValue;
5858
staticAttribute: EditableValue<string | Big | boolean | Date>;
5959
optionsSourceStaticDataSource: OptionsSourceStaticDataSourceType[];
6060
noOptionsText?: DynamicValue<string>;
6161
optionsSourceCustomContentType: OptionsSourceCustomContentTypeEnum;
6262
optionsSourceAssociationCustomContent?: ListWidgetValue;
6363
optionsSourceDatabaseCustomContent?: ListWidgetValue;
6464
controlType: ControlTypeEnum;
65+
groupName?: DynamicValue<string>;
6566
customEditability: CustomEditabilityEnum;
6667
customEditabilityExpression: DynamicValue<boolean>;
6768
readOnlyStyle: ReadOnlyStyleEnum;
6869
onChangeEvent?: ActionValue;
6970
ariaRequired: DynamicValue<boolean>;
70-
groupName?: DynamicValue<string>;
71+
ariaLabel: string;
7172
}
7273

7374
export interface CheckboxRadioSelectionPreviewProps {
@@ -80,28 +81,29 @@ export interface CheckboxRadioSelectionPreviewProps {
8081
attributeBoolean: string;
8182
optionsSourceDatabaseDataSource: {} | { caption: string } | { type: string } | null;
8283
optionsSourceDatabaseItemSelection: "Single" | "Multi" | "None";
84+
optionsSourceDatabaseValueAttribute: string;
85+
databaseAttributeString: string;
86+
attributeAssociation: string;
87+
optionsSourceAssociationDataSource: {} | { caption: string } | { type: string } | null;
8388
optionsSourceAssociationCaptionType: OptionsSourceAssociationCaptionTypeEnum;
8489
optionsSourceDatabaseCaptionType: OptionsSourceDatabaseCaptionTypeEnum;
8590
optionsSourceAssociationCaptionAttribute: string;
8691
optionsSourceDatabaseCaptionAttribute: string;
8792
optionsSourceAssociationCaptionExpression: string;
8893
optionsSourceDatabaseCaptionExpression: string;
89-
optionsSourceDatabaseValueAttribute: string;
90-
databaseAttributeString: string;
91-
attributeAssociation: string;
92-
optionsSourceAssociationDataSource: {} | { caption: string } | { type: string } | null;
9394
staticAttribute: string;
9495
optionsSourceStaticDataSource: OptionsSourceStaticDataSourcePreviewType[];
9596
noOptionsText: string;
9697
optionsSourceCustomContentType: OptionsSourceCustomContentTypeEnum;
9798
optionsSourceAssociationCustomContent: { widgetCount: number; renderer: ComponentType<{ children: ReactNode; caption?: string }> };
9899
optionsSourceDatabaseCustomContent: { widgetCount: number; renderer: ComponentType<{ children: ReactNode; caption?: string }> };
99100
controlType: ControlTypeEnum;
101+
groupName: string;
100102
customEditability: CustomEditabilityEnum;
101103
customEditabilityExpression: string;
102104
readOnlyStyle: ReadOnlyStyleEnum;
103105
onChangeEvent: {} | null;
104106
onChangeDatabaseEvent: {} | null;
105107
ariaRequired: string;
106-
groupName: string;
108+
ariaLabel: string;
107109
}

0 commit comments

Comments
 (0)