@varlet/ui 2.18.3 → 2.19.0-alpha.1699555048814
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/button/index.mjs +4 -3
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/utils/components.mjs +20 -2
- package/es/varlet.esm.js +2240 -2228
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +19 -1
- package/package.json +7 -7
- package/types/button.d.ts +11 -2
- package/types/varComponent.d.ts +2 -0
- package/umd/varlet.js +5 -5
package/es/button/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import Button from "./Button.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { props as buttonProps } from "./props.mjs";
|
|
3
|
+
import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
|
|
3
4
|
withInstall(Button);
|
|
4
|
-
|
|
5
|
+
withPropsDefaultsSetter(Button, buttonProps);
|
|
5
6
|
const _ButtonComponent = Button;
|
|
6
7
|
var stdin_default = Button;
|
|
7
8
|
export {
|
|
8
9
|
_ButtonComponent,
|
|
9
|
-
|
|
10
|
+
buttonProps,
|
|
10
11
|
stdin_default as default
|
|
11
12
|
};
|
package/es/index.bundle.mjs
CHANGED
|
@@ -259,7 +259,7 @@ import './tooltip/style/index.mjs'
|
|
|
259
259
|
import './uploader/style/index.mjs'
|
|
260
260
|
import './watermark/style/index.mjs'
|
|
261
261
|
|
|
262
|
-
const version = '2.
|
|
262
|
+
const version = '2.19.0-alpha.1699555048814'
|
|
263
263
|
|
|
264
264
|
function install(app) {
|
|
265
265
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -172,7 +172,7 @@ export * from './tooltip/index.mjs'
|
|
|
172
172
|
export * from './uploader/index.mjs'
|
|
173
173
|
export * from './watermark/index.mjs'
|
|
174
174
|
|
|
175
|
-
const version = '2.
|
|
175
|
+
const version = '2.19.0-alpha.1699555048814'
|
|
176
176
|
|
|
177
177
|
function install(app) {
|
|
178
178
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/utils/components.mjs
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
Comment,
|
|
45
45
|
Fragment
|
|
46
46
|
} from "vue";
|
|
47
|
-
import { createNamespaceFn, isArray } from "@varlet/shared";
|
|
47
|
+
import { createNamespaceFn, isArray, isPlainObject } from "@varlet/shared";
|
|
48
48
|
function pickProps(props, propsKey) {
|
|
49
49
|
return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
|
|
50
50
|
pickedProps[key] = props[key];
|
|
@@ -61,6 +61,23 @@ function withInstall(component, target) {
|
|
|
61
61
|
};
|
|
62
62
|
return componentWithInstall;
|
|
63
63
|
}
|
|
64
|
+
function withPropsDefaultsSetter(target, props) {
|
|
65
|
+
target.setPropsDefaults = function(defaults) {
|
|
66
|
+
Object.entries(defaults).forEach(([key, value]) => {
|
|
67
|
+
const prop = props[key];
|
|
68
|
+
if (prop == null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (isPlainObject(prop)) {
|
|
72
|
+
prop.default = value;
|
|
73
|
+
}
|
|
74
|
+
props[key] = {
|
|
75
|
+
type: prop,
|
|
76
|
+
default: value
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
64
81
|
function mount(component) {
|
|
65
82
|
const app = createApp(component);
|
|
66
83
|
const host = document.createElement("div");
|
|
@@ -172,5 +189,6 @@ export {
|
|
|
172
189
|
useRouteListener,
|
|
173
190
|
useTeleport,
|
|
174
191
|
useValidation,
|
|
175
|
-
withInstall
|
|
192
|
+
withInstall,
|
|
193
|
+
withPropsDefaultsSetter
|
|
176
194
|
};
|