@varlet/cli 2.0.0-alpha.1663499244572 → 2.0.0-alpha.1663742071515
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +21 -21
- package/README.en-US.md +401 -401
- package/README.md +396 -396
- package/lib/commands/build.d.ts +1 -1
- package/lib/commands/build.js +67 -18
- package/lib/commands/changelog.d.ts +6 -6
- package/lib/commands/changelog.js +27 -26
- package/lib/commands/commitLint.d.ts +1 -1
- package/lib/commands/commitLint.js +21 -50
- package/lib/commands/compile.d.ts +7 -7
- package/lib/commands/compile.js +119 -43
- package/lib/commands/create.d.ts +8 -8
- package/lib/commands/create.js +181 -90
- package/lib/commands/dev.d.ts +5 -5
- package/lib/commands/dev.js +123 -44
- package/lib/commands/gen.d.ts +8 -8
- package/lib/commands/gen.js +140 -85
- package/lib/commands/jest.d.ts +8 -0
- package/lib/commands/jest.js +85 -0
- package/lib/commands/lint.d.ts +1 -1
- package/lib/commands/lint.js +123 -48
- package/lib/commands/preview.d.ts +1 -1
- package/lib/commands/preview.js +74 -23
- package/lib/commands/release.d.ts +5 -5
- package/lib/commands/release.js +270 -132
- package/lib/commands/test.d.ts +7 -7
- package/lib/commands/test.js +26 -26
- package/lib/commands/useVite.d.ts +1 -0
- package/lib/commands/useVite.js +70 -0
- package/lib/commands/vite.d.ts +3 -3
- package/lib/commands/vite.js +69 -20
- package/lib/compiler/compileModule.d.ts +5 -5
- package/lib/compiler/compileModule.js +190 -79
- package/lib/compiler/compileSFC.d.ts +2 -2
- package/lib/compiler/compileSFC.js +135 -86
- package/lib/compiler/compileScript.d.ts +17 -17
- package/lib/compiler/compileScript.js +194 -152
- package/lib/compiler/compileSiteEntry.d.ts +13 -13
- package/lib/compiler/compileSiteEntry.js +237 -140
- package/lib/compiler/compileStyle.d.ts +11 -11
- package/lib/compiler/compileStyle.js +91 -43
- package/lib/compiler/compileTemplateHighlight.d.ts +10 -10
- package/lib/compiler/compileTemplateHighlight.js +193 -145
- package/lib/compiler/compileTypes.d.ts +2 -2
- package/lib/compiler/compileTypes.js +85 -49
- package/lib/config/babel.config.d.ts +2 -2
- package/lib/config/babel.config.js +31 -30
- package/lib/config/babel.sfc.transform.d.ts +1 -1
- package/lib/config/babel.sfc.transform.js +18 -18
- package/lib/config/jest.config.d.ts +1 -0
- package/lib/config/jest.config.js +37 -0
- package/lib/config/jest.media.mock.d.ts +0 -0
- package/lib/config/jest.media.mock.js +2 -0
- package/lib/config/jest.style.mock.d.ts +0 -0
- package/lib/config/jest.style.mock.js +2 -0
- package/lib/config/varlet.config.d.ts +1 -1
- package/lib/config/varlet.config.js +24 -23
- package/lib/config/vite.config.d.ts +5 -5
- package/lib/config/vite.config.js +162 -157
- package/lib/config/vitest.config.d.ts +2 -2
- package/lib/config/vitest.config.js +28 -28
- package/lib/index.d.ts +2 -2
- package/lib/index.js +102 -84
- package/lib/shared/constant.d.ts +43 -44
- package/lib/shared/constant.js +50 -51
- package/lib/shared/fsUtils.d.ts +12 -12
- package/lib/shared/fsUtils.js +108 -61
- package/lib/shared/logger.d.ts +8 -8
- package/lib/shared/logger.js +23 -23
- package/package.json +11 -10
- package/preset.js +3 -3
- package/site/components/button/Button.vue +106 -106
- package/site/components/button/button.less +183 -183
- package/site/components/button/index.ts +10 -10
- package/site/components/button/props.ts +78 -78
- package/site/components/cell/Cell.vue +54 -54
- package/site/components/cell/cell.less +78 -78
- package/site/components/cell/index.ts +10 -10
- package/site/components/cell/props.ts +27 -27
- package/site/components/code-example/CodeExample.vue +137 -137
- package/site/components/code-example/codeExample.less +41 -41
- package/site/components/code-example/index.ts +10 -10
- package/site/components/context/index.ts +21 -21
- package/site/components/context/lock.ts +92 -92
- package/site/components/context/zIndex.ts +20 -20
- package/site/components/icon/Icon.vue +75 -75
- package/site/components/icon/icon.less +26 -26
- package/site/components/icon/index.ts +10 -10
- package/site/components/icon/props.ts +24 -24
- package/site/components/loading/Loading.vue +84 -84
- package/site/components/loading/index.ts +10 -10
- package/site/components/loading/loading.less +505 -505
- package/site/components/loading/props.ts +42 -42
- package/site/components/popup/Popup.tsx +102 -102
- package/site/components/popup/index.ts +10 -10
- package/site/components/popup/popup.less +125 -125
- package/site/components/popup/props.ts +63 -63
- package/site/components/progress/Progress.vue +112 -112
- package/site/components/progress/index.ts +10 -10
- package/site/components/progress/progress.less +101 -101
- package/site/components/progress/props.ts +55 -55
- package/site/components/ripple/index.ts +188 -188
- package/site/components/ripple/ripple.less +20 -20
- package/site/components/snackbar/Snackbar.vue +41 -41
- package/site/components/snackbar/core.vue +132 -132
- package/site/components/snackbar/index.tsx +270 -270
- package/site/components/snackbar/props.ts +97 -97
- package/site/components/snackbar/snackbar.less +135 -135
- package/site/components/styles/common.less +64 -64
- package/site/components/styles/elevation.less +126 -126
- package/site/components/styles/var.less +27 -27
- package/site/components/utils/components.ts +117 -117
- package/site/components/utils/elements.ts +102 -102
- package/site/index.html +49 -49
- package/site/mobile/App.vue +291 -291
- package/site/mobile/components/AppHome.vue +134 -134
- package/site/mobile/components/AppType.vue +22 -22
- package/site/mobile/components/app-bar/AppBar.vue +65 -65
- package/site/mobile/components/app-bar/appBar.less +57 -57
- package/site/mobile/components/app-bar/index.ts +10 -10
- package/site/mobile/components/app-bar/props.ts +25 -25
- package/site/mobile/main.ts +78 -78
- package/site/mobile.html +41 -41
- package/site/module.d.ts +5 -5
- package/site/pc/App.vue +43 -43
- package/site/pc/Layout.vue +423 -423
- package/site/pc/components/AnimationBox.vue +33 -33
- package/site/pc/components/AppHeader.vue +368 -368
- package/site/pc/components/AppMobile.vue +60 -60
- package/site/pc/components/AppSidebar.vue +143 -143
- package/site/pc/components/LogoAnimation.vue +117 -117
- package/site/pc/floating.ts +9 -9
- package/site/pc/main.ts +100 -100
- package/site/pc/pages/index/index.less +176 -176
- package/site/pc/pages/index/index.vue +130 -130
- package/site/pc/pages/index/locale/en-US.ts +1 -1
- package/site/pc/pages/index/locale/zh-CN.ts +1 -1
- package/site/tsconfig.json +11 -11
- package/site/useProgress.ts +72 -72
- package/site/utils.ts +165 -167
- package/template/create/__tests__/index.spec.ejs +8 -8
- package/template/create/example/index.ejs +15 -15
- package/template/create/example/locale/en-US.ts +3 -3
- package/template/create/example/locale/index.ts +23 -23
- package/template/create/example/locale/zh-CN.ts +3 -3
- package/template/create/index.ejs +12 -12
- package/template/create/less.ejs +3 -3
- package/template/create/props.ts +1 -1
- package/template/create/tsx.ejs +13 -13
- package/template/create/vue.ejs +17 -17
- package/template/generators/base/.prettierignore +9 -9
- package/template/generators/base/.prettierrc +5 -5
- package/template/generators/base/README.md +82 -82
- package/template/generators/base/babel.config.js +10 -10
- package/template/generators/base/public/highlight.css +1 -1
- package/template/generators/base/public/logo.svg +1 -1
- package/template/generators/base/shims/shims-md.d.ts +4 -4
- package/template/generators/base/shims/shims-vue.d.ts +6 -6
- package/template/generators/base/tsconfig.json +13 -13
- package/template/generators/config/default/base/docs/home.zh-CN.md +10 -10
- package/template/generators/config/default/base/package.json +105 -105
- package/template/generators/config/default/base/types/basicComponent.d.ts +7 -7
- package/template/generators/config/default/base/types/button.d.ts +12 -12
- package/template/generators/config/default/base/types/index.d.ts +6 -6
- package/template/generators/config/default/base/varlet.config.js +110 -110
- package/template/generators/config/default/sfc/src/button/Button.vue +30 -30
- package/template/generators/config/default/sfc/src/button/__tests__/index.spec.js +7 -7
- package/template/generators/config/default/sfc/src/button/button.less +14 -14
- package/template/generators/config/default/sfc/src/button/docs/zh-CN.md +47 -47
- package/template/generators/config/default/sfc/src/button/example/BasicUse.vue +7 -7
- package/template/generators/config/default/sfc/src/button/example/ModifyColor.vue +7 -7
- package/template/generators/config/default/sfc/src/button/example/index.vue +13 -13
- package/template/generators/config/default/sfc/src/button/index.ts +10 -10
- package/template/generators/config/default/tsx/src/button/Button.tsx +29 -29
- package/template/generators/config/default/tsx/src/button/__tests__/index.spec.js +7 -7
- package/template/generators/config/default/tsx/src/button/button.less +14 -14
- package/template/generators/config/default/tsx/src/button/docs/zh-CN.md +47 -47
- package/template/generators/config/default/tsx/src/button/example/BasicUse.vue +7 -7
- package/template/generators/config/default/tsx/src/button/example/ModifyColor.vue +7 -7
- package/template/generators/config/default/tsx/src/button/example/index.vue +13 -13
- package/template/generators/config/default/tsx/src/button/index.ts +10 -10
- package/template/generators/config/i18n/base/docs/home.en-US.md +11 -11
- package/template/generators/config/i18n/base/docs/home.zh-CN.md +10 -10
- package/template/generators/config/i18n/base/package.json +105 -105
- package/template/generators/config/i18n/base/types/basicComponent.d.ts +7 -7
- package/template/generators/config/i18n/base/types/button.d.ts +12 -12
- package/template/generators/config/i18n/base/types/index.d.ts +7 -7
- package/template/generators/config/i18n/base/types/locale.d.ts +24 -24
- package/template/generators/config/i18n/base/varlet.config.js +122 -122
- package/template/generators/config/i18n/sfc/src/button/Button.vue +36 -36
- package/template/generators/config/i18n/sfc/src/button/__tests__/index.spec.js +7 -7
- package/template/generators/config/i18n/sfc/src/button/button.less +14 -14
- package/template/generators/config/i18n/sfc/src/button/docs/en-US.md +34 -34
- package/template/generators/config/i18n/sfc/src/button/docs/zh-CN.md +34 -34
- package/template/generators/config/i18n/sfc/src/button/example/BasicUse.vue +11 -11
- package/template/generators/config/i18n/sfc/src/button/example/ModifyColor.vue +11 -11
- package/template/generators/config/i18n/sfc/src/button/example/index.vue +13 -13
- package/template/generators/config/i18n/sfc/src/button/example/locale/en-US.ts +5 -5
- package/template/generators/config/i18n/sfc/src/button/example/locale/index.ts +23 -23
- package/template/generators/config/i18n/sfc/src/button/example/locale/zh-CN.ts +5 -5
- package/template/generators/config/i18n/sfc/src/button/index.ts +10 -10
- package/template/generators/config/i18n/sfc/src/locale/__tests__/index.spec.js +51 -51
- package/template/generators/config/i18n/sfc/src/locale/docs/en-US.md +26 -26
- package/template/generators/config/i18n/sfc/src/locale/docs/zh-CN.md +25 -25
- package/template/generators/config/i18n/sfc/src/locale/en-US.d.ts +5 -5
- package/template/generators/config/i18n/sfc/src/locale/en-US.ts +7 -7
- package/template/generators/config/i18n/sfc/src/locale/index.ts +67 -67
- package/template/generators/config/i18n/sfc/src/locale/zh-CN.d.ts +5 -5
- package/template/generators/config/i18n/sfc/src/locale/zh-CN.ts +7 -7
- package/template/generators/config/i18n/tsx/src/button/Button.tsx +33 -33
- package/template/generators/config/i18n/tsx/src/button/__tests__/index.spec.js +7 -7
- package/template/generators/config/i18n/tsx/src/button/button.less +14 -14
- package/template/generators/config/i18n/tsx/src/button/docs/en-US.md +34 -34
- package/template/generators/config/i18n/tsx/src/button/docs/zh-CN.md +34 -34
- package/template/generators/config/i18n/tsx/src/button/example/BasicUse.vue +11 -11
- package/template/generators/config/i18n/tsx/src/button/example/ModifyColor.vue +11 -11
- package/template/generators/config/i18n/tsx/src/button/example/index.vue +13 -13
- package/template/generators/config/i18n/tsx/src/button/example/locale/en-US.ts +5 -5
- package/template/generators/config/i18n/tsx/src/button/example/locale/index.ts +23 -23
- package/template/generators/config/i18n/tsx/src/button/example/locale/zh-CN.ts +5 -5
- package/template/generators/config/i18n/tsx/src/button/index.ts +10 -10
- package/template/generators/config/i18n/tsx/src/locale/__tests__/index.spec.js +51 -51
- package/template/generators/config/i18n/tsx/src/locale/docs/en-US.md +26 -26
- package/template/generators/config/i18n/tsx/src/locale/docs/zh-CN.md +25 -25
- package/template/generators/config/i18n/tsx/src/locale/en-US.d.ts +5 -5
- package/template/generators/config/i18n/tsx/src/locale/en-US.ts +7 -7
- package/template/generators/config/i18n/tsx/src/locale/index.ts +67 -67
- package/template/generators/config/i18n/tsx/src/locale/zh-CN.d.ts +5 -5
- package/template/generators/config/i18n/tsx/src/locale/zh-CN.ts +7 -7
- package/tsconfig.json +14 -15
- package/varlet.default.config.js +3 -3
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="logo">
|
|
3
|
-
<h1 class="varlet-home__title">
|
|
4
|
-
<img class="varlet-home__image" :src="logo" />
|
|
5
|
-
<span>{{ title }}</span>
|
|
6
|
-
</h1>
|
|
7
|
-
<h2 class="varlet-home__desc">{{ description[lang] }}</h2>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div
|
|
11
|
-
class="varlet-home__cell"
|
|
12
|
-
v-for="component in components"
|
|
13
|
-
:key="component.text"
|
|
14
|
-
v-ripple
|
|
15
|
-
@click="toComponent(component)"
|
|
16
|
-
>
|
|
17
|
-
<span>{{ component.text[lang] }}</span>
|
|
18
|
-
<var-icon name="chevron-right" size="14" />
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script lang='ts'>
|
|
23
|
-
import config from '@config'
|
|
24
|
-
import { useRouter } from 'vue-router'
|
|
25
|
-
import { reactive, ref } from 'vue'
|
|
26
|
-
import { inIframe, isPhone, watchLang, watchPlatform } from '../../utils'
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
name: 'AppHome',
|
|
30
|
-
setup() {
|
|
31
|
-
const title = ref(config?.title ?? '')
|
|
32
|
-
const logo = ref(config?.logo ?? '')
|
|
33
|
-
const description = ref(config?.mobile?.title ?? {})
|
|
34
|
-
const menu = ref(config?.pc?.menu ?? [])
|
|
35
|
-
const configComponents = menu.value.filter((item: any) => item.type === 2)
|
|
36
|
-
const components = reactive(configComponents)
|
|
37
|
-
const lang = ref('zh-CN')
|
|
38
|
-
const platform = ref('mobile')
|
|
39
|
-
const router = useRouter()
|
|
40
|
-
|
|
41
|
-
watchLang((newValue) => {
|
|
42
|
-
lang.value = newValue
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
watchPlatform((newValue) => {
|
|
46
|
-
platform.value = newValue
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
const toComponent = (component: any) => {
|
|
50
|
-
router.push({
|
|
51
|
-
path: `/${component.doc}`,
|
|
52
|
-
query: {
|
|
53
|
-
language: lang.value,
|
|
54
|
-
platform: platform.value,
|
|
55
|
-
replace: component.doc
|
|
56
|
-
},
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
if (!isPhone() && inIframe()) {
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
window.top.scrollToMenu(component.doc)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
components,
|
|
67
|
-
lang,
|
|
68
|
-
toComponent,
|
|
69
|
-
logo,
|
|
70
|
-
title,
|
|
71
|
-
description,
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<style scoped lang="less">
|
|
78
|
-
.logo {
|
|
79
|
-
height: 100px;
|
|
80
|
-
padding-top: 30px;
|
|
81
|
-
margin-bottom: 20px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.varlet-home__title {
|
|
85
|
-
margin: 0 0 16px;
|
|
86
|
-
font-size: 34px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.varlet-home__title,
|
|
90
|
-
.varlet-home__desc {
|
|
91
|
-
padding: 0 12px;
|
|
92
|
-
font-weight: normal;
|
|
93
|
-
line-height: 1;
|
|
94
|
-
user-select: none;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.varlet-home__desc {
|
|
98
|
-
margin: 0 0 40px;
|
|
99
|
-
color: var(--site-config-color-sub-text);
|
|
100
|
-
font-size: 14px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.varlet-home__image {
|
|
104
|
-
width: 36px;
|
|
105
|
-
height: 36px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.varlet-home__image,
|
|
109
|
-
.varlet-home__title span {
|
|
110
|
-
display: inline-block;
|
|
111
|
-
vertical-align: middle;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.varlet-home__title span {
|
|
115
|
-
margin-left: 16px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.varlet-home__cell {
|
|
119
|
-
display: flex;
|
|
120
|
-
align-items: center;
|
|
121
|
-
justify-content: space-between;
|
|
122
|
-
min-height: 40px;
|
|
123
|
-
padding: 10px 12px;
|
|
124
|
-
font-size: 15px;
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
127
|
-
transition: all 0.3s;
|
|
128
|
-
color: var(--site-config-color-text);
|
|
129
|
-
|
|
130
|
-
&:hover {
|
|
131
|
-
color: var(--site-config-color-mobile-cell-hover);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="logo">
|
|
3
|
+
<h1 class="varlet-home__title">
|
|
4
|
+
<img class="varlet-home__image" :src="logo" />
|
|
5
|
+
<span>{{ title }}</span>
|
|
6
|
+
</h1>
|
|
7
|
+
<h2 class="varlet-home__desc">{{ description[lang] }}</h2>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
class="varlet-home__cell"
|
|
12
|
+
v-for="component in components"
|
|
13
|
+
:key="component.text"
|
|
14
|
+
v-ripple
|
|
15
|
+
@click="toComponent(component)"
|
|
16
|
+
>
|
|
17
|
+
<span>{{ component.text[lang] }}</span>
|
|
18
|
+
<var-icon name="chevron-right" size="14" />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang='ts'>
|
|
23
|
+
import config from '@config'
|
|
24
|
+
import { useRouter } from 'vue-router'
|
|
25
|
+
import { reactive, ref } from 'vue'
|
|
26
|
+
import { inIframe, isPhone, watchLang, watchPlatform } from '../../utils'
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'AppHome',
|
|
30
|
+
setup() {
|
|
31
|
+
const title = ref(config?.title ?? '')
|
|
32
|
+
const logo = ref(config?.logo ?? '')
|
|
33
|
+
const description = ref(config?.mobile?.title ?? {})
|
|
34
|
+
const menu = ref(config?.pc?.menu ?? [])
|
|
35
|
+
const configComponents = menu.value.filter((item: any) => item.type === 2)
|
|
36
|
+
const components = reactive(configComponents)
|
|
37
|
+
const lang = ref('zh-CN')
|
|
38
|
+
const platform = ref('mobile')
|
|
39
|
+
const router = useRouter()
|
|
40
|
+
|
|
41
|
+
watchLang((newValue) => {
|
|
42
|
+
lang.value = newValue
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
watchPlatform((newValue) => {
|
|
46
|
+
platform.value = newValue
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const toComponent = (component: any) => {
|
|
50
|
+
router.push({
|
|
51
|
+
path: `/${component.doc}`,
|
|
52
|
+
query: {
|
|
53
|
+
language: lang.value,
|
|
54
|
+
platform: platform.value,
|
|
55
|
+
replace: component.doc
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
if (!isPhone() && inIframe()) {
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
window.top.scrollToMenu(component.doc)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
components,
|
|
67
|
+
lang,
|
|
68
|
+
toComponent,
|
|
69
|
+
logo,
|
|
70
|
+
title,
|
|
71
|
+
description,
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped lang="less">
|
|
78
|
+
.logo {
|
|
79
|
+
height: 100px;
|
|
80
|
+
padding-top: 30px;
|
|
81
|
+
margin-bottom: 20px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.varlet-home__title {
|
|
85
|
+
margin: 0 0 16px;
|
|
86
|
+
font-size: 34px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.varlet-home__title,
|
|
90
|
+
.varlet-home__desc {
|
|
91
|
+
padding: 0 12px;
|
|
92
|
+
font-weight: normal;
|
|
93
|
+
line-height: 1;
|
|
94
|
+
user-select: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.varlet-home__desc {
|
|
98
|
+
margin: 0 0 40px;
|
|
99
|
+
color: var(--site-config-color-sub-text);
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.varlet-home__image {
|
|
104
|
+
width: 36px;
|
|
105
|
+
height: 36px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.varlet-home__image,
|
|
109
|
+
.varlet-home__title span {
|
|
110
|
+
display: inline-block;
|
|
111
|
+
vertical-align: middle;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.varlet-home__title span {
|
|
115
|
+
margin-left: 16px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.varlet-home__cell {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: space-between;
|
|
122
|
+
min-height: 40px;
|
|
123
|
+
padding: 10px 12px;
|
|
124
|
+
font-size: 15px;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
127
|
+
transition: all 0.3s;
|
|
128
|
+
color: var(--site-config-color-text);
|
|
129
|
+
|
|
130
|
+
&:hover {
|
|
131
|
+
color: var(--site-config-color-mobile-cell-hover);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="app-type">
|
|
3
|
-
<slot />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import { defineComponent } from 'vue'
|
|
9
|
-
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
name: 'AppType',
|
|
12
|
-
})
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style lang="less">
|
|
16
|
-
.app-type {
|
|
17
|
-
width: 100%;
|
|
18
|
-
padding: 15px 0;
|
|
19
|
-
color: var(--site-config-color-sub-text);
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-type">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { defineComponent } from 'vue'
|
|
9
|
+
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
name: 'AppType',
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="less">
|
|
16
|
+
.app-type {
|
|
17
|
+
width: 100%;
|
|
18
|
+
padding: 15px 0;
|
|
19
|
+
color: var(--site-config-color-sub-text);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="classes(n(), [elevation, 'var-site-elevation--3'])"
|
|
4
|
-
:style="{
|
|
5
|
-
background: color,
|
|
6
|
-
color: textColor,
|
|
7
|
-
}"
|
|
8
|
-
>
|
|
9
|
-
<div :class="n('left')">
|
|
10
|
-
<slot name="left" />
|
|
11
|
-
<div :class="n('title')" :style="{ paddingLeft }" v-if="titlePosition === 'left'">
|
|
12
|
-
<slot>{{ title }}</slot>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div :class="n('title')" v-if="titlePosition === 'center'">
|
|
17
|
-
<slot>{{ title }}</slot>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div :class="n('right')">
|
|
21
|
-
<div :class="n('title')" :style="{ paddingRight }" v-if="titlePosition === 'right'">
|
|
22
|
-
<slot>{{ title }}</slot>
|
|
23
|
-
</div>
|
|
24
|
-
<slot name="right" />
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script lang="ts">
|
|
30
|
-
import { defineComponent, ref, Ref, onMounted, onUpdated } from 'vue'
|
|
31
|
-
import { props } from './props'
|
|
32
|
-
import { createNamespace } from '../../../components/utils/components'
|
|
33
|
-
|
|
34
|
-
const { n, classes } = createNamespace('app-bar')
|
|
35
|
-
|
|
36
|
-
export default defineComponent({
|
|
37
|
-
name: 'VarAppBar',
|
|
38
|
-
props,
|
|
39
|
-
setup(props, { slots }) {
|
|
40
|
-
const paddingLeft: Ref<number | undefined> = ref()
|
|
41
|
-
const paddingRight: Ref<number | undefined> = ref()
|
|
42
|
-
|
|
43
|
-
const computePadding = () => {
|
|
44
|
-
paddingLeft.value = slots.left ? 0 : undefined
|
|
45
|
-
paddingRight.value = slots.right ? 0 : undefined
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
onMounted(computePadding)
|
|
49
|
-
onUpdated(computePadding)
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
n,
|
|
53
|
-
classes,
|
|
54
|
-
paddingLeft,
|
|
55
|
-
paddingRight,
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<style lang="less">
|
|
62
|
-
@import '../../../components/styles/common';
|
|
63
|
-
@import '../../../components/styles/elevation';
|
|
64
|
-
@import './appBar';
|
|
65
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classes(n(), [elevation, 'var-site-elevation--3'])"
|
|
4
|
+
:style="{
|
|
5
|
+
background: color,
|
|
6
|
+
color: textColor,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<div :class="n('left')">
|
|
10
|
+
<slot name="left" />
|
|
11
|
+
<div :class="n('title')" :style="{ paddingLeft }" v-if="titlePosition === 'left'">
|
|
12
|
+
<slot>{{ title }}</slot>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div :class="n('title')" v-if="titlePosition === 'center'">
|
|
17
|
+
<slot>{{ title }}</slot>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div :class="n('right')">
|
|
21
|
+
<div :class="n('title')" :style="{ paddingRight }" v-if="titlePosition === 'right'">
|
|
22
|
+
<slot>{{ title }}</slot>
|
|
23
|
+
</div>
|
|
24
|
+
<slot name="right" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
import { defineComponent, ref, Ref, onMounted, onUpdated } from 'vue'
|
|
31
|
+
import { props } from './props'
|
|
32
|
+
import { createNamespace } from '../../../components/utils/components'
|
|
33
|
+
|
|
34
|
+
const { n, classes } = createNamespace('app-bar')
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
name: 'VarAppBar',
|
|
38
|
+
props,
|
|
39
|
+
setup(props, { slots }) {
|
|
40
|
+
const paddingLeft: Ref<number | undefined> = ref()
|
|
41
|
+
const paddingRight: Ref<number | undefined> = ref()
|
|
42
|
+
|
|
43
|
+
const computePadding = () => {
|
|
44
|
+
paddingLeft.value = slots.left ? 0 : undefined
|
|
45
|
+
paddingRight.value = slots.right ? 0 : undefined
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onMounted(computePadding)
|
|
49
|
+
onUpdated(computePadding)
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
n,
|
|
53
|
+
classes,
|
|
54
|
+
paddingLeft,
|
|
55
|
+
paddingRight,
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="less">
|
|
62
|
+
@import '../../../components/styles/common';
|
|
63
|
+
@import '../../../components/styles/elevation';
|
|
64
|
+
@import './appBar';
|
|
65
|
+
</style>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
@site-app-bar-color: var(--site-color-primary);
|
|
2
|
-
@site-app-bar-height: 54px;
|
|
3
|
-
@site-app-bar-text-color: #fff;
|
|
4
|
-
@site-app-bar-title-padding: 0 12px;
|
|
5
|
-
@site-app-bar-left-gap: 6px;
|
|
6
|
-
@site-app-bar-right-gap: 6px;
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
--site-app-bar-color: @site-app-bar-color;
|
|
10
|
-
--site-app-bar-title-padding: @site-app-bar-title-padding;
|
|
11
|
-
--site-app-bar-text-color: #fff;
|
|
12
|
-
--site-app-bar-height: @site-app-bar-height;
|
|
13
|
-
--site-app-bar-left-gap: @site-app-bar-left-gap;
|
|
14
|
-
--site-app-bar-right-gap: @site-app-bar-right-gap;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.var-site-app-bar {
|
|
18
|
-
position: relative;
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 100%;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
height: var(--site-app-bar-height);
|
|
24
|
-
background: var(--site-app-bar-color);
|
|
25
|
-
color: var(--site-app-bar-text-color);
|
|
26
|
-
transition: background-color 0.25s;
|
|
27
|
-
|
|
28
|
-
&__title {
|
|
29
|
-
flex: 1;
|
|
30
|
-
display: flex;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
white-space: nowrap;
|
|
33
|
-
text-overflow: ellipsis;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
padding: var(--site-app-bar-title-padding);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&__left,
|
|
39
|
-
&__right {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
height: 100%;
|
|
43
|
-
z-index: 2;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&__left {
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 0;
|
|
49
|
-
left: var(--site-app-bar-left-gap);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&__right {
|
|
53
|
-
position: absolute;
|
|
54
|
-
top: 0;
|
|
55
|
-
right: var(--site-app-bar-right-gap);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
@site-app-bar-color: var(--site-color-primary);
|
|
2
|
+
@site-app-bar-height: 54px;
|
|
3
|
+
@site-app-bar-text-color: #fff;
|
|
4
|
+
@site-app-bar-title-padding: 0 12px;
|
|
5
|
+
@site-app-bar-left-gap: 6px;
|
|
6
|
+
@site-app-bar-right-gap: 6px;
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
--site-app-bar-color: @site-app-bar-color;
|
|
10
|
+
--site-app-bar-title-padding: @site-app-bar-title-padding;
|
|
11
|
+
--site-app-bar-text-color: #fff;
|
|
12
|
+
--site-app-bar-height: @site-app-bar-height;
|
|
13
|
+
--site-app-bar-left-gap: @site-app-bar-left-gap;
|
|
14
|
+
--site-app-bar-right-gap: @site-app-bar-right-gap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.var-site-app-bar {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: flex;
|
|
20
|
+
width: 100%;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
height: var(--site-app-bar-height);
|
|
24
|
+
background: var(--site-app-bar-color);
|
|
25
|
+
color: var(--site-app-bar-text-color);
|
|
26
|
+
transition: background-color 0.25s;
|
|
27
|
+
|
|
28
|
+
&__title {
|
|
29
|
+
flex: 1;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
padding: var(--site-app-bar-title-padding);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__left,
|
|
39
|
+
&__right {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
height: 100%;
|
|
43
|
+
z-index: 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__left {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: var(--site-app-bar-left-gap);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__right {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0;
|
|
55
|
+
right: var(--site-app-bar-right-gap);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { App } from 'vue'
|
|
2
|
-
import AppBar from './AppBar.vue'
|
|
3
|
-
|
|
4
|
-
AppBar.install = function (app: App) {
|
|
5
|
-
app.component(AppBar.name, AppBar)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const _AppBarComponent = AppBar
|
|
9
|
-
|
|
10
|
-
export default AppBar
|
|
1
|
+
import type { App } from 'vue'
|
|
2
|
+
import AppBar from './AppBar.vue'
|
|
3
|
+
|
|
4
|
+
AppBar.install = function (app: App) {
|
|
5
|
+
app.component(AppBar.name, AppBar)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const _AppBarComponent = AppBar
|
|
9
|
+
|
|
10
|
+
export default AppBar
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export function positionValidator(position: string): boolean {
|
|
2
|
-
const validPositions = ['left', 'center', 'right']
|
|
3
|
-
return validPositions.includes(position)
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const props = {
|
|
7
|
-
color: {
|
|
8
|
-
type: String,
|
|
9
|
-
},
|
|
10
|
-
textColor: {
|
|
11
|
-
type: String,
|
|
12
|
-
},
|
|
13
|
-
title: {
|
|
14
|
-
type: String,
|
|
15
|
-
},
|
|
16
|
-
titlePosition: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: 'left',
|
|
19
|
-
validator: positionValidator,
|
|
20
|
-
},
|
|
21
|
-
elevation: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: true,
|
|
24
|
-
},
|
|
25
|
-
}
|
|
1
|
+
export function positionValidator(position: string): boolean {
|
|
2
|
+
const validPositions = ['left', 'center', 'right']
|
|
3
|
+
return validPositions.includes(position)
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const props = {
|
|
7
|
+
color: {
|
|
8
|
+
type: String,
|
|
9
|
+
},
|
|
10
|
+
textColor: {
|
|
11
|
+
type: String,
|
|
12
|
+
},
|
|
13
|
+
title: {
|
|
14
|
+
type: String,
|
|
15
|
+
},
|
|
16
|
+
titlePosition: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'left',
|
|
19
|
+
validator: positionValidator,
|
|
20
|
+
},
|
|
21
|
+
elevation: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true,
|
|
24
|
+
},
|
|
25
|
+
}
|