@try-at-software/input-elements 1.2.0-alpha.37 → 1.2.0-alpha.38

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.
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { IBaseInputElementProps } from '../IBaseInputElementProps';
3
3
  import { IDropdownInputProps } from './IDropdownInputProps';
4
4
  import { ISingleValueInputElementProps } from '../ISingleValueInputElementProps';
5
- export declare class DropdownInput extends React.Component<ISingleValueInputElementProps<string> & IBaseInputElementProps & IDropdownInputProps> {
5
+ import { IFluentUiDropdownInputProps } from './IFluentUiDropdownInputProps';
6
+ export declare class DropdownInput extends React.Component<ISingleValueInputElementProps<string> & IBaseInputElementProps & IDropdownInputProps & IFluentUiDropdownInputProps> {
6
7
  render(): JSX.Element;
7
8
  }
@@ -6,18 +6,16 @@ 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;
10
10
  if (!this.props)
11
11
  return null;
12
12
  const normalizedOptions = Utilities_1.DropdownHelper.getNormalizedOptions(this.props.defaultOption, this.props.options);
13
+ const DropdownComponent = (_a = this.props.dropdownComponent) !== null && _a !== void 0 ? _a : react_1.Dropdown;
13
14
  return (React.createElement(React.Fragment, null,
14
15
  !!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
+ React.createElement(DropdownComponent, { "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
17
  // This value should never be `undefined`.
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
+ defaultSelectedKey: this.props.value || ((_b = this.props.defaultOption) === null || _b === void 0 ? void 0 : _b.key) || null, disabled: this.props.isDisabled })));
21
19
  }
22
20
  }
23
21
  exports.DropdownInput = DropdownInput;
@@ -6,9 +6,4 @@ 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;
14
9
  }
@@ -0,0 +1,5 @@
1
+ import { IDropdownProps } from '@fluentui/react';
2
+ import * as React from 'react';
3
+ export interface IFluentUiDropdownInputProps {
4
+ dropdownComponent?: React.ComponentType<IDropdownProps>;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,4 +2,5 @@ export * from './DropdownInput';
2
2
  export * from './DropdownInputElement';
3
3
  export * from './IDropdownInputOption';
4
4
  export * from './IDropdownInputProps';
5
+ export * from './IFluentUiDropdownInputProps';
5
6
  export * from './MultiValueDropdownInput';
@@ -14,4 +14,5 @@ __exportStar(require("./DropdownInput"), exports);
14
14
  __exportStar(require("./DropdownInputElement"), exports);
15
15
  __exportStar(require("./IDropdownInputOption"), exports);
16
16
  __exportStar(require("./IDropdownInputProps"), exports);
17
+ __exportStar(require("./IFluentUiDropdownInputProps"), exports);
17
18
  __exportStar(require("./MultiValueDropdownInput"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@try-at-software/input-elements",
3
- "version": "1.2.0-alpha.37",
3
+ "version": "1.2.0-alpha.38",
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",