iguazio.dashboard-react-controls 0.0.21 → 0.0.23

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.
@@ -113,8 +113,8 @@ var FormChipCell = function FormChipCell(_ref) {
113
113
  return isEditMode || visibleChipsMaxLength === 'all' ? {
114
114
  visibleChips: (0, _lodash.get)(formState.values, name),
115
115
  hiddenChips: []
116
- } : (0, _generateChipsList.generateChipsList)((0, _lodash.get)(formState.values, name), visibleChipsMaxLength ? visibleChipsMaxLength : visibleChipsCount, delimiter);
117
- }, [visibleChipsMaxLength, isEditMode, visibleChipsCount, delimiter, formState.values, name]);
116
+ } : (0, _generateChipsList.generateChipsList)((0, _lodash.get)(formState.values, name), visibleChipsMaxLength ? visibleChipsMaxLength : visibleChipsCount);
117
+ }, [visibleChipsMaxLength, isEditMode, visibleChipsCount, formState.values, name]);
118
118
  var handleResize = (0, _react.useCallback)(function () {
119
119
  if (!isEditMode && !(0, _common.isEveryObjectValueEmpty)(chipsSizes)) {
120
120
  var _chipsCellRef$current;
@@ -154,6 +154,7 @@ var FormCombobox = function FormCombobox(_ref) {
154
154
  return setShowValidationRules(false);
155
155
  });
156
156
  var labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
157
+ var inputClassNames = (0, _classnames.default)('form-field-combobox__input', selectValue.id.length === 0 && 'form-field-combobox__input_hidden');
157
158
  (0, _react.useEffect)(function () {
158
159
  setValidationRules(function (prevState) {
159
160
  return prevState.map(function (rule) {
@@ -176,7 +177,7 @@ var FormCombobox = function FormCombobox(_ref) {
176
177
  setIsInvalid(meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched));
177
178
  }, [meta.invalid, meta.modified, meta.submitFailed, meta.touched, meta.validating]);
178
179
  var handleOutsideClick = (0, _react.useCallback)(function (event) {
179
- if (comboboxRef.current && !comboboxRef.current.contains(event.target) && suggestionListRef.current && !suggestionListRef.current.contains(event.target)) {
180
+ if (comboboxRef.current && !comboboxRef.current.contains(event.target)) {
180
181
  setSearchIsFocused(false);
181
182
  setShowSelectDropdown(false);
182
183
  setShowSuggestionList(false);
@@ -184,12 +185,33 @@ var FormCombobox = function FormCombobox(_ref) {
184
185
  onBlur && onBlur(input.value);
185
186
  }
186
187
  }, [input, onBlur]);
188
+
189
+ var handleScroll = function handleScroll(event) {
190
+ if (comboboxRef.current.contains(event.target)) return;
191
+
192
+ if (!event.target.closest('.pop-up-dialog') && !event.target.classList.contains('form-field-combobox')) {
193
+ setShowValidationRules(false);
194
+ setShowSelectDropdown(false);
195
+ setShowSuggestionList(false);
196
+ inputRef.current.blur();
197
+ }
198
+ };
199
+
187
200
  (0, _react.useEffect)(function () {
188
201
  window.addEventListener('click', handleOutsideClick);
189
202
  return function () {
190
203
  window.removeEventListener('click', handleOutsideClick);
191
204
  };
192
205
  }, [handleOutsideClick]);
206
+ (0, _react.useEffect)(function () {
207
+ if (showValidationRules || showSelectDropdown || showSuggestionList) {
208
+ window.addEventListener('scroll', handleScroll, true);
209
+ }
210
+
211
+ return function () {
212
+ window.removeEventListener('scroll', handleScroll, true);
213
+ };
214
+ }, [showSelectDropdown, showSuggestionList, showValidationRules]);
193
215
 
194
216
  var getValidationRules = function getValidationRules() {
195
217
  return validationRules.map(function (_ref2) {
@@ -421,8 +443,8 @@ var FormCombobox = function FormCombobox(_ref) {
421
443
  })
422
444
  })]
423
445
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
424
- className: "form-field-combobox__input form-field__control",
425
- disabled: selectValue.id.length === 0,
446
+ className: inputClassNames,
447
+ id: input.name,
426
448
  onChange: handleInputChange,
427
449
  onFocus: inputOnFocus,
428
450
  placeholder: inputPlaceholder,
@@ -13,11 +13,11 @@
13
13
  .form-field-combobox__icon {
14
14
  cursor: pointer;
15
15
  padding: 0;
16
+ transition: transform 200ms linear;
16
17
 
17
18
  &_open {
18
19
  transform: rotate(90deg);
19
20
  transform-origin: center center;
20
- transition: transform 200ms linear;
21
21
  }
22
22
  }
23
23
  }
@@ -29,21 +29,32 @@
29
29
  text-align: left;
30
30
  text-transform: capitalize;
31
31
  background-color: transparent;
32
+
33
+ label {
34
+ cursor: inherit;
35
+ }
32
36
  }
37
+
33
38
  &__select {
34
- flex: unset;
35
39
  padding: 0;
36
- max-width: 110px;
37
40
  overflow: visible;
38
41
 
39
42
  &-header {
40
43
  display: flex;
44
+ flex: 1;
41
45
  align-items: center;
46
+ cursor: pointer;
47
+ height: 100%;
42
48
  }
43
49
  }
44
50
 
45
51
  &__input {
46
- padding: 0;
52
+ width: 100%;
53
+ padding: 0 8px 0 0;
54
+
55
+ &_hidden {
56
+ flex: 0;
57
+ }
47
58
  }
48
59
  }
49
60
  }
@@ -59,7 +70,6 @@
59
70
  align-items: center;
60
71
  margin: 0 9px;
61
72
  border-bottom: $dividerBorder;
62
-
63
73
  }
64
74
  }
65
75
 
@@ -91,7 +101,7 @@
91
101
 
92
102
  .pop-up-dialog {
93
103
  width: 100%;
94
- max-height: 400px;
104
+ max-height: 250px;
95
105
  padding: 0;
96
106
  border-radius: 0;
97
107
 
@@ -101,7 +111,7 @@
101
111
  }
102
112
  }
