iguazio.dashboard-react-controls 2.1.4 → 2.1.5

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 (30) hide show
  1. package/dist/components/Backdrop/Backdrop.js +1 -5
  2. package/dist/components/Button/Button.js +6 -14
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +7 -16
  4. package/dist/components/FormCheckBox/FormCheckBox.js +4 -10
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +12 -22
  6. package/dist/components/FormChipCell/FormChipCell.js +17 -29
  7. package/dist/components/FormChipCell/FormChipCellView.js +11 -17
  8. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +1 -4
  9. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +5 -6
  10. package/dist/components/FormCombobox/FormCombobox.js +22 -42
  11. package/dist/components/FormInput/FormInput.js +41 -59
  12. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +4 -10
  13. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +18 -38
  14. package/dist/components/FormRadio/FormRadio.js +2 -6
  15. package/dist/components/FormSelect/FormSelect.js +11 -27
  16. package/dist/components/FormTextarea/FormTextarea.js +13 -28
  17. package/dist/components/FormToggle/FormToggle.js +3 -8
  18. package/dist/components/Modal/Modal.js +6 -14
  19. package/dist/components/PopUpDialog/PopUpDialog.js +8 -18
  20. package/dist/components/RoundedIcon/RoundedIcon.js +6 -14
  21. package/dist/components/Tip/Tip.js +1 -4
  22. package/dist/components/Tooltip/Tooltip.js +4 -10
  23. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +2 -6
  24. package/dist/components/Wizard/Wizard.js +6 -16
  25. package/dist/components/Wizard/WizardSteps/WizardSteps.js +1 -4
  26. package/dist/elements/FormActionButton/FormActionButton.js +3 -8
  27. package/dist/elements/FormRowActions/FormRowActions.js +4 -10
  28. package/dist/elements/OptionsMenu/OptionsMenu.js +4 -9
  29. package/dist/elements/SelectOption/SelectOption.js +3 -8
  30. package/package.json +1 -1
@@ -30,7 +30,7 @@ such restriction.
30
30
  const Backdrop = _ref => {
31
31
  let {
32
32
  duration = 300,
33
- show,
33
+ show = false,
34
34
  onClose
35
35
  } = _ref;
36
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
@@ -45,10 +45,6 @@ const Backdrop = _ref => {
45
45
  })
46
46
  });
47
47
  };
48
- Backdrop.defaultProps = {
49
- duration: 300,
50
- show: false
51
- };
52
48
  Backdrop.propTypes = {
53
49
  show: _propTypes.default.bool.isRequired
54
50
  };
@@ -35,13 +35,13 @@ such restriction.
35
35
 
36
36
  const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
37
37
  let {
38
- className,
39
- density,
38
+ className = '',
39
+ density = 'normal',
40
40
  icon,
41
- id,
42
- label,
43
- tooltip,
44
- variant,
41
+ id = 'btn',
42
+ label = 'Button',
43
+ tooltip = '',
44
+ variant = _constants.TERTIARY_BUTTON,
45
45
  ...restProps
46
46
  } = _ref;
47
47
  const buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), "btn-".concat(density), className);
@@ -62,14 +62,6 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
62
62
  })]
63
63
  });
64
64
  });
65
- Button.defaultProps = {
66
- className: '',
67
- density: 'normal',
68
- id: 'btn',
69
- label: 'Button',
70
- tooltip: '',
71
- variant: _constants.TERTIARY_BUTTON
72
- };
73
65
  Button.propTypes = {
74
66
  className: _propTypes.default.string,
75
67
  density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
@@ -32,16 +32,16 @@ such restriction.
32
32
 
33
33
  const ConfirmDialog = _ref => {
34
34
  let {
35
- cancelButton,
35
+ cancelButton = null,
36
36
  children,
37
- className,
37
+ className = '',
38
38
  closePopUp,
39
- confirmButton,
40
- customPosition,
41
- header,
39
+ confirmButton = null,
40
+ customPosition = {},
41
+ header = '',
42
42
  isOpen,
43
- message,
44
- messageOnly,
43
+ message = '',
44
+ messageOnly = false,
45
45
  onResolve
46
46
  } = _ref;
47
47
  const messageClassNames = (0, _classnames.default)('confirm-dialog__message', messageOnly && 'confirm-dialog__message-only');
@@ -88,15 +88,6 @@ const ConfirmDialog = _ref => {
88
88
  })
89
89
  });
90
90
  };
91
- ConfirmDialog.defaultProps = {
92
- cancelButton: null,
93
- className: '',
94
- confirmButton: null,
95
- customPosition: {},
96
- header: '',
97
- message: '',
98
- messageOnly: false
99
- };
100
91
  ConfirmDialog.propTypes = {
101
92
  cancelButton: _types.CONFIRM_DIALOG_CANCEL_BUTTON,
102
93
  className: _propTypes.default.string,
@@ -33,11 +33,11 @@ such restriction.
33
33
  const FormCheckBox = _ref => {
34
34
  let {
35
35
  children,
36
- className,
37
- highlightLabel,
38
- label,
36
+ className = '',
37
+ highlightLabel = false,
38
+ label = '',
39
39
  name,
40
- readOnly,
40
+ readOnly = false,
41
41
  ...inputProps
42
42
  } = _ref;
43
43
  const formFieldClassNames = (0, _classnames.default)('form-field-checkbox', readOnly && 'form-field-checkbox_readonly', className);
@@ -73,12 +73,6 @@ const FormCheckBox = _ref => {
73
73
  }
74
74
  });
