iguazio.dashboard-react-controls 1.9.2 → 2.0.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 (56) hide show
  1. package/dist/components/Backdrop/Backdrop.js +7 -7
  2. package/dist/components/Button/Button.js +20 -26
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +18 -17
  4. package/dist/components/FormCheckBox/FormCheckBox.js +28 -32
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +46 -50
  6. package/dist/components/FormChipCell/FormChipCell.js +122 -142
  7. package/dist/components/FormChipCell/FormChipCellView.js +44 -47
  8. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +23 -20
  9. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +129 -152
  10. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -27
  11. package/dist/components/FormChipCell/formChipCell.util.js +6 -16
  12. package/dist/components/FormCombobox/FormCombobox.js +134 -195
  13. package/dist/components/FormInput/FormInput.js +134 -212
  14. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +15 -14
  15. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +72 -72
  16. package/dist/components/FormRadio/FormRadio.js +21 -25
  17. package/dist/components/FormSelect/FormSelect.js +98 -126
  18. package/dist/components/FormSelect/FormSelect.test.js +56 -60
  19. package/dist/components/FormTextarea/FormTextarea.js +55 -71
  20. package/dist/components/FormToggle/FormToggle.js +25 -29
  21. package/dist/components/Modal/Modal.js +17 -18
  22. package/dist/components/PopUpDialog/PopUpDialog.js +53 -63
  23. package/dist/components/RoundedIcon/RoundedIcon.js +14 -13
  24. package/dist/components/Tip/Tip.js +58 -64
  25. package/dist/components/Tip/Tip.test.js +41 -64
  26. package/dist/components/Tooltip/Tooltip.js +75 -89
  27. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +6 -5
  28. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +10 -10
  29. package/dist/components/Wizard/Wizard.js +73 -107
  30. package/dist/components/Wizard/WizardSteps/WizardSteps.js +19 -20
  31. package/dist/components/index.js +18 -18
  32. package/dist/constants.js +26 -44
  33. package/dist/elements/FormActionButton/FormActionButton.js +12 -13
  34. package/dist/elements/FormRowActions/FormRowActions.js +19 -22
  35. package/dist/elements/OptionsMenu/OptionsMenu.js +10 -8
  36. package/dist/elements/SelectOption/SelectOption.js +14 -13
  37. package/dist/elements/SelectOption/SelectOption.test.js +39 -47
  38. package/dist/elements/ValidationTemplate/ValidationTemplate.js +7 -6
  39. package/dist/elements/index.js +5 -5
  40. package/dist/hooks/index.js +5 -5
  41. package/dist/hooks/useChipCell.hook.js +66 -85
  42. package/dist/hooks/useDebounce.hook.js +22 -24
  43. package/dist/hooks/useDetectOutsideClick.hook.js +4 -4
  44. package/dist/hooks/useFormTable.hook.js +99 -112
  45. package/dist/hooks/useHiddenChipsBlock.hook.js +40 -55
  46. package/dist/index.js +2 -3
  47. package/dist/scss/borders.scss +6 -0
  48. package/dist/scss/mixins.scss +32 -0
  49. package/dist/types.js +43 -67
  50. package/dist/utils/common.util.js +19 -23
  51. package/dist/utils/form.util.js +33 -39
  52. package/dist/utils/generateChipsList.util.js +7 -7
  53. package/dist/utils/getFirstScrollableParent.util.js +4 -10
  54. package/dist/utils/math.util.js +3 -3
  55. package/dist/utils/validation.util.js +74 -131
  56. package/package.json +34 -34
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -11,8 +10,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
10
  require("./textTooltipTemplate.scss");
12
11
  var _jsxRuntime = require("react/jsx-runtime");
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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); }
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; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  /*
17
16
  Copyright 2022 Iguazio Systems Ltd.
18
17
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -30,11 +29,13 @@ under the Apache 2.0 license is conditioned upon your compliance with
30
29
  such restriction.
31
30
  */
32
31
 
