@varlet/ui 3.16.1 → 3.16.2

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.16.1",
4
+ "version": "3.16.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1562,10 +1562,10 @@
1562
1562
  },
1563
1563
  {
1564
1564
  "name": "ripple",
1565
- "description": "Whether to enable ripple",
1565
+ "description": "Whether to enable ripple, supports object form `{ disabled?: boolean, color?: string }`",
1566
1566
  "default": "false",
1567
1567
  "value": {
1568
- "type": "boolean",
1568
+ "type": "boolean | object",
1569
1569
  "kind": "expression"
1570
1570
  }
1571
1571
  },
@@ -1589,10 +1589,10 @@
1589
1589
  },
1590
1590
  {
1591
1591
  "name": "hoverable",
1592
- "description": "Whether to enable hover effect",
1592
+ "description": "Whether to enable hover effect, supports object form `{ disabled?: boolean, color?: string }`",
1593
1593
  "default": "false",
1594
1594
  "value": {
1595
- "type": "boolean",
1595
+ "type": "boolean | object",
1596
1596
  "kind": "expression"
1597
1597
  }
1598
1598
  },
@@ -5930,10 +5930,10 @@
5930
5930
  },
5931
5931
  {
5932
5932
  "name": "ripple",
5933
- "description": "Whether to enable ripple effect",
5933
+ "description": "Whether to enable ripple effect, supports object form `{ disabled?: boolean, color?: string }`",
5934
5934
  "default": "false",
5935
5935
  "value": {
5936
- "type": "boolean",
5936
+ "type": "boolean | object",
5937
5937
  "kind": "expression"
5938
5938
  }
5939
5939
  },
@@ -5993,10 +5993,10 @@
5993
5993
  },
5994
5994
  {
5995
5995
  "name": "hoverable",
5996
- "description": "Whether to enable hover effect",
5996
+ "description": "Whether to enable hover effect, supports object form `{ disabled?: boolean, color?: string }`",
5997
5997
  "default": "false",
5998
5998
  "value": {
5999
- "type": "boolean",
5999
+ "type": "boolean | object",
6000
6000
  "kind": "expression"
6001
6001
  }
6002
6002
  }
@@ -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.16.1",
4
+ "version": "3.16.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1613,10 +1613,10 @@
1613
1613
  },
1614
1614
  {
1615
1615
  "name": "ripple",
1616
- "description": "是否开启水波",
1616
+ "description": "是否开启水波,支持对象形式 `{ disabled?: boolean, color?: string }`",
1617
1617
  "default": "false",
1618
1618
  "value": {
1619
- "type": "boolean",
1619
+ "type": "boolean | object",
1620
1620
  "kind": "expression"
1621
1621
  }
1622
1622
  },
@@ -1640,10 +1640,10 @@
1640
1640
  },
1641
1641
  {
1642
1642
  "name": "hoverable",
1643
- "description": "是否开启鼠标悬停效果",
1643
+ "description": "是否开启鼠标悬停效果,支持对象形式 `{ disabled?: boolean, color?: string }`",
1644
1644
  "default": "false",
1645
1645
  "value": {
1646
- "type": "boolean",
1646
+ "type": "boolean | object",
1647
1647
  "kind": "expression"
1648
1648
  }
1649
1649
  },
@@ -5972,10 +5972,10 @@
5972
5972
  },
5973
5973
  {
5974
5974
  "name": "ripple",
5975
- "description": "是否启用水波效果",
5975
+ "description": "是否启用水波效果,支持对象形式 `{ disabled?: boolean, color?: string }`",
5976
5976
  "default": "false",
5977
5977
  "value": {
5978
- "type": "boolean",
5978
+ "type": "boolean | object",
5979
5979
  "kind": "expression"
5980
5980
  }
5981
5981
  },
@@ -6035,10 +6035,10 @@
6035
6035
  },
