kui-vue 3.6.8 → 3.6.9

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 (51) hide show
  1. package/components/alert/demo/basic.md +2 -2
  2. package/components/alert/demo/close.md +2 -2
  3. package/components/alert/demo/customIcon.md +2 -2
  4. package/components/alert/styles/index.less +0 -1
  5. package/components/form/demo/valid.md +8 -7
  6. package/components/image/demo/group.md +1 -1
  7. package/components/image/group.jsx +10 -4
  8. package/components/image/image.jsx +47 -99
  9. package/components/image/preview.jsx +130 -116
  10. package/components/image/styles/index.less +219 -224
  11. package/components/image/utils.js +31 -0
  12. package/components/input/demo/event.md +0 -1
  13. package/components/inputNumber/styles/index.less +2 -2
  14. package/components/layout/demo/layout5.md +0 -1
  15. package/components/loading/loading.jsx +5 -21
  16. package/components/modal/styles/index.less +1 -0
  17. package/components/page/demo/basic.md +3 -3
  18. package/components/page/demo/size.md +4 -4
  19. package/components/page/demo/sizer-elevator.md +6 -6
  20. package/components/page/index.md +1 -1
  21. package/components/page/page.jsx +8 -8
  22. package/components/select/demo/theme.md +2 -1
  23. package/components/select/select.jsx +1 -1
  24. package/components/slider/demo/formatter.md +8 -9
  25. package/components/slider/slider.jsx +3 -4
  26. package/components/slider/thumb.jsx +4 -3
  27. package/components/space/demo/compact.md +9 -9
  28. package/components/styles/less-var.less +1 -1
  29. package/components/tabs/styles/index.less +2 -2
  30. package/dist/k-ui.cjs.js +2 -2
  31. package/dist/k-ui.css +2 -2
  32. package/dist/k-ui.d.ts +163 -162
  33. package/dist/k-ui.esm.js +2 -2
  34. package/dist/k-ui.umd.js +2 -2
  35. package/dist/locale/de.js +1 -1
  36. package/dist/locale/el.js +1 -1
  37. package/dist/locale/en.js +1 -1
  38. package/dist/locale/fr.js +1 -1
  39. package/dist/locale/it.js +1 -1
  40. package/dist/locale/ja.js +1 -1
  41. package/dist/locale/ko.js +1 -1
  42. package/dist/locale/ru.js +1 -1
  43. package/dist/locale/th.js +1 -1
  44. package/dist/locale/uk.js +1 -1
  45. package/dist/locale/vi.js +1 -1
  46. package/dist/locale/zh-CN.js +1 -1
  47. package/dist/locale/zh-TW.js +1 -1
  48. package/package.json +1 -2
  49. package/types/index.d.ts +14 -14
  50. package/types/page/Page.d.ts +1 -1
  51. package/types/slider/Slider.d.ts +1 -0
