linear-react-components-ui 0.4.76-beta.21 → 0.4.76-beta.24
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/assets/styles/panel.scss +4 -1
- package/lib/assets/styles/tabs.scss +49 -44
- package/lib/icons/helper.js +3 -3
- package/lib/inputs/select/Dropdown.js +5 -2
- package/lib/inputs/select/multiple/index.js +1 -1
- package/lib/internals/withTooltip.js +2 -2
- package/lib/tabs/Menu.js +1 -11
- package/lib/tabs/index.js +1 -1
- package/lib/treeview/index.js +26 -16
- package/package.json +1 -1
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
margin-bottom: 20px;
|
|
8
8
|
border: solid 1px $component-border-color;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
9
11
|
&.panel-shadow {
|
|
10
12
|
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
|
|
11
13
|
}
|
|
@@ -47,7 +49,8 @@
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
> .panel-content {
|
|
50
|
-
|
|
52
|
+
flex: 1;
|
|
53
|
+
overflow: auto;
|
|
51
54
|
padding: 15px;
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
margin-right: 1px;
|
|
49
49
|
padding: 0;
|
|
50
50
|
width: auto;
|
|
51
|
-
min-width: 100px;
|
|
52
51
|
display: flex;
|
|
53
52
|
justify-content: space-between;
|
|
54
53
|
align-items: center;
|
|
@@ -122,24 +121,26 @@
|
|
|
122
121
|
.tabs-component.menu-left {
|
|
123
122
|
grid-template-columns: auto 1fr;
|
|
124
123
|
grid-template-rows: none;
|
|
125
|
-
> .
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
> .menucontainer {
|
|
125
|
+
> .menu {
|
|
126
|
+
box-shadow: -1px 0px 0px 0px $component-border-color inset;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
}
|
|
130
|
+
> .menu > .menuitem {
|
|
131
|
+
border-radius: 5px 0px 0px 5px;
|
|
132
|
+
-moz-border-radius: 5px 0px 0px 5px;
|
|
133
|
+
-webkit-border-radius: 5px 0px 0px 5px;
|
|
134
|
+
&.selected {
|
|
135
|
+
border: 1px solid $component-border-color;
|
|
136
|
+
border-right: 1px solid $font-color-second;
|
|
137
|
+
border-left: 2px solid $component-selected-color;
|
|
138
|
+
width: 100%;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
> .menu > .menuitem > .closepanel {
|
|
142
|
+
float: left;
|
|
139
143
|
}
|
|
140
|
-
}
|
|
141
|
-
> .menu > .menuitem > .closepanel {
|
|
142
|
-
float: left;
|
|
143
144
|
}
|
|
144
145
|
> .panel {
|
|
145
146
|
border-top: 1px solid $component-border-color;
|
|
@@ -152,18 +153,20 @@
|
|
|
152
153
|
*/
|
|
153
154
|
.tabs-component.menu-bottom {
|
|
154
155
|
grid-template-rows: 1fr auto;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
156
|
+
.menucontainer {
|
|
157
|
+
> .menu {
|
|
158
|
+
box-shadow: 0 1px 1px 0px $component-border-color inset;
|
|
159
|
+
}
|
|
160
|
+
> .menu > .menuitem {
|
|
161
|
+
border-radius: 0px 0px 5px 5px;
|
|
162
|
+
-moz-border-radius: 0px 0px 5px 5px;
|
|
163
|
+
-webkit-border-radius: 0px 0px 5px 5px;
|
|
164
|
+
&.selected {
|
|
165
|
+
border: 1px solid $component-border-color;
|
|
166
|
+
border-top: 1px solid $font-color-second;
|
|
167
|
+
border-bottom: 2px solid $component-selected-color;
|
|
168
|
+
height: 100%;
|
|
169
|
+
}
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
172
|
> .panel {
|
|
@@ -178,20 +181,22 @@
|
|
|
178
181
|
.tabs-component.menu-right {
|
|
179
182
|
grid-template-columns: 1fr auto;
|
|
180
183
|
grid-template-rows: none;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
184
|
+
.menucontainer{
|
|
185
|
+
> .menu {
|
|
186
|
+
box-shadow: 2px 0 0px -1px $component-border-color inset;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
}
|
|
190
|
+
> .menu > .menuitem {
|
|
191
|
+
border-radius: 0px 5px 5px 0px;
|
|
192
|
+
-moz-border-radius: 0px 5px 5px 0px;
|
|
193
|
+
-webkit-border-radius: 0px 5px 5px 0px;
|
|
194
|
+
&.selected {
|
|
195
|
+
border: 1px solid $component-border-color;
|
|
196
|
+
border-left: 1px solid $font-color-second;
|
|
197
|
+
border-right: 2px solid $component-selected-color;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
> .panel {
|
package/lib/icons/helper.js
CHANGED
|
@@ -555,9 +555,9 @@ function getIcons() {
|
|
|
555
555
|
viewbox: '0 0 16 16',
|
|
556
556
|
paths: ['M0.854 5.146c-0.143-0.143-0.358-0.186-0.545-0.108s-0.309 0.26-0.309 0.462v10c0 0.202 0.122 0.385 0.309 0.462 0.062 0.026 0.127 0.038 0.191 0.038 0.13 0 0.258-0.051 0.354-0.146l5-5c0.195-0.195 0.195-0.512 0-0.707l-5-5z', 'M7.5 7c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 10c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 13c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 16c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M14.691 5.038c-0.062-0.026-0.127-0.038-0.191-0.038-0.13 0-0.258 0.051-0.354 0.146l-5 5c-0.195 0.195-0.195 0.512 0 0.707l5 5c0.143 0.143 0.358 0.186 0.545 0.108s0.309-0.26 0.309-0.462v-10c0-0.202-0.122-0.385-0.309-0.462zM13.875 13.991l-3.491-3.491 3.491-3.491v6.982z', 'M11.5 3c-0.943-1.257-2.419-2-4-2-1.672 0-3.226 0.831-4.158 2.222-0.154 0.229-0.092 0.54 0.137 0.694s0.54 0.092 0.694-0.137c0.745-1.113 1.989-1.778 3.327-1.778 1.313 0 2.534 0.64 3.284 1.716l-1.284 1.284h3.5v-3.5l-1.5 1.5z']
|
|
557
557
|
},
|
|
558
|
-
|
|
559
|
-
viewbox: '0 0
|
|
560
|
-
paths: ['
|
|
558
|
+
tools: {
|
|
559
|
+
viewbox: '0 0 20 16',
|
|
560
|
+
paths: ['M7.696 11.009l2.295 2.295-1.823 2.341c-0.334 0.437-0.926 0.476-1.315 0.087l-1.586-1.586c-0.389-0.389-0.35-0.98 0.087-1.315l2.341-1.823zM19.899 4.101l-2.399 2.399-3-3 2.399-2.399c-0.289-0.066-0.59-0.101-0.899-0.101-2.209 0-4 1.791-4 4 0 0.797 0.233 1.539 0.635 2.163l-2.233 1.739-3.402-3.402 4.5-4.5h-5l-2.22 2.22-0.22-0.22h-1.061v1.061l0.22 0.22-3.22 3.22 2.5 2.5 3-3 9 9 1.5-1.5-3.902-3.902 1.739-2.233c0.624 0.402 1.366 0.635 2.163 0.635 2.209 0 4-1.791 4-4 0-0.309-0.035-0.61-0.101-0.899z']
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
return icons;
|
|
@@ -85,7 +85,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
85
85
|
imgSrcKey = _ref.imgSrcKey,
|
|
86
86
|
gridWrapperStyle = _ref.gridWrapperStyle,
|
|
87
87
|
selectFieldRef = _ref.selectFieldRef,
|
|
88
|
-
dropdownMaxHeight = _ref.dropdownMaxHeight
|
|
88
|
+
dropdownMaxHeight = _ref.dropdownMaxHeight,
|
|
89
|
+
inputValue = _ref.inputValue;
|
|
89
90
|
|
|
90
91
|
var _useState = (0, _react.useState)(returnDropdownDynamicStyles(selectFieldRef, dropdownMaxHeight)),
|
|
91
92
|
_useState2 = _slicedToArray(_useState, 1),
|
|
@@ -102,6 +103,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
102
103
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
103
104
|
className: "filterinput",
|
|
104
105
|
type: "text",
|
|
106
|
+
value: inputValue,
|
|
105
107
|
onFocus: function onFocus() {
|
|
106
108
|
handleOnFocus();
|
|
107
109
|
},
|
|
@@ -174,7 +176,8 @@ Dropdown.propTypes = {
|
|
|
174
176
|
striped: _propTypes["default"].bool,
|
|
175
177
|
gridWrapperStyle: _propTypes["default"].object,
|
|
176
178
|
selectFieldRef: _propTypes["default"].object,
|
|
177
|
-
dropdownMaxHeight: _propTypes["default"].number
|
|
179
|
+
dropdownMaxHeight: _propTypes["default"].number,
|
|
180
|
+
inputValue: _propTypes["default"].string.isRequired
|
|
178
181
|
};
|
|
179
182
|
Dropdown.defaultProps = {
|
|
180
183
|
selected: null,
|
|
@@ -397,7 +397,7 @@ Object.defineProperty(MultipleSelect, "getDerivedStateFromProps", {
|
|
|
397
397
|
var dataCombo = remoteSearch ? dataSource : (0, _helper.getFilteredMultipleDataCombo)(_extends({}, props, state));
|
|
398
398
|
return {
|
|
399
399
|
dataCombo: dataCombo,
|
|
400
|
-
selected:
|
|
400
|
+
selected: dataCombo.length > 0 ? dataCombo[0] : null
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
403
|
|
|
@@ -112,12 +112,12 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
112
112
|
};
|
|
113
113
|
}, []);
|
|
114
114
|
(0, _react.useEffect)(function () {
|
|
115
|
-
if (targetElement.current) {
|
|
115
|
+
if (targetElement.current && tooltipElement.current) {
|
|
116
116
|
var width = tooltipDimensions.width,
|
|
117
117
|
height = tooltipDimensions.height;
|
|
118
118
|
var targetDimensions = targetElement.current.getBoundingClientRect();
|
|
119
119
|
var targetVerticalCenter = (targetDimensions.top + targetDimensions.bottom) / 2;
|
|
120
|
-
var tooltipClientWidth = tooltipElement.current
|
|
120
|
+
var tooltipClientWidth = tooltipElement.current.clientWidth;
|
|
121
121
|
var style = "width: ".concat(typeof width === 'string' ? width : "".concat(width, "px"));
|
|
122
122
|
var left = targetDimensions.left + targetDimensions.width / 2 - tooltipClientWidth / 2;
|
|
123
123
|
left = Math.min(left, document.body.clientWidth - tooltipClientWidth - space);
|
package/lib/tabs/Menu.js
CHANGED
|
@@ -20,22 +20,12 @@ var Menu = function Menu(props) {
|
|
|
20
20
|
customClassForToolBar = props.customClassForToolBar,
|
|
21
21
|
menuRef = props.menuRef,
|
|
22
22
|
toolBarRef = props.toolBarRef;
|
|
23
|
-
|
|
24
|
-
if (!toolbar) {
|
|
25
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
-
className: "menucontainer",
|
|
27
|
-
ref: function ref(r) {
|
|
28
|
-
menuRef(r);
|
|
29
|
-
}
|
|
30
|
-
}, /*#__PURE__*/_react["default"].createElement(_MenuItems["default"], props), /*#__PURE__*/_react["default"].createElement(_DropdownItems["default"], props));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
23
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
24
|
className: "menucontainer",
|
|
35
25
|
ref: function ref(r) {
|
|
36
26
|
menuRef(r);
|
|
37
27
|
}
|
|
38
|
-
}, /*#__PURE__*/_react["default"].createElement(_MenuItems["default"], props), /*#__PURE__*/_react["default"].createElement(_DropdownItems["default"], props), /*#__PURE__*/_react["default"].cloneElement(toolbar, {
|
|
28
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItems["default"], props), /*#__PURE__*/_react["default"].createElement(_DropdownItems["default"], props), toolbar && /*#__PURE__*/_react["default"].cloneElement(toolbar, {
|
|
39
29
|
customClass: "menubar ".concat(customClassForToolBar),
|
|
40
30
|
innerRef: toolBarRef ? function (r) {
|
|
41
31
|
toolBarRef(r);
|
package/lib/tabs/index.js
CHANGED
|
@@ -254,7 +254,7 @@ var Tabs = function Tabs(props) {
|
|
|
254
254
|
return function () {
|
|
255
255
|
return window.removeEventListener('resize', onResize);
|
|
256
256
|
};
|
|
257
|
-
}, [_menuRef.current]);
|
|
257
|
+
}, [_menuRef.current, tabMenuPosition]);
|
|
258
258
|
(0, _react.useEffect)(function () {
|
|
259
259
|
if (selectedTab) setSelectedTabId(selectedTab);
|
|
260
260
|
if (children) setPanels((0, _tabHelpers.buildPanels)(children));
|
package/lib/treeview/index.js
CHANGED
|
@@ -100,20 +100,26 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
100
100
|
enumerable: true,
|
|
101
101
|
writable: true,
|
|
102
102
|
value: function value(selectedIds) {
|
|
103
|
-
var requiredIds = [];
|
|
104
|
-
var newSelectedIds = [];
|
|
105
|
-
selectedIds.forEach(function (id) {
|
|
106
|
-
var _this$checkAllAncestr = _this.checkAllAncestry(id, [], true, false),
|
|
107
|
-
requiredParentsIds = _this$checkAllAncestr.requiredParentsIds,
|
|
108
|
-
updatedIdsWithAncestryIds = _this$checkAllAncestr.updatedIdsWithAncestryIds;
|
|
109
|
-
|
|
110
|
-
newSelectedIds = [].concat(_toConsumableArray(newSelectedIds), _toConsumableArray(updatedIdsWithAncestryIds));
|
|
111
|
-
requiredIds = [].concat(_toConsumableArray(requiredIds), _toConsumableArray(requiredParentsIds));
|
|
112
|
-
});
|
|
113
|
-
|
|
114
103
|
_this.setState({
|
|
115
|
-
requiredParentsIds:
|
|
116
|
-
|
|
104
|
+
requiredParentsIds: []
|
|
105
|
+
}, function () {
|
|
106
|
+
var requiredIds = [];
|
|
107
|
+
var newSelectedIds = [];
|
|
108
|
+
var selectedIdsUpdatedOnMount = _this.state.selectedIdsUpdatedOnMount;
|
|
109
|
+
selectedIds.forEach(function (id) {
|
|
110
|
+
var _this$checkAllAncestr = _this.checkAllAncestry(id, [], true, false),
|
|
111
|
+
requiredParentsIds = _this$checkAllAncestr.requiredParentsIds,
|
|
112
|
+
updatedIdsWithAncestryIds = _this$checkAllAncestr.updatedIdsWithAncestryIds;
|
|
113
|
+
|
|
114
|
+
newSelectedIds = [].concat(_toConsumableArray(newSelectedIds), _toConsumableArray(updatedIdsWithAncestryIds));
|
|
115
|
+
requiredIds = [].concat(_toConsumableArray(requiredIds), _toConsumableArray(requiredParentsIds));
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
_this.setState({
|
|
119
|
+
requiredParentsIds: _lodash["default"].uniq(requiredIds),
|
|
120
|
+
selectedIds: _lodash["default"].uniq(newSelectedIds),
|
|
121
|
+
selectedIdsUpdatedOnMount: selectedIdsUpdatedOnMount || true
|
|
122
|
+
});
|
|
117
123
|
});
|
|
118
124
|
}
|
|
119
125
|
});
|
|
@@ -504,7 +510,8 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
504
510
|
selectedIds: _this.props.selectedIds,
|
|
505
511
|
isHandlingSelectedIds: false,
|
|
506
512
|
requiredParentsIds: [],
|
|
507
|
-
alreadyOpenedIds: []
|
|
513
|
+
alreadyOpenedIds: [],
|
|
514
|
+
selectedIdsUpdatedOnMount: false
|
|
508
515
|
};
|
|
509
516
|
return _this;
|
|
510
517
|
}
|
|
@@ -519,12 +526,15 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
519
526
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
520
527
|
var _this$state3 = this.state,
|
|
521
528
|
selectedIds = _this$state3.selectedIds,
|
|
522
|
-
propSelectedIds = _this$state3.propSelectedIds
|
|
529
|
+
propSelectedIds = _this$state3.propSelectedIds,
|
|
530
|
+
selectedIdsUpdatedOnMount = _this$state3.selectedIdsUpdatedOnMount;
|
|
523
531
|
var allowCheckAllAncestry = this.props.allowCheckAllAncestry;
|
|
524
532
|
|
|
525
533
|
var isSameSelectedIds = _lodash["default"].isEqual(propSelectedIds.sort(), prevState.propSelectedIds.sort());
|
|
526
534
|
|
|
527
|
-
if (allowCheckAllAncestry && !isSameSelectedIds)
|
|
535
|
+
if (allowCheckAllAncestry && (!selectedIdsUpdatedOnMount || !isSameSelectedIds)) {
|
|
536
|
+
this.handleNewSelectedIds(selectedIds);
|
|
537
|
+
}
|
|
528
538
|
}
|
|
529
539
|
}, {
|
|
530
540
|
key: "render",
|