@synerise/ds-autocomplete 0.4.50 → 0.5.0
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 +17 -0
- package/dist/Autocomplete.d.ts +6 -3
- package/dist/Autocomplete.js +11 -20
- package/dist/Autocomplete.types.d.ts +6 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.5.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.4.50...@synerise/ds-autocomplete@0.5.0) (2023-09-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **input:** deps missing in autocomplete + input exports ([4a1439b](https://github.com/Synerise/synerise-design/commit/4a1439b70856f24b1c4500c97956c7ff8b97468a))
|
|
12
|
+
* **input:** fixed autosize imports/exports ([4fbebfa](https://github.com/Synerise/synerise-design/commit/4fbebfa9b5c13dc92b81cf1e6ee3639f54d3145b))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **input:** autosize input, filter ([c507a67](https://github.com/Synerise/synerise-design/commit/c507a672b2705da82e8bebe589495caf5d509e71))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [0.4.50](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.4.49...@synerise/ds-autocomplete@0.4.50) (2023-09-08)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @synerise/ds-autocomplete
|
package/dist/Autocomplete.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import '@synerise/ds-core/dist/js/style';
|
|
3
3
|
import './style/index.less';
|
|
4
|
-
import { AutocompleteProps
|
|
5
|
-
declare const Autocomplete:
|
|
4
|
+
import { AutocompleteProps } from './Autocomplete.types';
|
|
5
|
+
declare const Autocomplete: {
|
|
6
|
+
(props: AutocompleteProps): JSX.Element;
|
|
7
|
+
Option: import("rc-select/lib/Option").OptionFC;
|
|
8
|
+
};
|
|
6
9
|
export default Autocomplete;
|
package/dist/Autocomplete.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
var _excluded = ["className", "label", "description", "errorText", "disabled", "error", "handleInputRef", "autoResize"];
|
|
2
|
-
|
|
3
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); }
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import * as React from 'react';
|
|
3
|
+
import React, { useRef, useEffect } from 'react';
|
|
8
4
|
import '@synerise/ds-core/dist/js/style';
|
|
9
5
|
import "./style/index.css";
|
|
10
6
|
import AntdAutoComplete from 'antd/lib/auto-complete';
|
|
11
7
|
import { ErrorText, Description, Label } from '@synerise/ds-typography';
|
|
12
|
-
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import { AutoResize, WrapperAutoResize } from '@synerise/ds-input';
|
|
8
|
+
import { AutosizeInput } from '@synerise/ds-input';
|
|
15
9
|
import * as S from './Autocomplete.styles';
|
|
16
10
|
|
|
17
11
|
var Autocomplete = function Autocomplete(props) {
|
|
@@ -22,11 +16,9 @@ var Autocomplete = function Autocomplete(props) {
|
|
|
22
16
|
disabled = props.disabled,
|
|
23
17
|
error = props.error,
|
|
24
18
|
handleInputRef = props.handleInputRef,
|
|
25
|
-
autoResize = props.autoResize
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var inputRef = React.useRef(undefined);
|
|
29
|
-
React.useEffect(function () {
|
|
19
|
+
autoResize = props.autoResize;
|
|
20
|
+
var inputRef = useRef(undefined);
|
|
21
|
+
useEffect(function () {
|
|
30
22
|
handleInputRef && handleInputRef(inputRef);
|
|
31
23
|
}, [inputRef, handleInputRef]);
|
|
32
24
|
|
|
@@ -35,8 +27,11 @@ var Autocomplete = function Autocomplete(props) {
|
|
|
35
27
|
};
|
|
36
28
|
|
|
37
29
|
var renderAutoCompleteComponent = function renderAutoCompleteComponent() {
|
|
38
|
-
|
|
39
|
-
, _extends({},
|
|
30
|
+
var Component = autoResize ? AutosizeInput : AntdAutoComplete;
|
|
31
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, autoResize ? {
|
|
32
|
+
renderInput: AntdAutoComplete,
|
|
33
|
+
autoResize: autoResize
|
|
34
|
+
} : {}, props, {
|
|
40
35
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
41
36
|
// @ts-ignore
|
|
42
37
|
ref: inputRef,
|
|
@@ -49,11 +44,7 @@ var Autocomplete = function Autocomplete(props) {
|
|
|
49
44
|
return /*#__PURE__*/React.createElement(S.AutocompleteWrapper, {
|
|
50
45
|
autoResize: autoResize,
|
|
51
46
|
className: "ds-autocomplete " + (className || '')
|
|
52
|
-
}, label && /*#__PURE__*/React.createElement(S.LabelWrapper, null, /*#__PURE__*/React.createElement(Label, null, label)),
|
|
53
|
-
autoResize: autoResize
|
|
54
|
-
}, renderAutoCompleteComponent(), /*#__PURE__*/React.createElement(AutoResize, {
|
|
55
|
-
autoResize: autoResize
|
|
56
|
-
}, antdAutocompleteProps.value)) : renderAutoCompleteComponent(), 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, {
|
|
47
|
+
}, label && /*#__PURE__*/React.createElement(S.LabelWrapper, null, /*#__PURE__*/React.createElement(Label, null, label)), renderAutoCompleteComponent(), 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, {
|
|
57
48
|
disabled: disabled
|
|
58
49
|
}, description)));
|
|
59
50
|
};
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ReactNode, MutableRefObject } from 'react';
|
|
2
|
+
import { AutoCompleteProps as OriginalProps } from 'antd/lib/auto-complete';
|
|
3
3
|
import Select from 'antd/lib/select';
|
|
4
4
|
export declare type OverrideProps = {
|
|
5
5
|
className?: string;
|
|
6
|
-
errorText?:
|
|
7
|
-
label?:
|
|
8
|
-
description?:
|
|
6
|
+
errorText?: ReactNode | string;
|
|
7
|
+
label?: ReactNode | string;
|
|
8
|
+
description?: ReactNode | string;
|
|
9
9
|
error?: boolean;
|
|
10
|
-
handleInputRef?: (ref:
|
|
10
|
+
handleInputRef?: (ref: MutableRefObject<Select | undefined>) => void;
|
|
11
11
|
autoResize?: boolean | {
|
|
12
12
|
minWidth: string;
|
|
13
13
|
maxWidth: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export interface StaticComponents {
|
|
17
|
-
Option: typeof AntdAutoComplete.Option;
|
|
18
|
-
}
|
|
19
16
|
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.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Autocomplete UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-input": "^0.
|
|
35
|
+
"@synerise/ds-input": "^0.19.0",
|
|
36
36
|
"@synerise/ds-typography": "^0.12.10"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@testing-library/jest-dom": "5.1.1",
|
|
47
47
|
"@testing-library/react": "10.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ef59143e0ab93cee5b9a738fa1fa9c60748ddffc"
|
|
50
50
|
}
|