@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.
- package/es/action-sheet/ActionSheet.js +1 -1
- package/es/app-bar/AppBar.js +1 -1
- package/es/badge/Badge.js +5 -3
- package/es/button/Button.js +1 -1
- package/es/button/button.css +1 -1
- package/es/button/props.js +1 -2
- package/es/card/Card.js +3 -3
- package/es/cell/Cell.js +0 -1
- package/es/chip/Chip.js +6 -4
- package/es/chip/chip.css +1 -1
- package/es/col/Col.js +1 -1
- package/es/counter/Counter.js +2 -2
- package/es/date-picker/DatePicker.js +1 -1
- package/es/dialog/Dialog.js +1 -1
- package/es/divider/Divider.js +1 -1
- package/es/image/Image.js +1 -1
- package/es/image-preview/ImagePreview.js +3 -3
- package/es/index-anchor/IndexAnchor.js +1 -1
- package/es/index.js +5 -0
- package/es/input/Input.js +2 -2
- package/es/link/Link.js +102 -0
- package/es/link/LinkSfc.css +0 -0
- package/es/link/index.js +8 -0
- package/es/link/link.css +1 -0
- package/es/link/props.js +50 -0
- package/es/link/style/index.js +3 -0
- package/es/list/List.js +1 -1
- package/es/loading/Loading.js +1 -1
- package/es/menu/Menu.js +1 -1
- package/es/option/Option.js +2 -2
- package/es/pagination/Pagination.js +3 -3
- package/es/picker/Picker.js +1 -1
- package/es/popup/Popup.js +4 -4
- package/es/pull-refresh/PullRefresh.js +1 -1
- package/es/row/Row.js +1 -1
- package/es/select/Select.js +3 -3
- package/es/skeleton/Skeleton.js +1 -1
- package/es/slider/Slider.js +1 -1
- package/es/snackbar/core.js +1 -1
- package/es/snackbar/style/index.js +1 -1
- package/es/space/Space.js +2 -4
- package/es/style.css +1 -1
- package/es/style.js +1 -0
- package/es/switch/Switch.js +1 -1
- package/es/tab/Tab.js +2 -2
- package/es/table/Table.js +1 -1
- package/es/tabs/Tabs.js +2 -2
- package/es/time-picker/TimePicker.js +1 -1
- package/es/umdIndex.js +5 -0
- package/es/uploader/Uploader.js +3 -3
- package/es/utils/components.js +9 -3
- package/es/varlet.esm.js +3772 -3650
- package/highlight/attributes.json +38 -2
- package/highlight/tags.json +13 -0
- package/highlight/web-types.json +101 -3
- package/lib/action-sheet/ActionSheet.js +1 -1
- package/lib/app-bar/AppBar.js +1 -1
- package/lib/badge/Badge.js +5 -3
- package/lib/button/Button.js +1 -1
- package/lib/button/button.css +1 -1
- package/lib/button/props.js +1 -2
- package/lib/card/Card.js +3 -3
- package/lib/cell/Cell.js +0 -1
- package/lib/chip/Chip.js +6 -4
- package/lib/chip/chip.css +1 -1
- package/lib/col/Col.js +1 -1
- package/lib/counter/Counter.js +2 -2
- package/lib/date-picker/DatePicker.js +1 -1
- package/lib/dialog/Dialog.js +1 -1
- package/lib/divider/Divider.js +1 -1
- package/lib/image/Image.js +1 -1
- package/lib/image-preview/ImagePreview.js +3 -3
- package/lib/index-anchor/IndexAnchor.js +1 -1
- package/lib/index.js +3 -0
- package/lib/input/Input.js +2 -2
- package/lib/link/Link.js +115 -0
- package/lib/link/LinkSfc.css +0 -0
- package/lib/link/index.js +17 -0
- package/lib/link/link.css +1 -0
- package/lib/link/props.js +56 -0
- package/lib/link/style/index.js +3 -0
- package/lib/list/List.js +1 -1
- package/lib/loading/Loading.js +1 -1
- package/lib/menu/Menu.js +1 -1
- package/lib/option/Option.js +2 -2
- package/lib/pagination/Pagination.js +3 -3
- package/lib/picker/Picker.js +1 -1
- package/lib/popup/Popup.js +4 -4
- package/lib/pull-refresh/PullRefresh.js +1 -1
- package/lib/row/Row.js +1 -1
- package/lib/select/Select.js +3 -3
- package/lib/skeleton/Skeleton.js +1 -1
- package/lib/slider/Slider.js +1 -1
- package/lib/snackbar/core.js +1 -1
- package/lib/snackbar/style/index.js +1 -1
- package/lib/space/Space.js +2 -4
- package/lib/style.css +1 -1
- package/lib/style.js +1 -0
- package/lib/switch/Switch.js +1 -1
- package/lib/tab/Tab.js +2 -2
- package/lib/table/Table.js +1 -1
- package/lib/tabs/Tabs.js +2 -2
- package/lib/time-picker/TimePicker.js +1 -1
- package/lib/uploader/Uploader.js +3 -3
- package/lib/utils/components.js +9 -3
- package/package.json +7 -7
- package/types/index.d.ts +2 -0
- package/types/link.d.ts +30 -0
- package/umd/varlet.js +7 -7
package/lib/style.js
CHANGED
package/lib/switch/Switch.js
CHANGED
|
@@ -52,7 +52,7 @@ function render(_ctx, _cache) {
|
|
|
52
52
|
style: (0, _vue.normalizeStyle)(_ctx.styleComputed.ripple)
|
|
53
53
|
}, [(0, _vue.createElementVNode)("div", {
|
|
54
54
|
style: (0, _vue.normalizeStyle)(_ctx.styleComputed.handle),
|
|
55
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('handle'), '
|
|
55
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('handle'), _ctx.n('$-elevation--2'), [_ctx.modelValue === _ctx.activeValue, _ctx.n('handle--active')], [_ctx.errorMessage, _ctx.n('handle--error')]))
|
|
56
56
|
}, [_ctx.loading ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_loading, {
|
|
57
57
|
key: 0,
|
|
58
58
|
radius: _ctx.radius,
|
package/lib/tab/Tab.js
CHANGED
|
@@ -25,7 +25,7 @@ function render(_ctx, _cache) {
|
|
|
25
25
|
var _directive_ripple = (0, _vue.resolveDirective)("ripple");
|
|
26
26
|
|
|
27
27
|
return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
28
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), '
|
|
28
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.computeColorClass(), _ctx.n("--" + _ctx.itemDirection))),
|
|
29
29
|
ref: "tabEl",
|
|
30
30
|
style: (0, _vue.normalizeStyle)({
|
|
31
31
|
color: _ctx.computeColorStyle()
|
|
@@ -88,7 +88,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
88
88
|
disabled,
|
|
89
89
|
name
|
|
90
90
|
} = props;
|
|
91
|
-
return disabled ? '
|
|
91
|
+
return disabled ? n('$-tab--disabled') : active.value === name || active.value === (index == null ? void 0 : index.value) ? n('$-tab--active') : n('$-tab--inactive');
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
var handleClick = event => {
|
package/lib/table/Table.js
CHANGED
|
@@ -17,7 +17,7 @@ var {
|
|
|
17
17
|
|
|
18
18
|
function render(_ctx, _cache) {
|
|
19
19
|
return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
20
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), '
|
|
20
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n('$-elevation--1'), _ctx.n('$--box')))
|
|
21
21
|
}, [(0, _vue.createElementVNode)("div", {
|
|
22
22
|
class: (0, _vue.normalizeClass)(_ctx.n('main'))
|
|
23
23
|
}, [(0, _vue.createElementVNode)("table", {
|
package/lib/tabs/Tabs.js
CHANGED
|
@@ -32,11 +32,11 @@ var {
|
|
|
32
32
|
} = (0, _components.createNamespace)('tabs');
|
|
33
33
|
|
|
34
34
|
function render(_ctx, _cache) {
|
|
35
|
-
return (0, _vue.openBlock)(), (0, _vue.createBlock)((0, _vue.resolveDynamicComponent)(_ctx.sticky ? '
|
|
35
|
+
return (0, _vue.openBlock)(), (0, _vue.createBlock)((0, _vue.resolveDynamicComponent)(_ctx.sticky ? _ctx.n('$-sticky') : _ctx.Transition), {
|
|
36
36
|
"offset-top": _ctx.sticky ? _ctx.offsetTop : null
|
|
37
37
|
}, {
|
|
38
38
|
default: (0, _vue.withCtx)(() => [(0, _vue.createElementVNode)("div", (0, _vue.mergeProps)({
|
|
39
|
-
class: _ctx.classes(_ctx.n(), '
|
|
39
|
+
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')]),
|
|
40
40
|
style: {
|
|
41
41
|
background: _ctx.color
|
|
42
42
|
}
|
|
@@ -41,7 +41,7 @@ function render(_ctx, _cache) {
|
|
|
41
41
|
var _component_clock = (0, _vue.resolveComponent)("clock");
|
|
42
42
|
|
|
43
43
|
return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
44
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.elevation, '
|
|
44
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.elevation, _ctx.n('$-elevation--2')])),
|
|
45
45
|
ref: "picker"
|
|
46
46
|
}, [(0, _vue.createElementVNode)("div", {
|
|
47
47
|
class: (0, _vue.normalizeClass)(_ctx.n('title')),
|
package/lib/uploader/Uploader.js
CHANGED
|
@@ -56,12 +56,12 @@ function render(_ctx, _cache) {
|
|
|
56
56
|
var _directive_ripple = (0, _vue.resolveDirective)("ripple");
|
|
57
57
|
|
|
58
58
|
return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
59
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), '
|
|
59
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n('$--box')))
|
|
60
60
|
}, [(0, _vue.createElementVNode)("div", {
|
|
61
61
|
class: (0, _vue.normalizeClass)(_ctx.n('file-list'))
|
|
62
62
|
}, [((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(_ctx.files, f => {
|
|
63
63
|
return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
64
|
-
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('file'), '
|
|
64
|
+
class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('file'), _ctx.n('$-elevation--2'), [f.state === 'loading', _ctx.n('--loading')])),
|
|
65
65
|
key: f.id,
|
|
66
66
|
onClick: $event => _ctx.preview(f)
|
|
67
67
|
}, [(0, _vue.createElementVNode)("div", {
|
|
@@ -103,7 +103,7 @@ function render(_ctx, _cache) {
|
|
|
103
103
|
/* KEYED_FRAGMENT */
|
|
104
104
|
)), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
105
105
|
key: 0,
|
|
106
|
-
class: (0, _vue.normalizeClass)(_ctx.classes([!_ctx.$slots.default, _ctx.n('action') + "
|
|
106
|
+
class: (0, _vue.normalizeClass)(_ctx.classes([!_ctx.$slots.default, _ctx.n('action') + " " + _ctx.n('$-elevation--2')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disabled')])),
|
|
107
107
|
onClick: _cache[1] || (_cache[1] = function () {
|
|
108
108
|
return _ctx.triggerAction && _ctx.triggerAction(...arguments);
|
|
109
109
|
})
|
package/lib/utils/components.js
CHANGED
|
@@ -295,11 +295,17 @@ function exposeApis(apis) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
function createNamespace(name) {
|
|
298
|
-
var namespace = "var
|
|
298
|
+
var namespace = "var";
|
|
299
|
+
var componentName = namespace + "-" + name;
|
|
299
300
|
|
|
300
301
|
var createBEM = suffix => {
|
|
301
|
-
if (!suffix) return
|
|
302
|
-
|
|
302
|
+
if (!suffix) return componentName;
|
|
303
|
+
|
|
304
|
+
if (suffix[0] === '$') {
|
|
305
|
+
return suffix.replace('$', namespace);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return suffix.startsWith('--') ? "" + componentName + suffix : componentName + "__" + suffix;
|
|
303
309
|
};
|
|
304
310
|
|
|
305
311
|
var classes = function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -46,17 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
|
-
"@varlet/icons": "2.2.1",
|
|
50
|
-
"@varlet/shared": "2.2.1",
|
|
51
49
|
"dayjs": "^1.10.4",
|
|
52
|
-
"decimal.js": "^10.2.1"
|
|
50
|
+
"decimal.js": "^10.2.1",
|
|
51
|
+
"@varlet/icons": "2.3.0",
|
|
52
|
+
"@varlet/shared": "2.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/jest": "^26.0.15",
|
|
56
56
|
"@types/lodash-es": "^4.17.6",
|
|
57
57
|
"@types/node": "^18.7.18",
|
|
58
|
-
"@varlet/cli": "2.2.1",
|
|
59
|
-
"@varlet/touch-emulator": "2.2.1",
|
|
60
58
|
"@vue/runtime-core": "3.2.25",
|
|
61
59
|
"@vue/test-utils": "^2.0.2",
|
|
62
60
|
"clipboard": "^2.0.6",
|
|
@@ -65,7 +63,9 @@
|
|
|
65
63
|
"postcss-px-to-viewport": "^1.1.1",
|
|
66
64
|
"typescript": "^4.4.4",
|
|
67
65
|
"vue": "3.2.25",
|
|
68
|
-
"vue-router": "4.0.12"
|
|
66
|
+
"vue-router": "4.0.12",
|
|
67
|
+
"@varlet/cli": "2.3.0",
|
|
68
|
+
"@varlet/touch-emulator": "2.3.0"
|
|
69
69
|
},
|
|
70
70
|
"browserslist": [
|
|
71
71
|
"Chrome >= 54",
|
package/types/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from './indexAnchor'
|
|
|
31
31
|
export * from './indexBar'
|
|
32
32
|
export * from './input'
|
|
33
33
|
export * from './lazy'
|
|
34
|
+
export * from './link'
|
|
34
35
|
export * from './list'
|
|
35
36
|
export * from './loading'
|
|
36
37
|
export * from './locale'
|
|
@@ -100,6 +101,7 @@ declare module 'vue' {
|
|
|
100
101
|
VarIndexBar: typeof import('@varlet/ui')['_IndexBarComponent']
|
|
101
102
|
VarInput: typeof import('@varlet/ui')['_InputComponent']
|
|
102
103
|
VarLazy: typeof import('@varlet/ui')['_LazyComponent']
|
|
104
|
+
VarLink: typeof import('@varlet/ui')['_LinkComponent']
|
|
103
105
|
VarList: typeof import('@varlet/ui')['_ListComponent']
|
|
104
106
|
VarLoading: typeof import('@varlet/ui')['_LoadingComponent']
|
|
105
107
|
VarLocale: typeof import('@varlet/ui')['_LocaleComponent']
|
package/types/link.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VarComponent, BasicAttributes, Type as LinkType } from './varComponent'
|
|
2
|
+
import { VNode } from 'vue'
|
|
3
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
export type LinkUnderline = 'always' | 'hover' | 'none'
|
|
6
|
+
|
|
7
|
+
export { LinkType }
|
|
8
|
+
|
|
9
|
+
export interface LinkProps extends BasicAttributes {
|
|
10
|
+
type?: LinkType
|
|
11
|
+
href?: string
|
|
12
|
+
target?: string
|
|
13
|
+
to?: RouteLocationRaw
|
|
14
|
+
replace?: boolean
|
|
15
|
+
underline?: LinkUnderline
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
textColor?: string
|
|
18
|
+
textSize?: string | number
|
|
19
|
+
onClick?: (e: Event) => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class Link extends VarComponent {
|
|
23
|
+
$props: LinkProps
|
|
24
|
+
|
|
25
|
+
$slots: {
|
|
26
|
+
default(): VNode[]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class _LinkComponent extends Link {}
|