@zohodesk/react-cli 0.0.1-exp.175.1 → 0.0.1-exp.176.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -180
  3. package/.prettierrc +6 -6
  4. package/README.md +1025 -1028
  5. package/bin/cli.js +482 -482
  6. package/cert/Tsicsezwild-22-23.crt +37 -37
  7. package/cert/Tsicsezwild-22-23.key +27 -27
  8. package/docs/CustomChunks.md +26 -26
  9. package/docs/DevStart.md +18 -18
  10. package/docs/HoverActive.md +12 -12
  11. package/docs/InstallNode.md +28 -28
  12. package/docs/SelectorWeight.md +6 -0
  13. package/docs/TODOS.md +10 -10
  14. package/docs/ValueReplacer.md +60 -60
  15. package/docs/VariableConversion.md +719 -678
  16. package/docs/warnings_while_install.txt +35 -35
  17. package/files/eslintrc.js +62 -62
  18. package/files/prettierrc.js +3 -3
  19. package/lib/babel/cmjs-plugins-presets.js +4 -0
  20. package/lib/babel/es-plugins-presets.js +4 -0
  21. package/lib/common/getEntries.js +10 -0
  22. package/lib/common/getPublicPathConfig.js +6 -0
  23. package/lib/common/index.js +5 -0
  24. package/lib/common/splitChunks.js +13 -2
  25. package/lib/common/sslcertUpdater.js +17 -6
  26. package/lib/common/templateParameters.js +2 -0
  27. package/lib/common/testPattern.js +21 -10
  28. package/lib/common/valueReplacer.js +15 -0
  29. package/lib/configs/jest.config.js +9 -0
  30. package/lib/configs/libAlias.js +2 -4
  31. package/lib/configs/webpack.component.umd.config.js +5 -0
  32. package/lib/configs/webpack.css.umd.config.js +13 -5
  33. package/lib/configs/webpack.dev.config.js +36 -2
  34. package/lib/configs/webpack.docs.config.js +21 -1
  35. package/lib/configs/webpack.impact.config.js +19 -1
  36. package/lib/configs/webpack.prod.config.js +37 -3
  37. package/lib/hooks/docsProptypeHook.js +7 -3
  38. package/lib/jest/commitedFilesResult.js +45 -3
  39. package/lib/jest/coverageCollector.js +11 -0
  40. package/lib/jest/jsonMaker.js +6 -0
  41. package/lib/jest/preProcessors/cssPreprocessor.js +8 -0
  42. package/lib/jest/preProcessors/jsPreprocessor.js +2 -0
  43. package/lib/jest/preProcessors/otherFilesPreprocessor.js +3 -0
  44. package/lib/jest/result.js +22 -0
  45. package/lib/jest/run.js +17 -6
  46. package/lib/jest/setup.js +57 -5
  47. package/lib/loaderUtils/configsAssetsLoaders.js +44 -34
  48. package/lib/loaderUtils/getCSSLoaders.js +35 -20
  49. package/lib/loaderUtils/getDevJsLoaders.js +8 -0
  50. package/lib/loaderUtils/index.js +3 -0
  51. package/lib/loaderUtils/windowsModification.js +11 -0
  52. package/lib/loaders/docsLoader.js +7 -0
  53. package/lib/loaders/docsPropsLoader.js +7 -3
  54. package/lib/loaders/fileBountryLoader.js +2 -0
  55. package/lib/loaders/fileLoader.js +22 -11
  56. package/lib/loaders/scriptInstrumentLoader.js +13 -5
  57. package/lib/loaders/selectorMappingLoader.js +25 -7
  58. package/lib/loaders/workerLoader.js +29 -13
  59. package/lib/middlewares/HMRMiddleware.js +26 -13
  60. package/lib/middlewares/SSTMiddleware.js +3 -0
  61. package/lib/pluginUtils/configHtmlWebpackPlugins.js +9 -3
  62. package/lib/pluginUtils/getDevPlugins.js +68 -22
  63. package/lib/pluginUtils/getDocsPlugins.js +10 -1
  64. package/lib/pluginUtils/getLibraryImactPlugins.js +5 -4
  65. package/lib/pluginUtils/getLibraryPlugins.js +5 -0
  66. package/lib/pluginUtils/getProdPlugins.js +77 -28
  67. package/lib/pluginUtils/getServerPlugins.js +5 -0
  68. package/lib/pluginUtils/getUMDCSSPlugins.js +7 -0
  69. package/lib/pluginUtils/getUMDComponentPlugins.js +7 -0
  70. package/lib/pluginUtils/index.js +8 -0
  71. package/lib/plugins/CdnChangePlugin.js +14 -0
  72. package/lib/plugins/CleanupStatsPlugin.js +5 -0
  73. package/lib/plugins/EFCPlugin.js +34 -23
  74. package/lib/plugins/EFCPlugin.md +6 -6
  75. package/lib/plugins/EFCTemplatePlugin.js +32 -23
  76. package/lib/plugins/I18NInjectIntoIndexPlugin.js +38 -12
  77. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +17 -12
  78. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
  79. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +77 -46
  80. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +59 -44
  81. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +30 -21
  82. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  83. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  84. package/lib/plugins/I18nSplitPlugin/index.js +80 -70
  85. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +12 -2
  86. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +1 -0
  87. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +5 -0
  88. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +6 -0
  89. package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
  90. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -2
  91. package/lib/plugins/ManifestPlugin.js +17 -0
  92. package/lib/plugins/ModuleStatsPlugin.js +23 -0
  93. package/lib/plugins/OptimizeJSPlugin.js +7 -0
  94. package/lib/plugins/PublicPathCallbackPlugin.js +10 -0
  95. package/lib/plugins/PublicPathChangePlugin.js +36 -4
  96. package/lib/plugins/ReportGeneratePlugin.js +30 -4
  97. package/lib/plugins/RequireVariablePublicPlugin.js +6 -0
  98. package/lib/plugins/ResourceHintsPlugin.js +27 -20
  99. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
  100. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +22 -15
  101. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  102. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
  103. package/lib/plugins/ScriptInstrumentPlugin.js +7 -0
  104. package/lib/plugins/SelectorPlugin.js +97 -0
  105. package/lib/plugins/ServiceWorkerPlugin.js +29 -13
  106. package/lib/plugins/ShadowDOMSupportPlugin.js +40 -3
  107. package/lib/plugins/SourceMapHookPlugin.js +9 -0
  108. package/lib/plugins/TPHashMappingPlugin.js +19 -5
  109. package/lib/plugins/UglifyCSSPlugin.js +9 -0
  110. package/lib/plugins/UnusedFilesFindPlugin.js +35 -2
  111. package/lib/plugins/VariableConversionCollector.js +322 -0
  112. package/lib/plugins/composeCommonPlugin.js +30 -0
  113. package/lib/plugins/index.js +19 -0
  114. package/lib/plugins/libraryImpactPlugin.js +32 -0
  115. package/lib/plugins/webpackwatchrunplugin.js +5 -0
  116. package/lib/postcss-plugins/ExcludePlugin.js +4 -0
  117. package/lib/postcss-plugins/RTLSplitPlugin.js +37 -24
  118. package/lib/postcss-plugins/ValueReplacer.js +6 -9
  119. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
  120. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  121. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  122. package/lib/postcss-plugins/hoverActivePlugin.js +69 -33
  123. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +42 -13
  124. package/lib/postcss-plugins/variableModificationPlugin/index.js +216 -141
  125. package/lib/postcss-plugins/variableModifier.js +20 -13
  126. package/lib/schemas/index.js +23 -4
  127. package/lib/servers/clusterHubServer.js +10 -0
  128. package/lib/servers/devBuild.js +24 -13
  129. package/lib/servers/docsServer.js +2 -0
  130. package/lib/servers/docsServerCore.js +21 -0
  131. package/lib/servers/getCliPath.js +9 -0
  132. package/lib/servers/helpServer.js +5 -0
  133. package/lib/servers/httpsOptions.js +4 -0
  134. package/lib/servers/impactServer.js +34 -2
  135. package/lib/servers/mockserver.js +9 -0
  136. package/lib/servers/nowatchserver.js +34 -12
  137. package/lib/servers/scrServer.js +20 -13
  138. package/lib/servers/server.js +35 -7
  139. package/lib/servers/ssServer.js +16 -0
  140. package/lib/sh/pre-commit.sh +34 -34
  141. package/lib/sh/reportPublish.sh +45 -45
  142. package/lib/templates/CoverageScriptTemplate.js +14 -0
  143. package/lib/templates/WMSTemplate.js +12 -6
  144. package/lib/utils/babelPresets.js +2 -0
  145. package/lib/utils/buildstats.html +148 -148
  146. package/lib/utils/clean.js +8 -2
  147. package/lib/utils/copy.js +6 -0
  148. package/lib/utils/copyTimezones.js +8 -0
  149. package/lib/utils/createEventStream.js +4 -0
  150. package/lib/utils/cssClassNameGenerate.js +19 -3
  151. package/lib/utils/cssURLReplacer.js +25 -0
  152. package/lib/utils/dependencyPostPublish.js +9 -0
  153. package/lib/utils/fileUtils.js +26 -0
  154. package/lib/utils/folderIterator.js +10 -0
  155. package/lib/utils/getComponents.js +21 -0
  156. package/lib/utils/getCurrentBranch.js +5 -0
  157. package/lib/utils/getDependenciesImpactList.js +21 -0
  158. package/lib/utils/getHash.js +7 -0
  159. package/lib/utils/getIp.js +2 -0
  160. package/lib/utils/getOptions.js +39 -14
  161. package/lib/utils/getServerURL.js +7 -0
  162. package/lib/utils/index.js +47 -2
  163. package/lib/utils/init.js +1 -0
  164. package/lib/utils/initPreCommitHook.js +29 -6
  165. package/lib/utils/jsonHelper.js +19 -2
  166. package/lib/utils/libraryImpactConfig.js +2 -0
  167. package/lib/utils/lint/addScripts.js +5 -2
  168. package/lib/utils/lint/checkExistingConfig.js +12 -3
  169. package/lib/utils/lint/copyConfigs.js +3 -0
  170. package/lib/utils/lint/index.js +9 -0
  171. package/lib/utils/lint/lintScripts.js +1 -0
  172. package/lib/utils/lint/lintSetup.js +4 -3
  173. package/lib/utils/lint/lintStagedPreCommitHook.js +1 -0
  174. package/lib/utils/lint/question.js +7 -0
  175. package/lib/utils/lintReporter.js +20 -0
  176. package/lib/utils/mailSender.js +7 -0
  177. package/lib/utils/pullOrigin.js +4 -0
  178. package/lib/utils/reinstallDependencies.js +28 -0
  179. package/lib/utils/removeAttributes.js +7 -0
  180. package/lib/utils/repoClone.js +27 -2
  181. package/lib/utils/request.js +12 -0
  182. package/lib/utils/resultSchema.json +73 -73
  183. package/lib/utils/rtl.js +16 -4
  184. package/lib/utils/setEnvVariables.js +2 -0
  185. package/lib/utils/ssTestHack.js +10 -0
  186. package/lib/utils/switchBranch.js +4 -0
  187. package/lib/utils/urlConcat.js +4 -0
  188. package/lib/utils/useExitCleanup.js +10 -9
  189. package/npm8.md +9 -9
  190. package/package.json +146 -146
  191. package/postpublish.js +6 -6
  192. package/templates/app/.eslintrc.js +140 -140
  193. package/templates/app/README.md +12 -12
  194. package/templates/app/app/index.html +24 -24
  195. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  196. package/templates/app/app/properties/i18nkeys.json +3 -3
  197. package/templates/app/docs/all.html +69 -69
  198. package/templates/app/mockapi/index.js +18 -18
  199. package/templates/app/package.json +37 -37
  200. package/templates/app/src/actions/SampleActions/index.js +37 -37
  201. package/templates/app/src/actions/index.js +65 -65
  202. package/templates/app/src/appUrls.js +19 -19
  203. package/templates/app/src/components/Alert/Alert.js +134 -134
  204. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  205. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  206. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  207. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  208. package/templates/app/src/components/Sample/SampleList.js +61 -61
  209. package/templates/app/src/components/Slider/Slider.css +41 -41
  210. package/templates/app/src/components/Slider/Slider.js +55 -55
  211. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  212. package/templates/app/src/containers/AppContainer/index.js +96 -96
  213. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  214. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  215. package/templates/app/src/containers/DevTools/index.js +10 -10
  216. package/templates/app/src/containers/Header/index.js +67 -67
  217. package/templates/app/src/containers/Header/index.module.css +43 -43
  218. package/templates/app/src/containers/Redirect/index.js +63 -63
  219. package/templates/app/src/containers/Redirector/index.js +47 -47
  220. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  221. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  222. package/templates/app/src/historyChange.js +5 -5
  223. package/templates/app/src/index.html +10 -10
  224. package/templates/app/src/index.js +24 -24
  225. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  226. package/templates/app/src/reducers/alertData.js +11 -11
  227. package/templates/app/src/reducers/index.js +6 -6
  228. package/templates/app/src/reducers/samples.js +19 -19
  229. package/templates/app/src/store/configureStore.dev.js +51 -51
  230. package/templates/app/src/store/configureStore.js +5 -5
  231. package/templates/app/src/store/configureStore.prod.js +26 -26
  232. package/templates/app/src/util/Common.js +5 -5
  233. package/templates/app/src/util/RequestAPI.js +132 -132
  234. package/templates/docs/all.html +249 -249
  235. package/templates/docs/component.html +178 -178
  236. package/templates/docs/components.html +221 -221
  237. package/templates/docs/css/b.min.css +6 -6
  238. package/templates/docs/css/component.css +42 -42
  239. package/templates/docs/css/componentTest.css +6 -6
  240. package/templates/docs/css/hopscotch.css +585 -585
  241. package/templates/docs/css/style.css +1022 -1022
  242. package/templates/docs/impactReportTemplate.html +154 -154
  243. package/templates/docs/index.html +1501 -1501
  244. package/templates/docs/js/active-line.js +72 -72
  245. package/templates/docs/js/b.min.js +7 -7
  246. package/templates/docs/js/codemirror.js +9680 -9680
  247. package/templates/docs/js/designTokens.js +334 -334
  248. package/templates/docs/js/j.min.js +4 -4
  249. package/templates/docs/js/javascript.js +874 -874
  250. package/templates/docs/js/matchbrackets.js +145 -145
