Skip to content

Commit 724e93b

Browse files
committed
feat: initial update
1 parent 57c0b38 commit 724e93b

18 files changed

Lines changed: 166 additions & 199 deletions

packages/pluggableWidgets/selection-controls-web/src/SelectionControls.editorConfig.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const DATABASE_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
1212
"optionsSourceDatabaseCaptionExpression",
1313
"optionsSourceDatabaseCaptionType",
1414
"optionsSourceDatabaseCustomContent",
15-
"optionsSourceDatabaseCustomContentType",
1615
"optionsSourceDatabaseDataSource",
1716
"optionsSourceDatabaseValueAttribute",
1817
"optionsSourceDatabaseItemSelection",
@@ -25,7 +24,6 @@ const ASSOCIATION_SOURCE_CONFIG: Array<keyof SelectionControlsPreviewProps> = [
2524
"optionsSourceAssociationCaptionExpression",
2625
"optionsSourceAssociationCaptionType",
2726
"optionsSourceAssociationCustomContent",
28-
"optionsSourceAssociationCustomContentType",
2927
"optionsSourceAssociationDataSource",
3028
"attributeAssociation"
3129
];
@@ -42,7 +40,6 @@ export function getProperties(
4240
if (values.source === "context") {
4341
hidePropertiesIn(defaultProperties, values, [
4442
"staticAttribute",
45-
"staticDataSourceCustomContentType",
4643
"optionsSourceStaticDataSource",
4744
...DATABASE_SOURCE_CONFIG
4845
]);
@@ -65,7 +62,7 @@ export function getProperties(
6562
hidePropertiesIn(defaultProperties, values, ["optionsSourceAssociationCaptionType"]);
6663
}
6764

68-
if (values.optionsSourceAssociationCustomContentType === "no") {
65+
if (values.optionsSourceCustomContentType === "no") {
6966
hidePropertiesIn(defaultProperties, values, ["optionsSourceAssociationCustomContent"]);
7067
}
7168
}
@@ -75,7 +72,6 @@ export function getProperties(
7572
"attributeBoolean",
7673
"optionsSourceType",
7774
"staticAttribute",
78-
"staticDataSourceCustomContentType",
7975
"optionsSourceStaticDataSource",
8076
"onChangeEvent",
8177
...ASSOCIATION_SOURCE_CONFIG
@@ -88,7 +84,7 @@ export function getProperties(
8884
} else {
8985
hidePropertiesIn(defaultProperties, values, ["optionsSourceDatabaseCaptionAttribute"]);
9086
}
91-
if (values.optionsSourceDatabaseCustomContentType === "no") {
87+
if (values.optionsSourceCustomContentType === "no") {
9288
hidePropertiesIn(defaultProperties, values, ["optionsSourceDatabaseCustomContent"]);
9389
}
9490
if (values.optionsSourceDatabaseItemSelection === "Multi") {
@@ -116,7 +112,7 @@ export function getProperties(
116112
]);
117113
}
118114

119-
if (values.staticDataSourceCustomContentType === "no") {
115+
if (values.optionsSourceCustomContentType === "no") {
120116
values.optionsSourceStaticDataSource.forEach((_, index) => {
121117
hideNestedPropertiesIn(defaultProperties, values, "optionsSourceStaticDataSource", index, [
122118
"staticDataSourceCustomContent"

packages/pluggableWidgets/selection-controls-web/src/SelectionControls.xml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -182,41 +182,22 @@
182182
<!-- STATIC END-->
183183
<!-- GENERAL -->
184184
<propertyGroup caption="General">
185-
<property key="optionsSourceAssociationCustomContentType" type="enumeration" defaultValue="no" required="true">
185+
<property key="optionsSourceCustomContentType" type="enumeration" defaultValue="no" required="true">
186186
<caption>Custom content</caption>
187187
<description />
188188
<enumerationValues>
189189
<enumerationValue key="yes">Yes</enumerationValue>
190-
<enumerationValue key="listItem">List items only</enumerationValue>
191190
<enumerationValue key="no">No</enumerationValue>
192191
</enumerationValues>
193192
</property>
194193
<property key="optionsSourceAssociationCustomContent" type="widgets" required="true" dataSource="optionsSourceAssociationDataSource">
195194
<caption>Custom content</caption>
196195
<description />
197196
</property>
198-
<property key="optionsSourceDatabaseCustomContentType" type="enumeration" defaultValue="no" required="true">
199-
<caption>Custom content</caption>
200-
<description />
201-
<enumerationValues>
202-
<enumerationValue key="yes">Yes</enumerationValue>
203-
<enumerationValue key="listItem">List items only</enumerationValue>
204-
<enumerationValue key="no">No</enumerationValue>
205-
</enumerationValues>
206-
</property>
207197
<property key="optionsSourceDatabaseCustomContent" type="widgets" required="true" dataSource="optionsSourceDatabaseDataSource">
208198
<caption>Custom content</caption>
209199
<description />
210200
</property>
211-
<property key="staticDataSourceCustomContentType" type="enumeration" defaultValue="no">
212-
<caption>Custom content</caption>
213-
<description />
214-
<enumerationValues>
215-
<enumerationValue key="yes">Yes</enumerationValue>
216-
<enumerationValue key="listItem">List items only</enumerationValue>
217-
<enumerationValue key="no">No</enumerationValue>
218-
</enumerationValues>
219-
</property>
220201
<!-- END MISC PROPS -->
221202
</propertyGroup>
222203
<!-- END GENERAL -->

packages/pluggableWidgets/selection-controls-web/src/components/CheckboxSelection/CheckboxSelection.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export function CheckboxSelection({
77
tabIndex = 0,
88
inputId,
99
ariaRequired,
10-
a11yConfig,
1110
readOnlyStyle
1211
}: SelectionBaseProps<MultiSelector>): ReactElement {
1312
const options = selector.getOptions();
@@ -78,7 +77,7 @@ export function CheckboxSelection({
7877
</div>
7978

8079
{/* Clear all button */}
81-
{!isReadOnly && currentIds.length > 0 && (
80+
{/* {!isReadOnly && currentIds.length > 0 && (
8281
<button
8382
type="button"
8483
className="widget-selection-controls-clear-all"
@@ -87,15 +86,15 @@ export function CheckboxSelection({
8786
>
8887
Clear all selections
8988
</button>
90-
)}
89+
)} */}
9190

9291
{/* Accessibility status message */}
93-
<div id={`${inputId}-description`} className="sr-only" aria-live="polite" aria-atomic="true">
92+
{/* <div id={`${inputId}-description`} className="sr-only" aria-live="polite" aria-atomic="true">
9493
{currentIds.length > 0 &&
9594
`${a11yConfig.a11yStatusMessage.a11ySelectedValue} ${currentIds.map(id => selector.caption.get(id)).join(", ")}`}
9695
{` ${a11yConfig.a11yStatusMessage.a11yOptionsAvailable} ${options.length}`}
9796
{` ${a11yConfig.a11yStatusMessage.a11yInstructions}`}
98-
</div>
97+
</div> */}
9998
</div>
10099
);
101100
}

packages/pluggableWidgets/selection-controls-web/src/components/RadioSelection/RadioSelection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export function RadioSelection({
77
tabIndex = 0,
88
inputId,
99
ariaRequired,
10-
a11yConfig,
1110
readOnlyStyle
1211
}: SelectionBaseProps<SingleSelector>): ReactElement {
1312
const options = selector.options.getAll();
@@ -78,11 +77,11 @@ export function RadioSelection({
7877
</div>
7978

8079
{/* Accessibility status message */}
81-
<div id={`${inputId}-description`} className="sr-only" aria-live="polite" aria-atomic="true">
80+
{/* <div id={`${inputId}-description`} className="sr-only" aria-live="polite" aria-atomic="true">
8281
{currentId && `${a11yConfig.a11yStatusMessage.a11ySelectedValue} ${selector.caption.get(currentId)}`}
8382
{` ${a11yConfig.a11yStatusMessage.a11yOptionsAvailable} ${options.length}`}
8483
{` ${a11yConfig.a11yStatusMessage.a11yInstructions}`}
85-
</div>
84+
</div> */}
8685
</div>
8786
);
8887
}

packages/pluggableWidgets/selection-controls-web/src/helpers/Association/AssociationSimpleCaptionsProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { DynamicValue, ListAttributeValue, ListExpressionValue, ListWidgetValue, ObjectItem } from "mendix";
22
import { ReactNode, createElement } from "react";
3-
import { OptionsSourceAssociationCustomContentTypeEnum } from "../../../typings/SelectionControlsProps";
3+
import { OptionsSourceCustomContentTypeEnum } from "../../../typings/SelectionControlsProps";
44
import { CaptionsProvider } from "../types";
55

66
interface AssociationSimpleCaptionsProviderProps {
77
emptyOptionText?: DynamicValue<string>;
88
formattingAttributeOrExpression?: ListAttributeValue<string> | ListExpressionValue<string>;
99
customContent?: ListWidgetValue;
10-
customContentType: OptionsSourceAssociationCustomContentTypeEnum;
10+
customContentType: OptionsSourceCustomContentTypeEnum;
1111
}
1212

1313
export class AssociationSimpleCaptionsProvider implements CaptionsProvider {
1414
emptyCaption = "";
1515
formatter?: ListAttributeValue<string> | ListExpressionValue<string>;
1616
private _objectsMap: Map<string, ObjectItem>;
1717
private customContent?: ListWidgetValue;
18-
private customContentType: OptionsSourceAssociationCustomContentTypeEnum = "no";
18+
private customContentType: OptionsSourceCustomContentTypeEnum = "no";
1919

2020
constructor(objectsMap: Map<string, ObjectItem>) {
2121
this._objectsMap = objectsMap;

packages/pluggableWidgets/selection-controls-web/src/helpers/Association/BaseAssociationSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ActionValue, ObjectItem, ReferenceSetValue, ReferenceValue } from "mend
22
import { executeAction } from "@mendix/widget-plugin-platform/framework/execute-action";
33
import {
44
SelectionControlsContainerProps,
5-
OptionsSourceAssociationCustomContentTypeEnum
5+
OptionsSourceCustomContentTypeEnum
66
} from "../../../typings/SelectionControlsProps";
77
import { Status } from "../types";
88
import { AssociationOptionsProvider } from "./AssociationOptionsProvider";
@@ -16,7 +16,7 @@ export class BaseAssociationSelector<T extends string | string[], R extends Refe
1616
currentId: T | null = null;
1717
caption: AssociationSimpleCaptionsProvider;
1818
readOnly = false;
19-
customContentType: OptionsSourceAssociationCustomContentTypeEnum = "no";
19+
customContentType: OptionsSourceCustomContentTypeEnum = "no";
2020
validation?: string = undefined;
2121
onEnterEvent?: () => void;
2222
onLeaveEvent?: () => void;

packages/pluggableWidgets/selection-controls-web/src/helpers/Association/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "mendix";
1212
import {
1313
SelectionControlsContainerProps,
14-
OptionsSourceAssociationCustomContentTypeEnum
14+
OptionsSourceCustomContentTypeEnum
1515
} from "../../../typings/SelectionControlsProps";
1616

1717
export function extractAssociationProps(
@@ -24,7 +24,7 @@ export function extractAssociationProps(
2424
boolean,
2525
ActionValue | undefined,
2626
ListWidgetValue | undefined,
27-
OptionsSourceAssociationCustomContentTypeEnum
27+
OptionsSourceCustomContentTypeEnum
2828
] {
2929
const attr = props.attributeAssociation;
3030
const ds = props.optionsSourceAssociationDataSource!;
@@ -46,7 +46,7 @@ export function extractAssociationProps(
4646

4747
const onChangeEvent = props.onChangeEvent;
4848
const customContent = props.optionsSourceAssociationCustomContent;
49-
const customContentType = props.optionsSourceAssociationCustomContentType;
49+
const customContentType = props.optionsSourceCustomContentType;
5050

5151
return [attr, ds, captionProvider, emptyOption, clearable, onChangeEvent, customContent, customContentType];
5252
}

packages/pluggableWidgets/selection-controls-web/src/helpers/Database/DatabaseCaptionsProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { DynamicValue, ListAttributeValue, ListExpressionValue, ListWidgetValue, ObjectItem } from "mendix";
22
import { ReactNode, createElement } from "react";
33
import { Big } from "big.js";
4-
import { OptionsSourceDatabaseCustomContentTypeEnum } from "../../../typings/SelectionControlsProps";
4+
import { OptionsSourceCustomContentTypeEnum } from "../../../typings/SelectionControlsProps";
55
import { CaptionsProvider } from "../types";
66

77
interface DatabaseCaptionsProviderProps {
88
emptyOptionText?: DynamicValue<string>;
99
formattingAttributeOrExpression?: ListAttributeValue<string> | ListExpressionValue<string>;
1010
customContent?: ListWidgetValue;
11-
customContentType: OptionsSourceDatabaseCustomContentTypeEnum;
11+
customContentType: OptionsSourceCustomContentTypeEnum;
1212
attribute?: ListAttributeValue<string | Big>;
1313
caption?: string;
1414
}
@@ -18,7 +18,7 @@ export class DatabaseCaptionsProvider implements CaptionsProvider {
1818
formatter?: ListAttributeValue<string> | ListExpressionValue<string>;
1919
private _objectsMap: Map<string, ObjectItem>;
2020
private customContent?: ListWidgetValue;
21-
private customContentType: OptionsSourceDatabaseCustomContentTypeEnum = "no";
21+
private customContentType: OptionsSourceCustomContentTypeEnum = "no";
2222

2323
constructor(objectsMap: Map<string, ObjectItem>) {
2424
this._objectsMap = objectsMap;

packages/pluggableWidgets/selection-controls-web/src/helpers/Database/DatabaseMultiSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { EditableValue, ObjectItem, SelectionMultiValue } from "mendix";
22
import { Big } from "big.js";
33
import {
44
SelectionControlsContainerProps,
5-
OptionsSourceDatabaseCustomContentTypeEnum
5+
OptionsSourceCustomContentTypeEnum
66
} from "../../../typings/SelectionControlsProps";
77
import { MultiSelector, Status } from "../types";
88
import { _valuesIsEqual } from "../utils";
@@ -21,7 +21,7 @@ export class DatabaseMultiSelector<T extends string | Big, R extends EditableVal
2121
clearable = false;
2222
currentId: string[] | null = null;
2323
readOnly = false;
24-
customContentType: OptionsSourceDatabaseCustomContentTypeEnum = "no";
24+
customContentType: OptionsSourceCustomContentTypeEnum = "no";
2525
validation?: string = undefined;
2626
onEnterEvent?: () => void;
2727
onLeaveEvent?: () => void;

packages/pluggableWidgets/selection-controls-web/src/helpers/Database/DatabaseSingleSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { EditableValue, ObjectItem, SelectionSingleValue } from "mendix";
22
import { Big } from "big.js";
33
import {
44
SelectionControlsContainerProps,
5-
OptionsSourceDatabaseCustomContentTypeEnum
5+
OptionsSourceCustomContentTypeEnum
66
} from "../../../typings/SelectionControlsProps";
77
import { SingleSelector, Status } from "../types";
88
import { _valuesIsEqual } from "../utils";
@@ -21,7 +21,7 @@ export class DatabaseSingleSelector<T extends string | Big, R extends EditableVa
2121
clearable = false;
2222
currentId: string | null = null;
2323
readOnly = false;
24-
customContentType: OptionsSourceDatabaseCustomContentTypeEnum = "no";
24+
customContentType: OptionsSourceCustomContentTypeEnum = "no";
2525
validation?: string = undefined;
2626
onEnterEvent?: () => void;
2727
onLeaveEvent?: () => void;

0 commit comments

Comments
 (0)