@synerise/ds-autocomplete 0.8.27 → 0.8.29

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 CHANGED
@@ -3,6 +3,22 @@
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.8.29](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.8.28...@synerise/ds-autocomplete@0.8.29) (2024-11-28)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-autocomplete
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.8.28](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.8.27...@synerise/ds-autocomplete@0.8.28) (2024-11-21)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-autocomplete
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.8.27](https://github.com/Synerise/synerise-design/compare/@synerise/ds-autocomplete@0.8.26...@synerise/ds-autocomplete@0.8.27) (2024-11-12)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-autocomplete
@@ -1,9 +1,6 @@
1
1
  var _excluded = ["className", "label", "description", "errorText", "disabled", "error", "handleInputRef", "getPopupContainer", "autoResize", "readOnly"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
5
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
4
  import React, { useRef, useEffect } from 'react';
8
5
  import '@synerise/ds-core/dist/js/style';
9
6
  import "./style/index.css";
@@ -13,20 +10,18 @@ import { AutosizeWrapper } from '@synerise/ds-input';
13
10
  import { useResizeObserver } from '@synerise/ds-utils';
14
11
  import * as S from './Autocomplete.styles';
15
12
  var AUTOSIZE_EXTRA_WIDTH = 27;
16
-
17
13
  var Autocomplete = function Autocomplete(props) {
18
14
  var className = props.className,
19
- label = props.label,
20
- description = props.description,
21
- errorText = props.errorText,
22
- disabled = props.disabled,
23
- error = props.error,
24
- handleInputRef = props.handleInputRef,
25
- getPopupContainer = props.getPopupContainer,
26
- autoResize = props.autoResize,
27
- readOnly = props.readOnly,
28
- rest = _objectWithoutPropertiesLoose(props, _excluded);
29
-
15
+ label = props.label,
16
+ description = props.description,
17
+ errorText = props.errorText,
18
+ disabled = props.disabled,
19
+ error = props.error,
20
+ handleInputRef = props.handleInputRef,
21
+ getPopupContainer = props.getPopupContainer,
22
+ autoResize = props.autoResize,
23
+ readOnly = props.readOnly,
24
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
30
25
  var scrollLeftRef = useRef(0);
31
26
  var antSelectRef = useRef(null);
32
27
  var inputRef = useRef(null);
@@ -43,35 +38,27 @@ var Autocomplete = function Autocomplete(props) {
43
38
  inputRef.current = autosizeRef.current.inputRef.current;
44
39
  }
45
40
  }, []);
46
-
47
41
  var getParentNode = function getParentNode(triggerNode) {
48
42
  return triggerNode.parentNode;
49
43
  };
50
-
51
44
  var stretchToFit = autoResize && autoResize !== true && Boolean(autoResize.stretchToFit);
52
45
  var placeholder = typeof rest.placeholder === 'string' ? rest.placeholder : undefined;
53
-
54
46
  var handlePreAutosize = function handlePreAutosize() {
55
47
  var _inputRef$current;
56
-
57
48
  scrollLeftRef.current = ((_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.scrollLeft) || 0;
58
49
  autocompleteInputRef.current && autocompleteInputRef.current.style.removeProperty('max-width');
59
50
  };
60
-
61
51
  var handleAutosize = function handleAutosize() {
62
52
  var parentRect = elementRef.current && elementRef.current.getBoundingClientRect();
63
-
64
53
  if (stretchToFit && autocompleteInputRef.current && parentRect != null && parentRect.width) {
65
54
  autocompleteInputRef.current.style.maxWidth = (parentRect == null ? void 0 : parentRect.width) + 1 + "px";
66
55
  inputRef.current && inputRef.current.scrollTo(scrollLeftRef.current, 0);
67
56
  }
68
57
  };
69
-
70
58
  var transformRef = function transformRef(element) {
71
59
  autocompleteInputRef.current = element;
72
60
  return element.querySelector('input');
73
61
  };
74
-
75
62
  return /*#__PURE__*/React.createElement(S.AutocompleteWrapper, {
76
63
  ref: elementRef,
77
64
  autoResize: autoResize,
@@ -98,6 +85,5 @@ var Autocomplete = function Autocomplete(props) {
98
85
  disabled: disabled
99
86
  }, description)));
100
87
  };
101
-
102
88
  Autocomplete.Option = AntdAutoComplete.Option;
103
89
  export default Autocomplete;
@@ -16,7 +16,6 @@ export var LoaderWrapper = styled.div.withConfig({
16
16
  displayName: "Autocompletestyles__LoaderWrapper",
17
17
  componentId: "sc-10de6ms-3"
18
18
  })(["margin-right:10px;"]);
19
-
20
19
  var active = function active() {
21
20
  return 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:", ";"], function (props) {
22
21
  return props.theme.palette['blue-600'];
@@ -26,7 +25,6 @@ var active = function active() {
26
25
  return props.theme.palette['blue-050'];
27
26
  });
28
27
  };
29
-
30
28
  var error = function error() {
31
29
  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) {
32
30
  return props.theme.palette['red-600'];
@@ -36,7 +34,6 @@ var error = function error() {
36
34
  return props.theme.palette['red-600'];
37
35
  });
38
36
  };
39
-
40
37
  var readonly = function readonly() {
41
38
  return css(["background-color:", ";color:", ";input{cursor:auto;}"], function (props) {
42
39
  return props.theme.palette.white;
@@ -44,7 +41,6 @@ var readonly = function readonly() {
44
41
  return props.theme.palette['grey-700'];
45
42
  });
46
43
  };
47
-
48
44
  export var AutocompleteWrapper = styled.div.withConfig({
49
45
  displayName: "Autocompletestyles__AutocompleteWrapper",
50
46
  componentId: "sc-10de6ms-4"
@@ -64,10 +60,8 @@ export var ComponentWrapper = styled.div.withConfig({
64
60
  if (props.readOnly) {
65
61
  return css([".ant-select-selector{&:hover{", "}", "}"], readonly(), readonly());
66
62
  }
67
-
68
63
  if (props.error) {
69
64
  return css([".ant-select-selector{&:hover{", "}", "}"], error(), error());
70
65
  }
71
-
72
66
  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());
73
67
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-autocomplete",
3
- "version": "0.8.27",
3
+ "version": "0.8.29",
4
4
  "description": "Autocomplete UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,9 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-input": "^0.24.13",
38
- "@synerise/ds-typography": "^0.16.5",
39
- "@synerise/ds-utils": "^0.31.1"
37
+ "@synerise/ds-input": "^0.24.15",
38
+ "@synerise/ds-typography": "^0.16.7",
39
+ "@synerise/ds-utils": "^0.31.2"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@synerise/ds-core": "*",
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 17.0.2",
45
45
  "styled-components": "5.0.1"
46
46
  },
47
- "gitHead": "8d26191fc0475407e0691b9b183761ad3cd7c87d"
47
+ "gitHead": "4a56ee7ef816c22341ce704154dc7aa65b7d1dcc"
48
48
  }