iguazio.dashboard-react-controls 1.3.4 → 1.3.6

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.
@@ -50,18 +50,18 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
50
50
  variant = _ref.variant,
51
51
  restProps = _objectWithoutProperties(_ref, _excluded);
52
52
  var buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), "btn-".concat(density), className);
53
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", _objectSpread(_objectSpread({}, restProps), {}, {
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", _objectSpread(_objectSpread({}, restProps), {}, {
54
54
  className: buttonClassName,
55
55
  ref: ref,
56
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Tooltip.default, {
56
+ children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
57
57
  template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
58
58
  text: tooltip
59
59
  }),
60
60
  hidden: !tooltip,
61
- children: [icon, label && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
61
+ children: label && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
62
62
  children: label
63
- })]
64
- })
63
+ })
64
+ })]
65
65
  }));
66
66
  });
67
67
  Button.defaultProps = {
@@ -271,7 +271,9 @@ var FormCombobox = function FormCombobox(_ref) {
271
271
  onFocus && onFocus(input.value);
272
272
  }
273
273
  }, [input, onBlur, onFocus, showSelectDropdown]);
274
- var validateField = function validateField(value, allValues) {
274
+ var validateField = function validateField() {
275
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
276
+ var allValues = arguments.length > 1 ? arguments[1] : undefined;
275
277
  var valueToValidate = value.startsWith(selectValue.id) ? value.substring(selectValue.id.length) : value !== null && value !== void 0 ? value : '';
276
278
  var validationError = null;
277
279
  if (!(0, _lodash.isEmpty)(validationRules)) {
@@ -178,7 +178,7 @@ var FormSelect = function FormSelect(_ref) {
178
178
  };
179
179
  }, [clickHandler, handleScroll, isOpen]);
180
180
  var scrollOptionToView = (0, _react.useCallback)(function () {
181
- var selectedOptionEl = optionsListRef.current.querySelector("#".concat(input.value));
181
+ var selectedOptionEl = optionsListRef.current.querySelector("#".concat(_constants.SELECT_OPTION_ID_PREFIX).concat(input.value));
182
182
  searchValue ? optionsListRef.current.scrollTo({
183
183
  top: 0,
184
184
  left: 0,
@@ -215,7 +215,7 @@ var FormSelect = function FormSelect(_ref) {
215
215
  setSearchValue('');
216
216
  }
217
217
  }, [closeMenu, multiple]);
218
- var handleSelectOptionClick = function handleSelectOptionClick(selectedOption, option, ref) {
218
+ var handleSelectOptionClick = function handleSelectOptionClick(selectedOption, option) {
219
219
  if (selectedOption !== input.value) {
220
220
  option.handler && option.handler();
221
221
  onChange && onChange(selectedOption);
@@ -14,16 +14,15 @@
14
14
  flex-flow: column nowrap;
15
15
  overflow-y: auto;
16
16
  padding: 0 1rem;
17
- }
18
17
 
19
- & > *:not(:last-child) {
20
- margin-bottom: 10px;
18
+ & > *:not(:last-child) {
19
+ margin-bottom: 10px;
20
+ }
21
21
  }
22
22
 
23
23
  .wizard-steps {
24
24
  &__item {
25
- align-items: baseline;
26
- justify-content: flex-start;
25
+ display: block;
27
26
  background-color: inherit;
28
27
  border: 0;
29
28
  border-radius: 8px;
@@ -33,17 +32,14 @@
33
32
  height: auto;
34
33
  width: 100%;
35
34
 
36
- & > * {
35
+ @media screen and (min-width: 1200px) {
37
36
  display: flex;
38
- flex-flow: column nowrap;
39
37
  align-items: center;
40
- text-align: center;
41
- white-space: normal;
42
- width: 100%;
38
+ justify-content: flex-start;
43
39
 
44
- @media screen and (min-width: 1200px) {
45
- flex-flow: row nowrap;
40
+ & > * {
46
41
  text-align: left;
42
+ white-space: normal;
47
43
  }
48
44
  }
49
45
 
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.NOTFOUND_ERROR_STATUS_CODE = 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.GATEWAY_TIMEOUT_STATUS_CODE = exports.FORBIDDEN_ERROR_STATUS_CODE = exports.DELETE = exports.DANGER_BUTTON = exports.CONFLICT_ERROR_STATUS_CODE = exports.CLICK = exports.BADREQUEST_ERROR_STATUS_CODE = exports.BACKSPACE = void 0;
6
+ exports.validation = exports.TERTIARY_BUTTON = exports.TAB_SHIFT = exports.TAB = exports.SELECT_OPTION_ID_PREFIX = exports.SECONDARY_BUTTON = exports.PRIMARY_BUTTON = exports.NOTFOUND_ERROR_STATUS_CODE = 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.GATEWAY_TIMEOUT_STATUS_CODE = exports.FORBIDDEN_ERROR_STATUS_CODE = exports.DELETE = exports.DANGER_BUTTON = exports.CONFLICT_ERROR_STATUS_CODE = exports.CLICK = exports.BADREQUEST_ERROR_STATUS_CODE = exports.BACKSPACE = void 0;
7
7
  /*
8
8
  Copyright 2022 Iguazio Systems Ltd.
9
9
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -86,4 +86,8 @@ exports.MODAL_LG = MODAL_LG;
86
86
  var MODAL_MIN = 'min';
87
87
  exports.MODAL_MIN = MODAL_MIN;
88
88
  var MODAL_MAX = 'max';
89
- exports.MODAL_MAX = MODAL_MAX;
89
+
90
+ /*=========== SELECT =============*/
91
+ exports.MODAL_MAX = MODAL_MAX;
92
+ var SELECT_OPTION_ID_PREFIX = 'id-';
93
+ exports.SELECT_OPTION_ID_PREFIX = SELECT_OPTION_ID_PREFIX;
@@ -9,6 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _components = require("../../components");
11
11
  var _types = require("../../types");
12
+ var _constants = require("../../constants");
12
13
  var _checkmark = require("../../images/checkmark.svg");
13
14
  require("./selectOption.scss");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
@@ -58,7 +59,7 @@ var SelectOption = function SelectOption(_ref) {
58
59
  onClick: function onClick() {
59
60
  !item.disabled && _onClick(item.id);
60
61
  },
61
- id: item.id,
62
+ id: "".concat(_constants.SELECT_OPTION_ID_PREFIX).concat(item.id),
62
63
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
63
64
  className: "label-row",
64
65
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -77,6 +77,7 @@
77
77
  &-sub-label {
78
78
  margin-top: 5px;
79
79
  font-size: 13px;
80
+ width: 100%;
80
81
  }
81
82
 
82
83
  &-icon {
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.00003 13.456L12.3667 17.602L18.9794 13.902V15.3753L12.3667 19.108L5.37737 15.1347L5.0007 15.34V15.8533L12.3667 20L19.7334 15.8547V12.9767L19.3901 12.7707L12.3667 16.7453L5.7887 12.9767V11.5033L12.3667 15.2033L19.7334 11.058V8.21334L19.3901 8.008L12.3667 11.9827L6.13137 8.454L12.3667 4.92534L17.5401 7.83734L17.9854 7.56334V7.186L12.3667 4L5.00003 8.18V8.66L12.3667 12.8047L18.9794 9.10467V10.6113L12.3667 14.3467L5.37737 10.3733L5.0007 10.5787L5.00003 13.456Z" fill="#7F7989"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.75 13.6022L4.75073 10.4302L5.37992 10.0872L12.3671 14.0593L18.7294 10.4654V9.53103L12.3664 13.0913L4.75003 8.8062V8.03442L12.3667 3.71259L18.2354 7.04037V7.70305L17.5457 8.1274L12.3671 5.21241L6.63897 8.454L12.3667 11.6954L19.3936 7.71878L19.9834 8.07155V11.2042L12.3668 15.4902L6.0387 11.9308V12.8318L12.3675 16.4577L19.3938 12.4813L19.9834 12.8351V16.0009L12.3667 20.2869L4.7507 15.9995V15.1916L5.37992 14.8485L12.3672 18.8207L18.7294 15.2294V14.3284L12.3664 17.8887L4.75 13.6022ZM18.9794 13.902V15.3753L12.3667 19.108L5.37737 15.1347L5.0007 15.34V15.8533L12.3667 20L19.7334 15.8547V12.9767L19.3901 12.7707L12.3667 16.7453L5.7887 12.9767V11.5033L12.3667 15.2033L19.7334 11.058V8.21334L19.3901 8.008L12.3667 11.9827L6.13137 8.454L12.3667 4.92534L17.5401 7.83734L17.9854 7.56334V7.186L12.3667 4L5.00003 8.18V8.66L12.3667 12.8047L18.9794 9.10467V10.6113L12.3667 14.3467L5.37737 10.3733L5.0007 10.5787L5.00003 13.456L12.3667 17.602L18.9794 13.902Z" fill="#7F7989"/>
4
+ </svg>
@@ -310,6 +310,11 @@ var validationRules = {
310
310
  }), generateRule.required()]
311
311
  }
312
312
  },
313
+ function: {
314
+ name: [generateRule.validCharacters('a-z A-Z 0-9 - .'), generateRule.beginEndWith('a-z A-Z 0-9'), generateRule.length({
315
+ max: 63
316
+ }), generateRule.required()]
317
+ },
313
318
  common: {
314
319
  name: [generateRule.validCharacters('a-z A-Z 0-9 - _ .'), generateRule.beginEndWith('a-z A-Z 0-9'), generateRule.length({
315
320
  max: 63
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
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",