@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.
Files changed (45) hide show
  1. package/es/fab/Fab.mjs +3 -5
  2. package/es/field-decorator/FieldDecorator.mjs +196 -0
  3. package/es/field-decorator/FieldDecoratorSfc.css +0 -0
  4. package/es/field-decorator/fieldDecorator.css +1 -0
  5. package/es/field-decorator/props.mjs +81 -0
  6. package/es/field-decorator/style/index.mjs +4 -0
  7. package/es/icon/icon.css +1 -1
  8. package/es/index.bundle.mjs +1 -1
  9. package/es/index.mjs +1 -1
  10. package/es/input/Input.mjs +173 -161
  11. package/es/input/input.css +1 -1
  12. package/es/input/props.mjs +7 -33
  13. package/es/input/style/index.mjs +2 -1
  14. package/es/menu/usePopover.mjs +2 -2
  15. package/es/option/Option.mjs +0 -3
  16. package/es/option/option.css +1 -1
  17. package/es/select/Select.mjs +104 -145
  18. package/es/select/props.mjs +7 -33
  19. package/es/select/select.css +1 -1
  20. package/es/select/style/index.mjs +1 -0
  21. package/es/snackbar/Snackbar.mjs +1 -0
  22. package/es/snackbar/core.mjs +4 -0
  23. package/es/snackbar/index.mjs +18 -3
  24. package/es/snackbar/props.mjs +1 -1
  25. package/es/snackbar/style/index.mjs +1 -1
  26. package/es/sticky/Sticky.mjs +2 -2
  27. package/es/style.css +1 -1
  28. package/es/swipe/Swipe.mjs +1 -1
  29. package/es/tabs/Tabs.mjs +1 -1
  30. package/es/themes/dark/fieldDecorator.mjs +4 -0
  31. package/es/themes/dark/index.mjs +2 -2
  32. package/es/themes/dark/select.mjs +0 -2
  33. package/es/utils/components.mjs +42 -9
  34. package/es/varlet.esm.js +6876 -6683
  35. package/highlight/web-types.en-US.json +23 -1
  36. package/highlight/web-types.zh-CN.json +41 -1
  37. package/lib/style.css +1 -1
  38. package/lib/varlet.cjs.js +1200 -979
  39. package/package.json +6 -6
  40. package/types/input.d.ts +5 -1
  41. package/types/select.d.ts +5 -1
  42. package/types/snackbar.d.ts +6 -1
  43. package/types/varComponent.d.ts +2 -0
  44. package/umd/varlet.js +5 -5
  45. package/es/themes/dark/input.mjs +0 -4
@@ -1,5 +1,5 @@
1
1
  import VarFormDetails from '../form-details/index.mjs';
