@varlet/ui 3.18.1 → 3.19.0

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.
Files changed (91) hide show
  1. package/es/action-sheet/ActionItem.mjs +28 -8
  2. package/es/action-sheet/actionSheet.css +1 -1
  3. package/es/action-sheet/index.mjs +4 -2
  4. package/es/alert/alert.css +1 -1
  5. package/es/badge/Badge.mjs +20 -10
  6. package/es/badge/badge.css +1 -1
  7. package/es/bottom-navigation-item/BottomNavigationItem.mjs +34 -20
  8. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -1
  9. package/es/checkbox/Checkbox.mjs +95 -46
  10. package/es/checkbox/checkbox.css +1 -1
  11. package/es/chip/Chip.mjs +11 -4
  12. package/es/chip/chip.css +1 -1
  13. package/es/chip/props.mjs +4 -0
  14. package/es/date-input/DateInput.mjs +865 -0
  15. package/es/date-input/DateInputSfc.css +0 -0
  16. package/es/date-input/TimeSelect.mjs +201 -0
  17. package/es/date-input/date-input.css +1 -0
  18. package/es/date-input/index.mjs +12 -0
  19. package/es/date-input/props.mjs +77 -0
  20. package/es/date-input/style/index.mjs +14 -0
  21. package/es/date-picker/DatePicker.mjs +522 -451
  22. package/es/date-picker/DayPickerPanel.mjs +318 -0
  23. package/es/date-picker/MonthPickerPanel.mjs +187 -0
  24. package/es/date-picker/PanelHeader.mjs +332 -0
  25. package/es/date-picker/YearPickerPanel.mjs +199 -0
  26. package/es/date-picker/constants.mjs +31 -0
  27. package/es/date-picker/date-picker.css +1 -1
  28. package/es/date-picker/props.mjs +6 -9
  29. package/es/date-picker/style/index.mjs +0 -1
  30. package/es/date-picker/types.mjs +0 -0
  31. package/es/field-decorator/fieldDecorator.css +1 -1
  32. package/es/icon/icon.css +1 -1
  33. package/es/index.bundle.mjs +7 -1
  34. package/es/index.mjs +6 -1
  35. package/es/input/props.mjs +1 -1
  36. package/es/locale/en-US.mjs +2 -0
  37. package/es/locale/fa-IR.mjs +2 -0
  38. package/es/locale/ja-JP.mjs +2 -0
  39. package/es/locale/zh-CN.mjs +2 -0
  40. package/es/locale/zh-TW.mjs +2 -0
  41. package/es/menu-select/MenuSelect.mjs +11 -2
  42. package/es/menu-select/menuSelect.css +1 -1
  43. package/es/radio/Radio.mjs +61 -22
  44. package/es/radio/radio.css +1 -1
  45. package/es/rail-navigation-item/RailNavigationItem.mjs +33 -19
  46. package/es/rail-navigation-item/railNavigationItem.css +1 -1
  47. package/es/rate/Rate.mjs +23 -12
  48. package/es/rate/rate.css +1 -1
  49. package/es/select/Select.mjs +10 -1
  50. package/es/select/select.css +1 -1
  51. package/es/slider/Slider.mjs +1 -1
  52. package/es/step/Step.mjs +50 -20
  53. package/es/step/step.css +1 -1
  54. package/es/style.mjs +1 -0
  55. package/es/switch/Switch.mjs +1 -1
  56. package/es/themes/dark/alert.mjs +2 -2
  57. package/es/themes/dark/dateInput.mjs +9 -0
  58. package/es/themes/dark/datePicker.mjs +23 -19
  59. package/es/themes/dark/index.mjs +3 -2
  60. package/es/themes/md3-dark/alert.mjs +2 -2
  61. package/es/themes/md3-dark/dateInput.mjs +9 -0
  62. package/es/themes/md3-dark/datePicker.mjs +18 -13
  63. package/es/themes/md3-dark/index.mjs +3 -2
  64. package/es/themes/md3-light/alert.mjs +2 -2
  65. package/es/themes/md3-light/dateInput.mjs +9 -0
  66. package/es/themes/md3-light/datePicker.mjs +18 -13
  67. package/es/themes/md3-light/index.mjs +3 -2
  68. package/es/utils/elements.mjs +7 -0
  69. package/es/utils/shared.mjs +15 -0
  70. package/es/varlet.css +1 -1
  71. package/es/varlet.esm.js +11926 -10653
  72. package/highlight/web-types.en-US.json +599 -73
  73. package/highlight/web-types.zh-CN.json +572 -67
  74. package/lib/varlet.cjs.js +5616 -4186
  75. package/lib/varlet.css +1 -1
  76. package/package.json +7 -7
  77. package/types/actionSheet.d.ts +1 -1
  78. package/types/badge.d.ts +1 -0
  79. package/types/chip.d.ts +3 -0
  80. package/types/dateInput.d.ts +96 -0
  81. package/types/datePicker.d.ts +4 -2
  82. package/types/index.d.ts +2 -0
  83. package/types/locale.d.ts +2 -0
  84. package/types/rate.d.ts +7 -0
  85. package/types/step.d.ts +3 -0
  86. package/types/styleVars.d.ts +14 -4
  87. package/umd/varlet.js +7 -7
  88. package/es/date-picker/src/day-picker-panel.mjs +0 -385
  89. package/es/date-picker/src/month-picker-panel.mjs +0 -300
  90. package/es/date-picker/src/panel-header.mjs +0 -142
  91. package/es/date-picker/src/year-picker-panel.mjs +0 -311
@@ -1,13 +1,15 @@
1
+ import { callOrReturn, isString } from "@varlet/shared";
1
2
  import { defineComponent } from "vue";
2
3
  import Hover from "../hover/index.mjs";
3
4
  import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
4
5
  import VarIcon from "../icon/index.mjs";
5
6
  import Ripple from "../ripple/index.mjs";
6
- import { createNamespace } from "../utils/components.mjs";
7
+ import { createNamespace, MaybeVNode } from "../utils/components.mjs";
7
8
  const { name, n, classes } = createNamespace("action-sheet");
