linear-react-components-ui 1.0.10-rc.9 → 1.0.11-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.
Files changed (55) hide show
  1. package/.gitlab-ci.yml +2 -2
  2. package/.vscode/settings.json +4 -1
  3. package/lib/assets/styles/file.scss +33 -0
  4. package/lib/assets/styles/panel.scss +1 -0
  5. package/lib/assets/styles/shortcuts.scss +59 -0
  6. package/lib/form/Field.js +35 -18
  7. package/lib/form/FieldArray.js +53 -16
  8. package/lib/form/FieldNumber.js +12 -2
  9. package/lib/form/FieldPeriod.js +11 -1
  10. package/lib/form/helpers.d.ts +1 -1
  11. package/lib/form/helpers.js +2 -2
  12. package/lib/form/index.d.ts +2 -2
  13. package/lib/form/index.js +57 -36
  14. package/lib/form/types.d.ts +27 -10
  15. package/lib/form/withFieldHOC.js +1 -0
  16. package/lib/hint/index.js +17 -1
  17. package/lib/hint/types.d.ts +1 -1
  18. package/lib/icons/helper.d.ts +12 -0
  19. package/lib/icons/helper.js +12 -0
  20. package/lib/index.d.ts +1 -1
  21. package/lib/inputs/base/types.d.ts +1 -1
  22. package/lib/inputs/date/index.js +2 -1
  23. package/lib/inputs/file/DefaultFile.js +8 -2
  24. package/lib/inputs/file/DragDropFile.js +34 -14
  25. package/lib/inputs/file/types.d.ts +4 -1
  26. package/lib/inputs/mask/Cpf.js +4 -4
  27. package/lib/inputs/mask/imaskHOC.js +15 -11
  28. package/lib/inputs/multiSelect/index.js +0 -1
  29. package/lib/inputs/number/BaseNumber.js +1 -2
  30. package/lib/inputs/number/format_number.js +1 -1
  31. package/lib/inputs/period/index.js +1 -2
  32. package/lib/panel/Content.d.ts +2 -2
  33. package/lib/panel/Content.js +40 -37
  34. package/lib/panel/DangerPanel.d.ts +1 -1
  35. package/lib/panel/Default.d.ts +2 -2
  36. package/lib/panel/Default.js +9 -6
  37. package/lib/panel/Header.d.ts +1 -1
  38. package/lib/panel/Header.js +13 -8
  39. package/lib/panel/InfoPanel.d.ts +1 -1
  40. package/lib/panel/PrimaryPanel.d.ts +1 -1
  41. package/lib/panel/SuccessPanel.d.ts +1 -1
  42. package/lib/panel/ToolBar.d.ts +1 -1
  43. package/lib/panel/WarningPanel.d.ts +1 -1
  44. package/lib/panel/helpers.d.ts +1 -1
  45. package/lib/panel/helpers.js +12 -1
  46. package/lib/panel/index.d.ts +1 -1
  47. package/lib/panel/types.d.ts +1 -1
  48. package/lib/shortcuts/index.d.ts +7 -0
  49. package/lib/shortcuts/index.js +27 -0
  50. package/lib/shortcuts/types.d.ts +12 -0
  51. package/lib/shortcuts/types.js +5 -0
  52. package/lib/table/index.d.ts +1 -1
  53. package/lib/table/index.js +55 -32
  54. package/lib/{types-c1e2d0c9.d.ts → types-fe4a1068.d.ts} +10 -9
  55. package/package.json +1 -1
@@ -9,7 +9,6 @@ var _imask = _interopRequireDefault(require("imask"));
9
9
  var helpers = _interopRequireWildcard(require("./helpers"));
10
10
  var _permissionValidations = require("../../permissionValidations");
11
11
  var _format_number = require("../number/format_number");
12
- var _this = void 0;
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
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); }
15
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; }
@@ -100,7 +99,7 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
100
99
  maskRef.current.value = String(newValue);
101
100
  }
102
101
  };
