Skip to content

Commit 44259e1

Browse files
committed
chore(cb): revert changes so combobox can be use on 9.24
1 parent 4ffa869 commit 44259e1

File tree

9 files changed

+20
-216
lines changed

9 files changed

+20
-216
lines changed

packages/pluggableWidgets/combobox-web/CHANGELOG.md

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

77
## [Unreleased]
88

9-
## [2.1.3] - 2024-12-11
10-
119
### Fixed
1210

1311
- We fixed an issue where placeholder failed to shown on database source.
1412

15-
## [2.1.2] - 2024-12-09
16-
17-
### Fixed
18-
1913
- We fixed an issue where onchange event on database source triggered directly onload.
2014

2115
- We fixed an issue where selected value sometimes shows unavailable text on lazy loaded content.
2216

23-
## [2.1.1] - 2024-11-15
24-
25-
### Fixed
26-
2717
- We fixed an issue where database optional value attribute breaks on runtime when not being set.
2818

2919
- We fixed an issue where custom content not shown on design preview and runtime for database datasource.
3020

31-
## [2.1.0] - 2024-10-29
32-
33-
### Added
34-
35-
- We added support for attribute with **Long** type.
36-
37-
### Changed
38-
39-
- We make **Value** no longer required if the **Target attribute** is not set for database datasource.
40-
41-
- We restructure **Attribute** group configuration and rename it as **Store value**.
42-
43-
## [2.0.2] - 2024-10-03
44-
45-
### Fixed
46-
4721
- We fixed an issue where the onChange event was not being triggered when selecting an item for the first time.
4822

4923
- We fixed an issue where the combo box values would not refresh after toggling its read-only state.
5024

51-
## [2.0.1] - 2024-08-16
52-
53-
### Fixed
54-
5525
- We fixed an issue with the toolbar visibility when a combobox menu overlays it.
5626

57-
## [2.0.0] - 2024-08-09
27+
- We fixed a11y issue where aria-required not applied in the widget.
5828

5929
### Added
6030

61-
- We added the ability to auto label combobox, based on the set attributes.
31+
- We added support for attribute with **Long** type.
6232

63-
- We implement the selection API for combobox that use database datasource, which allows the widget selection to be listened into.
33+
### Changed
6434

65-
### Fixed
35+
- We make **Value** no longer required if the **Target attribute** is not set for database datasource.
6636

67-
- We fixed a11y issue where aria-required not applied in the widget.
37+
- We restructure **Attribute** group configuration and rename it as **Store value**.
6838

6939
## [1.6.3] - 2024-08-07
7040

