@varlet/ui 1.27.7 → 1.27.9-alpha.1653036733481
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.js +1 -1
- package/es/card/Card.js +213 -12
- package/es/card/card.css +1 -1
- package/es/card/card.less +109 -7
- package/es/card/props.js +18 -0
- package/es/col/Col.js +6 -6
- package/es/col/col.css +1 -1
- package/es/col/col.less +27 -2
- package/es/index-bar/IndexBar.js +4 -4
- package/es/index-bar/props.js +1 -1
- package/es/loading/Loading.js +5 -14
- package/es/loading/loading.css +1 -1
- package/es/loading/loading.less +20 -0
- package/es/picker/Picker.js +10 -7
- package/es/picker/props.js +4 -0
- package/es/progress/Progress.js +14 -11
- package/es/progress/progress.css +1 -1
- package/es/progress/progress.less +3 -0
- package/es/progress/props.js +1 -1
- package/es/rate/Rate.js +4 -2
- package/es/rate/props.js +2 -4
- package/es/rate/rate.css +1 -1
- package/es/rate/rate.less +7 -0
- package/es/select/Select.js +3 -1
- package/es/slider/Slider.js +10 -9
- package/es/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- package/es/style.css +1 -1
- package/es/switch/Switch.js +22 -19
- package/es/switch/props.js +1 -2
- package/es/switch/switch.css +1 -1
- package/es/switch/switch.less +18 -4
- package/es/utils/elements.js +13 -0
- package/es/utils/jest.js +19 -0
- package/es/varlet.esm.js +338 -103
- package/highlight/attributes.json +24 -4
- package/highlight/tags.json +6 -1
- package/highlight/web-types.json +58 -5
- package/lib/badge/Badge.js +1 -1
- package/lib/card/Card.js +213 -8
- package/lib/card/card.css +1 -1
- package/lib/card/card.less +109 -7
- package/lib/card/props.js +18 -0
- package/lib/col/Col.js +6 -6
- package/lib/col/col.css +1 -1
- package/lib/col/col.less +27 -2
- package/lib/index-bar/IndexBar.js +3 -3
- package/lib/index-bar/props.js +1 -1
- package/lib/loading/Loading.js +6 -15
- package/lib/loading/loading.css +1 -1
- package/lib/loading/loading.less +20 -0
- package/lib/picker/Picker.js +10 -7
- package/lib/picker/props.js +4 -0
- package/lib/progress/Progress.js +15 -11
- package/lib/progress/progress.css +1 -1
- package/lib/progress/progress.less +3 -0
- package/lib/progress/props.js +1 -1
- package/lib/rate/Rate.js +3 -1
- package/lib/rate/props.js +2 -4
- package/lib/rate/rate.css +1 -1
- package/lib/rate/rate.less +7 -0
- package/lib/select/Select.js +3 -1
- package/lib/slider/Slider.js +9 -8
- package/lib/snackbar/style/index.js +1 -1
- package/lib/snackbar/style/less.js +1 -1
- package/lib/style.css +1 -1
- package/lib/switch/Switch.js +22 -19
- package/lib/switch/props.js +1 -2
- package/lib/switch/switch.css +1 -1
- package/lib/switch/switch.less +18 -4
- package/lib/utils/elements.js +17 -1
- package/lib/utils/jest.js +21 -0
- package/package.json +10 -9
- package/types/card.d.ts +2 -0
- package/types/indexBar.d.ts +1 -1
- package/types/picker.d.ts +2 -0
- package/umd/varlet.js +4 -4
package/es/index-bar/IndexBar.js
CHANGED
|
@@ -4,7 +4,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
4
4
|
|
|
5
5
|
import { computed, defineComponent, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
6
6
|
import { easeInOutCubic, isPlainObject, toNumber } from '../utils/shared';
|
|
7
|
-
import { doubleRaf, getParentScroller, getScrollLeft, getScrollTop, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo } from '../utils/elements';
|
|
7
|
+
import { doubleRaf, getParentScroller, getScrollLeft, getScrollTop, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo, toPxNum } from '../utils/elements';
|
|
8
8
|
import { useIndexAnchors } from './provide';
|
|
9
9
|
import { props } from './props';
|
|
10
10
|
import { createNamespace, call } from '../utils/components';
|
|
@@ -34,7 +34,7 @@ export function render(_ctx, _cache) {
|
|
|
34
34
|
style: _normalizeStyle({
|
|
35
35
|
color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ''
|
|
36
36
|
}),
|
|
37
|
-
onClick: $event => _ctx.anchorClick(anchorName)
|
|
37
|
+
onClick: $event => _ctx.anchorClick(anchorName, true)
|
|
38
38
|
}, _toDisplayString(anchorName), 15
|
|
39
39
|
/* TEXT, CLASS, STYLE, PROPS */
|
|
40
40
|
, _hoisted_1);
|
|
@@ -64,7 +64,7 @@ export default defineComponent({
|
|
|
64
64
|
var active = ref();
|
|
65
65
|
var sticky = computed(() => props.sticky);
|
|
66
66
|
var cssMode = computed(() => props.cssMode);
|
|
67
|
-
var stickyOffsetTop = computed(() => props.stickyOffsetTop);
|
|
67
|
+
var stickyOffsetTop = computed(() => toPxNum(props.stickyOffsetTop));
|
|
68
68
|
var zIndex = computed(() => props.zIndex);
|
|
69
69
|
var indexBarProvider = {
|
|
70
70
|
active,
|
|
@@ -140,7 +140,7 @@ export default defineComponent({
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
var scrollTo = index => {
|
|
143
|
-
requestAnimationFrame(() => anchorClick(index
|
|
143
|
+
requestAnimationFrame(() => anchorClick(index));
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
|
package/es/index-bar/props.js
CHANGED
package/es/loading/Loading.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, defineComponent } from 'vue';
|
|
2
2
|
import { props } from './props';
|
|
3
|
-
import { toNumber } from '../utils/shared';
|
|
4
3
|
import { createNamespace, call } from '../utils/components';
|
|
4
|
+
import { multiplySizeUnit } from '../utils/elements';
|
|
5
5
|
var {
|
|
6
6
|
n,
|
|
7
7
|
classes
|
|
@@ -42,10 +42,10 @@ export function render(_ctx, _cache) {
|
|
|
42
42
|
key: 0,
|
|
43
43
|
class: _normalizeClass(_ctx.n('circle'))
|
|
44
44
|
}, [_createElementVNode("span", {
|
|
45
|
-
class: _normalizeClass(_ctx.n('circle-block')),
|
|
45
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('circle-block'), _ctx.n("circle-block--" + _ctx.size))),
|
|
46
46
|
style: _normalizeStyle({
|
|
47
|
-
width: _ctx.
|
|
48
|
-
height: _ctx.
|
|
47
|
+
width: _ctx.multiplySizeUnit(_ctx.radius, 2),
|
|
48
|
+
height: _ctx.multiplySizeUnit(_ctx.radius, 2),
|
|
49
49
|
color: _ctx.color
|
|
50
50
|
})
|
|
51
51
|
}, _hoisted_2, 6
|
|
@@ -108,15 +108,6 @@ export default defineComponent({
|
|
|
108
108
|
rect: 8,
|
|
109
109
|
disappear: 3
|
|
110
110
|
};
|
|
111
|
-
var sizeDict = {
|
|
112
|
-
mini: 9,
|
|
113
|
-
small: 12,
|
|
114
|
-
normal: 15,
|
|
115
|
-
large: 18
|
|
116
|
-
};
|
|
117
|
-
var getRadius = computed(() => {
|
|
118
|
-
return props.radius ? toNumber(props.radius) : sizeDict[props.size];
|
|
119
|
-
});
|
|
120
111
|
var isShow = computed(() => {
|
|
121
112
|
if (!call(slots.default)) return true;
|
|
122
113
|
return props.loading;
|
|
@@ -124,8 +115,8 @@ export default defineComponent({
|
|
|
124
115
|
return {
|
|
125
116
|
n,
|
|
126
117
|
classes,
|
|
118
|
+
multiplySizeUnit,
|
|
127
119
|
loadingTypeDict,
|
|
128
|
-
getRadius,
|
|
129
120
|
isShow
|
|
130
121
|
};
|
|
131
122
|
}
|
package/es/loading/loading.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --loading-opacity: 0.38; --loading-desc-margin: 8px 0 0;}.var-loading { position: relative;}.var-loading__content { position: relative; transition: opacity 0.3s; opacity: 1;}.var-loading__content--active { opacity: var(--loading-opacity);}.var-loading__content-mask { position: absolute; left: 0; right: 0; top: 0; bottom: 0;}.var-loading__body { display: flex; justify-content: center; align-items: center; height: 100%; flex-direction: column;}.var-loading__inside { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;}.var-loading__description { color: currentColor; margin: var(--loading-desc-margin);}.var-loading__description--large { font-size: 16px;}.var-loading__description--normal { font-size: 14px;}.var-loading__description--small { font-size: 12px;}.var-loading__description--mini { font-size: 10px;}.var-loading__circle { display: flex;}.var-loading__circle-block { display: inline-block; animation: circle 1.8s linear infinite;}.var-loading__circle-block svg { display: block; width: 100%; height: 100%;}.var-loading__circle-block svg circle { animation: circular 1.5s ease-in-out infinite; stroke: currentColor; stroke-width: 3; stroke-linecap: round;}@keyframes circle { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}@keyframes circular { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120; }}.var-loading__wave { display: flex; align-items: center; justify-content: center;}.var-loading__wave--large { width: 64px; height: 18px;}.var-loading__wave--normal { width: 50px; height: 16px;}.var-loading__wave--small { width: 36px; height: 14px;}.var-loading__wave--mini { width: 22px; height: 12px;}.var-loading__wave-item { height: 100%; display: inline-block; animation: 1.2s ease-in-out infinite wave;}.var-loading__wave-item:nth-child(1) { animation-delay: -1.2s; margin-left: 0;}.var-loading__wave-item:nth-child(2) { animation-delay: -1.1s;}.var-loading__wave-item:nth-child(3) { animation-delay: -1s;}.var-loading__wave-item:nth-child(4) { animation-delay: -0.9s;}.var-loading__wave-item:nth-child(5) { animation-delay: -0.8s;}.var-loading__wave-item--large { width: 5px; margin-left: 5px;}.var-loading__wave-item--normal { width: 4px; margin-left: 4px;}.var-loading__wave-item--small { width: 3px; margin-left: 3px;}.var-loading__wave-item--mini { width: 2px; margin-left: 2px;}@keyframes wave { 0%, 40%, 100% { transform: scaleY(0.4); } 20% { transform: scaleY(1); }}.var-loading__cube { display: flex; align-items: center;}.var-loading__cube--large { width: 64px; height: 18px;}.var-loading__cube--normal { width: 50px; height: 16px;}.var-loading__cube--small { width: 36px; height: 14px;}.var-loading__cube--mini { width: 22px; height: 12px;}.var-loading__cube-item { display: inline-block; transform-origin: right bottom; animation: 1.5s ease infinite cube;}.var-loading__cube-item:nth-child(1) { animation-delay: 0.2s; margin-left: 0;}.var-loading__cube-item:nth-child(2) { animation-delay: 0.4s;}.var-loading__cube-item:nth-child(3) { animation-delay: 0.6s;}.var-loading__cube-item:nth-child(4) { animation-delay: 0.8s;}.var-loading__cube-item--large { height: 10px; width: 10px; margin-left: 5px;}.var-loading__cube-item--normal { height: 8px; width: 8px; margin-left: 4px;}.var-loading__cube-item--small { height: 6px; width: 6px; margin-left: 3px;}.var-loading__cube-item--mini { height: 4px; width: 4px; margin-left: 2px;}@keyframes cube { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: rotate(90deg) scale(0.3); }}.var-loading__rect { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;}.var-loading__rect--large { width: 64px; height: 18px;}.var-loading__rect--normal { width: 50px; height: 16px;}.var-loading__rect--small { width: 36px; height: 14px;}.var-loading__rect--mini { width: 22px; height: 12px;}.var-loading__rect-item { animation: 2s ease-in-out infinite rect;}.var-loading__rect-item:nth-child(1) { animation-delay: 1.75s;}.var-loading__rect-item:nth-child(2) { animation-delay: 1.5s;}.var-loading__rect-item:nth-child(3) { animation-delay: 1.25s;}.var-loading__rect-item:nth-child(4) { animation-delay: 1s;}.var-loading__rect-item:nth-child(5) { animation-delay: 0.75s;}.var-loading__rect-item:nth-child(6) { animation-delay: 0.5s;}.var-loading__rect-item:nth-child(7) { animation-delay: 0.25s;}.var-loading__rect-item:nth-child(8) { animation-delay: 0s;}.var-loading__rect-item--large { height: 100%; width: 8px;}.var-loading__rect-item--normal { height: 90%; width: 6.4px;}.var-loading__rect-item--small { height: 80%; width: 4.8px;}.var-loading__rect-item--mini { height: 70%; width: 3.2px;}@keyframes rect { 0% { opacity: 0.3; } 25% { opacity: 1; } 50% { opacity: 0.3; } 65% { opacity: 1; } 100% { opacity: 0.3; }}.var-loading__disappear { display: flex; justify-content: space-around; align-items: center; flex-flow: nowrap;}.var-loading__disappear--large { width: 64px; height: 18px;}.var-loading__disappear--normal { width: 50px; height: 16px;}.var-loading__disappear--small { width: 36px; height: 14px;}.var-loading__disappear--mini { width: 22px; height: 12px;}.var-loading__disappear-item { border-radius: 50%; animation: 0.5s ease-in-out infinite alternate disappear;}.var-loading__disappear-item:nth-child(1) { animation-delay: -0.4s;}.var-loading__disappear-item:nth-child(2) { animation-delay: -0.2s;}.var-loading__disappear-item:nth-child(3) { animation-delay: 0s;}.var-loading__disappear-item--large { height: 15px; width: 15px;}.var-loading__disappear-item--normal { height: 12px; width: 12px;}.var-loading__disappear-item--small { height: 9px; width: 9px;}.var-loading__disappear-item--mini { height: 6px; width: 6px;}@keyframes disappear { 0% { opacity: 1; } 100% { opacity: 0; }}
|
|
1
|
+
:root { --loading-opacity: 0.38; --loading-desc-margin: 8px 0 0;}.var-loading { position: relative;}.var-loading__content { position: relative; transition: opacity 0.3s; opacity: 1;}.var-loading__content--active { opacity: var(--loading-opacity);}.var-loading__content-mask { position: absolute; left: 0; right: 0; top: 0; bottom: 0;}.var-loading__body { display: flex; justify-content: center; align-items: center; height: 100%; flex-direction: column;}.var-loading__inside { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;}.var-loading__description { color: currentColor; margin: var(--loading-desc-margin);}.var-loading__description--large { font-size: 16px;}.var-loading__description--normal { font-size: 14px;}.var-loading__description--small { font-size: 12px;}.var-loading__description--mini { font-size: 10px;}.var-loading__circle { display: flex;}.var-loading__circle-block { display: inline-block; animation: circle 1.8s linear infinite;}.var-loading__circle-block--large { width: 36px; height: 36px;}.var-loading__circle-block--normal { width: 30px; height: 30px;}.var-loading__circle-block--small { width: 24px; height: 24px;}.var-loading__circle-block--mini { width: 18px; height: 18px;}.var-loading__circle-block svg { display: block; width: 100%; height: 100%;}.var-loading__circle-block svg circle { animation: circular 1.5s ease-in-out infinite; stroke: currentColor; stroke-width: 3; stroke-linecap: round;}@keyframes circle { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}@keyframes circular { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120; }}.var-loading__wave { display: flex; align-items: center; justify-content: center;}.var-loading__wave--large { width: 64px; height: 18px;}.var-loading__wave--normal { width: 50px; height: 16px;}.var-loading__wave--small { width: 36px; height: 14px;}.var-loading__wave--mini { width: 22px; height: 12px;}.var-loading__wave-item { height: 100%; display: inline-block; animation: 1.2s ease-in-out infinite wave;}.var-loading__wave-item:nth-child(1) { animation-delay: -1.2s; margin-left: 0;}.var-loading__wave-item:nth-child(2) { animation-delay: -1.1s;}.var-loading__wave-item:nth-child(3) { animation-delay: -1s;}.var-loading__wave-item:nth-child(4) { animation-delay: -0.9s;}.var-loading__wave-item:nth-child(5) { animation-delay: -0.8s;}.var-loading__wave-item--large { width: 5px; margin-left: 5px;}.var-loading__wave-item--normal { width: 4px; margin-left: 4px;}.var-loading__wave-item--small { width: 3px; margin-left: 3px;}.var-loading__wave-item--mini { width: 2px; margin-left: 2px;}@keyframes wave { 0%, 40%, 100% { transform: scaleY(0.4); } 20% { transform: scaleY(1); }}.var-loading__cube { display: flex; align-items: center;}.var-loading__cube--large { width: 64px; height: 18px;}.var-loading__cube--normal { width: 50px; height: 16px;}.var-loading__cube--small { width: 36px; height: 14px;}.var-loading__cube--mini { width: 22px; height: 12px;}.var-loading__cube-item { display: inline-block; transform-origin: right bottom; animation: 1.5s ease infinite cube;}.var-loading__cube-item:nth-child(1) { animation-delay: 0.2s; margin-left: 0;}.var-loading__cube-item:nth-child(2) { animation-delay: 0.4s;}.var-loading__cube-item:nth-child(3) { animation-delay: 0.6s;}.var-loading__cube-item:nth-child(4) { animation-delay: 0.8s;}.var-loading__cube-item--large { height: 10px; width: 10px; margin-left: 5px;}.var-loading__cube-item--normal { height: 8px; width: 8px; margin-left: 4px;}.var-loading__cube-item--small { height: 6px; width: 6px; margin-left: 3px;}.var-loading__cube-item--mini { height: 4px; width: 4px; margin-left: 2px;}@keyframes cube { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: rotate(90deg) scale(0.3); }}.var-loading__rect { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;}.var-loading__rect--large { width: 64px; height: 18px;}.var-loading__rect--normal { width: 50px; height: 16px;}.var-loading__rect--small { width: 36px; height: 14px;}.var-loading__rect--mini { width: 22px; height: 12px;}.var-loading__rect-item { animation: 2s ease-in-out infinite rect;}.var-loading__rect-item:nth-child(1) { animation-delay: 1.75s;}.var-loading__rect-item:nth-child(2) { animation-delay: 1.5s;}.var-loading__rect-item:nth-child(3) { animation-delay: 1.25s;}.var-loading__rect-item:nth-child(4) { animation-delay: 1s;}.var-loading__rect-item:nth-child(5) { animation-delay: 0.75s;}.var-loading__rect-item:nth-child(6) { animation-delay: 0.5s;}.var-loading__rect-item:nth-child(7) { animation-delay: 0.25s;}.var-loading__rect-item:nth-child(8) { animation-delay: 0s;}.var-loading__rect-item--large { height: 100%; width: 8px;}.var-loading__rect-item--normal { height: 90%; width: 6.4px;}.var-loading__rect-item--small { height: 80%; width: 4.8px;}.var-loading__rect-item--mini { height: 70%; width: 3.2px;}@keyframes rect { 0% { opacity: 0.3; } 25% { opacity: 1; } 50% { opacity: 0.3; } 65% { opacity: 1; } 100% { opacity: 0.3; }}.var-loading__disappear { display: flex; justify-content: space-around; align-items: center; flex-flow: nowrap;}.var-loading__disappear--large { width: 64px; height: 18px;}.var-loading__disappear--normal { width: 50px; height: 16px;}.var-loading__disappear--small { width: 36px; height: 14px;}.var-loading__disappear--mini { width: 22px; height: 12px;}.var-loading__disappear-item { border-radius: 50%; animation: 0.5s ease-in-out infinite alternate disappear;}.var-loading__disappear-item:nth-child(1) { animation-delay: -0.4s;}.var-loading__disappear-item:nth-child(2) { animation-delay: -0.2s;}.var-loading__disappear-item:nth-child(3) { animation-delay: 0s;}.var-loading__disappear-item--large { height: 15px; width: 15px;}.var-loading__disappear-item--normal { height: 12px; width: 12px;}.var-loading__disappear-item--small { height: 9px; width: 9px;}.var-loading__disappear-item--mini { height: 6px; width: 6px;}@keyframes disappear { 0% { opacity: 1; } 100% { opacity: 0; }}
|
package/es/loading/loading.less
CHANGED
|
@@ -84,6 +84,26 @@
|
|
|
84
84
|
display: inline-block;
|
|
85
85
|
animation: circle 1.8s linear infinite;
|
|
86
86
|
|
|
87
|
+
&--large {
|
|
88
|
+
width: 36px;
|
|
89
|
+
height: 36px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&--normal {
|
|
93
|
+
width: 30px;
|
|
94
|
+
height: 30px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--small {
|
|
98
|
+
width: 24px;
|
|
99
|
+
height: 24px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--mini {
|
|
103
|
+
width: 18px;
|
|
104
|
+
height: 18px;
|
|
105
|
+
}
|
|
106
|
+
|
|
87
107
|
svg {
|
|
88
108
|
display: block;
|
|
89
109
|
width: 100%;
|
package/es/picker/Picker.js
CHANGED
|
@@ -109,7 +109,7 @@ export function render(_ctx, _cache) {
|
|
|
109
109
|
key: t
|
|
110
110
|
}, [_createElementVNode("div", {
|
|
111
111
|
class: _normalizeClass(_ctx.n('text'))
|
|
112
|
-
}, _toDisplayString(t), 3
|
|
112
|
+
}, _toDisplayString(_ctx.textFormatter(t, c.columnIndex)), 3
|
|
113
113
|
/* TEXT, CLASS */
|
|
114
114
|
)], 6
|
|
115
115
|
/* CLASS, STYLE */
|
|
@@ -277,7 +277,7 @@ export default defineComponent({
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
var normalizeNormalColumns = normalColumns => {
|
|
280
|
-
return normalColumns.map(column => {
|
|
280
|
+
return normalColumns.map((column, columnIndex) => {
|
|
281
281
|
var _normalColumn$initial;
|
|
282
282
|
|
|
283
283
|
var normalColumn = isArray(column) ? {
|
|
@@ -290,6 +290,7 @@ export default defineComponent({
|
|
|
290
290
|
touching: false,
|
|
291
291
|
translate: center.value,
|
|
292
292
|
index: (_normalColumn$initial = normalColumn.initialIndex) != null ? _normalColumn$initial : 0,
|
|
293
|
+
columnIndex,
|
|
293
294
|
duration: 0,
|
|
294
295
|
momentumTime: 0,
|
|
295
296
|
column: normalColumn,
|
|
@@ -303,11 +304,11 @@ export default defineComponent({
|
|
|
303
304
|
|
|
304
305
|
var normalizeCascadeColumns = cascadeColumns => {
|
|
305
306
|
var scrollColumns = [];
|
|
306
|
-
createChildren(scrollColumns, cascadeColumns, true);
|
|
307
|
+
createChildren(scrollColumns, cascadeColumns, 0, true);
|
|
307
308
|
return scrollColumns;
|
|
308
309
|
};
|
|
309
310
|
|
|
310
|
-
var createChildren = function (scrollColumns, children, initial) {
|
|
311
|
+
var createChildren = function (scrollColumns, children, columnIndex, initial) {
|
|
311
312
|
if (initial === void 0) {
|
|
312
313
|
initial = false;
|
|
313
314
|
}
|
|
@@ -323,6 +324,7 @@ export default defineComponent({
|
|
|
323
324
|
touching: false,
|
|
324
325
|
translate: center.value,
|
|
325
326
|
index,
|
|
327
|
+
columnIndex,
|
|
326
328
|
duration: 0,
|
|
327
329
|
momentumTime: 0,
|
|
328
330
|
column: {
|
|
@@ -334,13 +336,13 @@ export default defineComponent({
|
|
|
334
336
|
};
|
|
335
337
|
scrollColumns.push(scrollColumn);
|
|
336
338
|
scrollTo(scrollColumn, scrollColumn.index, 0, true);
|
|
337
|
-
createChildren(scrollColumns, scrollColumn.columns[scrollColumn.index].children, initial);
|
|
339
|
+
createChildren(scrollColumns, scrollColumn.columns[scrollColumn.index].children, columnIndex + 1, initial);
|
|
338
340
|
}
|
|
339
341
|
};
|
|
340
342
|
|
|
341
343
|
var rebuildChildren = scrollColumn => {
|
|
342
344
|
scrollColumns.value.splice(scrollColumns.value.indexOf(scrollColumn) + 1);
|
|
343
|
-
createChildren(scrollColumns.value, scrollColumn.columns[scrollColumn.index].children);
|
|
345
|
+
createChildren(scrollColumns.value, scrollColumn.columns[scrollColumn.index].children, scrollColumn.columnIndex + 1);
|
|
344
346
|
};
|
|
345
347
|
|
|
346
348
|
var change = scrollColumn => {
|
|
@@ -418,7 +420,8 @@ export default defineComponent({
|
|
|
418
420
|
} = getPicked();
|
|
419
421
|
prevIndexes = [...indexes];
|
|
420
422
|
}, {
|
|
421
|
-
immediate: true
|
|
423
|
+
immediate: true,
|
|
424
|
+
deep: true
|
|
422
425
|
});
|
|
423
426
|
return {
|
|
424
427
|
n,
|
package/es/picker/props.js
CHANGED
|
@@ -59,5 +59,9 @@ export var props = _extends({
|
|
|
59
59
|
},
|
|
60
60
|
onCancel: {
|
|
61
61
|
type: Function
|
|
62
|
+
},
|
|
63
|
+
textFormatter: {
|
|
64
|
+
type: Function,
|
|
65
|
+
default: text => text
|
|
62
66
|
}
|
|
63
67
|
}, pickProps(popupProps, ['show', 'onUpdate:show', 'closeOnClickOverlay', 'teleport', 'onOpen', 'onClose', 'onOpened', 'onClosed', 'onClickOverlay', 'onRouteChange']));
|
package/es/progress/Progress.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed } from 'vue';
|
|
2
2
|
import { props } from './props';
|
|
3
3
|
import { toNumber } from '../utils/shared';
|
|
4
|
+
import { toSizeUnit, multiplySizeUnit, toPxNum } from '../utils/elements';
|
|
4
5
|
import { createNamespace } from '../utils/components';
|
|
5
6
|
var {
|
|
6
7
|
n,
|
|
@@ -22,7 +23,7 @@ export function render(_ctx, _cache) {
|
|
|
22
23
|
}, [_createElementVNode("div", _mergeProps({
|
|
23
24
|
class: _ctx.n('linear-block'),
|
|
24
25
|
style: {
|
|
25
|
-
height: _ctx.lineWidth
|
|
26
|
+
height: _ctx.toSizeUnit(_ctx.lineWidth)
|
|
26
27
|
}
|
|
27
28
|
}, _ctx.$attrs), [_ctx.track ? (_openBlock(), _createElementBlock("div", {
|
|
28
29
|
key: 0,
|
|
@@ -55,8 +56,8 @@ export function render(_ctx, _cache) {
|
|
|
55
56
|
key: 1,
|
|
56
57
|
class: _normalizeClass(_ctx.n('circle')),
|
|
57
58
|
style: _normalizeStyle({
|
|
58
|
-
width: _ctx.size
|
|
59
|
-
height: _ctx.size
|
|
59
|
+
width: _ctx.toSizeUnit(_ctx.size),
|
|
60
|
+
height: _ctx.toSizeUnit(_ctx.size)
|
|
60
61
|
})
|
|
61
62
|
}, [(_openBlock(), _createElementBlock("svg", {
|
|
62
63
|
class: _normalizeClass(_ctx.n('circle-svg')),
|
|
@@ -67,11 +68,11 @@ export function render(_ctx, _cache) {
|
|
|
67
68
|
}, [_ctx.track ? (_openBlock(), _createElementBlock("circle", {
|
|
68
69
|
key: 0,
|
|
69
70
|
class: _normalizeClass(_ctx.n('circle-background')),
|
|
70
|
-
cx: _ctx.size
|
|
71
|
-
cy: _ctx.size
|
|
71
|
+
cx: _ctx.multiplySizeUnit(_ctx.size, 0.5),
|
|
72
|
+
cy: _ctx.multiplySizeUnit(_ctx.size, 0.5),
|
|
72
73
|
r: _ctx.circleProps.radius,
|
|
73
74
|
fill: "transparent",
|
|
74
|
-
"stroke-width": _ctx.lineWidth,
|
|
75
|
+
"stroke-width": _ctx.toSizeUnit(_ctx.lineWidth),
|
|
75
76
|
style: _normalizeStyle({
|
|
76
77
|
strokeDasharray: _ctx.circleProps.perimeter,
|
|
77
78
|
stroke: _ctx.trackColor
|
|
@@ -80,11 +81,11 @@ export function render(_ctx, _cache) {
|
|
|
80
81
|
/* CLASS, STYLE, PROPS */
|
|
81
82
|
, _hoisted_2)) : _createCommentVNode("v-if", true), _createElementVNode("circle", {
|
|
82
83
|
class: _normalizeClass(_ctx.n('circle-certain')),
|
|
83
|
-
cx: _ctx.size
|
|
84
|
-
cy: _ctx.size
|
|
84
|
+
cx: _ctx.multiplySizeUnit(_ctx.size, 0.5),
|
|
85
|
+
cy: _ctx.multiplySizeUnit(_ctx.size, 0.5),
|
|
85
86
|
r: _ctx.circleProps.radius,
|
|
86
87
|
fill: "transparent",
|
|
87
|
-
"stroke-width": _ctx.lineWidth,
|
|
88
|
+
"stroke-width": _ctx.toSizeUnit(_ctx.lineWidth),
|
|
88
89
|
style: _normalizeStyle({
|
|
89
90
|
strokeDasharray: _ctx.circleProps.strokeDasharray,
|
|
90
91
|
stroke: _ctx.color
|
|
@@ -128,9 +129,9 @@ export default defineComponent({
|
|
|
128
129
|
lineWidth,
|
|
129
130
|
value
|
|
130
131
|
} = props;
|
|
131
|
-
var viewBox = "0 0 " + size + " " + size;
|
|
132
|
+
var viewBox = "0 0 " + toPxNum(size) + " " + toPxNum(size);
|
|
132
133
|
var roundValue = toNumber(value) > 100 ? 100 : Math.round(toNumber(value));
|
|
133
|
-
var radius = (size -
|
|
134
|
+
var radius = (toPxNum(size) - toPxNum(lineWidth)) / 2;
|
|
134
135
|
var perimeter = 2 * Math.PI * radius;
|
|
135
136
|
var strokeDasharray = roundValue / 100 * perimeter + ", " + perimeter;
|
|
136
137
|
return {
|
|
@@ -144,6 +145,8 @@ export default defineComponent({
|
|
|
144
145
|
return {
|
|
145
146
|
n,
|
|
146
147
|
classes,
|
|
148
|
+
toSizeUnit,
|
|
149
|
+
multiplySizeUnit,
|
|
147
150
|
linearProps,
|
|
148
151
|
circleProps
|
|
149
152
|
};
|
package/es/progress/progress.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --progress-font-size: var(--font-size-sm); --progress-ripple-color: #fff; --progress-track-color: #d8d8d8; --progress-background: var(--color-primary);}.var-progress { position: relative; font-size: var(--progress-font-size);}.var-progress__linear { display: flex; align-items: center;}.var-progress__linear-block { flex: 1; position: relative; overflow: hidden;}.var-progress__linear-background,.var-progress__linear-certain { width: 100%; height: 100%;}.var-progress__linear-ripple::after { position: absolute; width: 0; background-color: var(--progress-ripple-color); height: 100%; opacity: 0; animation: ripple 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; content: '';}.var-progress__linear-background { background-color: var(--progress-track-color);}.var-progress__linear-certain { position: absolute; background-color: var(--progress-background); top: 0; left: 0; transition: all 0.2s, background-color 0.8s;}.var-progress__linear-label { margin-left: 8px; flex: 0;}@keyframes ripple { 0% { width: 0; opacity: 0.1; } 20% { width: 0; opacity: 0.5; } 80% { width: 100%; opacity: 0; }}.var-progress__circle { position: relative;}.var-progress__circle-background { stroke: var(--progress-track-color);}.var-progress__circle-certain { transition: all 0.2s; stroke: var(--progress-background); position: absolute;}.var-progress__circle-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);}
|
|
1
|
+
:root { --progress-font-size: var(--font-size-sm); --progress-ripple-color: #fff; --progress-track-color: #d8d8d8; --progress-background: var(--color-primary);}.var-progress { position: relative; font-size: var(--progress-font-size);}.var-progress__linear { display: flex; align-items: center;}.var-progress__linear-block { flex: 1; position: relative; overflow: hidden; height: 4px;}.var-progress__linear-background,.var-progress__linear-certain { width: 100%; height: 100%;}.var-progress__linear-ripple::after { position: absolute; width: 0; background-color: var(--progress-ripple-color); height: 100%; opacity: 0; animation: ripple 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; content: '';}.var-progress__linear-background { background-color: var(--progress-track-color);}.var-progress__linear-certain { position: absolute; background-color: var(--progress-background); top: 0; left: 0; transition: all 0.2s, background-color 0.8s;}.var-progress__linear-label { margin-left: 8px; flex: 0;}@keyframes ripple { 0% { width: 0; opacity: 0.1; } 20% { width: 0; opacity: 0.5; } 80% { width: 100%; opacity: 0; }}.var-progress__circle { position: relative; width: 40px; height: 40px;}.var-progress__circle-background { stroke: var(--progress-track-color);}.var-progress__circle-certain { transition: all 0.2s; stroke: var(--progress-background); position: absolute;}.var-progress__circle-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
flex: 1;
|
|
23
23
|
position: relative;
|
|
24
24
|
overflow: hidden;
|
|
25
|
+
height: 4px;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
&-background,
|
|
@@ -77,6 +78,8 @@
|
|
|
77
78
|
|
|
78
79
|
&__circle {
|
|
79
80
|
position: relative;
|
|
81
|
+
width: 40px;
|
|
82
|
+
height: 40px;
|
|
80
83
|
|
|
81
84
|
&-background {
|
|
82
85
|
stroke: var(--progress-track-color);
|
package/es/progress/props.js
CHANGED
package/es/rate/Rate.js
CHANGED
|
@@ -10,7 +10,7 @@ import { props } from './props';
|
|
|
10
10
|
var {
|
|
11
11
|
n
|
|
12
12
|
} = createNamespace('rate');
|
|
13
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent,
|
|
13
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createVNode as _createVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
14
14
|
|
|
15
15
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
16
16
|
|
|
@@ -33,6 +33,8 @@ export function render(_ctx, _cache) {
|
|
|
33
33
|
class: _normalizeClass(_ctx.getClass(val)),
|
|
34
34
|
onClick: $event => _ctx.handleClick(val, $event)
|
|
35
35
|
}, [_createVNode(_component_var_icon, {
|
|
36
|
+
class: _normalizeClass(_ctx.n('content-icon')),
|
|
37
|
+
"var-rate-cover": "",
|
|
36
38
|
transition: 0,
|
|
37
39
|
namespace: _ctx.namespace,
|
|
38
40
|
name: _ctx.getIconName(val),
|
|
@@ -41,7 +43,7 @@ export function render(_ctx, _cache) {
|
|
|
41
43
|
})
|
|
42
44
|
}, null, 8
|
|
43
45
|
/* PROPS */
|
|
44
|
-
, ["namespace", "name", "style"])], 14
|
|
46
|
+
, ["class", "namespace", "name", "style"])], 14
|
|
45
47
|
/* CLASS, STYLE, PROPS */
|
|
46
48
|
, _hoisted_1)), [[_directive_ripple, {
|
|
47
49
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
package/es/rate/props.js
CHANGED
|
@@ -22,12 +22,10 @@ export var props = {
|
|
|
22
22
|
default: 'star-outline'
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
|
-
type: [String, Number]
|
|
26
|
-
default: '24'
|
|
25
|
+
type: [String, Number]
|
|
27
26
|
},
|
|
28
27
|
gap: {
|
|
29
|
-
type: [String, Number]
|
|
30
|
-
default: '2'
|
|
28
|
+
type: [String, Number]
|
|
31
29
|
},
|
|
32
30
|
namespace: {
|
|
33
31
|
type: String
|
package/es/rate/rate.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__content { padding: var(--rate-action-padding); box-sizing: unset; cursor: pointer; display: flex; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate--primary { color: var(--rate-primary-color);}.var-rate--disabled { color: var(--rate-disabled-color); cursor: not-allowed;}.var-rate--error { color: var(--rate-error-color);}
|
|
1
|
+
:root { --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__content { padding: var(--rate-action-padding); box-sizing: unset; cursor: pointer; display: flex; width: 24px; height: 24px; margin-right: 2px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate__content-icon[var-rate-cover] { font-size: 24px;}.var-rate--primary { color: var(--rate-primary-color);}.var-rate--disabled { color: var(--rate-disabled-color); cursor: not-allowed;}.var-rate--error { color: var(--rate-error-color);}
|
package/es/rate/rate.less
CHANGED
package/es/select/Select.js
CHANGED
|
@@ -248,6 +248,8 @@ export default defineComponent({
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
var findLabel = modelValue => {
|
|
251
|
+
var _option$label$value, _option;
|
|
252
|
+
|
|
251
253
|
var option = options.find(_ref2 => {
|
|
252
254
|
var {
|
|
253
255
|
value
|
|
@@ -264,7 +266,7 @@ export default defineComponent({
|
|
|
264
266
|
});
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
return option.label.value;
|
|
269
|
+
return (_option$label$value = (_option = option) == null ? void 0 : _option.label.value) != null ? _option$label$value : '';
|
|
268
270
|
};
|
|
269
271
|
|
|
270
272
|
var computePlaceholderState = () => {
|
package/es/slider/Slider.js
CHANGED
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import { defineComponent, ref, onMounted, computed, reactive, nextTick, watch } from 'vue';
|
|
4
4
|
import { useValidation, createNamespace, call } from '../utils/components';
|
|
5
5
|
import { useForm } from '../form/provide';
|
|
6
|
-
import { getLeft } from '../utils/elements';
|
|
6
|
+
import { getLeft, multiplySizeUnit } from '../utils/elements';
|
|
7
7
|
import { isArray, isNumber, toNumber } from '../utils/shared';
|
|
8
8
|
import { props } from './props';
|
|
9
9
|
import VarFormDetails from '../form-details';
|
|
@@ -31,8 +31,8 @@ export function render(_ctx, _cache) {
|
|
|
31
31
|
}, [_createElementVNode("div", {
|
|
32
32
|
class: _normalizeClass(_ctx.classes(_ctx.n('block'), [_ctx.isDisabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')])),
|
|
33
33
|
style: _normalizeStyle({
|
|
34
|
-
height: _ctx.thumbSize === undefined ? _ctx.thumbSize :
|
|
35
|
-
margin: _ctx.thumbSize === undefined ? _ctx.thumbSize : "0 " + _ctx.
|
|
34
|
+
height: _ctx.thumbSize === undefined ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 3),
|
|
35
|
+
margin: _ctx.thumbSize === undefined ? _ctx.thumbSize : "0 " + _ctx.multiplySizeUnit(_ctx.thumbSize, 0.5)
|
|
36
36
|
}),
|
|
37
37
|
ref: "sliderEl",
|
|
38
38
|
onClick: _cache[0] || (_cache[0] = function () {
|
|
@@ -44,7 +44,7 @@ export function render(_ctx, _cache) {
|
|
|
44
44
|
class: _normalizeClass(_ctx.n('track-background')),
|
|
45
45
|
style: _normalizeStyle({
|
|
46
46
|
background: _ctx.trackColor,
|
|
47
|
-
height: _ctx.trackHeight
|
|
47
|
+
height: _ctx.multiplySizeUnit(_ctx.trackHeight)
|
|
48
48
|
})
|
|
49
49
|
}, null, 6
|
|
50
50
|
/* CLASS, STYLE */
|
|
@@ -73,8 +73,8 @@ export function render(_ctx, _cache) {
|
|
|
73
73
|
class: _normalizeClass(_ctx.n('thumb-block')),
|
|
74
74
|
style: _normalizeStyle({
|
|
75
75
|
background: _ctx.thumbColor,
|
|
76
|
-
height: _ctx.thumbSize
|
|
77
|
-
width: _ctx.thumbSize
|
|
76
|
+
height: _ctx.multiplySizeUnit(_ctx.thumbSize),
|
|
77
|
+
width: _ctx.multiplySizeUnit(_ctx.thumbSize)
|
|
78
78
|
})
|
|
79
79
|
}, null, 6
|
|
80
80
|
/* CLASS, STYLE */
|
|
@@ -90,8 +90,8 @@ export function render(_ctx, _cache) {
|
|
|
90
90
|
style: _normalizeStyle({
|
|
91
91
|
background: _ctx.labelColor,
|
|
92
92
|
color: _ctx.labelTextColor,
|
|
93
|
-
height: _ctx.thumbSize === undefined ? _ctx.thumbSize :
|
|
94
|
-
width: _ctx.thumbSize === undefined ? _ctx.thumbSize :
|
|
93
|
+
height: _ctx.thumbSize === undefined ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2),
|
|
94
|
+
width: _ctx.thumbSize === undefined ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2)
|
|
95
95
|
})
|
|
96
96
|
}, [_createElementVNode("span", null, _toDisplayString(item.value), 1
|
|
97
97
|
/* TEXT */
|
|
@@ -176,7 +176,7 @@ export default defineComponent({
|
|
|
176
176
|
var size;
|
|
177
177
|
|
|
178
178
|
if (props.thumbSize !== undefined) {
|
|
179
|
-
size = thumbsProps[item.enumValue].active ?
|
|
179
|
+
size = thumbsProps[item.enumValue].active ? multiplySizeUnit(props.thumbSize, 3) : '0px';
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
return {
|
|
@@ -385,6 +385,7 @@ export default defineComponent({
|
|
|
385
385
|
errorMessage,
|
|
386
386
|
thumbsProps,
|
|
387
387
|
thumbList,
|
|
388
|
+
multiplySizeUnit,
|
|
388
389
|
toNumber,
|
|
389
390
|
getRippleSize,
|
|
390
391
|
showLabel,
|
|
@@ -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'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.less'
|
|
2
|
+
import '../SnackbarSfc.less'
|
|
2
3
|
import '../../styles/elevation.less'
|
|
3
4
|
import '../../loading/loading.less'
|
|
4
5
|
import '../../button/button.less'
|
|
5
6
|
import '../../icon/icon.less'
|
|
6
7
|
import '../snackbar.less'
|
|
7
8
|
import '../coreSfc.less'
|
|
8
|
-
import '../SnackbarSfc.less'
|