@varlet/ui 3.5.0-alpha.1726249557629 → 3.5.0

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": "3.5.0-alpha.1726249557629",
4
+ "version": "3.5.0",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -407,7 +407,7 @@
407
407
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
408
408
  "default": "-",
409
409
  "value": {
410
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
410
+ "type": "((v: string) => any) | ZodType | Array<((v: string) => any) | ZodType>",
411
411
  "kind": "expression"
412
412
  }
413
413
  },
@@ -1633,7 +1633,7 @@
1633
1633
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
1634
1634
  "default": "-",
1635
1635
  "value": {
1636
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
1636
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
1637
1637
  "kind": "expression"
1638
1638
  }
1639
1639
  }
@@ -1729,7 +1729,7 @@
1729
1729
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
1730
1730
  "default": "-",
1731
1731
  "value": {
1732
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
1732
+ "type": "((v: any[]) => any) | ZodType | Array<((v: any[]) => any) | ZodType>",
1733
1733
  "kind": "expression"
1734
1734
  }
1735
1735
  }
@@ -2173,7 +2173,7 @@
2173
2173
  "description": "The value of the binding",
2174
2174
  "default": "0",
2175
2175
  "value": {
2176
- "type": "string | number",
2176
+ "type": "number",
2177
2177
  "kind": "expression"
2178
2178
  }
2179
2179
  },
@@ -2362,7 +2362,7 @@
2362
2362
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
2363
2363
  "default": "-",
2364
2364
  "value": {
2365
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
2365
+ "type": "((v: number) => any) | ZodType | Array<((v: number) => any) | ZodType>",
2366
2366
  "kind": "expression"
2367
2367
  }
2368
2368
  }
@@ -4095,7 +4095,7 @@
4095
4095
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
4096
4096
  "default": "-",
4097
4097
  "value": {
4098
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
4098
+ "type": "((v: string) => any) | ZodType | Array<((v: string) => any) | ZodType>",
4099
4099
  "kind": "expression"
4100
4100
  }
4101
4101
  },
@@ -5915,7 +5915,7 @@
5915
5915
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
5916
5916
  "default": "-",
5917
5917
  "value": {
5918
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
5918
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
5919
5919
  "kind": "expression"
5920
5920
  }
5921
5921
  }
@@ -5998,7 +5998,7 @@
5998
5998
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
5999
5999
  "default": "-",
6000
6000
  "value": {
6001
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6001
+ "type": "(v: any) => any | ZodType | Array<(v: any) => any | ZodType>",
6002
6002
  "kind": "expression"
6003
6003
  }
6004
6004
  }
@@ -6325,7 +6325,7 @@
6325
6325
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
6326
6326
  "default": "-",
6327
6327
  "value": {
6328
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6328
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
6329
6329
  "kind": "expression"
6330
6330
  }
6331
6331
  }
@@ -6642,7 +6642,7 @@
6642
6642
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
6643
6643
  "default": "-",
6644
6644
  "value": {
6645
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6645
+ "type": "((v: number | [number, number]) => any) | ZodType | Array<((v: number | [number, number]) => any) | ZodType>",
6646
6646
  "kind": "expression"
6647
6647
  }
6648
6648
  }
@@ -7351,7 +7351,7 @@
7351
7351
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
7352
7352
  "default": "-",
7353
7353
  "value": {
7354
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
7354
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
7355
7355
  "kind": "expression"
7356
7356
  }
7357
7357
  },
@@ -8183,7 +8183,7 @@
8183
8183
  "description": "Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0`",
8184
8184
  "default": "-",
8185
8185
  "value": {
8186
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
8186
+ "type": "((v: VarFile[]) => any) | ZodType | Array<((v: VarFile[]) => any) | ZodType>",
8187
8187
  "kind": "expression"
8188
8188
  }
8189
8189
  }
@@ -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": "3.5.0-alpha.1726249557629",
4
+ "version": "3.5.0",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -407,7 +407,7 @@
407
407
  "description": "验证规则,返回 `true` 表示验证通过,其余的值则转换为文本作为用户提示",
408
408
  "default": "-",
409
409
  "value": {
410
- "type": "Array<(v: string) => any>",
410
+ "type": "((v: string) => any) | ZodType | Array<((v: string) => any) | ZodType>",
411
411
  "kind": "expression"
412
412
  }
