@varlet/ui 3.2.3 → 3.2.5
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/README.md +5 -3
- package/README.zh-CN.md +5 -3
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/avatar-group/AvatarGroup.mjs +1 -2
- package/es/breadcrumb/Breadcrumb.mjs +2 -1
- package/es/breadcrumbs/Breadcrumbs.mjs +3 -1
- package/es/collapse/Collapse.mjs +2 -0
- package/es/collapse-item/CollapseItem.mjs +53 -53
- package/es/collapse-item/collapseItem.css +1 -1
- package/es/date-picker/src/year-picker-panel.mjs +10 -18
- package/es/divider/Divider.mjs +2 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.mjs +0 -1
- package/es/menu/usePopover.mjs +2 -3
- package/es/popup/Popup.mjs +3 -1
- package/es/progress/Progress.mjs +187 -185
- package/es/slider/Slider.mjs +19 -23
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +1 -0
- package/es/swipe-item/SwipeItem.mjs +18 -18
- package/es/switch/Switch.mjs +77 -80
- package/es/time-picker/clock.mjs +3 -5
- package/es/tooltip/Tooltip.mjs +2 -1
- package/es/varlet.esm.js +4176 -4177
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +411 -421
- package/package.json +7 -7
- package/umd/varlet.js +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
|
|
4
4
|
</a>
|
|
5
5
|
<h1>VARLET</h1>
|
|
6
|
-
<p>
|
|
6
|
+
<p>A mobile component library based on Vue3, Material Design 2, Material Design 3, and supports desktop development.</p>
|
|
7
7
|
<p>
|
|
8
8
|
<a href="https://varlet-varletjs.vercel.app/#/en-US/index">Documentation(Vercel)</a> |
|
|
9
9
|
<a href="https://varlet.gitee.io/varlet-ui/#/en-US/index">Documentation(Gitee)</a> |
|
|
@@ -36,11 +36,13 @@ Varlet is a Material design mobile component library developed based on `Vue3`,
|
|
|
36
36
|
- 🌍 Support internationalization
|
|
37
37
|
- 💡 Support WebStorm syntax highlighting
|
|
38
38
|
- 💪 Support the SSR
|
|
39
|
+
- 📦 Support [Nuxt Module](https://github.com/varletjs/varlet-nuxt)
|
|
39
40
|
- 💡 Support the Typescript
|
|
40
41
|
- 💪 Make sure more than 90 percent unit test coverage, providing stability assurance
|
|
41
|
-
-
|
|
42
|
+
- 🎨 Supports both Material Design 2 and Material Design 3 design systems
|
|
42
43
|
- 🛠️ Support dark mode
|
|
43
|
-
-
|
|
44
|
+
- 🔧 Provide official VSCode extension
|
|
45
|
+
- ⌨️ Support Accessibility (still improving)
|
|
44
46
|
|
|
45
47
|
### Install
|
|
46
48
|
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
|
|
5
5
|
</a>
|
|
6
6
|
<h1>VARLET</h1>
|
|
7
|
-
<p
|
|
7
|
+
<p>一个移动端组件库,基于 Vue3, Material Design 2, Material Design 3,并支持桌面端开发。</p>
|
|
8
8
|
<p>
|
|
9
9
|
<a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
|
|
10
10
|
<a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
|
|
@@ -36,11 +36,13 @@ Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全
|
|
|
36
36
|
- 🌍 支持国际化
|
|
37
37
|
- 💡 支持 webstorm 组件属性高亮
|
|
38
38
|
- 💪 支持 SSR
|
|
39
|
+
- 📦 支持 [Nuxt Module](https://github.com/varletjs/varlet-nuxt)
|
|
39
40
|
- 💡 支持 Typescript
|
|
40
41
|
- 💪 确保 90% 以上单元测试覆盖率,提供稳定性保证
|
|
41
|
-
-
|
|
42
|
+
- 🎨 同时支持 Material Design 2 和 Material Design 3 两套设计系统
|
|
42
43
|
- 🛠️ 支持暗黑模式
|
|
43
|
-
-
|
|
44
|
+
- 🔧 提供官方的 VSCode 插件
|
|
45
|
+
- ⌨️ 支持无障碍访问(持续改进中)
|
|
44
46
|
|
|
45
47
|
### 安装
|
|
46
48
|
|
|
@@ -30,7 +30,8 @@ function __render__(_ctx, _cache) {
|
|
|
30
30
|
_createElementVNode(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
|
-
class: _normalizeClass(_ctx.n("separator"))
|
|
33
|
+
class: _normalizeClass(_ctx.n("separator")),
|
|
34
|
+
"aria-hidden": "true"
|
|
34
35
|
},
|
|
35
36
|
_toDisplayString((_a = _ctx.separator) != null ? _a : _ctx.parentSeparator),
|
|
36
37
|
3
|
|
@@ -8,7 +8,9 @@ function __render__(_ctx, _cache) {
|
|
|
8
8
|
return _openBlock(), _createElementBlock(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
class: _normalizeClass(_ctx.n())
|
|
11
|
+
class: _normalizeClass(_ctx.n()),
|
|
12
|
+
role: "navigation",
|
|
13
|
+
"aria-label": "Breadcrumbs"
|
|
12
14
|
},
|
|
13
15
|
[
|
|
14
16
|
_renderSlot(_ctx.$slots, "default")
|
package/es/collapse/Collapse.mjs
CHANGED
|
@@ -25,12 +25,14 @@ const __sfc__ = defineComponent({
|
|
|
25
25
|
const offset = computed(() => props2.offset);
|
|
26
26
|
const divider = computed(() => props2.divider);
|
|
27
27
|
const elevation = computed(() => props2.elevation);
|
|
28
|
+
const accordion = computed(() => props2.accordion);
|
|
28
29
|
const normalizeValues = computed(() => normalizeToArray(props2.modelValue));
|
|
29
30
|
const { length, collapseItems, bindCollapseItems } = useCollapseItem();
|
|
30
31
|
const collapseProvider = {
|
|
31
32
|
offset,
|
|
32
33
|
divider,
|
|
33
34
|
elevation,
|
|
35
|
+
accordion,
|
|
34
36
|
updateItem
|
|
35
37
|
};
|
|
36
38
|
watch(
|
|
@@ -5,7 +5,9 @@ import { useCollapse } from "./provide.mjs";
|
|
|
5
5
|
import { props } from "./props.mjs";
|
|
6
6
|
import { useCollapseTransition } from "../collapse-transition/useCollapseTransition.mjs";
|
|
7
7
|
const { name, n, classes } = createNamespace("collapse-item");
|
|
8
|
-
import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle } from "vue";
|
|
8
|
+
import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
|
+
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
10
|
+
const _hoisted_1 = ["aria-expanded", "aria-disabled", "role"];
|
|
9
11
|
function __render__(_ctx, _cache) {
|
|
10
12
|
const _component_var_icon = _resolveComponent("var-icon");
|
|
11
13
|
return _openBlock(), _createElementBlock(
|
|
@@ -24,58 +26,55 @@ function __render__(_ctx, _cache) {
|
|
|
24
26
|
2
|
|
25
27
|
/* CLASS */
|
|
26
28
|
),
|
|
27
|
-
_createElementVNode(
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
29
|
+
_createElementVNode("div", {
|
|
30
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("header"), [!_ctx.disabled, _ctx.n("header--cursor-pointer")])),
|
|
31
|
+
"aria-expanded": _ctx.isShow,
|
|
32
|
+
"aria-disabled": _ctx.disabled,
|
|
33
|
+
role: _ctx.accordion ? "tab" : "button",
|
|
34
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.toggle && _ctx.toggle(...args))
|
|
35
|
+
}, [
|
|
36
|
+
_ctx.$slots.title || _ctx.title ? (_openBlock(), _createElementBlock(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
key: 0,
|
|
40
|
+
class: _normalizeClass(_ctx.n("header-title"))
|
|
41
|
+
},
|
|
42
|
+
[
|
|
43
|
+
_renderSlot(_ctx.$slots, "title", {}, () => [
|
|
44
|
+
_createTextVNode(
|
|
45
|
+
_toDisplayString(_ctx.title),
|
|
46
|
+
1
|
|
47
|
+
/* TEXT */
|
|
48
|
+
)
|
|
49
|
+
])
|
|
50
|
+
],
|
|
51
|
+
2
|
|
52
|
+
/* CLASS */
|
|
53
|
+
)) : _createCommentVNode("v-if", true),
|
|
54
|
+
_createElementVNode(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
class: _normalizeClass(_ctx.n("header-icon"))
|
|
58
|
+
},
|
|
59
|
+
[
|
|
60
|
+
_renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
61
|
+
_createVNode(_component_var_icon, {
|
|
62
|
+
name: _ctx.icon,
|
|
63
|
+
transition: 250,
|
|
64
|
+
class: _normalizeClass(
|
|
65
|
+
_ctx.classes(
|
|
66
|
+
_ctx.n("header-icon"),
|
|
67
|
+
[_ctx.isShow && _ctx.icon === "chevron-down", _ctx.n("header-open")],
|
|
68
|
+
[_ctx.disabled, _ctx.n("header--disable")]
|
|
68
69
|
)
|
|
69
|
-
|
|
70
|
-
])
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/* CLASS */
|
|
78
|
-
),
|
|
70
|
+
)
|
|
71
|
+
}, null, 8, ["name", "class"])
|
|
72
|
+
])
|
|
73
|
+
],
|
|
74
|
+
2
|
|
75
|
+
/* CLASS */
|
|
76
|
+
)
|
|
77
|
+
], 10, _hoisted_1),
|
|
79
78
|
_withDirectives(_createElementVNode(
|
|
80
79
|
"div",
|
|
81
80
|
{
|
|
@@ -120,7 +119,7 @@ const __sfc__ = defineComponent({
|
|
|
120
119
|
const name2 = computed(() => props2.name);
|
|
121
120
|
const disabled = computed(() => props2.disabled);
|
|
122
121
|
const { index, collapse, bindCollapse } = useCollapse();
|
|
123
|
-
const { offset, divider, elevation, updateItem } = collapse;
|
|
122
|
+
const { offset, divider, elevation, accordion, updateItem } = collapse;
|
|
124
123
|
const collapseItemProvider = {
|
|
125
124
|
index,
|
|
126
125
|
name: name2,
|
|
@@ -150,6 +149,7 @@ const __sfc__ = defineComponent({
|
|
|
150
149
|
divider,
|
|
151
150
|
elevation,
|
|
152
151
|
contentEl,
|
|
152
|
+
accordion,
|
|
153
153
|
n,
|
|
154
154
|
classes,
|
|
155
155
|
toggle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --collapse-background: var(--color-surface-container-highest); --collapse-text-color: #232222; --collapse-header-font-size: var(--font-size-lg); --collapse-header-padding: 10px 12px; --collapse-content-font-size: var(--font-size-md); --collapse-content-padding: 0 12px 10px; --collapse-item-margin-top: 16px; --collapse-disable-color: #bdbdbd; --collapse-border-top: thin solid var(--color-outline);}.var-collapse-item { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; position: relative; margin-top: 0; background: var(--collapse-background); color: var(--collapse-text-color); transition: margin-top 0.25s, background-color 0.25s;}.var-collapse-item__shadow { bottom: 0; content: ''; left: 0; position: absolute; right: 0; top: 0; z-index: -1;}.var-collapse-item:not(:first-child)::after { border-top: var(--collapse-divider-top); content: ''; left: 0; position: absolute; right: 0; top: 0;}.var-collapse-item__header { align-items: center; display: flex; font-size: var(--collapse-header-font-size); outline: none; padding: var(--collapse-header-padding); justify-content: space-between; position: relative;}.var-collapse-item__header-title { transition: color 0.25s;}.var-collapse-item__header-icon { transform: rotate(0deg); opacity: 1;}.var-collapse-item__header-open { transform: rotate(-180deg);}.var-collapse-item__header--disable { opacity: 0;}.var-collapse-item__content { font-size: var(--collapse-content-font-size); overflow: hidden; transition: all 0.25s;}.var-collapse-item__content-wrap { padding: var(--collapse-content-padding); word-break: break-all;}.var-collapse-item--active + .var-collapse-item,.var-collapse-item--active:not(:first-child) { margin-top: var(--collapse-item-margin-top);}.var-collapse-item--active + .var-collapse-item::after,.var-collapse-item--active:not(:first-child)::after { border-top: none;}.var-collapse-item--disable { color: var(--collapse-disable-color); cursor: not-allowed;}
|
|
1
|
+
:root { --collapse-background: var(--color-surface-container-highest); --collapse-text-color: #232222; --collapse-header-font-size: var(--font-size-lg); --collapse-header-padding: 10px 12px; --collapse-content-font-size: var(--font-size-md); --collapse-content-padding: 0 12px 10px; --collapse-item-margin-top: 16px; --collapse-disable-color: #bdbdbd; --collapse-border-top: thin solid var(--color-outline);}.var-collapse-item { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; position: relative; margin-top: 0; background: var(--collapse-background); color: var(--collapse-text-color); transition: margin-top 0.25s, background-color 0.25s;}.var-collapse-item__shadow { bottom: 0; content: ''; left: 0; position: absolute; right: 0; top: 0; z-index: -1;}.var-collapse-item:not(:first-child)::after { border-top: var(--collapse-divider-top); content: ''; left: 0; position: absolute; right: 0; top: 0;}.var-collapse-item__header { align-items: center; display: flex; font-size: var(--collapse-header-font-size); outline: none; padding: var(--collapse-header-padding); justify-content: space-between; position: relative;}.var-collapse-item__header-title { transition: color 0.25s;}.var-collapse-item__header-icon { transform: rotate(0deg); opacity: 1;}.var-collapse-item__header-open { transform: rotate(-180deg);}.var-collapse-item__header--disable { opacity: 0;}.var-collapse-item__header--cursor-pointer { cursor: pointer;}.var-collapse-item__content { font-size: var(--collapse-content-font-size); overflow: hidden; transition: all 0.25s;}.var-collapse-item__content-wrap { padding: var(--collapse-content-padding); word-break: break-all;}.var-collapse-item--active + .var-collapse-item,.var-collapse-item--active:not(:first-child) { margin-top: var(--collapse-item-margin-top);}.var-collapse-item--active + .var-collapse-item::after,.var-collapse-item--active:not(:first-child)::after { border-top: none;}.var-collapse-item--disable { color: var(--collapse-disable-color); cursor: not-allowed;}
|
|
@@ -138,16 +138,11 @@ const __sfc__ = defineComponent({
|
|
|
138
138
|
right: false
|
|
139
139
|
});
|
|
140
140
|
const yearList = computed(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return list;
|
|
144
|
-
let startYear = Math.floor(toNumber(props.preview) / 100 + page.value) * 100;
|
|
145
|
-
startYear = startYear < 0 ? 0 : startYear;
|
|
146
|
-
const yearRange = [startYear, startYear + 100];
|
|
147
|
-
for (let i = yearRange[0]; i < yearRange[1]; i++) {
|
|
148
|
-
list.push(i);
|
|
141
|
+
if (!props.preview) {
|
|
142
|
+
return [];
|
|
149
143
|
}
|
|
150
|
-
|
|
144
|
+
const startYear = Math.floor(toNumber(props.preview) / 100 + page.value) * 100;
|
|
145
|
+
return Array.from(Array(100), (_v, k) => Math.max(0, startYear) + k);
|
|
151
146
|
});
|
|
152
147
|
const shouldChoose = (val) => {
|
|
153
148
|
const {
|
|
@@ -171,12 +166,8 @@ const __sfc__ = defineComponent({
|
|
|
171
166
|
const {
|
|
172
167
|
componentProps: { min, max }
|
|
173
168
|
} = props;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (max)
|
|
177
|
-
isBeforeMax = dayjs(year).isSameOrBefore(dayjs(max), "year");
|
|
178
|
-
if (min)
|
|
179
|
-
isAfterMin = dayjs(year).isSameOrAfter(dayjs(min), "year");
|
|
169
|
+
const isBeforeMax = max ? dayjs(year).isSameOrBefore(dayjs(max), "year") : true;
|
|
170
|
+
const isAfterMin = min ? dayjs(year).isSameOrAfter(dayjs(min), "year") : true;
|
|
180
171
|
return isBeforeMax && isAfterMin;
|
|
181
172
|
};
|
|
182
173
|
const buttonProps = (year) => {
|
|
@@ -247,9 +238,10 @@ const __sfc__ = defineComponent({
|
|
|
247
238
|
});
|
|
248
239
|
};
|
|
249
240
|
const checkDate = (checkType) => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
241
|
+
const isPrevType = checkType === "prev";
|
|
242
|
+
reverse.value = isPrevType;
|
|
243
|
+
panelKey.value += isPrevType ? -1 : 1;
|
|
244
|
+
page.value += isPrevType ? -1 : 1;
|
|
253
245
|
};
|
|
254
246
|
const forwardRef = (checkType) => {
|
|
255
247
|
headerEl.value.checkDate(checkType);
|
package/es/divider/Divider.mjs
CHANGED
|
@@ -21,7 +21,8 @@ function __render__(_ctx, _cache) {
|
|
|
21
21
|
[_ctx.hairline, _ctx.n("--hairline")]
|
|
22
22
|
)
|
|
23
23
|
),
|
|
24
|
-
style: _normalizeStyle(_ctx.style)
|
|
24
|
+
style: _normalizeStyle(_ctx.style),
|
|
25
|
+
role: "separator"
|
|
25
26
|
},
|
|
26
27
|
[
|
|
27
28
|
!_ctx.vertical ? _renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
package/es/index.bundle.mjs
CHANGED
|
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
|
|
|
262
262
|
import './uploader/style/index.mjs'
|
|
263
263
|
import './watermark/style/index.mjs'
|
|
264
264
|
|
|
265
|
-
const version = '3.2.
|
|
265
|
+
const version = '3.2.5'
|
|
266
266
|
|
|
267
267
|
function install(app) {
|
|
268
268
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
|
|
|
174
174
|
export * from './uploader/index.mjs'
|
|
175
175
|
export * from './watermark/index.mjs'
|
|
176
176
|
|
|
177
|
-
const version = '3.2.
|
|
177
|
+
const version = '3.2.5'
|
|
178
178
|
|
|
179
179
|
function install(app) {
|
|
180
180
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/locale/index.mjs
CHANGED
package/es/menu/usePopover.mjs
CHANGED
|
@@ -54,7 +54,7 @@ function usePopover(options) {
|
|
|
54
54
|
const show = useVModel(options, "show", {
|
|
55
55
|
passive: true,
|
|
56
56
|
defaultValue: false,
|
|
57
|
-
emit(
|
|
57
|
+
emit(_event, value) {
|
|
58
58
|
if (value) {
|
|
59
59
|
call(options.onOpen);
|
|
60
60
|
} else {
|
|
@@ -300,8 +300,7 @@ function usePopover(options) {
|
|
|
300
300
|
popoverInstance.setOptions(getPopperOptions());
|
|
301
301
|
};
|
|
302
302
|
const open = () => {
|
|
303
|
-
|
|
304
|
-
if (disabled) {
|
|
303
|
+
if (options.disabled) {
|
|
305
304
|
return;
|
|
306
305
|
}
|
|
307
306
|
show.value = true;
|
package/es/popup/Popup.mjs
CHANGED
|
@@ -90,7 +90,9 @@ var stdin_default = defineComponent({
|
|
|
90
90
|
"class": classes(n("content"), n(`--${props2.position}`), [props2.defaultStyle, n("--content-background-color")], [props2.defaultStyle, n("$-elevation--3")], [props2.safeArea, n("--safe-area")], [props2.safeAreaTop, n("--safe-area-top")]),
|
|
91
91
|
"style": {
|
|
92
92
|
zIndex: zIndex.value
|
|
93
|
-
}
|
|
93
|
+
},
|
|
94
|
+
"role": "dialog",
|
|
95
|
+
"aria-modal": "true"
|
|
94
96
|
}, attrs), [rendered.value && call(slots.default)]), [[_vShow, props2.show]]);
|
|
95
97
|
}
|
|
96
98
|
function renderPopup() {
|