75
75
  };
76
- FormCheckBox.defaultProps = {
77
- className: '',
78
- highlightLabel: false,
79
- label: '',
80
- readOnly: false
81
- };
82
76
  FormCheckBox.propTypes = {
83
77
  className: _propTypes.default.string,
84
78
  highlightLabel: _propTypes.default.bool,
@@ -34,19 +34,25 @@ const FormChip = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
34
34
  let {
35
35
  chip,
36
36
  chipIndex,
37
- chipOptions,
37
+ chipOptions = {
38
+ background: 'purple',
39
+ boldValue: false,
40
+ borderRadius: 'primary',
41
+ borderColor: 'transparent',
42
+ density: 'dense',
43
+ font: 'purple'
44
+ },
38
45
  editConfig,
39
46
  handleEditChip,
40
47
  handleRemoveChip,
41
48
  handleToEditMode,
42
- isDeleteMode,
43
- isEditable,
44
- keyName,
49
+ isEditable = false,
50
+ keyName = '',
45
51
  meta,
46
52
  setChipsSizes,
47
53
  setEditConfig,
48
- validationRules,
49
- valueName
54
+ validationRules = {},
55
+ valueName = ''
50
56
  } = _ref;
51
57
  const chipRef = _react.default.useRef();
52
58
  (0, _react.useEffect)(() => {
@@ -80,21 +86,6 @@ const FormChip = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
80
86
  })
81
87
  });
82
88
  });
83
- FormChip.defaultProps = {
84
- chipOptions: {
85
- background: 'purple',
86
- boldValue: false,
87
- borderRadius: 'primary',
88
- borderColor: 'transparent',
89
- density: 'dense',
90
- font: 'purple'
91
- },
92
- isDeleteMode: false,
93
- isEditable: false,
94
- keyName: '',
95
- validationRules: {},
96
- valueName: ''
97
- };
98
89
  FormChip.propTypes = {
99
90
  chip: _propTypes.default.object.isRequired,
100
91
  chipIndex: _propTypes.default.number.isRequired,
@@ -103,7 +94,6 @@ FormChip.propTypes = {
103
94
  handleEditChip: _propTypes.default.func.isRequired,
104
95
  handleRemoveChip: _propTypes.default.func.isRequired,
105
96
  handleToEditMode: _propTypes.default.func.isRequired,
106
- isDeleteMode: _propTypes.default.bool,
107
97
  isEditable: _propTypes.default.bool,
108
98
  keyName: _propTypes.default.string,
109
99
  meta: _propTypes.default.object.isRequired,
@@ -40,20 +40,27 @@ such restriction.
40
40
 
41
41
  const FormChipCell = _ref => {
42
42
  let {
43
- chipOptions,
44
- className,
45
- delimiter,
43
+ chipOptions = {
44
+ background: 'purple',
45
+ boldValue: false,
46
+ borderRadius: 'primary',
47
+ borderColor: 'transparent',
48
+ density: 'dense',
49
+ font: 'purple'
50
+ },
51
+ className = '',
52
+ delimiter = null,
46
53
  formState,
47
54
  initialValues,
48
- isEditable,
49
- label,
55
+ isEditable = false,
56
+ label = null,
50
57
  name,
51
- onClick,
52
- shortChips,
53
- validationRules,
54
- validator,
58
+ onClick = () => {},
59
+ shortChips = false,
60
+ validationRules = {},
61
+ validator = null,
55
62
  onExitEditModeCallback,
56
- visibleChipsMaxLength
63
+ visibleChipsMaxLength = null
57
64
  } = _ref;
58
65
  const chipsClassName = (0, _classnames.default)('chips', className);
59
66
  const {
@@ -314,25 +321,6 @@ const FormChipCell = _ref => {
314
321
  })]
315
322
  });
316
323
  };
317
- FormChipCell.defaultProps = {
318
- chipOptions: {
319
- background: 'purple',
320
- boldValue: false,
321
- borderRadius: 'primary',
322
- borderColor: 'transparent',
323
- density: 'dense',
324
- font: 'purple'
325
- },
326
- className: '',
327
- delimiter: null,
328
- isEditable: false,
329
- label: null,
330
- onClick: () => {},
331
- shortChips: false,
332
- validationRules: {},
333
- validator: null,
334
- visibleChipsMaxLength: null
335
- };
336
324
  FormChipCell.propTypes = {
337
325
  chipOptions: _types.CHIP_OPTIONS,
338
326
  className: _propTypes.default.string,
@@ -38,7 +38,14 @@ such restriction.
38
38
 
39
39
  const FormChipCellView = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) => {
40
40
  let {
41
- chipOptions,
41
+ chipOptions = {
42
+ background: 'purple',
43
+ boldValue: false,
44
+ borderRadius: 'primary',
45
+ borderColor: 'transparent',
46
+ density: 'dense',
47
+ font: 'purple'
48
+ },
42
49
  chips,
43
50
  editConfig,
44
51
  formState,
@@ -47,15 +54,15 @@ const FormChipCellView = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
47
54
  handleRemoveChip,
48
55
  handleShowElements,
49
56
  handleToEditMode,
50
- isEditable,
57
+ isEditable = false,
51
58
  name,
52
59
  setChipsSizes,
53
60
  setEditConfig,
54
- shortChips,
61
+ shortChips = false,
55
62
  showChips,
56
63
  showHiddenChips,
57
64
  validateFields,
58
- validationRules
65
+ validationRules = {}
59
66
  } = _ref;
60
67
  let {
61
68
  chipsCellRef,
@@ -150,19 +157,6 @@ const FormChipCellView = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
150
157
  }
151
158
  });
