├── docs ├── vendor │ ├── v-layoutDemo.9da86e.css │ └── v-layoutDemo.9da86e.js ├── project │ ├── pageDemoA.1081c9.css │ ├── vueDemo.3ceb5b.css │ ├── reactRouterDemo.c256bc.css │ ├── reactBaseFrameDemo.a0453c.css │ ├── reactDemo.07239c.css │ ├── nestedRouterDemo.ecf5b0.css │ ├── StrictListDemo.31ac63.css │ ├── rollDemo.365bb8.css │ ├── w_share.8c8db3.css │ ├── commonDemo.2ce61f.js │ ├── tweenDemo.fe0338.css │ └── pageDemoB.97185c.js ├── assets │ └── fonts │ │ ├── din-bold.20720c.otf │ │ ├── Roboto-Light.7b5fb8.ttf │ │ └── Roboto-Regular.ac3f79.ttf ├── async │ └── my-test2.e0beaf.js ├── markedDemo.html ├── reactDemo.html ├── tweenDemo.html ├── commonDemo.html ├── vueRouterDemo.html ├── CacheRouteDemo.html ├── antdSliderDemo.html ├── LocalProviderDemo.html ├── antdDatePickerDemo.html ├── nestedRouterDemo.html ├── vueDemo.html ├── antdTabsDemo.html ├── antdCalendarDemo.html └── StrictListDemo.html ├── src ├── vendor │ ├── components │ │ ├── MAP @ │ │ │ ├── GoogleMap │ │ │ │ ├── Marker │ │ │ │ │ ├── style.m.scss │ │ │ │ │ └── img │ │ │ │ │ │ └── marker.svg │ │ │ │ ├── index.js │ │ │ │ ├── Map │ │ │ │ │ └── style.m.scss │ │ │ │ └── helpers │ │ │ │ │ ├── getDistance.js │ │ │ │ │ ├── context.js │ │ │ │ │ └── getCurrentPosition.js │ │ │ └── index.js │ │ └── UI @ │ │ │ ├── DOC │ │ │ └── img │ │ │ │ ├── Button.png │ │ │ │ ├── Loading.gif │ │ │ │ ├── Countdown.gif │ │ │ │ └── ActivityIndicator.gif │ │ │ ├── layout │ │ │ ├── View │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ ├── ScrollView │ │ │ │ ├── RefreshHolder │ │ │ │ │ ├── style.m.css │ │ │ │ │ └── index.js │ │ │ │ └── style.m.scss │ │ │ ├── Portal │ │ │ │ └── index.js │ │ │ └── DynamicNumber │ │ │ │ └── index.js │ │ │ ├── components │ │ │ ├── ActivityIndicator │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ ├── Icon │ │ │ │ ├── style.m.css │ │ │ │ └── index.js │ │ │ ├── Loading │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ ├── Button │ │ │ │ ├── index.js │ │ │ │ └── style.m.scss │ │ │ └── Countdown │ │ │ │ └── index.js │ │ │ ├── func │ │ │ ├── route │ │ │ │ ├── components │ │ │ │ │ └── Loading │ │ │ │ │ │ ├── style.m.css │ │ │ │ │ │ └── index.js │ │ │ │ └── asyncComponent.js │ │ │ └── Popup │ │ │ │ ├── components │ │ │ │ ├── Mask │ │ │ │ │ ├── style.m.scss │ │ │ │ │ └── index.js │ │ │ │ └── Frame │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ └── index.js │ ├── demo │ │ ├── common_common.js │ │ ├── component │ │ │ └── layoutDemo @ │ │ │ │ ├── style.scss │ │ │ │ └── index.js │ │ ├── CacheRoute @ │ │ │ ├── index.js │ │ │ ├── helpers │ │ │ │ ├── is.js │ │ │ │ └── try │ │ │ │ │ ├── index.js │ │ │ │ │ └── DOC.md │ │ │ ├── components │ │ │ │ ├── SwitchFragment.js │ │ │ │ └── CacheRoute.js │ │ │ └── core │ │ │ │ ├── Updatable.js │ │ │ │ └── manager.js │ │ ├── ReModulex @ │ │ │ ├── index.js │ │ │ ├── helpers │ │ │ │ ├── splitter.js │ │ │ │ ├── store.js │ │ │ │ ├── is.js │ │ │ │ ├── try │ │ │ │ │ ├── DOC.md │ │ │ │ │ └── index.js │ │ │ │ └── modules.js │ │ │ └── core │ │ │ │ └── context.js │ │ └── commonDemo @ │ │ │ └── index.js │ └── helpers @ │ │ ├── Constructor │ │ ├── FrameProcess │ │ │ ├── index.js │ │ │ └── core │ │ │ │ ├── Process.js │ │ │ │ └── Thread.js │ │ ├── EventBus.js │ │ └── CombJudge │ │ │ └── index.js │ │ ├── package │ │ ├── source │ │ │ ├── helpers.js │ │ │ └── index.js │ │ ├── classnames │ │ │ ├── index.js │ │ │ ├── helpers.js │ │ │ └── tests │ │ │ │ ├── index.test.js │ │ │ │ └── helpers.test.js │ │ ├── storage │ │ │ ├── __with__supportive.js │ │ │ └── index.js │ │ ├── i18n │ │ │ ├── i18n.test.js │ │ │ └── index.js │ │ ├── utils │ │ │ └── index.test.js │ │ └── url │ │ │ ├── index.js │ │ │ └── url.test.js │ │ ├── base │ │ ├── globalThis.js │ │ ├── is │ │ │ ├── index.js │ │ │ └── is-value-type.test.js │ │ └── try │ │ │ ├── DOC.md │ │ │ └── index.js │ │ └── index.js ├── project │ └── demo │ │ ├── frame │ │ └── reactBaseFrameDemo @ │ │ │ ├── helpers │ │ │ └── index.js │ │ │ ├── views │ │ │ ├── Home │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ └── SubPage │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ ├── assets │ │ │ ├── i18n │ │ │ │ ├── en_US.json │ │ │ │ ├── in.json │ │ │ │ ├── ms.json │ │ │ │ └── vi.json │ │ │ └── style.css │ │ │ ├── components │ │ │ └── Common │ │ │ │ ├── style.m.scss │ │ │ │ └── index.js │ │ │ ├── config │ │ │ ├── source.js │ │ │ ├── router.js │ │ │ ├── style │ │ │ │ └── mixins.scss │ │ │ └── locale.js │ │ │ ├── store │ │ │ ├── index.js │ │ │ └── modules │ │ │ │ └── main.js │ │ │ └── index.js │ │ ├── simple │ │ ├── pageDemoB @ │ │ │ ├── test.js │ │ │ └── index.js │ │ ├── pageDemoA @ │ │ │ ├── style.scss │ │ │ ├── test2.js │ │ │ ├── test3.js │ │ │ ├── pageA.common.js │ │ │ ├── style2.scss │ │ │ ├── test.js │ │ │ └── index.js │ │ ├── markedDemo @ │ │ │ └── index.js │ │ └── commonDemo @ │ │ │ └── index.js │ │ ├── react │ │ ├── rollDemo @ │ │ │ ├── Roll │ │ │ │ ├── style.scss │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── GridRollSample │ │ │ │ ├── style.scss │ │ │ │ └── index.js │ │ │ ├── RollSample │ │ │ │ ├── style.scss │ │ │ │ └── index.js │ │ │ └── helpers │ │ │ │ ├── divider.js │ │ │ │ ├── runner.js │ │ │ │ └── roller.js │ │ ├── reactRouterDemo @ │ │ │ ├── test.css │ │ │ ├── style.scss │ │ │ └── index.js │ │ ├── nestedRouterDemo @ │ │ │ ├── views │ │ │ │ └── position │ │ │ │ │ ├── route1 │ │ │ │ │ ├── sub1.js │ │ │ │ │ ├── sub2.js │ │ │ │ │ ├── sub3.js │ │ │ │ │ └── index.js │ │ │ │ │ ├── route2 │ │ │ │ │ ├── sub1.js │ │ │ │ │ ├── sub2.js │ │ │ │ │ ├── sub3.js │ │ │ │ │ └── index.js │ │ │ │ │ ├── route3 │ │ │ │ │ ├── sub1.js │ │ │ │ │ ├── sub2.js │ │ │ │ │ ├── sub3.js │ │ │ │ │ └── index.js │ │ │ │ │ ├── style.scss │ │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── reset.css │ │ │ ├── app.js │ │ │ └── components │ │ │ │ └── StupidLink.js │ │ ├── antd │ │ │ ├── Tabs @antdTabsDemo │ │ │ │ └── index.js │ │ │ ├── Calendar @antdCalendarDemo │ │ │ │ └── index.js │ │ │ ├── Slider @antdSliderDemo │ │ │ │ └── index.js │ │ │ └── LocalProviderDemo @ │ │ │ │ └── index.js │ │ ├── tweenDemo @ │ │ │ ├── index.js │ │ │ ├── views │ │ │ │ ├── Easing │ │ │ │ │ ├── style.m.scss │ │ │ │ │ ├── components │ │ │ │ │ │ └── EaseLine │ │ │ │ │ │ │ └── style.m.scss │ │ │ │ │ └── index.js │ │ │ │ └── Home │ │ │ │ │ └── style.m.scss │ │ │ └── router.js │ │ ├── StrictListDemo @ │ │ │ └── style.m.scss │ │ ├── reactDemo @ │ │ │ └── style.scss │ │ └── CacheRouteDemo @ │ │ │ └── index.js │ │ └── vue │ │ ├── vueDemo @ │ │ ├── style.scss │ │ ├── index.js │ │ └── App.vue │ │ ├── vueRouterDemo @ │ │ ├── App.vue │ │ ├── view │ │ │ ├── About.vue │ │ │ └── Home.vue │ │ ├── index.js │ │ └── router.js │ │ └── mintUIDemo @ │ │ ├── index.js │ │ └── App.vue ├── assets │ ├── img │ │ └── hot.png │ ├── font │ │ ├── din-bold.otf │ │ ├── opensans.ttf │ │ ├── Helvetica.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Medium.ttf │ │ ├── opensans-bold.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── GothamRoundedMedium.ttf │ │ ├── Helvetica-Narrow-Bold.ttf │ │ ├── SF-Pro-Display-Light.otf │ │ ├── SF-Pro-Display-Regular.otf │ │ └── SF-Pro-Display-Semibold.otf │ └── i18n │ │ ├── antd-mobile │ │ └── calendar │ │ │ ├── zh_CN.js │ │ │ └── en_US.js │ │ └── common │ │ ├── vi.json │ │ ├── in.json │ │ └── en_US.json └── __prefix__ │ ├── style │ ├── __eruda__fix.scss │ ├── __postcss-viewport-units__fix.scss │ ├── __antd__fix.scss │ └── reset.scss │ ├── eruda │ ├── helpers │ │ ├── source │ │ │ ├── helpers.js │ │ │ └── index.js │ │ ├── globalThis.js │ │ └── overide.js │ └── index.js │ └── index.js ├── .gitignore ├── .prettierignore ├── .prettierrc ├── jsconfig.json ├── .vscode └── settings.json ├── postcss.config.js ├── .eslintrc.json └── .babelrc /docs/vendor/v-layoutDemo.9da86e.css: -------------------------------------------------------------------------------- 1 | *{margin:0;padding:0} -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/Marker/style.m.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/helpers/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/views/Home/style.m.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/assets/i18n/en_US.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/assets/i18n/in.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/assets/i18n/ms.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/assets/i18n/vi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/views/SubPage/style.m.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/project/pageDemoA.1081c9.css: -------------------------------------------------------------------------------- 1 | h1{color:red}h2{color:green}h1{color:red} -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/components/Common/style.m.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoB @/test.js: -------------------------------------------------------------------------------- 1 | export const test = 'test ' 2 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/style.scss: -------------------------------------------------------------------------------- 1 | 2 | h1 { 3 | color: red; 4 | } -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Map' 2 | -------------------------------------------------------------------------------- /src/vendor/demo/common_common.js: -------------------------------------------------------------------------------- 1 | export const common_common = 'common common' 2 | -------------------------------------------------------------------------------- /src/vendor/demo/component/layoutDemo @/style.scss: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | -------------------------------------------------------------------------------- /src/assets/img/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/img/hot.png -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/Roll/style.scss: -------------------------------------------------------------------------------- 1 | 2 | button { 3 | margin: 20pt; 4 | padding: 10pt; 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/font/din-bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/din-bold.otf -------------------------------------------------------------------------------- /src/assets/font/opensans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/opensans.ttf -------------------------------------------------------------------------------- /src/assets/font/Helvetica.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/Helvetica.ttf -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/test2.js: -------------------------------------------------------------------------------- 1 | import { commonB } from './pageA.common' 2 | 3 | export const test2 = commonB 4 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/test3.js: -------------------------------------------------------------------------------- 1 | import { commonC } from './pageA.common' 2 | 3 | export const test3 = 'test 3' 4 | -------------------------------------------------------------------------------- /src/assets/font/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/Roboto-Light.ttf -------------------------------------------------------------------------------- /src/assets/font/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/Roboto-Medium.ttf -------------------------------------------------------------------------------- /src/assets/font/opensans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/opensans-bold.ttf -------------------------------------------------------------------------------- /src/assets/font/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/Roboto-Regular.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/din-bold.20720c.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/docs/assets/fonts/din-bold.20720c.otf -------------------------------------------------------------------------------- /docs/assets/fonts/Roboto-Light.7b5fb8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/docs/assets/fonts/Roboto-Light.7b5fb8.ttf -------------------------------------------------------------------------------- /src/assets/font/GothamRoundedMedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/GothamRoundedMedium.ttf -------------------------------------------------------------------------------- /src/assets/font/Helvetica-Narrow-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/Helvetica-Narrow-Bold.ttf -------------------------------------------------------------------------------- /src/assets/font/SF-Pro-Display-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/SF-Pro-Display-Light.otf -------------------------------------------------------------------------------- /src/project/demo/react/reactRouterDemo @/test.css: -------------------------------------------------------------------------------- 1 | 2 | :root { 3 | --mainColor: gray(85); 4 | } 5 | 6 | * { 7 | color: var(--mainColor); 8 | } -------------------------------------------------------------------------------- /docs/assets/fonts/Roboto-Regular.ac3f79.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/docs/assets/fonts/Roboto-Regular.ac3f79.ttf -------------------------------------------------------------------------------- /src/assets/font/SF-Pro-Display-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/SF-Pro-Display-Regular.otf -------------------------------------------------------------------------------- /src/assets/font/SF-Pro-Display-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/assets/font/SF-Pro-Display-Semibold.otf -------------------------------------------------------------------------------- /src/project/demo/vue/vueDemo @/style.scss: -------------------------------------------------------------------------------- 1 | * { 2 | color: blue; 3 | font-size: 24pt; 4 | height: 100vh; 5 | div { 6 | color: red; 7 | } 8 | } -------------------------------------------------------------------------------- /src/__prefix__/style/__eruda__fix.scss: -------------------------------------------------------------------------------- 1 | div[data-eruda] { 2 | display: none; 3 | 4 | ::after, 5 | ::before { 6 | color: inherit; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/index.js: -------------------------------------------------------------------------------- 1 | import GoogleMap from './GoogleMap' 2 | 3 | export { GoogleMap } 4 | 5 | export default { 6 | GoogleMap 7 | } 8 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/DOC/img/Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/vendor/components/UI @/DOC/img/Button.png -------------------------------------------------------------------------------- /src/vendor/components/UI @/DOC/img/Loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/vendor/components/UI @/DOC/img/Loading.gif -------------------------------------------------------------------------------- /src/vendor/components/UI @/DOC/img/Countdown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/vendor/components/UI @/DOC/img/Countdown.gif -------------------------------------------------------------------------------- /src/__prefix__/style/__postcss-viewport-units__fix.scss: -------------------------------------------------------------------------------- 1 | ::after, 2 | ::before { 3 | color: transparent; 4 | } 5 | 6 | img { 7 | content: normal !important; 8 | } 9 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route1/sub1.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route1/sub1
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route1/sub2.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route1/sub2
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route1/sub3.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route1/sub3
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route2/sub1.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route2/sub1
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route2/sub2.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route2/sub2
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route2/sub3.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route2/sub3
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route3/sub1.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route3/sub1
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route3/sub2.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route3/sub2
4 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route3/sub3.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () =>
route3/sub3
4 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/DOC/img/ActivityIndicator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CJY0208/webpack-multiple-pages/HEAD/src/vendor/components/UI @/DOC/img/ActivityIndicator.gif -------------------------------------------------------------------------------- /src/project/demo/vue/vueRouterDemo @/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /src/vendor/helpers @/Constructor/FrameProcess/index.js: -------------------------------------------------------------------------------- 1 | import Process from './core/Process' 2 | 3 | export const defaultProcess = new Process() 4 | 5 | export default Process 6 | -------------------------------------------------------------------------------- /docs/project/vueDemo.3ceb5b.css: -------------------------------------------------------------------------------- 1 | 2 | *{color:#464646;content:"viewport-units-buggyfill; font-size: 3.333vw";font-size:3.333vw 3 | } 4 | * div{color:red 5 | } 6 | .test{background-color:pink 7 | } -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/View/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .view { 3 | height: 100%; 4 | max-height: 100vh; 5 | overflow: hidden; 6 | display: flex; 7 | flex-direction: column; 8 | } 9 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/pageA.common.js: -------------------------------------------------------------------------------- 1 | console.log('pageA 公共模块') 2 | 3 | export const commonA = 'common A' 4 | 5 | export const commonB = 'common B' 6 | 7 | export const commonC = 'common C' 8 | -------------------------------------------------------------------------------- /src/project/demo/simple/markedDemo @/index.js: -------------------------------------------------------------------------------- 1 | // import '__prefix__' 2 | import terms from './terms.md' 3 | // const terms = 'lala' 4 | 5 | console.log(terms) 6 | 7 | document.querySelector('#root').innerHTML = terms 8 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/style2.scss: -------------------------------------------------------------------------------- 1 | @import './style.scss'; 2 | 3 | h2 { 4 | color: green; 5 | } 6 | h2 { 7 | color: green; 8 | } 9 | h2 { 10 | color: green; 11 | } 12 | h2 { 13 | color: green; 14 | } -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/test.js: -------------------------------------------------------------------------------- 1 | import { commonA } from './pageA.common' 2 | // import { fnA } from '@layout' 3 | 4 | export const test = commonA 5 | 6 | export const shaking = 'shaking ' 7 | 8 | import './style2' 9 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from 'react-dom' 3 | 4 | import './reset.css' 5 | import App from './app' 6 | 7 | render(, document.getElementById('root')) 8 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueRouterDemo @/view/About.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueRouterDemo @/view/Home.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/reset.css: -------------------------------------------------------------------------------- 1 | 2 | * { 3 | margin: 0; 4 | padding: 0; 5 | border: 0; 6 | outline: 0; 7 | list-style: none; 8 | } 9 | 10 | html, 11 | body { 12 | width: 100%; 13 | height: 100%; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /docs/async/my-test2.e0beaf.js: -------------------------------------------------------------------------------- 1 | webpackJsonp(['my-test2'], { 2 | QMd3: function(e, t, o) { 3 | 'use strict' 4 | Object.defineProperty(t, '__esModule', { value: !0 }), (t.test2 = void 0) 5 | var s = o('lbQB') 6 | t.test2 = s.commonB 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/index.js: -------------------------------------------------------------------------------- 1 | export default from './components/CacheRoute' 2 | export CacheRoute from './components/CacheRoute' 3 | export CacheSwitch from './components/CacheSwitch' 4 | export { dropByCacheKey, getCachingKeys, clearCache } from './core/manager' 5 | -------------------------------------------------------------------------------- /src/project/demo/react/antd/Tabs @antdTabsDemo/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | 5 | import * as helpers from '@helpers' 6 | import App from './app' 7 | 8 | ReactDOM.render(, document.getElementById('root')) 9 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/config/source.js: -------------------------------------------------------------------------------- 1 | import * as helpers from '@helpers' 2 | 3 | const { source: { js, css } = {} } = helpers 4 | 5 | // 手淘图标库 6 | js('//at.alicdn.com/t/font_622014_lyah3ms4ythdunmi.js') 7 | css('//at.alicdn.com/t/font_622014_lyah3ms4ythdunmi.css') 8 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/ScrollView/RefreshHolder/style.m.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .holder, 4 | .wrapper { 5 | width: 100%; 6 | } 7 | 8 | .holder { 9 | height: 0; 10 | position: relative; 11 | } 12 | 13 | .wrapper { 14 | position: absolute; 15 | bottom: 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/components/Common/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | 5 | import './style.m.scss' 6 | 7 | const Common = props =>
I am Common Component
8 | 9 | export default Common 10 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import Vue from 'vue' 3 | import 'vuex' 4 | 5 | import App from './App' 6 | 7 | Vue.config.productionTip = true 8 | 9 | new Vue({ 10 | el: '#root', 11 | render: createElement => createElement('App'), 12 | components: { App } 13 | }) 14 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/index.js: -------------------------------------------------------------------------------- 1 | import ReModulex from './core/ReModulex' 2 | 3 | export const createModule = (...args) => new ReModulex(...args) 4 | export { ModuleProvider, connectModules } from './core/context' 5 | export { mapModules } from './helpers/modules' 6 | export { applyStore } from './helpers/store' 7 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import 'css-loader/lib/css-base' 3 | import 'style-loader/lib/addStyles' 4 | import React from 'react' 5 | import { render } from 'react-dom' 6 | 7 | import AppRoute from './router' 8 | 9 | render(, document.getElementById('root')) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | build/config/__dll/manifest 4 | build/config/__dll/files 5 | build/config/__dll__check/manifest 6 | build/config/__dll__check/files 7 | yarn-error.log 8 | /__entry.config.js 9 | build/scripts/language/i18n 10 | build/scripts/language/.txt 11 | package-lock.json 12 | npm-debug.log 13 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | build/config/__dll/manifest 4 | build/config/__dll/files 5 | # build/config/__dll__check/manifest 6 | build/config/__dll__check/files 7 | package-lock.json 8 | build/utils/autodll-webpack-plugin 9 | __entry.config.js 10 | build/scripts/language/i18n 11 | build/scripts/language/.txt 12 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueRouterDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import Vue from 'vue' 3 | import App from './App' 4 | import router from './router' 5 | 6 | Vue.use(router) 7 | 8 | new Vue({ 9 | el: '#root', 10 | router, 11 | render: createElement => createElement('App'), 12 | components: { App } 13 | }) 14 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/View/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { classnames } from '@helpers' 3 | import './style.m.scss' 4 | 5 | const View = props => ( 6 |
7 | {props.children} 8 |
9 | ) 10 | 11 | export default View 12 | -------------------------------------------------------------------------------- /docs/project/reactRouterDemo.c256bc.css: -------------------------------------------------------------------------------- 1 | div{color:#00f}div h2{color:orange}h2,li{content:"viewport-units-buggyfill; font-size: 4.444vw";font-size:4.444vw}.module{background:red;color:green}.another-module{background:#ff0;color:#ffdead}.a{background:rgba(255,165,0,.5);content:"viewport-units-buggyfill; height: 1.389vw";height:1.389vw}*{color:#555} -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/ScrollView/RefreshHolder/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import './style.m.css' 4 | 5 | const RefreshHolder = ({ children }) => ( 6 |
7 |
{children}
8 |
9 | ) 10 | 11 | export default RefreshHolder 12 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/views/SubPage/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | 5 | import './style.m.scss' 6 | 7 | @helpers.hot(module) 8 | export default class SubPage extends Component { 9 | render() { 10 | return
SubPage
11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/views/Easing/style.m.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 100vw; 3 | height: 100vh; 4 | color: white; 5 | background: #18212d; 6 | 7 | ul { 8 | padding: 0; 9 | display: flex; 10 | justify-content: center; 11 | flex-wrap: wrap; 12 | 13 | list-style: none; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "useTabs": false, 4 | "semi": false, 5 | "singleQuote": true, 6 | "bracketSpacing": true, 7 | "overrides": [ 8 | { 9 | "files": ["*.json", ".babelrc", ".prettierrc"], 10 | "options": { 11 | "parser": "json", 12 | "tabWidth": 2 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/project/demo/vue/mintUIDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import Vue from 'vue' 3 | import { DatetimePicker } from 'mint-ui' 4 | import App from './App' 5 | 6 | Vue.component(DatetimePicker.name, DatetimePicker) 7 | 8 | new Vue({ 9 | el: '#root', 10 | render: createElement => createElement('App'), 11 | components: { App } 12 | }) 13 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/Map/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | @mixin hidden { 3 | display: none; 4 | opacity: 0; 5 | position: absolute; 6 | z-index: -9999; 7 | pointer-events: none; 8 | visibility: hidden; 9 | } 10 | 11 | .map { 12 | height: 100%; 13 | 14 | & a, 15 | & :global(.gm-style-cc) { 16 | @include hidden; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/splitter.js: -------------------------------------------------------------------------------- 1 | const __splitter = 'Y(^_^)Y' 2 | 3 | export const combine = (...actions) => actions.join(__splitter) 4 | export const split = (types, reducer, name) => 5 | types.split(__splitter).reduce( 6 | (actions, type) => ({ 7 | ...actions, 8 | [`${name}::${type}`]: reducer 9 | }), 10 | {} 11 | ) 12 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import 'css-loader/lib/css-base' 3 | import 'style-loader/lib/addStyles' 4 | import React from 'react' 5 | import { render } from 'react-dom' 6 | 7 | import Roll from './Roll' 8 | 9 | document.getElementsByTagName('title')[0].innerHTML = 'Roll Demo' 10 | 11 | render(, document.getElementById('root')) 12 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/ActivityIndicator/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .activity-indicator { 3 | width: 60pt; 4 | height: 60pt; 5 | 6 | border-radius: 50%; 7 | border: solid 2px; 8 | 9 | animation: rotate 1s infinite linear; 10 | } 11 | 12 | @keyframes rotate { 13 | from { 14 | transform: rotate(0deg) 15 | } 16 | 17 | to { 18 | transform: rotate(360deg) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/project/reactBaseFrameDemo.a0453c.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Roboto-Light;src:url(../assets/fonts/Roboto-Light.7b5fb8.ttf) format("truetype")}@font-face{font-family:Roboto-Regular;src:url(../assets/fonts/Roboto-Regular.ac3f79.ttf) format("truetype")}@font-face{font-family:DIN-Bold;src:url(../assets/fonts/din-bold.20720c.otf) format("truetype")}*{font-family:Roboto-Regular}.__CacheRoute__wrapper{height:100%;width:100%} -------------------------------------------------------------------------------- /src/vendor/demo/component/layoutDemo @/index.js: -------------------------------------------------------------------------------- 1 | // import '@commonDemo' 2 | // import { common_common } from '@commonDemo' 3 | // console.log(common_common) 4 | import './style.scss' 5 | 6 | export const fnA = () => { 7 | console.log('common2 fnA') 8 | } 9 | 10 | export const fnB = () => { 11 | console.log('common2 fnB') 12 | } 13 | 14 | export const fnC = () => { 15 | console.log('common2 fnC') 16 | } 17 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueRouterDemo @/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | import Home from './view/Home' 5 | import About from './view/About' 6 | 7 | Vue.use(Router) 8 | 9 | export default new Router({ 10 | routes: [ 11 | { 12 | path: '/', 13 | component: Home 14 | }, 15 | { 16 | path: '/about', 17 | component: About 18 | } 19 | ] 20 | }) 21 | -------------------------------------------------------------------------------- /src/project/demo/react/antd/Calendar @antdCalendarDemo/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | 5 | import * as helpers from '@helpers' 6 | import App from './app' 7 | 8 | if (process.env.TEST) { 9 | helpers.source 10 | .js('//cdn.jsdelivr.net/npm/eruda', 'eruda') 11 | .then(eruda => eruda.init()) 12 | } 13 | 14 | ReactDOM.render(, document.getElementById('root')) 15 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/route/components/Loading/style.m.css: -------------------------------------------------------------------------------- 1 | 2 | .loading { 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | 7 | position: absolute; 8 | left: 0; 9 | top: 0; 10 | right: 0; 11 | bottom: 0; 12 | 13 | width: 100vw; 14 | height: 100vh; 15 | 16 | background: rgba(255, 255, 255, .5); 17 | 18 | & .activity-indicator { 19 | width: 40px; 20 | height: 40px; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/route/components/Loading/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import Portal from '../../../../layout/Portal' 4 | import ActivityIndicator from '../../../../components/ActivityIndicator' 5 | 6 | import './style.m.css' 7 | 8 | const Loading = () => ( 9 | 10 | 11 | 12 | ) 13 | 14 | export default Loading 15 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/route/asyncComponent.js: -------------------------------------------------------------------------------- 1 | import React, { lazy, Suspense } from 'react' 2 | 3 | import Loading from './components/Loading' 4 | 5 | const asyncComponent = importComponent => { 6 | const Component = lazy(importComponent) 7 | 8 | return function LazyComponent(props) { 9 | return ( 10 | }> 11 | 12 | 13 | ) 14 | } 15 | } 16 | 17 | export default asyncComponent 18 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | HashRouter as Router, 4 | Route, 5 | Switch, 6 | NavLink, 7 | Redirect 8 | } from 'react-router-dom' 9 | 10 | import Position from './views/position' 11 | 12 | const App = () => ( 13 | 14 | 15 | 16 | 17 | 18 | 19 | ) 20 | 21 | export default App 22 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/helpers/is.js: -------------------------------------------------------------------------------- 1 | // 值类型判断 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | export const isUndefined = val => typeof val === 'undefined' 3 | 4 | export const isNull = val => val === null 5 | 6 | export const isFunction = val => typeof val === 'function' 7 | 8 | export const isString = val => typeof val === 'string' 9 | 10 | export const isExist = val => !(isUndefined(val) || isNull(val)) 11 | // 值类型判断 ------------------------------------------------------------- 12 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Icon/style.m.css: -------------------------------------------------------------------------------- 1 | :global(.icon) { 2 | display: inline-block; 3 | width: 1em; 4 | height: 1em; 5 | vertical-align: -0.15em; 6 | fill: currentColor; 7 | overflow: visible; 8 | position: relative; 9 | font-size: 46pt; 10 | 11 | &::before, 12 | &::after { 13 | position: absolute; 14 | left: 50%; 15 | top: 50%; 16 | transform: translate(-50%, -50%); 17 | color: inherit; 18 | } 19 | } 20 | 21 | :global(i.icon) { 22 | font-size: 46pt; 23 | } 24 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/ActivityIndicator/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import './style.m.scss' 4 | 5 | const ActivityIndicator = ({ subColor, color, ...props }) => ( 6 |
13 | ) 14 | 15 | ActivityIndicator.defaultProps = { 16 | subColor: '#fff', 17 | color: '#fd9933' 18 | } 19 | 20 | export default ActivityIndicator 21 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/views/Easing/components/EaseLine/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .content { 3 | padding: 30px; 4 | 5 | h2 { 6 | font-size: 16px; 7 | margin: 20px; 8 | text-align: center; 9 | } 10 | } 11 | 12 | .line { 13 | position: relative; 14 | width: 400px; 15 | height: 400px; 16 | background: #18212d; 17 | // outline: solid 1px #666; 18 | border-top: solid 1px #222; 19 | border-bottom: solid 1px #222; 20 | 21 | canvas { 22 | width: 100%; 23 | height: 100%; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/vendor/v-layoutDemo.9da86e.js: -------------------------------------------------------------------------------- 1 | webpackJsonp(['v-layoutDemo'], { 2 | NzAI: function(n, o, f) { 3 | 'use strict' 4 | Object.defineProperty(o, '__esModule', { value: !0 }), 5 | (o.fnC = o.fnB = o.fnA = void 0), 6 | f('mnyB') 7 | ;(o.fnA = function() { 8 | console.log('common2 fnA') 9 | }), 10 | (o.fnB = function() { 11 | console.log('common2 fnB') 12 | }), 13 | (o.fnC = function() { 14 | console.log('common2 fnC') 15 | }) 16 | }, 17 | mnyB: function(n, o) {} 18 | }) 19 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/source/helpers.js: -------------------------------------------------------------------------------- 1 | import { isUndefined } from '@helpers/base/is' 2 | import root from '@helpers/base/globalThis' 3 | import { curry } from '@helpers/package/utils' 4 | 5 | const getExt = curry((src, key) => { 6 | const ext = root[key] 7 | !isUndefined(key) && 8 | isUndefined(ext) && 9 | console.warn(`No external named '${key}' in global after loaded ${src}`) 10 | return ext 11 | }) 12 | 13 | export const getExternals = (src, externals) => 14 | Array.isArray(externals) ? externals.map(getExt(src)) : getExt(src, externals) 15 | -------------------------------------------------------------------------------- /src/project/demo/vue/vueDemo @/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 35 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/ScrollView/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .scrollView { 3 | flex: 1; 4 | height: 100%; 5 | max-height: 100vh; 6 | overflow: auto; 7 | } 8 | 9 | .footer { 10 | width: 720pt; 11 | height: 138pt; 12 | font-size: 30pt; 13 | 14 | display: flex; 15 | align-items: center; 16 | justify-content: center; 17 | color: #999; 18 | } 19 | 20 | .indicator { 21 | width: 100%; 22 | max-width: 720pt; 23 | height: 48pt; 24 | font-size: 30pt; 25 | 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | } 30 | -------------------------------------------------------------------------------- /src/project/demo/react/reactRouterDemo @/style.scss: -------------------------------------------------------------------------------- 1 | 2 | div { 3 | color: blue; 4 | // height: 100vh; 5 | 6 | h2 { 7 | color: orange; // lalala 8 | } 9 | } 10 | 11 | li { 12 | font-size: 32pt; 13 | } 14 | 15 | h2 { 16 | font-size: 32pt; 17 | } 18 | 19 | .module { 20 | color: green; 21 | } 22 | .another-module { 23 | color: navajowhite; 24 | } 25 | .module { 26 | background: red; 27 | } 28 | .another-module { 29 | background: yellow; 30 | } 31 | 32 | .a { 33 | height: 10pt; 34 | background: orange; 35 | background: rgba(255, 165, 0, 0.5); 36 | } 37 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/assets/style.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face { 3 | font-family: 'Roboto-Light'; 4 | src: url(~__assets__/font/Roboto-Light.ttf) format('truetype'); 5 | } 6 | 7 | @font-face { 8 | font-family: 'Roboto-Regular'; 9 | src: url(~__assets__/font/Roboto-Regular.ttf) format('truetype'); 10 | } 11 | 12 | @font-face { 13 | font-family: 'DIN-Bold'; 14 | src: url(~__assets__/font/din-bold.otf) format('truetype'); 15 | } 16 | 17 | * { 18 | font-family: 'Roboto-Regular'; 19 | } 20 | 21 | .__CacheRoute__wrapper { 22 | width: 100%; 23 | height: 100%; 24 | } 25 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/config/router.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Route } from 'react-router-dom' 3 | import { CacheRoute, CacheSwitch as Switch } from 'react-router-cache-route' 4 | 5 | import Home from '../views/Home' 6 | import SubPage from '../views/SubPage' 7 | 8 | const AppRouter = () => ( 9 | 10 | 16 | 17 | 18 | ) 19 | 20 | export default AppRouter 21 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/components/StupidLink.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withRouter } from 'react-router-dom' 3 | 4 | export default withRouter(({ history, location, to, children }) => ( 5 | { 8 | const to_path_arr = to.split('/') 9 | 10 | history.push( 11 | location.pathname 12 | .split('/') 13 | .map(path => to_path_arr.shift() || path) 14 | .join('/') 15 | ) 16 | }} 17 | > 18 | {children} 19 | 20 | )) 21 | -------------------------------------------------------------------------------- /src/project/demo/vue/mintUIDemo @/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 26 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/GridRollSample/style.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | .grid-content { 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | z-index: 100; 8 | 9 | display: flex; 10 | 11 | flex-wrap: wrap; 12 | 13 | width: 500pt; 14 | 15 | li { 16 | width: calc(500pt / 3); 17 | height: calc(500pt / 3); 18 | 19 | outline: solid 1px; 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | 24 | &.active { 25 | background: rgba(yellow, .3); 26 | } 27 | 28 | &.hidden { 29 | opacity: 0; 30 | } 31 | } 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/Popup/components/Mask/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .mask { 3 | position: absolute; 4 | 5 | top: 0; 6 | bottom: 0; 7 | left: 0; 8 | right: 0; 9 | 10 | z-index: 1000; 11 | 12 | width: 100%; 13 | height: 100%; 14 | 15 | max-width: 100vw; 16 | max-height: 100vh; 17 | 18 | background-color: rgba(0, 0, 0, .7); 19 | 20 | animation: fade-in .3s ease-in-out; 21 | 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } 26 | 27 | @keyframes fade-in { 28 | from { 29 | opacity: 0; 30 | } 31 | 32 | to { 33 | opacity: 1; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/components/SwitchFragment.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Fragment } from 'react' 2 | 3 | import { isExist } from '../helpers/is' 4 | 5 | function getFragment() { 6 | switch (true) { 7 | case isExist(PropTypes): 8 | return ({ children }) =>
{children}
9 | 10 | case isExist(Fragment): 11 | return ({ children }) => {children} 12 | 13 | default: 14 | return ({ children }) => children 15 | } 16 | } 17 | 18 | const SwitchFragment = getFragment() 19 | SwitchFragment.displayName = 'SwitchFragment' 20 | 21 | export default SwitchFragment 22 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/Portal/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { createPortal } from 'react-dom' 3 | 4 | const $root = document.body 5 | 6 | export default class Portal extends Component { 7 | __$node = document.createElement('div') 8 | 9 | constructor(props) { 10 | super(props) 11 | if (props.className) { 12 | this.__$node.className = props.className 13 | } 14 | } 15 | 16 | componentDidMount = () => $root.appendChild(this.__$node) 17 | componentWillUnmount = () => $root.removeChild(this.__$node) 18 | render = () => createPortal(this.props.children, this.__$node) 19 | } 20 | -------------------------------------------------------------------------------- /src/__prefix__/style/__antd__fix.scss: -------------------------------------------------------------------------------- 1 | #root, 2 | .am-modal-wrap { 3 | .am-list { 4 | .am-list-body, 5 | .am-list-line { 6 | &::before, 7 | &::after { 8 | transform: scaleY(1); 9 | background-color: #efeff4; 10 | } 11 | } 12 | } 13 | } 14 | 15 | .am-modal-wrap { 16 | .am-modal-transparent { 17 | width: 80%; 18 | } 19 | 20 | &.am-modal.am-modal-transparent.am-modal-android { 21 | .am-modal-content { 22 | box-shadow: 1px 1px 12pt #333; 23 | border-radius: 10pt; 24 | } 25 | } 26 | } 27 | 28 | .am-modal-mask-hidden + .am-modal-wrap-popup { 29 | display: none; 30 | } 31 | -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoB @/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDom from 'react-dom' 3 | import md5 from 'md5' 4 | import 'axios' 5 | 6 | import fp from 'lodash/fp' 7 | import _ from 'lodash' 8 | 9 | Object.assign(window, { _, fp }) 10 | 11 | import { fn1 } from '@commonDemo' 12 | import { fnB } from '@layoutDemo' 13 | import { test as test1 } from './test' 14 | // import { test as test2 } from '../pageA/test' 15 | 16 | console.log('pageB ') 17 | 18 | // import(/* webpackChunkName: "my-test2" */ '../pageClassA/pageA #/test2').then(({ test }) => { 19 | // console.log(test) 20 | // }) 21 | 22 | fn1() 23 | // fnB() 24 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/core/Updatable.js: -------------------------------------------------------------------------------- 1 | import { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import { get } from '../helpers/try' 5 | import { isExist } from '../helpers/is' 6 | 7 | export default class Updatable extends Component { 8 | static propsTypes = { 9 | render: PropTypes.func.isRequired, 10 | match: PropTypes.object.isRequired 11 | } 12 | 13 | render = () => this.props.render() 14 | 15 | shouldComponentUpdate(nextProps) { 16 | return ( 17 | isExist(nextProps.match) && 18 | get(nextProps, 'match.__CacheRoute__computedMatch__null') !== true 19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/classnames/index.js: -------------------------------------------------------------------------------- 1 | import __get__className__array from './helpers' 2 | 3 | export default function classnames(...args) { 4 | return [...new Set(__get__className__array(args))].join(' ').trim() 5 | } 6 | 7 | classnames.bind = (mapper = {}) => (...args) => 8 | [ 9 | ...new Set( 10 | __get__className__array(args).map( 11 | className => mapper[className] || className 12 | ) 13 | ) 14 | ] 15 | .join(' ') 16 | .trim() 17 | 18 | classnames.react = mapper => { 19 | const func = classnames.bind(mapper) 20 | return (...args) => ({ 21 | className: func(...args) 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/RollSample/style.scss: -------------------------------------------------------------------------------- 1 | 2 | .content { 3 | width: 500pt; 4 | height: 500pt; 5 | 6 | display: flex; 7 | align-items: center; 8 | position: relative; 9 | z-index: 1; 10 | } 11 | 12 | .roll { 13 | width: 100%; 14 | height: 100%; 15 | border: solid 10pt; 16 | border-radius: 50%; 17 | 18 | border-top-color: red; 19 | border-bottom-color: blue; 20 | border-left-color: green; 21 | border-right-color: orange; 22 | position: absolute; 23 | left: 0; 24 | opacity: .5; 25 | } 26 | 27 | .line { 28 | width: 50%; 29 | height: 1px; 30 | background-color: #333; 31 | 32 | transform-origin: right; 33 | } -------------------------------------------------------------------------------- /src/project/demo/simple/commonDemo @/index.js: -------------------------------------------------------------------------------- 1 | import * as helpers from '@helpers' 2 | import lodash from 'lodash' 3 | 4 | window.helpers = helpers 5 | 6 | console.log(helpers) 7 | 8 | window._ = lodash 9 | 10 | // console.log(1) 11 | 12 | // new Promise(resolve => { 13 | // console.log(2) 14 | 15 | // setTimeout(() => { 16 | // resolve() 17 | // // console.log(3) 18 | // process.nextTick(() => { 19 | // console.log(3) 20 | // }) 21 | // }) 22 | // }).then(() => { 23 | // console.log(4) 24 | // }) 25 | // console.log(5) 26 | // setTimeout(() => { 27 | // console.log(6) 28 | // }) 29 | 30 | // console.log(process.nextTick) 31 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/helpers/getDistance.js: -------------------------------------------------------------------------------- 1 | function toRadians(d) { 2 | return d * Math.PI / 180 3 | } 4 | 5 | export default function getDistance(lat1, lng1, lat2, lng2) { 6 | let radLat1 = toRadians(lat1) 7 | let radLat2 = toRadians(lat2) 8 | let deltaLat = radLat1 - radLat2 9 | let deltaLng = toRadians(lng1) - toRadians(lng2) 10 | let dis = 11 | 2 * 12 | Math.asin( 13 | Math.sqrt( 14 | Math.pow(Math.sin(deltaLat / 2), 2) + 15 | Math.cos(radLat1) * 16 | Math.cos(radLat2) * 17 | Math.pow(Math.sin(deltaLng / 2), 2) 18 | ) 19 | ) 20 | return dis * 6378137 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Loading/style.m.scss: -------------------------------------------------------------------------------- 1 | .loading { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | justify-content: center; 6 | 7 | padding: 30pt; 8 | background-color: rgba(0, 0, 0, 0.6); 9 | border-radius: 12pt; 10 | 11 | min-width: 170pt; 12 | min-height: 160pt; 13 | 14 | max-width: 500pt; 15 | 16 | &.withContent { 17 | padding: 40pt 30pt 20pt; 18 | } 19 | } 20 | 21 | .text { 22 | font-size: 24pt; 23 | line-height: 34pt; 24 | text-align: center; 25 | color: #fff; 26 | padding-top: 30pt; 27 | } 28 | 29 | .mask { 30 | background-color: transparent !important; 31 | } 32 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/store.js: -------------------------------------------------------------------------------- 1 | import { run } from './try' 2 | 3 | let __store 4 | 5 | const check = fn => (...args) => { 6 | if (!__store) { 7 | console.error( 8 | new Error(` 9 | [ReModulex Error] 10 | Forgot to apply the store? 11 | Use 'ReModulex.applyStore' with your redux store! 12 | `) 13 | ) 14 | } 15 | return run(fn, undefined, ...args) 16 | } 17 | 18 | export const applyStore = store => { 19 | __store = store 20 | } 21 | 22 | export const dispatch = check((...args) => run(__store, 'dispatch', ...args)) 23 | export const getState = check((...args) => run(__store, 'getState', ...args)) 24 | -------------------------------------------------------------------------------- /src/__prefix__/eruda/helpers/source/helpers.js: -------------------------------------------------------------------------------- 1 | import root from '../globalThis' 2 | 3 | const isUndefined = obj => typeof obj === 'undefined' 4 | const curry = fn => (...args) => 5 | args.length < fn.length 6 | ? curry(fn.bind(undefined, ...args)) 7 | : fn.apply(undefined, args) 8 | 9 | const getExt = curry((src, key) => { 10 | const ext = root[key] 11 | !isUndefined(key) && 12 | isUndefined(ext) && 13 | console.warn(`No external named '${key}' in global after loaded ${src}`) 14 | return ext 15 | }) 16 | 17 | export const getExternals = (src, externals) => 18 | Array.isArray(externals) ? externals.map(getExt(src)) : getExt(src, externals) 19 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/is.js: -------------------------------------------------------------------------------- 1 | // 值类型判断 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | export const isUndefined = val => typeof val === 'undefined' 3 | 4 | export const isNull = val => val === null 5 | 6 | export const isFunction = val => typeof val === 'function' 7 | 8 | export const isArray = val => val instanceof Array 9 | 10 | export const isObject = val => 11 | typeof val === 'object' && !(isArray(val) || isNull(val)) 12 | 13 | export const isString = val => typeof val === 'string' 14 | 15 | export const isExist = val => !(isUndefined(val) || isNull(val)) 16 | // 值类型判断 ------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/storage/__with__supportive.js: -------------------------------------------------------------------------------- 1 | import { isExist } from '@helpers/base/is' 2 | 3 | let __is__storage__supported = true 4 | 5 | const __key = '__test__supportive__' 6 | const storage = window.localStorage 7 | 8 | if (!isExist(storage)) { 9 | __is__storage__supported = false 10 | } 11 | 12 | try { 13 | storage.setItem(__key, '__test__supportive__') 14 | storage.removeItem(__key) 15 | } catch (err) { 16 | __is__storage__supported = false 17 | } 18 | 19 | export default function withSupportive(func) { 20 | if (!__is__storage__supported) { 21 | return () => console.warn('Storage unsupported') 22 | } 23 | 24 | return func 25 | } 26 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware, compose, combineReducers } from 'redux' 2 | import { persistStore } from 'redux-persist' 3 | 4 | import { isExist, run, globalThis as root } from '@helpers' 5 | 6 | import reduxModule from './modules/main' 7 | 8 | export const store = createStore( 9 | combineReducers({ 10 | main: reduxModule.persistReducer 11 | }), 12 | compose( 13 | ...[ 14 | process.env.NODE_ENV === 'development' 15 | ? run(root, '__REDUX_DEVTOOLS_EXTENSION__') 16 | : undefined 17 | ].filter(isExist) 18 | ) 19 | ) 20 | 21 | export const persistor = persistStore(store) 22 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/helpers/context.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import hoistStatics from 'hoist-non-react-statics' 3 | 4 | import * as helpers from '@helpers' 5 | 6 | const { value } = helpers 7 | const Context = React.createContext() 8 | const { Consumer } = Context 9 | 10 | export const { Provider } = Context 11 | 12 | export const withContext = Component => { 13 | const C = props => ( 14 | {context => } 15 | ) 16 | 17 | C.displayName = `withGoogleMapContext(${value( 18 | Component.displayName, 19 | Component.name 20 | )})` 21 | 22 | return hoistStatics(C, Component) 23 | } 24 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/views/Easing/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useRef, useEffect } from 'react' 2 | 3 | import { View, ScrollView } from '@UI' 4 | import { Tween, sample, clamp } from '@helpers' 5 | 6 | import styles from './style.m.scss' 7 | import EaseLine from './components/EaseLine' 8 | 9 | export default function Easing() { 10 | return ( 11 | 12 | 13 |
    14 | {Object.keys(Tween.easing).map(ease => ( 15 |
  • 16 | 17 |
  • 18 | ))} 19 |
