@varlet/ui 2.9.6 → 2.10.0-alpha.1681657406626
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/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/style/index.mjs +1 -1
- package/es/style.css +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 +38 -1
- package/es/varlet.esm.js +6972 -6798
- package/highlight/web-types.en-US.json +19 -1
- package/highlight/web-types.zh-CN.json +37 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +1159 -960
- package/package.json +6 -6
- package/types/input.d.ts +5 -1
- package/types/select.d.ts +5 -1
- package/types/varComponent.d.ts +2 -0
- package/umd/varlet.js +5 -5
- package/es/themes/dark/input.mjs +0 -4
package/es/fab/Fab.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { mergeProps as _mergeProps, isVNode as _isVNode, withDirectives as _with
|
|
|
2
2
|
import Button from '../button/index.mjs';
|
|
3
3
|
import Icon from '../icon/index.mjs';
|
|
4
4
|
import { defineComponent, ref, Teleport, Transition, watch } from 'vue';
|
|
5
|
-
import { useClickOutside
|
|
6
|
-
import { call, createNamespace, flatFragment, useTeleport } from '../utils/components.mjs';
|
|
5
|
+
import { useClickOutside } from '@varlet/use';
|
|
6
|
+
import { call, createNamespace, flatFragment, useTeleport, useVModel } from '../utils/components.mjs';
|
|
7
7
|
import { toSizeUnit } from '../utils/elements.mjs';
|
|
8
8
|
import { toNumber } from '@varlet/shared';
|
|
9
9
|
import { props } from './props.mjs';
|
|
@@ -33,9 +33,7 @@ export default defineComponent({
|
|
|
33
33
|
slots,
|
|
34
34
|
attrs
|
|
35
35
|
} = _ref;
|
|
36
|
-
var isActive = useVModel(props, 'active'
|
|
37
|
-
emit: (event, value) => call(props['onUpdate:active'], value)
|
|
38
|
-
});
|
|
36
|
+
var isActive = useVModel(props, 'active');
|
|
39
37
|
var host = ref(null);
|
|
40
38
|
var {
|
|
41
39
|
disabled
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import VarIcon from '../icon/index.mjs';
|
|
2
|
+
import { defineComponent, ref, watchEffect, computed } from 'vue';
|
|
3
|
+
import { props } from './props.mjs';
|
|
4
|
+
import { isEmpty } from '@varlet/shared';
|
|
5
|
+
import { createNamespace, call } from '../utils/components.mjs';
|
|
6
|
+
var {
|
|
7
|
+
n,
|
|
8
|
+
classes
|
|
9
|
+
} = createNamespace('field-decorator');
|
|
10
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
|
+
|
|
12
|
+
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
13
|
+
|
|
14
|
+
var _hoisted_1 = ["for"];
|
|
15
|
+
|
|
16
|
+
function __render__(_ctx, _cache) {
|
|
17
|
+
var _component_var_icon = _resolveComponent("var-icon");
|
|
18
|
+
|
|
19
|
+
return _openBlock(), _createElementBlock("div", {
|
|
20
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.n("--" + _ctx.variant), [_ctx.size === 'small', _ctx.n('--small')], [_ctx.disabled, _ctx.n('--disabled')])),
|
|
21
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
22
|
+
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
23
|
+
})
|
|
24
|
+
}, [_createElementVNode("div", {
|
|
25
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('controller'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')])),
|
|
26
|
+
style: _normalizeStyle({
|
|
27
|
+
color: _ctx.color,
|
|
28
|
+
cursor: _ctx.cursor
|
|
29
|
+
})
|
|
30
|
+
}, [_createElementVNode("div", {
|
|
31
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')])),
|
|
32
|
+
ref: "prependIconEl"
|
|
33
|
+
}, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
|
|
34
|
+
/* CLASS */
|
|
35
|
+
), _createElementVNode("div", {
|
|
36
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('wrap'), [!_ctx.hint, _ctx.n('--wrap-non-hint')]))
|
|
37
|
+
}, [_renderSlot(_ctx.$slots, "default"), _ctx.hint || _ctx.alwaysCustomPlaceholder ? (_openBlock(), _createElementBlock("label", {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('placeholder'), _ctx.n('$--ellipsis'), [_ctx.textarea, _ctx.n('placeholder-textarea')], [_ctx.isFocus, _ctx.n('--focus')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')], [!_ctx.hint, _ctx.n('--placeholder-non-hint')], _ctx.computePlaceholderState())),
|
|
40
|
+
style: _normalizeStyle({
|
|
41
|
+
color: _ctx.color,
|
|
42
|
+
transform: _ctx.placeholderTransform
|
|
43
|
+
}),
|
|
44
|
+
for: _ctx.id
|
|
45
|
+
}, _toDisplayString(_ctx.placeholder), 15
|
|
46
|
+
/* TEXT, CLASS, STYLE, PROPS */
|
|
47
|
+
, _hoisted_1)) : _createCommentVNode("v-if", true)], 2
|
|
48
|
+
/* CLASS */
|
|
49
|
+
), _createElementVNode("div", {
|
|
50
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
|
|
51
|
+
}, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable && !_ctx.isEmpty(_ctx.value) ? (_openBlock(), _createBlock(_component_var_icon, {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: _normalizeClass(_ctx.n('clear-icon')),
|
|
54
|
+
"var-field-decorator-cover": "",
|
|
55
|
+
name: "close-circle",
|
|
56
|
+
onClick: _ctx.handleClear
|
|
57
|
+
}, null, 8
|
|
58
|
+
/* PROPS */
|
|
59
|
+
, ["class", "onClick"])) : _createCommentVNode("v-if", true)])], 2
|
|
60
|
+
/* CLASS */
|
|
61
|
+
)], 6
|
|
62
|
+
/* CLASS, STYLE */
|
|
63
|
+
), _ctx.line ? (_openBlock(), _createElementBlock(_Fragment, {
|
|
64
|
+
key: 0
|
|
65
|
+
}, [_ctx.variant === 'outlined' ? (_openBlock(), _createElementBlock("div", {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.isFocus, _ctx.n('--line-focus')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')]))
|
|
68
|
+
}, [!(_ctx.formDisabled || _ctx.disabled) ? (_openBlock(), _createElementBlock(_Fragment, {
|
|
69
|
+
key: 0
|
|
70
|
+
}, [_createElementVNode("div", {
|
|
71
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line-start'), [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
72
|
+
style: _normalizeStyle({
|
|
73
|
+
borderColor: _ctx.color
|
|
74
|
+
})
|
|
75
|
+
}, null, 6
|
|
76
|
+
/* CLASS, STYLE */
|
|
77
|
+
), _createElementVNode("div", {
|
|
78
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line-notch'), [_ctx.hint && (!_ctx.isEmpty(_ctx.value) || _ctx.isFocus), _ctx.n('line-notch--hint')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
79
|
+
style: _normalizeStyle({
|
|
80
|
+
borderColor: _ctx.color
|
|
81
|
+
})
|
|
82
|
+
}, [_createElementVNode("div", {
|
|
83
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line-placeholder'), _ctx.n('$--ellipsis')))
|
|
84
|
+
}, _toDisplayString(_ctx.placeholder), 3
|
|
85
|
+
/* TEXT, CLASS */
|
|
86
|
+
)], 6
|
|
87
|
+
/* CLASS, STYLE */
|
|
88
|
+
), _createElementVNode("div", {
|
|
89
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line-end'), [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
90
|
+
style: _normalizeStyle({
|
|
91
|
+
borderColor: _ctx.color
|
|
92
|
+
})
|
|
93
|
+
}, null, 6
|
|
94
|
+
/* CLASS, STYLE */
|
|
95
|
+
)], 64
|
|
96
|
+
/* STABLE_FRAGMENT */
|
|
97
|
+
)) : _createCommentVNode("v-if", true)], 2
|
|
98
|
+
/* CLASS */
|
|
99
|
+
)) : (_openBlock(), _createElementBlock("div", {
|
|
100
|
+
key: 1,
|
|
101
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
102
|
+
style: _normalizeStyle({
|
|
103
|
+
background: !_ctx.errorMessage ? _ctx.blurColor : undefined
|
|
104
|
+
})
|
|
105
|
+
}, [_createElementVNode("div", {
|
|
106
|
+
class: _normalizeClass(_ctx.classes(_ctx.n('dot'), [_ctx.isFocus, _ctx.n('--line-focus')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
|
|
107
|
+
style: _normalizeStyle({
|
|
108
|
+
background: !_ctx.errorMessage ? _ctx.focusColor : undefined
|
|
109
|
+
})
|
|
110
|
+
}, null, 6
|
|
111
|
+
/* CLASS, STYLE */
|
|
112
|
+
)], 6
|
|
113
|
+
/* CLASS, STYLE */
|
|
114
|
+
))], 2112
|
|
115
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
116
|
+
)) : _createCommentVNode("v-if", true)], 2
|
|
117
|
+
/* CLASS */
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var __sfc__ = defineComponent({
|
|
122
|
+
name: 'VarFieldDecorator',
|
|
123
|
+
components: {
|
|
124
|
+
VarIcon
|
|
125
|
+
},
|
|
126
|
+
props,
|
|
127
|
+
|
|
128
|
+
setup(props) {
|
|
129
|
+
var prependIconEl = ref(null);
|
|
130
|
+
var placeholderTransform = ref('');
|
|
131
|
+
var color = computed(() => !props.errorMessage ? props.isFocus ? props.focusColor : props.blurColor : undefined);
|
|
132
|
+
|
|
133
|
+
var computePlaceholderState = () => {
|
|
134
|
+
var {
|
|
135
|
+
hint,
|
|
136
|
+
value,
|
|
137
|
+
isFocus,
|
|
138
|
+
composing
|
|
139
|
+
} = props;
|
|
140
|
+
|
|
141
|
+
if (!hint && (!isEmpty(value) || composing)) {
|
|
142
|
+
return n('--placeholder-hidden');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (hint && (!isEmpty(value) || isFocus)) {
|
|
146
|
+
return n('--placeholder-hint');
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var handleClear = e => {
|
|
151
|
+
call(props.onClear, e);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var handleClick = e => {
|
|
155
|
+
call(props.onClick, e);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
watchEffect(() => {
|
|
159
|
+
var {
|
|
160
|
+
hint,
|
|
161
|
+
value,
|
|
162
|
+
isFocus,
|
|
163
|
+
variant
|
|
164
|
+
} = props;
|
|
165
|
+
|
|
166
|
+
if (!prependIconEl.value) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (hint && (!isEmpty(value) || isFocus)) {
|
|
171
|
+
var _window$getComputedSt;
|
|
172
|
+
|
|
173
|
+
var prependIconWidth = ((_window$getComputedSt = window.getComputedStyle(prependIconEl.value)) == null ? void 0 : _window$getComputedSt.width) || 0;
|
|
174
|
+
placeholderTransform.value = "translate(-" + prependIconWidth + ", " + (variant === 'outlined' ? '-50%' : 0) + ")";
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
placeholderTransform.value = '';
|
|
179
|
+
});
|
|
180
|
+
return {
|
|
181
|
+
prependIconEl,
|
|
182
|
+
placeholderTransform,
|
|
183
|
+
color,
|
|
184
|
+
computePlaceholderState,
|
|
185
|
+
n,
|
|
186
|
+
classes,
|
|
187
|
+
isEmpty,
|
|
188
|
+
handleClear,
|
|
189
|
+
handleClick
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
__sfc__.render = __render__;
|
|
196
|
+
export default __sfc__;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root { --field-decorator-text-color: #555; --field-decorator-error-color: var(--color-danger); --field-decorator-blur-color: #888; --field-decorator-focus-color: var(--color-primary); --field-decorator-placeholder-size: 16px; --field-decorator-icon-size: 20px; --field-decorator-line-size: 1px; --field-decorator-line-focus-size: 2px; --field-decorator-disabled-color: var(--color-text-disabled); --field-decorator-standard-normal-padding-top: 20px; --field-decorator-standard-normal-padding-bottom: 4px; --field-decorator-standard-normal-icon-padding: 20px 0 4px; --field-decorator-standard-small-padding-top: 16px; --field-decorator-standard-small-padding-bottom: 4px; --field-decorator-standard-small-icon-padding: 16px 0 4px; --field-decorator-outlined-normal-padding-top: 16px; --field-decorator-outlined-normal-padding-bottom: 16px; --field-decorator-outlined-normal-padding-left: 16px; --field-decorator-outlined-normal-padding-right: 16px; --field-decorator-outlined-normal-placeholder-space: 4px; --field-decorator-outlined-normal-icon-padding: 16px 0 16px; --field-decorator-outlined-small-padding-top: 8px; --field-decorator-outlined-small-padding-bottom: 8px; --field-decorator-outlined-small-padding-left: 12px; --field-decorator-outlined-small-padding-right: 12px; --field-decorator-outlined-small-placeholder-space: 2px; --field-decorator-outlined-small-icon-padding: 8px 0 8px;}.var-field-decorator { width: 100%; color: var(--field-decorator-text-color); position: relative;}.var-field-decorator__controller { width: 100%; display: flex; position: relative;}.var-field-decorator__wrap { position: relative; flex-grow: 1; display: flex; flex-direction: column;}.var-field-decorator__icon { display: flex; align-items: center; font-size: var(--field-decorator-icon-size);}.var-field-decorator__placeholder { max-width: 100%; position: absolute; font-size: var(--field-decorator-placeholder-size); line-height: 1em; color: var(--field-decorator-blur-color); pointer-events: none; cursor: inherit; transform: translate(0, 0); vertical-align: middle;}.var-field-decorator__clear-icon[var-field-decorator-cover] { display: flex; font-size: 15px; margin-left: 4px; cursor: pointer;}.var-field-decorator--non-hint { padding-top: 0;}.var-field-decorator--placeholder-hint { font-size: 0.75em; top: 0 !important;}.var-field-decorator--placeholder-hidden { visibility: hidden;}.var-field-decorator--focus { color: var(--field-decorator-focus-color);}.var-field-decorator--disabled { color: var(--field-decorator-disabled-color); cursor: not-allowed;}.var-field-decorator--error { color: var(--field-decorator-error-color);}.var-field-decorator--standard .var-field-decorator__wrap { padding: var(--field-decorator-standard-normal-padding-top) 0 var(--field-decorator-standard-normal-padding-bottom);}.var-field-decorator--standard .var-field-decorator__icon { padding: var(--field-decorator-standard-normal-icon-padding);}.var-field-decorator--standard .var-field-decorator--wrap-non-hint { padding: 4px 0;}.var-field-decorator--standard .var-field-decorator__placeholder { left: 0; transform-origin: left; transition: top 0.3s, transform 0.3s, font-size 0.3s, color 0.25s; top: calc(var(--field-decorator-standard-normal-padding-top) + (100% - var(--field-decorator-standard-normal-padding-top) - var(--field-decorator-standard-normal-padding-bottom) - var(--field-decorator-placeholder-size)) / 2);}.var-field-decorator--standard .var-field-decorator__placeholder-textarea { top: var(--field-decorator-standard-normal-padding-top);}.var-field-decorator--standard .var-field-decorator--placeholder-hint { transform: translate(0, 0);}.var-field-decorator--standard .var-field-decorator--placeholder-non-hint { top: 50%; transform: translate(0, -50%);}.var-field-decorator--standard .var-field-decorator__line { width: 100%; height: var(--field-decorator-line-size); background: var(--field-decorator-blur-color); transition: background-color 0.25s;}.var-field-decorator--standard .var-field-decorator--line-disabled { background: var(--field-decorator-disabled-color);}.var-field-decorator--standard .var-field-decorator__dot { width: 100%; height: var(--field-decorator-line-focus-size); background: var(--field-decorator-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier), background-color 0.25s;}.var-field-decorator--standard .var-field-decorator--line-focus { transform: scaleX(1);}.var-field-decorator--standard .var-field-decorator--line-error { background: var(--field-decorator-error-color);}.var-field-decorator--outlined .var-field-decorator__controller { padding: 0 var(--field-decorator-outlined-normal-padding-right) 0 var(--field-decorator-outlined-normal-padding-left);}.var-field-decorator--outlined .var-field-decorator__wrap { padding: var(--field-decorator-outlined-normal-padding-top) 0 var(--field-decorator-outlined-normal-padding-bottom) 0;}.var-field-decorator--outlined .var-field-decorator__icon { padding: var(--field-decorator-outlined-normal-icon-padding);}.var-field-decorator--outlined .var-field-decorator__placeholder { transform-origin: left; transition: top 0.3s, transform 0.3s, font-size 0.3s, margin 0.3s, color 0.25s; top: calc(var(--field-decorator-outlined-normal-padding-top) + (100% - var(--field-decorator-outlined-normal-padding-top) - var(--field-decorator-outlined-normal-padding-bottom) - var(--field-decorator-placeholder-size)) / 2);}.var-field-decorator--outlined .var-field-decorator__placeholder-textarea { top: var(--field-decorator-outlined-normal-padding-top);}.var-field-decorator--outlined .var-field-decorator--placeholder-hint { transform: translateY(-50%);}.var-field-decorator--outlined .var-field-decorator__line { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; align-items: center; pointer-events: none;}.var-field-decorator--outlined .var-field-decorator__line-start { flex: 0 0 calc(var(--field-decorator-outlined-normal-padding-left) - var(--field-decorator-outlined-normal-placeholder-space)); height: 100%; border-radius: 4px 0 0 4px; border: 0 solid var(--field-decorator-blur-color); border-top-width: var(--field-decorator-line-size); border-bottom-width: var(--field-decorator-line-size); border-inline-start-width: var(--field-decorator-line-size); transition: border 0.1s;}.var-field-decorator--outlined .var-field-decorator__line-notch { max-width: calc(100% - (var(--field-decorator-outlined-normal-padding-left) - var(--field-decorator-outlined-normal-placeholder-space)) - (var(--field-decorator-outlined-normal-padding-right) - var(--field-decorator-outlined-normal-placeholder-space))); height: 100%; font: inherit; border: 0 solid var(--field-decorator-blur-color); border-top-width: var(--field-decorator-line-size); border-bottom-width: var(--field-decorator-line-size); transition: border 0.1s;}.var-field-decorator--outlined .var-field-decorator__line-notch--hint { border-top-width: 0 !important;}.var-field-decorator--outlined .var-field-decorator__line-placeholder { max-width: 100%; visibility: hidden; font-size: 0.75em; margin: 0 var(--field-decorator-outlined-normal-placeholder-space);}.var-field-decorator--outlined .var-field-decorator__line-end { flex: 1; height: 100%; border-radius: 0 4px 4px 0; border: 0 solid var(--field-decorator-blur-color); border-top-width: var(--field-decorator-line-size); border-bottom-width: var(--field-decorator-line-size); border-inline-end-width: var(--field-decorator-line-size); transition: border 0.1s;}.var-field-decorator--outlined .var-field-decorator--line-focus .var-field-decorator__line-start { border: 0 solid var(--field-decorator-focus-color); border-top-width: var(--field-decorator-line-focus-size); border-bottom-width: var(--field-decorator-line-focus-size); border-inline-start-width: var(--field-decorator-line-focus-size);}.var-field-decorator--outlined .var-field-decorator--line-focus .var-field-decorator__line-notch { border: 0 solid var(--field-decorator-focus-color); border-top-width: var(--field-decorator-line-focus-size); border-bottom-width: var(--field-decorator-line-focus-size);}.var-field-decorator--outlined .var-field-decorator--line-focus .var-field-decorator__line-end { border: 0 solid var(--field-decorator-focus-color); border-top-width: var(--field-decorator-line-focus-size); border-bottom-width: var(--field-decorator-line-focus-size); border-inline-end-width: var(--field-decorator-line-focus-size);}.var-field-decorator--outlined .var-field-decorator--line-disabled { border-radius: 4px; border: var(--field-decorator-line-size) solid var(--field-decorator-disabled-color);}.var-field-decorator--outlined .var-field-decorator--line-error { border-color: var(--field-decorator-error-color) !important;}.var-field-decorator--standard.var-field-decorator--small .var-field-decorator__wrap { padding: var(--field-decorator-standard-small-padding-top) 0 var(--field-decorator-standard-small-padding-bottom);}.var-field-decorator--standard.var-field-decorator--small .var-field-decorator__placeholder { top: calc(var(--field-decorator-standard-small-padding-top) + (100% - var(--field-decorator-standard-small-padding-top) - var(--field-decorator-standard-small-padding-bottom) - var(--field-decorator-placeholder-size)) / 2);}.var-field-decorator--standard.var-field-decorator--small .var-field-decorator__placeholder-textarea { top: var(--field-decorator-standard-small-padding-top);}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__controller { padding: 0 var(--field-decorator-outlined-small-padding-right) 0 var(--field-decorator-outlined-small-padding-left);}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__wrap { padding: var(--field-decorator-outlined-small-padding-top) 0 var(--field-decorator-outlined-small-padding-bottom) 0;}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__icon { padding: var(--field-decorator-outlined-small-icon-padding);}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__placeholder { top: calc(var(--field-decorator-outlined-small-padding-top) + (100% - var(--field-decorator-outlined-small-padding-top) - var(--field-decorator-outlined-small-padding-bottom) - var(--field-decorator-placeholder-size)) / 2);}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__placeholder-textarea { top: var(--field-decorator-outlined-small-padding-top);}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__line-start { flex: 0 0 calc(var(--field-decorator-outlined-small-padding-left) - var(--field-decorator-outlined-small-placeholder-space));}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__line-notch { max-width: calc(100% - (var(--field-decorator-outlined-small-padding-left) - var(--field-decorator-outlined-small-placeholder-space)) - (var(--field-decorator-outlined-small-padding-right) - var(--field-decorator-outlined-small-placeholder-space)));}.var-field-decorator--outlined.var-field-decorator--small .var-field-decorator__line-placeholder { margin: 0 var(--field-decorator-outlined-small-placeholder-space);}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineListenerProp } from '../utils/components.mjs';
|
|
2
|
+
export function sizeValidator(size) {
|
|
3
|
+
return ['small', 'normal'].includes(size);
|
|
4
|
+
}
|
|
5
|
+
export function variantValidator(variant) {
|
|
6
|
+
return ['outlined', 'standard'].includes(variant);
|
|
7
|
+
}
|
|
8
|
+
export var props = {
|
|
9
|
+
value: {
|
|
10
|
+
type: null,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
id: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ''
|
|
16
|
+
},
|
|
17
|
+
isFocus: {
|
|
18
|
+
type: Boolean
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'normal',
|
|
23
|
+
validator: sizeValidator
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'standard',
|
|
28
|
+
validator: variantValidator
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
line: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
hint: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
textColor: {
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
focusColor: {
|
|
45
|
+
type: String
|
|
46
|
+
},
|
|
47
|
+
blurColor: {
|
|
48
|
+
type: String
|
|
49
|
+
},
|
|
50
|
+
errorMessage: {
|
|
51
|
+
type: String
|
|
52
|
+
},
|
|
53
|
+
formDisabled: {
|
|
54
|
+
type: Boolean
|
|
55
|
+
},
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
clearable: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
textarea: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
cursor: {
|
|
69
|
+
type: String
|
|
70
|
+
},
|
|
71
|
+
composing: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
alwaysCustomPlaceholder: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
onClick: defineListenerProp(),
|
|
80
|
+
onClear: defineListenerProp()
|
|
81
|
+
};
|
package/es/index.bundle.mjs
CHANGED
|
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
|
|
|
241
241
|
import './tooltip/style/index.mjs'
|
|
242
242
|
import './uploader/style/index.mjs'
|
|
243
243
|
|
|
244
|
-
const version = '2.
|
|
244
|
+
const version = '2.10.0-alpha.1681657406626'
|
|
245
245
|
|
|
246
246
|
function install(app) {
|
|
247
247
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
|
|
|
160
160
|
export * from './tooltip/index.mjs'
|
|
161
161
|
export * from './uploader/index.mjs'
|
|
162
162
|
|
|
163
|
-
const version = '2.
|
|
163
|
+
const version = '2.10.0-alpha.1681657406626'
|
|
164
164
|
|
|
165
165
|
function install(app) {
|
|
166
166
|
ActionSheet.install && app.use(ActionSheet)
|