6036
6036
  {
6037
6037
  "name": "hoverable",
6038
- "description": "是否开启鼠标悬停效果",
6038
+ "description": "是否开启鼠标悬停效果,支持对象形式 `{ disabled?: boolean, color?: string }`",
6039
6039
  "default": "false",
6040
6040
  "value": {
6041
- "type": "boolean",
6041
+ "type": "boolean | object",
6042
6042
  "kind": "expression"
6043
6043
  }
6044
6044
  }
package/lib/varlet.cjs.js CHANGED
@@ -3250,13 +3250,17 @@ var stdin_default$39 = Hover;
3250
3250
  //#region es/hover-overlay/props.mjs
3251
3251
  var props$35 = {
3252
3252
  hovering: Boolean,
3253
- focusing: Boolean
3253
+ focusing: Boolean,
3254
+ color: String
3254
3255
  };
3255
3256
  //#endregion
3256
3257
  //#region es/hover-overlay/HoverOverlay.mjs
3257
3258
  var { name: name$89, n: n$97, classes: classes$77 } = createNamespace("hover-overlay");
3258
3259
  function __render__$95(_ctx, _cache) {
3259
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n("--hovering")], [_ctx.focusing && !_ctx.inMobile(), _ctx.n("--focusing")])) }, null, 2);
3260
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
3261
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n("--hovering")], [_ctx.focusing && !_ctx.inMobile(), _ctx.n("--focusing")])),
3262
+ style: (0, vue.normalizeStyle)({ color: _ctx.color })
3263
+ }, null, 6);
3260
3264
  }
3261
3265
  var __sfc__$95 = (0, vue.defineComponent)({
3262
3266
  name: name$89,
@@ -9379,7 +9383,10 @@ var props$13 = {
9379
9383
  default: "column"
9380
9384
  },
9381
9385
  surface: String,
9382
- hoverable: Boolean,
9386
+ hoverable: {
9387
+ type: [Boolean, Object],
9388
+ default: false
9389
+ },
9383
9390
  floating: Boolean,
9384
9391
  floatingDuration: {
9385
9392
  type: Number,
@@ -9397,7 +9404,10 @@ var props$13 = {
9397
9404
  ],
9398
9405
  default: true
9399
9406
  },
9400
- ripple: Boolean,
9407
+ ripple: {
9408
+ type: [Boolean, Object],
9409
+ default: false
9410
+ },
9401
9411
  onClick: defineListenerProp(),
9402
9412
  "onUpdate:floating": defineListenerProp(),
9403
9413
  outline: Boolean
@@ -9435,7 +9445,7 @@ function __render__$69(_ctx, _cache) {
9435
9445
  const _directive_hover = (0, vue.resolveDirective)("hover");
9436
9446
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
9437
9447
  ref: "card",
9438
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.hoverable, _ctx.n("--cursor")], [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)])),
9448
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [!_ctx.normalizedHoverable.disabled, _ctx.n("--cursor")], [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)])),
9439
9449
  style: (0, vue.normalizeStyle)({ zIndex: _ctx.floated ? _ctx.zIndex : void 0 }),
9440
9450
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
9441
9451
  }, [(0, vue.createElementVNode)("div", {
@@ -9495,7 +9505,10 @@ function __render__$69(_ctx, _cache) {
9495
9505
  })
9496
9506
  }, [(0, vue.renderSlot)(_ctx.$slots, "floating-content")], 6)) : (0, vue.createCommentVNode)("v-if", true)
9497
9507
  ], 2),
9498
- (0, vue.createVNode)(_component_var_hover_overlay, { hovering: _ctx.hoverable && !_ctx.floated ? _ctx.hovering : false }, null, 8, ["hovering"]),
9508
+ (0, vue.createVNode)(_component_var_hover_overlay, {
9509
+ hovering: !_ctx.normalizedHoverable.disabled && !_ctx.floated ? _ctx.hovering : false,
9510
+ color: _ctx.normalizedHoverable.color
9511
+ }, null, 8, ["hovering", "color"]),
9499
9512
  _ctx.showFloatingButtons ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
