fui-material 2.1.14 → 2.2.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/f-ui-kit.es.js +62 -32
- package/dist/f-ui-kit.es.js.map +1 -1
- package/dist/types/function-elements/fBankRound/fBankRound.d.ts +16 -0
- package/dist/types/function-elements/fBankRound/index.d.ts +1 -0
- package/dist/types/function-elements/fFormatRuNumber/fFormatRuNumber.d.ts +29 -0
- package/dist/types/function-elements/fFormatRuNumber/index.d.ts +1 -0
- package/dist/types/function-elements/index.d.ts +2 -0
- package/dist/types/material/FCheckbox/FCheckbox.d.ts +0 -5
- package/dist/types/material/FRadioButton/FRadioButton.d.ts +9 -29
- package/package.json +1 -1
package/dist/f-ui-kit.es.js
CHANGED
|
@@ -2123,7 +2123,6 @@ const FCheckbox = forwardRef(
|
|
|
2123
2123
|
({
|
|
2124
2124
|
label,
|
|
2125
2125
|
className,
|
|
2126
|
-
id,
|
|
2127
2126
|
st: st2,
|
|
2128
2127
|
...props
|
|
2129
2128
|
}, ref) => {
|
|
@@ -2131,7 +2130,6 @@ const FCheckbox = forwardRef(
|
|
|
2131
2130
|
"div",
|
|
2132
2131
|
{
|
|
2133
2132
|
className: `${styles$m["f-checkbox"]} ${className || ""}`,
|
|
2134
|
-
id,
|
|
2135
2133
|
style: st2,
|
|
2136
2134
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
2137
2135
|
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { ref, type: "checkbox", ...props }),
|
|
@@ -2144,36 +2142,26 @@ const FCheckbox = forwardRef(
|
|
|
2144
2142
|
const styles$l = {
|
|
2145
2143
|
"f-radio": "_f-radio_cwhmx_1"
|
|
2146
2144
|
};
|
|
2147
|
-
const FRadioButton = (
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
onClick,
|
|
2168
|
-
checked,
|
|
2169
|
-
disabled: disabled2
|
|
2170
|
-
}
|
|
2171
|
-
),
|
|
2172
|
-
label
|
|
2173
|
-
] })
|
|
2174
|
-
}
|
|
2175
|
-
);
|
|
2176
|
-
};
|
|
2145
|
+
const FRadioButton = forwardRef(
|
|
2146
|
+
({
|
|
2147
|
+
label,
|
|
2148
|
+
className,
|
|
2149
|
+
st: st2,
|
|
2150
|
+
...props
|
|
2151
|
+
}, ref) => {
|
|
2152
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2153
|
+
"div",
|
|
2154
|
+
{
|
|
2155
|
+
className: `${styles$l["f-radio"]} ${className || ""}`,
|
|
2156
|
+
style: st2,
|
|
2157
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
2158
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { ref, type: "radio", ...props }),
|
|
2159
|
+
label
|
|
2160
|
+
] })
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2177
2165
|
const DOTS = "...";
|
|
2178
2166
|
const range = (start, end) => {
|
|
2179
2167
|
const length = end - start + 1;
|
|
@@ -50047,6 +50035,46 @@ function fDownloadBlobFile(blob, fileName) {
|
|
|
50047
50035
|
document.body.removeChild(link2);
|
|
50048
50036
|
window.URL.revokeObjectURL(url);
|
|
50049
50037
|
}
|
|
50038
|
+
function fBankRound(value, decimalPlaces) {
|
|
50039
|
+
if (decimalPlaces == void 0) decimalPlaces = 2;
|
|
50040
|
+
const factor = Math.pow(10, decimalPlaces);
|
|
50041
|
+
const roundedValue = Math.round(value * factor) / factor;
|
|
50042
|
+
const strValue = roundedValue.toString();
|
|
50043
|
+
const dotIndex = strValue.indexOf(".");
|
|
50044
|
+
if (dotIndex === -1) {
|
|
50045
|
+
return roundedValue;
|
|
50046
|
+
}
|
|
50047
|
+
const fractionalPart = strValue.slice(dotIndex + 1);
|
|
50048
|
+
if (fractionalPart.length <= decimalPlaces) {
|
|
50049
|
+
return roundedValue;
|
|
50050
|
+
}
|
|
50051
|
+
const nextDigit = fractionalPart[decimalPlaces];
|
|
50052
|
+
if (nextDigit === "5") {
|
|
50053
|
+
const lastDigit = fractionalPart[decimalPlaces - 1];
|
|
50054
|
+
if (+lastDigit % 2 !== 0) {
|
|
50055
|
+
return +(roundedValue + Math.pow(10, -decimalPlaces)).toFixed(decimalPlaces);
|
|
50056
|
+
} else {
|
|
50057
|
+
return +roundedValue.toFixed(decimalPlaces);
|
|
50058
|
+
}
|
|
50059
|
+
}
|
|
50060
|
+
return +roundedValue.toFixed(decimalPlaces);
|
|
50061
|
+
}
|
|
50062
|
+
const fFormatRuNumber = (a, options) => {
|
|
50063
|
+
if (typeof a !== "number" || isNaN(a)) return "";
|
|
50064
|
+
let processedValue = a;
|
|
50065
|
+
if (options == null ? void 0 : options.useBankRound) {
|
|
50066
|
+
const decimalPlaces = options.bankRoundDecimalPlaces;
|
|
50067
|
+
processedValue = fBankRound(processedValue, decimalPlaces);
|
|
50068
|
+
}
|
|
50069
|
+
const formatOptions = {};
|
|
50070
|
+
if ((options == null ? void 0 : options.maximumFractionDigits) !== void 0) {
|
|
50071
|
+
formatOptions.maximumFractionDigits = options.maximumFractionDigits;
|
|
50072
|
+
}
|
|
50073
|
+
if ((options == null ? void 0 : options.minimumFractionDigits) !== void 0) {
|
|
50074
|
+
formatOptions.minimumFractionDigits = options.minimumFractionDigits;
|
|
50075
|
+
}
|
|
50076
|
+
return new Intl.NumberFormat("ru-RU", formatOptions).format(processedValue);
|
|
50077
|
+
};
|
|
50050
50078
|
function bind(fn, thisArg) {
|
|
50051
50079
|
return function wrap() {
|
|
50052
50080
|
return fn.apply(thisArg, arguments);
|
|
@@ -52545,6 +52573,7 @@ export {
|
|
|
52545
52573
|
FTrashIcon,
|
|
52546
52574
|
FUnlinkIcon,
|
|
52547
52575
|
fAlert,
|
|
52576
|
+
fBankRound,
|
|
52548
52577
|
fConfirm,
|
|
52549
52578
|
fConvertFileToBase64,
|
|
52550
52579
|
fDownloadBlobFile,
|
|
@@ -52553,6 +52582,7 @@ export {
|
|
|
52553
52582
|
fExportTableToExcel,
|
|
52554
52583
|
fExportingHtmlToDocx,
|
|
52555
52584
|
fExportingHtmlToXlsx,
|
|
52585
|
+
fFormatRuNumber,
|
|
52556
52586
|
fGenerateUniqueId,
|
|
52557
52587
|
fInstallFormatCodeXlsx,
|
|
52558
52588
|
fNotification,
|