413
413
  },
@@ -1792,7 +1792,7 @@
1792
1792
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
1793
1793
  "default": "-",
1794
1794
  "value": {
1795
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
1795
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
1796
1796
  "kind": "expression"
1797
1797
  }
1798
1798
  }
@@ -1888,7 +1888,7 @@
1888
1888
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
1889
1889
  "default": "-",
1890
1890
  "value": {
1891
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
1891
+ "type": "((v: any[]) => any) | ZodType | Array<((v: any[]) => any) | ZodType>",
1892
1892
  "kind": "expression"
1893
1893
  }
1894
1894
  }
@@ -2332,7 +2332,7 @@
2332
2332
  "description": "绑定的值",
2333
2333
  "default": "0",
2334
2334
  "value": {
2335
- "type": "string | number",
2335
+ "type": "number",
2336
2336
  "kind": "expression"
2337
2337
  }
2338
2338
  },
@@ -2521,7 +2521,7 @@
2521
2521
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
2522
2522
  "default": "-",
2523
2523
  "value": {
2524
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
2524
+ "type": "((v: number) => any) | ZodType | Array<((v: number) => any) | ZodType>",
2525
2525
  "kind": "expression"
2526
2526
  }
2527
2527
  }
@@ -4254,7 +4254,7 @@
4254
4254
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
4255
4255
  "default": "-",
4256
4256
  "value": {
4257
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
4257
+ "type": "((v: string) => any) | ZodType | Array<((v: string) => any) | ZodType>",
4258
4258
  "kind": "expression"
4259
4259
  }
4260
4260
  },
@@ -6074,7 +6074,7 @@
6074
6074
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
6075
6075
  "default": "-",
6076
6076
  "value": {
6077
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6077
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
6078
6078
  "kind": "expression"
6079
6079
  }
6080
6080
  }
@@ -6157,7 +6157,7 @@
6157
6157
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
6158
6158
  "default": "-",
6159
6159
  "value": {
6160
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6160
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
6161
6161
  "kind": "expression"
6162
6162
  }
6163
6163
  }
@@ -6345,7 +6345,7 @@
6345
6345
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
6346
6346
  "default": "-",
6347
6347
  "value": {
6348
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6348
+ "type": "((v: number) => any) | ZodType | Array<((v: number) => any) | ZodType>",
6349
6349
  "kind": "expression"
6350
6350
  }
6351
6351
  }
@@ -6656,7 +6656,7 @@
6656
6656
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
6657
6657
  "default": "-",
6658
6658
  "value": {
6659
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6659
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
6660
6660
  "kind": "expression"
6661
6661
  }
6662
6662
  }
@@ -6973,7 +6973,7 @@
6973
6973
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
6974
6974
  "default": "-",
6975
6975
  "value": {
6976
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
6976
+ "type": "((v: number | [number, number]) => any) | ZodType | Array<((v: number | [number, number]) => any) | ZodType>",
6977
6977
  "kind": "expression"
6978
6978
  }
6979
6979
  }
@@ -7682,7 +7682,7 @@
7682
7682
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
7683
7683
  "default": "-",
7684
7684
  "value": {
7685
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
7685
+ "type": "((v: any) => any) | ZodType | Array<((v: any) => any) | ZodType>",
7686
7686
  "kind": "expression"
7687
7687
  }
7688
7688
  },
@@ -8515,7 +8515,7 @@
8515
8515
  "description": "验证规则,返回 `true` 表示验证通过,其它类型的值将转换为文本作为用户提示。自 `3.5.0` 开始支持 [Zod 验证](#/zh-CN/zodValidation)",
8516
8516
  "default": "-",
8517
8517
  "value": {
8518
- "type": "(v: string) => any | ZodType | Array<(v: string) => any | ZodType>",
8518
+ "type": "((v: VarFile[]) => any) | ZodType | Array<((v: VarFile[]) => any) | ZodType>",
8519
8519
  "kind": "expression"
8520
8520
  }
8521
8521
  }
package/lib/varlet.cjs.js CHANGED
@@ -2928,6 +2928,38 @@ const props$1b = {
2928
2928
  onClick: defineListenerProp(),
2929
2929
  onClear: defineListenerProp()
2930
2930
  };