152
159
  });
153
- FormChipCellView.defaultProps = {
154
- chipOptions: {
155
- background: 'purple',
156
- boldValue: false,
157
- borderRadius: 'primary',
158
- borderColor: 'transparent',
159
- density: 'dense',
160
- font: 'purple'
161
- },
162
- isEditable: false,
163
- shortChips: false,
164
- validationRules: {}
165
- };
166
160
  FormChipCellView.propTypes = {
167
161
  chipOptions: _types.CHIP_OPTIONS,
168
162
  chips: _propTypes.default.object.isRequired,
@@ -39,7 +39,7 @@ const HiddenChipsBlock = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
39
39
  chipOptions,
40
40
  chips,
41
41
  handleShowElements,
42
- textOverflowEllipsis
42
+ textOverflowEllipsis = false
43
43
  } = _ref;
44
44
  let {
45
45
  hiddenChipsCounterRef,
@@ -97,9 +97,6 @@ const HiddenChipsBlock = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
97
97
  })
98
98
  }), document.getElementById('overlay_container'));
99
99
  });
100
- HiddenChipsBlock.defaultProps = {
101
- textOverflowEllipsis: false
102
- };
103
100
  HiddenChipsBlock.propTypes = {
104
101
  chipClassNames: _propTypes.default.string.isRequired,
105
102
  chipOptions: _types.CHIP_OPTIONS.isRequired,
@@ -37,12 +37,15 @@ under the Apache 2.0 license is conditioned upon your compliance with
37
37
  such restriction.
38
38
  */
39
39
 
40
+ const defaultProps = {
41
+ rules: {}
42
+ };
40
43
  const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
41
44
  let {
42
45
  chip,
43
46
  chipIndex,
44
47
  chipOptions,
45
- className,
48
+ className = '',
46
49
  editConfig,
47
50
  handleRemoveChip,
48
51
  isEditable,
@@ -50,7 +53,7 @@ const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
50
53
  meta,
51
54
  onChange,
52
55
  setEditConfig,
53
- validationRules: rules,
56
+ validationRules: rules = defaultProps.rules,
54
57
  valueName
55
58
  } = _ref;
56
59
  const [chipData, setChipData] = (0, _react.useState)({
@@ -282,10 +285,6 @@ const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
282
285
  })]
283
286
  });
284
287
  });
285
- NewChipForm.defaultProps = {
286
- className: '',
287
- validationRules: {}
288
- };
289
288
  NewChipForm.propTypes = {
290
289
  chip: _propTypes.default.object.isRequired,
291
290
  chipIndex: _propTypes.default.number.isRequired,
@@ -44,27 +44,31 @@ such restriction.
44
44
 
45
45
  const FormCombobox = _ref => {
46
46
  let {
47
- comboboxClassName,
48
- density,
49
- disabled,
50
- hideSearchInput,
51
- inputDefaultValue,
52
- inputPlaceholder,
47
+ comboboxClassName = '',
48
+ density = 'normal',
49
+ disabled = false,
50
+ hideSearchInput = false,
51
+ inputDefaultValue = '',
52
+ inputPlaceholder = '',
53
53
  invalidText,
54
- label,
55
- maxSuggestedMatches,
54
+ label = '',
55
+ maxSuggestedMatches = 1,
56
56
  name,
57
- onBlur,
58
- onChange,
59
- onFocus,
60
- required,
61
- rules,
62
- selectDefaultValue,
57
+ onBlur = null,
58
+ onChange = null,
59
+ onFocus = null,
60
+ required = false,
61
+ rules = [],
62
+ selectDefaultValue = {
63
+ label: '',
64
+ id: '',
65
+ className: ''
66
+ },
63
67
  selectOptions,
64
- selectPlaceholder,
65
- suggestionList,
66
- validator,
67
- withoutBorder
68
+ selectPlaceholder = '',
69
+ suggestionList = [],
70
+ validator = null,
71
+ withoutBorder = false
68
72
  } = _ref;
69
73
  const {
70
74
  input,
@@ -403,30 +407,6 @@ const FormCombobox = _ref => {
403
407
  }
404
408
  });
405
409
  };
