@varlet/ui 3.3.16 → 3.5.0-alpha.1726249557629

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 (56) hide show
  1. package/es/auto-complete/AutoComplete.mjs +361 -0
  2. package/es/auto-complete/AutoCompleteSfc.css +0 -0
  3. package/es/auto-complete/autoComplete.css +1 -0
  4. package/es/auto-complete/index.mjs +11 -0
  5. package/es/auto-complete/props.mjs +63 -0
  6. package/es/auto-complete/provide.mjs +0 -0
  7. package/es/auto-complete/style/index.mjs +11 -0
  8. package/es/checkbox/props.mjs +1 -1
  9. package/es/checkbox-group/CheckboxGroup.mjs +3 -5
  10. package/es/checkbox-group/props.mjs +5 -2
  11. package/es/counter/props.mjs +1 -1
  12. package/es/field-decorator/FieldDecorator.mjs +8 -8
  13. package/es/field-decorator/props.mjs +1 -1
  14. package/es/index.bundle.mjs +7 -1
  15. package/es/index.mjs +6 -1
  16. package/es/input/Input.mjs +12 -13
  17. package/es/input/props.mjs +22 -3
  18. package/es/menu-option/MenuOption.mjs +5 -2
  19. package/es/menu-option/menuOption.css +1 -1
  20. package/es/menu-select/MenuSelect.mjs +4 -5
  21. package/es/menu-select/props.mjs +13 -3
  22. package/es/radio/props.mjs +1 -1
  23. package/es/radio-group/RadioGroup.mjs +4 -6
  24. package/es/radio-group/props.mjs +5 -2
  25. package/es/select/Select.mjs +3 -5
  26. package/es/select/props.mjs +5 -2
  27. package/es/slider/props.mjs +1 -1
  28. package/es/style.css +1 -1
  29. package/es/style.mjs +1 -0
  30. package/es/switch/props.mjs +1 -1
  31. package/es/tooltip/Tooltip.mjs +5 -1
  32. package/es/tooltip/props.mjs +1 -0
  33. package/es/uploader/props.mjs +1 -1
  34. package/es/utils/components.mjs +30 -9
  35. package/es/varlet.esm.js +14219 -13843
  36. package/highlight/web-types.en-US.json +268 -30
  37. package/highlight/web-types.zh-CN.json +270 -32
  38. package/lib/style.css +1 -1
  39. package/lib/varlet.cjs.js +15305 -14844
  40. package/package.json +9 -8
  41. package/types/autoComplete.d.ts +84 -0
  42. package/types/checkbox.d.ts +3 -3
  43. package/types/checkboxGroup.d.ts +1 -1
  44. package/types/counter.d.ts +1 -1
  45. package/types/index.d.ts +2 -0
  46. package/types/input.d.ts +2 -1
  47. package/types/radio.d.ts +1 -1
  48. package/types/radioGroup.d.ts +1 -1
  49. package/types/rate.d.ts +1 -1
  50. package/types/select.d.ts +1 -1
  51. package/types/slider.d.ts +1 -1
  52. package/types/styleVars.d.ts +1 -0
  53. package/types/switch.d.ts +1 -1
  54. package/types/tooltip.d.ts +1 -0
  55. package/types/uploader.d.ts +1 -1
  56. package/umd/varlet.js +8 -8
