@fluentui/react-combobox 9.13.12 → 9.13.13
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/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-combobox
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 06 Dec 2024 12:49:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.13.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-combobox_v9.13.13)
|
|
8
|
+
|
|
9
|
+
Fri, 06 Dec 2024 12:49:19 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-combobox_v9.13.12..@fluentui/react-combobox_v9.13.13)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-aria to v9.13.10 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
15
|
+
- Bump @fluentui/react-context-selector to v9.1.70 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
16
|
+
- Bump @fluentui/react-field to v9.1.81 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
17
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.47 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
18
|
+
- Bump @fluentui/react-portal to v9.4.39 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
19
|
+
- Bump @fluentui/react-positioning to v9.15.13 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
20
|
+
- Bump @fluentui/react-shared-contexts to v9.21.1 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.23.1 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v9.1.23 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v9.18.18 ([PR #33414](https://github.com/microsoft/fluentui/pull/33414) by beachball)
|
|
24
|
+
|
|
7
25
|
## [9.13.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-combobox_v9.13.12)
|
|
8
26
|
|
|
9
|
-
Mon, 18 Nov 2024 09:
|
|
27
|
+
Mon, 18 Nov 2024 09:44:38 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-combobox_v9.13.11..@fluentui/react-combobox_v9.13.12)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { useControllableState } from '@fluentui/react-utilities';
|
|
3
3
|
export const useSelection = (props)=>{
|
|
4
4
|
const { defaultSelectedOptions, multiselect, onOptionSelect } = props;
|
|
@@ -7,7 +7,7 @@ export const useSelection = (props)=>{
|
|
|
7
7
|
defaultState: defaultSelectedOptions,
|
|
8
8
|
initialState: []
|
|
9
9
|
});
|
|
10
|
-
const selectOption = useCallback((event, option)=>{
|
|
10
|
+
const selectOption = React.useCallback((event, option)=>{
|
|
11
11
|
// if the option is disabled, do nothing
|
|
12
12
|
if (option.disabled) {
|
|
13
13
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useSelection.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/utils/useSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport { OptionValue } from './OptionCollection.types';\nimport { SelectionEvents, SelectionProps, SelectionState } from './Selection.types';\n\nexport const useSelection = (props: SelectionProps): SelectionState => {\n const { defaultSelectedOptions, multiselect, onOptionSelect } = props;\n\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: [],\n });\n\n const selectOption = React.useCallback(\n (event: SelectionEvents, option: OptionValue) => {\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n\n // for single-select, always return the selected option\n let newSelection = [option.value];\n\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex(o => o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [...selectedOptions.slice(0, selectedIndex), ...selectedOptions.slice(selectedIndex + 1)];\n } else {\n // select option\n newSelection = [...selectedOptions, option.value];\n }\n }\n\n setSelectedOptions(newSelection);\n onOptionSelect?.(event, { optionValue: option.value, optionText: option.text, selectedOptions: newSelection });\n },\n [onOptionSelect, multiselect, selectedOptions, setSelectedOptions],\n );\n\n const clearSelection = (event: SelectionEvents) => {\n setSelectedOptions([]);\n onOptionSelect?.(event, { optionValue: undefined, optionText: undefined, selectedOptions: [] });\n };\n\n return { clearSelection, selectOption, selectedOptions };\n};\n"],"names":["React","useControllableState","useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","state","defaultState","initialState","selectOption","useCallback","event","option","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,4BAA4B;AAIjE,OAAO,MAAMC,eAAe,CAACC;IAC3B,MAAM,EAAEC,sBAAsB,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGH;IAEhE,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGP,qBAAqB;QACjEQ,OAAON,MAAMI,eAAe;QAC5BG,cAAcN;QACdO,cAAc,EAAE;IAClB;IAEA,MAAMC,eAAeZ,MAAMa,WAAW,CACpC,CAACC,OAAwBC;QACvB,wCAAwC;QACxC,IAAIA,OAAOC,QAAQ,EAAE;YACnB;QACF;QAEA,uDAAuD;QACvD,IAAIC,eAAe;YAACF,OAAOG,KAAK;SAAC;QAEjC,sDAAsD;QACtD,IAAIb,aAAa;YACf,MAAMc,gBAAgBZ,gBAAgBa,SAAS,CAACC,CAAAA,IAAKA,MAAMN,OAAOG,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACtB,kBAAkB;gBAClBF,eAAe;uBAAIV,gBAAgBe,KAAK,CAAC,GAAGH;uBAAmBZ,gBAAgBe,KAAK,CAACH,gBAAgB;iBAAG;YAC1G,OAAO;gBACL,gBAAgB;gBAChBF,eAAe;uBAAIV;oBAAiBQ,OAAOG,KAAK;iBAAC;YACnD;QACF;QAEAV,mBAAmBS;QACnBX,2BAAAA,qCAAAA,eAAiBQ,OAAO;YAAES,aAAaR,OAAOG,KAAK;YAAEM,YAAYT,OAAOU,IAAI;YAAElB,iBAAiBU;QAAa;IAC9G,GACA;QAACX;QAAgBD;QAAaE;QAAiBC;KAAmB;IAGpE,MAAMkB,iBAAiB,CAACZ;QACtBN,mBAAmB,EAAE;QACrBF,2BAAAA,qCAAAA,eAAiBQ,OAAO;YAAES,aAAaI;YAAWH,YAAYG;YAAWpB,iBAAiB,EAAE;QAAC;IAC/F;IAEA,OAAO;QAAEmB;QAAgBd;QAAcL;IAAgB;AACzD,EAAE"}
|
|
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "useSelection", {
|
|
|
8
8
|
return useSelection;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
12
13
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
14
|
const useSelection = (props)=>{
|
|
14
15
|
const { defaultSelectedOptions, multiselect, onOptionSelect } = props;
|
|
@@ -17,7 +18,7 @@ const useSelection = (props)=>{
|
|
|
17
18
|
defaultState: defaultSelectedOptions,
|
|
18
19
|
initialState: []
|
|
19
20
|
});
|
|
20
|
-
const selectOption =
|
|
21
|
+
const selectOption = _react.useCallback((event, option)=>{
|
|
21
22
|
// if the option is disabled, do nothing
|
|
22
23
|
if (option.disabled) {
|
|
23
24
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useSelection.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/utils/useSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport { OptionValue } from './OptionCollection.types';\nimport { SelectionEvents, SelectionProps, SelectionState } from './Selection.types';\n\nexport const useSelection = (props: SelectionProps): SelectionState => {\n const { defaultSelectedOptions, multiselect, onOptionSelect } = props;\n\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: [],\n });\n\n const selectOption = React.useCallback(\n (event: SelectionEvents, option: OptionValue) => {\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n\n // for single-select, always return the selected option\n let newSelection = [option.value];\n\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex(o => o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [...selectedOptions.slice(0, selectedIndex), ...selectedOptions.slice(selectedIndex + 1)];\n } else {\n // select option\n newSelection = [...selectedOptions, option.value];\n }\n }\n\n setSelectedOptions(newSelection);\n onOptionSelect?.(event, { optionValue: option.value, optionText: option.text, selectedOptions: newSelection });\n },\n [onOptionSelect, multiselect, selectedOptions, setSelectedOptions],\n );\n\n const clearSelection = (event: SelectionEvents) => {\n setSelectedOptions([]);\n onOptionSelect?.(event, { optionValue: undefined, optionText: undefined, selectedOptions: [] });\n };\n\n return { clearSelection, selectOption, selectedOptions };\n};\n"],"names":["useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","useControllableState","state","defaultState","initialState","selectOption","React","useCallback","event","option","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;gCACc;AAI9B,MAAMA,eAAe,CAACC;IAC3B,MAAM,EAAEC,sBAAsB,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGH;IAEhE,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGC,IAAAA,oCAAAA,EAAqB;QACjEC,OAAOP,MAAMI,eAAe;QAC5BI,cAAcP;QACdQ,cAAc,EAAE;IAClB;IAEA,MAAMC,eAAeC,OAAMC,WAAW,CACpC,CAACC,OAAwBC;QACvB,wCAAwC;QACxC,IAAIA,OAAOC,QAAQ,EAAE;YACnB;QACF;QAEA,uDAAuD;QACvD,IAAIC,eAAe;YAACF,OAAOG,KAAK;SAAC;QAEjC,sDAAsD;QACtD,IAAIf,aAAa;YACf,MAAMgB,gBAAgBd,gBAAgBe,SAAS,CAACC,CAAAA,IAAKA,MAAMN,OAAOG,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACtB,kBAAkB;gBAClBF,eAAe;uBAAIZ,gBAAgBiB,KAAK,CAAC,GAAGH;uBAAmBd,gBAAgBiB,KAAK,CAACH,gBAAgB;iBAAG;YAC1G,OAAO;gBACL,gBAAgB;gBAChBF,eAAe;uBAAIZ;oBAAiBU,OAAOG,KAAK;iBAAC;YACnD;QACF;QAEAZ,mBAAmBW;QACnBb,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAiBU,OAAO;YAAES,aAAaR,OAAOG,KAAK;YAAEM,YAAYT,OAAOU,IAAI;YAAEpB,iBAAiBY;QAAa;IAC9G,GACA;QAACb;QAAgBD;QAAaE;QAAiBC;KAAmB;IAGpE,MAAMoB,iBAAiB,CAACZ;QACtBR,mBAAmB,EAAE;QACrBF,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAiBU,OAAO;YAAES,aAAaI;YAAWH,YAAYG;YAAWtB,iBAAiB,EAAE;QAAC;IAC/F;IAEA,OAAO;QAAEqB;QAAgBf;QAAcN;IAAgB;AACzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-combobox",
|
|
3
|
-
"version": "9.13.
|
|
3
|
+
"version": "9.13.13",
|
|
4
4
|
"description": "Fluent UI React Combobox component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
"@fluentui/scripts-cypress": "*"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluentui/react-aria": "^9.13.
|
|
22
|
+
"@fluentui/react-aria": "^9.13.10",
|
|
23
23
|
"@fluentui/keyboard-keys": "^9.0.8",
|
|
24
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
25
|
-
"@fluentui/react-field": "^9.1.
|
|
24
|
+
"@fluentui/react-context-selector": "^9.1.70",
|
|
25
|
+
"@fluentui/react-field": "^9.1.81",
|
|
26
26
|
"@fluentui/react-icons": "^2.0.245",
|
|
27
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
28
|
-
"@fluentui/react-portal": "^9.4.
|
|
29
|
-
"@fluentui/react-positioning": "^9.15.
|
|
30
|
-
"@fluentui/react-shared-contexts": "^9.21.
|
|
31
|
-
"@fluentui/react-tabster": "^9.23.
|
|
32
|
-
"@fluentui/react-theme": "^9.1.
|
|
33
|
-
"@fluentui/react-utilities": "^9.18.
|
|
27
|
+
"@fluentui/react-jsx-runtime": "^9.0.47",
|
|
28
|
+
"@fluentui/react-portal": "^9.4.39",
|
|
29
|
+
"@fluentui/react-positioning": "^9.15.13",
|
|
30
|
+
"@fluentui/react-shared-contexts": "^9.21.1",
|
|
31
|
+
"@fluentui/react-tabster": "^9.23.1",
|
|
32
|
+
"@fluentui/react-theme": "^9.1.23",
|
|
33
|
+
"@fluentui/react-utilities": "^9.18.18",
|
|
34
34
|
"@griffel/react": "^1.5.22",
|
|
35
35
|
"@swc/helpers": "^0.5.1"
|
|
36
36
|
},
|