@varlet/ui 2.2.1 → 2.3.0

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.
Files changed (109) hide show
  1. package/es/action-sheet/ActionSheet.js +1 -1
  2. package/es/app-bar/AppBar.js +1 -1
  3. package/es/badge/Badge.js +5 -3
  4. package/es/button/Button.js +1 -1
  5. package/es/button/button.css +1 -1
  6. package/es/button/props.js +1 -2
  7. package/es/card/Card.js +3 -3
  8. package/es/cell/Cell.js +0 -1
  9. package/es/chip/Chip.js +6 -4
  10. package/es/chip/chip.css +1 -1
  11. package/es/col/Col.js +1 -1
  12. package/es/counter/Counter.js +2 -2
  13. package/es/date-picker/DatePicker.js +1 -1
  14. package/es/dialog/Dialog.js +1 -1
  15. package/es/divider/Divider.js +1 -1
  16. package/es/image/Image.js +1 -1
  17. package/es/image-preview/ImagePreview.js +3 -3
  18. package/es/index-anchor/IndexAnchor.js +1 -1
  19. package/es/index.js +5 -0
  20. package/es/input/Input.js +2 -2
  21. package/es/link/Link.js +102 -0
  22. package/es/link/LinkSfc.css +0 -0
  23. package/es/link/index.js +8 -0
  24. package/es/link/link.css +1 -0
  25. package/es/link/props.js +50 -0
  26. package/es/link/style/index.js +3 -0
  27. package/es/list/List.js +1 -1
  28. package/es/loading/Loading.js +1 -1
  29. package/es/menu/Menu.js +1 -1
  30. package/es/option/Option.js +2 -2
  31. package/es/pagination/Pagination.js +3 -3
  32. package/es/picker/Picker.js +1 -1
  33. package/es/popup/Popup.js +4 -4
  34. package/es/pull-refresh/PullRefresh.js +1 -1
  35. package/es/row/Row.js +1 -1
  36. package/es/select/Select.js +3 -3
  37. package/es/skeleton/Skeleton.js +1 -1
  38. package/es/slider/Slider.js +1 -1
  39. package/es/snackbar/core.js +1 -1
  40. package/es/snackbar/style/index.js +1 -1
  41. package/es/space/Space.js +2 -4
  42. package/es/style.css +1 -1
  43. package/es/style.js +1 -0
  44. package/es/switch/Switch.js +1 -1
  45. package/es/tab/Tab.js +2 -2
  46. package/es/table/Table.js +1 -1
  47. package/es/tabs/Tabs.js +2 -2
  48. package/es/time-picker/TimePicker.js +1 -1
  49. package/es/umdIndex.js +5 -0
  50. package/es/uploader/Uploader.js +3 -3
  51. package/es/utils/components.js +9 -3
  52. package/es/varlet.esm.js +3772 -3650
  53. package/highlight/attributes.json +38 -2
  54. package/highlight/tags.json +13 -0
  55. package/highlight/web-types.json +101 -3
  56. package/lib/action-sheet/ActionSheet.js +1 -1
  57. package/lib/app-bar/AppBar.js +1 -1
  58. package/lib/badge/Badge.js +5 -3
  59. package/lib/button/Button.js +1 -1
  60. package/lib/button/button.css +1 -1
  61. package/lib/button/props.js +1 -2
  62. package/lib/card/Card.js +3 -3
  63. package/lib/cell/Cell.js +0 -1
  64. package/lib/chip/Chip.js +6 -4
  65. package/lib/chip/chip.css +1 -1
  66. package/lib/col/Col.js +1 -1
  67. package/lib/counter/Counter.js +2 -2
  68. package/lib/date-picker/DatePicker.js +1 -1
  69. package/lib/dialog/Dialog.js +1 -1
  70. package/lib/divider/Divider.js +1 -1
  71. package/lib/image/Image.js +1 -1
  72. package/lib/image-preview/ImagePreview.js +3 -3
  73. package/lib/index-anchor/IndexAnchor.js +1 -1
  74. package/lib/index.js +3 -0
  75. package/lib/input/Input.js +2 -2
  76. package/lib/link/Link.js +115 -0
  77. package/lib/link/LinkSfc.css +0 -0
  78. package/lib/link/index.js +17 -0
  79. package/lib/link/link.css +1 -0
  80. package/lib/link/props.js +56 -0
  81. package/lib/link/style/index.js +3 -0
  82. package/lib/list/List.js +1 -1
  83. package/lib/loading/Loading.js +1 -1
  84. package/lib/menu/Menu.js +1 -1
  85. package/lib/option/Option.js +2 -2
  86. package/lib/pagination/Pagination.js +3 -3
  87. package/lib/picker/Picker.js +1 -1
  88. package/lib/popup/Popup.js +4 -4
  89. package/lib/pull-refresh/PullRefresh.js +1 -1
  90. package/lib/row/Row.js +1 -1
  91. package/lib/select/Select.js +3 -3
  92. package/lib/skeleton/Skeleton.js +1 -1
  93. package/lib/slider/Slider.js +1 -1
  94. package/lib/snackbar/core.js +1 -1
  95. package/lib/snackbar/style/index.js +1 -1
  96. package/lib/space/Space.js +2 -4
  97. package/lib/style.css +1 -1
  98. package/lib/style.js +1 -0
  99. package/lib/switch/Switch.js +1 -1
  100. package/lib/tab/Tab.js +2 -2
  101. package/lib/table/Table.js +1 -1
  102. package/lib/tabs/Tabs.js +2 -2
  103. package/lib/time-picker/TimePicker.js +1 -1
  104. package/lib/uploader/Uploader.js +3 -3
  105. package/lib/utils/components.js +9 -3
  106. package/package.json +7 -7
  107. package/types/index.d.ts +2 -0
  108. package/types/link.d.ts +30 -0
  109. package/umd/varlet.js +7 -7