20 |
21 |
22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/assets/i18n/antd-mobile/calendar/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | title: '日期选择', 3 | today: '今天', 4 | month: '月', 5 | year: '年', 6 | am: '上午', 7 | pm: '下午', 8 | dateTimeFormat: 'yyyy年MM月dd日 星期w hh:mm', 9 | dateFormat: 'yyyy年MM月dd日 星期w', 10 | noChoose: '未选择', 11 | week: ['日', '一', '二', '三', '四', '五', '六'], 12 | clear: '清除', 13 | selectTime: '选择时间', 14 | selectStartTime: '选择开始时间', 15 | selectEndTime: '选择结束时间', 16 | start: '开始', 17 | end: '结束', 18 | begin: '起', 19 | over: '止', 20 | begin_over: '起/止', 21 | confirm: '确认', 22 | monthTitle: 'yyyy年MM月', 23 | loadPrevMonth: '加载上一个月', 24 | yesterday: '昨天', 25 | lastWeek: '近一周', 26 | lastMonth: '近一个月' 27 | } 28 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/router.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { createHashHistory } from 'history' 3 | import { Router } from 'react-router-dom' 4 | import { 5 | CacheRoute as Route, 6 | CacheSwitch as Switch 7 | } from 'react-router-cache-route' 8 | 9 | import Home from './views/Home' 10 | import Easing from './views/Easing' 11 | 12 | export const history = createHashHistory() 13 | 14 | export default function AppRoute() { 15 | return ( 16 | 17 | 18 | 19 | 20 | 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/vendor/helpers @/base/globalThis.js: -------------------------------------------------------------------------------- 1 | const getImplementation = () => { 2 | if (typeof self !== 'undefined') { 3 | return self 4 | } 5 | if (typeof window !== 'undefined') { 6 | return window 7 | } 8 | if (typeof global !== 'undefined') { 9 | return global 10 | } 11 | 12 | return Function('return this')() 13 | } 14 | 15 | const implementation = getImplementation() 16 | 17 | const getGlobal = () => { 18 | if ( 19 | typeof global !== 'object' || 20 | !global || 21 | global.Math !== Math || 22 | global.Array !== Array 23 | ) { 24 | return implementation 25 | } 26 | return global 27 | } 28 | 29 | const globalThis = getGlobal() 30 | 31 | export default globalThis 32 | -------------------------------------------------------------------------------- /src/__prefix__/eruda/helpers/globalThis.js: -------------------------------------------------------------------------------- 1 | const getImplementation = () => { 2 | if (typeof self !== 'undefined') { 3 | return self 4 | } 5 | if (typeof window !== 'undefined') { 6 | return window 7 | } 8 | if (typeof global !== 'undefined') { 9 | return global 10 | } 11 | 12 | return Function('return this')() 13 | } 14 | 15 | const implementation = getImplementation() 16 | 17 | const getGlobal = () => { 18 | if ( 19 | typeof global !== 'object' || 20 | !global || 21 | global.Math !== Math || 22 | global.Array !== Array 23 | ) { 24 | return implementation 25 | } 26 | return global 27 | } 28 | 29 | const globalThis = getGlobal() 30 | 31 | export default globalThis 32 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/helpers/divider.js: -------------------------------------------------------------------------------- 1 | import * as helpers from '@helpers' 2 | 3 | const { random } = helpers 4 | 5 | export default class Divider { 6 | constructor(total, count) { 7 | Object.assign(this, { total, count }) 8 | this.per = total / count 9 | } 10 | 11 | judge = amount => Math.floor((amount % this.total) / this.per) 12 | 13 | knock = (index, strict = false) => { 14 | const __offset = this.per / 2 15 | const __piece__middle__value = index * this.per + __offset 16 | 17 | if (strict) { 18 | return __piece__middle__value 19 | } 20 | 21 | return random( 22 | __piece__middle__value - __offset, 23 | __piece__middle__value + __offset 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | // vsc 识别 webpack alias 6 | "__src__": ["src"], 7 | "__prefix__": ["src/__prefix__"], 8 | "__assets__": ["src/assets"], 9 | "@helpers": ["src/vendor/helpers @"], 10 | "@UI": ["src/vendor/components/UI @"], 11 | "@MAP": ["src/vendor/components/MAP @"], 12 | 13 | "__src__/*": ["src/*"], 14 | "__prefix__/*": ["src/__prefix__/*"], 15 | "__assets__/*": ["src/assets/*"], 16 | "@helpers/*": ["src/vendor/helpers @/*"], 17 | "@UI/*": ["src/vendor/components/UI @/*"], 18 | "@MAP/*": ["src/vendor/components/MAP @/*"] 19 | } 20 | }, 21 | "exclude": ["node_modules", "dist"] 22 | } 23 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "files.exclude": { 4 | "**/.vscode": true, 5 | // "node_modules": true, 6 | // "yarn.lock": true, 7 | // "package-lock.json": true, 8 | "**/*.map": true, 9 | "yarn-error.log": true, 10 | ".dirty-branch": true 11 | }, 12 | "files.associations": { 13 | ".babelrc": "jsonc", 14 | ".eslintrc.json": "jsonc", 15 | ".prettierrc": "jsonc", 16 | "*.css": "css" 17 | }, 18 | "css.validate": false, 19 | "scss.validate": false, 20 | "editor.foldingStrategy": "indentation", 21 | "emmet.triggerExpansionOnTab": true, 22 | "javascript.validate.enable": false, 23 | "emmet.includeLanguages": { 24 | "vue-html": "html", 25 | "javascript": "javascriptreact" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/core/manager.js: -------------------------------------------------------------------------------- 1 | import { run } from '../helpers/try' 2 | 3 | const __components = {} 4 | 5 | export const register = (key, route) => { 6 | __components[key] = route 7 | } 8 | 9 | export const dropByCacheKey = key => { 10 | run(__components, [key, 'setState'], { 11 | cached: false 12 | }) 13 | } 14 | 15 | export const clearCache = () => { 16 | Object.entries(__components) 17 | .filter(([, component]) => component.state.cached) 18 | .forEach(([key]) => 19 | run(__components, [key, 'setState'], { 20 | cached: false 21 | }) 22 | ) 23 | } 24 | 25 | export const getCachingKeys = () => 26 | Object.entries(__components) 27 | .filter(([, component]) => component.state.cached) 28 | .map(([key]) => key) 29 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route2/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | HashRouter as Router, 4 | Route, 5 | Switch, 6 | NavLink, 7 | Redirect 8 | } from 'react-router-dom' 9 | 10 | import Sub1 from './sub1' 11 | import Sub2 from './sub2' 12 | import Sub3 from './sub3' 13 | 14 | export default () => ( 15 |
16 |
17 | sub1 18 | sub2 19 |
20 | 21 | 22 | 23 | 24 | 25 |
26 | ) 27 | -------------------------------------------------------------------------------- /src/assets/i18n/antd-mobile/calendar/en_US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | title: 'Calendar', 3 | today: 'Today', 4 | month: 'Month', 5 | year: 'Year', 6 | am: 'AM', 7 | pm: 'PM', 8 | dateTimeFormat: 'MM/dd/yyyy w hh:mm', 9 | dateFormat: 'yyyy/MM/dd w', 10 | noChoose: 'No Choose', 11 | week: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fir', 'Sat'], 12 | clear: 'Clear', 13 | selectTime: 'Select Time', 14 | selectStartTime: 'Select Start Time', 15 | selectEndTime: 'Select End Time', 16 | start: 'Start', 17 | end: 'End', 18 | begin: 'Start', 19 | over: 'End', 20 | begin_over: 'S/E', 21 | confirm: 'Confirm', 22 | monthTitle: 'yyyy/MM', 23 | loadPrevMonth: 'Load Prev Month', 24 | yesterday: 'Yesterday', 25 | lastWeek: 'Last Week', 26 | lastMonth: 'Last Month' 27 | } 28 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Icon/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import { classnames, get } from '@helpers' 4 | 5 | import './style.m.css' 6 | 7 | export default function Icon(props) { 8 | let { name = '' } = props 9 | const isSvg = name.startsWith('#') 10 | const prefix = name.split('-').shift() 11 | 12 | return isSvg ? ( 13 | 20 | ) : ( 21 | 30 | ) 31 | } 32 | -------------------------------------------------------------------------------- /src/__prefix__/eruda/helpers/source/index.js: -------------------------------------------------------------------------------- 1 | import { getExternals } from './helpers' 2 | 3 | // 增加 source 缓存,防止多次加载同一资源 4 | const cache = { 5 | js: [] 6 | } 7 | 8 | export const js = (src, externals) => { 9 | if (cache.js.includes(src)) { 10 | console.warn(`[source.js] ${src} 已被加载`) 11 | return Promise.resolve(getExternals(src, externals)) 12 | } 13 | 14 | return new Promise((resolve, reject) => { 15 | const script = document.createElement('script') 16 | script.setAttribute('src', src) 17 | script.addEventListener('load', () => 18 | setTimeout(() => { 19 | cache.js.push(src) 20 | 21 | resolve(getExternals(src, externals)) 22 | }) 23 | ) 24 | script.addEventListener('error', reject) 25 | document.body.appendChild(script) 26 | }) 27 | } 28 | -------------------------------------------------------------------------------- /src/__prefix__/style/reset.scss: -------------------------------------------------------------------------------- 1 | * { 2 | list-style: none; 3 | vertical-align: baseline; 4 | font-weight: inherit; 5 | font-family: inherit; 6 | font-style: inherit; 7 | font-size: 32pt; 8 | outline: 0; 9 | padding: 0; 10 | margin: 0; 11 | border: 0; 12 | color: inherit; 13 | flex-basis: auto; 14 | 15 | box-sizing: border-box; 16 | -webkit-overflow-scrolling: touch; 17 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 18 | -webkit-text-size-adjust: 100%; 19 | cursor: pointer; 20 | // user-select: none; 21 | 22 | &::-webkit-scrollbar { 23 | width: 0; 24 | height: 0; 25 | } 26 | } 27 | 28 | input, 29 | textarea { 30 | user-select: initial; 31 | } 32 | 33 | #root, 34 | html, 35 | body { 36 | width: 100%; 37 | height: 100%; 38 | overflow: hidden; 39 | } 40 | -------------------------------------------------------------------------------- /src/vendor/demo/commonDemo @/index.js: -------------------------------------------------------------------------------- 1 | import { common_common as aaa } from '../common_common' 2 | // console.log(common_common) 3 | 4 | // export const common_common = aaa 5 | 6 | export const fn1 = () => { 7 | console.log('common fn1') 8 | } 9 | 10 | export const fn2 = () => { 11 | console.log('common fn2') 12 | } 13 | 14 | export const fn3 = () => { 15 | console.log('common fn3') 16 | } 17 | 18 | function Instantiate(Class, opt) { 19 | return new Class(opt) 20 | } 21 | 22 | const delay = time => new Promise(resolve => setTimeout(resolve, time)) 23 | 24 | @Instantiate 25 | export class Test { 26 | async test() { 27 | console.log('common Test') 28 | await delay(2000) 29 | console.log('common Test class after 2000 ms ') 30 | } 31 | } 32 | 33 | console.log(Test) 34 | Test.test() 35 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Button/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import { classnames } from '@helpers' 5 | import './style.m.scss' 6 | 7 | const Button = ({ 8 | children, 9 | type, 10 | disable, 11 | active, 12 | onClick, 13 | className, 14 | ...props 15 | }) => ( 16 |
21 | {children} 22 |
23 | ) 24 | 25 | Button.defaultProps = { 26 | type: 'default', 27 | disable: false, 28 | active: false 29 | } 30 | 31 | Button.propTypes = { 32 | type: PropTypes.oneOf(['default', 'capsule', 'full']), 33 | disable: PropTypes.bool, 34 | active: PropTypes.bool, 35 | onClick: PropTypes.func 36 | } 37 | 38 | export default Button 39 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/try/DOC.md: -------------------------------------------------------------------------------- 1 | 2 | # try 模块 3 | 4 | 值相关的安全尝试,防止**由于属性断层抛出报错打断程序运行**的情况发生 5 | 6 | ## get 安全取值 7 | 8 | ```javascript 9 | var obj = { 10 | a: { 11 | b: 1 12 | } 13 | } 14 | 15 | // 基础 16 | get(obj, 'a.b') // 1 17 | get(obj, ['a', 'b']) // 1 18 | get(obj, 'c.b') // undefined 19 | 20 | // 带默认值 21 | get(obj, 'c.b', 1) // 1 22 | ``` 23 | 24 | ## run 安全运行(可保护上下文) 25 | 26 | ```javascript 27 | var obj = { 28 | deep: { 29 | deep: { 30 | add: (a, b) => a + b 31 | } 32 | }, 33 | 34 | name: 'CJY', 35 | greet() { 36 | console.log(`hello, I'm ${this.name}`) 37 | } 38 | } 39 | 40 | // 函数存在时 41 | run(obj, 'deep.deep.add', 1, 2) // 3 42 | 43 | 44 | // 取值不是函数或查找结果不存在时,行为与 get 函数一致 45 | run(obj, 'deep.deep.reduce') // undefined 46 | run(obj, 'name') // CJY 47 | 48 | // 保护上下文 49 | run(obj, 'greet') // hello, I'm CJY 50 | ``` 51 | -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/try/index.js: -------------------------------------------------------------------------------- 1 | import { isString, isExist, isUndefined, isFunction } from '../is' 2 | 3 | export const get = (obj, keys = [], defaultValue) => { 4 | try { 5 | let result = (isString(keys) ? keys.split('.') : keys).reduce( 6 | (res, key) => res[key], 7 | obj 8 | ) 9 | return isUndefined(result) ? defaultValue : result 10 | } catch (e) { 11 | return defaultValue 12 | } 13 | } 14 | 15 | export const run = (obj, keys = [], ...args) => { 16 | keys = isString(keys) ? keys.split('.') : keys 17 | 18 | const func = get(obj, keys) 19 | const context = get(obj, keys.slice(0, -1)) 20 | 21 | return isFunction(func) ? func.call(context, ...args) : func 22 | } 23 | 24 | export const value = (...values) => 25 | values.reduce( 26 | (value, nextValue) => (isUndefined(value) ? run(nextValue) : run(value)), 27 | undefined 28 | ) 29 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/RollSample/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | 5 | import './style.scss' 6 | 7 | @helpers.hot(module) 8 | export default class RollSample extends Component { 9 | render() { 10 | return ( 11 |
12 |
18 |
24 |
25 | 26 | //
27 | //
30 | //
31 | ) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/classnames/helpers.js: -------------------------------------------------------------------------------- 1 | import { isObject, isArray, isString } from '@helpers/base/is' 2 | import { flatten } from '@helpers/package/utils' 3 | 4 | export const __map__object__className = obj => 5 | Object.entries(obj) 6 | .filter(([key, value]) => !!value) 7 | .map(([key, value]) => key) 8 | 9 | export const __parse__className = className => 10 | /\s/.test(className) ? className.trim().split(' ') : className 11 | 12 | const __get__className__array = (...args) => 13 | flatten( 14 | args 15 | .filter(arg => !!arg) 16 | .map( 17 | arg => 18 | isObject(arg) 19 | ? __map__object__className(arg) 20 | : isArray(arg) 21 | ? __get__className__array(...arg) 22 | : isString(arg) ? __parse__className(arg) : String(arg) 23 | ) 24 | ) 25 | 26 | export default __get__className__array 27 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/i18n/i18n.test.js: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai' 2 | import { i18n } from './index' 3 | 4 | describe('i18n 单元测试', () => { 5 | const translate = i18n({ 6 | 你好: 'Hello', 7 | '你好,XX,我是YY': "Hello ${XX}, I'm ${YY}" 8 | }) 9 | 10 | it('i18n 接受一个 locale 对象后应返回一个 translate 函数', () => { 11 | expect(translate).to.be.a('function') 12 | }) 13 | 14 | describe('translate 函数翻译测试', () => { 15 | it('普通翻译', () => { 16 | expect(translate('你好')).to.be.equal('Hello') 17 | }) 18 | 19 | it('模板翻译', () => { 20 | const data = { 21 | XX: 'mocha', 22 | YY: 'CJY' 23 | } 24 | 25 | expect(translate('你好,XX,我是YY', data)).to.be.equal( 26 | `Hello ${data['XX']}, I'm ${data['YY']}` 27 | ) 28 | }) 29 | 30 | it('异常翻译', () => { 31 | expect(translate(undefined)).to.be.equal('') 32 | }) 33 | }) 34 | }) 35 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route1/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | HashRouter as Router, 4 | Route, 5 | Switch, 6 | NavLink, 7 | Redirect 8 | } from 'react-router-dom' 9 | 10 | import Sub1 from './sub1' 11 | import Sub2 from './sub2' 12 | import Sub3 from './sub3' 13 | 14 | export default () => ( 15 |
16 |
17 | sub1 18 | sub2 19 | sub3 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | ) 29 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/route3/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | HashRouter as Router, 4 | Route, 5 | Switch, 6 | NavLink, 7 | Redirect 8 | } from 'react-router-dom' 9 | 10 | import Sub1 from './sub1' 11 | import Sub2 from './sub2' 12 | import Sub3 from './sub3' 13 | 14 | export default () => ( 15 |
16 |
17 | sub1 18 | sub2 19 | sub3 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | ) 29 | -------------------------------------------------------------------------------- /src/vendor/helpers @/Constructor/FrameProcess/core/Process.js: -------------------------------------------------------------------------------- 1 | import { run } from '@helpers/base/try' 2 | 3 | import Thread from './Thread' 4 | 5 | /** 6 | * 帧任务进程 7 | * 作用:为任务分配适宜线程,并控制线程任务总数,以保证执行性能 8 | */ 9 | export default class Process { 10 | threadList = [] 11 | 12 | constructor({ maxTaskCount } = {}) { 13 | this.maxTaskCount = maxTaskCount 14 | } 15 | 16 | getAvailableThread = () => { 17 | let thread = this.threadList.find(thread => thread.isAvailable()) 18 | 19 | if (!thread) { 20 | thread = new Thread({ 21 | maxTaskCount: this.maxTaskCount 22 | }) 23 | this.threadList.push(thread) 24 | } 25 | 26 | return thread 27 | } 28 | 29 | start = frame => this.getAvailableThread().run(frame) 30 | once = frame => { 31 | const stop = this.start((...args) => { 32 | run(frame, undefined, ...args) 33 | stop() 34 | }) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/vendor/helpers @/index.js: -------------------------------------------------------------------------------- 1 | export * from '@helpers/base/is' 2 | 3 | export * from '@helpers/base/try' 4 | 5 | export * from '@helpers/package/i18n' 6 | 7 | export * from '@helpers/package/utils' 8 | 9 | export { default as CombJudge } from '@helpers/Constructor/CombJudge' 10 | 11 | export { default as Tween } from '@helpers/Constructor/Tween' 12 | 13 | export { default as EventBus } from '@helpers/Constructor/EventBus' 14 | 15 | export { 16 | default as FrameProcess, 17 | defaultProcess as defaultFrameProcess 18 | } from '@helpers/Constructor/FrameProcess' 19 | 20 | export { default as globalThis } from '@helpers/base/globalThis' 21 | 22 | export { default as classnames } from '@helpers/package/classnames' 23 | 24 | import * as source from '@helpers/package/source' 25 | 26 | import * as url from '@helpers/package/url' 27 | 28 | import * as storage from '@helpers/package/storage' 29 | 30 | export { source, url, storage } 31 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/style.scss: -------------------------------------------------------------------------------- 1 | 2 | #root, 3 | .wrapper { 4 | width: 100%; 5 | height: 100%; 6 | } 7 | 8 | .wrapper { 9 | display: flex; 10 | flex-direction: column; 11 | } 12 | 13 | .content { 14 | flex: 1; 15 | 16 | .nav { 17 | display: flex; 18 | 19 | a { 20 | flex: 1; 21 | height: 50pt; 22 | line-height: 50pt; 23 | text-align: center; 24 | outline: solid 1px; 25 | 26 | text-decoration: none; 27 | &.active { 28 | color: #f93; 29 | } 30 | } 31 | } 32 | } 33 | 34 | .footer ul { 35 | display: flex; 36 | 37 | li { 38 | flex: 1; 39 | height: 100pt; 40 | line-height: 100pt; 41 | text-align: center; 42 | outline: solid 1px; 43 | 44 | &.active { 45 | color: #f93; 46 | } 47 | } 48 | } 49 | 50 | .box { 51 | display: flex; 52 | align-items: center; 53 | justify-content: center; 54 | } 55 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/config/style/mixins.scss: -------------------------------------------------------------------------------- 1 | 2 | @mixin mid($pos: false, $way: false, $extra: false) { 3 | @if $pos { 4 | position: $pos; 5 | $transform: translate(-50%, 0); 6 | @if $way == both { 7 | top: 50%; 8 | left: 50%; 9 | $transform: translate(-50%, -50%); 10 | } @else if $way == middle { 11 | top: 50%; 12 | $transform: translate(0, -50%); 13 | } @else { 14 | left: 50%; 15 | } 16 | 17 | @if $extra { 18 | $transform: $transform $extra; 19 | } 20 | 21 | transform: $transform; 22 | } @else { 23 | margin: 0 auto; 24 | } 25 | } 26 | 27 | @mixin dot($line: 1) { 28 | @if $line <= 1 { 29 | white-space: nowrap; 30 | text-overflow: ellipsis; 31 | overflow: hidden; 32 | } @else if { 33 | display: -webkit-box; 34 | -webkit-box-orient: vertical; 35 | -webkit-line-clamp: $line; 36 | overflow: hidden; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/Popup/components/Mask/index.js: -------------------------------------------------------------------------------- 1 | import React, { createRef } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import { run, classnames } from '@helpers' 5 | 6 | import './style.m.scss' 7 | 8 | function Mask({ maskClosable, close, className, children }) { 9 | const mask = createRef() 10 | 11 | return ( 12 |
{ 18 | if (e.target === mask.current) { 19 | run(close) 20 | } 21 | } 22 | : undefined 23 | } 24 | > 25 | {children} 26 |
27 | ) 28 | } 29 | 30 | Mask.propTypes = { 31 | maskClosable: PropTypes.bool, 32 | close: PropTypes.func 33 | } 34 | 35 | Mask.defaultProps = { 36 | maskClosable: true, 37 | close: undefined 38 | } 39 | 40 | export default Mask 41 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/Marker/img/marker.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/classnames/tests/index.test.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import classnames from '../index' 3 | 4 | describe('classnames 单元测试', () => { 5 | it('classnames 基础用例测试', () => { 6 | assert.equal(classnames('foo', 'bar'), 'foo bar') 7 | 8 | assert.equal(classnames('foo', { bar: true }), 'foo bar') 9 | assert.equal(classnames({ 'foo-bar': true }), 'foo-bar') 10 | assert.equal(classnames({ 'foo-bar': false }), '') 11 | assert.equal(classnames({ foo: true }, { bar: true }), 'foo bar') 12 | assert.equal(classnames({ foo: true, bar: true }), 'foo bar') 13 | 14 | // lots of arguments of various types 15 | assert.equal( 16 | classnames('foo', { bar: true, duck: false }, 'baz', { quux: true }), 17 | 'foo bar baz quux' 18 | ) 19 | 20 | // other falsy values are just ignored 21 | assert.equal( 22 | classnames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''), 23 | 'bar 1' 24 | ) 25 | }) 26 | }) 27 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import 'css-loader/lib/css-base' 3 | import 'style-loader/lib/addStyles' 4 | import 'antd-mobile/dist/antd-mobile.less' 5 | 6 | import React from 'react' 7 | import { render } from 'react-dom' 8 | import { HashRouter as Router } from 'react-router-dom' 9 | import { PersistGate } from 'redux-persist/integration/react' 10 | import { ModuleProvider } from 're-modulex' 11 | 12 | import * as helpers from '@helpers' 13 | 14 | import AppRouter from './config/router' 15 | import locale from './config/locale' 16 | import { store, persistor } from './store' 17 | 18 | import './config/source' 19 | import './assets/style.css' 20 | 21 | Object.assign(window, { helpers }) 22 | 23 | render( 24 | 25 | 26 | 27 | 28 | 29 | 30 | , 31 | document.getElementById('root') 32 | ) 33 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/index.js: -------------------------------------------------------------------------------- 1 | import DynamicNumber from './layout/DynamicNumber' 2 | import ScrollView from './layout/ScrollView' 3 | import Portal from './layout/Portal' 4 | import View from './layout/View' 5 | 6 | import ActivityIndicator from './components/ActivityIndicator' 7 | import * as Loading from './components/Loading' 8 | import Countdown from './components/Countdown' 9 | import Button from './components/Button' 10 | import Icon from './components/Icon' 11 | 12 | import asyncComponent from './func/route/asyncComponent' 13 | import popup from './func/Popup' 14 | 15 | export { 16 | DynamicNumber, 17 | ScrollView, 18 | Portal, 19 | View, 20 | ActivityIndicator, 21 | Loading, 22 | Countdown, 23 | Button, 24 | Icon, 25 | asyncComponent, 26 | popup 27 | } 28 | 29 | export default { 30 | DynamicNumber, 31 | ScrollView, 32 | Portal, 33 | View, 34 | 35 | ActivityIndicator, 36 | Loading, 37 | Countdown, 38 | Button, 39 | Icon, 40 | 41 | asyncComponent, 42 | popup 43 | } 44 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/config/locale.js: -------------------------------------------------------------------------------- 1 | import * as helpers from '@helpers' 2 | 3 | import en_US_locale from '../assets/i18n/en_US.json' 4 | import in_locale from '../assets/i18n/in.json' 5 | import ms_locale from '../assets/i18n/ms.json' 6 | import vi_locale from '../assets/i18n/vi.json' 7 | 8 | export default { 9 | en: helpers.i18n.load([ 10 | en_US_locale, 11 | () => 12 | import(/* webpackChunkName: 'assets/i18n/common/en_US' */ '__assets__/i18n/common/en_US.json') 13 | ]), 14 | in: helpers.i18n.load([ 15 | in_locale, 16 | () => 17 | import(/* webpackChunkName: 'assets/i18n/common/in' */ '__assets__/i18n/common/in.json') 18 | ]), 19 | ms: helpers.i18n.load([ 20 | ms_locale, 21 | () => 22 | import(/* webpackChunkName: 'assets/i18n/common/ms' */ '__assets__/i18n/common/ms.json') 23 | ]), 24 | vi: helpers.i18n.load([ 25 | vi_locale, 26 | () => 27 | import(/* webpackChunkName: 'assets/i18n/common/vi' */ '__assets__/i18n/common/vi.json') 28 | ]) 29 | } 30 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/classnames/tests/helpers.test.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { 3 | __map__object__className, 4 | __parse__className 5 | } from '../../classnames/helpers' 6 | 7 | describe('classnames 辅助函数', () => { 8 | it('__map__object__className 需从对象中解析出正确的 className', () => { 9 | assert.equal( 10 | JSON.stringify( 11 | __map__object__className({ 12 | // 真值 13 | a: true, 14 | b: 1, 15 | c: {}, 16 | d: [], 17 | 18 | // 假值 19 | e: false, 20 | f: null, 21 | g: undefined, 22 | h: '', 23 | i: 0 24 | }) 25 | ), 26 | JSON.stringify(['a', 'b', 'c', 'd']) 27 | ) 28 | }) 29 | 30 | it('__parse__className 需正确解析 className', () => { 31 | assert.equal(__parse__className('simple-class-name'), 'simple-class-name') 32 | 33 | assert.equal( 34 | JSON.stringify(__parse__className('simple class name')), 35 | JSON.stringify(['simple', 'class', 'name']) 36 | ) 37 | }) 38 | }) 39 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/helpers/try/index.js: -------------------------------------------------------------------------------- 1 | import { isString, isExist, isUndefined, isFunction } from '../is' 2 | 3 | export const get = (obj, keys = [], defaultValue) => { 4 | keys = isString(keys) ? keys.split('.') : keys 5 | 6 | let result 7 | let res = obj 8 | let idx = 0 9 | 10 | for (; idx < keys.length; idx++) { 11 | let key = keys[idx] 12 | 13 | if (isExist(res)) { 14 | res = res[key] 15 | } else { 16 | break 17 | } 18 | } 19 | 20 | if (idx === keys.length) { 21 | result = res 22 | } 23 | 24 | return isUndefined(result) ? defaultValue : result 25 | } 26 | 27 | export const run = (obj, keys = [], ...args) => { 28 | keys = isString(keys) ? keys.split('.') : keys 29 | 30 | const func = get(obj, keys) 31 | const context = get(obj, keys.slice(0, -1)) 32 | 33 | return isFunction(func) ? func.call(context, ...args) : func 34 | } 35 | 36 | export const value = (...values) => 37 | values.reduce( 38 | (value, nextValue) => (isUndefined(value) ? run(nextValue) : run(value)), 39 | undefined 40 | ) 41 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/views/Home/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | import { connectModules } from 're-modulex' 5 | 6 | import './style.m.scss' 7 | 8 | @helpers.hot(module) 9 | // 简化 connect 过程 10 | @connectModules(({ main }) => ({ 11 | main 12 | })) 13 | export default class Home extends Component { 14 | render() { 15 | const { main } = this.props 16 | 17 | return ( 18 |
19 | Home 20 |
21 | module counter is: {main.state.counter} 22 | 23 | 26 |
27 | {/* 允许直接 commit */} 28 | main.commit('text', e.target.value)} /> 29 | main.dispatch('text', e.target.value)} /> 30 |
main text is: {main.state.text}
31 |
main getters.text is: {main.getters.text}
32 |
33 | ) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/project/reactDemo.07239c.css: -------------------------------------------------------------------------------- 1 | *{margin:0;padding:0}.Page{-webkit-border-radius:.556vw;-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:.556vw;content:"viewport-units-buggyfill; border-radius: 0.556vw";display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;flex-direction:column;height:auto;margin:auto;width:50%}.Page h2{text-align:center}.Page .margin{content:"viewport-units-buggyfill; margin: 0 2.778vw 0.694vw 2.778vw";margin:0 2.778vw .694vw}.Page .taskItems ol{content:"viewport-units-buggyfill; margin: 2.778vw 0";margin:2.778vw 0}.Page .taskItems ol li{-webkit-border-radius:.556vw;background-color:#fff;border:1px solid #e3e3e3;border-radius:.556vw;content:"viewport-units-buggyfill; border-radius: 0.556vw; height: 5.833vw; line-height: 5.833vw; margin: 0 2.778vw -1px";height:5.833vw;line-height:5.833vw;list-style-type:none;margin:0 2.778vw -1px}.Page .taskItems ol li .show{display:inline}.Page .taskItems ol li .hide{display:none}.Page .taskItems ol li button{background-color:#fff;cursor:pointer;float:right;height:inherit;width:inherit} -------------------------------------------------------------------------------- /src/project/demo/react/StrictListDemo @/style.m.scss: -------------------------------------------------------------------------------- 1 | $paddingLeft: 30pt; 2 | $lineHeight: 80pt; 3 | 4 | .list { 5 | max-height: 100vh; 6 | overflow: auto; 7 | } 8 | 9 | .group-head { 10 | display: flex; 11 | align-items: center; 12 | height: $lineHeight; 13 | background: #e6e6e6; 14 | padding-left: $paddingLeft; 15 | } 16 | 17 | .group { 18 | &.fixed, 19 | &.bottomed { 20 | padding-top: $lineHeight; 21 | 22 | .group-head { 23 | left: 0; 24 | right: 0; 25 | z-index: 100; 26 | } 27 | } 28 | 29 | &.fixed { 30 | position: static; 31 | .group-head { 32 | position: absolute; 33 | top: 0; 34 | } 35 | } 36 | 37 | &.bottomed { 38 | position: relative; 39 | .group-head { 40 | position: absolute; 41 | top: initial; 42 | bottom: 0; 43 | } 44 | } 45 | } 46 | 47 | .items { 48 | padding-left: $paddingLeft; 49 | } 50 | 51 | .item { 52 | border-bottom: solid 1px #e6e6e6; 53 | display: flex; 54 | align-items: center; 55 | height: $lineHeight; 56 | 57 | font-size: 26pt; 58 | 59 | &:last-child { 60 | border-bottom: none; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/vendor/components/MAP @/GoogleMap/helpers/getCurrentPosition.js: -------------------------------------------------------------------------------- 1 | import { get, run, isExist, globalThis as root } from '@helpers' 2 | 3 | const getCurrentPosition = async options => 4 | new Promise((resolve, reject) => { 5 | if (!isExist(get(root, 'navigator.geolocation.getCurrentPosition'))) { 6 | console.warn('浏览器不支持!') 7 | return reject(new Error('浏览器不支持')) 8 | } 9 | 10 | let timeout = setTimeout(() => { 11 | console.warn('定位超时!') 12 | reject(new Error('定位超时')) 13 | }, 10000) 14 | 15 | run( 16 | root, 17 | 'navigator.geolocation.getCurrentPosition', 18 | pos => { 19 | clearTimeout(timeout) 20 | console.log( 21 | `地理数据来源:浏览器api,值为latitude: ${get( 22 | pos, 23 | 'coords.latitude' 24 | )}, longitude: ${get(pos, 'coords.longitude')}` 25 | ) 26 | get(pos, 'coords') |> resolve 27 | }, 28 | err => { 29 | clearTimeout(timeout) 30 | console.warn('获取地理位置失败,原因:', err) 31 | reject(err) 32 | }, 33 | options 34 | ) 35 | }) 36 | 37 | export default getCurrentPosition 38 | -------------------------------------------------------------------------------- /src/__prefix__/eruda/helpers/overide.js: -------------------------------------------------------------------------------- 1 | import root from './globalThis' 2 | /** 3 | * 此文件用以在 eruda 加载前对 console 输出做记录,在 eruda 加载后做 log 恢复处理 4 | */ 5 | const console = root.console 6 | const __overided__methods = [ 7 | 'log', 8 | 'error', 9 | 'info', 10 | 'warn', 11 | 'dir', 12 | // 'time', 13 | // 'timeEnd', 14 | // 'clear', 15 | // 'count', 16 | // 'assert', 17 | 'table' 18 | ] 19 | 20 | const __log__cache = {} 21 | 22 | export const overide = () => { 23 | __overided__methods.forEach(method => { 24 | console[`_${method}`] = console[method] 25 | 26 | __log__cache[method] = [] 27 | console[method] = (...args) => { 28 | __log__cache[method].push(args) 29 | return console[`_${method}`](...args) 30 | } 31 | }) 32 | } 33 | 34 | export const reset = () => { 35 | __overided__methods.forEach(method => { 36 | console[method] = console[`_${method}`] 37 | // delete console[`_${method}`] 38 | }) 39 | } 40 | 41 | export const release = () => { 42 | __overided__methods.forEach(method => { 43 | __log__cache[method].forEach(args => { 44 | console[method](...args) 45 | }) 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /src/vendor/helpers @/Constructor/EventBus.js: -------------------------------------------------------------------------------- 1 | import { isFunction, isUndefined } from '@helpers/base/is' 2 | 3 | export default class EventBus { 4 | _listeners = {} 5 | 6 | __getEventMap = event => { 7 | if (!this._listeners[event]) { 8 | this._listeners[event] = new Map() 9 | } 10 | 11 | return this._listeners[event] 12 | } 13 | 14 | on = (event, listener, { once = false } = {}) => { 15 | if (!isFunction(listener)) { 16 | return console.error('[EventBus Error] listener is not a function') 17 | } 18 | 19 | this.__getEventMap(event).set( 20 | listener, 21 | once 22 | ? (...args) => { 23 | listener(...args) 24 | this.off(event, listener) 25 | } 26 | : listener 27 | ) 28 | 29 | return this 30 | } 31 | 32 | off = (event, listener) => { 33 | const eventMap = this.__getEventMap(event) 34 | 35 | if (isUndefined(listener)) { 36 | eventMap.clear() 37 | } else { 38 | eventMap.delete(listener) 39 | } 40 | 41 | return this 42 | } 43 | 44 | emit = (event, ...args) => 45 | this.__getEventMap(event).forEach(listener => listener(...args)) 46 | } 47 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/Popup/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import { run } from '@helpers' 4 | import PopupFrame from './components/Frame' 5 | import Mask from './components/Mask' 6 | 7 | const closeFns = [] 8 | 9 | export default function popup( 10 | render, // 渲染函数,形式为 close => 其中 close 函数可关闭弹窗 11 | { 12 | onClose, // 弹窗关闭回调 13 | maskClassName, // 自定义浮层 className 方便添加自己的样式 14 | maskClosable, // 是否允许浮层点击后弹窗消失 15 | setable = false // 弹窗内组件是否可以改变,若为真,则 popup 返回值变为 { set, close }, 其中 set 函数接收新的 render 函数 16 | } = {} 17 | ) { 18 | const timeStamp = Date.now() 19 | const close = () => { 20 | PopupFrame.remove(timeStamp) 21 | run(onClose) 22 | } 23 | const getPopup = render => ( 24 | 25 | {render(close)} 26 | 27 | ) 28 | 29 | closeFns.push(close) 30 | 31 | const set = PopupFrame.add(timeStamp, getPopup(render)) 32 | 33 | if (setable) { 34 | return { 35 | close, 36 | set: render => render |> getPopup |> set 37 | } 38 | } 39 | 40 | return close 41 | } 42 | 43 | popup.closeAll = () => closeFns.forEach(fn => run(fn)) 44 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/utils/index.test.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { flatten, __ } from './index' 3 | 4 | describe('helpers / package / utils 单元测试', () => { 5 | it('flatten 需正确拍扁数组', () => { 6 | assert.equal( 7 | JSON.stringify(flatten([1, [2, 3], [[4, 5], [6, [7, [8, [9]]]]], 0])), 8 | JSON.stringify([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) 9 | ) 10 | }) 11 | 12 | describe('utils 模块 __ 功能测试', () => { 13 | it('__ 期望能正确工作', () => { 14 | const fn = (x, y, z) => x + y + z 15 | const _fn = __(fn)(__, 1, __) 16 | 17 | assert.equal(_fn(3, 4), 8) 18 | }) 19 | 20 | it('__ 第二参数需可控制 this 指向', () => { 21 | const fn = function(word) { 22 | return `${word}, ${this.name}` 23 | } 24 | 25 | const _fn = __(fn, { 26 | name: 'CJY' 27 | })(__) 28 | 29 | assert.equal(_fn('Hello'), 'Hello, CJY') 30 | }) 31 | 32 | it('__ 期望能使用 bind 来控制 this 指向', () => { 33 | const fn = function(word) { 34 | return `${word}, ${this.name}` 35 | } 36 | 37 | const _fn = __(fn)(__).bind({ 38 | name: 'CJY' 39 | }) 40 | 41 | assert.equal(_fn('Hello'), 'Hello, CJY') 42 | }) 43 | }) 44 | }) 45 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/i18n/index.js: -------------------------------------------------------------------------------- 1 | import { get, run } from '@helpers/base/try' 2 | import { isUndefined, isObject } from '@helpers/base/is' 3 | 4 | /** 5 | * [template 简易字符串模板函数] 6 | * e.g: template('hello ${name}', { name: 'CJY' }) ==> 'hello CJY' 7 | * @param {[字符串]} str [description] 8 | * @param {[type]} data [description] 9 | * @return {[type]} [description] 10 | */ 11 | export const template = (str = '', data) => { 12 | const exp = /\$\{\w*\}/g, 13 | keys = str.match(exp) || {} 14 | 15 | Object.keys(keys).forEach(_k => { 16 | const key = keys[_k].replace('${', '').replace('}', '') 17 | str = str.replace(new RegExp(`\\$\{${key}\}`, 'g'), get(data, key)) 18 | }) 19 | 20 | return str 21 | } 22 | 23 | export const i18n = locale => (keys, data) => { 24 | if (isUndefined(keys)) { 25 | return '' 26 | } 27 | let text = get(locale, keys) 28 | 29 | if (isUndefined(text)) { 30 | return keys 31 | } 32 | 33 | if (isObject(data)) { 34 | text = template(text, data) 35 | } 36 | 37 | return text 38 | } 39 | 40 | export const i18nLoader = loaders => async () => 41 | Object.assign({}, ...(await Promise.all(loaders.map(loader => run(loader))))) 42 | 43 | i18n.load = i18nLoader 44 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/source/index.js: -------------------------------------------------------------------------------- 1 | import { isExist } from '@helpers/base/is' 2 | 3 | import { getExternals } from './helpers' 4 | 5 | // 增加 source 缓存,防止多次加载同一资源 6 | const cache = { 7 | js: [], 8 | css: [] 9 | } 10 | 11 | export const js = (src, externals) => { 12 | if (cache.js.includes(src)) { 13 | console.warn(`[source.js] ${src} 已被加载`) 14 | return Promise.resolve(getExternals(src, externals)) 15 | } 16 | 17 | return new Promise((resolve, reject) => { 18 | const script = document.createElement('script') 19 | script.setAttribute('src', src) 20 | script.addEventListener('load', () => 21 | setTimeout(() => { 22 | cache.js.push(src) 23 | 24 | resolve(getExternals(src, externals)) 25 | }) 26 | ) 27 | script.addEventListener('error', reject) 28 | document.body.appendChild(script) 29 | }) 30 | } 31 | 32 | export const css = href => { 33 | if (cache.css.includes(href)) { 34 | console.warn(`[source.css] ${href} 已被加载`) 35 | return 36 | } 37 | 38 | const link = document.createElement('link') 39 | link.setAttribute('href', href) 40 | link.setAttribute('rel', 'stylesheet') 41 | document.body.appendChild(link) 42 | 43 | cache.css.push(href) 44 | } 45 | -------------------------------------------------------------------------------- /docs/project/nestedRouterDemo.ecf5b0.css: -------------------------------------------------------------------------------- 1 | *{border:0;list-style:none;margin:0;outline:0;padding:0}body,html{height:100%;width:100%}#root,.wrapper{height:100%;width:100%}.wrapper{-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;flex-direction:column}.content{-webkit-box-flex:1;-webkit-flex:1;flex:1}.content .nav{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.content .nav a{-webkit-box-flex:1;-webkit-flex:1;content:"viewport-units-buggyfill; height: 6.944vw; line-height: 6.944vw";flex:1;height:6.944vw;line-height:6.944vw;outline:1px solid;text-align:center;text-decoration:none}.content .nav a.active{color:#f93}.footer ul{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.footer ul li{-webkit-box-flex:1;-webkit-flex:1;content:"viewport-units-buggyfill; height: 13.889vw; line-height: 13.889vw";flex:1;height:13.889vw;line-height:13.889vw;outline:1px solid;text-align:center}.footer ul li.active{color:#f93}.box{-webkit-align-items:center;-webkit-box-align:center;-webkit-box-pack:center;-webkit-justify-content:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;justify-content:center} -------------------------------------------------------------------------------- /src/__prefix__/index.js: -------------------------------------------------------------------------------- 1 | import 'babel-polyfill' 2 | import viewportUnitsBuggyfill from 'viewport-units-buggyfill' 3 | import viewportUnitsBuggyfillHack from 'viewport-units-buggyfill/viewport-units-buggyfill.hacks' 4 | import FastClick from '@cjy0208/fastclick' 5 | 6 | import './style/reset.scss' 7 | import './style/__postcss-viewport-units__fix.scss' 8 | import './style/__antd__fix.scss' 9 | import './eruda' 10 | 11 | viewportUnitsBuggyfill.init({ 12 | hacks: viewportUnitsBuggyfillHack, 13 | force: (() => { 14 | const versionNumber = parseFloat( 15 | (window.navigator.userAgent.match('Android ([0-9.]+)') || [])[1] 16 | ) 17 | 18 | const __need__fix = versionNumber <= 4.4 19 | 20 | if (__need__fix) { 21 | // 修复部分低端机 viewportUnitsBuggyfill 未生效的问题 22 | setTimeout(() => { 23 | viewportUnitsBuggyfill.refresh() 24 | }, 2000) 25 | } 26 | 27 | // anything below 4.4 uses WebKit without *any* viewport support, 28 | // 4.4 has issues with viewport units within calc() 29 | return __need__fix 30 | })() 31 | // refreshDebounceWait: 250 32 | }) 33 | 34 | FastClick.attach(document.body) 35 | 36 | if (process.env.NODE_ENV === 'development') { 37 | if (module.hot) { 38 | module.hot.accept() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/project/demo/react/tweenDemo @/views/Home/style.m.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | width: 100vw; 6 | height: 100vh; 7 | color: white; 8 | background: #18212d; 9 | } 10 | .view { 11 | min-width: 400px; 12 | position: relative; 13 | overflow: visible; 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | justify-content: center; 18 | } 19 | .block { 20 | width: 40px; 21 | height: 40px; 22 | position: absolute; 23 | left: 0; 24 | top: 0; 25 | background: #fed477; 26 | line-height: 40px; 27 | text-align: center; 28 | } 29 | .progress { 30 | margin-top: 100px; 31 | width: 400px; 32 | cursor: pointer; 33 | } 34 | .buttons { 35 | margin-top: 10px; 36 | text-align: center; 37 | 38 | button { 39 | background: #d97c98; 40 | color: #fff; 41 | padding: 1em 2em; 42 | border: 1px solid #fff; 43 | cursor: pointer; 44 | outline: none; 45 | margin-right: 5px; 46 | font-size: 16px; 47 | } 48 | } 49 | .info { 50 | overflow: hidden; 51 | font-size: 30px; 52 | font-weight: 700; 53 | margin: 20px 0; 54 | } 55 | .easing-link { 56 | font-size: 16px; 57 | color: #fff; 58 | text-decoration: underline; 59 | } 60 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/helpers/try/DOC.md: -------------------------------------------------------------------------------- 1 | 2 | # try 模块 3 | 4 | 值相关的安全尝试,防止**由于属性断层抛出报错打断程序运行**的情况发生 5 | 6 | ## get 安全取值 7 | 8 | ```javascript 9 | var obj = { 10 | a: { 11 | b: 1 12 | } 13 | } 14 | 15 | // 基础 16 | get(obj, 'a.b') // 1 17 | get(obj, ['a', 'b']) // 1 18 | get(obj, 'c.b') // undefined 19 | 20 | // 带默认值 21 | get(obj, 'c.b', 1) // 1 22 | ``` 23 | 24 | ## run 安全运行(可保护上下文) 25 | 26 | ```javascript 27 | var obj = { 28 | deep: { 29 | deep: { 30 | add: (a, b) => a + b 31 | } 32 | }, 33 | 34 | name: 'CJY', 35 | greet() { 36 | console.log(`hello, I'm ${this.name}`) 37 | } 38 | } 39 | 40 | // 函数存在时 41 | run(obj, 'deep.deep.add', 1, 2) // 3 42 | 43 | 44 | // 取值不是函数或查找结果不存在时,行为与 get 函数一致 45 | run(obj, 'deep.deep.reduce') // undefined 46 | run(obj, 'name') // CJY 47 | 48 | // 保护上下文 49 | run(obj, 'greet') // hello, I'm CJY 50 | ``` 51 | 52 | ## value 多层默认值(只在值为`undefined`情况下生效) 53 | 54 | ```javascript 55 | var v1, v2, v3 = 'default' 56 | 57 | value(v1, v2, v3) // default 58 | 59 | value(v1, 0, v3) // 0 60 | 61 | // 可传递执行函数 62 | value( 63 | v1, 64 | () => { 65 | console.log('v1没有,尝试v2') 66 | return v2 67 | }, 68 | () => { 69 | console.log('v2也没有,尝试v3') 70 | return v3 71 | }, 72 | ) // default 73 | ``` 74 | -------------------------------------------------------------------------------- /docs/project/StrictListDemo.31ac63.css: -------------------------------------------------------------------------------- 1 | .list_3Sxj{content:"viewport-units-buggyfill; max-height: 100vh";max-height:100vh;overflow:auto}.group-head_29UY{-webkit-align-items:center;-webkit-box-align:center;align-items:center;background:#e6e6e6;content:"viewport-units-buggyfill; height: 11.111vw; padding-left: 4.167vw";display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;height:11.111vw;padding-left:4.167vw}.group_22ld.bottomed_YBqS,.group_22ld.fixed_3cUA{content:"viewport-units-buggyfill; padding-top: 11.111vw";padding-top:11.111vw}.group_22ld.bottomed_YBqS .group-head_29UY,.group_22ld.fixed_3cUA .group-head_29UY{left:0;right:0;z-index:100}.group_22ld.fixed_3cUA{position:static}.group_22ld.fixed_3cUA .group-head_29UY{position:absolute;top:0}.group_22ld.bottomed_YBqS{position:relative}.group_22ld.bottomed_YBqS .group-head_29UY{bottom:0;position:absolute;top:auto}.items_2m2c{content:"viewport-units-buggyfill; padding-left: 4.167vw";padding-left:4.167vw}.item_2xnE{-webkit-align-items:center;-webkit-box-align:center;align-items:center;border-bottom:1px solid #e6e6e6;content:"viewport-units-buggyfill; height: 11.111vw; font-size: 3.611vw";display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;font-size:3.611vw;height:11.111vw}.item_2xnE:last-child{border-bottom:none} -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/helpers/modules.js: -------------------------------------------------------------------------------- 1 | import { isArray } from './is' 2 | import { value, run } from './try' 3 | 4 | const __modules = {} 5 | 6 | export const getModules = () => __modules 7 | export const hasModule = name => !!__modules[name] 8 | export const saveModule = (name, module) => { 9 | __modules[name] = module 10 | } 11 | export const mapModules = (modulesGetter, storeState) => { 12 | if (isArray(modulesGetter)) { 13 | let moduleNames = [...modulesGetter] 14 | modulesGetter = modules => 15 | moduleNames.reduce( 16 | (res, name) => 17 | modules[name] 18 | ? { 19 | ...res, 20 | [name]: modules[name] 21 | } 22 | : res, 23 | {} 24 | ) 25 | } 26 | 27 | const modules = value(run(modulesGetter, undefined, getModules()), {}) 28 | 29 | return Object.entries(modules).reduce( 30 | (res, [name, { dispatch, commit, compute, getState }]) => ({ 31 | ...res, 32 | [name]: value(() => { 33 | const state = getState(storeState) 34 | 35 | return { 36 | getState, 37 | compute: () => getState() |> compute, 38 | dispatch, 39 | commit, 40 | state, 41 | getters: compute(state) 42 | } 43 | }) 44 | }), 45 | {} 46 | ) 47 | } 48 | -------------------------------------------------------------------------------- /docs/project/rollDemo.365bb8.css: -------------------------------------------------------------------------------- 1 | .content{-webkit-align-items:center;-webkit-box-align:center;align-items:center;content:"viewport-units-buggyfill; width: 69.444vw; height: 69.444vw";display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;height:69.444vw;position:relative;width:69.444vw;z-index:1}.roll{-webkit-border-radius:50%;border-color:red orange #00f green;border-radius:50%;border-style:solid;border-width:1.389vw;content:"viewport-units-buggyfill; border: solid 1.389vw";height:100%;left:0;opacity:.5;position:absolute;width:100%}.line{-webkit-transform-origin:right;background-color:#333;height:1px;transform-origin:right;width:50%}.grid-content{-webkit-flex-wrap:wrap;content:"viewport-units-buggyfill; width: 69.444vw";flex-wrap:wrap;left:0;position:absolute;top:0;width:69.444vw;z-index:100}.grid-content,.grid-content li{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.grid-content li{-webkit-align-items:center;-webkit-box-align:center;-webkit-box-pack:center;-webkit-justify-content:center;align-items:center;content:"viewport-units-buggyfill; width: 23.148vw; height: 23.148vw";height:23.148vw;justify-content:center;outline:1px solid;width:23.148vw}.grid-content li.active{background:rgba(255,255,0,.3)}.grid-content li.hidden{opacity:0}button{content:"viewport-units-buggyfill; margin: 2.778vw; padding: 1.389vw";margin:2.778vw;padding:1.389vw} -------------------------------------------------------------------------------- /src/vendor/helpers @/Constructor/FrameProcess/core/Thread.js: -------------------------------------------------------------------------------- 1 | import { run } from '@helpers/base/try' 2 | import root from '@helpers/base/globalThis' 3 | 4 | const { requestAnimationFrame } = root 5 | 6 | export default class Thread { 7 | constructor({ maxTaskCount = 20 } = {}) { 8 | this.maxTaskCount = maxTaskCount 9 | } 10 | 11 | taskList = new Set() 12 | 13 | isAvailable = () => this.taskList.size >= this.maxTaskCount 14 | 15 | //进程是否正在工作:进程工作过程中若插入新的任务,不会影响目前的工作流程 16 | isRunning = false 17 | 18 | //帧函数 19 | frame = () => { 20 | const frameTime = Date.now() 21 | 22 | //执行任务帧 23 | this.taskList.forEach(({ frame, startTime }) => 24 | run(frame, undefined, { 25 | runningTime: frameTime - startTime, 26 | startTime, 27 | frameTime 28 | }) 29 | ) 30 | 31 | //若有未结束任务,则继续下一帧 32 | if (this.taskList.size > 0) { 33 | requestAnimationFrame(this.frame) 34 | } else { 35 | this.isRunning = false 36 | } 37 | } 38 | 39 | run = frame => { 40 | const task = { 41 | startTime: Date.now(), 42 | frame 43 | } 44 | 45 | this.taskList.add(task) 46 | 47 | if (!this.isRunning) { 48 | requestAnimationFrame(() => { 49 | this.isRunning = true 50 | this.frame() 51 | }) 52 | } 53 | 54 | return () => this.taskList.delete(task) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/layout/DynamicNumber/index.js: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import { Tween } from '@helpers' 5 | 6 | function DynamicNumber({ value: propsValue, format, duration, ease }) { 7 | const [value, setValue] = useState(propsValue) 8 | const [tween] = useState(() => 9 | new Tween({ 10 | from: value, 11 | to: propsValue, 12 | duration, 13 | ease 14 | }).on('update', value => setValue(value)) 15 | ) 16 | 17 | // 相当于 componentDidUpdate, 仅当 [propsValue, duration, ease] 变化时调用 18 | useEffect( 19 | () => { 20 | tween 21 | .config({ 22 | from: value, 23 | to: propsValue 24 | }) 25 | .restart() 26 | }, 27 | [propsValue] 28 | ) 29 | 30 | useEffect( 31 | () => { 32 | tween.config({ 33 | duration, 34 | ease 35 | }) 36 | }, 37 | [duration, ease] 38 | ) 39 | 40 | return format(value) 41 | } 42 | 43 | DynamicNumber.propTypes = { 44 | value: PropTypes.number, 45 | format: PropTypes.func, 46 | duration: PropTypes.number, 47 | ease: PropTypes.oneOfType([PropTypes.string, PropTypes.func]) 48 | } 49 | 50 | DynamicNumber.defaultProps = { 51 | value: 0, 52 | format: Math.floor, 53 | duration: 500, 54 | ease: 'inOutCubic' 55 | } 56 | 57 | export default DynamicNumber 58 | -------------------------------------------------------------------------------- /src/vendor/helpers @/Constructor/CombJudge/index.js: -------------------------------------------------------------------------------- 1 | export default class CombJubge { 2 | constructor(list) { 3 | this.list = list 4 | 5 | this.attr = Object.entries(list).reduce((attr, [id, item]) => { 6 | Object.entries(item).forEach(([key, val]) => { 7 | attr[key] = attr[key] || [] 8 | attr[key] = [...new Set([...attr[key], val])] 9 | }) 10 | 11 | return attr 12 | }, {}) 13 | 14 | this.attrKey = Object.keys(this.attr) 15 | } 16 | 17 | adaptedAttr = activeAttr => 18 | Object.entries(this.attr).reduce( 19 | (adaptedAttr, [key, values]) => 20 | Object.assign(adaptedAttr, { 21 | [key]: values.filter(val => 22 | this.__have( 23 | Object.assign({}, activeAttr, { 24 | [key]: val 25 | }) 26 | ) 27 | ) 28 | }), 29 | {} 30 | ) 31 | 32 | __have = activeAttr => 33 | Object.values(this.list).some(item => 34 | Object.entries(activeAttr).every(([key, val]) => item[key] === val) 35 | ) 36 | 37 | find = activeAttr => { 38 | for (let [id, item] of Object.entries(this.list)) { 39 | if ( 40 | Object.entries(activeAttr).every(([key, val]) => item[key] === val) && 41 | Object.keys(item).every(key => key in activeAttr) 42 | ) { 43 | return id 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ file = {}, options = {}, env }) => ({ 2 | parser: (() => { 3 | switch (file.extname) { 4 | case '.scss': 5 | return 'postcss-scss' 6 | case '.sass': 7 | return 'postcss-sass' 8 | dafault: return false 9 | } 10 | })(), 11 | plugins: [ 12 | require('postcss-modules-values')(), 13 | require('postcss-px-to-viewport')({ 14 | unitToConvert: 'pt', 15 | viewportWidth: 720, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750,此处为720 16 | // viewportHeight: 1280, // 视窗的高度,根据720设备的宽度来指定,一般指定1334,也可以不配置 17 | unitPrecision: 3, // 指定`[px]`转换为视窗单位值的小数位数(很多时候无法整除) 18 | viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw 19 | selectorBlackList: [], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 20 | minPixelValue: 0, // 小于或等于`0[px]`不转换为视窗单位,你也可以设置为你想要的值 21 | mediaQuery: false // 允许在媒体查询中转换`[px]` 22 | }), 23 | require('postcss-cssnext')({ 24 | warnForDuplicates: false 25 | }), 26 | require('postcss-write-svg')(), 27 | require('postcss-viewport-units')({ 28 | silence: true 29 | }), 30 | require('postcss-combine-duplicated-selectors')({ 31 | removeDuplicatedProperties: true 32 | }), 33 | require('autoprefixer')({ 34 | browsers: ['iOS > 7', 'Android >= 4.0', 'Chrome <= 50'] 35 | }), 36 | require('cssnano')({ 37 | preset: 'default' 38 | }) 39 | ] 40 | }) 41 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/func/Popup/components/Frame/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component, Fragment } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import * as helpers from '@helpers' 5 | 6 | import Portal from '../../../../layout/Portal' 7 | 8 | const { get, run, value, isExist } = helpers 9 | 10 | export default class PopupFrame extends Component { 11 | static propTypes = {} 12 | static defaultProps = {} 13 | 14 | __avaliable = true 15 | constructor(...args) { 16 | super(...args) 17 | 18 | if (isExist(PopupFrame.instance)) { 19 | this.__avaliable = false 20 | console.error(`[PopupFrame] 只能存在一个实例!`) 21 | } 22 | 23 | PopupFrame.instance = this 24 | } 25 | 26 | state = {} 27 | 28 | static add = (key, component) => { 29 | const setComponent = component => 30 | run(PopupFrame.instance, 'setState', { 31 | [key]: component 32 | }) 33 | 34 | setComponent(component) 35 | 36 | return setComponent 37 | } 38 | 39 | static remove = key => { 40 | run(PopupFrame.instance, 'setState', { 41 | [key]: undefined 42 | }) 43 | } 44 | 45 | render() { 46 | return !this.__avaliable ? null : ( 47 | 48 | {Object.entries(this.state).map(([key, component]) => ( 49 | {component} 50 | ))} 51 | 52 | ) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/storage/index.js: -------------------------------------------------------------------------------- 1 | import { isExist, isNull } from '@helpers/base/is' 2 | 3 | import withSupportive from './__with__supportive' 4 | 5 | const getter = storage => 6 | withSupportive(key => { 7 | let data = storage.getItem(key) 8 | let result 9 | 10 | if (data === 'undefined' || isNull(data)) { 11 | result = undefined 12 | } else { 13 | try { 14 | result = JSON.parse(data) 15 | } catch (err) { 16 | console.error('[ERROR ...storage.get --> JSON.parse]', err) 17 | result = data 18 | } 19 | } 20 | 21 | return result 22 | }) 23 | 24 | const setter = storage => 25 | withSupportive((key, value) => { 26 | let data 27 | 28 | try { 29 | data = JSON.stringify(value) 30 | } catch (err) { 31 | console.error('[ERROR ...storage.set --> JSON.stringify]', err) 32 | data = value 33 | } 34 | 35 | storage.setItem(key, data) 36 | 37 | return data 38 | }) 39 | 40 | const remover = storage => 41 | withSupportive(key => { 42 | storage.removeItem(key) 43 | }) 44 | 45 | export const get = getter(window.localStorage) 46 | export const set = setter(window.localStorage) 47 | export const remove = remover(window.localStorage) 48 | 49 | export const getSession = getter(window.sessionStorage) 50 | export const setSession = setter(window.sessionStorage) 51 | export const removeSession = remover(window.sessionStorage) 52 | -------------------------------------------------------------------------------- /src/project/demo/react/nestedRouterDemo @/views/position/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | HashRouter as Router, 4 | Route, 5 | Switch, 6 | NavLink, 7 | Redirect 8 | } from 'react-router-dom' 9 | 10 | import './style.scss' 11 | 12 | import Route1 from './route1' 13 | import Route2 from './route2' 14 | import Route3 from './route3' 15 | 16 | import StupidLink from '../../components/StupidLink' 17 | 18 | export default class Position extends Component { 19 | render() { 20 | return ( 21 |
22 |
23 |
24 | route1 25 | route2 26 | route3 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 |
    37 |
  • 1
  • 38 |
  • 2
  • 39 |
  • 3
  • 40 |
  • 4
  • 41 |
  • 5
  • 42 |
43 |
44 |
45 | ) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Loading/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import { get, run, value, isString, classnames } from '@helpers' 4 | 5 | import popup from '../../func/Popup' 6 | import ActivityIndicator from '../ActivityIndicator' 7 | 8 | import styles from './style.m.scss' 9 | 10 | let showing = false 11 | let controller = { 12 | close: undefined, 13 | set: undefined 14 | } 15 | 16 | export const show = content => { 17 | const withContent = 18 | (isString(content) && content.length > 0) || React.isValidElement(content) 19 | const popupRender = close => ( 20 |
21 | 22 | {withContent && 23 | (isString(content) ?

{content}

: content)} 24 |
25 | ) 26 | 27 | /** 28 | * 若 Loading 已处于展示状态中,则不再重新创建弹窗,而是直接修改当前弹窗的内容 29 | * 为什么?一般的处理方法有以下两种 30 | * 1、重复创建弹窗:但多个弹窗叠加会产生不好的视觉效果 31 | * 2、先关掉上一个弹窗再重新创建:创建弹窗有一个 0.3s 的渐入动画,如果使用此法会有些鬼畜(为什么不能搞定这个渐入动画?因为懒...) 32 | */ 33 | if (showing) { 34 | if (withContent) { 35 | run(controller, 'set', popupRender) 36 | } 37 | 38 | return get(controller, 'close') 39 | } 40 | 41 | showing = true 42 | const { close, set } = popup(popupRender, { 43 | setable: true, 44 | maskClassName: styles['mask'], 45 | onClose() { 46 | showing = false 47 | } 48 | }) 49 | 50 | controller = { close, set } 51 | 52 | return close 53 | } 54 | 55 | export const hide = () => run(controller, 'close') 56 | -------------------------------------------------------------------------------- /docs/project/w_share.8c8db3.css: -------------------------------------------------------------------------------- 1 | *{-webkit-box-sizing:border-box;-webkit-flex-basis:auto;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:100%;border:0;box-sizing:border-box;color:inherit;content:"viewport-units-buggyfill; font-size: 4.444vw";cursor:pointer;flex-basis:auto;font-family:inherit;font-size:4.444vw;font-style:inherit;font-weight:inherit;list-style:none;margin:0;outline:0;padding:0;vertical-align:baseline}::-webkit-scrollbar{height:0;width:0}input,textarea{-webkit-user-select:initial;user-select:auto}#root,body,html{height:100%;overflow:hidden;width:100%}:after,:before{color:transparent}img{content:normal!important}#root .am-list .am-list-body:after,#root .am-list .am-list-body:before,#root .am-list .am-list-line:after,#root .am-list .am-list-line:before,.am-modal-wrap .am-list .am-list-body:after,.am-modal-wrap .am-list .am-list-body:before,.am-modal-wrap .am-list .am-list-line:after,.am-modal-wrap .am-list .am-list-line:before{-webkit-transform:scaleY(1);background-color:#efeff4;transform:scaleY(1)}.am-modal-wrap .am-modal-transparent{width:80%}.am-modal-wrap.am-modal.am-modal-transparent.am-modal-android .am-modal-content{-webkit-border-radius:1.389vw;-webkit-box-shadow:1px 1px 1.667vw #333;border-radius:1.389vw;box-shadow:1px 1px 1.667vw #333;content:"viewport-units-buggyfill; -webkit-box-shadow: 1px 1px 1.667vw #333; box-shadow: 1px 1px 1.667vw #333; border-radius: 1.389vw"}.am-modal-mask-hidden+.am-modal-wrap-popup{display:none}div[data-eruda]{display:none}div[data-eruda] :after,div[data-eruda] :before{color:inherit} -------------------------------------------------------------------------------- /src/project/demo/react/reactDemo @/style.scss: -------------------------------------------------------------------------------- 1 | /* * 2 | 3 | @function p2r($pt) { 4 | @return $pt / 720 * 10rem; 5 | } 6 | 7 | div { 8 | color: blue; 9 | height: 100vh; 10 | 11 | h2 { 12 | color: orange; lalala 13 | } 14 | } 15 | 16 | li { 17 | font-size: p2r(32); 18 | } 19 | 20 | h2 { 21 | font-size: 32pt; 22 | } */ 23 | @mixin flexRow{display: flex;flex-direction: row;} 24 | @mixin flexColumn{display: flex;flex-direction: column;} 25 | @mixin flexSpace{display: flex;justify-content: space-between;align-items: center;} 26 | @mixin borderCss{border: 1px solid #e3e3e3;border-radius: 4pt;} 27 | @mixin margin{margin:0 20pt 5pt 20pt} 28 | @mixin pointer{cursor: pointer} 29 | *{margin: 0;padding: 0} 30 | 31 | .Page{ 32 | 33 | @include flexColumn; 34 | @include borderCss; 35 | width:50%; 36 | height: auto; 37 | background-color: #f5f5f5; 38 | margin:auto; 39 | h2{text-align: center} 40 | .margin{@include margin} 41 | .taskItems { 42 | 43 | ol{ 44 | margin:20pt 0; 45 | li{ 46 | @include borderCss; 47 | background-color: #fff; 48 | list-style-type: none; 49 | height: 42pt; 50 | line-height: 42pt; 51 | margin:0 20pt -1px; 52 | .show{display: inline} 53 | .hide{display: none} 54 | button{ 55 | @include pointer; 56 | float: right; 57 | // border:none; 58 | background-color: #fff; 59 | width: inherit; 60 | height: inherit; 61 | 62 | } 63 | } 64 | } 65 | 66 | } 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Button/style.m.scss: -------------------------------------------------------------------------------- 1 | 2 | .default { 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | 7 | padding: 19pt 16pt; 8 | 9 | font-size: 24pt; 10 | color: #fff; 11 | border-radius: 4pt; 12 | 13 | background-color: #fdb72b; 14 | text-align: center; 15 | } 16 | 17 | .capsule { 18 | display: flex; 19 | align-items: center; 20 | justify-content: center; 21 | 22 | font-size: 26pt; 23 | min-width: 120pt; 24 | max-width: 630pt; 25 | height: 60pt; 26 | text-align: center; 27 | padding: 0 34pt; 28 | white-space: nowrap; 29 | text-overflow: ellipsis; 30 | overflow: hidden; 31 | border-radius: 50pt; 32 | background-color: #e7e7e7; 33 | color: #333; 34 | &.active { 35 | color: #fff; 36 | background-image: linear-gradient( 37 | 90deg, 38 | #ffb800 0%, 39 | #ffa000 100%, 40 | #f98e08 100%, 41 | #f27c10 100%, 42 | #f65f3f 100%, 43 | #f9426e 100% 44 | ), 45 | linear-gradient(#e7e7e7, #e7e7e7); 46 | background-blend-mode: normal, normal; 47 | } 48 | 49 | &.disable { 50 | opacity: .4; 51 | } 52 | } 53 | 54 | .full { 55 | display: flex; 56 | align-items: center; 57 | justify-content: center; 58 | width: 100%; 59 | max-width: 720pt; 60 | height: 88pt; 61 | padding: 0 30pt; 62 | overflow: hidden; 63 | 64 | text-transform: uppercase; 65 | background-color: #F56A20; 66 | color: #fff; 67 | 68 | font-size: 28pt; 69 | text-align: center; 70 | 71 | &.disable { 72 | background: #ccc; 73 | } 74 | } -------------------------------------------------------------------------------- /docs/project/commonDemo.2ce61f.js: -------------------------------------------------------------------------------- 1 | webpackJsonp( 2 | ['commonDemo'], 3 | { 4 | '3IRH': function(o, n, t) { 5 | o.exports = t('RuJ5')('3IRH') 6 | }, 7 | DuR2: function(o, n, t) { 8 | o.exports = t('ldvi')('DuR2') 9 | }, 10 | Eacs: function(o, n, t) { 11 | o.exports = t('RuJ5')('Eacs') 12 | }, 13 | 'FZ+f': function(o, n, t) { 14 | o.exports = t('RuJ5')('FZ+f') 15 | }, 16 | MTIv: function(o, n, t) { 17 | o.exports = t('RuJ5')('MTIv') 18 | }, 19 | RuJ5: function(o, n) { 20 | o.exports = polyfill_7040c53544f95c7ea1ff 21 | }, 22 | cIrB: function(o, n, t) { 23 | o.exports = t('RuJ5')('cIrB') 24 | }, 25 | j1ja: function(o, n, t) { 26 | o.exports = t('RuJ5')('j1ja') 27 | }, 28 | ldvi: function(o, n) { 29 | o.exports = react_6869fe7fa65021e0953a 30 | }, 31 | sEW3: function(o, n, t) { 32 | t('kQ6M'), t('FZ+f'), t('MTIv') 33 | var e, 34 | u = (function(o) { 35 | { 36 | if (o && o.__esModule) return o 37 | var n = {} 38 | if (null != o) 39 | for (var t in o) 40 | Object.prototype.hasOwnProperty.call(o, t) && (n[t] = o[t]) 41 | return (n.default = o), n 42 | } 43 | })(t('+sPD')), 44 | f = t('M4fF'), 45 | r = (e = f) && e.__esModule ? e : { default: e } 46 | ;(window.helpers = u), console.log(u), (window._ = r.default) 47 | }, 48 | 'w/50': function(o, n, t) { 49 | o.exports = t('RuJ5')('w/50') 50 | } 51 | }, 52 | ['sEW3'] 53 | ) 54 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/url/index.js: -------------------------------------------------------------------------------- 1 | import { isNull } from '@helpers/base/is' 2 | import { get, run } from '@helpers/base/try' 3 | import root from '@helpers/base/globalThis' 4 | import { __ } from '@helpers/package/utils' 5 | 6 | const safeDecode = value => { 7 | const decoders = [root.decodeURIComponent, root.decodeURI, root.unescape] 8 | 9 | for (let decode of decoders) { 10 | try { 11 | return decode(value) 12 | } catch (error) { 13 | continue 14 | } 15 | } 16 | 17 | return value 18 | } 19 | 20 | export const paramEscape = __(param)(__, __, root.unescape) 21 | export function param(name, url = root.location.search, decode = safeDecode) { 22 | let res = get(run(url, 'split', '?'), '1', '').match( 23 | new RegExp(`(^|&)${name}=([^&]*)(&|$)`) 24 | ) 25 | 26 | return isNull(res) ? undefined : decode(res[2]) 27 | } 28 | 29 | export const allParamEscape = __(allParam)(__, root.unescape) 30 | export function allParam(url = root.location.search, decode = safeDecode) { 31 | const search = get(url.split('?'), [1], '') 32 | 33 | if (search.length === 0) { 34 | return {} 35 | } 36 | 37 | return search 38 | .split('&') 39 | .map(param => param.split('=')) 40 | .reduce( 41 | (res, [key, value]) => 42 | Object.assign(res, { 43 | [key]: decode(value) 44 | }), 45 | {} 46 | ) 47 | } 48 | 49 | export function generateParamStr(paramObj, encode = root.encodeURIComponent) { 50 | return `?${Object.entries(paramObj) 51 | .map(([key, value]) => [key, encode(value)].join('=')) 52 | .join('&')}` 53 | } 54 | -------------------------------------------------------------------------------- /src/project/demo/frame/reactBaseFrameDemo @/store/modules/main.js: -------------------------------------------------------------------------------- 1 | import { persistReducer } from 'redux-persist' 2 | import storageSession from 'redux-persist/lib/storage/session' 3 | import { createModule } from 're-modulex' 4 | 5 | const delay = time => new Promise(resolve => setTimeout(resolve, time)) 6 | 7 | const reduxModule = createModule({ 8 | name: 'main', 9 | state: { 10 | counter: 0, 11 | text: '' 12 | }, 13 | actions: ({ 14 | commit, // commit 为原 redux 的 dispatch 15 | dispatch, // dispatch 只触发到动作层 16 | getState, // 获取当前 module 的 state 17 | getStoreState, // 获取整个 redux store 的 state 18 | getModules // 获取其他 module 以进行模块间通信 19 | }) => ({ 20 | counter: { 21 | add: (amount = 1) => commit('add', amount), 22 | reduce: (amount = 1) => commit('reduce', -1 * amount) 23 | }, 24 | // 将异步控制从 redux 中拆离,异步操作不依赖其他中间件 25 | text: async text => { 26 | await delay(1000) 27 | commit('text', text) 28 | await delay(2000) 29 | commit('add', 1) // 同一个 action 可以 commit 多次 30 | dispatch.counter.reduce(1) 31 | } 32 | }), 33 | mutations: ({ combine }) => ({ 34 | // 变化响应可以合并,类似 redux-actions 的 combineActions 35 | [combine('add', 'reduce')]: ({ counter }, amount) => ({ 36 | counter: counter + amount 37 | }), 38 | text: (state, text) => ({ text }) 39 | }), 40 | // 允许衍生状态 41 | getters: { 42 | text: state => `computed::${state.text}` 43 | } 44 | }) 45 | export default reduxModule 46 | reduxModule.persistReducer = persistReducer( 47 | // 配合持久化插件工作 48 | { 49 | key: reduxModule.name, 50 | storage: storageSession 51 | }, 52 | reduxModule.reducer 53 | ) 54 | -------------------------------------------------------------------------------- /docs/project/tweenDemo.fe0338.css: -------------------------------------------------------------------------------- 1 | .container_1YMR{background:#18212d;color:#fff;content:"viewport-units-buggyfill; width: 100vw; height: 100vh";height:100vh;width:100vw}.container_1YMR,.view_3B5A{-webkit-align-items:center;-webkit-box-align:center;-webkit-box-pack:center;-webkit-justify-content:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;justify-content:center}.view_3B5A{-webkit-box-direction:normal;-webkit-box-orient:vertical;-webkit-flex-direction:column;flex-direction:column;min-width:400px;overflow:visible;position:relative}.block_31V1{background:#fed477;height:40px;left:0;line-height:40px;position:absolute;text-align:center;top:0;width:40px}.progress_1oiH{cursor:pointer;margin-top:100px;width:400px}.buttons_3naR{margin-top:10px;text-align:center}.buttons_3naR button{background:#d97c98;border:1px solid #fff;color:#fff;cursor:pointer;font-size:16px;margin-right:5px;outline:none;padding:1em 2em}.info_3wNr{font-size:30px;font-weight:700;margin:20px 0;overflow:hidden}.easing-link_2S6a{color:#fff;font-size:16px;text-decoration:underline}.container_gDoP{background:#18212d;color:#fff;content:"viewport-units-buggyfill; width: 100vw; height: 100vh";height:100vh;width:100vw}.container_gDoP ul{-webkit-box-pack:center;-webkit-flex-wrap:wrap;-webkit-justify-content:center;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;flex-wrap:wrap;justify-content:center;list-style:none;padding:0}.content_LEyg{padding:30px}.content_LEyg h2{font-size:16px;margin:20px;text-align:center}.line_1ggw{background:#18212d;border-bottom:1px solid #222;border-top:1px solid #222;height:400px;position:relative;width:400px}.line_1ggw canvas{height:100%;width:100%} -------------------------------------------------------------------------------- /src/project/demo/simple/pageDemoA @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React from 'react' 3 | import ReactDom from 'react-dom' 4 | import 'react-router-dom' 5 | import md5 from 'md5' 6 | import axios from 'axios' 7 | 8 | import fp from 'lodash/fp' 9 | import _ from 'lodash' 10 | 11 | Object.assign(window, { _, fp }) 12 | 13 | import { fn1, fn2 } from '@commonDemo' 14 | import { fnA } from '@layoutDemo' 15 | import { test } from './test' 16 | 17 | import './style' 18 | // import { test2 } from './test2' 19 | 20 | // import { test } from './test' 21 | 22 | // import(/* webpackChunkName: "my-test3" */ './test3').then(({ test3 }) => { 23 | // console.log(test3) 24 | // }) 25 | 26 | // import(/* webpackChunkName: "my-test2" */ './test2').then(({ test2 }) => { 27 | // console.log(test2) 28 | // }) 29 | 30 | // import(/* webpackChunkName: "my-test" */ './test').then(({ test }) => { 31 | // console.log(test) 32 | // }) 33 | 34 | // Object.assign(window, { React, ReactDom, moment }) 35 | 36 | // const App = () =>
{`App Text `}
37 | 38 | const testFn = () => 'pageA 3' 39 | 40 | console.log(testFn()) 41 | // console.log(test2) 42 | 43 | fn1() 44 | // fn2() 45 | 46 | fnA() 47 | 48 | const delay = time => new Promise(resolve => setTimeout(resolve, time)) 49 | ;(async () => { 50 | console.log('test async/await in pageA') 51 | await delay(1000) 52 | console.log('after 1000 ms') 53 | await delay(2000) 54 | console.log('after 2000 ms') 55 | 56 | console.warn('1000ms 后加载 my-test2') 57 | 58 | await delay(1000) 59 | 60 | const { 61 | test: test2 62 | } = await import(/* webpackChunkName: "my-test2" */ './test2') 63 | 64 | console.log('异步模块 test2') 65 | console.log(test2) 66 | })() 67 | -------------------------------------------------------------------------------- /src/vendor/components/UI @/components/Countdown/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | 5 | const { get, value } = helpers 6 | 7 | const __fix__zero = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'] 8 | const __format__time = t => { 9 | let h = t / 1000 / 3600 10 | let m = (h - Math.floor(h)) * 60 11 | let s = (m - Math.floor(m)) * 60 12 | h = Math.floor(h).toString() 13 | m = Math.floor(m).toString() 14 | s = Math.floor(s).toString() 15 | 16 | return `${value(__fix__zero[h], h)}:${value(__fix__zero[m], m)}:${value( 17 | __fix__zero[s], 18 | s 19 | )}` 20 | } 21 | 22 | const __get__countdown = (deadline, localOffset = 0) => { 23 | const date = Date.now() + localOffset 24 | 25 | return date < deadline ? __format__time(deadline - date) : '00:00:00' 26 | } 27 | 28 | export default class Countdown extends Component { 29 | render() { 30 | return value(this.state.countdown, null) 31 | } 32 | 33 | constructor(props, ...args) { 34 | super(props, ...args) 35 | 36 | this.state = { 37 | countdown: __get__countdown(props.deadline, props.localOffset) 38 | } 39 | } 40 | 41 | componentDidMount() { 42 | this.start() 43 | } 44 | 45 | componentWillUnmount() { 46 | this.stop() 47 | } 48 | 49 | start = () => { 50 | const { deadline, localOffset } = this.props 51 | 52 | this.interval = setInterval(() => { 53 | const countdown = __get__countdown(deadline, localOffset) 54 | 55 | if (countdown === '00:00:00') { 56 | this.stop() 57 | } 58 | 59 | this.setState({ 60 | countdown 61 | }) 62 | }, 1000) 63 | } 64 | 65 | stop = () => { 66 | clearInterval(this.interval) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /docs/project/pageDemoB.97185c.js: -------------------------------------------------------------------------------- 1 | webpackJsonp( 2 | ['pageDemoB'], 3 | { 4 | '3IRH': function(t, e, n) { 5 | t.exports = n('RuJ5')('3IRH') 6 | }, 7 | DuR2: function(t, e, n) { 8 | t.exports = n('ldvi')('DuR2') 9 | }, 10 | Eacs: function(t, e, n) { 11 | t.exports = n('RuJ5')('Eacs') 12 | }, 13 | 'FZ+f': function(t, e, n) { 14 | t.exports = n('RuJ5')('FZ+f') 15 | }, 16 | GiK3: function(t, e, n) { 17 | t.exports = n('ldvi')('GiK3') 18 | }, 19 | MTIv: function(t, e, n) { 20 | t.exports = n('RuJ5')('MTIv') 21 | }, 22 | O27J: function(t, e, n) { 23 | t.exports = n('ldvi')('O27J') 24 | }, 25 | RuJ5: function(t, e) { 26 | t.exports = polyfill_7040c53544f95c7ea1ff 27 | }, 28 | YSOd: function(t, e, n) { 29 | 'use strict' 30 | Object.defineProperty(e, '__esModule', { value: !0 }) 31 | e.test = 'test ' 32 | }, 33 | cIrB: function(t, e, n) { 34 | t.exports = n('RuJ5')('cIrB') 35 | }, 36 | j1ja: function(t, e, n) { 37 | t.exports = n('RuJ5')('j1ja') 38 | }, 39 | ldvi: function(t, e) { 40 | t.exports = react_6869fe7fa65021e0953a 41 | }, 42 | 'w/50': function(t, e, n) { 43 | t.exports = n('RuJ5')('w/50') 44 | }, 45 | ylhK: function(t, e, n) { 46 | n('kQ6M'), n('FZ+f'), n('MTIv') 47 | c(n('GiK3')), c(n('O27J')), c(n('L6bb')) 48 | n('mtWM') 49 | var o = c(n('5INz')), 50 | u = c(n('M4fF')), 51 | f = n('Yu5+') 52 | n('NzAI'), n('YSOd') 53 | function c(t) { 54 | return t && t.__esModule ? t : { default: t } 55 | } 56 | Object.assign(window, { _: u.default, fp: o.default }), 57 | console.log('pageB '), 58 | (0, f.fn1)() 59 | } 60 | }, 61 | ['ylhK'] 62 | ) 63 | -------------------------------------------------------------------------------- /src/vendor/helpers @/base/is/index.js: -------------------------------------------------------------------------------- 1 | import root from '@helpers/base/globalThis' 2 | 3 | // 值类型判断 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 | export const isUndefined = val => typeof val === 'undefined' 5 | 6 | export const isNull = val => val === null 7 | 8 | export const isFunction = val => typeof val === 'function' 9 | 10 | export const isArray = val => val instanceof Array 11 | 12 | const __error__type = [ 13 | 'Error', 14 | 'EvalError', 15 | 'RangeError', 16 | 'ReferenceError', 17 | 'SyntaxError', 18 | 'TypeError', 19 | 'URIError' 20 | ] 21 | .map(key => root[key]) 22 | .filter(type => !isUndefined(type)) 23 | export const isError = val => __error__type.some(type => val instanceof type) 24 | 25 | export const isObject = val => 26 | typeof val === 'object' && !(isArray(val) || isNull(val)) 27 | 28 | export const isBoolean = val => typeof val === 'boolean' 29 | 30 | export const isString = val => typeof val === 'string' 31 | 32 | export const isExist = val => !(isUndefined(val) || isNull(val)) 33 | 34 | export const isNaN = val => val !== val 35 | 36 | export const isNumber = val => typeof val === 'number' && !isNaN(val) 37 | // 值类型判断 ------------------------------------------------------------- 38 | 39 | // 环境判断 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 40 | export const isAndroid = () => /(Android)/i.test(window.navigator.userAgent) 41 | 42 | export const isIOS = () => 43 | /(iPhone|iPad|iPod|iOS)/i.test(window.navigator.userAgent) 44 | 45 | export const isWKWebview = () => isIOS() && isExist(window.webkit) 46 | 47 | export const isDesktop = () => 48 | /(Win32|Win64|MacIntel|Linux x86_64)/i.test(window.navigator.platform) 49 | 50 | export const isMobile = () => !isDesktop() && (isAndroid() || isIOS()) 51 | // 环境判断 ------------------------------------------------------------- 52 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/GridRollSample/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | // import UI, { } from '@UI' 5 | 6 | import './style.scss' 7 | import Divider from '../helpers/divider' 8 | 9 | const { classnames } = helpers 10 | 11 | export default class GridRollSample extends Component { 12 | __divider = new Divider(360, 8) 13 | 14 | render() { 15 | const activeIdx = this.__divider.judge(this.props.deg) 16 | 17 | return ( 18 |
    19 |
  • 24 | 0 25 |
  • 26 |
  • 31 | 1 32 |
  • 33 |
  • 38 | 2 39 |
  • 40 | 41 |
  • 46 | 7 47 |
  • 48 |
  • empty
  • 49 |
  • 54 | 3 55 |
  • 56 | 57 |
  • 62 | 6 63 |
  • 64 |
  • 69 | 5 70 |
  • 71 |
  • 76 | 4 77 |
  • 78 |
79 | ) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/helpers/runner.js: -------------------------------------------------------------------------------- 1 | import { get, run, clamp, defaultFrameProcess as frameProcess } from '@helpers' 2 | 3 | export default class Runner { 4 | constructor({ speed = 0 } = {}) { 5 | Object.assign(this, { 6 | speed 7 | }) 8 | 9 | this.distance = 0 10 | } 11 | 12 | __distance__reach__listener__info = {} 13 | onDistanceReach = (value, listener) => { 14 | this.__distance__reach__listener__info = { value, listener } 15 | } 16 | 17 | __running__listener = [] 18 | onRunning = listener => { 19 | this.__running__listener.push(listener) 20 | } 21 | 22 | setDistance = distance => { 23 | const prevDistance = this.distance 24 | this.distance = distance 25 | 26 | if (this.distance !== prevDistance) { 27 | if ( 28 | this.distance >= get(this.__distance__reach__listener__info, 'value', 0) 29 | ) { 30 | setTimeout(() => { 31 | run(this.__distance__reach__listener__info, 'listener', this.distance) 32 | 33 | try { 34 | delete this.__distance__reach__listener__info.listener 35 | } catch (err) { 36 | // nothing 37 | } 38 | }) 39 | } 40 | 41 | this.__running__listener.forEach(listener => 42 | run(listener, undefined, this.distance) 43 | ) 44 | } 45 | } 46 | 47 | __is__running = false 48 | __run = () => { 49 | let __prev__step__time = Date.now() 50 | this.__stop = frameProcess.start(() => { 51 | const __now = Date.now() 52 | if (this.speed > 0) { 53 | const d = this.speed * (__now - __prev__step__time) / 1000 54 | this.setDistance(this.distance + d) 55 | } 56 | __prev__step__time = __now 57 | }) 58 | } 59 | 60 | start = () => { 61 | this.__is__running = true 62 | this.__run() 63 | } 64 | 65 | stop = () => { 66 | this.__is__running = false 67 | run(this.__stop) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/__prefix__/eruda/index.js: -------------------------------------------------------------------------------- 1 | import '../style/__eruda__fix.scss' 2 | import { overide, reset, release } from './helpers/overide' 3 | import * as source from './helpers/source' 4 | 5 | let __console__timeout 6 | 7 | const __host__white__list = [] 8 | const { prompt } = window 9 | const isDesktop = () => 10 | /(Win32|Win64|MacIntel|Linux x86_64)/i.test(window.navigator.platform) 11 | 12 | const eruda$ = document.createElement('div') 13 | 14 | eruda$.setAttribute('data-eruda', true) 15 | document.body.appendChild(eruda$) 16 | 17 | const showConsole = async () => { 18 | try { 19 | const eruda = await source.js('//cdn.jsdelivr.net/npm/eruda', 'eruda') 20 | 21 | reset() 22 | 23 | eruda.init({ 24 | container: eruda$ 25 | }) 26 | 27 | release() 28 | 29 | eruda$.style.display = 'block' 30 | 31 | window.eruda = eruda 32 | } catch (err) { 33 | // nothing 34 | } 35 | } 36 | 37 | const bind = e => { 38 | let x, y 39 | 40 | try { 41 | x = e.touches[0].pageX 42 | y = e.touches[0].pageY 43 | } catch (err) { 44 | console.error('[eruda] 初始化失败', err) 45 | remove() 46 | } 47 | 48 | if (x > 50 || y > 50) { 49 | return 50 | } 51 | 52 | __console__timeout = setTimeout(() => { 53 | if (prompt() === '20160315') { 54 | showConsole() 55 | } 56 | }, 3000) 57 | } 58 | 59 | const unbind = e => clearTimeout(__console__timeout) 60 | 61 | const attach = () => { 62 | document.body.addEventListener('touchstart', bind) 63 | document.body.addEventListener('touchend', unbind) 64 | 65 | overide() 66 | } 67 | 68 | const remove = () => { 69 | try { 70 | eruda$.parentNode.removeChild(eruda$) 71 | } catch (error) { 72 | // nothing 73 | } 74 | } 75 | 76 | if (!isDesktop()) { 77 | attach() 78 | 79 | if ( 80 | __host__white__list.includes(window.location.host) || 81 | process.env.TEST || 82 | process.env.NODE_ENV === 'development' 83 | ) { 84 | showConsole() 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "plugins": [ 9 | /** 10 | * 校验 .vue 文件内部的 script 语句,文档:https://vue-loader.vuejs.org/zh-cn/workflow/linting.html 11 | */ 12 | "html" 13 | ], 14 | "rules": { 15 | //参考资料:http://eslint.cn/docs/rules/ 16 | "semi": "off", //要求或禁止使用分号而不是 ASI 17 | "no-undef": "error", //禁用未声明的变量,除非它们在 /*globals */ 注释中被提到 18 | "no-unused-vars": "off", //禁止出现未使用过的变量 19 | "no-use-before-define": "off", //不允许在变量定义之前使用它们 20 | "no-empty": "warn", //禁止空语句块 21 | "no-empty-function": "warn", //禁止出现空函数 22 | "eqeqeq": "warn", //要求使用 === 和 !== 23 | "no-lone-blocks": "warn", //禁用不必要的嵌套块 24 | "no-loop-func": "warn", //禁止在循环中出现 function 声明和表达式 25 | "no-native-reassign": "error", //禁止对原生对象赋值 26 | "no-alert": "off", //禁用 alert、confirm 和 prompt 27 | "no-extra-label": "warn", //禁用不必要的标签 28 | "no-eval": "error", //禁用 eval() 29 | "no-redeclare": "error", //禁止使用 var 多次声明同一变量 30 | "radix": "warn", //强制在 parseInt() 使用基数参数 31 | "no-return-assign": "warn", //禁止在 return 语句中使用赋值语句 32 | "no-bitwise": "off", //禁用按位运算符(防止类似于将 && 错写为 & 的错误) 33 | "no-mixed-spaces-and-tabs": "warn", //不允许空格和 tab 混合缩进 34 | "max-depth": ["warn", { "max": 4 }], //强制可嵌套的块的最大深度 35 | "max-params": ["warn", { "max": 9 }], //强制 function 定义中最多允许的参数数量 36 | "max-lines": ["warn", { "max": 1000 }], //强制最大行数 37 | "no-const-assign": "error", //禁止修改 const 声明的变量 38 | "prefer-template": "warn", //要求使用模板字面量而非字符串连接 39 | "no-var": "warn", //要求使用 let 或 const 而不是 var 40 | "no-implicit-globals": "error", //禁止在全局范围内使用 var 和命名的 function 声明 41 | "wrap-iife": "error", //要求 IIFE 使用括号括起来 42 | "no-extra-semi": "warn" //禁止不必要的分号 43 | }, 44 | "parserOptions": { 45 | "ecmaVersion": 6, 46 | "sourceType": "module", 47 | "allowImportExportEverywhere": true, 48 | "ecmaFeatures": { 49 | "jsx": true 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/vendor/helpers @/base/try/DOC.md: -------------------------------------------------------------------------------- 1 | 2 | # try 模块 3 | 4 | 值相关的安全尝试,防止**由于属性断层抛出报错打断程序运行**的情况发生 5 | 6 | ## get 安全取值 7 | 8 | ```javascript 9 | var obj = { 10 | a: { 11 | b: 1 12 | } 13 | } 14 | 15 | // 基础 16 | get(obj, 'a.b') // 1 17 | get(obj, ['a', 'b']) // 1 18 | get(obj, 'c.b') // undefined 19 | 20 | // 带默认值 21 | get(obj, 'c.b', 1) // 1 22 | ``` 23 | 24 | ## set 安全赋值(无副作用) 25 | 26 | ```javascript 27 | var obj 28 | 29 | obj = set(obj, 'a.b.c', 1) 30 | 31 | console.log(obj) 32 | /** 33 | * { 34 | * a: { 35 | * b: { 36 | * c: 1 37 | * } 38 | * } 39 | * } 40 | * / 41 | ``` 42 | 43 | 注:此方法为纯函数,无副作用 44 | 45 | ```javascript 46 | // DEMO 1: set函数的结果需要被使用 47 | var obj 48 | 49 | set(obj, 'a', 1) // {a: 1} 50 | 51 | console.log(obj) // undefined 52 | 53 | // DEMO 2:set函数会生成操作对象和其属性的新副本 54 | var obj = { 55 | a: { 56 | b: 1 57 | } 58 | } 59 | 60 | var obj2 = set(obj, 'a.b', 2) 61 | 62 | console.log(obj === obj2) // false 63 | console.log(obj.a === obj2.a) // false 64 | ``` 65 | 66 | ## run 安全运行(可保护上下文) 67 | 68 | ```javascript 69 | var obj = { 70 | deep: { 71 | deep: { 72 | add: (a, b) => a + b 73 | } 74 | }, 75 | 76 | name: 'CJY', 77 | greet() { 78 | console.log(`hello, I'm ${this.name}`) 79 | } 80 | } 81 | 82 | // 函数存在时 83 | run(obj, 'deep.deep.add', 1, 2) // 3 84 | 85 | 86 | // 取值不是函数或查找结果不存在时,行为与 get 函数一致 87 | run(obj, 'deep.deep.reduce') // undefined 88 | run(obj, 'name') // CJY 89 | 90 | // 保护上下文 91 | run(obj, 'greet') // hello, I'm CJY 92 | ``` 93 | 94 | ## value 多层默认值(只在值为`undefined`情况下生效) 95 | 96 | ```javascript 97 | var v1, v2, v3 = 'default' 98 | 99 | value(v1, v2, v3) // default 100 | 101 | value(v1, 0, v3) // 0 102 | 103 | // 可传递执行函数 104 | value( 105 | v1, 106 | () => { 107 | console.log('v1没有,尝试v2') 108 | return v2 109 | }, 110 | () => { 111 | console.log('v2也没有,尝试v3') 112 | return v3 113 | }, 114 | ) // default 115 | ``` -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "parserOpts": { 3 | "parser": "babylon" // babylon 固定在 6.13.0 版本以支持 pipeline 语法 4 | }, 5 | "presets": [ 6 | ["env", { 7 | /** 8 | * 由于 Tree Shaking 特性可能对缓存功能有较大影响,此处关闭此特性 9 | */ 10 | // "modules": false // Tree Shaking 特性要求使用 es6 模块语法才能分析无效引用,所以此处要关闭 babel 对 import 语法的转义 11 | }], 12 | "stage-2", 13 | "react" 14 | ], 15 | 16 | "env": { 17 | "production": { 18 | "plugins": [ 19 | ["jsx-css-modules", { 20 | "styleFileReg": [ 21 | "\\.m\\.(css|scss|sass)$" 22 | ] 23 | }], 24 | "transform-pipeline", 25 | "syntax-dynamic-import", 26 | "transform-decorators-legacy", 27 | "transform-async-functions", 28 | "transform-export-extensions", 29 | 30 | /** 31 | * babel-plugin-import 实现 antd-mobile 按需加载配置,文档:https://github.com/ant-design/babel-plugin-import 32 | */ 33 | ["import", { "libraryName": "antd-mobile", "style": true }], 34 | 35 | /** 36 | * babel-plugin-component 实现 mint-ui 按需加载配置,文档:https://github.com/ElementUI/babel-plugin-component 37 | */ 38 | ["component", { "libraryName": "mint-ui", "style": true }] 39 | 40 | /** 41 | * 让 vue 支持 jsx 语法,文档:https://github.com/vuejs/babel-plugin-transform-vue-jsx 42 | * 由于与 react jsx 语法编译互斥,停止使用 43 | */ 44 | // "transform-vue-jsx" 45 | ], 46 | }, 47 | "development": { 48 | "plugins": [ 49 | ["jsx-css-modules", { 50 | "styleFileReg": [ 51 | "\\.m\\.(css|scss|sass)$" 52 | ] 53 | }], 54 | "transform-pipeline", 55 | "react-hot-loader/babel", 56 | "syntax-dynamic-import", 57 | "transform-decorators-legacy", 58 | "transform-async-functions", 59 | "transform-export-extensions", 60 | ["import", { "libraryName": "antd-mobile", "style": true }], 61 | ["component", { "libraryName": "mint-ui", "style": true }] 62 | ] 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/vendor/demo/ReModulex @/core/context.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import hoistStatics from 'hoist-non-react-statics' 3 | 4 | import { getModules, mapModules } from '../helpers/modules' 5 | import { applyStore } from '../helpers/store' 6 | import { get, run, value } from '../helpers/try' 7 | 8 | const { Provider, Consumer } = value(() => { 9 | try { 10 | return React.createContext() 11 | } catch (error) { 12 | console.warn( 13 | new Error(` 14 | [ReModulex Environment Waring] 15 | 'React.createContext' API is not supported by you React version. 16 | So 'ModuleProvider' and 'connectModules' would NOT effect. 17 | Use 'applyStore' and 'mapModules' with 'Provider' and 'connect' in react-redux instead. 18 | https://github.com/CJY0208/re-modulex#%E4%B8%8D%E6%83%B3%E7%94%A8%E9%85%8D%E5%A5%97%E7%9A%84-moduleprovider-%E5%92%8C-connectmodules%E6%83%B3%E9%85%8D%E5%90%88-react-redux- 19 | `) 20 | ) 21 | return { 22 | Provider: ({ children }) => run(children), 23 | Consumer: ({ children }) => run(children) 24 | } 25 | } 26 | }) 27 | 28 | export class ModuleProvider extends Component { 29 | state = this.props.store.getState() 30 | 31 | constructor(props, ...args) { 32 | const { store } = props 33 | 34 | super(props, ...args) 35 | applyStore(store) 36 | this.unsubscibe = store.subscribe(() => 37 | this.setState(this.props.store.getState()) 38 | ) 39 | } 40 | 41 | componentWillUnmount() { 42 | run(this.unsubscibe) 43 | } 44 | 45 | render() { 46 | return {this.props.children} 47 | } 48 | } 49 | 50 | export const connectModules = modulesGetter => Component => { 51 | const C = props => ( 52 | 53 | {storeState => ( 54 | 55 | )} 56 | 57 | ) 58 | 59 | C.displayName = `HOC-ReModulex(${value( 60 | Component.displayName, 61 | Component.name 62 | )})` 63 | 64 | return hoistStatics(C, Component) 65 | } 66 | -------------------------------------------------------------------------------- /src/project/demo/react/CacheRouteDemo @/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { render } from 'react-dom' 3 | import { HashRouter, Link } from 'react-router-dom' 4 | import CacheRoute, { CacheSwitch } from '@CacheRoute' 5 | 6 | window.React = React 7 | console.log('React Version', React.version) 8 | 9 | const List = () => ( 10 |
16 |
    17 |
  • 1
  • 18 |
  • 2
  • 19 |
  • 3
  • 20 |
  • 4
  • 21 |
  • 5
  • 22 |
  • 6
  • 23 |
  • 7
  • 24 |
  • 8
  • 25 |
  • 9
  • 26 |
  • 10
  • 27 |
  • 11
  • 28 |
  • 12
  • 29 |
  • 13
  • 30 |
  • 14
  • 31 |
  • 15
  • 32 |
  • 16
  • 33 |
  • 17
  • 34 |
  • 18
  • 35 |
  • 19
  • 36 |
  • 20
  • 37 |
  • 21
  • 38 |
  • 22
  • 39 |
  • 23
  • 40 |
  • 24
  • 41 |
  • 25
  • 42 |
  • 26
  • 43 |
  • 27
  • 44 |
  • 28
  • 45 |
  • 29
  • 46 |
  • 30
  • 47 |
  • 31
  • 48 |
  • 32
  • 49 |
  • 33
  • 50 |
  • 34
  • 51 |
  • 35
  • 52 |
  • 36
  • 53 |
  • 37
  • 54 |
  • 38
  • 55 |
  • 39
  • 56 |
  • 40
  • 57 |
  • 41
  • 58 |
  • 42
  • 59 |
  • 43
  • 60 |
  • 44
  • 61 |
  • 45
  • 62 |
  • 46
  • 63 |
  • 47
  • 64 |
  • 48
  • 65 |
  • 49
  • 66 |
  • 50
  • 67 |
  • 68 | To Detail 69 |
  • 70 |
71 |
72 | ) 73 | 74 | const Item = ({ history }) => ( 75 |
76 | 83 |
84 | ) 85 | 86 | const App = () => ( 87 | 88 | 89 | 90 | 91 | 92 | 93 | ) 94 | 95 | render(, document.getElementById('root')) 96 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/helpers/roller.js: -------------------------------------------------------------------------------- 1 | import * as helpers from '@helpers' 2 | 3 | import Runner from './runner' 4 | 5 | const { run, get, value, Tween } = helpers 6 | 7 | export default class Roller { 8 | __runner = new Runner() 9 | 10 | onRolling = listener => { 11 | this.__runner.onRunning(distance => { 12 | run(listener, undefined, distance % 360, distance) 13 | }) 14 | } 15 | 16 | __rolling = false 17 | roll = (speed = 1080, { duration = 2000, ease } = {}) => { 18 | if (this.__rolling) { 19 | return 20 | } 21 | 22 | this.__rolling = true 23 | 24 | this.__runner.start() 25 | 26 | new Tween({ 27 | from: 0, 28 | to: speed, 29 | duration, 30 | ease 31 | }) 32 | .on('update', value => { 33 | this.__runner.speed = value 34 | }) 35 | .start() 36 | } 37 | 38 | stop = ( 39 | deg, 40 | { duration = 10000, ease = pos => Math.pow(pos - 1, 3) + 1, onEnd } = {} 41 | ) => { 42 | const slowDownDuration = duration * 5 / 5 43 | 44 | const __tangent__ratio = ease(0.0001) / 0.0001 45 | const slowDownDistance = 46 | slowDownDuration * this.__runner.speed / 1000 / __tangent__ratio 47 | 48 | let slowDownPoint = deg - slowDownDistance 49 | while (slowDownPoint < this.__runner.distance) { 50 | slowDownPoint += 360 51 | } 52 | 53 | this.__runner.onDistanceReach(slowDownPoint, distance => { 54 | this.__runner.speed = 0 55 | 56 | new Tween({ 57 | from: distance, 58 | to: slowDownPoint + slowDownDistance, 59 | ease, 60 | duration: slowDownDuration 61 | }) 62 | .on('update', this.__runner.setDistance) 63 | .on('end', () => { 64 | run(onEnd, undefined) 65 | this.__runner.stop() 66 | this.__rolling = false 67 | }) 68 | .start() 69 | }) 70 | 71 | // new Tween({ 72 | // from: this.__runner.speed, 73 | // to: this.__runner.speed / 4, 74 | // duration: duration * 1 / 5, 75 | // }) 76 | // .on('update', value => { 77 | // this.__runner.speed = value 78 | // }) 79 | // .on('end', realSlowDown) 80 | // .start() 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/vendor/helpers @/base/try/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | isString, 3 | isExist, 4 | isUndefined, 5 | isFunction, 6 | isObject, 7 | isArray, 8 | isNumber 9 | } from '@helpers/base/is' 10 | 11 | export const get = (obj, keys = [], defaultValue) => { 12 | try { 13 | if (isNumber(keys)) { 14 | keys = String(keys) 15 | } 16 | let result = (isString(keys) ? keys.split('.') : keys).reduce( 17 | (res, key) => res[key], 18 | obj 19 | ) 20 | return isUndefined(result) ? defaultValue : result 21 | } catch (e) { 22 | return defaultValue 23 | } 24 | 25 | // keys = isString(keys) ? keys.split('.') : keys 26 | 27 | // let result 28 | // let res = obj 29 | // let idx = 0 30 | 31 | // for (; idx < keys.length; idx++) { 32 | // let key = keys[idx] 33 | 34 | // if (isExist(res)) { 35 | // res = res[key] 36 | // } else { 37 | // break 38 | // } 39 | // } 40 | 41 | // if (idx === keys.length) { 42 | // result = res 43 | // } 44 | 45 | // return isUndefined(result) ? defaultValue : result 46 | } 47 | 48 | export const set = (obj = {}, keys = [], value) => { 49 | obj = Object.assign({}, obj) 50 | keys = isString(keys) ? keys.split('.') : keys 51 | 52 | keys.reduce((res, key, idx) => { 53 | let next = idx === keys.length - 1 ? value : get(res, key, {}) 54 | 55 | if (isObject(next)) { 56 | next = Object.assign({}, next) 57 | } 58 | 59 | if (isArray(next)) { 60 | next = next.slice() 61 | } 62 | 63 | res[key] = next 64 | 65 | return res[key] 66 | }, obj) 67 | 68 | return obj 69 | } 70 | 71 | export const run = (obj, keys = [], ...args) => { 72 | keys = isString(keys) ? keys.split('.') : keys 73 | 74 | const func = get(obj, keys) 75 | const context = get(obj, keys.slice(0, -1)) 76 | 77 | return isFunction(func) ? func.call(context, ...args) : func 78 | } 79 | 80 | // export const __run = (obj, keys = [], args) => run(obj, keys, ...args) 81 | 82 | export const value = (...values) => 83 | values.reduce( 84 | (value, nextValue) => (isUndefined(value) ? run(nextValue) : run(value)), 85 | undefined 86 | ) 87 | 88 | // export const valueRight = (...args) => value.apply(undefined, args.reverse()) 89 | -------------------------------------------------------------------------------- /src/project/demo/react/antd/Slider @antdSliderDemo/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | 5 | import { Slider, WingBlank, WhiteSpace } from 'antd-mobile' 6 | 7 | class App extends React.Component { 8 | log = name => { 9 | return value => { 10 | console.log(`${name}: ${value}`) 11 | } 12 | } 13 | render() { 14 | return ( 15 |
16 | 17 | 18 |

Slider

19 | 27 |
28 | 29 | 30 |

Disabled slider

31 | 40 |
41 | 42 | 43 |

Slider with customized color

44 | 66 |
67 |
68 | ) 69 | } 70 | } 71 | 72 | ReactDOM.render(, document.getElementById('root')) 73 | -------------------------------------------------------------------------------- /src/vendor/helpers @/base/is/is-value-type.test.js: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai' 2 | import { 3 | isUndefined, 4 | isNull, 5 | isFunction, 6 | isArray, 7 | isObject, 8 | isNumber, 9 | isBoolean, 10 | isString, 11 | isExist 12 | } from './index' 13 | 14 | describe('is 值类型单元测试', () => { 15 | it('isUndefined 函数测试', () => { 16 | expect(isUndefined(undefined)).to.be.equal(true) 17 | ;[null, {}, [], 0, ''].forEach(value => 18 | expect(isUndefined(value)).to.be.equal(false) 19 | ) 20 | }) 21 | 22 | it('isNull 函数测试', () => { 23 | expect(isNull(null)).to.be.equal(true) 24 | ;[undefined, {}, [], 0, ''].forEach(value => 25 | expect(isNull(value)).to.be.equal(false) 26 | ) 27 | }) 28 | 29 | it('isFunction 函数测试', () => { 30 | function fn1() {} 31 | const fn2 = () => {} 32 | ;[fn1, fn2].forEach(value => expect(isFunction(value)).to.be.equal(true)) 33 | ;[undefined, {}, [], 0, '', null].forEach(value => 34 | expect(isFunction(value)).to.be.equal(false) 35 | ) 36 | }) 37 | 38 | it('isArray 函数测试', () => { 39 | expect(isArray([])).to.be.equal(true) 40 | ;[undefined, {}, 0, ''].forEach(value => 41 | expect(isArray(value)).to.be.equal(false) 42 | ) 43 | }) 44 | 45 | it('isObject 函数测试', () => { 46 | expect(isObject({})).to.be.equal(true) 47 | ;[undefined, [], 0, ''].forEach(value => 48 | expect(isObject(value)).to.be.equal(false) 49 | ) 50 | }) 51 | 52 | it('isNumber 函数测试', () => { 53 | expect(isNumber(0)).to.be.equal(true) 54 | ;[undefined, [], {}, '1'].forEach(value => 55 | expect(isNumber(value)).to.be.equal(false) 56 | ) 57 | }) 58 | 59 | it('isBoolean 函数测试', () => { 60 | expect(isBoolean(false)).to.be.equal(true) 61 | ;[undefined, [], {}, ''].forEach(value => 62 | expect(isBoolean(value)).to.be.equal(false) 63 | ) 64 | }) 65 | 66 | it('isString 函数测试', () => { 67 | expect(isString('')).to.be.equal(true) 68 | ;[undefined, [], {}, 0].forEach(value => 69 | expect(isString(value)).to.be.equal(false) 70 | ) 71 | }) 72 | 73 | it('isExist 函数测试', () => { 74 | ;['', 0, false, {}, []].forEach(value => 75 | expect(isExist(value)).to.be.equal(true) 76 | ) 77 | ;[undefined, null].forEach(value => 78 | expect(isExist(value)).to.be.equal(false) 79 | ) 80 | }) 81 | }) 82 | -------------------------------------------------------------------------------- /src/project/demo/react/reactRouterDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React, { Component } from 'react' 3 | import ReactDOM from 'react-dom' 4 | import { HashRouter as Router, Route, Link, withRouter } from 'react-router-dom' 5 | 6 | import * as helpers from '@helpers' 7 | 8 | window.helpers = helpers 9 | 10 | import './style.scss' 11 | import './test.css' 12 | // import '@layoutDemo' 13 | // import 'mobx-react' 14 | // import 'react-redux' 15 | // import { createHashHistory } from 'history' 16 | // import 'axios' 17 | 18 | // console.log(withRouter) 19 | 20 | // const history = createHashHistory() 21 | 22 | const BasicExample = () => ( 23 | 24 |
25 |
    26 |
  • 27 | Home 28 |
  • 29 |
  • 30 | About 31 |
  • 32 |
  • 33 | Topics 34 |
  • 35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 |
43 |
44 | ) 45 | 46 | @withRouter 47 | class Home extends Component { 48 | render() { 49 | return ( 50 |
51 |

Home

52 |
53 | ) 54 | } 55 | } 56 | 57 | const About = () => ( 58 |
59 |

About

60 | 61 |
62 | ) 63 | 64 | const Topics = ({ match }) => ( 65 |
66 |

Topics

67 |
    68 |
  • 69 | Rendering with React 70 |
  • 71 |
  • 72 | Components 73 |
  • 74 |
  • 75 | Props v. State 76 |
  • 77 |
78 | 79 | 80 |

Please select a topic.

} 84 | /> 85 |
86 | ) 87 | 88 | const Topic = ({ match }) => ( 89 |
90 |

{match.params.topicId}

91 |
92 | ) 93 | 94 | ReactDOM.render(, document.getElementById('root')) 95 | // ReactDOM.render(
test
, document.getElementById('root')) 96 | -------------------------------------------------------------------------------- /src/project/demo/react/rollDemo @/Roll/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | 3 | import * as helpers from '@helpers' 4 | import UI, { View, ScrollView } from '@UI' 5 | 6 | import RollSample from '../RollSample' 7 | import GridRollSample from '../GridRollSample' 8 | 9 | import Roller from '../helpers/roller' 10 | import Divider from '../helpers/divider' 11 | import './style.scss' 12 | 13 | window.Roller = Roller 14 | window.Divider = Divider 15 | 16 | window.helpers = helpers 17 | 18 | const { random } = helpers 19 | 20 | @helpers.hot(module) 21 | export default class Roll extends Component { 22 | state = { 23 | deg: 0, 24 | stopAt: undefined 25 | } 26 | 27 | __roller = new Roller() 28 | __divider = new Divider(360, 8) 29 | __roller__stopping = false 30 | 31 | componentDidMount() { 32 | this.__roller.onRolling(deg => this.setState({ deg })) 33 | 34 | this.roll() 35 | 36 | window.roller = this.__roller 37 | } 38 | 39 | roll = () => { 40 | if (this.__roller.__rolling) { 41 | return 42 | } 43 | this.setState( 44 | { 45 | stopAt: undefined 46 | }, 47 | () => this.__roller.roll() 48 | ) 49 | } 50 | 51 | stop = () => { 52 | if (this.__roller__stopping) { 53 | return 54 | } 55 | this.__roller__stopping = true 56 | this.setState( 57 | { 58 | stopAt: random(0, 360) 59 | }, 60 | () => { 61 | this.__roller.stop(this.state.stopAt, { 62 | onEnd: () => { 63 | this.__roller__stopping = false 64 | } 65 | }) 66 | } 67 | ) 68 | } 69 | 70 | render() { 71 | return ( 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 | Now At Block {this.__divider.judge(this.state.deg)} ({(this.state 81 | .deg + 82 | 292.5) % 83 | 360}) 84 |
85 | {this.state.stopAt && ( 86 |
87 | Stop At Block {this.__divider.judge(this.state.stopAt)} ({(this 88 | .state.stopAt + 89 | 292.5) % 90 | 360}) 91 |
92 | )} 93 |
94 |
95 | ) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/vendor/demo/CacheRoute @/components/CacheRoute.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | import { Route } from 'react-router-dom' 4 | 5 | import CacheComponent from '../core/CacheComponent' 6 | import Updatable from '../core/Updatable' 7 | import { run } from '../helpers/try' 8 | 9 | const isEmptyChildren = children => React.Children.count(children) === 0 10 | 11 | export default class CacheRoute extends Component { 12 | static componentName = 'CacheRoute' 13 | 14 | static propTypes = { 15 | component: PropTypes.elementType || PropTypes.any, 16 | render: PropTypes.func, 17 | children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), 18 | className: PropTypes.string, 19 | when: PropTypes.oneOf(['forward', 'back', 'always']), 20 | behavior: PropTypes.func 21 | } 22 | 23 | static defaultProps = { 24 | when: 'forward' 25 | } 26 | 27 | render() { 28 | let { 29 | children, 30 | render, 31 | component, 32 | className, 33 | when, 34 | behavior, 35 | cacheKey, 36 | ...__rest__props 37 | } = this.props 38 | 39 | /** 40 | * Note: 41 | * If children prop is a React Element, define the corresponding wrapper component for supporting multiple children 42 | * 43 | * 说明:如果 children 属性是 React Element 则定义对应的包裹组件以支持多个子组件 44 | */ 45 | if (React.isValidElement(children) || !isEmptyChildren(children)) { 46 | render = () => children 47 | } 48 | 49 | return ( 50 | /** 51 | * Only children prop of Route can help to control rendering behavior 52 | * 只有 Router 的 children 属性有助于主动控制渲染行为 53 | */ 54 | ( 57 | 61 | {cacheLifecycles => ( 62 | { 65 | Object.assign(props, { cacheLifecycles }) 66 | 67 | if (component) { 68 | return React.createElement(component, props) 69 | } 70 | 71 | return run(render || children, undefined, props) 72 | }} 73 | /> 74 | )} 75 | 76 | )} 77 | /> 78 | ) 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /docs/markedDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/vendor/helpers @/package/url/url.test.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { JSDOM } from 'jsdom' 3 | import * as url from './index' 4 | 5 | const { window, document } = new JSDOM(``, { 6 | url: 7 | 'https://www.test.com/index.html?testCode=123&encodeURIComponentName=%E4%BD%A0%E5%A5%BD&escapeName=%u4F60%u597D' 8 | }) 9 | 10 | Object.assign( 11 | global, 12 | { 13 | window, 14 | document 15 | }, 16 | { 17 | location: window.location 18 | } 19 | ) 20 | 21 | describe('url 单元测试', () => { 22 | describe('param 函数功能测试', () => { 23 | it('使用默认的 location.search 作为查询字段', () => { 24 | assert.equal(url.param('testCode'), '123') 25 | assert.equal(url.param('encodeURIComponentName'), '你好') 26 | assert.equal(url.paramEscape('escapeName'), '你好') 27 | }) 28 | 29 | it('使用自定义查询字段', () => { 30 | const customSearch = 31 | '?testCode=456&encodeURIComponentName=%E6%88%91%E4%B8%8D%E5%A5%BD&escapeName=%u6211%u4E0D%u597D' 32 | assert.equal(url.param('testCode', customSearch), '456') 33 | assert.equal(url.param('encodeURIComponentName', customSearch), '我不好') 34 | assert.equal(url.paramEscape('escapeName', customSearch), '我不好') 35 | }) 36 | }) 37 | 38 | describe('allParam 函数功能测试', () => { 39 | it('使用默认的 location.search 作为查询字段', () => { 40 | assert.equal( 41 | JSON.stringify(url.allParam()), 42 | JSON.stringify({ 43 | testCode: '123', 44 | encodeURIComponentName: '你好', 45 | escapeName: '你好' 46 | }) 47 | ) 48 | 49 | // assert.equal( 50 | // JSON.stringify(url.allParamEscape()), 51 | // JSON.stringify({ 52 | // testCode: '123', 53 | // encodeURIComponentName: "ä½ å¥½", 54 | // escapeName: '你好' 55 | // }) 56 | // ) 57 | }) 58 | 59 | it('使用自定义查询字段', () => { 60 | const customSearch = 61 | '?testCode=456&encodeURIComponentName=%E6%88%91%E4%B8%8D%E5%A5%BD&escapeName=%u6211%u4E0D%u597D' 62 | assert.equal( 63 | JSON.stringify(url.allParam(customSearch)), 64 | JSON.stringify({ 65 | testCode: '456', 66 | encodeURIComponentName: '我不好', 67 | escapeName: '我不好' 68 | }) 69 | ) 70 | 71 | assert.equal( 72 | JSON.stringify(url.allParamEscape(customSearch)), 73 | JSON.stringify({ 74 | testCode: '456', 75 | encodeURIComponentName: '我不好', 76 | escapeName: '我不好' 77 | }) 78 | ) 79 | }) 80 | }) 81 | }) 82 | -------------------------------------------------------------------------------- /docs/reactDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/tweenDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tween Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/commonDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/vueRouterDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/CacheRouteDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/antdSliderDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/LocalProviderDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/antdDatePickerDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/nestedRouterDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/assets/i18n/common/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "价格": "Giá bán", 3 | "首付": "Số tiền đặt cọc", 4 | "月付": "Thanh toán hàng tháng", 5 | "月": "Tháng", 6 | "Credit Pay": "Thanh toán tín dụng", 7 | "Credit Pay说明": 8 | "Bạn có thể mua hàng bằng tín dụng mà không cần trả trước. Vui lòng thanh toán ( hóa đơn ) đúng hạn trước ngày ghi trên hóa đơn của bạn trong kế hoạch thanh toán.", 9 | "不分期": "Không kỳ hạn", 10 | "选择分期": "Chọn kỳ hạn", 11 | "现在购买": "MUA NGAY", 12 | "支付": "TRẢ", 13 | "如果您在当月的账单日期未能偿还,将扣除逾期款 XX": 14 | "${XX} Thanh toán quá hạn sẽ được áp dụng nếu bạn không thanh toán vào ngày lập hoá đơn cho tháng hiện tại.", 15 | "总还款": "Tổng trả lại", 16 | "还款计划": "Kế hoạch trả nợ", 17 | "我同意条款": "Tôi đồng ý với sự đóng góp", 18 | "条款协议": "Các điều khoản và điều kiện", 19 | "登陆或注册": "Đăng nhập / Đăng ký", 20 | "请先登陆您的账号": "Vui lòng đăng nhập tài khoản của bạn đầu tiên", 21 | "好的": "Xác nhận", 22 | "取消": "Hủy", 23 | "请选择支付方式": "Vui lòng chọn Phương thức thanh toán", 24 | "新建地址": "Thêm địa chỉ nhận hàng", 25 | "请选择收货地址": "Chọn địa chỉ Vui lòng", 26 | "商品详情": "Mục chi tiết", 27 | "选择分期方案": "Chọn Thời lượng", 28 | "确认支付": "Xác nhận thanh toán", 29 | "选择地址": "Chọn địa chỉ", 30 | "支付方式": "Phương thức thanh toán", 31 | "无法配送的地址": "Địa chỉ không có sẵn", 32 | "暂无地址,前往新建": "Chưa có địa chỉ giao hàng.", 33 | "您未同意条款协议": "Bạn không đồng ý với phần này!", 34 | "您有未完成的退款订单,请前往“账单”页面完成退款流程并继续购物。": 35 | "Bạn có (các) đơn đặt hàng hoàn tiền đang chờ xử lý.", 36 | "您的帐户仍然有未完成的余额,请先偿还,继续购物。": 37 | "Tài khoản của bạn vẫn còn số dư chưa thanh toán. Trả trước khi tiếp tục mua sắm.", 38 | "您未获取信用支付授权,请先完成分期或全额付款": 39 | "Để mua các khoản thanh toán bằng tín dụng với 0 khoản thanh toán trễ, trước tiên bạn cần hoàn thành đơn đặt hàng trả trước hoặc trả đầy đủ.", 40 | "额度不足": "Không đủ số dư", 41 | "分期付款申请": "Ứng dụng Trả góp", 42 | "您现在没有信用额度,请先申请信用额度以启用分期付款购物。": 43 | "Bạn không có giới hạn tín dụng ngay bây giờ. Hãy trước tiên hãy yêu cầu giới hạn tín dụng để cho phép mua sắm mua sắm.", 44 | "立即申请": "Áp dụng ngay bây giờ", 45 | "激活受理中": "Chế biến Kích hoạt", 46 | "激活受理中!请于额度激活成功后选择信用支付!": 47 | "Kích hoạt giới hạn tín dụng của bạn đang được xử lý.", 48 | "激活额度": "Kích hoạt Giới Hạn Tín dụng", 49 | "您的信用额度尚未激活,请现在激活它,开始无信用卡购物。": 50 | "Giới hạn tín dụng của bạn chưa được kích hoạt.", 51 | "现在激活": "Kích hoạt ngay", 52 | "以后再说": "Không phải bây giờ", 53 | "审核中": "Dưới Kiểm toán", 54 | "我们正在处理您的申请,请等待。": 55 | "Chúng tôi đang xử lý tài liệu của bạn ngay bây giờ, xin vui lòng chờ đợi.", 56 | "请提供XX": "Vui lòng cung cấp ${XX}", 57 | "XX有误": "${XX} sai", 58 | "分享": "Chia sẻ" 59 | } 60 | -------------------------------------------------------------------------------- /src/assets/i18n/common/in.json: -------------------------------------------------------------------------------- 1 | { 2 | "价格": "Harga", 3 | "首付": "Uang muka", 4 | "月付": "Per bulan", 5 | "月": "Bulan", 6 | "Credit Pay": "Bayar dengan limit", 7 | "Credit Pay说明": 8 | "Kamu dapat membeli produk dengan menggunakan limit kreditmu, Silahkan lunasi tagihanmu sebelum tanggal jatuh tempo.", 9 | "不分期": "Tanpa Cicilan", 10 | "选择分期": "Rencana Cicilan", 11 | "现在购买": "Beli", 12 | "支付": "BAYAR", 13 | "如果您在当月的账单日期未能偿还,将扣除逾期款 XX": 14 | "${XX} Biaya keterlambatan akan dikenakan jika Anda gagal membayar sesuai tanggal tagihan bulan ini.", 15 | "总还款": "Total Tagihan", 16 | "还款计划": "Waktu Pembayaran", 17 | "我同意条款": "Saya menyetujui cicilan tersebut", 18 | "条款协议": "Syarat dan ketentuan", 19 | "登陆或注册": "Masuk", 20 | "请先登陆您的账号": "Masukkan Akun Anda", 21 | "好的": "Konfirmasi", 22 | "取消": "Batal", 23 | "请选择支付方式": "Silahkan Pilih Metode Pembayaran", 24 | "新建地址": "Tambah Alamat Pengiriman", 25 | "请选择收货地址": "Silahkan Pilih Alamat", 26 | "商品详情": "Detail Item", 27 | "选择分期方案": "Rencana Cicilan", 28 | "确认支付": "Konfirmasi Akhir", 29 | "选择地址": "Pilih Alamat", 30 | "支付方式": "Rencana Cicilan", 31 | "无法配送的地址": "Alamat tidak tersedia", 32 | "暂无地址,前往新建": "Belum ada alamat pengiriman. Silahkan tambahkan.", 33 | "您未同意条款协议": "Anda Tidak Setuju dengan Cicilan!", 34 | "您有未完成的退款订单,请前往“账单”页面完成退款流程并继续购物。": 35 | "Pengembalian dana pada pesanan Anda belum selesai. Silakan ke menu ”Tagihanku” untuk selesaikan proses pengembalian dana dan melanjutkan berbelanja.", 36 | "您的帐户仍然有未完成的余额,请先偿还,继续购物。": 37 | "Masih ada tagihan yang belum dibayarkan, silakan bayar tagihan terlebih dahulu sebelum belanja kembali.", 38 | "您未获取信用支付授权,请先完成分期或全额付款": 39 | "Anda harus melakukan transaksi cicilan atau pembayaran tunai dahulu agar dapat menggunakan fitur ”bayar dengan limit”", 40 | "额度不足": "Saldo tidak mencukupi", 41 | "分期付款申请": "Pengajuan Cicilan", 42 | "您现在没有信用额度,请先申请信用额度以启用分期付款购物。": 43 | "Saat ini Anda tidak memiliki limit kredit. Silakan ajukan limit kredit terlebih dahulu untuk belanja dengan cicilan", 44 | "立即申请": "Ajukan Sekarang", 45 | "激活受理中": "Limit sedang diaktifkan", 46 | "激活受理中!请于额度激活成功后选择信用支付!": 47 | "Limit sedang diaktifkan, silakan menggunakan limit setelah proses sukses", 48 | "激活额度": "Aktifkan limit", 49 | "您的信用额度尚未激活,请现在激活它,开始无信用卡购物。": 50 | "Limit kredit Anda belum diaktifkan, silakan aktifkan limit Anda.", 51 | "现在激活": "Aktifkan sekarang", 52 | "以后再说": "Jangan sekarang", 53 | "审核中": "Dalam Proses Audit", 54 | "我们正在处理您的申请,请等待。": 55 | "Kami Sedang Memproses Dokumen Anda, Mohon Tunggu.", 56 | "请提供XX": "Harap berikan ${XX}", 57 | "XX有误": "${XX} salah", 58 | "分享": "Bagikan" 59 | } 60 | -------------------------------------------------------------------------------- /docs/vueDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/project/demo/react/antd/LocalProviderDemo @/index.js: -------------------------------------------------------------------------------- 1 | import '__prefix__' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | 5 | window.React = React 6 | 7 | import { 8 | Pagination, 9 | LocaleProvider, 10 | List, 11 | DatePicker, 12 | WhiteSpace, 13 | InputItem, 14 | WingBlank, 15 | SegmentedControl, 16 | Picker, 17 | SearchBar 18 | } from 'antd-mobile' 19 | import enUS from 'antd-mobile/lib/locale-provider/en_US' 20 | 21 | const maxDate = new Date(2018, 11, 3, 22, 0) 22 | const minDate = new Date(2015, 7, 6, 8, 30) 23 | 24 | const seasons = [ 25 | [ 26 | { 27 | label: '2013', 28 | value: '2013' 29 | }, 30 | { 31 | label: '2014', 32 | value: '2014' 33 | } 34 | ], 35 | [ 36 | { 37 | label: '春', 38 | value: '春' 39 | }, 40 | { 41 | label: '夏', 42 | value: '夏' 43 | } 44 | ] 45 | ] 46 | 47 | const Page = () => ( 48 |
49 | 50 | 51 | 52 | 58 | datePicker 59 | 60 | 61 | picker 62 | 63 | 64 | 65 | 66 | 67 | 68 |
69 | ) 70 | 71 | class App extends React.Component { 72 | constructor(props) { 73 | super(props) 74 | this.state = { 75 | isEnglish: true 76 | } 77 | } 78 | 79 | onChange = e => { 80 | const index = e.nativeEvent.selectedSegmentIndex 81 | this.setState({ 82 | isEnglish: index === 0 83 | }) 84 | } 85 | 86 | render() { 87 | const locale = this.state.isEnglish ? enUS : undefined 88 | return ( 89 | 90 | 95 | 96 | 97 | 98 | 99 | 100 | ) 101 | } 102 | } 103 | 104 | ReactDOM.render(, document.getElementById('root')) 105 | -------------------------------------------------------------------------------- /docs/antdTabsDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/assets/i18n/common/en_US.json: -------------------------------------------------------------------------------- 1 | { 2 | "价格": "Price", 3 | "首付": "Downpayment ", 4 | "月付": "Monthly Pay", 5 | "月": "Month", 6 | "Credit Pay": "Credit Pay", 7 | "Credit Pay说明": 8 | "You can purchase this item with your credit with 0 downpayment. Please repay your on time before the bill date shows on the following Repay Plan.", 9 | "不分期": "Full Pay", 10 | "选择分期": "Choose Duration", 11 | "现在购买": "BUY NOW", 12 | "支付": "PAY", 13 | "如果您在当月的账单日期未能偿还,将扣除逾期款 XX": 14 | "${XX} overdue payment will be applied if you fail to repay on bill date for current month.", 15 | "总还款": "Repay Total", 16 | "还款计划": "Repay Plan", 17 | "我同意条款": "I agree the Installment", 18 | "条款协议": "Terms and Conditions", 19 | "登陆或注册": "Login/Register", 20 | "请先登陆您的账号": "Please login your account first", 21 | "好的": "Confirm", 22 | "取消": "Cancel", 23 | "请选择支付方式": "Please Choose Repay Method", 24 | "新建地址": "ADD SHIPPING ADDRESS", 25 | "请选择收货地址": "Choose Address Please", 26 | "商品详情": "Item Details", 27 | "选择分期方案": "Choose Payment method", 28 | "确认支付": "Payment Confirmation", 29 | "选择地址": "Choose Address", 30 | "支付方式": "Payment Method", 31 | "无法配送的地址": "Unavailable address", 32 | "暂无地址,前往新建": "No shipping address yet. Go add one.", 33 | "您未同意条款协议": "You are disagree with the installment!", 34 | "您有未完成的退款订单,请前往“账单”页面完成退款流程并继续购物。": 35 | "You have pending refund order(s). Please go to ”Bills” page to complete refund process and continue shopping.", 36 | "您的帐户仍然有未完成的余额,请先偿还,继续购物。": 37 | "Your account still have outstanding balance. Please repay first to continue shopping.", 38 | "您未获取信用支付授权,请先完成分期或全额付款": 39 | "In order to purchase credit pay items with 0 downpayment, you need to complete an installment or full pay order first.", 40 | "额度不足": "Not enough balance", 41 | "分期付款申请": "Installment Application", 42 | "您现在没有信用额度,请先申请信用额度以启用分期付款购物。": 43 | "You don't have credit limit now. Please apply for credit limit first to enable installment shopping.", 44 | "立即申请": "Apply Now", 45 | "激活受理中": "Activation Processing", 46 | "激活受理中!请于额度激活成功后选择信用支付!": 47 | "Your credit limit activation is under processing. Start shopping without credit card after credit limit activated.", 48 | "激活额度": "Activate Credit Limit", 49 | "您的信用额度尚未激活,请现在激活它,开始无信用卡购物。": 50 | "Your credit limit has not yet been activated. Please activate it now to start shopping without credit card.", 51 | "现在激活": "Activate Now", 52 | "以后再说": "Not Now", 53 | "审核中": "Under Auditing", 54 | "我们正在处理您的申请,请等待。": 55 | "We are processing your documents now, please kindly wait.", 56 | "请提供XX": "Please provide ${XX}", 57 | "XX有误": "${XX} is wrong", 58 | "分享": "Share" 59 | } 60 | -------------------------------------------------------------------------------- /docs/antdCalendarDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /docs/StrictListDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Loading... 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 | --------------------------------------------------------------------------------