103
- var onAccept = function onAccept() {
102
+ var onAccept = (0, _react.useCallback)(function () {
104
103
  if (onChange && !disableCallbacks && maskRef.current) {
105
104
  var _maskRef$current = maskRef.current,
106
105
  unmaskedValue = _maskRef$current.unmaskedValue,
@@ -113,8 +112,8 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
113
112
  }
114
113
  }, props.unmask ? unmaskedValue : maskRef.current.value);
115
114
  }
116
- };
117
- var onComplete = function onComplete() {
115
+ }, [onChange]);
116
+ var onComplete = (0, _react.useCallback)(function () {
118
117
  if (props.onComplete && !disableCallbacks && maskRef.current) {
119
118
  var _maskRef$current2 = maskRef.current,
120
119
  unmaskedValue = _maskRef$current2.unmaskedValue,
@@ -127,13 +126,14 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
127
126
  }
128
127
  }, props.unmask ? unmaskedValue : maskRef.current.value);
129
128
  }
130
- };
129
+ }, [props.onComplete]);
131
130
  var getMask = function getMask() {
132
131
  var element = elementRef.current;
133
132
  if (element) {
134
133
  var maskCurrent = maskRef.current;
135
134
  if (!maskCurrent) {
136
- maskRef.current = (0, _imask.default)(element, maskOptions).on('accept', onAccept.bind(_this)).on('complete', onComplete.bind(_this));
135
+ maskRef.current = (0, _imask.default)(element, maskOptions);
136
+ if (value && typeof value !== 'number' && value.trim() !== '' || value && typeof value === 'number') onAccept();
137
137
  setValue(value);
138
138
  } else {
139
139
  maskCurrent.updateOptions(maskOptions);
@@ -150,14 +150,19 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
150
150
  if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
151
151
  if (!props.mask || dontInitMask) return;
152
152
  getMask();
153
+ }, [maskOptions]);
154
+ (0, _react.useEffect)(function () {
155
+ if (!maskRef.current) return;
156
+ var maskCurrent = maskRef.current;
157
+ maskCurrent.on('accept', onAccept);
158
+ maskCurrent.on('complete', onComplete);
153
159
 
154
160
  // eslint-disable-next-line consistent-return
155
161
  return function () {
156
- var _maskRef$current3, _maskRef$current4;
157
- (_maskRef$current3 = maskRef.current) === null || _maskRef$current3 === void 0 ? void 0 : _maskRef$current3.off('accept', onAccept);
158
- (_maskRef$current4 = maskRef.current) === null || _maskRef$current4 === void 0 ? void 0 : _maskRef$current4.off('complete', onComplete);
162
+ maskCurrent.off('accept', onAccept);
163
+ maskCurrent.off('complete', onComplete);
159
164
  };
160
- }, [maskOptions]);
165
+ }, [onAccept, onComplete]);
161
166
  (0, _react.useEffect)(function () {
162
167
  if (maskOptions.mask && !dontInitMask) {
163
168
  if (maskRef.current) {
@@ -182,7 +187,6 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
182
187
  },
183
188
  inputRef: function inputRef(el) {
184
189
  elementRef.current = el;
185
- // Propagate the input ref for who call it
186
190
  if (_inputRef) {
187
191
  if (_typeof(_inputRef) === 'object') _inputRef.current = el;else _inputRef(el);
188
192
  }
@@ -122,7 +122,6 @@ var MultiSelectField = function MultiSelectField(props) {
122
122
  var onBlurComponent = function onBlurComponent(e) {
123
123
  if (onBlur) onBlur(e);
124
124
  if (!insideComponent) {
125
- setOpened(false);
126
125
  setInputValue('');
127
126
  setDataCombo(dataSource);
128
127
  }
@@ -24,13 +24,12 @@ var returnEventFormattedValue = function returnEventFormattedValue(props, event)
24
24
  var _event$target = event.target,
25
25
  value = _event$target.value,
26
26
  name = _event$target.name;
27
- var teste = _objectSpread(_objectSpread({}, event), {}, {
27
+ return _objectSpread(_objectSpread({}, event), {}, {
28
28
  target: {
29
29
  value: (0, _format_number.numberToEnUS)(value),
30
30
  name: name
31
31
  }
32
32
  });
33
- return teste;
34
33
  }
35
34
  return event;
36
35
  };
@@ -14,7 +14,7 @@ exports.numberToPtBR = numberToPtBR;
14
14
  var numberToEnUS = function numberToEnUS(value) {
15
15
  var formattedNumber;
16
16
  if (value) {
17
- formattedNumber = value.replace('.', '').replace(',', '.');
17
+ formattedNumber = value.replaceAll('.', '').replaceAll(',', '.');
18
18
  return Number(formattedNumber);
19
19
  }
20
20
  return value;
@@ -31,7 +31,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
31
31
  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; } }
32
32
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
33
  var PeriodPicker = function PeriodPicker(props) {
34
- var _props$value2, _props$value3;
35
34
  var _props$showButtonOpen = props.showButtonOpen,
36
35
  showButtonOpen = _props$showButtonOpen === void 0 ? true : _props$showButtonOpen,
37
36
  _props$openOnFocus = props.openOnFocus,
@@ -138,7 +137,7 @@ var PeriodPicker = function PeriodPicker(props) {
138
137
  setValueInitial(newValueInitial);
139
138
  setValueFinal(newValueFinal);
140
139
  }
141
- }, [(_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.initial, (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.final]);
140
+ }, [props.value]);
142
141
  var openCalendar = function openCalendar() {
143
142
  setShowCalendar(true);
144
143
  setShowPeriodSelection(false);
@@ -1,10 +1,10 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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, style }: IPanelProps) => JSX.Element | null;
8
+ declare const PanelContent: ({ customClass, children, ...rest }: IPanelContentProps) => JSX.Element | null;
9
9
 
10
10
  export { PanelContent as default };
@@ -6,59 +6,62 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
- var _helpers = _interopRequireDefault(require("./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
- var observer = null;
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; }
15
18
  var PanelContent = function PanelContent(_ref) {
16
19
  var customClass = _ref.customClass,
17
20
  children = _ref.children,
18
- style = _ref.style;
21
+ rest = _objectWithoutProperties(_ref, _excluded);
19
22
  var _useContext = (0, _react.useContext)(_helpers.default),
20
23
  opened = _useContext.opened,
21
24
  onEndReached = _useContext.onEndReached,
22
- onEndReachedThreshold = _useContext.onEndReachedThreshold,
25
+ _useContext$onEndReac = _useContext.onEndReachedThreshold,
26
+ onEndReachedThreshold = _useContext$onEndReac === void 0 ? 0.1 : _useContext$onEndReac,
23
27
  hideContent = _useContext.hideContent;
24
28
  var rootElementRef = (0, _react.useRef)(null);
25
- var observedElement = (0, _react.useRef)(null);
26
- /* usa uma referencia ao onEndReched pra evitar novas instancias do observer */
27
- var onEndReachedRef = (0, _react.useRef)(onEndReached);
28
- var options = {
29
- root: rootElementRef.current,
30
- threshold: onEndReachedThreshold || 0
31
- };
32
- var scrollObserver = function scrollObserver(node) {
33
- // evitar criação de multiplos observers
34
- if (observer) observer.unobserve(node);
35
- observer = new IntersectionObserver(function (entries) {
36
- entries.forEach(function (en) {
37
- if (en.intersectionRatio > 0 && onEndReachedRef.current) {
38
- onEndReachedRef.current();
39
- }
40
- }, options);
41
- });
42
- observer.observe(node);
43
- };
44
-
45
- /* atualiza referencia caso a função mude */
46
- (0, _react.useEffect)(function () {
47
- onEndReachedRef.current = onEndReached;
48
- }, [onEndReached]);
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]);
49
48
  (0, _react.useEffect)(function () {
50
- if (observedElement.current && onEndReachedRef.current) {
51
- scrollObserver(observedElement.current);
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);
52
53
  }
53
- }, [observedElement]);
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]);
54
60
  if (!opened) return null;
