@varlet/ui 2.9.6 → 2.10.0-alpha.1682067841655
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/fab/Fab.mjs +3 -5
- package/es/field-decorator/FieldDecorator.mjs +196 -0
- package/es/field-decorator/FieldDecoratorSfc.css +0 -0
- package/es/field-decorator/fieldDecorator.css +1 -0
- package/es/field-decorator/props.mjs +81 -0
- package/es/field-decorator/style/index.mjs +4 -0
- package/es/icon/icon.css +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +173 -161
- package/es/input/input.css +1 -1
- package/es/input/props.mjs +7 -33
- package/es/input/style/index.mjs +2 -1
- package/es/menu/usePopover.mjs +2 -2
- package/es/option/Option.mjs +0 -3
- package/es/option/option.css +1 -1
- package/es/select/Select.mjs +104 -145
- package/es/select/props.mjs +7 -33
- package/es/select/select.css +1 -1
- package/es/select/style/index.mjs +1 -0
- package/es/snackbar/Snackbar.mjs +1 -0
- package/es/snackbar/core.mjs +4 -0
- package/es/snackbar/index.mjs +18 -3
- package/es/snackbar/props.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/sticky/Sticky.mjs +2 -2
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +1 -1
- package/es/tabs/Tabs.mjs +1 -1
- package/es/themes/dark/fieldDecorator.mjs +4 -0
- package/es/themes/dark/index.mjs +2 -2
- package/es/themes/dark/select.mjs +0 -2
- package/es/utils/components.mjs +42 -9
- package/es/varlet.esm.js +6876 -6683
- package/highlight/web-types.en-US.json +23 -1
- package/highlight/web-types.zh-CN.json +41 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +1200 -979
- package/package.json +6 -6
- package/types/input.d.ts +5 -1
- package/types/select.d.ts +5 -1
- package/types/snackbar.d.ts +6 -1
- package/types/varComponent.d.ts +2 -0
- package/umd/varlet.js +5 -5
- package/es/themes/dark/input.mjs +0 -4
package/es/input/Input.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import VarFormDetails from '../form-details/index.mjs';
|
|
2
|
-
import
|
|
2
|
+
import VarFieldDecorator from '../field-decorator/FieldDecorator.mjs';
|
|
3
3
|
import { defineComponent, getCurrentInstance, ref, computed, nextTick } from 'vue';
|
|
4
4
|
import { props } from './props.mjs';
|
|
5
5
|
import { isEmpty, toNumber } from '@varlet/shared';
|
|
@@ -10,170 +10,160 @@ var {
|
|
|
10
10
|
n,
|
|
11
11
|
classes
|
|
12
12
|
} = createNamespace('input');
|
|
13
|
-
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass,
|
|
13
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, createVNode as _createVNode, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
14
14
|
|
|
15
15
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
16
16
|
|
|
17
|
-
var _hoisted_1 = ["
|
|
18
|
-
var _hoisted_2 = ["id", "disabled", "type", "value", "maxlength"];
|
|
19
|
-
var _hoisted_3 = ["
|
|
17
|
+
var _hoisted_1 = ["placeholder"];
|
|
18
|
+
var _hoisted_2 = ["id", "disabled", "type", "value", "placeholder", "maxlength", "rows"];
|
|
19
|
+
var _hoisted_3 = ["id", "disabled", "type", "value", "placeholder", "maxlength"];
|
|
20
20
|
|
|
21
21
|
function __render__(_ctx, _cache) {
|
|
22
|
-
var
|
|
22
|
+
var _component_var_field_decorator = _resolveComponent("var-field-decorator");
|
|
23
23
|
|
|
24
24
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
25
25
|
|
|
26
26
|
return _openBlock(), _createElementBlock("div", {
|
|
27
|
-
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box')
|
|
28
|
-
|
|
29
|
-
return _ctx.
|
|
27
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'))),
|
|
28
|
+
onMousedown: _cache[15] || (_cache[15] = function () {
|
|
29
|
+
return _ctx.handleMousedown && _ctx.handleMousedown(...arguments);
|
|
30
30
|
})
|
|
31
|
-
}, [
|
|
32
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('controller'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
33
|
-
style: _normalizeStyle({
|
|
34
|
-
color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
|
|
35
|
-
})
|
|
36
|
-
}, [_createElementVNode("div", {
|
|
37
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
38
|
-
}, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
|
|
39
|
-
/* CLASS */
|
|
40
|
-
), _createElementVNode("div", {
|
|
41
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('wrap'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
42
|
-
}, [_ctx.type === 'password' ? (_openBlock(), _createElementBlock("input", {
|
|
43
|
-
key: 0,
|
|
44
|
-
class: _normalizeClass(_ctx.n('autocomplete'))
|
|
45
|
-
}, null, 2
|
|
46
|
-
/* CLASS */
|
|
47
|
-
)) : _createCommentVNode("v-if", true), _ctx.textarea ? (_openBlock(), _createElementBlock("textarea", {
|
|
48
|
-
key: 1,
|
|
49
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('input'), _ctx.n('--textarea'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
50
|
-
ref: "el",
|
|
51
|
-
autocomplete: "new-password",
|
|
52
|
-
id: _ctx.id,
|
|
53
|
-
disabled: _ctx.formDisabled || _ctx.disabled || _ctx.formReadonly || _ctx.readonly,
|
|
54
|
-
type: _ctx.type,
|
|
31
|
+
}, [_createVNode(_component_var_field_decorator, _normalizeProps(_guardReactiveProps({
|
|
55
32
|
value: _ctx.modelValue,
|
|
56
|
-
maxlength: _ctx.maxlength,
|
|
57
|
-
rows: _ctx.rows,
|
|
58
|
-
style: _normalizeStyle({
|
|
59
|
-
color: _ctx.textColor,
|
|
60
|
-
caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined,
|
|
61
|
-
resize: _ctx.resize ? 'vertical' : 'none'
|
|
62
|
-
}),
|
|
63
|
-
onFocus: _cache[0] || (_cache[0] = function () {
|
|
64
|
-
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
65
|
-
}),
|
|
66
|
-
onBlur: _cache[1] || (_cache[1] = function () {
|
|
67
|
-
return _ctx.handleBlur && _ctx.handleBlur(...arguments);
|
|
68
|
-
}),
|
|
69
|
-
onInput: _cache[2] || (_cache[2] = function () {
|
|
70
|
-
return _ctx.handleInput && _ctx.handleInput(...arguments);
|
|
71
|
-
}),
|
|
72
|
-
onChange: _cache[3] || (_cache[3] = function () {
|
|
73
|
-
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
74
|
-
}),
|
|
75
|
-
onTouchstart: _cache[4] || (_cache[4] = function () {
|
|
76
|
-
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
77
|
-
}),
|
|
78
|
-
onCompositionstart: _cache[5] || (_cache[5] = function () {
|
|
79
|
-
return _ctx.handleCompositionStart && _ctx.handleCompositionStart(...arguments);
|
|
80
|
-
}),
|
|
81
|
-
onCompositionend: _cache[6] || (_cache[6] = function () {
|
|
82
|
-
return _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...arguments);
|
|
83
|
-
})
|
|
84
|
-
}, "\n ", 46
|
|
85
|
-
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
86
|
-
, _hoisted_1)) : (_openBlock(), _createElementBlock("input", {
|
|
87
|
-
key: 2,
|
|
88
|
-
class: _normalizeClass(_ctx.classes(_ctx.n('input'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
89
|
-
ref: "el",
|
|
90
|
-
autocomplete: "new-password",
|
|
91
33
|
id: _ctx.id,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
34
|
+
size: _ctx.size,
|
|
35
|
+
variant: _ctx.variant,
|
|
36
|
+
placeholder: _ctx.placeholder,
|
|
37
|
+
line: _ctx.line,
|
|
38
|
+
hint: _ctx.hint,
|
|
39
|
+
textColor: _ctx.textColor,
|
|
40
|
+
focusColor: _ctx.focusColor,
|
|
41
|
+
blurColor: _ctx.blurColor,
|
|
42
|
+
isFocus: _ctx.isFocus,
|
|
43
|
+
errorMessage: _ctx.errorMessage,
|
|
44
|
+
formDisabled: _ctx.formDisabled,
|
|
45
|
+
disabled: _ctx.disabled,
|
|
46
|
+
clearable: _ctx.clearable,
|
|
47
|
+
textarea: _ctx.textarea,
|
|
48
|
+
cursor: _ctx.cursor,
|
|
49
|
+
composing: _ctx.isComposing,
|
|
50
|
+
alwaysCustomPlaceholder: false,
|
|
51
|
+
onClick: _ctx.handleClick,
|
|
52
|
+
onClear: _ctx.handleClear
|
|
53
|
+
})), {
|
|
54
|
+
"prepend-icon": _withCtx(() => [_renderSlot(_ctx.$slots, "prepend-icon")]),
|
|
55
|
+
"append-icon": _withCtx(() => [_renderSlot(_ctx.$slots, "append-icon")]),
|
|
56
|
+
default: _withCtx(() => [_ctx.type === 'password' ? (_openBlock(), _createElementBlock("input", {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: _normalizeClass(_ctx.n('autocomplete')),
|
|
59
|
+
placeholder: !_ctx.hint ? _ctx.placeholder : undefined,
|
|
60
|
+
style: _normalizeStyle({
|
|
61
|
+
'--input-placeholder-color': _ctx.placeholderColor
|
|
62
|
+
})
|
|
63
|
+
}, null, 14
|
|
64
|
+
/* CLASS, STYLE, PROPS */
|
|
65
|
+
, _hoisted_1)) : _createCommentVNode("v-if", true), _ctx.textarea ? (_openBlock(), _createElementBlock("textarea", {
|
|
66
|
+
key: 1,
|
|
67
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('input'), _ctx.n('--textarea'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
68
|
+
ref: "el",
|
|
69
|
+
autocomplete: "new-password",
|
|
70
|
+
id: _ctx.id,
|
|
71
|
+
disabled: _ctx.formDisabled || _ctx.disabled || _ctx.formReadonly || _ctx.readonly,
|
|
72
|
+
type: _ctx.type,
|
|
73
|
+
value: _ctx.modelValue,
|
|
74
|
+
placeholder: !_ctx.hint ? _ctx.placeholder : undefined,
|
|
75
|
+
maxlength: _ctx.maxlength,
|
|
76
|
+
rows: _ctx.rows,
|
|
77
|
+
style: _normalizeStyle({
|
|
78
|
+
color: !_ctx.errorMessage ? _ctx.textColor : undefined,
|
|
79
|
+
caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined,
|
|
80
|
+
resize: _ctx.resize ? 'vertical' : 'none',
|
|
81
|
+
'--input-placeholder-color': _ctx.placeholderColor
|
|
82
|
+
}),
|
|
83
|
+
onFocus: _cache[0] || (_cache[0] = function () {
|
|
84
|
+
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
85
|
+
}),
|
|
86
|
+
onBlur: _cache[1] || (_cache[1] = function () {
|
|
87
|
+
return _ctx.handleBlur && _ctx.handleBlur(...arguments);
|
|
88
|
+
}),
|
|
89
|
+
onInput: _cache[2] || (_cache[2] = function () {
|
|
90
|
+
return _ctx.handleInput && _ctx.handleInput(...arguments);
|
|
91
|
+
}),
|
|
92
|
+
onChange: _cache[3] || (_cache[3] = function () {
|
|
93
|
+
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
94
|
+
}),
|
|
95
|
+
onTouchstart: _cache[4] || (_cache[4] = function () {
|
|
96
|
+
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
97
|
+
}),
|
|
98
|
+
onCompositionstart: _cache[5] || (_cache[5] = function () {
|
|
99
|
+
return _ctx.handleCompositionStart && _ctx.handleCompositionStart(...arguments);
|
|
100
|
+
}),
|
|
101
|
+
onCompositionend: _cache[6] || (_cache[6] = function () {
|
|
102
|
+
return _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...arguments);
|
|
103
|
+
})
|
|
104
|
+
}, "\n ", 46
|
|
105
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
106
|
+
, _hoisted_2)) : (_openBlock(), _createElementBlock("input", {
|
|
107
|
+
key: 2,
|
|
108
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('input'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.errorMessage, _ctx.n('--caret-error')])),
|
|
109
|
+
ref: "el",
|
|
110
|
+
autocomplete: "new-password",
|
|
111
|
+
id: _ctx.id,
|
|
112
|
+
disabled: _ctx.formDisabled || _ctx.disabled || _ctx.formReadonly || _ctx.readonly,
|
|
113
|
+
type: _ctx.type,
|
|
114
|
+
value: _ctx.modelValue,
|
|
115
|
+
placeholder: !_ctx.hint ? _ctx.placeholder : undefined,
|
|
116
|
+
maxlength: _ctx.maxlength,
|
|
117
|
+
style: _normalizeStyle({
|
|
118
|
+
color: !_ctx.errorMessage ? _ctx.textColor : undefined,
|
|
119
|
+
caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined,
|
|
120
|
+
'--input-placeholder-color': _ctx.placeholderColor
|
|
121
|
+
}),
|
|
122
|
+
onFocus: _cache[7] || (_cache[7] = function () {
|
|
123
|
+
return _ctx.handleFocus && _ctx.handleFocus(...arguments);
|
|
124
|
+
}),
|
|
125
|
+
onBlur: _cache[8] || (_cache[8] = function () {
|
|
126
|
+
return _ctx.handleBlur && _ctx.handleBlur(...arguments);
|
|
127
|
+
}),
|
|
128
|
+
onInput: _cache[9] || (_cache[9] = function () {
|
|
129
|
+
return _ctx.handleInput && _ctx.handleInput(...arguments);
|
|
130
|
+
}),
|
|
131
|
+
onChange: _cache[10] || (_cache[10] = function () {
|
|
132
|
+
return _ctx.handleChange && _ctx.handleChange(...arguments);
|
|
133
|
+
}),
|
|
134
|
+
onTouchstart: _cache[11] || (_cache[11] = function () {
|
|
135
|
+
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
136
|
+
}),
|
|
137
|
+
onCompositionstart: _cache[12] || (_cache[12] = function () {
|
|
138
|
+
return _ctx.handleCompositionStart && _ctx.handleCompositionStart(...arguments);
|
|
139
|
+
}),
|
|
140
|
+
onCompositionend: _cache[13] || (_cache[13] = function () {
|
|
141
|
+
return _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...arguments);
|
|
142
|
+
})
|
|
143
|
+
}, null, 46
|
|
144
|
+
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
145
|
+
, _hoisted_3))]),
|
|
146
|
+
_: 3
|
|
147
|
+
/* FORWARDED */
|
|
148
|
+
|
|
149
|
+
}, 16
|
|
150
|
+
/* FULL_PROPS */
|
|
151
|
+
), _createVNode(_component_var_form_details, {
|
|
163
152
|
"error-message": _ctx.errorMessage,
|
|
164
|
-
"extra-message": _ctx.maxlengthText
|
|
153
|
+
"extra-message": _ctx.maxlengthText,
|
|
154
|
+
onMousedown: _cache[14] || (_cache[14] = _withModifiers(() => {}, ["stop"]))
|
|
165
155
|
}, null, 8
|
|
166
156
|
/* PROPS */
|
|
167
|
-
, ["error-message", "extra-message"])],
|
|
168
|
-
/* CLASS */
|
|
157
|
+
, ["error-message", "extra-message"])], 34
|
|
158
|
+
/* CLASS, HYDRATE_EVENTS */
|
|
169
159
|
);
|
|
170
160
|
}
|
|
171
161
|
|
|
172
162
|
var __sfc__ = defineComponent({
|
|
173
163
|
name: 'VarInput',
|
|
174
164
|
components: {
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
VarFormDetails,
|
|
166
|
+
VarFieldDecorator
|
|
177
167
|
},
|
|
178
168
|
props,
|
|
179
169
|
|
|
@@ -205,6 +195,28 @@ var __sfc__ = defineComponent({
|
|
|
205
195
|
|
|
206
196
|
return String(modelValue).length + "/" + maxlength;
|
|
207
197
|
});
|
|
198
|
+
var cursor = computed(() => props.disabled || props.readonly ? '' : 'text');
|
|
199
|
+
var placeholderColor = computed(() => {
|
|
200
|
+
var {
|
|
201
|
+
hint,
|
|
202
|
+
blurColor,
|
|
203
|
+
focusColor
|
|
204
|
+
} = props;
|
|
205
|
+
|
|
206
|
+
if (hint) {
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (errorMessage.value) {
|
|
211
|
+
return 'var(--field-decorator-error-color)';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (isFocus.value) {
|
|
215
|
+
return focusColor || 'var(--field-decorator-focus-color)';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return blurColor || 'var(--field-decorator-blur-color)';
|
|
219
|
+
});
|
|
208
220
|
var {
|
|
209
221
|
bindForm,
|
|
210
222
|
form
|
|
@@ -228,21 +240,6 @@ var __sfc__ = defineComponent({
|
|
|
228
240
|
});
|
|
229
241
|
};
|
|
230
242
|
|
|
231
|
-
var computePlaceholderState = () => {
|
|
232
|
-
var {
|
|
233
|
-
hint,
|
|
234
|
-
modelValue
|
|
235
|
-
} = props;
|
|
236
|
-
|
|
237
|
-
if (!hint && (!isEmpty(modelValue) || isComposing.value)) {
|
|
238
|
-
return n('--placeholder-hidden');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (hint && (!isEmpty(modelValue) || isFocus.value)) {
|
|
242
|
-
return n('--placeholder-hint');
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
|
|
246
243
|
var handleFocus = e => {
|
|
247
244
|
isFocus.value = true;
|
|
248
245
|
call(props.onFocus, e);
|
|
@@ -359,7 +356,20 @@ var __sfc__ = defineComponent({
|
|
|
359
356
|
}
|
|
360
357
|
|
|
361
358
|
e.stopPropagation();
|
|
362
|
-
};
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
function handleMousedown(e) {
|
|
362
|
+
var {
|
|
363
|
+
disabled
|
|
364
|
+
} = props;
|
|
365
|
+
|
|
366
|
+
if (form != null && form.disabled.value || disabled || e.target === el.value) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
focus();
|
|
371
|
+
e.preventDefault();
|
|
372
|
+
} // expose
|
|
363
373
|
|
|
364
374
|
|
|
365
375
|
var reset = () => {
|
|
@@ -401,14 +411,15 @@ var __sfc__ = defineComponent({
|
|
|
401
411
|
isFocus,
|
|
402
412
|
isComposing,
|
|
403
413
|
errorMessage,
|
|
414
|
+
placeholderColor,
|
|
404
415
|
type,
|
|
416
|
+
cursor,
|
|
405
417
|
maxlengthText,
|
|
406
418
|
formDisabled: form == null ? void 0 : form.disabled,
|
|
407
419
|
formReadonly: form == null ? void 0 : form.readonly,
|
|
408
420
|
n,
|
|
409
421
|
classes,
|
|
410
422
|
isEmpty,
|
|
411
|
-
computePlaceholderState,
|
|
412
423
|
handleFocus,
|
|
413
424
|
handleBlur,
|
|
414
425
|
handleInput,
|
|
@@ -418,6 +429,7 @@ var __sfc__ = defineComponent({
|
|
|
418
429
|
handleTouchstart,
|
|
419
430
|
handleCompositionStart,
|
|
420
431
|
handleCompositionEnd,
|
|
432
|
+
handleMousedown,
|
|
421
433
|
validate,
|
|
422
434
|
resetValidation,
|
|
423
435
|
reset,
|
package/es/input/input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --input-input-
|
|
1
|
+
:root { --input-input-height: 24px; --input-textarea-height: auto;}.var-input__autocomplete { width: 0; height: 0; padding: 0; border: none; outline: none; font-size: 0;}.var-input__input { width: 100%; height: var(--input-input-height); padding: 0; outline: none; border: none; background: transparent; color: var(--field-decorator-text-color); caret-color: var(--field-decorator-focus-color); transition: color 0.25s; font: inherit;}.var-input__input::placeholder { color: var(--input-placeholder-color);}.var-input--textarea { height: var(--input-textarea-height); min-height: var(--input-input-height);}.var-input--disabled { color: var(--field-decorator-disabled-color); cursor: not-allowed;}.var-input--error { color: var(--field-decorator-error-color);}.var-input--caret-error { caret-color: var(--field-decorator-error-color);}
|
package/es/input/props.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import { defineListenerProp, pickProps } from '../utils/components.mjs';
|
|
4
|
+
import { props as fieldDecoratorProps } from '../field-decorator/props.mjs';
|
|
2
5
|
export function typeValidator(type) {
|
|
3
6
|
return ['text', 'password', 'number'].includes(type);
|
|
4
7
|
}
|
|
5
|
-
export var props = {
|
|
8
|
+
export var props = _extends({
|
|
6
9
|
modelValue: {
|
|
7
10
|
type: String
|
|
8
11
|
},
|
|
@@ -23,41 +26,13 @@ export var props = {
|
|
|
23
26
|
type: [String, Number],
|
|
24
27
|
default: 8
|
|
25
28
|
},
|
|
26
|
-
placeholder: {
|
|
27
|
-
type: String
|
|
28
|
-
},
|
|
29
|
-
line: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
hint: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: true
|
|
36
|
-
},
|
|
37
|
-
textColor: {
|
|
38
|
-
type: String
|
|
39
|
-
},
|
|
40
|
-
focusColor: {
|
|
41
|
-
type: String
|
|
42
|
-
},
|
|
43
|
-
blurColor: {
|
|
44
|
-
type: String
|
|
45
|
-
},
|
|
46
29
|
maxlength: {
|
|
47
30
|
type: [String, Number]
|
|
48
31
|
},
|
|
49
|
-
disabled: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false
|
|
52
|
-
},
|
|
53
32
|
readonly: {
|
|
54
33
|
type: Boolean,
|
|
55
34
|
default: false
|
|
56
35
|
},
|
|
57
|
-
clearable: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: false
|
|
60
|
-
},
|
|
61
36
|
resize: {
|
|
62
37
|
type: Boolean,
|
|
63
38
|
default: false
|
|
@@ -75,9 +50,8 @@ export var props = {
|
|
|
75
50
|
},
|
|
76
51
|
onFocus: defineListenerProp(),
|
|
77
52
|
onBlur: defineListenerProp(),
|
|
78
|
-
onClick: defineListenerProp(),
|
|
79
|
-
onClear: defineListenerProp(),
|
|
80
53
|
onInput: defineListenerProp(),
|
|
81
54
|
onChange: defineListenerProp(),
|
|
55
|
+
onClear: defineListenerProp(),
|
|
82
56
|
'onUpdate:modelValue': defineListenerProp()
|
|
83
|
-
};
|
|
57
|
+
}, pickProps(fieldDecoratorProps, ['size', 'variant', 'placeholder', 'line', 'hint', 'textColor', 'focusColor', 'blurColor', 'disabled', 'clearable', 'onClick']));
|
package/es/input/style/index.mjs
CHANGED
package/es/menu/usePopover.mjs
CHANGED
|
@@ -6,9 +6,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
6
6
|
|
|
7
7
|
import flip from '@popperjs/core/lib/modifiers/flip';
|
|
8
8
|
import offset from '@popperjs/core/lib/modifiers/offset';
|
|
9
|
-
import { useClickOutside
|
|
9
|
+
import { useClickOutside } from '@varlet/use';
|
|
10
10
|
import { doubleRaf, toPxNum } from '../utils/elements.mjs';
|
|
11
|
-
import { call } from '../utils/components.mjs';
|
|
11
|
+
import { call, useVModel } from '../utils/components.mjs';
|
|
12
12
|
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
|
13
13
|
import { createPopper } from '@popperjs/core/lib/popper-lite';
|
|
14
14
|
import { useZIndex } from '../context/zIndex.mjs';
|
package/es/option/Option.mjs
CHANGED
|
@@ -18,7 +18,6 @@ function __render__(_ctx, _cache) {
|
|
|
18
18
|
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
19
19
|
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.optionSelected, _ctx.n('--selected-color')])),
|
|
20
20
|
style: _normalizeStyle({
|
|
21
|
-
width: _ctx.wrapWidth,
|
|
22
21
|
color: _ctx.optionSelected ? _ctx.focusColor : undefined
|
|
23
22
|
}),
|
|
24
23
|
onClick: _cache[2] || (_cache[2] = function () {
|
|
@@ -72,7 +71,6 @@ var __sfc__ = defineComponent({
|
|
|
72
71
|
bindSelect
|
|
73
72
|
} = useSelect();
|
|
74
73
|
var {
|
|
75
|
-
wrapWidth,
|
|
76
74
|
multiple,
|
|
77
75
|
focusColor,
|
|
78
76
|
onSelect,
|
|
@@ -102,7 +100,6 @@ var __sfc__ = defineComponent({
|
|
|
102
100
|
n,
|
|
103
101
|
classes,
|
|
104
102
|
optionSelected,
|
|
105
|
-
wrapWidth,
|
|
106
103
|
multiple,
|
|
107
104
|
focusColor,
|
|
108
105
|
handleClick,
|
package/es/option/option.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --option-height: 38px; --option-padding: 0 12px; --option-selected-background: var(--
|
|
1
|
+
:root { --option-height: 38px; --option-padding: 0 12px; --option-selected-background: var(--field-decorator-focus-color);}.var-option { position: relative; display: flex; align-items: center; height: var(--option-height); padding: var(--option-padding); cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-option__cover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.2; background: transparent;}.var-option__text { display: flex; align-items: center;}.var-option--selected-background { background: var(--option-selected-background);}.var-option--selected-color { color: var(--option-selected-background);}
|