@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/themes/dark/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import collapse from './collapse.mjs';
|
|
|
11
11
|
import datePicker from './datePicker.mjs';
|
|
12
12
|
import dialog from './dialog.mjs';
|
|
13
13
|
import divider from './divider.mjs';
|
|
14
|
-
import
|
|
14
|
+
import fieldDecorator from './fieldDecorator.mjs';
|
|
15
15
|
import pagination from './pagination.mjs';
|
|
16
16
|
import picker from './picker.mjs';
|
|
17
17
|
import popup from './popup.mjs';
|
|
@@ -45,4 +45,4 @@ export default _extends({
|
|
|
45
45
|
'--color-danger': '#ef5350',
|
|
46
46
|
'--color-disabled': '#404040',
|
|
47
47
|
'--color-text-disabled': '#757575'
|
|
48
|
-
}, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table,
|
|
48
|
+
}, button, cell, card, timePicker, datePicker, skeleton, tabs, tab, popup, dialog, actionSheet, chip, badge, uploader, collapse, pullRefresh, switchThemes, steps, pagination, table, fieldDecorator, select, radio, checkbox, divider, picker, appBar, bottomNavigation, bottomNavigationItem, menu, result, breadcrumb, paper, avatar);
|
package/es/utils/components.mjs
CHANGED
|
@@ -5,7 +5,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
5
5
|
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); }
|
|
6
6
|
|
|
7
7
|
import { useEventListener } from '@varlet/use';
|
|
8
|
-
import { createApp, h, getCurrentInstance, isVNode, ref, onActivated, onDeactivated, Comment, Fragment } from 'vue';
|
|
8
|
+
import { createApp, h, getCurrentInstance, isVNode, ref, onActivated, onDeactivated, Comment, Fragment, computed, watch } from 'vue';
|
|
9
9
|
import { inBrowser, isArray } from '@varlet/shared';
|
|
10
10
|
export function pickProps(props, propsKey) {
|
|
11
11
|
return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
@@ -232,4 +232,41 @@ export function formatElevation(elevation, defaultLevel) {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
return "var-elevation--" + elevation;
|
|
235
|
+
}
|
|
236
|
+
export function useVModel(props, key, options) {
|
|
237
|
+
if (options === void 0) {
|
|
238
|
+
options = {};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var {
|
|
242
|
+
passive = true,
|
|
243
|
+
eventName,
|
|
244
|
+
defaultValue,
|
|
245
|
+
emit
|
|
246
|
+
} = options;
|
|
247
|
+
var event = eventName != null ? eventName : "onUpdate:" + key.toString();
|
|
248
|
+
|
|
249
|
+
var getValue = () => props[key] != null ? props[key] : defaultValue;
|
|
250
|
+
|
|
251
|
+
if (!passive) {
|
|
252
|
+
return computed({
|
|
253
|
+
get() {
|
|
254
|
+
return getValue();
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
set(value) {
|
|
258
|
+
emit ? emit(event, value) : call(props[event], value);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
var proxy = ref(getValue());
|
|
265
|
+
watch(() => props[key], () => {
|
|
266
|
+
proxy.value = getValue();
|
|
267
|
+
});
|
|
268
|
+
watch(() => proxy.value, newValue => {
|
|
269
|
+
emit ? emit(event, newValue) : call(props[event], newValue);
|
|
270
|
+
});
|
|
271
|
+
return proxy;
|
|
235
272
|
}
|