2931
+ const SWIPE_BIND_SWIPE_ITEM_KEY = Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");
2932
+ const SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY = Symbol(
2933
+ "SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY"
2934
+ );
2935
+ function useSwipeItems() {
2936
+ const { childProviders, length, bindChildren } = useChildren(
2937
+ SWIPE_BIND_SWIPE_ITEM_KEY
2938
+ );
2939
+ return {
2940
+ length,
2941
+ swipeItems: childProviders,
2942
+ bindSwipeItems: bindChildren
2943
+ };
2944
+ }
2945
+ function useSwipeResizeListeners() {
2946
+ const { childProviders, bindChildren } = useChildren(
2947
+ SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY
2948
+ );
2949
+ return {
2950
+ swipeResizeListeners: childProviders,
2951
+ bindSwipeResizeListeners: bindChildren
2952
+ };
2953
+ }
2954
+ function useSwipeResizeDispatcher() {
2955
+ const { parentProvider, bindParent } = useParent(
2956
+ SWIPE_RESIZE_DISPATCHER_BIND_SWIPE_RESIZE_LISTENER_KEY
2957
+ );
2958
+ return {
2959
+ swipeResizeDispatcher: parentProvider,
2960
+ bindSwipeResizeDispatcher: bindParent
2961
+ };
2962
+ }
2931
2963
  var __async$h = (__this, __arguments, generator) => {
2932
2964
  return new Promise((resolve, reject) => {
2933
2965
  var fulfilled = (value) => {
@@ -3158,6 +3190,7 @@ const __sfc__$1k = vue.defineComponent({
3158
3190
  const transitionDisabled = vue.ref(true);
3159
3191
  const isFloating = vue.computed(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
3160
3192
  const { popup, bindPopup } = usePopup();
3193
+ const { bindSwipeResizeDispatcher } = useSwipeResizeDispatcher();
3161
3194
  const color = vue.computed(
3162
3195
  () => !props2.isError ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
3163
3196
  );
@@ -3170,6 +3203,11 @@ const __sfc__$1k = vue.defineComponent({
3170
3203
  });
3171
3204
  vue.onUpdated(resize);
3172
3205
  call(bindPopup, null);
3206
+ call(bindSwipeResizeDispatcher, {
3207
+ onResize() {
3208
+ vue.nextTick().then(resize);
3209
+ }
3210
+ });
3173
3211
  if (popup) {
3174
3212
  vue.watch(
3175
3213
  () => popup.show.value,
@@ -12360,7 +12398,7 @@ LN10 = new Decimal(LN10);
12360
12398
  PI = new Decimal(PI);
12361
12399
  const props$M = {
12362
12400
  modelValue: {
12363
- type: [String, Number],
12401
+ type: Number,
12364
12402
  default: 0
12365
12403
  },
12366
12404
  min: [String, Number],
@@ -16794,17 +16832,6 @@ withInstall(stdin_default$4m);
16794
16832
  withPropsDefaultsSetter(stdin_default$4m, props$B);
16795
16833
  const _ImageComponent = stdin_default$4m;
16796
16834
  var stdin_default$4l = stdin_default$4m;
16797
- const SWIPE_BIND_SWIPE_ITEM_KEY = Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");
16798
- function useSwipeItems() {
16799
- const { childProviders, length, bindChildren } = useChildren(
16800
- SWIPE_BIND_SWIPE_ITEM_KEY
16801
- );
16802
- return {
16803
- length,
16804
- swipeItems: childProviders,
16805
- bindSwipeItems: bindChildren
16806
- };
16807
- }
16808
16835
  const props$A = {
16809
16836
  loop: {
16810
16837
  type: Boolean,
@@ -17036,6 +17063,7 @@ const __sfc__$G = vue.defineComponent({
17036
17063
  const index = vue.ref(0);
17037
17064
  const hovering = vue.ref(false);
17038
17065
  const { swipeItems, bindSwipeItems, length } = useSwipeItems();
17066
+ const { swipeResizeListeners, bindSwipeResizeListeners } = useSwipeResizeListeners();
17039
17067
  const { popup, bindPopup } = usePopup();
17040
17068
  const {
17041
17069
  deltaX,
@@ -17062,6 +17090,7 @@ const __sfc__$G = vue.defineComponent({
17062
17090
  bindSwipeItems(swipeProvider);
17063
17091
  useEventListener(() => window, "keydown", handleKeydown);
17064
17092
  call(bindPopup, null);
17093
+ call(bindSwipeResizeListeners, null);
17065
17094
  vue.watch(
17066
17095
  () => length.value,
17067
17096
  () => __async$7(this, null, function* () {
@@ -17264,6 +17293,9 @@ const __sfc__$G = vue.defineComponent({
17264
17293
  setTimeout(() => {
17265
17294
  lockDuration.value = false;
17266
17295
  });
17296
+ swipeResizeListeners.forEach(({ onResize }) => {
17297
+ onResize();
17298
+ });
17267
17299
  }
17268
17300
  function next(options) {
17269
17301
  return __async$7(this, null, function* () {
@@ -29613,7 +29645,7 @@ withInstall(stdin_default$1);
29613
29645
  withPropsDefaultsSetter(stdin_default$1, props);
29614
29646
  const _WatermarkComponent = stdin_default$1;
29615
29647
  var stdin_default = stdin_default$1;
29616
- const version = "3.5.0-alpha.1726249557629";
29648
+ const version = "3.5.0";
29617
29649
  function install(app) {
29618
29650
  stdin_default$5I.install && app.use(stdin_default$5I);
29619
29651
  stdin_default$5G.install && app.use(stdin_default$5G);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.5.0-alpha.1726249557629",
3
+ "version": "3.5.0",
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": "3.5.0-alpha.1726249557629",
52
- "@varlet/shared": "3.5.0-alpha.1726249557629",
53
- "@varlet/use": "3.5.0-alpha.1726249557629"
51
+ "@varlet/icons": "3.5.0",
52
+ "@varlet/shared": "3.5.0",
53
+ "@varlet/use": "3.5.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
@@ -65,9 +65,9 @@
65
65
  "typescript": "^5.1.5",
66
66
  "vue": "3.4.21",
67
67
  "vue-router": "4.2.0",
68
- "@varlet/ui": "3.5.0-alpha.1726249557629",
69
- "@varlet/cli": "3.5.0-alpha.1726249557629",
70
- "@varlet/touch-emulator": "3.5.0-alpha.1726249557629"
68
+ "@varlet/ui": "3.5.0",
69
+ "@varlet/cli": "3.5.0",
70
+ "@varlet/touch-emulator": "3.5.0"
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "varlet-cli dev",
@@ -3,6 +3,7 @@ import {
3
3
  BasicAttributes,
4
4
  ListenerProp,
5
5
  Variant as AutoCompleteVariant,
6
+ Rules as AutoCompleteRules,
6
7
  SetPropsDefaults,
7
8
  } from './varComponent'
8
9
  import { VNode, VNodeChild, type InputHTMLAttributes } from 'vue'
@@ -44,7 +45,7 @@ export interface AutoCompleteProps extends BasicAttributes {
44
45
  clearable?: boolean
45
46
  validateTrigger?: AutoCompleteValidateTrigger[]
46
47
  getShow?: (v: string) => boolean
47
- rules?: any
48
+ rules?: AutoCompleteRules
48
49
  enterkeyhint?: InputHTMLAttributes['enterKeyHint']
49
50
  onFocus?: ListenerProp<() => void>
50
51
  onBlur?: ListenerProp<() => void>
@@ -1,4 +1,4 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as CheckboxRules } from './varComponent'
2
2
  import { VNode } from 'vue'
3
3
 
4
4
  export declare const checkboxProps: Record<keyof CheckboxProps, any>
@@ -17,7 +17,7 @@ export interface CheckboxProps extends BasicAttributes {
17
17
  iconSize?: string | number
18
18
  ripple?: boolean
19
19
  validateTrigger?: Array<CheckboxValidateTrigger>
20
- rules?: any
20
+ rules?: CheckboxRules
21
21
  onClick?: ListenerProp<(e: Event) => void>
22
22
  onChange?: ListenerProp<(value: any) => void>
23
23
  'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
@@ -2,6 +2,7 @@ import {
2
2
  VarComponent,
3
3
  BasicAttributes,
4
4
  Direction as CheckboxGroupDirection,
5
+ Rules as CheckboxGroupRules,
5
6
  ListenerProp,
6
7
  SetPropsDefaults,
7
8
  } from './varComponent'
@@ -31,7 +32,7 @@ export interface CheckboxGroupProps extends BasicAttributes {
31
32
  options?: Array<CheckboxGroupOption>
32
33
  direction?: CheckboxGroupDirection
33
34
  validateTrigger?: Array<CheckboxGroupValidateTrigger>
34
- rules?: any
35
+ rules?: CheckboxGroupRules
35
36
  onChange?: ListenerProp<(value: Array<any>) => void>
36
37
  'onUpdate:modelValue'?: ListenerProp<(value: Array<any>) => void>
37
38
  }
@@ -1,11 +1,11 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as CounterRules } from './varComponent'
2
2
 
3
3
  export declare const counterProps: Record<keyof CounterProps, any>
4
4
 
5
5
  export type CounterValidateTrigger = 'onIncrement' | 'onDecrement' | 'onInputChange' | 'onLazyChange'
6
6
 
7
7
  export interface CounterProps extends BasicAttributes {
8
- modelValue?: string | number
8
+ modelValue?: number
9
9
  min?: string | number
10
10
  max?: string | number
11
11
  step?: string | number
@@ -26,8 +26,8 @@ export interface CounterProps extends BasicAttributes {
26
26
  press?: boolean
27
27
  ripple?: boolean
28
28
  validateTrigger?: Array<CounterValidateTrigger>
29
- rules?: any
30
- onBeforeChange?: ListenerProp<(value: number, change: (value: string | number) => void) => void>
29
+ rules?: CounterRules
30
+ onBeforeChange?: ListenerProp<(value: number, change: (value: number) => void) => void>
31
31
  onChange?: ListenerProp<(value: number) => void>
32
32
  onIncrement?: ListenerProp<(value: number) => void>
33
33
  onDecrement?: ListenerProp<(value: number) => void>
package/types/input.d.ts CHANGED
@@ -1,4 +1,11 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, Variant as InputVariant, SetPropsDefaults } from './varComponent'
1
+ import {
2
+ VarComponent,
3
+ BasicAttributes,
4
+ ListenerProp,
5
+ Variant as InputVariant,
6
+ Rules as InputRules,
7
+ SetPropsDefaults,
8
+ } from './varComponent'
2
9
  import { VNode, InputHTMLAttributes } from 'vue'
3
10
 
4
11
  export declare const inputProps: Record<keyof InputProps, any>
@@ -29,7 +36,7 @@ export interface InputProps extends BasicAttributes {
29
36
  resize?: boolean
30
37
  autofocus?: boolean
31
38
  validateTrigger?: InputValidateTrigger[]
32
- rules?: any
39
+ rules?: InputRules
33
40
  enterkeyhint?: InputHTMLAttributes['enterKeyHint']
34
41
  onFocus?: ListenerProp<(e: Event) => void>
35
42
  onBlur?: ListenerProp<(e: Event) => void>
package/types/radio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, Rules as RadioRules, SetPropsDefaults } from './varComponent'
2
2
  import { VNode } from 'vue'
3
3
 
4
4
  export declare const radioProps: Record<keyof RadioProps, any>
@@ -16,7 +16,7 @@ export interface RadioProps extends BasicAttributes {
16
16
  iconSize?: string | number
17
17
  ripple?: boolean
18
18
  validateTrigger?: Array<RadioValidateTrigger>
19
- rules?: any
19
+ rules?: RadioRules
20
20
  onClick?: ListenerProp<(e: Event) => void>
21
21
  onChange?: ListenerProp<(value: any) => void>
22
22
  'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
@@ -2,6 +2,7 @@ import {
2
2
  VarComponent,
3
3
  BasicAttributes,
4
4
  Direction as RadioGroupDirection,
5
+ Rules as RadioGroupRules,
5
6
  ListenerProp,
6
7
  SetPropsDefaults,
7
8
  } from './varComponent'
@@ -30,7 +31,7 @@ export interface RadioGroupProps extends BasicAttributes {
30
31
  labelKey?: string
31
32
  valueKey?: string
32
33
  validateTrigger?: Array<RadioGroupValidateTrigger>
33
- rules?: any
34
+ rules?: RadioGroupRules
34
35
  onChange?: ListenerProp<(value: any) => void>
35
36
  'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
36
37
  }
package/types/rate.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as RateRules } from './varComponent'
2
2
 
3
3
  export declare const rateProps: Record<keyof RateProps, any>
4
4
 
@@ -21,7 +21,7 @@ export interface RateProps extends BasicAttributes {
21
21
  readonly?: boolean
22
22
  clearable?: boolean
23
23
  ripple?: boolean
24
- rules?: any
24
+ rules?: RateRules
25
25
  onChange?: ListenerProp<(value: number) => void>
26
26
  'onUpdate:modelValue'?: ListenerProp<(value: number) => void>
27
27
  }
package/types/select.d.ts CHANGED
@@ -1,4 +1,11 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, Variant as SelectVariant, SetPropsDefaults } from './varComponent'
1
+ import {
2
+ VarComponent,
3
+ BasicAttributes,
4
+ ListenerProp,
5
+ Variant as SelectVariant,
6
+ Rules as SelectRules,
7
+ SetPropsDefaults,
8
+ } from './varComponent'
2
9
  import { VNode } from 'vue'
3
10
 
4
11
  export declare const selectProps: Record<keyof SelectProps, any>
@@ -43,7 +50,7 @@ export interface SelectProps extends BasicAttributes {
43
50
  separator?: string
44
51
  textAlign?: SelectTextAlign
45
52
  validateTrigger?: Array<SelectValidateTrigger>
46
- rules?: any
53
+ rules?: SelectRules
47
54
  onFocus?: ListenerProp<(e: Event) => void>
48
55
  onBlur?: ListenerProp<(e: Event) => void>
49
56
  onClick?: ListenerProp<(e: Event) => void>
package/types/slider.d.ts CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  VarComponent,
3
3
  BasicAttributes,
4
4
  Direction as SliderDirection,
5
+ Rules as SliderRules,
5
6
  ListenerProp,
6
7
  SetPropsDefaults,
7
8
  } from './varComponent'
@@ -30,7 +31,7 @@ export interface SliderProps extends BasicAttributes {
30
31
  disabled?: boolean
31
32
  readonly?: boolean
32
33
  direction?: SliderDirection
33
- rules?: any
34
+ rules?: SliderRules
34
35
  onChange?: ListenerProp<(value: number | Array<number>) => void>
35
36
  onStart?: ListenerProp<() => void>
36
37
  onEnd?: ListenerProp<(value: number | Array<number>) => void>
package/types/switch.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as SwitchRules } from './varComponent'
2
2
 
3
3
  export declare const switchProps: Record<keyof SwitchProps, any>
4
4
 
@@ -20,7 +20,7 @@ export interface SwitchProps extends BasicAttributes {
20
20
  lazyChange?: boolean
21
21
  validateTrigger?: Array<SwitchValidateTrigger>
22
22
  variant?: boolean
23
- rules?: any
23
+ rules?: SwitchRules
24
24
  onClick?: ListenerProp<(event: Event) => void>
25
25
  onChange?: ListenerProp<(value: any) => void>
26
26
  'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
@@ -1,4 +1,4 @@
1
- import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults } from './varComponent'
1
+ import { VarComponent, BasicAttributes, ListenerProp, SetPropsDefaults, Rules as UploaderRules } from './varComponent'
2
2
  import { VNode, InputHTMLAttributes } from 'vue'
3
3
 
4
4
  export declare const uploaderProps: Record<keyof UploaderProps, any>
@@ -47,7 +47,7 @@ export interface UploaderProps extends BasicAttributes {
47
47
  preventDefaultPreview?: boolean
48
48
  resolveType?: UploaderResolveType
49
49
  validateTrigger?: Array<UploaderValidateTrigger>
50
- rules?: any
50
+ rules?: UploaderRules
51
51
  onClickAction?: ListenerProp<(chooseFile: () => void, event: Event) => void>
52
52
  onBeforeFilter?: ListenerProp<(files: VarFile[]) => Promise<VarFile[]> | VarFile[]>
53
53
  onBeforeRead?: ListenerProp<(file: VarFile) => Promise<any> | any>
@@ -18,6 +18,10 @@ export type Variant = 'outlined' | 'standard'
18
18
 
19
19
  export type ListenerProp<F> = F | F[]
20
20
 
21
+ export type Rule = Record<string, any> | ((v: any) => any)
22
+
23
+ export type Rules = Rule | Rule[]
24
+
21
25
  export interface BasicAttributes {
22
26
  class?: string | Record<string, any>
23
27
  style?: string | Record<string, any>