linear-react-components-ui 1.0.0-rc.1 → 1.0.0-rc.2
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/index.d.ts +10 -25
- package/lib/index.js +5 -131
- package/lib/table/Header.js +34 -6
- package/lib/table/types.d.ts +8 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
export { default as ButtonContainer } from './buttons/button_container/index.js';
|
|
2
|
-
export { default as Button } from './buttons/Button.js';
|
|
3
|
-
export { default as DangerButton } from './buttons/DangerButton.js';
|
|
4
|
-
export { default as CancelButton } from './buttons/CancelButton.js';
|
|
5
|
-
export { default as EditButton } from './buttons/EditButton.js';
|
|
6
|
-
export { default as DestroyButton } from './buttons/DestroyButton.js';
|
|
7
|
-
export { default as AddButton } from './buttons/AddButton.js';
|
|
8
|
-
export { default as ActivateButton } from './buttons/ActivateButton.js';
|
|
9
|
-
export { default as InactivateButton } from './buttons/InactivateButton.js';
|
|
10
1
|
export { default as Panel } from './panel/Default.js';
|
|
11
|
-
export { default as PrimaryPanel } from './panel/PrimaryPanel.js';
|
|
12
|
-
export { default as DangerPanel } from './panel/DangerPanel.js';
|
|
13
|
-
export { default as WarningPanel } from './panel/WarningPanel.js';
|
|
14
|
-
export { default as SuccessPanel } from './panel/SuccessPanel.js';
|
|
15
|
-
export { default as InfoPanel } from './panel/InfoPanel.js';
|
|
16
|
-
export { default as PanelHeader } from './panel/Header.js';
|
|
17
|
-
export { default as PanelContent } from './panel/Content.js';
|
|
18
2
|
export { default as Toolbar } from './toolbar/index.js';
|
|
3
|
+
export { default as Button } from './buttons/Button.js';
|
|
19
4
|
export { default as Label } from './labels/DefaultLabel.js';
|
|
20
5
|
export { default as Icon } from './icons/index.js';
|
|
21
6
|
export { default as List } from './list/index.js';
|
|
22
7
|
export { default as Radio } from './radio/index.js';
|
|
23
8
|
export { default as Tab } from './tabs/index.js';
|
|
24
9
|
export { default as Dialog } from './dialog/base/index.js';
|
|
25
|
-
|
|
26
|
-
export { default as LabelBar } from './toolbar/LabelBar.js';
|
|
27
|
-
export { default as Separator } from './toolbar/Separator.js';
|
|
28
|
-
export { default as ToolBarGroup } from './toolbar/ToolBarGroup.js';
|
|
29
|
-
export { default as TabPanel } from './tabs/Panel.js';
|
|
10
|
+
import './types-3c6f1c20.js';
|
|
30
11
|
import 'react';
|
|
31
|
-
import './@types/Position.js';
|
|
32
|
-
import './buttons/types.js';
|
|
33
12
|
import './@types/PermissionAttr.js';
|
|
34
|
-
import './@types/Size.js';
|
|
35
|
-
import './types-3c6f1c20.js';
|
|
36
13
|
import './internals/colorStyles.js';
|
|
14
|
+
import './toolbar/ToolBarGroup.js';
|
|
37
15
|
import './toolbar/types.js';
|
|
38
16
|
import './@types/ButtonTypes.js';
|
|
17
|
+
import './@types/Position.js';
|
|
18
|
+
import './@types/Size.js';
|
|
39
19
|
import './treeview/types.js';
|
|
20
|
+
import './toolbar/Separator.js';
|
|
21
|
+
import './toolbar/ButtonBar.js';
|
|
22
|
+
import './toolbar/LabelBar.js';
|
|
23
|
+
import './buttons/types.js';
|
|
40
24
|
import './labels/types.js';
|
|
41
25
|
import './icons/types.js';
|
|
42
26
|
import './@types/PointerEvents.js';
|
|
@@ -46,5 +30,6 @@ import './list/types.js';
|
|
|
46
30
|
import './list/Item.js';
|
|
47
31
|
import './list/Separator.js';
|
|
48
32
|
import './radio/types.js';
|
|
33
|
+
import './tabs/Panel.js';
|
|
49
34
|
import './tabs/types.js';
|
|
50
35
|
import './dialog/types.js';
|
package/lib/index.js
CHANGED
|
@@ -1,106 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
Object.defineProperty(exports, "ActivateButton", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _buttons.ActivateButton;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "AddButton", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _buttons.AddButton;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
6
|
Object.defineProperty(exports, "Button", {
|
|
21
7
|
enumerable: true,
|
|
22
8
|
get: function get() {
|
|
23
9
|
return _buttons.default;
|
|
24
10
|
}
|
|
25
11
|
});
|
|
26
|
-
Object.defineProperty(exports, "ButtonBar", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _toolbar.ButtonBar;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "ButtonContainer", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _buttons.ButtonContainer;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(exports, "CancelButton", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function get() {
|
|
41
|
-
return _buttons.CancelButton;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "DangerButton", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function get() {
|
|
47
|
-
return _buttons.DangerButton;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(exports, "DangerPanel", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
get: function get() {
|
|
53
|
-
return _panel.DangerPanel;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(exports, "DestroyButton", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
get: function get() {
|
|
59
|
-
return _buttons.DestroyButton;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
12
|
Object.defineProperty(exports, "Dialog", {
|
|
63
13
|
enumerable: true,
|
|
64
14
|
get: function get() {
|
|
65
15
|
return _base.default;
|
|
66
16
|
}
|
|
67
17
|
});
|
|
68
|
-
Object.defineProperty(exports, "EditButton", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function get() {
|
|
71
|
-
return _buttons.EditButton;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
18
|
Object.defineProperty(exports, "Icon", {
|
|
75
19
|
enumerable: true,
|
|
76
20
|
get: function get() {
|
|
77
21
|
return _icons.default;
|
|
78
22
|
}
|
|
79
23
|
});
|
|
80
|
-
Object.defineProperty(exports, "InactivateButton", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function get() {
|
|
83
|
-
return _buttons.InactivateButton;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "InfoPanel", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function get() {
|
|
89
|
-
return _panel.InfoPanel;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
24
|
Object.defineProperty(exports, "Label", {
|
|
93
25
|
enumerable: true,
|
|
94
26
|
get: function get() {
|
|
95
27
|
return _labels.default;
|
|
96
28
|
}
|
|
97
29
|
});
|
|
98
|
-
Object.defineProperty(exports, "LabelBar", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function get() {
|
|
101
|
-
return _toolbar.LabelBar;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
30
|
Object.defineProperty(exports, "List", {
|
|
105
31
|
enumerable: true,
|
|
106
32
|
get: function get() {
|
|
@@ -113,78 +39,30 @@ Object.defineProperty(exports, "Panel", {
|
|
|
113
39
|
return _panel.default;
|
|
114
40
|
}
|
|
115
41
|
});
|
|
116
|
-
Object.defineProperty(exports, "PanelContent", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function get() {
|
|
119
|
-
return _panel.PanelContent;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(exports, "PanelHeader", {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
get: function get() {
|
|
125
|
-
return _panel.PanelHeader;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(exports, "PrimaryPanel", {
|
|
129
|
-
enumerable: true,
|
|
130
|
-
get: function get() {
|
|
131
|
-
return _panel.PrimaryPanel;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
42
|
Object.defineProperty(exports, "Radio", {
|
|
135
43
|
enumerable: true,
|
|
136
44
|
get: function get() {
|
|
137
45
|
return _radio.default;
|
|
138
46
|
}
|
|
139
47
|
});
|
|
140
|
-
Object.defineProperty(exports, "Separator", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function get() {
|
|
143
|
-
return _toolbar.Separator;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(exports, "SuccessPanel", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
get: function get() {
|
|
149
|
-
return _panel.SuccessPanel;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
48
|
Object.defineProperty(exports, "Tab", {
|
|
153
49
|
enumerable: true,
|
|
154
50
|
get: function get() {
|
|
155
51
|
return _tabs.default;
|
|
156
52
|
}
|
|
157
53
|
});
|
|
158
|
-
Object.defineProperty(exports, "TabPanel", {
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function get() {
|
|
161
|
-
return _tabs.TabPanel;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "ToolBarGroup", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _toolbar.ToolBarGroup;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
54
|
Object.defineProperty(exports, "Toolbar", {
|
|
171
55
|
enumerable: true,
|
|
172
56
|
get: function get() {
|
|
173
57
|
return _toolbar.default;
|
|
174
58
|
}
|
|
175
59
|
});
|
|
176
|
-
Object.defineProperty(exports, "WarningPanel", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
get: function get() {
|
|
179
|
-
return _panel.WarningPanel;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
60
|
|
|
183
|
-
var
|
|
61
|
+
var _panel = _interopRequireDefault(require("./panel"));
|
|
184
62
|
|
|
185
|
-
var
|
|
63
|
+
var _toolbar = _interopRequireDefault(require("./toolbar"));
|
|
186
64
|
|
|
187
|
-
var
|
|
65
|
+
var _buttons = _interopRequireDefault(require("./buttons"));
|
|
188
66
|
|
|
189
67
|
var _labels = _interopRequireDefault(require("./labels"));
|
|
190
68
|
|
|
@@ -194,12 +72,8 @@ var _list = _interopRequireDefault(require("./list"));
|
|
|
194
72
|
|
|
195
73
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
196
74
|
|
|
197
|
-
var _tabs =
|
|
75
|
+
var _tabs = _interopRequireDefault(require("./tabs"));
|
|
198
76
|
|
|
199
77
|
var _base = _interopRequireDefault(require("./dialog/base"));
|
|
200
78
|
|
|
201
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
202
|
-
|
|
203
|
-
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); }
|
|
204
|
-
|
|
205
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
79
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/table/Header.js
CHANGED
|
@@ -26,27 +26,55 @@ var getColumnsWidth = function getColumnsWidth(children) {
|
|
|
26
26
|
var columns = children.props.children;
|
|
27
27
|
if (!_lodash.default.isArray(columns)) columns = [columns];
|
|
28
28
|
columns.forEach(function (element) {
|
|
29
|
-
var colWidth;
|
|
29
|
+
var colWidth = 0;
|
|
30
30
|
|
|
31
|
-
if (
|
|
31
|
+
if (_lodash.default.isArray(element)) {
|
|
32
|
+
element.forEach(function (elementArray) {
|
|
33
|
+
if (elementArray && elementArray.props.style && elementArray.props.style.width) {
|
|
34
|
+
colWidth = elementArray.props.style.width;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
columnsWidth.push(colWidth);
|
|
38
|
+
});
|
|
39
|
+
} else if (element && element.props.style && element.props.style.width) {
|
|
32
40
|
colWidth = element.props.style.width;
|
|
41
|
+
columnsWidth.push(colWidth);
|
|
33
42
|
}
|
|
34
|
-
|
|
35
|
-
columnsWidth.push(colWidth);
|
|
36
43
|
});
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
return columnsWidth;
|
|
40
47
|
};
|
|
41
48
|
|
|
49
|
+
var countColumnsFromChildren = function countColumnsFromChildren(children) {
|
|
50
|
+
var count = 0;
|
|
51
|
+
|
|
52
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
53
|
+
children.props.children.forEach(function (child) {
|
|
54
|
+
if (_lodash.default.isArray(child)) {
|
|
55
|
+
child.forEach(function (arrayChild) {
|
|
56
|
+
count = arrayChild ? count + 1 : count;
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
count = child ? count + 1 : count;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return count;
|
|
65
|
+
};
|
|
66
|
+
|
|
42
67
|
var getColumnsCount = function getColumnsCount(children) {
|
|
43
68
|
var columnsCount = 0;
|
|
44
69
|
|
|
45
70
|
if (_lodash.default.isArray(children) && children.length > 0 && children[0].props) {
|
|
46
|
-
columnsCount = children[0].props.children
|
|
71
|
+
columnsCount = countColumnsFromChildren(children[0].props.children);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(children) && children.props && children.props.children) {
|
|
75
|
+
columnsCount = countColumnsFromChildren(children.props.children);
|
|
47
76
|
}
|
|
48
77
|
|
|
49
|
-
if ( /*#__PURE__*/(0, _react.isValidElement)(children) && children.props) columnsCount = children.props.children.length;
|
|
50
78
|
return columnsCount;
|
|
51
79
|
};
|
|
52
80
|
|
package/lib/table/types.d.ts
CHANGED
|
@@ -73,5 +73,12 @@ interface ITableRowContext {
|
|
|
73
73
|
skeletonInRows?: number;
|
|
74
74
|
rowBorder?: boolean;
|
|
75
75
|
}
|
|
76
|
+
declare type TableElement = {
|
|
77
|
+
props: {
|
|
78
|
+
style: {
|
|
79
|
+
width: string | number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
76
83
|
|
|
77
|
-
export { ITableBodyProps, ITableContext, ITableHeaderProps, ITableProps, ITableRowContext, ITableRowProps };
|
|
84
|
+
export { ITableBodyProps, ITableContext, ITableHeaderProps, ITableProps, ITableRowContext, ITableRowProps, TableElement };
|