@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.
@@ -3,5 +3,5 @@ import '../../icon/icon.css'
3
3
  import '../../ripple/ripple.css'
4
4
  import '../../popup/popup.css'
5
5
  import '../actionSheet.css'
6
- import '../ActionItemSfc.css'
7
6
  import '../ActionSheetSfc.css'
7
+ import '../ActionItemSfc.css'
package/es/card/Card.mjs CHANGED
@@ -18,7 +18,7 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- import { call, doubleRaf, getRect } from "@varlet/shared";
21
+ import { call, doubleRaf, getRect, isPlainObject } from "@varlet/shared";
22
22
  import { computed, defineComponent, nextTick, ref, watch } from "vue";
23
23
  import VarButton from "../button/index.mjs";
24
24
  import { useLock } from "../context/lock.mjs";
@@ -51,7 +51,7 @@ function __render__(_ctx, _cache) {
51
51
  [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")],
52
52
  [_ctx.variant === "filled", _ctx.n("--filled")],
53
53
  [_ctx.surfaceLow, _ctx.n("--surface-low")],
54
- [_ctx.hoverable, _ctx.n("--cursor")],
54
+ [!_ctx.normalizedHoverable.disabled, _ctx.n("--cursor")],
55
55
  [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)]
56
56
  )
57
57
  ),
@@ -186,8 +186,9 @@ function __render__(_ctx, _cache) {
186
186
  /* CLASS */
187
187
  ),
188
188
  _createVNode(_component_var_hover_overlay, {
189
- hovering: _ctx.hoverable && !_ctx.floated ? _ctx.hovering : false
190
- }, null, 8, ["hovering"]),
189
+ hovering: !_ctx.normalizedHoverable.disabled && !_ctx.floated ? _ctx.hovering : false,
190
+ color: _ctx.normalizedHoverable.color
191
+ }, null, 8, ["hovering", "color"]),
191
192
  _ctx.showFloatingButtons ? (_openBlock(), _createElementBlock(
192
193
  "div",
193
194
  {
@@ -242,7 +243,7 @@ function __render__(_ctx, _cache) {
242
243
  6
243
244
  /* CLASS, STYLE */
244
245
  )), [
245
- [_directive_ripple, { disabled: !_ctx.ripple || _ctx.floater }],
246
+ [_directive_ripple, { disabled: _ctx.normalizedRipple.disabled || _ctx.floater, color: _ctx.normalizedRipple.color }],
246
247
  [_directive_hover, _ctx.handleHovering, "desktop"]
247
248
  ]);
248
249
  }
@@ -274,6 +275,8 @@ const __sfc__ = defineComponent({
274
275
  const showFloatingButtons = ref(false);
275
276
  const floated = ref(false);
276
277
  const { zIndex } = useZIndex(() => props2.floating, 1);
278
+ const normalizedRipple = computed(() => normalizeRipple(props2.ripple));
279
+ const normalizedHoverable = computed(() => normalizeHoverable(props2.hoverable));
277
280
  let dropdownFloaterTop = "auto";
278
281
  let dropdownFloaterLeft = "auto";
279
282
  let dropper = null;
@@ -327,9 +330,33 @@ const __sfc__ = defineComponent({
327
330
  floaterOverflow.value = "auto";
328
331
  floated.value = true;
329
332
  }),
330
- props2.ripple ? RIPPLE_DELAY : 0
333
+ normalizedRipple.value.disabled ? 0 : RIPPLE_DELAY
331
334
  );
332
335
  }
