linear-react-components-ui 0.4.76-beta.17 → 0.4.76-beta.20
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/alerts/AlertProvider.js +1 -1
- package/lib/alerts/BaseAlert.js +1 -1
- package/lib/assets/styles/panel.scss +4 -1
- package/lib/assets/styles/table.scss +12 -0
- package/lib/assets/styles/tabs.scss +49 -44
- package/lib/assets/styles/treeview.scss +0 -4
- package/lib/buttons/DefaultButton.js +1 -1
- package/lib/buttons/index.js +28 -28
- package/lib/calendar/base/helpers.js +6 -6
- package/lib/calendar/base/index.js +1 -1
- package/lib/calendar/index.js +10 -10
- package/lib/checkbox/index.js +1 -1
- package/lib/dialog/index.js +6 -6
- package/lib/drawer/Drawer.js +1 -1
- package/lib/drawer/index.js +4 -4
- package/lib/dropdown/withDropdown.js +2 -2
- package/lib/fieldset/index.js +1 -1
- package/lib/form/Field.js +1 -1
- package/lib/form/helpers.js +1 -1
- package/lib/form/index.js +5 -5
- package/lib/form/withFieldHOC.js +1 -1
- package/lib/form/withFormSecurity.js +2 -2
- package/lib/index.js +12 -12
- package/lib/inputs/base/InputTextBase.js +1 -1
- package/lib/inputs/base/helpers.js +1 -1
- package/lib/inputs/color/index.js +1 -1
- package/lib/inputs/date/Dropdown.js +1 -1
- package/lib/inputs/date/helpers.js +1 -1
- package/lib/inputs/date/index.js +1 -1
- package/lib/inputs/inputHOC.js +1 -1
- package/lib/inputs/mask/Cnpj.js +1 -1
- package/lib/inputs/mask/Cpf.js +1 -1
- package/lib/inputs/mask/helpers.js +2 -2
- package/lib/inputs/mask/imaskHOC.js +1 -1
- package/lib/inputs/mask/index.js +4 -4
- package/lib/inputs/multiSelect/Dropdown.js +1 -1
- package/lib/inputs/multiSelect/index.js +1 -1
- package/lib/inputs/number/format_number.js +1 -1
- package/lib/inputs/period/Dropdown.js +1 -1
- package/lib/inputs/period/helper.js +1 -1
- package/lib/inputs/period/index.js +1 -1
- package/lib/inputs/search/index.js +1 -1
- package/lib/inputs/select/Dropdown.js +6 -3
- package/lib/inputs/select/helper.js +1 -1
- package/lib/inputs/select/multiple/index.js +2 -2
- package/lib/inputs/select/simple/index.js +1 -1
- package/lib/internals/constants.js +1 -1
- package/lib/internals/withTooltip.js +3 -3
- package/lib/labelMessages/index.js +1 -1
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/labels/index.js +10 -10
- package/lib/list/Item.js +1 -1
- package/lib/list/index.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +9 -9
- package/lib/menus/sidenav/popup_menu_search/index.js +1 -1
- package/lib/panel/Default.js +1 -1
- package/lib/panel/helpers.js +1 -1
- package/lib/panel/index.js +14 -14
- package/lib/permissionValidations.js +1 -1
- package/lib/radio/index.js +1 -1
- package/lib/spinner/index.js +1 -1
- package/lib/split/Split.js +1 -1
- package/lib/table/Body.js +39 -4
- package/lib/table/Header.js +12 -1
- package/lib/table/HeaderColumn.js +4 -2
- package/lib/table/Row.js +14 -7
- package/lib/table/RowColumn.js +4 -3
- package/lib/table/helpers.js +11 -1
- package/lib/table/index.js +34 -21
- package/lib/tabs/Menu.js +1 -11
- package/lib/tabs/Panel.js +1 -1
- package/lib/tabs/index.js +2 -2
- package/lib/tabs/tabHelpers.js +3 -2
- package/lib/toolbar/index.js +8 -8
- package/lib/treeview/Node.js +5 -17
- package/lib/treeview/index.js +30 -24
- package/lib/treeview_old/Node.js +1 -1
- package/package.json +1 -1
- package/lib/inputs/date/helper.js +0 -16
package/lib/treeview/Node.js
CHANGED
|
@@ -27,8 +27,6 @@ var _list = _interopRequireWildcard(require("../list"));
|
|
|
27
27
|
|
|
28
28
|
var _toolbar = _interopRequireWildcard(require("../toolbar"));
|
|
29
29
|
|
|
30
|
-
var _SpinnerLoading = _interopRequireDefault(require("../spinner/SpinnerLoading"));
|
|
31
|
-
|
|
32
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
31
|
|
|
34
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -61,7 +59,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
61
59
|
|
|
62
60
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
61
|
|
|
64
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
62
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
65
63
|
|
|
66
64
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
67
65
|
|
|
@@ -157,9 +155,6 @@ var TreeNode = /*#__PURE__*/function (_Component) {
|
|
|
157
155
|
className: "treeviewitem"
|
|
158
156
|
}, _this2.getSpan(), /*#__PURE__*/_react["default"].createElement("div", {
|
|
159
157
|
className: "label",
|
|
160
|
-
style: !onNodeClick ? {
|
|
161
|
-
textDecoration: 'none'
|
|
162
|
-
} : null,
|
|
163
158
|
ref: _this2.labelRef,
|
|
164
159
|
role: "button",
|
|
165
160
|
onKeyPress: null,
|
|
@@ -245,11 +240,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
245
240
|
enumerable: true,
|
|
246
241
|
writable: true,
|
|
247
242
|
value: function value() {
|
|
248
|
-
var
|
|
249
|
-
alwaysShowArrow = _this3$props.alwaysShowArrow,
|
|
250
|
-
idsInLoading = _this3$props.idsInLoading;
|
|
243
|
+
var alwaysShowArrow = _this3.props.alwaysShowArrow;
|
|
251
244
|
var node = _this3.state.node;
|
|
252
|
-
var isLoading = idsInLoading.includes(node.id);
|
|
253
245
|
|
|
254
246
|
var span = /*#__PURE__*/_react["default"].createElement("noscript", null);
|
|
255
247
|
|
|
@@ -262,9 +254,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
262
254
|
onClick: function onClick() {
|
|
263
255
|
return _this3.openCloseTree(node);
|
|
264
256
|
}
|
|
265
|
-
},
|
|
266
|
-
size: "30px"
|
|
267
|
-
}) : /*#__PURE__*/_react["default"].createElement(_icons["default"], {
|
|
257
|
+
}, /*#__PURE__*/_react["default"].createElement(_icons["default"], {
|
|
268
258
|
name: _this3.state.isVisible ? 'up' : 'down',
|
|
269
259
|
size: 10
|
|
270
260
|
}));
|
|
@@ -441,8 +431,7 @@ TreeNode.propTypes = {
|
|
|
441
431
|
onNodeClick: _propTypes["default"].func,
|
|
442
432
|
handlerOnNodeOpen: _propTypes["default"].func,
|
|
443
433
|
nodeElementsValidations: _propTypes["default"].object,
|
|
444
|
-
startNodesOpened: _propTypes["default"].bool.isRequired
|
|
445
|
-
idsInLoading: _propTypes["default"].arrayOf(_propTypes["default"].number)
|
|
434
|
+
startNodesOpened: _propTypes["default"].bool.isRequired
|
|
446
435
|
};
|
|
447
436
|
TreeNode.defaultProps = {
|
|
448
437
|
childrenIds: [],
|
|
@@ -455,8 +444,7 @@ TreeNode.defaultProps = {
|
|
|
455
444
|
nodeMenuButtonSize: 'small',
|
|
456
445
|
onNodeClick: undefined,
|
|
457
446
|
handlerOnNodeOpen: undefined,
|
|
458
|
-
nodeElementsValidations: undefined
|
|
459
|
-
idsInLoading: []
|
|
447
|
+
nodeElementsValidations: undefined
|
|
460
448
|
};
|
|
461
449
|
TreeNode.contextType = _constants.TreeviewContext;
|
|
462
450
|
var _default = TreeNode;
|
package/lib/treeview/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
65
65
|
|
|
66
66
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
67
67
|
|
|
68
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
68
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
69
69
|
|
|
70
70
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
71
71
|
|
|
@@ -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
|
});
|
|
@@ -463,8 +469,7 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
463
469
|
nodeToolbarElements = _this$props3.nodeToolbarElements,
|
|
464
470
|
nodeMenuButtonSize = _this$props3.nodeMenuButtonSize,
|
|
465
471
|
alwaysShowArrow = _this$props3.alwaysShowArrow,
|
|
466
|
-
startNodesOpened = _this$props3.startNodesOpened
|
|
467
|
-
idsInLoading = _this$props3.idsInLoading;
|
|
472
|
+
startNodesOpened = _this$props3.startNodesOpened;
|
|
468
473
|
var childrenIds = [];
|
|
469
474
|
|
|
470
475
|
if (node.itens && node.itens.length > 0) {
|
|
@@ -482,7 +487,6 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
482
487
|
return /*#__PURE__*/_react["default"].createElement(_Node["default"], {
|
|
483
488
|
key: "node-".concat(node.id),
|
|
484
489
|
node: node,
|
|
485
|
-
idsInLoading: idsInLoading,
|
|
486
490
|
startNodesOpened: startNodesOpened,
|
|
487
491
|
alwaysShowArrow: alwaysShowArrow,
|
|
488
492
|
childrenIds: childrenIds,
|
|
@@ -506,7 +510,8 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
506
510
|
selectedIds: _this.props.selectedIds,
|
|
507
511
|
isHandlingSelectedIds: false,
|
|
508
512
|
requiredParentsIds: [],
|
|
509
|
-
alreadyOpenedIds: []
|
|
513
|
+
alreadyOpenedIds: [],
|
|
514
|
+
selectedIdsUpdatedOnMount: false
|
|
510
515
|
};
|
|
511
516
|
return _this;
|
|
512
517
|
}
|
|
@@ -521,12 +526,15 @@ var TreeView = /*#__PURE__*/function (_Component) {
|
|
|
521
526
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
522
527
|
var _this$state3 = this.state,
|
|
523
528
|
selectedIds = _this$state3.selectedIds,
|
|
524
|
-
propSelectedIds = _this$state3.propSelectedIds
|
|
529
|
+
propSelectedIds = _this$state3.propSelectedIds,
|
|
530
|
+
selectedIdsUpdatedOnMount = _this$state3.selectedIdsUpdatedOnMount;
|
|
525
531
|
var allowCheckAllAncestry = this.props.allowCheckAllAncestry;
|
|
526
532
|
|
|
527
533
|
var isSameSelectedIds = _lodash["default"].isEqual(propSelectedIds.sort(), prevState.propSelectedIds.sort());
|
|
528
534
|
|
|
529
|
-
if (allowCheckAllAncestry && !isSameSelectedIds)
|
|
535
|
+
if (allowCheckAllAncestry && (!selectedIdsUpdatedOnMount || !isSameSelectedIds)) {
|
|
536
|
+
this.handleNewSelectedIds(selectedIds);
|
|
537
|
+
}
|
|
530
538
|
}
|
|
531
539
|
}, {
|
|
532
540
|
key: "render",
|
|
@@ -598,8 +606,7 @@ TreeView.propTypes = {
|
|
|
598
606
|
onNodeClick: _propTypes["default"].func,
|
|
599
607
|
onNodeOpen: _propTypes["default"].func,
|
|
600
608
|
nodeElementsValidations: _propTypes["default"].object,
|
|
601
|
-
enableDynamicData: _propTypes["default"].bool
|
|
602
|
-
idsInLoading: _propTypes["default"].arrayOf(_propTypes["default"].number)
|
|
609
|
+
enableDynamicData: _propTypes["default"].bool
|
|
603
610
|
};
|
|
604
611
|
TreeView.defaultProps = {
|
|
605
612
|
customClass: '',
|
|
@@ -621,8 +628,7 @@ TreeView.defaultProps = {
|
|
|
621
628
|
onNodeClick: undefined,
|
|
622
629
|
onNodeOpen: undefined,
|
|
623
630
|
nodeElementsValidations: undefined,
|
|
624
|
-
enableDynamicData: false
|
|
625
|
-
idsInLoading: []
|
|
631
|
+
enableDynamicData: false
|
|
626
632
|
};
|
|
627
633
|
var _default = TreeView;
|
|
628
634
|
exports["default"] = _default;
|
package/lib/treeview_old/Node.js
CHANGED
|
@@ -35,7 +35,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
35
35
|
|
|
36
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
37
|
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
39
|
|
|
40
40
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
41
|
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var getCalendarDropdownStyle = function getCalendarDropdownStyle(_ref) {
|
|
9
|
-
var topPosition = _ref.topPosition,
|
|
10
|
-
leftPosition = _ref.leftPosition,
|
|
11
|
-
width = _ref.width;
|
|
12
|
-
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var _default = getCalendarDropdownStyle;
|
|
16
|
-
exports["default"] = _default;
|