Skip to content

Commit e5a02fc

Browse files
committed
chore(cb): revert changes so combobox can be use on 9.24
1 parent b722ffb commit e5a02fc

File tree

9 files changed

+25
-16
lines changed

9 files changed

+25
-16
lines changed

packages/pluggableWidgets/combobox-web/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
### Fixed
1010

11+
- We fixed an issue where database onchange failed to trigger, if you have set your onChange event using database source on v1.7.0 previously, it will clear again upon upgrade, but it will be seamless upgrade from 1.6.x version.
12+
13+
## [1.7.0] - 2024-12-17
14+
15+
### Fixed
16+
1117
- We fixed an issue where placeholder failed to shown on database source.
1218

1319
- We fixed an issue where onchange event on database source triggered directly onload.

packages/pluggableWidgets/combobox-web/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/combobox-web",
33
"widgetName": "Combobox",
4-
"version": "1.7.0",
4+
"version": "1.7.1",
55
"description": "Configurable Combo box widget with suggestions and autocomplete.",
66
"copyright": "© Mendix Technology BV 2024. All rights reserved.",
77
"license": "Apache-2.0",
@@ -19,9 +19,10 @@
1919
"mpkName": "com.mendix.widget.web.Combobox.mpk"
2020
},
2121
"marketplace": {
22-
"minimumMXVersion": "10.7.0",
22+
"minimumMXVersion": "9.24.0.2965",
2323
"appNumber": 219304,
24-
"appName": "Combo box"
24+
"appName": "Combo box",
25+
"reactReady": true
2526
},
2627
"testProject": {
2728
"githubUrl": "https://github.com/mendix/testProjects",

packages/pluggableWidgets/combobox-web/src/Combobox.editorConfig.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const DATABASE_SOURCE_CONFIG: Array<keyof ComboboxPreviewProps> = [
2121
"optionsSourceDatabaseDataSource",
2222
"optionsSourceDatabaseDefaultValue",
2323
"optionsSourceDatabaseValueAttribute",
24-
"databaseAttributeString",
25-
"onChangeDatabaseEvent"
24+
"databaseAttributeString"
2625
];
2726

2827
const ASSOCIATION_SOURCE_CONFIG: Array<keyof ComboboxPreviewProps> = [
@@ -99,7 +98,6 @@ export function getProperties(values: ComboboxPreviewProps, defaultProperties: P
9998
"selectionMethod",
10099
"selectAllButton",
101100
"selectAllButtonCaption",
102-
"onChangeEvent",
103101
...ASSOCIATION_SOURCE_CONFIG
104102
]);
105103
if (values.optionsSourceDatabaseDataSource === null) {

packages/pluggableWidgets/combobox-web/src/Combobox.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,6 @@
310310
<caption>On change action</caption>
311311
<description />
312312
</property>
313-
<property key="onChangeDatabaseEvent" type="action" required="false">
314-
<caption>On change action</caption>
315-
<description />
316-
</property>
317313
<property key="onEnterEvent" type="action" required="false">
318314
<caption>On enter action</caption>
319315
<description />

packages/pluggableWidgets/combobox-web/src/components/MultiSelection/MultiSelection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export function MultiSelection({
5252
if (selector.options.loadMore) {
5353
selector.options.loadMore();
5454
}
55-
}
55+
},
56+
readOnly: selector.readOnly
5657
});
5758

