@varlet/ui 2.22.0 → 2.22.1-alpha.1706370837642

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.22.0",
4
+ "version": "2.22.1-alpha.1706370837642",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -4041,9 +4041,9 @@
4041
4041
  {
4042
4042
  "name": "v-model:show",
4043
4043
  "description": "Whether to show the menu",
4044
- "default": "default",
4044
+ "default": "false",
4045
4045
  "value": {
4046
- "type": "string",
4046
+ "type": "boolean",
4047
4047
  "kind": "expression"
4048
4048
  }
4049
4049
  },
@@ -4252,9 +4252,9 @@
4252
4252
  {
4253
4253
  "name": "v-model:show",
4254
4254
  "description": "Whether to show the menu",
4255
- "default": "default",
4255
+ "default": "false",
4256
4256
  "value": {
4257
- "type": "string",
4257
+ "type": "boolean",
4258
4258
  "kind": "expression"
4259
4259
  }
4260
4260
  },
@@ -5999,7 +5999,7 @@
5999
5999
  "description": "Validation rules",
6000
6000
  "default": "-",
6001
6001
  "value": {
6002
- "type": "array",
6002
+ "type": "Array<(v: number | number[]) => any>",
6003
6003
  "kind": "expression"
6004
6004
  }
6005
6005
  }
@@ -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.22.0",
4
+ "version": "2.22.1-alpha.1706370837642",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -4209,9 +4209,9 @@
4209
4209
  {
4210
4210
  "name": "v-model:show",
4211
4211
  "description": "是否显示菜单",
4212
- "default": "default",
4212
+ "default": "false",
4213
4213
  "value": {
4214
- "type": "string",
4214
+ "type": "boolean",
4215
4215
  "kind": "expression"
4216
4216
  }
4217
4217
  },
@@ -4420,9 +4420,9 @@
4420
4420
  {
4421
4421
  "name": "v-model:show",
4422
4422
  "description": "是否显示菜单",
4423
- "default": "default",
4423
+ "default": "false",
4424
4424
  "value": {
4425
- "type": "string",
4425
+ "type": "boolean",
4426
4426
  "kind": "expression"
4427
4427
  }
4428
4428
  },
@@ -6339,7 +6339,7 @@
6339
6339
  "description": "校验规则",
6340
6340
  "default": "-",
6341
6341
  "value": {
6342
- "type": "array",
6342
+ "type": "Array<(v: number | number[]) => any>",
6343
6343
  "kind": "expression"
6344
6344
  }
6345
6345
  }
