@synerise/ds-factors 0.10.0 → 0.10.4
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/CHANGELOG.md +32 -0
- package/dist/FactorTypeSelector/FactorTypeSelector.js +1 -13
- package/dist/FactorValue/DynamicKey/DynamicKey.js +3 -16
- package/dist/FactorValue/FactorValue.js +1 -1
- package/dist/FactorValue/Formula/Formula.js +2 -15
- package/dist/FactorValue/Formula/FormulaModal.js +3 -16
- package/dist/FactorValue/Number/NumberInput.js +2 -15
- package/dist/FactorValue/Parameter/Parameter.js +6 -21
- package/dist/FactorValue/Parameter/ParameterDropdown.js +23 -39
- package/dist/FactorValue/Text/Text.js +9 -24
- package/dist/FactorValue/Text/TextModal.js +2 -15
- package/dist/Factors.js +2 -2
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.10.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.10.3...@synerise/ds-factors@0.10.4) (2021-11-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.10.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.10.2...@synerise/ds-factors@0.10.3) (2021-11-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.10.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.10.1...@synerise/ds-factors@0.10.2) (2021-11-16)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.10.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.9.1...@synerise/ds-factors@0.10.1) (2021-11-09)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-factors
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [0.10.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-factors@0.9.1...@synerise/ds-factors@0.10.0) (2021-11-09)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-factors
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
|
|
9
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import Dropdown from '@synerise/ds-dropdown';
|
|
15
3
|
import Icon, { CheckS } from '@synerise/ds-icon';
|
|
@@ -30,7 +18,7 @@ var FactorTypeSelector = function FactorTypeSelector(_ref) {
|
|
|
30
18
|
var list = availableFactorTypes || ALL_FACTOR_TYPES;
|
|
31
19
|
|
|
32
20
|
if (unavailableFactorTypes !== undefined) {
|
|
33
|
-
list =
|
|
21
|
+
list = [].concat(list).filter(function (type) {
|
|
34
22
|
return unavailableFactorTypes.indexOf(type) < 0;
|
|
35
23
|
});
|
|
36
24
|
}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
|
-
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."); }
|
|
10
|
-
|
|
11
|
-
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); }
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
17
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
7
|
import * as React from 'react';
|
|
20
8
|
import { RawInput } from '@synerise/ds-input';
|
|
21
9
|
import { debounce } from 'lodash';
|
|
@@ -33,9 +21,8 @@ var DynamicKey = function DynamicKey(_ref) {
|
|
|
33
21
|
key: value.key,
|
|
34
22
|
value: value.value
|
|
35
23
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setLocalValue = _React$useState2[1];
|
|
24
|
+
localValue = _React$useState[0],
|
|
25
|
+
setLocalValue = _React$useState[1];
|
|
39
26
|
|
|
40
27
|
var onChangeDebounce = React.useCallback(debounce(onChange, 300), [onChange]);
|
|
41
28
|
|
|
@@ -27,7 +27,7 @@ var FactorValue = function FactorValue(_ref) {
|
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
28
28
|
// @ts-ignore
|
|
29
29
|
React.createElement(InputComponent, {
|
|
30
|
-
key:
|
|
30
|
+
key: factorKey + "-" + selectedFactor.name,
|
|
31
31
|
value: value,
|
|
32
32
|
placeholder: texts.valuePlaceholder,
|
|
33
33
|
onChange: onChangeValue,
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import Button from '@synerise/ds-button';
|
|
15
3
|
import Icon, { EditS } from '@synerise/ds-icon';
|
|
@@ -26,9 +14,8 @@ var FormulaInput = function FormulaInput(_ref) {
|
|
|
26
14
|
formulaEditor = _ref.formulaEditor;
|
|
27
15
|
|
|
28
16
|
var _React$useState = React.useState(false),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setOpenFormulaModal = _React$useState2[1];
|
|
17
|
+
openFormulaModal = _React$useState[0],
|
|
18
|
+
setOpenFormulaModal = _React$useState[1];
|
|
32
19
|
|
|
33
20
|
var mode = React.useMemo(function () {
|
|
34
21
|
return value ? 'two-icons' : 'label-icon';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import ModalProxy from '@synerise/ds-modal';
|
|
15
3
|
import InlineEdit from '@synerise/ds-inline-edit';
|
|
@@ -22,10 +10,9 @@ var FormulaModal = function FormulaModal(_ref) {
|
|
|
22
10
|
texts = _ref.texts,
|
|
23
11
|
formulaEditor = _ref.formulaEditor;
|
|
24
12
|
|
|
25
|
-
var _React$useState = React.useState((value
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setFormulaName = _React$useState2[1];
|
|
13
|
+
var _React$useState = React.useState((value == null ? void 0 : value.name) || texts.formula.defaultName),
|
|
14
|
+
formulaName = _React$useState[0],
|
|
15
|
+
setFormulaName = _React$useState[1];
|
|
29
16
|
|
|
30
17
|
var handleOk = React.useCallback(function () {
|
|
31
18
|
onApply({
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import InputNumber from '@synerise/ds-input-number';
|
|
15
3
|
import { debounce } from 'lodash';
|
|
@@ -21,9 +9,8 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
21
9
|
opened = _ref.opened;
|
|
22
10
|
|
|
23
11
|
var _React$useState = React.useState(value),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setLocalValue = _React$useState2[1];
|
|
12
|
+
localValue = _React$useState[0],
|
|
13
|
+
setLocalValue = _React$useState[1];
|
|
27
14
|
|
|
28
15
|
var onChangeValueDebounce = React.useCallback(debounce(onChange, 300), [onChange]);
|
|
29
16
|
|
|
@@ -2,20 +2,6 @@ var _excluded = ["buttonIcon", "buttonLabel", "loading"];
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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); }
|
|
4
4
|
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
|
-
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."); }
|
|
8
|
-
|
|
9
|
-
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); }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
14
|
-
|
|
15
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
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
|
-
|
|
19
5
|
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; }
|
|
20
6
|
|
|
21
7
|
import Dropdown from '@synerise/ds-dropdown';
|
|
@@ -43,12 +29,11 @@ var ParameterInput = function ParameterInput(_ref) {
|
|
|
43
29
|
var buttonIcon = parameters.buttonIcon,
|
|
44
30
|
buttonLabel = parameters.buttonLabel,
|
|
45
31
|
loading = parameters.loading,
|
|
46
|
-
restParameters =
|
|
32
|
+
restParameters = _objectWithoutPropertiesLoose(parameters, _excluded);
|
|
47
33
|
|
|
48
34
|
var _React$useState = React.useState(false),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setDropdownVisible = _React$useState2[1];
|
|
35
|
+
dropdownVisible = _React$useState[0],
|
|
36
|
+
setDropdownVisible = _React$useState[1];
|
|
52
37
|
|
|
53
38
|
var handleChange = React.useCallback(function (val) {
|
|
54
39
|
onChange(val);
|
|
@@ -86,15 +71,15 @@ var ParameterInput = function ParameterInput(_ref) {
|
|
|
86
71
|
}))
|
|
87
72
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
88
73
|
getPopupContainer: getPopupContainerOverride || getPopupContainer,
|
|
89
|
-
title: (value
|
|
74
|
+
title: (value == null ? void 0 : value.name) || '',
|
|
90
75
|
trigger: ['hover']
|
|
91
76
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
92
77
|
type: "secondary",
|
|
93
78
|
mode: "two-icons",
|
|
94
79
|
onClick: handleOnClick
|
|
95
80
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
|
-
component: (value
|
|
97
|
-
}), /*#__PURE__*/React.createElement(Value, null, (value
|
|
81
|
+
component: (value == null ? void 0 : value.icon) || buttonIcon
|
|
82
|
+
}), /*#__PURE__*/React.createElement(Value, null, (value == null ? void 0 : value.name) || buttonLabel), /*#__PURE__*/React.createElement(Icon, {
|
|
98
83
|
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
99
84
|
})))));
|
|
100
85
|
};
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || 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); }
|
|
2
2
|
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
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."); }
|
|
6
|
-
|
|
7
|
-
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); }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
3
|
import * as React from 'react';
|
|
16
4
|
import Dropdown from '@synerise/ds-dropdown';
|
|
17
5
|
import Icon, { SearchM } from '@synerise/ds-icon';
|
|
@@ -35,13 +23,13 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
35
23
|
loading = _ref.loading,
|
|
36
24
|
onFetchData = _ref.onFetchData,
|
|
37
25
|
hasMoreItems = _ref.hasMoreItems;
|
|
38
|
-
var listRef =
|
|
26
|
+
var listRef = React.createRef();
|
|
39
27
|
var listStyle = {
|
|
40
28
|
overflowX: 'unset',
|
|
41
29
|
overflowY: 'unset'
|
|
42
30
|
};
|
|
43
31
|
var defaultTab = React.useMemo(function () {
|
|
44
|
-
var defaultIndex = groups
|
|
32
|
+
var defaultIndex = groups == null ? void 0 : groups.findIndex(function (group) {
|
|
45
33
|
return group.defaultGroup;
|
|
46
34
|
});
|
|
47
35
|
return defaultIndex || 0;
|
|
@@ -49,33 +37,29 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
49
37
|
var overlayRef = React.useRef(null);
|
|
50
38
|
|
|
51
39
|
var _React$useState = React.useState(''),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
setSearchQuery = _React$useState2[1];
|
|
40
|
+
searchQuery = _React$useState[0],
|
|
41
|
+
setSearchQuery = _React$useState[1];
|
|
55
42
|
|
|
56
|
-
var _React$
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
setActiveTab = _React$useState4[1];
|
|
43
|
+
var _React$useState2 = React.useState(defaultTab),
|
|
44
|
+
activeTab = _React$useState2[0],
|
|
45
|
+
setActiveTab = _React$useState2[1];
|
|
60
46
|
|
|
61
|
-
var _React$
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setActiveGroup = _React$useState6[1];
|
|
47
|
+
var _React$useState3 = React.useState(undefined),
|
|
48
|
+
activeGroup = _React$useState3[0],
|
|
49
|
+
setActiveGroup = _React$useState3[1];
|
|
65
50
|
|
|
66
|
-
var _React$
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
setSearchInputFocus = _React$useState8[1];
|
|
51
|
+
var _React$useState4 = React.useState(true),
|
|
52
|
+
searchInputCanBeFocused = _React$useState4[0],
|
|
53
|
+
setSearchInputFocus = _React$useState4[1];
|
|
70
54
|
|
|
71
55
|
var classNames = React.useMemo(function () {
|
|
72
|
-
return "ds-parameter-item ds-parameter-item-"
|
|
56
|
+
return "ds-parameter-item ds-parameter-item-" + uuid();
|
|
73
57
|
}, []);
|
|
74
58
|
useOnClickOutside(overlayRef, function () {
|
|
75
59
|
setDropdownVisible(false);
|
|
76
60
|
});
|
|
77
61
|
var currentTabItems = React.useMemo(function () {
|
|
78
|
-
return groups
|
|
62
|
+
return groups == null ? void 0 : groups.find(function (group, index) {
|
|
79
63
|
return activeTab === index;
|
|
80
64
|
});
|
|
81
65
|
}, [groups, activeTab]);
|
|
@@ -86,7 +70,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
86
70
|
setDropdownVisible(false);
|
|
87
71
|
}, [setDropdownVisible]);
|
|
88
72
|
var filteredItems = React.useMemo(function () {
|
|
89
|
-
return items
|
|
73
|
+
return items == null ? void 0 : items.filter(function (item) {
|
|
90
74
|
return item.name.toLowerCase().includes(searchQuery.toLowerCase());
|
|
91
75
|
}).map(function (item) {
|
|
92
76
|
return {
|
|
@@ -104,12 +88,12 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
104
88
|
return filteredItems;
|
|
105
89
|
}
|
|
106
90
|
|
|
107
|
-
var hasSubgroups = Boolean(currentTabItems
|
|
91
|
+
var hasSubgroups = Boolean(currentTabItems == null ? void 0 : currentTabItems.subGroups);
|
|
108
92
|
|
|
109
93
|
if (hasSubgroups && !activeGroup) {
|
|
110
94
|
var _currentTabItems$subG;
|
|
111
95
|
|
|
112
|
-
return currentTabItems
|
|
96
|
+
return currentTabItems == null ? void 0 : (_currentTabItems$subG = currentTabItems.subGroups) == null ? void 0 : _currentTabItems$subG.map(function (subGroup) {
|
|
113
97
|
return {
|
|
114
98
|
className: classNames,
|
|
115
99
|
item: subGroup,
|
|
@@ -120,7 +104,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
120
104
|
}
|
|
121
105
|
|
|
122
106
|
if (activeGroup) {
|
|
123
|
-
return items
|
|
107
|
+
return items == null ? void 0 : items.filter(function (item) {
|
|
124
108
|
return item.groupId === activeGroup.id;
|
|
125
109
|
}).map(function (item) {
|
|
126
110
|
return {
|
|
@@ -134,7 +118,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
134
118
|
}
|
|
135
119
|
|
|
136
120
|
if (activeTab && groups && groups[activeTab]) {
|
|
137
|
-
return items
|
|
121
|
+
return items == null ? void 0 : items.filter(function (item) {
|
|
138
122
|
return item.groupId === groups[activeTab].id;
|
|
139
123
|
}).map(function (item) {
|
|
140
124
|
return {
|
|
@@ -147,7 +131,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
147
131
|
});
|
|
148
132
|
}
|
|
149
133
|
|
|
150
|
-
return items
|
|
134
|
+
return items == null ? void 0 : items.map(function (item) {
|
|
151
135
|
return {
|
|
152
136
|
className: classNames,
|
|
153
137
|
item: item,
|
|
@@ -161,7 +145,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
161
145
|
setSearchQuery(value);
|
|
162
146
|
}, [setSearchQuery]);
|
|
163
147
|
var getTabs = React.useMemo(function () {
|
|
164
|
-
return (groups
|
|
148
|
+
return (groups == null ? void 0 : groups.map(function (group) {
|
|
165
149
|
return {
|
|
166
150
|
label: group.name,
|
|
167
151
|
icon: group.icon
|
|
@@ -226,7 +210,7 @@ var ParameterDropdown = function ParameterDropdown(_ref) {
|
|
|
226
210
|
}), loading ? /*#__PURE__*/React.createElement(S.LoaderWrapper, null, /*#__PURE__*/React.createElement(Loader, {
|
|
227
211
|
label: texts.parameter.loadingParameter,
|
|
228
212
|
labelPosition: "bottom"
|
|
229
|
-
})) : /*#__PURE__*/React.createElement(S.ItemsList, null, currentItems
|
|
213
|
+
})) : /*#__PURE__*/React.createElement(S.ItemsList, null, currentItems != null && currentItems.length ? /*#__PURE__*/React.createElement(Scrollbar, {
|
|
230
214
|
absolute: true,
|
|
231
215
|
style: {
|
|
232
216
|
padding: 8
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import Icon, { FullScreenM } from '@synerise/ds-icon';
|
|
15
3
|
import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
|
|
@@ -30,23 +18,20 @@ var TextInput = function TextInput(_ref) {
|
|
|
30
18
|
opened = _ref.opened;
|
|
31
19
|
|
|
32
20
|
var _React$useState = React.useState(false),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setOpenExpanseEditor = _React$useState2[1];
|
|
21
|
+
openExpanseEditor = _React$useState[0],
|
|
22
|
+
setOpenExpanseEditor = _React$useState[1];
|
|
36
23
|
|
|
37
24
|
var _useState = useState(),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
setInputRef = _useState2[1];
|
|
25
|
+
inputRef = _useState[0],
|
|
26
|
+
setInputRef = _useState[1];
|
|
41
27
|
|
|
42
|
-
var _React$
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setLocalValue = _React$useState4[1];
|
|
28
|
+
var _React$useState2 = React.useState(value),
|
|
29
|
+
localValue = _React$useState2[0],
|
|
30
|
+
setLocalValue = _React$useState2[1];
|
|
46
31
|
|
|
47
32
|
var onChangeDebounce = React.useCallback(debounce(onChange, 300), [onChange]);
|
|
48
33
|
React.useEffect(function () {
|
|
49
|
-
if (inputRef
|
|
34
|
+
if (inputRef != null && inputRef.current && opened) {
|
|
50
35
|
inputRef.current.focus();
|
|
51
36
|
}
|
|
52
37
|
}, [inputRef, opened]);
|
|
@@ -86,7 +71,7 @@ var TextInput = function TextInput(_ref) {
|
|
|
86
71
|
placeholder: texts.valuePlaceholder,
|
|
87
72
|
value: localValue,
|
|
88
73
|
onChange: handleAutocomplete
|
|
89
|
-
}, autocompleteOptions
|
|
74
|
+
}, autocompleteOptions == null ? void 0 : autocompleteOptions.map(function (option) {
|
|
90
75
|
return /*#__PURE__*/React.createElement(Autocomplete.Option, {
|
|
91
76
|
key: option,
|
|
92
77
|
value: option
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import ModalProxy from '@synerise/ds-modal';
|
|
15
3
|
import Textarea from '@synerise/ds-input/dist/Textarea/Textarea';
|
|
@@ -22,9 +10,8 @@ var TextModal = function TextModal(_ref) {
|
|
|
22
10
|
texts = _ref.texts;
|
|
23
11
|
|
|
24
12
|
var _React$useState = React.useState('' || value),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
setExpandValue = _React$useState2[1];
|
|
13
|
+
expandValue = _React$useState[0],
|
|
14
|
+
setExpandValue = _React$useState[1];
|
|
28
15
|
|
|
29
16
|
React.useEffect(function () {
|
|
30
17
|
setExpandValue(value);
|
package/dist/Factors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
4
|
|
|
@@ -172,7 +172,7 @@ var Factors = function Factors(_ref) {
|
|
|
172
172
|
resetMargin: true,
|
|
173
173
|
compact: true,
|
|
174
174
|
withoutTypeSelector: withoutTypeSelector,
|
|
175
|
-
className: "ds-factors ds-factors-"
|
|
175
|
+
className: "ds-factors ds-factors-" + factorType
|
|
176
176
|
}, !withoutTypeSelector && setSelectedFactorType && /*#__PURE__*/React.createElement(FactorTypeSelector, {
|
|
177
177
|
selectedFactorType: factorType,
|
|
178
178
|
setSelectedFactorType: setSelectedFactorType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-factors",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Factors UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-autocomplete": "^0.4.
|
|
36
|
-
"@synerise/ds-badge": "^0.5.
|
|
37
|
-
"@synerise/ds-button": "^0.16.
|
|
38
|
-
"@synerise/ds-date-picker": "^0.6.
|
|
39
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
40
|
-
"@synerise/ds-icon": "^0.46.
|
|
41
|
-
"@synerise/ds-inline-edit": "^0.5.
|
|
42
|
-
"@synerise/ds-input": "^0.18.
|
|
43
|
-
"@synerise/ds-input-number": "^0.6.
|
|
44
|
-
"@synerise/ds-menu": "^0.11.
|
|
45
|
-
"@synerise/ds-modal": "^0.15.
|
|
46
|
-
"@synerise/ds-result": "^0.6.
|
|
47
|
-
"@synerise/ds-tabs": "^0.12.
|
|
48
|
-
"@synerise/ds-typography": "^0.12.
|
|
35
|
+
"@synerise/ds-autocomplete": "^0.4.4",
|
|
36
|
+
"@synerise/ds-badge": "^0.5.4",
|
|
37
|
+
"@synerise/ds-button": "^0.16.2",
|
|
38
|
+
"@synerise/ds-date-picker": "^0.6.4",
|
|
39
|
+
"@synerise/ds-dropdown": "^0.17.4",
|
|
40
|
+
"@synerise/ds-icon": "^0.46.2",
|
|
41
|
+
"@synerise/ds-inline-edit": "^0.5.4",
|
|
42
|
+
"@synerise/ds-input": "^0.18.2",
|
|
43
|
+
"@synerise/ds-input-number": "^0.6.4",
|
|
44
|
+
"@synerise/ds-menu": "^0.11.2",
|
|
45
|
+
"@synerise/ds-modal": "^0.15.2",
|
|
46
|
+
"@synerise/ds-result": "^0.6.2",
|
|
47
|
+
"@synerise/ds-tabs": "^0.12.4",
|
|
48
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
49
49
|
"@synerise/ds-utils": "^0.19.0",
|
|
50
50
|
"classnames": "^2.2.6",
|
|
51
51
|
"react-window": "1.8.5"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"@synerise/ds-core": "*",
|
|
55
55
|
"react": ">=16.9.0 < 17.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "3e5f807c3c9ce7bbcb707b1e229ad5d7ef50d830"
|
|
58
58
|
}
|