kui-vue 3.6.2 → 3.6.4

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 (204) hide show
  1. package/components/card/card.jsx +19 -9
  2. package/components/card/demo/basic.md +3 -3
  3. package/components/card/demo/border.md +1 -7
  4. package/components/card/demo/index.jsx +9 -7
  5. package/components/card/demo/notitle.md +23 -0
  6. package/components/card/styles/index.less +5 -3
  7. package/components/checkbox/styles/index.less +1 -0
  8. package/components/collapse/styles/index.less +2 -2
  9. package/components/colorPicker/mode.jsx +1 -1
  10. package/components/components.js +3 -0
  11. package/components/drawer/demo/target.md +2 -2
  12. package/components/drawer/drawer.jsx +48 -74
  13. package/components/drawer/styles/index.less +38 -67
  14. package/components/dropdown/demo/basic.md +1 -1
  15. package/components/dropdown/demo/rightmenu.md +1 -1
  16. package/components/dropdown/styles/index.less +181 -24
  17. package/components/flex/demo/size.md +14 -5
  18. package/components/form/demo/customvalid.md +1 -1
  19. package/components/form/demo/dynamicvalid.md +1 -1
  20. package/components/form/demo/length.md +1 -13
  21. package/components/form/demo/valid.md +10 -1
  22. package/components/form/form.jsx +1 -1
  23. package/components/grid/demo/align.md +5 -5
  24. package/components/grid/demo/basic.md +2 -2
  25. package/components/grid/demo/fill.md +8 -8
  26. package/components/grid/demo/flex.md +7 -7
  27. package/components/grid/demo/gutter.md +2 -4
  28. package/components/grid/demo/offset.md +5 -5
  29. package/components/input/demo/icon.md +9 -2
  30. package/components/input/demo/theme.md +1 -1
  31. package/components/input/input.jsx +12 -10
  32. package/components/inputNumber/demo/basic.md +1 -0
  33. package/components/inputNumber/demo/format.md +3 -8
  34. package/components/inputNumber/inputNumber.jsx +116 -139
  35. package/components/inputNumber/styles/index.less +3 -3
  36. package/components/layout/demo/layout2.md +0 -12
  37. package/components/layout/demo/layout5.md +0 -1
  38. package/components/locale/de.js +1 -0
  39. package/components/locale/el.js +1 -0
  40. package/components/locale/en.js +1 -0
  41. package/components/locale/fr.js +1 -0
  42. package/components/locale/it.js +1 -0
  43. package/components/locale/ja.js +1 -0
  44. package/components/locale/ko.js +1 -0
  45. package/components/locale/ru.js +1 -0
  46. package/components/locale/th.js +1 -0
  47. package/components/locale/uk.js +1 -0
  48. package/components/locale/vi.js +1 -0
  49. package/components/locale/zh-CN.js +1 -0
  50. package/components/locale/zh-TW.js +1 -0
  51. package/components/menu/demo/collapsed.md +9 -9
  52. package/components/menu/index.md +1 -0
  53. package/components/menu/styles/index.less +229 -375
  54. package/components/message/group.jsx +11 -4
  55. package/components/rate/rate.jsx +7 -2
  56. package/components/rate/star.jsx +20 -5
  57. package/components/select/demo/filterable.md +1 -0
  58. package/components/select/demo/multiple.md +3 -0
  59. package/components/select/select.jsx +23 -19
  60. package/components/slider/demo/vertical.md +2 -1
  61. package/components/slider/demo/withNumber.md +0 -2
  62. package/components/slider/index.md +2 -3
  63. package/components/slider/slider.jsx +296 -291
  64. package/components/slider/styles/index.less +11 -12
  65. package/components/slider/thumb.jsx +70 -148
  66. package/components/spin/demo/container.md +1 -1
  67. package/components/spin/demo/mode.md +1 -1
  68. package/components/statCard/countup.js +254 -0
  69. package/components/statCard/countup.jsx +45 -0
  70. package/components/statCard/demo/basic.md +31 -0
  71. package/components/statCard/demo/card.md +40 -0
  72. package/components/statCard/demo/index.jsx +19 -0
  73. package/components/statCard/demo/info.md +9 -0
  74. package/components/statCard/demo/with-card.md +43 -0
  75. package/components/statCard/index.js +3 -0
  76. package/components/statCard/index.md +28 -0
  77. package/components/statCard/rollup.jsx +64 -0
  78. package/components/statCard/statCard.jsx +42 -0
  79. package/components/statCard/statNumber.jsx +53 -0
  80. package/components/statCard/styles/index.less +76 -0
  81. package/components/styles/color.less +4 -2
  82. package/components/styles/index.less +1 -0
  83. package/components/styles/sys.less +2 -3
  84. package/components/styles/var.less +1 -0
  85. package/components/table/demo/col-row-span.md +1 -1
  86. package/components/table/demo/custom-header.md +1 -1
  87. package/components/table/demo/fixed-col-head.md +1 -1
  88. package/components/table/demo/head-span.md +2 -2
  89. package/components/table/demo/size.md +1 -1
  90. package/components/table/demo/table-check.md +11 -1
  91. package/components/table/index.md +13 -12
  92. package/components/table/styles/index.less +67 -58
  93. package/components/table/table.jsx +7 -5
  94. package/components/tabs/demo/sample.md +1 -8
  95. package/components/tabs/index.md +9 -9
  96. package/components/tabs/tabs.jsx +6 -4
  97. package/components/treeselect/treeselect.jsx +17 -17
  98. package/components/upload/demo/custom.md +5 -2
  99. package/components/upload/demo/exceed.md +1 -1
  100. package/components/upload/demo/pictures.md +14 -0
  101. package/components/upload/fileList.jsx +24 -47
  102. package/components/upload/index.md +13 -4
  103. package/components/upload/selector.jsx +37 -117
  104. package/components/upload/styles/index.less +2 -3
  105. package/components/upload/upload.jsx +189 -116
  106. package/components/utils/number.js +79 -65
  107. package/components/utils/placement.js +4 -4
  108. package/components/utils/vnode.jsx +46 -25
  109. package/dist/k-ui.cjs.js +2 -2
  110. package/dist/k-ui.css +2 -2
  111. package/dist/k-ui.d.ts +242 -200
  112. package/dist/k-ui.esm.js +2 -2
  113. package/dist/k-ui.umd.js +2 -2
  114. package/dist/locale/de.js +2 -2
  115. package/dist/locale/el.js +2 -2
  116. package/dist/locale/en.js +2 -2
  117. package/dist/locale/fr.js +2 -2
  118. package/dist/locale/it.js +2 -2
  119. package/dist/locale/ja.js +2 -2
  120. package/dist/locale/ko.js +2 -2
  121. package/dist/locale/ru.js +2 -2
  122. package/dist/locale/th.js +2 -2
  123. package/dist/locale/uk.js +2 -2
  124. package/dist/locale/vi.js +2 -2
  125. package/dist/locale/zh-CN.js +2 -2
  126. package/dist/locale/zh-TW.js +2 -2
  127. package/package.json +3 -1
  128. package/types/affix/Affix.d.ts +1 -1
  129. package/types/alert/Alert.d.ts +1 -1
  130. package/types/avatar/Avatar.d.ts +1 -1
  131. package/types/backtop/BackTop.d.ts +1 -1
  132. package/types/badge/Badge.d.ts +1 -1
  133. package/types/breadcrumb/Breadcrumb.d.ts +1 -1
  134. package/types/breadcrumb/BreadcrumbItem.d.ts +1 -1
  135. package/types/button/Button.d.ts +1 -1
  136. package/types/button/ButtonGroup.d.ts +1 -1
  137. package/types/card/Card.d.ts +1 -1
  138. package/types/carousel/Carousel.d.ts +1 -1
  139. package/types/carousel/CarouselItem.d.ts +1 -1
  140. package/types/checkbox/Checkbox.d.ts +1 -1
  141. package/types/checkbox/CheckboxGroup.d.ts +1 -1
  142. package/types/collapse/Collapse.d.ts +1 -1
  143. package/types/collapse/CollapsePanel.d.ts +1 -1
  144. package/types/colorPicker/ColorPicker.d.ts +1 -1
  145. package/types/datePicker/DatePicker.d.ts +1 -1
  146. package/types/descriptions/Descriptions.d.ts +1 -1
  147. package/types/descriptions/DescriptionsItem.d.ts +1 -1
  148. package/types/divider/Divider.d.ts +1 -1
  149. package/types/drawer/Drawer.d.ts +2 -2
  150. package/types/dropdown/Dropdown.d.ts +1 -1
  151. package/types/dropdown/DropdownButton.d.ts +1 -1
  152. package/types/empty/Empty.d.ts +1 -1
  153. package/types/flex/Flex.d.ts +1 -1
  154. package/types/form/Form.d.ts +1 -1
  155. package/types/form/formitem.d.ts +1 -1
  156. package/types/grid/Col.d.ts +1 -1
  157. package/types/grid/Row.d.ts +1 -1
  158. package/types/icon/Icon.d.ts +1 -1
  159. package/types/image/ImageGroup.d.ts +1 -1
  160. package/types/image/KImage.d.ts +1 -1
  161. package/types/index.d.ts +16 -12
  162. package/types/input/Input.d.ts +1 -1
  163. package/types/input/InputGroup.d.ts +1 -1
  164. package/types/input/TextArea.d.ts +1 -1
  165. package/types/inputNumber/InputNumber.d.ts +1 -1
  166. package/types/layout/sider.d.ts +1 -1
  167. package/types/loading/loading.d.ts +1 -1
  168. package/types/menu/Menu.d.ts +1 -1
  169. package/types/menu/MenuDivider.d.ts +1 -1
  170. package/types/menu/MenuGroup.d.ts +1 -1
  171. package/types/menu/MenuItem.d.ts +1 -1
  172. package/types/menu/SubMenu.d.ts +1 -1
  173. package/types/modal/Modal.d.ts +1 -1
  174. package/types/page/Page.d.ts +1 -1
  175. package/types/popconfirm/Popconfirm.d.ts +1 -1
  176. package/types/poptip/Poptip.d.ts +1 -1
  177. package/types/progress/Progress.d.ts +1 -1
  178. package/types/radio/Radio.d.ts +1 -1
  179. package/types/radio/RadioButton.d.ts +1 -1
  180. package/types/radio/RadioGroup.d.ts +1 -1
  181. package/types/rate/Rate.d.ts +2 -2
  182. package/types/select/Option.d.ts +1 -1
  183. package/types/select/Select.d.ts +1 -1
  184. package/types/skeleton/Skeleton.d.ts +1 -1
  185. package/types/skeleton/SkeletonAvatar.d.ts +1 -1
  186. package/types/skeleton/SkeletonButton.d.ts +1 -1
  187. package/types/skeleton/SkeletonImage.d.ts +1 -1
  188. package/types/skeleton/SkeletonText.d.ts +1 -1
  189. package/types/slider/Slider.d.ts +8 -7
  190. package/types/space/Space.d.ts +1 -1
  191. package/types/spin/Spin.d.ts +1 -1
  192. package/types/statCard/StatCard.d.ts +20 -0
  193. package/types/statCard/StatNumber.d.ts +26 -0
  194. package/types/switch/Switch.d.ts +1 -1
  195. package/types/table/Table.d.ts +2 -1
  196. package/types/tabs/TabPanel.d.ts +1 -1
  197. package/types/tabs/Tabs.d.ts +1 -1
  198. package/types/tag/Tag.d.ts +1 -1
  199. package/types/timeline/TimeLine.d.ts +1 -1
  200. package/types/timeline/TimeLineItem.d.ts +1 -1
  201. package/types/tooltip/Tooltip.d.ts +1 -1
  202. package/types/tree/Tree.d.ts +1 -1
  203. package/types/treeselect/TreeSelect.d.ts +1 -1
  204. package/types/upload/Upload.d.ts +1 -1
