@varlet/ui 3.16.0 → 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.0",
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
  },
@@ -5668,6 +5668,15 @@
5668
5668
  "kind": "expression"
5669
5669
  }
5670
5670
  },
5671
+ {
5672
+ "name": "align",
5673
+ "description": "Overall content alignment, options are `start` `center` `end`",
5674
+ "default": "center",
5675
+ "value": {
5676
+ "type": "OtpInputAlign",
5677
+ "kind": "expression"
5678
+ }
5679
+ },
5671
5680
  {
5672
5681
  "name": "validate-trigger",
5673
5682
  "description": "Validation triggers, options are `onInput` `onClick` `onPaste` `onComplete`",
@@ -5921,10 +5930,10 @@
5921
5930
  },
5922
5931
  {
5923
5932
  "name": "ripple",
5924
- "description": "Whether to enable ripple effect",
5933
+ "description": "Whether to enable ripple effect, supports object form `{ disabled?: boolean, color?: string }`",
5925
5934
  "default": "false",
5926
5935
  "value": {
5927
- "type": "boolean",
5936
+ "type": "boolean | object",
5928
5937
  "kind": "expression"
5929
5938
  }
5930
5939
  },
@@ -5984,10 +5993,10 @@
5984
5993
  },
5985
5994
  {
5986
5995
  "name": "hoverable",
5987
- "description": "Whether to enable hover effect",
5996
+ "description": "Whether to enable hover effect, supports object form `{ disabled?: boolean, color?: string }`",
5988
5997
  "default": "false",
5989
5998
  "value": {
5990
- "type": "boolean",
5999
+ "type": "boolean | object",
5991
6000
  "kind": "expression"
5992
6001
  }
5993
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.0",
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
  },
@@ -5710,6 +5710,15 @@
5710
5710
  "kind": "expression"
5711
5711
  }
5712
5712
  },
5713
+ {
5714
+ "name": "align",
5715
+ "description": "组件整体内容对齐方式,可选值为 `start` `center` `end`",
5716
+ "default": "center",
5717
+ "value": {
5718
+ "type": "OtpInputAlign",
5719
+ "kind": "expression"
5720
+ }
5721
+ },
5713
5722
  {
5714
5723
  "name": "validate-trigger",
5715
5724
  "description": "触发校验的时机,可选值为 `onInput` `onClick` `onPaste` `onComplete`",
@@ -5963,10 +5972,10 @@
5963
5972
  },
5964
5973
  {
5965
5974
  "name": "ripple",
5966
- "description": "是否启用水波效果",
5975
+ "description": "是否启用水波效果,支持对象形式 `{ disabled?: boolean, color?: string }`",
5967
5976
  "default": "false",
5968
5977
  "value": {
5969
- "type": "boolean",
5978
+ "type": "boolean | object",
5970
5979
  "kind": "expression"
5971
5980
  }
5972
5981
  },
@@ -6026,10 +6035,10 @@
6026
6035
  },
6027
6036
  {
6028
6037
  "name": "hoverable",
6029
- "description": "是否开启鼠标悬停效果",
6038
+ "description": "是否开启鼠标悬停效果,支持对象形式 `{ disabled?: boolean, color?: string }`",
6030
6039
  "default": "false",
6031
6040
  "value": {
6032
- "type": "boolean",
6041
+ "type": "boolean | object",
6033
6042
  "kind": "expression"
6034
6043
  }
6035
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,
@@ -18422,6 +18462,10 @@ var props$50 = __spreadProps$3(__spreadValues$9({
18422
18462
  type: [String, Number],
18423
18463
  default: 8
18424
18464
  },
18465
+ align: {
18466
+ type: String,
18467
+ default: "center"
18468
+ },
18425
18469
  validateTrigger: {
18426
18470
  type: Array,
18427
18471
  default: () => ["onInput", "onComplete"]
@@ -18458,7 +18502,7 @@ function __render__$35(_ctx, _cache) {
18458
18502
  const _component_var_form_details = (0, vue.resolveComponent)("var-form-details");
18459
18503
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
18460
18504
  ref: "rootEl",
18461
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
18505
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.n(`--align-${_ctx.align}`))),
18462
18506
  style: (0, vue.normalizeStyle)({
18463
18507
  "--otp-input-gutter": _ctx.gutterStyle,
18464
18508
  "--otp-input-cell-height": _ctx.cellHeightStyle,
@@ -18770,6 +18814,7 @@ var __sfc__$35 = (0, vue.defineComponent)({
18770
18814
  cellMaxWidthStyle,
18771
18815
  resolvedInputmode,
18772
18816
  nativeInputType,
18817
+ align: props2.align,
18773
18818
  n: n$33,
18774
18819
  classes: classes$26,
18775
18820
  setInputRef,
@@ -19169,14 +19214,20 @@ var props$53 = {
19169
19214
  ],
19170
19215
  default: false
19171
19216
  },
19172
- ripple: Boolean,
19217
+ ripple: {
19218
+ type: [Boolean, Object],
19219
+ default: false
19220
+ },
19173
19221
  radius: [Number, String],
19174
19222
  width: [Number, String],
19175
19223
  height: [Number, String],
19176
19224
  round: Boolean,
19177
19225
  inline: Boolean,
19178
19226
  surface: String,
19179
- hoverable: Boolean,
19227
+ hoverable: {
19228
+ type: [Boolean, Object],
19229
+ default: false
19230
+ },
19180
19231
  onClick: defineListenerProp()
19181
19232
  };
19182
19233
  //#endregion
@@ -19187,14 +19238,20 @@ function __render__$33(_ctx, _cache) {
19187
19238
  const _directive_ripple = (0, vue.resolveDirective)("ripple");
19188
19239
  const _directive_hover = (0, vue.resolveDirective)("hover");
19189
19240
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
19190
- 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")])),
19191
19242
  style: (0, vue.normalizeStyle)({
19192
19243
  width: _ctx.toSizeUnit(_ctx.width),
19193
19244
  height: _ctx.toSizeUnit(_ctx.height),
19194
19245
  "border-radius": _ctx.toSizeUnit(_ctx.radius)
19195
19246
  }),
19196
19247
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
19197
- }, [(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
+ }], [
19198
19255
  _directive_hover,
19199
19256
  _ctx.handleHovering,
19200
19257
  "desktop"
@@ -19211,6 +19268,28 @@ var __sfc__$33 = (0, vue.defineComponent)({
19211
19268
  setup(props2) {
19212
19269
  const surfaceLow = (0, vue.computed)(() => props2.surface === "low");
19213
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
+ }
19214
19293
  function handleClick(e) {
19215
19294
  call(props2.onClick, e);
19216
19295
  }
@@ -19219,6 +19298,8 @@ var __sfc__$33 = (0, vue.defineComponent)({
19219
19298
  classes: classes$24,
19220
19299
  formatElevation,
19221
19300
  surfaceLow,
19301
+ normalizedRipple,
19302
+ normalizedHoverable,
19222
19303
  hovering,
19223
19304
  handleHovering,
19224
19305
  toSizeUnit,
@@ -29037,7 +29118,7 @@ var _WatermarkComponent = stdin_default$100;
29037
29118
  var stdin_default$94 = stdin_default$100;
29038
29119
  //#endregion
29039
29120
  //#region es/index.bundle.mjs
29040
- var version = "3.16.0";
29121
+ var version = "3.16.2";
29041
29122
  function install(app) {
29042
29123
  stdin_default.install && app.use(stdin_default);
29043
29124
  stdin_default$1.install && app.use(stdin_default$1);