406
- FormCombobox.defaultProps = {
407
- comboboxClassName: '',
408
- density: 'normal',
409
- disabled: false,
410
- hideSearchInput: false,
411
- inputDefaultValue: '',
412
- inputPlaceholder: '',
413
- label: '',
414
- maxSuggestedMatches: 1,
415
- onBlur: null,
416
- onFocus: null,
417
- onChange: null,
418
- required: false,
419
- rules: [],
420
- selectDefaultValue: {
421
- label: '',
422
- id: '',
423
- className: ''
424
- },
425
- selectPlaceholder: '',
426
- suggestionList: [],
427
- validator: null,
428
- withoutBorder: false
429
- };
430
410
  FormCombobox.propTypes = {
431
411
  comboboxClassName: _propTypes.default.string,
432
412
  density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
@@ -42,33 +42,47 @@ under the Apache 2.0 license is conditioned upon your compliance with
42
42
  such restriction.
43
43
  */
44
44
 
45
+ const defaultProps = {
46
+ iconClick: () => {},
47
+ link: {
48
+ show: '',
49
+ value: ''
50
+ },
51
+ onBlur: () => {},
52
+ onChange: () => {},
53
+ onKeyDown: () => {},
54
+ validator: () => {},
55
+ rules: []
56
+ };
45
57
  const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
46
58
  var _ref2;
47
59
  let {
48
- async,
49
- className,
50
- customRequiredLabel,
51
- density,
52
- disabled,
53
- focused,
54
- iconClass,
55
- iconClick,
56
- inputIcon,
57
- invalidText,
58
- label,
59
- link,
60
+ async = false,
61
+ className = '',
62
+ customRequiredLabel = '',
63
+ density = 'normal',
64
+ disabled = false,
65
+ focused = false,
66
+ iconClass = '',
67
+ iconClick = defaultProps.iconClick,
68
+ inputIcon = null,
69
+ invalidText = 'This field is invalid',
70
+ label = '',
71
+ link = defaultProps.link,
60
72
  name,
61
- onBlur,
62
- onChange,
73
+ onBlur = defaultProps.onBlur,
74
+ onChange = defaultProps.onChange,
63
75
  onFocus,
64
- onKeyDown,
65
- pattern,
66
- required,
67
- suggestionList,
68
- tip,
69
- validationRules: rules,
70
- validator,
71
- withoutBorder,
76
+ onKeyDown = defaultProps.onKeyDown,
77
+ pattern = null,
78
+ required = false,
79
+ suggestionList = [],
80
+ step = '1',
81
+ tip = '',
82
+ type = 'text',
83
+ validationRules: rules = defaultProps.rules,
84
+ validator = defaultProps.validator,
85
+ withoutBorder = false,
72
86
  ...inputProps
73
87
  } = _ref;
74
88
  const {
@@ -199,7 +213,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
199
213
  }
200
214
  }
201
215
  if ((0, _lodash.isEmpty)(validationError)) {
202
- if (inputProps.type === 'number') {
216
+ if (type === 'number') {
203
217
  if (inputProps.max && +valueToValidate > +inputProps.max) {
204
218
  validationError = {
205
219
  name: 'maxValue',
@@ -249,7 +263,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
249
263
  return validationError;
250
264
  }, 400);
251
265
  const parseField = val => {
252
- return inputProps.type === 'number' && val ? parseFloat(val) || val : val;
266
+ return type === 'number' && val ? parseFloat(val) || val : val;
253
267
  };
254
268
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
255
269
  validate: async ? validateFieldAsync : validateField,
@@ -299,6 +313,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
299
313
  required: isInvalid || required,
300
314
  disabled,
301
315
  pattern,
316
+ type,
302
317
  ...inputProps,
303
318
  ...input,
304
319
  autoComplete: (_inputProps$autocompl = inputProps.autocomplete) !== null && _inputProps$autocompl !== void 0 ? _inputProps$autocompl : 'off',
@@ -328,9 +343,9 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
328
343
  onClick: iconClick,
329
344
  children: inputIcon
330
345
  })]
331
- }), inputProps.type === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberButtons.default, {
346
+ }), type === 'number' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberButtons.default, {
332
347
  ...inputProps,
333
- step: +inputProps.step,
348
+ step: +step,
334
349
  ...input,
335
350
  disabled
336
351
  })]
@@ -357,39 +372,6 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
357
372
  }
358
373
  });
359
374
  });
360
- FormInput.defaultProps = {
361
- async: false,
362
- className: '',
363
- customRequiredLabel: '',
364
- density: 'normal',
365
- disabled: false,
366
- focused: false,
367
- iconClass: '',
368
- iconClick: () => {},
369
- inputIcon: null,
370
- invalidText: 'This field is invalid',
371
- label: '',
372
- link: {
373
- show: '',
374
- value: ''
375
- },
376
- min: null,
377
- max: null,
378
- onBlur: () => {},
379
- onChange: () => {},
380
- onKeyDown: () => {},
381
- pattern: null,
382
- placeholder: '',
383
- required: false,
384
- step: '1',
385
- suggestionList: [],
386
- tip: '',
387
- type: 'text',
388
- validationRules: [],
389
- validator: () => {},
390
- value: '',
391
- withoutBorder: false
392
- };
393
375
  FormInput.propTypes = {
394
376
  async: _propTypes.default.bool,
395
377
  className: _propTypes.default.string,
@@ -31,11 +31,11 @@ such restriction.
31
31
 
32
32
  const InputNumberButtons = _ref => {
33
33
  let {
34
- disabled,
35
- min,
36
- max,
34
+ disabled = false,
35
+ min = null,
36
+ max = null,
37
37
  onChange,
38
- step,
38
+ step = 1,
39
39
  value
40
40
  } = _ref;
41
41
  const handleIncrease = event => {
@@ -80,12 +80,6 @@ const InputNumberButtons = _ref => {
80
80
  })
81
81
  });
82
82
  };
