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
package/dist/locale/de.js
CHANGED
package/dist/locale/el.js
CHANGED
package/dist/locale/en.js
CHANGED
package/dist/locale/fr.js
CHANGED
package/dist/locale/it.js
CHANGED
package/dist/locale/ja.js
CHANGED
package/dist/locale/ko.js
CHANGED
package/dist/locale/ru.js
CHANGED
package/dist/locale/th.js
CHANGED
package/dist/locale/ua.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* kui-vue v3.
|
|
2
|
+
* kui-vue v3.6.0
|
|
3
3
|
* Copyright 2017-present, kui-vue.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Author: Qiu / https://chuchur.com
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).kui_lang_ua=t()}(this,function(){"use strict";return{k:{datePicker:{selectYear:"Виберіть рік",selectMonth:"Виберіть місяць",selectDate:"Вибрати дату",selectTime:"Вибрати час",startDate:"Дата початку",endDate:"Дата завершення",today:"Сьогодні",now:"Зараз",ok:"Обрати",back:"назад"},empty:{description:"Немає даних"},
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).kui_lang_ua=t()}(this,function(){"use strict";return{k:{datePicker:{selectYear:"Виберіть рік",selectMonth:"Виберіть місяць",selectDate:"Вибрати дату",selectTime:"Вибрати час",startDate:"Дата початку",endDate:"Дата завершення",today:"Сьогодні",now:"Зараз",ok:"Обрати",back:"назад"},drawer:{ok:"Обрати",cancel:"Відміна"},empty:{description:"Немає даних"},pop:{ok:"Обрати",cancel:"Відміна"},modal:{ok:"Обрати",cancel:"Відміна"},page:{page:"",pageSize:"на сторінці",goto:"Перейти",items:"",total:"Всього"},select:{placeholder:"Обрати",loading:"Завантаження...",emptyText:"Немає даних"},table:{emptyText:"Немає даних"},upload:{successful:"успіх",failed:"не вдалося",errorFileSize:"незаконний розмір файла"},image:{preview:"перегляд"}}}});
|
package/dist/locale/uk.js
CHANGED
package/dist/locale/vi.js
CHANGED
package/dist/locale/zh-CN.js
CHANGED
package/dist/locale/zh-TW.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kui-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.2",
|
|
5
5
|
"description": "A lightweight desktop UI component library suitable for Vue.js 2.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/k-ui.cjs.js",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"@vitejs/plugin-vue2": "^2.3.4",
|
|
95
95
|
"@vitejs/plugin-vue2-jsx": "^1.1.1",
|
|
96
96
|
"color": "^5.0.2",
|
|
97
|
-
"dayjs": "^1.11.
|
|
98
|
-
"less": "^4.
|
|
99
|
-
"vite": "npm:rolldown-vite@7.
|
|
97
|
+
"dayjs": "^1.11.19",
|
|
98
|
+
"less": "^4.5.1",
|
|
99
|
+
"vite": "npm:rolldown-vite@7.3.0",
|
|
100
100
|
"vue-router": "^3.6.2"
|
|
101
101
|
},
|
|
102
102
|
"overrides": {
|
|
103
|
-
"vite": "npm:rolldown-vite@7.
|
|
103
|
+
"vite": "npm:rolldown-vite@7.3.0"
|
|
104
104
|
}
|
|
105
105
|
}
|
package/test/i18n@8.x.html
CHANGED
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
<link rel="stylesheet" type="text/css" href="../dist/k-ui.css" />
|
|
8
8
|
<script src="https://unpkg.com/vue@2.x"></script>
|
|
9
9
|
<script src="https://unpkg.com/dayjs"></script>
|
|
10
|
+
<!-- <script src="https://app.unpkg.com/dayjs@1.11.19/files/locale/zh-cn.js"></script> -->
|
|
11
|
+
<script src="https://app.unpkg.com/dayjs@1.11.19/files/locale/de.js"></script>
|
|
10
12
|
<!-- <script src="https://unpkg.com/vue-i18n@8.x"></script> -->
|
|
11
13
|
<script src="../dist/k-ui.umd.js?t=22"></script>
|
|
12
14
|
|
|
13
15
|
<script src="../dist/locale/en.js"></script>
|
|
14
16
|
<script src="../dist/locale/zh-CN.js"></script>
|
|
15
17
|
<script src="../dist/locale/de.js"></script>
|
|
16
|
-
<script src="../dist/locale/
|
|
18
|
+
<script src="../dist/locale/uk.js"></script>
|
|
17
19
|
<style>
|
|
18
20
|
body,
|
|
19
21
|
html {
|
|
@@ -69,7 +71,9 @@
|
|
|
69
71
|
},
|
|
70
72
|
mounted() {
|
|
71
73
|
setTimeout(() => {
|
|
72
|
-
|
|
74
|
+
console.log("change locale", kui_lang_de);
|
|
75
|
+
dayjs.locale("de");
|
|
76
|
+
this.locale = kui_lang_de;
|
|
73
77
|
}, 2000);
|
|
74
78
|
},
|
|
75
79
|
});
|
|
@@ -3,7 +3,7 @@ import Vue, { VueConstructor } from "vue";
|
|
|
3
3
|
/** Checkbox component props */
|
|
4
4
|
export interface CheckboxProps {
|
|
5
5
|
/** default: false */
|
|
6
|
-
checked?: boolean;
|
|
6
|
+
checked?: boolean | number;
|
|
7
7
|
value?: string | number | boolean;
|
|
8
8
|
label?: string | number;
|
|
9
9
|
theme?: string;
|
package/types/image/KImage.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export { default as Affix } from "./affix/Affix";
|
|
2
2
|
export type { AffixProps } from "./affix/Affix";
|
|
3
|
-
export { default as Alert } from "./alert/Alert";
|
|
4
|
-
export type { AlertProps } from "./alert/Alert";
|
|
5
|
-
export { default as Avatar } from "./avatar/Avatar";
|
|
6
|
-
export type { AvatarProps } from "./avatar/Avatar";
|
|
7
3
|
export { default as Badge } from "./badge/Badge";
|
|
8
4
|
export type { BadgeProps } from "./badge/Badge";
|
|
5
|
+
export { default as BackTop } from "./backtop/BackTop";
|
|
6
|
+
export type { BackTopProps } from "./backtop/BackTop";
|
|
7
|
+
export { default as Avatar } from "./avatar/Avatar";
|
|
8
|
+
export type { AvatarProps } from "./avatar/Avatar";
|
|
9
9
|
export { default as Breadcrumb } from "./breadcrumb/Breadcrumb";
|
|
10
10
|
export type { BreadcrumbProps } from "./breadcrumb/Breadcrumb";
|
|
11
11
|
export { default as BreadcrumbItem } from "./breadcrumb/BreadcrumbItem";
|
|
12
12
|
export type { BreadcrumbItemProps } from "./breadcrumb/BreadcrumbItem";
|
|
13
|
-
export { default as
|
|
14
|
-
export type {
|
|
13
|
+
export { default as Alert } from "./alert/Alert";
|
|
14
|
+
export type { AlertProps } from "./alert/Alert";
|
|
15
15
|
export { default as Button } from "./button/Button";
|
|
16
16
|
export type { ButtonProps } from "./button/Button";
|
|
17
17
|
export { default as ButtonGroup } from "./button/ButtonGroup";
|
|
@@ -72,8 +72,6 @@ export { default as InputGroup } from "./input/InputGroup";
|
|
|
72
72
|
export type { InputGroupProps } from "./input/InputGroup";
|
|
73
73
|
export { default as InputNumber } from "./inputNumber/InputNumber";
|
|
74
74
|
export type { InputNumberProps } from "./inputNumber/InputNumber";
|
|
75
|
-
export { default as sider } from "./layout/sider";
|
|
76
|
-
export type { siderProps } from "./layout/sider";
|
|
77
75
|
export { default as loading } from "./loading/loading";
|
|
78
76
|
export type { loadingProps } from "./loading/loading";
|
|
79
77
|
export { default as Menu } from "./menu/Menu";
|
|
@@ -86,14 +84,16 @@ export { default as SubMenu } from "./menu/SubMenu";
|
|
|
86
84
|
export type { SubMenuProps } from "./menu/SubMenu";
|
|
87
85
|
export { default as MenuDivider } from "./menu/MenuDivider";
|
|
88
86
|
export type { MenuDividerProps } from "./menu/MenuDivider";
|
|
89
|
-
export { default as
|
|
90
|
-
export type {
|
|
87
|
+
export { default as sider } from "./layout/sider";
|
|
88
|
+
export type { siderProps } from "./layout/sider";
|
|
91
89
|
export { default as Page } from "./page/Page";
|
|
92
90
|
export type { PageProps } from "./page/Page";
|
|
93
91
|
export { default as Popconfirm } from "./popconfirm/Popconfirm";
|
|
94
92
|
export type { PopconfirmProps } from "./popconfirm/Popconfirm";
|
|
95
93
|
export { default as Poptip } from "./poptip/Poptip";
|
|
96
94
|
export type { PoptipProps } from "./poptip/Poptip";
|
|
95
|
+
export { default as Modal } from "./modal/Modal";
|
|
96
|
+
export type { ModalProps } from "./modal/Modal";
|
|
97
97
|
export { default as Progress } from "./progress/Progress";
|
|
98
98
|
export type { ProgressProps } from "./progress/Progress";
|
|
99
99
|
export { default as Radio } from "./radio/Radio";
|
|
@@ -140,9 +140,9 @@ export { default as TimeLineItem } from "./timeline/TimeLineItem";
|
|
|
140
140
|
export type { TimeLineItemProps } from "./timeline/TimeLineItem";
|
|
141
141
|
export { default as Tooltip } from "./tooltip/Tooltip";
|
|
142
142
|
export type { TooltipProps } from "./tooltip/Tooltip";
|
|
143
|
-
export { default as Tree } from "./tree/Tree";
|
|
144
|
-
export type { TreeProps } from "./tree/Tree";
|
|
145
143
|
export { default as TreeSelect } from "./treeselect/TreeSelect";
|
|
146
144
|
export type { TreeSelectProps } from "./treeselect/TreeSelect";
|
|
145
|
+
export { default as Tree } from "./tree/Tree";
|
|
146
|
+
export type { TreeProps } from "./tree/Tree";
|
|
147
147
|
export { default as Upload } from "./upload/Upload";
|
|
148
148
|
export type { UploadProps } from "./upload/Upload";
|
package/types/radio/Radio.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Vue, { VueConstructor } from "vue";
|
|
|
3
3
|
/** RadioButton component props */
|
|
4
4
|
export interface RadioButtonProps {
|
|
5
5
|
/** default: false */
|
|
6
|
-
checked?: boolean;
|
|
6
|
+
checked?: boolean | number;
|
|
7
7
|
value?: string | number | boolean;
|
|
8
8
|
label?: string | number;
|
|
9
9
|
theme?: string;
|
package/types/switch/Switch.d.ts
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getTransitionProp } from './transition'
|
|
2
|
-
export default {
|
|
3
|
-
name: 'Collapse',
|
|
4
|
-
props: {
|
|
5
|
-
name: String,
|
|
6
|
-
collapse: { type: Boolean, default: true }
|
|
7
|
-
},
|
|
8
|
-
// functional: true, //为true 表示 无状态 data 无 无实例 没有this
|
|
9
|
-
render() {
|
|
10
|
-
let { name, $slots, collapse } = this
|
|
11
|
-
let child = $slots.default || $slots.content;
|
|
12
|
-
const props = collapse ? getTransitionProp(name) : { name }
|
|
13
|
-
return (<transition {...props} name={name}>{child}</transition>)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import Icon from '../icon'
|
|
2
|
-
import { isNotEmpty } from '../utils/element'
|
|
3
|
-
import { Search, CloseCircle, EyeOutline, EyeOffOutline } from 'kui-icons';
|
|
4
|
-
import InputGroup from '../input/inputGroup'
|
|
5
|
-
export default {
|
|
6
|
-
name: "baseInput",
|
|
7
|
-
props: {
|
|
8
|
-
clearable: Boolean,
|
|
9
|
-
visiblePassword: Boolean,
|
|
10
|
-
visiblePasswordIcon: Boolean,
|
|
11
|
-
id: String,
|
|
12
|
-
size: {
|
|
13
|
-
default: 'default',
|
|
14
|
-
validator(value) {
|
|
15
|
-
return ["small", "large", "default"].indexOf(value) >= 0;
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
inputType: { type: String, default: "input" },
|
|
19
|
-
value: [String, Number, Array, Object],
|
|
20
|
-
disabled: Boolean,
|
|
21
|
-
type: {
|
|
22
|
-
validator(value) {
|
|
23
|
-
return (["text", "password", "url", "email", "date", "search", "hidden"].indexOf(value) >= 0);
|
|
24
|
-
},
|
|
25
|
-
default: 'text'
|
|
26
|
-
},
|
|
27
|
-
icon: [String, Array],
|
|
28
|
-
suffix: String,
|
|
29
|
-
prefix: String,
|
|
30
|
-
theme: String,
|
|
31
|
-
shape: String,
|
|
32
|
-
formatter: Function,
|
|
33
|
-
parser: Function,
|
|
34
|
-
placeholder: String
|
|
35
|
-
},
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
currentValue: this.value,
|
|
39
|
-
isFocus: false,
|
|
40
|
-
isPassword: !this.visiblePassword,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
inject: {
|
|
44
|
-
Input: { default: null },
|
|
45
|
-
InputNumber: { default: null },
|
|
46
|
-
},
|
|
47
|
-
watch: {
|
|
48
|
-
value(value) {
|
|
49
|
-
this.currentValue = value
|
|
50
|
-
},
|
|
51
|
-
visiblePassword(value) {
|
|
52
|
-
this.isPassword = !value
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
mounted() {
|
|
56
|
-
let textInput = (this.Input || this.InputNumber) || {}
|
|
57
|
-
textInput.focus = (e) => {
|
|
58
|
-
this.$nextTick(() => this.$refs.input.focus(e))
|
|
59
|
-
}
|
|
60
|
-
textInput.blur = (e) => {
|
|
61
|
-
this.$nextTick(() => this.$refs.input.blur(e))
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
clear() {
|
|
66
|
-
this.setValue({ input: '', output: '' })
|
|
67
|
-
this.$nextTick(() => this.$refs.input.focus())
|
|
68
|
-
},
|
|
69
|
-
iconClick() {
|
|
70
|
-
!this.disabled && this.$emit("icon-click");
|
|
71
|
-
},
|
|
72
|
-
handleFocus(e) {
|
|
73
|
-
this.isFocus = true
|
|
74
|
-
let input = this.Input || this.InputNumber
|
|
75
|
-
input && input.$emit('focus', e)
|
|
76
|
-
},
|
|
77
|
-
handleBlur(e) {
|
|
78
|
-
this.$emit('blur', e);
|
|
79
|
-
this.isFocus = false
|
|
80
|
-
},
|
|
81
|
-
handleInput(e) {
|
|
82
|
-
let v = e.target.value + '', input = v, output = v + '';
|
|
83
|
-
let { parser, formatter } = this
|
|
84
|
-
|
|
85
|
-
if (parser) {
|
|
86
|
-
output = parser(v)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (output !== '' && formatter) {
|
|
91
|
-
input = formatter(output)
|
|
92
|
-
}
|
|
93
|
-
e.target.value = input
|
|
94
|
-
if (input === '') {
|
|
95
|
-
output = ''
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
this.setValue({ input, output })
|
|
99
|
-
},
|
|
100
|
-
showPassword() {
|
|
101
|
-
if (this.disabled) return;
|
|
102
|
-
this.isPassword = !this.isPassword
|
|
103
|
-
let type = this.isPassword ? 'text' : 'password'
|
|
104
|
-
this.$refs.input.type = type
|
|
105
|
-
},
|
|
106
|
-
setValue({ input, output }) {
|
|
107
|
-
this.currentValue = input
|
|
108
|
-
this.$emit('input', output)
|
|
109
|
-
// this.$emit('change', output)
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
searchEvent() {
|
|
113
|
-
if (this.disabled) return;
|
|
114
|
-
this.$listeners.search(this.currentValue)
|
|
115
|
-
},
|
|
116
|
-
getSuffix() {
|
|
117
|
-
let { $listeners, suffix, visiblePasswordIcon } = this
|
|
118
|
-
const SearchNode = ('search' in $listeners) ? <Icon type={Search} class="k-input-search-icon" onClick={this.searchEvent} /> : null
|
|
119
|
-
|
|
120
|
-
const Password = (this.type == 'password' && visiblePasswordIcon) ? <Icon class="k-input-password-icon" type={!this.isPassword ? EyeOutline : EyeOffOutline} onClick={this.showPassword} /> : null
|
|
121
|
-
|
|
122
|
-
return Password || SearchNode || this.$slots.suffix || (suffix ? <div class={[`k-${this.inputType}-suffix`]}>{suffix}</div> : null)
|
|
123
|
-
},
|
|
124
|
-
getTextInput(multiple) {
|
|
125
|
-
const { disabled, size, type, inputType, currentValue, id, theme, shape, placeholder } = this
|
|
126
|
-
const props = {
|
|
127
|
-
domProps: {
|
|
128
|
-
value: currentValue
|
|
129
|
-
},
|
|
130
|
-
class: [
|
|
131
|
-
{
|
|
132
|
-
[`k-${inputType}`]: !multiple,
|
|
133
|
-
[`k-${inputType}-text`]: multiple,
|
|
134
|
-
[`k-${inputType}-disabled`]: disabled,
|
|
135
|
-
[`k-${inputType}-sm`]: size == 'small' && !multiple,
|
|
136
|
-
[`k-${inputType}-lg`]: size == 'large' && !multiple,
|
|
137
|
-
[`k-${inputType}-${theme}`]: theme != 'solid' && !multiple && theme,
|
|
138
|
-
[`k-${inputType}-circle`]: shape == 'circle' && !multiple,
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
ref: 'input',
|
|
142
|
-
attrs: {
|
|
143
|
-
...this.$attrs,
|
|
144
|
-
disabled, id, placeholder
|
|
145
|
-
},
|
|
146
|
-
on: {
|
|
147
|
-
...this.$listeners,
|
|
148
|
-
focus: this.handleFocus,
|
|
149
|
-
blur: this.handleBlur,
|
|
150
|
-
input: this.handleInput
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
props.attrs.type = type
|
|
155
|
-
|
|
156
|
-
if (!this.isPassword && type == 'password') {
|
|
157
|
-
props.attrs.type = 'text'
|
|
158
|
-
}
|
|
159
|
-
return (<input {...props} single />)
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
render() {
|
|
163
|
-
const { inputType, icon, $slots, size, disabled, type, $listeners, clearable, suffix, theme, prefix, shape } = this
|
|
164
|
-
|
|
165
|
-
let multiple = (icon || ('search' in $listeners) || $slots.suffix || suffix || $slots.prefix || prefix || type == 'password' || clearable || $slots.controls) && type !== 'hidden'
|
|
166
|
-
let textInput = this.getTextInput(multiple)
|
|
167
|
-
|
|
168
|
-
if (!multiple) return textInput;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
let { isFocus, currentValue } = this
|
|
172
|
-
let clearableShow = clearable && isNotEmpty(currentValue)
|
|
173
|
-
const props = {
|
|
174
|
-
class: {
|
|
175
|
-
[`k-${inputType}`]: true,
|
|
176
|
-
[`k-${inputType}-focus`]: isFocus,
|
|
177
|
-
[`k-${inputType}-disabled`]: disabled,
|
|
178
|
-
[`k-${inputType}-sm`]: size == 'small',
|
|
179
|
-
[`k-${inputType}-lg`]: size == 'large',
|
|
180
|
-
[`k-${inputType}-${theme}`]: theme && theme != 'solid',
|
|
181
|
-
[`k-${inputType}-circle`]: shape == 'circle',
|
|
182
|
-
},
|
|
183
|
-
}
|
|
184
|
-
const suffixNode = this.getSuffix()
|
|
185
|
-
const prefixNode = (prefix ? <div class={`k-${inputType}-prefix`}>{prefix}</div> : null)
|
|
186
|
-
if ($slots.prefix || $slots.suffix) {
|
|
187
|
-
return <InputGroup size={size}>
|
|
188
|
-
{$slots.prefix ? <div class={{ "k-input-group-prefix": true }}>{$slots.prefix}</div> : null}
|
|
189
|
-
<div {...props} mult>
|
|
190
|
-
{icon ? <Icon type={icon} class={`k-${inputType}-icon`} onClick={this.iconClick} /> : null}
|
|
191
|
-
{prefixNode}
|
|
192
|
-
{textInput}
|
|
193
|
-
{clearable ? <Icon type={CloseCircle} class={[`k-${inputType}-clearable`, { [`k-${inputType}-clearable-hidden`]: !clearableShow }]} onClick={this.clear} /> : null}
|
|
194
|
-
{/* {suffixNode} */}
|
|
195
|
-
{$slots.controls}
|
|
196
|
-
</div>
|
|
197
|
-
{$slots.suffix ? <div class={{ "k-input-group-suffix": true }}>{$slots.suffix}</div> : null}
|
|
198
|
-
</InputGroup>
|
|
199
|
-
} else {
|
|
200
|
-
return <div {...props} mult>
|
|
201
|
-
{icon ? <Icon type={icon} class={`k-${inputType}-icon`} onClick={this.iconClick} /> : null}
|
|
202
|
-
{prefixNode}
|
|
203
|
-
{textInput}
|
|
204
|
-
{clearable ? <Icon type={CloseCircle} class={[`k-${inputType}-clearable`, { [`k-${inputType}-clearable-hidden`]: !clearableShow }]} onClick={this.clear} /> : null}
|
|
205
|
-
{suffixNode}
|
|
206
|
-
{$slots.controls}
|
|
207
|
-
</div>
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<cn>
|
|
2
|
-
### 禁用
|
|
3
|
-
设置为禁用状态。
|
|
4
|
-
</cn>
|
|
5
|
-
|
|
6
|
-
```vue
|
|
7
|
-
<template>
|
|
8
|
-
<Space class="demo-color-picker" vertical>
|
|
9
|
-
<ColorPicker :value="color" disabled />
|
|
10
|
-
<ColorPicker :value="color" disabled showText />
|
|
11
|
-
</Space>
|
|
12
|
-
</template>
|
|
13
|
-
<script setup>
|
|
14
|
-
const color = "#3a95ff";
|
|
15
|
-
</script>
|
|
16
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<cn>
|
|
2
|
-
### 颜色编码
|
|
3
|
-
编码格式,支持HEX、HSB、RGB。
|
|
4
|
-
</cn>
|
|
5
|
-
|
|
6
|
-
```vue
|
|
7
|
-
<template>
|
|
8
|
-
<Space class="demo-color-picker" vertical>
|
|
9
|
-
<Space> <ColorPicker v-model="color1" /> HEX: {{ color1 }} </Space>
|
|
10
|
-
<Space>
|
|
11
|
-
<ColorPicker v-model="color2" mode="rgb" /> RGB: {{ color2 }}
|
|
12
|
-
</Space>
|
|
13
|
-
<Space>
|
|
14
|
-
<ColorPicker v-model="color3" mode="hsl" /> HSL: {{ color3 }}
|
|
15
|
-
</Space>
|
|
16
|
-
</Space>
|
|
17
|
-
</template>
|
|
18
|
-
<script setup>
|
|
19
|
-
import { ref } from "vue";
|
|
20
|
-
const color1 = ref("#00ff00");
|
|
21
|
-
const color2 = ref("rgb(58, 149, 255)");
|
|
22
|
-
const color3 = ref("hsl(212, 100%, 61%)");
|
|
23
|
-
</script>
|
|
24
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<cn>
|
|
2
|
-
### 自定义颜色盘
|
|
3
|
-
可以定义默认的颜色盘
|
|
4
|
-
</cn>
|
|
5
|
-
|
|
6
|
-
```vue
|
|
7
|
-
<template>
|
|
8
|
-
<div class="demo-color-picker">
|
|
9
|
-
<ColorPicker v-model="color" :presets="colors" />
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
<script setup>
|
|
13
|
-
import { ref } from "vue";
|
|
14
|
-
const color = ref("#3a95ff");
|
|
15
|
-
const colors = ["#9c27b0", "red", "blue"];
|
|
16
|
-
</script>
|
|
17
|
-
```
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<cn>
|
|
2
|
-
### 自定义字符
|
|
3
|
-
可以自定义每一个字符。
|
|
4
|
-
</cn>
|
|
5
|
-
|
|
6
|
-
```vue
|
|
7
|
-
<template>
|
|
8
|
-
<Space vertical>
|
|
9
|
-
<Rate :character="(i) => i" :value="2" :count="9" />
|
|
10
|
-
<Rate :icon="(i) => icons[i - 1]" :value="3" />
|
|
11
|
-
</Space>
|
|
12
|
-
</template>
|
|
13
|
-
<script setup>
|
|
14
|
-
import {
|
|
15
|
-
VolumeOff,
|
|
16
|
-
VolumeLow,
|
|
17
|
-
VolumeMedium,
|
|
18
|
-
VolumeHigh,
|
|
19
|
-
VolumeMute,
|
|
20
|
-
} from "kui-icons";
|
|
21
|
-
const icons = [VolumeOff, VolumeLow, VolumeMedium, VolumeHigh, VolumeMute];
|
|
22
|
-
</script>
|
|
23
|
-
```
|