@fluentui/react-migration-v8-v9 1.0.24 → 1.0.26
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.json +61 -1
- package/CHANGELOG.md +20 -2
- package/lib/components/Button/ActionButtonShim.js +4 -3
- package/lib/components/Button/ActionButtonShim.js.map +1 -1
- package/lib/components/Button/ButtonShim.js +6 -7
- package/lib/components/Button/ButtonShim.js.map +1 -1
- package/lib/components/Button/CompoundButtonShim.js +6 -5
- package/lib/components/Button/CompoundButtonShim.js.map +1 -1
- package/lib/components/Button/DefaultButtonShim.js +2 -2
- package/lib/components/Button/DefaultButtonShim.js.map +1 -1
- package/lib/components/Button/MenuButtonShim.js +10 -6
- package/lib/components/Button/MenuButtonShim.js.map +1 -1
- package/lib/components/Button/PrimaryButtonShim.js +2 -2
- package/lib/components/Button/PrimaryButtonShim.js.map +1 -1
- package/lib/components/Button/ToggleButtonShim.js +6 -4
- package/lib/components/Button/ToggleButtonShim.js.map +1 -1
- package/lib/components/Button/shimButtonProps.js +6 -5
- package/lib/components/Button/shimButtonProps.js.map +1 -1
- package/lib/components/Menu/MenuShim.js +16 -14
- package/lib/components/Menu/MenuShim.js.map +1 -1
- package/lib/components/Menu/shimMenuProps.js +6 -4
- package/lib/components/Menu/shimMenuProps.js.map +1 -1
- package/lib/components/Stack/StackItemShim.js +61 -72
- package/lib/components/Stack/StackItemShim.js.map +1 -1
- package/lib/components/Stack/StackShim.js +85 -101
- package/lib/components/Stack/StackShim.js.map +1 -1
- package/lib/components/Stack/stackUtils.js +12 -24
- package/lib/components/Stack/stackUtils.js.map +1 -1
- package/lib/components/Theme/themeDuplicates.js.map +1 -1
- package/lib/components/Theme/v8ThemeShim.js +34 -27
- package/lib/components/Theme/v8ThemeShim.js.map +1 -1
- package/lib/components/Theme/v9BrandVariantsShim.js +0 -8
- package/lib/components/Theme/v9BrandVariantsShim.js.map +1 -1
- package/lib/components/Theme/v9ThemeShim.js +2 -8
- package/lib/components/Theme/v9ThemeShim.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Button/ActionButtonShim.js +4 -7
- package/lib-commonjs/components/Button/ActionButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/ButtonShim.js +6 -13
- package/lib-commonjs/components/Button/ButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/CommandButtonShim.js +0 -2
- package/lib-commonjs/components/Button/CommandButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/CompoundButtonShim.js +6 -9
- package/lib-commonjs/components/Button/CompoundButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/DefaultButtonShim.js +2 -5
- package/lib-commonjs/components/Button/DefaultButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/MenuButtonShim.js +12 -12
- package/lib-commonjs/components/Button/MenuButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/PrimaryButtonShim.js +2 -5
- package/lib-commonjs/components/Button/PrimaryButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/ToggleButtonShim.js +6 -8
- package/lib-commonjs/components/Button/ToggleButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +0 -10
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/shimButtonProps.js +6 -9
- package/lib-commonjs/components/Button/shimButtonProps.js.map +1 -1
- package/lib-commonjs/components/Menu/MenuShim.js +20 -22
- package/lib-commonjs/components/Menu/MenuShim.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +0 -3
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/shimMenuProps.js +6 -14
- package/lib-commonjs/components/Menu/shimMenuProps.js.map +1 -1
- package/lib-commonjs/components/Stack/StackItemShim.js +61 -76
- package/lib-commonjs/components/Stack/StackItemShim.js.map +1 -1
- package/lib-commonjs/components/Stack/StackShim.js +85 -107
- package/lib-commonjs/components/Stack/StackShim.js.map +1 -1
- package/lib-commonjs/components/Stack/index.js +0 -3
- package/lib-commonjs/components/Stack/index.js.map +1 -1
- package/lib-commonjs/components/Stack/stackUtils.js +12 -29
- package/lib-commonjs/components/Stack/stackUtils.js.map +1 -1
- package/lib-commonjs/components/Theme/index.js +0 -5
- package/lib-commonjs/components/Theme/index.js.map +1 -1
- package/lib-commonjs/components/Theme/themeDuplicates.js +1 -1
- package/lib-commonjs/components/Theme/themeDuplicates.js.map +1 -1
- package/lib-commonjs/components/Theme/v8ThemeShim.js +34 -31
- package/lib-commonjs/components/Theme/v8ThemeShim.js.map +1 -1
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js +0 -11
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js.map +1 -1
- package/lib-commonjs/components/Theme/v9ThemeShim.js +2 -12
- package/lib-commonjs/components/Theme/v9ThemeShim.js.map +1 -1
- package/lib-commonjs/index.js +0 -8
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
"name": "@fluentui/react-migration-v8-v9",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
5
|
+
"date": "Wed, 04 Jan 2023 07:45:38 GMT",
|
|
6
|
+
"tag": "@fluentui/react-migration-v8-v9_v1.0.26",
|
|
7
|
+
"version": "1.0.26",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "olfedias@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-migration-v8-v9",
|
|
13
|
+
"commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
|
|
14
|
+
"comment": "chore: Update Griffel to latest version"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 02 Jan 2023 07:46:48 GMT",
|
|
21
|
+
"tag": "@fluentui/react-migration-v8-v9_v1.0.25",
|
|
22
|
+
"version": "1.0.25",
|
|
23
|
+
"comments": {
|
|
24
|
+
"none": [
|
|
25
|
+
{
|
|
26
|
+
"author": "martinhochel@microsoft.com",
|
|
27
|
+
"package": "@fluentui/react-migration-v8-v9",
|
|
28
|
+
"commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
|
|
29
|
+
"comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Fri, 30 Dec 2022 07:51:07 GMT",
|
|
36
|
+
"tag": "@fluentui/react-migration-v8-v9_v1.0.25",
|
|
37
|
+
"version": "1.0.25",
|
|
38
|
+
"comments": {
|
|
39
|
+
"none": [
|
|
40
|
+
{
|
|
41
|
+
"author": "martinhochel@microsoft.com",
|
|
42
|
+
"package": "@fluentui/react-migration-v8-v9",
|
|
43
|
+
"commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
|
|
44
|
+
"comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Fri, 23 Dec 2022 07:55:40 GMT",
|
|
51
|
+
"tag": "@fluentui/react-migration-v8-v9_v1.0.25",
|
|
52
|
+
"version": "1.0.25",
|
|
53
|
+
"comments": {
|
|
54
|
+
"patch": [
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-migration-v8-v9",
|
|
58
|
+
"comment": "Bump @fluentui/react to v8.104.1",
|
|
59
|
+
"commit": "64040a4899e338d8e4e11819975b717276702b9c"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Wed, 21 Dec 2022 07:47:36 GMT",
|
|
6
66
|
"tag": "@fluentui/react-migration-v8-v9_v1.0.24",
|
|
7
67
|
"version": "1.0.24",
|
|
8
68
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-migration-v8-v9
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 04 Jan 2023 07:45:38 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [1.0.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-migration-v8-v9_v1.0.26)
|
|
8
|
+
|
|
9
|
+
Wed, 04 Jan 2023 07:45:38 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-migration-v8-v9_v1.0.25..@fluentui/react-migration-v8-v9_v1.0.26)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [1.0.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-migration-v8-v9_v1.0.25)
|
|
17
|
+
|
|
18
|
+
Fri, 23 Dec 2022 07:55:40 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-migration-v8-v9_v1.0.24..@fluentui/react-migration-v8-v9_v1.0.25)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- Bump @fluentui/react to v8.104.1 ([PR #26073](https://github.com/microsoft/fluentui/pull/26073) by beachball)
|
|
24
|
+
|
|
7
25
|
## [1.0.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-migration-v8-v9_v1.0.24)
|
|
8
26
|
|
|
9
|
-
Wed, 21 Dec 2022 07:
|
|
27
|
+
Wed, 21 Dec 2022 07:47:36 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-migration-v8-v9_v1.0.23..@fluentui/react-migration-v8-v9_v1.0.24)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -4,13 +4,14 @@ import { shimButtonProps } from './shimButtonProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* Shims a v8 ActionButton to render a v9 Button
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
export const ActionButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
9
|
-
const variantProps = {
|
|
8
|
+
const variantProps = {
|
|
9
|
+
...props,
|
|
10
10
|
variantClassName: 'ms-Button--action ms-Button--command'
|
|
11
11
|
};
|
|
12
12
|
const shimProps = shimButtonProps(variantProps);
|
|
13
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
13
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
14
|
+
...props,
|
|
14
15
|
...shimProps,
|
|
15
16
|
appearance: "transparent"
|
|
16
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,MAAM,QAAQ,4BAA4B;AAEnD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD;;;AAGA,OAAO,MAAMC,gBAAgB,gBAEzBH,KAAK,CAACI,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;EACnC,MAAMC,YAAY,GAAG;IACnB,GAAGF,KAAK;IACRG,gBAAgB,EAAE;GACnB;EAED,MAAMC,SAAS,GAAGP,eAAe,CAACK,YAAY,CAAC;EAE/C,oBAAOP,oBAACC,MAAM;IAAA,GAAMI,KAAgD;IAAA,GAAMI,SAAS;IAAEC,UAAU,EAAC;EAAa,EAAG;AAClH,CAAC,CAAC","names":["React","Button","shimButtonProps","ActionButtonShim","forwardRef","props","_ref","variantProps","variantClassName","shimProps","appearance"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/ActionButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { Button } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims a v8 ActionButton to render a v9 Button\n */\nexport const ActionButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: 'ms-Button--action ms-Button--command',\n };\n\n const shimProps = shimButtonProps(variantProps);\n\n return <Button {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} appearance=\"transparent\" />;\n});\n"]}
|
|
@@ -5,20 +5,19 @@ import { ToggleButtonShim } from './ToggleButtonShim';
|
|
|
5
5
|
import { CompoundButtonShim } from './CompoundButtonShim';
|
|
6
6
|
export const ButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
7
7
|
var _a;
|
|
8
|
-
|
|
9
8
|
const shimProps = shimButtonProps(props);
|
|
10
|
-
|
|
11
9
|
if (props.toggle) {
|
|
12
|
-
return /*#__PURE__*/React.createElement(ToggleButtonShim, {
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToggleButtonShim, {
|
|
11
|
+
...props
|
|
13
12
|
}, props.children);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
if (props.secondaryText || ((_a = props.onRenderDescription) === null || _a === void 0 ? void 0 : _a.call(props, props))) {
|
|
17
|
-
return /*#__PURE__*/React.createElement(CompoundButtonShim, {
|
|
15
|
+
return /*#__PURE__*/React.createElement(CompoundButtonShim, {
|
|
16
|
+
...props
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
20
|
+
...props,
|
|
22
21
|
...shimProps
|
|
23
22
|
});
|
|
24
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,MAAM,QAAQ,4BAA4B;AAEnD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,OAAO,MAAMC,UAAU,gBAEnBL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;;EACnC,MAAMC,SAAS,GAAGP,eAAe,CAACK,KAAK,CAAC;EAExC,IAAIA,KAAK,CAACG,MAAM,EAAE;IAChB,oBAAOV,oBAACG,gBAAgB;MAAA,GAAKI;IAAK,GAAGA,KAAK,CAACI,QAAQ,CAAoB;;EAEzE,IAAIJ,KAAK,CAACK,aAAa,KAAI,WAAK,CAACC,mBAAmB,+CAAzBN,KAAK,EAAuBA,KAAK,CAAC,GAAE;IAC7D,oBAAOP,oBAACI,kBAAkB;MAAA,GAAKG;IAAK,EAAI;;EAG1C,oBAAOP,oBAACC,MAAM;IAAA,GAAMM,KAAgD;IAAA,GAAME;EAAS,EAAI;AACzF,CAAC,CAAC","names":["React","Button","shimButtonProps","ToggleButtonShim","CompoundButtonShim","ButtonShim","forwardRef","props","_ref","shimProps","toggle","children","secondaryText","onRenderDescription"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/ButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IBaseButtonProps } from '@fluentui/react';\n\nimport { Button } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\nimport { ToggleButtonShim } from './ToggleButtonShim';\nimport { CompoundButtonShim } from './CompoundButtonShim';\n\nexport const ButtonShim: React.ForwardRefExoticComponent<\n IBaseButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const shimProps = shimButtonProps(props);\n\n if (props.toggle) {\n return <ToggleButtonShim {...props}>{props.children}</ToggleButtonShim>;\n }\n if (props.secondaryText || props.onRenderDescription?.(props)) {\n return <CompoundButtonShim {...props} />;\n }\n\n return <Button {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -4,17 +4,18 @@ import { shimButtonProps } from './shimButtonProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* Shims v8 CompoundButton to render a v9 CompoundButton
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
export const CompoundButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
9
8
|
var _a;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const variantProps = {
|
|
10
|
+
...props,
|
|
12
11
|
variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound'
|
|
13
12
|
};
|
|
14
|
-
const shimProps = {
|
|
13
|
+
const shimProps = {
|
|
14
|
+
...shimButtonProps(variantProps),
|
|
15
15
|
secondaryContent: props.secondaryText || ((_a = props.onRenderDescription) === null || _a === void 0 ? void 0 : _a.call(props, props))
|
|
16
16
|
};
|
|
17
|
-
return /*#__PURE__*/React.createElement(CompoundButton, {
|
|
17
|
+
return /*#__PURE__*/React.createElement(CompoundButton, {
|
|
18
|
+
...props,
|
|
18
19
|
...shimProps
|
|
19
20
|
});
|
|
20
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,cAAc,QAAQ,4BAA4B;AAG3D,SAASC,eAAe,QAAQ,mBAAmB;AAEnD;;;AAGA,OAAO,MAAMC,kBAAkB,gBAE3BH,KAAK,CAACI,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;;EACnC,MAAMC,YAAY,GAAG;IACnB,GAAGF,KAAK;IACRG,gBAAgB,EAAEH,KAAK,CAACI,OAAO,GAAG,4BAA4B,GAAG;GAClE;EAED,MAAMC,SAAS,GAAwB;IACrC,GAAGR,eAAe,CAACK,YAAY,CAAC;IAChCI,gBAAgB,EAAEN,KAAK,CAACO,aAAa,KAAI,WAAK,CAACC,mBAAmB,+CAAzBR,KAAK,EAAuBA,KAAK,CAAC;GAC5E;EAED,oBAAOL,oBAACC,cAAc;IAAA,GAAMI,KAAgD;IAAA,GAAMK;EAAS,EAAI;AACjG,CAAC,CAAC","names":["React","CompoundButton","shimButtonProps","CompoundButtonShim","forwardRef","props","_ref","variantProps","variantClassName","primary","shimProps","secondaryContent","secondaryText","onRenderDescription"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/CompoundButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { CompoundButton } from '@fluentui/react-components';\nimport type { CompoundButtonProps } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims v8 CompoundButton to render a v9 CompoundButton\n */\nexport const CompoundButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound',\n };\n\n const shimProps: CompoundButtonProps = {\n ...shimButtonProps(variantProps),\n secondaryContent: props.secondaryText || props.onRenderDescription?.(props),\n };\n\n return <CompoundButton {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -3,9 +3,9 @@ import { ButtonShim } from './ButtonShim';
|
|
|
3
3
|
/**
|
|
4
4
|
* Shims a v8 DefaultButton to render a v9 Button
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
export const DefaultButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
8
|
-
return /*#__PURE__*/React.createElement(ButtonShim, {
|
|
7
|
+
return /*#__PURE__*/React.createElement(ButtonShim, {
|
|
8
|
+
...props,
|
|
9
9
|
variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default'
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,UAAU,QAAQ,cAAc;AAEzC;;;AAGA,OAAO,MAAMC,iBAAiB,gBAE1BF,KAAK,CAACG,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;EACnC,oBAAOL,oBAACC,UAAU;IAAA,GAAKG,KAAK;IAAEE,gBAAgB,EAAEF,KAAK,CAACG,OAAO,GAAG,oBAAoB,GAAG;EAAoB,EAAI;AACjH,CAAC,CAAC","names":["React","ButtonShim","DefaultButtonShim","forwardRef","props","_ref","variantClassName","primary"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/DefaultButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { ButtonShim } from './ButtonShim';\n\n/**\n * Shims a v8 DefaultButton to render a v9 Button\n */\nexport const DefaultButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n return <ButtonShim {...props} variantClassName={props.primary ? 'ms-Button--primary' : 'ms-Button--default'} />;\n});\n"]}
|
|
@@ -4,20 +4,24 @@ import { MenuItemShim, shimMenuProps } from '../Menu/index';
|
|
|
4
4
|
import { shimButtonProps } from './shimButtonProps';
|
|
5
5
|
export const MenuButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
6
6
|
var _a;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const variantProps = {
|
|
8
|
+
...props,
|
|
9
9
|
variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default'
|
|
10
10
|
};
|
|
11
|
-
const shimProps = {
|
|
11
|
+
const shimProps = {
|
|
12
|
+
...shimButtonProps(variantProps)
|
|
12
13
|
};
|
|
13
14
|
const shimmedMenuProps = props.menuProps ? shimMenuProps(props.menuProps) : {};
|
|
14
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
15
|
-
|
|
15
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
16
|
+
...shimmedMenuProps
|
|
17
|
+
}, /*#__PURE__*/React.createElement(MenuTrigger, null, /*#__PURE__*/React.createElement(MenuButton, {
|
|
18
|
+
...shimProps
|
|
16
19
|
})), /*#__PURE__*/React.createElement(MenuPopover, null, /*#__PURE__*/React.createElement(MenuList, null, (_a = props.menuProps) === null || _a === void 0 ? void 0 : _a.items.map(item =>
|
|
17
20
|
/*#__PURE__*/
|
|
18
21
|
// key is added through item spread
|
|
19
22
|
// eslint-disable-next-line react/jsx-key
|
|
20
|
-
React.createElement(MenuItemShim, {
|
|
23
|
+
React.createElement(MenuItemShim, {
|
|
24
|
+
...item
|
|
21
25
|
})))));
|
|
22
26
|
});
|
|
23
27
|
//# sourceMappingURL=MenuButtonShim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,WAAW,QAAQ,4BAA4B;AAEjG,SAASC,YAAY,EAAEC,aAAa,QAAQ,eAAe;AAE3D,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,OAAO,MAAMC,cAAc,gBAEvBT,KAAK,CAACU,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;;EACnC,MAAMC,YAAY,GAAG;IACnB,GAAGF,KAAK;IACRG,gBAAgB,EAAEH,KAAK,CAACI,OAAO,GAAG,oBAAoB,GAAG;GAC1D;EAED,MAAMC,SAAS,GAAoB;IACjC,GAAGR,eAAe,CAACK,YAAY;GAChC;EAED,MAAMI,gBAAgB,GAAGN,KAAK,CAACO,SAAS,GAAGX,aAAa,CAACI,KAAK,CAACO,SAAS,CAAC,GAAG,EAAE;EAE9E,oBACElB,oBAACE,IAAI;IAAA,GAAKe;EAAgB,gBACxBjB,oBAACK,WAAW,qBACVL,oBAACC,UAAU;IAAA,GAAKe;EAAS,EAAI,CACjB,eACdhB,oBAACI,WAAW,qBACVJ,oBAACG,QAAQ,QACN,WAAK,CAACe,SAAS,0CAAEC,KAAK,CAACC,GAAG,CAACC,IAAI;EAAA;EAC9B;EACA;EACArB,oBAACM,YAAY;IAAA,GAAKe;EAAI,EACvB,CAAC,CACO,CACC,CACT;AAEX,CAAC,CAAC","names":["React","MenuButton","Menu","MenuList","MenuPopover","MenuTrigger","MenuItemShim","shimMenuProps","shimButtonProps","MenuButtonShim","forwardRef","props","_ref","variantProps","variantClassName","primary","shimProps","shimmedMenuProps","menuProps","items","map","item"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/MenuButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\nimport { MenuButton, Menu, MenuList, MenuPopover, MenuTrigger } from '@fluentui/react-components';\nimport type { MenuButtonProps } from '@fluentui/react-components';\nimport { MenuItemShim, shimMenuProps } from '../Menu/index';\n\nimport { shimButtonProps } from './shimButtonProps';\n\nexport const MenuButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default',\n };\n\n const shimProps: MenuButtonProps = {\n ...shimButtonProps(variantProps),\n };\n\n const shimmedMenuProps = props.menuProps ? shimMenuProps(props.menuProps) : {};\n\n return (\n <Menu {...shimmedMenuProps}>\n <MenuTrigger>\n <MenuButton {...shimProps} />\n </MenuTrigger>\n <MenuPopover>\n <MenuList>\n {props.menuProps?.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuList>\n </MenuPopover>\n </Menu>\n );\n});\n"]}
|
|
@@ -3,9 +3,9 @@ import { ButtonShim } from './ButtonShim';
|
|
|
3
3
|
/**
|
|
4
4
|
* Shims v8 PrimaryButton to render a v9 Button
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
export const PrimaryButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
8
|
-
return /*#__PURE__*/React.createElement(ButtonShim, {
|
|
7
|
+
return /*#__PURE__*/React.createElement(ButtonShim, {
|
|
8
|
+
...props,
|
|
9
9
|
primary: true,
|
|
10
10
|
variantClassName: "ms-Button--primary"
|
|
11
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,UAAU,QAAQ,cAAc;AAEzC;;;AAGA,OAAO,MAAMC,iBAAiB,gBAE1BF,KAAK,CAACG,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;EACnC,oBAAOL,oBAACC,UAAU;IAAA,GAAKG,KAAK;IAAEE,OAAO;IAACC,gBAAgB,EAAC;EAAoB,EAAG;AAChF,CAAC,CAAC","names":["React","ButtonShim","PrimaryButtonShim","forwardRef","props","_ref","primary","variantClassName"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/PrimaryButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\nimport { ButtonShim } from './ButtonShim';\n\n/**\n * Shims v8 PrimaryButton to render a v9 Button\n */\nexport const PrimaryButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n return <ButtonShim {...props} primary variantClassName=\"ms-Button--primary\" />;\n});\n"]}
|
|
@@ -4,16 +4,18 @@ import { shimButtonProps } from './shimButtonProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* Shims v8 ToggleButton to render a v9 ToggleButton
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
export const ToggleButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {
|
|
9
|
-
const variantProps = {
|
|
8
|
+
const variantProps = {
|
|
9
|
+
...props,
|
|
10
10
|
variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound'
|
|
11
11
|
};
|
|
12
|
-
const shimProps = {
|
|
12
|
+
const shimProps = {
|
|
13
|
+
...shimButtonProps(variantProps),
|
|
13
14
|
checked: props.checked,
|
|
14
15
|
defaultChecked: props.defaultChecked
|
|
15
16
|
};
|
|
16
|
-
return /*#__PURE__*/React.createElement(ToggleButton, {
|
|
17
|
+
return /*#__PURE__*/React.createElement(ToggleButton, {
|
|
18
|
+
...props,
|
|
17
19
|
...shimProps
|
|
18
20
|
});
|
|
19
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD;;;AAGA,OAAO,MAAMC,gBAAgB,gBAEzBH,KAAK,CAACI,UAAU,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAI;EACnC,MAAMC,YAAY,GAAG;IACnB,GAAGF,KAAK;IACRG,gBAAgB,EAAEH,KAAK,CAACI,OAAO,GAAG,4BAA4B,GAAG;GAClE;EAED,MAAMC,SAAS,GAAsB;IACnC,GAAGR,eAAe,CAACK,YAAY,CAAC;IAChCI,OAAO,EAAEN,KAAK,CAACM,OAAO;IACtBC,cAAc,EAAEP,KAAK,CAACO;GACvB;EAED,oBAAOZ,oBAACC,YAAY;IAAA,GAAMI,KAAgD;IAAA,GAAMK;EAAS,EAAI;AAC/F,CAAC,CAAC","names":["React","ToggleButton","shimButtonProps","ToggleButtonShim","forwardRef","props","_ref","variantProps","variantClassName","primary","shimProps","checked","defaultChecked"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/ToggleButtonShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { ToggleButton } from '@fluentui/react-components';\nimport type { ToggleButtonProps } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims v8 ToggleButton to render a v9 ToggleButton\n */\nexport const ToggleButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound',\n };\n\n const shimProps: ToggleButtonProps = {\n ...shimButtonProps(variantProps),\n checked: props.checked,\n defaultChecked: props.defaultChecked,\n };\n\n return <ToggleButton {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Icon } from '@fluentui/react';
|
|
3
3
|
export const shimButtonProps = props => {
|
|
4
|
-
var _a;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var _a;
|
|
5
|
+
//TODO: Icon shim. This still renders the v8 icon.
|
|
6
|
+
const icon = props.onRenderIcon ? props.onRenderIcon(props) : props.iconProps ? /*#__PURE__*/React.createElement(Icon, {
|
|
7
|
+
...props.iconProps
|
|
8
8
|
}) : undefined;
|
|
9
9
|
const variantClassName = ((_a = props.variantClassName) !== null && _a !== void 0 ? _a : props.primary) ? 'ms-Button--primary' : 'ms-Button--default';
|
|
10
10
|
const className = [props.baseClassName, variantClassName, props.className].filter(Boolean).join(' ');
|
|
11
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
// spread incoming props to propagate HTML properties not part of IBaseButtonProps
|
|
12
13
|
...props,
|
|
13
14
|
appearance: props.primary ? 'primary' : undefined,
|
|
14
15
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,IAAI,QAAQ,iBAAiB;AAKtC,OAAO,MAAMC,eAAe,GAAIC,KAAgE,IAAiB;;EAC/G;EACA,MAAMC,IAAI,GAAGD,KAAK,CAACE,YAAY,GAC7BF,KAAK,CAACE,YAAY,CAACF,KAAK,CAAC,GACvBA,KAAK,CAACG,SAAS,gBACjBN,oBAACC,IAAI;IAAA,GAAKE,KAAK,CAACG;EAAS,EAAI,GAC3BC,SAAS;EAEb,MAAMC,gBAAgB,GAAG,YAAK,CAACA,gBAAgB,mCAAIL,KAAK,CAACM,OAAO,IAAG,oBAAoB,GAAG,oBAAoB;EAC9G,MAAMC,SAAS,GAAG,CAACP,KAAK,CAACQ,aAAa,EAAEH,gBAAgB,EAAEL,KAAK,CAACO,SAAS,CAAC,CAACE,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAEpG,OAAO;IACL;IACA,GAAGX,KAAK;IACRY,UAAU,EAAEZ,KAAK,CAACM,OAAO,GAAG,SAAS,GAAGF,SAAS;IACjDG,SAAS;IACTM,QAAQ,EAAEb,KAAK,CAACa,QAAQ;IACxBC,iBAAiB,EAAEd,KAAK,CAACe,kBAAkB;IAC3C,aAAa,EAAEf,KAAK,CAACgB,UAAU;IAC/B,YAAY,EAAEhB,KAAK,CAACiB,SAAS;IAC7BhB,IAAI;IACJiB,GAAG,EAAElB,KAAK,CAACkB,GAAG,IAAIlB,KAAK,CAACmB,QAAQ;IAChCC,QAAQ,EAAEpB,KAAK,CAACqB,gBAAgB,GAC5BrB,KAAK,CAACqB,gBAAgB,CAACrB,KAAK,CAAC,GAC7BA,KAAK,CAACsB,YAAY,GAClBtB,KAAK,CAACsB,YAAY,CAACtB,KAAK,CAAC,GACzBA,KAAK,CAACuB,IAAI,IAAIvB,KAAK,CAACoB;GACV;AAClB,CAAC","names":["React","Icon","shimButtonProps","props","icon","onRenderIcon","iconProps","undefined","variantClassName","primary","className","baseClassName","filter","Boolean","join","appearance","disabled","disabledFocusable","allowDisabledFocus","ariaHidden","ariaLabel","key","uniqueId","children","onRenderChildren","onRenderText","text"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Button/shimButtonProps.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Icon } from '@fluentui/react';\nimport type { IBaseButtonProps } from '@fluentui/react';\n\nimport type { ButtonProps } from '@fluentui/react-components';\n\nexport const shimButtonProps = (props: IBaseButtonProps & React.RefAttributes<HTMLButtonElement>): ButtonProps => {\n //TODO: Icon shim. This still renders the v8 icon.\n const icon = props.onRenderIcon ? (\n props.onRenderIcon(props)\n ) : props.iconProps ? (\n <Icon {...props.iconProps} />\n ) : undefined;\n\n const variantClassName = props.variantClassName ?? props.primary ? 'ms-Button--primary' : 'ms-Button--default';\n const className = [props.baseClassName, variantClassName, props.className].filter(Boolean).join(' ');\n\n return {\n // spread incoming props to propagate HTML properties not part of IBaseButtonProps\n ...props,\n appearance: props.primary ? 'primary' : undefined,\n className,\n disabled: props.disabled,\n disabledFocusable: props.allowDisabledFocus,\n 'aria-hidden': props.ariaHidden,\n 'aria-label': props.ariaLabel,\n icon,\n key: props.key || props.uniqueId,\n children: props.onRenderChildren\n ? props.onRenderChildren(props)\n : props.onRenderText\n ? props.onRenderText(props)\n : props.text || props.children,\n } as ButtonProps;\n};\n"]}
|
|
@@ -4,46 +4,48 @@ import { MenuItem, MenuDivider, MenuGroup, MenuGroupHeader, MenuTrigger, Menu, M
|
|
|
4
4
|
import { shimMenuHeaderProps, shimMenuItemCheckboxProps, shimMenuItemProps, shimMenuProps } from './shimMenuProps';
|
|
5
5
|
export const MenuItemShim = props => {
|
|
6
6
|
var _a, _b;
|
|
7
|
-
|
|
8
7
|
if (props.itemType === ContextualMenuItemType.Divider) {
|
|
9
8
|
const shimProps = shimMenuItemProps(props);
|
|
10
|
-
return /*#__PURE__*/React.createElement(MenuDivider, {
|
|
9
|
+
return /*#__PURE__*/React.createElement(MenuDivider, {
|
|
10
|
+
...shimProps
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
if (props.itemType === ContextualMenuItemType.Section) {
|
|
15
14
|
const shimProps = shimMenuHeaderProps(props);
|
|
16
15
|
return /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(MenuGroupHeader, null, shimProps.children), (_a = props.subMenuProps) === null || _a === void 0 ? void 0 : _a.items.map(item =>
|
|
17
16
|
/*#__PURE__*/
|
|
18
17
|
// key is added through item spread
|
|
19
18
|
// eslint-disable-next-line react/jsx-key
|
|
20
|
-
React.createElement(MenuItemShim, {
|
|
19
|
+
React.createElement(MenuItemShim, {
|
|
20
|
+
...item
|
|
21
21
|
})));
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
if (props.canCheck) {
|
|
25
24
|
const shimProps = shimMenuItemCheckboxProps(props);
|
|
26
|
-
return /*#__PURE__*/React.createElement(MenuItemCheckbox, {
|
|
25
|
+
return /*#__PURE__*/React.createElement(MenuItemCheckbox, {
|
|
26
|
+
...shimProps
|
|
27
27
|
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
}
|
|
29
|
+
// Nested Menu to handle submenus
|
|
31
30
|
if (((_b = props.subMenuProps) === null || _b === void 0 ? void 0 : _b.items) && props.subMenuProps.items.length > 0) {
|
|
32
31
|
const shimmedMenuProps = shimMenuProps(props.subMenuProps);
|
|
33
32
|
const shimmedItemProps = shimMenuItemProps(props);
|
|
34
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
35
|
-
|
|
33
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
34
|
+
...shimmedMenuProps
|
|
35
|
+
}, /*#__PURE__*/React.createElement(MenuTrigger, null, /*#__PURE__*/React.createElement(MenuItem, {
|
|
36
|
+
...shimmedItemProps,
|
|
36
37
|
hasSubmenu: true
|
|
37
38
|
})), /*#__PURE__*/React.createElement(MenuPopover, null, /*#__PURE__*/React.createElement(MenuList, null, props.subMenuProps.items.map(item =>
|
|
38
39
|
/*#__PURE__*/
|
|
39
40
|
// key is added through item spread
|
|
40
41
|
// eslint-disable-next-line react/jsx-key
|
|
41
|
-
React.createElement(MenuItemShim, {
|
|
42
|
+
React.createElement(MenuItemShim, {
|
|
43
|
+
...item
|
|
42
44
|
})))));
|
|
43
45
|
}
|
|
44
|
-
|
|
45
46
|
const shimProps = shimMenuItemProps(props);
|
|
46
|
-
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
47
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
48
|
+
...shimProps
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
51
|
//# sourceMappingURL=MenuShim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,sBAAsB,QAAQ,iBAAiB;AAExD,SACEC,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,WAAW,EACXC,IAAI,EACJC,QAAQ,EACRC,WAAW,EACXC,gBAAgB,QAEX,4BAA4B;AAEnC,SAASC,mBAAmB,EAAEC,yBAAyB,EAAEC,iBAAiB,EAAEC,aAAa,QAAQ,iBAAiB;AAElH,OAAO,MAAMC,YAAY,GAAIC,KAA0B,IAAI;;EACzD,IAAIA,KAAK,CAACC,QAAQ,KAAKhB,sBAAsB,CAACiB,OAAO,EAAE;IACrD,MAAMC,SAAS,GAAGN,iBAAiB,CAACG,KAAK,CAAC;IAC1C,oBAAOhB,oBAACG,WAAW;MAAA,GAAMgB;IAA8B,EAAI;;EAG7D,IAAIH,KAAK,CAACC,QAAQ,KAAKhB,sBAAsB,CAACmB,OAAO,EAAE;IACrD,MAAMD,SAAS,GAAGR,mBAAmB,CAACK,KAAK,CAAC;IAC5C,oBACEhB,oBAACI,SAAS,qBACRJ,oBAACK,eAAe,QAAEc,SAAS,CAACE,QAAQ,CAAmB,EAEtD,WAAK,CAACC,YAAY,0CAAEC,KAAK,CAACC,GAAG,CAACC,IAAI;IAAA;IACjC;IACA;IACAzB,oBAACe,YAAY;MAAA,GAAKU;IAAI,EACvB,CAAC,CACQ;;EAIhB,IAAIT,KAAK,CAACU,QAAQ,EAAE;IAClB,MAAMP,SAAS,GAAGP,yBAAyB,CAACI,KAAK,CAAC;IAClD,oBAAOhB,oBAACU,gBAAgB;MAAA,GAAKS;IAAS,EAAI;;EAG5C;EACA,IAAI,YAAK,CAACG,YAAY,0CAAEC,KAAK,KAAIP,KAAK,CAACM,YAAY,CAACC,KAAK,CAACI,MAAM,GAAG,CAAC,EAAE;IACpE,MAAMC,gBAAgB,GAAGd,aAAa,CAACE,KAAK,CAACM,YAAY,CAAC;IAC1D,MAAMO,gBAAgB,GAAGhB,iBAAiB,CAACG,KAAK,CAAC;IAEjD,oBACEhB,oBAACO,IAAI;MAAA,GAAKqB;IAAgB,gBACxB5B,oBAACM,WAAW,qBACVN,oBAACE,QAAQ;MAAA,GAAK2B,gBAAgB;MAAEC,UAAU;IAAA,EAAG,CACjC,eACd9B,oBAACS,WAAW,qBACVT,oBAACQ,QAAQ,QACNQ,KAAK,CAACM,YAAY,CAACC,KAAK,CAACC,GAAG,CAACC,IAAI;IAAA;IAChC;IACA;IACAzB,oBAACe,YAAY;MAAA,GAAKU;IAAI,EACvB,CAAC,CACO,CACC,CACT;;EAIX,MAAMN,SAAS,GAAGN,iBAAiB,CAACG,KAAK,CAAC;EAC1C,oBAAOhB,oBAACE,QAAQ;IAAA,GAAKiB;EAAS,EAAI;AACpC,CAAC","names":["React","ContextualMenuItemType","MenuItem","MenuDivider","MenuGroup","MenuGroupHeader","MenuTrigger","Menu","MenuList","MenuPopover","MenuItemCheckbox","shimMenuHeaderProps","shimMenuItemCheckboxProps","shimMenuItemProps","shimMenuProps","MenuItemShim","props","itemType","Divider","shimProps","Section","children","subMenuProps","items","map","item","canCheck","length","shimmedMenuProps","shimmedItemProps","hasSubmenu"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Menu/MenuShim.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { ContextualMenuItemType } from '@fluentui/react';\nimport type { IContextualMenuItem } from '@fluentui/react';\nimport {\n MenuItem,\n MenuDivider,\n MenuGroup,\n MenuGroupHeader,\n MenuTrigger,\n Menu,\n MenuList,\n MenuPopover,\n MenuItemCheckbox,\n MenuDividerProps,\n} from '@fluentui/react-components';\n\nimport { shimMenuHeaderProps, shimMenuItemCheckboxProps, shimMenuItemProps, shimMenuProps } from './shimMenuProps';\n\nexport const MenuItemShim = (props: IContextualMenuItem) => {\n if (props.itemType === ContextualMenuItemType.Divider) {\n const shimProps = shimMenuItemProps(props);\n return <MenuDivider {...(shimProps as MenuDividerProps)} />;\n }\n\n if (props.itemType === ContextualMenuItemType.Section) {\n const shimProps = shimMenuHeaderProps(props);\n return (\n <MenuGroup>\n <MenuGroupHeader>{shimProps.children}</MenuGroupHeader>\n {/* //TODO: sectionProps handling */}\n {props.subMenuProps?.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuGroup>\n );\n }\n\n if (props.canCheck) {\n const shimProps = shimMenuItemCheckboxProps(props);\n return <MenuItemCheckbox {...shimProps} />;\n }\n\n // Nested Menu to handle submenus\n if (props.subMenuProps?.items && props.subMenuProps.items.length > 0) {\n const shimmedMenuProps = shimMenuProps(props.subMenuProps);\n const shimmedItemProps = shimMenuItemProps(props);\n\n return (\n <Menu {...shimmedMenuProps}>\n <MenuTrigger>\n <MenuItem {...shimmedItemProps} hasSubmenu />\n </MenuTrigger>\n <MenuPopover>\n <MenuList>\n {props.subMenuProps.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuList>\n </MenuPopover>\n </Menu>\n );\n }\n\n const shimProps = shimMenuItemProps(props);\n return <MenuItem {...shimProps} />;\n};\n"]}
|
|
@@ -8,9 +8,11 @@ export const shimMenuProps = props => {
|
|
|
8
8
|
};
|
|
9
9
|
export const shimMenuItemProps = props => {
|
|
10
10
|
//TODO: Handle menuItem.onRenderIcon
|
|
11
|
-
const icon = props.iconProps ? /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
+
const icon = props.iconProps ? /*#__PURE__*/React.createElement(Icon, {
|
|
12
|
+
...props.iconProps
|
|
12
13
|
}) : undefined;
|
|
13
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
...props,
|
|
14
16
|
'aria-label': props.ariaLabel,
|
|
15
17
|
children: props.text,
|
|
16
18
|
icon,
|
|
@@ -18,14 +20,14 @@ export const shimMenuItemProps = props => {
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
export const shimMenuItemCheckboxProps = props => {
|
|
21
|
-
return {
|
|
23
|
+
return {
|
|
24
|
+
...shimMenuItemProps(props),
|
|
22
25
|
name: props.text || 'name',
|
|
23
26
|
value: props.value || 'value'
|
|
24
27
|
};
|
|
25
28
|
};
|
|
26
29
|
export const shimMenuHeaderProps = props => {
|
|
27
30
|
var _a;
|
|
28
|
-
|
|
29
31
|
return {
|
|
30
32
|
children: (_a = props.sectionProps) === null || _a === void 0 ? void 0 : _a.title
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,IAAI,QAAQ,iBAAiB;AAItC,OAAO,MAAMC,aAAa,GAAIC,KAA2B,IAAwB;EAC/E,OAAO;IACLC,QAAQ,EAAED,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,KAAK,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,SAAS,CAAC;IAC7CC,aAAa,EAAEN,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,KAAK,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACG,QAAQ,IAAIH,CAAC,CAACI,OAAO;GAC9D;AACH,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAIT,KAA0B,IAAmB;EAC7E;EACA,MAAMU,IAAI,GAAGV,KAAK,CAACK,SAAS,gBAAGR,oBAACC,IAAI;IAAA,GAAKE,KAAK,CAACK;EAAS,EAAI,GAAGM,SAAS;EAExE,OAAO;IACL,GAAGX,KAAK;IACR,YAAY,EAAEA,KAAK,CAACY,SAAS;IAC7BC,QAAQ,EAAEb,KAAK,CAACc,IAAI;IACpBJ,IAAI;IACJK,gBAAgB,EAAEf,KAAK,CAACgB;GACR;AACpB,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAIjB,KAA0B,IAA2B;EAC7F,OAAO;IACL,GAAGS,iBAAiB,CAACT,KAAK,CAAC;IAC3BkB,IAAI,EAAElB,KAAK,CAACc,IAAI,IAAI,MAAM;IAC1BK,KAAK,EAAEnB,KAAK,CAACmB,KAAK,IAAI;GACvB;AACH,CAAC;AAED,OAAO,MAAMC,mBAAmB,GAAIpB,KAA0B,IAA0B;;EACtF,OAAO;IACLa,QAAQ,EAAE,WAAK,CAACQ,YAAY,0CAAEC;GAC/B;AACH,CAAC","names":["React","Icon","shimMenuProps","props","hasIcons","items","some","i","iconProps","hasCheckmarks","canCheck","checked","shimMenuItemProps","icon","undefined","ariaLabel","children","text","secondaryContent","secondaryText","shimMenuItemCheckboxProps","name","value","shimMenuHeaderProps","sectionProps","title"],"sourceRoot":"../src/","sources":["packages/react-migration-v8-v9/src/components/Menu/shimMenuProps.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Icon } from '@fluentui/react';\nimport type { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\nimport type { MenuItemProps, MenuGroupHeaderProps, MenuItemCheckboxProps, MenuProps } from '@fluentui/react-menu';\n\nexport const shimMenuProps = (props: IContextualMenuProps): Partial<MenuProps> => {\n return {\n hasIcons: props?.items.some(i => i.iconProps),\n hasCheckmarks: props?.items.some(i => i.canCheck || i.checked),\n };\n};\n\nexport const shimMenuItemProps = (props: IContextualMenuItem): MenuItemProps => {\n //TODO: Handle menuItem.onRenderIcon\n const icon = props.iconProps ? <Icon {...props.iconProps} /> : undefined;\n\n return {\n ...props,\n 'aria-label': props.ariaLabel,\n children: props.text,\n icon,\n secondaryContent: props.secondaryText,\n } as MenuItemProps;\n};\n\nexport const shimMenuItemCheckboxProps = (props: IContextualMenuItem): MenuItemCheckboxProps => {\n return {\n ...shimMenuItemProps(props),\n name: props.text || 'name',\n value: props.value || 'value',\n };\n};\n\nexport const shimMenuHeaderProps = (props: IContextualMenuItem): MenuGroupHeaderProps => {\n return {\n children: props.sectionProps?.title,\n };\n};\n"]}
|