@@ -6,12 +6,12 @@
6
6
  ```vue
7
7
  <template>
8
8
  <Space vertical>
9
- <Page v-model:current="current" :total="100" />
9
+ <Page v-model:page="page" :total="100" />
10
10
  <code>showSizer</code>
11
- <Page v-model:current="current" :total="100" showSizer :page-size="20" />
11
+ <Page v-model:page="page" :total="100" showSizer :page-size="20" />
12
12
  <code>showElevator</code>
13
13
  <Page
14
- v-model:current="current"
14
+ v-model:page="page"
15
15
  :total="100"
16
16
  showSizer
17
17
  showElevator
@@ -20,7 +20,7 @@
20
20
  />
21
21
  <code>theme="light"</code>
22
22
  <Page
23
- v-model:current="current"
23
+ v-model:page="page"
24
24
  :total="100"
25
25
  showSizer
26
26
  showElevator
@@ -30,7 +30,7 @@
30
30
  />
31
31
  <code>disabled</code>
32
32
  <Page
33
- v-model:current="current"
33
+ v-model:page="page"
34
34
  :total="100"
35
35
  disabled
36
36
  showSizer
@@ -42,7 +42,7 @@
42
42
  </template>
43
43
  <script setup>
44
44
  import { ref } from "vue";
45
- const current = ref(3);
45
+ const page = ref(3);
46
46
  const sizeData = [30, 50, 80, 100];
47
47
  </script>
48
48
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  | 属性 | 说明 | 类型 | 默认值 |
4
4
  | ------------- | ---------------------------------------- | ----------------------- | ---------------- |
5
- | current | 当前页码 | Number | 1 |
5
+ | page | 当前页码 | Number | 1 |
6
6
  | total | 数据总数 | Number | 0 |
7
7
  | page-size | 每页条数 | Number | 10 |
8
8
  | show-sizer | 是否显示页码组 | Boolean | false |
@@ -28,13 +28,13 @@ const Page = defineComponent({
28
28
  },
29
29
  total: { default: 0, type: Number },
30
30
  pageSize: { default: 10, type: Number },
31
- current: { default: 1, type: Number },
31
+ page: { default: 1, type: Number },
32
32
  },
33
33
  setup(ps, { emit }) {
34
34
  const nextPageGroup = ref(false);
35
35
  const prevPageGroup = ref(false);
36
36
  const pageCount = ref(Math.ceil(ps.total / ps.pageSize) || 1);
37
- const defaultPage = ref(ps.current);
37
+ const defaultPage = ref(ps.page);
38
38
  const defaultPageSize = ref(ps.pageSize);
39
39
  const injectedLocale = inject("locale", zhCN);
40
40
 
@@ -58,7 +58,7 @@ const Page = defineComponent({
58
58
  );
59
59
 
60
60
  watch(
61
- () => ps.current,
61
+ () => ps.page,
62
62
  (v) => {
63
63
  defaultPage.value = v;
64
64
  resetPage();
@@ -164,7 +164,7 @@ const Page = defineComponent({
164
164
  if (ps.disabled) return;
165
165
  if (defaultPage.value > 1) {
166
166
  defaultPage.value--;
167
- emit("update:current", defaultPage.value);
167
+ emit("update:page", defaultPage.value);
168
168
  emit("change", defaultPage.value, defaultPageSize.value);
169
169
  }
170
170
  };
@@ -172,7 +172,7 @@ const Page = defineComponent({
172
172
  if (ps.disabled) return;
173
173
  if (defaultPage.value < pageCount.value) {
174
174
  defaultPage.value++;
175
- emit("update:current", defaultPage.value);
175
+ emit("update:page", defaultPage.value);
176
176
  emit("change", defaultPage.value, defaultPageSize.value);
177
177
  }
178
178
  };
@@ -188,7 +188,7 @@ const Page = defineComponent({
188
188
  page = pageCount.value;
189
189
  }
190
190
  defaultPage.value = page;
191
- emit("update:current", page);
191
+ emit("update:page", page);
192
192
  emit("change", defaultPage.value, defaultPageSize.value);
193
193
  };
194
194
  const changeSize = (value) => {
@@ -196,7 +196,7 @@ const Page = defineComponent({
196
196
  pageCount.value = Math.ceil(ps.total / defaultPageSize.value) || 1;
197
197
  if (defaultPage.value > pageCount.value) {
198
198
  defaultPage.value = pageCount.value;
199
- emit("update:current", defaultPage.value);
199
+ emit("update:page", defaultPage.value);
200
200
  }
201
201
  emit("change", defaultPage.value, defaultPageSize.value);
202
202
  };
@@ -280,7 +280,7 @@ const Page = defineComponent({
280
280
 
281
281
  if ((page >= 1 || page <= pCount) && defaultPage.value != page) {
282
282
  defaultPage.value = page;
283
- emit("update:current", page);
283
+ emit("update:page", page);
284
284
  emit("change", page, defaultPageSize.value);
285
285
  }
286
286
  nextTick(() => {
@@ -40,9 +40,10 @@
40
40
  </Space>
41
41
  </template>
42
42
  <script setup>
43
+ import { ref } from "vue";
43
44
  import { Search, CaretDown } from "kui-icons";
44
45
 
45
- const value = ["1", "3"];
46
+ const value = ref(["1", "3"]);
46
47
  const options = [
47
48
  { label: "Apple", value: "1" },
48
49
  { label: "Orange", value: "2" },
@@ -339,7 +339,7 @@ const Select = defineComponent({
339
339
  const emitValue = () => {
340
340
  const result = ps.multiple
341
341
  ? currentValue.value
342
- : currentValue.value[0] || null;
342
+ : currentValue.value[0];
343
343
  emit("input", result);
344
344
  emit("change", result);
345
345
  };
@@ -1,19 +1,18 @@
1
1
  <cn>
2
2
  ### 自定义提示
3
- 使用 tipFormatter 可以设置 Tooltip 的显示的格式。设置 tipFormatter={null},则隐藏 Tooltip。
3
+ 使用 tipFormatter 可以设置 Tooltip 的显示的格式。
4
4
  当 tooltipVisible 为 true 时,将始终显示 ToolTip;反之则始终不显示,即使在拖动、移入时也是如此。
5
5
  </cn>
6
6
 
7
7
  ```vue
