linear-react-components-ui 1.0.12 → 1.0.13-beta.0
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 +1 -15
- package/lib/assets/styles/table.scss +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/inputs/multiSelect/index.js +0 -1
- package/lib/panel/Content.d.ts +2 -2
- package/lib/panel/Content.js +38 -80
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/Default.d.ts +2 -2
- package/lib/panel/Default.js +9 -6
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +13 -8
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/helpers.d.ts +1 -1
- package/lib/panel/helpers.js +12 -1
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/types.d.ts +1 -1
- package/lib/table/RowColumn.js +6 -2
- package/lib/table/index.js +2 -1
- package/lib/table/types.d.ts +2 -0
- package/lib/{types-98a22f0f.d.ts → types-fe4a1068.d.ts} +10 -10
- package/package.json +1 -1
|
@@ -52,21 +52,7 @@
|
|
|
52
52
|
flex: 1;
|
|
53
53
|
overflow: auto;
|
|
54
54
|
padding: 15px;
|
|
55
|
-
|
|
56
|
-
width: 100%;
|
|
57
|
-
position: absolute;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
visibility: hidden;
|
|
60
|
-
top: 0;
|
|
61
|
-
left: 0;
|
|
62
|
-
> .observer {
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 10px;
|
|
65
|
-
bottom: 0;
|
|
66
|
-
left: 0;
|
|
67
|
-
position: absolute;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
55
|
+
position: relative;
|
|
70
56
|
}
|
|
71
57
|
}
|
|
72
58
|
|
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { default as List } from './list/index.js';
|
|
|
7
7
|
export { default as Radio } from './radio/index.js';
|
|
8
8
|
export { default as Tab } from './tabs/index.js';
|
|
9
9
|
export { default as Dialog } from './dialog/base/index.js';
|
|
10
|
-
import './types-
|
|
10
|
+
import './types-fe4a1068.js';
|
|
11
11
|
import 'react';
|
|
12
12
|
import './@types/PermissionAttr.js';
|
|
13
13
|
import './internals/colorStyles.js';
|
package/lib/panel/Content.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as IPanelContentProps } from '../types-fe4a1068.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
|
6
6
|
import '../icons/helper.js';
|
|
7
7
|
|
|
8
|
-
declare const PanelContent: ({ customClass, children,
|
|
8
|
+
declare const PanelContent: ({ customClass, children, ...rest }: IPanelContentProps) => JSX.Element | null;
|
|
9
9
|
|
|
10
10
|
export { PanelContent as default };
|
package/lib/panel/Content.js
CHANGED
|
@@ -6,28 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _helpers =
|
|
9
|
+
var _helpers = _interopRequireWildcard(require("./helpers"));
|
|
10
10
|
var _noPermission = _interopRequireDefault(require("../noPermission"));
|
|
11
|
+
var _excluded = ["customClass", "children"];
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
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); }
|
|
13
14
|
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; }
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
24
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
18
|
var PanelContent = function PanelContent(_ref) {
|
|
26
|
-
var _rootElementRef$curre3;
|
|
27
19
|
var customClass = _ref.customClass,
|
|
28
20
|
children = _ref.children,
|
|
29
|
-
|
|
30
|
-
style = _ref.style;
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
22
|
var _useContext = (0, _react.useContext)(_helpers.default),
|
|
32
23
|
opened = _useContext.opened,
|
|
33
24
|
onEndReached = _useContext.onEndReached,
|
|
@@ -35,75 +26,42 @@ var PanelContent = function PanelContent(_ref) {
|
|
|
35
26
|
onEndReachedThreshold = _useContext$onEndReac === void 0 ? 0.1 : _useContext$onEndReac,
|
|
36
27
|
hideContent = _useContext.hideContent;
|
|
37
28
|
var rootElementRef = (0, _react.useRef)(null);
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
var enableOnEndReached = (0, _react.useRef)(true);
|
|
30
|
+
var lastScrollHeight = (0, _react.useRef)(0);
|
|
31
|
+
var onScrollEndReached = (0, _react.useCallback)(function () {
|
|
32
|
+
var element = rootElementRef.current;
|
|
33
|
+
if (element && onEndReached) {
|
|
34
|
+
var scrollTop = element.scrollTop,
|
|
35
|
+
scrollHeight = element.scrollHeight,
|
|
36
|
+
clientHeight = element.clientHeight;
|
|
37
|
+
var scrollOffset = scrollHeight - clientHeight - scrollTop - 1;
|
|
38
|
+
var threshold = (0, _helpers.getCurrentThreshold)(element, onEndReachedThreshold);
|
|
39
|
+
if (scrollOffset <= threshold && enableOnEndReached.current) {
|
|
40
|
+
onEndReached();
|
|
41
|
+
lastScrollHeight.current = scrollHeight;
|
|
42
|
+
if (lastScrollHeight.current === scrollHeight) enableOnEndReached.current = false;
|
|
43
|
+
} else if (scrollOffset > threshold && !enableOnEndReached.current) {
|
|
44
|
+
enableOnEndReached.current = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, [onEndReached, onEndReachedThreshold, enableOnEndReached.current, rootElementRef.current, lastScrollHeight.current]);
|
|
44
48
|
(0, _react.useEffect)(function () {
|
|
45
|
-
if (
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (entry.isIntersecting && onEndReached) {
|
|
50
|
-
onEndReached();
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
threshold: onEndReachedThreshold,
|
|
54
|
-
root: rootElementRef.current,
|
|
55
|
-
rootMargin: '15px'
|
|
56
|
-
});
|
|
57
|
-
observer.observe(observedElement.current);
|
|
58
|
-
var scrollObserver = new ResizeObserver(function () {
|
|
59
|
-
var _rootElementRef$curre;
|
|
60
|
-
var currentScrollHeight = (_rootElementRef$curre = rootElementRef.current) === null || _rootElementRef$curre === void 0 ? void 0 : _rootElementRef$curre.scrollHeight;
|
|
61
|
-
if (currentScrollHeight) setScrollHeight(currentScrollHeight);
|
|
62
|
-
});
|
|
63
|
-
scrollObserver.observe(rootElementRef.current);
|
|
64
|
-
var mutationObserver = new MutationObserver(function (mutationList) {
|
|
65
|
-
var mutations = mutationList;
|
|
66
|
-
var lastMutation = mutations.findLast(function (mutation) {
|
|
67
|
-
return mutation.type === 'childList';
|
|
68
|
-
});
|
|
69
|
-
if ((lastMutation === null || lastMutation === void 0 ? void 0 : lastMutation.type) === 'childList') {
|
|
70
|
-
var _rootElementRef$curre2;
|
|
71
|
-
var currentScrollHeight = (_rootElementRef$curre2 = rootElementRef.current) === null || _rootElementRef$curre2 === void 0 ? void 0 : _rootElementRef$curre2.scrollHeight;
|
|
72
|
-
if (currentScrollHeight) setScrollHeight(currentScrollHeight);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
mutationObserver.observe(rootElementRef.current, {
|
|
76
|
-
childList: true,
|
|
77
|
-
subtree: true
|
|
78
|
-
});
|
|
79
|
-
return function () {
|
|
80
|
-
observer.disconnect();
|
|
81
|
-
scrollObserver.disconnect();
|
|
82
|
-
mutationObserver.disconnect();
|
|
83
|
-
};
|
|
49
|
+
if (onEndReached) {
|
|
50
|
+
var _rootElementRef$curre, _rootElementRef$curre2;
|
|
51
|
+
(_rootElementRef$curre = rootElementRef.current) === null || _rootElementRef$curre === void 0 ? void 0 : _rootElementRef$curre.addEventListener('scroll', onScrollEndReached);
|
|
52
|
+
(_rootElementRef$curre2 = rootElementRef.current) === null || _rootElementRef$curre2 === void 0 ? void 0 : _rootElementRef$curre2.addEventListener('resize', onScrollEndReached);
|
|
84
53
|
}
|
|
85
|
-
return function () {
|
|
86
|
-
|
|
54
|
+
return function () {
|
|
55
|
+
var _rootElementRef$curre3, _rootElementRef$curre4;
|
|
56
|
+
(_rootElementRef$curre3 = rootElementRef.current) === null || _rootElementRef$curre3 === void 0 ? void 0 : _rootElementRef$curre3.removeEventListener('scroll', onScrollEndReached);
|
|
57
|
+
(_rootElementRef$curre4 = rootElementRef.current) === null || _rootElementRef$curre4 === void 0 ? void 0 : _rootElementRef$curre4.removeEventListener('resize', onScrollEndReached);
|
|
58
|
+
};
|
|
59
|
+
}, [onScrollEndReached]);
|
|
87
60
|
if (!opened) return null;
|
|
88
|
-
return hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
return hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
89
62
|
ref: rootElementRef,
|
|
90
|
-
className: "panel-content ".concat(customClass)
|
|
91
|
-
|
|
92
|
-
position: 'relative'
|
|
93
|
-
})
|
|
94
|
-
}, opened && children, onEndReached && /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
-
className: "observer-wrapper",
|
|
96
|
-
ref: observerWrapperElement,
|
|
97
|
-
style: {
|
|
98
|
-
height: scrollHeight || ((_rootElementRef$curre3 = rootElementRef.current) === null || _rootElementRef$curre3 === void 0 ? void 0 : _rootElementRef$curre3.clientHeight)
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
ref: observedElement,
|
|
102
|
-
style: {
|
|
103
|
-
height: observerTargetHeight
|
|
104
|
-
},
|
|
105
|
-
className: "observer"
|
|
106
|
-
})));
|
|
63
|
+
className: "panel-content ".concat(customClass !== null && customClass !== void 0 ? customClass : '')
|
|
64
|
+
}, rest), opened && children);
|
|
107
65
|
};
|
|
108
66
|
var _default = PanelContent;
|
|
109
67
|
exports.default = _default;
|
package/lib/panel/Default.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as IPanelProps } from '../types-
|
|
1
|
+
import { I as IPanelProps } from '../types-fe4a1068.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
|
6
6
|
import '../icons/helper.js';
|
|
7
7
|
|
|
8
|
-
declare const DefaultPanel: ({ startOpened, toggleable, customClass, children,
|
|
8
|
+
declare const DefaultPanel: ({ startOpened, toggleable, customClass, children, title, gridCols, onEndReached, onEndReachedThreshold, permissionAttr, colorStyle, ...rest }: IPanelProps) => JSX.Element | null;
|
|
9
9
|
|
|
10
10
|
export { DefaultPanel as default };
|
package/lib/panel/Default.js
CHANGED
|
@@ -10,29 +10,33 @@ var _gridlayout = _interopRequireDefault(require("../gridlayout"));
|
|
|
10
10
|
var _Header = _interopRequireDefault(require("./Header"));
|
|
11
11
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
12
12
|
var _permissionValidations = require("../permissionValidations");
|
|
13
|
+
var _excluded = ["startOpened", "toggleable", "customClass", "children", "title", "gridCols", "onEndReached", "onEndReachedThreshold", "permissionAttr", "colorStyle"];
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
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); }
|
|
15
16
|
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; }
|
|
17
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
21
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
22
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
26
|
var DefaultPanel = function DefaultPanel(_ref) {
|
|
23
27
|
var _ref$startOpened = _ref.startOpened,
|
|
24
28
|
startOpened = _ref$startOpened === void 0 ? true : _ref$startOpened,
|
|
25
29
|
toggleable = _ref.toggleable,
|
|
26
30
|
customClass = _ref.customClass,
|
|
27
31
|
children = _ref.children,
|
|
28
|
-
style = _ref.style,
|
|
29
32
|
title = _ref.title,
|
|
30
33
|
gridCols = _ref.gridCols,
|
|
31
34
|
onEndReached = _ref.onEndReached,
|
|
32
35
|
_ref$onEndReachedThre = _ref.onEndReachedThreshold,
|
|
33
36
|
onEndReachedThreshold = _ref$onEndReachedThre === void 0 ? 0.1 : _ref$onEndReachedThre,
|
|
34
37
|
permissionAttr = _ref.permissionAttr,
|
|
35
|
-
colorStyle = _ref.colorStyle
|
|
38
|
+
colorStyle = _ref.colorStyle,
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
40
|
var _useState = (0, _react.useState)(startOpened),
|
|
37
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
42
|
opened = _useState2[0],
|
|
@@ -48,10 +52,9 @@ var DefaultPanel = function DefaultPanel(_ref) {
|
|
|
48
52
|
return cssClass;
|
|
49
53
|
};
|
|
50
54
|
var renderContent = function renderContent() {
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className: getCssClass()
|
|
53
|
-
|
|
54
|
-
}, title && /*#__PURE__*/_react.default.createElement(_Header.default, {
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
56
|
+
className: getCssClass()
|
|
57
|
+
}, rest), title && /*#__PURE__*/_react.default.createElement(_Header.default, {
|
|
55
58
|
title: title
|
|
56
59
|
}), children);
|
|
57
60
|
};
|
package/lib/panel/Header.d.ts
CHANGED
package/lib/panel/Header.js
CHANGED
|
@@ -9,9 +9,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
10
10
|
var _buttons = _interopRequireWildcard(require("../buttons"));
|
|
11
11
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
12
|
+
var _excluded = ["titleIcon", "icon", "title", "children", "customClass", "headerColored", "styleForTitle", "customClassForTitle"];
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
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); }
|
|
14
15
|
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; }
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
19
|
var getIcon = function getIcon(titleIcon, icon) {
|
|
16
20
|
if (icon) {
|
|
17
21
|
return icon;
|
|
@@ -28,7 +32,7 @@ var getClassName = function getClassName(_ref) {
|
|
|
28
32
|
var customClass = _ref.customClass,
|
|
29
33
|
_ref$headerColored = _ref.headerColored,
|
|
30
34
|
headerColored = _ref$headerColored === void 0 ? true : _ref$headerColored;
|
|
31
|
-
var className = "panel-header ".concat(customClass);
|
|
35
|
+
var className = "panel-header ".concat(customClass !== null && customClass !== void 0 ? customClass : '');
|
|
32
36
|
if (!headerColored) className += ' -uncolored';
|
|
33
37
|
return className;
|
|
34
38
|
};
|
|
@@ -37,20 +41,21 @@ var PanelHeader = function PanelHeader(props) {
|
|
|
37
41
|
icon = props.icon,
|
|
38
42
|
title = props.title,
|
|
39
43
|
children = props.children,
|
|
40
|
-
|
|
44
|
+
customClass = props.customClass,
|
|
45
|
+
headerColored = props.headerColored,
|
|
41
46
|
styleForTitle = props.styleForTitle,
|
|
42
|
-
customClassForTitle = props.customClassForTitle
|
|
47
|
+
customClassForTitle = props.customClassForTitle,
|
|
48
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
43
49
|
var _useContext = (0, _react.useContext)(_helpers.default),
|
|
44
50
|
toggleable = _useContext.toggleable,
|
|
45
51
|
handlerToggleable = _useContext.handlerToggleable,
|
|
46
52
|
opened = _useContext.opened;
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
-
className: getClassName(props)
|
|
49
|
-
|
|
50
|
-
}, (icon || titleIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
54
|
+
className: getClassName(props)
|
|
55
|
+
}, rest), (icon || titleIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
51
56
|
className: "".concat(icon !== null || titleIcon !== null ? 'icon-left-panel' : '')
|
|
52
57
|
}, getIcon(titleIcon, icon)), title && /*#__PURE__*/_react.default.createElement("h1", {
|
|
53
|
-
className: "title ".concat(customClassForTitle),
|
|
58
|
+
className: "title ".concat(customClassForTitle !== null && customClassForTitle !== void 0 ? customClassForTitle : ''),
|
|
54
59
|
style: styleForTitle
|
|
55
60
|
}, title), toggleable && /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
|
|
56
61
|
position: "right"
|
package/lib/panel/InfoPanel.d.ts
CHANGED
package/lib/panel/ToolBar.d.ts
CHANGED
package/lib/panel/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { P as default, n as numberAroundZeroAndOne } from '../types-
|
|
2
|
+
export { P as default, g as getCurrentThreshold, n as numberAroundZeroAndOne } from '../types-fe4a1068.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
package/lib/panel/helpers.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
exports.getCurrentThreshold = getCurrentThreshold;
|
|
7
8
|
exports.numberAroundZeroAndOne = numberAroundZeroAndOne;
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -14,11 +15,21 @@ function numberAroundZeroAndOne(_ref) {
|
|
|
14
15
|
if (props[propName]) {
|
|
15
16
|
var value = props[propName];
|
|
16
17
|
if (typeof value === 'number') {
|
|
17
|
-
return value >= 0 && value <= 1 ?
|
|
18
|
+
return value >= 0 && value <= 1 ? value : new Error("invalid value of ".concat(propName, " in ").concat(componentName, " component, is not between 0 and 1"));
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
23
|
+
function getCurrentThreshold(element, threshold) {
|
|
24
|
+
if (threshold > 1) return 1;
|
|
25
|
+
if (threshold < 0) return 0;
|
|
26
|
+
var scrollHeight = element.scrollHeight,
|
|
27
|
+
clientHeight = element.clientHeight;
|
|
28
|
+
var offsetHeight = scrollHeight - clientHeight;
|
|
29
|
+
var scrollThreshold = Math.round(scrollHeight * threshold);
|
|
30
|
+
var maxScrollThreshold = Math.round(offsetHeight - offsetHeight * 0.3);
|
|
31
|
+
return Math.min(scrollThreshold, maxScrollThreshold);
|
|
32
|
+
}
|
|
22
33
|
var PanelContext = /*#__PURE__*/_react.default.createContext({});
|
|
23
34
|
var _default = PanelContext;
|
|
24
35
|
exports.default = _default;
|
package/lib/panel/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { default as SuccessPanel } from './SuccessPanel.js';
|
|
|
6
6
|
export { default as InfoPanel } from './InfoPanel.js';
|
|
7
7
|
export { default as PanelHeader } from './Header.js';
|
|
8
8
|
export { default as PanelContent } from './Content.js';
|
|
9
|
-
import '../types-
|
|
9
|
+
import '../types-fe4a1068.js';
|
|
10
10
|
import 'react';
|
|
11
11
|
import '../@types/PermissionAttr.js';
|
|
12
12
|
import '../internals/colorStyles.js';
|
package/lib/panel/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { C as ContextProps, a as IPanelHeaderProps, I as IPanelProps,
|
|
2
|
+
export { C as ContextProps, a as IPanelContentProps, b as IPanelHeaderProps, I as IPanelProps, c as IParameterFunction } from '../types-fe4a1068.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
package/lib/table/RowColumn.js
CHANGED
|
@@ -40,7 +40,9 @@ var RowColumn = function RowColumn(props) {
|
|
|
40
40
|
displayContent = _props$displayContent === void 0 ? 'always' : _props$displayContent,
|
|
41
41
|
textAlign = props.textAlign,
|
|
42
42
|
_props$visible = props.visible,
|
|
43
|
-
visible = _props$visible === void 0 ? true : _props$visible
|
|
43
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
44
|
+
rowSpan = props.rowSpan,
|
|
45
|
+
colSpan = props.colSpan;
|
|
44
46
|
var context = (0, _react.useContext)(_helpers.RowContext);
|
|
45
47
|
var skeletonize = context.skeletonize,
|
|
46
48
|
vertical = context.vertical,
|
|
@@ -64,7 +66,9 @@ var RowColumn = function RowColumn(props) {
|
|
|
64
66
|
if (!visible) return null;
|
|
65
67
|
if (skeletonize && !skeletonInRows && !vertical) return null;
|
|
66
68
|
return /*#__PURE__*/_react.default.createElement("td", {
|
|
67
|
-
|
|
69
|
+
rowSpan: rowSpan,
|
|
70
|
+
colSpan: colSpan,
|
|
71
|
+
className: "rowcolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(!context.rowBorder && ' -noborder', " ").concat(!rowSpan ? ' -norowspan' : ''),
|
|
68
72
|
style: style,
|
|
69
73
|
onClick: function onClick(e) {
|
|
70
74
|
getColClickEvent(e, _objectSpread(_objectSpread({}, context), props));
|
package/lib/table/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var _RowColumn = _interopRequireDefault(require("./RowColumn"));
|
|
|
45
45
|
require("../assets/styles/table.scss");
|
|
46
46
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
47
47
|
var _excluded = ["children"],
|
|
48
|
-
_excluded2 = ["onColClick", "onRowClick", "bodyScrollable", "vertical", "skeletonize", "strict", "skeletonHeight", "skeletonInHeader", "skeletonInRows", "customClass", "bordered", "hovered", "headerColored", "condensed", "selectedRowId"];
|
|
48
|
+
_excluded2 = ["onColClick", "onRowClick", "bodyScrollable", "vertical", "skeletonize", "strict", "skeletonHeight", "skeletonInHeader", "skeletonInRows", "customClass", "bordered", "hovered", "headerColored", "condensed", "selectedRowId", "striped"];
|
|
49
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
50
|
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); }
|
|
51
51
|
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; }
|
|
@@ -91,6 +91,7 @@ var Table = function Table(_ref2) {
|
|
|
91
91
|
headerColored = props.headerColored,
|
|
92
92
|
condensed = props.condensed,
|
|
93
93
|
selectedRowIdFromProps = props.selectedRowId,
|
|
94
|
+
striped = props.striped,
|
|
94
95
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
95
96
|
var _useState = (0, _react.useState)(selectedRowIdFromProps),
|
|
96
97
|
_useState2 = _slicedToArray(_useState, 2),
|
package/lib/table/types.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ interface ITableRowProps extends Pick<TableHTMLAttributes<HTMLTableRowElement>,
|
|
|
55
55
|
dividerColor?: 'primary' | 'danger' | 'info' | 'success' | 'warning';
|
|
56
56
|
dividerColSpan?: number;
|
|
57
57
|
dividerStyle?: CSSProperties;
|
|
58
|
+
rowSpan?: number;
|
|
59
|
+
colSpan?: number;
|
|
58
60
|
}
|
|
59
61
|
interface ITableContext {
|
|
60
62
|
bodyScrollable?: boolean;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React__default, { ReactNode, ReactElement } from 'react';
|
|
1
|
+
import React__default, { ComponentPropsWithoutRef, ReactNode, ReactElement } from 'react';
|
|
2
2
|
import { PermissionAttr } from './@types/PermissionAttr.js';
|
|
3
3
|
import ColorStyles from './internals/colorStyles.js';
|
|
4
4
|
import { IconNames } from './@types/Icon.js';
|
|
5
5
|
|
|
6
|
-
declare function numberAroundZeroAndOne({ props, propName, componentName }: IParameterFunction): Error | null;
|
|
6
|
+
declare function numberAroundZeroAndOne({ props, propName, componentName }: IParameterFunction): number | Error | null;
|
|
7
|
+
declare function getCurrentThreshold(element: HTMLDivElement, threshold: number): number;
|
|
7
8
|
declare const PanelContext: React__default.Context<ContextProps>;
|
|
8
9
|
|
|
9
|
-
interface IPanelProps {
|
|
10
|
+
interface IPanelProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
|
|
10
11
|
customClass?: string;
|
|
11
12
|
startOpened?: boolean;
|
|
12
13
|
toggleable?: boolean;
|
|
13
14
|
children?: ReactNode;
|
|
14
|
-
|
|
15
|
-
colorStyle?: typeof ColorStyles | '' | string;
|
|
15
|
+
colorStyle?: typeof ColorStyles | string;
|
|
16
16
|
gridCols?: string;
|
|
17
17
|
title?: string;
|
|
18
18
|
onEndReached?: () => void;
|
|
19
19
|
onEndReachedThreshold?: typeof numberAroundZeroAndOne | number;
|
|
20
20
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
21
|
-
observerTargetHeight?: number | string;
|
|
22
21
|
}
|
|
23
|
-
interface
|
|
22
|
+
interface IPanelContentProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
|
|
23
|
+
customClass?: string;
|
|
24
|
+
}
|
|
25
|
+
interface IPanelHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'className'> {
|
|
24
26
|
title?: string;
|
|
25
|
-
children?: ReactElement;
|
|
26
27
|
icon?: ReactElement;
|
|
27
28
|
titleIcon?: IconNames;
|
|
28
29
|
customClass?: string;
|
|
29
|
-
style?: object;
|
|
30
30
|
styleForTitle?: object;
|
|
31
31
|
customClassForTitle?: string;
|
|
32
32
|
headerColored?: boolean;
|
|
@@ -45,4 +45,4 @@ interface IParameterFunction {
|
|
|
45
45
|
componentName: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export { ContextProps as C, IPanelProps as I, PanelContext as P,
|
|
48
|
+
export { ContextProps as C, IPanelProps as I, PanelContext as P, IPanelContentProps as a, IPanelHeaderProps as b, IParameterFunction as c, getCurrentThreshold as g, numberAroundZeroAndOne as n };
|