336
+ function normalizeRipple(value) {
337
+ if (isPlainObject(value)) {
338
+ return {
339
+ disabled: !!value.disabled,
340
+ color: value.color
341
+ };
342
+ }
343
+ return {
344
+ disabled: !value,
345
+ color: void 0
346
+ };
347
+ }
348
+ function normalizeHoverable(value) {
349
+ if (isPlainObject(value)) {
350
+ return {
351
+ disabled: !!value.disabled,
352
+ color: value.color
353
+ };
354
+ }
355
+ return {
356
+ disabled: !value,
357
+ color: void 0
358
+ };
359
+ }
333
360
  function dropdown() {
334
361
  clearTimeout(dropper);
335
362
  clearTimeout(floater.value);
@@ -378,6 +405,8 @@ const __sfc__ = defineComponent({
378
405
  zIndex,
379
406
  isRow,
380
407
  surfaceLow,
408
+ normalizedRipple,
409
+ normalizedHoverable,
381
410
  hovering,
382
411
  handleHovering,
383
412
  showFloatingButtons,
package/es/card/props.mjs CHANGED
@@ -16,7 +16,10 @@ const props = {
16
16
  default: "column"
17
17
  },
18
18
  surface: String,
19
- hoverable: Boolean,
19
+ hoverable: {
20
+ type: [Boolean, Object],
21
+ default: false
22
+ },
20
23
  floating: Boolean,
21
24
  floatingDuration: {
22
25
  type: Number,
@@ -30,7 +33,10 @@ const props = {
30
33
  type: [Boolean, Number, String],
31
34
  default: true
32
35
  },
33
- ripple: Boolean,
36
+ ripple: {
37
+ type: [Boolean, Object],
38
+ default: false
39
+ },
34
40
  onClick: defineListenerProp(),
35
41
  "onUpdate:floating": defineListenerProp(),
36
42
  /**
@@ -3,16 +3,17 @@ import { defineComponent } from "vue";
3
3
  import { createNamespace } from "../utils/components.mjs";
4
4
  import { props } from "./props.mjs";
5
5
  const { name, n, classes } = createNamespace("hover-overlay");
6
- import { normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
6
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
7
7
  function __render__(_ctx, _cache) {
8
8
  return _openBlock(), _createElementBlock(
9
9
  "div",
10
10
  {
11
- class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n("--hovering")], [_ctx.focusing && !_ctx.inMobile(), _ctx.n("--focusing")]))
11
+ class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n("--hovering")], [_ctx.focusing && !_ctx.inMobile(), _ctx.n("--focusing")])),
12
+ style: _normalizeStyle({ color: _ctx.color })
12
13
  },
13
14
  null,
14
- 2
15
- /* CLASS */
15
+ 6
16
+ /* CLASS, STYLE */
16
17
  );
17
18
  }
18
19
  const __sfc__ = defineComponent({
@@ -1,6 +1,7 @@
1
1
  const props = {
2
2
  hovering: Boolean,
3
- focusing: Boolean
3
+ focusing: Boolean,
4
+ color: String
4
5
  };
5
6
  export {
6
7
  props
@@ -286,7 +286,7 @@ import './tooltip/style/index.mjs'
286
286
  import './uploader/style/index.mjs'
287
287
  import './watermark/style/index.mjs'
288
288
 
289
- const version = '3.16.0'
289
+ const version = '3.16.2'
290
290
 
291
291
  function install(app) {
292
292
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -190,7 +190,7 @@ export * from './tooltip/index.mjs'
190
190
  export * from './uploader/index.mjs'
191
191
  export * from './watermark/index.mjs'
192
192
 
193
- const version = '3.16.0'
193
+ const version = '3.16.2'
194
194
 
195
195
  function install(app) {
196
196
  ActionSheet.install && app.use(ActionSheet)
@@ -17,7 +17,7 @@ function __render__(_ctx, _cache) {
17
17
  "div",
18
18
  {
19
19
  ref: "rootEl",
20
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
20
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"), _ctx.n(`--align-${_ctx.align}`))),
21
21
  style: _normalizeStyle({
22
22
  "--otp-input-gutter": _ctx.gutterStyle,
23
23
  "--otp-input-cell-height": _ctx.cellHeightStyle,
@@ -398,6 +398,7 @@ const __sfc__ = defineComponent({
398
398
  cellMaxWidthStyle,
399
399
  resolvedInputmode,
400
400
  nativeInputType,
401
+ align: props2.align,
401
402
  n,
402
403
  classes,
403
404
  setInputRef,
@@ -1 +1 @@
1
- :root { --otp-input-gutter: 8px; --otp-input-cell-height: 48px; --otp-input-cell-max-width: 48px; --otp-input-input-font-size: 20px;}.var-otp-input { display: inline-flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 100%;}.var-otp-input__cells { display: flex; align-items: center; justify-content: center; gap: var(--otp-input-gutter); width: 100%; max-width: 100%;}.var-otp-input__cell { flex: 1 1 0; min-width: 0; height: var(--otp-input-cell-height); max-width: var(--otp-input-cell-max-width);}.var-otp-input__separator { display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; flex-shrink: 0;}.var-otp-input__details { width: 100%;}.var-otp-input .var-input__input { text-align: center; font-size: var(--otp-input-input-font-size); text-transform: none; height: 100%;}.var-otp-input .var-field-decorator__middle { justify-content: center;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--filled .var-field-decorator__controller,.var-otp-input .var-field-decorator--small.var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--small.var-field-decorator--filled .var-field-decorator__controller { padding-left: 0; padding-right: 0;}.var-otp-input .var-field-decorator--standard .var-field-decorator__controller,.var-otp-input .var-field-decorator--standard .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--standard .var-field-decorator__middle,.var-otp-input .var-field-decorator--standard .var-field-decorator__icon,.var-otp-input .var-field-decorator--standard .var-field-decorator--middle-non-hint,.var-otp-input .var-field-decorator--standard .var-field-decorator--icon-non-hint { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--outlined .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__middle,.var-otp-input .var-field-decorator--outlined .var-field-decorator__icon { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-field-decorator--filled .var-field-decorator__controller,.var-otp-input .var-field-decorator--filled .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--filled .var-field-decorator__middle,.var-otp-input .var-field-decorator--filled .var-field-decorator__icon,.var-otp-input .var-field-decorator--filled .var-field-decorator--middle-non-hint,.var-otp-input .var-field-decorator--filled .var-field-decorator--icon-non-hint { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-input,.var-otp-input .var-field-decorator,.var-otp-input .var-field-decorator__container,.var-otp-input .var-field-decorator__main,.var-otp-input .var-field-decorator__body { height: 100%;}
1
+ :root { --otp-input-gutter: 8px; --otp-input-cell-height: 48px; --otp-input-cell-max-width: 48px; --otp-input-input-font-size: 20px;}.var-otp-input { display: inline-flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 100%;}.var-otp-input__cells { display: flex; align-items: center; justify-content: center; gap: var(--otp-input-gutter); width: 100%; max-width: 100%;}.var-otp-input__cell { flex: 1 1 0; min-width: 0; height: var(--otp-input-cell-height); max-width: var(--otp-input-cell-max-width);}.var-otp-input__separator { display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; flex-shrink: 0;}.var-otp-input__details { width: 100%;}.var-otp-input--align-start .var-otp-input__cells { justify-content: flex-start;}.var-otp-input--align-start .var-otp-input__details,.var-otp-input--align-start .var-otp-input__details .var-form-details__error-message,.var-otp-input--align-start .var-otp-input__details .var-form-details__extra-message { text-align: left;}.var-otp-input--align-center .var-otp-input__cells { justify-content: center;}.var-otp-input--align-center .var-otp-input__details,.var-otp-input--align-center .var-otp-input__details .var-form-details__error-message,.var-otp-input--align-center .var-otp-input__details .var-form-details__extra-message { text-align: center;}.var-otp-input--align-end .var-otp-input__cells { justify-content: flex-end;}.var-otp-input--align-end .var-otp-input__details,.var-otp-input--align-end .var-otp-input__details .var-form-details__error-message,.var-otp-input--align-end .var-otp-input__details .var-form-details__extra-message { text-align: right;}.var-otp-input .var-input__input { text-align: center; font-size: var(--otp-input-input-font-size); text-transform: none; height: 100%;}.var-otp-input .var-field-decorator__middle { justify-content: center;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--filled .var-field-decorator__controller,.var-otp-input .var-field-decorator--small.var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--small.var-field-decorator--filled .var-field-decorator__controller { padding-left: 0; padding-right: 0;}.var-otp-input .var-field-decorator--standard .var-field-decorator__controller,.var-otp-input .var-field-decorator--standard .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--standard .var-field-decorator__middle,.var-otp-input .var-field-decorator--standard .var-field-decorator__icon,.var-otp-input .var-field-decorator--standard .var-field-decorator--middle-non-hint,.var-otp-input .var-field-decorator--standard .var-field-decorator--icon-non-hint { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__controller,.var-otp-input .var-field-decorator--outlined .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--outlined .var-field-decorator__middle,.var-otp-input .var-field-decorator--outlined .var-field-decorator__icon { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-field-decorator--filled .var-field-decorator__controller,.var-otp-input .var-field-decorator--filled .var-field-decorator__middle { height: 100%;}.var-otp-input .var-field-decorator--filled .var-field-decorator__middle,.var-otp-input .var-field-decorator--filled .var-field-decorator__icon,.var-otp-input .var-field-decorator--filled .var-field-decorator--middle-non-hint,.var-otp-input .var-field-decorator--filled .var-field-decorator--icon-non-hint { margin-top: 0; margin-bottom: 0;}.var-otp-input .var-input,.var-otp-input .var-field-decorator,.var-otp-input .var-field-decorator__container,.var-otp-input .var-field-decorator__main,.var-otp-input .var-field-decorator__body { height: 100%;}
@@ -52,6 +52,10 @@ const props = __spreadProps(__spreadValues({
52
52
  type: [String, Number],
53
53
  default: 8
54
54
  },
55
+ align: {
56
+ type: String,
57
+ default: "center"
58
+ },
55
59
  validateTrigger: {
56
60
  type: Array,
57
61
  default: () => ["onInput", "onComplete"]
@@ -1,4 +1,4 @@
1
- import { call } from "@varlet/shared";
1
+ import { call, isPlainObject } from "@varlet/shared";
2
2
  import { computed, defineComponent } from "vue";
3
3
  import Hover from "../hover/index.mjs";
4
4
  import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
@@ -20,7 +20,7 @@ function __render__(_ctx, _cache) {
20
20
  _ctx.n(),
21
21
  _ctx.n("$--box"),
22
22
  _ctx.formatElevation(_ctx.elevation, 2),
23
- [_ctx.onClick || _ctx.hoverable, _ctx.n("--cursor")],
23
+ [_ctx.onClick || !_ctx.normalizedHoverable.disabled, _ctx.n("--cursor")],
24
24
  [_ctx.round, _ctx.n("--round")],
25
25
  [_ctx.surfaceLow, _ctx.n("--surface-low")],
26
26
  [_ctx.inline, _ctx.n("$--inline-flex")]
@@ -36,13 +36,14 @@ function __render__(_ctx, _cache) {
36
36
  [
37
37
  _renderSlot(_ctx.$slots, "default"),
38
38
  _createVNode(_component_var_hover_overlay, {
39
- hovering: _ctx.hoverable ? _ctx.hovering : false
40
- }, null, 8, ["hovering"])
39
+ hovering: !_ctx.normalizedHoverable.disabled ? _ctx.hovering : false,
40
+ color: _ctx.normalizedHoverable.color
41
+ }, null, 8, ["hovering", "color"])
41
42
  ],
42
43
  6
43
44
  /* CLASS, STYLE */
44
45
  )), [
45
- [_directive_ripple, { disabled: !_ctx.ripple }],
46
+ [_directive_ripple, { disabled: _ctx.normalizedRipple.disabled, color: _ctx.normalizedRipple.color }],
46
47
  [_directive_hover, _ctx.handleHovering, "desktop"]
47
48
  ]);
48
49
  }
@@ -56,6 +57,32 @@ const __sfc__ = defineComponent({
56
57
  setup(props2) {
57
58
  const surfaceLow = computed(() => props2.surface === "low");
58
59
  const { hovering, handleHovering } = useHoverOverlay();
60
+ const normalizedRipple = computed(() => normalizeRipple(props2.ripple));
61
+ const normalizedHoverable = computed(() => normalizeHoverable(props2.hoverable));
62
+ function normalizeRipple(value) {
63
+ if (isPlainObject(value)) {
64
+ return {
65
+ disabled: !!value.disabled,
66
+ color: value.color
67
+ };
68
+ }
69
+ return {
70
+ disabled: !value,
71
+ color: void 0
72
+ };
73
+ }
74
+ function normalizeHoverable(value) {
75
+ if (isPlainObject(value)) {
76
+ return {
77
+ disabled: !!value.disabled,
78
+ color: value.color
79
+ };
80
+ }
81
+ return {
82
+ disabled: !value,
83
+ color: void 0
84
+ };
85
+ }
59
86
  function handleClick(e) {
60
87
  call(props2.onClick, e);
61
88
  }
@@ -64,6 +91,8 @@ const __sfc__ = defineComponent({
64
91
  classes,
65
92
  formatElevation,
66
93
  surfaceLow,
94
+ normalizedRipple,
95
+ normalizedHoverable,
67
96
  hovering,
68
97
  handleHovering,
69
98
  toSizeUnit,
@@ -4,14 +4,20 @@ const props = {
4
4
  type: [Boolean, Number, String],
5
5
  default: false
6
6
  },
7
- ripple: Boolean,
7
+ ripple: {
8
+ type: [Boolean, Object],
9
+ default: false
10
+ },
8
11
  radius: [Number, String],
9
12
  width: [Number, String],
10
13
  height: [Number, String],
11
14
  round: Boolean,
12
15
  inline: Boolean,
13
16
  surface: String,
14
- hoverable: Boolean,
17
+ hoverable: {
18
+ type: [Boolean, Object],
19
+ default: false
20
+ },
15
21
  onClick: defineListenerProp()
16
22
  };
17
23
  export {