linear-react-components-ui 1.1.22-beta.10 → 1.1.22-beta.12
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/lib/drawer/Drawer.js
CHANGED
|
@@ -79,9 +79,10 @@ const BaseDrawer = _ref => {
|
|
|
79
79
|
componentEl.appendChild(drawerContainerEl.current);
|
|
80
80
|
drawerComponentEl.current = componentEl;
|
|
81
81
|
};
|
|
82
|
-
const setDrawerOverlay = body => {
|
|
82
|
+
const setDrawerOverlay = (body, id) => {
|
|
83
83
|
const drawerOverlay = document.createElement('div');
|
|
84
84
|
drawerOverlay.className = 'drawer-overlay';
|
|
85
|
+
drawerOverlay.id = id;
|
|
85
86
|
drawerOverlay.dataset.testid = 'drawer-overlay';
|
|
86
87
|
body.appendChild(drawerOverlay);
|
|
87
88
|
};
|
|
@@ -94,6 +95,7 @@ const BaseDrawer = _ref => {
|
|
|
94
95
|
(0, _react.useEffect)(() => {
|
|
95
96
|
let body;
|
|
96
97
|
const randomId = Math.round(+new Date() / 1000);
|
|
98
|
+
const overlayId = `overlay-${randomId}`;
|
|
97
99
|
if (targetId === undefined) {
|
|
98
100
|
body = document.getElementsByTagName('body')[0];
|
|
99
101
|
} else {
|
|
@@ -101,10 +103,10 @@ const BaseDrawer = _ref => {
|
|
|
101
103
|
}
|
|
102
104
|
if (body) setDrawerComponent(body, randomId);
|
|
103
105
|
if (overlay && body) {
|
|
104
|
-
setDrawerOverlay(body);
|
|
106
|
+
setDrawerOverlay(body, overlayId);
|
|
105
107
|
}
|
|
106
108
|
return () => {
|
|
107
|
-
const drawerOverlay = document.
|
|
109
|
+
const drawerOverlay = document.getElementById(overlayId);
|
|
108
110
|
if (closeOnEsc) document.body.removeEventListener('keydown', closeDrawerOnEsc);
|
|
109
111
|
if (targetId) {
|
|
110
112
|
const drawerComponentTarget = document.getElementById(targetId);
|
|
@@ -141,9 +141,6 @@ const SimpleSelect = props => {
|
|
|
141
141
|
if (props.onBlur) {
|
|
142
142
|
const event = getSelectEvent(selected);
|
|
143
143
|
props.onBlur(event);
|
|
144
|
-
if (selected && opened) {
|
|
145
|
-
onSelect(selected);
|
|
146
|
-
}
|
|
147
144
|
if (selected && descriptionKeyIsString && inputText !== selected[descriptionKey] || !descriptionKeyIsString && inputText !== descriptionKey(selected)) {
|
|
148
145
|
setSelected(null);
|
|
149
146
|
setInputText(inputText);
|
|
@@ -223,6 +220,9 @@ const SimpleSelect = props => {
|
|
|
223
220
|
setSelected(newCurrent);
|
|
224
221
|
if (descriptionKeyIsString) setInputText(newCurrent ? newCurrent[descriptionKey] : '');else setInputText(newCurrent ? descriptionKey(newCurrent) : '');
|
|
225
222
|
}
|
|
223
|
+
if (dataSourceWithAllOptions.length === 0 && inputText) {
|
|
224
|
+
setInputText('');
|
|
225
|
+
}
|
|
226
226
|
}, [dataSourceWithAllOptions.length, value]);
|
|
227
227
|
(0, _react.useEffect)(() => {
|
|
228
228
|
if (!_lodash.default.isEqual(dataCombo, dataSourceWithAllOptions)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linear-react-components-ui",
|
|
3
|
-
"version": "1.1.22-beta.
|
|
3
|
+
"version": "1.1.22-beta.12",
|
|
4
4
|
"description": "Linear Sistemas ReactJs Components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.cjs",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"lib"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"lib": "babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" --ignore **/*.spec.tsx && babel src/lib/assets -d lib/assets --copy-files && npm run lib:types",
|
|
11
|
+
"lib": "rm -rf lib && babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" --ignore **/*.spec.tsx && babel src/lib/assets -d lib/assets --copy-files && npm run lib:types",
|
|
12
12
|
"lib:types": "tsup --dts-only --dts --external react",
|
|
13
13
|
"demo": "node scripts/start.js",
|
|
14
14
|
"demo:prod": "webpack --config ./config/webpack.config.js --mode production",
|