package/es/style.js CHANGED
@@ -28,6 +28,7 @@ import './index-anchor/style'
28
28
  import './index-bar/style'
29
29
  import './input/style'
30
30
  import './lazy/style'
31
+ import './link/style'
31
32
  import './list/style'
32
33
  import './loading/style'
33
34
  import './locale/style'
@@ -36,7 +36,7 @@ export function render(_ctx, _cache) {
36
36
  style: _normalizeStyle(_ctx.styleComputed.ripple)
37
37
  }, [_createElementVNode("div", {
38
38
  style: _normalizeStyle(_ctx.styleComputed.handle),
39
- class: _normalizeClass(_ctx.classes(_ctx.n('handle'), 'var-elevation--2', [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle--active')], [_ctx.errorMessage, _ctx.n('handle--error')]))
39
+ class: _normalizeClass(_ctx.classes(_ctx.n('handle'), _ctx.n('$-elevation--2'), [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle--active')], [_ctx.errorMessage, _ctx.n('handle--error')]))
40
40
  }, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
41
41
  key: 0,
42
42
  radius: _ctx.radius,
package/es/tab/Tab.js CHANGED
@@ -12,7 +12,7 @@ export function render(_ctx, _cache) {
12
12
  var _directive_ripple = _resolveDirective("ripple");
13
13
 
14
14
  return _withDirectives((_openBlock(), _createElementBlock("div", {
15
- class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box', _ctx.computeColorClass(), _ctx.n("--" + _ctx.itemDirection))),
15
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.computeColorClass(), _ctx.n("--" + _ctx.itemDirection))),
16
16
  ref: "tabEl",
17
17
  style: _normalizeStyle({
18
18
  color: _ctx.computeColorStyle()
@@ -74,7 +74,7 @@ export default defineComponent({
74
74
  disabled,
75
75
  name
76
76
  } = props;
77
- return disabled ? 'var-tab--disabled' : active.value === name || active.value === (index == null ? void 0 : index.value) ? 'var-tab--active' : 'var-tab--inactive';
77
+ return disabled ? n('$-tab--disabled') : active.value === name || active.value === (index == null ? void 0 : index.value) ? n('$-tab--active') : n('$-tab--inactive');
78
78
  };
79
79
 
80
80
  var handleClick = event => {
package/es/table/Table.js CHANGED
@@ -8,7 +8,7 @@ var {
8
8
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
9
9
  export function render(_ctx, _cache) {
10
10
  return _openBlock(), _createElementBlock("div", {
11
- class: _normalizeClass(_ctx.classes(_ctx.n(), 'var-elevation--1 var--box'))
11
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$-elevation--1'), _ctx.n('$--box')))
12
12
  }, [_createElementVNode("div", {
13
13
  class: _normalizeClass(_ctx.n('main'))
14
14
  }, [_createElementVNode("table", {
package/es/tabs/Tabs.js CHANGED
@@ -16,11 +16,11 @@ var {
16
16
  } = createNamespace('tabs');
17
17
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
18
18
  export function render(_ctx, _cache) {
19
- return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
19
+ return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? _ctx.n('$-sticky') : _ctx.Transition), {
20
20
  "offset-top": _ctx.sticky ? _ctx.offsetTop : null
21
21
  }, {
22
22
  default: _withCtx(() => [_createElementVNode("div", _mergeProps({
23
- class: _ctx.classes(_ctx.n(), 'var--box', _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, 'var-elevation--4'], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')], [_ctx.safeArea, _ctx.n('--safe-area')]),
23
+ class: _ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, _ctx.n('$-elevation--4')], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')], [_ctx.safeArea, _ctx.n('--safe-area')]),
24
24
  style: {
25
25
  background: _ctx.color
26
26
  }
@@ -25,7 +25,7 @@ export function render(_ctx, _cache) {
25
25
  var _component_clock = _resolveComponent("clock");
26
26
 
27
27
  return _openBlock(), _createElementBlock("div", {
28
- class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.elevation, 'var-elevation--2'])),
28
+ class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.elevation, _ctx.n('$-elevation--2')])),
29
29
  ref: "picker"
30
30
  }, [_createElementVNode("div", {
31
31
  class: _normalizeClass(_ctx.n('title')),
package/es/umdIndex.js CHANGED
@@ -28,6 +28,7 @@ import IndexAnchor, * as IndexAnchorModule from './index-anchor'
28
28
  import IndexBar, * as IndexBarModule from './index-bar'
29
29
  import Input, * as InputModule from './input'
30
30
  import Lazy, * as LazyModule from './lazy'
31
+ import Link, * as LinkModule from './link'
31
32
  import List, * as ListModule from './list'
32
33
  import Loading, * as LoadingModule from './loading'
33
34
  import Locale, * as LocaleModule from './locale'
@@ -94,6 +95,7 @@ import './index-anchor/style'
94
95
  import './index-bar/style'
95
96
  import './input/style'
96
97
  import './lazy/style'
98
+ import './link/style'
97
99
  import './list/style'
98
100
  import './loading/style'
99
101
  import './locale/style'
@@ -162,6 +164,7 @@ function install(app) {
162
164
  IndexBar.install && app.use(IndexBar)
163
165
  Input.install && app.use(Input)
164
166
  Lazy.install && app.use(Lazy)
167
+ Link.install && app.use(Link)
165
168
  List.install && app.use(List)
166
169
  Loading.install && app.use(Loading)
167
170
  Locale.install && app.use(Locale)
@@ -231,6 +234,7 @@ export {
231
234
  IndexBar,
232
235
  Input,
233
236
  Lazy,
237
+ Link,
234
238
  List,
235
239
  Loading,
236
240
  Locale,
@@ -300,6 +304,7 @@ export default {
300
304
  IndexBar,
301
305
  Input,
302
306
  Lazy,
307
+ Link,
303
308
  List,
304
309
  Loading,
305
310
  Locale,
@@ -37,12 +37,12 @@ export function render(_ctx, _cache) {
37
37
  var _directive_ripple = _resolveDirective("ripple");
38
38
 
39
39
  return _openBlock(), _createElementBlock("div", {
40
- class: _normalizeClass(_ctx.classes(_ctx.n(), 'var--box'))
40
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box')))
41
41
  }, [_createElementVNode("div", {
42
42
  class: _normalizeClass(_ctx.n('file-list'))
43
43
  }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.files, f => {
44
44
  return _withDirectives((_openBlock(), _createElementBlock("div", {
45
- class: _normalizeClass(_ctx.classes(_ctx.n('file'), 'var-elevation--2', [f.state === 'loading', _ctx.n('--loading')])),
45
+ class: _normalizeClass(_ctx.classes(_ctx.n('file'), _ctx.n('$-elevation--2'), [f.state === 'loading', _ctx.n('--loading')])),
46
46
  key: f.id,
47
47
  onClick: $event => _ctx.preview(f)
48
48
  }, [_createElementVNode("div", {
@@ -84,7 +84,7 @@ export function render(_ctx, _cache) {
84
84
  /* KEYED_FRAGMENT */
85
85
  )), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? _withDirectives((_openBlock(), _createElementBlock("div", {
86
86
  key: 0,
87
- class: _normalizeClass(_ctx.classes([!_ctx.$slots.default, _ctx.n('action') + " var-elevation--2"], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disabled')])),
87
+ class: _normalizeClass(_ctx.classes([!_ctx.$slots.default, _ctx.n('action') + " " + _ctx.n('$-elevation--2')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disabled')])),
88
88
  onClick: _cache[1] || (_cache[1] = function () {
89
89
  return _ctx.triggerAction && _ctx.triggerAction(...arguments);
90
90
  })
@@ -261,11 +261,17 @@ export function exposeApis(apis) {
261
261
  }
262
262
  }
263
263
  export function createNamespace(name) {
264
- var namespace = "var-" + name;
264
+ var namespace = "var";
265
+ var componentName = namespace + "-" + name;
265
266
 
266
267
  var createBEM = suffix => {
267
- if (!suffix) return namespace;
268
- return suffix.startsWith('--') ? "" + namespace + suffix : namespace + "__" + suffix;
268
+ if (!suffix) return componentName;
269
+
270
+ if (suffix[0] === '$') {
271
+ return suffix.replace('$', namespace);
272
+ }
273
+
274
+ return suffix.startsWith('--') ? "" + componentName + suffix : componentName + "__" + suffix;
269
275
  };
270
276
 
271
277
  var classes = function () {