@varlet/ui 3.6.0-alpha.1728498016952 → 3.6.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/alert/Alert.mjs +136 -0
- package/es/alert/AlertSfc.css +0 -0
- package/es/alert/alert.css +1 -0
- package/es/alert/index.mjs +9 -0
- package/es/alert/props.mjs +23 -0
- package/es/alert/style/index.mjs +5 -0
- package/es/code/Code.mjs +3 -3
- package/es/code/props.mjs +7 -7
- package/es/index.bundle.mjs +7 -1
- package/es/index.mjs +6 -1
- package/es/style.css +1 -1
- package/es/style.mjs +1 -0
- package/es/themes/dark/alert.mjs +33 -0
- package/es/themes/dark/index.mjs +3 -2
- package/es/themes/md3-dark/alert.mjs +33 -0
- package/es/themes/md3-dark/index.mjs +3 -2
- package/es/themes/md3-light/alert.mjs +33 -0
- package/es/themes/md3-light/index.mjs +3 -2
- package/es/varlet.esm.js +4631 -4394
- package/highlight/web-types.en-US.json +115 -1
- package/highlight/web-types.zh-CN.json +115 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +1323 -1080
- package/package.json +7 -7
- package/types/alert.d.ts +35 -0
- package/types/code.d.ts +1 -0
- package/types/index.d.ts +2 -0
- package/types/styleVars.d.ts +28 -0
- package/umd/varlet.js +8 -8
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import VarIcon from "../icon/index.mjs";
|
|
2
|
+
import { defineComponent, computed } from "vue";
|
|
3
|
+
import { props } from "./props.mjs";
|
|
4
|
+
import { createNamespace, formatElevation } from "../utils/components.mjs";
|
|
5
|
+
import { call } from "@varlet/shared";
|
|
6
|
+
const { name, n, classes } = createNamespace("alert");
|
|
7
|
+
const iconTypeMap = {
|
|
8
|
+
success: "checkbox-marked-circle",
|
|
9
|
+
warning: "warning",
|
|
10
|
+
info: "information",
|
|
11
|
+
danger: "error"
|
|
12
|
+
};
|
|
13
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeStyle as _normalizeStyle } from "vue";
|
|
14
|
+
function __render__(_ctx, _cache) {
|
|
15
|
+
const _component_var_icon = _resolveComponent("var-icon");
|
|
16
|
+
return _openBlock(), _createElementBlock(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.n(`--${_ctx.variant}`), _ctx.n(`--${_ctx.type}`), _ctx.formatElevation(_ctx.elevation, 2))),
|
|
20
|
+
style: _normalizeStyle({
|
|
21
|
+
"background-color": _ctx.color
|
|
22
|
+
}),
|
|
23
|
+
role: "alert"
|
|
24
|
+
},
|
|
25
|
+
[
|
|
26
|
+
_ctx.isInternalType || _ctx.$slots["icon"] ? (_openBlock(), _createElementBlock(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
key: 0,
|
|
30
|
+
class: _normalizeClass(_ctx.n("icon"))
|
|
31
|
+
},
|
|
32
|
+
[
|
|
33
|
+
_renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
34
|
+
_ctx.isInternalType ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
35
|
+
key: 0,
|
|
36
|
+
name: _ctx.iconTypeMap[_ctx.type]
|
|
37
|
+
}, null, 8, ["name"])) : _createCommentVNode("v-if", true)
|
|
38
|
+
])
|
|
39
|
+
],
|
|
40
|
+
2
|
|
41
|
+
/* CLASS */
|
|
42
|
+
)) : _createCommentVNode("v-if", true),
|
|
43
|
+
_renderSlot(_ctx.$slots, "content", {}, () => [
|
|
44
|
+
_createElementVNode(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
class: _normalizeClass(_ctx.n("content"))
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
_ctx.title || _ctx.$slots["title"] ? (_openBlock(), _createElementBlock(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
key: 0,
|
|
54
|
+
class: _normalizeClass(_ctx.n("title"))
|
|
55
|
+
},
|
|
56
|
+
[
|
|
57
|
+
_renderSlot(_ctx.$slots, "title", {}, () => [
|
|
58
|
+
_createTextVNode(
|
|
59
|
+
_toDisplayString(_ctx.title),
|
|
60
|
+
1
|
|
61
|
+
/* TEXT */
|
|
62
|
+
)
|
|
63
|
+
])
|
|
64
|
+
],
|
|
65
|
+
2
|
|
66
|
+
/* CLASS */
|
|
67
|
+
)) : _createCommentVNode("v-if", true),
|
|
68
|
+
_ctx.message || _ctx.$slots["default"] ? (_openBlock(), _createElementBlock(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
key: 1,
|
|
72
|
+
class: _normalizeClass(_ctx.n("message"))
|
|
73
|
+
},
|
|
74
|
+
[
|
|
75
|
+
_renderSlot(_ctx.$slots, "default", {}, () => [
|
|
76
|
+
_createTextVNode(
|
|
77
|
+
_toDisplayString(_ctx.message),
|
|
78
|
+
1
|
|
79
|
+
/* TEXT */
|
|
80
|
+
)
|
|
81
|
+
])
|
|
82
|
+
],
|
|
83
|
+
2
|
|
84
|
+
/* CLASS */
|
|
85
|
+
)) : _createCommentVNode("v-if", true)
|
|
86
|
+
],
|
|
87
|
+
2
|
|
88
|
+
/* CLASS */
|
|
89
|
+
)
|
|
90
|
+
]),
|
|
91
|
+
_ctx.closeable ? (_openBlock(), _createElementBlock(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
key: 1,
|
|
95
|
+
class: _normalizeClass(_ctx.n("close-icon")),
|
|
96
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClose && _ctx.handleClose(...args))
|
|
97
|
+
},
|
|
98
|
+
[
|
|
99
|
+
_renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
|
100
|
+
_createVNode(_component_var_icon, { name: "close-circle" })
|
|
101
|
+
])
|
|
102
|
+
],
|
|
103
|
+
2
|
|
104
|
+
/* CLASS */
|
|
105
|
+
)) : _createCommentVNode("v-if", true)
|
|
106
|
+
],
|
|
107
|
+
6
|
|
108
|
+
/* CLASS, STYLE */
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
const __sfc__ = defineComponent({
|
|
112
|
+
name,
|
|
113
|
+
components: {
|
|
114
|
+
VarIcon
|
|
115
|
+
},
|
|
116
|
+
props,
|
|
117
|
+
setup(props2) {
|
|
118
|
+
const isInternalType = computed(() => ["info", "success", "danger", "warning"].includes(props2.type));
|
|
119
|
+
function handleClose(e) {
|
|
120
|
+
call(props2.onClose, e);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
n,
|
|
124
|
+
classes,
|
|
125
|
+
iconTypeMap,
|
|
126
|
+
isInternalType,
|
|
127
|
+
formatElevation,
|
|
128
|
+
handleClose
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
__sfc__.render = __render__;
|
|
133
|
+
var stdin_default = __sfc__;
|
|
134
|
+
export {
|
|
135
|
+
stdin_default as default
|
|
136
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --alert-padding: 16px; --alert-border-radius: 4px; --alert-icon-size: 22px; --alert-icon-margin: 0 12px 0 0; --alert-close-icon-size: 22px; --alert-close-icon-margin: 2px 0 0 12px; --alert-standard-info-text-color: var(--color-on-info); --alert-standard-danger-text-color: var(--color-on-danger); --alert-standard-success-text-color: var(--color-on-success); --alert-standard-warning-text-color: var(--color-on-warning); --alert-danger-background: var(--color-danger); --alert-success-background: var(--color-success); --alert-warning-background: var(--color-warning); --alert-info-background: var(--color-info); --alert-tonal-danger-background: hsla(var(--hsl-danger), 0.12); --alert-tonal-success-background: hsla(var(--hsl-success), 0.12); --alert-tonal-warning-background: hsla(var(--hsl-warning), 0.12); --alert-tonal-info-background: hsla(var(--hsl-info), 0.12); --alert-tonal-danger-text-color: var(--color-danger); --alert-tonal-success-text-color: var(--color-success); --alert-tonal-warning-text-color: var(--color-warning); --alert-tonal-info-text-color: var(--color-info); --alert-message-font-size: 14px; --alert-title-font-size: 16px; --alert-title-font-weight: 500; --alert-message-margin-top: 4px; --alert-message-line-height: 1.5; --alert-title-line-height: 1.5;}.var-alert { display: flex; padding: var(--alert-padding); border-radius: var(--alert-border-radius);}.var-alert__icon { margin: var(--alert-icon-margin);}.var-alert__icon .var-icon { font-size: var(--alert-icon-size);}.var-alert__content { flex: 1;}.var-alert__title { font-size: var(--alert-title-font-size); font-weight: var(--alert-title-font-weight); line-height: var(--alert-title-line-height); word-break: normal; word-wrap: break-word;}.var-alert__title + .var-alert__message { margin-top: var(--alert-message-margin-top);}.var-alert__message { font-size: var(--alert-message-font-size); line-height: var(--alert-message-line-height);}.var-alert__close-icon { cursor: pointer; margin: var(--alert-close-icon-margin);}.var-alert__close-icon .var-icon[alert-cover] { font-size: var(--alert-close-icon-size);}.var-alert--outlined { border: thin solid currentColor; background-color: transparent;}.var-alert--outlined.var-alert--info { border-color: var(--alert-info-background); color: var(--alert-info-background);}.var-alert--outlined.var-alert--success { border-color: var(--alert-success-background); color: var(--alert-success-background);}.var-alert--outlined.var-alert--warning { border-color: var(--alert-warning-background); color: var(--alert-warning-background);}.var-alert--outlined.var-alert--danger { border-color: var(--alert-danger-background); color: var(--alert-danger-background);}.var-alert--tonal.var-alert--info { background-color: var(--alert-tonal-info-background); color: var(--alert-tonal-info-text-color);}.var-alert--tonal.var-alert--success { background-color: var(--alert-tonal-success-background); color: var(--alert-tonal-success-text-color);}.var-alert--tonal.var-alert--warning { background-color: var(--alert-tonal-warning-background); color: var(--alert-tonal-warning-text-color);}.var-alert--tonal.var-alert--danger { background-color: var(--alert-tonal-danger-background); color: var(--alert-tonal-danger-text-color);}.var-alert--standard.var-alert--info { background-color: var(--alert-info-background); color: var(--alert-standard-info-text-color);}.var-alert--standard.var-alert--success { background-color: var(--alert-success-background); color: var(--alert-standard-success-text-color);}.var-alert--standard.var-alert--warning { background-color: var(--alert-warning-background); color: var(--alert-standard-warning-text-color);}.var-alert--standard.var-alert--danger { background-color: var(--alert-danger-background); color: var(--alert-standard-danger-text-color);}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineListenerProp } from "../utils/components.mjs";
|
|
2
|
+
const props = {
|
|
3
|
+
type: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: "info"
|
|
6
|
+
},
|
|
7
|
+
variant: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "standard"
|
|
10
|
+
},
|
|
11
|
+
color: String,
|
|
12
|
+
title: String,
|
|
13
|
+
message: String,
|
|
14
|
+
closeable: Boolean,
|
|
15
|
+
elevation: {
|
|
16
|
+
type: [Boolean, String, Number],
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
onClose: defineListenerProp()
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
props
|
|
23
|
+
};
|
package/es/code/Code.mjs
CHANGED
|
@@ -43,12 +43,12 @@ const __sfc__ = defineComponent({
|
|
|
43
43
|
});
|
|
44
44
|
if (highlighter) {
|
|
45
45
|
watch(
|
|
46
|
-
() => [highlighter.value, props2.code, props2.language, normalizedTheme.value],
|
|
47
|
-
(_0) => __async(this, [_0], function* ([highlighter2, code, lang, theme2]) {
|
|
46
|
+
() => [highlighter.value, props2.code, props2.language, normalizedTheme.value, props2.trim],
|
|
47
|
+
(_0) => __async(this, [_0], function* ([highlighter2, code, lang, theme2, trim]) {
|
|
48
48
|
if (!highlighter2) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
highlightedCode.value = yield highlighter2.codeToHtml(code, { lang, theme: theme2 });
|
|
51
|
+
highlightedCode.value = yield highlighter2.codeToHtml(trim ? code.trim() : code, { lang, theme: theme2 });
|
|
52
52
|
}),
|
|
53
53
|
{ immediate: true }
|
|
54
54
|
);
|
package/es/code/props.mjs
CHANGED
|
@@ -3,13 +3,13 @@ const props = {
|
|
|
3
3
|
type: String,
|
|
4
4
|
default: ""
|
|
5
5
|
},
|
|
6
|
-
language:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type:
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
language: String,
|
|
7
|
+
theme: String,
|
|
8
|
+
wordWrap: Boolean,
|
|
9
|
+
trim: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: true
|
|
12
|
+
}
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
15
|
props
|
package/es/index.bundle.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ActionSheet from './action-sheet/index.mjs'
|
|
2
|
+
import Alert from './alert/index.mjs'
|
|
2
3
|
import AppBar from './app-bar/index.mjs'
|
|
3
4
|
import AutoComplete from './auto-complete/index.mjs'
|
|
4
5
|
import Avatar from './avatar/index.mjs'
|
|
@@ -91,6 +92,7 @@ import Uploader from './uploader/index.mjs'
|
|
|
91
92
|
import Watermark from './watermark/index.mjs'
|
|
92
93
|
|
|
93
94
|
export * from './action-sheet/index.mjs'
|
|
95
|
+
export * from './alert/index.mjs'
|
|
94
96
|
export * from './app-bar/index.mjs'
|
|
95
97
|
export * from './auto-complete/index.mjs'
|
|
96
98
|
export * from './avatar/index.mjs'
|
|
@@ -183,6 +185,7 @@ export * from './uploader/index.mjs'
|
|
|
183
185
|
export * from './watermark/index.mjs'
|
|
184
186
|
|
|
185
187
|
import './action-sheet/style/index.mjs'
|
|
188
|
+
import './alert/style/index.mjs'
|
|
186
189
|
import './app-bar/style/index.mjs'
|
|
187
190
|
import './auto-complete/style/index.mjs'
|
|
188
191
|
import './avatar/style/index.mjs'
|
|
@@ -274,10 +277,11 @@ import './tooltip/style/index.mjs'
|
|
|
274
277
|
import './uploader/style/index.mjs'
|
|
275
278
|
import './watermark/style/index.mjs'
|
|
276
279
|
|
|
277
|
-
const version = '3.6.0
|
|
280
|
+
const version = '3.6.0'
|
|
278
281
|
|
|
279
282
|
function install(app) {
|
|
280
283
|
ActionSheet.install && app.use(ActionSheet)
|
|
284
|
+
Alert.install && app.use(Alert)
|
|
281
285
|
AppBar.install && app.use(AppBar)
|
|
282
286
|
AutoComplete.install && app.use(AutoComplete)
|
|
283
287
|
Avatar.install && app.use(Avatar)
|
|
@@ -374,6 +378,7 @@ export {
|
|
|
374
378
|
version,
|
|
375
379
|
install,
|
|
376
380
|
ActionSheet,
|
|
381
|
+
Alert,
|
|
377
382
|
AppBar,
|
|
378
383
|
AutoComplete,
|
|
379
384
|
Avatar,
|
|
@@ -470,6 +475,7 @@ export default {
|
|
|
470
475
|
version,
|
|
471
476
|
install,
|
|
472
477
|
ActionSheet,
|
|
478
|
+
Alert,
|
|
473
479
|
AppBar,
|
|
474
480
|
AutoComplete,
|
|
475
481
|
Avatar,
|
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ActionSheet from './action-sheet/index.mjs'
|
|
2
|
+
import Alert from './alert/index.mjs'
|
|
2
3
|
import AppBar from './app-bar/index.mjs'
|
|
3
4
|
import AutoComplete from './auto-complete/index.mjs'
|
|
4
5
|
import Avatar from './avatar/index.mjs'
|
|
@@ -91,6 +92,7 @@ import Uploader from './uploader/index.mjs'
|
|
|
91
92
|
import Watermark from './watermark/index.mjs'
|
|
92
93
|
|
|
93
94
|
export * from './action-sheet/index.mjs'
|
|
95
|
+
export * from './alert/index.mjs'
|
|
94
96
|
export * from './app-bar/index.mjs'
|
|
95
97
|
export * from './auto-complete/index.mjs'
|
|
96
98
|
export * from './avatar/index.mjs'
|
|
@@ -182,10 +184,11 @@ export * from './tooltip/index.mjs'
|
|
|
182
184
|
export * from './uploader/index.mjs'
|
|
183
185
|
export * from './watermark/index.mjs'
|
|
184
186
|
|
|
185
|
-
const version = '3.6.0
|
|
187
|
+
const version = '3.6.0'
|
|
186
188
|
|
|
187
189
|
function install(app) {
|
|
188
190
|
ActionSheet.install && app.use(ActionSheet)
|
|
191
|
+
Alert.install && app.use(Alert)
|
|
189
192
|
AppBar.install && app.use(AppBar)
|
|
190
193
|
AutoComplete.install && app.use(AutoComplete)
|
|
191
194
|
Avatar.install && app.use(Avatar)
|
|
@@ -282,6 +285,7 @@ export {
|
|
|
282
285
|
version,
|
|
283
286
|
install,
|
|
284
287
|
ActionSheet,
|
|
288
|
+
Alert,
|
|
285
289
|
AppBar,
|
|
286
290
|
AutoComplete,
|
|
287
291
|
Avatar,
|
|
@@ -378,6 +382,7 @@ export default {
|
|
|
378
382
|
version,
|
|
379
383
|
install,
|
|
380
384
|
ActionSheet,
|
|
385
|
+
Alert,
|
|
381
386
|
AppBar,
|
|
382
387
|
AutoComplete,
|
|
383
388
|
Avatar,
|