iguazio.dashboard-react-controls 1.8.2 → 1.8.4
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.
|
@@ -22,7 +22,7 @@ var _popout = require("../../images/popout.svg");
|
|
|
22
22
|
var _warning = require("../../images/warning.svg");
|
|
23
23
|
require("./formInput.scss");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
var _excluded = ["async", "className", "density", "disabled", "focused", "iconClass", "iconClick", "inputIcon", "invalidText", "label", "link", "name", "onBlur", "onChange", "pattern", "required", "suggestionList", "tip", "validationRules", "validator", "withoutBorder"];
|
|
25
|
+
var _excluded = ["async", "className", "customRequiredLabel", "density", "disabled", "focused", "iconClass", "iconClick", "inputIcon", "invalidText", "label", "link", "name", "onBlur", "onChange", "onFocus", "pattern", "required", "suggestionList", "tip", "validationRules", "validator", "withoutBorder"];
|
|
26
26
|
/*
|
|
27
27
|
Copyright 2022 Iguazio Systems Ltd.
|
|
28
28
|
Licensed under the Apache License, Version 2.0 (the "License") with
|
|
@@ -62,6 +62,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
62
62
|
var _ref2;
|
|
63
63
|
var async = _ref.async,
|
|
64
64
|
className = _ref.className,
|
|
65
|
+
customRequiredLabel = _ref.customRequiredLabel,
|
|
65
66
|
density = _ref.density,
|
|
66
67
|
disabled = _ref.disabled,
|
|
67
68
|
focused = _ref.focused,
|
|
@@ -74,6 +75,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
74
75
|
name = _ref.name,
|
|
75
76
|
onBlur = _ref.onBlur,
|
|
76
77
|
onChange = _ref.onChange,
|
|
78
|
+
onFocus = _ref.onFocus,
|
|
77
79
|
pattern = _ref.pattern,
|
|
78
80
|
required = _ref.required,
|
|
79
81
|
suggestionList = _ref.suggestionList,
|
|
@@ -181,6 +183,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
181
183
|
};
|
|
182
184
|
var handleInputFocus = function handleInputFocus(event) {
|
|
183
185
|
input.onFocus && input.onFocus(event);
|
|
186
|
+
onFocus && onFocus();
|
|
184
187
|
setIsFocused(true);
|
|
185
188
|
};
|
|
186
189
|
var handleScroll = function handleScroll(event) {
|
|
@@ -207,7 +210,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
207
210
|
if (required && valueToValidate.trim().length === 0) {
|
|
208
211
|
validationError = {
|
|
209
212
|
name: 'required',
|
|
210
|
-
label: 'This field is required'
|
|
213
|
+
label: customRequiredLabel || 'This field is required'
|
|
211
214
|
};
|
|
212
215
|
} else if (!(0, _lodash.isEmpty)(rules) && !async) {
|
|
213
216
|
var _checkPatternsValidit = (0, _validation.checkPatternsValidity)(rules, valueToValidate),
|
|
@@ -422,6 +425,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
422
425
|
FormInput.defaultProps = {
|
|
423
426
|
async: false,
|
|
424
427
|
className: '',
|
|
428
|
+
customRequiredLabel: '',
|
|
425
429
|
density: 'normal',
|
|
426
430
|
disabled: false,
|
|
427
431
|
focused: false,
|
|
@@ -454,6 +458,7 @@ FormInput.defaultProps = {
|
|
|
454
458
|
FormInput.propTypes = {
|
|
455
459
|
async: _propTypes.default.bool,
|
|
456
460
|
className: _propTypes.default.string,
|
|
461
|
+
customRequiredLabel: _propTypes.default.string,
|
|
457
462
|
density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
|
|
458
463
|
disabled: _propTypes.default.bool,
|
|
459
464
|
focused: _propTypes.default.bool,
|
|
@@ -468,6 +473,7 @@ FormInput.propTypes = {
|
|
|
468
473
|
name: _propTypes.default.string.isRequired,
|
|
469
474
|
onBlur: _propTypes.default.func,
|
|
470
475
|
onChange: _propTypes.default.func,
|
|
476
|
+
onFocus: _propTypes.default.func,
|
|
471
477
|
onKeyDown: _propTypes.default.func,
|
|
472
478
|
pattern: _propTypes.default.string,
|
|
473
479
|
placeholder: _propTypes.default.string,
|
|
@@ -40,12 +40,14 @@ var InputNumberButtons = function InputNumberButtons(_ref) {
|
|
|
40
40
|
event.preventDefault();
|
|
41
41
|
if (max && value >= max) return;
|
|
42
42
|
var newValue = isCurrentValueEmpty() ? step : (0, _math.performFloatOperation)(value, step, '+');
|
|
43
|
+
newValue = max && newValue > max ? max : newValue;
|
|
43
44
|
onChange(newValue);
|
|
44
45
|
};
|
|
45
46
|
var handleDecrease = function handleDecrease(event) {
|
|
46
47
|
event.preventDefault();
|
|
47
48
|
if (min && value <= min) return;
|
|
48
49
|
var newValue = isCurrentValueEmpty() ? -step : (0, _math.performFloatOperation)(value, step, '-');
|
|
50
|
+
newValue = min && newValue < min ? min : newValue;
|
|
49
51
|
onChange(newValue);
|
|
50
52
|
};
|
|
51
53
|
var isCurrentValueEmpty = function isCurrentValueEmpty() {
|
|
@@ -29,7 +29,7 @@ var openPopUp = function openPopUp(element, props) {
|
|
|
29
29
|
return (0, _reactModalPromise.create)(element)(props);
|
|
30
30
|
};
|
|
31
31
|
exports.openPopUp = openPopUp;
|
|
32
|
-
var openConfirmPopUp = function openConfirmPopUp(
|
|
32
|
+
var openConfirmPopUp = function openConfirmPopUp(message, confirmHandler) {
|
|
33
33
|
return openPopUp(_components.ConfirmDialog, {
|
|
34
34
|
cancelButton: {
|
|
35
35
|
label: 'Cancel',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.4",
|
|
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",
|