@fluentui/react-select 9.1.4 → 9.1.6

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.
Files changed (63) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +79 -1
  3. package/CHANGELOG.md +28 -2
  4. package/lib/Select.js.map +1 -1
  5. package/lib/SelectField.js.map +1 -1
  6. package/lib/components/Select/Select.js.map +1 -1
  7. package/lib/components/Select/Select.types.js +1 -1
  8. package/lib/components/Select/Select.types.js.map +1 -1
  9. package/lib/components/Select/index.js.map +1 -1
  10. package/lib/components/Select/renderSelect.js +1 -7
  11. package/lib/components/Select/renderSelect.js.map +1 -1
  12. package/lib/components/Select/useSelect.js +2 -2
  13. package/lib/components/Select/useSelect.js.map +1 -1
  14. package/lib/components/Select/useSelectStyles.js.map +1 -1
  15. package/lib/components/SelectField/SelectField.js +1 -2
  16. package/lib/components/SelectField/SelectField.js.map +1 -1
  17. package/lib/components/SelectField/index.js.map +1 -1
  18. package/lib/index.js.map +1 -1
  19. package/lib-commonjs/Select.js +5 -4
  20. package/lib-commonjs/Select.js.map +1 -1
  21. package/lib-commonjs/SelectField.js +5 -4
  22. package/lib-commonjs/SelectField.js.map +1 -1
  23. package/lib-commonjs/components/Select/Select.js +19 -20
  24. package/lib-commonjs/components/Select/Select.js.map +1 -1
  25. package/lib-commonjs/components/Select/Select.types.js +5 -2
  26. package/lib-commonjs/components/Select/Select.types.js.map +1 -1
  27. package/lib-commonjs/components/Select/index.js +9 -8
  28. package/lib-commonjs/components/Select/index.js.map +1 -1
  29. package/lib-commonjs/components/Select/renderSelect.js +13 -22
  30. package/lib-commonjs/components/Select/renderSelect.js.map +1 -1
  31. package/lib-commonjs/components/Select/useSelect.js +60 -69
  32. package/lib-commonjs/components/Select/useSelect.js.map +1 -1
  33. package/lib-commonjs/components/Select/useSelectStyles.js +589 -272
  34. package/lib-commonjs/components/Select/useSelectStyles.js.map +1 -1
  35. package/lib-commonjs/components/SelectField/SelectField.js +17 -11
  36. package/lib-commonjs/components/SelectField/SelectField.js.map +1 -1
  37. package/lib-commonjs/components/SelectField/index.js +5 -4
  38. package/lib-commonjs/components/SelectField/index.js.map +1 -1
  39. package/lib-commonjs/index.js +21 -49
  40. package/lib-commonjs/index.js.map +1 -1
  41. package/package.json +10 -9
  42. package/lib-amd/Select.js +0 -6
  43. package/lib-amd/Select.js.map +0 -1
  44. package/lib-amd/SelectField.js +0 -6
  45. package/lib-amd/SelectField.js.map +0 -1
  46. package/lib-amd/components/Select/Select.js +0 -17
  47. package/lib-amd/components/Select/Select.js.map +0 -1
  48. package/lib-amd/components/Select/Select.types.js +0 -5
  49. package/lib-amd/components/Select/Select.types.js.map +0 -1
  50. package/lib-amd/components/Select/index.js +0 -10
  51. package/lib-amd/components/Select/index.js.map +0 -1
  52. package/lib-amd/components/Select/renderSelect.js +0 -16
  53. package/lib-amd/components/Select/renderSelect.js.map +0 -1
  54. package/lib-amd/components/Select/useSelect.js +0 -51
  55. package/lib-amd/components/Select/useSelect.js.map +0 -1
  56. package/lib-amd/components/Select/useSelectStyles.js +0 -154
  57. package/lib-amd/components/Select/useSelectStyles.js.map +0 -1
  58. package/lib-amd/components/SelectField/SelectField.js +0 -10
  59. package/lib-amd/components/SelectField/SelectField.js.map +0 -1
  60. package/lib-amd/components/SelectField/index.js +0 -6
  61. package/lib-amd/components/SelectField/index.js.map +0 -1
  62. package/lib-amd/index.js +0 -13
  63. package/lib-amd/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderSelect_unstable","state","slots","slotProps","getSlots","createElement","root","select","children","icon","exports"],"sources":["../src/packages/react-components/react-select/src/components/Select/renderSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\n/**\n * Render the final JSX of Select\n */\nexport const renderSelect_unstable = (state: SelectState) => {\n const { slots, slotProps } = getSlots<SelectSlots>(state);\n return (\n <slots.root {...slotProps.root}>\n <slots.select {...slotProps.select}>{slotProps.select.children}</slots.select>\n <slots.icon {...slotProps.icon} />\n </slots.root>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,qBAAqB,GAAIC,KAAkB,IAAI;EAC1D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAcH,KAAK,CAAC;EACzD,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BT,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,GAAGJ,SAAS,CAACI,MAAM,CAACC,QAAQ,CAAgB,EAC9EX,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACO,IAAI;IAAA,GAAKN,SAAS,CAACM;EAAI,EAAI,CACvB;AAEjB,CAAC;AARYC,OAAA,CAAAV,qBAAqB,GAAAA,qBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Select/renderSelect.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Select\n */\nexport const renderSelect_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.select, slotProps.select, slotProps.select.children), /*#__PURE__*/React.createElement(slots.icon, slotProps.icon));\n};\n//# sourceMappingURL=renderSelect.js.map"],"names":["renderSelect_unstable","state","slots","slotProps","getSlots","React","createElement","root","select","children","icon"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,wBAAwBC,CAAAA,QAAS;IAC5C,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,MAAM,EAAEL,UAAUK,MAAM,EAAEL,UAAUK,MAAM,CAACC,QAAQ,GAAG,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMQ,IAAI,EAAEP,UAAUO,IAAI;AAC9N,GACA,wCAAwC"}