33
- var TextTooltipTemplate = function TextTooltipTemplate(_ref) {
34
- var text = _ref.text,
35
- warning = _ref.warning;
36
- var textRef = (0, _react.useRef)();
37
- var tooltipClassNames = (0, _classnames.default)('tooltip-template', 'tooltip__text', warning && 'tooltip__warning');
32
+ const TextTooltipTemplate = _ref => {
33
+ let {
34
+ text,
35
+ warning
36
+ } = _ref;
37
+ const textRef = (0, _react.useRef)();
38
+ const tooltipClassNames = (0, _classnames.default)('tooltip-template', 'tooltip__text', warning && 'tooltip__warning');
38
39
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
39
40
  className: tooltipClassNames,
40
41
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -49,5 +50,4 @@ TextTooltipTemplate.propTypes = {
49
50
  TextTooltipTemplate.propTypes = {
50
51
  text: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element, _propTypes.default.number])
51
52
  };
52
- var _default = TextTooltipTemplate;
53
- exports.default = _default;
53
+ var _default = exports.default = TextTooltipTemplate;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -17,70 +16,48 @@ var _types = require("../../types");
17
16
  require("./Wizard.scss");
18
17
  var _jsxRuntime = require("react/jsx-runtime");
19
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
- 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); }
21
- 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; }
22
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
- 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."); }
24
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
- 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); }
31
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
32
- 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."); }
33
- 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); }
34
- 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; }
35
- 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; } }
36
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
37
- Copyright 2022 Iguazio Systems Ltd.
38
- Licensed under the Apache License, Version 2.0 (the "License") with
39
- an addition restriction as set forth herein. You may not use this
40
- file except in compliance with the License. You may obtain a copy of
41
- the License at http://www.apache.org/licenses/LICENSE-2.0.
42
- Unless required by applicable law or agreed to in writing, software
43
- distributed under the License is distributed on an "AS IS" BASIS,
44
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
45
- implied. See the License for the specific language governing
46
- permissions and limitations under the License.
47
- In addition, you may not use the software for any purposes that are
48
- illegal under applicable law, and the grant of the foregoing license
49
- under the Apache 2.0 license is conditioned upon your compliance with
50
- such restriction.
51
- */
52
- var Wizard = function Wizard(_ref) {
53
- var children = _ref.children,
54
- className = _ref.className,
55
- getActions = _ref.getActions,
56
- isWizardOpen = _ref.isWizardOpen,
57
- location = _ref.location,
58
- onWizardResolve = _ref.onWizardResolve,
59
- previewText = _ref.previewText,
60
- size = _ref.size,
61
- stepsConfig = _ref.stepsConfig,
62
- subTitle = _ref.subTitle,
63
- title = _ref.title;
64
- var wizardClasses = (0, _classnames.default)('wizard-form', className);
65
- var _useState = (0, _react.useState)(false),
66
- _useState2 = _slicedToArray(_useState, 2),
67
- jumpingToFirstInvalid = _useState2[0],
68
- setJumpingToFirstInvalid = _useState2[1];
69
- var _useState3 = (0, _react.useState)(0),
70
- _useState4 = _slicedToArray(_useState3, 2),
71
- activeStepNumber = _useState4[0],
72
- setActiveStepNumber = _useState4[1];
73
- var _useState5 = (0, _react.useState)(null),
74
- _useState6 = _slicedToArray(_useState5, 2),
75
- firstDisabledStepIdx = _useState6[0],
76
- setFirstDisabledStepIdx = _useState6[1];
77
- var visibleSteps = (0, _react.useMemo)(function () {
78
- return (stepsConfig === null || stepsConfig === void 0 ? void 0 : stepsConfig.filter(function (step) {
79
- return !step.hidden;
80
- })) || [];
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ /*
22
+ Copyright 2022 Iguazio Systems Ltd.
23
+ Licensed under the Apache License, Version 2.0 (the "License") with
24
+ an addition restriction as set forth herein. You may not use this
25
+ file except in compliance with the License. You may obtain a copy of
26
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
27
+ Unless required by applicable law or agreed to in writing, software
28
+ distributed under the License is distributed on an "AS IS" BASIS,
29
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
30
+ implied. See the License for the specific language governing
31
+ permissions and limitations under the License.
32
+ In addition, you may not use the software for any purposes that are
33
+ illegal under applicable law, and the grant of the foregoing license
34
+ under the Apache 2.0 license is conditioned upon your compliance with
35
+ such restriction.
36
+ */
37
+
38
+ const Wizard = _ref => {
39
+ let {
40
+ children,
41
+ className,
42
+ getActions,
43
+ isWizardOpen,
44
+ location,
45
+ onWizardResolve,
46
+ previewText,
47
+ size,
48
+ stepsConfig,
49
+ subTitle,
50
+ title
51
+ } = _ref;
52
+ const wizardClasses = (0, _classnames.default)('wizard-form', className);
53
+ const [jumpingToFirstInvalid, setJumpingToFirstInvalid] = (0, _react.useState)(false);
54
+ const [activeStepNumber, setActiveStepNumber] = (0, _react.useState)(0);
55
+ const [firstDisabledStepIdx, setFirstDisabledStepIdx] = (0, _react.useState)(null);
56
+ const visibleSteps = (0, _react.useMemo)(() => {
57
+ return (stepsConfig === null || stepsConfig === void 0 ? void 0 : stepsConfig.filter(step => !step.hidden)) || [];
81
58
  }, [stepsConfig]);
82
- (0, _react.useLayoutEffect)(function () {
83
- var disabledStep = visibleSteps.find(function (step, stepIdx) {
59
+ (0, _react.useLayoutEffect)(() => {
60
+ const disabledStep = visibleSteps.find((step, stepIdx) => {
84
61
  if (step.disabled) {
85
62
  setFirstDisabledStepIdx(stepIdx);
86
63
  }
@@ -90,22 +67,18 @@ var Wizard = function Wizard(_ref) {
90
67
  setFirstDisabledStepIdx(null);
91
68
  }
92
69
  }, [visibleSteps]);
93
- (0, _react.useEffect)(function () {
94
- var firstInvalidStepIdx = visibleSteps.findIndex(function (step) {
95
- return step.invalid;
96
- });
70
+ (0, _react.useEffect)(() => {
71
+ const firstInvalidStepIdx = visibleSteps.findIndex(step => step.invalid);
97
72
  if (jumpingToFirstInvalid && (0, _lodash.isNumber)(firstInvalidStepIdx) && firstInvalidStepIdx !== -1) {
98
73
  setActiveStepNumber(firstInvalidStepIdx);
99
74
  setJumpingToFirstInvalid(false);
100
75
  }
101
76
  }, [jumpingToFirstInvalid, visibleSteps]);
102
- var stepsTemplate = (0, _react.useMemo)(function () {
103
- return _react.default.Children.toArray(children).filter(function (child, idx) {
104
- return !(0, _lodash.isEmpty)(stepsConfig) && !stepsConfig[idx].hidden;
105
- }).map(function (child, idx) {
106
- var stepIsActive = idx === activeStepNumber;
107
- var newChild = !(0, _lodash.isNumber)(firstDisabledStepIdx) || idx < firstDisabledStepIdx ? /*#__PURE__*/_react.default.cloneElement(child, {
108
- stepIsActive: stepIsActive
77
+ const stepsTemplate = (0, _react.useMemo)(() => {
78
+ return _react.default.Children.toArray(children).filter((child, idx) => !(0, _lodash.isEmpty)(stepsConfig) && !stepsConfig[idx].hidden).map((child, idx) => {
79
+ const stepIsActive = idx === activeStepNumber;
80
+ const newChild = !(0, _lodash.isNumber)(firstDisabledStepIdx) || idx < firstDisabledStepIdx ? /*#__PURE__*/_react.default.cloneElement(child, {
81
+ stepIsActive
109
82
  }) : null;
110
83
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
111
84
  className: !stepIsActive ? 'wizard-form__hidden-content-item' : 'wizard-form__visible-content-item',
@@ -113,30 +86,24 @@ var Wizard = function Wizard(_ref) {
113
86
  }, idx);
114
87
  });
115
88
  }, [activeStepNumber, children, firstDisabledStepIdx, stepsConfig]);
116
- var totalSteps = (0, _react.useMemo)(function () {
89
+ const totalSteps = (0, _react.useMemo)(() => {
117
90
  return visibleSteps.length - 1 || 0;
118
91
  }, [visibleSteps]);
119
- var isLastStep = (0, _react.useMemo)(function () {
92
+ const isLastStep = (0, _react.useMemo)(() => {
120
93
  return activeStepNumber === totalSteps;
121
94
  }, [activeStepNumber, totalSteps]);
122
- var goToNextStep = function goToNextStep() {
123
- setActiveStepNumber(function (prevStep) {
124
- return Math.min(++prevStep, totalSteps);
125
- });
126
- };
127
- var goToPreviousStep = function goToPreviousStep() {
128
- return setActiveStepNumber(function (prevStep) {
129
- return Math.max(--prevStep, 0);
130
- });
95
+ const goToNextStep = () => {
96
+ setActiveStepNumber(prevStep => Math.min(++prevStep, totalSteps));
131
97
  };
132
- var goToFirstInvalidStep = function goToFirstInvalidStep() {
98
+ const goToPreviousStep = () => setActiveStepNumber(prevStep => Math.max(--prevStep, 0));
99
+ const goToFirstInvalidStep = () => {
133
100
  setJumpingToFirstInvalid(true);
134
101
  };
135
- var jumpToStep = function jumpToStep(idx) {
102
+ const jumpToStep = idx => {
136
103
  return setActiveStepNumber(idx);
137
104
  };
138
- var getDefaultActions = function getDefaultActions(stepConfig) {
139
- var defaultActions = [];
105
+ const getDefaultActions = stepConfig => {
106
+ const defaultActions = [];
140
107
  if (activeStepNumber !== 0) {
141
108
  defaultActions.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
142
109
  id: "wizard-btn-back",
@@ -156,22 +123,20 @@ var Wizard = function Wizard(_ref) {
156
123
  }));
157
124
  return defaultActions;
158
125
  };
159
- var renderModalActions = function renderModalActions() {
126
+ const renderModalActions = () => {
160
127
  if ((0, _lodash.isEmpty)(visibleSteps)) return [];
161
- var actionsList = getDefaultActions(visibleSteps[activeStepNumber]);
162
- var allStepsAreEnabled = visibleSteps.every(function (step) {
163
- return !step.disabled;
164
- });
128
+ const actionsList = getDefaultActions(visibleSteps[activeStepNumber]);
129
+ const allStepsAreEnabled = visibleSteps.every(step => !step.disabled);
165
130
  if (getActions) {
166
- var actions = getActions({
167
- allStepsAreEnabled: allStepsAreEnabled,
168
- jumpToStep: jumpToStep,
169
- goToFirstInvalidStep: goToFirstInvalidStep
131
+ const actions = getActions({
132
+ allStepsAreEnabled,
133
+ jumpToStep,
134
+ goToFirstInvalidStep
170
135
  });
171
- var mainActions = actions.map(function (action) {
172
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread({}, action));
173
- });
174
- actionsList.push.apply(actionsList, _toConsumableArray(mainActions));
136
+ const mainActions = actions.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
137
+ ...action
138
+ }));
139
+ actionsList.push(...mainActions);
175
140
  }
176
141
  return actionsList;
177
142
  };
@@ -221,9 +186,10 @@ Wizard.propsTypes = {
221
186
  subTitle: _propTypes.default.string,
222
187
  title: _propTypes.default.string.isRequired
223
188
  };
224
- Wizard.Step = function (_ref2) {
225
- var children = _ref2.children;
189
+ Wizard.Step = _ref2 => {
190
+ let {
191
+ children
192
+ } = _ref2;
226
193
  return children;
227
194
  };
228
- var _default = Wizard;
229
- exports.default = _default;
195
+ var _default = exports.default = Wizard;
@@ -30,26 +30,28 @@ under the Apache 2.0 license is conditioned upon your compliance with
30
30
  such restriction.
31
31
  */
32
32
 
33
- var WizardSteps = function WizardSteps(_ref) {
34
- var activeStepNumber = _ref.activeStepNumber,
35
- firstDisabledStepIdx = _ref.firstDisabledStepIdx,
36
- jumpToStep = _ref.jumpToStep,
37
- steps = _ref.steps;
38
- var getStepClassNames = function getStepClassNames(idx, invalid) {
39
- return (0, _classnames.default)('wizard-steps__item', idx === activeStepNumber && 'wizard-steps__item_active', invalid && 'wizard-steps__item_invalid');
40
- };
41
- var handleJumpToStep = function handleJumpToStep(event, idx) {
33
+ const WizardSteps = _ref => {
34
+ let {
35
+ activeStepNumber,
36
+ firstDisabledStepIdx,
37
+ jumpToStep,
38
+ steps
39
+ } = _ref;
40
+ const getStepClassNames = (idx, invalid) => (0, _classnames.default)('wizard-steps__item', idx === activeStepNumber && 'wizard-steps__item_active', invalid && 'wizard-steps__item_invalid');
41
+ const handleJumpToStep = (event, idx) => {
42
42
  event.preventDefault();
43
43
  jumpToStep(idx);
44
44
  };
45
45
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
46
46
  className: "wizard-steps",
47
- children: steps.map(function (_ref2, idx) {
48
- var id = _ref2.id,
49
- label = _ref2.label,
50
- disabled = _ref2.disabled,
51
- invalid = _ref2.invalid;
52
- var stepIsDisabled = (0, _lodash.isNumber)(firstDisabledStepIdx) && idx >= firstDisabledStepIdx;
47
+ children: steps.map((_ref2, idx) => {
48
+ let {
49
+ id,
50
+ label,
51
+ disabled,
52
+ invalid
53
+ } = _ref2;
54
+ const stepIsDisabled = (0, _lodash.isNumber)(firstDisabledStepIdx) && idx >= firstDisabledStepIdx;
53
55
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
54
56
  className: getStepClassNames(idx, invalid),
55
57
  disabled: stepIsDisabled,
@@ -58,9 +60,7 @@ var WizardSteps = function WizardSteps(_ref) {
58
60
  children: idx + 1
59
61
  }),
60
62
  label: label,
61
- onClick: function onClick(e) {
62
- return handleJumpToStep(e, idx);
63
- }
63
+ onClick: e => handleJumpToStep(e, idx)
64
64
  }, id);
65
65
  })
66
66
  });
@@ -74,5 +74,4 @@ WizardSteps.propTypes = {
74
74
  jumpToStep: _propTypes.default.func.isRequired,
75
75
  steps: _types.WIZARD_STEPS_CONFIG
76
76
  };
77
- var _default = WizardSteps;
78
- exports.default = _default;
77
+ var _default = exports.default = WizardSteps;
@@ -5,109 +5,109 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "Button", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _Button.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "ConfirmDialog", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _ConfirmDialog.default;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "FormCheckBox", {
19
19
  enumerable: true,
20
- get: function get() {
20
+ get: function () {
21
21
  return _FormCheckBox.default;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "FormChipCell", {
25
25
  enumerable: true,
26
- get: function get() {
26
+ get: function () {
27
27
  return _FormChipCell.default;
28
28
  }
29
29
  });
30
30
  Object.defineProperty(exports, "FormCombobox", {
31
31
  enumerable: true,
32
- get: function get() {
32
+ get: function () {
33
33
  return _FormCombobox.default;
34
34
  }
35
35
  });
36
36
  Object.defineProperty(exports, "FormInput", {
37
37
  enumerable: true,
38
- get: function get() {
38
+ get: function () {
39
39
  return _FormInput.default;
40
40
  }
41
41
  });
42
42
  Object.defineProperty(exports, "FormKeyValueTable", {
43
43
  enumerable: true,
44
- get: function get() {
44
+ get: function () {
45
45
  return _FormKeyValueTable.default;
46
46
  }
47
47
  });
48
48
  Object.defineProperty(exports, "FormRadio", {
49
49
  enumerable: true,
50
- get: function get() {
50
+ get: function () {
51
51
  return _FormRadio.default;
52
52
  }
53
53
  });
54
54
  Object.defineProperty(exports, "FormSelect", {
55
55
  enumerable: true,
56
- get: function get() {
56
+ get: function () {
57
57
  return _FormSelect.default;
58
58
  }
59
59
  });
60
60
  Object.defineProperty(exports, "FormTextarea", {
61
61
  enumerable: true,
62
- get: function get() {
62
+ get: function () {
63
63
  return _FormTextarea.default;
64
64
  }
65
65
  });
66
66
  Object.defineProperty(exports, "FormToggle", {
67
67
  enumerable: true,
68
- get: function get() {
68
+ get: function () {
69
69
  return _FormToggle.default;
70
70
  }
71
71
  });
72
72
  Object.defineProperty(exports, "Modal", {
73
73
  enumerable: true,
74
- get: function get() {
74
+ get: function () {
75
75
  return _Modal.default;
76
76
  }
77
77
  });
78
78
  Object.defineProperty(exports, "PopUpDialog", {
79
79
  enumerable: true,
80
- get: function get() {
80
+ get: function () {
81
81
  return _PopUpDialog.default;
82
82
  }
83
83
  });
84
84
  Object.defineProperty(exports, "RoundedIcon", {
85
85
  enumerable: true,
86
- get: function get() {
86
+ get: function () {
87
87
  return _RoundedIcon.default;
88
88
  }
89
89
  });
90
90
  Object.defineProperty(exports, "TextTooltipTemplate", {
91
91
  enumerable: true,
92
- get: function get() {
92
+ get: function () {
93
93
  return _TextTooltipTemplate.default;
94
94
  }
95
95
  });
96
96
  Object.defineProperty(exports, "Tip", {
97
97
  enumerable: true,
98
- get: function get() {
98
+ get: function () {
99
99
  return _Tip.default;
100
100
  }
101
101
  });
102
102
  Object.defineProperty(exports, "Tooltip", {
103
103
  enumerable: true,
104
- get: function get() {
104
+ get: function () {
105
105
  return _Tooltip.default;
106
106
  }
107
107
  });
108
108
  Object.defineProperty(exports, "Wizard", {
109
109
  enumerable: true,
110
- get: function get() {
110
+ get: function () {
111
111
  return _Wizard.default;
112
112
  }
113
113
  });
package/dist/constants.js CHANGED
@@ -21,31 +21,23 @@ under the Apache 2.0 license is conditioned upon your compliance with
21
21
  such restriction.
22
22
  */
23
23
  /*=========== EVENT KEYS =============*/
24
- var BACKSPACE = 'Backspace';
25
- exports.BACKSPACE = BACKSPACE;
26
- var CLICK = 'Click';
27
- exports.CLICK = CLICK;
28
- var DELETE = 'Delete';
29
- exports.DELETE = DELETE;
30
- var TAB = 'Tab';
31
- exports.TAB = TAB;
32
- var TAB_SHIFT = 'Tab+Shift';
24
+ const BACKSPACE = exports.BACKSPACE = 'Backspace';
25
+ const CLICK = exports.CLICK = 'Click';
26
+ const DELETE = exports.DELETE = 'Delete';
27
+ const TAB = exports.TAB = 'Tab';
28
+ const TAB_SHIFT = exports.TAB_SHIFT = 'Tab+Shift';
33
29
 
34
30
  /*=========== BUTTONS =============*/
35
- exports.TAB_SHIFT = TAB_SHIFT;
36
- var PRIMARY_BUTTON = 'primary';
37
- exports.PRIMARY_BUTTON = PRIMARY_BUTTON;
38
- var SECONDARY_BUTTON = 'secondary';
39
- exports.SECONDARY_BUTTON = SECONDARY_BUTTON;
40
- var TERTIARY_BUTTON = 'tertiary';
41
- exports.TERTIARY_BUTTON = TERTIARY_BUTTON;
42
- var DANGER_BUTTON = 'danger';
43
- exports.DANGER_BUTTON = DANGER_BUTTON;
44
- var LABEL_BUTTON = 'label';
31
+
32
+ const PRIMARY_BUTTON = exports.PRIMARY_BUTTON = 'primary';
33
+ const SECONDARY_BUTTON = exports.SECONDARY_BUTTON = 'secondary';
34
+ const TERTIARY_BUTTON = exports.TERTIARY_BUTTON = 'tertiary';
35
+ const DANGER_BUTTON = exports.DANGER_BUTTON = 'danger';
36
+ const LABEL_BUTTON = exports.LABEL_BUTTON = 'label';
45
37
 
46
38
  /*=========== VALITATION =============*/
47
- exports.LABEL_BUTTON = LABEL_BUTTON;
48
- var validation = {
39
+
40
+ const validation = exports.validation = {
49
41
  BEGIN_END_NOT_WITH: {
50
42
  LABEL: 'Must not begin and end with',
51
43
  NAME: 'beginEndNot'
@@ -105,28 +97,18 @@ var validation = {
105
97
  };
106
98
 
107
99
  /*=========== STATUS CODES =============*/
108
- exports.validation = validation;
109
- var BADREQUEST_ERROR_STATUS_CODE = 400;
110
- exports.BADREQUEST_ERROR_STATUS_CODE = BADREQUEST_ERROR_STATUS_CODE;
111
- var FORBIDDEN_ERROR_STATUS_CODE = 403;
112
- exports.FORBIDDEN_ERROR_STATUS_CODE = FORBIDDEN_ERROR_STATUS_CODE;
113
- var NOTFOUND_ERROR_STATUS_CODE = 404;
114
- exports.NOTFOUND_ERROR_STATUS_CODE = NOTFOUND_ERROR_STATUS_CODE;
115
- var CONFLICT_ERROR_STATUS_CODE = 409;
116
- exports.CONFLICT_ERROR_STATUS_CODE = CONFLICT_ERROR_STATUS_CODE;
117
- var INTERNAL_SERVER_ERROR_STATUS_CODE = 500;
118
- exports.INTERNAL_SERVER_ERROR_STATUS_CODE = INTERNAL_SERVER_ERROR_STATUS_CODE;
119
- var GATEWAY_TIMEOUT_STATUS_CODE = 504;
100
+
101
+ const BADREQUEST_ERROR_STATUS_CODE = exports.BADREQUEST_ERROR_STATUS_CODE = 400;
102
+ const FORBIDDEN_ERROR_STATUS_CODE = exports.FORBIDDEN_ERROR_STATUS_CODE = 403;
103
+ const NOTFOUND_ERROR_STATUS_CODE = exports.NOTFOUND_ERROR_STATUS_CODE = 404;
104
+ const CONFLICT_ERROR_STATUS_CODE = exports.CONFLICT_ERROR_STATUS_CODE = 409;
105
+ const INTERNAL_SERVER_ERROR_STATUS_CODE = exports.INTERNAL_SERVER_ERROR_STATUS_CODE = 500;
106
+ const GATEWAY_TIMEOUT_STATUS_CODE = exports.GATEWAY_TIMEOUT_STATUS_CODE = 504;
120
107
 
121
108
  /*=========== MODAL =============*/
122
- exports.GATEWAY_TIMEOUT_STATUS_CODE = GATEWAY_TIMEOUT_STATUS_CODE;
123
- var MODAL_SM = 'sm';
124
- exports.MODAL_SM = MODAL_SM;
125
- var MODAL_MD = 'md';
126
- exports.MODAL_MD = MODAL_MD;
127
- var MODAL_LG = 'lg';
128
- exports.MODAL_LG = MODAL_LG;
129
- var MODAL_MIN = 'min';
130
- exports.MODAL_MIN = MODAL_MIN;
131
- var MODAL_MAX = 'max';
132
- exports.MODAL_MAX = MODAL_MAX;
109
+
110
+ const MODAL_SM = exports.MODAL_SM = 'sm';
111
+ const MODAL_MD = exports.MODAL_MD = 'md';
112
+ const MODAL_LG = exports.MODAL_LG = 'lg';
113
+ const MODAL_MIN = exports.MODAL_MIN = 'min';
114
+ const MODAL_MAX = exports.MODAL_MAX = 'max';
@@ -29,22 +29,22 @@ under the Apache 2.0 license is conditioned upon your compliance with
29
29
  such restriction.
30
30
  */
31
31
 
32
- var FormActionButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
33
- var disabled = _ref.disabled,
34
- fields = _ref.fields,
35
- fieldsPath = _ref.fieldsPath,
36
- hidden = _ref.hidden,
37
- id = _ref.id,
38
- label = _ref.label,
39
- _onClick = _ref.onClick;
32
+ const FormActionButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
33
+ let {
34
+ disabled,
35
+ fields,
36
+ fieldsPath,
37
+ hidden,
38
+ id,
39
+ label,
40
+ onClick
41
+ } = _ref;
40
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
41
43
  children: [!hidden && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
42
44
  className: "form-table__row form-table__action-row no-hover",
43
45
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
44
46
  "data-testid": id ? id : "".concat(fieldsPath, "-add-btn"),
45
- onClick: function onClick(event) {
46
- return _onClick(event, fields, fieldsPath);
47
- },
47
+ onClick: event => onClick(event, fields, fieldsPath),
48
48
  disabled: disabled,
49
49
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_plus.ReactComponent, {}), label]
50
50
  })
@@ -66,5 +66,4 @@ FormActionButton.propTypes = {
66
66
  label: _propTypes.default.string,
67
67
  onClick: _propTypes.default.func.isRequired
68
68
  };
69
- var _default = FormActionButton;
70
- exports.default = _default;
69
+ var _default = exports.default = FormActionButton;