9500
9513
  key: 0,
9501
9514
  class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("floating-buttons"), _ctx.n("$--box"))),
@@ -9522,7 +9535,10 @@ function __render__$69(_ctx, _cache) {
9522
9535
  width: _ctx.holderWidth,
9523
9536
  height: _ctx.holderHeight
9524
9537
  })
9525
- }, null, 6)], 6)), [[_directive_ripple, { disabled: !_ctx.ripple || _ctx.floater }], [
9538
+ }, null, 6)], 6)), [[_directive_ripple, {
9539
+ disabled: _ctx.normalizedRipple.disabled || _ctx.floater,
9540
+ color: _ctx.normalizedRipple.color
9541
+ }], [
9526
9542
  _directive_hover,
9527
9543
  _ctx.handleHovering,
9528
9544
  "desktop"
@@ -9559,6 +9575,8 @@ var __sfc__$69 = (0, vue.defineComponent)({
9559
9575
  const showFloatingButtons = (0, vue.ref)(false);
9560
9576
  const floated = (0, vue.ref)(false);
9561
9577
  const { zIndex } = useZIndex(() => props2.floating, 1);
9578
+ const normalizedRipple = (0, vue.computed)(() => normalizeRipple(props2.ripple));
9579
+ const normalizedHoverable = (0, vue.computed)(() => normalizeHoverable(props2.hoverable));
9562
9580
  let dropdownFloaterTop = "auto";
9563
9581
  let dropdownFloaterLeft = "auto";
9564
9582
  let dropper = null;
@@ -9599,7 +9617,27 @@ var __sfc__$69 = (0, vue.defineComponent)({
9599
9617
  opacity.value = "1";
9600
9618
  floaterOverflow.value = "auto";
9601
9619
  floated.value = true;
9602
- }), props2.ripple ? RIPPLE_DELAY : 0);
9620
+ }), normalizedRipple.value.disabled ? 0 : RIPPLE_DELAY);
9621
+ }
9622
+ function normalizeRipple(value) {
9623
+ if (isPlainObject(value)) return {
9624
+ disabled: !!value.disabled,
9625
+ color: value.color
9626
+ };
9627
+ return {
9628
+ disabled: !value,
9629
+ color: void 0
9630
+ };
9631
+ }
9632
+ function normalizeHoverable(value) {
9633
+ if (isPlainObject(value)) return {
9634
+ disabled: !!value.disabled,
9635
+ color: value.color
9636
+ };
9637
+ return {
9638
+ disabled: !value,
9639
+ color: void 0
9640
+ };
9603
9641
  }
9604
9642
  function dropdown() {
9605
9643
  clearTimeout(dropper);
@@ -9649,6 +9687,8 @@ var __sfc__$69 = (0, vue.defineComponent)({
9649
9687
  zIndex,
9650
9688
  isRow,
9651
9689
  surfaceLow,
9690
+ normalizedRipple,
9691
+ normalizedHoverable,
9652
9692
  hovering,
9653
9693
  handleHovering,
9654
9694
  showFloatingButtons,
@@ -19174,14 +19214,20 @@ var props$53 = {
19174
19214
  ],
19175
19215
  default: false
19176
19216
  },
19177
- ripple: Boolean,
19217
+ ripple: {
19218
+ type: [Boolean, Object],
19219
+ default: false
19220
+ },
19178
19221
  radius: [Number, String],
19179
19222
  width: [Number, String],
19180
19223
  height: [Number, String],
19181
19224
  round: Boolean,
19182
19225
  inline: Boolean,
19183
19226
  surface: String,
19184
- hoverable: Boolean,
19227
+ hoverable: {
19228
+ type: [Boolean, Object],
19229
+ default: false
19230
+ },
19185
19231
  onClick: defineListenerProp()
19186
19232
  };
19187
19233
  //#endregion
@@ -19192,14 +19238,20 @@ function __render__$33(_ctx, _cache) {
19192
19238
  const _directive_ripple = (0, vue.resolveDirective)("ripple");
19193
19239
  const _directive_hover = (0, vue.resolveDirective)("hover");
19194
19240
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
19195
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.formatElevation(_ctx.elevation, 2), [_ctx.onClick || _ctx.hoverable, _ctx.n("--cursor")], [_ctx.round, _ctx.n("--round")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.inline, _ctx.n("$--inline-flex")])),
19241
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.formatElevation(_ctx.elevation, 2), [_ctx.onClick || !_ctx.normalizedHoverable.disabled, _ctx.n("--cursor")], [_ctx.round, _ctx.n("--round")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.inline, _ctx.n("$--inline-flex")])),
19196
19242
  style: (0, vue.normalizeStyle)({
19197
19243
  width: _ctx.toSizeUnit(_ctx.width),
19198
19244
  height: _ctx.toSizeUnit(_ctx.height),
19199
19245
  "border-radius": _ctx.toSizeUnit(_ctx.radius)
19200
19246
  }),
