@varlet/ui 2.18.3 → 2.19.0-alpha.1699554867300

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.18.3",
4
+ "version": "2.19.0-alpha.1699554867300",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.18.3",
4
+ "version": "2.19.0-alpha.1699554867300",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
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 = {
@@ -24973,9 +24991,9 @@ const skeleton = "";
24973
24991
  const SkeletonSfc = "";
24974
24992
  const slider = "";
24975
24993
  const SliderSfc = "";
24976
- const SnackbarSfc = "";
24977
24994
  const snackbar = "";
24978
24995
  const coreSfc = "";
24996
+ const SnackbarSfc = "";
24979
24997
  const space = "";
24980
24998
  const step = "";
24981
24999
  const StepSfc = "";
@@ -25002,7 +25020,7 @@ const uploader = "";
25002
25020
  const UploaderSfc = "";
25003
25021
  const watermark = "";
25004
25022
  const WatermarkSfc = "";
25005
- const version = "2.18.3";
25023
+ const version = "2.19.0-alpha.1699554867300";
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.18.3",
3
+ "version": "2.19.0-alpha.1699554867300",
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.18.3",
52
- "@varlet/shared": "2.18.3",
53
- "@varlet/use": "2.18.3"
51
+ "@varlet/icons": "2.19.0-alpha.1699554867300",
52
+ "@varlet/shared": "2.19.0-alpha.1699554867300",
53
+ "@varlet/use": "2.19.0-alpha.1699554867300"
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.18.3",
70
- "@varlet/ui": "2.18.3",
71
- "@varlet/touch-emulator": "2.18.3"
69
+ "@varlet/ui": "2.19.0-alpha.1699554867300",
70
+ "@varlet/cli": "2.19.0-alpha.1699554867300",
71
+ "@varlet/touch-emulator": "2.19.0-alpha.1699554867300"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
package/types/button.d.ts CHANGED
@@ -1,4 +1,11 @@
1
- import { VarComponent, BasicAttributes, Type as ButtonType, Size as ButtonSize, ListenerProp } from './varComponent'
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
 
@@ -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: {
@@ -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'