@@ -6,6 +6,7 @@ import { defineComponent, ref, nextTick, watch, inject, provide } from "vue";
6
6
  import { withInstall } from "../utils/vue";
7
7
  import InputBox from "./inputBox";
8
8
  import { sizeMap, filterSize } from "../utils/size";
9
+ import { getChildren } from "../utils/vnode";
9
10
 
10
11
  const Input = defineComponent({
11
12
  name: "Input",
@@ -132,19 +133,20 @@ const Input = defineComponent({
132
133
  shape,
133
134
  inputType,
134
135
  } = ps;
135
- const slotSuffix = slots.suffix?.();
136
- const slotPrefix = slots.prefix?.();
136
+ const slotSuffix = getChildren(slots.suffix?.());
137
+ const slotPrefix = getChildren(slots.prefix?.());
138
+ const slotControls = getChildren(slots.controls?.());
137
139
  let multiple =
138
140
  (icon ||
139
141
  // attrs.onSearch ||
140
142
  "search" in listeners ||
141
- slotSuffix ||
143
+ slotSuffix.length > 0 ||
142
144
  suffix ||
143
- slotPrefix ||
145
+ slotPrefix.length > 0 ||
144
146
  prefix ||
145
147
  type == "password" ||
146
148
  clearable ||
147
- slots.controls) &&
149
+ slotControls.length > 0) &&
148
150
  type !== "hidden";
149
151
  const inputProps = {
150
152
  attrs: { ...attrs },
@@ -199,9 +201,9 @@ const Input = defineComponent({
199
201
  };
200
202
  // const prefixNode = prefix ? <div class={`k-input-prefix`}>{prefix}</div> : null;
201
203
 
202
- if (slotPrefix || slotSuffix) {
204
+ if (slotPrefix.length || slotSuffix.length) {
203
205
  const preChildren = [];
204
- if (slotPrefix)
206
+ if (slotPrefix.length)
205
207
  preChildren.push(
206
208
  <div class="k-input-group-prefix">{slotPrefix}</div>
207
209
  );
@@ -231,12 +233,12 @@ const Input = defineComponent({
231
233
  />
232
234
  );
233
235
  const sufChildren = [];
234
- if (slotSuffix)
236
+ if (slotSuffix.length)
235
237
  sufChildren.push(
236
238
  <div class="k-input-group-suffix">{slotSuffix}</div>
237
239
  );
238
240
 
239
- if (slots.controls) innerChildren.push(slots.controls?.());
241
+ if (slotControls.length) innerChildren.push(slotControls);
240
242
  return (
241
243
  <InputGroup size={size}>
242
244
  {preChildren}
@@ -272,7 +274,7 @@ const Input = defineComponent({
272
274
  />
273
275
  );
274
276
  if (suffixNode) children.push(suffixNode);
275
- if (slots.controls) children.push(slots.controls?.());
277
+ if (slotControls.length) children.push(slotControls);
276
278
 
277
279
  return (
278
280
  <div {...props} mult>
@@ -6,6 +6,7 @@
6
6
  ```vue
7
7
  <template>
8
8
  <Space style="font-size:12px;max-width:200px" block vertical>
9
+ <code>v-model: {{value}}</code>
9
10
  <InputNumber v-model="value" />
10
11
 
11
12
  <code>readonly</code>
@@ -1,6 +1,6 @@
1
1
  <cn>
2
- ### 高精度小数/格式化展示
3
- 通过 formatter 格式化数字,以展示具有具体含义的数据,往往需要配合 parser 一起使用。
2
+ ### 高精度小数/格式化展示
3
+ 通过 formatter 格式化数字,以展示具有具体含义的数据,往往需要配合 parser 一起使用。
4
4
  </cn>
5
5
 
6
6
  ```vue
@@ -9,12 +9,7 @@
9
9
  <code> 0.1+0.2 = 0.3 (yes) ,输出:{{ n }}</code>
10
10
  <InputNumber :step="0.2" v-model="n" />
11
11
  <code>步长为 0.00000000000001 ,输出:{{ n1 }}</code>
12
- <InputNumber
13
- v-model="n1"
14
- :min="0"
15
- :max="10"
16
- :step="0.00000000000001"
17
- />
12
+ <InputNumber v-model="n1" :min="0" :max="10" :step="0.00000000000001" />
18
13
  <code>保留2位小数, 输出:{{ n3 }}</code>
19
14
  <InputNumber :precision="2" v-model="n3" />
20
15
  <code> 货币,千分位,输出: {{ n4 }}</code>
@@ -1,18 +1,13 @@
1
+ import { ref, defineComponent, watch, inject, computed } from "vue";
2
+ import Big from "big.js";
1
3
  import Input from "../input/input";
2
4
  import Icon from "../icon";
3
5
  import { withInstall } from "../utils/vue";
4
- import {
5
- add,
6
- subtract,
7
- toFixed,
8
- isValidNumber,
9
- isEmpty,
10
- toDecimalString,
11
- } from "../utils/number";
12
- import { ChevronUp } from "kui-icons";
13
- import { ref, defineComponent, watch, inject } from "vue";
6
+ import { ChevronUp, ChevronDown } from "kui-icons";
14
7
  import { sizeMap, filterSize } from "../utils/size";
8
+ import { normalize, isValidBig } from "../utils/number";
15
9
  const InputNumber = defineComponent({
10
+ name: "InputNumber",
16
11
  props: {
17
12
  value: [Array, Number, String],
18
13
  min: { type: Number, default: -Infinity },
@@ -38,179 +33,161 @@ const InputNumber = defineComponent({
38
33
  default: 1,
39
34
  },
40
35
  theme: String,
41
- // placeholder: String,
42
36
  icon: [String, Array],
43
37
  id: String,
44
38
  },
45
- setup(ps, { slots, attrs, emit, listeners }) {
39
+ setup(props, { slots, attrs, emit, listeners }) {
46
40
  const parentSize = inject("size", null);
47
- const getValue = (v, edge, sync) => {
48
- let input = "";
49
- let output = "";
50
-
51
- let { min, max, precision, formatter, parser } = ps;
52
-
53
- if (!isValidNumber(v)) {
54
- if (isEmpty(v)) {
55
- input = "";
56
- output = "";
57
- } else {
58
- input = String(v);
59
- output = formatter ? parser?.(String(v)) || v : String(v);
60
- }
61
- } else {
62
- if (/e/i.test(v) && sync) {
63
- v = toDecimalString(v);
64
- }
65
- input = String(v);
66
- output = v;
67
- }
68
- if (formatter) {
69
- const value = parser?.(String(input)) || input;
70
- input = formatter(String(value));
41
+ const innerValue = ref("");
42
+ const userInput = ref(null);
43
+
44
+ const clamp = (val) => {
45
+ if (!isValidBig(val)) {
46
+ return val === "" ? "" : innerValue.value;
71
47
  }
72
- if (edge) {
73
- if (precision > 0) {
74
- output = toFixed(output, precision);
75
- }
76
- if (output > max) {
77
- output = max;
78
- input = formatter?.(String(max)) || max;
79
- } else if (output < min) {
80
- output = min;
81
- input = formatter?.(String(min)) || min;
82
- }
48
+
49
+ try {
50
+ let b = new Big(val);
51
+
52
+ if (props.max !== Infinity && b.gt(props.max)) b = new Big(props.max);
53
+ if (props.min !== -Infinity && b.lt(props.min)) b = new Big(props.min);
54
+
55
+ return props.precision !== undefined
56
+ ? b.toFixed(props.precision)
57
+ : b.toFixed();
58
+ } catch (e) {
59
+ return innerValue.value;
83
60
  }
84
- // console.log(`origin: ${v}`, `input: ${input}`, `output: ${output}`);
85
- return { input, output };
86
61
  };
87
- // output is the truth value
88
- // input is the show text
89
- const { input, output } = getValue(ps.value);
90
-
91
- const inputValue = ref(input);
92
- const outputValue = ref(output);
93
-
94
- const calcValue = (e, isUp) => {
95
- if (ps.disabled) return;
96
- const { step } = ps;
97
- if (!isValidNumber(outputValue.value) || isEmpty(outputValue.value)) {
98
- outputValue.value = 0;
99
- }
100
- let value =
101
- isUp == 1
102
- ? add(String(outputValue.value), String(step))
103
- : subtract(String(outputValue.value), String(step));
104
- const { input, output } = getValue(value, true);
105
-
106
- // return
107
- inputValue.value = input;
108
- outputValue.value = output;
109
- e.preventDefault();
110
-
111
- emit("input", output);
112
- // emit("update:value", output);
113
- emit("change", { target: { value: output } });
62
+
63
+ watch(
64
+ () => props.value,
65
+ (val) => {
66
+ const next = normalize(val, props.precision);
67
+ if (next !== innerValue.value) {
68
+ innerValue.value = next;
69
+ }
70
+ },
71
+ { immediate: true }
72
+ );
73
+ const emitValue = (value) => {
74
+ emit("input", value);
75
+ emit("change", value);
114
76
  };
77
+ const displayValue = computed(() => {
78
+ if (userInput.value !== null) return userInput.value;
115
79
 
116
- const onKeyDown = (e) => {
117
- if (!ps.keyboard) return;
118
- if (e.key === "ArrowUp") {
119
- calcValue(e, 1);
120
- } else if (e.key === "ArrowDown") {
121
- calcValue(e, 0);
122
- }
80
+ if (innerValue.value === "") return "";
81
+ return props.formatter
82
+ ? props.formatter(innerValue.value)
83
+ : innerValue.value;
84
+ });
85
+
86
+ const triggerUpdate = (val) => {
87
+ const parsed = props.parser ? props.parser(val) : val;
88
+ const clampedStr = clamp(parsed);
89
+ innerValue.value = clampedStr;
90
+ userInput.value = null;
91
+ const output = clampedStr === "" ? undefined : Number(clampedStr);
92
+ emitValue(output);
123
93
  };
124
- const onUpdate = (e) => {
125
- const v = e; //.target.value;
126
- const { input, output } = getValue(v, false, false);
127
- inputValue.value = input;
128
- // e.target.value = input;
129
94
 
130
- if (!isValidNumber(output) && !isEmpty(v)) {
95
+ const handleInput = (val) => {
96
+ userInput.value = val;
97
+ const parsed = props.parser ? props.parser(val) : val;
98
+ if (val === "") {
99
+ innerValue.value = "";
100
+ emitValue(undefined);
131
101
  return;
132
102
  }
133
- const { max, min } = ps;
134
- if ((output && output > max) || (output && output < min)) {
135
- return;
103
+
104
+ if (isValidBig(parsed)) {
105
+ const bigVal = new Big(parsed);
106
+ const normalizedStr = bigVal.toFixed();
107
+
108
+ innerValue.value = normalizedStr;
109
+ emitValue(Number(normalizedStr));
110
+
111
+ if (props.formatter) {
112
+ const formatted = props.formatter(normalizedStr);
113
+ if (formatted !== userInput.value) {
114
+ userInput.value = formatted;
115
+ }
116
+ }
136
117
  }
137
- outputValue.value = output;
138
- emit("input", output);
139
- // emit("update:value", output);
140
- // e.preventDefault();
141
118
  };
142
- watch(
143
- () => ps.value,
144
- (v) => {
145
- const { input, output } = getValue(v, false);
146
119
 
147
- inputValue.value = input;
148
- outputValue.value = output;
149
- }
150
- );
151
- const blurHandle = (e) => {
152
- const { input, output } = getValue(outputValue.value, true, true);
153
- // console.log(input, output)
154
- inputValue.value = input;
155
- outputValue.value = output;
156
- emit("input", output);
157
- // emit("update:value", output);
158
- emit("blur", e);
120
+ const handleBlur = (event) => {
121
+ triggerUpdate(
122
+ userInput.value !== null ? userInput.value : innerValue.value
123
+ );
124
+ emit("blur", event);
125
+ };
126
+
127
+ const stepAction = (type) => {
128
+ if (props.disabled || props.readonly) return;
129
+
130
+ const current = isValidBig(innerValue.value) ? innerValue.value : 0;
131
+ const next =
132
+ type === "up"
133
+ ? new Big(current).plus(props.step)
134
+ : new Big(current).minus(props.step);
135
+
136
+ triggerUpdate(next.toFixed());
159
137
  };
160
138
  return () => {
161
139
  // const { suffix } = ps;
162
140
 
163
- const props = {
164
- attrs: { ...attrs, readonly: ps.readonly },
165
- // ...ps,
141
+ const inputProps = {
142
+ attrs: { ...attrs, readonly: props.readonly },
166
143
  props: {
167
144
  inputType: "input-number",
168
- value: inputValue.value,
145
+ value: displayValue.value,
169
146
  clearable: false,
170
- size: ps.size || filterSize(parentSize),
171
- disabled: ps.disabled,
172
- suffix: ps.suffix,
173
- prefix: ps.prefix,
174
- icon: ps.icon,
175
- theme: ps.theme,
176
- // placeholder: ps.placeholder,
147
+ size: props.size || filterSize(parentSize),
148
+ disabled: props.disabled,
149
+ suffix: props.suffix,
150
+ prefix: props.prefix,
151
+ icon: props.icon,
152
+ theme: props.theme,
153
+ placeholder: props.placeholder,
177
154
  },
178
155
  on: {
179
156
  ...listeners,
180
- input: (e) => {
181
- onUpdate(e);
157
+ input: handleInput,
158
+ blur: handleBlur,
159
+ keydown: (e) => {
160
+ if (e.key === "ArrowUp") {
161
+ e.preventDefault();
162
+ stepAction("up");
163
+ }
164
+ if (e.key === "ArrowDown") {
165
+ e.preventDefault();
166
+ stepAction("down");
167
+ }
182
168
  },
183
- change: (e) => {},
184
- blur: (e) => blurHandle(e),
185
- keydown: (e) => onKeyDown(e),
186
169
  },
187
- // onInput: (e) => {
188
- // onUpdate(e);
189
- // },
190
- // onChange: (e) => {},
191
- // onBlur: (e) => blurHandle(e),
192
- // onKeydown: (e) => onKeyDown(e),
193
170
  };
194
171
  return (
195
172
  <Input
196
- {...props}
173
+ {...inputProps}
197
174
  scopedSlots={{
198
175
  suffix: () => slots.suffix?.(),
199
176
  prefix: () => slots.prefix?.(),
200
177
  controls: () =>
201
- ps.controls && !ps.readonly ? (
178
+ props.controls && !props.readonly && !props.disabled ? (
202
179
  <div class="k-input-number-controls">
203
180
  <span
204
181
  class="k-input-number-control"
205
- onClick={(e) => calcValue(e, 1)}
182
+ onClick={() => stepAction("up")}
206
183
  >
207
184
  <Icon type={ChevronUp} />
208
185
  </span>
209
186
  <span
210
187
  class="k-input-number-control"
211
- onClick={(e) => calcValue(e)}
188
+ onClick={() => stepAction("down")}
212
189
  >
213
- <Icon type={ChevronUp} />
190
+ <Icon type={ChevronDown} />
214
191
  </span>
215
192
  </div>
216
193
  ) : null,
@@ -22,7 +22,7 @@
22
22
  &:not(.k-input-number-light, .k-input-number-disabled):hover {
23
23
  border-color: var(--kui-color-main);
24
24
  }
25
- &:hover:not(.k-input-number-disabled) {
25
+ &:not(.k-input-number-disabled):hover {
26
26
  .k-input-number-controls {
27
27
  opacity: 1;
28
28
  width: 20px;
@@ -111,7 +111,7 @@
111
111
  outline-offset: 1px;
112
112
  outline: 2px solid var(--kui-color-main-80);
113
113
  }
114
- .k-input-number-focus:not(.k-input-number-light) {
114
+ .k-input-number-focus:not(.k-input-number-light, .k-input-number-disabled) {
115
115
  border-color: var(--kui-color-main);
116
116
  box-shadow: 0 0 0 2px var(--kui-color-main-90);
117
117
  }
@@ -126,7 +126,7 @@
126
126
  width: auto;
127
127
  padding-right: var(--kui-padding-inline);
128
128
 
129
- &:not(.k-input-number-light):hover {
129
+ &:not(.k-input-number-light, .k-input-number-disabled):hover {
130
130
  border-color: var(--kui-color-main);
131
131
  }
132
132
 
@@ -3,18 +3,6 @@
3
3
  拥有顶部导航及侧边栏的页面,多用于展示类网站。
4
4
  </cn>
5
5
 
6
- ````vue
7
- <cn>
8
- ### 顶部-侧边布局
9
- 拥有顶部导航及侧边栏的页面,多用于展示类网站。
10
- </cn>
11
-
12
- ```vue
13
- <cn>
14
- ### 顶部-侧边布局
15
- 拥有顶部导航及侧边栏的页面,多用于展示类网站。
16
- </cn>
17
-
18
6
  ```vue
19
7
  <template>
20
8
  <div class="k-demo-layout">
@@ -39,7 +39,6 @@
39
39
  :icon="collapsed ? MenuUnfold : MenuFold"
40
40
  @click="collapsed = !collapsed"
41
41
  class="btn-collapsed"
42
- ><i></i
43
42
  ></Button>
44
43
  </div>
45
44
  <Breadcrumb class="nav">
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "Erfolg",
50
50
  failed: "gescheitert",
51
51
  errorFileSize: "illegale Dateigröße",
52
+ releaseToUpload: "Loslassen, um den Upload zu starten",
52
53
  },
53
54
  image: {
54
55
  preview: "Vorschau",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "επιτυχία",
50
50
  failed: "Αποτυχία",
51
51
  errorFileSize: "Παράνομο μέγεθος αρχείου",
52
+ releaseToUpload: "Αφήστε για να ξεκινήσει η μεταφόρτωση",
52
53
  },
53
54
  image: {
54
55
  preview: "προεπισκόπηση",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "Successful",
50
50
  failed: "Failed",
51
51
  errorFileSize: "Illegal file size",
52
+ releaseToUpload: "Release to start uploading",
52
53
  },
53
54
  image: {
54
55
  preview: "Preview",
@@ -41,6 +41,7 @@ export default {
41
41
  placeholder: "Choisir",
42
42
  loading: "Chargement...",
43
43
  emptyText: "Aucune donnée",
44
+ releaseToUpload: "Relâchez pour commencer le téléversement",
44
45
  },
45
46
  table: {
46
47
  emptyText: "Aucune donnée",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "successo",
50
50
  failed: "fail",
51
51
  errorFileSize: "Dimensione file illegale",
52
+ releaseToUpload: "Rilascia per avviare il caricamento",
52
53
  },
53
54
  image: {
54
55
  preview: "anteprima",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "成功",
50
50
  failed: "失敗",
51
51
  errorFileSize: "不法",
52
+ releaseToUpload: "離すとアップロードが開始されます",
52
53
  },
53
54
  image: {
54
55
  preview: "プレビュー",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "성취",
50
50
  failed: "패하다",
51
51
  errorFileSize: "잘못된 파일 크기",
52
+ releaseToUpload: "놓으면 업로드가 시작됩니다.",
52
53
  },
53
54
  image: {
54
55
  preview: "미리 보기",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "успешно",
50
50
  failed: "неудача",
51
51
  errorFileSize: " Неверный размер файла",
52
+ releaseToUpload: "Отпустите, чтобы начать загрузку",
52
53
  },
53
54
  image: {
54
55
  preview: "просмотр",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "สำเร็จแล้ว",
50
50
  failed: "ความล้มเหลว",
51
51
  errorFileSize: "ขนาดไฟล์ไม่ถูกต้อง",
52
+ releaseToUpload: "ปล่อยเพื่อเริ่มอัปโหลด",
52
53
  },
53
54
  image: {
54
55
  preview: "แสดงตัวอย่าง",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "успіх",
50
50
  failed: "не вдалося",
51
51
  errorFileSize: "незаконний розмір файла",
52
+ releaseToUpload: "Відпустіть, щоб розпочати завантаження",
52
53
  },
53
54
  image: {
54
55
  preview: "перегляд",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "thành công",
50
50
  failed: "thất bại",
51
51
  errorFileSize: "Phạm vi bất hợp pháp",
52
+ releaseToUpload: "Thả ra để bắt đầu tải lên",
52
53
  },
53
54
  image: {
54
55
  preview: "Xem thử",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "上传成功",
50
50
  failed: "上传失败",
51
51
  errorFileSize: "文件尺寸不合法",
52
+ releaseToUpload: "松手开始上传",
52
53
  },
53
54
  image: {
54
55
  preview: "预览",
@@ -49,6 +49,7 @@ export default {
49
49
  successful: "上傳成功",
50
50
  failed: "上傳失敗",
51
51
  errorFileSize: "檔案尺寸不合法",
52
+ releaseToUpload: "放開開始上傳",
52
53
  },
53
54
  image: {
54
55
  preview: "預覽",
@@ -23,18 +23,18 @@
23
23
  <MenuItem key="1-1" :icon="Mail">Option 1</MenuItem>
24
24
  <MenuItem key="1-2" :icon="Grid"><span>Option 2</span></MenuItem>
25
25
  <SubMenu key="sub2" :icon="Heart" title="Navigation Two">
26
- <MenuItem key="2-1">Option 5</MenuItem>
27
- <MenuItem key="2-2">Option 6</MenuItem>
28
- <SubMenu title="SubMenu" key="sub2-1">
29
- <MenuItem key="2-3">Option 7</MenuItem>
30
- <MenuItem key="2-4">Option 8</MenuItem>
26
+ <MenuItem key="2-1" :icon="Mail">Option 5</MenuItem>
27
+ <MenuItem key="2-2" :icon="Mail">Option 6</MenuItem>
28
+ <SubMenu title="SubMenu" key="sub2-1" :icon="Mail">
29
+ <MenuItem key="2-3" :icon="Mail">Option 7</MenuItem>
30
+ <MenuItem key="2-4" :icon="Mail">Option 8</MenuItem>
31
31
  </SubMenu>
32
32
  </SubMenu>
33
33
  <SubMenu key="sub3" :icon="Settings" title="Navigation Three">
34
- <MenuItem key="3-1">Option 9</MenuItem>
35
- <MenuItem key="3-2">Option 10</MenuItem>
36
- <MenuItem key="3-3">Option 11</MenuItem>
37
- <MenuItem key="3-4">Option 12</MenuItem>
34
+ <MenuItem key="3-1" :icon="Mail">Option 9</MenuItem>
35
+ <MenuItem key="3-2" :icon="Mail">Option 10</MenuItem>
36
+ <MenuItem key="3-3" :icon="Mail">Option 11</MenuItem>
37
+ <MenuItem key="3-4" :icon="Mail">Option 12</MenuItem>
38
38
  </SubMenu>
39
39
  </Menu>
40
40
  </div>
@@ -4,6 +4,7 @@
4
4
 
5
5
  | 属性 | 说明 | 类型 | 默认值 |
6
6
  | -------------------- | ---------------------------------------- | ------------------------------------------------- | -------- |
7
+ | value(v-model) | 当前选中的菜单项 | String: [] | light |
7
8
  | theme | 主题颜色 | String: light dark | light |
8
9
  | v-model:openKeys | 当前展开的 SubMenu 菜单项 key 数组 | String[] | - |
9
10
  | v-model:selectedKeys | 当前选中的菜单项,可使用 v-model 绑定 | String[] | - |