kui-crm 0.0.179 → 0.0.181

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/cjs/index.js CHANGED
@@ -2138,7 +2138,7 @@ function ErrorPopup(_a) {
2138
2138
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Global, { styles: containerCSS$1 }), ReactDOM.createPortal(jsxRuntime.jsx(StyledWrapper$a, __assign({ onMouseEnter: startHover, onMouseLeave: handleMouseLeave, className: "KUI-ErrorPopup", container: true, alignItems: "center" }, { children: jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "xs", weight: 600, color: "zero" }, { children: jsxRuntime.jsx(StyledContent$1, { children: label ? "Error in ".concat(label) : "Error" }) })) })), parentNode)] }));
2139
2139
  }
2140
2140
  var containerCSS$1 = react.css(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n body {\n position: relative;\n }\n .KUI-ErrorPopup_container {\n display: flex;\n position: fixed;\n top: 120px;\n justify-content: center;\n flex-direction: column;\n width: 100%;\n align-items: center;\n z-index: 10000;\n }\n"], ["\n body {\n position: relative;\n }\n .KUI-ErrorPopup_container {\n display: flex;\n position: fixed;\n top: 120px;\n justify-content: center;\n flex-direction: column;\n width: 100%;\n align-items: center;\n z-index: 10000;\n }\n"])));
2141
- var StyledWrapper$a = styled__default["default"](kuiBasic.Grid)(templateObject_2$o || (templateObject_2$o = __makeTemplateObject(["\n height: 46px;\n border-radius: 12px;\n background: rgba(25, 25, 25, 0.8);\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n padding: 0 24px;\n margin-bottom: 16px;\n width: max-content;\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n height: 46px;\n border-radius: 12px;\n background: rgba(25, 25, 25, 0.8);\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n padding: 0 24px;\n margin-bottom: 16px;\n width: max-content;\n &:last-child {\n margin-bottom: 0;\n }\n"])));
2141
+ var StyledWrapper$a = styled__default["default"](kuiBasic.Grid)(templateObject_2$o || (templateObject_2$o = __makeTemplateObject(["\n height: 46px;\n border-radius: 12px;\n background: rgba(25, 25, 25, 0.8);\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n padding: 0 24px;\n margin-bottom: 16px;\n width: max-content;\n max-width: calc(100vh - 32px);\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n height: 46px;\n border-radius: 12px;\n background: rgba(25, 25, 25, 0.8);\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n padding: 0 24px;\n margin-bottom: 16px;\n width: max-content;\n max-width: calc(100vh - 32px);\n &:last-child {\n margin-bottom: 0;\n }\n"])));
2142
2142
  var StyledContent$1 = styled__default["default"].pre(templateObject_3$m || (templateObject_3$m = __makeTemplateObject(["\n margin: 0;\n padding: 0;\n"], ["\n margin: 0;\n padding: 0;\n"])));
2143
2143
  var templateObject_1$C, templateObject_2$o, templateObject_3$m;
2144
2144
 
@@ -3182,9 +3182,14 @@ var NumberField = React.forwardRef(function (props, ref) {
3182
3182
  .fill("9")
3183
3183
  .join("")));
3184
3184
  var enforceMinMax = function (e) {
3185
+ var _a;
3185
3186
  form.clearErrors(name);
3186
- if (e.target.value > maxNumber ||
3187
- String(e.target.value).length > numberLength) {
3187
+ var value = e.target.value;
3188
+ var valueArr = String(value).split(".");
3189
+ var decimalPartLength = ((_a = valueArr[1]) === null || _a === void 0 ? void 0 : _a.length) || 0;
3190
+ if (value > maxNumber ||
3191
+ String(value).length > numberLength ||
3192
+ (maxDecimalPart && decimalPartLength > maxDecimalPart)) {
3188
3193
  e.target.value = Number(String(e.target.value).slice(0, -1));
3189
3194
  }
3190
3195
  if (maxValue && Number(e.target.value) > Number(maxValue)) {
@@ -4039,18 +4044,18 @@ var getPartialMeterInfoFields = function (resource, type, meter, withCheckValue,
4039
4044
  __assign({ label: "Number", name: "".concat(prefixName, "number") }, settings === null || settings === void 0 ? void 0 : settings.number),
4040
4045
  __assign(__assign({ label: "T1 value", name: "".concat(prefixName, "T1"), maxValue: ((_a = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _a === void 0 ? void 0 : _a.T1) && withCheckValue
4041
4046
  ? Number(meter.maxValue.T1)
4042
- : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.T1 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t1)
4047
+ : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.values.T1 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t1)
4043
4048
  ], kuiUtils.addToArrayByCondition(type !== "T1", __assign(__assign({ label: "T2 value", name: "".concat(prefixName, "T2"), maxValue: ((_b = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _b === void 0 ? void 0 : _b.T2) && withCheckValue
4044
4049
  ? Number(meter.maxValue.T2)
4045
- : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.T2 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t2)), true), kuiUtils.addToArrayByCondition(type === "T3", __assign(__assign({ label: "T3 value", name: "".concat(prefixName, "T3"), maxValue: ((_c = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _c === void 0 ? void 0 : _c.T3) && withCheckValue
4050
+ : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.values.T2 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t2)), true), kuiUtils.addToArrayByCondition(type === "T3", __assign(__assign({ label: "T3 value", name: "".concat(prefixName, "T3"), maxValue: ((_c = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _c === void 0 ? void 0 : _c.T3) && withCheckValue
4046
4051
  ? Number(meter.maxValue.T3)
4047
- : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.T3 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t3)), true);
4052
+ : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.values.T3 }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t3)), true);
4048
4053
  }
4049
4054
  return [
4050
4055
  __assign({ label: "Number", name: "".concat(prefixName, "number") }, settings === null || settings === void 0 ? void 0 : settings.number),
4051
4056
  __assign(__assign({ label: "Value", name: "".concat(prefixName, "value"), maxValue: ((_d = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _d === void 0 ? void 0 : _d.value) && withCheckValue
4052
4057
  ? Number(meter.maxValue.value)
4053
- : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.value }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.value),
4058
+ : null, placeholder: meter === null || meter === void 0 ? void 0 : meter.values.value }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.value),
4054
4059
  ];
4055
4060
  };
4056
4061