@fluentui/react-spinbutton 9.2.3 → 9.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +97 -1
  3. package/CHANGELOG.md +31 -2
  4. package/lib/SpinButton.js.map +1 -1
  5. package/lib/SpinButtonField.js.map +1 -1
  6. package/lib/components/SpinButton/SpinButton.js.map +1 -1
  7. package/lib/components/SpinButton/SpinButton.types.js +1 -1
  8. package/lib/components/SpinButton/SpinButton.types.js.map +1 -1
  9. package/lib/components/SpinButton/index.js.map +1 -1
  10. package/lib/components/SpinButton/renderSpinButton.js +1 -9
  11. package/lib/components/SpinButton/renderSpinButton.js.map +1 -1
  12. package/lib/components/SpinButton/useSpinButton.js +4 -3
  13. package/lib/components/SpinButton/useSpinButton.js.map +1 -1
  14. package/lib/components/SpinButton/useSpinButtonStyles.js.map +1 -1
  15. package/lib/components/SpinButtonField/SpinButtonField.js +1 -2
  16. package/lib/components/SpinButtonField/SpinButtonField.js.map +1 -1
  17. package/lib/components/SpinButtonField/index.js.map +1 -1
  18. package/lib/index.js.map +1 -1
  19. package/lib/utils/clamp.js.map +1 -1
  20. package/lib/utils/getBound.js.map +1 -1
  21. package/lib/utils/index.js.map +1 -1
  22. package/lib/utils/precision.js +6 -7
  23. package/lib/utils/precision.js.map +1 -1
  24. package/lib-commonjs/SpinButton.js +5 -4
  25. package/lib-commonjs/SpinButton.js.map +1 -1
  26. package/lib-commonjs/SpinButtonField.js +5 -4
  27. package/lib-commonjs/SpinButtonField.js.map +1 -1
  28. package/lib-commonjs/components/SpinButton/SpinButton.js +19 -20
  29. package/lib-commonjs/components/SpinButton/SpinButton.js.map +1 -1
  30. package/lib-commonjs/components/SpinButton/SpinButton.types.js +5 -2
  31. package/lib-commonjs/components/SpinButton/SpinButton.types.js.map +1 -1
  32. package/lib-commonjs/components/SpinButton/index.js +9 -8
  33. package/lib-commonjs/components/SpinButton/index.js.map +1 -1
  34. package/lib-commonjs/components/SpinButton/renderSpinButton.js +13 -24
  35. package/lib-commonjs/components/SpinButton/renderSpinButton.js.map +1 -1
  36. package/lib-commonjs/components/SpinButton/useSpinButton.js +248 -259
  37. package/lib-commonjs/components/SpinButton/useSpinButton.js.map +1 -1
  38. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.js +506 -246
  39. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.js.map +1 -1
  40. package/lib-commonjs/components/SpinButtonField/SpinButtonField.js +17 -11
  41. package/lib-commonjs/components/SpinButtonField/SpinButtonField.js.map +1 -1
  42. package/lib-commonjs/components/SpinButtonField/index.js +5 -4
  43. package/lib-commonjs/components/SpinButtonField/index.js.map +1 -1
  44. package/lib-commonjs/index.js +21 -49
  45. package/lib-commonjs/index.js.map +1 -1
  46. package/lib-commonjs/utils/clamp.js +28 -21
  47. package/lib-commonjs/utils/clamp.js.map +1 -1
  48. package/lib-commonjs/utils/getBound.js +16 -14
  49. package/lib-commonjs/utils/getBound.js.map +1 -1
  50. package/lib-commonjs/utils/index.js +7 -6
  51. package/lib-commonjs/utils/index.js.map +1 -1
  52. package/lib-commonjs/utils/precision.js +33 -33
  53. package/lib-commonjs/utils/precision.js.map +1 -1
  54. package/package.json +12 -11
  55. package/lib-amd/SpinButton.js +0 -6
  56. package/lib-amd/SpinButton.js.map +0 -1
  57. package/lib-amd/SpinButtonField.js +0 -6
  58. package/lib-amd/SpinButtonField.js.map +0 -1
  59. package/lib-amd/components/SpinButton/SpinButton.js +0 -17
  60. package/lib-amd/components/SpinButton/SpinButton.js.map +0 -1
  61. package/lib-amd/components/SpinButton/SpinButton.types.js +0 -5
  62. package/lib-amd/components/SpinButton/SpinButton.types.js.map +0 -1
  63. package/lib-amd/components/SpinButton/index.js +0 -10
  64. package/lib-amd/components/SpinButton/index.js.map +0 -1
  65. package/lib-amd/components/SpinButton/renderSpinButton.js +0 -17
  66. package/lib-amd/components/SpinButton/renderSpinButton.js.map +0 -1
  67. package/lib-amd/components/SpinButton/useSpinButton.js +0 -253
  68. package/lib-amd/components/SpinButton/useSpinButton.js.map +0 -1
  69. package/lib-amd/components/SpinButton/useSpinButtonStyles.js +0 -420
  70. package/lib-amd/components/SpinButton/useSpinButtonStyles.js.map +0 -1
  71. package/lib-amd/components/SpinButtonField/SpinButtonField.js +0 -10
  72. package/lib-amd/components/SpinButtonField/SpinButtonField.js.map +0 -1
  73. package/lib-amd/components/SpinButtonField/index.js +0 -6
  74. package/lib-amd/components/SpinButtonField/index.js.map +0 -1
  75. package/lib-amd/index.js +0 -13
  76. package/lib-amd/index.js.map +0 -1
  77. package/lib-amd/utils/clamp.js +0 -30
  78. package/lib-amd/utils/clamp.js.map +0 -1
  79. package/lib-amd/utils/getBound.js +0 -19
  80. package/lib-amd/utils/getBound.js.map +0 -1
  81. package/lib-amd/utils/index.js +0 -8
  82. package/lib-amd/utils/index.js.map +0 -1
  83. package/lib-amd/utils/precision.js +0 -44
  84. package/lib-amd/utils/precision.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clamp","value","min","max","nextValue","undefined","error","Error","process","env","NODE_ENV","console","stack","join","Math"],"sources":["../src/packages/react-components/react-spinbutton/src/utils/clamp.ts"],"sourcesContent":["export const clamp = (value: number, min?: number, max?: number): number => {\n let nextValue = value;\n if (min !== undefined) {\n if (max !== undefined && min > max) {\n const error = new Error();\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(\n [\n `\"min\" value \"${min}\" is greater than \"max\" value \"${max}\".`,\n '\"min\" must be less than or equal to \"max\".',\n `Returning value \"${value}\".`,\n error.stack,\n ].join(),\n );\n }\n return value;\n }\n\n nextValue = Math.max(min, nextValue);\n }\n\n if (max !== undefined) {\n nextValue = Math.min(max, nextValue);\n }\n\n return nextValue;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,KAAK,GAAGA,CAACC,KAAa,EAAEC,GAAY,EAAEC,GAAY,KAAY;EACzE,IAAIC,SAAS,GAAGH,KAAK;EACrB,IAAIC,GAAG,KAAKG,SAAS,EAAE;IACrB,IAAIF,GAAG,KAAKE,SAAS,IAAIH,GAAG,GAAGC,GAAG,EAAE;MAClC,MAAMG,KAAK,GAAG,IAAIC,KAAK,EAAE;MACzB,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACzC;QACAC,OAAO,CAACL,KAAK,CACX,CACE,gBAAgBJ,GAAG,kCAAkCC,GAAG,IAAI,EAC5D,4CAA4C,EAC5C,oBAAoBF,KAAK,IAAI,EAC7BK,KAAK,CAACM,KAAK,CACZ,CAACC,IAAI,EAAE,CACT;;MAEH,OAAOZ,KAAK;;IAGdG,SAAS,GAAGU,IAAI,CAACX,GAAG,CAACD,GAAG,EAAEE,SAAS,CAAC;;EAGtC,IAAID,GAAG,KAAKE,SAAS,EAAE;IACrBD,SAAS,GAAGU,IAAI,CAACZ,GAAG,CAACC,GAAG,EAAEC,SAAS,CAAC;;EAGtC,OAAOA,SAAS;AAClB,CAAC"}
