@varlet/ui 2.19.3-alpha.1701190302604 → 2.19.3
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/badge/Badge.mjs +24 -2
- package/es/badge/badge.css +1 -1
- package/es/badge/props.mjs +9 -1
- package/es/collapse/Collapse.mjs +5 -5
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/varlet.esm.js +2750 -2729
- package/highlight/web-types.en-US.json +19 -1
- package/highlight/web-types.zh-CN.json +19 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +174 -145
- package/package.json +7 -7
- package/types/badge.d.ts +2 -0
- package/umd/varlet.js +5 -5
package/es/badge/Badge.mjs
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import VarIcon from "../icon/index.mjs";
|
|
2
18
|
import { toNumber } from "@varlet/shared";
|
|
3
19
|
import { computed, defineComponent } from "vue";
|
|
4
20
|
import { props } from "./props.mjs";
|
|
5
21
|
import { createNamespace } from "../utils/components.mjs";
|
|
22
|
+
import { toSizeUnit } from "../utils/elements.mjs";
|
|
6
23
|
const { name, n, classes } = createNamespace("badge");
|
|
7
24
|
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vShow as _vShow, mergeProps as _mergeProps, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
8
25
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
@@ -27,11 +44,11 @@ function __render__(_ctx, _cache) {
|
|
|
27
44
|
class: _ctx.classes(
|
|
28
45
|
_ctx.n("content"),
|
|
29
46
|
_ctx.n(`--${_ctx.type}`),
|
|
30
|
-
[_ctx.$slots.default, _ctx.n(`--${_ctx.position}`)],
|
|
47
|
+
[_ctx.$slots.default, _ctx.n(`--${_ctx.position}`), _ctx.n("--offset")],
|
|
31
48
|
[_ctx.dot, _ctx.n("--dot")],
|
|
32
49
|
[_ctx.icon, _ctx.n("--icon")]
|
|
33
50
|
),
|
|
34
|
-
style: { background: _ctx.color }
|
|
51
|
+
style: __spreadValues({ background: _ctx.color }, _ctx.offsetStyle)
|
|
35
52
|
}, _ctx.$attrs),
|
|
36
53
|
[
|
|
37
54
|
_ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
@@ -75,8 +92,13 @@ const __sfc__ = defineComponent({
|
|
|
75
92
|
const { value: value2, maxValue } = props2;
|
|
76
93
|
return value2 != null && maxValue != null && toNumber(value2) > toNumber(maxValue) ? `${maxValue}+` : value2;
|
|
77
94
|
});
|
|
95
|
+
const offsetStyle = computed(() => ({
|
|
96
|
+
[`--badge-offset-y`]: toSizeUnit(props2.offsetY),
|
|
97
|
+
[`--badge-offset-x`]: toSizeUnit(props2.offsetX)
|
|
98
|
+
}));
|
|
78
99
|
return {
|
|
79
100
|
value,
|
|
101
|
+
offsetStyle,
|
|
80
102
|
n,
|
|
81
103
|
classes
|
|
82
104
|
};
|
package/es/badge/badge.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --badge-content-padding: 2px 6px; --badge-content-border: none; --badge-content-border-radius: 100px; --badge-content-font-size: 12px; --badge-icon-size: 12px; --badge-default-color: #e0e0e0; --badge-primary-color: var(--color-primary); --badge-danger-color: var(--color-danger); --badge-success-color: var(--color-success); --badge-warning-color: var(--color-warning); --badge-info-color: var(--color-info); --badge-dot-width: 8px; --badge-dot-height: 8px;}.var-badge { display: inline-block; position: relative; transition: background-color 0.25s;}.var-badge__content { display: inline-block; vertical-align: middle; text-align: center; padding: var(--badge-content-padding); border: var(--badge-content-border); border-radius: var(--badge-content-border-radius); color: #fff; font-size: var(--badge-content-font-size);}.var-badge__icon[var-badge-cover] { font-size: var(--badge-icon-size);}.var-badge--icon { padding: 2px 4px;}.var-badge--dot { box-sizing: content-box; width: var(--badge-dot-width); height: var(--badge-dot-height); padding: 0;}.var-badge--default { background: var(--badge-default-color);}.var-badge--primary { background: var(--badge-primary-color);}.var-badge--info { background: var(--badge-info-color);}.var-badge--warning { background: var(--badge-warning-color);}.var-badge--success { background: var(--badge-success-color);}.var-badge--danger { background: var(--badge-danger-color);}.var-badge--right-top { position: absolute; top: 0; right: 0; transform: translateY(-50%) translateX(50%);}.var-badge--left-top { position: absolute; top: 0; left: 0; transform: translateY(-50%) translateX(-50%);}.var-badge--right-bottom { position: absolute; bottom: 0; right: 0; transform: translateY(50%) translateX(50%);}.var-badge--left-bottom { position: absolute; bottom: 0; left: 0; transform: translateY(50%) translateX(-50%);}.var-badge-fade-enter-active,.var-badge-fade-leave-active { transition: opacity 0.15s var(--cubic-bezier);}.var-badge-fade-enter-from,.var-badge-fade-leave-to { opacity: 0;}
|
|
1
|
+
:root { --badge-content-padding: 2px 6px; --badge-content-border: none; --badge-content-border-radius: 100px; --badge-content-font-size: 12px; --badge-icon-size: 12px; --badge-default-color: #e0e0e0; --badge-primary-color: var(--color-primary); --badge-danger-color: var(--color-danger); --badge-success-color: var(--color-success); --badge-warning-color: var(--color-warning); --badge-info-color: var(--color-info); --badge-dot-width: 8px; --badge-dot-height: 8px;}.var-badge { display: inline-block; position: relative; transition: background-color 0.25s;}.var-badge__content { display: inline-block; vertical-align: middle; text-align: center; padding: var(--badge-content-padding); border: var(--badge-content-border); border-radius: var(--badge-content-border-radius); color: #fff; font-size: var(--badge-content-font-size);}.var-badge--offset { transform: translateX(var(--badge-offset-x)) translateY(var(--badge-offset-y));}.var-badge__icon[var-badge-cover] { font-size: var(--badge-icon-size);}.var-badge--icon { padding: 2px 4px;}.var-badge--dot { box-sizing: content-box; width: var(--badge-dot-width); height: var(--badge-dot-height); padding: 0;}.var-badge--default { background: var(--badge-default-color);}.var-badge--primary { background: var(--badge-primary-color);}.var-badge--info { background: var(--badge-info-color);}.var-badge--warning { background: var(--badge-warning-color);}.var-badge--success { background: var(--badge-success-color);}.var-badge--danger { background: var(--badge-danger-color);}.var-badge--right-top { position: absolute; top: 0; right: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-top { position: absolute; top: 0; left: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge--right-bottom { position: absolute; bottom: 0; right: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-bottom { position: absolute; bottom: 0; left: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge-fade-enter-active,.var-badge-fade-leave-active { transition: opacity 0.15s var(--cubic-bezier);}.var-badge-fade-enter-from,.var-badge-fade-leave-to { opacity: 0;}
|
package/es/badge/props.mjs
CHANGED
|
@@ -18,7 +18,15 @@ const props = {
|
|
|
18
18
|
dot: Boolean,
|
|
19
19
|
icon: pickProps(iconProps, "name"),
|
|
20
20
|
namespace: pickProps(iconProps, "namespace"),
|
|
21
|
-
color: String
|
|
21
|
+
color: String,
|
|
22
|
+
offsetX: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
offsetY: {
|
|
27
|
+
type: [String, Number],
|
|
28
|
+
default: 0
|
|
29
|
+
}
|
|
22
30
|
};
|
|
23
31
|
export {
|
|
24
32
|
props
|
package/es/collapse/Collapse.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { computed, defineComponent, nextTick, watch } from "vue";
|
|
|
2
2
|
import { useCollapseItem } from "./provide.mjs";
|
|
3
3
|
import { props } from "./props.mjs";
|
|
4
4
|
import { createNamespace } from "../utils/components.mjs";
|
|
5
|
-
import { normalizeToArray, call,
|
|
5
|
+
import { normalizeToArray, call, removeArrayBlank } from "@varlet/shared";
|
|
6
6
|
const { name, n } = createNamespace("collapse");
|
|
7
7
|
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
8
8
|
function __render__(_ctx, _cache) {
|
|
@@ -44,12 +44,12 @@ const __sfc__ = defineComponent({
|
|
|
44
44
|
bindCollapseItems(collapseProvider);
|
|
45
45
|
function updateItem(itemValue, targetExpand) {
|
|
46
46
|
if (props2.accordion) {
|
|
47
|
-
const
|
|
48
|
-
updateModelValue(
|
|
47
|
+
const modelValue2 = targetExpand ? itemValue : void 0;
|
|
48
|
+
updateModelValue(modelValue2);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
updateModelValue(
|
|
51
|
+
const modelValue = targetExpand ? [...normalizeValues.value, itemValue] : normalizeValues.value.filter((value) => value !== itemValue);
|
|
52
|
+
updateModelValue(modelValue);
|
|
53
53
|
}
|
|
54
54
|
function updateModelValue(modelValue) {
|
|
55
55
|
call(props2["onUpdate:modelValue"], modelValue);
|
package/es/index.bundle.mjs
CHANGED
|
@@ -259,7 +259,7 @@ import './tooltip/style/index.mjs'
|
|
|
259
259
|
import './uploader/style/index.mjs'
|
|
260
260
|
import './watermark/style/index.mjs'
|
|
261
261
|
|
|
262
|
-
const version = '2.19.3
|
|
262
|
+
const version = '2.19.3'
|
|
263
263
|
|
|
264
264
|
function install(app) {
|
|
265
265
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -172,7 +172,7 @@ export * from './tooltip/index.mjs'
|
|
|
172
172
|
export * from './uploader/index.mjs'
|
|
173
173
|
export * from './watermark/index.mjs'
|
|
174
174
|
|
|
175
|
-
const version = '2.19.3
|
|
175
|
+
const version = '2.19.3'
|
|
176
176
|
|
|
177
177
|
function install(app) {
|
|
178
178
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
|
+
import '../SnackbarSfc.css'
|
|
2
3
|
import '../../styles/elevation.css'
|
|
3
4
|
import '../../loading/loading.css'
|
|
4
5
|
import '../../button/button.css'
|
|
5
6
|
import '../../icon/icon.css'
|
|
6
7
|
import '../snackbar.css'
|
|
7
8
|
import '../coreSfc.css'
|
|
8
|
-
import '../SnackbarSfc.css'
|