@fluentui/react-spinbutton 9.2.32 → 9.2.34
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +85 -1
- package/CHANGELOG.md +29 -2
- package/lib/components/SpinButton/SpinButton.js.map +1 -1
- package/lib/components/SpinButton/renderSpinButton.js +8 -2
- package/lib/components/SpinButton/renderSpinButton.js.map +1 -1
- package/lib/components/SpinButton/useSpinButton.js +3 -2
- package/lib/components/SpinButton/useSpinButton.js.map +1 -1
- package/lib/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
- package/lib/utils/clamp.js.map +1 -1
- package/lib/utils/getBound.js.map +1 -1
- package/lib/utils/precision.js.map +1 -1
- package/lib-commonjs/SpinButton.js +2 -2
- package/lib-commonjs/SpinButton.js.map +1 -1
- package/lib-commonjs/components/SpinButton/SpinButton.js +9 -7
- package/lib-commonjs/components/SpinButton/SpinButton.js.map +1 -1
- package/lib-commonjs/components/SpinButton/SpinButton.types.js +2 -2
- package/lib-commonjs/components/SpinButton/SpinButton.types.js.map +1 -1
- package/lib-commonjs/components/SpinButton/index.js +6 -6
- package/lib-commonjs/components/SpinButton/index.js.map +1 -1
- package/lib-commonjs/components/SpinButton/renderSpinButton.js +14 -6
- package/lib-commonjs/components/SpinButton/renderSpinButton.js.map +1 -1
- package/lib-commonjs/components/SpinButton/useSpinButton.js +42 -39
- package/lib-commonjs/components/SpinButton/useSpinButton.js.map +1 -1
- package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js +14 -10
- package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +16 -6
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/clamp.js +3 -1
- package/lib-commonjs/utils/clamp.js.map +1 -1
- package/lib-commonjs/utils/getBound.js +3 -1
- package/lib-commonjs/utils/getBound.js.map +1 -1
- package/lib-commonjs/utils/index.js +4 -4
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/precision.js +6 -2
- package/lib-commonjs/utils/precision.js.map +1 -1
- package/package.json +12 -12
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./clamp"), exports);
|
7
|
+
_export_star._(require("./getBound"), exports);
|
8
|
+
_export_star._(require("./precision"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './clamp';\nexport * from './getBound';\nexport * from './precision';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './clamp';\nexport * from './getBound';\nexport * from './precision';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA"}
|
@@ -15,8 +15,12 @@ function _export(target, all) {
|
|
15
15
|
});
|
16
16
|
}
|
17
17
|
_export(exports, {
|
18
|
-
calculatePrecision: ()
|
19
|
-
|
18
|
+
calculatePrecision: function() {
|
19
|
+
return calculatePrecision;
|
20
|
+
},
|
21
|
+
precisionRound: function() {
|
22
|
+
return precisionRound;
|
23
|
+
}
|
20
24
|
});
|
21
25
|
function calculatePrecision(value) {
|
22
26
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["precision.js"],"sourcesContent":["/**\n * Calculates a number's precision based on the number of trailing\n * zeros if the number does not have a decimal indicated by a negative\n * precision. Otherwise, it calculates the number of digits after\n * the decimal point indicated by a positive precision.\n * @param value - the value to determine the precision of\n */ export function calculatePrecision(value) {\n /**\n * Group 1:\n * [1-9]([0]+$) matches trailing zeros\n * Group 2:\n * \\.([0-9]*) matches all digits after a decimal point.\n */ const groups = /[1-9]([0]+$)|\\.([0-9]*)/.exec(String(value));\n if (!groups) {\n return 0;\n }\n if (groups[1]) {\n return -groups[1].length;\n }\n if (groups[2]) {\n return groups[2].length;\n }\n return 0;\n}\n/**\n * Rounds a number to a certain level of precision. Accepts negative precision.\n * @param value - The value that is being rounded.\n * @param precision - The number of decimal places to round the number to\n */ export function precisionRound(value, precision, base = 10) {\n const exp = Math.pow(base, precision);\n return Math.round(value * exp) / exp;\n}\n"],"names":["calculatePrecision","precisionRound","value","groups","exec","String","length","precision","base","exp","Math","pow","round"],"mappings":"AAAA;;;;;;CAMC;;;;;;;;;;;IAAmBA,kBAAkB
|
1
|
+
{"version":3,"sources":["precision.js"],"sourcesContent":["/**\n * Calculates a number's precision based on the number of trailing\n * zeros if the number does not have a decimal indicated by a negative\n * precision. Otherwise, it calculates the number of digits after\n * the decimal point indicated by a positive precision.\n * @param value - the value to determine the precision of\n */ export function calculatePrecision(value) {\n /**\n * Group 1:\n * [1-9]([0]+$) matches trailing zeros\n * Group 2:\n * \\.([0-9]*) matches all digits after a decimal point.\n */ const groups = /[1-9]([0]+$)|\\.([0-9]*)/.exec(String(value));\n if (!groups) {\n return 0;\n }\n if (groups[1]) {\n return -groups[1].length;\n }\n if (groups[2]) {\n return groups[2].length;\n }\n return 0;\n}\n/**\n * Rounds a number to a certain level of precision. Accepts negative precision.\n * @param value - The value that is being rounded.\n * @param precision - The number of decimal places to round the number to\n */ export function precisionRound(value, precision, base = 10) {\n const exp = Math.pow(base, precision);\n return Math.round(value * exp) / exp;\n}\n"],"names":["calculatePrecision","precisionRound","value","groups","exec","String","length","precision","base","exp","Math","pow","round"],"mappings":"AAAA;;;;;;CAMC;;;;;;;;;;;IAAmBA,kBAAkB;eAAlBA;;IAsBAC,cAAc;eAAdA;;;AAtBT,SAASD,mBAAmBE,KAAK;IACxC;;;;;GAKD,GAAG,MAAMC,SAAS,0BAA0BC,IAAI,CAACC,OAAOH;IACvD,IAAI,CAACC,QAAQ;QACT,OAAO;IACX;IACA,IAAIA,MAAM,CAAC,EAAE,EAAE;QACX,OAAO,CAACA,MAAM,CAAC,EAAE,CAACG,MAAM;IAC5B;IACA,IAAIH,MAAM,CAAC,EAAE,EAAE;QACX,OAAOA,MAAM,CAAC,EAAE,CAACG,MAAM;IAC3B;IACA,OAAO;AACX;AAKW,SAASL,eAAeC,KAAK,EAAEK,SAAS,EAAEC,OAAO,EAAE;IAC1D,MAAMC,MAAMC,KAAKC,GAAG,CAACH,MAAMD;IAC3B,OAAOG,KAAKE,KAAK,CAACV,QAAQO,OAAOA;AACrC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-spinbutton",
|
3
|
-
"version": "9.2.
|
3
|
+
"version": "9.2.34",
|
4
4
|
"description": "Fluent UI React SpinButton component.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -34,21 +34,21 @@
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@fluentui/keyboard-keys": "^9.0.
|
38
|
-
"@fluentui/react-field": "^9.1.
|
37
|
+
"@fluentui/keyboard-keys": "^9.0.4",
|
38
|
+
"@fluentui/react-field": "^9.1.24",
|
39
39
|
"@fluentui/react-icons": "^2.0.207",
|
40
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
41
|
-
"@fluentui/react-shared-contexts": "^9.7.
|
42
|
-
"@fluentui/react-theme": "^9.1.
|
43
|
-
"@fluentui/react-utilities": "^9.13.
|
40
|
+
"@fluentui/react-jsx-runtime": "^9.0.5",
|
41
|
+
"@fluentui/react-shared-contexts": "^9.7.3",
|
42
|
+
"@fluentui/react-theme": "^9.1.12",
|
43
|
+
"@fluentui/react-utilities": "^9.13.2",
|
44
44
|
"@griffel/react": "^1.5.14",
|
45
|
-
"@swc/helpers": "^0.
|
45
|
+
"@swc/helpers": "^0.5.1"
|
46
46
|
},
|
47
47
|
"peerDependencies": {
|
48
|
-
"@types/react": ">=16.
|
49
|
-
"@types/react-dom": ">=16.
|
50
|
-
"react": ">=16.
|
51
|
-
"react-dom": ">=16.
|
48
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
49
|
+
"@types/react-dom": ">=16.14.0 <19.0.0",
|
50
|
+
"react": ">=16.14.0 <19.0.0",
|
51
|
+
"react-dom": ">=16.14.0 <19.0.0"
|
52
52
|
},
|
53
53
|
"beachball": {
|
54
54
|
"disallowedChangeTypes": [
|