@skedulo/sked-ui 20.3.0 → 20.3.1
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.
package/dist/index.js
CHANGED
|
@@ -60447,11 +60447,11 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
60447
60447
|
|
|
60448
60448
|
var valueChangeWithValidation = function valueChangeWithValidation(newValue) {
|
|
60449
60449
|
// limit the number of characters allowed
|
|
60450
|
-
var
|
|
60450
|
+
var valueWitinMaxLength = newValue.toString().length <= maxLength; // only change the value if the new value falls within the set min and max
|
|
60451
60451
|
|
|
60452
60452
|
var valueWithInMinMax = newValue <= max && newValue >= min;
|
|
60453
60453
|
|
|
60454
|
-
if (
|
|
60454
|
+
if (valueWitinMaxLength && valueWithInMinMax) {
|
|
60455
60455
|
onValueChange(newValue);
|
|
60456
60456
|
}
|
|
60457
60457
|
};
|
|
@@ -60462,10 +60462,12 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
60462
60462
|
var inputValue = event.target.value;
|
|
60463
60463
|
|
|
60464
60464
|
if (inputValue === '') {
|
|
60465
|
-
|
|
60465
|
+
onValueChange(''); // The only time we supply a string to the onValuechange prop function - Indicating that the field is not zero, but empty.
|
|
60466
|
+
|
|
60467
|
+
return;
|
|
60466
60468
|
}
|
|
60467
60469
|
|
|
60468
|
-
|
|
60470
|
+
valueChangeWithValidation(Number(Number(lodash_defaultTo__WEBPACK_IMPORTED_MODULE_3___default()(inputValue, 0)).toFixed(precision)));
|
|
60469
60471
|
};
|
|
60470
60472
|
|
|
60471
60473
|
var increment = function increment(direction) {
|
|
@@ -60489,24 +60491,24 @@ var NumberInput = function NumberInput(_ref) {
|
|
|
60489
60491
|
|
|
60490
60492
|
var buttonClasses = 'sked-button--icon-only focus:sk-bg-neutral-250 sk-rounded-none sk-border-0 sk-border-l sk-border-neutral-450';
|
|
60491
60493
|
var disabled = otherProps.disabled;
|
|
60492
|
-
return /*#__PURE__*/
|
|
60494
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("div", {
|
|
60493
60495
|
className: "sk-relative sk-flex sk-items-center"
|
|
60494
|
-
}, /*#__PURE__*/
|
|
60496
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](_FormElements__WEBPACK_IMPORTED_MODULE_4__["FormInputElement"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
60495
60497
|
type: "number"
|
|
60496
60498
|
}, otherProps, {
|
|
60497
60499
|
className: "sked-number sk-pr-20 ".concat(className),
|
|
60498
60500
|
onChange: changeHandler,
|
|
60499
60501
|
onKeyDown: onKeyDown,
|
|
60500
60502
|
value: value
|
|
60501
|
-
})), /*#__PURE__*/
|
|
60503
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("div", {
|
|
60502
60504
|
className: "sk-absolute sk-right-0 sk-flex sk-mr-px"
|
|
60503
|
-
}, /*#__PURE__*/
|
|
60505
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](_buttons_button_Button__WEBPACK_IMPORTED_MODULE_5__["Button"], {
|
|
60504
60506
|
icon: "zoomOut",
|
|
60505
60507
|
onClick: increment(-1),
|
|
60506
60508
|
disabled: value <= min || disabled,
|
|
60507
60509
|
buttonType: "transparent",
|
|
60508
60510
|
className: buttonClasses
|
|
60509
|
-
}), /*#__PURE__*/
|
|
60511
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](_buttons_button_Button__WEBPACK_IMPORTED_MODULE_5__["Button"], {
|
|
60510
60512
|
icon: "zoomIn",
|
|
60511
60513
|
onClick: increment(1),
|
|
60512
60514
|
disabled: value >= max || disabled,
|