@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.
- package/es/auto-complete/AutoComplete.mjs +361 -0
- package/es/auto-complete/AutoCompleteSfc.css +0 -0
- package/es/auto-complete/autoComplete.css +1 -0
- package/es/auto-complete/index.mjs +11 -0
- package/es/auto-complete/props.mjs +63 -0
- package/es/auto-complete/provide.mjs +0 -0
- package/es/auto-complete/style/index.mjs +11 -0
- package/es/checkbox/props.mjs +1 -1
- package/es/checkbox-group/CheckboxGroup.mjs +3 -5
- package/es/checkbox-group/props.mjs +5 -2
- package/es/counter/props.mjs +1 -1
- package/es/field-decorator/FieldDecorator.mjs +8 -8
- package/es/field-decorator/props.mjs +1 -1
- package/es/index.bundle.mjs +7 -1
- package/es/index.mjs +6 -1
- package/es/input/Input.mjs +12 -13
- package/es/input/props.mjs +22 -3
- package/es/menu-option/MenuOption.mjs +5 -2
- package/es/menu-option/menuOption.css +1 -1
- package/es/menu-select/MenuSelect.mjs +4 -5
- package/es/menu-select/props.mjs +13 -3
- package/es/radio/props.mjs +1 -1
- package/es/radio-group/RadioGroup.mjs +4 -6
- package/es/radio-group/props.mjs +5 -2
- package/es/select/Select.mjs +3 -5
- package/es/select/props.mjs +5 -2
- package/es/slider/props.mjs +1 -1
- package/es/style.css +1 -1
- package/es/style.mjs +1 -0
- package/es/switch/props.mjs +1 -1
- package/es/tooltip/Tooltip.mjs +5 -1
- package/es/tooltip/props.mjs +1 -0
- package/es/uploader/props.mjs +1 -1
- package/es/utils/components.mjs +30 -9
- package/es/varlet.esm.js +14219 -13843
- package/highlight/web-types.en-US.json +268 -30
- package/highlight/web-types.zh-CN.json +270 -32
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +15305 -14844
- package/package.json +9 -8
- package/types/autoComplete.d.ts +84 -0
- package/types/checkbox.d.ts +3 -3
- package/types/checkboxGroup.d.ts +1 -1
- package/types/counter.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/input.d.ts +2 -1
- package/types/radio.d.ts +1 -1
- package/types/radioGroup.d.ts +1 -1
- package/types/rate.d.ts +1 -1
- package/types/select.d.ts +1 -1
- package/types/slider.d.ts +1 -1
- package/types/styleVars.d.ts +1 -0
- package/types/switch.d.ts +1 -1
- package/types/tooltip.d.ts +1 -0
- package/types/uploader.d.ts +1 -1
- package/umd/varlet.js +8 -8
package/es/index.mjs
CHANGED
|
@@ -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'
|
|
@@ -176,11 +178,12 @@ export * from './tooltip/index.mjs'
|
|
|
176
178
|
export * from './uploader/index.mjs'
|
|
177
179
|
export * from './watermark/index.mjs'
|
|
178
180
|
|
|
179
|
-
const version = '3.
|
|
181
|
+
const version = '3.5.0-alpha.1726249557629'
|
|
180
182
|
|
|
181
183
|
function install(app) {
|
|
182
184
|
ActionSheet.install && app.use(ActionSheet)
|
|
183
185
|
AppBar.install && app.use(AppBar)
|
|
186
|
+
AutoComplete.install && app.use(AutoComplete)
|
|
184
187
|
Avatar.install && app.use(Avatar)
|
|
185
188
|
AvatarGroup.install && app.use(AvatarGroup)
|
|
186
189
|
BackTop.install && app.use(BackTop)
|
|
@@ -274,6 +277,7 @@ export {
|
|
|
274
277
|
install,
|
|
275
278
|
ActionSheet,
|
|
276
279
|
AppBar,
|
|
280
|
+
AutoComplete,
|
|
277
281
|
Avatar,
|
|
278
282
|
AvatarGroup,
|
|
279
283
|
BackTop,
|
|
@@ -367,6 +371,7 @@ export default {
|
|
|
367
371
|
install,
|
|
368
372
|
ActionSheet,
|
|
369
373
|
AppBar,
|
|
374
|
+
AutoComplete,
|
|
370
375
|
Avatar,
|
|
371
376
|
AvatarGroup,
|
|
372
377
|
BackTop,
|
package/es/input/Input.mjs
CHANGED
|
@@ -7,11 +7,11 @@ import { useValidation, createNamespace } from "../utils/components.mjs";
|
|
|
7
7
|
import { useForm } from "../form/provide.mjs";
|
|
8
8
|
import { onSmartMounted, useClientId } from "@varlet/use";
|
|
9
9
|
const { name, n, classes } = createNamespace("input");
|
|
10
|
-
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, createSlots as _createSlots, createVNode as _createVNode,
|
|
10
|
+
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, createSlots as _createSlots, createVNode as _createVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
11
11
|
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
12
12
|
const _hoisted_1 = ["placeholder", "enterkeyhint"];
|
|
13
|
-
const _hoisted_2 = ["id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "rows", "enterkeyhint", "inputmode"];
|
|
14
|
-
const _hoisted_3 = ["id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "enterkeyhint", "inputmode"];
|
|
13
|
+
const _hoisted_2 = ["autocomplete", "id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "rows", "enterkeyhint", "inputmode"];
|
|
14
|
+
const _hoisted_3 = ["autocomplete", "id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "enterkeyhint", "inputmode"];
|
|
15
15
|
function __render__(_ctx, _cache) {
|
|
16
16
|
const _component_var_field_decorator = _resolveComponent("var-field-decorator");
|
|
17
17
|
const _component_var_form_details = _resolveComponent("var-form-details");
|
|
@@ -19,7 +19,7 @@ function __render__(_ctx, _cache) {
|
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
21
|
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
|
|
22
|
-
onMousedown: _cache[
|
|
22
|
+
onMousedown: _cache[12] || (_cache[12] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args))
|
|
23
23
|
},
|
|
24
24
|
[
|
|
25
25
|
_createVNode(
|
|
@@ -35,8 +35,8 @@ function __render__(_ctx, _cache) {
|
|
|
35
35
|
textColor: _ctx.textColor,
|
|
36
36
|
focusColor: _ctx.focusColor,
|
|
37
37
|
blurColor: _ctx.blurColor,
|
|
38
|
-
isFocusing: _ctx.isFocusing,
|
|
39
|
-
|
|
38
|
+
isFocusing: _ctx.isForceFocusingEffect != null ? _ctx.isForceFocusingEffect : _ctx.isFocusing,
|
|
39
|
+
isError: _ctx.isForceErrorEffect != null ? _ctx.isForceErrorEffect : !!_ctx.errorMessage,
|
|
40
40
|
formDisabled: _ctx.formDisabled,
|
|
41
41
|
disabled: _ctx.disabled,
|
|
42
42
|
clearable: _ctx.clearable,
|
|
@@ -76,7 +76,7 @@ function __render__(_ctx, _cache) {
|
|
|
76
76
|
)
|
|
77
77
|
),
|
|
78
78
|
ref: "el",
|
|
79
|
-
autocomplete: "new-password",
|
|
79
|
+
autocomplete: _ctx.autocomplete ? _ctx.autocomplete : "new-password",
|
|
80
80
|
id: _ctx.id,
|
|
81
81
|
disabled: _ctx.formDisabled || _ctx.disabled,
|
|
82
82
|
readonly: _ctx.formReadonly || _ctx.readonly,
|
|
@@ -110,7 +110,7 @@ function __render__(_ctx, _cache) {
|
|
|
110
110
|
)
|
|
111
111
|
),
|
|
112
112
|
ref: "el",
|
|
113
|
-
autocomplete: "new-password",
|
|
113
|
+
autocomplete: _ctx.autocomplete ? _ctx.autocomplete : "new-password",
|
|
114
114
|
id: _ctx.id,
|
|
115
115
|
disabled: _ctx.formDisabled || _ctx.disabled,
|
|
116
116
|
readonly: _ctx.formReadonly || _ctx.readonly,
|
|
@@ -147,11 +147,10 @@ function __render__(_ctx, _cache) {
|
|
|
147
147
|
1040
|
|
148
148
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
149
149
|
),
|
|
150
|
-
|
|
150
|
+
_ctx.isShowFormDetails ? (_openBlock(), _createBlock(_component_var_form_details, {
|
|
151
|
+
key: 0,
|
|
151
152
|
"error-message": _ctx.errorMessage,
|
|
152
|
-
"extra-message": _ctx.maxlengthText
|
|
153
|
-
onMousedown: _cache[12] || (_cache[12] = _withModifiers(() => {
|
|
154
|
-
}, ["stop"]))
|
|
153
|
+
"extra-message": _ctx.maxlengthText
|
|
155
154
|
}, _createSlots({
|
|
156
155
|
_: 2
|
|
157
156
|
/* DYNAMIC */
|
|
@@ -163,7 +162,7 @@ function __render__(_ctx, _cache) {
|
|
|
163
162
|
]),
|
|
164
163
|
key: "0"
|
|
165
164
|
} : void 0
|
|
166
|
-
]), 1032, ["error-message", "extra-message"])
|
|
165
|
+
]), 1032, ["error-message", "extra-message"])) : _createCommentVNode("v-if", true)
|
|
167
166
|
],
|
|
168
167
|
34
|
|
169
168
|
/* CLASS, NEED_HYDRATION */
|
package/es/input/props.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,9 +16,10 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
import { defineListenerProp, pickProps } from "../utils/components.mjs";
|
|
18
21
|
import { fieldDecoratorProps } from "../field-decorator/index.mjs";
|
|
19
|
-
const props = __spreadValues({
|
|
22
|
+
const props = __spreadProps(__spreadValues({
|
|
20
23
|
modelValue: String,
|
|
21
24
|
modelModifiers: {
|
|
22
25
|
type: Object,
|
|
@@ -39,7 +42,7 @@ const props = __spreadValues({
|
|
|
39
42
|
type: Array,
|
|
40
43
|
default: () => ["onInput", "onClear"]
|
|
41
44
|
},
|
|
42
|
-
rules: Array,
|
|
45
|
+
rules: [Array, Function, Object],
|
|
43
46
|
enterkeyhint: String,
|
|
44
47
|
onFocus: defineListenerProp(),
|
|
45
48
|
onBlur: defineListenerProp(),
|
|
@@ -59,7 +62,23 @@ const props = __spreadValues({
|
|
|
59
62
|
"disabled",
|
|
60
63
|
"clearable",
|
|
61
64
|
"onClick"
|
|
62
|
-
]))
|
|
65
|
+
])), {
|
|
66
|
+
// internal start
|
|
67
|
+
autocomplete: String,
|
|
68
|
+
isForceFocusingEffect: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: void 0
|
|
71
|
+
},
|
|
72
|
+
isForceErrorEffect: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: void 0
|
|
75
|
+
},
|
|
76
|
+
isShowFormDetails: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: true
|
|
79
|
+
}
|
|
80
|
+
// internal end
|
|
81
|
+
});
|
|
63
82
|
export {
|
|
64
83
|
props
|
|
65
84
|
};
|
|
@@ -51,10 +51,13 @@ function __render__(_ctx, _cache) {
|
|
|
51
51
|
_createElementVNode(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
class: _normalizeClass(_ctx.classes(_ctx.n("text")
|
|
54
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("text")))
|
|
55
55
|
},
|
|
56
56
|
[
|
|
57
|
-
_createVNode(_component_maybe_v_node, {
|
|
57
|
+
_createVNode(_component_maybe_v_node, {
|
|
58
|
+
class: _normalizeClass(_ctx.n("$--ellipsis")),
|
|
59
|
+
is: _ctx.labelVNode
|
|
60
|
+
}, null, 8, ["class", "is"])
|
|
58
61
|
],
|
|
59
62
|
2
|
|
60
63
|
/* CLASS */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --menu-option-normal-height: 38px; --menu-option-small-height: 30px; --menu-option-mini-height: 24px; --menu-option-large-height: 46px; --menu-option-padding: 0 12px; --menu-option-normal-font-size: var(--font-size-md); --menu-option-small-font-size: var(--font-size-sm); --menu-option-mini-font-size: var(--font-size-xs); --menu-option-large-font-size: var(--font-size-lg); --menu-option-selected-background: var(--color-primary); --menu-option-text-color: #555; --menu-option-disabled-color: var(--color-text-disabled);}.var-menu-option { position: relative; display: flex; align-items: center; padding: var(--menu-option-padding); cursor: pointer; -webkit-tap-highlight-color: transparent; color: var(--menu-option-text-color); outline: none;}.var-menu-option__cover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.2; background: transparent;}.var-menu-option__text { display: flex; align-items: center;}.var-menu-option--normal { height: var(--menu-option-normal-height); font-size: var(--menu-option-normal-font-size);}.var-menu-option--large { height: var(--menu-option-large-height); font-size: var(--menu-option-large-font-size);}.var-menu-option--small { height: var(--menu-option-small-height); font-size: var(--menu-option-small-font-size);}.var-menu-option--mini { height: var(--menu-option-mini-height); font-size: var(--menu-option-mini-font-size);}.var-menu-option--selected-background { background: var(--menu-option-selected-background);}.var-menu-option--selected-color { color: var(--menu-option-selected-background);}.var-menu-option--disabled { color: var(--menu-option-disabled-color); cursor: not-allowed;}
|
|
1
|
+
:root { --menu-option-normal-height: 38px; --menu-option-small-height: 30px; --menu-option-mini-height: 24px; --menu-option-large-height: 46px; --menu-option-padding: 0 12px; --menu-option-normal-font-size: var(--font-size-md); --menu-option-small-font-size: var(--font-size-sm); --menu-option-mini-font-size: var(--font-size-xs); --menu-option-large-font-size: var(--font-size-lg); --menu-option-selected-background: var(--color-primary); --menu-option-text-color: #555; --menu-option-disabled-color: var(--color-text-disabled);}.var-menu-option { position: relative; display: flex; align-items: center; padding: var(--menu-option-padding); cursor: pointer; -webkit-tap-highlight-color: transparent; color: var(--menu-option-text-color); outline: none;}.var-menu-option__cover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.2; background: transparent;}.var-menu-option__text { display: flex; align-items: center; overflow-x: hidden;}.var-menu-option--normal { height: var(--menu-option-normal-height); font-size: var(--menu-option-normal-font-size);}.var-menu-option--large { height: var(--menu-option-large-height); font-size: var(--menu-option-large-font-size);}.var-menu-option--small { height: var(--menu-option-small-height); font-size: var(--menu-option-small-font-size);}.var-menu-option--mini { height: var(--menu-option-mini-height); font-size: var(--menu-option-mini-font-size);}.var-menu-option--selected-background { background: var(--menu-option-selected-background);}.var-menu-option--selected-color { color: var(--menu-option-selected-background);}.var-menu-option--disabled { color: var(--menu-option-disabled-color); cursor: not-allowed;}
|
|
@@ -5,7 +5,7 @@ import { props } from "./props.mjs";
|
|
|
5
5
|
import { createNamespace, formatElevation } from "../utils/components.mjs";
|
|
6
6
|
import { useMenuOptions } from "./provide.mjs";
|
|
7
7
|
import { useSelectController } from "../select/useSelectController.mjs";
|
|
8
|
-
import { call,
|
|
8
|
+
import { call, preventDefault } from "@varlet/shared";
|
|
9
9
|
import { useEventListener, useVModel } from "@varlet/use";
|
|
10
10
|
import { focusChildElementByKey } from "../utils/elements.mjs";
|
|
11
11
|
const { name, n, classes } = createNamespace("menu-select");
|
|
@@ -47,10 +47,10 @@ function __render__(_ctx, _cache) {
|
|
|
47
47
|
class: _normalizeClass(_ctx.classes(_ctx.n("menu"), _ctx.formatElevation(_ctx.elevation, 3), [_ctx.scrollable, _ctx.n("--scrollable")]))
|
|
48
48
|
},
|
|
49
49
|
[
|
|
50
|
-
_ctx.
|
|
50
|
+
_ctx.options.length ? (_openBlock(true), _createElementBlock(
|
|
51
51
|
_Fragment,
|
|
52
52
|
{ key: 0 },
|
|
53
|
-
_renderList(_ctx.
|
|
53
|
+
_renderList(_ctx.options, (option) => {
|
|
54
54
|
return _openBlock(), _createBlock(_component_var_menu_option, {
|
|
55
55
|
key: option[_ctx.valueKey],
|
|
56
56
|
label: option[_ctx.labelKey],
|
|
@@ -84,7 +84,6 @@ const __sfc__ = defineComponent({
|
|
|
84
84
|
const menu = ref(null);
|
|
85
85
|
const menuOptionsRef = ref(null);
|
|
86
86
|
const show = useVModel(props2, "show");
|
|
87
|
-
const menuSelectOptions = computed(() => isArray(props2.options) ? props2.options : []);
|
|
88
87
|
const { menuOptions, length, bindMenuOptions } = useMenuOptions();
|
|
89
88
|
const { computeLabel, getSelectedValue } = useSelectController({
|
|
90
89
|
modelValue: () => props2.modelValue,
|
|
@@ -119,6 +118,7 @@ const __sfc__ = defineComponent({
|
|
|
119
118
|
if (key === "Escape") {
|
|
120
119
|
menu.value.$el.focus();
|
|
121
120
|
close();
|
|
121
|
+
call(props2.onKeyEscape);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
@@ -141,7 +141,6 @@ const __sfc__ = defineComponent({
|
|
|
141
141
|
show,
|
|
142
142
|
menu,
|
|
143
143
|
menuOptionsRef,
|
|
144
|
-
menuSelectOptions,
|
|
145
144
|
n,
|
|
146
145
|
classes,
|
|
147
146
|
formatElevation,
|
package/es/menu-select/props.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,14 +16,18 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
import { menuProps } from "../menu/index.mjs";
|
|
18
21
|
import { defineListenerProp, pickProps } from "../utils/components.mjs";
|
|
19
|
-
const props = __spreadValues({
|
|
22
|
+
const props = __spreadProps(__spreadValues({
|
|
20
23
|
modelValue: {
|
|
21
24
|
type: [String, Number, Boolean, Array],
|
|
22
25
|
default: void 0
|
|
23
26
|
},
|
|
24
|
-
options:
|
|
27
|
+
options: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
25
31
|
labelKey: {
|
|
26
32
|
type: String,
|
|
27
33
|
default: "label"
|
|
@@ -61,7 +67,11 @@ const props = __spreadValues({
|
|
|
61
67
|
"onClosed",
|
|
62
68
|
"onClickOutside",
|
|
63
69
|
"onUpdate:show"
|
|
64
|
-
]))
|
|
70
|
+
])), {
|
|
71
|
+
// internal start
|
|
72
|
+
onKeyEscape: defineListenerProp()
|
|
73
|
+
// internal end
|
|
74
|
+
});
|
|
65
75
|
export {
|
|
66
76
|
props
|
|
67
77
|
};
|
package/es/radio/props.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { props } from "./props.mjs";
|
|
|
5
5
|
import { useValidation, createNamespace, MaybeVNode } from "../utils/components.mjs";
|
|
6
6
|
import { useRadios } from "./provide.mjs";
|
|
7
7
|
import { useForm } from "../form/provide.mjs";
|
|
8
|
-
import { call, preventDefault,
|
|
8
|
+
import { call, preventDefault, isFunction } from "@varlet/shared";
|
|
9
9
|
import { useEventListener } from "@varlet/use";
|
|
10
10
|
const { name, n, classes } = createNamespace("radio-group");
|
|
11
11
|
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";
|
|
@@ -25,10 +25,10 @@ function __render__(_ctx, _cache) {
|
|
|
25
25
|
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n(`--${_ctx.direction}`)))
|
|
26
26
|
},
|
|
27
27
|
[
|
|
28
|
-
_ctx.
|
|
28
|
+
_ctx.options.length ? (_openBlock(true), _createElementBlock(
|
|
29
29
|
_Fragment,
|
|
30
30
|
{ key: 0 },
|
|
31
|
-
_renderList(_ctx.
|
|
31
|
+
_renderList(_ctx.options, (option) => {
|
|
32
32
|
return _openBlock(), _createBlock(_component_var_radio, {
|
|
33
33
|
key: option[_ctx.valueKey],
|
|
34
34
|
"checked-value": option[_ctx.valueKey],
|
|
@@ -71,7 +71,6 @@ const __sfc__ = defineComponent({
|
|
|
71
71
|
// expose
|
|
72
72
|
resetValidation
|
|
73
73
|
} = useValidation();
|
|
74
|
-
const radioGroupOptions = computed(() => isArray(props2.options) ? props2.options : []);
|
|
75
74
|
const radioGroupErrorMessage = computed(() => errorMessage.value);
|
|
76
75
|
const radioGroupProvider = {
|
|
77
76
|
onToggle,
|
|
@@ -153,8 +152,7 @@ const __sfc__ = defineComponent({
|
|
|
153
152
|
reset,
|
|
154
153
|
validate,
|
|
155
154
|
resetValidation,
|
|
156
|
-
isFunction
|
|
157
|
-
radioGroupOptions
|
|
155
|
+
isFunction
|
|
158
156
|
};
|
|
159
157
|
}
|
|
160
158
|
});
|
package/es/radio-group/props.mjs
CHANGED
|
@@ -8,7 +8,10 @@ const props = {
|
|
|
8
8
|
type: String,
|
|
9
9
|
default: "horizontal"
|
|
10
10
|
},
|
|
11
|
-
options:
|
|
11
|
+
options: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => []
|
|
14
|
+
},
|
|
12
15
|
labelKey: {
|
|
13
16
|
type: String,
|
|
14
17
|
default: "label"
|
|
@@ -21,7 +24,7 @@ const props = {
|
|
|
21
24
|
type: Array,
|
|
22
25
|
default: () => ["onChange"]
|
|
23
26
|
},
|
|
24
|
-
rules: Array,
|
|
27
|
+
rules: [Array, Function, Object],
|
|
25
28
|
onChange: defineListenerProp(),
|
|
26
29
|
"onUpdate:modelValue": defineListenerProp()
|
|
27
30
|
};
|
package/es/select/Select.mjs
CHANGED
|
@@ -56,10 +56,10 @@ function __render__(_ctx, _cache) {
|
|
|
56
56
|
class: _normalizeClass(_ctx.classes(_ctx.n("scroller"), _ctx.n("$-elevation--3")))
|
|
57
57
|
},
|
|
58
58
|
[
|
|
59
|
-
_ctx.
|
|
59
|
+
_ctx.options.length ? (_openBlock(true), _createElementBlock(
|
|
60
60
|
_Fragment,
|
|
61
61
|
{ key: 0 },
|
|
62
|
-
_renderList(_ctx.
|
|
62
|
+
_renderList(_ctx.options, (option) => {
|
|
63
63
|
return _openBlock(), _createBlock(_component_var_option, {
|
|
64
64
|
key: option[_ctx.valueKey],
|
|
65
65
|
label: option[_ctx.labelKey],
|
|
@@ -91,7 +91,7 @@ function __render__(_ctx, _cache) {
|
|
|
91
91
|
focusColor: _ctx.focusColor,
|
|
92
92
|
blurColor: _ctx.blurColor,
|
|
93
93
|
isFocusing: _ctx.isFocusing,
|
|
94
|
-
|
|
94
|
+
isError: !!_ctx.errorMessage,
|
|
95
95
|
formDisabled: _ctx.formDisabled,
|
|
96
96
|
disabled: _ctx.disabled,
|
|
97
97
|
clearable: _ctx.clearable,
|
|
@@ -282,7 +282,6 @@ const __sfc__ = defineComponent({
|
|
|
282
282
|
const focusColor = computed(() => props2.focusColor);
|
|
283
283
|
const isEmptyModelValue = computed(() => isEmpty(props2.modelValue));
|
|
284
284
|
const cursor = computed(() => props2.disabled || props2.readonly ? "" : "pointer");
|
|
285
|
-
const selectOptions = computed(() => isArray(props2.options) ? props2.options : []);
|
|
286
285
|
const offsetY = ref(0);
|
|
287
286
|
const { bindForm, form } = useForm();
|
|
288
287
|
const { length, options, bindOptions } = useOptions();
|
|
@@ -498,7 +497,6 @@ const __sfc__ = defineComponent({
|
|
|
498
497
|
cursor,
|
|
499
498
|
placeholderColor,
|
|
500
499
|
enableCustomPlaceholder,
|
|
501
|
-
selectOptions,
|
|
502
500
|
isFunction,
|
|
503
501
|
n,
|
|
504
502
|
classes,
|
package/es/select/props.mjs
CHANGED
|
@@ -21,7 +21,10 @@ const props = __spreadValues({
|
|
|
21
21
|
type: [String, Number, Boolean, Array],
|
|
22
22
|
default: void 0
|
|
23
23
|
},
|
|
24
|
-
options:
|
|
24
|
+
options: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
25
28
|
labelKey: {
|
|
26
29
|
type: String,
|
|
27
30
|
default: "label"
|
|
@@ -49,7 +52,7 @@ const props = __spreadValues({
|
|
|
49
52
|
type: Array,
|
|
50
53
|
default: () => ["onChange", "onClear", "onClose"]
|
|
51
54
|
},
|
|
52
|
-
rules: Array,
|
|
55
|
+
rules: [Array, Function, Object],
|
|
53
56
|
onFocus: defineListenerProp(),
|
|
54
57
|
onBlur: defineListenerProp(),
|
|
55
58
|
onClose: defineListenerProp(),
|