1
+ {"version":3,"names":["clamp","value","min","max","nextValue","undefined","error","Error","process","env","NODE_ENV","console","stack","join","Math"],"sources":["../../src/utils/clamp.ts"],"sourcesContent":["export const clamp = (value: number, min?: number, max?: number): number => {\n let nextValue = value;\n if (min !== undefined) {\n if (max !== undefined && min > max) {\n const error = new Error();\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(\n [\n `\"min\" value \"${min}\" is greater than \"max\" value \"${max}\".`,\n '\"min\" must be less than or equal to \"max\".',\n `Returning value \"${value}\".`,\n error.stack,\n ].join(),\n );\n }\n return value;\n }\n\n nextValue = Math.max(min, nextValue);\n }\n\n if (max !== undefined) {\n nextValue = Math.min(max, nextValue);\n }\n\n return nextValue;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,KAAA,GAAQA,CAACC,KAAA,EAAeC,GAAA,EAAcC,GAAA,KAAyB;EAC1E,IAAIC,SAAA,GAAYH,KAAA;EAChB,IAAIC,GAAA,KAAQG,SAAA,EAAW;IACrB,IAAIF,GAAA,KAAQE,SAAA,IAAaH,GAAA,GAAMC,GAAA,EAAK;MAClC,MAAMG,KAAA,GAAQ,IAAIC,KAAA;MAClB,IAAIC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;QACAC,OAAA,CAAQL,KAAK,CACX,CACG,gBAAeJ,GAAI,kCAAiCC,GAAI,IAAG,EAC5D,8CACC,oBAAmBF,KAAM,IAAG,EAC7BK,KAAA,CAAMM,KAAK,CACZ,CAACC,IAAI;MAEV;MACA,OAAOZ,KAAA;IACT;IAEAG,SAAA,GAAYU,IAAA,CAAKX,GAAG,CAACD,GAAA,EAAKE,SAAA;EAC5B;EAEA,IAAID,GAAA,KAAQE,SAAA,EAAW;IACrBD,SAAA,GAAYU,IAAA,CAAKZ,GAAG,CAACC,GAAA,EAAKC,SAAA;EAC5B;EAEA,OAAOA,SAAA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"names":["getBound","value","min","max","undefined"],"sources":["../src/packages/react-components/react-spinbutton/src/utils/getBound.ts"],"sourcesContent":["import type { SpinButtonBounds } from '../SpinButton';\n\nexport const getBound = (value: number, min?: number, max?: number): SpinButtonBounds => {\n if (min !== undefined && value === min) {\n if (max === min) {\n return 'both';\n }\n return 'min';\n } else if (max !== undefined && value === max) {\n return 'max';\n }\n\n return 'none';\n};\n"],"mappings":"AAEA,OAAO,MAAMA,QAAQ,GAAGA,CAACC,KAAa,EAAEC,GAAY,EAAEC,GAAY,KAAsB;EACtF,IAAID,GAAG,KAAKE,SAAS,IAAIH,KAAK,KAAKC,GAAG,EAAE;IACtC,IAAIC,GAAG,KAAKD,GAAG,EAAE;MACf,OAAO,MAAM;;IAEf,OAAO,KAAK;GACb,MAAM,IAAIC,GAAG,KAAKC,SAAS,IAAIH,KAAK,KAAKE,GAAG,EAAE;IAC7C,OAAO,KAAK;;EAGd,OAAO,MAAM;AACf,CAAC"}
1
+ {"version":3,"names":["getBound","value","min","max","undefined"],"sources":["../../src/utils/getBound.ts"],"sourcesContent":["import type { SpinButtonBounds } from '../SpinButton';\n\nexport const getBound = (value: number, min?: number, max?: number): SpinButtonBounds => {\n if (min !== undefined && value === min) {\n if (max === min) {\n return 'both';\n }\n return 'min';\n } else if (max !== undefined && value === max) {\n return 'max';\n }\n\n return 'none';\n};\n"],"mappings":"AAEA,OAAO,MAAMA,QAAA,GAAWA,CAACC,KAAA,EAAeC,GAAA,EAAcC,GAAA,KAAmC;EACvF,IAAID,GAAA,KAAQE,SAAA,IAAaH,KAAA,KAAUC,GAAA,EAAK;IACtC,IAAIC,GAAA,KAAQD,GAAA,EAAK;MACf,OAAO;IACT;IACA,OAAO;EACT,OAAO,IAAIC,GAAA,KAAQC,SAAA,IAAaH,KAAA,KAAUE,GAAA,EAAK;IAC7C,OAAO;EACT;EAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-spinbutton/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC","sourcesContent":["export * from './clamp';\nexport * from './getBound';\nexport * from './precision';\n"]}
1
+ {"version":3,"names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './getBound';\nexport * from './precision';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -4,14 +4,13 @@
4
4
  * precision. Otherwise, it calculates the number of digits after
5
5
  * the decimal point indicated by a positive precision.
6
6
  * @param value - the value to determine the precision of
7
- */
8
- export function calculatePrecision(value) {
7
+ */export function calculatePrecision(value) {
9
8
  /**
10
- * Group 1:
11
- * [1-9]([0]+$) matches trailing zeros
12
- * Group 2:
13
- * \.([0-9]*) matches all digits after a decimal point.
14
- */
9
+ * Group 1:
10
+ * [1-9]([0]+$) matches trailing zeros
11
+ * Group 2:
12
+ * \.([0-9]*) matches all digits after a decimal point.
13
+ */
15
14
  const groups = /[1-9]([0]+$)|\.([0-9]*)/.exec(String(value));
16
15
  if (!groups) {
17
16
  return 0;
@@ -1 +1 @@
1
- {"version":3,"names":["calculatePrecision","value","groups","exec","String","length","precisionRound","precision","base","exp","Math","pow","round"],"sources":["../src/packages/react-components/react-spinbutton/src/utils/precision.ts"],"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 */\nexport function calculatePrecision(value: number | string): number {\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 */\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/**\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 */\nexport function precisionRound(value: number, precision: number, base: number = 10): number {\n const exp = Math.pow(base, precision);\n return Math.round(value * exp) / exp;\n}\n"],"mappings":"AAAA;;;;;;;AAOA,OAAM,SAAUA,kBAAkBA,CAACC,KAAsB;EACvD;;;;;;EAMA,MAAMC,MAAM,GAAG,yBAAyB,CAACC,IAAI,CAACC,MAAM,CAACH,KAAK,CAAC,CAAC;EAC5D,IAAI,CAACC,MAAM,EAAE;IACX,OAAO,CAAC;;EAEV,IAAIA,MAAM,CAAC,CAAC,CAAC,EAAE;IACb,OAAO,CAACA,MAAM,CAAC,CAAC,CAAC,CAACG,MAAM;;EAE1B,IAAIH,MAAM,CAAC,CAAC,CAAC,EAAE;IACb,OAAOA,MAAM,CAAC,CAAC,CAAC,CAACG,MAAM;;EAEzB,OAAO,CAAC;AACV;AAEA;;;;;AAKA,OAAM,SAAUC,cAAcA,CAACL,KAAa,EAAEM,SAAiB,EAAEC,IAAA,GAAe,EAAE;EAChF,MAAMC,GAAG,GAAGC,IAAI,CAACC,GAAG,CAACH,IAAI,EAAED,SAAS,CAAC;EACrC,OAAOG,IAAI,CAACE,KAAK,CAACX,KAAK,GAAGQ,GAAG,CAAC,GAAGA,GAAG;AACtC"}
1
+ {"version":3,"names":["calculatePrecision","value","groups","exec","String","length","precisionRound","precision","base","exp","Math","pow","round"],"sources":["../../src/utils/precision.ts"],"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 */\nexport function calculatePrecision(value: number | string): number {\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 */\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/**\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 */\nexport function precisionRound(value: number, precision: number, base: number = 10): number {\n const exp = Math.pow(base, precision);\n return Math.round(value * exp) / exp;\n}\n"],"mappings":"AAAA;;;;;;GAOA,OAAO,SAASA,mBAAmBC,KAAsB,EAAU;EACjE;;;;;;EAMA,MAAMC,MAAA,GAAS,0BAA0BC,IAAI,CAACC,MAAA,CAAOH,KAAA;EACrD,IAAI,CAACC,MAAA,EAAQ;IACX,OAAO;EACT;EACA,IAAIA,MAAM,CAAC,EAAE,EAAE;IACb,OAAO,CAACA,MAAM,CAAC,EAAE,CAACG,MAAM;EAC1B;EACA,IAAIH,MAAM,CAAC,EAAE,EAAE;IACb,OAAOA,MAAM,CAAC,EAAE,CAACG,MAAM;EACzB;EACA,OAAO;AACT;AAEA;;;;;AAKA,OAAO,SAASC,eAAeL,KAAa,EAAEM,SAAiB,EAAEC,IAAA,GAAe,EAAE,EAAU;EAC1F,MAAMC,GAAA,GAAMC,IAAA,CAAKC,GAAG,CAACH,IAAA,EAAMD,SAAA;EAC3B,OAAOG,IAAA,CAAKE,KAAK,CAACX,KAAA,GAAQQ,GAAA,IAAOA,GAAA;AACnC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/SpinButton/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/SpinButton/index"), exports);
7
+ //# sourceMappingURL=SpinButton.js.map
8
+
8
9
  //# sourceMappingURL=SpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-spinbutton/src/SpinButton.ts"],"sourcesContent":["export * from './components/SpinButton/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/SpinButton.js"],"sourcesContent":["export * from './components/SpinButton/index';\n//# sourceMappingURL=SpinButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/SpinButtonField/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/SpinButtonField/index"), exports);
7
+ //# sourceMappingURL=SpinButtonField.js.map
8
+
8
9
  //# sourceMappingURL=SpinButtonField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-spinbutton/src/SpinButtonField.ts"],"sourcesContent":["export * from './components/SpinButtonField/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,wCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/SpinButtonField.js"],"sourcesContent":["export * from './components/SpinButtonField/index';\n//# sourceMappingURL=SpinButtonField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,2CAA2C"}
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "SpinButton", {
6
+ enumerable: true,
7
+ get: ()=>SpinButton
5
8
  });
6
- exports.SpinButton = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const useSpinButton_1 = /*#__PURE__*/require("./useSpinButton");
9
- const renderSpinButton_1 = /*#__PURE__*/require("./renderSpinButton");
10
- const useSpinButtonStyles_1 = /*#__PURE__*/require("./useSpinButtonStyles");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- /**
13
- * A SpinButton allows someone to incrementally adjust a value in small steps.
14
- */
15
- exports.SpinButton = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = useSpinButton_1.useSpinButton_unstable(props, ref);
17
- useSpinButtonStyles_1.useSpinButtonStyles_unstable(state);
18
- const {
19
- useSpinButtonStyles_unstable: useCustomStyles
20
- } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
- useCustomStyles(state);
22
- return renderSpinButton_1.renderSpinButton_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useSpinButton = require("./useSpinButton");
12
+ const _renderSpinButton = require("./renderSpinButton");
13
+ const _useSpinButtonStyles = require("./useSpinButtonStyles");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const SpinButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
+ const state = (0, _useSpinButton.useSpinButton_unstable)(props, ref);
17
+ (0, _useSpinButtonStyles.useSpinButtonStyles_unstable)(state);
18
+ const { useSpinButtonStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
19
+ useCustomStyles(state);
20
+ return (0, _renderSpinButton.renderSpinButton_unstable)(state);
23
21
  });
24
- exports.SpinButton.displayName = 'SpinButton';
22
+ SpinButton.displayName = 'SpinButton'; //# sourceMappingURL=SpinButton.js.map
23
+
25
24
  //# sourceMappingURL=SpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","useSpinButton_1","renderSpinButton_1","useSpinButtonStyles_1","react_shared_contexts_1","exports","SpinButton","forwardRef","props","ref","state","useSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderSpinButton_unstable","displayName"],"sources":["../src/packages/react-components/react-spinbutton/src/components/SpinButton/SpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinButton_unstable } from './useSpinButton';\nimport { renderSpinButton_unstable } from './renderSpinButton';\nimport { useSpinButtonStyles_unstable } from './useSpinButtonStyles';\nimport type { SpinButtonProps } from './SpinButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A SpinButton allows someone to incrementally adjust a value in small steps.\n */\nexport const SpinButton: ForwardRefComponent<SpinButtonProps> = React.forwardRef((props, ref) => {\n const state = useSpinButton_unstable(props, ref);\n\n useSpinButtonStyles_unstable(state);\n\n const { useSpinButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderSpinButton_unstable(state);\n});\n\nSpinButton.displayName = 'SpinButton';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,eAAA,gBAAAD,OAAA;AACA,MAAAE,kBAAA,gBAAAF,OAAA;AACA,MAAAG,qBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,UAAU,gBAAyCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGT,eAAA,CAAAU,sBAAsB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEhDN,qBAAA,CAAAS,4BAA4B,CAACF,KAAK,CAAC;EAEnC,MAAM;IAAEE,4BAA4B,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACxFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,kBAAA,CAAAa,yBAAyB,CAACL,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFL,OAAA,CAAAC,UAAU,CAACU,WAAW,GAAG,YAAY"}
1
+ {"version":3,"sources":["../../../lib/components/SpinButton/SpinButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useSpinButton_unstable } from './useSpinButton';\nimport { renderSpinButton_unstable } from './renderSpinButton';\nimport { useSpinButtonStyles_unstable } from './useSpinButtonStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A SpinButton allows someone to incrementally adjust a value in small steps.\n */\nexport const SpinButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useSpinButton_unstable(props, ref);\n useSpinButtonStyles_unstable(state);\n const {\n useSpinButtonStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderSpinButton_unstable(state);\n});\nSpinButton.displayName = 'SpinButton';\n//# sourceMappingURL=SpinButton.js.map"],"names":["SpinButton","React","forwardRef","props","ref","state","useSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderSpinButton_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;+BACgB;kCACG;qCACG;qCACA;AAItC,MAAMA,aAAa,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACtE,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5CG,IAAAA,iDAA4B,EAACF;IAC7B,MAAM,EACJE,8BAA8BC,gBAAe,EAC9C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,2CAAyB,EAACL;AACnC;AACAL,WAAWW,WAAW,GAAG,cACzB,sCAAsC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=SpinButton.types.js.map
8
+
6
9
  //# sourceMappingURL=SpinButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-spinbutton/src/components/SpinButton/SpinButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type SpinButtonSlots = {\n /**\n * The root element of SpinButton is a container `<div>`.\n * The root slot receives the `className` and `style` specified on the `<SpinButton>`.\n * All other native props are applied to the primary slot: `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * Input that displays the current value and accepts direct input from the user.\n * Displayed value is formatted.\n *\n * This is the primary slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * Renders the increment control.\n */\n incrementButton: NonNullable<Slot<'button'>>;\n\n /**\n * Renders the decrement control.\n */\n decrementButton: NonNullable<Slot<'button'>>;\n};\n\n/**\n * SpinButton Props\n */\nexport type SpinButtonProps = Omit<\n ComponentProps<Partial<SpinButtonSlots>, 'input'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Controls the colors and borders of the input.\n * @default 'outline'\n */\n appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';\n\n /**\n * Initial value of the control (assumed to be valid). Updates to this prop will not be respected.\n *\n * Use this if you intend for the SpinButton to be an uncontrolled component which maintains its\n * own value. For a controlled component, use `value` instead. (Mutually exclusive with `value`.)\n *\n * Use `null` to indicate the control has no value.\n */\n defaultValue?: number | null;\n\n /**\n * String representation of `value`.\n *\n * Use this when displaying the value to users as something other than a plain number.\n * For example, when displaying currency values this might be \"$1.00\" when value is `1`.\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events. When SpinButton is used as an\n * uncontrolled component this prop is ignored.\n */\n displayValue?: string;\n\n /**\n * Max value of the control. If not provided, the control has no maximum value.\n */\n max?: number;\n\n /**\n * Min value of the control. If not provided, the control has no minimum value.\n */\n min?: number;\n\n /**\n * Callback for when the committed value changes.\n * - User presses the up/down buttons (on single press or every spin)\n * - User presses the up/down arrow keys (on single press or every spin)\n * - User *commits* edits to the input text by focusing away (blurring) or pressing enter.\n * Note that this is NOT called for every key press while the user is editing.\n */\n onChange?: (event: SpinButtonChangeEvent, data: SpinButtonOnChangeData) => void;\n\n /**\n * How many decimal places the value should be rounded to.\n *\n * The default is calculated based on the precision of `step`: i.e. if step = 1, precision = 0.\n * step = 0.0089, precision = 4. step = 300, precision = 2. step = 23.00, precision = 2.\n */\n precision?: number;\n\n /**\n * Size of the input.\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * Difference between two adjacent values of the control.\n * This value is used to calculate the precision of the input if no `precision` is given.\n * The precision calculated this way will always be greater than or equal 0.\n * @default 1\n */\n step?: number;\n\n /**\n * Large difference between two values. This should be greater than `step` and is used\n * when users hit the Page Up or Page Down keys.\n * @default 1\n */\n stepPage?: number;\n\n /**\n * Current value of the control (assumed to be valid).\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events; otherwise, use the `defaultValue`\n * property.\n *\n * Use `null` to indicate the control has no value.\n *\n * Mutually exclusive with `defaultValue`.\n */\n value?: number | null;\n};\n\n/**\n * State used in rendering SpinButton\n */\nexport type SpinButtonState = ComponentState<SpinButtonSlots> &\n Required<Pick<SpinButtonProps, 'appearance' | 'size'>> & {\n /**\n * State used to track which direction, if any, SpinButton is currently spinning.\n * @default 'rest'\n */\n spinState: SpinButtonSpinState;\n\n /**\n * State used to track if the value is at the range bounds of [min-max].\n * @default 'none'\n */\n atBound: SpinButtonBounds;\n };\n\nexport type SpinButtonChangeEvent =\n | React.MouseEvent<HTMLButtonElement>\n | React.ChangeEvent<HTMLElement>\n | React.FocusEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>;\n\nexport type SpinButtonOnChangeData = {\n value?: number | null;\n displayValue?: string;\n};\n\nexport type SpinButtonSpinState = 'rest' | 'up' | 'down';\nexport type SpinButtonBounds = 'none' | 'min' | 'max' | 'both';\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/SpinButton/SpinButton.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=SpinButton.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,4CAA4C"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./SpinButton"), exports);
8
- tslib_1.__exportStar(require("./SpinButton.types"), exports);
9
- tslib_1.__exportStar(require("./renderSpinButton"), exports);
10
- tslib_1.__exportStar(require("./useSpinButton"), exports);
11
- tslib_1.__exportStar(require("./useSpinButtonStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./SpinButton"), exports);
7
+ _exportStar(require("./SpinButton.types"), exports);
8
+ _exportStar(require("./renderSpinButton"), exports);
9
+ _exportStar(require("./useSpinButton"), exports);
10
+ _exportStar(require("./useSpinButtonStyles"), exports);
11
+ //# sourceMappingURL=index.js.map
12
+
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-spinbutton/src/components/SpinButton/index.ts"],"sourcesContent":["export * from './SpinButton';\nexport * from './SpinButton.types';\nexport * from './renderSpinButton';\nexport * from './useSpinButton';\nexport * from './useSpinButtonStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,kBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,wBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,wBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,2BAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/SpinButton/index.js"],"sourcesContent":["export * from './SpinButton';\nexport * from './SpinButton.types';\nexport * from './renderSpinButton';\nexport * from './useSpinButton';\nexport * from './useSpinButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,28 +1,17 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderSpinButton_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderSpinButton_unstable
5
8
  });
6
- exports.renderSpinButton_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Render the final JSX of SpinButton
11
- */
12
- const renderSpinButton_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, {
18
- ...slotProps.root
19
- }, React.createElement(slots.input, {
20
- ...slotProps.input
21
- }), React.createElement(slots.incrementButton, {
22
- ...slotProps.incrementButton
23
- }), React.createElement(slots.decrementButton, {
24
- ...slotProps.decrementButton
25
- }));
26
- };
27
- exports.renderSpinButton_unstable = renderSpinButton_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const renderSpinButton_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, /*#__PURE__*/ _react.createElement(slots.input, slotProps.input), /*#__PURE__*/ _react.createElement(slots.incrementButton, slotProps.incrementButton), /*#__PURE__*/ _react.createElement(slots.decrementButton, slotProps.decrementButton));
15
+ }; //# sourceMappingURL=renderSpinButton.js.map
16
+
28
17
  //# sourceMappingURL=renderSpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderSpinButton_unstable","state","slots","slotProps","getSlots","createElement","root","input","incrementButton","decrementButton","exports"],"sources":["../src/packages/react-components/react-spinbutton/src/components/SpinButton/renderSpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SpinButtonState, SpinButtonSlots } from './SpinButton.types';\n\n/**\n * Render the final JSX of SpinButton\n */\nexport const renderSpinButton_unstable = (state: SpinButtonState) => {\n const { slots, slotProps } = getSlots<SpinButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.incrementButton {...slotProps.incrementButton} />\n <slots.decrementButton {...slotProps.decrementButton} />\n </slots.root>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAkBH,KAAK,CAAC;EAE7D,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BT,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,KAAK;IAAA,GAAKJ,SAAS,CAACI;EAAK,EAAI,EACpCV,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACM,eAAe;IAAA,GAAKL,SAAS,CAACK;EAAe,EAAI,EACxDX,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACO,eAAe;IAAA,GAAKN,SAAS,CAACM;EAAe,EAAI,CAC7C;AAEjB,CAAC;AAVYC,OAAA,CAAAV,yBAAyB,GAAAA,yBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/SpinButton/renderSpinButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of SpinButton\n */\nexport const renderSpinButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), /*#__PURE__*/React.createElement(slots.incrementButton, slotProps.incrementButton), /*#__PURE__*/React.createElement(slots.decrementButton, slotProps.decrementButton));\n};\n//# sourceMappingURL=renderSpinButton.js.map"],"names":["renderSpinButton_unstable","state","slots","slotProps","getSlots","React","createElement","root","input","incrementButton","decrementButton"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,4BAA4BC,CAAAA,QAAS;IAChD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACJ,MAAMM,KAAK,EAAEL,UAAUK,KAAK,GAAG,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMO,eAAe,EAAEN,UAAUM,eAAe,GAAG,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMQ,eAAe,EAAEP,UAAUO,eAAe;AAC3S,GACA,4CAA4C"}