83
- InputNumberButtons.defaultProps = {
84
- disabled: false,
85
- min: null,
86
- max: null,
87
- step: 1
88
- };
89
83
  InputNumberButtons.propTypes = {
90
84
  disabled: _propTypes.default.bool,
91
85
  min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
@@ -33,26 +33,26 @@ such restriction.
33
33
 
34
34
  const FormKeyValueTable = _ref => {
35
35
  let {
36
- actionButtonId,
37
- addNewItemLabel,
38
- className,
39
- defaultKey,
40
- disabled,
41
- exitEditModeTriggerItem,
36
+ actionButtonId = '',
37
+ addNewItemLabel = 'Add new item',
38
+ className = '',
39
+ defaultKey = '',
40
+ disabled = false,
41
+ exitEditModeTriggerItem = null,
42
42
  fieldsPath,
43
43
  formState,
44
- isKeyEditable,
45
- isKeyRequired,
46
- isValueRequired,
47
- keyHeader,
48
- keyLabel,
49
- keyOptions,
50
- keyValidationRules,
51
- onExitEditModeCallback,
52
- valueHeader,
53
- valueLabel,
54
- valueType,
55
- valueValidationRules
44
+ isKeyEditable = true,
45
+ isKeyRequired = true,
46
+ isValueRequired = true,
47
+ keyHeader = 'Key',
48
+ keyLabel = 'Key',
49
+ keyOptions = null,
50
+ keyValidationRules = [],
51
+ onExitEditModeCallback = () => {},
52
+ valueHeader = 'Value',
53
+ valueLabel = 'Value',
54
+ valueType = 'text',
55
+ valueValidationRules = []
56
56
  } = _ref;
57
57
  const tableClassNames = (0, _classnames.default)('form-table form-key-value-table', disabled && 'form-table_disabled', className);
58
58
  const {
@@ -194,26 +194,6 @@ const FormKeyValueTable = _ref => {
194
194
  })]
195
195
  });
196
196
  };
197
- FormKeyValueTable.defaultProps = {
198
- actionButtonId: '',
199
- addNewItemLabel: 'Add new item',
200
- className: '',
201
- defaultKey: '',
202
- disabled: false,
203
- exitEditModeTriggerItem: null,
204
- isKeyEditable: true,
205
- isKeyRequired: true,
206
- isValueRequired: true,
207
- keyHeader: 'Key',
208
- keyLabel: 'Key',
209
- keyOptions: null,
210
- keyValidationRules: [],
211
- onExitEditModeCallback: () => {},
212
- valueHeader: 'Value',
213
- valueLabel: 'Value',
214
- valueType: 'text',
215
- valueValidationRules: []
216
- };
217
197
  FormKeyValueTable.propTypes = {
218
198
  actionButtonId: _propTypes.default.string,
219
199
  addNewItemLabel: _propTypes.default.string,
@@ -32,10 +32,10 @@ such restriction.
32
32
 
33
33
  const FormRadio = _ref => {
34
34
  let {
35
- className,
35
+ className = '',
36
36
  name,
37
37
  label,
38
- readOnly,
38
+ readOnly = false,
39
39
  tooltip,
40
40
  ...inputProps
41
41
  } = _ref;
@@ -76,10 +76,6 @@ const FormRadio = _ref => {
76
76
  }
77
77
  });
78
78
  };
79
- FormRadio.defaultProps = {
80
- className: '',
81
- readOnly: false
82
- };
83
79
  FormRadio.propTypes = {
84
80
  className: _propTypes.default.string,
85
81
  label: _propTypes.default.string.isRequired,
@@ -17,7 +17,6 @@ var _types = require("../../types");
17
17
  var _constants = require("../../constants");
18
18
  var _dropdown = require("../../images/dropdown.svg");
19
19
  require("./formSelect.scss");
20
- var _lodash = require("lodash");
21
20
  var _jsxRuntime = require("react/jsx-runtime");
22
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
22
  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); }
@@ -42,22 +41,22 @@ such restriction.
42
41
  const FormSelect = _ref => {
43
42
  var _selectRef$current;
44
43
  let {
45
- className,
46
- density,
47
- disabled,
48
- hideSelectedOption,
49
- label,
50
- multiple,
44
+ className = '',
45
+ density = 'normal',
46
+ disabled = false,
47
+ hideSelectedOption = false,
48
+ label = '',
49
+ multiple = false,
51
50
  name,
52
51
  onChange,
53
52
  options,
54
53
  required,
55
- search,
54
+ search = false,
56
55
  selectedItemAction,
57
- scrollToView,
58
- tooltip,
59
- withoutBorder,
60
- withSelectedIcon
56
+ scrollToView = true,
57
+ tooltip = '',
58
+ withoutBorder = false,
59
+ withSelectedIcon = true
61
60
  } = _ref;
62
61
  const {
63
62
  input,
@@ -335,20 +334,6 @@ const FormSelect = _ref => {
335
334
  }
336
335
  });
337
336
  };