8
8
  <template>
9
- <div style="max-width:520px;">
9
+ <Space style="max-width:520px;" vertical block>
10
+ <code>show %</code>
10
11
  <Slider :tipFormatter="(v) => `${v}%`" :value="20" />
11
- <br />
12
- <br />
13
- <Slider :tipFormatter="null" :value="10" />
14
- <br />
15
- <br />
16
- <Slider :value="10" :tooltipVisible="true" />
17
- </div>
12
+ <code>hide tooltip</code>
13
+ <Slider :tooltipVisible="false" :value="20" />
14
+ <code>show tooltip for ever</code>
15
+ <Slider :value="70" :tooltipVisible="true" />
16
+ </Space>
18
17
  </template>
19
18
  ```
@@ -19,7 +19,7 @@ const Slider = defineComponent({
19
19
  size: [String, Number],
20
20
  included: { type: Boolean, default: true },
21
21
  tipFormatter: Function,
22
- tooltipVisible: Boolean,
22
+ tooltipVisible: { type: Boolean, default: null },
23
23
  },
24
24
  emits: ["input", "change"],
25
25
 
@@ -60,7 +60,7 @@ const Slider = defineComponent({
60
60
  internalValue.value = formatValue(nv);
61
61
  }
62
62
  },
63
- { immediate: true }
63
+ { immediate: true },
64
64
  );
65
65
 
66
66
  const getPercent = (val) => {
@@ -169,7 +169,6 @@ const Slider = defineComponent({
169
169
  let [e1, e2] = touch
170
170
  ? ["touchmove", "touchend"]
171
171
  : ["mousemove", "mouseup"];
172
- console.log(e1,e2,222);
173
172
  const onMove = (e) => handleThumbMove(e);
174
173
  const onUp = () => {
175
174
  draggingIndex.value = -1;
@@ -210,7 +209,7 @@ const Slider = defineComponent({
210
209
  }
211
210
  } else {
212
211
  nextValue = Number(
213
- new Big(targetValue).plus(isPlus ? props.step : -props.step)
212
+ new Big(targetValue).plus(isPlus ? props.step : -props.step),
214
213
  );
215
214
  }
216
215
 
@@ -10,7 +10,7 @@ export default defineComponent({
10
10
  reverse: Boolean,
11
11
  disabled: Boolean,
12
12
  size: [String, Number],
13
- tooltipVisible: Boolean,
13
+ tooltipVisible: { type: Boolean, default: null },
14
14
  tipFormatter: Function,
15
15
  dragging: Boolean, // 接收父组件传入的拖拽状态
16
16
  },
@@ -31,7 +31,7 @@ export default defineComponent({
31
31
  if (diff === 0) return 0;
32
32
  return Math.max(
33
33
  0,
34
- Math.min(100, ((props.value - props.min) / diff) * 100)
34
+ Math.min(100, ((props.value - props.min) / diff) * 100),
35
35
  );
36
36
  });
37
37
 
@@ -63,6 +63,7 @@ export default defineComponent({
63
63
  return (
64
64
  <Tooltip
65
65
  title={displayValue}
66
+ disabled={props.disabled || props.tooltipVisible === false}
66
67
  show={showTooltip && !props.disabled}
67
68
  placement={props.vertical ? "right" : "top"}
68
69
  >
@@ -76,7 +77,7 @@ export default defineComponent({
76
77
  ]}
77
78
  style={thumbStyle.value}
78
79
  ref={elRef}
79
- tabindex={props.disabled ? -1 : 0}
80
+ tabindex={props.disabled ? null : 0}
80
81
  onMousedown={handleDown}
81
82
  onTouchstart={handleDown}
82
83
  onKeydown={(e) => emit("keydownUpdate", e)}
@@ -5,10 +5,10 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <Space vertical size="middle">
9
- <Space compact>
10
- <Input style="width:20%" value="027" />
11
- <Input style="width:30%" value="28398987" />
8
+ <Space vertical size="middle" block style="max-width: 520px">
9
+ <Space compact :style="{ width: '50%' }">
10
+ <Input :style="{ width: '50%' }" value="027" />
11
+ <Input :style="{ width: '50%' }" value="28398987" />
12
12
  </Space>
13
13
  <Space compact size="small" block>
14
14
  <Input :style="{ width: 'calc(100% - 200px)' }" value="https://k-ui.cn" />
@@ -46,12 +46,12 @@
46
46
  </Select>
47
47
  <Input :style="{ width: '50%' }" value="Nanshan District, Shenzheng" />
48
48
  </Space>
49
- <Space compact>
49
+ <Space compact block>
50
50
  <Input :style="{ width: '30%' }" value="0755" />
51
51
  <Input clearable :style="{ width: '50%' }" value="28398987" />
52
52
  <Input :style="{ width: '20%' }" value="+1" />
53
53
  </Space>
54
- <Space compact>
54
+ <Space compact block>
55
55
  <Select value="Option1">
56
56
  <Option value="Option1">Option1</Option>
57
57
  <Option value="Option2">Option2</Option>
@@ -59,16 +59,16 @@
59
59
  <Input :style="{ width: '50%' }" value="input content" />
60
60
  <InputNumber :value="12" />
61
61
  </Space>
62
- <Space compact>
62
+ <Space compact block>
63
63
  <Input :style="{ width: '50%' }" value="input content" />
64
64
  <DatePicker />
65
65
  </Space>
66
- <Space compact>
66
+ <Space compact block>
67
67
  <DatePicker mode="dateRange" />
68
68
  <Input :style="{ width: '30%' }" value="input content" />
69
69
  <Button type="primary">查询</Button>
70
70
  </Space>
71
- <Space compact>
71
+ <Space compact block>
72
72
  <Input :style="{ width: '30%' }" value="input content" />
73
73
  <DatePicker mdoe="dateRange" />
74
74
  </Space>
@@ -222,7 +222,7 @@
222
222
  // 边框颜色
223
223
  @outline-color: @main-8;
224
224
  @border-color: #e9e9e9;
225
- @dark-border-color: #262626;
225
+ @dark-border-color: #333;
226
226
 
227
227
  @pop-border-color: #e7e7e7;
228
228
  @dark-pop-border-color: #313131;
@@ -172,12 +172,12 @@
172
172
  .k-tabs-tab {
173
173
  margin-right: 2px;
174
174
  border: 1px solid var(--kui-color-border);
175
- border-bottom-color: transparent;
176
175
  padding: 8px 16px;
176
+ background: var(--kui-color-bg-1);
177
177
  }
178
178
 
179
179
  .k-tabs-tab-active {
180
- background: var(--kui-color-back);
180
+ background: var(--kui-color-bg);
181
181
  border-bottom-color: transparent;
182
182
 
183
183
  &::after {