@varlet/ui 3.20.5 → 3.20.6

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.20.5",
4
+ "version": "3.20.6",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -6788,6 +6788,24 @@
6788
6788
  "type": "boolean | object",
6789
6789
  "kind": "expression"
6790
6790
  }
6791
+ },
6792
+ {
6793
+ "name": "active",
6794
+ "description": "Whether to enable the persistent active effect. It uses a translucent primary-color overlay and text color by default and supports object form `{ color?: string }`",
6795
+ "default": "false",
6796
+ "value": {
6797
+ "type": "boolean | object",
6798
+ "kind": "expression"
6799
+ }
6800
+ },
6801
+ {
6802
+ "name": "disabled",
6803
+ "description": "Whether to disable interaction. When disabled, click, hover, and ripple effects are disabled and only a disabled cursor is shown",
6804
+ "default": "false",
6805
+ "value": {
6806
+ "type": "boolean",
6807
+ "kind": "expression"
6808
+ }
6791
6809
  }
6792
6810
  ],
6793
6811
  "events": [
@@ -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.20.5",
4
+ "version": "3.20.6",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -6530,6 +6530,24 @@
6530
6530
  "type": "boolean | object",
6531
6531
  "kind": "expression"
6532
6532
  }
6533
+ },
6534
+ {
6535
+ "name": "active",
6536
+ "description": "是否开启常驻激活效果,默认使用主色半透明叠层和文字颜色,支持对象形式 `{ color?: string }`",
6537
+ "default": "false",
6538
+ "value": {
6539
+ "type": "boolean | object",
6540
+ "kind": "expression"
6541
+ }
6542
+ },
6543
+ {
6544
+ "name": "disabled",
6545
+ "description": "是否禁用交互。禁用后不触发点击、悬停和水波效果,仅显示禁用光标",
6546
+ "default": "false",
6547
+ "value": {
6548
+ "type": "boolean",
6549
+ "kind": "expression"
6550
+ }
6533
6551
  }
6534
6552
  ],
6535
6553
  "events": [
package/lib/varlet.cjs.js CHANGED
@@ -21733,6 +21733,11 @@ var props$55 = {
21733
21733
  type: [Boolean, Object],
21734
21734
  default: false
21735
21735
  },
21736
+ active: {
21737
+ type: [Boolean, Object],
21738
+ default: false
21739
+ },
21740
+ disabled: Boolean,
21736
21741
  onClick: defineListenerProp()
21737
21742
  };
21738
21743
  //#endregion
@@ -21743,18 +21748,26 @@ function __render__$39(_ctx, _cache) {
21743
21748
  const _directive_ripple = (0, vue.resolveDirective)("ripple");
21744
21749
  const _directive_hover = (0, vue.resolveDirective)("hover");
21745
21750
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
21746
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), [_ctx.variant === "standard", _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.variant === "outlined", _ctx.n("--outlined")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.inline, _ctx.n("$--inline-flex")])),
21751
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n("$--box"), [_ctx.variant === "standard", _ctx.formatElevation(_ctx.elevation, 2)], [!_ctx.disabled && (_ctx.onClick || !_ctx.normalizedHoverable.disabled), _ctx.n("--cursor")], [_ctx.disabled, _ctx.n("--disabled")], [!_ctx.disabled && _ctx.normalizedActive.enabled, _ctx.n("--active")], [_ctx.round, _ctx.n("--round")], [_ctx.surfaceLow, _ctx.n("--surface-low")], [_ctx.variant === "outlined", _ctx.n("--outlined")], [_ctx.variant === "filled", _ctx.n("--filled")], [_ctx.inline, _ctx.n("$--inline-flex")])),
21747
21752
  style: (0, vue.normalizeStyle)({
21748
21753
  width: _ctx.toSizeUnit(_ctx.width),
21749
21754
  height: _ctx.toSizeUnit(_ctx.height),
21750
- "border-radius": _ctx.toSizeUnit(_ctx.radius)
21755
+ "border-radius": _ctx.toSizeUnit(_ctx.radius),
21756
+ "--paper-active-color": _ctx.normalizedActive.color
21751
21757
  }),