338
- FormSelect.defaultProps = {
339
- className: '',
340
- density: 'normal',
341
- disabled: false,
342
- hideSelectedOption: false,
343
- label: '',
344
- onClick: null,
345
- search: false,
346
- tooltip: '',
347
- multiple: false,
348
- scrollToView: true,
349
- withoutBorder: false,
350
- withSelectedIcon: true
351
- };
352
337
  FormSelect.propTypes = {
353
338
  className: _propTypes.default.string,
354
339
  density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
@@ -356,7 +341,6 @@ FormSelect.propTypes = {
356
341
  hideSelectedOption: _propTypes.default.bool,
357
342
  label: _propTypes.default.string,
358
343
  name: _propTypes.default.string.isRequired,
359
- onClick: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
360
344
  options: _types.SELECT_OPTIONS.isRequired,
361
345
  search: _propTypes.default.bool,
362
346
  tooltip: _propTypes.default.string,
@@ -36,19 +36,20 @@ such restriction.
36
36
 
37
37
  const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
38
38
  let {
39
- className,
40
- disabled,
41
- focused,
42
- iconClass,
43
- invalidText,
44
- label,
45
- maxLength,
39
+ className = '',
40
+ disabled = false,
41
+ focused = false,
42
+ iconClass = '',
43
+ invalidText = 'This field is invalid',
44
+ label = '',
45
+ maxLength = null,
46
46
  name,
47
- onBlur,
48
- onChange,
49
- required,
47
+ onBlur = () => {},
48
+ onChange = () => {},
49
+ required = false,
50
+ rows = 3,
50
51
  textAreaIcon,
51
- tip,
52
+ tip = '',
52
53
  withoutBorder,
53
54
  ...textareaProps
54
55
  } = _ref;
@@ -133,6 +134,7 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
133
134
  ref: textAreaRef,
134
135
  required: isInvalid || required,
135
136
  disabled,
137
+ rows,
136
138
  ...textareaProps,
137
139
  ...input,
138
140
  onBlur: handleInputBlur,
@@ -165,22 +167,6 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
165
167
  }
166
168
  });
167
169
  });
168
- FormTextarea.defaultProps = {
169
- className: '',
170
- disabled: false,
171
- focused: false,
172
- iconClass: '',
173
- textAreaIcon: null,
174
- invalidText: 'This field is invalid',
175
- label: '',
176
- maxLength: null,
177
- onBlur: () => {},
178
- onChange: () => {},
179
- placeholder: '',
180
- required: false,
181
- rows: 3,
182
- tip: ''
183
- };
184
170
  FormTextarea.propTypes = {
185
171
  className: _propTypes.default.string,
186
172
  disabled: _propTypes.default.bool,
@@ -193,7 +179,6 @@ FormTextarea.propTypes = {
193
179
  name: _propTypes.default.string.isRequired,
194
180
  onBlur: _propTypes.default.func,
195
181
  onChange: _propTypes.default.func,
196
- placeholder: _propTypes.default.string,
197
182
  required: _propTypes.default.bool,
198
183
  tip: _propTypes.default.string
199
184
  };
@@ -30,11 +30,11 @@ such restriction.
30
30
 
31
31
  const FormToggle = _ref => {
32
32
  let {
33
- className,
33
+ className = '',
34
34
  density,
35
- label,
35
+ label = '',
36
36
  name,
37
- onChange,
37
+ onChange = () => {},
38
38
  ...inputProps
39
39
  } = _ref;
40
40
  const toggleWrapperClassNames = (0, _classnames.default)('form-field__wrapper', density && "form-field__wrapper-".concat(density));
@@ -72,11 +72,6 @@ const FormToggle = _ref => {
72
72
  }
73
73
  });
74
74
  };
75
- FormToggle.defaultProps = {
76
- className: '',
77
- label: '',
78
- onChange: () => {}
79
- };
80
75
  FormToggle.propTypes = {
81
76
  className: _propTypes.default.string,
82
77
  density: _propTypes.default.string,
@@ -35,15 +35,15 @@ such restriction.
35
35
 
36
36
  const Modal = _ref => {
37
37
  let {
38
- actions,
38
+ actions = [],
39
39
  children,
40
40
  className,
41
41
  onClose,
42
- previewText,
43
- size,
44
- show,
45
- subTitle,
46
- title
42
+ previewText = '',
43
+ size = _constants.MODAL_MD,
44
+ show = false,
45
+ subTitle = null,
46
+ title = ''
47
47
  } = _ref;
48
48
  const modalClassNames = (0, _classnames.default)('modal', className, size && "modal-".concat(size));
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -97,14 +97,6 @@ const Modal = _ref => {
97
97
  })]
98
98
  });
99
99
  };
100
- Modal.defaultProps = {
101
- actions: [],
102
- previewText: '',
103
- show: false,
104
- size: _constants.MODAL_MD,
105
- subTitle: null,
106
- title: ''
107
- };
108
100
  Modal.propTypes = {
109
101
  actions: _propTypes.default.array,
110
102
  children: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.object, _propTypes.default.node, _propTypes.default.string]).isRequired,
@@ -40,14 +40,14 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
40
40
  var _ref2;
41
41
  let {
42
42
  children,
43
- className,
44
- closePopUp,
45
- customPosition,
46
- headerIsHidden,
47
- headerText,
48
- showPopUpDialog,
49
- style,
50
- tooltipText
43
+ className = '',
44
+ closePopUp = () => {},
45
+ customPosition = {},
46
+ headerIsHidden = false,
47
+ headerText = '',
48
+ showPopUpDialog = true,
49
+ style = {},
50
+ tooltipText = ''
51
51
  } = _ref;