@@ -1,74 +1,65 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useSelect_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useSelect_unstable
5
8
  });
6
- exports.useSelect_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
10
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
11
- /**
12
- * Create the state required to render Select.
13
- *
14
- * The returned state can be modified with hooks such as useSelectStyles,
15
- * before being passed to renderSelect.
16
- *
17
- * @param props - props from this instance of Select
18
- * @param ref - reference to the `<select>` element in Select
19
- */
20
- const useSelect_unstable = (props, ref) => {
21
- var _a;
22
- const overrides = react_shared_contexts_1.useOverrides_unstable();
23
- const {
24
- defaultValue,
25
- value,
26
- select,
27
- icon,
28
- root,
29
- appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
30
- onChange,
31
- size = 'medium'
32
- } = props;
33
- const nativeProps = react_utilities_1.getPartitionedNativeProps({
34
- props,
35
- primarySlotTagName: 'select',
36
- excludedPropNames: ['appearance', 'defaultValue', 'onChange', 'size', 'value']
37
- });
38
- const state = {
39
- size,
40
- appearance,
41
- components: {
42
- root: 'span',
43
- select: 'select',
44
- icon: 'span'
45
- },
46
- select: react_utilities_1.resolveShorthand(select, {
47
- required: true,
48
- defaultProps: {
49
- defaultValue,
50
- value,
51
- ref,
52
- ...nativeProps.primary
53
- }
54
- }),
55
- icon: react_utilities_1.resolveShorthand(icon, {
56
- required: true,
57
- defaultProps: {
58
- children: React.createElement(react_icons_1.ChevronDownRegular, null)
59
- }
60
- }),
61
- root: react_utilities_1.resolveShorthand(root, {
62
- required: true,
63
- defaultProps: nativeProps.root
64
- })
65
- };
66
- state.select.onChange = react_utilities_1.useEventCallback(event => {
67
- onChange === null || onChange === void 0 ? void 0 : onChange(event, {
68
- value: event.target.value
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 _reactIcons = require("@fluentui/react-icons");
13
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
14
+ const useSelect_unstable = (props, ref)=>{
15
+ const overrides = (0, _reactSharedContexts.useOverrides_unstable)();
16
+ var _overrides_inputDefaultAppearance;
17
+ const { defaultValue , value , select , icon , root , appearance =(_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline' , onChange , size ='medium' } = props;
18
+ const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
19
+ props,
20
+ primarySlotTagName: 'select',
21
+ excludedPropNames: [
22
+ 'appearance',
23
+ 'defaultValue',
24
+ 'onChange',
25
+ 'size',
26
+ 'value'
27
+ ]
69
28
  });
70
- });
71
- return state;
72
- };
73
- exports.useSelect_unstable = useSelect_unstable;
29
+ const state = {
30
+ size,
31
+ appearance,
32
+ components: {
33
+ root: 'span',
34
+ select: 'select',
35
+ icon: 'span'
36
+ },
37
+ select: (0, _reactUtilities.resolveShorthand)(select, {
38
+ required: true,
39
+ defaultProps: {
40
+ defaultValue,
41
+ value,
42
+ ref,
43
+ ...nativeProps.primary
44
+ }
45
+ }),
46
+ icon: (0, _reactUtilities.resolveShorthand)(icon, {
47
+ required: true,
48
+ defaultProps: {
49
+ children: /*#__PURE__*/ _react.createElement(_reactIcons.ChevronDownRegular, null)
50
+ }
51
+ }),
52
+ root: (0, _reactUtilities.resolveShorthand)(root, {
53
+ required: true,
54
+ defaultProps: nativeProps.root
55
+ })
56
+ };
57
+ state.select.onChange = (0, _reactUtilities.useEventCallback)((event)=>{
58
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, {
59
+ value: event.target.value
60
+ });
61
+ });
62
+ return state;
63
+ }; //# sourceMappingURL=useSelect.js.map
64
+
74
65
  //# sourceMappingURL=useSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","react_icons_1","react_shared_contexts_1","useSelect_unstable","props","ref","overrides","useOverrides_unstable","defaultValue","value","select","icon","root","appearance","_a","inputDefaultAppearance","onChange","size","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","state","components","resolveShorthand","required","defaultProps","primary","children","createElement","ChevronDownRegular","useEventCallback","event","target","exports"],"sources":["../src/packages/react-components/react-select/src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport type { SelectProps, SelectState } from './Select.types';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Select.\n *\n * The returned state can be modified with hooks such as useSelectStyles,\n * before being passed to renderSelect.\n *\n * @param props - props from this instance of Select\n * @param ref - reference to the `<select>` element in Select\n */\nexport const useSelect_unstable = (props: SelectProps, ref: React.Ref<HTMLSelectElement>): SelectState => {\n const overrides = useOverrides();\n\n const {\n defaultValue,\n value,\n select,\n icon,\n root,\n appearance = overrides.inputDefaultAppearance ?? 'outline',\n\n onChange,\n size = 'medium',\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'select',\n excludedPropNames: ['appearance', 'defaultValue', 'onChange', 'size', 'value'],\n });\n\n const state: SelectState = {\n size,\n appearance,\n components: {\n root: 'span',\n select: 'select',\n icon: 'span',\n },\n select: resolveShorthand(select, {\n required: true,\n defaultProps: {\n defaultValue,\n value,\n ref,\n ...nativeProps.primary,\n },\n }),\n icon: resolveShorthand(icon, {\n required: true,\n defaultProps: { children: <ChevronDownRegular /> },\n }),\n root: resolveShorthand(root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n\n state.select.onChange = useEventCallback(event => {\n onChange?.(event, { value: (event.target as HTMLSelectElement).value });\n });\n\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,aAAA,gBAAAF,OAAA;AAEA,MAAAG,uBAAA,gBAAAH,OAAA;AAEA;;;;;;;;;AASO,MAAMI,kBAAkB,GAAGA,CAACC,KAAkB,EAAEC,GAAiC,KAAiB;;EACvG,MAAMC,SAAS,GAAGJ,uBAAA,CAAAK,qBAAY,EAAE;EAEhC,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,MAAM;IACNC,IAAI;IACJC,IAAI;IACJC,UAAU,GAAG,CAAAC,EAAA,GAAAR,SAAS,CAACS,sBAAsB,cAAAD,EAAA,cAAAA,EAAA,GAAI,SAAS;IAE1DE,QAAQ;IACRC,IAAI,GAAG;EAAQ,CAChB,GAAGb,KAAK;EAET,MAAMc,WAAW,GAAGlB,iBAAA,CAAAmB,yBAAyB,CAAC;IAC5Cf,KAAK;IACLgB,kBAAkB,EAAE,QAAQ;IAC5BC,iBAAiB,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO;GAC9E,CAAC;EAEF,MAAMC,KAAK,GAAgB;IACzBL,IAAI;IACJJ,UAAU;IACVU,UAAU,EAAE;MACVX,IAAI,EAAE,MAAM;MACZF,MAAM,EAAE,QAAQ;MAChBC,IAAI,EAAE;KACP;IACDD,MAAM,EAAEV,iBAAA,CAAAwB,gBAAgB,CAACd,MAAM,EAAE;MAC/Be,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZlB,YAAY;QACZC,KAAK;QACLJ,GAAG;QACH,GAAGa,WAAW,CAACS;;KAElB,CAAC;IACFhB,IAAI,EAAEX,iBAAA,CAAAwB,gBAAgB,CAACb,IAAI,EAAE;MAC3Bc,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QAAEE,QAAQ,EAAE9B,KAAA,CAAA+B,aAAA,CAAC5B,aAAA,CAAA6B,kBAAkB;MAAG;KACjD,CAAC;IACFlB,IAAI,EAAEZ,iBAAA,CAAAwB,gBAAgB,CAACZ,IAAI,EAAE;MAC3Ba,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAER,WAAW,CAACN;KAC3B;GACF;EAEDU,KAAK,CAACZ,MAAM,CAACM,QAAQ,GAAGhB,iBAAA,CAAA+B,gBAAgB,CAACC,KAAK,IAAG;IAC/ChB,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGgB,KAAK,EAAE;MAAEvB,KAAK,EAAGuB,KAAK,CAACC,MAA4B,CAACxB;IAAK,CAAE,CAAC;EACzE,CAAC,CAAC;EAEF,OAAOa,KAAK;AACd,CAAC;AArDYY,OAAA,CAAA/B,kBAAkB,GAAAA,kBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Select/useSelect.js"],"sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';\n/**\n * Create the state required to render Select.\n *\n * The returned state can be modified with hooks such as useSelectStyles,\n * before being passed to renderSelect.\n *\n * @param props - props from this instance of Select\n * @param ref - reference to the `<select>` element in Select\n */\nexport const useSelect_unstable = (props, ref) => {\n const overrides = useOverrides();\n var _overrides_inputDefaultAppearance;\n const {\n defaultValue,\n value,\n select,\n icon,\n root,\n appearance = (_overrides_inputDefaultAppearance = overrides.inputDefaultAppearance) !== null && _overrides_inputDefaultAppearance !== void 0 ? _overrides_inputDefaultAppearance : 'outline',\n onChange,\n size = 'medium'\n } = props;\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'select',\n excludedPropNames: ['appearance', 'defaultValue', 'onChange', 'size', 'value']\n });\n const state = {\n size,\n appearance,\n components: {\n root: 'span',\n select: 'select',\n icon: 'span'\n },\n select: resolveShorthand(select, {\n required: true,\n defaultProps: {\n defaultValue,\n value,\n ref,\n ...nativeProps.primary\n }\n }),\n icon: resolveShorthand(icon, {\n required: true,\n defaultProps: {\n children: /*#__PURE__*/React.createElement(ChevronDownRegular, null)\n }\n }),\n root: resolveShorthand(root, {\n required: true,\n defaultProps: nativeProps.root\n })\n };\n state.select.onChange = useEventCallback(event => {\n onChange === null || onChange === void 0 ? void 0 : onChange(event, {\n value: event.target.value\n });\n });\n return state;\n};\n//# sourceMappingURL=useSelect.js.map"],"names":["useSelect_unstable","props","ref","overrides","useOverrides","_overrides_inputDefaultAppearance","defaultValue","value","select","icon","root","appearance","inputDefaultAppearance","onChange","size","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","state","components","resolveShorthand","required","defaultProps","primary","children","React","createElement","ChevronDownRegular","useEventCallback","event","target"],"mappings":";;;;+BAaaA;;aAAAA;;;6DAbU;gCACuD;4BAC3C;qCACmB;AAU/C,MAAMA,qBAAqB,CAACC,OAAOC,MAAQ;IAChD,MAAMC,YAAYC,IAAAA,0CAAY;IAC9B,IAAIC;IACJ,MAAM,EACJC,aAAY,EACZC,MAAK,EACLC,OAAM,EACNC,KAAI,EACJC,KAAI,EACJC,YAAa,AAACN,CAAAA,oCAAoCF,UAAUS,sBAAsB,AAAD,MAAO,IAAI,IAAIP,sCAAsC,KAAK,IAAIA,oCAAoC,SAAS,CAAA,EAC5LQ,SAAQ,EACRC,MAAO,SAAQ,EAChB,GAAGb;IACJ,MAAMc,cAAcC,IAAAA,yCAAyB,EAAC;QAC5Cf;QACAgB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAc;YAAgB;YAAY;YAAQ;SAAQ;IAChF;IACA,MAAMC,QAAQ;QACZL;QACAH;QACAS,YAAY;YACVV,MAAM;YACNF,QAAQ;YACRC,MAAM;QACR;QACAD,QAAQa,IAAAA,gCAAgB,EAACb,QAAQ;YAC/Bc,UAAU,IAAI;YACdC,cAAc;gBACZjB;gBACAC;gBACAL;gBACA,GAAGa,YAAYS,OAAO;YACxB;QACF;QACAf,MAAMY,IAAAA,gCAAgB,EAACZ,MAAM;YAC3Ba,UAAU,IAAI;YACdC,cAAc;gBACZE,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,8BAAkB,EAAE,IAAI;YACrE;QACF;QACAlB,MAAMW,IAAAA,gCAAgB,EAACX,MAAM;YAC3BY,UAAU,IAAI;YACdC,cAAcR,YAAYL,IAAI;QAChC;IACF;IACAS,MAAMX,MAAM,CAACK,QAAQ,GAAGgB,IAAAA,gCAAgB,EAACC,CAAAA,QAAS;QAChDjB,aAAa,IAAI,IAAIA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASiB,OAAO;YAClEvB,OAAOuB,MAAMC,MAAM,CAACxB,KAAK;QAC3B,EAAE;IACJ;IACA,OAAOY;AACT,GACA,qCAAqC"}