21752
21758
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
21753
- }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(_component_var_hover_overlay, {
21754
- hovering: !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
21755
- color: _ctx.normalizedHoverable.color
21756
- }, null, 8, ["hovering", "color"])], 6)), [[_directive_ripple, {
21757
- disabled: _ctx.normalizedRipple.disabled,
21759
+ }, [
21760
+ (0, vue.renderSlot)(_ctx.$slots, "default"),
21761
+ (0, vue.createVNode)(_component_var_hover_overlay, {
21762
+ class: (0, vue.normalizeClass)(_ctx.n("active-overlay")),
21763
+ hovering: !_ctx.disabled && _ctx.normalizedActive.enabled
21764
+ }, null, 8, ["class", "hovering"]),
21765
+ (0, vue.createVNode)(_component_var_hover_overlay, {
21766
+ hovering: !_ctx.disabled && !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
21767
+ color: _ctx.normalizedHoverable.color
21768
+ }, null, 8, ["hovering", "color"])
21769
+ ], 6)), [[_directive_ripple, {
21770
+ disabled: _ctx.disabled || _ctx.normalizedRipple.disabled,
21758
21771
  color: _ctx.normalizedRipple.color
21759
21772
  }], [
21760
21773
  _directive_hover,
@@ -21775,6 +21788,7 @@ var __sfc__$39 = (0, vue.defineComponent)({
21775
21788
  const { hovering, handleHovering } = useHoverOverlay();
21776
21789
  const normalizedRipple = (0, vue.computed)(() => normalizeRipple(props2.ripple));
21777
21790
  const normalizedHoverable = (0, vue.computed)(() => normalizeHoverable(props2.hoverable));
21791
+ const normalizedActive = (0, vue.computed)(() => normalizeActive(props2.active));
21778
21792
  function normalizeRipple(value) {
21779
21793
  if (isPlainObject(value)) return {
21780
21794
  disabled: !!value.disabled,
@@ -21795,7 +21809,18 @@ var __sfc__$39 = (0, vue.defineComponent)({
21795
21809
  color: void 0
21796
21810
  };
21797
21811
  }
21812
+ function normalizeActive(value) {
21813
+ if (isPlainObject(value)) return {
21814
+ enabled: true,
21815
+ color: value.color
21816
+ };
21817
+ return {
21818
+ enabled: value,
21819
+ color: void 0
21820
+ };
21821
+ }
21798
21822
  function handleClick(e) {
21823
+ if (props2.disabled) return;
21799
21824
  call(props2.onClick, e);
21800
21825
  }
21801
21826
  return {
@@ -21805,6 +21830,7 @@ var __sfc__$39 = (0, vue.defineComponent)({
21805
21830
  surfaceLow,
21806
21831
  normalizedRipple,
21807
21832
  normalizedHoverable,
21833
+ normalizedActive,
21808
21834
  hovering,
21809
21835
  handleHovering,
21810
21836
  toSizeUnit,
@@ -27700,7 +27726,9 @@ var stdin_default$297 = {
27700
27726
  "--paper-outlined-background": "transparent",
27701
27727
  "--paper-filled-background": "var(--color-surface-container-highest)",
27702
27728
  "--paper-outline-color": "var(--color-outline)",
27703
- "--paper-border-radius": "4px"
27729
+ "--paper-border-radius": "4px",
27730
+ "--paper-active-color": "var(--color-primary)",
27731
+ "--paper-active-opacity": "0.2"
27704
27732
  };
27705
27733
  //#endregion
27706
27734
  //#region es/themes/dark/picker.mjs
@@ -29080,7 +29108,9 @@ var stdin_default$221 = {
29080
29108
  "--paper-outlined-background": "transparent",
29081
29109
  "--paper-filled-background": "var(--color-surface-container-highest)",
29082
29110
  "--paper-outline-color": "var(--color-outline)",
29083
- "--paper-border-radius": "12px"
29111
+ "--paper-border-radius": "12px",
29112
+ "--paper-active-color": "var(--color-primary)",
29113
+ "--paper-active-opacity": "0.2"
29084
29114
  };
29085
29115
  //#endregion
29086
29116
  //#region es/themes/md3-dark/picker.mjs
@@ -30445,7 +30475,9 @@ var stdin_default$145 = {
30445
30475
  "--paper-outlined-background": "transparent",
30446
30476
  "--paper-filled-background": "var(--color-surface-container-highest)",
30447
30477
  "--paper-outline-color": "var(--color-outline)",
30448
- "--paper-border-radius": "12px"
30478
+ "--paper-border-radius": "12px",
30479
+ "--paper-active-color": "var(--color-primary)",
30480
+ "--paper-active-opacity": "0.2"
30449
30481
  };
30450
30482
  //#endregion
30451
30483
  //#region es/themes/md3-light/picker.mjs
@@ -32845,7 +32877,7 @@ var _WatermarkComponent = stdin_default$108;
32845
32877
  var stdin_default$102 = stdin_default$108;
32846
32878
  //#endregion
32847
32879
  //#region es/index.bundle.mjs
32848
- var version = "3.20.5";
32880
+ var version = "3.20.6";
32849
32881
  function install(app) {
32850
32882
  stdin_default.install && app.use(stdin_default);
32851
32883
  stdin_default$1.install && app.use(stdin_default$1);