8
- import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
9
+ import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives } from "vue";
9
10
  function __render__(_ctx, _cache) {
10
11
  const _component_var_icon = _resolveComponent("var-icon");
12
+ const _component_maybe_v_node = _resolveComponent("maybe-v-node");
11
13
  const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
12
14
  const _directive_ripple = _resolveDirective("ripple");
13
15
  const _directive_hover = _resolveDirective("hover");
@@ -18,14 +20,26 @@ function __render__(_ctx, _cache) {
18
20
  style: _normalizeStyle({ color: _ctx.color })
19
21
  },
20
22
  [
21
- _ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
23
+ _ctx.isString(_ctx.icon) ? (_openBlock(), _createBlock(_component_var_icon, {
22
24
  key: 0,
23
- "var-action-sheet-cover": "",
24
25
  class: _normalizeClass(_ctx.n("action-icon")),
25
26
  namespace: _ctx.namespace,
26
27
  name: _ctx.icon,
27
28
  size: _ctx.iconSize
28
- }, null, 8, ["class", "namespace", "name", "size"])) : _createCommentVNode("v-if", true),
29
+ }, null, 8, ["class", "namespace", "name", "size"])) : _ctx.icon ? (_openBlock(), _createElementBlock(
30
+ "span",
31
+ {
32
+ key: 1,
33
+ class: _normalizeClass(_ctx.n("action-icon"))
34
+ },
35
+ [
36
+ _createVNode(_component_maybe_v_node, {
37
+ is: _ctx.renderIcon()
38
+ }, null, 8, ["is"])
39
+ ],
40
+ 2
41
+ /* CLASS */
42
+ )) : _createCommentVNode("v-if", true),
29
43
  _createElementVNode(
30
44
  "div",
31
45
  {
@@ -49,6 +63,7 @@ function __render__(_ctx, _cache) {
49
63
  const __sfc__ = defineComponent({
50
64
  name,
51
65
  components: {
66
+ MaybeVNode,
52
67
  VarHoverOverlay,
53
68
  VarIcon
54
69
  },
@@ -60,15 +75,20 @@ const __sfc__ = defineComponent({
60
75
  color: String,
61
76
  namespace: String,
62
77
  iconSize: [String, Number],
63
- icon: String
78
+ icon: [String, Object, Function]
64
79
  },
65
- setup() {
80
+ setup(props) {
66
81
  const { hovering, handleHovering } = useHoverOverlay();
82
+ function renderIcon() {
83
+ return callOrReturn(props.icon);
84
+ }
67
85
  return {
68
86
  hovering,
87
+ isString,
69
88
  n,
70
89
  classes,
71
- handleHovering
90
+ handleHovering,
91
+ renderIcon
72
92
  };
73
93
  }
74
94
  });
@@ -1 +1 @@
1
- :root { --action-sheet-border-radius: 2px; --action-sheet-border-top: none; --action-sheet-title-color: #888; --action-sheet-title-padding: 10px 16px; --action-sheet-title-font-size: 14px; --action-sheet-action-item-height: 48px; --action-sheet-action-item-padding: 0 18px; --action-sheet-action-item-color: #333; --action-sheet-action-item-disabled-color: var(--color-text-disabled); --action-sheet-icon-margin: 0 20px 0 0; --action-sheet-icon-size: 24px; --action-sheet-background: #fff;}.var-action-sheet { padding: 10px 0; background: var(--action-sheet-background); transition: background-color 0.25s;}.var-action-sheet__popup-radius { border-radius: var(--action-sheet-border-radius); border-top: var(--action-sheet-border-top);}.var-action-sheet__title { padding: var(--action-sheet-title-padding); color: var(--action-sheet-title-color); font-size: var(--action-sheet-title-font-size);}.var-action-sheet__action-item { display: flex; align-items: center; height: var(--action-sheet-action-item-height); padding: var(--action-sheet-action-item-padding); color: var(--action-sheet-action-item-color); cursor: pointer; position: relative;}.var-action-sheet__action-name { overflow: auto; max-height: var(--action-sheet-action-item-height);}.var-action-sheet__action-icon[var-action-sheet-cover] { margin: var(--action-sheet-icon-margin); width: var(--action-sheet-icon-size); height: var(--action-sheet-icon-size); font-size: var(--action-sheet-icon-size);}.var-action-sheet--disabled { color: var(--action-sheet-action-item-disabled-color) !important; cursor: not-allowed;}
1
+ :root { --action-sheet-border-radius: 2px; --action-sheet-border-top: none; --action-sheet-title-color: #888; --action-sheet-title-padding: 10px 16px; --action-sheet-title-font-size: 14px; --action-sheet-action-item-height: 48px; --action-sheet-action-item-padding: 0 18px; --action-sheet-action-item-color: #333; --action-sheet-action-item-disabled-color: var(--color-text-disabled); --action-sheet-icon-margin: 0 20px 0 0; --action-sheet-icon-size: 24px; --action-sheet-background: #fff;}.var-action-sheet { padding: 10px 0; background: var(--action-sheet-background); transition: background-color 0.25s;}.var-action-sheet__popup-radius { border-radius: var(--action-sheet-border-radius); border-top: var(--action-sheet-border-top);}.var-action-sheet__title { padding: var(--action-sheet-title-padding); color: var(--action-sheet-title-color); font-size: var(--action-sheet-title-font-size);}.var-action-sheet__action-item { display: flex; align-items: center; height: var(--action-sheet-action-item-height); padding: var(--action-sheet-action-item-padding); color: var(--action-sheet-action-item-color); cursor: pointer; position: relative;}.var-action-sheet__action-name { overflow: auto; max-height: var(--action-sheet-action-item-height);}.var-action-sheet__action-icon { display: inline-flex; margin: var(--action-sheet-icon-margin); width: var(--action-sheet-icon-size); height: var(--action-sheet-icon-size); font-size: var(--action-sheet-icon-size);}.var-action-sheet__action-icon .var-icon { font-size: inherit;}.var-action-sheet--disabled { color: var(--action-sheet-action-item-disabled-color) !important; cursor: not-allowed;}
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import { call, inBrowser } from "@varlet/shared";
18
- import { nextTick, reactive } from "vue";
18
+ import { nextTick, shallowReactive } from "vue";
19
19
  import { mountInstance, withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
20
20
  import VarActionSheet from "./ActionSheet.mjs";
21
21
  import { props as actionSheetProps } from "./props.mjs";
@@ -30,7 +30,9 @@ function ActionSheet(options) {
30
30
  }
31
31
  return new Promise((resolve) => {
32
32
  ActionSheet.close();
33
- const reactiveActionSheetOptions = reactive(normalizeOptions(options));
33
+ const reactiveActionSheetOptions = shallowReactive(
34
+ normalizeOptions(options)
35
+ );
34
36
  reactiveActionSheetOptions.teleport = "body";
35
37
  singletonOptions = reactiveActionSheetOptions;
36
38
  const { unmountInstance } = mountInstance(VarActionSheet, reactiveActionSheetOptions, {
@@ -1 +1 @@
1
- :root { --alert-padding: 16px; --alert-border-radius: 4px; --alert-icon-size: 22px; --alert-icon-margin: 0 12px 0 0; --alert-close-icon-size: 22px; --alert-close-icon-margin: 2px 0 0 12px; --alert-standard-info-text-color: var(--color-on-info); --alert-standard-danger-text-color: var(--color-on-danger); --alert-standard-success-text-color: var(--color-on-success); --alert-standard-warning-text-color: var(--color-on-warning); --alert-danger-background: var(--color-danger); --alert-success-background: var(--color-success); --alert-warning-background: var(--color-warning); --alert-info-background: var(--color-info); --alert-tonal-danger-background: hsla(var(--hsl-danger), 0.12); --alert-tonal-success-background: hsla(var(--hsl-success), 0.12); --alert-tonal-warning-background: hsla(var(--hsl-warning), 0.12); --alert-tonal-info-background: hsla(var(--hsl-info), 0.12); --alert-tonal-danger-text-color: var(--color-danger); --alert-tonal-success-text-color: var(--color-success); --alert-tonal-warning-text-color: var(--color-warning); --alert-tonal-info-text-color: var(--color-info); --alert-message-font-size: 14px; --alert-title-font-size: 16px; --alert-title-font-weight: 500; --alert-message-margin-top: 4px; --alert-message-line-height: 1.5; --alert-title-line-height: 1.5;}.var-alert { display: flex; padding: var(--alert-padding); border-radius: var(--alert-border-radius);}.var-alert__icon { margin: var(--alert-icon-margin);}.var-alert__icon .var-icon { font-size: var(--alert-icon-size);}.var-alert__content { flex: 1;}.var-alert__title { font-size: var(--alert-title-font-size); font-weight: var(--alert-title-font-weight); line-height: var(--alert-title-line-height); word-break: normal; word-wrap: break-word;}.var-alert__title + .var-alert__message { margin-top: var(--alert-message-margin-top);}.var-alert__message { font-size: var(--alert-message-font-size); line-height: var(--alert-message-line-height);}.var-alert__close-icon { cursor: pointer; margin: var(--alert-close-icon-margin);}.var-alert__close-icon .var-icon[alert-cover] { font-size: var(--alert-close-icon-size);}.var-alert--outlined { border: thin solid currentColor; background-color: transparent;}.var-alert--outlined.var-alert--info { border-color: var(--alert-info-background); color: var(--alert-info-background);}.var-alert--outlined.var-alert--success { border-color: var(--alert-success-background); color: var(--alert-success-background);}.var-alert--outlined.var-alert--warning { border-color: var(--alert-warning-background); color: var(--alert-warning-background);}.var-alert--outlined.var-alert--danger { border-color: var(--alert-danger-background); color: var(--alert-danger-background);}.var-alert--tonal.var-alert--info { background-color: var(--alert-tonal-info-background); color: var(--alert-tonal-info-text-color);}.var-alert--tonal.var-alert--success { background-color: var(--alert-tonal-success-background); color: var(--alert-tonal-success-text-color);}.var-alert--tonal.var-alert--warning { background-color: var(--alert-tonal-warning-background); color: var(--alert-tonal-warning-text-color);}.var-alert--tonal.var-alert--danger { background-color: var(--alert-tonal-danger-background); color: var(--alert-tonal-danger-text-color);}.var-alert--standard.var-alert--info { background-color: var(--alert-info-background); color: var(--alert-standard-info-text-color);}.var-alert--standard.var-alert--success { background-color: var(--alert-success-background); color: var(--alert-standard-success-text-color);}.var-alert--standard.var-alert--warning { background-color: var(--alert-warning-background); color: var(--alert-standard-warning-text-color);}.var-alert--standard.var-alert--danger { background-color: var(--alert-danger-background); color: var(--alert-standard-danger-text-color);}
1
+ :root { --alert-padding: 16px; --alert-border-radius: 4px; --alert-icon-size: 22px; --alert-icon-margin: 1px 12px 0 0; --alert-close-icon-size: 22px; --alert-close-icon-margin: 1px 0 0 12px; --alert-standard-info-text-color: var(--color-on-info); --alert-standard-danger-text-color: var(--color-on-danger); --alert-standard-success-text-color: var(--color-on-success); --alert-standard-warning-text-color: var(--color-on-warning); --alert-danger-background: var(--color-danger); --alert-success-background: var(--color-success); --alert-warning-background: var(--color-warning); --alert-info-background: var(--color-info); --alert-tonal-danger-background: hsla(var(--hsl-danger), 0.12); --alert-tonal-success-background: hsla(var(--hsl-success), 0.12); --alert-tonal-warning-background: hsla(var(--hsl-warning), 0.12); --alert-tonal-info-background: hsla(var(--hsl-info), 0.12); --alert-tonal-danger-text-color: var(--color-danger); --alert-tonal-success-text-color: var(--color-success); --alert-tonal-warning-text-color: var(--color-warning); --alert-tonal-info-text-color: var(--color-info); --alert-message-font-size: 14px; --alert-title-font-size: 16px; --alert-title-font-weight: 500; --alert-message-margin-top: 4px; --alert-message-line-height: 1.5; --alert-title-line-height: 1.5;}.var-alert { display: flex; padding: var(--alert-padding); border-radius: var(--alert-border-radius);}.var-alert__icon { display: inline-flex; align-items: start; margin: var(--alert-icon-margin); font-size: var(--alert-icon-size);}.var-alert__icon .var-icon { font-size: inherit;}.var-alert__content { flex: 1;}.var-alert__title { font-size: var(--alert-title-font-size); font-weight: var(--alert-title-font-weight); line-height: var(--alert-title-line-height); word-break: normal; word-wrap: break-word;}.var-alert__title + .var-alert__message { margin-top: var(--alert-message-margin-top);}.var-alert__message { font-size: var(--alert-message-font-size); line-height: var(--alert-message-line-height); margin-top: 2px;}.var-alert__close-icon { display: inline-flex; align-items: start; cursor: pointer; margin: var(--alert-close-icon-margin); font-size: var(--alert-close-icon-size);}.var-alert__close-icon .var-icon { font-size: inherit;}.var-alert--outlined { border: thin solid currentColor; background-color: transparent;}.var-alert--outlined.var-alert--info { border-color: var(--alert-info-background); color: var(--alert-info-background);}.var-alert--outlined.var-alert--success { border-color: var(--alert-success-background); color: var(--alert-success-background);}.var-alert--outlined.var-alert--warning { border-color: var(--alert-warning-background); color: var(--alert-warning-background);}.var-alert--outlined.var-alert--danger { border-color: var(--alert-danger-background); color: var(--alert-danger-background);}.var-alert--tonal.var-alert--info { background-color: var(--alert-tonal-info-background); color: var(--alert-tonal-info-text-color);}.var-alert--tonal.var-alert--success { background-color: var(--alert-tonal-success-background); color: var(--alert-tonal-success-text-color);}.var-alert--tonal.var-alert--warning { background-color: var(--alert-tonal-warning-background); color: var(--alert-tonal-warning-text-color);}.var-alert--tonal.var-alert--danger { background-color: var(--alert-tonal-danger-background); color: var(--alert-tonal-danger-text-color);}.var-alert--standard.var-alert--info { background-color: var(--alert-info-background); color: var(--alert-standard-info-text-color);}.var-alert--standard.var-alert--success { background-color: var(--alert-success-background); color: var(--alert-standard-success-text-color);}.var-alert--standard.var-alert--warning { background-color: var(--alert-warning-background); color: var(--alert-standard-warning-text-color);}.var-alert--standard.var-alert--danger { background-color: var(--alert-danger-background); color: var(--alert-standard-danger-text-color);}
@@ -21,7 +21,7 @@ import { createNamespace } from "../utils/components.mjs";
21
21
  import { toSizeUnit } from "../utils/elements.mjs";
22
22
  import { props } from "./props.mjs";
23
23
  const { name, n, classes } = createNamespace("badge");
24
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vShow as _vShow, mergeProps as _mergeProps, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode } from "vue";
24
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, vShow as _vShow, mergeProps as _mergeProps, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx } from "vue";
25
25
  const _hoisted_1 = { key: 0 };
26
26
  function __render__(_ctx, _cache) {
27
27
  const _component_var_icon = _resolveComponent("var-icon");
@@ -45,20 +45,30 @@ function __render__(_ctx, _cache) {
45
45
  _ctx.n(`--${_ctx.type}`),
46
46
  [_ctx.$slots.default, _ctx.n(`--${_ctx.position}`), _ctx.n("--offset")],
47
47
  [_ctx.dot, _ctx.n("--dot")],
48
- [_ctx.icon, _ctx.n("--icon")]
48
+ [_ctx.icon || _ctx.$slots.icon, _ctx.n("--icon")]
49
49
  ),
50
50
  style: __spreadValues({ background: _ctx.color }, _ctx.offsetStyle)
51
51
  }, _ctx.$attrs),
52
52
  [
53
- _ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
54
- key: 0,
55
- class: _normalizeClass(_ctx.n("icon")),
56
- "var-badge-cover": "",
57
- name: _ctx.icon,
58
- namespace: _ctx.namespace
59
- }, null, 8, ["class", "name", "namespace"])) : _createCommentVNode("v-if", true),
53
+ _ctx.$slots.icon || _ctx.icon ? (_openBlock(), _createElementBlock(
54
+ "span",
55
+ {
56
+ key: 0,
57
+ class: _normalizeClass(_ctx.n("icon"))
58
+ },
59
+ [
60
+ _renderSlot(_ctx.$slots, "icon", {}, () => [
61
+ _createVNode(_component_var_icon, {
62
+ name: _ctx.icon,
63
+ namespace: _ctx.namespace
64
+ }, null, 8, ["name", "namespace"])
65
+ ])
66
+ ],
67
+ 2
68
+ /* CLASS */
69
+ )) : _createCommentVNode("v-if", true),
60
70
  _renderSlot(_ctx.$slots, "value", {}, () => [
61
- !_ctx.icon && !_ctx.dot ? (_openBlock(), _createElementBlock(
71
+ !_ctx.$slots.icon && !_ctx.icon && !_ctx.dot ? (_openBlock(), _createElementBlock(
62
72
  "span",
63
73
  _hoisted_1,
64
74
  _toDisplayString(_ctx.value),
@@ -1 +1 @@
1
- :root { --badge-content-padding: 2px 6px; --badge-content-border: none; --badge-content-border-radius: 100px; --badge-content-font-size: 12px; --badge-icon-size: 12px; --badge-default-color: #e0e0e0; --badge-primary-color: var(--color-primary); --badge-danger-color: var(--color-danger); --badge-success-color: var(--color-success); --badge-warning-color: var(--color-warning); --badge-info-color: var(--color-info); --badge-default-text-color: #1d1b20; --badge-primary-text-color: var(--color-on-primary); --badge-danger-text-color: var(--color-on-danger); --badge-success-text-color: var(--color-on-success); --badge-warning-text-color: var(--color-on-warning); --badge-info-text-color: var(--color-on-info); --badge-dot-width: 8px; --badge-dot-height: 8px;}.var-badge { display: inline-flex; align-items: center; position: relative; vertical-align: middle; transition: background-color 0.25s;}.var-badge__content { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: var(--badge-content-padding); border: var(--badge-content-border); border-radius: var(--badge-content-border-radius); font-size: var(--badge-content-font-size); line-height: 1;}.var-badge--offset { transform: translateX(var(--badge-offset-x)) translateY(var(--badge-offset-y));}.var-badge__icon[var-badge-cover] { font-size: var(--badge-icon-size);}.var-badge--icon { padding: 2px 4px;}.var-badge--dot { box-sizing: content-box; width: var(--badge-dot-width); height: var(--badge-dot-height); padding: 0;}.var-badge--default { color: var(--badge-default-text-color); background: var(--badge-default-color);}.var-badge--primary { color: var(--badge-primary-text-color); background: var(--badge-primary-color);}.var-badge--info { color: var(--badge-info-text-color); background: var(--badge-info-color);}.var-badge--warning { color: var(--badge-warning-text-color); background: var(--badge-warning-color);}.var-badge--success { color: var(--badge-success-text-color); background: var(--badge-success-color);}.var-badge--danger { color: var(--badge-danger-text-color); background: var(--badge-danger-color);}.var-badge--right-top { position: absolute; top: 0; right: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-top { position: absolute; top: 0; left: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge--right-bottom { position: absolute; bottom: 0; right: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-bottom { position: absolute; bottom: 0; left: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge-fade-enter-active,.var-badge-fade-leave-active { transition: opacity 0.15s var(--cubic-bezier);}.var-badge-fade-enter-from,.var-badge-fade-leave-to { opacity: 0;}
1
+ :root { --badge-content-padding: 2px 6px; --badge-content-border: none; --badge-content-border-radius: 100px; --badge-content-font-size: 12px; --badge-icon-size: 12px; --badge-default-color: #e0e0e0; --badge-primary-color: var(--color-primary); --badge-danger-color: var(--color-danger); --badge-success-color: var(--color-success); --badge-warning-color: var(--color-warning); --badge-info-color: var(--color-info); --badge-default-text-color: #1d1b20; --badge-primary-text-color: var(--color-on-primary); --badge-danger-text-color: var(--color-on-danger); --badge-success-text-color: var(--color-on-success); --badge-warning-text-color: var(--color-on-warning); --badge-info-text-color: var(--color-on-info); --badge-dot-width: 8px; --badge-dot-height: 8px;}.var-badge { display: inline-flex; align-items: center; position: relative; vertical-align: middle; transition: background-color 0.25s;}.var-badge__content { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: var(--badge-content-padding); border: var(--badge-content-border); border-radius: var(--badge-content-border-radius); font-size: var(--badge-content-font-size); line-height: 1;}.var-badge--offset { transform: translateX(var(--badge-offset-x)) translateY(var(--badge-offset-y));}.var-badge__icon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; font-size: var(--badge-icon-size); line-height: 1;}.var-badge__icon .var-icon { font-size: inherit;}.var-badge--icon { padding: 2px 4px;}.var-badge--dot { box-sizing: content-box; width: var(--badge-dot-width); height: var(--badge-dot-height); padding: 0;}.var-badge--default { color: var(--badge-default-text-color); background: var(--badge-default-color);}.var-badge--primary { color: var(--badge-primary-text-color); background: var(--badge-primary-color);}.var-badge--info { color: var(--badge-info-text-color); background: var(--badge-info-color);}.var-badge--warning { color: var(--badge-warning-text-color); background: var(--badge-warning-color);}.var-badge--success { color: var(--badge-success-text-color); background: var(--badge-success-color);}.var-badge--danger { color: var(--badge-danger-text-color); background: var(--badge-danger-color);}.var-badge--right-top { position: absolute; top: 0; right: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-top { position: absolute; top: 0; left: 0; transform: translateY(calc(-50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge--right-bottom { position: absolute; bottom: 0; right: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(50% + var(--badge-offset-x)));}.var-badge--left-bottom { position: absolute; bottom: 0; left: 0; transform: translateY(calc(50% + var(--badge-offset-y))) translateX(calc(-50% + var(--badge-offset-x)));}.var-badge-fade-enter-active,.var-badge-fade-leave-active { transition: opacity 0.15s var(--cubic-bezier);}.var-badge-fade-enter-from,.var-badge-fade-leave-to { opacity: 0;}
@@ -11,7 +11,7 @@ const defaultBadgeProps = {
11
11
  type: "danger",
12
12
  dot: true
13
13
  };
14
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, withCtx as _withCtx, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
14
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, mergeProps as _mergeProps, withCtx as _withCtx, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives } from "vue";
15
15
  function __render__(_ctx, _cache) {
16
16
  const _component_var_icon = _resolveComponent("var-icon");
17
17
  const _component_var_badge = _resolveComponent("var-badge");
@@ -51,30 +51,44 @@ function __render__(_ctx, _cache) {
51
51
  "var-bottom-navigation-item-cover": ""
52
52
  }), {
53
53
  default: _withCtx(() => [
54
+ _createElementVNode(
55
+ "span",
56
+ {
57
+ class: _normalizeClass(_ctx.n("icon"))
58
+ },
59
+ [
60
+ _renderSlot(_ctx.$slots, "icon", { active: _ctx.isActive }, () => [
61
+ _ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
62
+ key: 0,
63
+ name: _ctx.icon,
64
+ namespace: _ctx.namespace
65
+ }, null, 8, ["name", "namespace"])) : _createCommentVNode("v-if", true)
66
+ ])
67
+ ],
68
+ 2
69
+ /* CLASS */
70
+ )
71
+ ]),
72
+ _: 3
73
+ /* FORWARDED */
74
+ }, 16, ["class"])) : _ctx.$slots.icon || _ctx.icon ? (_openBlock(), _createElementBlock(
75
+ "span",
76
+ {
77
+ key: 1,
78
+ class: _normalizeClass(_ctx.n("icon"))
79
+ },
80
+ [
54
81
  _renderSlot(_ctx.$slots, "icon", { active: _ctx.isActive }, () => [
55
82
  _ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
56
83
  key: 0,
57
84
  name: _ctx.icon,
58
- namespace: _ctx.namespace,
59
- class: _normalizeClass(_ctx.n("icon")),
60
- "var-bottom-navigation-item-cover": ""
61
- }, null, 8, ["name", "namespace", "class"])) : _createCommentVNode("v-if", true)
85
+ namespace: _ctx.namespace
86
+ }, null, 8, ["name", "namespace"])) : _createCommentVNode("v-if", true)
62
87
  ])
63
- ]),
64
- _: 3
65
- /* FORWARDED */
66
- }, 16, ["class"])) : _renderSlot(_ctx.$slots, "icon", {
67
- key: 1,
68
- active: _ctx.isActive
69
- }, () => [
70
- _ctx.icon ? (_openBlock(), _createBlock(_component_var_icon, {
71
- key: 0,
72
- name: _ctx.icon,
73
- namespace: _ctx.namespace,
74
- class: _normalizeClass(_ctx.n("icon")),
75
- "var-bottom-navigation-item-cover": ""
76
- }, null, 8, ["name", "namespace", "class"])) : _createCommentVNode("v-if", true)
77
- ])
88
+ ],
89
+ 2
90
+ /* CLASS */
91
+ )) : _createCommentVNode("v-if", true)
78
92
  ],
