kui-vue 3.6.0 → 3.6.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.
Files changed (141) hide show
  1. package/{readme.md → README.md} +4 -10
  2. package/components/button/demo/group.md +1 -1
  3. package/components/button/demo/size.md +1 -1
  4. package/components/card/card.jsx +1 -1
  5. package/components/checkbox/checkbox.jsx +17 -16
  6. package/components/checkbox/checkboxGroup.jsx +5 -5
  7. package/components/checkbox/demo/group.md +17 -6
  8. package/components/checkbox/styles/index.less +4 -11
  9. package/components/collapse/collapse.jsx +9 -10
  10. package/components/collapse/demo/accordion.md +2 -2
  11. package/components/collapse/demo/basic.md +2 -2
  12. package/components/collapse/demo/extra.md +2 -2
  13. package/components/collapse/demo/nesting.md +4 -4
  14. package/components/collapse/demo/sample.md +2 -2
  15. package/components/collapse/index.md +6 -6
  16. package/components/colorPicker/colorpicker.jsx +5 -6
  17. package/components/colorPicker/demo/basic.md +14 -2
  18. package/components/colorPicker/demo/customTrigger.md +2 -2
  19. package/components/colorPicker/demo/index.jsx +0 -8
  20. package/components/colorPicker/demo/size.md +24 -10
  21. package/components/datePicker/datepicker.jsx +19 -11
  22. package/components/datePicker/demo/basic.md +15 -6
  23. package/components/datePicker/demo/lang.md +2 -2
  24. package/components/datePicker/demo/size.md +1 -1
  25. package/components/drawer/drawer.jsx +2 -2
  26. package/components/dropdown/dropdown.jsx +9 -40
  27. package/components/dropdown/dropdownButton.jsx +18 -7
  28. package/components/empty/demo/basic.md +1 -3
  29. package/components/empty/demo/nodesc.md +1 -3
  30. package/components/empty/demo/used.md +4 -6
  31. package/components/empty/empty.jsx +19 -17
  32. package/components/empty/styles/index.less +18 -5
  33. package/components/form/demo/align.md +10 -10
  34. package/components/form/demo/valid.md +3 -2
  35. package/components/form/form.jsx +1 -1
  36. package/components/form/formitem.jsx +1 -1
  37. package/components/image/image.jsx +1 -0
  38. package/components/image/preview.jsx +1 -1
  39. package/components/input/demo/basic.md +1 -1
  40. package/components/input/demo/group.md +1 -1
  41. package/components/input/index.md +1 -1
  42. package/components/input/input.jsx +7 -5
  43. package/components/input/inputBox.jsx +2 -2
  44. package/components/inputNumber/demo/basic.md +12 -5
  45. package/components/inputNumber/demo/format.md +0 -5
  46. package/components/inputNumber/index.md +1 -1
  47. package/components/inputNumber/inputNumber.jsx +3 -5
  48. package/components/inputNumber/styles/index.less +64 -64
  49. package/components/menu/submenu.jsx +5 -5
  50. package/components/message/demo/close.md +1 -1
  51. package/components/message/group.jsx +2 -2
  52. package/components/message/index.md +1 -1
  53. package/components/message/inner.jsx +26 -7
  54. package/components/notice/demo/close.md +1 -1
  55. package/components/notice/index.md +1 -1
  56. package/components/page/page.jsx +0 -1
  57. package/components/page/styles/index.less +7 -1
  58. package/components/popconfirm/popconfirm.jsx +18 -20
  59. package/components/poptip/poptip.jsx +4 -4
  60. package/components/progress/progress.jsx +1 -1
  61. package/components/radio/demo/group.md +16 -6
  62. package/components/radio/demo/radioButton.md +3 -8
  63. package/components/radio/radio.jsx +14 -11
  64. package/components/radio/radioButton.jsx +1 -1
  65. package/components/radio/radioGroup.jsx +9 -12
  66. package/components/radio/styles/index.less +10 -21
  67. package/components/rate/demo/basic.md +12 -2
  68. package/components/rate/demo/character.md +16 -2
  69. package/components/rate/demo/index.jsx +0 -8
  70. package/components/rate/demo/tips.md +15 -5
  71. package/components/rate/rate.jsx +24 -5
  72. package/components/select/demo/basic.md +16 -7
  73. package/components/select/demo/filterable.md +4 -2
  74. package/components/select/demo/size.md +1 -1
  75. package/components/select/index.md +23 -22
  76. package/components/select/option.jsx +7 -3
  77. package/components/select/select.jsx +43 -37
  78. package/components/select/styles/index.less +1 -0
  79. package/components/slider/demo/basic.md +2 -1
  80. package/components/slider/demo/withNumber.md +3 -3
  81. package/components/slider/slider.jsx +0 -25
  82. package/components/space/styles/index.less +5 -1
  83. package/components/spin/index.md +6 -5
  84. package/components/styles/sys.less +3 -0
  85. package/components/switch/switch.jsx +13 -5
  86. package/components/table/demo/size.md +1 -1
  87. package/components/table/styles/index.less +10 -5
  88. package/components/table/table.jsx +98 -69
  89. package/components/tabs/tabs.jsx +1 -1
  90. package/components/tooltip/tooltip.jsx +16 -11
  91. package/components/treeselect/demo/basic.md +11 -8
  92. package/components/treeselect/demo/size.md +6 -5
  93. package/components/treeselect/demo/theme.md +0 -1
  94. package/components/treeselect/treeselect.jsx +15 -20
  95. package/components/upload/upload.jsx +0 -1
  96. package/components/utils/placement.js +162 -124
  97. package/dist/k-ui.cjs.js +2 -2
  98. package/dist/k-ui.css +2 -2
  99. package/dist/k-ui.d.ts +131 -127
  100. package/dist/k-ui.esm.js +2 -2
  101. package/dist/k-ui.umd.js +2 -2
  102. package/dist/locale/de.js +1 -1
  103. package/dist/locale/el.js +1 -1
  104. package/dist/locale/en.js +1 -1
  105. package/dist/locale/fr.js +1 -1
  106. package/dist/locale/it.js +1 -1
  107. package/dist/locale/ja.js +1 -1
  108. package/dist/locale/ko.js +1 -1
  109. package/dist/locale/ru.js +1 -1
  110. package/dist/locale/th.js +1 -1
  111. package/dist/locale/ua.js +2 -2
  112. package/dist/locale/uk.js +1 -1
  113. package/dist/locale/vi.js +1 -1
  114. package/dist/locale/zh-CN.js +1 -1
  115. package/dist/locale/zh-TW.js +1 -1
  116. package/package.json +5 -5
  117. package/test/i18n@8.x.html +6 -2
  118. package/types/checkbox/Checkbox.d.ts +1 -1
  119. package/types/collapse/Collapse.d.ts +1 -1
  120. package/types/image/KImage.d.ts +1 -0
  121. package/types/index.d.ts +12 -12
  122. package/types/popconfirm/Popconfirm.d.ts +1 -0
  123. package/types/radio/Radio.d.ts +1 -1
  124. package/types/radio/RadioButton.d.ts +1 -1
  125. package/types/switch/Switch.d.ts +2 -1
  126. package/types/tooltip/Tooltip.d.ts +1 -0
  127. package/components/base/collapse.jsx +0 -15
  128. package/components/base/input.jsx +0 -210
  129. package/components/colorPicker/demo/disabled.md +0 -16
  130. package/components/colorPicker/demo/disabledAlpha.md +0 -13
  131. package/components/colorPicker/demo/mode.md +0 -24
  132. package/components/colorPicker/demo/presets.md +0 -17
  133. package/components/rate/demo/clear.md +0 -13
  134. package/components/rate/demo/custom.md +0 -23
  135. package/components/rate/demo/disabled.md +0 -12
  136. package/components/rate/demo/half.md +0 -12
  137. package/components/steps/index.js +0 -4
  138. package/components/steps/step.vue +0 -82
  139. package/components/steps/steps.vue +0 -68
  140. package/components/steps/styles/index.less +0 -198
  141. package/components/utils/element.js +0 -122
