@varlet/ui 1.21.0 → 1.22.0-alpha.15
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/action-sheet/ActionSheet.js +15 -19
- package/es/app-bar/AppBar.js +14 -19
- package/es/back-top/BackTop.js +7 -10
- package/es/badge/Badge.js +7 -12
- package/es/button/Button.js +14 -13
- package/es/card/Card.js +19 -23
- package/es/cell/Cell.js +14 -19
- package/es/checkbox/Checkbox.js +14 -19
- package/es/checkbox-group/CheckboxGroup.js +6 -11
- package/es/chip/Chip.js +8 -11
- package/es/col/Col.js +8 -11
- package/es/collapse/Collapse.js +5 -10
- package/es/collapse-item/CollapseItem.js +16 -21
- package/es/countdown/Countdown.js +5 -10
- package/es/counter/Counter.js +18 -22
- package/es/date-picker/DatePicker.js +23 -28
- package/es/date-picker/src/day-picker-panel.js +14 -19
- package/es/date-picker/src/month-picker-panel.js +12 -17
- package/es/date-picker/src/panel-header.js +12 -17
- package/es/date-picker/src/year-picker-panel.js +12 -16
- package/es/dialog/Dialog.js +12 -17
- package/es/divider/Divider.js +8 -13
- package/es/form/Form.js +5 -10
- package/es/form-details/FormDetails.js +6 -11
- package/es/icon/Icon.js +6 -9
- package/es/icon/icon.less +1 -1
- package/es/image/Image.js +23 -21
- package/es/image-preview/ImagePreview.js +20 -24
- package/es/index-anchor/IndexAnchor.js +4 -7
- package/es/index-bar/IndexBar.js +15 -19
- package/es/input/Input.js +33 -37
- package/es/list/List.js +10 -15
- package/es/loading/Loading.js +21 -24
- package/es/menu/Menu.js +9 -12
- package/es/option/Option.js +16 -21
- package/es/picker/Picker.js +33 -36
- package/es/popup/Popup.js +14 -17
- package/es/progress/Progress.js +30 -32
- package/es/pull-refresh/PullRefresh.js +12 -15
- package/es/radio/Radio.js +14 -19
- package/es/radio-group/RadioGroup.js +6 -11
- package/es/rate/Rate.js +12 -16
- package/es/row/Row.js +7 -10
- package/es/select/Select.js +42 -47
- package/es/skeleton/Skeleton.js +41 -39
- package/es/slider/Slider.js +32 -36
- package/es/snackbar/Snackbar.js +8 -11
- package/es/snackbar/core.js +14 -19
- package/es/step/Step.js +23 -28
- package/es/steps/Steps.js +6 -9
- package/es/sticky/Sticky.js +10 -13
- package/es/swipe/Swipe.js +20 -24
- package/es/swipe-item/SwipeItem.js +6 -9
- package/es/switch/Switch.js +16 -21
- package/es/tab/Tab.js +8 -11
- package/es/tab-item/TabItem.js +5 -8
- package/es/tabs/Tabs.js +10 -13
- package/es/tabs-items/TabsItems.js +4 -7
- package/es/time-picker/TimePicker.js +32 -37
- package/es/time-picker/clock.js +15 -20
- package/es/uploader/Uploader.js +31 -31
- package/package.json +4 -4
- package/umd/varlet.js +2 -1
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { defineComponent, ref } from 'vue';
|
|
2
2
|
import { useSwipe } from './provide';
|
|
3
|
-
import { renderSlot as _renderSlot,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
8
|
-
return _openBlock(), _createBlock("div", {
|
|
3
|
+
import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
export function render(_ctx, _cache) {
|
|
5
|
+
return _openBlock(), _createElementBlock("div", {
|
|
9
6
|
class: "var-swipe-item",
|
|
10
|
-
style: {
|
|
7
|
+
style: _normalizeStyle({
|
|
11
8
|
width: !_ctx.vertical ? _ctx.size + "px" : null,
|
|
12
9
|
height: _ctx.vertical ? _ctx.size + "px" : null,
|
|
13
10
|
transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)"
|
|
14
|
-
}
|
|
11
|
+
})
|
|
15
12
|
}, [_renderSlot(_ctx.$slots, "default")], 4
|
|
16
13
|
/* STYLE */
|
|
17
14
|
);
|
|
18
|
-
}
|
|
15
|
+
}
|
|
19
16
|
export default defineComponent({
|
|
20
17
|
render,
|
|
21
18
|
name: 'VarSwipeItem',
|
package/es/switch/Switch.js
CHANGED
|
@@ -6,40 +6,35 @@ import { props } from './props';
|
|
|
6
6
|
import FormDetails from '../form-details';
|
|
7
7
|
import Loading from '../loading';
|
|
8
8
|
import Ripple from '../ripple';
|
|
9
|
-
import {
|
|
9
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createVNode as _createVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
_pushScopeId("");
|
|
11
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
14
12
|
|
|
15
13
|
var _hoisted_1 = {
|
|
16
14
|
class: "var-switch"
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
_popScopeId();
|
|
20
|
-
|
|
21
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
16
|
+
export function render(_ctx, _cache) {
|
|
22
17
|
var _component_var_loading = _resolveComponent("var-loading");
|
|
23
18
|
|
|
24
19
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
25
20
|
|
|
26
21
|
var _directive_ripple = _resolveDirective("ripple");
|
|
27
22
|
|
|
28
|
-
return _openBlock(),
|
|
29
|
-
class: ["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]],
|
|
30
|
-
onClick: _cache[
|
|
31
|
-
style: _ctx.styleComputed.switch
|
|
32
|
-
}, [
|
|
33
|
-
style: _ctx.styleComputed.track,
|
|
34
|
-
class: ["var-switch__track", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__track-active' : null, _ctx.errorMessage ? 'var-switch__track-error' : null]]
|
|
23
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
|
|
24
|
+
class: _normalizeClass(["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]]),
|
|
25
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.switchActive && _ctx.switchActive(...args)),
|
|
26
|
+
style: _normalizeStyle(_ctx.styleComputed.switch)
|
|
27
|
+
}, [_createElementVNode("div", {
|
|
28
|
+
style: _normalizeStyle(_ctx.styleComputed.track),
|
|
29
|
+
class: _normalizeClass(["var-switch__track", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__track-active' : null, _ctx.errorMessage ? 'var-switch__track-error' : null]])
|
|
35
30
|
}, null, 6
|
|
36
31
|
/* CLASS, STYLE */
|
|
37
|
-
), _withDirectives(
|
|
32
|
+
), _withDirectives(_createElementVNode("div", {
|
|
38
33
|
class: "var-switch__ripple",
|
|
39
|
-
style: _ctx.styleComputed.ripple
|
|
40
|
-
}, [
|
|
41
|
-
style: _ctx.styleComputed.handle,
|
|
42
|
-
class: ["var-switch__handle var-elevation--2", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__handle-active' : null, _ctx.errorMessage ? 'var-switch__handle-error' : null]]
|
|
34
|
+
style: _normalizeStyle(_ctx.styleComputed.ripple)
|
|
35
|
+
}, [_createElementVNode("div", {
|
|
36
|
+
style: _normalizeStyle(_ctx.styleComputed.handle),
|
|
37
|
+
class: _normalizeClass(["var-switch__handle var-elevation--2", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__handle-active' : null, _ctx.errorMessage ? 'var-switch__handle-error' : null]])
|
|
43
38
|
}, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
|
|
44
39
|
key: 0,
|
|
45
40
|
radius: _ctx.size / 2 - 2
|
|
@@ -58,7 +53,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
58
53
|
}, null, 8
|
|
59
54
|
/* PROPS */
|
|
60
55
|
, ["error-message"])]);
|
|
61
|
-
}
|
|
56
|
+
}
|
|
62
57
|
export default defineComponent({
|
|
63
58
|
render,
|
|
64
59
|
name: 'VarSwitch',
|
package/es/tab/Tab.js
CHANGED
|
@@ -2,26 +2,23 @@ import { defineComponent, ref, computed, watch } from 'vue';
|
|
|
2
2
|
import { props } from './props';
|
|
3
3
|
import Ripple from '../ripple';
|
|
4
4
|
import { useTabs } from './provide';
|
|
5
|
-
import { renderSlot as _renderSlot, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock,
|
|
6
|
-
|
|
7
|
-
var _withId = /*#__PURE__*/_withScopeId("");
|
|
8
|
-
|
|
9
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
5
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
6
|
+
export function render(_ctx, _cache) {
|
|
10
7
|
var _directive_ripple = _resolveDirective("ripple");
|
|
11
8
|
|
|
12
|
-
return _withDirectives((_openBlock(),
|
|
13
|
-
class: ["var-tab var--box", [_ctx.computeColorClass(), "var-tab--" + _ctx.itemDirection]],
|
|
9
|
+
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
10
|
+
class: _normalizeClass(["var-tab var--box", [_ctx.computeColorClass(), "var-tab--" + _ctx.itemDirection]]),
|
|
14
11
|
ref: "tabEl",
|
|
15
|
-
style: {
|
|
12
|
+
style: _normalizeStyle({
|
|
16
13
|
color: _ctx.computeColorStyle()
|
|
17
|
-
},
|
|
18
|
-
onClick: _cache[
|
|
14
|
+
}),
|
|
15
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
19
16
|
}, [_renderSlot(_ctx.$slots, "default")], 6
|
|
20
17
|
/* CLASS, STYLE */
|
|
21
18
|
)), [[_directive_ripple, {
|
|
22
19
|
disabled: _ctx.disabled
|
|
23
20
|
}]]);
|
|
24
|
-
}
|
|
21
|
+
}
|
|
25
22
|
export default defineComponent({
|
|
26
23
|
render,
|
|
27
24
|
name: 'VarTab',
|
package/es/tab-item/TabItem.js
CHANGED
|
@@ -2,17 +2,14 @@ import SwipeItem from '../swipe-item';
|
|
|
2
2
|
import { defineComponent, ref, computed } from 'vue';
|
|
3
3
|
import { useTabsItems } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
-
import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent,
|
|
6
|
-
|
|
7
|
-
var _withId = /*#__PURE__*/_withScopeId("");
|
|
8
|
-
|
|
9
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
5
|
+
import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
|
+
export function render(_ctx, _cache) {
|
|
10
7
|
var _component_var_swipe_item = _resolveComponent("var-swipe-item");
|
|
11
8
|
|
|
12
9
|
return _openBlock(), _createBlock(_component_var_swipe_item, {
|
|
13
|
-
class: ["var-tab-item", [!_ctx.current && 'var-tab-item--inactive']]
|
|
10
|
+
class: _normalizeClass(["var-tab-item", [!_ctx.current && 'var-tab-item--inactive']])
|
|
14
11
|
}, {
|
|
15
|
-
default:
|
|
12
|
+
default: _withCtx(() => [_ctx.initSlot ? _renderSlot(_ctx.$slots, "default", {
|
|
16
13
|
key: 0
|
|
17
14
|
}) : _createCommentVNode("v-if", true)]),
|
|
18
15
|
_: 3
|
|
@@ -21,7 +18,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
21
18
|
}, 8
|
|
22
19
|
/* PROPS */
|
|
23
20
|
, ["class"]);
|
|
24
|
-
}
|
|
21
|
+
}
|
|
25
22
|
export default defineComponent({
|
|
26
23
|
render,
|
|
27
24
|
name: 'VarTabItem',
|
package/es/tabs/Tabs.js
CHANGED
|
@@ -4,30 +4,27 @@ import { props } from './props';
|
|
|
4
4
|
import { useTabList } from './provide';
|
|
5
5
|
import { isNumber, linear } from '../utils/shared';
|
|
6
6
|
import { toSizeUnit, scrollTo } from '../utils/elements';
|
|
7
|
-
import { renderSlot as _renderSlot,
|
|
8
|
-
|
|
9
|
-
var _withId = /*#__PURE__*/_withScopeId("");
|
|
10
|
-
|
|
11
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
7
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
8
|
+
export function render(_ctx, _cache) {
|
|
12
9
|
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
|
|
13
10
|
"offset-top": _ctx.sticky ? _ctx.offsetTop : null
|
|
14
11
|
}, {
|
|
15
|
-
default:
|
|
12
|
+
default: _withCtx(() => [_createElementVNode("div", _mergeProps({
|
|
16
13
|
class: ["var-tabs var--box", ["var-tabs--item-" + _ctx.itemDirection, "var-tabs--layout-" + _ctx.layoutDirection + "-padding", _ctx.elevation ? "var-elevation--4" : null, _ctx.fixedBottom ? 'var-tabs--fixed-bottom' : null]],
|
|
17
14
|
style: {
|
|
18
15
|
background: _ctx.color
|
|
19
16
|
}
|
|
20
|
-
}, _ctx.$attrs), [
|
|
21
|
-
class: ["var-tabs__tab-wrap", [_ctx.scrollable ? "var-tabs--layout-" + _ctx.layoutDirection + "-scrollable" : null, "var-tabs--layout-" + _ctx.layoutDirection]],
|
|
17
|
+
}, _ctx.$attrs), [_createElementVNode("div", {
|
|
18
|
+
class: _normalizeClass(["var-tabs__tab-wrap", [_ctx.scrollable ? "var-tabs--layout-" + _ctx.layoutDirection + "-scrollable" : null, "var-tabs--layout-" + _ctx.layoutDirection]]),
|
|
22
19
|
ref: "scrollerEl"
|
|
23
|
-
}, [_renderSlot(_ctx.$slots, "default"),
|
|
24
|
-
class: ["var-tabs__indicator", ["var-tabs--layout-" + _ctx.layoutDirection + "-indicator"]],
|
|
25
|
-
style: {
|
|
20
|
+
}, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("div", {
|
|
21
|
+
class: _normalizeClass(["var-tabs__indicator", ["var-tabs--layout-" + _ctx.layoutDirection + "-indicator"]]),
|
|
22
|
+
style: _normalizeStyle({
|
|
26
23
|
width: _ctx.layoutDirection === 'horizontal' ? _ctx.indicatorWidth : _ctx.toSizeUnit(_ctx.indicatorSize),
|
|
27
24
|
height: _ctx.layoutDirection === 'horizontal' ? _ctx.toSizeUnit(_ctx.indicatorSize) : _ctx.indicatorHeight,
|
|
28
25
|
transform: _ctx.layoutDirection === 'horizontal' ? "translateX(" + _ctx.indicatorX + ")" : "translateY(" + _ctx.indicatorY + ")",
|
|
29
26
|
background: _ctx.indicatorColor || _ctx.activeColor
|
|
30
|
-
}
|
|
27
|
+
})
|
|
31
28
|
}, null, 6
|
|
32
29
|
/* CLASS, STYLE */
|
|
33
30
|
)], 2
|
|
@@ -41,7 +38,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
41
38
|
}, 8
|
|
42
39
|
/* PROPS */
|
|
43
40
|
, ["offset-top"]);
|
|
44
|
-
}
|
|
41
|
+
}
|
|
45
42
|
export default defineComponent({
|
|
46
43
|
render,
|
|
47
44
|
name: 'VarTabs',
|
|
@@ -2,11 +2,8 @@ import Swipe from '../swipe';
|
|
|
2
2
|
import { defineComponent, watch, ref } from 'vue';
|
|
3
3
|
import { useTabItem } from './provide';
|
|
4
4
|
import { props } from './props';
|
|
5
|
-
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent,
|
|
6
|
-
|
|
7
|
-
var _withId = /*#__PURE__*/_withScopeId("");
|
|
8
|
-
|
|
9
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
5
|
+
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
6
|
+
export function render(_ctx, _cache) {
|
|
10
7
|
var _component_var_swipe = _resolveComponent("var-swipe");
|
|
11
8
|
|
|
12
9
|
return _openBlock(), _createBlock(_component_var_swipe, {
|
|
@@ -17,14 +14,14 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
17
14
|
indicator: false,
|
|
18
15
|
onChange: _ctx.handleSwipeChange
|
|
19
16
|
}, {
|
|
20
|
-
default:
|
|
17
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
|
|
21
18
|
_: 3
|
|
22
19
|
/* FORWARDED */
|
|
23
20
|
|
|
24
21
|
}, 8
|
|
25
22
|
/* PROPS */
|
|
26
23
|
, ["loop", "touchable", "onChange"]);
|
|
27
|
-
}
|
|
24
|
+
}
|
|
28
25
|
export default defineComponent({
|
|
29
26
|
render,
|
|
30
27
|
name: 'VarTabsItems',
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { computed, defineComponent, reactive, ref, watch } from 'vue';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
2
|
+
import dayjs from 'dayjs/esm';
|
|
3
3
|
import Clock from './clock.js'
|
|
4
4
|
import { props, hoursAmpm, hours24 } from './props';
|
|
5
5
|
import { toNumber } from '../utils/shared';
|
|
6
6
|
import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from './utils';
|
|
7
|
-
import { toDisplayString as _toDisplayString,
|
|
7
|
+
import { toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, createVNode as _createVNode, Transition as _Transition, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
_pushScopeId("");
|
|
9
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
12
10
|
|
|
13
11
|
var _hoisted_1 = {
|
|
14
12
|
class: "var-time-picker-title__time"
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
var _hoisted_2 = /*#__PURE__*/
|
|
15
|
+
var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("span", null, ":", -1
|
|
18
16
|
/* HOISTED */
|
|
19
|
-
);
|
|
17
|
+
));
|
|
20
18
|
|
|
21
19
|
var _hoisted_3 = {
|
|
22
20
|
key: 0
|
|
@@ -28,58 +26,55 @@ var _hoisted_4 = {
|
|
|
28
26
|
var _hoisted_5 = {
|
|
29
27
|
class: "var-time-picker-body"
|
|
30
28
|
};
|
|
31
|
-
|
|
32
|
-
_popScopeId();
|
|
33
|
-
|
|
34
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
29
|
+
export function render(_ctx, _cache) {
|
|
35
30
|
var _component_clock = _resolveComponent("clock");
|
|
36
31
|
|
|
37
|
-
return _openBlock(),
|
|
38
|
-
class: ["var-time-picker", [_ctx.shadow ? 'var-elevation--2' : null]],
|
|
32
|
+
return _openBlock(), _createElementBlock("div", {
|
|
33
|
+
class: _normalizeClass(["var-time-picker", [_ctx.shadow ? 'var-elevation--2' : null]]),
|
|
39
34
|
ref: "picker"
|
|
40
|
-
}, [
|
|
35
|
+
}, [_createElementVNode("div", {
|
|
41
36
|
class: "var-time-picker-title",
|
|
42
|
-
style: {
|
|
37
|
+
style: _normalizeStyle({
|
|
43
38
|
background: _ctx.headerColor || _ctx.color
|
|
44
|
-
}
|
|
45
|
-
}, [
|
|
46
|
-
class: ["var-time-picker-title__btn", _ctx.type === 'hour' ? 'var-time-picker-title__btn--active' : null],
|
|
47
|
-
onClick: _cache[
|
|
39
|
+
})
|
|
40
|
+
}, [_createElementVNode("div", _hoisted_1, [_createElementVNode("div", {
|
|
41
|
+
class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'hour' ? 'var-time-picker-title__btn--active' : null]),
|
|
42
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.checkPanel('hour'))
|
|
48
43
|
}, _toDisplayString(_ctx.time.hour), 3
|
|
49
44
|
/* TEXT, CLASS */
|
|
50
|
-
), _hoisted_2,
|
|
51
|
-
class: ["var-time-picker-title__btn", _ctx.type === 'minute' ? 'var-time-picker-title__btn--active' : null],
|
|
52
|
-
onClick: _cache[
|
|
45
|
+
), _hoisted_2, _createElementVNode("div", {
|
|
46
|
+
class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'minute' ? 'var-time-picker-title__btn--active' : null]),
|
|
47
|
+
onClick: _cache[1] || (_cache[1] = $event => _ctx.checkPanel('minute'))
|
|
53
48
|
}, _toDisplayString(_ctx.time.minute), 3
|
|
54
49
|
/* TEXT, CLASS */
|
|
55
|
-
), _ctx.useSeconds ? (_openBlock(),
|
|
50
|
+
), _ctx.useSeconds ? (_openBlock(), _createElementBlock("span", _hoisted_3, ":")) : _createCommentVNode("v-if", true), _ctx.useSeconds ? (_openBlock(), _createElementBlock("div", {
|
|
56
51
|
key: 1,
|
|
57
|
-
class: ["var-time-picker-title__btn", _ctx.type === 'second' ? 'var-time-picker-title__btn--active' : null],
|
|
58
|
-
onClick: _cache[
|
|
52
|
+
class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'second' ? 'var-time-picker-title__btn--active' : null]),
|
|
53
|
+
onClick: _cache[2] || (_cache[2] = $event => _ctx.checkPanel('second'))
|
|
59
54
|
}, _toDisplayString(_ctx.time.second), 3
|
|
60
55
|
/* TEXT, CLASS */
|
|
61
|
-
)) : _createCommentVNode("v-if", true)]), _ctx.format === 'ampm' ? (_openBlock(),
|
|
62
|
-
class: ["var-time-picker-title__btn", _ctx.ampm === 'am' ? 'var-time-picker-title__btn--active' : null],
|
|
63
|
-
onClick: _cache[
|
|
56
|
+
)) : _createCommentVNode("v-if", true)]), _ctx.format === 'ampm' ? (_openBlock(), _createElementBlock("div", _hoisted_4, [_createElementVNode("div", {
|
|
57
|
+
class: _normalizeClass(["var-time-picker-title__btn", _ctx.ampm === 'am' ? 'var-time-picker-title__btn--active' : null]),
|
|
58
|
+
onClick: _cache[3] || (_cache[3] = $event => _ctx.checkAmpm('am'))
|
|
64
59
|
}, " AM ", 2
|
|
65
60
|
/* CLASS */
|
|
66
|
-
),
|
|
67
|
-
class: ["var-time-picker-title__btn", _ctx.ampm === 'pm' ? 'var-time-picker-title__btn--active' : null],
|
|
68
|
-
onClick: _cache[
|
|
61
|
+
), _createElementVNode("div", {
|
|
62
|
+
class: _normalizeClass(["var-time-picker-title__btn", _ctx.ampm === 'pm' ? 'var-time-picker-title__btn--active' : null]),
|
|
63
|
+
onClick: _cache[4] || (_cache[4] = $event => _ctx.checkAmpm('pm'))
|
|
69
64
|
}, " PM ", 2
|
|
70
65
|
/* CLASS */
|
|
71
66
|
)])) : _createCommentVNode("v-if", true)], 4
|
|
72
67
|
/* STYLE */
|
|
73
|
-
),
|
|
68
|
+
), _createElementVNode("div", _hoisted_5, [_createElementVNode("div", {
|
|
74
69
|
class: "var-time-picker-clock__container",
|
|
75
|
-
onTouchstart: _cache[
|
|
76
|
-
onTouchmove: _cache[
|
|
77
|
-
onTouchend: _cache[
|
|
70
|
+
onTouchstart: _cache[5] || (_cache[5] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
|
|
71
|
+
onTouchmove: _cache[6] || (_cache[6] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
|
|
72
|
+
onTouchend: _cache[7] || (_cache[7] = (...args) => _ctx.end && _ctx.end(...args)),
|
|
78
73
|
ref: "container"
|
|
79
74
|
}, [_createVNode(_Transition, {
|
|
80
75
|
name: "var-time-picker-panel-fade"
|
|
81
76
|
}, {
|
|
82
|
-
default:
|
|
77
|
+
default: _withCtx(() => [_createVNode(_component_clock, {
|
|
83
78
|
key: _ctx.type,
|
|
84
79
|
ref: "inner",
|
|
85
80
|
type: _ctx.type,
|
|
@@ -107,7 +102,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
107
102
|
)])], 2
|
|
108
103
|
/* CLASS */
|
|
109
104
|
);
|
|
110
|
-
}
|
|
105
|
+
}
|
|
111
106
|
export default defineComponent({
|
|
112
107
|
render,
|
|
113
108
|
name: 'VarTimePicker',
|
package/es/time-picker/clock.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { computed, defineComponent, ref, watch } from 'vue';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
2
|
+
import dayjs from 'dayjs/esm';
|
|
3
3
|
import { hoursAmpm, hours24, minSec } from './props';
|
|
4
4
|
import { notConvert, convertHour, getIsDisableMinute, getIsDisableSecond, getNumberTime } from './utils';
|
|
5
5
|
import { toNumber } from '../utils/shared';
|
|
6
|
-
import {
|
|
6
|
+
import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
_pushScopeId("");
|
|
8
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
11
9
|
|
|
12
10
|
var _hoisted_1 = {
|
|
13
11
|
class: "var-time-picker-clock"
|
|
@@ -17,30 +15,27 @@ var _hoisted_2 = {
|
|
|
17
15
|
class: "var-time-picker-clock__inner",
|
|
18
16
|
ref: "inner"
|
|
19
17
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
24
|
-
return _openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", {
|
|
18
|
+
export function render(_ctx, _cache) {
|
|
19
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
|
|
25
20
|
class: "var-time-picker-clock__hand",
|
|
26
|
-
style: _ctx.handStyle
|
|
21
|
+
style: _normalizeStyle(_ctx.handStyle)
|
|
27
22
|
}, null, 4
|
|
28
23
|
/* STYLE */
|
|
29
|
-
), (_openBlock(true),
|
|
30
|
-
return _openBlock(),
|
|
31
|
-
class: ["var-time-picker-clock__item", [_ctx.isActive(index, false) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(timeScale) ? 'var-time-picker-clock__item--disable' : null]],
|
|
24
|
+
), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.timeScales, (timeScale, index) => {
|
|
25
|
+
return _openBlock(), _createElementBlock("div", {
|
|
26
|
+
class: _normalizeClass(["var-time-picker-clock__item", [_ctx.isActive(index, false) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(timeScale) ? 'var-time-picker-clock__item--disable' : null]]),
|
|
32
27
|
key: timeScale,
|
|
33
|
-
style: _ctx.getStyle(index, timeScale, false)
|
|
28
|
+
style: _normalizeStyle(_ctx.getStyle(index, timeScale, false))
|
|
34
29
|
}, _toDisplayString(timeScale), 7
|
|
35
30
|
/* TEXT, CLASS, STYLE */
|
|
36
31
|
);
|
|
37
32
|
}), 128
|
|
38
33
|
/* KEYED_FRAGMENT */
|
|
39
|
-
)), _ctx.format === '24hr' && _ctx.type === 'hour' ? (_openBlock(),
|
|
40
|
-
return _openBlock(),
|
|
41
|
-
class: ["var-time-picker-clock__item", [_ctx.isActive(index, true) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(hour) ? 'var-time-picker-clock__item--disable' : null]],
|
|
34
|
+
)), _ctx.format === '24hr' && _ctx.type === 'hour' ? (_openBlock(), _createElementBlock("div", _hoisted_2, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.hours24, (hour, index) => {
|
|
35
|
+
return _openBlock(), _createElementBlock("div", {
|
|
36
|
+
class: _normalizeClass(["var-time-picker-clock__item", [_ctx.isActive(index, true) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(hour) ? 'var-time-picker-clock__item--disable' : null]]),
|
|
42
37
|
key: hour,
|
|
43
|
-
style: _ctx.getStyle(index, hour, true)
|
|
38
|
+
style: _normalizeStyle(_ctx.getStyle(index, hour, true))
|
|
44
39
|
}, _toDisplayString(hour), 7
|
|
45
40
|
/* TEXT, CLASS, STYLE */
|
|
46
41
|
);
|
|
@@ -49,7 +44,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
49
44
|
))], 512
|
|
50
45
|
/* NEED_PATCH */
|
|
51
46
|
)) : _createCommentVNode("v-if", true)]);
|
|
52
|
-
}
|
|
47
|
+
}
|
|
53
48
|
export default defineComponent({
|
|
54
49
|
render,
|
|
55
50
|
name: 'Clock',
|
package/es/uploader/Uploader.js
CHANGED
|
@@ -12,11 +12,9 @@ import { props } from './props';
|
|
|
12
12
|
import { isNumber, isHTMLSupportImage, isHTMLSupportVideo, toNumber, isString } from '../utils/shared';
|
|
13
13
|
import { useValidation } from '../utils/components';
|
|
14
14
|
import { useForm } from '../form/provide';
|
|
15
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock,
|
|
15
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, renderSlot as _renderSlot, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
_pushScopeId("");
|
|
17
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
20
18
|
|
|
21
19
|
var _hoisted_1 = {
|
|
22
20
|
class: "var-uploader var--box"
|
|
@@ -24,13 +22,15 @@ var _hoisted_1 = {
|
|
|
24
22
|
var _hoisted_2 = {
|
|
25
23
|
class: "var-uploader__file-list"
|
|
26
24
|
};
|
|
27
|
-
var _hoisted_3 =
|
|
25
|
+
var _hoisted_3 = ["onClick"];
|
|
26
|
+
var _hoisted_4 = {
|
|
28
27
|
class: "var-uploader__file-name"
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var _hoisted_5 = ["onClick"];
|
|
30
|
+
var _hoisted_6 = ["src", "alt"];
|
|
31
|
+
var _hoisted_7 = ["multiple", "accept", "capture", "disabled"];
|
|
32
|
+
var _hoisted_8 = ["src"];
|
|
33
|
+
export function render(_ctx, _cache) {
|
|
34
34
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
35
35
|
|
|
36
36
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
@@ -39,14 +39,14 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
39
39
|
|
|
40
40
|
var _directive_ripple = _resolveDirective("ripple");
|
|
41
41
|
|
|
42
|
-
return _openBlock(),
|
|
43
|
-
return _withDirectives((_openBlock(),
|
|
44
|
-
class: ["var-uploader__file var-elevation--2", [f.state === 'loading' ? 'var-uploader--loading' : null]],
|
|
42
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.modelValue, f => {
|
|
43
|
+
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
44
|
+
class: _normalizeClass(["var-uploader__file var-elevation--2", [f.state === 'loading' ? 'var-uploader--loading' : null]]),
|
|
45
45
|
key: f,
|
|
46
46
|
onClick: $event => _ctx.preview(f)
|
|
47
|
-
}, [
|
|
47
|
+
}, [_createElementVNode("div", _hoisted_4, _toDisplayString(f.name || f.url), 1
|
|
48
48
|
/* TEXT */
|
|
49
|
-
), _ctx.removable ? (_openBlock(),
|
|
49
|
+
), _ctx.removable ? (_openBlock(), _createElementBlock("div", {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "var-uploader__file-close",
|
|
52
52
|
onClick: _withModifiers($event => _ctx.handleRemove(f), ["stop"])
|
|
@@ -56,41 +56,41 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
56
56
|
name: "delete"
|
|
57
57
|
})], 8
|
|
58
58
|
/* PROPS */
|
|
59
|
-
,
|
|
59
|
+
, _hoisted_5)) : _createCommentVNode("v-if", true), f.cover ? (_openBlock(), _createElementBlock("img", {
|
|
60
60
|
key: 1,
|
|
61
61
|
class: "var-uploader__file-cover",
|
|
62
|
-
style: {
|
|
62
|
+
style: _normalizeStyle({
|
|
63
63
|
objectFit: f.fit
|
|
64
|
-
},
|
|
64
|
+
}),
|
|
65
65
|
src: f.cover,
|
|
66
66
|
alt: f.name
|
|
67
67
|
}, null, 12
|
|
68
68
|
/* STYLE, PROPS */
|
|
69
|
-
,
|
|
70
|
-
class: ["var-uploader__file-indicator", [f.state === 'success' ? 'var-uploader--success' : null, f.state === 'error' ? 'var-uploader--error' : null]]
|
|
69
|
+
, _hoisted_6)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
|
|
70
|
+
class: _normalizeClass(["var-uploader__file-indicator", [f.state === 'success' ? 'var-uploader--success' : null, f.state === 'error' ? 'var-uploader--error' : null]])
|
|
71
71
|
}, null, 2
|
|
72
72
|
/* CLASS */
|
|
73
73
|
)], 10
|
|
74
74
|
/* CLASS, PROPS */
|
|
75
|
-
,
|
|
75
|
+
, _hoisted_3)), [[_directive_ripple, {
|
|
76
76
|
disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly || !_ctx.ripple
|
|
77
77
|
}]]);
|
|
78
78
|
}), 128
|
|
79
79
|
/* KEYED_FRAGMENT */
|
|
80
|
-
)), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? _withDirectives((_openBlock(),
|
|
80
|
+
)), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
81
81
|
key: 0,
|
|
82
|
-
class: ["var--relative", [!_ctx.$slots.default ? 'var-uploader__action var-elevation--2' : null, _ctx.disabled || _ctx.formDisabled ? 'var-uploader--disabled' : null]]
|
|
83
|
-
}, [
|
|
82
|
+
class: _normalizeClass(["var--relative", [!_ctx.$slots.default ? 'var-uploader__action var-elevation--2' : null, _ctx.disabled || _ctx.formDisabled ? 'var-uploader--disabled' : null]])
|
|
83
|
+
}, [_createElementVNode("input", {
|
|
84
84
|
class: "var-uploader__action-input",
|
|
85
85
|
type: "file",
|
|
86
86
|
multiple: _ctx.multiple,
|
|
87
87
|
accept: _ctx.accept,
|
|
88
88
|
capture: _ctx.capture,
|
|
89
89
|
disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
|
|
90
|
-
onChange: _cache[
|
|
90
|
+
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
|
|
91
91
|
}, null, 40
|
|
92
92
|
/* PROPS, HYDRATE_EVENTS */
|
|
93
|
-
,
|
|
93
|
+
, _hoisted_7), _renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_icon, {
|
|
94
94
|
class: "var-uploader__action-icon",
|
|
95
95
|
"var-uploader-cover": "",
|
|
96
96
|
name: "plus"
|
|
@@ -108,13 +108,13 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
108
108
|
"var-uploader-cover": "",
|
|
109
109
|
position: "center",
|
|
110
110
|
show: _ctx.showPreview,
|
|
111
|
-
"onUpdate:show": _cache[
|
|
112
|
-
onClosed: _cache[
|
|
111
|
+
"onUpdate:show": _cache[1] || (_cache[1] = $event => _ctx.showPreview = $event),
|
|
112
|
+
onClosed: _cache[2] || (_cache[2] = $event => _ctx.currentPreview = null)
|
|
113
113
|
}, {
|
|
114
|
-
default:
|
|
114
|
+
default: _withCtx(() => {
|
|
115
115
|
var _ctx$currentPreview, _ctx$currentPreview2;
|
|
116
116
|
|
|
117
|
-
return [_ctx.currentPreview && _ctx.isHTMLSupportVideo((_ctx$currentPreview = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview.url) ? (_openBlock(),
|
|
117
|
+
return [_ctx.currentPreview && _ctx.isHTMLSupportVideo((_ctx$currentPreview = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview.url) ? (_openBlock(), _createElementBlock("video", {
|
|
118
118
|
key: 0,
|
|
119
119
|
class: "var-uploader__preview-video",
|
|
120
120
|
playsinline: "true",
|
|
@@ -126,7 +126,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
126
126
|
src: (_ctx$currentPreview2 = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview2.url
|
|
127
127
|
}, null, 8
|
|
128
128
|
/* PROPS */
|
|
129
|
-
,
|
|
129
|
+
, _hoisted_8)) : _createCommentVNode("v-if", true)];
|
|
130
130
|
}),
|
|
131
131
|
_: 1
|
|
132
132
|
/* STABLE */
|
|
@@ -134,7 +134,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
134
134
|
}, 8
|
|
135
135
|
/* PROPS */
|
|
136
136
|
, ["show"])]);
|
|
137
|
-
}
|
|
137
|
+
}
|
|
138
138
|
export default defineComponent({
|
|
139
139
|
render,
|
|
140
140
|
name: 'VarUploader',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0-alpha.15+97121f37",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"test:watch": "varlet-cli jest -w"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"vue": "^3.
|
|
46
|
+
"vue": "^3.2.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "97121f377fea975b88d2affc156f01d3c7dc43c1",
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@varlet/cli": "^1.
|
|
50
|
+
"@varlet/cli": "^1.22.0-alpha.15+97121f37"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"dayjs": "^1.10.4",
|