iguazio.dashboard-react-controls 0.0.39 → 1.2.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 (79) hide show
  1. package/dist/components/Backdrop/Backdrop.js +4 -11
  2. package/dist/components/Button/Button.js +25 -28
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +10 -24
  4. package/dist/components/FormCheckBox/FormCheckBox.js +25 -25
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +33 -33
  6. package/dist/components/FormChipCell/FormChipCell.js +66 -109
  7. package/dist/components/FormChipCell/FormChipCellView.js +19 -37
  8. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +58 -90
  9. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -22
  10. package/dist/components/FormChipCell/formChipCell.util.js +0 -1
  11. package/dist/components/FormCombobox/FormCombobox.js +82 -140
  12. package/dist/components/FormInput/FormInput.js +110 -175
  13. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +6 -21
  14. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +23 -39
  15. package/dist/components/FormRadio/FormRadio.js +23 -22
  16. package/dist/components/FormSelect/FormSelect.js +56 -92
  17. package/dist/components/FormSelect/FormSelect.test.js +19 -35
  18. package/dist/components/FormTextarea/FormTextarea.js +44 -69
  19. package/dist/components/Modal/Modal.js +8 -21
  20. package/dist/components/Modal/Modal.scss +2 -2
  21. package/dist/components/PopUpDialog/PopUpDialog.js +28 -43
  22. package/dist/components/RoundedIcon/RoundedIcon.js +7 -18
  23. package/dist/components/RoundedIcon/roundedIcon.scss +2 -2
  24. package/dist/components/Tip/Tip.js +25 -40
  25. package/dist/components/Tip/Tip.test.js +36 -45
  26. package/dist/components/Tooltip/Tooltip.js +40 -64
  27. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +2 -8
  28. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +2 -12
  29. package/dist/components/Wizard/Wizard.js +35 -57
  30. package/dist/components/Wizard/Wizard.scss +1 -3
  31. package/dist/components/Wizard/WizardSteps/WizardSteps.js +4 -16
  32. package/dist/components/Wizard/WizardSteps/WizardSteps.scss +1 -0
  33. package/dist/components/index.js +0 -18
  34. package/dist/constants.js +4 -6
  35. package/dist/elements/FormActionButton/FormActionButton.js +6 -12
  36. package/dist/elements/FormRowActions/FormRowActions.js +6 -18
  37. package/dist/elements/HiddenChipsBlock/HiddenChipsBlock.js +37 -55
  38. package/dist/elements/OptionsMenu/OptionsMenu.js +4 -14
  39. package/dist/elements/SelectOption/SelectOption.js +6 -18
  40. package/dist/elements/SelectOption/SelectOption.test.js +19 -12
  41. package/dist/elements/SelectOption/selectOption.scss +5 -2
  42. package/dist/elements/ValidationTemplate/ValidationTemplate.js +2 -11
  43. package/dist/elements/index.js +0 -6
  44. package/dist/hooks/index.js +0 -1
  45. package/dist/hooks/useDebounce.js +1 -5
  46. package/dist/hooks/useDetectOutsideClick.js +4 -8
  47. package/dist/hooks/useFormTable.hook.js +31 -41
  48. package/dist/images/archive-icon.svg +3 -0
  49. package/dist/images/arrow.svg +1 -1
  50. package/dist/images/close.svg +2 -2
  51. package/dist/images/collapse.svg +2 -2
  52. package/dist/images/copy-to-clipboard-icon.svg +3 -0
  53. package/dist/images/deploy-icon.svg +4 -0
  54. package/dist/images/edit.svg +1 -1
  55. package/dist/images/edit_old.svg +3 -0
  56. package/dist/images/expand.svg +2 -2
  57. package/dist/images/eye-icon.svg +3 -0
  58. package/dist/images/link-icon.svg +5 -0
  59. package/dist/images/monitor-icon.svg +3 -0
  60. package/dist/images/refresh.svg +1 -1
  61. package/dist/images/tag-icon.svg +4 -0
  62. package/dist/images/unarchive-icon.svg +3 -0
  63. package/dist/images/yaml.svg +2 -3
  64. package/dist/images/yaml_old.svg +4 -0
  65. package/dist/index.js +0 -13
  66. package/dist/scss/borders.scss +1 -1
  67. package/dist/scss/colors.scss +2 -0
  68. package/dist/scss/common.scss +7 -3
  69. package/dist/scss/mixins.scss +6 -19
  70. package/dist/scss/shadows.scss +3 -3
  71. package/dist/scss/variables.scss +2 -0
  72. package/dist/types.js +19 -49
  73. package/dist/utils/common.util.js +3 -13
  74. package/dist/utils/form.util.js +20 -24
  75. package/dist/utils/generateChipsList.util.js +0 -3
  76. package/dist/utils/getFirstScrollableParent.util.js +0 -5
  77. package/dist/utils/validation.util.js +72 -94
  78. package/package.json +104 -104
  79. package/dist/images/eye.svg +0 -4
