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.
- package/{readme.md → README.md} +4 -10
- package/components/button/demo/group.md +1 -1
- package/components/button/demo/size.md +1 -1
- package/components/card/card.jsx +1 -1
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +5 -5
- package/components/checkbox/demo/group.md +17 -6
- package/components/checkbox/styles/index.less +4 -11
- package/components/collapse/collapse.jsx +9 -10
- package/components/collapse/demo/accordion.md +2 -2
- package/components/collapse/demo/basic.md +2 -2
- package/components/collapse/demo/extra.md +2 -2
- package/components/collapse/demo/nesting.md +4 -4
- package/components/collapse/demo/sample.md +2 -2
- package/components/collapse/index.md +6 -6
- package/components/colorPicker/colorpicker.jsx +5 -6
- package/components/colorPicker/demo/basic.md +14 -2
- package/components/colorPicker/demo/customTrigger.md +2 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/datePicker/datepicker.jsx +19 -11
- package/components/datePicker/demo/basic.md +15 -6
- package/components/datePicker/demo/lang.md +2 -2
- package/components/datePicker/demo/size.md +1 -1
- package/components/drawer/drawer.jsx +2 -2
- package/components/dropdown/dropdown.jsx +9 -40
- package/components/dropdown/dropdownButton.jsx +18 -7
- package/components/empty/demo/basic.md +1 -3
- package/components/empty/demo/nodesc.md +1 -3
- package/components/empty/demo/used.md +4 -6
- package/components/empty/empty.jsx +19 -17
- package/components/empty/styles/index.less +18 -5
- package/components/form/demo/align.md +10 -10
- package/components/form/demo/valid.md +3 -2
- package/components/form/form.jsx +1 -1
- package/components/form/formitem.jsx +1 -1
- package/components/image/image.jsx +1 -0
- package/components/image/preview.jsx +1 -1
- package/components/input/demo/basic.md +1 -1
- package/components/input/demo/group.md +1 -1
- package/components/input/index.md +1 -1
- package/components/input/input.jsx +7 -5
- package/components/input/inputBox.jsx +2 -2
- package/components/inputNumber/demo/basic.md +12 -5
- package/components/inputNumber/demo/format.md +0 -5
- package/components/inputNumber/index.md +1 -1
- package/components/inputNumber/inputNumber.jsx +3 -5
- package/components/inputNumber/styles/index.less +64 -64
- package/components/menu/submenu.jsx +5 -5
- package/components/message/demo/close.md +1 -1
- package/components/message/group.jsx +2 -2
- package/components/message/index.md +1 -1
- package/components/message/inner.jsx +26 -7
- package/components/notice/demo/close.md +1 -1
- package/components/notice/index.md +1 -1
- package/components/page/page.jsx +0 -1
- package/components/page/styles/index.less +7 -1
- package/components/popconfirm/popconfirm.jsx +18 -20
- package/components/poptip/poptip.jsx +4 -4
- package/components/progress/progress.jsx +1 -1
- package/components/radio/demo/group.md +16 -6
- package/components/radio/demo/radioButton.md +3 -8
- package/components/radio/radio.jsx +14 -11
- package/components/radio/radioButton.jsx +1 -1
- package/components/radio/radioGroup.jsx +9 -12
- package/components/radio/styles/index.less +10 -21
- package/components/rate/demo/basic.md +12 -2
- package/components/rate/demo/character.md +16 -2
- package/components/rate/demo/index.jsx +0 -8
- package/components/rate/demo/tips.md +15 -5
- package/components/rate/rate.jsx +24 -5
- package/components/select/demo/basic.md +16 -7
- package/components/select/demo/filterable.md +4 -2
- package/components/select/demo/size.md +1 -1
- package/components/select/index.md +23 -22
- package/components/select/option.jsx +7 -3
- package/components/select/select.jsx +43 -37
- package/components/select/styles/index.less +1 -0
- package/components/slider/demo/basic.md +2 -1
- package/components/slider/demo/withNumber.md +3 -3
- package/components/slider/slider.jsx +0 -25
- package/components/space/styles/index.less +5 -1
- package/components/spin/index.md +6 -5
- package/components/styles/sys.less +3 -0
- package/components/switch/switch.jsx +13 -5
- package/components/table/demo/size.md +1 -1
- package/components/table/styles/index.less +10 -5
- package/components/table/table.jsx +98 -69
- package/components/tabs/tabs.jsx +1 -1
- package/components/tooltip/tooltip.jsx +16 -11
- package/components/treeselect/demo/basic.md +11 -8
- package/components/treeselect/demo/size.md +6 -5
- package/components/treeselect/demo/theme.md +0 -1
- package/components/treeselect/treeselect.jsx +15 -20
- package/components/upload/upload.jsx +0 -1
- package/components/utils/placement.js +162 -124
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +131 -127
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +2 -2
- package/dist/locale/uk.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zh-CN.js +1 -1
- package/dist/locale/zh-TW.js +1 -1
- package/package.json +5 -5
- package/test/i18n@8.x.html +6 -2
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/image/KImage.d.ts +1 -0
- package/types/index.d.ts +12 -12
- package/types/popconfirm/Popconfirm.d.ts +1 -0
- package/types/radio/Radio.d.ts +1 -1
- package/types/radio/RadioButton.d.ts +1 -1
- package/types/switch/Switch.d.ts +2 -1
- package/types/tooltip/Tooltip.d.ts +1 -0
- package/components/base/collapse.jsx +0 -15
- package/components/base/input.jsx +0 -210
- package/components/colorPicker/demo/disabled.md +0 -16
- package/components/colorPicker/demo/disabledAlpha.md +0 -13
- package/components/colorPicker/demo/mode.md +0 -24
- package/components/colorPicker/demo/presets.md +0 -17
- package/components/rate/demo/clear.md +0 -13
- package/components/rate/demo/custom.md +0 -23
- package/components/rate/demo/disabled.md +0 -12
- package/components/rate/demo/half.md +0 -12
- package/components/steps/index.js +0 -4
- package/components/steps/step.vue +0 -82
- package/components/steps/steps.vue +0 -68
- package/components/steps/styles/index.less +0 -198
- package/components/utils/element.js +0 -122
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
watch,
|
|
16
16
|
nextTick,
|
|
17
17
|
inject,
|
|
18
|
-
toRefs,
|
|
19
18
|
// Transition,
|
|
20
19
|
onBeforeMount,
|
|
21
20
|
onMounted,
|
|
22
21
|
computed,
|
|
22
|
+
onBeforeUpdate,
|
|
23
23
|
// cloneVNode,
|
|
24
24
|
} from "vue";
|
|
25
25
|
|
|
@@ -77,7 +77,7 @@ const Select = defineComponent({
|
|
|
77
77
|
: injectedLocale;
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
const labelText = ref([]);
|
|
80
|
+
// const labelText = ref([]);
|
|
81
81
|
const visible = ref(false);
|
|
82
82
|
const rendered = ref(false);
|
|
83
83
|
const currentValue = ref(
|
|
@@ -92,47 +92,50 @@ const Select = defineComponent({
|
|
|
92
92
|
const hasSearchEvent = "search" in listeners;
|
|
93
93
|
const refPopper = ref();
|
|
94
94
|
const transOrigin = ref("bottom");
|
|
95
|
-
const
|
|
95
|
+
const refSelection = ref();
|
|
96
96
|
const left = ref(0);
|
|
97
97
|
const top = ref(0);
|
|
98
98
|
const currentPlacement = ref(ps.placement);
|
|
99
99
|
const queryInputEventTimer = ref();
|
|
100
|
-
|
|
101
100
|
const activeIndex = ref(-1);
|
|
102
101
|
|
|
103
102
|
const reallySize = ref(0);
|
|
104
103
|
const ctxFocused = ref(false);
|
|
104
|
+
const updateTrigger = ref(0);
|
|
105
|
+
|
|
106
|
+
onBeforeUpdate(() => {
|
|
107
|
+
updateTrigger.value++;
|
|
108
|
+
});
|
|
109
|
+
|
|
105
110
|
watch(
|
|
106
111
|
() => ps.placement,
|
|
107
112
|
(v) => {
|
|
108
113
|
currentPlacement.value = v;
|
|
109
|
-
|
|
114
|
+
if (visible.value) {
|
|
115
|
+
updatePosition();
|
|
116
|
+
}
|
|
110
117
|
}
|
|
111
118
|
);
|
|
112
119
|
watch(
|
|
113
120
|
() => ps.options,
|
|
114
121
|
(v) => {
|
|
115
|
-
updateLabel();
|
|
116
|
-
// 如果下拉框是打开状态,重新计算位置(防止数据变多导致高度变化)
|
|
117
122
|
if (visible.value) {
|
|
118
123
|
updatePosition();
|
|
119
124
|
}
|
|
120
125
|
},
|
|
121
126
|
{ deep: true }
|
|
122
127
|
);
|
|
128
|
+
|
|
123
129
|
watch(
|
|
124
130
|
() => ps.value,
|
|
125
131
|
(v) => {
|
|
126
132
|
currentValue.value = ps.multiple ? v || [] : isEmpty(v) ? [] : [v];
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
if (visible.value) {
|
|
134
|
+
updatePosition();
|
|
135
|
+
}
|
|
129
136
|
}
|
|
130
137
|
);
|
|
131
|
-
|
|
132
|
-
// // 影响外层 scroll
|
|
133
|
-
// const item = refPopper.value.children[0].children[activeIndex.value];
|
|
134
|
-
// item.scrollIntoView({ block: "center" });
|
|
135
|
-
// };
|
|
138
|
+
|
|
136
139
|
const scrollOptionIntoView = () => {
|
|
137
140
|
const containerEl = refPopper.value;
|
|
138
141
|
const optionEl = refPopper.value.children[0].children[activeIndex.value];
|
|
@@ -198,11 +201,17 @@ const Select = defineComponent({
|
|
|
198
201
|
document.removeEventListener("click", outsideClick);
|
|
199
202
|
});
|
|
200
203
|
|
|
204
|
+
const labelText = computed(() => {
|
|
205
|
+
return optionsData.value
|
|
206
|
+
.filter((item) => currentValue.value.includes(item.value))
|
|
207
|
+
.map((item) => item.label);
|
|
208
|
+
});
|
|
209
|
+
|
|
201
210
|
const updatePosition = () => {
|
|
202
211
|
nextTick(() => {
|
|
203
|
-
minWidth.value =
|
|
212
|
+
minWidth.value = refSelection.value?.offsetWidth;
|
|
204
213
|
setPlacement({
|
|
205
|
-
|
|
214
|
+
refSelection,
|
|
206
215
|
refPopper,
|
|
207
216
|
currentPlacement,
|
|
208
217
|
transOrigin,
|
|
@@ -214,14 +223,13 @@ const Select = defineComponent({
|
|
|
214
223
|
|
|
215
224
|
onMounted(() => {
|
|
216
225
|
nextTick(() => {
|
|
217
|
-
minWidth.value =
|
|
218
|
-
updateLabel();
|
|
226
|
+
minWidth.value = refSelection.value?.offsetWidth;
|
|
219
227
|
});
|
|
220
228
|
document.addEventListener("keydown", onKeydown);
|
|
221
229
|
});
|
|
222
230
|
|
|
223
231
|
const outsideClick = (e) => {
|
|
224
|
-
const ctx =
|
|
232
|
+
const ctx = refSelection.value?.$el || refSelection.value;
|
|
225
233
|
if (
|
|
226
234
|
refPopper.value &&
|
|
227
235
|
!refPopper.value.contains(e.target) &&
|
|
@@ -266,10 +274,8 @@ const Select = defineComponent({
|
|
|
266
274
|
if (currentValue.value?.indexOf(value) >= 0) {
|
|
267
275
|
selected = false;
|
|
268
276
|
currentValue.value = currentValue.value.filter((v) => v !== value);
|
|
269
|
-
labelText.value = labelText.value.filter((v) => v !== label);
|
|
270
277
|
} else {
|
|
271
278
|
currentValue.value.push(value);
|
|
272
|
-
labelText.value.push(label);
|
|
273
279
|
}
|
|
274
280
|
updatePosition();
|
|
275
281
|
if (hasSearchEvent || ps.filterable) {
|
|
@@ -279,9 +285,8 @@ const Select = defineComponent({
|
|
|
279
285
|
}
|
|
280
286
|
} else {
|
|
281
287
|
currentValue.value = [value];
|
|
282
|
-
labelText.value = [label];
|
|
283
|
-
// toggle();
|
|
284
288
|
visible.value = false;
|
|
289
|
+
emit("openChange", false);
|
|
285
290
|
clearQuery();
|
|
286
291
|
activeIndex.value = -1;
|
|
287
292
|
}
|
|
@@ -290,7 +295,7 @@ const Select = defineComponent({
|
|
|
290
295
|
emit("input", result);
|
|
291
296
|
|
|
292
297
|
emit("change", result);
|
|
293
|
-
emit("select", value, label, selected);
|
|
298
|
+
emit("select", { value, label, selected });
|
|
294
299
|
};
|
|
295
300
|
const searchInput = (e) => {
|
|
296
301
|
queryKey.value = e.target.value;
|
|
@@ -307,10 +312,12 @@ const Select = defineComponent({
|
|
|
307
312
|
document.addEventListener("click", outsideClick);
|
|
308
313
|
nextTick(() => {
|
|
309
314
|
visible.value = true;
|
|
315
|
+
emit("openChange", true);
|
|
310
316
|
updatePosition();
|
|
311
317
|
});
|
|
312
318
|
} else {
|
|
313
319
|
visible.value = true;
|
|
320
|
+
emit("openChange", true);
|
|
314
321
|
updatePosition();
|
|
315
322
|
}
|
|
316
323
|
emit("search", e);
|
|
@@ -330,13 +337,11 @@ const Select = defineComponent({
|
|
|
330
337
|
const removeTag = (e, index) => {
|
|
331
338
|
if (ps.disabled) return;
|
|
332
339
|
currentValue.value.splice(index, 1);
|
|
333
|
-
labelText.value.splice(index, 1);
|
|
334
340
|
e.stopPropagation();
|
|
335
341
|
updatePosition();
|
|
336
342
|
};
|
|
337
343
|
const onClear = (e) => {
|
|
338
344
|
currentValue.value = [];
|
|
339
|
-
labelText.value = [];
|
|
340
345
|
emit("input", ps.multiple ? [] : "");
|
|
341
346
|
emit("change", ps.multiple ? [] : "");
|
|
342
347
|
clearQuery();
|
|
@@ -365,11 +370,13 @@ const Select = defineComponent({
|
|
|
365
370
|
document.addEventListener("click", outsideClick);
|
|
366
371
|
nextTick(() => {
|
|
367
372
|
visible.value = true;
|
|
373
|
+
emit("openChange", true);
|
|
368
374
|
updatePosition();
|
|
369
375
|
showQuery();
|
|
370
376
|
});
|
|
371
377
|
} else {
|
|
372
378
|
visible.value = show || !visible.value;
|
|
379
|
+
emit("openChange", visible.value);
|
|
373
380
|
if (visible.value) {
|
|
374
381
|
updatePosition();
|
|
375
382
|
showQuery();
|
|
@@ -379,12 +386,8 @@ const Select = defineComponent({
|
|
|
379
386
|
}
|
|
380
387
|
};
|
|
381
388
|
|
|
382
|
-
const updateLabel = () => {
|
|
383
|
-
labelText.value = optionsData.value
|
|
384
|
-
.filter((item) => currentValue.value.includes(item.value))
|
|
385
|
-
.map((item) => item.label);
|
|
386
|
-
};
|
|
387
389
|
const optionsData = computed(() => {
|
|
390
|
+
updateTrigger.value;
|
|
388
391
|
let { options, loading } = ps;
|
|
389
392
|
if (loading) return [];
|
|
390
393
|
if (!options) {
|
|
@@ -405,7 +408,7 @@ const Select = defineComponent({
|
|
|
405
408
|
});
|
|
406
409
|
const filterOptions = () => {
|
|
407
410
|
const key = queryKey.value;
|
|
408
|
-
const filter = ps.filterable &&
|
|
411
|
+
const filter = ps.filterable && key.trim() !== "";
|
|
409
412
|
return filter
|
|
410
413
|
? optionsData.value.filter((item) =>
|
|
411
414
|
item.label.toLowerCase().includes(key.toLowerCase())
|
|
@@ -444,7 +447,6 @@ const Select = defineComponent({
|
|
|
444
447
|
ps.multiple &&
|
|
445
448
|
currentValue.value.length > 0
|
|
446
449
|
) {
|
|
447
|
-
labelText.value = labelText.value.slice(0, -1);
|
|
448
450
|
currentValue.value = currentValue.value.slice(0, -1);
|
|
449
451
|
emit("input", currentValue.value);
|
|
450
452
|
// emit("update:value", currentValue.value);
|
|
@@ -457,13 +459,17 @@ const Select = defineComponent({
|
|
|
457
459
|
}
|
|
458
460
|
};
|
|
459
461
|
const showClear = computed(() => {
|
|
460
|
-
return
|
|
462
|
+
return (
|
|
463
|
+
ps.clearable &&
|
|
464
|
+
!ps.disabled &&
|
|
465
|
+
!isEmpty(currentValue.value) &&
|
|
466
|
+
!isEmpty(labelText.value)
|
|
467
|
+
);
|
|
461
468
|
});
|
|
462
469
|
const renderOverlay = () => {
|
|
463
|
-
const optionNodes = renderOptions();
|
|
464
|
-
|
|
465
470
|
let overlay = null;
|
|
466
471
|
if (rendered.value) {
|
|
472
|
+
const optionNodes = renderOptions();
|
|
467
473
|
const preCls = "k-select";
|
|
468
474
|
const props = {
|
|
469
475
|
ref: refPopper,
|
|
@@ -642,7 +648,7 @@ const Select = defineComponent({
|
|
|
642
648
|
onClick={toggle}
|
|
643
649
|
onFocus={() => (ctxFocused.value = true)}
|
|
644
650
|
onBlur={() => (ctxFocused.value = false)}
|
|
645
|
-
ref={
|
|
651
|
+
ref={refSelection}
|
|
646
652
|
>
|
|
647
653
|
{icon ? <Icon type={icon} class="k-select-icon" /> : null}
|
|
648
654
|
<div class="k-select-selection">{childNode}</div>
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space style="max-width:520px;" vertical block>
|
|
9
|
-
<code>value: {{ v1 }}</code>
|
|
10
9
|
<code>Disabled: <k-switch v-model="disabled" /></code>
|
|
10
|
+
<code>v-model: {{ v1 }}</code>
|
|
11
11
|
<Slider v-model="v1" :step="10" :disabled="disabled" :min="20" />
|
|
12
|
+
<code>v-model: {{ v2 }}</code>
|
|
12
13
|
<Slider v-model="v2" range :disabled="disabled" :min="10" :max="80" />
|
|
13
14
|
<Slider
|
|
14
15
|
:marks="{ 0: '0°C', 25: '25°C', 36: '36°C', 100: '100°C' }"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<div>
|
|
9
9
|
<Row>
|
|
10
10
|
<Col :span="12">
|
|
11
|
-
<Slider v-model="n1" :min="1" :max="20" />
|
|
11
|
+
<Slider v-model:value="n1" :min="1" :max="20" />
|
|
12
12
|
</Col>
|
|
13
13
|
<Col :span="4">
|
|
14
14
|
<InputNumber
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
</Row>
|
|
22
22
|
<Row>
|
|
23
23
|
<Col :span="12">
|
|
24
|
-
<Slider v-model="n2" :min="0" :max="1" :step="0.01" />
|
|
24
|
+
<Slider v-model:value="n2" :min="0" :max="1" :step="0.01" />
|
|
25
25
|
</Col>
|
|
26
26
|
<Col :span="4">
|
|
27
27
|
<InputNumber
|
|
28
|
-
v-model="n2"
|
|
28
|
+
v-model:value="n2"
|
|
29
29
|
:min="0"
|
|
30
30
|
:max="1"
|
|
31
31
|
:step="0.01"
|
|
@@ -128,37 +128,12 @@ const Slider = defineComponent({
|
|
|
128
128
|
const v = ps.range ? [...defaultValue.value] : defaultValue.value;
|
|
129
129
|
let newValue = null;
|
|
130
130
|
if (ps.range) {
|
|
131
|
-
// todo:
|
|
132
|
-
// v = type === "right" ? [v[0], x] : [x, v[1]];
|
|
133
|
-
// 可以交叉
|
|
134
131
|
let [a, b] = [...v];
|
|
135
|
-
// let x1 = Math.min(a, b, x);
|
|
136
|
-
// let y1 = Math.max(a, b, x);
|
|
137
132
|
if (type == "right") {
|
|
138
|
-
// if (x > a) {
|
|
139
|
-
// newValue = [a, x];
|
|
140
|
-
// } else if (x < a) {
|
|
141
|
-
// newValue = [x, b ];
|
|
142
|
-
// } else {
|
|
143
|
-
// console.log(a, b, x);
|
|
144
133
|
newValue = [a, x];
|
|
145
|
-
// }
|
|
146
134
|
} else {
|
|
147
135
|
newValue = [x, b];
|
|
148
136
|
}
|
|
149
|
-
|
|
150
|
-
// let [x1, y1] = [...newValue];
|
|
151
|
-
// if (x1 > y1) {
|
|
152
|
-
// newValue = [y1, x1];
|
|
153
|
-
// }
|
|
154
|
-
// console.log(x1,y1);
|
|
155
|
-
|
|
156
|
-
// 不能交叉
|
|
157
|
-
// if (type === "right") {
|
|
158
|
-
// v = [v[0], Math.max(v[0], x)]; // 右边不能小于左边
|
|
159
|
-
// } else {
|
|
160
|
-
// v = [Math.min(x, v[1]), v[1]]; // 左边不能大于右边
|
|
161
|
-
// }
|
|
162
137
|
} else {
|
|
163
138
|
newValue = x;
|
|
164
139
|
}
|
package/components/spin/index.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
## Radio API
|
|
2
2
|
|
|
3
|
-
| 属性 | 说明 | 类型
|
|
4
|
-
| ----- | --------------------------------------------- |
|
|
5
|
-
| value | 是否加载状态,可以使用 `v-model` 双向绑定数据 | Boolean
|
|
6
|
-
| mode | 展示spin类型,提供4中展示方式 | String
|
|
7
|
-
| delay | 延迟显示加载效果的时间(防止闪烁) | Number (毫秒)
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| ----- | --------------------------------------------- | --------------------- | ------ |
|
|
5
|
+
| value | 是否加载状态,可以使用 `v-model` 双向绑定数据 | Boolean | false |
|
|
6
|
+
| mode | 展示spin类型,提供4中展示方式 | String | - |
|
|
7
|
+
| delay | 延迟显示加载效果的时间(防止闪烁) | Number (毫秒) | 500 |
|
|
8
|
+
| size | 设置加载效果的大小 | `large,default,small` | - |
|
|
@@ -24,12 +24,15 @@ textarea::placeholder {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&::-webkit-scrollbar-track {
|
|
27
|
+
background-color: transparent;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&::-webkit-scrollbar-thumb {
|
|
30
31
|
border-radius: 8px;
|
|
31
32
|
width: 6px;
|
|
32
33
|
height: 6px;
|
|
34
|
+
min-height: 55px;
|
|
35
|
+
min-width: 55px;
|
|
33
36
|
background-color: var(--kui-color-border);
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { Loading } from "kui-icons";
|
|
3
3
|
import { defineComponent, ref, watch } from "vue";
|
|
4
|
-
import { withInstall } from
|
|
4
|
+
import { withInstall } from "../utils/vue";
|
|
5
5
|
const Switch = defineComponent({
|
|
6
6
|
name: "KSwitch",
|
|
7
|
+
model: {
|
|
8
|
+
prop: "checked",
|
|
9
|
+
event: "input",
|
|
10
|
+
},
|
|
7
11
|
props: {
|
|
12
|
+
checked: {
|
|
13
|
+
type: [Boolean, Number],
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
8
16
|
// checked: [Boolean, Number], //for 3
|
|
9
|
-
value: [Boolean, Number], //for 3
|
|
10
17
|
type: String,
|
|
11
18
|
disabled: Boolean,
|
|
12
19
|
loading: Boolean,
|
|
@@ -20,9 +27,9 @@ const Switch = defineComponent({
|
|
|
20
27
|
falseText: String,
|
|
21
28
|
},
|
|
22
29
|
setup(ps, { slots, emit }) {
|
|
23
|
-
const isChecked = ref(ps.
|
|
30
|
+
const isChecked = ref(ps.checked);
|
|
24
31
|
watch(
|
|
25
|
-
() => ps.
|
|
32
|
+
() => ps.checked,
|
|
26
33
|
(nv, no) => {
|
|
27
34
|
isChecked.value = nv;
|
|
28
35
|
}
|
|
@@ -69,7 +76,8 @@ const Switch = defineComponent({
|
|
|
69
76
|
class={classes}
|
|
70
77
|
onClick={change}
|
|
71
78
|
disabled={disabled || loading}
|
|
72
|
-
type="button"
|
|
79
|
+
type="button"
|
|
80
|
+
>
|
|
73
81
|
{textNode}
|
|
74
82
|
{loadNode}
|
|
75
83
|
</button>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<div>
|
|
9
9
|
<Space>
|
|
10
|
-
Size:<RadioGroup v-model="size" size="small">
|
|
10
|
+
Size:<RadioGroup v-model="size" size="small" type="button">
|
|
11
11
|
<RadioButton value="large" label="Large" />
|
|
12
12
|
<RadioButton value="default" label="Default" />
|
|
13
13
|
<RadioButton value="small" label="Small" />
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
z-index: 3;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.k-table-cell-fix-left
|
|
20
|
-
position: sticky;
|
|
21
|
-
}
|
|
22
|
-
|
|
19
|
+
.k-table-cell-fix-left,
|
|
23
20
|
.k-table-cell-fix-right {
|
|
24
21
|
position: sticky;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
backface-visibility: hidden;
|
|
24
|
+
-webkit-backface-visibility: hidden;
|
|
25
|
+
will-change: transform;
|
|
26
|
+
contain: layout;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
.k-spin {
|
|
@@ -328,7 +330,10 @@
|
|
|
328
330
|
padding: 20px 16px;
|
|
329
331
|
}
|
|
330
332
|
}
|
|
331
|
-
|
|
333
|
+
.k-table-body {
|
|
334
|
+
-webkit-overflow-scrolling: touch;
|
|
335
|
+
will-change: scroll-position;
|
|
336
|
+
}
|
|
332
337
|
.k-table-header + .k-table-body {
|
|
333
338
|
table tr th:first-child {
|
|
334
339
|
border-radius: 0;
|