19201
19247
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
19202
- }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(_component_var_hover_overlay, { hovering: _ctx.hoverable ? _ctx.hovering : false }, null, 8, ["hovering"])], 6)), [[_directive_ripple, { disabled: !_ctx.ripple }], [
19248
+ }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(_component_var_hover_overlay, {
19249
+ hovering: !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
19250
+ color: _ctx.normalizedHoverable.color
19251
+ }, null, 8, ["hovering", "color"])], 6)), [[_directive_ripple, {
19252
+ disabled: _ctx.normalizedRipple.disabled,
19253
+ color: _ctx.normalizedRipple.color
19254
+ }], [
19203
19255
  _directive_hover,
19204
19256
  _ctx.handleHovering,
19205
19257
  "desktop"
@@ -19216,6 +19268,28 @@ var __sfc__$33 = (0, vue.defineComponent)({
19216
19268
  setup(props2) {
19217
19269
  const surfaceLow = (0, vue.computed)(() => props2.surface === "low");
19218
19270
  const { hovering, handleHovering } = useHoverOverlay();
19271
+ const normalizedRipple = (0, vue.computed)(() => normalizeRipple(props2.ripple));
19272
+ const normalizedHoverable = (0, vue.computed)(() => normalizeHoverable(props2.hoverable));
19273
+ function normalizeRipple(value) {
19274
+ if (isPlainObject(value)) return {
19275
+ disabled: !!value.disabled,
19276
+ color: value.color
19277
+ };
19278
+ return {
19279
+ disabled: !value,
19280
+ color: void 0
19281
+ };
19282
+ }
19283
+ function normalizeHoverable(value) {
19284
+ if (isPlainObject(value)) return {
19285
+ disabled: !!value.disabled,
19286
+ color: value.color
19287
+ };
19288
+ return {
19289
+ disabled: !value,
19290
+ color: void 0
19291
+ };
19292
+ }
19219
19293
  function handleClick(e) {
19220
19294
  call(props2.onClick, e);
19221
19295
  }
@@ -19224,6 +19298,8 @@ var __sfc__$33 = (0, vue.defineComponent)({
19224
19298
  classes: classes$24,
19225
19299
  formatElevation,
19226
19300
  surfaceLow,
19301
+ normalizedRipple,
19302
+ normalizedHoverable,
19227
19303
  hovering,
19228
19304
  handleHovering,
19229
19305
  toSizeUnit,
@@ -29042,7 +29118,7 @@ var _WatermarkComponent = stdin_default$100;
29042
29118
  var stdin_default$94 = stdin_default$100;
29043
29119
  //#endregion
29044
29120
  //#region es/index.bundle.mjs
29045
- var version = "3.16.1";
29121
+ var version = "3.16.2";
29046
29122
  function install(app) {
29047
29123
  stdin_default.install && app.use(stdin_default);
29048
29124
  stdin_default$1.install && app.use(stdin_default$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.16.1",
3
+ "version": "3.16.2",
4
4
  "description": "A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.",
5
5
  "keywords": [
6
6
  "Vue3",
@@ -44,9 +44,9 @@
44
44
  "@popperjs/core": "^2.11.6",
45
45
  "dayjs": "^1.10.4",
46
46
  "decimal.js": "^10.2.1",
47
- "@varlet/shared": "3.16.1",
48
- "@varlet/icons": "3.16.1",
49
- "@varlet/use": "3.16.1"
47
+ "@varlet/icons": "3.16.2",
48
+ "@varlet/use": "3.16.2",
49
+ "@varlet/shared": "3.16.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^20.19.0",
@@ -62,9 +62,9 @@
62
62
  "vue": "3.5.21",
63
63
  "vue-router": "4.5.1",
64
64
  "zod": "^3.23.8",
65
- "@varlet/cli": "3.16.1",
66
- "@varlet/ui": "3.16.1",
67
- "@varlet/touch-emulator": "3.16.1"
65
+ "@varlet/ui": "3.16.2",
66
+ "@varlet/cli": "3.16.2",
67
+ "@varlet/touch-emulator": "3.16.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"
package/types/card.d.ts CHANGED
@@ -11,10 +11,20 @@ export type CardVariant = 'standard' | 'outlined' | 'filled'
11
11
 
12
12
  export type CardSurface = 'low'
13
13
 
14
+ export interface CardRipple {
15
+ disabled?: boolean
16
+ color?: string
17
+ }
18
+
19
+ export interface CardHoverable {
20
+ disabled?: boolean
21
+ color?: string
22
+ }
23
+
14
24
  export interface CardProps extends BasicAttributes {
15
25
  variant?: CardVariant
16
26
  surface?: CardSurface
17
- hoverable?: boolean
27
+ hoverable?: boolean | CardHoverable
18
28
  src?: string
19
29
  fit?: CardFit
20
30
  imageHeight?: string | number
@@ -24,7 +34,7 @@ export interface CardProps extends BasicAttributes {
24
34
  subtitle?: string
25
35
  description?: string
26
36
  elevation?: boolean | number | string
27
- ripple?: boolean
37
+ ripple?: boolean | CardRipple
28
38
  layout?: CardLayout
29
39
  floating?: boolean
30
40
  floatingDuration?: number
@@ -4,6 +4,8 @@ export declare const hoverOverlayProps: Record<keyof HoverOverlayProps, any>
4
4
 
5
5
  export interface HoverOverlayProps extends BasicAttributes {
6
6
  hovering?: boolean
7
+ focusing?: boolean
8
+ color?: string
7
9
  }
8
10
 
9
11
  export class HoverOverlay extends VarComponent {
package/types/paper.d.ts CHANGED
@@ -5,16 +5,26 @@ export declare const paperProps: Record<keyof PaperProps, any>
5
5
 
6
6
  export type PaperSurface = 'low'
7
7
 
8
+ export interface PaperRipple {
9
+ disabled?: boolean
10
+ color?: string
11
+ }
12
+
13
+ export interface PaperHoverable {
14
+ disabled?: boolean
15
+ color?: string
16
+ }
17
+
8
18
  export interface PaperProps extends BasicAttributes {
9
19
  elevation?: boolean | number | string
10
- ripple?: boolean
20
+ ripple?: boolean | PaperRipple
11
21
  radius?: string | number
12
22
  width?: string | number
13
23
  height?: string | number
14
24
  round?: boolean
15
25
  inline?: boolean
16
26
  surface?: PaperSurface
17
- hoverable?: boolean
27
+ hoverable?: boolean | PaperHoverable
18
28
  onClick?: ListenerProp<(e: Event) => void>
19
29
  }
20
30