103
113
 
104
- & .path-type,
114
+ .path-type,
105
115
  &__dropdown .path-type {
106
116
  &-store {
107
117
  color: $amethyst;
@@ -7,7 +7,9 @@
7
7
  width: 100%;
8
8
 
9
9
  input {
10
+ height: inherit;
10
11
  width: 100%;
12
+ padding: 12px 16px;
11
13
  }
12
14
 
13
15
  .form-field {
@@ -42,6 +42,7 @@
42
42
  display: flex;
43
43
  align-items: center;
44
44
  width: 100%;
45
+ padding: 0 8px 0 16px;
45
46
 
46
47
  &-value {
47
48
  display: block;
@@ -7,7 +7,9 @@
7
7
  width: 100%;
8
8
 
9
9
  textarea {
10
+ height: inherit;
10
11
  width: 100%;
12
+ padding: 12px 16px;
11
13
  white-space: normal;
12
14
  }
13
15
 
@@ -17,11 +19,6 @@
17
19
  &__wrapper {
18
20
  .form-field__control {
19
21
  padding: 0;
20
-
21
- & > *:first-child {
22
- height: inherit;
23
- padding: 12px 0 12px 16px;
24
- }
25
22
  }
26
23
  }
27
24
 
@@ -49,10 +49,10 @@ var Modal = function Modal(_ref) {
49
49
  var actions = _ref.actions,
50
50
  children = _ref.children,
51
51
  className = _ref.className,
52
- location = _ref.location,
53
52
  onClose = _ref.onClose,
54
53
  size = _ref.size,
55
54
  show = _ref.show,
55
+ subTitle = _ref.subTitle,
56
56
  title = _ref.title;
57
57
  var modalClassNames = (0, _classnames.default)('modal', className, size && "modal-".concat(size));
58
58
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -77,12 +77,15 @@ var Modal = function Modal(_ref) {
77
77
  })
78
78
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
79
79
  className: "modal__content",
80
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
80
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
81
81
  className: "modal__header",
82
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h5", {
82
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h5", {
83
83
  className: "modal__header-title",
84
84
  children: title
85
- })
85
+ }), subTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("h6", {
86
+ className: "modal__header-sub-title",
87
+ children: subTitle
88
+ })]
86
89
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
90
  className: "modal__body",
88
91
  children: children
@@ -107,15 +110,16 @@ Modal.defaultProps = {
107
110
  actions: [],
108
111
  show: false,
109
112
  size: _constants.MODAL_MD,
113
+ subTitle: null,
110
114
  title: ''
111
115
  };
112
116
  Modal.propTypes = {
113
117
  actions: _propTypes.default.array,
114
118
  children: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.object, _propTypes.default.node, _propTypes.default.string]).isRequired,
115
- location: _propTypes.default.object.isRequired,
116
119
  onClose: _propTypes.default.func.isRequired,
117
120
  show: _propTypes.default.bool.isRequired,
118
121
  size: _types.MODAL_SIZES,
122
+ subTitle: _propTypes.default.string,
119
123
  title: _propTypes.default.string