55
- 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({
56
62
  ref: rootElementRef,
57
- className: "panel-content ".concat(customClass),
58
- style: style
59
- }, opened && children, onEndReached ? /*#__PURE__*/_react.default.createElement("div", {
60
- ref: observedElement
61
- }) : /*#__PURE__*/_react.default.createElement("noscript", null));
63
+ className: "panel-content ".concat(customClass !== null && customClass !== void 0 ? customClass : '')
64
+ }, rest), opened && children);
62
65
  };
63
66
  var _default = PanelContent;
64
67
  exports.default = _default;
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,10 +1,10 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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, style, title, gridCols, onEndReached, onEndReachedThreshold, permissionAttr, colorStyle, }: IPanelProps) => JSX.Element | null;
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 };
@@ -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
- style: style
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
  };
@@ -1,4 +1,4 @@
1
- import { a as IPanelHeaderProps } from '../types-c1e2d0c9.js';
1
+ import { b as IPanelHeaderProps } from '../types-fe4a1068.js';
2
2
  import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../internals/colorStyles.js';
@@ -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
- style = props.style,
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
- style: style
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"
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,4 +1,4 @@
1
- import { I as IPanelProps } from '../types-c1e2d0c9.js';
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';
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- export { P as default, n as numberAroundZeroAndOne } from '../types-c1e2d0c9.js';
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';
@@ -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 ? null : new Error("invalid value of ".concat(propName, " in ").concat(componentName, " component, is not between 0 and 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;
@@ -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-c1e2d0c9.js';
9
+ import '../types-fe4a1068.js';
10
10
  import 'react';
11
11
  import '../@types/PermissionAttr.js';
12
12
  import '../internals/colorStyles.js';
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- export { C as ContextProps, a as IPanelHeaderProps, I as IPanelProps, b as IParameterFunction } from '../types-c1e2d0c9.js';
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';
@@ -0,0 +1,7 @@
1
+ import { IShortcutsProps } from './types.js';
2
+ import 'react';
3
+ import '../@types/ColorStyles.js';
4
+
5
+ declare const Shortcuts: ({ type, style, styleShortcut, shortcut, description }: IShortcutsProps) => JSX.Element;
6
+
7
+ export { Shortcuts as default };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ require("../assets/styles/shortcuts.scss");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var Shortcuts = function Shortcuts(_ref) {
11
+ var type = _ref.type,
12
+ style = _ref.style,
13
+ styleShortcut = _ref.styleShortcut,
14
+ shortcut = _ref.shortcut,
15
+ description = _ref.description;
16
+ return /*#__PURE__*/_react.default.createElement("p", {
17
+ "data-testid": "description",
18
+ className: "shortcut-description",
19
+ style: style
20
+ }, /*#__PURE__*/_react.default.createElement("kbd", {
21
+ "data-testid": "shortcut",
22
+ className: "shortcut-component ".concat(type && "-".concat(type)),
23
+ style: styleShortcut
24
+ }, shortcut), ":\xA0", description);
25
+ };
26
+ var _default = Shortcuts;
27
+ exports.default = _default;
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from 'react';
2
+ import { ColorStyles } from '../@types/ColorStyles.js';
3
+
4
+ interface IShortcutsProps {
5
+ type?: ColorStyles;
6
+ style?: CSSProperties;
7
+ styleShortcut?: CSSProperties;
8
+ shortcut: string;
9
+ description: string;
10
+ }
11
+
12
+ export { IShortcutsProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -6,6 +6,6 @@ export { default as Td } from './RowColumn.js';
6
6
  import { ITableProps } from './types.js';
7
7
  import 'react';
8
8
 
9
- declare const Table: (props: ITableProps) => JSX.Element;
9
+ declare const Table: ({ children, ...props }: ITableProps) => JSX.Element;
10
10
 
11
11
  export { Table as default };