52
52
  const [showPopUp, setShowPopUp] = (0, _react.useState)(showPopUpDialog !== null && showPopUpDialog !== void 0 ? showPopUpDialog : true);
53
53
  const popUpOverlayRef = (0, _react.useRef)(null);
@@ -154,16 +154,6 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
154
154
  })
155
155
  }), document.getElementById('overlay_container')) : null;
156
156
  });
157
- PopUpDialog.defaultProps = {
158
- className: '',
159
- closePopUp: () => {},
160
- customPosition: {},
161
- headerIsHidden: false,
162
- headerText: '',
163
- showPopUpDialog: true,
164
- style: {},
165
- tooltipText: ''
166
- };
167
157
  PopUpDialog.propTypes = {
168
158
  className: _propTypes.default.string,
169
159
  closePopUp: _propTypes.default.func,
@@ -32,12 +32,12 @@ such restriction.
32
32
  const RoundedIcon = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
33
33
  let {
34
34
  children,
35
- className,
36
- disabled,
37
- id,
38
- isActive,
39
- onClick,
40
- tooltipText
35
+ className = '',
36
+ disabled = false,
37
+ id = '',
38
+ isActive = false,
39
+ onClick = () => {},
40
+ tooltipText = ''
41
41
  } = _ref;
42
42
  const wrapperClassNames = (0, _classnames.default)('round-icon-cp', className);
43
43
  const IconClassNames = (0, _classnames.default)('round-icon-cp__circle', isActive && 'round-icon-cp__circle-active', disabled && 'round-icon-cp__circle-disabled');
@@ -60,14 +60,6 @@ const RoundedIcon = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
60
60
  })
61
61
  });
62
62
  });
63
- RoundedIcon.defaultProps = {
64
- className: '',
65
- disabled: false,
66
- id: '',
67
- isActive: false,
68
- onClick: () => {},
69
- tooltipText: ''
70
- };
71
63
  RoundedIcon.propTypes = {
72
64
  children: _propTypes.default.node.isRequired,
73
65
  className: _propTypes.default.string,
@@ -39,7 +39,7 @@ const iconLength = parseInt(_tip.default.iconlength);
39
39
  const minTextLength = 40;
40
40
  const Tip = _ref => {
41
41
  let {
42
- className,
42
+ className = '',
43
43
  text,
44
44
  withExclamationMark
45
45
  } = _ref;
@@ -108,9 +108,6 @@ const Tip = _ref => {
108
108
  }), document.getElementById('overlay_container'))]
109
109
  });
110
110
  };
111
- Tip.defaultProps = {
112
- className: ''
113
- };
114
111
  Tip.propTypes = {
115
112
  className: _propTypes.default.string,
116
113
  text: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]).isRequired
@@ -37,11 +37,11 @@ const Tooltip = _ref => {
37
37
  let {
38
38
  children,
39
39
  className,
40
- hidden,
41
- id,
42
- renderChildAsHtml,
40
+ hidden = false,
41
+ id = '',
42
+ renderChildAsHtml = false,
43
43
  template,
44
- textShow
44
+ textShow = false
45
45
  } = _ref;
46
46
  const [show, setShow] = (0, _react.useState)(false);
47
47
  const [style, setStyle] = (0, _react.useState)({});
@@ -167,12 +167,6 @@ const Tooltip = _ref => {
167
167
  }), document.getElementById('overlay_container'))]
168
168
  });
169
169
  };
170
- Tooltip.defaultProps = {
171
- hidden: false,
172
- id: '',
173
- renderChildAsHtml: false,
174
- textShow: false
175
- };
176
170
  Tooltip.propTypes = {
177
171
  className: _propTypes.default.string,
178
172
  hidden: _propTypes.default.bool,
@@ -28,8 +28,8 @@ such restriction.
28
28
 
29
29
  const ProducerTooltipTemplate = _ref => {
30
30
  let {
31
- kind,
32
- owner
31
+ kind = '',
32
+ owner = ''
33
33
  } = _ref;
34
34
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
35
35
  className: "tooltip-container",
@@ -46,10 +46,6 @@ const ProducerTooltipTemplate = _ref => {
46
46
  })]
47
47
  });
48
48
  };
49
- ProducerTooltipTemplate.defaultProps = {
50
- kind: '',
51
- owner: ''
52
- };
53
49
  ProducerTooltipTemplate.propTypes = {
54
50
  kind: _propTypes.default.string.isRequired,
55
51
  owner: _propTypes.default.string.isRequired
@@ -38,15 +38,15 @@ such restriction.
38
38
  const Wizard = _ref => {
39
39
  let {
40
40
  children,
41
- className,
42
- getActions,
41
+ className = '',
42
+ getActions = null,
43
43
  isWizardOpen,
44
44
  location,
45
45
  onWizardResolve,
46
- previewText,
47
- size,
48
- stepsConfig,
49
- subTitle,
46
+ previewText = '',
47
+ size = _constants.MODAL_MD,
48
+ stepsConfig = [],
49
+ subTitle = null,
50
50
  title
51
51
  } = _ref;
52
52
  const wizardClasses = (0, _classnames.default)('wizard-form', className);
@@ -164,19 +164,9 @@ const Wizard = _ref => {
164
164
  })]
165
165
  });
166
166
  };
