@fluentui/react-migration-v8-v9 9.2.0 → 9.2.2
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/.swcrc +30 -0
- package/CHANGELOG.json +73 -1
- package/CHANGELOG.md +27 -2
- package/lib/components/Button/ActionButtonShim.js.map +1 -1
- package/lib/components/Button/ButtonShim.js +4 -8
- package/lib/components/Button/ButtonShim.js.map +1 -1
- package/lib/components/Button/CommandButtonShim.js +1 -2
- package/lib/components/Button/CommandButtonShim.js.map +1 -1
- package/lib/components/Button/CompoundButtonShim.js +2 -2
- package/lib/components/Button/CompoundButtonShim.js.map +1 -1
- package/lib/components/Button/DefaultButtonShim.js.map +1 -1
- package/lib/components/Button/MenuButtonShim.js +4 -10
- package/lib/components/Button/MenuButtonShim.js.map +1 -1
- package/lib/components/Button/PrimaryButtonShim.js.map +1 -1
- package/lib/components/Button/ToggleButtonShim.js.map +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/shimButtonProps.js +3 -5
- package/lib/components/Button/shimButtonProps.js.map +1 -1
- package/lib/components/Menu/MenuShim.js +12 -23
- package/lib/components/Menu/MenuShim.js.map +1 -1
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/Menu/shimMenuProps.js +3 -5
- package/lib/components/Menu/shimMenuProps.js.map +1 -1
- package/lib/components/Stack/StackItemShim.js.map +1 -1
- package/lib/components/Stack/StackShim.js.map +1 -1
- package/lib/components/Stack/index.js.map +1 -1
- package/lib/components/Stack/stackUtils.js.map +1 -1
- package/lib/components/Theme/index.js.map +1 -1
- package/lib/components/Theme/themeDuplicates.js +1 -2
- package/lib/components/Theme/themeDuplicates.js.map +1 -1
- package/lib/components/Theme/v8ThemeShim.js +0 -12
- package/lib/components/Theme/v8ThemeShim.js.map +1 -1
- package/lib/components/Theme/v9BrandVariantsShim.js.map +1 -1
- package/lib/components/Theme/v9ThemeShim.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Button/ActionButtonShim.js +21 -20
- package/lib-commonjs/components/Button/ActionButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/ButtonShim.js +25 -25
- package/lib-commonjs/components/Button/ButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/CommandButtonShim.js +9 -12
- package/lib-commonjs/components/Button/CommandButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/CompoundButtonShim.js +24 -23
- package/lib-commonjs/components/Button/CompoundButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/DefaultButtonShim.js +14 -13
- package/lib-commonjs/components/Button/DefaultButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/MenuButtonShim.js +24 -27
- package/lib-commonjs/components/Button/MenuButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/PrimaryButtonShim.js +15 -14
- package/lib-commonjs/components/Button/PrimaryButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/ToggleButtonShim.js +24 -23
- package/lib-commonjs/components/Button/ToggleButtonShim.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +13 -12
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/shimButtonProps.js +33 -28
- package/lib-commonjs/components/Button/shimButtonProps.js.map +1 -1
- package/lib-commonjs/components/Menu/MenuShim.js +42 -52
- package/lib-commonjs/components/Menu/MenuShim.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +6 -5
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/shimMenuProps.js +44 -38
- package/lib-commonjs/components/Menu/shimMenuProps.js.map +1 -1
- package/lib-commonjs/components/Stack/StackItemShim.js +195 -157
- package/lib-commonjs/components/Stack/StackItemShim.js.map +1 -1
- package/lib-commonjs/components/Stack/StackShim.js +273 -230
- package/lib-commonjs/components/Stack/StackShim.js.map +1 -1
- package/lib-commonjs/components/Stack/index.js +6 -5
- package/lib-commonjs/components/Stack/index.js.map +1 -1
- package/lib-commonjs/components/Stack/stackUtils.js +145 -151
- package/lib-commonjs/components/Stack/stackUtils.js.map +1 -1
- package/lib-commonjs/components/Theme/index.js +8 -7
- package/lib-commonjs/components/Theme/index.js.map +1 -1
- package/lib-commonjs/components/Theme/themeDuplicates.js +810 -786
- package/lib-commonjs/components/Theme/themeDuplicates.js.map +1 -1
- package/lib-commonjs/components/Theme/v8ThemeShim.js +285 -307
- package/lib-commonjs/components/Theme/v8ThemeShim.js.map +1 -1
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js +56 -61
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js.map +1 -1
- package/lib-commonjs/components/Theme/v9ThemeShim.js +183 -188
- package/lib-commonjs/components/Theme/v9ThemeShim.js.map +1 -1
- package/lib-commonjs/index.js +48 -200
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/ToggleButtonShim.js"],"sourcesContent":["import * as React from 'react';\nimport { ToggleButton } from '@fluentui/react-components';\nimport { shimButtonProps } from './shimButtonProps';\n/**\n * Shims v8 ToggleButton to render a v9 ToggleButton\n */\nexport const ToggleButtonShim = /*#__PURE__*/React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound'\n };\n const shimProps = {\n ...shimButtonProps(variantProps),\n checked: props.checked,\n defaultChecked: props.defaultChecked\n };\n return /*#__PURE__*/React.createElement(ToggleButton, {\n ...props,\n ...shimProps\n });\n});\n//# sourceMappingURL=ToggleButtonShim.js.map"],"names":["ToggleButtonShim","React","forwardRef","props","_ref","variantProps","variantClassName","primary","shimProps","shimButtonProps","checked","defaultChecked","createElement","ToggleButton"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;iCACM;iCACG;AAIzB,MAAMA,mBAAmB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,OAAS;IAC7E,MAAMC,eAAe;QACnB,GAAGF,KAAK;QACRG,kBAAkBH,MAAMI,OAAO,GAAG,+BAA+B,qBAAqB;IACxF;IACA,MAAMC,YAAY;QAChB,GAAGC,IAAAA,gCAAe,EAACJ,aAAa;QAChCK,SAASP,MAAMO,OAAO;QACtBC,gBAAgBR,MAAMQ,cAAc;IACtC;IACA,OAAO,WAAW,GAAEV,OAAMW,aAAa,CAACC,6BAAY,EAAE;QACpD,GAAGV,KAAK;QACR,GAAGK,SAAS;IACd;AACF,IACA,4CAA4C"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./ActionButtonShim"), exports);
|
|
7
|
+
_exportStar(require("./ButtonShim"), exports);
|
|
8
|
+
_exportStar(require("./CommandButtonShim"), exports);
|
|
9
|
+
_exportStar(require("./CompoundButtonShim"), exports);
|
|
10
|
+
_exportStar(require("./DefaultButtonShim"), exports);
|
|
11
|
+
_exportStar(require("./MenuButtonShim"), exports);
|
|
12
|
+
_exportStar(require("./PrimaryButtonShim"), exports);
|
|
13
|
+
_exportStar(require("./shimButtonProps"), exports);
|
|
14
|
+
_exportStar(require("./ToggleButtonShim"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
16
|
+
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/index.js"],"sourcesContent":["export * from './ActionButtonShim';\nexport * from './ButtonShim';\nexport * from './CommandButtonShim';\nexport * from './CompoundButtonShim';\nexport * from './DefaultButtonShim';\nexport * from './MenuButtonShim';\nexport * from './PrimaryButtonShim';\nexport * from './shimButtonProps';\nexport * from './ToggleButtonShim';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "shimButtonProps", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>shimButtonProps
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const shimButtonProps = props
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _react1 = require("@fluentui/react");
|
|
12
|
+
const shimButtonProps = (props)=>{
|
|
13
|
+
//TODO: Icon shim. This still renders the v8 icon.
|
|
14
|
+
const icon = props.onRenderIcon ? props.onRenderIcon(props) : props.iconProps ? /*#__PURE__*/ _react.createElement(_react1.Icon, props.iconProps) : undefined;
|
|
15
|
+
var _props_variantClassName;
|
|
16
|
+
const variantClassName = ((_props_variantClassName = props.variantClassName) !== null && _props_variantClassName !== void 0 ? _props_variantClassName : props.primary) ? 'ms-Button--primary' : 'ms-Button--default';
|
|
17
|
+
const className = [
|
|
18
|
+
props.baseClassName,
|
|
19
|
+
variantClassName,
|
|
20
|
+
props.className
|
|
21
|
+
].filter(Boolean).join(' ');
|
|
22
|
+
return {
|
|
23
|
+
// spread incoming props to propagate HTML properties not part of IBaseButtonProps
|
|
24
|
+
...props,
|
|
25
|
+
appearance: props.primary ? 'primary' : undefined,
|
|
26
|
+
className,
|
|
27
|
+
disabled: props.disabled,
|
|
28
|
+
disabledFocusable: props.allowDisabledFocus,
|
|
29
|
+
'aria-hidden': props.ariaHidden,
|
|
30
|
+
'aria-label': props.ariaLabel,
|
|
31
|
+
icon,
|
|
32
|
+
key: props.key || props.uniqueId,
|
|
33
|
+
children: props.onRenderChildren ? props.onRenderChildren(props) : props.onRenderText ? props.onRenderText(props) : props.text || props.children
|
|
34
|
+
};
|
|
35
|
+
}; //# sourceMappingURL=shimButtonProps.js.map
|
|
36
|
+
|
|
32
37
|
//# sourceMappingURL=shimButtonProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/shimButtonProps.js"],"sourcesContent":["import * as React from 'react';\nimport { Icon } from '@fluentui/react';\nexport const shimButtonProps = props => {\n //TODO: Icon shim. This still renders the v8 icon.\n const icon = props.onRenderIcon ? props.onRenderIcon(props) : props.iconProps ? /*#__PURE__*/React.createElement(Icon, props.iconProps) : undefined;\n var _props_variantClassName;\n const variantClassName = ((_props_variantClassName = props.variantClassName) !== null && _props_variantClassName !== void 0 ? _props_variantClassName : props.primary) ? 'ms-Button--primary' : 'ms-Button--default';\n const className = [props.baseClassName, variantClassName, props.className].filter(Boolean).join(' ');\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 ? props.onRenderChildren(props) : props.onRenderText ? props.onRenderText(props) : props.text || props.children\n };\n};\n//# sourceMappingURL=shimButtonProps.js.map"],"names":["shimButtonProps","props","icon","onRenderIcon","iconProps","React","createElement","Icon","undefined","_props_variantClassName","variantClassName","primary","className","baseClassName","filter","Boolean","join","appearance","disabled","disabledFocusable","allowDisabledFocus","ariaHidden","ariaLabel","key","uniqueId","children","onRenderChildren","onRenderText","text"],"mappings":";;;;+BAEaA;;aAAAA;;;6DAFU;wBACF;AACd,MAAMA,kBAAkBC,CAAAA,QAAS;IACtC,kDAAkD;IAClD,MAAMC,OAAOD,MAAME,YAAY,GAAGF,MAAME,YAAY,CAACF,SAASA,MAAMG,SAAS,GAAG,WAAW,GAAEC,OAAMC,aAAa,CAACC,YAAI,EAAEN,MAAMG,SAAS,IAAII,SAAS;IACnJ,IAAIC;IACJ,MAAMC,mBAAmB,AAAC,CAAA,AAACD,CAAAA,0BAA0BR,MAAMS,gBAAgB,AAAD,MAAO,IAAI,IAAID,4BAA4B,KAAK,IAAIA,0BAA0BR,MAAMU,OAAO,AAAD,IAAK,uBAAuB,oBAAoB;IACpN,MAAMC,YAAY;QAACX,MAAMY,aAAa;QAAEH;QAAkBT,MAAMW,SAAS;KAAC,CAACE,MAAM,CAACC,SAASC,IAAI,CAAC;IAChG,OAAO;QACL,kFAAkF;QAClF,GAAGf,KAAK;QACRgB,YAAYhB,MAAMU,OAAO,GAAG,YAAYH,SAAS;QACjDI;QACAM,UAAUjB,MAAMiB,QAAQ;QACxBC,mBAAmBlB,MAAMmB,kBAAkB;QAC3C,eAAenB,MAAMoB,UAAU;QAC/B,cAAcpB,MAAMqB,SAAS;QAC7BpB;QACAqB,KAAKtB,MAAMsB,GAAG,IAAItB,MAAMuB,QAAQ;QAChCC,UAAUxB,MAAMyB,gBAAgB,GAAGzB,MAAMyB,gBAAgB,CAACzB,SAASA,MAAM0B,YAAY,GAAG1B,MAAM0B,YAAY,CAAC1B,SAASA,MAAM2B,IAAI,IAAI3B,MAAMwB,QAAQ;IAClJ;AACF,GACA,2CAA2C"}
|
|
@@ -1,56 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "MenuItemShim", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>MenuItemShim
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const MenuItemShim = props
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})), React.createElement(react_components_1.MenuPopover, null, React.createElement(react_components_1.MenuList, null, props.subMenuProps.items.map(item =>
|
|
44
|
-
// key is added through item spread
|
|
45
|
-
// eslint-disable-next-line react/jsx-key
|
|
46
|
-
React.createElement(exports.MenuItemShim, {
|
|
47
|
-
...item
|
|
48
|
-
})))));
|
|
49
|
-
}
|
|
50
|
-
const shimProps = shimMenuProps_1.shimMenuItemProps(props);
|
|
51
|
-
return React.createElement(react_components_1.MenuItem, {
|
|
52
|
-
...shimProps
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
exports.MenuItemShim = MenuItemShim;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _react1 = require("@fluentui/react");
|
|
12
|
+
const _reactComponents = require("@fluentui/react-components");
|
|
13
|
+
const _shimMenuProps = require("./shimMenuProps");
|
|
14
|
+
const MenuItemShim = (props)=>{
|
|
15
|
+
var _props_subMenuProps;
|
|
16
|
+
if (props.itemType === _react1.ContextualMenuItemType.Divider) {
|
|
17
|
+
const shimProps = (0, _shimMenuProps.shimMenuItemProps)(props);
|
|
18
|
+
return /*#__PURE__*/ _react.createElement(_reactComponents.MenuDivider, shimProps);
|
|
19
|
+
}
|
|
20
|
+
if (props.itemType === _react1.ContextualMenuItemType.Section) {
|
|
21
|
+
var _props_subMenuProps1;
|
|
22
|
+
const shimProps = (0, _shimMenuProps.shimMenuHeaderProps)(props);
|
|
23
|
+
return /*#__PURE__*/ _react.createElement(_reactComponents.MenuGroup, null, /*#__PURE__*/ _react.createElement(_reactComponents.MenuGroupHeader, null, shimProps.children), (_props_subMenuProps1 = props.subMenuProps) === null || _props_subMenuProps1 === void 0 ? void 0 : _props_subMenuProps1.items.map((item)=>// key is added through item spread
|
|
24
|
+
// eslint-disable-next-line react/jsx-key
|
|
25
|
+
/*#__PURE__*/ _react.createElement(MenuItemShim, item)));
|
|
26
|
+
}
|
|
27
|
+
if (props.canCheck) {
|
|
28
|
+
const shimProps = (0, _shimMenuProps.shimMenuItemCheckboxProps)(props);
|
|
29
|
+
return /*#__PURE__*/ _react.createElement(_reactComponents.MenuItemCheckbox, shimProps);
|
|
30
|
+
}
|
|
31
|
+
// Nested Menu to handle submenus
|
|
32
|
+
if (((_props_subMenuProps = props.subMenuProps) === null || _props_subMenuProps === void 0 ? void 0 : _props_subMenuProps.items) && props.subMenuProps.items.length > 0) {
|
|
33
|
+
const shimmedMenuProps = (0, _shimMenuProps.shimMenuProps)(props.subMenuProps);
|
|
34
|
+
const shimmedItemProps = (0, _shimMenuProps.shimMenuItemProps)(props);
|
|
35
|
+
return /*#__PURE__*/ _react.createElement(_reactComponents.Menu, shimmedMenuProps, /*#__PURE__*/ _react.createElement(_reactComponents.MenuTrigger, null, /*#__PURE__*/ _react.createElement(_reactComponents.MenuItem, {
|
|
36
|
+
...shimmedItemProps,
|
|
37
|
+
hasSubmenu: true
|
|
38
|
+
})), /*#__PURE__*/ _react.createElement(_reactComponents.MenuPopover, null, /*#__PURE__*/ _react.createElement(_reactComponents.MenuList, null, props.subMenuProps.items.map((item)=>// key is added through item spread
|
|
39
|
+
// eslint-disable-next-line react/jsx-key
|
|
40
|
+
/*#__PURE__*/ _react.createElement(MenuItemShim, item)))));
|
|
41
|
+
}
|
|
42
|
+
const shimProps = (0, _shimMenuProps.shimMenuItemProps)(props);
|
|
43
|
+
return /*#__PURE__*/ _react.createElement(_reactComponents.MenuItem, shimProps);
|
|
44
|
+
}; //# sourceMappingURL=MenuShim.js.map
|
|
45
|
+
|
|
56
46
|
//# sourceMappingURL=MenuShim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Menu/MenuShim.js"],"sourcesContent":["import * as React from 'react';\nimport { ContextualMenuItemType } from '@fluentui/react';\nimport { MenuItem, MenuDivider, MenuGroup, MenuGroupHeader, MenuTrigger, Menu, MenuList, MenuPopover, MenuItemCheckbox } from '@fluentui/react-components';\nimport { shimMenuHeaderProps, shimMenuItemCheckboxProps, shimMenuItemProps, shimMenuProps } from './shimMenuProps';\nexport const MenuItemShim = props => {\n var _props_subMenuProps;\n if (props.itemType === ContextualMenuItemType.Divider) {\n const shimProps = shimMenuItemProps(props);\n return /*#__PURE__*/React.createElement(MenuDivider, shimProps);\n }\n if (props.itemType === ContextualMenuItemType.Section) {\n var _props_subMenuProps1;\n const shimProps = shimMenuHeaderProps(props);\n return /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(MenuGroupHeader, null, shimProps.children), (_props_subMenuProps1 = props.subMenuProps) === null || _props_subMenuProps1 === void 0 ? void 0 : _props_subMenuProps1.items.map(item =>\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n /*#__PURE__*/\n React.createElement(MenuItemShim, item)));\n }\n if (props.canCheck) {\n const shimProps = shimMenuItemCheckboxProps(props);\n return /*#__PURE__*/React.createElement(MenuItemCheckbox, shimProps);\n }\n // Nested Menu to handle submenus\n if (((_props_subMenuProps = props.subMenuProps) === null || _props_subMenuProps === void 0 ? void 0 : _props_subMenuProps.items) && props.subMenuProps.items.length > 0) {\n const shimmedMenuProps = shimMenuProps(props.subMenuProps);\n const shimmedItemProps = shimMenuItemProps(props);\n return /*#__PURE__*/React.createElement(Menu, shimmedMenuProps, /*#__PURE__*/React.createElement(MenuTrigger, null, /*#__PURE__*/React.createElement(MenuItem, {\n ...shimmedItemProps,\n hasSubmenu: true\n })), /*#__PURE__*/React.createElement(MenuPopover, null, /*#__PURE__*/React.createElement(MenuList, null, props.subMenuProps.items.map(item =>\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n /*#__PURE__*/\n React.createElement(MenuItemShim, item)))));\n }\n const shimProps = shimMenuItemProps(props);\n return /*#__PURE__*/React.createElement(MenuItem, shimProps);\n};\n//# sourceMappingURL=MenuShim.js.map"],"names":["MenuItemShim","props","_props_subMenuProps","itemType","ContextualMenuItemType","Divider","shimProps","shimMenuItemProps","React","createElement","MenuDivider","Section","_props_subMenuProps1","shimMenuHeaderProps","MenuGroup","MenuGroupHeader","children","subMenuProps","items","map","item","canCheck","shimMenuItemCheckboxProps","MenuItemCheckbox","length","shimmedMenuProps","shimMenuProps","shimmedItemProps","Menu","MenuTrigger","MenuItem","hasSubmenu","MenuPopover","MenuList"],"mappings":";;;;+BAIaA;;aAAAA;;;6DAJU;wBACgB;iCACuF;+BAC7B;AAC1F,MAAMA,eAAeC,CAAAA,QAAS;IACnC,IAAIC;IACJ,IAAID,MAAME,QAAQ,KAAKC,8BAAsB,CAACC,OAAO,EAAE;QACrD,MAAMC,YAAYC,IAAAA,gCAAiB,EAACN;QACpC,OAAO,WAAW,GAAEO,OAAMC,aAAa,CAACC,4BAAW,EAAEJ;IACvD,CAAC;IACD,IAAIL,MAAME,QAAQ,KAAKC,8BAAsB,CAACO,OAAO,EAAE;QACrD,IAAIC;QACJ,MAAMN,YAAYO,IAAAA,kCAAmB,EAACZ;QACtC,OAAO,WAAW,GAAEO,OAAMC,aAAa,CAACK,0BAAS,EAAE,IAAI,EAAE,WAAW,GAAEN,OAAMC,aAAa,CAACM,gCAAe,EAAE,IAAI,EAAET,UAAUU,QAAQ,GAAG,AAACJ,CAAAA,uBAAuBX,MAAMgB,YAAY,AAAD,MAAO,IAAI,IAAIL,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBM,KAAK,CAACC,GAAG,CAACC,CAAAA,OACxQ,mCAAmC;YACnC,yCAAyC;YACzC,WAAW,GACXZ,OAAMC,aAAa,CAACT,cAAcoB,MAAM;IAC1C,CAAC;IACD,IAAInB,MAAMoB,QAAQ,EAAE;QAClB,MAAMf,YAAYgB,IAAAA,wCAAyB,EAACrB;QAC5C,OAAO,WAAW,GAAEO,OAAMC,aAAa,CAACc,iCAAgB,EAAEjB;IAC5D,CAAC;IACD,iCAAiC;IACjC,IAAI,AAAC,CAAA,AAACJ,CAAAA,sBAAsBD,MAAMgB,YAAY,AAAD,MAAO,IAAI,IAAIf,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBgB,KAAK,AAAD,KAAMjB,MAAMgB,YAAY,CAACC,KAAK,CAACM,MAAM,GAAG,GAAG;QACvK,MAAMC,mBAAmBC,IAAAA,4BAAa,EAACzB,MAAMgB,YAAY;QACzD,MAAMU,mBAAmBpB,IAAAA,gCAAiB,EAACN;QAC3C,OAAO,WAAW,GAAEO,OAAMC,aAAa,CAACmB,qBAAI,EAAEH,kBAAkB,WAAW,GAAEjB,OAAMC,aAAa,CAACoB,4BAAW,EAAE,IAAI,EAAE,WAAW,GAAErB,OAAMC,aAAa,CAACqB,yBAAQ,EAAE;YAC7J,GAAGH,gBAAgB;YACnBI,YAAY,IAAI;QAClB,KAAK,WAAW,GAAEvB,OAAMC,aAAa,CAACuB,4BAAW,EAAE,IAAI,EAAE,WAAW,GAAExB,OAAMC,aAAa,CAACwB,yBAAQ,EAAE,IAAI,EAAEhC,MAAMgB,YAAY,CAACC,KAAK,CAACC,GAAG,CAACC,CAAAA,OACvI,mCAAmC;YACnC,yCAAyC;YACzC,WAAW,GACXZ,OAAMC,aAAa,CAACT,cAAcoB;IACpC,CAAC;IACD,MAAMd,YAAYC,IAAAA,gCAAiB,EAACN;IACpC,OAAO,WAAW,GAAEO,OAAMC,aAAa,CAACqB,yBAAQ,EAAExB;AACpD,GACA,oCAAoC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./MenuShim"), exports);
|
|
7
|
+
_exportStar(require("./shimMenuProps"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Menu/index.js"],"sourcesContent":["export * from './MenuShim';\nexport * from './shimMenuProps';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;CACd,iCAAiC"}
|
|
@@ -1,45 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
secondaryContent: props.secondaryText
|
|
27
|
-
};
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
shimMenuProps: ()=>shimMenuProps,
|
|
13
|
+
shimMenuItemProps: ()=>shimMenuItemProps,
|
|
14
|
+
shimMenuItemCheckboxProps: ()=>shimMenuItemCheckboxProps,
|
|
15
|
+
shimMenuHeaderProps: ()=>shimMenuHeaderProps
|
|
16
|
+
});
|
|
17
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
18
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
19
|
+
const _react1 = require("@fluentui/react");
|
|
20
|
+
const shimMenuProps = (props)=>{
|
|
21
|
+
return {
|
|
22
|
+
hasIcons: props === null || props === void 0 ? void 0 : props.items.some((i)=>i.iconProps),
|
|
23
|
+
hasCheckmarks: props === null || props === void 0 ? void 0 : props.items.some((i)=>i.canCheck || i.checked)
|
|
24
|
+
};
|
|
28
25
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const shimMenuItemProps = (props)=>{
|
|
27
|
+
//TODO: Handle menuItem.onRenderIcon
|
|
28
|
+
const icon = props.iconProps ? /*#__PURE__*/ _react.createElement(_react1.Icon, props.iconProps) : undefined;
|
|
29
|
+
return {
|
|
30
|
+
...props,
|
|
31
|
+
'aria-label': props.ariaLabel,
|
|
32
|
+
children: props.text,
|
|
33
|
+
icon,
|
|
34
|
+
secondaryContent: props.secondaryText
|
|
35
|
+
};
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const shimMenuItemCheckboxProps = (props)=>{
|
|
38
|
+
return {
|
|
39
|
+
...shimMenuItemProps(props),
|
|
40
|
+
name: props.text || 'name',
|
|
41
|
+
value: props.value || 'value'
|
|
42
|
+
};
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
const shimMenuHeaderProps = (props)=>{
|
|
45
|
+
var _props_sectionProps;
|
|
46
|
+
return {
|
|
47
|
+
children: (_props_sectionProps = props.sectionProps) === null || _props_sectionProps === void 0 ? void 0 : _props_sectionProps.title
|
|
48
|
+
};
|
|
49
|
+
}; //# sourceMappingURL=shimMenuProps.js.map
|
|
50
|
+
|
|
45
51
|
//# sourceMappingURL=shimMenuProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Menu/shimMenuProps.js"],"sourcesContent":["import * as React from 'react';\nimport { Icon } from '@fluentui/react';\nexport const shimMenuProps = props => {\n return {\n hasIcons: props === null || props === void 0 ? void 0 : props.items.some(i => i.iconProps),\n hasCheckmarks: props === null || props === void 0 ? void 0 : props.items.some(i => i.canCheck || i.checked)\n };\n};\nexport const shimMenuItemProps = props => {\n //TODO: Handle menuItem.onRenderIcon\n const icon = props.iconProps ? /*#__PURE__*/React.createElement(Icon, props.iconProps) : undefined;\n return {\n ...props,\n 'aria-label': props.ariaLabel,\n children: props.text,\n icon,\n secondaryContent: props.secondaryText\n };\n};\nexport const shimMenuItemCheckboxProps = props => {\n return {\n ...shimMenuItemProps(props),\n name: props.text || 'name',\n value: props.value || 'value'\n };\n};\nexport const shimMenuHeaderProps = props => {\n var _props_sectionProps;\n return {\n children: (_props_sectionProps = props.sectionProps) === null || _props_sectionProps === void 0 ? void 0 : _props_sectionProps.title\n };\n};\n//# sourceMappingURL=shimMenuProps.js.map"],"names":["shimMenuProps","shimMenuItemProps","shimMenuItemCheckboxProps","shimMenuHeaderProps","props","hasIcons","items","some","i","iconProps","hasCheckmarks","canCheck","checked","icon","React","createElement","Icon","undefined","ariaLabel","children","text","secondaryContent","secondaryText","name","value","_props_sectionProps","sectionProps","title"],"mappings":";;;;;;;;;;;IAEaA,aAAa,MAAbA;IAMAC,iBAAiB,MAAjBA;IAWAC,yBAAyB,MAAzBA;IAOAC,mBAAmB,MAAnBA;;;6DA1BU;wBACF;AACd,MAAMH,gBAAgBI,CAAAA,QAAS;IACpC,OAAO;QACLC,UAAUD,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAME,KAAK,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAEC,SAAS,CAAC;QAC1FC,eAAeN,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAME,KAAK,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAEG,QAAQ,IAAIH,EAAEI,OAAO,CAAC;IAC7G;AACF;AACO,MAAMX,oBAAoBG,CAAAA,QAAS;IACxC,oCAAoC;IACpC,MAAMS,OAAOT,MAAMK,SAAS,GAAG,WAAW,GAAEK,OAAMC,aAAa,CAACC,YAAI,EAAEZ,MAAMK,SAAS,IAAIQ,SAAS;IAClG,OAAO;QACL,GAAGb,KAAK;QACR,cAAcA,MAAMc,SAAS;QAC7BC,UAAUf,MAAMgB,IAAI;QACpBP;QACAQ,kBAAkBjB,MAAMkB,aAAa;IACvC;AACF;AACO,MAAMpB,4BAA4BE,CAAAA,QAAS;IAChD,OAAO;QACL,GAAGH,kBAAkBG,MAAM;QAC3BmB,MAAMnB,MAAMgB,IAAI,IAAI;QACpBI,OAAOpB,MAAMoB,KAAK,IAAI;IACxB;AACF;AACO,MAAMrB,sBAAsBC,CAAAA,QAAS;IAC1C,IAAIqB;IACJ,OAAO;QACLN,UAAU,AAACM,CAAAA,sBAAsBrB,MAAMsB,YAAY,AAAD,MAAO,IAAI,IAAID,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBE,KAAK;IACtI;AACF,GACA,yCAAyC"}
|