@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/lib/varlet.cjs.js
CHANGED
|
@@ -656,6 +656,23 @@ function withInstall(component, target) {
|
|
|
656
656
|
};
|
|
657
657
|
return componentWithInstall;
|
|
658
658
|
}
|
|
659
|
+
function withPropsDefaultsSetter(target, props2) {
|
|
660
|
+
target.setPropsDefaults = function(defaults) {
|
|
661
|
+
Object.entries(defaults).forEach(([key, value]) => {
|
|
662
|
+
const prop = props2[key];
|
|
663
|
+
if (prop == null) {
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
if (isPlainObject(prop)) {
|
|
667
|
+
prop.default = value;
|
|
668
|
+
}
|
|
669
|
+
props2[key] = {
|
|
670
|
+
type: prop,
|
|
671
|
+
default: value
|
|
672
|
+
};
|
|
673
|
+
});
|
|
674
|
+
};
|
|
675
|
+
}
|
|
659
676
|
function mount$1(component) {
|
|
660
677
|
const app = vue.createApp(component);
|
|
661
678
|
const host = document.createElement("div");
|
|
@@ -3209,6 +3226,7 @@ const __sfc__$1f = vue.defineComponent({
|
|
|
3209
3226
|
__sfc__$1f.render = __render__$1e;
|
|
3210
3227
|
var stdin_default$37 = __sfc__$1f;
|
|
3211
3228
|
withInstall(stdin_default$37);
|
|
3229
|
+
withPropsDefaultsSetter(stdin_default$37, props$17);
|
|
3212
3230
|
const _ButtonComponent = stdin_default$37;
|
|
3213
3231
|
var stdin_default$36 = stdin_default$37;
|
|
3214
3232
|
const props$16 = {
|
|
@@ -25002,7 +25020,7 @@ const uploader = "";
|
|
|
25002
25020
|
const UploaderSfc = "";
|
|
25003
25021
|
const watermark = "";
|
|
25004
25022
|
const WatermarkSfc = "";
|
|
25005
|
-
const version = "2.
|
|
25023
|
+
const version = "2.19.0-alpha.1699555048814";
|
|
25006
25024
|
function install(app) {
|
|
25007
25025
|
stdin_default$3k.install && app.use(stdin_default$3k);
|
|
25008
25026
|
stdin_default$3i.install && app.use(stdin_default$3i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0-alpha.1699555048814",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/icons": "2.
|
|
52
|
-
"@varlet/shared": "2.
|
|
53
|
-
"@varlet/use": "2.
|
|
51
|
+
"@varlet/icons": "2.19.0-alpha.1699555048814",
|
|
52
|
+
"@varlet/shared": "2.19.0-alpha.1699555048814",
|
|
53
|
+
"@varlet/use": "2.19.0-alpha.1699555048814"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vue/runtime-core": "3.3.4",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"typescript": "^5.1.5",
|
|
67
67
|
"vue": "3.3.4",
|
|
68
68
|
"vue-router": "4.2.0",
|
|
69
|
-
"@varlet/cli": "2.
|
|
70
|
-
"@varlet/ui": "2.
|
|
71
|
-
"@varlet/touch-emulator": "2.
|
|
69
|
+
"@varlet/cli": "2.19.0-alpha.1699555048814",
|
|
70
|
+
"@varlet/ui": "2.19.0-alpha.1699555048814",
|
|
71
|
+
"@varlet/touch-emulator": "2.19.0-alpha.1699555048814"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"dev": "varlet-cli dev",
|
package/types/button.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
VarComponent,
|
|
3
|
+
SetPropsDefaults,
|
|
4
|
+
BasicAttributes,
|
|
5
|
+
Type as ButtonType,
|
|
6
|
+
Size as ButtonSize,
|
|
7
|
+
ListenerProp,
|
|
8
|
+
} from './varComponent'
|
|
2
9
|
import { LoadingType, LoadingSize } from './loading'
|
|
3
10
|
import { ButtonHTMLAttributes, VNode } from 'vue'
|
|
4
11
|
|
|
5
12
|
export { ButtonType, ButtonSize }
|
|
6
13
|
|
|
7
|
-
export declare const buttonProps: Record<
|
|
14
|
+
export declare const buttonProps: Record<keyof ButtonProps, any>
|
|
8
15
|
|
|
9
16
|
export interface ButtonProps extends BasicAttributes {
|
|
10
17
|
type?: ButtonType
|
|
@@ -30,6 +37,8 @@ export interface ButtonProps extends BasicAttributes {
|
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
export class Button extends VarComponent {
|
|
40
|
+
static setPropsDefaults: SetPropsDefaults<ButtonProps>
|
|
41
|
+
|
|
33
42
|
$props: ButtonProps
|
|
34
43
|
|
|
35
44
|
$slots: {
|
package/types/varComponent.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export class VarComponent {
|
|
|
6
6
|
static install(app: App): void
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export type SetPropsDefaults<P> = (defaults: Record<keyof P, any>) => void
|
|
10
|
+
|
|
9
11
|
export type Type = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
12
|
|
|
11
13
|
export type Size = 'normal' | 'mini' | 'small' | 'large'
|