@@ -1,120 +1,101 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _lodash = require("lodash");
17
-
18
12
  var _NewChipInput = _interopRequireDefault(require("../NewChipInput/NewChipInput"));
19
-
20
13
  var _OptionsMenu = _interopRequireDefault(require("../../../elements/OptionsMenu/OptionsMenu"));
21
-
22
14
  var _ValidationTemplate = _interopRequireDefault(require("../../../elements/ValidationTemplate/ValidationTemplate"));
23
-
24
15
  var _types = require("../../../types");
25
-
26
16
  var _constants = require("../../../constants");
27
-
28
17
  var _close = require("../../../images/close.svg");
29
-
30
18
  require("./newChipForm.scss");
31
-
32
19
  var _jsxRuntime = require("react/jsx-runtime");
33
-
34
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
-
36
21
  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); }
37
-
38
22
  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; }
39
-
40
23
  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; }
41
-
42
24
  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; }
43
-
44
- 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; }
45
-
25
+ 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; }
26
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
27
+ 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); }
46
28
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
47
-
48
29
  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."); }
49
-
50
30
  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); }
51
-
52
- 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; }
53
-
54
- 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; }
55
-
56
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
-
31
+ 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; }
32
+ 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; } }
33
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
34
+ Copyright 2022 Iguazio Systems Ltd.
35
+ Licensed under the Apache License, Version 2.0 (the "License") with
36
+ an addition restriction as set forth herein. You may not use this
37
+ file except in compliance with the License. You may obtain a copy of
38
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
39
+ Unless required by applicable law or agreed to in writing, software
40
+ distributed under the License is distributed on an "AS IS" BASIS,
41
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
42
+ implied. See the License for the specific language governing
43
+ permissions and limitations under the License.
44
+ In addition, you may not use the software for any purposes that are
45
+ illegal under applicable law, and the grant of the foregoing license
46
+ under the Apache 2.0 license is conditioned upon your compliance with
47
+ such restriction.
48
+ */
58
49
  var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
59
50
  var chip = _ref.chip,