120
124
  };
121
125
  var _default = Modal;
@@ -9,6 +9,7 @@
9
9
  width: 100%;
10
10
  height: 660px;
11
11
  max-width: 96%;
12
+ min-width: 300px;
12
13
  max-height: 96%;
13
14
  outline: 0;
14
15
  transform: translate(-50%, -50%);
@@ -17,13 +18,28 @@
17
18
  @media screen and (min-width: 1200px) {
18
19
  width: 1000px;
19
20
 
20
- &-sm {
21
+ &.modal-sm {
21
22
  width: 700px;
22
23
  }
23
24
 
24
- &-lg {
25
+ &.modal-lg {
25
26
  width: 1400px;
26
27
  }
28
+
29
+ &.modal-full {
30
+ width: 95vw;
31
+ height: 95vh;
32
+ }
33
+ }
34
+
35
+ &.modal-min {
36
+ width: 500px;
37
+ height: auto;
38
+ }
39
+
40
+ &.modal-full {
41
+ width: 90vw;
42
+ height: 90vh;
27
43
  }
28
44
 
29
45
  &__content {
@@ -43,21 +59,26 @@
43
59
 
44
60
  &__header {
45
61
  position: relative;
46
- padding: 1.5rem 2rem;
47
- display: flex;
48
- flex-shrink: 0;
49
- justify-content: center;
50
- align-items: center;
51
62
  border-bottom: $primaryBorder;
63
+ text-align: center;
64
+ vertical-align: middle;
65
+ padding: 1.5rem 2rem;
52
66
 
53
67
  &-title {
54
68
  color: $primary;
55
69
  font-size: 2em;
56
- font-weight: 400;
57
70
  text-transform: capitalize;
58
71
  margin: 0;
59
72
  }
60
73
 
74
+ &-sub-title {
75
+ color: $primary;
76
+ font-size: 1.5em;
77
+ font-weight: 400;
78
+ line-height: 2em;
79
+ margin: 0;
80
+ }
81
+
61
82
  &-button {
62
83
  position: absolute;
63
84
  top: 10px;
@@ -69,7 +90,6 @@
69
90
  overflow-y: auto;
70
91
  overflow-x: hidden;
71
92
  flex: 1 0;
72
- flex-basis: 0;
73
93
  padding: 1.5rem 2rem 0;
74
94
  margin-bottom: 1rem;
75
95
  }
@@ -60,6 +60,7 @@ var Wizard = function Wizard(_ref) {
60
60
  onWizardSubmit = _ref.onWizardSubmit,
61
61
  location = _ref.location,
62
62
  size = _ref.size,
63
+ subTitle = _ref.subTitle,
63
64
  title = _ref.title,
64
65
  stepsConfig = _ref.stepsConfig,
65
66
  submitButtonLabel = _ref.submitButtonLabel;
@@ -158,6 +159,7 @@ var Wizard = function Wizard(_ref) {
158
159
  location: location,
159
160
  show: isWizardOpen,
160
161
  size: size,
162
+ subTitle: subTitle,
161
163
  title: title,
162
164
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_WizardSteps.default, {
163
165
  activeStepNumber: activeStepNumber,
@@ -175,7 +177,8 @@ Wizard.defaultProps = {
175
177
  confirmClose: false,
176
178
  size: _constants.MODAL_MD,
177
179
  stepsConfig: [],
178
- submitButtonLabel: 'Submit'
180
+ submitButtonLabel: 'Submit',
181
+ subTitle: null
179
182
  };
180
183
  Wizard.propsTypes = {
181
184
  className: _propTypes.default.string,
@@ -186,6 +189,7 @@ Wizard.propsTypes = {
186
189
  onWizardSubmit: _propTypes.default.func.isRequired,
187
190
  location: _propTypes.default.string.isRequired,
188
191
  size: _types.MODAL_SIZES,
192
+ subTitle: _propTypes.default.string,
189
193
  title: _propTypes.default.string.isRequired,
190
194
  stepsConfig: _types.WIZARD_STEPS_CONFIG,
191
195
  submitButtonLabel: _propTypes.default.string
package/dist/constants.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.validation = exports.TERTIARY_BUTTON = exports.TAB_SHIFT = exports.TAB = exports.SECONDARY_BUTTON = exports.PRIMARY_BUTTON = exports.MODAL_SM = exports.MODAL_MD = exports.MODAL_LG = exports.LABEL_BUTTON = exports.INTERNAL_SERVER_ERROR_STATUS_CODE = exports.FORBIDDEN_ERROR_STATUS_CODE = exports.DELETE = exports.DANGER_BUTTON = exports.CONFLICT_ERROR_STATUS_CODE = exports.CLICK = exports.BACKSPACE = void 0;
6
+ exports.validation = exports.TERTIARY_BUTTON = exports.TAB_SHIFT = exports.TAB = exports.SECONDARY_BUTTON = exports.PRIMARY_BUTTON = exports.MODAL_SM = exports.MODAL_MIN = exports.MODAL_MD = exports.MODAL_MAX = exports.MODAL_LG = exports.LABEL_BUTTON = exports.INTERNAL_SERVER_ERROR_STATUS_CODE = exports.FORBIDDEN_ERROR_STATUS_CODE = exports.DELETE = exports.DANGER_BUTTON = exports.CONFLICT_ERROR_STATUS_CODE = exports.CLICK = exports.BACKSPACE = void 0;
7
7
 
8
8
  /*
9
9
  Copyright 2022 Iguazio Systems Ltd.
@@ -78,4 +78,8 @@ exports.MODAL_SM = MODAL_SM;
78
78
  var MODAL_MD = 'md';
79
79
  exports.MODAL_MD = MODAL_MD;
80
80
  var MODAL_LG = 'lg';
81
- exports.MODAL_LG = MODAL_LG;
81
+ exports.MODAL_LG = MODAL_LG;
82
+ var MODAL_MIN = 'min';
83
+ exports.MODAL_MIN = MODAL_MIN;
84
+ var MODAL_MAX = 'max';
85
+ exports.MODAL_MAX = MODAL_MAX;
@@ -987,7 +987,6 @@
987
987
  display: flex;
988
988
  flex: 1;
989
989
  flex-flow: row nowrap;
990
- align-items: center;
991
990
  position: relative;
992
991
  width: 100%;
993
992
  color: $primary;
@@ -1063,7 +1062,6 @@
1063
1062
  flex: 1;
1064
1063
  align-items: center;
1065
1064
  overflow: hidden;
1066
- padding: 0 8px 0 16px;
1067
1065
  }
1068
1066
 
1069
1067
  &__icons {
package/dist/types.js CHANGED
@@ -27,7 +27,7 @@ illegal under applicable law, and the grant of the foregoing license
27
27
  under the Apache 2.0 license is conditioned upon your compliance with
28
28
  such restriction.
29
29
  */
30
- var BUTTON_VARIANTS = _propTypes.default.oneOf([_constants.PRIMARY_BUTTON, _constants.SECONDARY_BUTTON, _constants.TERTIARY_BUTTON, _constants.DANGER_BUTTON, _constants.LABEL_BUTTON]);
30
+ var BUTTON_VARIANTS = _propTypes.default.oneOf([_constants.DANGER_BUTTON, _constants.LABEL_BUTTON, _constants.PRIMARY_BUTTON, _constants.SECONDARY_BUTTON, _constants.TERTIARY_BUTTON]);
31
31
 
32
32
  exports.BUTTON_VARIANTS = BUTTON_VARIANTS;
33
33
 
@@ -51,7 +51,7 @@ var CHIP_INPUT_LIST = _propTypes.default.arrayOf(_propTypes.default.shape({
51
51
  exports.CHIP_INPUT_LIST = CHIP_INPUT_LIST;
52
52
 
53
53
  var CHIP_OPTIONS = _propTypes.default.shape({
54
- background: _propTypes.default.oneOf(['none', 'orange', 'green', 'purple', 'grey', 'sorbus', 'java', 'amethyst']),
54
+ background: _propTypes.default.oneOf(['amethyst', 'green', 'grey', 'java', 'none', 'orange', 'purple', 'sorbus']),
55
55
  boldValue: _propTypes.default.bool,
56
56
  borderColor: _propTypes.default.oneOf(['transparent', 'orange', 'green', 'purple', 'grey']),
57
57
  density: _propTypes.default.oneOf(['dense', 'normal', 'medium']),
@@ -72,7 +72,7 @@ var POP_UP_CUSTOM_POSITION = _propTypes.default.shape({
72
72
 
73
73
  exports.POP_UP_CUSTOM_POSITION = POP_UP_CUSTOM_POSITION;
74
74
 
75
- var MODAL_SIZES = _propTypes.default.oneOf([_constants.MODAL_SM, _constants.MODAL_MD, _constants.MODAL_LG]);
75
+ var MODAL_SIZES = _propTypes.default.oneOf([_constants.MODAL_SM, _constants.MODAL_MD, _constants.MODAL_LG, _constants.MODAL_MIN, _constants.MODAL_MAX]);
76
76
 
77
77
  exports.MODAL_SIZES = MODAL_SIZES;
78
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
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",