@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 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>Vue3 mobile component library supports both Material Design 2 and 3, and also has a good experience on the desktop.</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
  - 🌍 &nbsp; Support internationalization
37
37
  - 💡 &nbsp; Support WebStorm syntax highlighting
38
38
  - 💪 &nbsp; Support the SSR
39
+ - 📦 &nbsp; Support [Nuxt Module](https://github.com/varletjs/varlet-nuxt)
39
40
  - 💡 &nbsp; Support the Typescript
40
41
  - 💪 &nbsp; Make sure more than 90 percent unit test coverage, providing stability assurance
41
- - 🛠️ &nbsp; Supports both Material Design 2 and Material Design 3 design systems
42
+ - 🎨 &nbsp; Supports both Material Design 2 and Material Design 3 design systems
42
43
  - 🛠️ &nbsp; Support dark mode
43
- - 🛠️ &nbsp; Provide official VSCode extension
44
+ - 🔧 &nbsp; Provide official VSCode extension
45
+ - ⌨️ &nbsp; 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>Vue3 移动端组件库,同时支持 Material Design 2 3,桌面端也有不错的体验。</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
  - 🌍 &nbsp; 支持国际化
37
37
  - 💡 &nbsp; 支持 webstorm 组件属性高亮
38
38
  - 💪 &nbsp; 支持 SSR
39
+ - 📦 &nbsp; 支持 [Nuxt Module](https://github.com/varletjs/varlet-nuxt)
39
40
  - 💡 &nbsp; 支持 Typescript
40
41
  - 💪 &nbsp; 确保 90% 以上单元测试覆盖率,提供稳定性保证
41
- - 🛠️ &nbsp; 同时支持 Material Design 2 和 Material Design 3 两套设计系统
42
+ - 🎨 &nbsp; 同时支持 Material Design 2 和 Material Design 3 两套设计系统
42
43
  - 🛠️ &nbsp; 支持暗黑模式
43
- - 🛠️ &nbsp; 提供官方的 VSCode 插件
44
+ - 🔧 &nbsp; 提供官方的 VSCode 插件
45
+ - ⌨️ &nbsp; 支持无障碍访问(持续改进中)
44
46
 
45
47
  ### 安装
46
48
 
@@ -3,5 +3,5 @@ import '../../icon/icon.css'
3
3
  import '../../ripple/ripple.css'
4
4
  import '../../popup/popup.css'
5
5
  import '../actionSheet.css'
6
- import '../ActionSheetSfc.css'
7
6
  import '../ActionItemSfc.css'
7
+ import '../ActionSheetSfc.css'
@@ -33,8 +33,7 @@ const __sfc__ = defineComponent({
33
33
  return {
34
34
  rootStyles,
35
35
  n,
36
- classes,
37
- toSizeUnit
36
+ classes
38
37
  };
39
38
  }
40
39
  });
@@ -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")
@@ -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
- "div",
29
- {
30
- class: _normalizeClass(_ctx.n("header")),
31
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.toggle && _ctx.toggle(...args))
32
- },
33
- [
34
- _ctx.$slots.title || _ctx.title ? (_openBlock(), _createElementBlock(
35
- "div",
36
- {
37
- key: 0,
38
- class: _normalizeClass(_ctx.n("header-title"))
39
- },
40
- [
41
- _renderSlot(_ctx.$slots, "title", {}, () => [
42
- _createTextVNode(
43
- _toDisplayString(_ctx.title),
44
- 1
45
- /* TEXT */
46
- )
47
- ])
48
- ],
49
- 2
50
- /* CLASS */
51
- )) : _createCommentVNode("v-if", true),
52
- _createElementVNode(
53
- "div",
54
- {
55
- class: _normalizeClass(_ctx.n("header-icon"))
56
- },
57
- [
58
- _renderSlot(_ctx.$slots, "icon", {}, () => [
59
- _createVNode(_component_var_icon, {
60
- name: _ctx.icon,
61
- transition: 250,
62
- class: _normalizeClass(
63
- _ctx.classes(
64
- _ctx.n("header-icon"),
65
- [_ctx.isShow && _ctx.icon === "chevron-down", _ctx.n("header-open")],
66
- [_ctx.disabled, _ctx.n("header--disable")]
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
- }, null, 8, ["name", "class"])
70
- ])
71
- ],
72
- 2
73
- /* CLASS */
74
- )
75
- ],
76
- 2
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
- const list = [];
142
- if (!props.preview)
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
- return list;
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
- let isBeforeMax = true;
175
- let isAfterMin = true;
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
- reverse.value = checkType === "prev";
251
- panelKey.value += checkType === "prev" ? -1 : 1;
252
- page.value += checkType === "prev" ? -1 : 1;
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);
@@ -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 }, () => [
@@ -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.3'
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.3'
177
+ const version = '3.2.5'
178
178
 
179
179
  function install(app) {
180
180
  ActionSheet.install && app.use(ActionSheet)
@@ -47,7 +47,6 @@ function useLocale() {
47
47
  if (hasOwn(currentMessage2.value, id)) {
48
48
  return currentMessage2.value[id];
49
49
  }
50
- return id;
51
50
  };
52
51
  return {
53
52
  messages: messages2,
@@ -54,7 +54,7 @@ function usePopover(options) {
54
54
  const show = useVModel(options, "show", {
55
55
  passive: true,
56
56
  defaultValue: false,
57
- emit(event, value) {
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
- const { disabled } = options;
304
- if (disabled) {
303
+ if (options.disabled) {
305
304
  return;
306
305
  }
307
306
  show.value = true;
@@ -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() {