60
- chipIndex = _ref.chipIndex,
61
- chipOptions = _ref.chipOptions,
62
- className = _ref.className,
63
- editConfig = _ref.editConfig,
64
- handleRemoveChip = _ref.handleRemoveChip,
65
- isEditable = _ref.isEditable,
66
- keyName = _ref.keyName,
67
- meta = _ref.meta,
68
- onChange = _ref.onChange,
69
- setEditConfig = _ref.setEditConfig,
70
- rules = _ref.validationRules,
71
- valueName = _ref.valueName;
72
-
51
+ chipIndex = _ref.chipIndex,
52
+ chipOptions = _ref.chipOptions,
53
+ className = _ref.className,
54
+ editConfig = _ref.editConfig,
55
+ handleRemoveChip = _ref.handleRemoveChip,
56
+ isEditable = _ref.isEditable,
57
+ keyName = _ref.keyName,
58
+ meta = _ref.meta,
59
+ onChange = _ref.onChange,
60
+ setEditConfig = _ref.setEditConfig,
61
+ rules = _ref.validationRules,
62
+ valueName = _ref.valueName;
73
63
  var _useState = (0, _react.useState)({
74
- isKeyOnly: chip.isKeyOnly,
75
- key: chip.key,
76
- value: chip.value,
77
- keyFieldWidth: 0,
78
- valueFieldWidth: 0
79
- }),
80
- _useState2 = _slicedToArray(_useState, 2),
81
- chipData = _useState2[0],
82
- setChipData = _useState2[1];
83
-
64
+ isKeyOnly: chip.isKeyOnly,
65
+ key: chip.key,
66
+ value: chip.value,
67
+ keyFieldWidth: 0,
68
+ valueFieldWidth: 0
69
+ }),
70
+ _useState2 = _slicedToArray(_useState, 2),
71
+ chipData = _useState2[0],
72
+ setChipData = _useState2[1];
84
73
  var _useState3 = (0, _react.useState)('key'),
85
- _useState4 = _slicedToArray(_useState3, 2),
86
- selectedInput = _useState4[0],
87
- setSelectedInput = _useState4[1];
88
-
74
+ _useState4 = _slicedToArray(_useState3, 2),
75
+ selectedInput = _useState4[0],
76
+ setSelectedInput = _useState4[1];
89
77
  var _useState5 = (0, _react.useState)(rules),
90
- _useState6 = _slicedToArray(_useState5, 2),
91
- validationRules = _useState6[0],
92
- setValidationRules = _useState6[1];
93
-
78
+ _useState6 = _slicedToArray(_useState5, 2),
79
+ validationRules = _useState6[0],
80
+ setValidationRules = _useState6[1];
94
81
  var _useState7 = (0, _react.useState)(false),
95
- _useState8 = _slicedToArray(_useState7, 2),
96
- showValidationRules = _useState8[0],
97
- setShowValidationRules = _useState8[1];
98
-
82
+ _useState8 = _slicedToArray(_useState7, 2),
83
+ showValidationRules = _useState8[0],
84
+ setShowValidationRules = _useState8[1];
99
85
  var maxWidthInput = (0, _react.useMemo)(function () {
100
86
  var _ref$current;
101
-
102
87
  return ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientWidth) - 50;
103
88
  }, [ref]);
104
89
  var background = chipOptions.background,
105
- borderColor = chipOptions.borderColor,
106
- borderRadius = chipOptions.borderRadius,
107
- density = chipOptions.density,
108
- font = chipOptions.font;
90
+ borderColor = chipOptions.borderColor,
91
+ borderRadius = chipOptions.borderRadius,
92
+ density = chipOptions.density,
93
+ font = chipOptions.font;
109
94
  var minWidthInput = 25;
110
95
  var minWidthValueInput = 35;
111
-
112
96
  var refInputKey = _react.default.useRef({});
113
-
114
97
  var refInputValue = _react.default.useRef({});
115
-
116
98
  var refInputContainer = _react.default.useRef();
117
-
118
99
  var labelKeyClassName = (0, _classnames.default)(className, !editConfig.isKeyFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'key'], [])) && !(0, _lodash.isEmpty)(chipData.key) && 'item_edited_invalid');
119
100
  var labelContainerClassName = (0, _classnames.default)('edit-chip-container', background && "edit-chip-container-background_".concat(background), borderColor && "edit-chip-container-border_".concat(borderColor), font && "edit-chip-container-font_".concat(font), density && "edit-chip-container-density_".concat(density), borderRadius && "edit-chip-container-border_".concat(borderRadius), (editConfig.isEdit || editConfig.isNewChip) && 'edit-chip-container_edited');
120
101
  var labelValueClassName = (0, _classnames.default)('input-label-value', !editConfig.isValueFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'value'], [])) && !(0, _lodash.isEmpty)(chipData.value) && 'item_edited_invalid');
@@ -132,16 +113,13 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
132
113
  });
