@varlet/ui 1.27.16 → 1.27.17-alpha.1656907860130
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/CHANGELOG.md +1885 -1885
- package/LICENCE +21 -21
- package/README.en-US.md +93 -93
- package/README.md +93 -93
- package/es/index.d.ts +1 -1
- package/es/select/Select.js +12 -6
- package/es/select/select.css +1 -1
- package/es/select/select.less +184 -183
- package/es/snackbar/snackbar.less +129 -129
- package/es/style.css +1 -1
- package/es/varlet.esm.js +8 -6
- package/highlight/attributes.json +1 -1850
- package/highlight/tags.json +58 -578
- package/highlight/web-types.json +152 -5237
- package/lib/index.d.ts +1 -1
- package/lib/select/Select.js +11 -5
- package/lib/select/select.css +1 -1
- package/lib/select/select.less +184 -183
- package/lib/snackbar/snackbar.less +129 -129
- package/lib/snackbar/style/index.js +1 -1
- package/lib/snackbar/style/less.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +6 -7
- package/types/button.d.ts +27 -27
- package/types/card.d.ts +29 -29
- package/types/cell.d.ts +18 -18
- package/types/global.d.ts +68 -68
- package/types/icon.d.ts +16 -16
- package/types/index.d.ts +68 -68
- package/types/list.d.ts +21 -21
- package/types/switch.d.ts +25 -25
- package/types/varComponent.d.ts +12 -12
- package/umd/varlet.js +4 -4
package/LICENCE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 varlet
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 varlet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en-US.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<a href="https://varlet-varletjs.vercel.app/#/en-US/home">
|
|
3
|
-
<img src="https://varlet-varletjs.vercel.app/logo.svg" width="150">
|
|
4
|
-
</a>
|
|
5
|
-
<h1>VARLET</h1>
|
|
6
|
-
<p>Material design mobile component library for Vue3</p>
|
|
7
|
-
<p>
|
|
8
|
-
<a href="https://varlet-varletjs.vercel.app/#/en-US/home">Documentation(Vercel)</a>
|
|
9
|
-
<a href="https://varlet.gitee.io/varlet-ui/#/en-US/home">Documentation(Gitee)</a>
|
|
10
|
-
</p>
|
|
11
|
-
<p>
|
|
12
|
-
<img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
|
|
13
|
-
<img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
|
|
14
|
-
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
15
|
-
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
16
|
-
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
17
|
-
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
18
|
-
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
19
|
-
</p>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
### Intro
|
|
25
|
-
|
|
26
|
-
Varlet is a Material design mobile component library developed based on `Vue3`, developed and maintained by partners in the community.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Features
|
|
30
|
-
- 🚀 Provide 50+ high quality general purpose components
|
|
31
|
-
- 🚀 Components are very lightweight
|
|
32
|
-
- 💪 Developed by Chinese, complete Chinese and English documentation and logistics support
|
|
33
|
-
- 🛠️ Support on-demand introduction
|
|
34
|
-
- 🛠️ Support theme customization
|
|
35
|
-
- 🌍 Support internationalization
|
|
36
|
-
- 💡 Support WebStorm, VS Code component syntax highlighting
|
|
37
|
-
- 💪 Support the SSR
|
|
38
|
-
- 💡 Support the Typescript
|
|
39
|
-
- 💪 Make sure more than 90 percent unit test coverage, providing stability assurance
|
|
40
|
-
- 🛠️ Support dark mode
|
|
41
|
-
|
|
42
|
-
### Install
|
|
43
|
-
|
|
44
|
-
### CDN
|
|
45
|
-
`varlet.js` contain all the styles and logic of the component library, and you can import them.
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<div id="app"></div>
|
|
49
|
-
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
|
50
|
-
<script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
|
|
51
|
-
<script>
|
|
52
|
-
const app = Vue.createApp({
|
|
53
|
-
template: '<var-button>Button</var-button>'
|
|
54
|
-
})
|
|
55
|
-
app.use(Varlet).mount('#app')
|
|
56
|
-
</script>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Webpack / Vite
|
|
60
|
-
```shell
|
|
61
|
-
# Install with npm or yarn or pnpm
|
|
62
|
-
|
|
63
|
-
# npm
|
|
64
|
-
npm i @varlet/ui -S
|
|
65
|
-
|
|
66
|
-
# yarn
|
|
67
|
-
yarn add @varlet/ui
|
|
68
|
-
|
|
69
|
-
# pnpm
|
|
70
|
-
pnpm add @varlet/ui
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
```js
|
|
74
|
-
import App from './App.vue'
|
|
75
|
-
import Varlet from '@varlet/ui'
|
|
76
|
-
import { createApp } from 'vue'
|
|
77
|
-
import '@varlet/ui/es/style.js'
|
|
78
|
-
|
|
79
|
-
createApp(App).use(Varlet).mount('#app')
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Sponsorship us
|
|
83
|
-
|
|
84
|
-
We will use the donations to encourage open source contributors, buy them a cup of coffee and milk tea,
|
|
85
|
-
purchase infrastructure that is helpful to the project, and promote the project to become better.
|
|
86
|
-
|
|
87
|
-
<img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/wechat.png?raw=true" />
|
|
88
|
-
|
|
89
|
-
### Contributors
|
|
90
|
-
|
|
91
|
-
<a href="https://github.com/varletjs/varlet/graphs/contributors">
|
|
92
|
-
<img src="https://contrib.rocks/image?repo=haoziqaq/varlet" />
|
|
93
|
-
</a>
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://varlet-varletjs.vercel.app/#/en-US/home">
|
|
3
|
+
<img src="https://varlet-varletjs.vercel.app/logo.svg" width="150">
|
|
4
|
+
</a>
|
|
5
|
+
<h1>VARLET</h1>
|
|
6
|
+
<p>Material design mobile component library for Vue3</p>
|
|
7
|
+
<p>
|
|
8
|
+
<a href="https://varlet-varletjs.vercel.app/#/en-US/home">Documentation(Vercel)</a>
|
|
9
|
+
<a href="https://varlet.gitee.io/varlet-ui/#/en-US/home">Documentation(Gitee)</a>
|
|
10
|
+
</p>
|
|
11
|
+
<p>
|
|
12
|
+
<img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
|
|
13
|
+
<img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
|
|
14
|
+
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
15
|
+
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
16
|
+
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
17
|
+
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
18
|
+
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### Intro
|
|
25
|
+
|
|
26
|
+
Varlet is a Material design mobile component library developed based on `Vue3`, developed and maintained by partners in the community.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
- 🚀 Provide 50+ high quality general purpose components
|
|
31
|
+
- 🚀 Components are very lightweight
|
|
32
|
+
- 💪 Developed by Chinese, complete Chinese and English documentation and logistics support
|
|
33
|
+
- 🛠️ Support on-demand introduction
|
|
34
|
+
- 🛠️ Support theme customization
|
|
35
|
+
- 🌍 Support internationalization
|
|
36
|
+
- 💡 Support WebStorm, VS Code component syntax highlighting
|
|
37
|
+
- 💪 Support the SSR
|
|
38
|
+
- 💡 Support the Typescript
|
|
39
|
+
- 💪 Make sure more than 90 percent unit test coverage, providing stability assurance
|
|
40
|
+
- 🛠️ Support dark mode
|
|
41
|
+
|
|
42
|
+
### Install
|
|
43
|
+
|
|
44
|
+
### CDN
|
|
45
|
+
`varlet.js` contain all the styles and logic of the component library, and you can import them.
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<div id="app"></div>
|
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
|
|
51
|
+
<script>
|
|
52
|
+
const app = Vue.createApp({
|
|
53
|
+
template: '<var-button>Button</var-button>'
|
|
54
|
+
})
|
|
55
|
+
app.use(Varlet).mount('#app')
|
|
56
|
+
</script>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Webpack / Vite
|
|
60
|
+
```shell
|
|
61
|
+
# Install with npm or yarn or pnpm
|
|
62
|
+
|
|
63
|
+
# npm
|
|
64
|
+
npm i @varlet/ui -S
|
|
65
|
+
|
|
66
|
+
# yarn
|
|
67
|
+
yarn add @varlet/ui
|
|
68
|
+
|
|
69
|
+
# pnpm
|
|
70
|
+
pnpm add @varlet/ui
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import App from './App.vue'
|
|
75
|
+
import Varlet from '@varlet/ui'
|
|
76
|
+
import { createApp } from 'vue'
|
|
77
|
+
import '@varlet/ui/es/style.js'
|
|
78
|
+
|
|
79
|
+
createApp(App).use(Varlet).mount('#app')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Sponsorship us
|
|
83
|
+
|
|
84
|
+
We will use the donations to encourage open source contributors, buy them a cup of coffee and milk tea,
|
|
85
|
+
purchase infrastructure that is helpful to the project, and promote the project to become better.
|
|
86
|
+
|
|
87
|
+
<img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/wechat.png?raw=true" />
|
|
88
|
+
|
|
89
|
+
### Contributors
|
|
90
|
+
|
|
91
|
+
<a href="https://github.com/varletjs/varlet/graphs/contributors">
|
|
92
|
+
<img src="https://contrib.rocks/image?repo=haoziqaq/varlet" />
|
|
93
|
+
</a>
|
package/README.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<a href="https://varlet-varletjs.vercel.app">
|
|
3
|
-
<img src="https://varlet-varletjs.vercel.app/logo.svg" width="150" >
|
|
4
|
-
</a>
|
|
5
|
-
<h1>VARLET</h1>
|
|
6
|
-
<p>基于 Vue3 的 Material design 风格移动端组件库</p>
|
|
7
|
-
<p>
|
|
8
|
-
<a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
|
|
9
|
-
<a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
|
|
10
|
-
<a href="https://github.com/varletjs/varlet/blob/dev/README.en-US.md">English Readme</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p>
|
|
13
|
-
<img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
|
|
14
|
-
<img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
|
|
15
|
-
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
16
|
-
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
17
|
-
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
18
|
-
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
19
|
-
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
### 介绍
|
|
26
|
-
|
|
27
|
-
Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全面拥抱 `Vue3` 生态,由社区建立起来的组件库团队进行维护。
|
|
28
|
-
|
|
29
|
-
### 特性
|
|
30
|
-
- 🚀 提供50+个高质量通用组件
|
|
31
|
-
- 🚀 组件十分轻量
|
|
32
|
-
- 💪 由国人开发,完善的中英文文档和后勤保障
|
|
33
|
-
- 🛠️ 支持按需引入
|
|
34
|
-
- 🛠️ 支持主题定制
|
|
35
|
-
- 🌍 支持国际化
|
|
36
|
-
- 💡 支持 webstorm,vscode 组件属性高亮
|
|
37
|
-
- 💪 支持 SSR
|
|
38
|
-
- 💡 支持 Typescript
|
|
39
|
-
- 💪 确保90%以上单元测试覆盖率,提供稳定性保证
|
|
40
|
-
- 🛠️ 支持暗黑模式
|
|
41
|
-
|
|
42
|
-
### 安装
|
|
43
|
-
|
|
44
|
-
### CDN
|
|
45
|
-
`varlet.js` 包含组件库的所有样式和逻辑,引入即可。
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<div id="app"></div>
|
|
49
|
-
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
|
50
|
-
<script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
|
|
51
|
-
<script>
|
|
52
|
-
const app = Vue.createApp({
|
|
53
|
-
template: '<var-button>按钮</var-button>'
|
|
54
|
-
})
|
|
55
|
-
app.use(Varlet).mount('#app')
|
|
56
|
-
</script>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Webpack / Vite
|
|
60
|
-
```shell
|
|
61
|
-
# 通过 npm 或 yarn 或 pnpm 安装
|
|
62
|
-
|
|
63
|
-
# npm
|
|
64
|
-
npm i @varlet/ui -S
|
|
65
|
-
|
|
66
|
-
# yarn
|
|
67
|
-
yarn add @varlet/ui
|
|
68
|
-
|
|
69
|
-
# pnpm
|
|
70
|
-
pnpm add @varlet/ui
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
```js
|
|
74
|
-
import App from './App.vue'
|
|
75
|
-
import Varlet from '@varlet/ui'
|
|
76
|
-
import { createApp } from 'vue'
|
|
77
|
-
import '@varlet/ui/es/style.js'
|
|
78
|
-
|
|
79
|
-
createApp(App).use(Varlet).mount('#app')
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 捐赠我们
|
|
83
|
-
|
|
84
|
-
我们将用捐赠所得去鼓励参与开源的贡献者们,给他们买一杯咖啡奶茶,购置对于项目有帮助基础设施,推动项目变得更好。
|
|
85
|
-
|
|
86
|
-
<img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/wechat.png?raw=true" />
|
|
87
|
-
|
|
88
|
-
### Contributors
|
|
89
|
-
|
|
90
|
-
<a href="https://github.com/varletjs/varlet/graphs/contributors">
|
|
91
|
-
<img src="https://contrib.rocks/image?repo=varletjs/varlet" />
|
|
92
|
-
</a>
|
|
93
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://varlet-varletjs.vercel.app">
|
|
3
|
+
<img src="https://varlet-varletjs.vercel.app/logo.svg" width="150" >
|
|
4
|
+
</a>
|
|
5
|
+
<h1>VARLET</h1>
|
|
6
|
+
<p>基于 Vue3 的 Material design 风格移动端组件库</p>
|
|
7
|
+
<p>
|
|
8
|
+
<a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
|
|
9
|
+
<a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
|
|
10
|
+
<a href="https://github.com/varletjs/varlet/blob/dev/README.en-US.md">English Readme</a>
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
|
|
14
|
+
<img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
|
|
15
|
+
<img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
|
|
16
|
+
<img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
|
|
17
|
+
<img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
|
|
18
|
+
<img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
|
|
19
|
+
<img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### 介绍
|
|
26
|
+
|
|
27
|
+
Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全面拥抱 `Vue3` 生态,由社区建立起来的组件库团队进行维护。
|
|
28
|
+
|
|
29
|
+
### 特性
|
|
30
|
+
- 🚀 提供50+个高质量通用组件
|
|
31
|
+
- 🚀 组件十分轻量
|
|
32
|
+
- 💪 由国人开发,完善的中英文文档和后勤保障
|
|
33
|
+
- 🛠️ 支持按需引入
|
|
34
|
+
- 🛠️ 支持主题定制
|
|
35
|
+
- 🌍 支持国际化
|
|
36
|
+
- 💡 支持 webstorm,vscode 组件属性高亮
|
|
37
|
+
- 💪 支持 SSR
|
|
38
|
+
- 💡 支持 Typescript
|
|
39
|
+
- 💪 确保90%以上单元测试覆盖率,提供稳定性保证
|
|
40
|
+
- 🛠️ 支持暗黑模式
|
|
41
|
+
|
|
42
|
+
### 安装
|
|
43
|
+
|
|
44
|
+
### CDN
|
|
45
|
+
`varlet.js` 包含组件库的所有样式和逻辑,引入即可。
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<div id="app"></div>
|
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
|
|
51
|
+
<script>
|
|
52
|
+
const app = Vue.createApp({
|
|
53
|
+
template: '<var-button>按钮</var-button>'
|
|
54
|
+
})
|
|
55
|
+
app.use(Varlet).mount('#app')
|
|
56
|
+
</script>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Webpack / Vite
|
|
60
|
+
```shell
|
|
61
|
+
# 通过 npm 或 yarn 或 pnpm 安装
|
|
62
|
+
|
|
63
|
+
# npm
|
|
64
|
+
npm i @varlet/ui -S
|
|
65
|
+
|
|
66
|
+
# yarn
|
|
67
|
+
yarn add @varlet/ui
|
|
68
|
+
|
|
69
|
+
# pnpm
|
|
70
|
+
pnpm add @varlet/ui
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import App from './App.vue'
|
|
75
|
+
import Varlet from '@varlet/ui'
|
|
76
|
+
import { createApp } from 'vue'
|
|
77
|
+
import '@varlet/ui/es/style.js'
|
|
78
|
+
|
|
79
|
+
createApp(App).use(Varlet).mount('#app')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 捐赠我们
|
|
83
|
+
|
|
84
|
+
我们将用捐赠所得去鼓励参与开源的贡献者们,给他们买一杯咖啡奶茶,购置对于项目有帮助基础设施,推动项目变得更好。
|
|
85
|
+
|
|
86
|
+
<img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/wechat.png?raw=true" />
|
|
87
|
+
|
|
88
|
+
### Contributors
|
|
89
|
+
|
|
90
|
+
<a href="https://github.com/varletjs/varlet/graphs/contributors">
|
|
91
|
+
<img src="https://contrib.rocks/image?repo=varletjs/varlet" />
|
|
92
|
+
</a>
|
|
93
|
+
|
package/es/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '..\types'
|
package/es/select/Select.js
CHANGED
|
@@ -8,7 +8,7 @@ import { props } from './props';
|
|
|
8
8
|
import { useValidation, createNamespace, call } from '../utils/components';
|
|
9
9
|
import { useOptions } from './provide';
|
|
10
10
|
import { useForm } from '../form/provide';
|
|
11
|
-
import { toPxNum } from '../utils/elements';
|
|
11
|
+
import { getTop, toPxNum } from '../utils/elements';
|
|
12
12
|
var {
|
|
13
13
|
n,
|
|
14
14
|
classes
|
|
@@ -457,16 +457,22 @@ export default defineComponent({
|
|
|
457
457
|
var {
|
|
458
458
|
body
|
|
459
459
|
} = document;
|
|
460
|
+
var bodyScrollHeight = body.scrollHeight;
|
|
460
461
|
nextTick(() => {
|
|
461
|
-
var _menuEl$value
|
|
462
|
+
var _menuEl$value;
|
|
462
463
|
|
|
463
464
|
var {
|
|
464
|
-
offsetTop: menuOffsetTop,
|
|
465
465
|
offsetHeight: menuOffsetHeight
|
|
466
466
|
} = (_menuEl$value = menuEl.value) == null ? void 0 : _menuEl$value.parentElement;
|
|
467
|
-
var
|
|
468
|
-
|
|
469
|
-
if (
|
|
467
|
+
var wrapOffsetTop = getTop(wrapEl.value);
|
|
468
|
+
|
|
469
|
+
if (wrapOffsetTop + offsetY.value < 0) {
|
|
470
|
+
offsetY.value = getOffsetY();
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (menuOffsetHeight + wrapOffsetTop + offsetY.value > bodyScrollHeight) {
|
|
474
|
+
offsetY.value -= menuOffsetHeight - getOffsetY();
|
|
475
|
+
}
|
|
470
476
|
});
|
|
471
477
|
};
|
|
472
478
|
|
package/es/select/select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color: var(--color-text-disabled);}.var-select-footer-margin-enter-from,.var-select-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-select-footer-margin-enter-active,.var-select-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-select { width: 100%; color: var(--select-select-text-color);}.var-select__controller { width: 100%; display: flex; position: relative;}.var-select__menu[var-select-cover] { flex-grow: 1; background: transparent;}.var-select__chip[var-select-cover] { margin: var(--select-chip-margin);}.var-select__scroller { max-height: var(--select-scroller-max-height); background: var(--select-scroller-background); padding: var(--select-scroller-padding); overflow-y: auto;}.var-select__wrap { position: relative; display: flex; flex-direction: column; padding-top: var(--select-placeholder-size);}.var-select__icon { display: flex; align-items: center; padding: var(--select-icon-padding); font-size: 20px;}.var-select__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition-property: top, transform, width; transition-duration: 0.3s; transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1); font-size: var(--select-placeholder-size); color: var(--select-blur-color);}.var-select__select { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 32px; padding: var(--select-select-padding); outline: none; border: none; font-size: inherit; color: var(--select-select-text-color); word-break: break-all;}.var-select__arrow[var-select-cover] { flex-shrink: 0; font-size: var(--select-arrow-size);}.var-select__line { width: 100%; height: var(--select-line-size); background: var(--select-blur-color);}.var-select__dot { width: 100%; height: var(--select-line-spread-size); background: var(--select-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier);}.var-select--placeholder-hint { top: 0; width: 133.33%; transform: translate(0, 0) scale(0.75);}.var-select--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-select--non-hint { padding-top: 0;}.var-select--placeholder-hidden { visibility: hidden;}.var-select--focus { color: var(--select-focus-color);}.var-select--spread { transform: scaleX(1);}.var-select--disabled { color: var(--select-disabled-color);}.var-select--error { color: var(--select-error-color);}.var-select--line-disabled { background: var(--select-disabled-color);}.var-select--line-error { background: var(--select-error-color);}.var-select--arrow-rotate { transform: rotate(180deg);}
|
|
1
|
+
:root { --select-select-text-color: #555; --select-select-padding: 5px 0; --select-error-color: var(--color-danger); --select-blur-color: #888; --select-focus-color: var(--color-primary); --select-scroller-background: #fff; --select-scroller-padding: 6px 0; --select-scroller-max-height: 278px; --select-placeholder-size: 16px; --select-icon-padding: 16px 0 0; --select-icon-size: 20px; --select-chip-margin: 5px 5px 0; --select-line-size: 1px; --select-line-spread-size: 2px; --select-arrow-size: 20px; --select-disabled-color: var(--color-text-disabled);}.var-select-footer-margin-enter-from,.var-select-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-select-footer-margin-enter-active,.var-select-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-select { width: 100%; color: var(--select-select-text-color);}.var-select__controller { width: 100%; display: flex; position: relative;}.var-select__menu[var-select-cover] { flex-grow: 1; background: transparent;}.var-select__chip[var-select-cover] { margin: var(--select-chip-margin);}.var-select__scroller { max-height: var(--select-scroller-max-height); background: var(--select-scroller-background); padding: var(--select-scroller-padding); overflow-y: auto;}.var-select__wrap { position: relative; display: flex; flex-direction: column; padding-top: var(--select-placeholder-size);}.var-select__icon { display: flex; align-items: center; padding: var(--select-icon-padding); font-size: 20px;}.var-select__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition-property: top, transform, width; transition-duration: 0.3s; transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1); font-size: var(--select-placeholder-size); color: var(--select-blur-color);}.var-select__select { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 32px; padding: var(--select-select-padding); outline: none; border: none; font-size: inherit; color: var(--select-select-text-color); word-break: break-all; overflow-x: hidden;}.var-select__arrow[var-select-cover] { flex-shrink: 0; font-size: var(--select-arrow-size);}.var-select__line { width: 100%; height: var(--select-line-size); background: var(--select-blur-color);}.var-select__dot { width: 100%; height: var(--select-line-spread-size); background: var(--select-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier);}.var-select--placeholder-hint { top: 0; width: 133.33%; transform: translate(0, 0) scale(0.75);}.var-select--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-select--non-hint { padding-top: 0;}.var-select--placeholder-hidden { visibility: hidden;}.var-select--focus { color: var(--select-focus-color);}.var-select--spread { transform: scaleX(1);}.var-select--disabled { color: var(--select-disabled-color);}.var-select--error { color: var(--select-error-color);}.var-select--line-disabled { background: var(--select-disabled-color);}.var-select--line-error { background: var(--select-error-color);}.var-select--arrow-rotate { transform: rotate(180deg);}
|