@fluentui/react-spinbutton 9.2.31 → 9.2.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/CHANGELOG.json +85 -1
  2. package/CHANGELOG.md +29 -2
  3. package/lib/components/SpinButton/SpinButton.js.map +1 -1
  4. package/lib/components/SpinButton/renderSpinButton.js +8 -2
  5. package/lib/components/SpinButton/renderSpinButton.js.map +1 -1
  6. package/lib/components/SpinButton/useSpinButton.js +3 -2
  7. package/lib/components/SpinButton/useSpinButton.js.map +1 -1
  8. package/lib/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
  9. package/lib/utils/clamp.js.map +1 -1
  10. package/lib/utils/getBound.js.map +1 -1
  11. package/lib/utils/precision.js.map +1 -1
  12. package/lib-commonjs/SpinButton.js +2 -2
  13. package/lib-commonjs/SpinButton.js.map +1 -1
  14. package/lib-commonjs/components/SpinButton/SpinButton.js +9 -7
  15. package/lib-commonjs/components/SpinButton/SpinButton.js.map +1 -1
  16. package/lib-commonjs/components/SpinButton/SpinButton.types.js +2 -2
  17. package/lib-commonjs/components/SpinButton/SpinButton.types.js.map +1 -1
  18. package/lib-commonjs/components/SpinButton/index.js +6 -6
  19. package/lib-commonjs/components/SpinButton/index.js.map +1 -1
  20. package/lib-commonjs/components/SpinButton/renderSpinButton.js +14 -6
  21. package/lib-commonjs/components/SpinButton/renderSpinButton.js.map +1 -1
  22. package/lib-commonjs/components/SpinButton/useSpinButton.js +42 -39
  23. package/lib-commonjs/components/SpinButton/useSpinButton.js.map +1 -1
  24. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js +14 -10
  25. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
  26. package/lib-commonjs/index.js +16 -6
  27. package/lib-commonjs/index.js.map +1 -1
  28. package/lib-commonjs/utils/clamp.js +3 -1
  29. package/lib-commonjs/utils/clamp.js.map +1 -1
  30. package/lib-commonjs/utils/getBound.js +3 -1
  31. package/lib-commonjs/utils/getBound.js.map +1 -1
  32. package/lib-commonjs/utils/index.js +4 -4
  33. package/lib-commonjs/utils/index.js.map +1 -1
  34. package/lib-commonjs/utils/precision.js +6 -2
  35. package/lib-commonjs/utils/precision.js.map +1 -1
  36. package/package.json +12 -12
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./clamp"), exports);
7
- _exportStar(require("./getBound"), exports);
8
- _exportStar(require("./precision"), exports);
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":";;;;;oBAAc;oBACA;oBACA"}
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: ()=>calculatePrecision,
19
- precisionRound: ()=>precisionRound
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,MAAlBA;IAsBAC,cAAc,MAAdA;;AAtBT,SAASD,mBAAmBE,KAAK,EAAE;IAC1C;;;;;GAKD,GAAG,MAAMC,SAAS,0BAA0BC,IAAI,CAACC,OAAOH;IACvD,IAAI,CAACC,QAAQ;QACT,OAAO;IACX,CAAC;IACD,IAAIA,MAAM,CAAC,EAAE,EAAE;QACX,OAAO,CAACA,MAAM,CAAC,EAAE,CAACG,MAAM;IAC5B,CAAC;IACD,IAAIH,MAAM,CAAC,EAAE,EAAE;QACX,OAAOA,MAAM,CAAC,EAAE,CAACG,MAAM;IAC3B,CAAC;IACD,OAAO;AACX;AAKW,SAASL,eAAeC,KAAK,EAAEK,SAAS,EAAEC,OAAO,EAAE,EAAE;IAC5D,MAAMC,MAAMC,KAAKC,GAAG,CAACH,MAAMD;IAC3B,OAAOG,KAAKE,KAAK,CAACV,QAAQO,OAAOA;AACrC"}
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.31",
3
+ "version": "9.2.33",
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.3",
38
- "@fluentui/react-field": "^9.1.21",
37
+ "@fluentui/keyboard-keys": "^9.0.4",
38
+ "@fluentui/react-field": "^9.1.23",
39
39
  "@fluentui/react-icons": "^2.0.207",
40
- "@fluentui/react-jsx-runtime": "^9.0.2",
41
- "@fluentui/react-shared-contexts": "^9.7.2",
42
- "@fluentui/react-theme": "^9.1.11",
43
- "@fluentui/react-utilities": "^9.12.0",
40
+ "@fluentui/react-jsx-runtime": "^9.0.4",
41
+ "@fluentui/react-shared-contexts": "^9.7.3",
42
+ "@fluentui/react-theme": "^9.1.12",
43
+ "@fluentui/react-utilities": "^9.13.1",
44
44
  "@griffel/react": "^1.5.14",
45
- "@swc/helpers": "^0.4.14"
45
+ "@swc/helpers": "^0.5.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@types/react": ">=16.8.0 <19.0.0",
49
- "@types/react-dom": ">=16.8.0 <19.0.0",
50
- "react": ">=16.8.0 <19.0.0",
51
- "react-dom": ">=16.8.0 <19.0.0"
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": [