@synerise/ds-autocomplete 0.4.10 → 0.4.11
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/CHANGELOG.md +8 -0
- package/dist/Autocomplete.d.ts +2 -5
- package/dist/Autocomplete.js +27 -37
- package/dist/Autocomplete.types.d.ts +6 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.4.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.4.10...@synerise/ds-autocomplete@0.4.11) (2022-06-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-autocomplete
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.4.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.4.9...@synerise/ds-autocomplete@0.4.10) (2022-04-29)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-autocomplete
|
package/dist/Autocomplete.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import '@synerise/ds-core/dist/js/style';
|
|
3
3
|
import './style/index.less';
|
|
4
|
-
import { AutocompleteProps } from 'Autocomplete.types';
|
|
5
|
-
declare
|
|
6
|
-
static Option: import("rc-select/lib/Option").OptionFC;
|
|
7
|
-
render(): React.ReactElement;
|
|
8
|
-
}
|
|
4
|
+
import { AutocompleteProps, StaticComponents } from 'Autocomplete.types';
|
|
5
|
+
declare const Autocomplete: React.FC<AutocompleteProps> & StaticComponents;
|
|
9
6
|
export default Autocomplete;
|
package/dist/Autocomplete.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
3
|
import * as React from 'react';
|
|
8
4
|
import '@synerise/ds-core/dist/js/style';
|
|
9
5
|
import "./style/index.css";
|
|
@@ -11,37 +7,31 @@ import AntdAutoComplete from 'antd/lib/auto-complete';
|
|
|
11
7
|
import { ErrorText, Description, Label } from '@synerise/ds-typography';
|
|
12
8
|
import * as S from './Autocomplete.styles';
|
|
13
9
|
|
|
14
|
-
var Autocomplete =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return Autocomplete;
|
|
43
|
-
}(React.PureComponent);
|
|
44
|
-
|
|
45
|
-
_defineProperty(Autocomplete, "Option", AntdAutoComplete.Option);
|
|
46
|
-
|
|
10
|
+
var Autocomplete = function Autocomplete(props) {
|
|
11
|
+
var className = props.className,
|
|
12
|
+
label = props.label,
|
|
13
|
+
description = props.description,
|
|
14
|
+
errorText = props.errorText,
|
|
15
|
+
disabled = props.disabled,
|
|
16
|
+
error = props.error,
|
|
17
|
+
handleInputRef = props.handleInputRef;
|
|
18
|
+
var inputRef = React.useRef(undefined);
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
handleInputRef && handleInputRef(inputRef);
|
|
21
|
+
}, [inputRef, handleInputRef]);
|
|
22
|
+
return /*#__PURE__*/React.createElement(S.AutocompleteWrapper, {
|
|
23
|
+
className: "ds-autocomplete " + (className || '')
|
|
24
|
+
}, label && /*#__PURE__*/React.createElement(S.LabelWrapper, null, /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(AntdAutoComplete // eslint-disable-next-line react/jsx-props-no-spreading
|
|
25
|
+
, _extends({}, props, {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
ref: inputRef,
|
|
29
|
+
dropdownClassName: "ds-autocomplete-dropdown",
|
|
30
|
+
className: !!errorText || error ? 'error' : undefined
|
|
31
|
+
})), errorText && /*#__PURE__*/React.createElement(S.ErrorWrapper, null, /*#__PURE__*/React.createElement(ErrorText, null, errorText)), description && /*#__PURE__*/React.createElement(S.DescWrapper, null, description && /*#__PURE__*/React.createElement(Description, {
|
|
32
|
+
disabled: disabled
|
|
33
|
+
}, description)));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Autocomplete.Option = AntdAutoComplete.Option;
|
|
47
37
|
export default Autocomplete;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AutoCompleteProps as OriginalProps } from 'antd/lib/auto-complete';
|
|
2
|
+
import AntdAutoComplete, { AutoCompleteProps as OriginalProps } from 'antd/lib/auto-complete';
|
|
3
|
+
import Select from 'antd/lib/select';
|
|
3
4
|
export declare type OverrideProps = {
|
|
4
5
|
className?: string;
|
|
5
6
|
errorText?: React.ReactNode | string;
|
|
6
7
|
label?: React.ReactNode | string;
|
|
7
8
|
description?: React.ReactNode | string;
|
|
8
9
|
error?: boolean;
|
|
10
|
+
handleInputRef?: (ref: React.MutableRefObject<Select | undefined>) => void;
|
|
9
11
|
};
|
|
12
|
+
export interface StaticComponents {
|
|
13
|
+
Option: typeof AntdAutoComplete.Option;
|
|
14
|
+
}
|
|
10
15
|
export declare type AutocompleteProps = OverrideProps & OriginalProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-autocomplete",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "Autocomplete UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@synerise/ds-utils": "^0.21.10"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "116cf109200639a805ef51ce8301e47dc7a8b168"
|
|
45
45
|
}
|