orc-shared 5.10.2-dev.4 → 5.99.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppFrame/About.js +13 -13
- package/dist/components/AppFrame/Anchor.js +7 -7
- package/dist/components/AppFrame/AppFrame.js +3 -3
- package/dist/components/AppFrame/Help.js +4 -4
- package/dist/components/AppFrame/MenuItem.js +17 -26
- package/dist/components/AppFrame/Preferences.js +14 -14
- package/dist/components/AppFrame/Sidebar.js +6 -6
- package/dist/components/AppFrame/Topbar.js +6 -6
- package/dist/components/ApplicationModuleLoader.js +3 -2
- package/dist/components/Authenticate.js +29 -22
- package/dist/components/DropMenu/Menu.js +9 -9
- package/dist/components/ErrorPlaceholder.js +8 -24
- package/dist/components/Form/Field.js +4 -4
- package/dist/components/Form/Inputs/Button.js +2 -2
- package/dist/components/{IconButton.js → Form/Inputs/MultiSelector.js} +33 -31
- package/dist/components/Form/Inputs/index.js +1 -1
- package/dist/components/InternetExplorerWarningMessage.js +15 -15
- package/dist/components/LoadingIcon.js +38 -17
- package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +4 -4
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/dist/components/MaterialUI/Inputs/InputBase.js +20 -188
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/Select.js +10 -0
- package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
- package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
- package/dist/components/MaterialUI/muiThemes.js +2 -0
- package/dist/components/Provision.js +30 -13
- package/dist/components/Routing/SegmentPage.js +115 -56
- package/dist/components/Scope/ScopeNode.js +62 -57
- package/dist/components/Sidepanel.js +59 -23
- package/dist/components/Spritesheet.js +35 -17
- package/dist/components/Text.js +1 -60
- package/dist/components/ToastList.js +95 -64
- package/dist/components/Treeview/Branch.js +82 -20
- package/dist/components/Treeview/Label.js +108 -31
- package/dist/components/Treeview/Leaf.js +56 -12
- package/dist/components/Treeview/Node.js +22 -9
- package/dist/components/Treeview/index.js +7 -1
- package/dist/components/Treeview/settings.js +17 -6
- package/dist/utils/index.js +0 -4
- package/dist/utils/testUtils.js +1 -12
- package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
- package/package.json +2 -2
- package/src/components/AppFrame/About.js +13 -13
- package/src/components/AppFrame/Anchor.js +7 -7
- package/src/components/AppFrame/AppFrame.js +3 -3
- package/src/components/AppFrame/Help.js +4 -4
- package/src/components/AppFrame/MenuItem.js +15 -23
- package/src/components/AppFrame/Preferences.js +14 -14
- package/src/components/AppFrame/Sidebar.js +6 -6
- package/src/components/AppFrame/Topbar.js +6 -6
- package/src/components/ApplicationModuleLoader.js +2 -2
- package/src/components/ApplicationModuleLoader.test.js +15 -28
- package/src/components/Authenticate.js +21 -23
- package/src/components/Authenticate.test.js +19 -27
- package/src/components/DropMenu/Menu.js +9 -9
- package/src/components/ErrorPlaceholder.js +4 -21
- package/src/components/ErrorPlaceholder.test.js +7 -14
- package/src/components/Form/Field.js +4 -4
- package/src/components/Form/InputField.test.js +2 -1
- package/src/components/Form/Inputs/Button.js +2 -2
- package/src/components/Form/Inputs/MultiSelector.js +23 -0
- package/src/components/Form/Inputs/MultiSelector.test.js +112 -0
- package/src/components/Form/Inputs/index.js +1 -1
- package/src/components/InternetExplorerWarningMessage.js +15 -15
- package/src/components/Loader.test.js +50 -59
- package/src/components/LoadingIcon.js +27 -14
- package/src/components/LoadingIcon.test.js +11 -15
- package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +3 -3
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +0 -74
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Translations.test.js +6 -18
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
- package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
- package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/src/components/MaterialUI/Inputs/InputBase.js +31 -214
- package/src/components/MaterialUI/Inputs/InputBase.test.js +1 -460
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
- package/src/components/MaterialUI/Inputs/Select.js +7 -0
- package/src/components/MaterialUI/Inputs/Select.test.js +45 -0
- package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
- package/src/components/MaterialUI/Inputs/Switch.js +1 -1
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
- package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
- package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
- package/src/components/MaterialUI/muiThemes.js +3 -0
- package/src/components/Navigation/Navigation.test.js +0 -5
- package/src/components/Navigation/useNavigationState.test.js +79 -222
- package/src/components/Provision.js +36 -42
- package/src/components/Provision.test.js +10 -26
- package/src/components/Routing/SegmentPage.js +68 -52
- package/src/components/Routing/SegmentPage.test.js +4 -12
- package/src/components/Scope/ScopeNode.js +44 -55
- package/src/components/Scope/ScopeNode.test.js +84 -163
- package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
- package/src/components/Sidepanel.js +38 -32
- package/src/components/Sidepanel.test.js +54 -27
- package/src/components/Spritesheet.js +23 -21
- package/src/components/Spritesheet.test.js +10 -10
- package/src/components/Text.js +0 -49
- package/src/components/ToastList.js +79 -90
- package/src/components/ToastList.test.js +29 -103
- package/src/components/Treeview/Branch.js +65 -47
- package/src/components/Treeview/Branch.test.js +2 -43
- package/src/components/Treeview/Label.js +68 -54
- package/src/components/Treeview/Label.test.js +55 -63
- package/src/components/Treeview/Leaf.js +41 -22
- package/src/components/Treeview/Leaf.test.js +1 -15
- package/src/components/Treeview/Node.js +16 -9
- package/src/components/Treeview/Node.test.js +269 -200
- package/src/components/Treeview/Treeview.test.js +248 -248
- package/src/components/Treeview/index.js +6 -0
- package/src/components/Treeview/settings.js +10 -6
- package/src/utils/index.js +0 -4
- package/src/utils/testUtils.js +0 -10
- package/src/utils/testUtils.test.js +0 -68
- package/src/utils/toastHelper.js +8 -0
- package/src/utils/toastHelper.test.js +41 -0
- package/dist/components/Button.js +0 -70
- package/dist/components/CategoryList.js +0 -197
- package/dist/components/Checkbox.js +0 -103
- package/dist/components/Icon.js +0 -69
- package/dist/components/Input.js +0 -101
- package/dist/components/List/DataCell.js +0 -129
- package/dist/components/List/HeadCell.js +0 -125
- package/dist/components/List/HeadRow.js +0 -73
- package/dist/components/List/List.js +0 -274
- package/dist/components/List/Row.js +0 -109
- package/dist/components/List/enhanceColumnDefs.js +0 -111
- package/dist/components/List/index.js +0 -59
- package/dist/components/Modal/Dialog.js +0 -75
- package/dist/components/Modal/Wrapper.js +0 -69
- package/dist/components/Modal/index.js +0 -86
- package/dist/components/MultiSelector.js +0 -187
- package/dist/components/Navigation/Bar.js +0 -293
- package/dist/components/Navigation/Tab.js +0 -182
- package/dist/components/Placeholder.js +0 -114
- package/dist/components/Scope/Selector.js +0 -123
- package/dist/components/Selector.js +0 -185
- package/dist/components/Switch.js +0 -128
- package/dist/components/Toolbar.js +0 -227
- package/dist/components/Tooltip.js +0 -66
- package/dist/getTheme.js +0 -158
- package/dist/getThemeOverrides.js +0 -93
- package/dist/hocs/withAuthentication.js +0 -72
- package/dist/utils/styledPropFuncs.js +0 -88
- package/src/components/Button.js +0 -90
- package/src/components/Button.test.js +0 -49
- package/src/components/CategoryList.js +0 -140
- package/src/components/CategoryList.test.js +0 -667
- package/src/components/Checkbox.js +0 -63
- package/src/components/Checkbox.test.js +0 -122
- package/src/components/Icon.js +0 -18
- package/src/components/IconButton.js +0 -30
- package/src/components/IconButton.test.js +0 -61
- package/src/components/Input.js +0 -35
- package/src/components/Input.test.js +0 -34
- package/src/components/List/DataCell.js +0 -77
- package/src/components/List/DataCell.test.js +0 -357
- package/src/components/List/HeadCell.js +0 -105
- package/src/components/List/HeadCell.test.js +0 -331
- package/src/components/List/HeadRow.js +0 -21
- package/src/components/List/HeadRow.test.js +0 -27
- package/src/components/List/List.js +0 -162
- package/src/components/List/List.test.js +0 -705
- package/src/components/List/Row.js +0 -72
- package/src/components/List/Row.test.js +0 -194
- package/src/components/List/enhanceColumnDefs.js +0 -54
- package/src/components/List/enhanceColumnDefs.test.js +0 -179
- package/src/components/List/index.js +0 -6
- package/src/components/Modal/Background.js +0 -10
- package/src/components/Modal/Dialog.js +0 -27
- package/src/components/Modal/Dialog.test.js +0 -20
- package/src/components/Modal/Modal.test.js +0 -52
- package/src/components/Modal/Wrapper.js +0 -32
- package/src/components/Modal/Wrapper.test.js +0 -55
- package/src/components/Modal/index.js +0 -22
- package/src/components/MultiSelector.js +0 -104
- package/src/components/MultiSelector.test.js +0 -348
- package/src/components/Navigation/Bar.js +0 -212
- package/src/components/Navigation/Bar.test.js +0 -552
- package/src/components/Navigation/Tab.js +0 -156
- package/src/components/Navigation/Tab.test.js +0 -404
- package/src/components/Placeholder.js +0 -61
- package/src/components/Placeholder.test.js +0 -106
- package/src/components/Scope/Selector.js +0 -70
- package/src/components/Scope/Selector.test.js +0 -138
- package/src/components/Selector.js +0 -191
- package/src/components/Selector.test.js +0 -157
- package/src/components/Switch.js +0 -112
- package/src/components/Switch.test.js +0 -130
- package/src/components/Text.test.js +0 -132
- package/src/components/Toolbar.js +0 -178
- package/src/components/Toolbar.test.js +0 -478
- package/src/components/Tooltip.js +0 -51
- package/src/components/Tooltip.test.js +0 -21
- package/src/getTheme.js +0 -103
- package/src/getTheme.test.js +0 -92
- package/src/getThemeOverrides.js +0 -27
- package/src/hocs/withAuthentication.js +0 -18
- package/src/hocs/withAuthentication.test.js +0 -120
- package/src/utils/styledPropFuncs.js +0 -20
- package/src/utils/styledPropFuncs.test.js +0 -166
|
@@ -317,7 +317,7 @@ describe("InputBase Component", () => {
|
|
|
317
317
|
});
|
|
318
318
|
});
|
|
319
319
|
|
|
320
|
-
describe("InputBase component
|
|
320
|
+
describe("InputBase component debouce", () => {
|
|
321
321
|
const clock = sinon.useFakeTimers();
|
|
322
322
|
let update, container;
|
|
323
323
|
|
|
@@ -946,463 +946,4 @@ describe("AdvancedNumericInput", () => {
|
|
|
946
946
|
|
|
947
947
|
expect(update, "to have calls satisfying", [{ args: ["", metadata] }]);
|
|
948
948
|
});
|
|
949
|
-
|
|
950
|
-
it("Change advanced numeric input value with decimal does not have the spinner buttons", () => {
|
|
951
|
-
const inputProps = new InputBaseProps();
|
|
952
|
-
const aLabel = "aLabel";
|
|
953
|
-
const aValue = "";
|
|
954
|
-
|
|
955
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
956
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
957
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
958
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
959
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
960
|
-
|
|
961
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
962
|
-
const mountedComponent = mount(component);
|
|
963
|
-
const btn = mountedComponent.find("[data-qa='increase']");
|
|
964
|
-
expect(btn.length, "to be", 0);
|
|
965
|
-
});
|
|
966
|
-
|
|
967
|
-
it("Disabled advanced numeric input value without decimals should not have the increase/decrease buttons", () => {
|
|
968
|
-
const inputProps = new InputBaseProps();
|
|
969
|
-
const aLabel = "aLabel";
|
|
970
|
-
const aValue = "";
|
|
971
|
-
|
|
972
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
973
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
974
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
975
|
-
inputProps.set(InputBaseProps.propNames.disabled, true);
|
|
976
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
977
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
978
|
-
|
|
979
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
980
|
-
const mountedComponent = mount(component);
|
|
981
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
982
|
-
expect(btn.length, "to equal", 0);
|
|
983
|
-
});
|
|
984
|
-
|
|
985
|
-
it("Advanced numeric input value without decimals, simulate onMouseDown to make code coverage happy", () => {
|
|
986
|
-
const inputProps = new InputBaseProps();
|
|
987
|
-
const aLabel = "aLabel";
|
|
988
|
-
const aValue = "";
|
|
989
|
-
|
|
990
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
991
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
992
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
993
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
994
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
995
|
-
|
|
996
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
997
|
-
const mountedComponent = mount(component);
|
|
998
|
-
const btnIncrease = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
999
|
-
const btnDecrease = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1000
|
-
|
|
1001
|
-
btnIncrease.simulate("mouseDown");
|
|
1002
|
-
btnDecrease.simulate("mouseDown");
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
it("Advanced numeric input value without decimals but with custom onKeyDown with prevent default", () => {
|
|
1006
|
-
const keydownSpy = sinon.stub().callsFake(e => {
|
|
1007
|
-
e.preventDefault();
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
const inputProps = new InputBaseProps();
|
|
1011
|
-
const aLabel = "aLabel";
|
|
1012
|
-
const aValue = "";
|
|
1013
|
-
|
|
1014
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1015
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1016
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1017
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1018
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1019
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { onKeyDown: keydownSpy });
|
|
1020
|
-
|
|
1021
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1022
|
-
const mountedComponent = mount(component);
|
|
1023
|
-
const input = mountedComponent.find("input");
|
|
1024
|
-
input.simulate("keydown", { key: "ArrowUp" });
|
|
1025
|
-
|
|
1026
|
-
expect(keydownSpy, "was called once");
|
|
1027
|
-
expect(update, "was not called");
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1030
|
-
it("Advanced numeric input value without decimals but with custom onKeyDown without prevent default", () => {
|
|
1031
|
-
const keydownSpy = sinon.stub().callsFake(e => {});
|
|
1032
|
-
|
|
1033
|
-
const inputProps = new InputBaseProps();
|
|
1034
|
-
const aLabel = "aLabel";
|
|
1035
|
-
const aValue = "";
|
|
1036
|
-
|
|
1037
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1038
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1039
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1040
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1041
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1042
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { onKeyDown: keydownSpy });
|
|
1043
|
-
|
|
1044
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1045
|
-
const mountedComponent = mount(component);
|
|
1046
|
-
const input = mountedComponent.find("input");
|
|
1047
|
-
input.simulate("keydown", { key: "ArrowUp" });
|
|
1048
|
-
|
|
1049
|
-
expect(keydownSpy, "was called once");
|
|
1050
|
-
expect(update, "to have calls satisfying", [{ args: ["1", null] }]);
|
|
1051
|
-
});
|
|
1052
|
-
|
|
1053
|
-
it("Change advanced numeric input value, empty initial value with increase button", () => {
|
|
1054
|
-
const inputProps = new InputBaseProps();
|
|
1055
|
-
const aLabel = "aLabel";
|
|
1056
|
-
const aValue = "";
|
|
1057
|
-
|
|
1058
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1059
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1060
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1061
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1062
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1063
|
-
|
|
1064
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1065
|
-
const mountedComponent = mount(component);
|
|
1066
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1067
|
-
btn.simulate("click");
|
|
1068
|
-
|
|
1069
|
-
expect(update, "to have calls satisfying", [{ args: ["1", null] }]);
|
|
1070
|
-
});
|
|
1071
|
-
|
|
1072
|
-
it("Change advanced numeric input value, 1 initial value with increase button", () => {
|
|
1073
|
-
const inputProps = new InputBaseProps();
|
|
1074
|
-
const aLabel = "aLabel";
|
|
1075
|
-
const aValue = "1";
|
|
1076
|
-
|
|
1077
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1078
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1079
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1080
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1081
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1082
|
-
|
|
1083
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1084
|
-
const mountedComponent = mount(component);
|
|
1085
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1086
|
-
btn.simulate("click");
|
|
1087
|
-
|
|
1088
|
-
expect(update, "to have calls satisfying", [{ args: ["2", null] }]);
|
|
1089
|
-
});
|
|
1090
|
-
|
|
1091
|
-
it("Change advanced numeric input value, 10 initial value with max 11 with increase button", () => {
|
|
1092
|
-
const inputProps = new InputBaseProps();
|
|
1093
|
-
const aLabel = "aLabel";
|
|
1094
|
-
const aValue = "10";
|
|
1095
|
-
|
|
1096
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1097
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1098
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1099
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1100
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1101
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -11, max: 11 });
|
|
1102
|
-
|
|
1103
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1104
|
-
const mountedComponent = mount(component);
|
|
1105
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1106
|
-
btn.simulate("click");
|
|
1107
|
-
|
|
1108
|
-
expect(update, "to have calls satisfying", [{ args: ["11", null] }]);
|
|
1109
|
-
});
|
|
1110
|
-
|
|
1111
|
-
it("Change advanced numeric input value, 11 initial value with max 11 with increase button stays at 11", () => {
|
|
1112
|
-
const inputProps = new InputBaseProps();
|
|
1113
|
-
const aLabel = "aLabel";
|
|
1114
|
-
const aValue = "11";
|
|
1115
|
-
|
|
1116
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1117
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1118
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1119
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1120
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1121
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -11, max: 11 });
|
|
1122
|
-
|
|
1123
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1124
|
-
const mountedComponent = mount(component);
|
|
1125
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1126
|
-
btn.simulate("click");
|
|
1127
|
-
|
|
1128
|
-
expect(update, "was not called");
|
|
1129
|
-
});
|
|
1130
|
-
|
|
1131
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, increase button set value to 5", () => {
|
|
1132
|
-
const inputProps = new InputBaseProps();
|
|
1133
|
-
const aLabel = "aLabel";
|
|
1134
|
-
const aValue = "";
|
|
1135
|
-
|
|
1136
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1137
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1138
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1139
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1140
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1141
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: 5, max: 15 });
|
|
1142
|
-
|
|
1143
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1144
|
-
const mountedComponent = mount(component);
|
|
1145
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1146
|
-
btn.simulate("click");
|
|
1147
|
-
|
|
1148
|
-
expect(update, "to have calls satisfying", [{ args: ["5", null] }]);
|
|
1149
|
-
});
|
|
1150
|
-
|
|
1151
|
-
it("Change advanced numeric input value, empty initial value, min=-15, max=-5, increase button set value to -5", () => {
|
|
1152
|
-
const inputProps = new InputBaseProps();
|
|
1153
|
-
const aLabel = "aLabel";
|
|
1154
|
-
const aValue = "";
|
|
1155
|
-
|
|
1156
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1157
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1158
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1159
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1160
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1161
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -15, max: -5 });
|
|
1162
|
-
|
|
1163
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1164
|
-
const mountedComponent = mount(component);
|
|
1165
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1166
|
-
btn.simulate("click");
|
|
1167
|
-
|
|
1168
|
-
expect(update, "to have calls satisfying", [{ args: ["-5", null] }]);
|
|
1169
|
-
});
|
|
1170
|
-
|
|
1171
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, increase button set value to 5", () => {
|
|
1172
|
-
const inputProps = new InputBaseProps();
|
|
1173
|
-
const aLabel = "aLabel";
|
|
1174
|
-
const aValue = "";
|
|
1175
|
-
|
|
1176
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1177
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1178
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1179
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1180
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1181
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: 5, max: 15 });
|
|
1182
|
-
|
|
1183
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1184
|
-
const mountedComponent = mount(component);
|
|
1185
|
-
const btn = mountedComponent.find("[data-qa='increase']").hostNodes();
|
|
1186
|
-
btn.simulate("click");
|
|
1187
|
-
|
|
1188
|
-
expect(update, "to have calls satisfying", [{ args: ["5", null] }]);
|
|
1189
|
-
});
|
|
1190
|
-
|
|
1191
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, key up set value to 1", () => {
|
|
1192
|
-
const inputProps = new InputBaseProps();
|
|
1193
|
-
const aLabel = "aLabel";
|
|
1194
|
-
const aValue = "";
|
|
1195
|
-
|
|
1196
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1197
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1198
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1199
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1200
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1201
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -5, max: 15 });
|
|
1202
|
-
|
|
1203
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1204
|
-
const mountedComponent = mount(component);
|
|
1205
|
-
const input = mountedComponent.find("input");
|
|
1206
|
-
input.simulate("keydown", { key: "ArrowUp" });
|
|
1207
|
-
|
|
1208
|
-
expect(update, "to have calls satisfying", [{ args: ["1", null] }]);
|
|
1209
|
-
});
|
|
1210
|
-
|
|
1211
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, scroll up set value to 1", () => {
|
|
1212
|
-
const inputProps = new InputBaseProps();
|
|
1213
|
-
const aLabel = "aLabel";
|
|
1214
|
-
const aValue = "";
|
|
1215
|
-
|
|
1216
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1217
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1218
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1219
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1220
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1221
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -5, max: 15 });
|
|
1222
|
-
|
|
1223
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1224
|
-
const mountedComponent = mount(component);
|
|
1225
|
-
const input = mountedComponent.find("input");
|
|
1226
|
-
input.simulate("wheel", { deltaY: -100 });
|
|
1227
|
-
|
|
1228
|
-
expect(update, "to have calls satisfying", [{ args: ["1", null] }]);
|
|
1229
|
-
});
|
|
1230
|
-
|
|
1231
|
-
it("Change advanced numeric input value, empty initial value with decrease button", () => {
|
|
1232
|
-
const inputProps = new InputBaseProps();
|
|
1233
|
-
const aLabel = "aLabel";
|
|
1234
|
-
const aValue = "";
|
|
1235
|
-
|
|
1236
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1237
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1238
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1239
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1240
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1241
|
-
|
|
1242
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1243
|
-
const mountedComponent = mount(component);
|
|
1244
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1245
|
-
btn.simulate("click");
|
|
1246
|
-
|
|
1247
|
-
expect(update, "to have calls satisfying", [{ args: ["-1", null] }]);
|
|
1248
|
-
});
|
|
1249
|
-
|
|
1250
|
-
it("Change advanced numeric input value, -1 initial value with decrease button", () => {
|
|
1251
|
-
const inputProps = new InputBaseProps();
|
|
1252
|
-
const aLabel = "aLabel";
|
|
1253
|
-
const aValue = "-1";
|
|
1254
|
-
|
|
1255
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1256
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1257
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1258
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1259
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1260
|
-
|
|
1261
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1262
|
-
const mountedComponent = mount(component);
|
|
1263
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1264
|
-
btn.simulate("click");
|
|
1265
|
-
|
|
1266
|
-
expect(update, "to have calls satisfying", [{ args: ["-2", null] }]);
|
|
1267
|
-
});
|
|
1268
|
-
|
|
1269
|
-
it("Change advanced numeric input value, -10 initial value with min 11 with decrease button", () => {
|
|
1270
|
-
const inputProps = new InputBaseProps();
|
|
1271
|
-
const aLabel = "aLabel";
|
|
1272
|
-
const aValue = "-10";
|
|
1273
|
-
|
|
1274
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1275
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1276
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1277
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1278
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1279
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -11, max: 11 });
|
|
1280
|
-
|
|
1281
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1282
|
-
const mountedComponent = mount(component);
|
|
1283
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1284
|
-
btn.simulate("click");
|
|
1285
|
-
|
|
1286
|
-
expect(update, "to have calls satisfying", [{ args: ["-11", null] }]);
|
|
1287
|
-
});
|
|
1288
|
-
|
|
1289
|
-
it("Change advanced numeric input value, -11 initial value with min -11 with decrease button stays at -11", () => {
|
|
1290
|
-
const inputProps = new InputBaseProps();
|
|
1291
|
-
const aLabel = "aLabel";
|
|
1292
|
-
const aValue = "-11";
|
|
1293
|
-
|
|
1294
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1295
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1296
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1297
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1298
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1299
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -11, max: 11 });
|
|
1300
|
-
|
|
1301
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1302
|
-
const mountedComponent = mount(component);
|
|
1303
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1304
|
-
btn.simulate("click");
|
|
1305
|
-
|
|
1306
|
-
expect(update, "was not called");
|
|
1307
|
-
});
|
|
1308
|
-
|
|
1309
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, decrease button should set to 5", () => {
|
|
1310
|
-
const inputProps = new InputBaseProps();
|
|
1311
|
-
const aLabel = "aLabel";
|
|
1312
|
-
const aValue = "";
|
|
1313
|
-
|
|
1314
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1315
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1316
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1317
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1318
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1319
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: 5, max: 15 });
|
|
1320
|
-
|
|
1321
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1322
|
-
const mountedComponent = mount(component);
|
|
1323
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1324
|
-
btn.simulate("click");
|
|
1325
|
-
|
|
1326
|
-
expect(update, "to have calls satisfying", [{ args: ["5", null] }]);
|
|
1327
|
-
});
|
|
1328
|
-
|
|
1329
|
-
it("Change advanced numeric input value, empty initial value, min=-15, max=-5, decrease button set value to -5", () => {
|
|
1330
|
-
const inputProps = new InputBaseProps();
|
|
1331
|
-
const aLabel = "aLabel";
|
|
1332
|
-
const aValue = "";
|
|
1333
|
-
|
|
1334
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1335
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1336
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1337
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1338
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1339
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -15, max: -5 });
|
|
1340
|
-
|
|
1341
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1342
|
-
const mountedComponent = mount(component);
|
|
1343
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1344
|
-
btn.simulate("click");
|
|
1345
|
-
|
|
1346
|
-
expect(update, "to have calls satisfying", [{ args: ["-5", null] }]);
|
|
1347
|
-
});
|
|
1348
|
-
|
|
1349
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, decrease button set value to 5", () => {
|
|
1350
|
-
const inputProps = new InputBaseProps();
|
|
1351
|
-
const aLabel = "aLabel";
|
|
1352
|
-
const aValue = "";
|
|
1353
|
-
|
|
1354
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1355
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1356
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1357
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1358
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1359
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: 5, max: 15 });
|
|
1360
|
-
|
|
1361
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1362
|
-
const mountedComponent = mount(component);
|
|
1363
|
-
const btn = mountedComponent.find("[data-qa='decrease']").hostNodes();
|
|
1364
|
-
btn.simulate("click");
|
|
1365
|
-
|
|
1366
|
-
expect(update, "to have calls satisfying", [{ args: ["5", null] }]);
|
|
1367
|
-
});
|
|
1368
|
-
|
|
1369
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, key down set value to 1", () => {
|
|
1370
|
-
const inputProps = new InputBaseProps();
|
|
1371
|
-
const aLabel = "aLabel";
|
|
1372
|
-
const aValue = "";
|
|
1373
|
-
|
|
1374
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1375
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1376
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1377
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1378
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1379
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -5, max: 15 });
|
|
1380
|
-
|
|
1381
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1382
|
-
const mountedComponent = mount(component);
|
|
1383
|
-
const input = mountedComponent.find("input");
|
|
1384
|
-
input.simulate("keydown", { key: "ArrowDown" });
|
|
1385
|
-
|
|
1386
|
-
expect(update, "to have calls satisfying", [{ args: ["-1", null] }]);
|
|
1387
|
-
});
|
|
1388
|
-
|
|
1389
|
-
it("Change advanced numeric input value, empty initial value, min=5, max=15, scroll down set value to 1", () => {
|
|
1390
|
-
const inputProps = new InputBaseProps();
|
|
1391
|
-
const aLabel = "aLabel";
|
|
1392
|
-
const aValue = "";
|
|
1393
|
-
|
|
1394
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
1395
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
1396
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
1397
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
1398
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
1399
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -5, max: 15 });
|
|
1400
|
-
|
|
1401
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
1402
|
-
const mountedComponent = mount(component);
|
|
1403
|
-
const input = mountedComponent.find("input");
|
|
1404
|
-
input.simulate("wheel", { deltaY: 100 });
|
|
1405
|
-
|
|
1406
|
-
expect(update, "to have calls satisfying", [{ args: ["-1", null] }]);
|
|
1407
|
-
});
|
|
1408
949
|
});
|
|
@@ -104,7 +104,7 @@ export const useStyles = makeStyles(theme => ({
|
|
|
104
104
|
"&:focus-within": {
|
|
105
105
|
zIndex: 99,
|
|
106
106
|
border: `${theme.spacing(0.1)} solid ${theme.palette.focus}`,
|
|
107
|
-
boxShadow: `0 0
|
|
107
|
+
boxShadow: `0 0 ${theme.spacing(0.4)} ${theme.palette.focus}`,
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
selectRoot: {
|
|
@@ -47,7 +47,7 @@ describe("useStyles", () => {
|
|
|
47
47
|
expect
|
|
48
48
|
.it("to contain", "z-index: 99;")
|
|
49
49
|
.and("to contain", "border: 0.0625rem solid #4fa1f0;")
|
|
50
|
-
.and("to contain", "box-shadow: 0 0
|
|
50
|
+
.and("to contain", "box-shadow: 0 0 0.25rem #4fa1f0;"),
|
|
51
51
|
);
|
|
52
52
|
});
|
|
53
53
|
});
|
|
@@ -145,6 +145,8 @@ export const SelectIconButton = props => {
|
|
|
145
145
|
);
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
+
const renderMultipleValues = selected => selected?.join(", ");
|
|
149
|
+
|
|
148
150
|
const selectEmptyValue = "~~#~~";
|
|
149
151
|
|
|
150
152
|
const Select = ({ options, selectProps, children }) => {
|
|
@@ -169,6 +171,7 @@ const Select = ({ options, selectProps, children }) => {
|
|
|
169
171
|
const native = selectProps?.get(SelectProps.propNames.native);
|
|
170
172
|
const onClose = selectProps?.get(SelectProps.propNames.onClose);
|
|
171
173
|
const inputProps = selectProps?.get(SelectProps.propNames.inputProps);
|
|
174
|
+
const multiple = selectProps?.get(SelectProps.propNames.multiple);
|
|
172
175
|
const hasError = !!error;
|
|
173
176
|
|
|
174
177
|
if (sortType === sortTypeEnum.numeric) {
|
|
@@ -252,6 +255,8 @@ const Select = ({ options, selectProps, children }) => {
|
|
|
252
255
|
error={hasError}
|
|
253
256
|
native={native}
|
|
254
257
|
inputProps={inputProps}
|
|
258
|
+
multiple={multiple}
|
|
259
|
+
renderValue={multiple ? renderMultipleValues : undefined}
|
|
255
260
|
classes={{
|
|
256
261
|
icon: classes.icon,
|
|
257
262
|
root: selectProps?.getStyle(SelectProps.ruleNames.root),
|
|
@@ -275,6 +280,8 @@ const Select = ({ options, selectProps, children }) => {
|
|
|
275
280
|
error={hasError}
|
|
276
281
|
native={native}
|
|
277
282
|
inputProps={inputProps}
|
|
283
|
+
multiple={multiple}
|
|
284
|
+
renderValue={multiple ? renderMultipleValues : undefined}
|
|
278
285
|
classes={{
|
|
279
286
|
icon: classes.icon,
|
|
280
287
|
root: selectProps?.getStyle(SelectProps.ruleNames.root),
|
|
@@ -669,4 +669,49 @@ describe("Select Component", () => {
|
|
|
669
669
|
|
|
670
670
|
expect(muiSelect.prop("open"), "to be true");
|
|
671
671
|
});
|
|
672
|
+
|
|
673
|
+
it("Renders Select component with multiple values", () => {
|
|
674
|
+
const options = [
|
|
675
|
+
{ value: "aValue", label: "aLabel" },
|
|
676
|
+
{ value: "anotherValue", label: "anotherLabel" },
|
|
677
|
+
];
|
|
678
|
+
|
|
679
|
+
const selectProps = new SelectProps();
|
|
680
|
+
|
|
681
|
+
selectProps.set(SelectProps.propNames.update, update);
|
|
682
|
+
selectProps.set(SelectProps.propNames.multiple, true);
|
|
683
|
+
selectProps.set(SelectProps.propNames.value, ["aValue"]);
|
|
684
|
+
|
|
685
|
+
const component = (
|
|
686
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
687
|
+
<Select options={options} selectProps={selectProps} />
|
|
688
|
+
</TestWrapper>
|
|
689
|
+
);
|
|
690
|
+
|
|
691
|
+
const ChevronDown = props => {
|
|
692
|
+
return <Icon id="dropdown-chevron-down" {...props} />;
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
const expected = (
|
|
696
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
697
|
+
<SelectMUI
|
|
698
|
+
value={["aValue"]}
|
|
699
|
+
disableUnderline={true}
|
|
700
|
+
IconComponent={ChevronDown}
|
|
701
|
+
error={false}
|
|
702
|
+
multiple={true}
|
|
703
|
+
renderValue={selected => selected.join(", ")}
|
|
704
|
+
>
|
|
705
|
+
<MenuItem key="aValue" value="aValue">
|
|
706
|
+
<TooltippedTypography children="aLabel" titleValue="aLabel" />
|
|
707
|
+
</MenuItem>
|
|
708
|
+
<MenuItem key="anotherValue" value="anotherValue">
|
|
709
|
+
<TooltippedTypography noWrap children="anotherLabel" titleValue="anotherLabel" />
|
|
710
|
+
</MenuItem>
|
|
711
|
+
</SelectMUI>
|
|
712
|
+
</TestWrapper>
|
|
713
|
+
);
|
|
714
|
+
|
|
715
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
716
|
+
});
|
|
672
717
|
});
|
|
@@ -21,6 +21,7 @@ class SelectProps extends ComponentProps {
|
|
|
21
21
|
onClose: "onClose",
|
|
22
22
|
native: "native",
|
|
23
23
|
inputProps: "inputProps",
|
|
24
|
+
multiple: "multiple",
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
static ruleNames = {
|
|
@@ -42,6 +43,7 @@ class SelectProps extends ComponentProps {
|
|
|
42
43
|
this.componentProps.set(this.constructor.propNames.onClose, null);
|
|
43
44
|
this.componentProps.set(this.constructor.propNames.native, null);
|
|
44
45
|
this.componentProps.set(this.constructor.propNames.inputProps, null);
|
|
46
|
+
this.componentProps.set(this.constructor.propNames.multiple, null);
|
|
45
47
|
|
|
46
48
|
this.componentClasses.set(this.constructor.ruleNames.root, null);
|
|
47
49
|
this.componentClasses.set(this.constructor.ruleNames.paper, null);
|
|
@@ -15,6 +15,7 @@ describe("Select Props", () => {
|
|
|
15
15
|
"onClose",
|
|
16
16
|
"native",
|
|
17
17
|
"inputProps",
|
|
18
|
+
"multiple",
|
|
18
19
|
];
|
|
19
20
|
|
|
20
21
|
expect(SelectProps.propNames, "to have keys", propNames);
|
|
@@ -34,6 +35,7 @@ describe("Select Props", () => {
|
|
|
34
35
|
"onClose",
|
|
35
36
|
"native",
|
|
36
37
|
"inputProps",
|
|
38
|
+
"multiple",
|
|
37
39
|
];
|
|
38
40
|
|
|
39
41
|
const selectProps = new SelectProps();
|
|
@@ -39,7 +39,7 @@ export const useStyles = makeStyles(theme => ({
|
|
|
39
39
|
track: {
|
|
40
40
|
backgroundColor: theme.palette.grey.borders,
|
|
41
41
|
opacity: "1 !important",
|
|
42
|
-
borderRadius:
|
|
42
|
+
borderRadius: theme.spacing(2),
|
|
43
43
|
position: "relative",
|
|
44
44
|
"&:before, &:after": {
|
|
45
45
|
display: "inline-block",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, isValidElement, cloneElement } from "react";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
2
3
|
import { makeStyles } from "@material-ui/core/styles";
|
|
3
4
|
import Button from "@material-ui/core/Button";
|
|
4
5
|
import Menu from "@material-ui/core/Menu";
|
|
5
6
|
import MenuItem from "@material-ui/core/MenuItem";
|
|
6
|
-
import Text from "../../Text";
|
|
7
7
|
import DropDownMenuProps, { isDropDownMenuProps } from "./DropDownMenuProps";
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles(theme => ({
|
|
@@ -95,7 +95,7 @@ const DropDownMenu = ({ payload, menuItems, children, dropDownMenuProps = new Dr
|
|
|
95
95
|
onClick={onMenuItemClick(action, itemContext)}
|
|
96
96
|
disabled={disabled}
|
|
97
97
|
>
|
|
98
|
-
<
|
|
98
|
+
{typeof title === "string" ? title : <FormattedMessage {...title} />}
|
|
99
99
|
</MenuItem>
|
|
100
100
|
))}
|
|
101
101
|
</Menu>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Provider } from "react-redux";
|
|
3
2
|
import ReactDOM from "react-dom";
|
|
4
3
|
import sinon from "sinon";
|
|
5
4
|
import { mount } from "enzyme";
|
|
@@ -14,7 +13,7 @@ describe("DropDownMenu", () => {
|
|
|
14
13
|
let store, menuItems, container;
|
|
15
14
|
beforeEach(() => {
|
|
16
15
|
menuItems = [
|
|
17
|
-
{ title: "asd", action: sinon.spy().named("action"), itemContext: "aContext" },
|
|
16
|
+
{ title: { id: "asd", defaultMessage: "asd" }, action: sinon.spy().named("action"), itemContext: "aContext" },
|
|
18
17
|
{ title: "asd2", action: sinon.spy().named("action"), itemContext: "myContext" },
|
|
19
18
|
];
|
|
20
19
|
store = {
|
|
@@ -73,9 +72,9 @@ describe("DropDownMenu", () => {
|
|
|
73
72
|
const payload = "payload";
|
|
74
73
|
|
|
75
74
|
ReactDOM.render(
|
|
76
|
-
<
|
|
75
|
+
<TestWrapper provider={{ store }} intlProvider>
|
|
77
76
|
<DropDownMenu payload={payload} menuItems={menuItems} />
|
|
78
|
-
</
|
|
77
|
+
</TestWrapper>,
|
|
79
78
|
container,
|
|
80
79
|
);
|
|
81
80
|
|
|
@@ -98,9 +97,9 @@ describe("DropDownMenu", () => {
|
|
|
98
97
|
const payload = "payload";
|
|
99
98
|
|
|
100
99
|
const component = (
|
|
101
|
-
<
|
|
100
|
+
<TestWrapper provider={{ store }} intlProvider>
|
|
102
101
|
<DropDownMenu payload={payload} menuItems={menuItems} />
|
|
103
|
-
</
|
|
102
|
+
</TestWrapper>
|
|
104
103
|
);
|
|
105
104
|
|
|
106
105
|
const mountedComponent = mount(component);
|