133
114
  }
134
115
  }, [chipData.key, chipData.value, chipData.keyFieldWidth, chipData.valueFieldWidth, maxWidthInput, refInputKey, refInputValue]);
135
-
136
116
  var handleScroll = function handleScroll() {
137
117
  setShowValidationRules(false);
138
118
  };
139
-
140
119
  (0, _react.useEffect)(function () {
141
120
  if (showValidationRules) {
142
121
  window.addEventListener('scroll', handleScroll, true);
143
122
  }
144
-
145
123
  return function () {
146
124
  window.removeEventListener('scroll', handleScroll, true);
147
125
  };
@@ -158,9 +136,7 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
158
136
  var outsideClick = (0, _react.useCallback)(function (event) {
159
137
  if (editConfig.chipIndex === chipIndex) {
160
138
  var _event$path, _event$composedPath;
161
-
162
139
  var elementPath = (_event$path = event.path) !== null && _event$path !== void 0 ? _event$path : (_event$composedPath = event.composedPath) === null || _event$composedPath === void 0 ? void 0 : _event$composedPath.call(event);
163
-
164
140
  if (!elementPath.includes(refInputContainer.current)) {
165
141
  onChange(event, _constants.CLICK);
166
142
  window.getSelection().removeAllRanges();
@@ -179,14 +155,12 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
179
155
  }, [outsideClick, editConfig.isEdit]);
180
156
  var focusChip = (0, _react.useCallback)(function (event) {
181
157
  event.stopPropagation();
182
-
183
158
  if (editConfig.chipIndex === chipIndex && isEditable) {
184
159
  if (!event.shiftKey && event.key === _constants.TAB && editConfig.isValueFocused) {
185
160
  onChange(event, _constants.TAB);
186
161
  } else if (event.shiftKey && event.key === _constants.TAB && editConfig.isKeyFocused) {
187
162
  onChange(event, _constants.TAB_SHIFT);
188
163
  }
189
-
190
164
  if (event.key === _constants.BACKSPACE || event.key === _constants.DELETE) {
191
165
  setChipData(function (prevState) {
192
166
  return {
@@ -216,13 +190,11 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
216
190
  });
217
191
  });
218
192
  }
219
-
220
193
  event && event.stopPropagation();
221
194
  }
222
195
  }, [keyName, refInputKey, refInputValue, setEditConfig, editConfig.chipIndex, chipIndex]);
223
196
  var handleOnChange = (0, _react.useCallback)(function (event) {
224
197
  event.preventDefault();
225
-
226
198
  if (event.target.name === keyName) {
227
199
  var currentWidthKeyInput = refInputKey.current.scrollWidth;
228
200
  setChipData(function (prevState) {
@@ -235,7 +207,6 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
235
207
  var currentWidthValueInput = refInputValue.current.scrollWidth;
236
208
  setChipData(function (prevState) {
237
209
  var _refInputValue$curren;
238
-
239
210
  return _objectSpread(_objectSpread({}, prevState), {}, {
240
211
  value: refInputValue.current.value,
241
212
  valueFieldWidth: ((_refInputValue$curren = refInputValue.current.value) === null || _refInputValue$curren === void 0 ? void 0 : _refInputValue$curren.length) <= 1 ? minWidthValueInput : currentWidthValueInput >= maxWidthInput ? maxWidthInput : currentWidthValueInput > minWidthValueInput ? currentWidthValueInput + 2 : minWidthValueInput
@@ -257,7 +228,6 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
257
228
  if (meta.error) {
258
229
  setValidationRules(function (prevState) {
259
230
  var _prevState$selectedIn;
260
-
261
231
  return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, selectedInput, (_prevState$selectedIn = prevState[selectedInput]) === null || _prevState$selectedIn === void 0 ? void 0 : _prevState$selectedIn.map(function (rule) {
262
232
  return _objectSpread(_objectSpread({}, rule), {}, {
263
233
  isValid: (0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', editConfig.chipIndex, selectedInput], [])) ? true : !meta.error[editConfig.chipIndex][selectedInput].some(function (err) {
@@ -271,12 +241,11 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
271
241
  }, [meta, showValidationRules, selectedInput, editConfig.chipIndex]);
272
242
  var getValidationRules = (0, _react.useCallback)(function () {
273
243
  var _validationRules$sele;
274
-
275
244
  return (_validationRules$sele = validationRules[selectedInput]) === null || _validationRules$sele === void 0 ? void 0 : _validationRules$sele.map(function (_ref2) {
276
245
  var _ref2$isValid = _ref2.isValid,
277
- isValid = _ref2$isValid === void 0 ? false : _ref2$isValid,
278
- label = _ref2.label,
279
- name = _ref2.name;
246
+ isValid = _ref2$isValid === void 0 ? false : _ref2$isValid,
247
+ label = _ref2.label,
248
+ name = _ref2.name;
280
249
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ValidationTemplate.default, {
281
250
  valid: isValid,
282
251
  validationMessage: label
@@ -327,7 +296,6 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
327
296
  })]
328
297
  });
329
298
  });
330
-
331
299
  NewChipForm.defaultProps = {
332
300
  className: '',
333
301
  validationRules: {}
@@ -1,51 +1,54 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
7
-
8
8
  var _react = _interopRequireDefault(require("react"));
9
-
10
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
10
  var _reactFinalForm = require("react-final-form");
13
-
14
11
  var _jsxRuntime = require("react/jsx-runtime");
15
-
16
12
  var _excluded = ["name", "onChange", "onFocus"];
17
-
13
+ /*
14
+ Copyright 2022 Iguazio Systems Ltd.
15
+ Licensed under the Apache License, Version 2.0 (the "License") with
16
+ an addition restriction as set forth herein. You may not use this
17
+ file except in compliance with the License. You may obtain a copy of
18
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
19
+ Unless required by applicable law or agreed to in writing, software
20
+ distributed under the License is distributed on an "AS IS" BASIS,
21
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
22
+ implied. See the License for the specific language governing
23
+ permissions and limitations under the License.
24
+ In addition, you may not use the software for any purposes that are
25
+ illegal under applicable law, and the grant of the foregoing license
26
+ under the Apache 2.0 license is conditioned upon your compliance with
27
+ such restriction.
28
+ */
18
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
30
  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; }
21
-
22
31
  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; }
23
-
24
- 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; }
25
-
32
+ 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; }
33
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
34
+ 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); }
26
35
  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; }
27
-
28
36
  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; }
29
-
30
37
  var NewChipInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
31
38
  var name = _ref.name,
32
- onChange = _ref.onChange,
33
- onFocus = _ref.onFocus,
34
- inputProps = _objectWithoutProperties(_ref, _excluded);
35
-
39
+ onChange = _ref.onChange,
40
+ onFocus = _ref.onFocus,
41
+ inputProps = _objectWithoutProperties(_ref, _excluded);
36
42
  var _useField = (0, _reactFinalForm.useField)(name),
37
- input = _useField.input;
38
-
43
+ input = _useField.input;
39
44
  var handleInputChange = function handleInputChange(event) {
40
45
  input.onChange(event);
41
46
  onChange(event);
42
47
  };
43
-
44
48
  var handleInputFocus = function handleInputFocus(event) {
45
49
  input.onFocus(event);
46
50
  onFocus(event);
47
51
  };
48
-
49
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
50
53
  name: name,
51
54
  children: function children(_ref2) {
@@ -63,7 +66,6 @@ var NewChipInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
63
66
  }
64
67
  });
65
68
  });
66
-
67
69
  NewChipInput.propTypes = {
68
70
  name: _propTypes.default.string.isRequired,
69
71
  onChange: _propTypes.default.func.isRequired,
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.uniquenessError = void 0;
7
-
8
7
  /*
9
8
  Copyright 2022 Iguazio Systems Ltd.
10
9
  Licensed under the Apache License, Version 2.0 (the "License") with