@varlet/ui 1.21.0 → 1.22.0-alpha.10
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/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- 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 +3 -1
package/es/swipe/Swipe.js
CHANGED
|
@@ -5,50 +5,46 @@ import { props } from './props';
|
|
|
5
5
|
import { isNumber, toNumber } from '../utils/shared';
|
|
6
6
|
var SWIPE_DELAY = 250;
|
|
7
7
|
var SWIPE_DISTANCE = 20;
|
|
8
|
-
import { renderSlot as _renderSlot,
|
|
8
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
_pushScopeId("");
|
|
10
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
11
|
|
|
14
12
|
var _hoisted_1 = {
|
|
15
13
|
class: "var-swipe",
|
|
16
14
|
ref: "swipeEl"
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class: ["var-swipe__track", [_ctx.vertical ? 'var-swipe--vertical' : null]],
|
|
24
|
-
style: {
|
|
16
|
+
var _hoisted_2 = ["onClick"];
|
|
17
|
+
export function render(_ctx, _cache) {
|
|
18
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
|
|
19
|
+
class: _normalizeClass(["var-swipe__track", [_ctx.vertical ? 'var-swipe--vertical' : null]]),
|
|
20
|
+
style: _normalizeStyle({
|
|
25
21
|
width: !_ctx.vertical ? _ctx.trackSize + "px" : null,
|
|
26
22
|
height: _ctx.vertical ? _ctx.trackSize + "px" : null,
|
|
27
23
|
transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)",
|
|
28
24
|
transitionDuration: _ctx.lockDuration ? "0ms" : _ctx.toNumber(_ctx.duration) + "ms"
|
|
29
|
-
},
|
|
30
|
-
onTouchstart: _cache[
|
|
31
|
-
onTouchmove: _cache[
|
|
32
|
-
onTouchend: _cache[
|
|
25
|
+
}),
|
|
26
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
|
|
27
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
|
|
28
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
|
|
33
29
|
}, [_renderSlot(_ctx.$slots, "default")], 38
|
|
34
30
|
/* CLASS, STYLE, HYDRATE_EVENTS */
|
|
35
31
|
), _renderSlot(_ctx.$slots, "indicator", {
|
|
36
32
|
index: _ctx.index,
|
|
37
33
|
length: _ctx.length
|
|
38
|
-
}, () => [_ctx.indicator && _ctx.length ? (_openBlock(),
|
|
34
|
+
}, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
|
|
39
35
|
key: 0,
|
|
40
|
-
class: ["var-swipe__indicators", [_ctx.vertical ? 'var-swipe--indicators-vertical' : null]]
|
|
41
|
-
}, [(_openBlock(true),
|
|
42
|
-
return _openBlock(),
|
|
43
|
-
class: ["var-swipe__indicator", [_ctx.index === idx ? 'var-swipe--indicator-active' : null, _ctx.vertical ? 'var-swipe--indicator-vertical' : null]],
|
|
44
|
-
style: {
|
|
36
|
+
class: _normalizeClass(["var-swipe__indicators", [_ctx.vertical ? 'var-swipe--indicators-vertical' : null]])
|
|
37
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
|
|
38
|
+
return _openBlock(), _createElementBlock("div", {
|
|
39
|
+
class: _normalizeClass(["var-swipe__indicator", [_ctx.index === idx ? 'var-swipe--indicator-active' : null, _ctx.vertical ? 'var-swipe--indicator-vertical' : null]]),
|
|
40
|
+
style: _normalizeStyle({
|
|
45
41
|
background: _ctx.indicatorColor
|
|
46
|
-
},
|
|
42
|
+
}),
|
|
47
43
|
key: l,
|
|
48
44
|
onClick: $event => _ctx.to(idx)
|
|
49
45
|
}, null, 14
|
|
50
46
|
/* CLASS, STYLE, PROPS */
|
|
51
|
-
,
|
|
47
|
+
, _hoisted_2);
|
|
52
48
|
}), 128
|
|
53
49
|
/* KEYED_FRAGMENT */
|
|
54
50
|
))], 2
|
|
@@ -56,7 +52,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
|
|
|
56
52
|
)) : _createCommentVNode("v-if", true)])], 512
|
|
57
53
|
/* NEED_PATCH */
|
|
58
54
|
);
|
|
59
|
-
}
|
|
55
|
+
}
|
|
60
56
|
export default defineComponent({
|
|
61
57
|
render,
|
|
62
58
|
name: 'VarSwipe',
|
|
@@ -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',
|