@@ -32,79 +32,79 @@
32
32
  .k-input-number-clearable-hidden {
33
33
  visibility: hidden;
34
34
  }
35
+ }
35
36
 
36
- .k-input-number-controls {
37
- transition: all 0.15s ease-in-out;
38
- user-select: none;
39
- // position: absolute;
40
- // right: 0;
41
- // top: 0;
42
- // width: 20px;
43
- display: flex;
44
- flex-direction: column;
45
- color: var(--kui-color-icon);
46
- border-left: 1px solid var(--kui-color-border);
47
- background-color: var(--kui-color-back);
48
- font-size: 11px;
49
- justify-content: center;
50
- align-items: center;
51
- height: 30px;
52
- opacity: 0;
53
- width: 0;
54
- overflow: hidden;
55
- }
37
+ .k-input-number-controls {
38
+ transition: all 0.15s ease-in-out;
39
+ user-select: none;
40
+ // position: absolute;
41
+ // right: 0;
42
+ // top: 0;
43
+ // width: 20px;
44
+ display: flex;
45
+ flex-direction: column;
46
+ color: var(--kui-color-icon);
47
+ border-left: 1px solid var(--kui-color-border);
48
+ background-color: var(--kui-color-back);
49
+ font-size: 11px;
50
+ justify-content: center;
51
+ align-items: center;
52
+ height: 30px;
53
+ opacity: 0;
54
+ width: 0;
55
+ overflow: hidden;
56
+ }
56
57
 
