@varlet/ui 2.3.1 → 2.4.0-alpha.1670751751241
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/app-bar/AppBar.js +1 -1
- package/es/app-bar/appBar.css +1 -1
- package/es/app-bar/props.js +4 -0
- package/es/card/Card.js +1 -1
- package/es/index.js +15 -0
- package/es/loading-bar/LoadingBar.js +33 -0
- package/es/loading-bar/index.js +66 -0
- package/es/loading-bar/loadingBar.css +1 -0
- package/es/loading-bar/props.js +26 -0
- package/es/loading-bar/style/index.js +2 -0
- package/es/overlay/Overlay.js +83 -0
- package/es/overlay/index.js +8 -0
- package/es/overlay/overlay.css +1 -0
- package/es/overlay/props.js +19 -0
- package/es/overlay/style/index.js +2 -0
- package/es/popup/Popup.js +1 -1
- package/es/popup/popup.css +1 -1
- package/es/popup/props.js +4 -0
- package/es/result/Empty.js +23 -0
- package/es/result/Error.js +23 -0
- package/es/result/Info.js +23 -0
- package/es/result/Question.js +23 -0
- package/es/result/Result.js +95 -0
- package/es/result/ResultSfc.css +0 -0
- package/es/result/Success.js +74 -0
- package/es/result/Warning.js +23 -0
- package/es/result/index.js +8 -0
- package/es/result/props.js +24 -0
- package/es/result/result.css +1 -0
- package/es/result/style/index.js +3 -0
- package/es/style.css +1 -1
- package/es/style.js +3 -0
- package/es/themes/dark/index.js +2 -1
- package/es/themes/dark/result.js +9 -0
- package/es/umdIndex.js +15 -0
- package/es/utils/elements.js +11 -7
- package/es/varlet.esm.js +5272 -4795
- package/highlight/attributes.json +41 -1
- package/highlight/tags.json +22 -1
- package/highlight/web-types.json +139 -2
- package/lib/app-bar/AppBar.js +1 -1
- package/lib/app-bar/appBar.css +1 -1
- package/lib/app-bar/props.js +4 -0
- package/lib/card/Card.js +1 -1
- package/lib/index.js +9 -0
- package/lib/loading-bar/LoadingBar.js +49 -0
- package/lib/loading-bar/index.js +78 -0
- package/lib/loading-bar/loadingBar.css +1 -0
- package/lib/loading-bar/props.js +31 -0
- package/lib/loading-bar/style/index.js +2 -0
- package/lib/overlay/Overlay.js +96 -0
- package/lib/overlay/index.js +17 -0
- package/lib/overlay/overlay.css +1 -0
- package/lib/overlay/props.js +24 -0
- package/lib/overlay/style/index.js +2 -0
- package/lib/popup/Popup.js +1 -1
- package/lib/popup/popup.css +1 -1
- package/lib/popup/props.js +4 -0
- package/lib/result/Empty.js +32 -0
- package/lib/result/Error.js +32 -0
- package/lib/result/Info.js +32 -0
- package/lib/result/Question.js +32 -0
- package/lib/result/Result.js +117 -0
- package/lib/result/ResultSfc.css +0 -0
- package/lib/result/Success.js +86 -0
- package/lib/result/Warning.js +32 -0
- package/lib/result/index.js +17 -0
- package/lib/result/props.js +30 -0
- package/lib/result/result.css +1 -0
- package/lib/result/style/index.js +3 -0
- package/lib/style.css +1 -1
- package/lib/style.js +3 -0
- package/lib/themes/dark/index.js +3 -1
- package/lib/themes/dark/result.js +14 -0
- package/lib/utils/elements.js +18 -8
- package/package.json +6 -7
- package/types/appBar.d.ts +1 -0
- package/types/index.d.ts +6 -0
- package/types/loadingBar.d.ts +18 -0
- package/types/overlay.d.ts +19 -0
- package/types/popup.d.ts +2 -2
- package/types/result.d.ts +25 -0
- package/umd/varlet.js +7 -7
- package/CHANGELOG.md +0 -1885
package/lib/style.js
CHANGED
|
@@ -31,9 +31,11 @@ require('./lazy/style')
|
|
|
31
31
|
require('./link/style')
|
|
32
32
|
require('./list/style')
|
|
33
33
|
require('./loading/style')
|
|
34
|
+
require('./loading-bar/style')
|
|
34
35
|
require('./locale/style')
|
|
35
36
|
require('./menu/style')
|
|
36
37
|
require('./option/style')
|
|
38
|
+
require('./overlay/style')
|
|
37
39
|
require('./pagination/style')
|
|
38
40
|
require('./picker/style')
|
|
39
41
|
require('./popup/style')
|
|
@@ -42,6 +44,7 @@ require('./pull-refresh/style')
|
|
|
42
44
|
require('./radio/style')
|
|
43
45
|
require('./radio-group/style')
|
|
44
46
|
require('./rate/style')
|
|
47
|
+
require('./result/style')
|
|
45
48
|
require('./ripple/style')
|
|
46
49
|
require('./row/style')
|
|
47
50
|
require('./select/style')
|
package/lib/themes/dark/index.js
CHANGED
|
@@ -37,6 +37,8 @@ var _pullRefresh = _interopRequireDefault(require("./pullRefresh"));
|
|
|
37
37
|
|
|
38
38
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
39
39
|
|
|
40
|
+
var _result = _interopRequireDefault(require("./result"));
|
|
41
|
+
|
|
40
42
|
var _select = _interopRequireDefault(require("./select"));
|
|
41
43
|
|
|
42
44
|
var _skeleton = _interopRequireDefault(require("./skeleton"));
|
|
@@ -78,6 +80,6 @@ var _default = _extends({
|
|
|
78
80
|
'--color-danger': '#ef5350',
|
|
79
81
|
'--color-disabled': '#404040',
|
|
80
82
|
'--color-text-disabled': '#757575'
|
|
81
|
-
}, _button.default, _cell.default, _card.default, _timePicker.default, _datePicker.default, _skeleton.default, _tabs.default, _tab.default, _popup.default, _dialog.default, _actionSheet.default, _chip.default, _badge.default, _uploader.default, _collapse.default, _pullRefresh.default, _switch.default, _steps.default, _pagination.default, _table.default, _input.default, _select.default, _radio.default, _checkbox.default, _divider.default, _picker.default, _appBar.default, _bottomNavigation.default, _bottomNavigationItem.default, _menu.default);
|
|
83
|
+
}, _button.default, _cell.default, _card.default, _timePicker.default, _datePicker.default, _skeleton.default, _tabs.default, _tab.default, _popup.default, _dialog.default, _actionSheet.default, _chip.default, _badge.default, _uploader.default, _collapse.default, _pullRefresh.default, _switch.default, _steps.default, _pagination.default, _table.default, _input.default, _select.default, _radio.default, _checkbox.default, _divider.default, _picker.default, _appBar.default, _bottomNavigation.default, _bottomNavigationItem.default, _menu.default, _result.default);
|
|
82
84
|
|
|
83
85
|
exports.default = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
'--result-background': '#303030',
|
|
7
|
+
'--result-title-color': '#ffffff',
|
|
8
|
+
'--result-description-color': '#aaaaaa',
|
|
9
|
+
'--result-question-color': '#7f8e96',
|
|
10
|
+
'--result-question-border-color': 'rgba(151,194,216,0.3)',
|
|
11
|
+
'--result-empty-color': '#adadad',
|
|
12
|
+
'--result-empty-border-color': 'rgba(232,229,229,0.3)'
|
|
13
|
+
};
|
|
14
|
+
exports.default = _default;
|
package/lib/utils/elements.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.getScrollTop = getScrollTop;
|
|
|
12
12
|
exports.getTop = getTop;
|
|
13
13
|
exports.getTranslate = getTranslate;
|
|
14
14
|
exports.inViewport = inViewport;
|
|
15
|
-
exports.multiplySizeUnit = exports.isVw = exports.isVh = exports.isRem = exports.isPx = exports.isPercent = void 0;
|
|
15
|
+
exports.multiplySizeUnit = exports.isVw = exports.isVh = exports.isVar = exports.isRem = exports.isPx = exports.isPercent = exports.isCalc = void 0;
|
|
16
16
|
exports.nextTickFrame = nextTickFrame;
|
|
17
17
|
exports.requestAnimationFrame = requestAnimationFrame;
|
|
18
18
|
exports.scrollTo = scrollTo;
|
|
@@ -124,31 +124,41 @@ function getAllParentScroller(el) {
|
|
|
124
124
|
} // example 1rem
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
var isRem = value => (0, _shared.isString)(value) && value.endsWith('rem'); //
|
|
127
|
+
var isRem = value => (0, _shared.isString)(value) && value.endsWith('rem'); // e.g. 1 || 1px
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
exports.isRem = isRem;
|
|
131
131
|
|
|
132
|
-
var isPx = value => (0, _shared.isString)(value) && value.endsWith('px') || (0, _shared.isNumber)(value); //
|
|
132
|
+
var isPx = value => (0, _shared.isString)(value) && value.endsWith('px') || (0, _shared.isNumber)(value); // e.g. 1%
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
exports.isPx = isPx;
|
|
136
136
|
|
|
137
|
-
var isPercent = value => (0, _shared.isString)(value) && value.endsWith('%'); //
|
|
137
|
+
var isPercent = value => (0, _shared.isString)(value) && value.endsWith('%'); // e.g. 1vw
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
exports.isPercent = isPercent;
|
|
141
141
|
|
|
142
|
-
var isVw = value => (0, _shared.isString)(value) && value.endsWith('vw'); //
|
|
142
|
+
var isVw = value => (0, _shared.isString)(value) && value.endsWith('vw'); // e.g. 1vh
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
exports.isVw = isVw;
|
|
146
146
|
|
|
147
|
-
var isVh = value => (0, _shared.isString)(value) && value.endsWith('vh'); //
|
|
147
|
+
var isVh = value => (0, _shared.isString)(value) && value.endsWith('vh'); // e.g. calc(1px + 1px)
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
exports.isVh = isVh;
|
|
151
151
|
|
|
152
|
+
var isCalc = value => (0, _shared.isString)(value) && value.startsWith('calc('); // e.g. var(--color-primary)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
exports.isCalc = isCalc;
|
|
156
|
+
|
|
157
|
+
var isVar = value => (0, _shared.isString)(value) && value.startsWith('var('); // e.g. return 1
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
exports.isVar = isVar;
|
|
161
|
+
|
|
152
162
|
var toPxNum = value => {
|
|
153
163
|
if ((0, _shared.isNumber)(value)) {
|
|
154
164
|
return value;
|
|
@@ -178,7 +188,7 @@ var toPxNum = value => {
|
|
|
178
188
|
|
|
179
189
|
|
|
180
190
|
return 0;
|
|
181
|
-
}; //
|
|
191
|
+
}; // e.g. return 1px 1% 1vw 1vh 1rem null var(--color-primary) calc(1px + 1px)
|
|
182
192
|
|
|
183
193
|
|
|
184
194
|
exports.toPxNum = toPxNum;
|
|
@@ -188,7 +198,7 @@ var toSizeUnit = value => {
|
|
|
188
198
|
return undefined;
|
|
189
199
|
}
|
|
190
200
|
|
|
191
|
-
if (isPercent(value) || isVw(value) || isVh(value) || isRem(value)) {
|
|
201
|
+
if (isPercent(value) || isVw(value) || isVh(value) || isRem(value) || isCalc(value) || isVar(value)) {
|
|
192
202
|
return value;
|
|
193
203
|
}
|
|
194
204
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-alpha.1670751751241",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"es",
|
|
22
22
|
"umd",
|
|
23
23
|
"highlight",
|
|
24
|
-
"types"
|
|
25
|
-
"CHANGELOG.md"
|
|
24
|
+
"types"
|
|
26
25
|
],
|
|
27
26
|
"author": "haoziqaq <357229046@qq.com>",
|
|
28
27
|
"license": "MIT",
|
|
@@ -48,8 +47,8 @@
|
|
|
48
47
|
"@popperjs/core": "^2.11.6",
|
|
49
48
|
"dayjs": "^1.10.4",
|
|
50
49
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/icons": "2.
|
|
52
|
-
"@varlet/shared": "2.
|
|
50
|
+
"@varlet/icons": "2.4.0-alpha.1670751751241",
|
|
51
|
+
"@varlet/shared": "2.4.0-alpha.1670751751241"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"@types/jest": "^26.0.15",
|
|
@@ -64,8 +63,8 @@
|
|
|
64
63
|
"typescript": "^4.4.4",
|
|
65
64
|
"vue": "3.2.25",
|
|
66
65
|
"vue-router": "4.0.12",
|
|
67
|
-
"@varlet/
|
|
68
|
-
"@varlet/
|
|
66
|
+
"@varlet/touch-emulator": "2.4.0-alpha.1670751751241",
|
|
67
|
+
"@varlet/cli": "2.4.0-alpha.1670751751241"
|
|
69
68
|
},
|
|
70
69
|
"browserslist": [
|
|
71
70
|
"Chrome >= 54",
|
package/types/appBar.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -34,9 +34,11 @@ export * from './lazy'
|
|
|
34
34
|
export * from './link'
|
|
35
35
|
export * from './list'
|
|
36
36
|
export * from './loading'
|
|
37
|
+
export * from './loadingBar'
|
|
37
38
|
export * from './locale'
|
|
38
39
|
export * from './menu'
|
|
39
40
|
export * from './option'
|
|
41
|
+
export * from './overlay'
|
|
40
42
|
export * from './pagination'
|
|
41
43
|
export * from './picker'
|
|
42
44
|
export * from './popup'
|
|
@@ -45,6 +47,7 @@ export * from './pullRefresh'
|
|
|
45
47
|
export * from './radio'
|
|
46
48
|
export * from './radioGroup'
|
|
47
49
|
export * from './rate'
|
|
50
|
+
export * from './result'
|
|
48
51
|
export * from './ripple'
|
|
49
52
|
export * from './row'
|
|
50
53
|
export * from './select'
|
|
@@ -104,9 +107,11 @@ declare module 'vue' {
|
|
|
104
107
|
VarLink: typeof import('@varlet/ui')['_LinkComponent']
|
|
105
108
|
VarList: typeof import('@varlet/ui')['_ListComponent']
|
|
106
109
|
VarLoading: typeof import('@varlet/ui')['_LoadingComponent']
|
|
110
|
+
VarLoadingBar: typeof import('@varlet/ui')['_LoadingBarComponent']
|
|
107
111
|
VarLocale: typeof import('@varlet/ui')['_LocaleComponent']
|
|
108
112
|
VarMenu: typeof import('@varlet/ui')['_MenuComponent']
|
|
109
113
|
VarOption: typeof import('@varlet/ui')['_OptionComponent']
|
|
114
|
+
VarOverlay: typeof import('@varlet/ui')['_OverlayComponent']
|
|
110
115
|
VarPagination: typeof import('@varlet/ui')['_PaginationComponent']
|
|
111
116
|
VarPicker: typeof import('@varlet/ui')['_PickerComponent']
|
|
112
117
|
VarPopup: typeof import('@varlet/ui')['_PopupComponent']
|
|
@@ -115,6 +120,7 @@ declare module 'vue' {
|
|
|
115
120
|
VarRadio: typeof import('@varlet/ui')['_RadioComponent']
|
|
116
121
|
VarRadioGroup: typeof import('@varlet/ui')['_RadioGroupComponent']
|
|
117
122
|
VarRate: typeof import('@varlet/ui')['_RateComponent']
|
|
123
|
+
VarResult: typeof import('@varlet/ui')['_ResultComponent']
|
|
118
124
|
VarRipple: typeof import('@varlet/ui')['_RippleComponent']
|
|
119
125
|
VarRow: typeof import('@varlet/ui')['_RowComponent']
|
|
120
126
|
VarSelect: typeof import('@varlet/ui')['_SelectComponent']
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LoadingBarOptions {
|
|
2
|
+
color?: string
|
|
3
|
+
errorColor?: string
|
|
4
|
+
height?: string | number
|
|
5
|
+
top?: string | number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ILoadingBar {
|
|
9
|
+
mergeConfig(options: LoadingBarOptions): void
|
|
10
|
+
|
|
11
|
+
start(): void
|
|
12
|
+
|
|
13
|
+
finish(): void
|
|
14
|
+
|
|
15
|
+
error(): void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const LoadingBar: ILoadingBar
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VarComponent, BasicAttributes } from './varComponent'
|
|
2
|
+
import { VNode, TeleportProps } from 'vue'
|
|
3
|
+
|
|
4
|
+
export interface OverlayProps extends BasicAttributes {
|
|
5
|
+
lockScroll?: boolean
|
|
6
|
+
teleport?: TeleportProps['to']
|
|
7
|
+
onClick?: () => void
|
|
8
|
+
'onUpdate:show'?: (show: boolean) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class Overlay extends VarComponent {
|
|
12
|
+
$props: OverlayProps
|
|
13
|
+
|
|
14
|
+
$slots: {
|
|
15
|
+
default(): VNode[]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class _OverlayComponent extends Overlay {}
|
package/types/popup.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VarComponent, BasicAttributes } from './varComponent'
|
|
2
|
-
import
|
|
3
|
-
import { VNode } from 'vue'
|
|
2
|
+
import { VNode, TeleportProps } from 'vue'
|
|
4
3
|
|
|
5
4
|
export type PopupPosition = 'top' | 'bottom' | 'right' | 'left' | 'center'
|
|
6
5
|
|
|
@@ -12,6 +11,7 @@ export interface PopupProps extends BasicAttributes {
|
|
|
12
11
|
overlayStyle?: Record<string, any>
|
|
13
12
|
lockScroll?: boolean
|
|
14
13
|
closeOnClickOverlay?: boolean
|
|
14
|
+
defaultStyle?: boolean
|
|
15
15
|
teleport?: TeleportProps['to']
|
|
16
16
|
onOpen?: () => void
|
|
17
17
|
onOpened?: () => void
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VarComponent, BasicAttributes } from './varComponent'
|
|
2
|
+
import { VNode } from 'vue'
|
|
3
|
+
|
|
4
|
+
export type ResultType = 'info' | 'success' | 'warning' | 'error' | 'question' | 'empty'
|
|
5
|
+
|
|
6
|
+
export interface ResultProps extends BasicAttributes {
|
|
7
|
+
type?: ResultType
|
|
8
|
+
title?: string
|
|
9
|
+
description?: string
|
|
10
|
+
imageSize?: string | number
|
|
11
|
+
animation?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class Result extends VarComponent {
|
|
15
|
+
$props: ResultProps
|
|
16
|
+
|
|
17
|
+
$slots: {
|
|
18
|
+
image(): VNode[]
|
|
19
|
+
title(): VNode[]
|
|
20
|
+
description(): VNode[]
|
|
21
|
+
footer(): VNode[]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class _ResultComponent extends Result {}
|