5859
return (

packages/pluggableWidgets/combobox-web/src/helpers/Database/DatabaseSingleSelectionSelector.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import { EditableValue } from "mendix";
1+
import { ActionValue, EditableValue } from "mendix";
22
import { ComboboxContainerProps } from "../../../typings/ComboboxProps";
33
import { _valuesIsEqual } from "../utils";
44
import { BaseDatabaseSingleSelector } from "./BaseDatabaseSingleSelector";
55
import { DatabaseValuesProvider } from "./DatabaseValuesProvider";
66
import { extractDatabaseProps } from "./utils";
7+
import { executeAction } from "@mendix/widget-plugin-platform/framework/execute-action";
78

89
export class DatabaseSingleSelectionSelector<
910
T extends string | Big,
1011
R extends EditableValue<T>
1112
> extends BaseDatabaseSingleSelector<T> {
1213
validation?: string = undefined;
1314
values: DatabaseValuesProvider;
15+
private onChangeEvent?: ActionValue;
1416
protected _attr: R | undefined;
1517

1618
constructor() {
@@ -29,6 +31,7 @@ export class DatabaseSingleSelectionSelector<
2931
ds,
3032
emptyOption,
3133
emptyValue,
34+
onChangeEvent,
3235
lazyLoading,
3336
valueSourceAttribute
3437
} = extractDatabaseProps(props);
@@ -85,12 +88,14 @@ export class DatabaseSingleSelectionSelector<
8588
this.readOnly = targetAttribute?.readOnly ?? false;
8689
this.status = targetAttribute?.status ?? ds.status;
8790
this.validation = targetAttribute?.validation;
91+
this.onChangeEvent = onChangeEvent;
8892
}
8993

9094
setValue(objectId: string | null): void {
9195
const value = this.values.get(objectId) as T;
9296
this.lastSetValue = value;
9397
this._attr?.setValue(value);
9498
super.setValue(objectId);
99+
executeAction(this.onChangeEvent);
95100
}
96101
}

packages/pluggableWidgets/combobox-web/src/helpers/Database/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import Big from "big.js";
12
import {
3+
ActionValue,
24
DynamicValue,
35
EditableValue,
46
ListAttributeValue,
@@ -13,7 +15,6 @@ import {
1315
OptionsSourceAssociationCustomContentTypeEnum,
1416
OptionsSourceDatabaseCaptionTypeEnum
1517
} from "../../../typings/ComboboxProps";
16-
import Big from "big.js";
1718

1819
type ExtractionReturnValue = {
1920
targetAttribute?: EditableValue<string | Big>;
@@ -26,6 +27,7 @@ type ExtractionReturnValue = {
2627
emptyOption?: DynamicValue<string>;
2728
emptyValue?: DynamicValue<string | Big>;
2829
filterType: FilterTypeEnum;
30+
onChangeEvent?: ActionValue;
2931
lazyLoading: boolean;
3032
loadingType: LoadingTypeEnum;
3133
valueSourceAttribute: ListAttributeValue<string | Big> | undefined;
@@ -34,6 +36,7 @@ type ExtractionReturnValue = {
3436
export function extractDatabaseProps(props: ComboboxContainerProps): ExtractionReturnValue {
3537
const targetAttribute = props.databaseAttributeString;
3638
const filterType = props.filterType;
39+
const onChangeEvent = props.onChangeEvent;
3740

3841
const ds = props.optionsSourceDatabaseDataSource;
3942
if (!ds) {
@@ -84,6 +87,7 @@ export function extractDatabaseProps(props: ComboboxContainerProps): ExtractionR
8487
emptyOption,
8588
emptyValue,
8689
filterType,
90+
onChangeEvent,
8791
lazyLoading,
8892
loadingType,
8993
valueSourceAttribute

packages/pluggableWidgets/combobox-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="Combobox" version="1.7.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Combobox" version="1.7.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Combobox.xml" />
66
</widgetFiles>

packages/pluggableWidgets/combobox-web/typings/ComboboxProps.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export interface ComboboxContainerProps {
8282
selectAllButtonCaption: DynamicValue<string>;
8383
readOnlyStyle: ReadOnlyStyleEnum;
8484
onChangeEvent?: ActionValue;
85-
onChangeDatabaseEvent?: ActionValue;
8685
onEnterEvent?: ActionValue;
8786
onLeaveEvent?: ActionValue;
8887
ariaRequired: boolean;
@@ -133,7 +132,6 @@ export interface ComboboxPreviewProps {
133132
selectAllButtonCaption: string;
134133
readOnlyStyle: ReadOnlyStyleEnum;
135134
onChangeEvent: {} | null;
136-
onChangeDatabaseEvent: {} | null;
137135
onEnterEvent: {} | null;
138136
onLeaveEvent: {} | null;
139137
ariaRequired: boolean;

0 commit comments

Comments
 (0)