@aliwind/rc-console-menu
Version:
React component for Alibaba Cloud.
1 lines • 3.72 kB
JSON
{"remainingRequest":"/Users/csr/workspace/open-component/node_modules/thread-loader/dist/cjs.js??ref--9-1!/Users/csr/workspace/open-component/node_modules/@breezr/plugin-typescript/node_modules/ts-loader/index.js??ref--9-2!/Users/csr/workspace/open-component/packages/rc-console-menu/src/utils.tsx","dependencies":[{"path":"/Users/csr/workspace/open-component/packages/rc-console-menu/src/utils.tsx","mtime":1572582220682},{"path":"/Users/csr/workspace/open-component/node_modules/cache-loader/dist/cjs.js","mtime":1571812248602},{"path":"/Users/csr/workspace/open-component/node_modules/thread-loader/dist/cjs.js","mtime":1571812248618},{"path":"/Users/csr/workspace/open-component/node_modules/@breezr/plugin-typescript/node_modules/ts-loader/index.js","mtime":1571882237140}],"contextDependencies":[],"result":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport React from 'react';\nimport { ConfigProvider } from '@aliwind/component';\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * @param {Number} level\n */\nexport var getPriority = function (level) {\n return new Array(level).fill('&').join('');\n};\n/**\n * Checks if value is `null` or `undefined`\n * @param {*} value\n * @return {Boolean}\n */\nexport var isNil = function (value) { return value == null; };\nexport function GetFusionConfig(Wrapped) {\n var ConfifgConsumer = ConfigProvider.Consumer;\n var HOC = function (props) { return (React.createElement(ConfifgConsumer, null, function (context) { return (React.createElement(Wrapped, __assign({}, props, { fusionConfig: context }))); })); };\n return HOC;\n}\n",{"version":3,"file":"/Users/csr/workspace/open-component/packages/rc-console-menu/src/utils.tsx","sourceRoot":"","sources":["/Users/csr/workspace/open-component/packages/rc-console-menu/src/utils.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,uDAAuD;AAEvD;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAAa;IACvC,OAAA,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAAnC,CAAmC,CAAA;AAErC;;;;GAIG;AACH,MAAM,CAAC,IAAM,KAAK,GAAG,UAAC,KAAU,IAAgC,OAAA,KAAK,IAAI,IAAI,EAAb,CAAa,CAAA;AAE7E,MAAM,UAAU,eAAe,CAC7B,OAAsC;IAEtC,IAAM,eAAe,GAAS,cAAsB,CAAC,QAAQ,CAAA;IAC7D,IAAM,GAAG,GAA6C,UAAA,KAAK,IAAI,OAAA,CAC7D,oBAAC,eAAe,QACb,UAAC,OAAY,IAAK,OAAA,CACjB,oBAAC,OAAO,eAAM,KAAkB,IAAE,YAAY,EAAE,OAAO,IAAI,CAC5D,EAFkB,CAElB,CACe,CACnB,EAN8D,CAM9D,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import React from 'react'\nimport { ConfigProvider } from '@aliwind/component'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * @param {Number} level\n */\nexport const getPriority = (level: number) =>\n new Array(level).fill('&').join('')\n\n/**\n * Checks if value is `null` or `undefined`\n * @param {*} value\n * @return {Boolean}\n */\nexport const isNil = (value: any): value is undefined | null => value == null\n\nexport function GetFusionConfig<PropType extends { fusionConfig: any }>(\n Wrapped: React.ComponentType<PropType>\n) {\n const ConfifgConsumer: any = (ConfigProvider as any).Consumer\n const HOC: React.FC<Omit<PropType, 'fusionConfig'>> = props => (\n <ConfifgConsumer>\n {(context: any) => (\n <Wrapped {...(props as PropType)} fusionConfig={context} />\n )}\n </ConfifgConsumer>\n )\n return HOC\n}\n"]}]}