@try-at-software/input-elements 1.2.0-alpha.34 → 1.2.0-alpha.35
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.
|
@@ -6,15 +6,18 @@ const react_1 = require("@fluentui/react");
|
|
|
6
6
|
const Utilities_1 = require("../../Utilities");
|
|
7
7
|
class DropdownInput extends React.Component {
|
|
8
8
|
render() {
|
|
9
|
-
var _a, _b, _c
|
|
9
|
+
var _a, _b, _c;
|
|
10
10
|
if (!this.props)
|
|
11
11
|
return null;
|
|
12
12
|
const normalizedOptions = Utilities_1.DropdownHelper.getNormalizedOptions(this.props.defaultOption, this.props.options);
|
|
13
13
|
return (React.createElement(React.Fragment, null,
|
|
14
|
-
!!
|
|
15
|
-
React.createElement(react_1.Dropdown, { "data-automationid": "dropdown-input", options: normalizedOptions, onChange: (_event, option) =>
|
|
14
|
+
!!this.props.label && React.createElement(react_1.Label, { required: !!this.props.renderRequiredIndicator }, this.props.label),
|
|
15
|
+
React.createElement(react_1.Dropdown, { "data-automationid": "dropdown-input", options: normalizedOptions, onChange: (_event, option) => !!this.props.onChange && this.props.onChange(option.key), errorMessage: this.props.errorMessage, placeholder: this.props.placeholder,
|
|
16
16
|
// This value should never be `undefined`.
|
|
17
|
-
defaultSelectedKey:
|
|
17
|
+
defaultSelectedKey: this.props.value || ((_a = this.props.defaultOption) === null || _a === void 0 ? void 0 : _a.key) || null, disabled: this.props.isDisabled, calloutProps: {
|
|
18
|
+
directionalHintFixed: (_b = this.props.renderProps) === null || _b === void 0 ? void 0 : _b.allowPositionChanges,
|
|
19
|
+
minPagePadding: (_c = this.props.renderProps) === null || _c === void 0 ? void 0 : _c.pagePadding
|
|
20
|
+
} })));
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
exports.DropdownInput = DropdownInput;
|
|
@@ -6,4 +6,9 @@ export interface IDropdownInputProps extends IBaseInputElementDynamicProps {
|
|
|
6
6
|
* The default option for the dropdown.
|
|
7
7
|
*/
|
|
8
8
|
defaultOption?: IDropdownInputOption;
|
|
9
|
+
renderProps: IDropdownInputRenderingProps;
|
|
10
|
+
}
|
|
11
|
+
export interface IDropdownInputRenderingProps {
|
|
12
|
+
pagePadding?: number;
|
|
13
|
+
allowPositionChanges?: boolean;
|
|
9
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@try-at-software/input-elements",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.35",
|
|
4
4
|
"description": "A package providing different input elements that are extensible and easily configurable for your custom needs.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|