packages/pluggableWidgets/combobox-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/combobox-web",
33
"widgetName": "Combobox",
4-
"version": "2.1.3",
4+
"version": "1.7.0",
55
"description": "Configurable Combo box widget with suggestions and autocomplete.",
66
"copyright": "© Mendix Technology BV 2024. All rights reserved.",
77
"license": "Apache-2.0",

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const DATABASE_SOURCE_CONFIG: Array<keyof ComboboxPreviewProps> = [
2121
"optionsSourceDatabaseDataSource",
2222
"optionsSourceDatabaseDefaultValue",
2323
"optionsSourceDatabaseValueAttribute",
24-
"optionsSourceDatabaseItemSelection",
2524
"databaseAttributeString",
2625
"onChangeDatabaseEvent"
2726
];
@@ -119,13 +118,7 @@ export function getProperties(values: ComboboxPreviewProps, defaultProperties: P
119118
} else {
120119
hidePropertiesIn(defaultProperties, values, ["selectedItemsStyle"]);
121120
}
122-
if (values.optionsSourceDatabaseItemSelection === "Multi") {
123-
hidePropertiesIn(defaultProperties, values, [
124-
"optionsSourceDatabaseValueAttribute",
125-
"databaseAttributeString",
126-
"optionsSourceDatabaseDefaultValue"
127-
]);
128-
}
121+
129122
if (values.databaseAttributeString.length === 0) {
130123
hidePropertiesIn(defaultProperties, values, [
131124
"optionsSourceDatabaseValueAttribute",

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
</property>
3131

3232
<!-- ENUM & BOOLEAN-->
33-
<property key="attributeEnumeration" type="attribute" required="true" setLabel="true">
33+
<property key="attributeEnumeration" type="attribute" required="true">
3434
<caption>Attribute</caption>
3535
<description />
3636
<attributeTypes>
3737
<attributeType name="Enum" />
3838
</attributeTypes>
3939
</property>
40-
<property key="attributeBoolean" type="attribute" required="true" setLabel="true">
40+
<property key="attributeBoolean" type="attribute" required="true">
4141
<caption>Attribute</caption>
4242
<description />
4343
<attributeTypes>
@@ -50,14 +50,6 @@
5050
<caption>Selectable objects</caption>
5151
<description />
5252
</property>
53-
<property key="optionsSourceDatabaseItemSelection" type="selection" dataSource="optionsSourceDatabaseDataSource" onChange="onChangeDatabaseEvent">
54-
<caption>Selection type</caption>
55-
<description />
56-
<selectionTypes>
57-
<selectionType name="Single" />
58-
<selectionType name="Multi" />
59-
</selectionTypes>
60-
</property>
6153
</propertyGroup>
6254
<propertyGroup caption="Caption">
6355
<!-- CAPTIONS -->
@@ -114,7 +106,7 @@
114106
<attributeType name="Enum" />
115107
</attributeTypes>
116108
</property>
117-
<property key="databaseAttributeString" type="attribute" setLabel="true" required="false">
109+
<property key="databaseAttributeString" type="attribute">
118110
<caption>Target attribute</caption>
119111
<description />
120112
<attributeTypes>
@@ -124,7 +116,7 @@
124116
<attributeType name="Enum" />
125117
</attributeTypes>
126118
</property>
127-
<property key="optionsSourceDatabaseDefaultValue" type="expression" required="false">
119+
<property key="optionsSourceDatabaseDefaultValue" type="expression">
128120
<caption>Default value</caption>
129121
<description />
130122
<returnType assignableTo="databaseAttributeString" />
@@ -133,7 +125,7 @@
133125
</propertyGroup>
134126
<propertyGroup caption="Attribute">
135127
<!-- ASSOCIATION -->
136-
<property key="attributeAssociation" type="association" selectableObjects="optionsSourceAssociationDataSource" required="true" setLabel="true">
128+
<property key="attributeAssociation" type="association" selectableObjects="optionsSourceAssociationDataSource" required="true">
137129
<caption>Entity</caption>
138130
<description />
139131
<associationTypes>
@@ -149,7 +141,7 @@
149141
<!-- END OPTIONS SOURCE -->
150142
<!-- STATIC-->
151143
<propertyGroup caption="Values">
152-
<property key="staticAttribute" type="attribute" required="true" setLabel="true">
144+
<property key="staticAttribute" type="attribute" required="true">
153145
<caption>Attribute</caption>
154146
<description />
155147
<attributeTypes>

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

Lines changed: 0 additions & 131 deletions
This file was deleted.

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EditableValue, SelectionSingleValue } from "mendix";
1+
import { EditableValue } from "mendix";
22
import { ComboboxContainerProps } from "../../../typings/ComboboxProps";
33
import { _valuesIsEqual } from "../utils";
44
import { BaseDatabaseSingleSelector } from "./BaseDatabaseSingleSelector";
@@ -12,7 +12,6 @@ export class DatabaseSingleSelectionSelector<
1212
validation?: string = undefined;
1313
values: DatabaseValuesProvider;
1414
protected _attr: R | undefined;
15-
private selection?: SelectionSingleValue;
1615

1716
constructor() {
1817
super();
@@ -86,25 +85,12 @@ export class DatabaseSingleSelectionSelector<
8685
this.readOnly = targetAttribute?.readOnly ?? false;
8786
this.status = targetAttribute?.status ?? ds.status;
8887
this.validation = targetAttribute?.validation;
89-
this.selection = props.optionsSourceDatabaseItemSelection as SelectionSingleValue;
90-
91-
if (this.selection.selection === undefined) {
92-
const objectId = this.options.getAll().find(option => {
93-
return targetAttribute && _valuesIsEqual(targetAttribute?.value, this.values.get(option));
94-
});
95-
if (objectId) {
96-
this.selection.setSelection(this.options._optionToValue(objectId));
97-
}
98-
}
9988
}
10089

10190
setValue(objectId: string | null): void {
10291
const value = this.values.get(objectId) as T;
10392
this.lastSetValue = value;
10493
this._attr?.setValue(value);
105-
if (objectId !== (this.selection?.selection?.id ?? "")) {
106-
this.selection?.setSelection(this.options._optionToValue(objectId));
107-
}
10894
super.setValue(objectId);
10995
}
11096
}

packages/pluggableWidgets/combobox-web/src/helpers/getSelector.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ComboboxContainerProps } from "../../typings/ComboboxProps";
22
import { AssociationMultiSelector } from "./Association/AssociationMultiSelector";
33
import { AssociationSingleSelector } from "./Association/AssociationSingleSelector";
4-
import { DatabaseMultiSelectionSelector } from "./Database/DatabaseMultiSelectionSelector";
54
import { DatabaseSingleSelectionSelector } from "./Database/DatabaseSingleSelectionSelector";
65
import { EnumBooleanSingleSelector } from "./EnumBool/EnumBoolSingleSelector";
76
import { StaticSingleSelector } from "./Static/StaticSingleSelector";
@@ -19,11 +18,7 @@ export function getSelector(props: ComboboxContainerProps): Selector {
1918
throw new Error(`'optionsSourceType' of type '${props.optionsSourceType}' is not supported`);
2019
}
2120
} else if (props.source === "database") {
22-
if (props.optionsSourceDatabaseItemSelection?.type === "Multi") {
23-
return new DatabaseMultiSelectionSelector();
24-
} else {
25-
return new DatabaseSingleSelectionSelector();
26-
}
21+
return new DatabaseSingleSelectionSelector();
2722
} else if (props.source === "static") {
2823
return new StaticSingleSelector();
2924
}

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

0 commit comments

Comments
 (0)