@synerise/ds-autocomplete 1.2.33 → 1.2.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.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -2
- package/dist/Autocomplete.const.js +8 -3
- package/dist/Autocomplete.d.ts +3 -4
- package/dist/Autocomplete.js +68 -97
- package/dist/Autocomplete.styles.d.ts +4 -4
- package/dist/Autocomplete.styles.js +29 -48
- package/dist/Autocomplete.types.d.ts +5 -5
- package/dist/Autocomplete.types.js +1 -1
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils/getIconsWidth.js +6 -3
- package/package.json +10 -10
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
|
+
## [1.2.35](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@1.2.34...@synerise/ds-autocomplete@1.2.35) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-autocomplete
|
|
9
|
+
|
|
10
|
+
## [1.2.34](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@1.2.33...@synerise/ds-autocomplete@1.2.34) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-autocomplete
|
|
13
|
+
|
|
6
14
|
## [1.2.33](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@1.2.32...@synerise/ds-autocomplete@1.2.33) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-autocomplete
|
package/README.md
CHANGED
|
@@ -32,7 +32,6 @@ import Autocomplete from '@synerise/ds-autocomplete'
|
|
|
32
32
|
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
33
33
|
| allowClear | Show clear button, effective in multiple mode only. | boolean | `false` |
|
|
34
34
|
| autoFocus | get focus when component mounted | boolean | `false` |
|
|
35
|
-
| backfill | backfill selected item the input when using keyboard | boolean | `false` |
|
|
36
35
|
| children (for customize input element) | customize input element | `HTMLInputElement HTMLTextAreaElement React.ReactElement<InputProps>` | <Input /> |
|
|
37
36
|
| children (for dataSource) | Data source to auto complete | `React.ReactElement<OptionProps> Array<React.ReactElement<OptionProps>>` | - |
|
|
38
37
|
| dataSource | Data source for autocomplete | DataSourceItemType[] | - |
|
|
@@ -40,7 +39,7 @@ import Autocomplete from '@synerise/ds-autocomplete'
|
|
|
40
39
|
| defaultActiveFirstOption | Whether active first option by default | boolean | `true` |
|
|
41
40
|
| defaultValue | Initial selected option. | string or string[] | - |
|
|
42
41
|
| disabled | Whether disabled select | boolean | - |
|
|
43
|
-
|
|
|
42
|
+
| readOnly | Whether disabled select with readonly styles applied | boolean | - |
|
|
44
43
|
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | `true` |
|
|
45
44
|
| icon1 | Renders an icon at the right end of the input | ReactNode | `-` |
|
|
46
45
|
| icon2 | Renders an icon at the right end of the input | ReactNode | `-` |
|
package/dist/Autocomplete.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import AntdAutoComplete from 'antd/lib/auto-complete';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import './style/index.less';
|
|
1
|
+
import { default as AntdAutoComplete } from 'antd/lib/auto-complete';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AutocompleteProps } from './Autocomplete.types';
|
|
5
4
|
declare const Autocomplete: FC<AutocompleteProps> & {
|
|
6
5
|
Option: typeof AntdAutoComplete.Option;
|
|
7
6
|
};
|
package/dist/Autocomplete.js
CHANGED
|
@@ -1,121 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import * as S from './Autocomplete.styles';
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import AntdAutoComplete from "antd/lib/auto-complete";
|
|
3
|
+
import { useRef, useEffect, useCallback, useMemo } from "react";
|
|
4
|
+
import FormField from "@synerise/ds-form-field";
|
|
5
|
+
import { AutosizeWrapper } from "@synerise/ds-input";
|
|
6
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
7
|
+
import { useResizeObserver } from "@synerise/ds-utils";
|
|
8
|
+
import { IconWrapper, AutocompleteWrapper, ComponentWrapper } from "./Autocomplete.styles.js";
|
|
9
|
+
import { getIconsWidth } from "./utils/getIconsWidth.js";
|
|
11
10
|
import "./style/index.css";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
useEffect(
|
|
11
|
+
const AUTOSIZE_EXTRA_WIDTH = 27;
|
|
12
|
+
const Autocomplete = ({
|
|
13
|
+
className,
|
|
14
|
+
label,
|
|
15
|
+
description,
|
|
16
|
+
errorText,
|
|
17
|
+
disabled,
|
|
18
|
+
error,
|
|
19
|
+
handleInputRef,
|
|
20
|
+
getPopupContainer,
|
|
21
|
+
autoResize,
|
|
22
|
+
readOnly,
|
|
23
|
+
tooltip,
|
|
24
|
+
tooltipConfig,
|
|
25
|
+
icon1,
|
|
26
|
+
icon1Tooltip,
|
|
27
|
+
icon2,
|
|
28
|
+
icon2Tooltip,
|
|
29
|
+
...rest
|
|
30
|
+
}) => {
|
|
31
|
+
const scrollLeftRef = useRef(0);
|
|
32
|
+
const antSelectRef = useRef(null);
|
|
33
|
+
const inputRef = useRef(null);
|
|
34
|
+
const autosizeRef = useRef(null);
|
|
35
|
+
const autocompleteInputRef = useRef(null);
|
|
36
|
+
const elementRef = useRef(null);
|
|
37
|
+
useEffect(() => {
|
|
39
38
|
handleInputRef && handleInputRef(antSelectRef);
|
|
40
39
|
}, [antSelectRef, handleInputRef]);
|
|
41
|
-
useEffect(
|
|
40
|
+
useEffect(() => {
|
|
42
41
|
if (autosizeRef.current) {
|
|
43
42
|
autocompleteInputRef.current = autosizeRef.current.inputWrapperRef.current;
|
|
44
43
|
inputRef.current = autosizeRef.current.inputRef.current;
|
|
45
44
|
}
|
|
46
45
|
}, []);
|
|
47
|
-
|
|
46
|
+
const getParentNode = (triggerNode) => {
|
|
48
47
|
return triggerNode.parentNode;
|
|
49
48
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
autocompleteInputRef.current && autocompleteInputRef.current.style.removeProperty('max-width');
|
|
49
|
+
const stretchToFit = autoResize && autoResize !== true && Boolean(autoResize.stretchToFit);
|
|
50
|
+
const placeholderString = typeof rest.placeholder === "string" ? rest.placeholder : void 0;
|
|
51
|
+
const handlePreAutosize = useCallback(() => {
|
|
52
|
+
scrollLeftRef.current = inputRef.current?.scrollLeft || 0;
|
|
53
|
+
autocompleteInputRef.current && autocompleteInputRef.current.style.removeProperty("max-width");
|
|
56
54
|
}, []);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (stretchToFit && autocompleteInputRef.current && parentRect
|
|
60
|
-
autocompleteInputRef.current.style.maxWidth =
|
|
55
|
+
const handleAutosize = useCallback(() => {
|
|
56
|
+
const parentRect = elementRef.current && elementRef.current.getBoundingClientRect();
|
|
57
|
+
if (stretchToFit && autocompleteInputRef.current && parentRect?.width) {
|
|
58
|
+
autocompleteInputRef.current.style.maxWidth = `${parentRect?.width + 1}px`;
|
|
61
59
|
inputRef.current && inputRef.current.scrollTo(scrollLeftRef.current, 0);
|
|
62
60
|
}
|
|
63
61
|
}, [stretchToFit]);
|
|
64
|
-
|
|
62
|
+
const handleWrapperResize = useCallback(() => {
|
|
65
63
|
handlePreAutosize();
|
|
66
64
|
handleAutosize();
|
|
67
65
|
}, [handleAutosize, handlePreAutosize]);
|
|
68
|
-
|
|
66
|
+
const transformRef = useCallback((element) => {
|
|
69
67
|
autocompleteInputRef.current = element;
|
|
70
|
-
return element.querySelector(
|
|
68
|
+
return element.querySelector("input");
|
|
71
69
|
}, []);
|
|
72
70
|
useResizeObserver(elementRef, handleWrapperResize);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(_antSelectRef$current = antSelectRef.current) == null || _antSelectRef$current.focus();
|
|
71
|
+
const iconCount = +!!icon1 + +!!icon2;
|
|
72
|
+
const handleIconsClick = useCallback(() => {
|
|
73
|
+
antSelectRef.current?.focus();
|
|
77
74
|
}, []);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onClick: handleIconsClick
|
|
87
|
-
}, icon1WithTooltip, " ", icon2WithTooltip));
|
|
75
|
+
const icons = useMemo(() => {
|
|
76
|
+
const icon1WithTooltip = icon1Tooltip ? /* @__PURE__ */ jsx(Tooltip, { title: icon1Tooltip, children: icon1 }) : icon1;
|
|
77
|
+
const icon2WithTooltip = icon2Tooltip ? /* @__PURE__ */ jsx(Tooltip, { title: icon2Tooltip, children: icon2 }) : icon2;
|
|
78
|
+
return /* @__PURE__ */ jsx(Fragment, { children: (icon1WithTooltip || icon2WithTooltip) && /* @__PURE__ */ jsxs(IconWrapper, { onClick: handleIconsClick, children: [
|
|
79
|
+
icon1WithTooltip,
|
|
80
|
+
" ",
|
|
81
|
+
icon2WithTooltip
|
|
82
|
+
] }) });
|
|
88
83
|
}, [handleIconsClick, icon1, icon2, icon1Tooltip, icon2Tooltip]);
|
|
89
|
-
return
|
|
90
|
-
ref:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}, /*#__PURE__*/React.createElement(FormField, {
|
|
94
|
-
label: label,
|
|
95
|
-
tooltip: tooltip,
|
|
96
|
-
tooltipConfig: tooltipConfig,
|
|
97
|
-
description: description,
|
|
98
|
-
errorText: errorText
|
|
99
|
-
}, /*#__PURE__*/React.createElement(S.ComponentWrapper, {
|
|
100
|
-
readOnly: readOnly,
|
|
101
|
-
error: !!errorText || error,
|
|
102
|
-
iconCount: iconCount
|
|
103
|
-
}, /*#__PURE__*/React.createElement(AutosizeWrapper, {
|
|
104
|
-
autoResize: !!autoResize,
|
|
105
|
-
value: rest.value,
|
|
106
|
-
placeholder: placeholderString,
|
|
107
|
-
transformRef: transformRef,
|
|
108
|
-
ref: autosizeRef,
|
|
109
|
-
extraWidth: AUTOSIZE_EXTRA_WIDTH + getIconsWidth(iconCount),
|
|
110
|
-
preAutosize: handlePreAutosize,
|
|
111
|
-
onAutosize: handleAutosize
|
|
112
|
-
}, /*#__PURE__*/React.createElement(AntdAutoComplete, _extends({}, rest, {
|
|
113
|
-
disabled: readOnly || disabled,
|
|
114
|
-
dropdownClassName: "ds-autocomplete-dropdown ps__child--consume",
|
|
115
|
-
getPopupContainer: getPopupContainer || getParentNode,
|
|
116
|
-
ref: antSelectRef,
|
|
117
|
-
"data-testid": "autocomplete-autosize-input"
|
|
118
|
-
})), icons))));
|
|
84
|
+
return /* @__PURE__ */ jsx(AutocompleteWrapper, { ref: elementRef, autoResize, className: `ds-autocomplete ${className || ""}`, children: /* @__PURE__ */ jsx(FormField, { label, tooltip, tooltipConfig, description, errorText, children: /* @__PURE__ */ jsx(ComponentWrapper, { readOnly, error: !!errorText || error, iconCount, children: /* @__PURE__ */ jsxs(AutosizeWrapper, { autoResize: !!autoResize, value: rest.value, placeholder: placeholderString, transformRef, ref: autosizeRef, extraWidth: AUTOSIZE_EXTRA_WIDTH + getIconsWidth(iconCount), preAutosize: handlePreAutosize, onAutosize: handleAutosize, children: [
|
|
85
|
+
/* @__PURE__ */ jsx(AntdAutoComplete, { ...rest, disabled: readOnly || disabled, dropdownClassName: "ds-autocomplete-dropdown ps__child--consume", getPopupContainer: getPopupContainer || getParentNode, ref: antSelectRef, "data-testid": "autocomplete-autosize-input" }),
|
|
86
|
+
icons
|
|
87
|
+
] }) }) }) });
|
|
119
88
|
};
|
|
120
89
|
Autocomplete.Option = AntdAutoComplete.Option;
|
|
121
|
-
export
|
|
90
|
+
export {
|
|
91
|
+
Autocomplete as default
|
|
92
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const AutocompleteWrapper: import(
|
|
1
|
+
import { AutoResizeProp } from '@synerise/ds-input';
|
|
2
|
+
export declare const AutocompleteWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
3
3
|
autoResize?: AutoResizeProp;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const IconWrapper: import(
|
|
6
|
-
export declare const ComponentWrapper: import(
|
|
5
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const ComponentWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
7
7
|
error?: boolean;
|
|
8
8
|
readOnly?: boolean;
|
|
9
9
|
iconCount?: number;
|
|
@@ -1,57 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, function (props) {
|
|
10
|
-
return props.theme.palette['blue-600'];
|
|
11
|
-
}, function (props) {
|
|
12
|
-
return props.theme.palette['blue-050'];
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var error = function error() {
|
|
16
|
-
return css(["transition:ease-in-out all 0.2s,width 0s,min-width 0s,max-width 0s;box-shadow:inset 0 0 0 1px ", ";background:", ";border:1px solid ", ";"], function (props) {
|
|
17
|
-
return props.theme.palette['red-600'];
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.theme.palette['red-050'];
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return props.theme.palette['red-600'];
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var readonly = function readonly() {
|
|
25
|
-
return css(["background-color:", ";color:", ";input{cursor:auto;}"], function (props) {
|
|
26
|
-
return props.theme.palette.white;
|
|
27
|
-
}, function (props) {
|
|
28
|
-
return props.theme.palette['grey-700'];
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
export var AutocompleteWrapper = styled.div.withConfig({
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { autoresizeConfObjToCss } from "@synerise/ds-input/dist/Input.styles";
|
|
3
|
+
import { ICON_OFFSET, ICON_GAP } from "./Autocomplete.const.js";
|
|
4
|
+
import { getIconsWidth } from "./utils/getIconsWidth.js";
|
|
5
|
+
const active = () => css(["transition:ease-in-out all 0.2s,width 0s,min-width 0s,max-width 0s;box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";background-color:", ";"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-050"]);
|
|
6
|
+
const error = () => css(["transition:ease-in-out all 0.2s,width 0s,min-width 0s,max-width 0s;box-shadow:inset 0 0 0 1px ", ";background:", ";border:1px solid ", ";"], (props) => props.theme.palette["red-600"], (props) => props.theme.palette["red-050"], (props) => props.theme.palette["red-600"]);
|
|
7
|
+
const readonly = () => css(["background-color:", ";color:", ";input{cursor:auto;}"], (props) => props.theme.palette.white, (props) => props.theme.palette["grey-700"]);
|
|
8
|
+
const AutocompleteWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
32
9
|
displayName: "Autocompletestyles__AutocompleteWrapper",
|
|
33
10
|
componentId: "sc-10de6ms-0"
|
|
34
|
-
})(["input{font-feature-settings:'tnum';}.ant-select-auto-complete{width:", ";", ";grid-area:1 / 1;}.ant-select > span{position:absolute;left:0;top:0;}.ant-select-dropdown{.ant-select-selection__rendered{margin:0;}.ant-select-selection:hover .ant-select-selection__rendered{margin-right:10px;}.ant-select-selection__clear{font-size:15px;color:", ";width:16px;height:16px;margin-top:-7px;}&.ant-select:not(.ant-select-no-arrow) .ant-select-selection__clear{right:12px;&:hover{color:", ";}}.ant-select-dropdown-menu-item{font-weight:normal;strong{font-weight:500;}}}.ant-select-selection-search-input{padding:0;padding-right:10px;}"],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}));
|
|
40
|
-
}, function (props) {
|
|
41
|
-
return props.theme.palette['grey-600'];
|
|
42
|
-
}, function (props) {
|
|
43
|
-
return props.theme.palette['grey-700'];
|
|
44
|
-
});
|
|
45
|
-
export var IconWrapper = styled.div.withConfig({
|
|
11
|
+
})(["input{font-feature-settings:'tnum';}.ant-select-auto-complete{width:", ";", ";grid-area:1 / 1;}.ant-select > span{position:absolute;left:0;top:0;}.ant-select-dropdown{.ant-select-selection__rendered{margin:0;}.ant-select-selection:hover .ant-select-selection__rendered{margin-right:10px;}.ant-select-selection__clear{font-size:15px;color:", ";width:16px;height:16px;margin-top:-7px;}&.ant-select:not(.ant-select-no-arrow) .ant-select-selection__clear{right:12px;&:hover{color:", ";}}.ant-select-dropdown-menu-item{font-weight:normal;strong{font-weight:500;}}}.ant-select-selection-search-input{padding:0;padding-right:10px;}"], (props) => props.autoResize ? "100%" : "200px", (props) => autoresizeConfObjToCss({
|
|
12
|
+
...props,
|
|
13
|
+
boxSizing: "border-box"
|
|
14
|
+
}), (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-700"]);
|
|
15
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
46
16
|
displayName: "Autocompletestyles__IconWrapper",
|
|
47
17
|
componentId: "sc-10de6ms-1"
|
|
48
18
|
})(["position:absolute;right:", "px;top:0;display:flex;bottom:0;align-items:center;gap:", "px;z-index:5;"], ICON_OFFSET, ICON_GAP);
|
|
49
|
-
|
|
19
|
+
const ComponentWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
50
20
|
displayName: "Autocompletestyles__ComponentWrapper",
|
|
51
21
|
componentId: "sc-10de6ms-2"
|
|
52
|
-
})(["&&&{", ";.ant-select-auto-complete{", "}}}"],
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
})(["&&&{", ";.ant-select-auto-complete{", "}}}"], (props) => props.iconCount && `
|
|
23
|
+
position: relative;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
& {
|
|
26
|
+
.ant-select .ant-select-selector .ant-select-selection-search {
|
|
27
|
+
right: ${getIconsWidth(props.iconCount)}px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`, (props) => {
|
|
55
31
|
if (props.readOnly) {
|
|
56
32
|
return css([".ant-select-selector{&:hover{", "}", "}"], readonly(), readonly());
|
|
57
33
|
}
|
|
@@ -59,4 +35,9 @@ export var ComponentWrapper = styled.div.withConfig({
|
|
|
59
35
|
return css([".ant-select-selector{&:hover{", "}", "}"], error(), error());
|
|
60
36
|
}
|
|
61
37
|
return css(["&.ant-select{.ant-select-selector{padding:0 10px;}.ant-input{transition:ease-in-out all 0.3s,width 0s,min-width 0s,max-width 0s;&:focus{", " &:hover{", "}}}}"], active(), active());
|
|
62
|
-
});
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
AutocompleteWrapper,
|
|
41
|
+
ComponentWrapper,
|
|
42
|
+
IconWrapper
|
|
43
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { AutoCompleteProps as OriginalProps } from 'antd/lib/auto-complete';
|
|
2
|
+
import { RefSelectProps } from 'antd/lib/select';
|
|
3
|
+
import { MutableRefObject, ReactNode } from 'react';
|
|
4
|
+
import { FormFieldCommonProps } from '@synerise/ds-form-field';
|
|
5
|
+
import { AutoResizeProp } from '@synerise/ds-input';
|
|
6
6
|
export type OverrideProps = FormFieldCommonProps & {
|
|
7
7
|
className?: string;
|
|
8
8
|
icon1?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ICON_OFFSET, ICON_WIDTH, ICON_GAP } from "../Autocomplete.const.js";
|
|
2
|
+
const getIconsWidth = (iconCount) => {
|
|
3
3
|
return iconCount > 0 ? ICON_OFFSET + iconCount * ICON_WIDTH + (iconCount - 1) * ICON_GAP : 0;
|
|
4
|
-
};
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
getIconsWidth
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-autocomplete",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.35",
|
|
4
4
|
"description": "Autocomplete UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
26
|
-
"test": "vitest",
|
|
27
|
-
"test:watch": "
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
28
|
"types": "tsc --noEmit",
|
|
29
29
|
"check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
|
|
30
30
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-form-field": "^1.3.
|
|
39
|
-
"@synerise/ds-input": "^1.6.
|
|
40
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
41
|
-
"@synerise/ds-utils": "^1.
|
|
38
|
+
"@synerise/ds-form-field": "^1.3.10",
|
|
39
|
+
"@synerise/ds-input": "^1.6.10",
|
|
40
|
+
"@synerise/ds-tooltip": "^1.4.10",
|
|
41
|
+
"@synerise/ds-utils": "^1.7.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@synerise/ds-core": "*",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"styled-components": "^5.3.3",
|
|
48
48
|
"vitest": "4"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
51
51
|
}
|