2
- import VarIcon from '../icon/index.mjs';
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, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, createBlock as _createBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
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 = ["id", "disabled", "type", "value", "maxlength", "rows"];
18
- var _hoisted_2 = ["id", "disabled", "type", "value", "maxlength"];
19
- var _hoisted_3 = ["for"];
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 _component_var_icon = _resolveComponent("var-icon");
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'), [_ctx.disabled, _ctx.n('--disabled')])),
28
- onClick: _cache[14] || (_cache[14] = function () {
29
- return _ctx.handleClick && _ctx.handleClick(...arguments);
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
- }, [_createElementVNode("div", {
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
- disabled: _ctx.formDisabled || _ctx.disabled || _ctx.formReadonly || _ctx.readonly,
93
- type: _ctx.type,
94
- value: _ctx.modelValue,
95
- maxlength: _ctx.maxlength,
96
- style: _normalizeStyle({
97
- color: _ctx.textColor,
98
- caretColor: !_ctx.errorMessage ? _ctx.focusColor : undefined
99
- }),
100
- onFocus: _cache[7] || (_cache[7] = function () {
101
- return _ctx.handleFocus && _ctx.handleFocus(...arguments);
102
- }),
103
- onBlur: _cache[8] || (_cache[8] = function () {
104
- return _ctx.handleBlur && _ctx.handleBlur(...arguments);
105
- }),
106
- onInput: _cache[9] || (_cache[9] = function () {
107
- return _ctx.handleInput && _ctx.handleInput(...arguments);
108
- }),
109
- onChange: _cache[10] || (_cache[10] = function () {
110
- return _ctx.handleChange && _ctx.handleChange(...arguments);
111
- }),
112
- onTouchstart: _cache[11] || (_cache[11] = function () {
113
- return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
114
- }),
115
- onCompositionstart: _cache[12] || (_cache[12] = function () {
116
- return _ctx.handleCompositionStart && _ctx.handleCompositionStart(...arguments);
117
- }),
118
- onCompositionend: _cache[13] || (_cache[13] = function () {
119
- return _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...arguments);
120
- })
121
- }, null, 46
122
- /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
123
- , _hoisted_2)), _createElementVNode("label", {
124
- class: _normalizeClass(_ctx.classes(_ctx.n('$--ellipsis'), [_ctx.isFocus, _ctx.n('--focus')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n('--error')], [_ctx.textarea, _ctx.n('textarea-placeholder'), _ctx.n('placeholder')], _ctx.computePlaceholderState(), [!_ctx.hint, _ctx.n('--placeholder-non-hint')])),
125
- style: _normalizeStyle({
126
- color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : undefined
127
- }),
128
- for: _ctx.id
129
- }, _toDisplayString(_ctx.placeholder), 15
130
- /* TEXT, CLASS, STYLE, PROPS */
131
- , _hoisted_3)], 2
132
- /* CLASS */
133
- ), _createElementVNode("div", {
134
- class: _normalizeClass(_ctx.classes(_ctx.n('icon'), [!_ctx.hint, _ctx.n('--non-hint')]))
135
- }, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable && !_ctx.isEmpty(_ctx.modelValue) ? (_openBlock(), _createBlock(_component_var_icon, {
136
- key: 0,
137
- class: _normalizeClass(_ctx.n('clear-icon')),
138
- "var-input-cover": "",
139
- name: "close-circle",
140
- onClick: _ctx.handleClear
141
- }, null, 8
142
- /* PROPS */
143
- , ["class", "onClick"])) : _createCommentVNode("v-if", true)])], 2
144
- /* CLASS */
145
- )], 6
146
- /* CLASS, STYLE */
147
- ), _ctx.line ? (_openBlock(), _createElementBlock("div", {
148
- key: 0,
149
- class: _normalizeClass(_ctx.classes(_ctx.n('line'), [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
150
- style: _normalizeStyle({
151
- background: !_ctx.errorMessage ? _ctx.blurColor : undefined
152
- })
153
- }, [_createElementVNode("div", {
154
- class: _normalizeClass(_ctx.classes(_ctx.n('dot'), [_ctx.isFocus, _ctx.n('--spread')], [_ctx.formDisabled || _ctx.disabled, _ctx.n('--line-disabled')], [_ctx.errorMessage, _ctx.n('--line-error')])),
155
- style: _normalizeStyle({
156
- background: !_ctx.errorMessage ? _ctx.focusColor : undefined
157
- })
158
- }, null, 6
159
- /* CLASS, STYLE */
160
- )], 6
161
- /* CLASS, STYLE */
162
- )) : _createCommentVNode("v-if", true), _createVNode(_component_var_form_details, {
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"])], 2
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
- VarIcon,
176
- VarFormDetails
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
- }; // expose
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,
@@ -1 +1 @@
1
- :root { --input-input-text-color: #555; --input-error-color: var(--color-danger); --input-blur-color: #888; --input-focus-color: var(--color-primary); --input-placeholder-size: 16px; --input-textarea-height: auto; --input-textarea-padding-top: 8px; --input-icon-padding: 16px 0 0; --input-icon-size: 20px; --input-line-size: 1px; --input-line-spread-size: 2px; --input-disabled-color: var(--color-text-disabled);}.var-input-footer-margin-enter-from,.var-input-footer-margin-leave-to { opacity: 0; margin-top: 2px !important;}.var-input-footer-margin-enter-active,.var-input-footer-margin-leave-active { transition: 0.2s all var(--cubic-bezier);}.var-input { width: 100%; color: var(--input-input-text-color); overflow: hidden;}.var-input__controller { width: 100%; display: flex; position: relative;}.var-input__wrap { position: relative; flex-grow: 1; display: flex; flex-direction: column; padding-top: var(--input-placeholder-size);}.var-input__icon { display: flex; align-items: center; padding: var(--input-icon-padding); font-size: 20px;}.var-input__placeholder { position: absolute; top: 50%; left: 0; width: 100%; transform-origin: left; transition: top 0.3s, transform 0.3s, width 0.3s, color 0.25s; transform: translate(0, calc(-50% + var(--input-placeholder-size) / 2)) scale(1); font-size: var(--input-placeholder-size); color: var(--input-blur-color); cursor: inherit;}.var-input__textarea-placeholder { position: absolute; top: 0; left: 0; width: 100%; transform-origin: left; transition: transform 0.3s, width 0.3s, color 0.25s; transform: translate(0, calc(var(--input-textarea-padding-top) + var(--input-placeholder-size))) scale(1); font-size: var(--input-placeholder-size); color: var(--input-blur-color); cursor: inherit;}.var-input__autocomplete { width: 0; height: 0; padding: 0; border: none; outline: none; font-size: 0;}.var-input__input { width: 100%; height: 32px; padding: 0; outline: none; border: none; background: transparent; color: var(--input-input-text-color); caret-color: var(--input-focus-color); transition: color 0.25s; font: inherit;}.var-input__line { width: 100%; height: var(--input-line-size); background: var(--input-blur-color); transition: background-color 0.25s;}.var-input__dot { width: 100%; height: var(--input-line-spread-size); background: var(--input-focus-color); transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--cubic-bezier), background-color 0.25s;}.var-input__clear-icon[var-input-cover] { display: flex; font-size: 15px; margin-left: 4px;}.var-input--textarea { padding-top: var(--input-textarea-padding-top); height: var(--input-textarea-height);}.var-input--placeholder-hint { top: 0; width: 133.33%; transform: translate(0, 0) scale(0.75);}.var-input--placeholder-non-hint { top: 50%; transform: translate(0, -50%) scale(1);}.var-input--non-hint { padding-top: 0;}.var-input--placeholder-hidden { visibility: hidden;}.var-input--focus { color: var(--input-focus-color);}.var-input--spread { transform: scaleX(1);}.var-input--disabled { color: var(--input-disabled-color); cursor: not-allowed;}.var-input--error { color: var(--input-error-color);}.var-input--line-disabled { background: var(--input-disabled-color);}.var-input--line-error { background: var(--input-error-color);}.var-input--caret-error { caret-color: var(--input-error-color);}
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);}
@@ -1,8 +1,11 @@
1
- import { defineListenerProp } from '../utils/components.mjs';
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']));
@@ -1,5 +1,6 @@
1
1
  import '../../styles/common.css'
2
- import '../../icon/icon.css'
3
2
  import '../../form-details/formDetails.css'
3
+ import '../../icon/icon.css'
4
+ import '../../field-decorator/fieldDecorator.css'
4
5
  import '../input.css'
5
6
  import '../InputSfc.css'
@@ -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, useVModel } from '@varlet/use';
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';
@@ -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,
@@ -1 +1 @@
1
- :root { --option-height: 38px; --option-padding: 0 12px; --option-selected-background: var(--select-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);}
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);}