@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/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.10+6b74530c",
|
|
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": "6b74530cf52ce08997a311d1a63402585c23be18",
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@varlet/cli": "^1.
|
|
50
|
+
"@varlet/cli": "^1.22.0-alpha.10+6b74530c"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"dayjs": "^1.10.4",
|