@@ -0,0 +1,361 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import VarInput from "../input/index.mjs";
22
+ import VarMenuSelect from "../menu-select/index.mjs";
23
+ import VarMenuOption from "../menu-option/index.mjs";
24
+ import VarFormDetails from "../form-details/index.mjs";
25
+ import { computed, defineComponent, nextTick, ref, watch } from "vue";
26
+ import { props } from "./props.mjs";
27
+ import { createNamespace, useValidation } from "../utils/components.mjs";
28
+ import { useClickOutside, useEventListener, useVModel } from "@varlet/use";
29
+ import { call, isEmpty, preventDefault, raf, toNumber } from "@varlet/shared";
30
+ import { useForm } from "../form/provide.mjs";
31
+ const { name, n } = createNamespace("auto-complete");
32
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
33
+ const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
34
+ const _hoisted_1 = ["tabindex"];
35
+ function __render__(_ctx, _cache) {
36
+ const _component_var_input = _resolveComponent("var-input");
37
+ const _component_var_menu_option = _resolveComponent("var-menu-option");
38
+ const _component_var_menu_select = _resolveComponent("var-menu-select");
39
+ const _component_var_form_details = _resolveComponent("var-form-details");
40
+ return _openBlock(), _createElementBlock("div", {
41
+ ref: "root",
42
+ class: _normalizeClass(_ctx.n()),
43
+ tabindex: _ctx.disabled || _ctx.formDisabled ? void 0 : "0",
44
+ onFocusin: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
45
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
46
+ }, [
47
+ _createVNode(_component_var_menu_select, {
48
+ "same-width": "",
49
+ "auto-complete-cover": "",
50
+ scrollable: "",
51
+ trigger: "manual",
52
+ placement: "bottom",
53
+ disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
54
+ class: _normalizeClass(_ctx.n("menu-select")),
55
+ "popover-class": _ctx.variant === "standard" ? _ctx.n("--standard-menu-margin") : void 0,
56
+ show: _ctx.isShowMenuSelect,
57
+ "onUpdate:show": _cache[1] || (_cache[1] = ($event) => _ctx.isShowMenuSelect = $event),
58
+ "onUpdate:modelValue": _ctx.handleAutoComplete,
59
+ onKeyEscape: _ctx.handleKeyEscape
60
+ }, {
61
+ options: _withCtx(() => [
62
+ _createElementVNode(
63
+ "div",
64
+ {
65
+ class: _normalizeClass(_ctx.n("options"))
66
+ },
67
+ [
68
+ (_openBlock(true), _createElementBlock(
69
+ _Fragment,
70
+ null,
71
+ _renderList(_ctx.viewOptions, (option) => {
72
+ return _openBlock(), _createBlock(_component_var_menu_option, {
73
+ key: option[_ctx.valueKey],
74
+ label: option[_ctx.labelKey],
75
+ value: option[_ctx.valueKey],
76
+ option,
77
+ disabled: option.disabled
78
+ }, null, 8, ["label", "value", "option", "disabled"]);
79
+ }),
80
+ 128
81
+ /* KEYED_FRAGMENT */
82
+ ))
83
+ ],
84
+ 2
85
+ /* CLASS */
86
+ )
87
+ ]),
88
+ default: _withCtx(() => [
89
+ _createVNode(_component_var_input, _mergeProps({ ref: "input" }, {
90
+ maxlength: _ctx.maxlength,
91
+ enterkeyhint: _ctx.enterkeyhint,
92
+ placeholder: _ctx.placeholder,
93
+ size: _ctx.size,
94
+ variant: _ctx.variant,
95
+ line: _ctx.line,
96
+ hint: _ctx.hint,
97
+ textColor: _ctx.textColor,
98
+ focusColor: _ctx.focusColor,
99
+ blurColor: _ctx.blurColor,
100
+ readonly: _ctx.readonly,
101
+ disabled: _ctx.disabled,
102
+ clearable: _ctx.clearable
103
+ }, {
104
+ autocomplete: "off",
105
+ "is-force-focusing-effect": _ctx.isFocusing,
106
+ "is-force-error-effect": !!_ctx.errorMessage,
107
+ "is-show-form-details": false,
108
+ onInput: _ctx.handleInput,
109
+ onBlur: _ctx.handleBlur,
110
+ onClear: _ctx.handleClear,
111
+ onChange: _ctx.handleChange,
112
+ modelValue: _ctx.value,
113
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event)
114
+ }), _createSlots({
115
+ _: 2
116
+ /* DYNAMIC */
117
+ }, [
118
+ _ctx.$slots["prepend-icon"] ? {
119
+ name: "prepend-icon",
120
+ fn: _withCtx(() => [
121
+ _renderSlot(_ctx.$slots, "prepend-icon")
122
+ ]),
123
+ key: "0"
124
+ } : void 0,
125
+ _ctx.$slots["append-icon"] ? {
126
+ name: "append-icon",
127
+ fn: _withCtx(() => [
128
+ _renderSlot(_ctx.$slots, "append-icon")
129
+ ]),
130
+ key: "1"
131
+ } : void 0,
132
+ _ctx.$slots["clear-icon"] ? {
133
+ name: "clear-icon",
134
+ fn: _withCtx(({ clear }) => [
135
+ _renderSlot(_ctx.$slots, "clear-icon", { clear })
136
+ ]),
137
+ key: "2"
138
+ } : void 0,
139
+ _ctx.$slots["extra-message"] ? {
140
+ name: "extra-message",
141
+ fn: _withCtx(() => [
142
+ _renderSlot(_ctx.$slots, "extra-message")
143
+ ]),
144
+ key: "3"
145
+ } : void 0
146
+ ]), 1040, ["is-force-focusing-effect", "is-force-error-effect", "onInput", "onBlur", "onClear", "onChange", "modelValue"])
147
+ ]),
148
+ _: 3
149
+ /* FORWARDED */
150
+ }, 8, ["disabled", "class", "popover-class", "show", "onUpdate:modelValue", "onKeyEscape"]),
151
+ _createVNode(_component_var_form_details, {
152
+ "error-message": _ctx.errorMessage,
153
+ "extra-message": _ctx.maxlengthText
154
+ }, null, 8, ["error-message", "extra-message"])
155
+ ], 42, _hoisted_1);
156
+ }
157
+ const __sfc__ = defineComponent({
158
+ name,
159
+ components: {
160
+ VarInput,
161
+ VarMenuSelect,
162
+ VarMenuOption,
163
+ VarFormDetails
164
+ },
165
+ props,
166
+ setup(props2) {
167
+ const root = ref();
168
+ const input = ref();
169
+ const isFocusing = ref(false);
170
+ const value = useVModel(props2, "modelValue");
171
+ const viewOptions = ref([]);
172
+ const isShowMenuSelect = ref(false);
173
+ const maxlengthText = computed(() => {
174
+ const { maxlength } = props2;
175
+ if (!maxlength) {
176
+ return "";
177
+ }
178
+ if (isEmpty(value.value)) {
179
+ return `0 / ${maxlength}`;
180
+ }
181
+ return `${String(value.value).length}/${maxlength}`;
182
+ });
183
+ const {
184
+ errorMessage,
185
+ validateWithTrigger: vt,
186
+ validate: v,
187
+ // expose
188
+ resetValidation
189
+ } = useValidation();
190
+ const { bindForm, form } = useForm();
191
+ let clearing = false;
192
+ const autoCompleteProvider = {
193
+ reset,
194
+ resetValidation,
195
+ validate
196
+ };
197
+ useClickOutside(
198
+ () => root.value,
199
+ "click",
200
+ () => {
201
+ if (clearing) {
202
+ clearing = false;
203
+ return;
204
+ }
205
+ blur();
206
+ }
207
+ );
208
+ watch(() => [props2.options, isFocusing.value], changeMenuState);
209
+ call(bindForm, autoCompleteProvider);
210
+ useEventListener(() => window, "keydown", handleKeydown);
211
+ function reset() {
212
+ call(props2["onUpdate:modelValue"], "");
213
+ resetValidation();
214
+ }
215
+ function validate() {
216
+ return v(props2.rules, props2.modelValue);
217
+ }
218
+ function focus() {
219
+ if (isFocusing.value || props2.disabled || (form == null ? void 0 : form.disabled.value)) {
220
+ return;
221
+ }
222
+ isFocusing.value = true;
223
+ input.value.focus();
224
+ call(props2.onFocus);
225
+ validateWithTrigger("onFocus");
226
+ }
227
+ function blur() {
228
+ if (!isFocusing.value) {
229
+ return;
230
+ }
231
+ isFocusing.value = false;
232
+ isShowMenuSelect.value = false;
233
+ input.value.blur();
234
+ call(props2.onBlur);
235
+ validateWithTrigger("onBlur");
236
+ }
237
+ function handleBlur() {
238
+ if (isShowMenuSelect.value) {
239
+ return;
240
+ }
241
+ blur();
242
+ }
243
+ function validateWithTrigger(trigger) {
244
+ nextTick(() => {
245
+ const { validateTrigger, rules, modelValue } = props2;
246
+ vt(validateTrigger, trigger, rules, modelValue);
247
+ });
248
+ }
249
+ function handleKeydown(event) {
250
+ return __async(this, null, function* () {
251
+ var _a;
252
+ if ((form == null ? void 0 : form.disabled.value) || (form == null ? void 0 : form.readonly.value) || props2.disabled || props2.readonly || !isFocusing.value || !isShowMenuSelect.value) {
253
+ return;
254
+ }
255
+ const { key } = event;
256
+ if (key === "Tab") {
257
+ preventDefault(event);
258
+ root.value.focus();
259
+ isShowMenuSelect.value = false;
260
+ return;
261
+ }
262
+ if (!["ArrowUp", "ArrowDown", "Enter"].includes(key)) {
263
+ input.value.focus();
264
+ return;
265
+ }
266
+ if (key === "Enter") {
267
+ yield raf();
268
+ (_a = input.value) == null ? void 0 : _a.focus();
269
+ }
270
+ });
271
+ }
272
+ function changeMenuState() {
273
+ return __async(this, null, function* () {
274
+ if (isFocusing.value) {
275
+ isShowMenuSelect.value = getShowMenuSelect(value.value);
276
+ }
277
+ if (isShowMenuSelect.value) {
278
+ viewOptions.value = props2.options;
279
+ }
280
+ });
281
+ }
282
+ function handleInput(newValue, event) {
283
+ return __async(this, null, function* () {
284
+ changeMenuState();
285
+ call(props2.onInput, newValue, event);
286
+ validateWithTrigger("onInput");
287
+ });
288
+ }
289
+ function handleClear() {
290
+ clearing = true;
291
+ changeMenuState();
292
+ call(props2.onClear, value.value);
293
+ validateWithTrigger("onClear");
294
+ }
295
+ function handleClick(event) {
296
+ if (props2.disabled || (form == null ? void 0 : form.disabled.value)) {
297
+ return;
298
+ }
299
+ call(props2.onClick, event);
300
+ validateWithTrigger("onClick");
301
+ }
302
+ function handleChange(newValue) {
303
+ call(props2.onChange, newValue);
304
+ validateWithTrigger("onChange");
305
+ }
306
+ function handleAutoComplete(newValue) {
307
+ return __async(this, null, function* () {
308
+ var _a;
309
+ if (props2.maxlength != null) {
310
+ newValue = newValue.slice(0, toNumber(props2.maxlength));
311
+ }
312
+ if (newValue !== value.value) {
313
+ value.value = newValue;
314
+ call(props2.onChange, newValue);
315
+ validateWithTrigger("onChange");
316
+ }
317
+ yield raf();
318
+ (_a = input.value) == null ? void 0 : _a.focus();
319
+ });
320
+ }
321
+ function handleKeyEscape() {
322
+ input.value.focus();
323
+ }
324
+ function getShowMenuSelect(newValue) {
325
+ if (props2.disabled || props2.readonly || (form == null ? void 0 : form.disabled.value) || (form == null ? void 0 : form.readonly.value)) {
326
+ return false;
327
+ }
328
+ return props2.options.length > 0 && (props2.getShow != null ? props2.getShow(newValue) : newValue.length > 0);
329
+ }
330
+ return {
331
+ root,
332
+ input,
333
+ value,
334
+ isShowMenuSelect,
335
+ viewOptions,
336
+ isFocusing,
337
+ formDisabled: form == null ? void 0 : form.disabled,
338
+ formReadonly: form == null ? void 0 : form.readonly,
339
+ errorMessage,
340
+ maxlengthText,
341
+ n,
342
+ handleInput,
343
+ handleClear,
344
+ handleClick,
345
+ handleChange,
346
+ handleBlur,
347
+ handleKeyEscape,
348
+ handleAutoComplete,
349
+ reset,
350
+ validate,
351
+ resetValidation,
352
+ blur,
353
+ focus
354
+ };
355
+ }
356
+ });
357
+ __sfc__.render = __render__;
358
+ var stdin_default = __sfc__;
359
+ export {
360
+ stdin_default as default
361
+ };
File without changes
@@ -0,0 +1 @@
1
+ :root { --auto-complete-options-padding: 6px 0;}.var-auto-complete { outline: none;}.var-auto-complete__menu-select[auto-complete-cover] { display: block;}.var-auto-complete__options { padding: var(--auto-complete-options-padding);}.var-auto-complete--standard-menu-margin { margin-top: var(--field-decorator-line-focus-size) !important;}
@@ -0,0 +1,11 @@
1
+ import AutoComplete from "./AutoComplete.mjs";
2
+ import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
3
+ import { props as autoCompleteProps } from "./props.mjs";
4
+ withInstall(AutoComplete);
5
+ withPropsDefaultsSetter(AutoComplete, autoCompleteProps);
6
+ const _AutoCompleteComponent = AutoComplete;
7
+ var stdin_default = AutoComplete;
8
+ export {
9
+ _AutoCompleteComponent,
10
+ stdin_default as default
11
+ };
@@ -0,0 +1,63 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { defineListenerProp, pickProps } from "../utils/components.mjs";
18
+ import { inputProps } from "../input/index.mjs";
19
+ const props = __spreadValues({
20
+ modelValue: String,
21
+ options: {
22
+ type: Array,
23
+ default: () => []
24
+ },
25
+ labelKey: {
26
+ type: String,
27
+ default: "label"
28
+ },
29
+ valueKey: {
30
+ type: String,
31
+ default: "value"
32
+ },
33
+ maxlength: [String, Number],
34
+ readonly: Boolean,
35
+ disabled: Boolean,
36
+ validateTrigger: {
37
+ type: Array,
38
+ default: () => ["onInput", "onClear", "onChange"]
39
+ },
40
+ getShow: Function,
41
+ rules: [Array, Function, Object],
42
+ onFocus: defineListenerProp(),
43
+ onBlur: defineListenerProp(),
44
+ onInput: defineListenerProp(),
45
+ onChange: defineListenerProp(),
46
+ onClear: defineListenerProp(),
47
+ onClick: defineListenerProp(),
48
+ "onUpdate:modelValue": defineListenerProp()
49
+ }, pickProps(inputProps, [
50
+ "size",
51
+ "variant",
52
+ "placeholder",
53
+ "enterkeyhint",
54
+ "line",
55
+ "hint",
56
+ "textColor",
57
+ "focusColor",
58
+ "blurColor",
59
+ "clearable"
60
+ ]));
61
+ export {
62
+ props
63
+ };
File without changes
@@ -0,0 +1,11 @@
1
+ import '../../styles/common.css'
2
+ import '../../styles/elevation.css'
3
+ import '../../icon/icon.css'
4
+ import '../../field-decorator/fieldDecorator.css'
5
+ import '../../form-details/formDetails.css'
6
+ import '../../input/input.css'
7
+ import '../../menu/menu.css'
8
+ import '../../menu-option/menuOption.css'
9
+ import '../../menu-select/menuSelect.css'
10
+ import '../autoComplete.css'
11
+ import '../AutoCompleteSfc.css'
@@ -26,7 +26,7 @@ const props = {
26
26
  type: Array,
27
27
  default: () => ["onChange"]
28
28
  },