79
93
  2
80
94
  /* CLASS */
@@ -1 +1 @@
1
- :root { --bottom-navigation-item-font-size: var(--font-size-sm); --bottom-navigation-item-inactive-color: #646566; --bottom-navigation-item-active-color: var(--color-primary); --bottom-navigation-item-active-background-color: var(--color-surface-container-high); --bottom-navigation-item-variant-active-background-color: var(--color-primary-container); --bottom-navigation-item-variant-active-color: var(--color-on-primary-container); --bottom-navigation-item-line-height: 1; --bottom-navigation-item-icon-size: 22px; --bottom-navigation-item-icon-margin-bottom: 5px; --bottom-navigation-item-variant-icon-margin-bottom: 6px; --bottom-navigation-item-variant-icon-container-height: 30px; --bottom-navigation-item-variant-icon-container-border-radius: 100px; --bottom-navigation-item-variant-icon-container-max-width: 58px;}.var-bottom-navigation-item { height: 100%; padding-bottom: 2px; position: relative; display: inline-flex; flex: 1 1 0%; flex-direction: column; align-items: center; justify-content: center; line-height: var(--bottom-navigation-item-line-height); color: var(--bottom-navigation-item-inactive-color); cursor: pointer; user-select: none; vertical-align: middle; appearance: none; text-decoration: none; background-color: transparent; outline: 0; border: 0; transition: color 250ms, margin 250ms;}.var-bottom-navigation-item--variant-padding { padding-bottom: 6px;}.var-bottom-navigation-item--active { color: var(--bottom-navigation-item-active-color); background-color: var(--bottom-navigation-item-active-background-color); transition: background-color 250ms;}.var-bottom-navigation-item--animated .var-bottom-navigation-item__label { font-size: calc(var(--bottom-navigation-item-font-size) * 1.16);}.var-bottom-navigation-item--variant-icon-container { display: flex; justify-content: center; align-items: center; width: 0; height: var(--bottom-navigation-item-variant-icon-container-height); border-radius: var(--bottom-navigation-item-variant-icon-container-border-radius); max-width: var(--bottom-navigation-item-variant-icon-container-max-width);}.var-bottom-navigation-item--variant-active { color: var(--bottom-navigation-item-variant-active-color); background-color: var(--bottom-navigation-item-variant-active-background-color); width: 100%; transition: background-color 0.25s, width 0.5s;}.var-bottom-navigation-item--right-half-space { margin-right: calc(var(--bottom-navigation-height) / 2);}.var-bottom-navigation-item--left-half-space { margin-left: calc(var(--bottom-navigation-height) / 2);}.var-bottom-navigation-item--right-space { margin-right: calc(var(--bottom-navigation-height) + var(--bottom-navigation-fab-offset));}.var-bottom-navigation-item__icon[var-bottom-navigation-item-cover] { font-size: var(--bottom-navigation-item-icon-size);}.var-bottom-navigation-item__badge[var-bottom-navigation-item-cover] { margin-top: 6px; margin-right: -4px;}.var-bottom-navigation-item__label { margin-top: var(--bottom-navigation-item-icon-margin-bottom); font-size: var(--bottom-navigation-item-font-size); transition: font-size 0.2s ease 0.1s; white-space: nowrap;}.var-bottom-navigation-item--variant-padding .var-bottom-navigation-item__label { margin-top: var(--bottom-navigation-item-variant-icon-margin-bottom);}
1
+ :root { --bottom-navigation-item-font-size: var(--font-size-sm); --bottom-navigation-item-inactive-color: #646566; --bottom-navigation-item-active-color: var(--color-primary); --bottom-navigation-item-active-background-color: var(--color-surface-container-high); --bottom-navigation-item-variant-active-background-color: var(--color-primary-container); --bottom-navigation-item-variant-active-color: var(--color-on-primary-container); --bottom-navigation-item-line-height: 1; --bottom-navigation-item-icon-size: 22px; --bottom-navigation-item-icon-margin-bottom: 5px; --bottom-navigation-item-variant-icon-margin-bottom: 6px; --bottom-navigation-item-variant-icon-container-height: 30px; --bottom-navigation-item-variant-icon-container-border-radius: 100px; --bottom-navigation-item-variant-icon-container-max-width: 58px;}.var-bottom-navigation-item { height: 100%; padding-bottom: 2px; position: relative; display: inline-flex; flex: 1 1 0%; flex-direction: column; align-items: center; justify-content: center; line-height: var(--bottom-navigation-item-line-height); color: var(--bottom-navigation-item-inactive-color); cursor: pointer; user-select: none; vertical-align: middle; appearance: none; text-decoration: none; background-color: transparent; outline: 0; border: 0; transition: color 250ms, margin 250ms;}.var-bottom-navigation-item--variant-padding { padding-bottom: 6px;}.var-bottom-navigation-item--active { color: var(--bottom-navigation-item-active-color); background-color: var(--bottom-navigation-item-active-background-color); transition: background-color 250ms;}.var-bottom-navigation-item--animated .var-bottom-navigation-item__label { font-size: calc(var(--bottom-navigation-item-font-size) * 1.16);}.var-bottom-navigation-item--variant-icon-container { display: flex; justify-content: center; align-items: center; width: 0; height: var(--bottom-navigation-item-variant-icon-container-height); border-radius: var(--bottom-navigation-item-variant-icon-container-border-radius); max-width: var(--bottom-navigation-item-variant-icon-container-max-width);}.var-bottom-navigation-item--variant-active { color: var(--bottom-navigation-item-variant-active-color); background-color: var(--bottom-navigation-item-variant-active-background-color); width: 100%; transition: background-color 0.25s, width 0.5s;}.var-bottom-navigation-item--right-half-space { margin-right: calc(var(--bottom-navigation-height) / 2);}.var-bottom-navigation-item--left-half-space { margin-left: calc(var(--bottom-navigation-height) / 2);}.var-bottom-navigation-item--right-space { margin-right: calc(var(--bottom-navigation-height) + var(--bottom-navigation-fab-offset));}.var-bottom-navigation-item__icon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; font-size: var(--bottom-navigation-item-icon-size); line-height: 1;}.var-bottom-navigation-item__icon .var-icon { font-size: inherit;}.var-bottom-navigation-item__badge[var-bottom-navigation-item-cover] { margin-top: 6px; margin-right: -4px;}.var-bottom-navigation-item__label { margin-top: var(--bottom-navigation-item-icon-margin-bottom); font-size: var(--bottom-navigation-item-font-size); transition: font-size 0.2s ease 0.1s; white-space: nowrap;}.var-bottom-navigation-item--variant-padding .var-bottom-navigation-item__label { margin-top: var(--bottom-navigation-item-variant-icon-margin-bottom);}
@@ -1,3 +1,23 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
1
21
  import { call, preventDefault } from "@varlet/shared";
2
22
  import { useEventListener, useVModel } from "@varlet/use";
3
23
  import { computed, defineComponent, nextTick, ref } from "vue";
@@ -8,10 +28,11 @@ import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
8
28
  import VarIcon from "../icon/index.mjs";
9
29
  import Ripple from "../ripple/index.mjs";
10
30
  import { createNamespace, useValidation } from "../utils/components.mjs";
31
+ import { toSizeUnit } from "../utils/elements.mjs";
11
32
  import { props } from "./props.mjs";
12
33
  import { useCheckboxGroup } from "./provide.mjs";
13
34
  const { name, n, classes } = createNamespace("checkbox");
14
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode } from "vue";
35
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementVNode as _createElementVNode } from "vue";
15
36
  const _hoisted_1 = ["aria-checked", "aria-disabled", "tabindex"];