167
- Wizard.defaultProps = {
168
- className: '',
169
- getActions: null,
170
- confirmClose: false,
171
- previewText: '',
172
- size: _constants.MODAL_MD,
173
- stepsConfig: [],
174
- subTitle: null
175
- };
176
167
  Wizard.propsTypes = {
177
168
  className: _propTypes.default.string,
178
169
  getActions: _propTypes.default.func,
179
- confirmClose: _propTypes.default.bool,
180
170
  isWizardOpen: _propTypes.default.bool.isRequired,
181
171
  location: _propTypes.default.string.isRequired,
182
172
  onWizardResolve: _propTypes.default.func.isRequired,
@@ -33,7 +33,7 @@ such restriction.
33
33
  const WizardSteps = _ref => {
34
34
  let {
35
35
  activeStepNumber,
36
- firstDisabledStepIdx,
36
+ firstDisabledStepIdx = null,
37
37
  jumpToStep,
38
38
  steps
39
39
  } = _ref;
@@ -65,9 +65,6 @@ const WizardSteps = _ref => {
65
65
  })
66
66
  });
67
67
  };
68
- WizardSteps.defaultProps = {
69
- firstDisabledStepIdx: null
70
- };
71
68
  WizardSteps.propTypes = {
72
69
  activeStepNumber: _propTypes.default.number.isRequired,
73
70
  firstDisabledStepIdx: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf([null])]),
@@ -31,12 +31,12 @@ such restriction.
31
31
 
32
32
  const FormActionButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
33
33
  let {
34
- disabled,
34
+ disabled = false,
35
35
  fields,
36
36
  fieldsPath,
37
37
  hidden,
38
- id,
39
- label,
38
+ id = '',
39
+ label = 'Add new item',
40
40
  onClick
41
41
  } = _ref;
42
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -53,11 +53,6 @@ const FormActionButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
53
53
  })]
54
54
  });
55
55
  });
56
- FormActionButton.defaultProps = {
57
- disabled: false,
58
- id: '',
59
- label: 'Add new item'
60
- };
61
56
  FormActionButton.propTypes = {
62
57
  disabled: _propTypes.default.bool,
63
58
  fields: _propTypes.default.shape({}).isRequired,
@@ -38,13 +38,13 @@ const FormRowActions = _ref => {
38
38
  var _editingItem$ui, _editingItem$ui2, _editingItem$ui3, _editingItem$ui4;
39
39
  let {
40
40
  applyChanges,
41
- deleteButtonIsHidden,
41
+ deleteButtonIsHidden = false,
42
42
  deleteRow,
43
- disabled,
43
+ disabled = false,
44
44
  discardOrDelete,
45
- editingItem,
45
+ editingItem = null,
46
46
  fieldsPath,
47
- hidden,
47
+ hidden = false,
48
48
  index
49
49
  } = _ref;
50
50
  return hidden ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -86,12 +86,6 @@ const FormRowActions = _ref => {
86
86
  })]
87
87
  });
88
88
  };
89
- FormRowActions.defaultProps = {
90
- deleteButtonIsHidden: false,
91
- disabled: false,
92
- editingItem: null,
93
- hidden: false
94
- };
95
89
  FormRowActions.propTypes = {
96
90
  applyChanges: _propTypes.default.func.isRequired,
97
91
  deleteButtonIsHidden: _propTypes.default.bool,
@@ -30,9 +30,9 @@ such restriction.
30
30
 
31
31
  const OptionsMenu = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
32
32
  let {
33
- children,
34
- show,
35
- timeout
33
+ children = [],
34
+ show = false,
35
+ timeout = 300
36
36
  } = _ref;
37
37
  const {
38
38
  width: dropdownWidth
@@ -52,7 +52,7 @@ const OptionsMenu = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
52
52
  autoHorizontalPosition: true
53
53
  },
54
54
  style: {
55
- 'minWidth': "".concat(dropdownWidth, "px")
55
+ minWidth: "".concat(dropdownWidth, "px")
56
56
  },
57
57
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
58
58
  className: "options-menu__body",
@@ -61,11 +61,6 @@ const OptionsMenu = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
61
61
  })
62
62
  });
63
63
  });
64
- OptionsMenu.defaultProps = {
65
- children: [],
66
- show: false,
67
- timeout: 300
68
- };
69
64
  OptionsMenu.propTypes = {
70
65
  children: _propTypes.default.arrayOf(_propTypes.default.element),
71
66
  show: _propTypes.default.bool.isRequired,
@@ -35,10 +35,10 @@ const SelectOption = _ref => {
35
35
  let {
36
36
  item,
37
37
  name,
38
- onClick,
39
- multiple,
38
+ onClick = () => {},
39
+ multiple = false,
40
40
  selectedId,
41
- withSelectedIcon
41
+ withSelectedIcon = true
42
42
  } = _ref;
43
43
  const selectClassName = (0, _classnames.default)('select__item', multiple && 'multiple', item.hidden && 'hidden', item.disabled && 'disabled');
44
44
  if (multiple) {
@@ -97,11 +97,6 @@ const SelectOption = _ref => {
97
97
  })
98
98
  });
99
99
  };
100
- SelectOption.defaultProps = {
101
- onClick: () => {},
102
- multiple: false,
103
- withSelectedIcon: true
104
- };
105
100
  SelectOption.propTypes = {
106
101
  name: _propTypes.default.string.isRequired,
107
102
  item: _types.SELECT_OPTION.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",