57
- .k-input-number-control {
58
- flex: 1;
59
- display: flex;
60
- width: 100%;
61
- align-items: center;
62
- justify-content: center;
63
- cursor: pointer;
64
-
65
- &:hover {
66
- color: var(--kui-color-main);
67
- background-color: var(--kui-color-hover);
68
- }
58
+ .k-input-number-control {
59
+ flex: 1;
60
+ display: flex;
61
+ width: 100%;
62
+ align-items: center;
63
+ justify-content: center;
64
+ cursor: pointer;
69
65
 
70
- &:active {
71
- color: var(--kui-color-main);
72
- background-color: var(--kui-color-active);
73
- }
66
+ &:hover {
67
+ color: var(--kui-color-main);
68
+ background-color: var(--kui-color-hover);
69
+ }
74
70
 
75
- &:first-child {
76
- border-radius: 0 @radius 0 0;
77
- }
71
+ &:active {
72
+ color: var(--kui-color-main);
73
+ background-color: var(--kui-color-active);
74
+ }
78
75
 
79
- &:last-child {
80
- border-top: 1px solid var(--kui-color-border);
81
- border-radius: 0 0 @radius 0;
76
+ &:first-child {
77
+ border-radius: 0 @radius 0 0;
78
+ }
82
79
 
83
- .k-icon {
84
- transform: rotate(180deg);
85
- }
80
+ &:last-child {
81
+ border-top: 1px solid var(--kui-color-border);
82
+ border-radius: 0 0 @radius 0;
83
+
84
+ .k-icon {
85
+ transform: rotate(180deg);
86
86
  }
87
87
  }
88
+ }
88
89
 
89
- .k-input-number-text {
90
- padding-left: 0;
91
- border: none;
92
- height: 30px;
93
- line-height: 1.5;
94
- padding: 4px 0;
95
- font-size: 14px;
96
- color: var(--kui-color-font);
97
- background-color: transparent;
98
- background-image: none;
99
- box-sizing: border-box;
100
- flex: 1;
101
- min-width: 10px;
102
- line-height: 1.571;
103
-
104
- &:focus {
105
- // border-color: var(--kui-color-main);
106
- outline: none;
107
- }
90
+ .k-input-number-text {
91
+ padding-left: 0;
92
+ border: none;
93
+ height: 30px;
94
+ line-height: 1.5;
95
+ padding: 4px 0;
96
+ font-size: 14px;
97
+ color: var(--kui-color-font);
98
+ background-color: transparent;
99
+ background-image: none;
100
+ box-sizing: border-box;
101
+ flex: 1;
102
+ min-width: 10px;
103
+ line-height: 1.571;
104
+
105
+ &:focus {
106
+ // border-color: var(--kui-color-main);
107
+ outline: none;
108
108
  }
109
109
  }
110
110
  .k-input-number-focus {
@@ -27,7 +27,7 @@ const SubMenu = defineComponent({
27
27
  icon: [String, Array],
28
28
  },
29
29
  setup(ps, { slots, attrs }) {
30
- const refCtx = ref();
30
+ const refSelection = ref(null);
31
31
  const refPopper = ref();
32
32
  const top = ref(0);
33
33
  const left = ref(0);
@@ -54,7 +54,7 @@ const SubMenu = defineComponent({
54
54
 
55
55
  onMounted(() => {
56
56
  nextTick(() => {
57
- const width = refCtx.value?.offsetWidth;
57
+ const width = refSelection.value?.offsetWidth;
58
58
  minWidth.value = `${width}px`;
59
59
 
60
60
  if (openKeys.value.indexOf(key) >= 0) {
@@ -103,7 +103,7 @@ const SubMenu = defineComponent({
103
103
  }
104
104
  nextTick(() => {
105
105
  setPlacement({
106
- refCtx,
106
+ refSelection,
107
107
  refPopper,
108
108
  currentPlacement,
109
109
  transOrigin,
@@ -178,7 +178,7 @@ const SubMenu = defineComponent({
178
178
  const renderSubmenu = () => {
179
179
  const inline = mode.value != "horizontal";
180
180
  const opened = openKeys.value.indexOf(key) >= 0;
181
- // todo: mode 从inline 切换 vertical 时 会卡一下, 为查明原因. 后面在细看
181
+ // todo: mode 从inline 切换 vertical 时 会卡一下
182
182
 
183
183
  if (inline) {
184
184
  const transitionProps = getTransitionProp("k-collapse-slide");
@@ -223,7 +223,7 @@ const SubMenu = defineComponent({
223
223
  inlineCollapsed.value
224
224
  ) {
225
225
  // popper
226
- titleProps.ref = refCtx;
226
+ titleProps.ref = refSelection;
227
227
  // titleProps.onMouseenter = () => { for 3
228
228
  titleProps.on.mouseenter = () => {
229
229
  if (ps.disabled) return;
@@ -31,7 +31,7 @@ const config3 = () => {
31
31
  duration: 0,
32
32
  closable: true,
33
33
  content: "手动关闭",
34
- close: () => {
34
+ onClose: () => {
35
35
  message.success("我是回调");
36
36
  },
37
37
  });
@@ -12,13 +12,13 @@ export default defineComponent({
12
12
  const group = ref([]);
13
13
 
14
14
  const show = (options) => {
15
- let { duration, close, closable, noticeType } = options;
15
+ let { duration, onClose, closable, noticeType } = options;
16
16
  let key = getUuid();
17
17
  options.key = key;
18
18
  options.duration = isNaN(Number(duration)) ? 3.5 : duration;
19
19
  let timer;
20
20
  let callback = (key) => {
21
- typeof close === "function" && close();
21
+ typeof onClose === "function" && onClose();
22
22
  group.value = group.value.filter((item) => item.key !== key);
23
23
  clearTimeout(timer);
24
24
  timer = null;
@@ -21,6 +21,6 @@
21
21
  | content | 提示内容 | String,Vnode | - |
22
22
  | duration | 自动关闭的延时,单位秒,0 为 不自动关闭 | Number | 3 |
23
23
  | closable | 是否可手动关闭 | Boolean | false |
24
- | close | 关闭时的回调 | Function | - |
24
+ | onClose | 关闭时的回调 | Function | - |
25
25
  | icon | 自定义图标 | String | - |
26
26
  | color | 自定义图标颜色 | String | - |
@@ -1,5 +1,11 @@
1
1
  import Icon from "../icon";
2
- import { Close, InformationCircle, CloseCircle, CheckmarkCircle, AlertCircle } from "kui-icons";
2
+ import {
3
+ Close,
4
+ InformationCircle,
5
+ CloseCircle,
6
+ CheckmarkCircle,
7
+ AlertCircle,
8
+ } from "kui-icons";
3
9
  import { defineComponent } from "vue";
4
10
  export default defineComponent({
5
11
  props: {
@@ -8,13 +14,16 @@ export default defineComponent({
8
14
  content: [String, Object],
9
15
  icon: [String, Array],
10
16
  color: String,
17
+ duration: Number,
11
18
  closable: Boolean,
12
19
  noticeType: { type: String, default: "message" },
13
- onClose: { type: Function, default: () => { } },
14
20
  },
15
- setup(ps) {
21
+ setup(ps, { emit }) {
22
+ const onClose = () => {
23
+ emit("close");
24
+ };
16
25
  return () => {
17
- let { noticeType, type, content, title, onClose, closable, icon, color } = ps;
26
+ let { noticeType, type, content, title, closable, icon, color } = ps;
18
27
  const classes = [
19
28
  `k-${noticeType}-box`,
20
29
  {
@@ -30,17 +39,27 @@ export default defineComponent({
30
39
  };
31
40
  const children = [];
32
41
  if (type in icons) {
33
- children.push(<Icon type={icon || icons[type]} color={color} class={`k-${noticeType}-icon`} />);
42
+ children.push(
43
+ <Icon
44
+ type={icon || icons[type]}
45
+ color={color}
46
+ class={`k-${noticeType}-icon`}
47
+ />
48
+ );
34
49
  }
35
50
  if (noticeType == "message") {
36
51
  children.push(<span>{content}</span>);
37
52
  if (closable) {
38
- children.push(<Icon class="k-message-close" type={Close} onClick={onClose} />);
53
+ children.push(
54
+ <Icon class="k-message-close" type={Close} onClick={onClose} />
55
+ );
39
56
  }
40
57
  } else {
41
58
  children.push(<div class="k-notice-title">{title}</div>);
42
59
  children.push(<div class="k-notice-desc">{content}</div>);
43
- children.push(<Icon class="k-notice-close" type={Close} onClick={onClose} />);
60
+ children.push(
61
+ <Icon class="k-notice-close" type={Close} onClick={onClose} />
62
+ );
44
63
  }
45
64
  return (
46
65
  <div class={classes}>
@@ -36,7 +36,7 @@ const config3 = () => {
36
36
  duration: 0,
37
37
  title: "温馨提示",
38
38
  content: "手动关闭",
39
- close: () => {
39
+ onClose: () => {
40
40
  message.success("我是回调");
41
41
  },
42
42
  });
@@ -19,6 +19,6 @@
19
19
  | title | 通知提醒的标题 | String | - |
20
20
  | content | 提示内容 | String ,vndoe | - |
21
21
  | duration | 自动关闭的延时,单位秒,不关闭可以写 0 | Number | 3 |
22
- | close | 关闭时的回调 | Function | - |
22
+ | onClose | 关闭时的回调 | Function | - |
23
23
  | icon | 自定义图标 | String | - |
24
24
  | color | 自定义图标颜色 | String | - |
@@ -31,7 +31,6 @@ const Page = defineComponent({
31
31
  current: { default: 1, type: Number },
32
32
  },
33
33
  setup(ps, { emit }) {
34
- // todo: select
35
34
  const nextPageGroup = ref(false);
36
35
  const prevPageGroup = ref(false);
37
36
  const pageCount = ref(Math.ceil(ps.total / ps.pageSize) || 1);
@@ -158,7 +158,13 @@
158
158
  cursor: not-allowed;
159
159
  .k-pager-item {
160
160
  color: var(--kui-color-disabled);
161
- border-color: var(--kui-color-disabled);
161
+ border-color: var(--kui-color-disable-border);
162
+ }
163
+ .k-pager-item-active {
164
+ color: var(--kui-color-disabled);
165
+ :hover {
166
+ color: var(--kui-color-disabled);
167
+ }
162
168
  }
163
169
  * {
164
170
  cursor: not-allowed;
@@ -23,6 +23,7 @@ const Popconfirm = defineComponent({
23
23
  },
24
24
  props: {
25
25
  dark: Boolean,
26
+ show: Boolean,
26
27
  title: [String, Number, Object, Array],
27
28
  size: String,
28
29
  width: [Number, String],
@@ -59,7 +60,7 @@ const Popconfirm = defineComponent({
59
60
  const rendered = ref(false);
60
61
  const visible = ref(false);
61
62
  const refPopper = ref();
62
- const refCtx = ref();
63
+ const refSelection = ref();
63
64
  const left = ref(0);
64
65
  const top = ref(0);
65
66
  const currentPlacement = ref(ps.placement);
@@ -69,7 +70,7 @@ const Popconfirm = defineComponent({
69
70
  const updatePosition = () => {
70
71
  nextTick(() => {
71
72
  setPlacement({
72
- refCtx,
73
+ refSelection,
73
74
  refPopper,
74
75
  currentPlacement,
75
76
  transOrigin,
@@ -100,15 +101,19 @@ const Popconfirm = defineComponent({
100
101
  }
101
102
  }
102
103
  );
104
+ const updateShow = (value) => {
105
+ visible.value = value;
106
+ emit("update:show", value);
107
+ };
103
108
  const outsideClick = (e) => {
104
- const ctx = refCtx.value?.$el || refCtx.value;
109
+ const ctx = refSelection.value?.$el || refSelection.value;
105
110
  if (
106
111
  refPopper.value &&
107
112
  !refPopper.value.contains(e.target) &&
108
113
  ctx &&
109
114
  !ctx.contains(e.target)
110
115
  ) {
111
- visible.value = false;
116
+ updateShow(false);
112
117
  }
113
118
  };
114
119
  const mouseEnter = () => {
@@ -116,29 +121,22 @@ const Popconfirm = defineComponent({
116
121
  rendered.value = true;
117
122
  document.addEventListener("click", outsideClick);
118
123
  nextTick(() => {
119
- visible.value = true;
124
+ updateShow(true);
120
125
  updatePosition();
121
126
  });
122
127
  } else {
123
128
  clearTimeout(showTimer.value);
124
- visible.value = true;
129
+ updateShow(true);
125
130
  updatePosition();
126
131
  }
127
132
  };
128
- const hide = () => {
129
- hideTimer.value = setTimeout(() => {
130
- if (!ps.show) {
131
- visible.value = false;
132
- }
133
- }, 300);
134
- };
135
133
  const ok = () => {
136
- visible.value = false;
134
+ updateShow(false);
137
135
  emit("ok");
138
136
  };
139
137
 
140
138
  const cancel = () => {
141
- visible.value = false;
139
+ updateShow(false);
142
140
  emit("cancel");
143
141
  };
144
142
  return () => {
@@ -152,7 +150,7 @@ const Popconfirm = defineComponent({
152
150
  },
153
151
  ];
154
152
  const wpProps = {
155
- ref: refCtx,
153
+ ref: refSelection,
156
154
  // onClick: mouseEnter, //for 3
157
155
  on: {
158
156
  click: mouseEnter,
@@ -183,24 +181,24 @@ const Popconfirm = defineComponent({
183
181
  on: {
184
182
  mouseenter: () => {
185
183
  clearTimeout(hideTimer.value);
186
- visible.value = true;
184
+ updateShow(true);
187
185
  },
188
186
  mouseleave: () => {
189
187
  showTimer.value = setTimeout(() => {
190
188
  if (!ps.show) {
191
- visible.value = false;
189
+ updateShow(false);
192
190
  }
193
191
  }, 300);
194
192
  },
195
193
  },
196
194
  // onMouseenter: () => {
197
195
  // clearTimeout(hideTimer.value);
198
- // visible.value = true;
196
+ // updateShow(true;
199
197
  // },
200
198
  // onMouseleave: () => {
201
199
  // showTimer.value = setTimeout(() => {
202
200
  // if (!ps.show) {
203
- // visible.value = false;
201
+ // updateShow(false;
204
202
  // }
205
203
  // }, 300);
206
204
  // },
@@ -41,7 +41,7 @@ const Poptip = defineComponent({
41
41
  const rendered = ref(ps.show);
42
42
  const visible = ref(ps.show);
43
43
  const refPopper = ref();
44
- const refCtx = ref();
44
+ const refSelection = ref();
45
45
  const left = ref(0);
46
46
  const top = ref(0);
47
47
  const currentPlacement = ref(ps.placement);
@@ -51,7 +51,7 @@ const Poptip = defineComponent({
51
51
  const updatePosition = () => {
52
52
  nextTick(() => {
53
53
  setPlacement({
54
- refCtx,
54
+ refSelection,
55
55
  refPopper,
56
56
  currentPlacement,
57
57
  transOrigin,
@@ -89,7 +89,7 @@ const Poptip = defineComponent({
89
89
  emit("update:show", value);
90
90
  };
91
91
  const outsideClick = (e) => {
92
- const ctx = refCtx.value?.$el || refCtx.value;
92
+ const ctx = refSelection.value?.$el || refSelection.value;
93
93
  if (
94
94
  refPopper.value &&
95
95
  !refPopper.value.contains(e.target) &&
@@ -132,7 +132,7 @@ const Poptip = defineComponent({
132
132
  },
133
133
  ];
134
134
  const wpProps = {
135
- ref: refCtx,
135
+ ref: refSelection,
136
136
  // onMouseleave: hide, //for 3
137
137
  on: { mouseleave: hide },
138
138
  };
@@ -89,7 +89,7 @@ const Progress = defineComponent({
89
89
  // front color
90
90
  style = {
91
91
  strokeDasharray: `${(percent / 100) * (len - (dashboard ? gap : 0))}px ${len}px`, //长度,间距 ,实线和虚线的长度
92
- transition: `stroke-dasharray .3s ease 0s;opacity ease 0s;`,
92
+ transition: `stroke-dasharray .3s ease 0s,opacity 0.3s ease 0s`,
93
93
  strokeDashoffset: dashboard ? -gap / 2 : 0,
94
94
  stroke: strokeColor,
95
95
  strokeLinecap: strokeLinecap,
@@ -7,11 +7,11 @@
7
7
  <template>
8
8
  <Space vertical>
9
9
  use options
10
- <code>value: {{ value1 }}</code>
11
- <RadioGroup :options="options" v-model="value1" />
10
+ <code>value: {{ value }}</code>
11
+ <RadioGroup :options="options" v-model="value" />
12
12
  <br />
13
13
  use children
14
- <RadioGroup v-model="value1">
14
+ <RadioGroup v-model="value">
15
15
  <Radio
16
16
  :label="item.label"
17
17
  :value="item.value"
@@ -23,13 +23,23 @@
23
23
  </template>
24
24
  <script setup>
25
25
  import { ref } from "vue";
26
- const value1 = ref("apple");
27
- const options = [
26
+ const value = ref("apple");
27
+ const options = ref([
28
28
  { label: "Apple", value: "apple" },
29
29
  { label: "Orange", value: "orange" },
30
30
  { label: "Banana", value: "banana" },
31
31
  { label: "Pear", value: "pear" },
32
32
  { label: "Grape", value: "grape" },
33
- ];
33
+ ]);
34
+ // 异步更新数据
35
+ setTimeout(() => {
36
+ options.value = [
37
+ { label: "Apple1", value: "apple" },
38
+ { label: "Orange1", value: "orange" },
39
+ { label: "Banana1", value: "banana" },
40
+ { label: "Pear1", value: "pear" },
41
+ { label: "Grape1", value: "grape" },
42
+ ];
43
+ }, 1000);
34
44
  </script>
35
45
  ```
@@ -7,23 +7,18 @@
7
7
  <template>
8
8
  <Space vertical>
9
9
  <code>Shape : {{ shape }}</code>
10
- <RadioGroup v-model="shape" size="small">
10
+ <RadioGroup v-model="shape" size="small" type="button">
11
11
  <RadioButton value="default" label="Default" />
12
12
  <RadioButton value="circle" label="Circle" />
13
13
  </RadioGroup>
14
14
  <code>Theme :{{ theme }}</code>
15
- <RadioGroup v-model="theme" size="small">
15
+ <RadioGroup v-model="theme" size="small" type="button">
16
16
  <RadioButton value="default" label="Default" />
17
17
  <RadioButton value="light" label="Light" />
18
18
  <RadioButton value="card" label="Card" />
19
19
  </RadioGroup>
20
20
  <code>Size :{{ size }}</code>
21
- <RadioGroup
22
- v-model="size"
23
- type="button"
24
- size="small"
25
- :options="sizes"
26
- >
21
+ <RadioGroup v-model="size" type="button" size="small" :options="sizes">
27
22
  </RadioGroup>
28
23
  <br />
29
24
  <RadioGroup
@@ -14,7 +14,7 @@ const Radio = defineComponent({
14
14
 
15
15
  // [Vue 3 Upgrade]: Vue 2 use checked & model
16
16
  checked: {
17
- type: Boolean,
17
+ type: [Boolean, Number],
18
18
  default: false,
19
19
  },
20
20
  value: { type: [String, Number, Boolean] },
@@ -40,25 +40,28 @@ const Radio = defineComponent({
40
40
  }
41
41
  );
42
42
 
43
- const onChange = (e) => {
44
- if (props.disabled || isChecked.value) return;
45
- const checked = e.target.checked;
46
-
43
+ const emitValue = (checked) => {
47
44
  isChecked.value = checked;
48
- // [Vue 3 Upgrade]: emit("update:modelValue", targetChecked);
49
45
  emit("change", {
50
46
  checked: checked,
51
47
  value: props.value,
52
- label: props.label,
48
+ label: props.label || slots.default?.(),
53
49
  });
54
50
  emit("input", checked);
55
51
  };
56
- const triggleCheck = (e) => {
57
- // onChange({ target: { checked: isChecked.value } });
52
+ const onChange = (e) => {
53
+ if (props.disabled || isChecked.value) return;
54
+ const checked = e.target.checked;
55
+ e.preventDefault();
56
+ e.stopPropagation();
57
+ emitValue(checked);
58
+ };
59
+ const triggerCheck = (e) => {
58
60
  if (e.code == "Space") {
59
- onChange({ target: { checked: !isChecked.value } });
60
61
  e.preventDefault();
61
62
  e.stopPropagation();
63
+ if (props.disabled || isChecked.value) return;
64
+ emitValue(!isChecked.value);
62
65
  }
63
66
  };
64
67
  return () => {
@@ -76,7 +79,7 @@ const Radio = defineComponent({
76
79
  const labelNode = props.label || slots.default?.();
77
80
 
78
81
  return (
79
- <label class={classes} tabindex="0" onKeydown={triggleCheck}>
82
+ <label class={classes} tabindex="0" onKeydown={triggerCheck}>
80
83
  <span class="k-radio-symbol">
81
84
  <input
82
85
  type="radio"
@@ -14,7 +14,7 @@ const RadioButton = defineComponent({
14
14
 
15
15
  // [Vue 3 Upgrade]: Vue 2 use checked & model
16
16
  checked: {
17
- type: Boolean,
17
+ type: [Boolean, Number],
18
18
  default: false,
19
19
  },
20
20
  value: { type: [String, Number, Boolean] },