package/lib/varlet.cjs.js CHANGED
@@ -3849,24 +3849,23 @@ function __render__$1b(_ctx, _cache) {
3849
3849
  return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
3850
3850
  "button",
3851
3851
  {
3852
- class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"), [_ctx.active === _ctx.index || _ctx.active === _ctx.name, _ctx.n("--active")])),
3852
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"), [_ctx.isActive, _ctx.n("--active")])),
3853
3853
  style: vue.normalizeStyle({
3854
- color: _ctx.computeColorStyle()
3854
+ color: _ctx.isActive ? _ctx.activeColor : _ctx.inactiveColor
3855
3855
  }),
3856
3856
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
3857
3857
  },
3858
3858
  [
3859
- _ctx.icon && !_ctx.$slots.icon ? (vue.openBlock(), vue.createBlock(_component_var_icon, {
3860
- key: 0,
3861
- name: _ctx.icon,
3862
- namespace: _ctx.namespace,
3863
- class: vue.normalizeClass(_ctx.n("icon")),
3864
- "var-bottom-navigation-item-cover": ""
3865
- }, null, 8, ["name", "namespace", "class"])) : vue.createCommentVNode("v-if", true),
3866
- vue.renderSlot(_ctx.$slots, "icon", {
3867
- active: _ctx.active === _ctx.index || _ctx.active === _ctx.name
3868
- }),
3869
- _ctx.badge ? (vue.openBlock(), vue.createBlock(_component_var_badge, vue.mergeProps({ key: 1 }, _ctx.badgeProps, {
3859
+ vue.renderSlot(_ctx.$slots, "icon", { active: _ctx.isActive }, () => [
3860
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_var_icon, {
3861
+ key: 0,
3862
+ name: _ctx.icon,
3863
+ namespace: _ctx.namespace,
3864
+ class: vue.normalizeClass(_ctx.n("icon")),
3865
+ "var-bottom-navigation-item-cover": ""
3866
+ }, null, 8, ["name", "namespace", "class"])) : vue.createCommentVNode("v-if", true)
3867
+ ]),
3868
+ _ctx.badge ? (vue.openBlock(), vue.createBlock(_component_var_badge, vue.mergeProps({ key: 0 }, _ctx.badgeProps, {
3870
3869
  class: _ctx.n("badge"),
3871
3870
  "var-bottom-navigation-item-cover": ""
3872
3871
  }), null, 16, ["class"])) : vue.createCommentVNode("v-if", true),
@@ -3876,20 +3875,13 @@ function __render__$1b(_ctx, _cache) {
3876
3875
  class: vue.normalizeClass(_ctx.n("label"))
3877
3876
  },
3878
3877
  [
3879
- !_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock(
3880
- vue.Fragment,
3881
- { key: 0 },
3882
- [
3883
- vue.createTextVNode(
3884
- vue.toDisplayString(_ctx.label),
3885
- 1
3886
- /* TEXT */
3887
- )
3888
- ],
3889
- 64
3890
- /* STABLE_FRAGMENT */
3891
- )) : vue.createCommentVNode("v-if", true),
3892
- vue.renderSlot(_ctx.$slots, "default")
3878
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
3879
+ vue.createTextVNode(
3880
+ vue.toDisplayString(_ctx.label),
3881
+ 1
3882
+ /* TEXT */
3883
+ )
3884
+ ])
3893
3885
  ],
3894
3886
  2
3895
3887
  /* CLASS */
@@ -3911,8 +3903,8 @@ const __sfc__$1c = vue.defineComponent({
3911
3903
  props: props$14,
3912
3904
  setup(props2) {
3913
3905
  const name2 = vue.computed(() => props2.name);
3914
- const badge = vue.computed(() => props2.badge);
3915
- const badgeProps = vue.ref({});
3906
+ const isActive = vue.computed(() => [name2.value, index.value].includes(active.value));
3907
+ const badgeProps = vue.computed(() => props2.badge === true ? defaultBadgeProps : props2.badge);
3916
3908
  const { index, bottomNavigation, bindBottomNavigation } = useBottomNavigation();
3917
3909
  const { active, activeColor, inactiveColor } = bottomNavigation;
3918
3910
  const bottomNavigationItemProvider = {
@@ -3920,16 +3912,6 @@ const __sfc__$1c = vue.defineComponent({
3920
3912
  index
3921
3913
  };
3922
3914
  bindBottomNavigation(bottomNavigationItemProvider);
3923
- vue.watch(
3924
- () => badge.value,
3925
- (newValue) => {
3926
- badgeProps.value = newValue === true ? defaultBadgeProps : badge.value;
3927
- },
3928
- { immediate: true }
3929
- );
3930
- function computeColorStyle() {
3931
- return active.value === name2.value || active.value === index.value ? activeColor.value : inactiveColor.value;
3932
- }
3933
3915
  function handleClick() {
3934
3916
  var _a;
3935
3917
  const active2 = (_a = name2.value) != null ? _a : index.value;
@@ -3937,13 +3919,12 @@ const __sfc__$1c = vue.defineComponent({
3937
3919
  call(bottomNavigation.onToggle, active2);
3938
3920
  }
3939
3921
  return {
3940
- index,
3941
- active,
3942
- badge,
3922
+ activeColor,
3923
+ inactiveColor,
3943
3924
  badgeProps,
3925
+ isActive,
3944
3926
  n: n$1b,
3945
3927
  classes: classes$Z,
3946
- computeColorStyle,
3947
3928
  handleClick
3948
3929
  };
3949
3930
  }
@@ -25165,7 +25146,7 @@ withInstall(stdin_default$1);
25165
25146
  withPropsDefaultsSetter(stdin_default$1, props);
25166
25147
  const _WatermarkComponent = stdin_default$1;
25167
25148
  var stdin_default = stdin_default$1;
25168
- const version = "2.22.0";
25149
+ const version = "2.22.1-alpha.1706370837642";
25169
25150
  function install(app) {
25170
25151
  stdin_default$3m.install && app.use(stdin_default$3m);
25171
25152
  stdin_default$3k.install && app.use(stdin_default$3k);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "2.22.0",
3
+ "version": "2.22.1-alpha.1706370837642",
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.22.0",
52
- "@varlet/shared": "2.22.0",
53
- "@varlet/use": "2.22.0"
51
+ "@varlet/use": "2.22.1-alpha.1706370837642",
52
+ "@varlet/icons": "2.22.1-alpha.1706370837642",
53
+ "@varlet/shared": "2.22.1-alpha.1706370837642"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.3",
@@ -66,9 +66,9 @@
66
66
  "typescript": "^5.1.5",
67
67
  "vue": "3.4.3",
68
68
  "vue-router": "4.2.0",
69
- "@varlet/cli": "2.22.0",
70
- "@varlet/ui": "2.22.0",
71
- "@varlet/touch-emulator": "2.22.0"
69
+ "@varlet/ui": "2.22.1-alpha.1706370837642",
70
+ "@varlet/cli": "2.22.1-alpha.1706370837642",
71
+ "@varlet/touch-emulator": "2.22.1-alpha.1706370837642"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
package/types/slider.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface SliderProps extends BasicAttributes {
30
30
  disabled?: boolean
31
31
  readonly?: boolean
32
32
  direction?: SliderDirection
33
- rules?: Array<(value: any) => any>
33
+ rules?: Array<(value: number | Array<number>) => any>
34
34
  onChange?: ListenerProp<(value: number | Array<number>) => void>
35
35
  onStart?: ListenerProp<() => void>
36
36
  onEnd?: ListenerProp<(value: number | Array<number>) => void>