kui-vue 3.4.8 → 3.5.0
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/LICENSE +1 -1
- package/components/affix/affix.jsx +42 -42
- package/components/alert/alert.jsx +12 -7
- package/components/avatar/AvatarGroup.jsx +8 -5
- package/components/avatar/avatar.jsx +10 -7
- package/components/avatar/demo/base.md +1 -0
- package/components/avatar/demo/info.md +2 -5
- package/components/backtop/backtop.jsx +39 -32
- package/components/badge/badge.jsx +7 -7
- package/components/badge/demo/color.md +0 -1
- package/components/badge/styles/index.less +0 -4
- package/components/base/{collapse.js → collapse.jsx} +2 -7
- package/components/base/drop.jsx +181 -195
- package/components/base/input.jsx +27 -46
- package/components/base/pop.jsx +21 -17
- package/components/base/transition.js +1 -4
- package/components/breadcrumb/breadcrumb.jsx +6 -3
- package/components/breadcrumb/breadcrumbItem.jsx +4 -2
- package/components/breadcrumb/styles/index.less +1 -1
- package/components/button/button.jsx +95 -56
- package/components/button/buttonGroup.jsx +5 -3
- package/components/button/demo/base.md +3 -3
- package/components/button/demo/block.md +1 -1
- package/components/button/demo/color.md +30 -0
- package/components/button/demo/disabled.md +2 -2
- package/components/button/demo/index.vue +4 -4
- package/components/button/demo/light.md +8 -8
- package/components/button/demo/loading.md +10 -7
- package/components/button/demo/outline.md +22 -0
- package/components/button/demo/size.md +3 -4
- package/components/button/demo/with-icon.md +5 -5
- package/components/button/styles/index.less +269 -44
- package/components/card/card.jsx +4 -2
- package/components/carousel/carousel.jsx +143 -97
- package/components/carousel/carouselItem.jsx +13 -14
- package/components/carousel/styles/index.less +1 -1
- package/components/checkbox/checkbox.jsx +6 -4
- package/components/checkbox/demo/disabled.md +1 -3
- package/components/checkbox/group.jsx +6 -3
- package/components/collapse/collapse.jsx +14 -12
- package/components/collapse/demo/{accrodion.md → accordion.md} +2 -2
- package/components/collapse/demo/index.vue +2 -2
- package/components/collapse/panel.jsx +15 -16
- package/components/collapse/styles/index.less +3 -3
- package/components/colorPicker/alpha.jsx +107 -0
- package/components/colorPicker/colorpicker.jsx +177 -384
- package/components/colorPicker/demo/base.md +1 -3
- package/components/colorPicker/demo/customTriggle.md +34 -0
- package/components/colorPicker/demo/disabled.md +22 -0
- package/components/colorPicker/demo/disabledAlpha.md +20 -0
- package/components/colorPicker/demo/index.vue +11 -5
- package/components/colorPicker/demo/mode.md +16 -18
- package/components/colorPicker/demo/placement.md +25 -0
- package/components/colorPicker/demo/{colors.md → presets.md} +2 -2
- package/components/colorPicker/demo/size.md +14 -13
- package/components/colorPicker/hue.jsx +114 -0
- package/components/colorPicker/index.md +11 -11
- package/components/colorPicker/mode.jsx +176 -0
- package/components/colorPicker/paint.jsx +126 -0
- package/components/colorPicker/presets.jsx +69 -0
- package/components/colorPicker/styles/index.less +144 -46
- package/components/components.js +155 -0
- package/components/const/var.js +3 -0
- package/components/datePicker/datecalendar.jsx +34 -34
- package/components/datePicker/datepicker.jsx +24 -23
- package/components/datePicker/styles/calendar.less +3 -3
- package/components/descriptions/descriptions.jsx +12 -8
- package/components/descriptions/descriptionsItem.jsx +5 -2
- package/components/divider/divider.jsx +4 -2
- package/components/drawer/drawer.jsx +74 -69
- package/components/dropdown/dropdown.jsx +5 -2
- package/components/dropdown/styles/index.less +14 -3
- package/components/empty/empty.jsx +5 -5
- package/components/flex/demo/align.md +1 -1
- package/components/flex/demo/size.md +1 -1
- package/components/flex/flex.jsx +12 -4
- package/components/form/demo/length.md +1 -1
- package/components/form/demo/valid.md +1 -1
- package/components/form/form.jsx +9 -8
- package/components/form/formitem.jsx +14 -11
- package/components/grid/col.jsx +5 -2
- package/components/grid/row.jsx +11 -8
- package/components/icon/demo/base.md +8 -7
- package/components/icon/demo/index.vue +3 -1
- package/components/icon/demo/info.md +1 -38
- package/components/icon/demo/search.vue +16 -15
- package/components/icon/demo/use.md +30 -0
- package/components/icon/icon.jsx +5 -2
- package/components/image/group.jsx +4 -2
- package/components/image/image.jsx +16 -13
- package/components/image/index.js +6 -9
- package/components/image/{instance.js → instance.jsx} +6 -6
- package/components/image/preview.jsx +219 -195
- package/components/image/styles/index.less +1 -1
- package/components/index.js +36 -142
- package/components/input/input.jsx +6 -4
- package/components/input/inputGroup.jsx +16 -14
- package/components/input/textarea.jsx +16 -7
- package/components/inputNumber/demo/base.md +16 -8
- package/components/inputNumber/demo/format.md +7 -19
- package/components/inputNumber/demo/size.md +2 -6
- package/components/inputNumber/inputNumber.jsx +112 -104
- package/components/inputNumber/styles/index.less +47 -11
- package/components/layout/demo/base.md +11 -6
- package/components/layout/demo/layout1.md +82 -63
- package/components/layout/demo/layout2.md +93 -56
- package/components/layout/demo/layout3.md +95 -53
- package/components/layout/demo/layout4.md +97 -45
- package/components/layout/demo/layout5.md +81 -80
- package/components/layout/index.js +0 -4
- package/components/layout/layout.jsx +3 -2
- package/components/loading/demo/info.md +3 -3
- package/components/loading/{index.js → index.jsx} +29 -24
- package/components/locale/index.js +27 -69
- package/components/locale/lang/de.js +1 -1
- package/components/locale/lang/el.js +1 -1
- package/components/locale/lang/en.js +1 -1
- package/components/locale/lang/fr.js +2 -2
- package/components/locale/lang/it.js +1 -1
- package/components/locale/lang/ja.js +1 -1
- package/components/locale/lang/ko.js +1 -1
- package/components/locale/lang/ru.js +1 -1
- package/components/locale/lang/th.js +1 -1
- package/components/locale/lang/ua.js +1 -1
- package/components/locale/lang/vi.js +1 -1
- package/components/locale/lang/zh-CN.js +1 -1
- package/components/locale/lang/zh-TW.js +1 -1
- package/components/menu/demo/index.vue +2 -2
- package/components/menu/menu.jsx +6 -3
- package/components/menu/menudivider.jsx +5 -3
- package/components/menu/menugroup.jsx +4 -2
- package/components/menu/menuitem.jsx +6 -4
- package/components/menu/styles/index.less +88 -20
- package/components/menu/submenu.jsx +11 -28
- package/components/message/group.jsx +31 -28
- package/components/message/index.js +2 -2
- package/components/modal/demo/index.vue +2 -3
- package/components/modal/demo/info.md +5 -4
- package/components/modal/index.js +5 -7
- package/components/modal/modal.jsx +116 -121
- package/components/notice/index.js +2 -1
- package/components/page/page.jsx +15 -12
- package/components/page/styles/index.less +4 -4
- package/components/popconfirm/popconfirm.jsx +9 -8
- package/components/popconfirm/styles/index.less +15 -8
- package/components/poptip/poptip.jsx +7 -6
- package/components/poptip/styles/index.less +10 -4
- package/components/progress/progress.jsx +11 -8
- package/components/radio/button.jsx +4 -1
- package/components/radio/demo/button.md +1 -2
- package/components/radio/group.jsx +10 -19
- package/components/radio/radio.jsx +7 -9
- package/components/radio/styles/index.less +1 -1
- package/components/rate/rate.jsx +7 -10
- package/components/select/demo/base.md +5 -2
- package/components/select/demo/info.md +3 -1
- package/components/select/demo/multiple.md +1 -1
- package/components/select/demo/theme.md +0 -5
- package/components/select/index.md +4 -0
- package/components/select/option.jsx +8 -5
- package/components/select/select.jsx +247 -237
- package/components/select/styles/index.less +7 -13
- package/components/skeleton/demo/items.md +3 -3
- package/components/skeleton/skeleton.jsx +6 -2
- package/components/skeleton/skeletonAvatar.jsx +6 -2
- package/components/skeleton/skeletonButton.jsx +6 -2
- package/components/skeleton/skeletonImage.jsx +6 -2
- package/components/skeleton/skeletonText.jsx +6 -2
- package/components/slider/slider.jsx +15 -11
- package/components/slider/thumb.jsx +9 -8
- package/components/space/demo/align.md +5 -6
- package/components/space/demo/size.md +8 -8
- package/components/space/space.jsx +19 -17
- package/components/spin/demo/container.md +10 -10
- package/components/spin/spin.jsx +5 -2
- package/components/styles/color.less +57 -37
- package/components/styles/sys.less +31 -0
- package/components/styles/var.less +40 -11
- package/components/switch/styles/index.less +2 -2
- package/components/switch/switch.jsx +11 -8
- package/components/table/demo/edit.md +4 -4
- package/components/table/demo/expand.md +1 -2
- package/components/table/demo/filter.md +1 -1
- package/components/table/extend.jsx +172 -157
- package/components/table/styles/index.less +2 -1
- package/components/table/table.jsx +8 -6
- package/components/tabs/demo/base.md +6 -6
- package/components/tabs/demo/card.md +6 -6
- package/components/tabs/demo/centered.md +6 -6
- package/components/tabs/demo/closable.md +3 -3
- package/components/tabs/demo/disabled.md +6 -6
- package/components/tabs/demo/extra.md +6 -6
- package/components/tabs/demo/icon.md +4 -4
- package/components/tabs/demo/index.vue +3 -4
- package/components/tabs/demo/sample.md +6 -6
- package/components/tabs/index.js +2 -2
- package/components/tabs/index.md +1 -1
- package/components/tabs/styles/index.less +47 -9
- package/components/tabs/tabpanel.jsx +28 -0
- package/components/tabs/tabs.jsx +198 -151
- package/components/tag/demo/color.md +0 -1
- package/components/tag/styles/index.less +0 -6
- package/components/tag/tag.jsx +6 -3
- package/components/timeline/timeline.jsx +3 -1
- package/components/timeline/timelineitem.jsx +5 -2
- package/components/tooltip/demo/color.md +2 -3
- package/components/tooltip/styles/index.less +15 -26
- package/components/tooltip/tooltip.jsx +8 -6
- package/components/tree/demo/directory.md +3 -3
- package/components/tree/node.jsx +39 -50
- package/components/tree/styles/index.less +3 -3
- package/components/tree/tree.jsx +18 -28
- package/components/treeselect/styles/index.less +1 -1
- package/components/treeselect/treeselect.jsx +21 -22
- package/components/upload/demo/form.md +1 -1
- package/components/upload/upload.jsx +13 -27
- package/components/{_tool → utils}/animate.js +1 -1
- package/components/{_tool → utils}/clone.js +2 -2
- package/components/utils/color.js +5 -0
- package/components/{_tool/utils.js → utils/element.js} +8 -5
- package/components/utils/number.js +81 -0
- package/components/utils/theme.js +62 -0
- package/components/utils/vue.js +7 -0
- package/dist/k-ui.cjs.js +7 -0
- package/dist/k-ui.css +6 -7
- package/dist/k-ui.d.ts +162 -0
- package/dist/k-ui.esm.js +7 -0
- package/dist/k-ui.umd.js +7 -0
- package/dist/locale/de.js +5 -7
- package/dist/locale/el.js +5 -7
- package/dist/locale/en.js +5 -7
- package/dist/locale/fr.js +5 -7
- package/dist/locale/it.js +5 -7
- package/dist/locale/ja.js +5 -7
- package/dist/locale/ko.js +5 -7
- package/dist/locale/ru.js +5 -7
- package/dist/locale/th.js +5 -7
- package/dist/locale/ua.js +5 -7
- package/dist/locale/vi.js +5 -7
- package/dist/locale/zh-CN.js +7 -0
- package/dist/locale/zh-TW.js +7 -0
- package/package.json +53 -20
- package/readme.md +105 -0
- package/test/i18n@8.x.html +65 -0
- package/types/affix/Affix.d.ts +17 -0
- package/types/alert/Alert.d.ts +18 -0
- package/types/anchor/Anchor.d.ts +16 -0
- package/types/anchor/Link.d.ts +15 -0
- package/types/avatar/Avatar.d.ts +17 -0
- package/types/avatar/AvatarGroup.d.ts +15 -0
- package/types/backtop/BackTop.d.ts +16 -0
- package/types/badge/Badge.d.ts +20 -0
- package/types/base/BasePop.d.ts +24 -0
- package/types/base/Collapse.d.ts +15 -0
- package/types/base/Drop.d.ts +27 -0
- package/types/base/baseInput.d.ts +32 -0
- package/types/base/input.d.ts +32 -0
- package/types/base/pop.d.ts +36 -0
- package/types/breadcrumb/Breadcrumb.d.ts +11 -0
- package/types/breadcrumb/BreadcrumbItem.d.ts +17 -0
- package/types/button/Button.d.ts +27 -0
- package/types/button/ButtonGroup.d.ts +15 -0
- package/types/card/Card.d.ts +16 -0
- package/types/carousel/Carousel.d.ts +22 -0
- package/types/carousel/CarouselItem.d.ts +11 -0
- package/types/checkbox/Checkbox.d.ts +19 -0
- package/types/checkbox/CheckboxGroup.d.ts +20 -0
- package/types/collapse/Collapse.d.ts +15 -0
- package/types/collapse/Panel.d.ts +14 -0
- package/types/colorPicker/Alpha.d.ts +13 -0
- package/types/colorPicker/ColorPicker.d.ts +26 -0
- package/types/colorPicker/Hue.d.ts +13 -0
- package/types/colorPicker/Mode.d.ts +15 -0
- package/types/colorPicker/Paint.d.ts +14 -0
- package/types/colorPicker/Presets.d.ts +15 -0
- package/types/datePicker/DateCalendar.d.ts +27 -0
- package/types/datePicker/DatePicker.d.ts +36 -0
- package/types/descriptions/Descriptions.d.ts +21 -0
- package/types/descriptions/DescriptionsItem.d.ts +18 -0
- package/types/divider/Divider.d.ts +18 -0
- package/types/drawer/Drawer.d.ts +35 -0
- package/types/dropdown/Dropdown.d.ts +21 -0
- package/types/empty/Empty.d.ts +15 -0
- package/types/flex/Flex.d.ts +17 -0
- package/types/form/Form.d.ts +25 -0
- package/types/form/FormItem.d.ts +17 -0
- package/types/grid/Col.d.ts +15 -0
- package/types/grid/Row.d.ts +17 -0
- package/types/icon/Icon.d.ts +17 -0
- package/types/image/ImageGroup.d.ts +11 -0
- package/types/image/ImagePreview.d.ts +24 -0
- package/types/image/KImage.d.ts +21 -0
- package/types/image/imageProps.d.ts +19 -0
- package/types/image/instance.d.ts +19 -0
- package/types/index.d.ts +188 -0
- package/types/input/Input.d.ts +31 -0
- package/types/input/InputGroup.d.ts +17 -0
- package/types/input/TextArea.d.ts +16 -0
- package/types/inputNumber/InputNumber.d.ts +33 -0
- package/types/layout/layout.d.ts +13 -0
- package/types/layout/prop.d.ts +13 -0
- package/types/loading/Loading.d.ts +11 -0
- package/types/menu/Menu.d.ts +21 -0
- package/types/menu/MenuDivider.d.ts +11 -0
- package/types/menu/MenuGroup.d.ts +13 -0
- package/types/menu/MenuItem.d.ts +15 -0
- package/types/menu/SubMenu.d.ts +15 -0
- package/types/menu/show.d.ts +15 -0
- package/types/message/group.d.ts +13 -0
- package/types/message/inner.d.ts +24 -0
- package/types/modal/Modal.d.ts +31 -0
- package/types/page/Page.d.ts +26 -0
- package/types/popconfirm/Popconfirm.d.ts +21 -0
- package/types/poptip/Poptip.d.ts +22 -0
- package/types/progress/Progress.d.ts +33 -0
- package/types/radio/Radio.d.ts +19 -0
- package/types/radio/RadioButton.d.ts +18 -0
- package/types/radio/RadioGroup.d.ts +23 -0
- package/types/rate/Rate.d.ts +26 -0
- package/types/rate/Star.d.ts +22 -0
- package/types/select/Option.d.ts +15 -0
- package/types/select/Select.d.ts +38 -0
- package/types/skeleton/Skeleton.d.ts +21 -0
- package/types/skeleton/SkeletonAvatar.d.ts +19 -0
- package/types/skeleton/SkeletonButton.d.ts +20 -0
- package/types/skeleton/SkeletonImage.d.ts +18 -0
- package/types/skeleton/SkeletonText.d.ts +18 -0
- package/types/slider/Slider.d.ts +29 -0
- package/types/slider/thumb.d.ts +24 -0
- package/types/space/Space.d.ts +18 -0
- package/types/spin/Spin.d.ts +20 -0
- package/types/switch/KSwitch.d.ts +20 -0
- package/types/switch/Switch.d.ts +20 -0
- package/types/table/ExtendTable.d.ts +21 -0
- package/types/table/Table.d.ts +24 -0
- package/types/table/extend.d.ts +21 -0
- package/types/tabs/TabPanel.d.ts +17 -0
- package/types/tabs/Tabs.d.ts +18 -0
- package/types/tag/Tag.d.ts +18 -0
- package/types/timeline/TimeLine.d.ts +14 -0
- package/types/timeline/TimeLineItem.d.ts +16 -0
- package/types/tooltip/Tooltip.d.ts +23 -0
- package/types/tree/Tree.d.ts +28 -0
- package/types/tree/TreeNode.d.ts +17 -0
- package/types/treeselect/TreeSelect.d.ts +41 -0
- package/types/upload/Upload.d.ts +39 -0
- package/README.md +0 -106
- package/components/_tool/directives.js +0 -31
- package/components/_tool/number.js +0 -177
- package/components/bin/index.js +0 -3
- package/components/button/demo/normal.md +0 -41
- package/components/button/demo/solid.md +0 -16
- package/components/colorPicker/canvasHelper.js +0 -274
- package/components/colorPicker/demo/shape.md +0 -36
- package/components/tabs/tabpane.jsx +0 -25
- package/dist/k-ui.js +0 -9
- package/dist/locale/zhCN.js +0 -9
- package/dist/locale/zhTW.js +0 -9
- package/test/i18n@6.x.html +0 -52
- /package/components/{_tool → directives}/outsiteclick.js +0 -0
- /package/components/{_tool → directives}/resize.js +0 -0
- /package/components/{_tool → directives}/scroll.js +0 -0
- /package/components/{_tool → directives}/transfer.js +0 -0
- /package/components/menu/demo/{accrodion.md → accordion.md} +0 -0
- /package/components/modal/demo/{confrim.md → confirm.md} +0 -0
- /package/components/{_tool → utils}/docClick.js +0 -0
package/components/tree/node.jsx
CHANGED
|
@@ -2,11 +2,12 @@ import Icon from '../icon'
|
|
|
2
2
|
import { Checkbox } from '../checkbox'
|
|
3
3
|
import { Button } from '../button'
|
|
4
4
|
import Node from './node.jsx'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import cloneVNode from '../
|
|
5
|
+
import { getTransitionProp } from '../base/transition'
|
|
6
|
+
import { getChildren } from '../utils/element'
|
|
7
|
+
import cloneVNode from '../utils/clone.js'
|
|
8
8
|
import { Sync, RemoveCircleOutline, AddCircleOutline, ChevronForward } from 'kui-icons'
|
|
9
|
-
|
|
9
|
+
import { withInstall } from '../utils/vue'
|
|
10
|
+
const TreeNode = {
|
|
10
11
|
name: 'TreeNode',
|
|
11
12
|
props: {
|
|
12
13
|
data: Object,
|
|
@@ -24,14 +25,14 @@ export default {
|
|
|
24
25
|
return {
|
|
25
26
|
defaultData: this.data || {},
|
|
26
27
|
loading: false,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
dragged: false,
|
|
29
|
+
dropped: false,
|
|
29
30
|
reload: true,
|
|
30
31
|
level: 0
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
watch: {
|
|
34
|
-
data(val,
|
|
35
|
+
data(val,) {
|
|
35
36
|
this.defaultData = val || {}
|
|
36
37
|
}
|
|
37
38
|
},
|
|
@@ -40,7 +41,7 @@ export default {
|
|
|
40
41
|
VNode: { default: null },
|
|
41
42
|
},
|
|
42
43
|
created() {
|
|
43
|
-
let { defaultCheckedKeys = [],
|
|
44
|
+
let { defaultCheckedKeys = [], checkStrictly } = this.Tree
|
|
44
45
|
let checked = defaultCheckedKeys.indexOf(this.$vnode.key) > -1
|
|
45
46
|
if (checked && !checkStrictly) {
|
|
46
47
|
this.updateChildCheck(this.defaultData, checked)
|
|
@@ -53,20 +54,6 @@ export default {
|
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
beforeDestroy() {
|
|
56
|
-
/* let { defaultSelectedKeys = [],
|
|
57
|
-
defaultExpandedKeys = [],
|
|
58
|
-
defaultCheckedKeys = [],
|
|
59
|
-
halfCheckedKeys = [],
|
|
60
|
-
} = this.Tree
|
|
61
|
-
let key = this.$vnode.key
|
|
62
|
-
let s = defaultSelectedKeys.indexOf(key),
|
|
63
|
-
e = defaultExpandedKeys.indexOf(key),
|
|
64
|
-
c = defaultCheckedKeys.indexOf(key),
|
|
65
|
-
h = halfCheckedKeys.indexOf(key);
|
|
66
|
-
s > -1 && defaultSelectedKeys.splice(s, 1);
|
|
67
|
-
e > -1 && defaultExpandedKeys.splice(e, 1);
|
|
68
|
-
c > -1 && defaultCheckedKeys.splice(c, 1);
|
|
69
|
-
h > -1 && halfCheckedKeys.splice(h, 1); */
|
|
70
57
|
},
|
|
71
58
|
methods: {
|
|
72
59
|
updateChildCheck({ children = [], disabled }, checked) {
|
|
@@ -89,7 +76,7 @@ export default {
|
|
|
89
76
|
let { defaultCheckedKeys, halfCheckedKeys } = this.Tree
|
|
90
77
|
const normal = children.filter(({ disabled }) => !disabled)
|
|
91
78
|
let checkedLength = normal.filter(({ key }) => defaultCheckedKeys.indexOf(key) > -1).length
|
|
92
|
-
let
|
|
79
|
+
let halfCheckedLength = normal.filter(({ key }) => halfCheckedKeys.indexOf(key) > -1).length
|
|
93
80
|
// let key = defaultData.key,
|
|
94
81
|
let isCheckAll = checkedLength == normal.length;
|
|
95
82
|
|
|
@@ -97,7 +84,7 @@ export default {
|
|
|
97
84
|
let checkIndex = defaultCheckedKeys.indexOf(key)
|
|
98
85
|
|
|
99
86
|
isCheckAll ? defaultCheckedKeys.push(key) : (checkIndex > -1 && defaultCheckedKeys.splice(checkIndex, 1))
|
|
100
|
-
if ((
|
|
87
|
+
if ((halfCheckedLength > 0 || checkedLength > 0) && !isCheckAll)
|
|
101
88
|
halfIndex < 0 && halfCheckedKeys.push(key)
|
|
102
89
|
else
|
|
103
90
|
halfIndex > -1 && halfCheckedKeys.splice(halfIndex, 1);
|
|
@@ -109,7 +96,7 @@ export default {
|
|
|
109
96
|
let { Tree } = this
|
|
110
97
|
let key = this.$vnode.key
|
|
111
98
|
|
|
112
|
-
let { defaultCheckedKeys, halfCheckedKeys, checkStrictly } =
|
|
99
|
+
let { defaultCheckedKeys, halfCheckedKeys, checkStrictly } = Tree
|
|
113
100
|
let index = defaultCheckedKeys.indexOf(key)
|
|
114
101
|
checked && index < 0 ? defaultCheckedKeys.push(key) : defaultCheckedKeys.splice(index, 1)
|
|
115
102
|
this.Tree.defaultCheckedKeys = defaultCheckedKeys
|
|
@@ -128,13 +115,13 @@ export default {
|
|
|
128
115
|
// update parent
|
|
129
116
|
this.VNode && this.updateParentCheck(this.VNode)
|
|
130
117
|
}
|
|
131
|
-
Tree.onCheck(
|
|
118
|
+
Tree.onCheck(checked, key, this.defaultData, this)
|
|
132
119
|
}
|
|
133
120
|
},
|
|
134
121
|
handleSelect(e) {
|
|
135
122
|
let { disabled, key } = this.defaultData
|
|
136
123
|
if (!disabled) {
|
|
137
|
-
let { Tree,
|
|
124
|
+
let { Tree, } = this
|
|
138
125
|
if (Tree.directory) {
|
|
139
126
|
this.handleExpand(e)
|
|
140
127
|
}
|
|
@@ -155,24 +142,24 @@ export default {
|
|
|
155
142
|
}
|
|
156
143
|
},
|
|
157
144
|
onDragStart(e) {
|
|
158
|
-
this.
|
|
145
|
+
this.dragged = true
|
|
159
146
|
this.Tree.onDragStart(e, this)
|
|
160
147
|
},
|
|
161
148
|
onDragEnd(e) {
|
|
162
|
-
this.
|
|
149
|
+
this.dragged = false
|
|
163
150
|
this.Tree.onDragEnd(e, { node: this.defaultData, parent: this.getParent() })
|
|
164
151
|
this.$forceUpdate()
|
|
165
152
|
},
|
|
166
153
|
onDragEnter(e) {
|
|
167
|
-
this.
|
|
154
|
+
this.dropped = true
|
|
168
155
|
this.Tree.onDragEnter(e, { node: this.defaultData, parent: this.getParent() })
|
|
169
156
|
},
|
|
170
157
|
onDragLeave(e) {
|
|
171
|
-
this.
|
|
158
|
+
this.dropped = false
|
|
172
159
|
this.Tree.onDragLeave(e, { node: this.defaultData, parent: this.getParent() })
|
|
173
160
|
},
|
|
174
161
|
onDrop(e) {
|
|
175
|
-
this.
|
|
162
|
+
this.dropped = false
|
|
176
163
|
if (!this.defaultData.disabled) {
|
|
177
164
|
this.Tree.onDrop(e, { node: this.defaultData })
|
|
178
165
|
}
|
|
@@ -184,14 +171,14 @@ export default {
|
|
|
184
171
|
return this.VNode ? this.VNode.defaultData : { children: this.Tree.defaultData }
|
|
185
172
|
}
|
|
186
173
|
},
|
|
187
|
-
render(
|
|
174
|
+
render() {
|
|
188
175
|
// return <div/>
|
|
189
176
|
let p = { ...this.$props }
|
|
190
177
|
delete p.data
|
|
191
178
|
let data = Object.assign(p, this.defaultData)
|
|
192
179
|
let { isLeaf, disabled, icon, title, children = [] } = data
|
|
193
180
|
|
|
194
|
-
let
|
|
181
|
+
let slotChildren = getChildren(this.$slots.default)
|
|
195
182
|
|
|
196
183
|
let itemNode = [], { Tree, loading, reload } = this;
|
|
197
184
|
let key = this.$vnode.key
|
|
@@ -202,16 +189,16 @@ export default {
|
|
|
202
189
|
checked = defaultCheckedKeys.indexOf(key) > - 1,
|
|
203
190
|
indeterminate = halfCheckedKeys.indexOf(key) > - 1;
|
|
204
191
|
|
|
205
|
-
let
|
|
192
|
+
let hasChildren = slotChildren.length > 0 || children.length > 0
|
|
206
193
|
let hasLoad = 'loadData' in Tree.$listeners || 'load-data' in Tree.$listeners
|
|
207
|
-
if ((
|
|
194
|
+
if ((hasChildren || hasLoad) && isLeaf !== true) {
|
|
208
195
|
let arrowCls = ['k-tree-arrow', { 'k-tree-arrow-open': expand }]
|
|
209
196
|
let arrowNode = <span class={arrowCls} onClick={this.handleExpand}>
|
|
210
|
-
<Button size="small"
|
|
197
|
+
<Button size="small" type="text" loading={loading} icon={loading ? Sync : (showLine ? (expand ? RemoveCircleOutline : AddCircleOutline) : ChevronForward)} spin={loading} />
|
|
211
198
|
</span>
|
|
212
199
|
itemNode.push(arrowNode)
|
|
213
200
|
} else {
|
|
214
|
-
itemNode.push(<span class="k-tree-
|
|
201
|
+
itemNode.push(<span class="k-tree-comment"></span>)
|
|
215
202
|
}
|
|
216
203
|
// console.log(checked,checked, disabled, indeterminate)
|
|
217
204
|
if (checkable) {
|
|
@@ -254,18 +241,18 @@ export default {
|
|
|
254
241
|
}
|
|
255
242
|
itemNode.push(<span {...titleProps}>{innerNode}</span>)
|
|
256
243
|
|
|
257
|
-
let
|
|
258
|
-
if (expand &&
|
|
259
|
-
if (
|
|
260
|
-
//
|
|
261
|
-
|
|
244
|
+
let childrenVNode = null
|
|
245
|
+
if (expand && hasChildren && reload) {
|
|
246
|
+
if (slotChildren.length) {
|
|
247
|
+
// children = slotChildren
|
|
248
|
+
childrenVNode = slotChildren.map((vnode, i) => {
|
|
262
249
|
vnode.data.key = vnode.data.key || `${key}_${i}`
|
|
263
250
|
let ele = cloneVNode(vnode)
|
|
264
251
|
return ele;
|
|
265
252
|
|
|
266
253
|
})
|
|
267
254
|
} else {
|
|
268
|
-
|
|
255
|
+
childrenVNode = children.map((item, i) => {
|
|
269
256
|
const k = item.key || `${key}_${i}`
|
|
270
257
|
item.key = k
|
|
271
258
|
// console.log(k)
|
|
@@ -273,13 +260,13 @@ export default {
|
|
|
273
260
|
})
|
|
274
261
|
}
|
|
275
262
|
}
|
|
276
|
-
let onProps =
|
|
263
|
+
let onProps = getTransitionProp('k-tree-slide')
|
|
277
264
|
const itemProps = {
|
|
278
265
|
attrs: {},
|
|
279
266
|
class: ['k-tree-item', {
|
|
280
267
|
'k-tree-item-disabled': disabled,
|
|
281
|
-
'k-tree-item-drag': this.
|
|
282
|
-
'k-tree-item-drop': this.
|
|
268
|
+
'k-tree-item-drag': this.dragged,
|
|
269
|
+
'k-tree-item-drop': this.dropped && !disabled,
|
|
283
270
|
'k-tree-item-extra-hidden': !showExtra,
|
|
284
271
|
'k-tree-item-selected': directory && selected
|
|
285
272
|
}],
|
|
@@ -297,13 +284,15 @@ export default {
|
|
|
297
284
|
let extra = Tree.$scopedSlots.extra({ node: this.defaultData, parent: this.getParent() })
|
|
298
285
|
extraNode = <span class='k-tree-item-extra'>{extra}</span>
|
|
299
286
|
}
|
|
300
|
-
|
|
287
|
+
childrenVNode && childrenVNode.unshift(<span class="k-tree-line" style={{ left: `${(this.level || 0) * 24 + 12}px` }} key="line"></span>)
|
|
301
288
|
return (
|
|
302
289
|
<div class="k-tree-children">
|
|
303
290
|
<div {...itemProps}>{itemNode}{extraNode}</div>
|
|
304
291
|
{
|
|
305
|
-
<transition-group class="k-tree-item-children" tag="div" {...onProps}>{
|
|
292
|
+
<transition-group class="k-tree-item-children" tag="div" {...onProps}>{childrenVNode}</transition-group>
|
|
306
293
|
}
|
|
307
294
|
</div>)
|
|
308
295
|
}
|
|
309
|
-
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export default withInstall(TreeNode)
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
// position: relative;
|
|
24
24
|
// }
|
|
25
25
|
// }
|
|
26
|
-
.k-tree-
|
|
26
|
+
.k-tree-comment {
|
|
27
27
|
display: inline-block;
|
|
28
28
|
width: 24px;
|
|
29
29
|
position: relative;
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
z-index: 1;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
.k-tree-
|
|
231
|
+
.k-tree-comment {
|
|
232
232
|
&::before {
|
|
233
233
|
content: '';
|
|
234
234
|
position: absolute;
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
|
|
254
254
|
.k-tree-children:last-child {
|
|
255
255
|
|
|
256
|
-
>.k-tree-item>.k-tree-
|
|
256
|
+
>.k-tree-item>.k-tree-comment::before {
|
|
257
257
|
height: 12px;
|
|
258
258
|
}
|
|
259
259
|
|
package/components/tree/tree.jsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import TreeNode from './node.jsx'
|
|
2
|
-
import {
|
|
3
|
-
import cloneVNode from '../
|
|
4
|
-
|
|
2
|
+
import { getChildren } from '../utils/element.js'
|
|
3
|
+
import cloneVNode from '../utils/clone.js'
|
|
4
|
+
import { withInstall } from '../utils/vue'
|
|
5
|
+
const Tree = {
|
|
5
6
|
name: 'Tree',
|
|
6
7
|
props: {
|
|
7
8
|
data: Array,
|
|
@@ -36,27 +37,21 @@ export default {
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
watch: {
|
|
39
|
-
data(val,
|
|
40
|
+
data(val,) {
|
|
40
41
|
this.defaultData = val || []
|
|
41
42
|
},
|
|
42
|
-
selectedKeys(val,
|
|
43
|
+
selectedKeys(val,) {
|
|
43
44
|
this.defaultSelectedKeys = val || []
|
|
44
45
|
},
|
|
45
|
-
expandedKeys(val,
|
|
46
|
+
expandedKeys(val,) {
|
|
46
47
|
this.defaultExpandedKeys = val || []
|
|
47
48
|
},
|
|
48
|
-
checkedKeys(val,
|
|
49
|
+
checkedKeys(val,) {
|
|
49
50
|
this.defaultCheckedKeys = val || []
|
|
50
51
|
},
|
|
51
52
|
},
|
|
52
53
|
created() {
|
|
53
|
-
//Init key
|
|
54
|
-
// (this.defaultData || []).forEach(item => {
|
|
55
|
-
// // this.setKeys(item);
|
|
56
|
-
// });
|
|
57
|
-
//Init half check
|
|
58
54
|
this.setCheckHalf()
|
|
59
|
-
|
|
60
55
|
},
|
|
61
56
|
mounted() {
|
|
62
57
|
window.addEventListener('keydown', this.handleKeyDown);
|
|
@@ -83,17 +78,10 @@ export default {
|
|
|
83
78
|
this.setParentHalf(this.defaultData, key)
|
|
84
79
|
})
|
|
85
80
|
},
|
|
86
|
-
// setKeys({ children = [] }, key = 'n') {
|
|
87
|
-
// for (let i = 0; i < children.length; i++) {
|
|
88
|
-
// let item = children[i]
|
|
89
|
-
// item.key = item.key || `${key}_${i}`
|
|
90
|
-
// this.setKeys(item, item.key)
|
|
91
|
-
// }
|
|
92
|
-
// },
|
|
93
81
|
setParentHalf(data = [], key) {
|
|
94
82
|
for (let i = 0; i < data.length; i++) {
|
|
95
83
|
let item = data[i]
|
|
96
|
-
let { children = [],
|
|
84
|
+
let { children = [], } = item
|
|
97
85
|
let keys = children.filter(child => !child.disabled).map(child => child.key)
|
|
98
86
|
|
|
99
87
|
if (keys.indexOf(key) >= 0 && this.defaultCheckedKeys.indexOf(item.key) < 0) { //符合要求
|
|
@@ -179,13 +167,13 @@ export default {
|
|
|
179
167
|
|
|
180
168
|
this.$emit('dragstart', { event, node: defaultData })
|
|
181
169
|
},
|
|
182
|
-
onDragEnd(event, { node,
|
|
170
|
+
onDragEnd(event, { node, }) {
|
|
183
171
|
this.$emit('dragend', { event, node })
|
|
184
172
|
},
|
|
185
|
-
onDragEnter(event, { node,
|
|
173
|
+
onDragEnter(event, { node, }) {
|
|
186
174
|
this.$emit('dragenter', { event, node, expandedKeys: this.defaultExpandedKeys })
|
|
187
175
|
},
|
|
188
|
-
onDragLeave(event, { node,
|
|
176
|
+
onDragLeave(event, { node, }) {
|
|
189
177
|
this.$emit('dragleave', { event, node })
|
|
190
178
|
},
|
|
191
179
|
|
|
@@ -227,9 +215,9 @@ export default {
|
|
|
227
215
|
},
|
|
228
216
|
renderChild() {
|
|
229
217
|
let { defaultData, $slots } = this
|
|
230
|
-
let
|
|
231
|
-
if (
|
|
232
|
-
return
|
|
218
|
+
let children = getChildren($slots.default)
|
|
219
|
+
if (children.length) {
|
|
220
|
+
return children.map((vnode, i) => {
|
|
233
221
|
vnode.data.key = vnode.data.key || `n_${i}`
|
|
234
222
|
let ele = cloneVNode(vnode)
|
|
235
223
|
return ele;
|
|
@@ -251,4 +239,6 @@ export default {
|
|
|
251
239
|
{this.renderChild()}
|
|
252
240
|
</div>)
|
|
253
241
|
}
|
|
254
|
-
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export default withInstall(Tree)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import Empty from '../empty';
|
|
3
|
-
import { hasProp,
|
|
3
|
+
import { hasProp, isNotEmpty } from '../utils/element'
|
|
4
4
|
|
|
5
5
|
import Drop from '../base/drop'
|
|
6
6
|
import { t } from '../locale';
|
|
7
7
|
import { Sync, Close, CloseCircle, ChevronDown } from 'kui-icons'
|
|
8
8
|
import { Tree } from '../tree'
|
|
9
|
-
|
|
9
|
+
import cloneDeep from 'lodash.clonedeep'
|
|
10
|
+
import { withInstall } from '../utils/vue'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
export default {
|
|
12
|
+
const TreeSelect = {
|
|
13
13
|
name: "TreeSelect",
|
|
14
14
|
props: {
|
|
15
15
|
placeholder: String,
|
|
@@ -68,12 +68,12 @@ export default {
|
|
|
68
68
|
this.currentValue = this.multiple ? [] : ''
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
currentValue(
|
|
71
|
+
currentValue() {
|
|
72
72
|
this.setLabel()
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
methods: {
|
|
76
|
-
|
|
76
|
+
clearQuery() {
|
|
77
77
|
if (this.showSearch) {
|
|
78
78
|
this.queryKey = ''
|
|
79
79
|
this.$refs.search.value = ''
|
|
@@ -153,8 +153,8 @@ export default {
|
|
|
153
153
|
// }
|
|
154
154
|
// return result;
|
|
155
155
|
},
|
|
156
|
-
getLabel(
|
|
157
|
-
let node = this.findNodeByKeyIterative(
|
|
156
|
+
getLabel(children, labelValue) {
|
|
157
|
+
let node = this.findNodeByKeyIterative(children, labelValue)
|
|
158
158
|
return node?.title || labelValue;
|
|
159
159
|
},
|
|
160
160
|
setLabel() {
|
|
@@ -180,7 +180,7 @@ export default {
|
|
|
180
180
|
}
|
|
181
181
|
this.label = currentLabel
|
|
182
182
|
|
|
183
|
-
setTimeout(
|
|
183
|
+
setTimeout(() => { this.setPosition() }, 230);
|
|
184
184
|
|
|
185
185
|
},
|
|
186
186
|
clear(e) {
|
|
@@ -199,7 +199,7 @@ export default {
|
|
|
199
199
|
if (this.filterable || isSearch) {
|
|
200
200
|
this.showSearch = this.opened
|
|
201
201
|
if (this.opened) {
|
|
202
|
-
this.$nextTick(
|
|
202
|
+
this.$nextTick(() => {
|
|
203
203
|
this.isFocus = true
|
|
204
204
|
this.$refs.search.focus()
|
|
205
205
|
})
|
|
@@ -223,7 +223,7 @@ export default {
|
|
|
223
223
|
if (isSearch) {
|
|
224
224
|
// this.$nextTick(e => {
|
|
225
225
|
this.showSearch = true
|
|
226
|
-
this.$nextTick(
|
|
226
|
+
this.$nextTick(() => {
|
|
227
227
|
this.$refs.search.focus()
|
|
228
228
|
this.isFocus = true
|
|
229
229
|
})
|
|
@@ -254,7 +254,7 @@ export default {
|
|
|
254
254
|
this.opened = false
|
|
255
255
|
this.showSearch = false
|
|
256
256
|
} else if ('search' in this.$listeners || this.filterable) {
|
|
257
|
-
this.$nextTick(
|
|
257
|
+
this.$nextTick(() => {
|
|
258
258
|
this.$refs.search.focus()
|
|
259
259
|
this.isFocus = true
|
|
260
260
|
})
|
|
@@ -286,9 +286,9 @@ export default {
|
|
|
286
286
|
} else {
|
|
287
287
|
this.label = item.label
|
|
288
288
|
}
|
|
289
|
-
setTimeout(
|
|
289
|
+
setTimeout(() => { this.setPosition() }, 230);
|
|
290
290
|
} else {
|
|
291
|
-
this.$nextTick(
|
|
291
|
+
this.$nextTick(() => this.setPosition())
|
|
292
292
|
}
|
|
293
293
|
this.$emit("input", this.currentValue);
|
|
294
294
|
this.$emit("change", this.currentValue);
|
|
@@ -314,7 +314,7 @@ export default {
|
|
|
314
314
|
searchInput(e) {
|
|
315
315
|
this.queryKey = e.target.value
|
|
316
316
|
//todo:
|
|
317
|
-
this.$nextTick(
|
|
317
|
+
this.$nextTick(() => {
|
|
318
318
|
// let max = this.selectWidth - 15 - (this.showArrow ? 25 : 0)
|
|
319
319
|
e.target.style.width = this.$refs.mirror.offsetWidth + 'px'
|
|
320
320
|
this.setPosition()
|
|
@@ -327,9 +327,9 @@ export default {
|
|
|
327
327
|
}, 500);
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
|
-
emptyClick(
|
|
330
|
+
emptyClick() {
|
|
331
331
|
if (this.showSearch) {
|
|
332
|
-
this.$nextTick(
|
|
332
|
+
this.$nextTick(() => {
|
|
333
333
|
this.$refs.search.focus()
|
|
334
334
|
this.isFocus = true
|
|
335
335
|
|
|
@@ -350,7 +350,7 @@ export default {
|
|
|
350
350
|
opened, placeholder, showArrow, bordered,
|
|
351
351
|
clear, removeTag, queryKey, theme, arrowIcon, icon, shape, filterable,
|
|
352
352
|
clearable, label, toggleDrop, isFocus, currentValue,
|
|
353
|
-
treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys,
|
|
353
|
+
treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys,
|
|
354
354
|
} = this
|
|
355
355
|
let childNode = []
|
|
356
356
|
if (arrowIcon == undefined) {
|
|
@@ -407,13 +407,10 @@ export default {
|
|
|
407
407
|
className: ['k-tree-select-dropdown', { 'k-tree-select-dropdown-multiple': this.multiple, 'k-tree-select-dropdown-sm': size == 'small' }]
|
|
408
408
|
},
|
|
409
409
|
on: {
|
|
410
|
-
input: e => {
|
|
411
|
-
this.opened = e
|
|
412
|
-
},
|
|
413
410
|
hide: () => {
|
|
414
411
|
this.opened = false
|
|
415
412
|
setTimeout(() => {
|
|
416
|
-
this.
|
|
413
|
+
this.clearQuery()
|
|
417
414
|
}, 300)
|
|
418
415
|
}
|
|
419
416
|
}
|
|
@@ -506,3 +503,5 @@ export default {
|
|
|
506
503
|
)
|
|
507
504
|
}
|
|
508
505
|
};
|
|
506
|
+
|
|
507
|
+
export default withInstall(TreeSelect);
|
|
@@ -8,7 +8,8 @@ const timestamp = Date.now()
|
|
|
8
8
|
function getUuid() {
|
|
9
9
|
return `k-upload-${timestamp}-${count++}`
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
import { withInstall } from '../utils/vue'
|
|
12
|
+
const Upload = {
|
|
12
13
|
name: "Upload",
|
|
13
14
|
props: {
|
|
14
15
|
method: { type: String, default: "post" },
|
|
@@ -47,34 +48,21 @@ export default {
|
|
|
47
48
|
};
|
|
48
49
|
},
|
|
49
50
|
mounted() {
|
|
50
|
-
// if (this.draggable && this.$isServer) {
|
|
51
|
-
// window.addEventListener("dragover", function (e) {
|
|
52
|
-
// e = e || event;
|
|
53
|
-
// e.preventDefault();
|
|
54
|
-
// }, false);
|
|
55
|
-
// window.addEventListener("drop", function (e) {
|
|
56
|
-
// e = e || event;
|
|
57
|
-
// e.preventDefault();
|
|
58
|
-
// }, false);
|
|
59
|
-
// }
|
|
60
51
|
},
|
|
61
52
|
methods: {
|
|
62
53
|
formatFileSize(fileSize) {
|
|
63
|
-
var temp =
|
|
54
|
+
var temp = 0
|
|
64
55
|
if (fileSize < 1024) {
|
|
65
56
|
return fileSize + 'B';
|
|
66
57
|
} else if (fileSize < (1024 * 1024)) {
|
|
67
58
|
temp = fileSize / 1024;
|
|
68
|
-
|
|
69
|
-
return temp + 'KB';
|
|
59
|
+
return temp.toFixed(2) + 'KB';
|
|
70
60
|
} else if (fileSize < (1024 * 1024 * 1024)) {
|
|
71
61
|
temp = fileSize / (1024 * 1024);
|
|
72
|
-
|
|
73
|
-
return temp + 'MB';
|
|
62
|
+
return temp.toFixed(2) + 'MB';
|
|
74
63
|
} else {
|
|
75
64
|
temp = fileSize / (1024 * 1024 * 1024);
|
|
76
|
-
|
|
77
|
-
return temp + 'GB';
|
|
65
|
+
return temp.toFixed(2) + 'GB';
|
|
78
66
|
}
|
|
79
67
|
},
|
|
80
68
|
triggerSelect(e) {
|
|
@@ -117,7 +105,7 @@ export default {
|
|
|
117
105
|
let item = {
|
|
118
106
|
uid: getUuid(),
|
|
119
107
|
filename: files[i].name, size: this.formatFileSize(size),
|
|
120
|
-
status: 'wait', percent: 0, preview:
|
|
108
|
+
status: 'wait', percent: 0, preview: null,
|
|
121
109
|
}
|
|
122
110
|
this.uploadTemp[item.uid] = files[i]
|
|
123
111
|
|
|
@@ -219,7 +207,7 @@ export default {
|
|
|
219
207
|
event
|
|
220
208
|
})
|
|
221
209
|
}
|
|
222
|
-
xhr.onload = (
|
|
210
|
+
xhr.onload = () => {
|
|
223
211
|
if (xhr.status != 200) {
|
|
224
212
|
item.status = 'error'
|
|
225
213
|
delete this.uploadTemp[item.uid]
|
|
@@ -291,11 +279,7 @@ export default {
|
|
|
291
279
|
}
|
|
292
280
|
],
|
|
293
281
|
}
|
|
294
|
-
|
|
295
|
-
// let childs = getChild(this.$slots.default)
|
|
296
|
-
// let child = childs.map(child => {
|
|
297
|
-
// return cloneVNode(child, { on: { click: this.triggerSelect } })
|
|
298
|
-
// })
|
|
282
|
+
|
|
299
283
|
let addProps = {
|
|
300
284
|
attrs: {
|
|
301
285
|
drag: draggable && this.dragOver ? 'over' : null
|
|
@@ -323,7 +307,7 @@ export default {
|
|
|
323
307
|
</div> : null
|
|
324
308
|
|
|
325
309
|
|
|
326
|
-
const filsList = () => {
|
|
310
|
+
const filsList = (selector) => {
|
|
327
311
|
return (showUploadList && !isPicture) || isPicture ? <div class={`k-upload-${isPicture ? 'picture' : 'file'}-list`}>
|
|
328
312
|
{
|
|
329
313
|
defaultFileList.map((item, i) => {
|
|
@@ -368,4 +352,6 @@ export default {
|
|
|
368
352
|
</div >
|
|
369
353
|
)
|
|
370
354
|
}
|
|
371
|
-
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export default withInstall(Upload)
|
|
@@ -32,7 +32,7 @@ export default function animate(options) {
|
|
|
32
32
|
return timeFraction//Math.pow(timeFraction, 5)
|
|
33
33
|
}
|
|
34
34
|
}, options)
|
|
35
|
-
requestAnimationFrame(function animate(
|
|
35
|
+
requestAnimationFrame(function animate() {
|
|
36
36
|
var timeFraction = (new Date() - start) / options.duration;
|
|
37
37
|
if (timeFraction > 1) timeFraction = 1;
|
|
38
38
|
var progress = options.timing(timeFraction)
|