29
- rules: Array,
29
+ rules: [Array, Function, Object],
30
30
  onClick: defineListenerProp(),
31
31
  onChange: defineListenerProp(),
32
32
  "onUpdate:modelValue": defineListenerProp(),
@@ -5,7 +5,7 @@ import { props } from "./props.mjs";
5
5
  import { useValidation, createNamespace, MaybeVNode } from "../utils/components.mjs";
6
6
  import { useCheckboxes } from "./provide.mjs";
7
7
  import { useForm } from "../form/provide.mjs";
8
- import { uniq, call, isArray, isFunction } from "@varlet/shared";
8
+ import { uniq, call, isFunction } from "@varlet/shared";
9
9
  const { name, n, classes } = createNamespace("checkbox-group");
10
10
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
11
11
  function __render__(_ctx, _cache) {
@@ -24,10 +24,10 @@ function __render__(_ctx, _cache) {
24
24
  class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
25
25
  },
26
26
  [
27
- _ctx.checkboxGroupOptions.length ? (_openBlock(true), _createElementBlock(
27
+ _ctx.options.length ? (_openBlock(true), _createElementBlock(
28
28
  _Fragment,
29
29
  { key: 0 },
30
- _renderList(_ctx.checkboxGroupOptions, (option) => {
30
+ _renderList(_ctx.options, (option) => {
31
31
  return _openBlock(), _createBlock(_component_var_checkbox, {
32
32
  key: option[_ctx.valueKey],
33
33
  "checked-value": option[_ctx.valueKey],
@@ -63,7 +63,6 @@ const __sfc__ = defineComponent({
63
63
  setup(props2) {
64
64
  const max = computed(() => props2.max);
65
65
  const checkedCount = computed(() => props2.modelValue.length);
66
- const checkboxGroupOptions = computed(() => isArray(props2.options) ? props2.options : []);
67
66
  const { length, checkboxes, bindCheckboxes } = useCheckboxes();
68
67
  const { bindForm } = useForm();
69
68
  const {
@@ -141,7 +140,6 @@ const __sfc__ = defineComponent({
141
140
  }
142
141
  return {
143
142
  errorMessage,
144
- checkboxGroupOptions,
145
143
  n,
146
144
  classes,
147
145
  checkAll,
@@ -5,7 +5,10 @@ const props = {
5
5
  default: () => []
6
6
  },
7
7
  max: [String, Number],
8
- options: Array,
8
+ options: {
9
+ type: Array,
10
+ default: () => []
11
+ },
9
12
  labelKey: {
10
13
  type: String,
11
14
  default: "label"
@@ -22,7 +25,7 @@ const props = {
22
25
  type: Array,
23
26
  default: () => ["onChange"]
24
27
  },
25
- rules: Array,
28
+ rules: [Array, Function, Object],
26
29
  onChange: defineListenerProp(),
27
30
  "onUpdate:modelValue": defineListenerProp()
28
31
  };
@@ -45,7 +45,7 @@ const props = {
45
45
  type: Array,
46
46
  default: () => ["onInputChange", "onLazyChange", "onIncrement", "onDecrement"]
47
47
  },
48
- rules: Array,
48
+ rules: [Array, Function, Object],
49
49
  onBeforeChange: defineListenerProp(),
50
50
  onChange: defineListenerProp(),
51
51
  onIncrement: defineListenerProp(),
@@ -45,7 +45,7 @@ function __render__(_ctx, _cache) {
45
45
  _ctx.classes(
46
46
  _ctx.n("controller"),
47
47
  [_ctx.isFocusing, _ctx.n("--focus")],
48
- [_ctx.errorMessage, _ctx.n("--error")],
48
+ [_ctx.isError, _ctx.n("--error")],
49
49
  [_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")]
50
50
  )
51
51
  ),
@@ -91,7 +91,7 @@ function __render__(_ctx, _cache) {
91
91
  [_ctx.isFocusing, _ctx.n("--focus")],
92
92
  [_ctx.hintCenter, _ctx.n("--hint-center")],
93
93
  [_ctx.formDisabled || _ctx.disabled, _ctx.n("--disabled")],
94
- [_ctx.errorMessage, _ctx.n("--error")],
94
+ [_ctx.isError, _ctx.n("--error")],
95
95
  [_ctx.transitionDisabled, _ctx.n("--transition-disabled")],
96
96
  _ctx.computePlaceholderState()
97
97
  )
@@ -147,7 +147,7 @@ function __render__(_ctx, _cache) {
147
147
  _ctx.classes(
148
148
  _ctx.n("line"),
149
149
  [_ctx.isFocusing, _ctx.n("--line-focus")],
150
- [_ctx.errorMessage, _ctx.n("--line-error")],
150
+ [_ctx.isError, _ctx.n("--line-error")],
151
151
  [_ctx.formDisabled || _ctx.disabled, _ctx.n("--line-disabled")]
152
152
  )
153
153
  ),
@@ -189,8 +189,8 @@ function __render__(_ctx, _cache) {
189
189
  "div",
190
190
  {
191
191
  key: 1,
192
- class: _normalizeClass(_ctx.classes(_ctx.n("line"), [_ctx.formDisabled || _ctx.disabled, _ctx.n("--line-disabled")], [_ctx.errorMessage, _ctx.n("--line-error")])),
193
- style: _normalizeStyle({ background: !_ctx.errorMessage ? _ctx.blurColor : void 0 })
192
+ class: _normalizeClass(_ctx.classes(_ctx.n("line"), [_ctx.formDisabled || _ctx.disabled, _ctx.n("--line-disabled")], [_ctx.isError, _ctx.n("--line-error")])),
193
+ style: _normalizeStyle({ background: !_ctx.isError ? _ctx.blurColor : void 0 })
194
194
  },
195
195
  [
196
196
  _createElementVNode(
@@ -201,10 +201,10 @@ function __render__(_ctx, _cache) {
201
201
  _ctx.n("dot"),
202
202
  [_ctx.isFocusing, _ctx.n("--line-focus")],
203
203
  [_ctx.formDisabled || _ctx.disabled, _ctx.n("--line-disabled")],
204
- [_ctx.errorMessage, _ctx.n("--line-error")]
204
+ [_ctx.isError, _ctx.n("--line-error")]
205
205
  )
206
206
  ),
207
- style: _normalizeStyle({ background: !_ctx.errorMessage ? _ctx.focusColor : void 0 })
207
+ style: _normalizeStyle({ background: !_ctx.isError ? _ctx.focusColor : void 0 })
208
208
  },
209
209
  null,
210
210
  6
@@ -238,7 +238,7 @@ const __sfc__ = defineComponent({
238
238
  const isFloating = computed(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
239
239
  const { popup, bindPopup } = usePopup();
240
240
  const color = computed(
241
- () => !props2.errorMessage ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
241
+ () => !props2.isError ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
242
242
  );
243
243
  onWindowResize(resize);
244
244
  onSmartMounted(() => {
@@ -33,7 +33,7 @@ const props = {
33
33
  textColor: String,
34
34
  focusColor: String,
35
35
  blurColor: String,
36
- errorMessage: String,
36
+ isError: Boolean,
37
37
  formDisabled: Boolean,
38
38
  disabled: Boolean,
39
39
  clearable: Boolean,
@@ -1,5 +1,6 @@
1
1
  import ActionSheet from './action-sheet/index.mjs'
2
2
  import AppBar from './app-bar/index.mjs'
3
+ import AutoComplete from './auto-complete/index.mjs'
3
4
  import Avatar from './avatar/index.mjs'
4
5
  import AvatarGroup from './avatar-group/index.mjs'
5
6
  import BackTop from './back-top/index.mjs'
@@ -89,6 +90,7 @@ import Watermark from './watermark/index.mjs'
89
90
 
90
91
  export * from './action-sheet/index.mjs'
91
92
  export * from './app-bar/index.mjs'
93
+ export * from './auto-complete/index.mjs'
92
94
  export * from './avatar/index.mjs'
93
95
  export * from './avatar-group/index.mjs'
94
96
  export * from './back-top/index.mjs'
@@ -178,6 +180,7 @@ export * from './watermark/index.mjs'
178
180
 
179
181
  import './action-sheet/style/index.mjs'
180
182
  import './app-bar/style/index.mjs'
183
+ import './auto-complete/style/index.mjs'
181
184
  import './avatar/style/index.mjs'
182
185
  import './avatar-group/style/index.mjs'
183
186
  import './back-top/style/index.mjs'
@@ -265,11 +268,12 @@ import './tooltip/style/index.mjs'
265
268
  import './uploader/style/index.mjs'
266
269
  import './watermark/style/index.mjs'
267
270
 
268
- const version = '3.3.16'
271
+ const version = '3.5.0-alpha.1726249557629'
269
272
 
270
273
  function install(app) {
271
274
  ActionSheet.install && app.use(ActionSheet)
272
275
  AppBar.install && app.use(AppBar)
276
+ AutoComplete.install && app.use(AutoComplete)
273
277
  Avatar.install && app.use(Avatar)
274
278
  AvatarGroup.install && app.use(AvatarGroup)
275
279
  BackTop.install && app.use(BackTop)
@@ -363,6 +367,7 @@ export {
363
367
  install,
364
368
  ActionSheet,
365
369
  AppBar,
370
+ AutoComplete,
366
371
  Avatar,
367
372
  AvatarGroup,
368
373
  BackTop,
@@ -456,6 +461,7 @@ export default {
456
461
  install,
457
462
  ActionSheet,
458
463
  AppBar,
464
+ AutoComplete,
459
465
  Avatar,
460
466
  AvatarGroup,
461
467
  BackTop,