@zohodesk/react-cli 0.0.1-exp.169.2 → 0.0.1-exp.175.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintignore +7 -7
- package/.eslintrc.js +180 -179
- package/.prettierrc +6 -6
- package/README.md +1028 -951
- package/bin/cli.js +483 -483
- package/cert/Tsicsezwild-22-23.crt +37 -37
- package/cert/Tsicsezwild-22-23.key +27 -27
- package/docs/CustomChunks.md +26 -26
- package/docs/DevStart.md +18 -18
- package/docs/HoverActive.md +12 -12
- package/docs/InstallNode.md +28 -28
- package/docs/TODOS.md +10 -10
- package/docs/ValueReplacer.md +60 -60
- package/docs/VariableConversion.md +678 -0
- package/docs/warnings_while_install.txt +35 -35
- package/files/eslintrc.js +62 -62
- package/files/prettierrc.js +3 -3
- package/lib/babel/cmjs-plugins-presets.js +0 -4
- package/lib/babel/es-plugins-presets.js +0 -4
- package/lib/common/getEntries.js +0 -10
- package/lib/common/getPublicPathConfig.js +0 -6
- package/lib/common/index.js +0 -5
- package/lib/common/splitChunks.js +2 -13
- package/lib/common/sslcertUpdater.js +6 -17
- package/lib/common/templateParameters.js +0 -2
- package/lib/common/testPattern.js +10 -21
- package/lib/common/valueReplacer.js +0 -15
- package/lib/configs/jest.config.js +8 -21
- package/lib/configs/libAlias.js +11 -2
- package/lib/configs/webpack.component.umd.config.js +0 -5
- package/lib/configs/webpack.css.umd.config.js +5 -13
- package/lib/configs/webpack.dev.config.js +13 -24
- package/lib/configs/webpack.docs.config.js +6 -12
- package/lib/configs/webpack.impact.config.js +6 -10
- package/lib/configs/webpack.prod.config.js +15 -26
- package/lib/hooks/docsProptypeHook.js +3 -7
- package/lib/jest/commitedFilesResult.js +3 -45
- package/lib/jest/coverageCollector.js +0 -11
- package/lib/jest/jsonMaker.js +0 -6
- package/lib/jest/preProcessors/cssPreprocessor.js +14 -13
- package/lib/jest/preProcessors/jsPreprocessor.js +0 -2
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +0 -3
- package/lib/jest/result.js +0 -22
- package/lib/jest/run.js +6 -17
- package/lib/jest/setup.js +5 -57
- package/lib/loaderUtils/configsAssetsLoaders.js +34 -44
- package/lib/loaderUtils/getCSSLoaders.js +41 -28
- package/lib/loaderUtils/getDevJsLoaders.js +0 -8
- package/lib/loaderUtils/index.js +0 -3
- package/lib/loaders/docsLoader.js +0 -7
- package/lib/loaders/docsPropsLoader.js +3 -7
- package/lib/loaders/fileBountryLoader.js +0 -2
- package/lib/loaders/fileLoader.js +11 -22
- package/lib/loaders/scriptInstrumentLoader.js +5 -13
- package/lib/loaders/selectorMappingLoader.js +7 -25
- package/lib/loaders/workerLoader.js +13 -29
- package/lib/middlewares/HMRMiddleware.js +13 -26
- package/lib/middlewares/SSTMiddleware.js +0 -3
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +53 -0
- package/lib/pluginUtils/getDevPlugins.js +20 -64
- package/lib/pluginUtils/getDocsPlugins.js +1 -10
- package/lib/pluginUtils/getLibraryImactPlugins.js +4 -5
- package/lib/pluginUtils/getLibraryPlugins.js +0 -5
- package/lib/pluginUtils/getProdPlugins.js +32 -78
- package/lib/pluginUtils/getServerPlugins.js +0 -5
- package/lib/pluginUtils/getUMDCSSPlugins.js +0 -7
- package/lib/pluginUtils/getUMDComponentPlugins.js +0 -7
- package/lib/pluginUtils/index.js +0 -8
- package/lib/plugins/CdnChangePlugin.js +0 -14
- package/lib/plugins/CleanupStatsPlugin.js +0 -5
- package/lib/plugins/EFCPlugin.js +23 -34
- package/lib/plugins/EFCPlugin.md +6 -6
- package/lib/plugins/EFCTemplatePlugin.js +23 -32
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +12 -38
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +12 -17
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +46 -77
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +44 -59
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +21 -30
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
- package/lib/plugins/I18nSplitPlugin/README.md +25 -25
- package/lib/plugins/I18nSplitPlugin/index.js +70 -80
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +0 -6
- package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +2 -20
- package/lib/plugins/ManifestPlugin.js +0 -17
- package/lib/plugins/ModuleStatsPlugin.js +0 -23
- package/lib/plugins/OptimizeJSPlugin.js +0 -7
- package/lib/plugins/PublicPathCallbackPlugin.js +0 -10
- package/lib/plugins/PublicPathChangePlugin.js +4 -36
- package/lib/plugins/ReportGeneratePlugin.js +4 -30
- package/lib/plugins/RequireVariablePublicPlugin.js +0 -6
- package/lib/plugins/ResourceHintsPlugin.js +20 -27
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +23 -38
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
- package/lib/plugins/ScriptInstrumentPlugin.js +0 -7
- package/lib/plugins/ServiceWorkerPlugin.js +13 -29
- package/lib/plugins/ShadowDOMSupportPlugin.js +3 -40
- package/lib/plugins/SourceMapHookPlugin.js +0 -9
- package/lib/plugins/TPHashMappingPlugin.js +5 -19
- package/lib/plugins/UglifyCSSPlugin.js +0 -9
- package/lib/plugins/UnusedFilesFindPlugin.js +2 -35
- package/lib/plugins/index.js +0 -19
- package/lib/plugins/libraryImpactPlugin.js +0 -32
- package/lib/plugins/webpackwatchrunplugin.js +0 -5
- package/lib/postcss-plugins/ExcludePlugin.js +0 -4
- package/lib/postcss-plugins/RTLSplitPlugin.js +24 -37
- package/lib/postcss-plugins/ValueReplacer.js +9 -6
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
- package/lib/postcss-plugins/__test__/test1Input.css +38 -38
- package/lib/postcss-plugins/__test__/test1Output.css +38 -38
- package/lib/postcss-plugins/hoverActivePlugin.js +80 -92
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +31 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +232 -0
- package/lib/postcss-plugins/variableModifier.js +14 -20
- package/lib/schemas/index.js +28 -13
- package/lib/servers/clusterHubServer.js +0 -10
- package/lib/servers/devBuild.js +13 -24
- package/lib/servers/docsServer.js +0 -2
- package/lib/servers/docsServerCore.js +0 -21
- package/lib/servers/getCliPath.js +1 -10
- package/lib/servers/helpServer.js +0 -5
- package/lib/servers/httpsOptions.js +0 -4
- package/lib/servers/impactServer.js +2 -34
- package/lib/servers/mockserver.js +0 -9
- package/lib/servers/nowatchserver.js +12 -34
- package/lib/servers/scrServer.js +13 -20
- package/lib/servers/server.js +7 -35
- package/lib/servers/ssServer.js +0 -16
- package/lib/sh/pre-commit.sh +34 -34
- package/lib/sh/reportPublish.sh +45 -45
- package/lib/templates/CoverageScriptTemplate.js +0 -14
- package/lib/templates/WMSTemplate.js +6 -12
- package/lib/utils/babelPresets.js +0 -2
- package/lib/utils/buildstats.html +148 -148
- package/lib/utils/clean.js +2 -8
- package/lib/utils/copy.js +0 -6
- package/lib/utils/copyTimezones.js +0 -8
- package/lib/utils/createEventStream.js +0 -4
- package/lib/utils/cssClassNameGenerate.js +3 -19
- package/lib/utils/cssURLReplacer.js +0 -25
- package/lib/utils/dependencyPostPublish.js +0 -9
- package/lib/utils/fileUtils.js +0 -26
- package/lib/utils/folderIterator.js +0 -10
- package/lib/utils/getComponents.js +0 -21
- package/lib/utils/getCurrentBranch.js +0 -5
- package/lib/utils/getDependenciesImpactList.js +0 -21
- package/lib/utils/getHash.js +0 -7
- package/lib/utils/getIp.js +0 -2
- package/lib/utils/getOptions.js +38 -35
- package/lib/utils/getServerURL.js +0 -7
- package/lib/utils/index.js +2 -47
- package/lib/utils/init.js +0 -1
- package/lib/utils/initPreCommitHook.js +6 -29
- package/lib/utils/jsonHelper.js +2 -19
- package/lib/utils/libraryImpactConfig.js +0 -2
- package/lib/utils/lint/addScripts.js +2 -5
- package/lib/utils/lint/checkExistingConfig.js +3 -12
- package/lib/utils/lint/copyConfigs.js +0 -3
- package/lib/utils/lint/index.js +0 -9
- package/lib/utils/lint/lintScripts.js +0 -1
- package/lib/utils/lint/lintSetup.js +3 -4
- package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
- package/lib/utils/lint/question.js +0 -7
- package/lib/utils/lintReporter.js +0 -20
- package/lib/utils/mailSender.js +0 -7
- package/lib/utils/pullOrigin.js +0 -4
- package/lib/utils/reinstallDependencies.js +0 -28
- package/lib/utils/removeAttributes.js +0 -7
- package/lib/utils/repoClone.js +2 -27
- package/lib/utils/request.js +0 -12
- package/lib/utils/resultSchema.json +73 -73
- package/lib/utils/rtl.js +4 -16
- package/lib/utils/setEnvVariables.js +0 -2
- package/lib/utils/ssTestHack.js +0 -10
- package/lib/utils/switchBranch.js +0 -4
- package/lib/utils/urlConcat.js +0 -4
- package/lib/utils/useExitCleanup.js +9 -10
- package/npm8.md +9 -9
- package/package.json +146 -148
- package/postpublish.js +6 -6
- package/templates/app/.eslintrc.js +140 -140
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -24
- package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
- package/templates/app/app/properties/i18nkeys.json +3 -3
- package/templates/app/docs/all.html +69 -69
- package/templates/app/mockapi/index.js +18 -18
- package/templates/app/package.json +37 -37
- package/templates/app/src/actions/SampleActions/index.js +37 -37
- package/templates/app/src/actions/index.js +65 -65
- package/templates/app/src/appUrls.js +19 -19
- package/templates/app/src/components/Alert/Alert.js +134 -134
- package/templates/app/src/components/Alert/Alert.module.css +79 -79
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
- package/templates/app/src/components/Sample/Sample.module.css +11 -11
- package/templates/app/src/components/Sample/SampleList.js +61 -61
- package/templates/app/src/components/Slider/Slider.css +41 -41
- package/templates/app/src/components/Slider/Slider.js +55 -55
- package/templates/app/src/containers/AlertContainer/index.js +15 -15
- package/templates/app/src/containers/AppContainer/index.js +96 -96
- package/templates/app/src/containers/AppContainer/index.module.css +27 -27
- package/templates/app/src/containers/CustomMatch/index.js +65 -65
- package/templates/app/src/containers/DevTools/index.js +10 -10
- package/templates/app/src/containers/Header/index.js +67 -67
- package/templates/app/src/containers/Header/index.module.css +43 -43
- package/templates/app/src/containers/Redirect/index.js +63 -63
- package/templates/app/src/containers/Redirector/index.js +47 -47
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
- package/templates/app/src/historyChange.js +5 -5
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +24 -24
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
- package/templates/app/src/reducers/alertData.js +11 -11
- package/templates/app/src/reducers/index.js +6 -6
- package/templates/app/src/reducers/samples.js +19 -19
- package/templates/app/src/store/configureStore.dev.js +51 -51
- package/templates/app/src/store/configureStore.js +5 -5
- package/templates/app/src/store/configureStore.prod.js +26 -26
- package/templates/app/src/util/Common.js +5 -5
- package/templates/app/src/util/RequestAPI.js +132 -132
- package/templates/docs/all.html +249 -249
- package/templates/docs/component.html +178 -178
- package/templates/docs/components.html +221 -221
- package/templates/docs/css/b.min.css +6 -6
- package/templates/docs/css/component.css +42 -42
- package/templates/docs/css/componentTest.css +6 -6
- package/templates/docs/css/hopscotch.css +585 -585
- package/templates/docs/css/style.css +1022 -1022
- package/templates/docs/impactReportTemplate.html +154 -154
- package/templates/docs/index.html +1501 -1493
- package/templates/docs/js/active-line.js +72 -72
- package/templates/docs/js/b.min.js +7 -7
- package/templates/docs/js/codemirror.js +9680 -9680
- package/templates/docs/js/designTokens.js +334 -334
- package/templates/docs/js/j.min.js +4 -4
- package/templates/docs/js/javascript.js +874 -874
- package/templates/docs/js/matchbrackets.js +145 -145
@@ -1,96 +1,96 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { PropTypes } from "prop-types";
|
3
|
-
import { connect } from "react-redux";
|
4
|
-
import CustomMatch from "../CustomMatch";
|
5
|
-
import Redirector from "../Redirector";
|
6
|
-
import { Container, Box } from "@zohodesk/components";
|
7
|
-
import style from "./index.module.css";
|
8
|
-
import Header from "../Header";
|
9
|
-
import SampleListContainer from "../SampleListContainer/ListContainer";
|
10
|
-
|
11
|
-
import { push, alertAction } from "../../actions";
|
12
|
-
|
13
|
-
class AppContainer extends React.Component {
|
14
|
-
constructor(props) {
|
15
|
-
super(props);
|
16
|
-
this.state = {};
|
17
|
-
}
|
18
|
-
componentDidMount() {
|
19
|
-
/*const { showConfirmBox } = this.props;
|
20
|
-
|
21
|
-
showConfirmBox({
|
22
|
-
type: "confirmation",
|
23
|
-
submitText: "Yes",
|
24
|
-
cancelText: "Cancel",
|
25
|
-
title: "Alert",
|
26
|
-
iconName: "notifiExclamation",
|
27
|
-
message: "Are you sure?",
|
28
|
-
isActive: true,
|
29
|
-
palette: "danger"
|
30
|
-
})
|
31
|
-
.then(() => {
|
32
|
-
logger.log("Suceess");
|
33
|
-
})
|
34
|
-
.catch(() => {
|
35
|
-
logger.log("Cancel");
|
36
|
-
});*/
|
37
|
-
}
|
38
|
-
render() {
|
39
|
-
const { alertData, paramMap = {} } = this.props;
|
40
|
-
|
41
|
-
return (
|
42
|
-
<Container
|
43
|
-
className={style.deskContainer}
|
44
|
-
onMouseOver={this.handleOver}
|
45
|
-
scroll="none"
|
46
|
-
tagName="div"
|
47
|
-
>
|
48
|
-
<Redirector />
|
49
|
-
|
50
|
-
<Box tagName="header">
|
51
|
-
<Header />
|
52
|
-
</Box>
|
53
|
-
|
54
|
-
<Box className={style.posrel} flexible tagName="section">
|
55
|
-
<Container
|
56
|
-
alignBox="row"
|
57
|
-
className={`${style.container}`}
|
58
|
-
tagName="section"
|
59
|
-
>
|
60
|
-
<Box className={""} flexible tagName="article" scroll="vertical">
|
61
|
-
<CustomMatch name="sampleList" isExactly>
|
62
|
-
<SampleListContainer />
|
63
|
-
</CustomMatch>
|
64
|
-
</Box>
|
65
|
-
</Container>
|
66
|
-
|
67
|
-
{alertData.isActive && (
|
68
|
-
<AlertContainer
|
69
|
-
alertData={alertData}
|
70
|
-
isActive={alertData.isActive}
|
71
|
-
palette={alertData.palette}
|
72
|
-
type={alertData.type}
|
73
|
-
/>
|
74
|
-
)}
|
75
|
-
</Box>
|
76
|
-
</Container>
|
77
|
-
);
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
AppContainer.propTypes = {
|
82
|
-
push: PropTypes.func,
|
83
|
-
alertData: PropTypes.object,
|
84
|
-
paramMap: PropTypes.object,
|
85
|
-
showConfirmBox: PropTypes.func
|
86
|
-
};
|
87
|
-
|
88
|
-
const mapStateToProps = (state, ownProps) => {
|
89
|
-
const { alertData, routing } = state;
|
90
|
-
const { paramMap } = routing;
|
91
|
-
return { alertData, paramMap };
|
92
|
-
};
|
93
|
-
export default connect(
|
94
|
-
mapStateToProps,
|
95
|
-
{ push, showConfirmBox: alertAction.showConfirmBox }
|
96
|
-
)(AppContainer);
|
1
|
+
import React from "react";
|
2
|
+
import { PropTypes } from "prop-types";
|
3
|
+
import { connect } from "react-redux";
|
4
|
+
import CustomMatch from "../CustomMatch";
|
5
|
+
import Redirector from "../Redirector";
|
6
|
+
import { Container, Box } from "@zohodesk/components";
|
7
|
+
import style from "./index.module.css";
|
8
|
+
import Header from "../Header";
|
9
|
+
import SampleListContainer from "../SampleListContainer/ListContainer";
|
10
|
+
|
11
|
+
import { push, alertAction } from "../../actions";
|
12
|
+
|
13
|
+
class AppContainer extends React.Component {
|
14
|
+
constructor(props) {
|
15
|
+
super(props);
|
16
|
+
this.state = {};
|
17
|
+
}
|
18
|
+
componentDidMount() {
|
19
|
+
/*const { showConfirmBox } = this.props;
|
20
|
+
|
21
|
+
showConfirmBox({
|
22
|
+
type: "confirmation",
|
23
|
+
submitText: "Yes",
|
24
|
+
cancelText: "Cancel",
|
25
|
+
title: "Alert",
|
26
|
+
iconName: "notifiExclamation",
|
27
|
+
message: "Are you sure?",
|
28
|
+
isActive: true,
|
29
|
+
palette: "danger"
|
30
|
+
})
|
31
|
+
.then(() => {
|
32
|
+
logger.log("Suceess");
|
33
|
+
})
|
34
|
+
.catch(() => {
|
35
|
+
logger.log("Cancel");
|
36
|
+
});*/
|
37
|
+
}
|
38
|
+
render() {
|
39
|
+
const { alertData, paramMap = {} } = this.props;
|
40
|
+
|
41
|
+
return (
|
42
|
+
<Container
|
43
|
+
className={style.deskContainer}
|
44
|
+
onMouseOver={this.handleOver}
|
45
|
+
scroll="none"
|
46
|
+
tagName="div"
|
47
|
+
>
|
48
|
+
<Redirector />
|
49
|
+
|
50
|
+
<Box tagName="header">
|
51
|
+
<Header />
|
52
|
+
</Box>
|
53
|
+
|
54
|
+
<Box className={style.posrel} flexible tagName="section">
|
55
|
+
<Container
|
56
|
+
alignBox="row"
|
57
|
+
className={`${style.container}`}
|
58
|
+
tagName="section"
|
59
|
+
>
|
60
|
+
<Box className={""} flexible tagName="article" scroll="vertical">
|
61
|
+
<CustomMatch name="sampleList" isExactly>
|
62
|
+
<SampleListContainer />
|
63
|
+
</CustomMatch>
|
64
|
+
</Box>
|
65
|
+
</Container>
|
66
|
+
|
67
|
+
{alertData.isActive && (
|
68
|
+
<AlertContainer
|
69
|
+
alertData={alertData}
|
70
|
+
isActive={alertData.isActive}
|
71
|
+
palette={alertData.palette}
|
72
|
+
type={alertData.type}
|
73
|
+
/>
|
74
|
+
)}
|
75
|
+
</Box>
|
76
|
+
</Container>
|
77
|
+
);
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
AppContainer.propTypes = {
|
82
|
+
push: PropTypes.func,
|
83
|
+
alertData: PropTypes.object,
|
84
|
+
paramMap: PropTypes.object,
|
85
|
+
showConfirmBox: PropTypes.func
|
86
|
+
};
|
87
|
+
|
88
|
+
const mapStateToProps = (state, ownProps) => {
|
89
|
+
const { alertData, routing } = state;
|
90
|
+
const { paramMap } = routing;
|
91
|
+
return { alertData, paramMap };
|
92
|
+
};
|
93
|
+
export default connect(
|
94
|
+
mapStateToProps,
|
95
|
+
{ push, showConfirmBox: alertAction.showConfirmBox }
|
96
|
+
)(AppContainer);
|
@@ -1,27 +1,27 @@
|
|
1
|
-
.container,
|
2
|
-
.rightPanel {
|
3
|
-
position: relative;
|
4
|
-
}
|
5
|
-
.leftPanel {
|
6
|
-
position: relative;
|
7
|
-
transition: width 0.3s ease, transform 0.3s ease;
|
8
|
-
will-change: width, transform;
|
9
|
-
background-color: #f4f6f9;
|
10
|
-
}
|
11
|
-
.open {
|
12
|
-
width: 13.75rem;
|
13
|
-
}
|
14
|
-
.leftPanelContainer {
|
15
|
-
width: 100%;
|
16
|
-
height: 100%;
|
17
|
-
display: flex;
|
18
|
-
-webkit-box-orient: vertical;
|
19
|
-
-webkit-box-direction: normal;
|
20
|
-
-webkit-flex-direction: column;
|
21
|
-
-ms-flex-direction: column;
|
22
|
-
flex-direction: column;
|
23
|
-
}
|
24
|
-
|
25
|
-
.deskContainer {
|
26
|
-
height: 100vh;
|
27
|
-
}
|
1
|
+
.container,
|
2
|
+
.rightPanel {
|
3
|
+
position: relative;
|
4
|
+
}
|
5
|
+
.leftPanel {
|
6
|
+
position: relative;
|
7
|
+
transition: width 0.3s ease, transform 0.3s ease;
|
8
|
+
will-change: width, transform;
|
9
|
+
background-color: #f4f6f9;
|
10
|
+
}
|
11
|
+
.open {
|
12
|
+
width: 13.75rem;
|
13
|
+
}
|
14
|
+
.leftPanelContainer {
|
15
|
+
width: 100%;
|
16
|
+
height: 100%;
|
17
|
+
display: flex;
|
18
|
+
-webkit-box-orient: vertical;
|
19
|
+
-webkit-box-direction: normal;
|
20
|
+
-webkit-flex-direction: column;
|
21
|
+
-ms-flex-direction: column;
|
22
|
+
flex-direction: column;
|
23
|
+
}
|
24
|
+
|
25
|
+
.deskContainer {
|
26
|
+
height: 100vh;
|
27
|
+
}
|
@@ -1,65 +1,65 @@
|
|
1
|
-
import React, { Component } from "react";
|
2
|
-
import { connect } from "react-redux";
|
3
|
-
import PropTypes from "prop-types";
|
4
|
-
import { replace } from "../../actions";
|
5
|
-
class CustomMatch extends Component {
|
6
|
-
render() {
|
7
|
-
let { children, isMatch } = this.props;
|
8
|
-
return (isMatch && React.Children.only(children)) || null;
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
|
-
export default connect(
|
13
|
-
(state, props) => {
|
14
|
-
let isMatch;
|
15
|
-
if (Array.isArray(props.names)) {
|
16
|
-
isMatch = props.names.some(urlObj => {
|
17
|
-
let { name, module, isExactly } = urlObj || {};
|
18
|
-
const { paramMap = {}, urls } = state.routing;
|
19
|
-
let url = urls[name] || {};
|
20
|
-
|
21
|
-
let { moduleName } = paramMap;
|
22
|
-
if ((isExactly && url.match === 2) || (!isExactly && url.match)) {
|
23
|
-
isMatch = true;
|
24
|
-
return module ? moduleName === module : isMatch;
|
25
|
-
}
|
26
|
-
return false;
|
27
|
-
});
|
28
|
-
} else {
|
29
|
-
let url = state.routing.urls[props.name];
|
30
|
-
if (url) {
|
31
|
-
isMatch =
|
32
|
-
(props.isExactly && url.match === 2) ||
|
33
|
-
(!props.isExactly && url.match);
|
34
|
-
if (isMatch && Array.isArray(props.module)) {
|
35
|
-
let modules = props.module;
|
36
|
-
isMatch = modules.some(module => {
|
37
|
-
return state.routing.paramMap.moduleName === module;
|
38
|
-
});
|
39
|
-
} else if (isMatch && props.module) {
|
40
|
-
isMatch = state.routing.paramMap.moduleName === props.module;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
isMatch =
|
45
|
-
!isMatch && props.orMapStateMatch
|
46
|
-
? props.orMapStateMatch(state)
|
47
|
-
: isMatch;
|
48
|
-
return {
|
49
|
-
isMatch: isMatch ? true : false,
|
50
|
-
isAuthenticate: props.checkAuthenticate
|
51
|
-
? props.checkAuthenticate(state)
|
52
|
-
: true
|
53
|
-
};
|
54
|
-
},
|
55
|
-
{ replace }
|
56
|
-
)(CustomMatch);
|
57
|
-
|
58
|
-
CustomMatch.defaultProps = {
|
59
|
-
isExactly: false
|
60
|
-
};
|
61
|
-
CustomMatch.propTypes = {
|
62
|
-
children: PropTypes.element,
|
63
|
-
isExactly: PropTypes.bool,
|
64
|
-
isMatch: PropTypes.bool
|
65
|
-
};
|
1
|
+
import React, { Component } from "react";
|
2
|
+
import { connect } from "react-redux";
|
3
|
+
import PropTypes from "prop-types";
|
4
|
+
import { replace } from "../../actions";
|
5
|
+
class CustomMatch extends Component {
|
6
|
+
render() {
|
7
|
+
let { children, isMatch } = this.props;
|
8
|
+
return (isMatch && React.Children.only(children)) || null;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
export default connect(
|
13
|
+
(state, props) => {
|
14
|
+
let isMatch;
|
15
|
+
if (Array.isArray(props.names)) {
|
16
|
+
isMatch = props.names.some(urlObj => {
|
17
|
+
let { name, module, isExactly } = urlObj || {};
|
18
|
+
const { paramMap = {}, urls } = state.routing;
|
19
|
+
let url = urls[name] || {};
|
20
|
+
|
21
|
+
let { moduleName } = paramMap;
|
22
|
+
if ((isExactly && url.match === 2) || (!isExactly && url.match)) {
|
23
|
+
isMatch = true;
|
24
|
+
return module ? moduleName === module : isMatch;
|
25
|
+
}
|
26
|
+
return false;
|
27
|
+
});
|
28
|
+
} else {
|
29
|
+
let url = state.routing.urls[props.name];
|
30
|
+
if (url) {
|
31
|
+
isMatch =
|
32
|
+
(props.isExactly && url.match === 2) ||
|
33
|
+
(!props.isExactly && url.match);
|
34
|
+
if (isMatch && Array.isArray(props.module)) {
|
35
|
+
let modules = props.module;
|
36
|
+
isMatch = modules.some(module => {
|
37
|
+
return state.routing.paramMap.moduleName === module;
|
38
|
+
});
|
39
|
+
} else if (isMatch && props.module) {
|
40
|
+
isMatch = state.routing.paramMap.moduleName === props.module;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
isMatch =
|
45
|
+
!isMatch && props.orMapStateMatch
|
46
|
+
? props.orMapStateMatch(state)
|
47
|
+
: isMatch;
|
48
|
+
return {
|
49
|
+
isMatch: isMatch ? true : false,
|
50
|
+
isAuthenticate: props.checkAuthenticate
|
51
|
+
? props.checkAuthenticate(state)
|
52
|
+
: true
|
53
|
+
};
|
54
|
+
},
|
55
|
+
{ replace }
|
56
|
+
)(CustomMatch);
|
57
|
+
|
58
|
+
CustomMatch.defaultProps = {
|
59
|
+
isExactly: false
|
60
|
+
};
|
61
|
+
CustomMatch.propTypes = {
|
62
|
+
children: PropTypes.element,
|
63
|
+
isExactly: PropTypes.bool,
|
64
|
+
isMatch: PropTypes.bool
|
65
|
+
};
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { createDevTools } from "redux-devtools";
|
3
|
-
import LogMonitor from "redux-devtools-log-monitor";
|
4
|
-
import DockMonitor from "redux-devtools-dock-monitor";
|
5
|
-
|
6
|
-
export default createDevTools(
|
7
|
-
<DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-w">
|
8
|
-
<LogMonitor />
|
9
|
-
</DockMonitor>
|
10
|
-
);
|
1
|
+
import React from "react";
|
2
|
+
import { createDevTools } from "redux-devtools";
|
3
|
+
import LogMonitor from "redux-devtools-log-monitor";
|
4
|
+
import DockMonitor from "redux-devtools-dock-monitor";
|
5
|
+
|
6
|
+
export default createDevTools(
|
7
|
+
<DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-w">
|
8
|
+
<LogMonitor />
|
9
|
+
</DockMonitor>
|
10
|
+
);
|
@@ -1,67 +1,67 @@
|
|
1
|
-
import React, { Component } from "react";
|
2
|
-
import PropTypes from "prop-types";
|
3
|
-
import { connect } from "react-redux";
|
4
|
-
import style from "./index.module.css";
|
5
|
-
import { push, alertAction } from "../../actions";
|
6
|
-
|
7
|
-
import { URL_PREFIX } from "../../util/Common";
|
8
|
-
|
9
|
-
class Header extends Component {
|
10
|
-
constructor(props) {
|
11
|
-
super(props);
|
12
|
-
this.state = {
|
13
|
-
tabs: [
|
14
|
-
{
|
15
|
-
url: `${URL_PREFIX}/sample`,
|
16
|
-
name: "Sample",
|
17
|
-
apiName: "sample",
|
18
|
-
id: "1"
|
19
|
-
}
|
20
|
-
],
|
21
|
-
selectedTab: "sample"
|
22
|
-
};
|
23
|
-
this.changeTab = this.changeTab.bind(this);
|
24
|
-
}
|
25
|
-
changeTab(e) {
|
26
|
-
e.preventDefault();
|
27
|
-
let { push } = this.props;
|
28
|
-
|
29
|
-
push({ pathname: e.target.getAttribute("href") });
|
30
|
-
}
|
31
|
-
render() {
|
32
|
-
let { tabs, selectedTab } = this.state;
|
33
|
-
const { topbar, menuUl, menuli, menuliActive, menuLink } = style;
|
34
|
-
|
35
|
-
tabs = tabs.map((tab, index) => {
|
36
|
-
const { apiName, url, name } = tab;
|
37
|
-
|
38
|
-
const tabClass =
|
39
|
-
selectedTab === apiName ? menuli + " " + menuliActive : menuli;
|
40
|
-
return (
|
41
|
-
<li className={tabClass} key={index}>
|
42
|
-
<a href={url} className={menuLink} onClick={this.changeTab}>
|
43
|
-
{name}
|
44
|
-
</a>
|
45
|
-
</li>
|
46
|
-
);
|
47
|
-
});
|
48
|
-
return (
|
49
|
-
<div className={topbar}>
|
50
|
-
<ul className={menuUl}>{tabs}</ul>
|
51
|
-
</div>
|
52
|
-
);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
Header.propTypes = {
|
57
|
-
push: PropTypes.func
|
58
|
-
};
|
59
|
-
|
60
|
-
const mapStateToProps = (state, ownProps) => {
|
61
|
-
return {};
|
62
|
-
};
|
63
|
-
|
64
|
-
export default connect(
|
65
|
-
mapStateToProps,
|
66
|
-
{ push, showConfirmBox: alertAction.showConfirmBox }
|
67
|
-
)(Header);
|
1
|
+
import React, { Component } from "react";
|
2
|
+
import PropTypes from "prop-types";
|
3
|
+
import { connect } from "react-redux";
|
4
|
+
import style from "./index.module.css";
|
5
|
+
import { push, alertAction } from "../../actions";
|
6
|
+
|
7
|
+
import { URL_PREFIX } from "../../util/Common";
|
8
|
+
|
9
|
+
class Header extends Component {
|
10
|
+
constructor(props) {
|
11
|
+
super(props);
|
12
|
+
this.state = {
|
13
|
+
tabs: [
|
14
|
+
{
|
15
|
+
url: `${URL_PREFIX}/sample`,
|
16
|
+
name: "Sample",
|
17
|
+
apiName: "sample",
|
18
|
+
id: "1"
|
19
|
+
}
|
20
|
+
],
|
21
|
+
selectedTab: "sample"
|
22
|
+
};
|
23
|
+
this.changeTab = this.changeTab.bind(this);
|
24
|
+
}
|
25
|
+
changeTab(e) {
|
26
|
+
e.preventDefault();
|
27
|
+
let { push } = this.props;
|
28
|
+
|
29
|
+
push({ pathname: e.target.getAttribute("href") });
|
30
|
+
}
|
31
|
+
render() {
|
32
|
+
let { tabs, selectedTab } = this.state;
|
33
|
+
const { topbar, menuUl, menuli, menuliActive, menuLink } = style;
|
34
|
+
|
35
|
+
tabs = tabs.map((tab, index) => {
|
36
|
+
const { apiName, url, name } = tab;
|
37
|
+
|
38
|
+
const tabClass =
|
39
|
+
selectedTab === apiName ? menuli + " " + menuliActive : menuli;
|
40
|
+
return (
|
41
|
+
<li className={tabClass} key={index}>
|
42
|
+
<a href={url} className={menuLink} onClick={this.changeTab}>
|
43
|
+
{name}
|
44
|
+
</a>
|
45
|
+
</li>
|
46
|
+
);
|
47
|
+
});
|
48
|
+
return (
|
49
|
+
<div className={topbar}>
|
50
|
+
<ul className={menuUl}>{tabs}</ul>
|
51
|
+
</div>
|
52
|
+
);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
Header.propTypes = {
|
57
|
+
push: PropTypes.func
|
58
|
+
};
|
59
|
+
|
60
|
+
const mapStateToProps = (state, ownProps) => {
|
61
|
+
return {};
|
62
|
+
};
|
63
|
+
|
64
|
+
export default connect(
|
65
|
+
mapStateToProps,
|
66
|
+
{ push, showConfirmBox: alertAction.showConfirmBox }
|
67
|
+
)(Header);
|
@@ -1,43 +1,43 @@
|
|
1
|
-
.topbar {
|
2
|
-
min-height: 45px;
|
3
|
-
background: #1e2633;
|
4
|
-
|
5
|
-
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
|
6
|
-
width: 100%;
|
7
|
-
z-index: 5;
|
8
|
-
color: #fff;
|
9
|
-
}
|
10
|
-
|
11
|
-
:global ul,
|
12
|
-
:global li {
|
13
|
-
padding: 0;
|
14
|
-
margin: 0;
|
15
|
-
}
|
16
|
-
|
17
|
-
.menuUl {
|
18
|
-
list-style: none;
|
19
|
-
}
|
20
|
-
|
21
|
-
.menuli {
|
22
|
-
float: left;
|
23
|
-
box-sizing: border-box;
|
24
|
-
cursor: pointer;
|
25
|
-
position: relative;
|
26
|
-
font-size: 12px;
|
27
|
-
letter-spacing: 0.6px;
|
28
|
-
text-transform: uppercase;
|
29
|
-
}
|
30
|
-
|
31
|
-
.menuliActive {
|
32
|
-
background: #4b515c;
|
33
|
-
}
|
34
|
-
|
35
|
-
.menuLink {
|
36
|
-
padding: 17px 14px 15px;
|
37
|
-
float: left;
|
38
|
-
line-height: 13px;
|
39
|
-
color: #fff;
|
40
|
-
max-width: 110px;
|
41
|
-
-webkit-font-smoothing: antialiased;
|
42
|
-
-moz-osx-font-smoothing: grayscale;
|
43
|
-
}
|
1
|
+
.topbar {
|
2
|
+
min-height: 45px;
|
3
|
+
background: #1e2633;
|
4
|
+
|
5
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
|
6
|
+
width: 100%;
|
7
|
+
z-index: 5;
|
8
|
+
color: #fff;
|
9
|
+
}
|
10
|
+
|
11
|
+
:global ul,
|
12
|
+
:global li {
|
13
|
+
padding: 0;
|
14
|
+
margin: 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
.menuUl {
|
18
|
+
list-style: none;
|
19
|
+
}
|
20
|
+
|
21
|
+
.menuli {
|
22
|
+
float: left;
|
23
|
+
box-sizing: border-box;
|
24
|
+
cursor: pointer;
|
25
|
+
position: relative;
|
26
|
+
font-size: 12px;
|
27
|
+
letter-spacing: 0.6px;
|
28
|
+
text-transform: uppercase;
|
29
|
+
}
|
30
|
+
|
31
|
+
.menuliActive {
|
32
|
+
background: #4b515c;
|
33
|
+
}
|
34
|
+
|
35
|
+
.menuLink {
|
36
|
+
padding: 17px 14px 15px;
|
37
|
+
float: left;
|
38
|
+
line-height: 13px;
|
39
|
+
color: #fff;
|
40
|
+
max-width: 110px;
|
41
|
+
-webkit-font-smoothing: antialiased;
|
42
|
+
-moz-osx-font-smoothing: grayscale;
|
43
|
+
}
|