16
37
  function __render__(_ctx, _cache) {
17
38
  const _component_var_icon = _resolveComponent("var-icon");
@@ -50,30 +71,51 @@ function __render__(_ctx, _cache) {
50
71
  style: _normalizeStyle({ color: _ctx.checked || _ctx.isIndeterminate ? _ctx.checkedColor : _ctx.uncheckedColor })
51
72
  },
52
73
  [
53
- _ctx.isIndeterminate ? _renderSlot(_ctx.$slots, "indeterminate-icon", { key: 0 }, () => [
54
- _createVNode(_component_var_icon, {
74
+ _ctx.isIndeterminate ? (_openBlock(), _createElementBlock(
75
+ "span",
76
+ {
77
+ key: 0,
55
78
  class: _normalizeClass(_ctx.n("icon")),
56
- name: "minus-box",
57
- size: _ctx.iconSize,
58
- "var-checkbox-cover": ""
59
- }, null, 8, ["class", "size"])
60
- ]) : _createCommentVNode("v-if", true),
61
- _ctx.checked && !_ctx.isIndeterminate ? _renderSlot(_ctx.$slots, "checked-icon", { key: 1 }, () => [
62
- _createVNode(_component_var_icon, {
79
+ style: _normalizeStyle({ fontSize: _ctx.toSizeUnit(_ctx.iconSize) })
80
+ },
81
+ [
82
+ _renderSlot(_ctx.$slots, "indeterminate-icon", {}, () => [
83
+ _createVNode(_component_var_icon, { name: "minus-box" })
84
+ ])
85
+ ],
86
+ 6
87
+ /* CLASS, STYLE */
88
+ )) : _createCommentVNode("v-if", true),
89
+ _ctx.checked && !_ctx.isIndeterminate ? (_openBlock(), _createElementBlock(
90
+ "span",
91
+ {
92
+ key: 1,
63
93
  class: _normalizeClass(_ctx.n("icon")),
64
- name: "checkbox-marked",
65
- size: _ctx.iconSize,
66
- "var-checkbox-cover": ""
67
- }, null, 8, ["class", "size"])
68
- ]) : _createCommentVNode("v-if", true),
69
- !_ctx.checked && !_ctx.isIndeterminate ? _renderSlot(_ctx.$slots, "unchecked-icon", { key: 2 }, () => [
70
- _createVNode(_component_var_icon, {
94
+ style: _normalizeStyle({ fontSize: _ctx.toSizeUnit(_ctx.iconSize) })
95
+ },
96
+ [
97
+ _renderSlot(_ctx.$slots, "checked-icon", {}, () => [
98
+ _createVNode(_component_var_icon, { name: "checkbox-marked" })
99
+ ])
100
+ ],
101
+ 6
102
+ /* CLASS, STYLE */
103
+ )) : _createCommentVNode("v-if", true),
104
+ !_ctx.checked && !_ctx.isIndeterminate ? (_openBlock(), _createElementBlock(
105
+ "span",
106
+ {
107
+ key: 2,
71
108
  class: _normalizeClass(_ctx.n("icon")),
72
- name: "checkbox-blank-outline",
73
- size: _ctx.iconSize,
74
- "var-checkbox-cover": ""
75
- }, null, 8, ["class", "size"])
76
- ]) : _createCommentVNode("v-if", true),
109
+ style: _normalizeStyle({ fontSize: _ctx.toSizeUnit(_ctx.iconSize) })
110
+ },
111
+ [
112
+ _renderSlot(_ctx.$slots, "unchecked-icon", {}, () => [
113
+ _createVNode(_component_var_icon, { name: "checkbox-blank-outline" })
114
+ ])
115
+ ],
116
+ 6
117
+ /* CLASS, STYLE */
118
+ )) : _createCommentVNode("v-if", true),
77
119
  _createVNode(_component_var_hover_overlay, {
78
120
  hovering: !_ctx.disabled && !_ctx.formDisabled && _ctx.hovering,
79
121
  focusing: !_ctx.disabled && !_ctx.formDisabled && _ctx.isFocusing
@@ -156,32 +198,38 @@ const __sfc__ = defineComponent({
156
198
  });
157
199
  }
158
200
  function change(changedValue) {
159
- const { checkedValue: checkedValue2, onChange } = props2;
160
- value.value = changedValue;
161
- call(onChange, value.value, isIndeterminate.value);
162
- validateWithTrigger("onChange");
163
- changedValue === checkedValue2 ? checkboxGroup == null ? void 0 : checkboxGroup.onChecked(checkedValue2) : checkboxGroup == null ? void 0 : checkboxGroup.onUnchecked(checkedValue2);
201
+ return __async(this, null, function* () {
202
+ const { checkedValue: checkedValue2, onChange } = props2;
203
+ value.value = changedValue;
204
+ changedValue === checkedValue2 ? checkboxGroup == null ? void 0 : checkboxGroup.onChecked(checkedValue2) : checkboxGroup == null ? void 0 : checkboxGroup.onUnchecked(checkedValue2);
205
+ yield nextTick();
206
+ call(onChange, changedValue, isIndeterminate.value);
207
+ validateWithTrigger("onChange");
208
+ });
164
209
  }
165
210
  function handleClick(e) {
166
- const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
167
- if ((form == null ? void 0 : form.disabled.value) || disabled) {
168
- return;
169
- }
170
- call(onClick, e);
171
- if ((form == null ? void 0 : form.readonly.value) || readonly) {
172
- return;
173
- }
174
- if (isIndeterminate.value === true) {
175
- isIndeterminate.value = false;
176
- call(props2.onChange, value.value, isIndeterminate.value);
177
- validateWithTrigger("onChange");
178
- return;
179
- }
180
- const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
181
- if (!checked.value && maximum) {
182
- return;
183
- }
184
- change(checked.value ? uncheckedValue : checkedValue2);
211
+ return __async(this, null, function* () {
212
+ const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
213
+ if ((form == null ? void 0 : form.disabled.value) || disabled) {
214
+ return;
215
+ }
216
+ call(onClick, e);
217
+ if ((form == null ? void 0 : form.readonly.value) || readonly) {
218
+ return;
219
+ }
220
+ if (isIndeterminate.value === true) {
221
+ isIndeterminate.value = false;
222
+ yield nextTick();
223
+ call(props2.onChange, value.value, isIndeterminate.value);
224
+ validateWithTrigger("onChange");
225
+ return;
226
+ }
227
+ const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
228
+ if (!checked.value && maximum) {
229
+ return;
230
+ }
231
+ change(checked.value ? uncheckedValue : checkedValue2);
232
+ });
185
233
  }
186
234
  function handleTextClick() {
187
235
  checkbox.value.focus();
@@ -241,6 +289,7 @@ const __sfc__ = defineComponent({
241
289
  handleHovering,
242
290
  handleClick,
243
291
  handleTextClick,
292
+ toSizeUnit,
244
293
  toggle,
245
294
  reset,
246
295
  validate,
@@ -1 +1 @@
1
- :root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-text-color: #555; --checkbox-icon-size: 24px;}.var-checkbox { display: flex; align-items: center; outline: none; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: transparent;}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { position: relative; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding: var(--checkbox-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-checkbox__icon[var-checkbox-cover] { display: block; font-size: var(--checkbox-icon-size);}.var-checkbox__text { color: var(--checkbox-text-color);}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color); cursor: not-allowed;}.var-checkbox--error { color: var(--checkbox-error-color);}
1
+ :root { --checkbox-checked-color: var(--color-primary); --checkbox-unchecked-color: #555; --checkbox-disabled-color: var(--color-text-disabled); --checkbox-error-color: var(--color-danger); --checkbox-action-padding: 6px; --checkbox-text-color: #555; --checkbox-icon-size: 24px;}.var-checkbox { display: flex; align-items: center; outline: none; transform: translateX(calc(-1 * var(--checkbox-action-padding))); cursor: pointer; -webkit-tap-highlight-color: transparent;}.var-checkbox__wrap { display: inline-flex; flex-direction: column;}.var-checkbox__action { position: relative; display: flex; justify-content: center; align-items: center; flex-shrink: 0; padding: var(--checkbox-action-padding); border-radius: 50%; transition: background-color 0.25s, color 0.25s;}.var-checkbox__icon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; font-size: var(--checkbox-icon-size); line-height: 1;}.var-checkbox__icon .var-icon { font-size: inherit;}.var-checkbox__text { color: var(--checkbox-text-color);}.var-checkbox--checked { color: var(--checkbox-checked-color);}.var-checkbox--unchecked { color: var(--checkbox-unchecked-color);}.var-checkbox--disabled { color: var(--checkbox-disabled-color); cursor: not-allowed;}.var-checkbox--error { color: var(--checkbox-error-color);}
package/es/chip/Chip.mjs CHANGED
@@ -39,10 +39,12 @@ function __render__(_ctx, _cache) {
39
39
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClose && _ctx.handleClose(...args))
40
40
  },
41
41
  [
42
- _createVNode(_component_var_icon, {
43
- name: `${_ctx.iconName ? _ctx.iconName : "close-circle"}`,
44
- namespace: _ctx.namespace
45
- }, null, 8, ["name", "namespace"])
42
+ _renderSlot(_ctx.$slots, "icon", {}, () => [
43
+ _createVNode(_component_var_icon, {
44
+ name: _ctx.closeIconName,
45
+ namespace: _ctx.namespace
46
+ }, null, 8, ["name", "namespace"])
47
+ ])
46
48
  ],
47
49
  2
48
50
  /* CLASS */
@@ -84,12 +86,17 @@ const __sfc__ = defineComponent({
84
86
  const roundClass = round ? n("--round") : null;
85
87
  return [n(`--${size}`), blockClass, plainTypeClass, roundClass];
86
88
  });
89
+ const closeIconName = computed(() => {
90
+ var _a, _b;
91
+ return (_b = (_a = props2.icon) != null ? _a : props2.iconName) != null ? _b : "close-circle";
92
+ });
87
93
  function handleClose(e) {
88
94
  call(props2.onClose, e);
89
95
  }
90
96
  return {
91
97
  chipStyle,
92
98
  contentClass,
99
+ closeIconName,
93
100
  n,
94
101
  classes,
95
102
  formatElevation,
package/es/chip/chip.css CHANGED
@@ -1 +1 @@
1
- :root { --chip-default-text-color: #555; --chip-primary-text-color: var(--color-on-primary-container); --chip-danger-text-color: var(--color-on-danger-container); --chip-success-text-color: var(--color-on-success-container); --chip-warning-text-color: var(--color-on-warning-container); --chip-info-text-color: var(--color-on-info-container); --chip-default-color: #e0e0e0; --chip-primary-color: var(--color-primary-container); --chip-danger-color: var(--color-danger-container); --chip-success-color: var(--color-success-container); --chip-warning-color: var(--color-warning-container); --chip-info-color: var(--color-info-container); --chip-primary-plain-color: var(--color-primary); --chip-danger-plain-color: var(--color-danger); --chip-success-plain-color: var(--color-success); --chip-warning-plain-color: var(--color-warning); --chip-info-plain-color: var(--color-info); --chip-border-radius: 2px; --chip-normal-height: 32px; --chip-large-height: 40px; --chip-small-height: 24px; --chip-mini-height: 16px; --chip-round-radius: 100px; --chip-normal-padding: 0 10px; --chip-large-padding: 0 17px; --chip-small-padding: 0 6px; --chip-mini-padding: 0 4px; --chip-text-normal-margin: 0 5px; --chip-text-large-margin: 0 5px; --chip-text-small-margin: 0 3px; --chip-text-mini-margin: 0 2px; --chip-mini-font-size: var(--font-size-xs); --chip-small-font-size: var(--font-size-sm); --chip-normal-font-size: var(--font-size-md); --chip-large-font-size: var(--font-size-lg);}.var-fade-leave-to { opacity: 0;}.var-fade-leave-active { transition: opacity 0.3s;}.var-chip { justify-content: center; align-items: center; font-family: Roboto, sans-serif; border-radius: var(--chip-border-radius); cursor: default; border: thin solid transparent; vertical-align: middle; transition: background-color 0.25s, border-radius 0.25s;}.var-chip--default { color: var(--chip-default-text-color); background: var(--chip-default-color);}.var-chip--primary { color: var(--chip-primary-text-color); background-color: var(--chip-primary-color);}.var-chip--info { color: var(--chip-info-text-color); background-color: var(--chip-info-color);}.var-chip--success { color: var(--chip-success-text-color); background-color: var(--chip-success-color);}.var-chip--warning { color: var(--chip-warning-text-color); background-color: var(--chip-warning-color);}.var-chip--danger { color: var(--chip-danger-text-color); background-color: var(--chip-danger-color);}.var-chip__plain { background-color: transparent;}.var-chip__plain:active { box-shadow: none;}.var-chip__plain-default { color: inherit; border-color: currentColor;}.var-chip__plain-primary { color: var(--chip-primary-plain-color); border-color: currentColor;}.var-chip__plain-info { color: var(--chip-info-plain-color); border-color: currentColor;}.var-chip__plain-success { color: var(--chip-success-plain-color); border-color: currentColor;}.var-chip__plain-warning { color: var(--chip-warning-plain-color); border-color: currentColor;}.var-chip__plain-danger { color: var(--chip-danger-plain-color); border-color: currentColor;}.var-chip--round { border-radius: var(--chip-round-radius);}.var-chip--normal { font-size: var(--chip-normal-font-size); padding: var(--chip-normal-padding); height: var(--chip-normal-height);}.var-chip--large { padding: var(--chip-large-padding); font-size: var(--chip-large-font-size); height: var(--chip-large-height);}.var-chip--small { padding: var(--chip-small-padding); font-size: var(--chip-small-font-size); height: var(--chip-small-height);}.var-chip--mini { padding: var(--chip-mini-padding); font-size: var(--chip-mini-font-size); height: var(--chip-mini-height);}.var-chip--close { cursor: pointer; -webkit-tap-highlight-color: transparent;}.var-chip__text-large { margin: var(--chip-text-large-margin);}.var-chip__text-normal { margin: var(--chip-text-normal-margin);}.var-chip__text-small { margin: var(--chip-text-small-margin);}.var-chip__text-mini { margin: var(--chip-text-mini-margin);}
1
+ :root { --chip-default-text-color: #555; --chip-primary-text-color: var(--color-on-primary-container); --chip-danger-text-color: var(--color-on-danger-container); --chip-success-text-color: var(--color-on-success-container); --chip-warning-text-color: var(--color-on-warning-container); --chip-info-text-color: var(--color-on-info-container); --chip-default-color: #e0e0e0; --chip-primary-color: var(--color-primary-container); --chip-danger-color: var(--color-danger-container); --chip-success-color: var(--color-success-container); --chip-warning-color: var(--color-warning-container); --chip-info-color: var(--color-info-container); --chip-primary-plain-color: var(--color-primary); --chip-danger-plain-color: var(--color-danger); --chip-success-plain-color: var(--color-success); --chip-warning-plain-color: var(--color-warning); --chip-info-plain-color: var(--color-info); --chip-border-radius: 2px; --chip-normal-height: 32px; --chip-large-height: 40px; --chip-small-height: 24px; --chip-mini-height: 16px; --chip-round-radius: 100px; --chip-normal-padding: 0 10px; --chip-large-padding: 0 17px; --chip-small-padding: 0 6px; --chip-mini-padding: 0 4px; --chip-text-normal-margin: 0 5px; --chip-text-large-margin: 0 5px; --chip-text-small-margin: 0 3px; --chip-text-mini-margin: 0 2px; --chip-mini-font-size: var(--font-size-xs); --chip-small-font-size: var(--font-size-sm); --chip-normal-font-size: var(--font-size-md); --chip-large-font-size: var(--font-size-lg);}.var-fade-leave-to { opacity: 0;}.var-fade-leave-active { transition: opacity 0.3s;}.var-chip { justify-content: center; align-items: center; font-family: Roboto, sans-serif; border-radius: var(--chip-border-radius); cursor: default; border: thin solid transparent; vertical-align: middle; transition: background-color 0.25s, border-radius 0.25s;}.var-chip--default { color: var(--chip-default-text-color); background: var(--chip-default-color);}.var-chip--primary { color: var(--chip-primary-text-color); background-color: var(--chip-primary-color);}.var-chip--info { color: var(--chip-info-text-color); background-color: var(--chip-info-color);}.var-chip--success { color: var(--chip-success-text-color); background-color: var(--chip-success-color);}.var-chip--warning { color: var(--chip-warning-text-color); background-color: var(--chip-warning-color);}.var-chip--danger { color: var(--chip-danger-text-color); background-color: var(--chip-danger-color);}.var-chip__plain { background-color: transparent;}.var-chip__plain:active { box-shadow: none;}.var-chip__plain-default { color: inherit; border-color: currentColor;}.var-chip__plain-primary { color: var(--chip-primary-plain-color); border-color: currentColor;}.var-chip__plain-info { color: var(--chip-info-plain-color); border-color: currentColor;}.var-chip__plain-success { color: var(--chip-success-plain-color); border-color: currentColor;}.var-chip__plain-warning { color: var(--chip-warning-plain-color); border-color: currentColor;}.var-chip__plain-danger { color: var(--chip-danger-plain-color); border-color: currentColor;}.var-chip--round { border-radius: var(--chip-round-radius);}.var-chip--normal { font-size: var(--chip-normal-font-size); padding: var(--chip-normal-padding); height: var(--chip-normal-height);}.var-chip--large { padding: var(--chip-large-padding); font-size: var(--chip-large-font-size); height: var(--chip-large-height);}.var-chip--small { padding: var(--chip-small-padding); font-size: var(--chip-small-font-size); height: var(--chip-small-height);}.var-chip--mini { padding: var(--chip-mini-padding); font-size: var(--chip-mini-font-size); height: var(--chip-mini-height);}.var-chip--close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: inherit; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent;}.var-chip--close .var-icon { font-size: inherit;}.var-chip__text-large { margin: var(--chip-text-large-margin);}.var-chip__text-normal { margin: var(--chip-text-normal-margin);}.var-chip__text-small { margin: var(--chip-text-small-margin);}.var-chip__text-mini { margin: var(--chip-text-mini-margin);}
package/es/chip/props.mjs CHANGED
@@ -11,6 +11,10 @@ const props = {
11
11
  },
12
12
  color: String,
13
13
  textColor: String,
14
+ icon: pickProps(iconProps, "name"),
15
+ /**
16
+ * @deprecated use icon instead
17
+ */
14
18
  iconName: pickProps(iconProps, "name"),
15
19
  namespace: pickProps(iconProps, "namespace"),
16
20
  plain: Boolean,