@synerise/ds-inline-edit 1.0.5 → 1.0.7
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,25 @@
|
|
|
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.0.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-edit@1.0.6...@synerise/ds-inline-edit@1.0.7) (2025-04-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **inline-edit:** fix text flicker ([b151d33](https://github.com/Synerise/synerise-design/commit/b151d3312fd546df7bf3087b4e509ce565f2df44))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.0.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-edit@1.0.5...@synerise/ds-inline-edit@1.0.6) (2025-04-16)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-inline-edit
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-inline-edit@1.0.4...@synerise/ds-inline-edit@1.0.5) (2025-04-02)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-inline-edit
|
package/dist/InlineEdit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useCallback, useRef, useState, useEffect } from 'react';
|
|
3
3
|
import Tooltip from '@synerise/ds-tooltip';
|
|
4
4
|
import Icon, { EditS } from '@synerise/ds-icon';
|
|
@@ -20,54 +20,49 @@ var InlineEdit = function InlineEdit(_ref) {
|
|
|
20
20
|
input = _ref.input;
|
|
21
21
|
var inputRef = useRef(null);
|
|
22
22
|
var _useState = useState(),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var handleScroll = useCallback(function () {
|
|
26
|
-
if (inputRef.current) {
|
|
27
|
-
var scrolledPixels = inputRef.current.scrollLeft;
|
|
28
|
-
if (scrolledPixels > 0) {
|
|
29
|
-
setScrolled(true);
|
|
30
|
-
} else {
|
|
31
|
-
setScrolled(false);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}, [inputRef]);
|
|
23
|
+
focused = _useState[0],
|
|
24
|
+
setFocused = _useState[1];
|
|
35
25
|
var handleChange = useCallback(function (event) {
|
|
36
|
-
|
|
26
|
+
// eslint-disable-next-line no-unused-expressions
|
|
27
|
+
input.onChange == null || input.onChange(event);
|
|
37
28
|
}, [input]);
|
|
29
|
+
var handleFocus = function handleFocus() {
|
|
30
|
+
setFocused(false);
|
|
31
|
+
};
|
|
38
32
|
var handleBlur = useCallback(function (event) {
|
|
39
33
|
input.onBlur && input.onBlur(event);
|
|
40
34
|
inputRef.current && inputRef.current.scrollTo({
|
|
41
35
|
left: 0
|
|
42
36
|
});
|
|
43
|
-
|
|
37
|
+
setFocused(true);
|
|
38
|
+
}, [input]);
|
|
44
39
|
var handleKeyPress = useCallback(function (event) {
|
|
45
40
|
if (event.key === 'Enter') {
|
|
46
41
|
input.onEnterPress && input.onEnterPress(event);
|
|
47
42
|
inputRef.current && inputRef.current.blur();
|
|
48
43
|
}
|
|
49
|
-
}, [input
|
|
44
|
+
}, [input]);
|
|
50
45
|
var handleFocusInput = useCallback(function () {
|
|
51
46
|
inputRef.current && inputRef.current.focus();
|
|
52
|
-
}, [
|
|
47
|
+
}, []);
|
|
53
48
|
useEffect(function () {
|
|
54
49
|
autoFocus && inputRef.current && inputRef.current.focus();
|
|
55
|
-
}, [autoFocus
|
|
50
|
+
}, [autoFocus]);
|
|
56
51
|
return /*#__PURE__*/React.createElement(S.InPlaceEditableInputContainer, {
|
|
57
52
|
className: "ds-inline-edit " + (className || ''),
|
|
58
53
|
style: style,
|
|
59
54
|
size: size,
|
|
60
55
|
disabled: disabled,
|
|
61
56
|
error: error,
|
|
62
|
-
scrolled:
|
|
57
|
+
scrolled: focused
|
|
63
58
|
}, /*#__PURE__*/React.createElement(AutosizeInput, {
|
|
64
59
|
extraWidth: 2,
|
|
65
|
-
value: input.value
|
|
60
|
+
value: input.value,
|
|
66
61
|
placeholder: input.placeholder,
|
|
67
62
|
placeholderIsMinWidth: false,
|
|
68
63
|
wrapperClassName: "autosize-input"
|
|
69
64
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
70
|
-
|
|
65
|
+
autoComplete: "off",
|
|
71
66
|
id: input.name ? toCamelCase(input.name) : 'id'
|
|
72
67
|
}, input, {
|
|
73
68
|
className: "autosize-input",
|
|
@@ -76,7 +71,8 @@ var InlineEdit = function InlineEdit(_ref) {
|
|
|
76
71
|
disabled: disabled,
|
|
77
72
|
onChange: handleChange,
|
|
78
73
|
onBlur: handleBlur,
|
|
79
|
-
|
|
74
|
+
onFocus: handleFocus,
|
|
75
|
+
value: input.value,
|
|
80
76
|
ref: inputRef
|
|
81
77
|
}))), !hideIcon && /*#__PURE__*/React.createElement(Tooltip, {
|
|
82
78
|
"data-testid": "inline-edit-icon",
|
|
@@ -46,7 +46,7 @@ export var IconWrapper = styled.div.withConfig({
|
|
|
46
46
|
export var InPlaceEditableInputContainer = styled.div.withConfig({
|
|
47
47
|
displayName: "InlineEditstyles__InPlaceEditableInputContainer",
|
|
48
48
|
componentId: "sc-1itw4az-2"
|
|
49
|
-
})(["display:flex;max-width:100%;align-items:center;pointer-events:", ";", "{svg{color:", ";fill:", ";}}input{", "}&:hover{input{color:", ";background-image:linear-gradient(
|
|
49
|
+
})(["display:flex;max-width:100%;align-items:center;pointer-events:", ";", "{svg{color:", ";fill:", ";}}input{", "}&:hover{input{color:", ";background-image:linear-gradient(to right,", " 20%,rgba(255,255,255,0) 10%);}", "{background-color:", ";}}", " > .autosize-input{display:inline-block;overflow:hidden;}> .autosize-input > input,> ", "{border:none;background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;", " overflow:hidden;text-overflow:", ";max-width:100%;padding-bottom:", ";margin:0;vertical-align:top;color:", ";::placeholder{color:", ";}}"], function (_ref) {
|
|
50
50
|
var disabled = _ref.disabled;
|
|
51
51
|
return disabled ? 'none' : 'all';
|
|
52
52
|
}, IconWrapper, function (props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["value", "onChange"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _objectWithoutPropertiesLoose(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { useRef, useState, useEffect } from 'react';
|
|
5
5
|
import { NOOP, toCamelCase } from '@synerise/ds-utils';
|
|
6
6
|
import Icon, { AngleDownS } from '@synerise/ds-icon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useState, useCallback } from 'react';
|
|
3
3
|
import { SearchItems } from '@synerise/ds-search/dist/Elements';
|
|
4
4
|
import * as S from './SelectDropdown.style';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-inline-edit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "InlineEdit UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
38
|
-
"@synerise/ds-icon": "^1.
|
|
39
|
-
"@synerise/ds-input": "^1.
|
|
40
|
-
"@synerise/ds-list-item": "^1.0.
|
|
41
|
-
"@synerise/ds-scrollbar": "^1.0.
|
|
42
|
-
"@synerise/ds-search": "^1.1.
|
|
43
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
44
|
-
"@synerise/ds-typography": "^1.0.
|
|
37
|
+
"@synerise/ds-dropdown": "^1.0.6",
|
|
38
|
+
"@synerise/ds-icon": "^1.4.1",
|
|
39
|
+
"@synerise/ds-input": "^1.1.1",
|
|
40
|
+
"@synerise/ds-list-item": "^1.0.6",
|
|
41
|
+
"@synerise/ds-scrollbar": "^1.0.6",
|
|
42
|
+
"@synerise/ds-search": "^1.1.3",
|
|
43
|
+
"@synerise/ds-tooltip": "^1.1.5",
|
|
44
|
+
"@synerise/ds-typography": "^1.0.6",
|
|
45
45
|
"@synerise/ds-utils": "^1.0.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"react": ">=16.9.0 <= 18.3.1",
|
|
50
50
|
"styled-components": "^5.3.3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "fc601270d3c84a5a52b62473a01f1b3c1c7014a7"
|
|
53
53
|
}
|