@@ -1,37 +1,37 @@
1
- .container {
2
- top: 0;
3
- left: 0;
4
- bottom: 0;
5
- right: 0;
6
- position: absolute;
7
- }
8
- .default {
9
- background-color: rgba(0, 0, 0, 0.7);
10
- }
11
- .dark {
12
- background-color: rgba(0, 0, 0, 0.9);
13
- }
14
- .darkLight {
15
- background-color: var(--zd_bg_dark16);
16
- }
17
- .plain {
18
- background-color: transparent;
19
- }
20
- .snow {
21
- background-color: rgba(30, 38, 51, 0.4);
22
- }
23
- .index3 {
24
- z-index: 3;
25
- }
26
- .index5 {
27
- z-index: 5;
28
- }
29
- .index7 {
30
- z-index: 7;
31
- }
32
- .index10 {
33
- z-index: 10;
34
- }
35
- .delay {
36
- transition-delay: 0.2s;
37
- }
1
+ .container {
2
+ top: 0;
3
+ left: 0;
4
+ bottom: 0;
5
+ right: 0;
6
+ position: absolute;
7
+ }
8
+ .default {
9
+ background-color: rgba(0, 0, 0, 0.7);
10
+ }
11
+ .dark {
12
+ background-color: rgba(0, 0, 0, 0.9);
13
+ }
14
+ .darkLight {
15
+ background-color: var(--zd_bg_dark16);
16
+ }
17
+ .plain {
18
+ background-color: transparent;
19
+ }
20
+ .snow {
21
+ background-color: rgba(30, 38, 51, 0.4);
22
+ }
23
+ .index3 {
24
+ z-index: 3;
25
+ }
26
+ .index5 {
27
+ z-index: 5;
28
+ }
29
+ .index7 {
30
+ z-index: 7;
31
+ }
32
+ .index10 {
33
+ z-index: 10;
34
+ }
35
+ .delay {
36
+ transition-delay: 0.2s;
37
+ }
@@ -1,84 +1,84 @@
1
- import React, { Component } from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import style from "./FreezeLayer.css";
5
- import { Container, Animation } from "@zohodesk/components";
6
- export default class FreezeLayer extends Component {
7
- constructor(props) {
8
- super(props);
9
- this.state = { isActive: props.isActive, isChildActive: false };
10
- this.toggleChild = this.toggleChild.bind(this);
11
- }
12
-
13
- toggleChild() {
14
- this.setState({ isChildActive: !this.state.isChildActive });
15
- }
16
-
17
- render() {
18
- let {
19
- children,
20
- align,
21
- childAnimationName,
22
- palette,
23
- onClick,
24
- animationName,
25
- zIndex,
26
- isActive
27
- } = this.props;
28
- let { isChildActive } = this.state;
29
- return (
30
- <Animation
31
- name={animationName}
32
- isActive={isActive}
33
- onExit={this.toggleChild}
34
- onEntered={this.toggleChild}
35
- delayClassName={childAnimationName ? style.delay : ""}
36
- exitDuration={childAnimationName && 500}
37
- >
38
- <div
39
- className={`
40
- ${style.container} ${style[`index${zIndex}`]} ${style[palette]}
41
- `}
42
- onClick={onClick ? onClick : null}
43
- >
44
- {children && (
45
- <Container alignBox="row" align={align}>
46
- {childAnimationName ? (
47
- <Animation name={childAnimationName} isActive={isChildActive}>
48
- {children}
49
- </Animation>
50
- ) : (
51
- children
52
- )}
53
- </Container>
54
- )}
55
- </div>
56
- </Animation>
57
- );
58
- }
59
- }
60
- FreezeLayer.propTypes = {
61
- align: PropTypes.oneOf(["horizontal", "vertical", "both"]),
62
- animationName: PropTypes.oneOf([
63
- "zoomIn",
64
- "scaleIn",
65
- "fadeIn",
66
- "slideLeft",
67
- "slideDown",
68
- "skewIn",
69
- "default",
70
- "none"
71
- ]),
72
- childAnimationName: PropTypes.string,
73
- children: PropTypes.node,
74
- isActive: PropTypes.bool,
75
- onClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
76
- palette: PropTypes.oneOf(["dark", "default", "darkLight", "plain", "snow"]),
77
- zIndex: PropTypes.oneOf(["3", "5", "7", "10"])
78
- };
79
- FreezeLayer.defaultProps = {
80
- animationName: "default",
81
- isActive: false,
82
- palette: "default",
83
- zIndex: "5"
84
- };
1
+ import React, { Component } from "react";
2
+ import PropTypes from "prop-types";
3
+
4
+ import style from "./FreezeLayer.css";
5
+ import { Container, Animation } from "@zohodesk/components";
6
+ export default class FreezeLayer extends Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.state = { isActive: props.isActive, isChildActive: false };
10
+ this.toggleChild = this.toggleChild.bind(this);
11
+ }
12
+
13
+ toggleChild() {
14
+ this.setState({ isChildActive: !this.state.isChildActive });
15
+ }
16
+
17
+ render() {
18
+ let {
19
+ children,
20
+ align,
21
+ childAnimationName,
22
+ palette,
23
+ onClick,
24
+ animationName,
25
+ zIndex,
26
+ isActive
27
+ } = this.props;
28
+ let { isChildActive } = this.state;
29
+ return (
30
+ <Animation
31
+ name={animationName}
32
+ isActive={isActive}
33
+ onExit={this.toggleChild}
34
+ onEntered={this.toggleChild}
35
+ delayClassName={childAnimationName ? style.delay : ""}
36
+ exitDuration={childAnimationName && 500}
37
+ >
38
+ <div
39
+ className={`
40
+ ${style.container} ${style[`index${zIndex}`]} ${style[palette]}
41
+ `}
42
+ onClick={onClick ? onClick : null}
43
+ >
44
+ {children && (
45
+ <Container alignBox="row" align={align}>
46
+ {childAnimationName ? (
47
+ <Animation name={childAnimationName} isActive={isChildActive}>
48
+ {children}
49
+ </Animation>
50
+ ) : (
51
+ children
52
+ )}
53
+ </Container>
54
+ )}
55
+ </div>
56
+ </Animation>
57
+ );
58
+ }
59
+ }
60
+ FreezeLayer.propTypes = {
61
+ align: PropTypes.oneOf(["horizontal", "vertical", "both"]),
62
+ animationName: PropTypes.oneOf([
63
+ "zoomIn",
64
+ "scaleIn",
65
+ "fadeIn",
66
+ "slideLeft",
67
+ "slideDown",
68
+ "skewIn",
69
+ "default",
70
+ "none"
71
+ ]),
72
+ childAnimationName: PropTypes.string,
73
+ children: PropTypes.node,
74
+ isActive: PropTypes.bool,
75
+ onClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
76
+ palette: PropTypes.oneOf(["dark", "default", "darkLight", "plain", "snow"]),
77
+ zIndex: PropTypes.oneOf(["3", "5", "7", "10"])
78
+ };
79
+ FreezeLayer.defaultProps = {
80
+ animationName: "default",
81
+ isActive: false,
82
+ palette: "default",
83
+ zIndex: "5"
84
+ };
@@ -1,11 +1,11 @@
1
- .addButtonContainer {
2
- text-align: right;
3
- padding: 10px;
4
- }
5
- .listContainer {
6
- margin-top: 20px;
7
- padding: 5px 0 10px 10px;
8
- }
9
- .listItem {
10
- padding: 10px 0;
11
- }
1
+ .addButtonContainer {
2
+ text-align: right;
3
+ padding: 10px;
4
+ }
5
+ .listContainer {
6
+ margin-top: 20px;
7
+ padding: 5px 0 10px 10px;
8
+ }
9
+ .listItem {
10
+ padding: 10px 0;
11
+ }
@@ -1,61 +1,61 @@
1
- import React, { Component } from "react";
2
- import PropTypes from "prop-types";
3
- import { URL_PREFIX } from "../../util/Common";
4
- import { Button, Container, Box, Switch } from "@zohodesk/components";
5
- import Card, {
6
- CardHeader,
7
- CardContent
8
- } from "@zohodesk/components/lib/Card/Card";
9
- import style from "./Sample.module.css";
10
-
11
- /**
12
- * BlockList
13
- */
14
- class SampleList extends Component {
15
- constructor(props) {
16
- super(props);
17
- }
18
- render() {
19
- let { samples = {} } = this.props;
20
-
21
- samples = samples.map((sample, index) => {
22
- const { id, name, status } = sample;
23
- const url = `${URL_PREFIX}/block/${id}`;
24
- const editUrl = `${URL_PREFIX}/block/${id}/edit`;
25
-
26
- return (
27
- <div key={id} className={style.listItem}>
28
- {id}-{name}
29
- </div>
30
- );
31
- });
32
-
33
- if (samples.length === 0) {
34
- samples = <div>There is no samples</div>;
35
- }
36
- return (
37
- <Card isScrollAttribute={true}>
38
- <CardHeader>
39
- <div className={style.addButtonContainer}>
40
- <Button
41
- palette="primaryFilled"
42
- size="medium"
43
- text="Add Sample"
44
- onClick={this.goAddForm}
45
- />
46
- </div>
47
- </CardHeader>
48
- <CardContent isScrollAttribute={true} scroll="vertical">
49
- <div className={style.listContainer}>{samples}</div>
50
- </CardContent>
51
- </Card>
52
- );
53
- }
54
- }
55
-
56
- SampleList.propTypes = {
57
- push: PropTypes.func,
58
- samples: PropTypes.object
59
- };
60
-
61
- export default SampleList;
1
+ import React, { Component } from "react";
2
+ import PropTypes from "prop-types";
3
+ import { URL_PREFIX } from "../../util/Common";
4
+ import { Button, Container, Box, Switch } from "@zohodesk/components";
5
+ import Card, {
6
+ CardHeader,
7
+ CardContent
8
+ } from "@zohodesk/components/lib/Card/Card";
9
+ import style from "./Sample.module.css";
10
+
11
+ /**
12
+ * BlockList
13
+ */
14
+ class SampleList extends Component {
15
+ constructor(props) {
16
+ super(props);
17
+ }
18
+ render() {
19
+ let { samples = {} } = this.props;
20
+
21
+ samples = samples.map((sample, index) => {
22
+ const { id, name, status } = sample;
23
+ const url = `${URL_PREFIX}/block/${id}`;
24
+ const editUrl = `${URL_PREFIX}/block/${id}/edit`;
25
+
26
+ return (
27
+ <div key={id} className={style.listItem}>
28
+ {id}-{name}
29
+ </div>
30
+ );
31
+ });
32
+
33
+ if (samples.length === 0) {
34
+ samples = <div>There is no samples</div>;
35
+ }
36
+ return (
37
+ <Card isScrollAttribute={true}>
38
+ <CardHeader>
39
+ <div className={style.addButtonContainer}>
40
+ <Button
41
+ palette="primaryFilled"
42
+ size="medium"
43
+ text="Add Sample"
44
+ onClick={this.goAddForm}
45
+ />
46
+ </div>
47
+ </CardHeader>
48
+ <CardContent isScrollAttribute={true} scroll="vertical">
49
+ <div className={style.listContainer}>{samples}</div>
50
+ </CardContent>
51
+ </Card>
52
+ );
53
+ }
54
+ }
55
+
56
+ SampleList.propTypes = {
57
+ push: PropTypes.func,
58
+ samples: PropTypes.object
59
+ };
60
+
61
+ export default SampleList;
@@ -1,41 +1,41 @@
1
- .container {
2
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176);
3
- background-color: var(--zd_bg_pure);
4
- right: 0;
5
- top: 0;
6
- bottom: 0;
7
- position: absolute;
8
- z-index: 5;
9
- overflow: auto;
10
- }
11
- .xsmall {
12
- width: 360px;
13
- }
14
- .small {
15
- width: 410px;
16
- }
17
- .medium {
18
- width: 660px;
19
- }
20
- .large {
21
- width: 936px;
22
- }
23
-
24
- .close a,
25
- .close input,
26
- .close textarea,
27
- .close button,
28
- .close iframe {
29
- display: none;
30
- }
31
-
32
- @media only screen and (max-width: 22.5em) {
33
- .container {
34
- width: 100%;
35
- }
36
- }
37
-
38
- html[dir="rtl"] .container {
39
- left: 0;
40
- right: initial;
41
- }
1
+ .container {
2
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176);
3
+ background-color: var(--zd_bg_pure);
4
+ right: 0;
5
+ top: 0;
6
+ bottom: 0;
7
+ position: absolute;
8
+ z-index: 5;
9
+ overflow: auto;
10
+ }
11
+ .xsmall {
12
+ width: 360px;
13
+ }
14
+ .small {
15
+ width: 410px;
16
+ }
17
+ .medium {
18
+ width: 660px;
19
+ }
20
+ .large {
21
+ width: 936px;
22
+ }
23
+
24
+ .close a,
25
+ .close input,
26
+ .close textarea,
27
+ .close button,
28
+ .close iframe {
29
+ display: none;
30
+ }
31
+
32
+ @media only screen and (max-width: 22.5em) {
33
+ .container {
34
+ width: 100%;
35
+ }
36
+ }
37
+
38
+ html[dir="rtl"] .container {
39
+ left: 0;
40
+ right: initial;
41
+ }
@@ -1,55 +1,55 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import style from "./Slider.css";
4
- import FreezeLayer from "../FreezeLayer/FreezeLayer";
5
-
6
- import { Animation } from "@zohodesk/components";
7
- export default class Slider extends React.Component {
8
- render() {
9
- let { children, needFreeze, isActive, onClick, palette, size } = this.props;
10
- return needFreeze ? (
11
- <FreezeLayer
12
- onClick={onClick}
13
- isActive={isActive}
14
- animationName="fadeIn"
15
- childAnimationName="slideLeft"
16
- palette={palette}
17
- >
18
- <div
19
- className={`${style.container} ${isActive ? "" : style.close} ${
20
- style[size]
21
- }`}
22
- onClick={e => {
23
- e.stopPropagation();
24
- }}
25
- >
26
- {children}
27
- </div>
28
- </FreezeLayer>
29
- ) : (
30
- <Animation isActive={isActive} name="slideLeft">
31
- <div
32
- className={`${style.container} ${style[size]}`}
33
- onClick={e => {
34
- e.stopPropagation();
35
- }}
36
- >
37
- {children}
38
- </div>
39
- </Animation>
40
- );
41
- }
42
- }
43
- Slider.propTypes = {
44
- children: PropTypes.node,
45
- isActive: PropTypes.bool,
46
- needFreeze: PropTypes.bool,
47
- onClick: PropTypes.func,
48
- palette: PropTypes.oneOf(["dark", "default", "darkLight", "plain"]),
49
- size: PropTypes.oneOf(["small", "xsmall", "medium", "large"])
50
- };
51
- Slider.defaultProps = {
52
- isActive: false,
53
- palette: "default",
54
- size: "xsmall"
55
- };
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import style from "./Slider.css";
4
+ import FreezeLayer from "../FreezeLayer/FreezeLayer";
5
+
6
+ import { Animation } from "@zohodesk/components";
7
+ export default class Slider extends React.Component {
8
+ render() {
9
+ let { children, needFreeze, isActive, onClick, palette, size } = this.props;
10
+ return needFreeze ? (
11
+ <FreezeLayer
12
+ onClick={onClick}
13
+ isActive={isActive}
14
+ animationName="fadeIn"
15
+ childAnimationName="slideLeft"
16
+ palette={palette}
17
+ >
18
+ <div
19
+ className={`${style.container} ${isActive ? "" : style.close} ${
20
+ style[size]
21
+ }`}
22
+ onClick={e => {
23
+ e.stopPropagation();
24
+ }}
25
+ >
26
+ {children}
27
+ </div>
28
+ </FreezeLayer>
29
+ ) : (
30
+ <Animation isActive={isActive} name="slideLeft">
31
+ <div
32
+ className={`${style.container} ${style[size]}`}
33
+ onClick={e => {
34
+ e.stopPropagation();
35
+ }}
36
+ >
37
+ {children}
38
+ </div>
39
+ </Animation>
40
+ );
41
+ }
42
+ }
43
+ Slider.propTypes = {
44
+ children: PropTypes.node,
45
+ isActive: PropTypes.bool,
46
+ needFreeze: PropTypes.bool,
47
+ onClick: PropTypes.func,
48
+ palette: PropTypes.oneOf(["dark", "default", "darkLight", "plain"]),
49
+ size: PropTypes.oneOf(["small", "xsmall", "medium", "large"])
50
+ };
51
+ Slider.defaultProps = {
52
+ isActive: false,
53
+ palette: "default",
54
+ size: "xsmall"
55
+ };
@@ -1,15 +1,15 @@
1
- import { connect } from "react-redux";
2
- import Alert from "../../components/Alert/Alert";
3
- import { alertAction } from "../../actions/index.js";
4
-
5
- function mapStateToProps() {
6
- return {
7
- onSubmitClick: alertAction.ob.resolve,
8
- onCancelClick: alertAction.ob.reject
9
- };
10
- }
11
-
12
- export default connect(
13
- mapStateToProps,
14
- {}
15
- )(Alert);
1
+ import { connect } from "react-redux";
2
+ import Alert from "../../components/Alert/Alert";
3
+ import { alertAction } from "../../actions/index.js";
4
+
5
+ function mapStateToProps() {
6
+ return {
7
+ onSubmitClick: alertAction.ob.resolve,
8
+ onCancelClick: alertAction.ob.reject
9
+ };
10
+ }
11
+
12
+ export default connect(
13
+ mapStateToProps,
14
+ {}
15
+ )(Alert);