@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.
- 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/icon/icon.css +1 -1
- 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/Snackbar.mjs +1 -0
- package/es/snackbar/core.mjs +4 -0
- package/es/snackbar/index.mjs +18 -3
- package/es/snackbar/props.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/sticky/Sticky.mjs +2 -2
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +1 -1
- package/es/tabs/Tabs.mjs +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 +42 -9
- package/es/varlet.esm.js +6876 -6683
- package/highlight/web-types.en-US.json +23 -1
- package/highlight/web-types.zh-CN.json +41 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +1200 -979
- package/package.json +6 -6
- package/types/input.d.ts +5 -1
- package/types/select.d.ts +5 -1
- package/types/snackbar.d.ts +6 -1
- package/types/varComponent.d.ts +2 -0
- package/umd/varlet.js +5 -5
- package/es/themes/dark/input.mjs +0 -4
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -412,7 +412,7 @@ var __sfc__ = defineComponent({
|
|
|
412
412
|
onActivated(resize);
|
|
413
413
|
onDeactivated(stopAutoplay);
|
|
414
414
|
onUnmounted(stopAutoplay);
|
|
415
|
-
useEventListener(window, 'resize', resize);
|
|
415
|
+
useEventListener(() => window, 'resize', resize);
|
|
416
416
|
return {
|
|
417
417
|
n,
|
|
418
418
|
classes,
|
package/es/tabs/Tabs.mjs
CHANGED
|
@@ -226,8 +226,8 @@ var __sfc__ = defineComponent({
|
|
|
226
226
|
}));
|
|
227
227
|
watch(() => props.active, resize);
|
|
228
228
|
watch(() => props.scrollable, resize);
|
|
229
|
-
useEventListener(window, 'resize', resize);
|
|
230
229
|
onActivated(resize);
|
|
230
|
+
useEventListener(() => window, 'resize', resize);
|
|
231
231
|
return {
|
|
232
232
|
stickyComponent,
|
|
233
233
|
indicatorWidth,
|
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,8 +5,8 @@ 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';
|
|
9
|
-
import {
|
|
8
|
+
import { createApp, h, getCurrentInstance, isVNode, ref, onActivated, onDeactivated, Comment, Fragment, computed, watch } from 'vue';
|
|
9
|
+
import { isArray } from '@varlet/shared';
|
|
10
10
|
export function pickProps(props, propsKey) {
|
|
11
11
|
return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
12
12
|
pickedProps[key] = props[key];
|
|
@@ -142,13 +142,9 @@ export function useValidation() {
|
|
|
142
142
|
validateWithTrigger
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
export function useRouteListener(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
useEventListener(window, 'hashchange', cb);
|
|
151
|
-
useEventListener(window, 'popstate', cb);
|
|
145
|
+
export function useRouteListener(listener) {
|
|
146
|
+
useEventListener(() => window, 'hashchange', listener);
|
|
147
|
+
useEventListener(() => window, 'popstate', listener);
|
|
152
148
|
}
|
|
153
149
|
export function useTeleport() {
|
|
154
150
|
var disabled = ref(false);
|
|
@@ -232,4 +228,41 @@ export function formatElevation(elevation, defaultLevel) {
|
|
|
232
228
|
}
|
|
233
229
|
|
|
234
230
|
return "var-elevation--" + elevation;
|
|
231
|
+
}
|
|
232
|
+
export function useVModel(props, key, options) {
|
|
233
|
+
if (options === void 0) {
|
|
234
|
+
options = {};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
var {
|
|
238
|
+
passive = true,
|
|
239
|
+
eventName,
|
|
240
|
+
defaultValue,
|
|
241
|
+
emit
|
|
242
|
+
} = options;
|
|
243
|
+
var event = eventName != null ? eventName : "onUpdate:" + key.toString();
|
|
244
|
+
|
|
245
|
+
var getValue = () => props[key] != null ? props[key] : defaultValue;
|
|
246
|
+
|
|
247
|
+
if (!passive) {
|
|
248
|
+
return computed({
|
|
249
|
+
get() {
|
|
250
|
+
return getValue();
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
set(value) {
|
|
254
|
+
emit ? emit(event, value) : call(props[event], value);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
var proxy = ref(getValue());
|
|
261
|
+
watch(() => props[key], () => {
|
|
262
|
+
proxy.value = getValue();
|
|
263
|
+
});
|
|
264
|
+
watch(() => proxy.value, newValue => {
|
|
265
|
+
emit ? emit(event, newValue) : call(props[event], newValue);
|
|
266
|
+
});
|
|
267
|
+
return proxy;
|
|
235
268
|
}
|