@varlet/ui 2.11.3 → 2.11.5
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/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/pagination/Pagination.mjs +4 -4
- package/es/pagination/pagination.css +1 -1
- package/es/rate/Rate.mjs +13 -2
- package/es/rate/props.mjs +4 -0
- package/es/step/Step.mjs +7 -38
- package/es/step/step.css +1 -1
- package/es/steps/Steps.mjs +0 -2
- package/es/steps/provide.mjs +0 -2
- package/es/style.css +1 -1
- package/es/themes/dark/pagination.mjs +2 -1
- package/es/varlet.esm.js +1309 -1329
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +10 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +80 -104
- package/package.json +6 -6
- package/types/rate.d.ts +1 -0
- package/umd/varlet.js +5 -5
package/es/index.bundle.mjs
CHANGED
|
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
|
|
|
241
241
|
import './tooltip/style/index.mjs'
|
|
242
242
|
import './uploader/style/index.mjs'
|
|
243
243
|
|
|
244
|
-
const version = '2.11.
|
|
244
|
+
const version = '2.11.5'
|
|
245
245
|
|
|
246
246
|
function install(app) {
|
|
247
247
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
|
|
|
160
160
|
export * from './tooltip/index.mjs'
|
|
161
161
|
export * from './uploader/index.mjs'
|
|
162
162
|
|
|
163
|
-
const version = '2.11.
|
|
163
|
+
const version = '2.11.5'
|
|
164
164
|
|
|
165
165
|
function install(app) {
|
|
166
166
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -91,10 +91,10 @@ function __render__(_ctx, _cache) {
|
|
|
91
91
|
key: 2,
|
|
92
92
|
class: _normalizeClass(_ctx.classes(_ctx.n('size'), [_ctx.disabled, _ctx.n('item--disabled')]))
|
|
93
93
|
}, [_createVNode(_component_var_menu, {
|
|
94
|
+
placement: "cover-top",
|
|
94
95
|
disabled: _ctx.disabled,
|
|
95
96
|
show: _ctx.menuVisible,
|
|
96
|
-
"onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event)
|
|
97
|
-
"offset-x": -4
|
|
97
|
+
"onUpdate:show": _cache[6] || (_cache[6] = $event => _ctx.menuVisible = $event)
|
|
98
98
|
}, {
|
|
99
99
|
menu: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sizeOption, (option, index) => {
|
|
100
100
|
return _withDirectives((_openBlock(), _createBlock(_component_var_cell, {
|
|
@@ -139,7 +139,7 @@ function __render__(_ctx, _cache) {
|
|
|
139
139
|
/* CLASS */
|
|
140
140
|
)) : _createCommentVNode("v-if", true), _ctx.showQuickJumper && !_ctx.simple ? (_openBlock(), _createElementBlock("li", {
|
|
141
141
|
key: 3,
|
|
142
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('quickly'), [_ctx.disabled, 'item--disabled']))
|
|
142
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('quickly'), [_ctx.disabled, _ctx.n('item--disabled')]))
|
|
143
143
|
}, [_createTextVNode(_toDisplayString(_ctx.pack.paginationJump) + " ", 1
|
|
144
144
|
/* TEXT */
|
|
145
145
|
), _createVNode(_component_var_input, {
|
|
@@ -155,7 +155,7 @@ function __render__(_ctx, _cache) {
|
|
|
155
155
|
/* CLASS */
|
|
156
156
|
)) : _createCommentVNode("v-if", true), _ctx.totalText ? (_openBlock(), _createElementBlock("li", {
|
|
157
157
|
key: 4,
|
|
158
|
-
class: _normalizeClass(_ctx.n('total'))
|
|
158
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('total'), [_ctx.disabled, _ctx.n('item--disabled')]))
|
|
159
159
|
}, _toDisplayString(_ctx.totalText), 3
|
|
160
160
|
/* TEXT, CLASS */
|
|
161
161
|
)) : _createCommentVNode("v-if", true)], 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --pagination-font-size: var(--font-size-md); --pagination-active-color: #fff; --pagination-active-bg-color: var(--color-primary); --pagination-hover-bg-color:
|
|
1
|
+
:root { --pagination-text-color: #555; --pagination-font-size: var(--font-size-md); --pagination-active-color: #fff; --pagination-active-bg-color: var(--color-primary); --pagination-hover-bg-color: rgba(85, 85, 85, 0.15); --pagination-total-margin: 0 12px; --pagination-total-line-height: 24px; --pagination-item-width: 32px; --pagination-item-height: 32px; --pagination-item-margin: 0 6px; --pagination-item-background: #fff; --pagination-item-border-radius: 4px; --pagination-item-simple-border-radius: 50%; --pagination-list-bg-color: #fff; --pagination-list-active-bg-color: #edf5ff; --pagination-list-active-color: var(--color-primary); --pagination-input-width: 32px; --pagination-disabled-color: var(--color-text-disabled); --pagination-bg-disabled-color: var(--color-disabled); --pagination-size-line-height: 24px;}.pagination-flex-nowrap { display: flex; white-space: nowrap; align-items: center;}.var-pagination { display: flex; align-items: center; list-style: none; margin: 0; font-size: var(--pagination-font-size); padding: 0; color: var(--pagination-text-color);}.var-pagination__item { display: inline-flex; min-width: var(--pagination-item-width); align-items: center; justify-content: center; margin: var(--pagination-item-margin); height: var(--pagination-item-height); cursor: pointer; border-radius: var(--pagination-item-border-radius); outline: none; transition: all 0.25s; user-select: none; background-color: var(--pagination-item-background);}.var-pagination__item:hover { background-color: var(--pagination-hover-bg-color);}.var-pagination__item--active { color: var(--pagination-active-color); background-color: var(--pagination-active-bg-color) !important;}.var-pagination__item--hide { display: none;}.var-pagination__item--simple { background: transparent; border-radius: var(--pagination-item-simple-border-radius);}.var-pagination__item--disabled { cursor: not-allowed; color: var(--pagination-disabled-color); background-color: unset;}.var-pagination__item--disabled:hover { background-color: unset;}.var-pagination__item--disabled--hover:hover { background-color: inherit;}.var-pagination__item--disabled--active { background-color: var(--pagination-bg-disabled-color);}.var-pagination__item--disabled--active:hover { background-color: var(--pagination-bg-disabled-color);}.var-pagination__prev { margin-left: 0;}.var-pagination__total { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-total-line-height); margin: var(--pagination-total-margin);}.var-pagination__size { display: flex; white-space: nowrap; align-items: center; line-height: var(--pagination-size-line-height); margin: var(--pagination-item-margin);}.var-pagination__size--open { display: flex; align-items: center; cursor: pointer;}.var-pagination__size--open--disabled { cursor: inherit;}.var-pagination__list { background-color: var(--pagination-list-bg-color); cursor: pointer; transition: all 0.25s;}.var-pagination__list:hover { color: var(--pagination-list-active-color); background-color: var(--pagination-list-active-bg-color);}.var-pagination__list--active { background-color: var(--pagination-list-active-bg-color) !important; color: var(--pagination-list-active-color);}.var-pagination__quickly,.var-pagination__simple { display: flex; white-space: nowrap; align-items: center;}.var-pagination__quickly [var-pagination-cover],.var-pagination__simple [var-pagination-cover] { width: var(--pagination-input-width);}.var-pagination__quickly [var-pagination-cover] .var-field-decorator__middle,.var-pagination__simple [var-pagination-cover] .var-field-decorator__middle { padding: 0;}.var-pagination__quickly [var-pagination-cover] .var-input__input,.var-pagination__simple [var-pagination-cover] .var-input__input { height: auto; text-align: center;}.var-pagination__quickly-line,.var-pagination__simple-line { height: 1px; background: transparent;}.var-pagination__quickly { margin: var(--pagination-item-margin);}.var-pagination__quickly [var-pagination-cover] { margin-left: 6px;}.var-pagination__size--open-icon[var-pagination-cover] { font-size: inherit;}
|
package/es/rate/Rate.mjs
CHANGED
|
@@ -100,6 +100,7 @@ var __sfc__ = defineComponent({
|
|
|
100
100
|
hovering
|
|
101
101
|
} = useHoverOverlay();
|
|
102
102
|
var currentHoveringValue = ref(-1);
|
|
103
|
+
var lastScore = Number(props.modelValue);
|
|
103
104
|
|
|
104
105
|
var getStyle = val => {
|
|
105
106
|
var {
|
|
@@ -161,13 +162,23 @@ var __sfc__ = defineComponent({
|
|
|
161
162
|
};
|
|
162
163
|
|
|
163
164
|
var changeValue = (score, event) => {
|
|
164
|
-
|
|
165
|
+
var {
|
|
166
|
+
half,
|
|
167
|
+
clearable
|
|
168
|
+
} = props;
|
|
169
|
+
|
|
170
|
+
if (half) {
|
|
165
171
|
var {
|
|
166
172
|
offsetWidth
|
|
167
173
|
} = event.target;
|
|
168
174
|
if (event.offsetX <= Math.floor(offsetWidth / 2)) score -= 0.5;
|
|
169
|
-
}
|
|
175
|
+
} // set score to 0 when last score is equal to current score
|
|
176
|
+
// and the value of clearable is true
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
if (lastScore === score && clearable) score = 0; // update last score
|
|
170
180
|
|
|
181
|
+
lastScore = score;
|
|
171
182
|
call(props['onUpdate:modelValue'], score);
|
|
172
183
|
};
|
|
173
184
|
|
package/es/rate/props.mjs
CHANGED
package/es/step/Step.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, defineComponent
|
|
1
|
+
import { computed, defineComponent } from 'vue';
|
|
2
2
|
import { props } from './props.mjs';
|
|
3
3
|
import { useSteps } from './provide.mjs';
|
|
4
4
|
import VarIcon from '../icon/index.mjs';
|
|
@@ -7,7 +7,7 @@ var {
|
|
|
7
7
|
n,
|
|
8
8
|
classes
|
|
9
9
|
} = createNamespace('step');
|
|
10
|
-
import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock,
|
|
10
|
+
import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderSlot as _renderSlot, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
11
|
|
|
12
12
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
13
|
|
|
@@ -22,9 +22,6 @@ function __render__(_ctx, _cache) {
|
|
|
22
22
|
class: _normalizeClass(_ctx.n())
|
|
23
23
|
}, [_createElementVNode("div", {
|
|
24
24
|
class: _normalizeClass(_ctx.n(_ctx.direction))
|
|
25
|
-
}, [_createElementVNode("div", {
|
|
26
|
-
class: _normalizeClass(_ctx.n(_ctx.direction + "-main")),
|
|
27
|
-
ref: _ctx.getRef
|
|
28
25
|
}, [_createElementVNode("div", {
|
|
29
26
|
class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-tag"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-tag--active")])),
|
|
30
27
|
style: _normalizeStyle({
|
|
@@ -65,17 +62,11 @@ function __render__(_ctx, _cache) {
|
|
|
65
62
|
})
|
|
66
63
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
67
64
|
/* CLASS */
|
|
68
|
-
)
|
|
65
|
+
), _createElementVNode("div", {
|
|
66
|
+
class: _normalizeClass(_ctx.n(_ctx.direction + "-line"))
|
|
67
|
+
}, null, 2
|
|
69
68
|
/* CLASS */
|
|
70
|
-
),
|
|
71
|
-
key: 0,
|
|
72
|
-
class: _normalizeClass(_ctx.n(_ctx.direction + "-line")),
|
|
73
|
-
style: _normalizeStyle({
|
|
74
|
-
margin: _ctx.lineMargin
|
|
75
|
-
})
|
|
76
|
-
}, null, 6
|
|
77
|
-
/* CLASS, STYLE */
|
|
78
|
-
)) : _createCommentVNode("v-if", true)], 2
|
|
69
|
+
)], 2
|
|
79
70
|
/* CLASS */
|
|
80
71
|
)], 2
|
|
81
72
|
/* CLASS */
|
|
@@ -90,9 +81,6 @@ var __sfc__ = defineComponent({
|
|
|
90
81
|
props,
|
|
91
82
|
|
|
92
83
|
setup() {
|
|
93
|
-
var main = ref(null);
|
|
94
|
-
var lineMargin = ref('');
|
|
95
|
-
var isLastChild = ref(false);
|
|
96
84
|
var {
|
|
97
85
|
index,
|
|
98
86
|
steps,
|
|
@@ -100,7 +88,6 @@ var __sfc__ = defineComponent({
|
|
|
100
88
|
} = useSteps();
|
|
101
89
|
var {
|
|
102
90
|
active,
|
|
103
|
-
length,
|
|
104
91
|
activeColor,
|
|
105
92
|
inactiveColor,
|
|
106
93
|
direction,
|
|
@@ -114,35 +101,17 @@ var __sfc__ = defineComponent({
|
|
|
114
101
|
|
|
115
102
|
var click = () => clickStep(index.value);
|
|
116
103
|
|
|
117
|
-
var getRef = el => {
|
|
118
|
-
if (direction.value === 'horizontal') {
|
|
119
|
-
main.value = el;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
104
|
bindSteps(stepProvider);
|
|
124
|
-
watch(length, newLength => {
|
|
125
|
-
isLastChild.value = newLength - 1 === index.value;
|
|
126
|
-
|
|
127
|
-
if (main.value) {
|
|
128
|
-
var margin = main.value.offsetWidth / 2 - 14;
|
|
129
|
-
lineMargin.value = "0 -" + margin + "px";
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
105
|
return {
|
|
133
106
|
n,
|
|
134
107
|
classes,
|
|
135
|
-
main,
|
|
136
108
|
index,
|
|
137
109
|
isActive,
|
|
138
110
|
isCurrent,
|
|
139
111
|
direction,
|
|
140
|
-
lineMargin,
|
|
141
112
|
activeColor,
|
|
142
113
|
inactiveColor,
|
|
143
|
-
|
|
144
|
-
click,
|
|
145
|
-
getRef
|
|
114
|
+
click
|
|
146
115
|
};
|
|
147
116
|
}
|
|
148
117
|
|
package/es/step/step.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --step-tag-size: 20px; --step-tag-background: #9e9e9e; --step-tag-font-size: var(--font-size-md); --step-tag-color: #fff; --step-tag-active-color: var(--color-primary); --step-tag-margin: 4px 0; --step-tag-icon-size: var(--font-size-lg); --step-content-font-size: var(--font-size-md); --step-content-color: rgba(0, 0, 0, 0.38); --step-content-active-color: #000; --step-line-background: #000; --step-
|
|
1
|
+
:root { --step-tag-size: 20px; --step-tag-background: #9e9e9e; --step-tag-font-size: var(--font-size-md); --step-tag-color: #fff; --step-tag-active-color: var(--color-primary); --step-tag-margin: 4px 0; --step-tag-icon-size: var(--font-size-lg); --step-content-font-size: var(--font-size-md); --step-content-color: rgba(0, 0, 0, 0.38); --step-content-active-color: #000; --step-line-background: #000; --step-line-gap: 8px; --step-min-size: calc(var(--step-tag-size) + var(--step-line-gap)); --step-line-size: calc(100% - var(--step-min-size)); --step-vertical-tag-margin: 0 4px; --step-vertical-min-height: 50px;}.tag { width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step { position: relative; flex: 1; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-step:last-child .var-step__horizontal-line { width: 0;}.var-step:last-child .var-step__vertical-line { height: 0;}.var-step__horizontal { display: flex; flex-direction: column; align-items: center;}.var-step__horizontal-tag { margin: var(--step-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-tag--active { background: var(--step-tag-active-color);}.var-step__horizontal-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__horizontal-content--active { color: var(--step-content-active-color);}.var-step__horizontal-line { position: absolute; top: calc(var(--step-min-size) / 2); left: calc(50% + var(--step-min-size) / 2); width: var(--step-line-size); height: 1px; transform: scaleY(0.5); background: var(--step-line-background);}.var-step__vertical { display: flex; height: 100%; min-height: var(--step-vertical-min-height);}.var-step__vertical-tag { flex-shrink: 0; margin: var(--step-vertical-tag-margin); width: var(--step-tag-size); height: var(--step-tag-size); background: var(--step-tag-background); display: flex; font-size: var(--step-tag-font-size); align-items: center; justify-content: center; border-radius: 50%; color: var(--step-tag-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-tag--active { background: var(--step-tag-active-color);}.var-step__vertical-content { font-size: var(--step-content-font-size); color: var(--step-content-color); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); transition: 0.3s var(--cubic-bezier);}.var-step__vertical-content--active { color: var(--step-content-active-color);}.var-step__vertical-line { position: absolute; height: var(--step-line-size); left: calc(var(--step-min-size) / 2); top: calc(var(--step-min-size) - var(--step-line-gap) / 2); width: 1px; transform: scaleX(0.5); background: var(--step-line-background);}.var-step__icon[var-step-cover] { font-size: var(--step-tag-icon-size);}
|
package/es/steps/Steps.mjs
CHANGED
|
@@ -28,7 +28,6 @@ var __sfc__ = defineComponent({
|
|
|
28
28
|
var inactiveColor = computed(() => props.inactiveColor);
|
|
29
29
|
var direction = computed(() => props.direction);
|
|
30
30
|
var {
|
|
31
|
-
length,
|
|
32
31
|
bindStep
|
|
33
32
|
} = useStep();
|
|
34
33
|
|
|
@@ -38,7 +37,6 @@ var __sfc__ = defineComponent({
|
|
|
38
37
|
|
|
39
38
|
var stepsProvider = {
|
|
40
39
|
active,
|
|
41
|
-
length,
|
|
42
40
|
direction,
|
|
43
41
|
activeColor,
|
|
44
42
|
inactiveColor,
|
package/es/steps/provide.mjs
CHANGED
|
@@ -3,11 +3,9 @@ export var STEPS_BIND_STEP_KEY = Symbol('STEPS_BIND_STEP_KEY');
|
|
|
3
3
|
export function useStep() {
|
|
4
4
|
var {
|
|
5
5
|
bindChildren,
|
|
6
|
-
length,
|
|
7
6
|
childProviders
|
|
8
7
|
} = useChildren(STEPS_BIND_STEP_KEY);
|
|
9
8
|
return {
|
|
10
|
-
length,
|
|
11
9
|
step: childProviders,
|
|
12
10
|
bindStep: bindChildren
|
|
13
11
|
};
|