kui-vue 3.4.9 → 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 +70 -43
- 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 +54 -22
- 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
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
import {Button} from '../button'
|
|
2
|
+
import { Button } from '../button'
|
|
3
3
|
import dayjs from 'dayjs'
|
|
4
4
|
import { t } from '../locale'
|
|
5
|
+
import { withInstall } from '../utils/vue'
|
|
5
6
|
import {
|
|
6
7
|
ChevronDoubleBack, ChevronBack, ChevronForward,
|
|
7
8
|
ChevronDoubleForward
|
|
8
9
|
} from "kui-icons";
|
|
9
|
-
|
|
10
|
-
name: "
|
|
10
|
+
const DateCalendar = {
|
|
11
|
+
name: "DateCalendar",
|
|
11
12
|
props: {
|
|
12
13
|
v1: [String, Date, Number, Object],
|
|
13
14
|
v2: [String, Date, Number, Object],
|
|
14
15
|
value: [String, Date, Number, Object],
|
|
15
|
-
disabledDate: { type: Function, default:
|
|
16
|
-
disabledTime: { type: Function, default:
|
|
16
|
+
disabledDate: { type: Function, default: () => 0 },
|
|
17
|
+
disabledTime: { type: Function, default: () => { } },
|
|
17
18
|
mode: {
|
|
18
19
|
type: String, default: 'date', validator(value) {
|
|
19
20
|
return ["year", "month", "date", 'time', 'dateTime', "dateRange", 'dateTimeRange'].indexOf(value) >= 0;
|
|
@@ -103,8 +104,8 @@ export default {
|
|
|
103
104
|
},
|
|
104
105
|
initToCenter(key, animate = false) {
|
|
105
106
|
this.$nextTick(() => {
|
|
106
|
-
let
|
|
107
|
-
for (let m of
|
|
107
|
+
let children = (this.$refs[key] || {}).children || []
|
|
108
|
+
for (let m of children) {
|
|
108
109
|
// console.log(m.children)
|
|
109
110
|
for (let n of m.children) {
|
|
110
111
|
// console.log(n)
|
|
@@ -155,12 +156,12 @@ export default {
|
|
|
155
156
|
const weeksNode = <div class="k-calendar-weekdays">{weekNode}</div>
|
|
156
157
|
return weeksNode
|
|
157
158
|
},
|
|
158
|
-
isSelectDay(
|
|
159
|
-
let { v1, v2,
|
|
159
|
+
isSelectDay(date) {
|
|
160
|
+
let { v1, v2, isRange, value } = this
|
|
160
161
|
if (isRange) {
|
|
161
|
-
return (v1 && dayjs(v1).isSame(
|
|
162
|
+
return (v1 && dayjs(v1).isSame(date, 'date')) || (v2 && dayjs(v2).isSame(date, 'date'))
|
|
162
163
|
} else {
|
|
163
|
-
return v1 && value && dayjs(value).isSame(
|
|
164
|
+
return v1 && value && dayjs(value).isSame(date, 'date')
|
|
164
165
|
}
|
|
165
166
|
},
|
|
166
167
|
isDisabled(date) {
|
|
@@ -215,7 +216,7 @@ export default {
|
|
|
215
216
|
time.setMonth(time.getMonth() + 1, 1)
|
|
216
217
|
// 这个月的天数
|
|
217
218
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
218
|
-
let date = time.setDate(day)
|
|
219
|
+
let date = time.setDate(day);
|
|
219
220
|
let cls = {
|
|
220
221
|
'k-calendar-day-item': 1,
|
|
221
222
|
'k-calendar-day-this': dayjs(date).isSame(dayjs(), 'day'),
|
|
@@ -297,13 +298,10 @@ export default {
|
|
|
297
298
|
const monthNode = <div class="k-calendar-months" ref="monthspicker">{month}</div>
|
|
298
299
|
return monthNode
|
|
299
300
|
},
|
|
300
|
-
fix(v) {
|
|
301
|
-
return ('0' + v).slice(-2)
|
|
302
|
-
},
|
|
303
301
|
isDisabledTime(types, value) {
|
|
304
|
-
let
|
|
305
|
-
if (
|
|
306
|
-
let [a, b] =
|
|
302
|
+
let obj = this.disabledTime()
|
|
303
|
+
if (obj && types in obj && typeof obj[types] === 'function') {
|
|
304
|
+
let [a, b] = obj[types]() || []
|
|
307
305
|
if (a && b) {
|
|
308
306
|
return value >= a && value <= b
|
|
309
307
|
}
|
|
@@ -414,25 +412,25 @@ export default {
|
|
|
414
412
|
showYears = showYears || mode == 'year' || mode == 'month'
|
|
415
413
|
let { $y, $M, $D } = this.date || dayjs()
|
|
416
414
|
//header
|
|
417
|
-
let
|
|
415
|
+
let headNodeChildren = []
|
|
418
416
|
if (!isTime) {
|
|
419
417
|
if (!showTimes && !showYears) {
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
headNodeChildren.push(<Button icon={ChevronDoubleBack} size={pickerSize} type="text" class="k-calendar-prev-year-btn" onClick={() => this.nextAndPrev(0, 'year')}></Button>)
|
|
419
|
+
headNodeChildren.push(<Button icon={ChevronBack} size={pickerSize} type="text" class="k-calendar-prev-month-btn" onClick={() => this.nextAndPrev(0, 'month')}></Button>)
|
|
422
420
|
}
|
|
423
421
|
// else if (mode != 'year' && mode != 'month') {
|
|
424
|
-
// headNode.push(<Button class="k-calendar-back" size={pickerSize} icon={ChevronBack}
|
|
422
|
+
// headNode.push(<Button class="k-calendar-back" size={pickerSize} icon={ChevronBack} type="text" onClick={this.back}>{t('k.datePicker.back')} </Button>)
|
|
425
423
|
// }
|
|
426
|
-
|
|
424
|
+
headNodeChildren.push(<Button class="k-calendar-year-select" size={pickerSize} type="text" onClick={this.setShowYear}>{$y}{t('k.datePicker.year')} {mode != 'year' ? months[$M] : ''} {(!showYears && showTimes) ? $D : ''}</Button>)
|
|
427
425
|
|
|
428
426
|
if (!showTimes && !showYears) {
|
|
429
|
-
|
|
430
|
-
|
|
427
|
+
headNodeChildren.push(<Button type="text" size={pickerSize} icon={ChevronForward} class="k-calendar-next-month-btn" onClick={() => this.nextAndPrev(1, 'month')}></Button>)
|
|
428
|
+
headNodeChildren.push(<Button icon={ChevronDoubleForward} size={pickerSize} type="text" class="k-calendar-next-year-btn" onClick={() => this.nextAndPrev(1, 'year')}></Button>)
|
|
431
429
|
}
|
|
432
430
|
} else {
|
|
433
|
-
|
|
431
|
+
headNodeChildren.push(<div class="k-calendar-time-label">{t('k.datePicker.selectTime')}</div>)
|
|
434
432
|
}
|
|
435
|
-
const headNode = <div class="k-calendar-head">{
|
|
433
|
+
const headNode = <div class="k-calendar-head">{headNodeChildren}</div>
|
|
436
434
|
|
|
437
435
|
//days and week body
|
|
438
436
|
let dayWeekBodyNode = null
|
|
@@ -444,15 +442,15 @@ export default {
|
|
|
444
442
|
// console.log(showYears)
|
|
445
443
|
let yearsMonthNode = null
|
|
446
444
|
if (showYears) {
|
|
447
|
-
let
|
|
445
|
+
let children = []
|
|
448
446
|
const yearNode = this.getYearsNode()
|
|
449
|
-
|
|
447
|
+
children.push(yearNode)
|
|
450
448
|
|
|
451
449
|
if (mode != 'year') {
|
|
452
450
|
const monthNode = this.getMonthsNode()
|
|
453
|
-
|
|
451
|
+
children.push(monthNode)
|
|
454
452
|
}
|
|
455
|
-
yearsMonthNode = <div class="k-calendar-yearmonth-picker" ref="ympicker">{
|
|
453
|
+
yearsMonthNode = <div class="k-calendar-yearmonth-picker" ref="ympicker">{children}</div>
|
|
456
454
|
}
|
|
457
455
|
|
|
458
456
|
let timeNode = null
|
|
@@ -463,8 +461,8 @@ export default {
|
|
|
463
461
|
//footer
|
|
464
462
|
let footerNode = []
|
|
465
463
|
if (withTime) {
|
|
466
|
-
// footerNode.push(<Button
|
|
467
|
-
footerNode.push(<Button
|
|
464
|
+
// footerNode.push(<Button type="text" size={pickerSize} disabled={disabled} class="k-calendar-btn-today" onClick={this.setToday}>{t('k.datePicker.now')}</Button>)
|
|
465
|
+
footerNode.push(<Button type="text" size={pickerSize} onClick={this.setShowTime}>{showTimes ? t('k.datePicker.selectDate') : t('k.datePicker.selectTime')}</Button>)
|
|
468
466
|
if (!isRange || this.isRight) footerNode.push(<Button type="primary" class="k-calendar-btn-ok" size={pickerSize} onClick={e => this.ok(e)}>{t('k.datePicker.ok')}</Button>)
|
|
469
467
|
}
|
|
470
468
|
footerNode = footerNode.length || (isRange && withTime) ? <div class="k-calendar-footer">{footerNode}</div> : null
|
|
@@ -484,4 +482,6 @@ export default {
|
|
|
484
482
|
</div>
|
|
485
483
|
)
|
|
486
484
|
}
|
|
487
|
-
};
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
export default withInstall(DateCalendar);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import Calendar from './datecalendar'
|
|
2
2
|
import Icon from "../icon";
|
|
3
|
-
|
|
3
|
+
import { withInstall } from '../utils/vue'
|
|
4
4
|
import dayjs from 'dayjs'
|
|
5
5
|
import Drop from '../base/drop'
|
|
6
6
|
import { t } from '../locale'
|
|
7
7
|
import { CloseCircle, CalendarOutline, TimeOutline } from 'kui-icons'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import duration from 'dayjs/plugin/duration';
|
|
9
|
+
import isBetween from 'dayjs/plugin/isBetween';
|
|
11
10
|
dayjs.extend(duration);
|
|
12
11
|
dayjs.extend(isBetween);
|
|
13
|
-
|
|
12
|
+
const DatePicker = {
|
|
14
13
|
name: 'DatePicker',
|
|
15
14
|
props: {
|
|
16
15
|
value: [String, Date, Number, Array, Object],
|
|
@@ -21,8 +20,8 @@ export default {
|
|
|
21
20
|
},
|
|
22
21
|
disabled: Boolean,
|
|
23
22
|
transfer: { type: Boolean, default: true },
|
|
24
|
-
disabledDate: { type: Function, default:
|
|
25
|
-
disabledTime: { type: Function, default:
|
|
23
|
+
disabledDate: { type: Function, default: () => { } },
|
|
24
|
+
disabledTime: { type: Function, default: () => { } },
|
|
26
25
|
format: String,
|
|
27
26
|
clearable: { type: Boolean, default: true },
|
|
28
27
|
bordered: { type: Boolean, default: true },
|
|
@@ -66,7 +65,7 @@ export default {
|
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
67
|
created() {
|
|
69
|
-
this.
|
|
68
|
+
this.updateCalendarDate()
|
|
70
69
|
},
|
|
71
70
|
computed: {
|
|
72
71
|
label() {
|
|
@@ -89,19 +88,19 @@ export default {
|
|
|
89
88
|
watch: {
|
|
90
89
|
value(v) {
|
|
91
90
|
if (this.v != this.currentValue) {
|
|
92
|
-
console.log(v)
|
|
91
|
+
// console.log(v)
|
|
93
92
|
if (!this.isRange) {
|
|
94
93
|
this.currentValue = v ? dayjs(v) : ''
|
|
95
94
|
} else {
|
|
96
95
|
let [a, b] = v || []
|
|
97
96
|
this.currentValue = [a ? dayjs(a) : null, b ? dayjs(b) : null]
|
|
98
97
|
}
|
|
99
|
-
this.
|
|
98
|
+
this.updateCalendarDate()
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
},
|
|
103
102
|
methods: {
|
|
104
|
-
|
|
103
|
+
updateCalendarDate() {
|
|
105
104
|
let { currentValue, isRange } = this
|
|
106
105
|
if (isRange) {
|
|
107
106
|
let [a, b] = currentValue || []
|
|
@@ -146,7 +145,7 @@ export default {
|
|
|
146
145
|
this.v1 = null
|
|
147
146
|
this.v2 = null
|
|
148
147
|
}
|
|
149
|
-
this.
|
|
148
|
+
this.updateCalendarDate()
|
|
150
149
|
|
|
151
150
|
this.$emit("input", v);
|
|
152
151
|
this.$emit("change", v, v);
|
|
@@ -159,13 +158,13 @@ export default {
|
|
|
159
158
|
this.opened = !this.opened;
|
|
160
159
|
|
|
161
160
|
if (this.opened) {
|
|
162
|
-
this.
|
|
161
|
+
this.updateCalendarDate()
|
|
163
162
|
} else {
|
|
164
163
|
this.validValue()
|
|
165
164
|
}
|
|
166
165
|
},
|
|
167
166
|
picker1Update(value, type) {
|
|
168
|
-
let { v1, v2, withTime,
|
|
167
|
+
let { v1, v2, withTime, isRange } = this
|
|
169
168
|
if (isRange) {
|
|
170
169
|
if (!type) { //day
|
|
171
170
|
let result = dayjs(value)
|
|
@@ -208,7 +207,7 @@ export default {
|
|
|
208
207
|
}
|
|
209
208
|
},
|
|
210
209
|
picker2Update(value, type) {
|
|
211
|
-
let { v1, v2, withTime
|
|
210
|
+
let { v1, v2, withTime } = this
|
|
212
211
|
if (!type) { //day
|
|
213
212
|
let result = dayjs(value)
|
|
214
213
|
if (!v1) {
|
|
@@ -230,7 +229,7 @@ export default {
|
|
|
230
229
|
let _v2 = (v2 || dayjs(this.d2))[type](value)
|
|
231
230
|
this.v2 = _v2
|
|
232
231
|
if (v1) {
|
|
233
|
-
const oneMonth = dayjs.duration(1, 'month').asDays();
|
|
232
|
+
// const oneMonth = dayjs.duration(1, 'month').asDays();
|
|
234
233
|
const diff = _v2.diff(v1, 'day');
|
|
235
234
|
// console.log(oneMonth, diff)
|
|
236
235
|
if (diff < 0) {
|
|
@@ -248,7 +247,7 @@ export default {
|
|
|
248
247
|
let dateStr = isRange ? [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null] : v1.format(ft)
|
|
249
248
|
this.$emit('input', dateStr)
|
|
250
249
|
this.$emit('change', this.currentValue, dateStr)
|
|
251
|
-
this.
|
|
250
|
+
this.updateCalendarDate()
|
|
252
251
|
},
|
|
253
252
|
validValue(e) {
|
|
254
253
|
// 只有一个值的时候, 直接置空
|
|
@@ -262,11 +261,11 @@ export default {
|
|
|
262
261
|
getPresetsNode() {
|
|
263
262
|
let { presets } = this
|
|
264
263
|
if (presets && presets.length > 1) {
|
|
265
|
-
let
|
|
264
|
+
let children = []
|
|
266
265
|
for (let i = 0; i < presets.length; i++) {
|
|
267
|
-
|
|
266
|
+
children.push(<Button type="text" size="small" onClick={() => this.setPreset(presets[i])}>{presets[i].label}</Button>)
|
|
268
267
|
}
|
|
269
|
-
return <div class="k-date-picker-presets">{
|
|
268
|
+
return <div class="k-date-picker-presets">{children}</div>
|
|
270
269
|
}
|
|
271
270
|
return null
|
|
272
271
|
},
|
|
@@ -296,7 +295,7 @@ export default {
|
|
|
296
295
|
render() {
|
|
297
296
|
// console.log(t('k.datePicker'))
|
|
298
297
|
let { currentValue, placeholder, disabled, clearable, v1, v2, d1, d2, h2,
|
|
299
|
-
opened, size, label,
|
|
298
|
+
opened, size, label, bordered, theme, shape, dateIcon,
|
|
300
299
|
format, mode, disabledTime, isRange, withTime, disabledDate, pickerSize
|
|
301
300
|
} = this
|
|
302
301
|
let childNode = [];
|
|
@@ -405,7 +404,8 @@ export default {
|
|
|
405
404
|
selection: this.$el,
|
|
406
405
|
value: this.opened,
|
|
407
406
|
placement: 'bottom-left',
|
|
408
|
-
transitionName: 'k-date-picker'
|
|
407
|
+
transitionName: 'k-date-picker',
|
|
408
|
+
extendWidth: false,
|
|
409
409
|
},
|
|
410
410
|
on: {
|
|
411
411
|
// render: () => {
|
|
@@ -448,4 +448,5 @@ export default {
|
|
|
448
448
|
</div>
|
|
449
449
|
)
|
|
450
450
|
}
|
|
451
|
-
}
|
|
451
|
+
}
|
|
452
|
+
export default withInstall(DatePicker)
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
&:active {
|
|
113
|
-
background-color: var(--kui-color-
|
|
113
|
+
background-color: var(--kui-color-active);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
&:active {
|
|
171
|
-
background: var(--kui-color-
|
|
171
|
+
background: var(--kui-color-active);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
&:active {
|
|
294
|
-
background: var(--kui-color-
|
|
294
|
+
background: var(--kui-color-active);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getChildren } from "../utils/element"
|
|
2
2
|
import Item from "./descriptionsItem"
|
|
3
|
-
|
|
3
|
+
import { withInstall } from '../utils/vue'
|
|
4
|
+
const Descriptions = {
|
|
5
|
+
name: 'Descriptions',
|
|
4
6
|
props: {
|
|
5
7
|
bordered: Boolean,
|
|
6
8
|
column: { type: Number, default: 3 },
|
|
@@ -10,13 +12,13 @@ export default {
|
|
|
10
12
|
size: { type: String, default: 'default' }
|
|
11
13
|
},
|
|
12
14
|
methods: {
|
|
13
|
-
|
|
15
|
+
getProps(vnode) {
|
|
14
16
|
let { children, propsData } = vnode.componentOptions
|
|
15
17
|
return { children, ...propsData }
|
|
16
18
|
},
|
|
17
|
-
|
|
19
|
+
renderBody() {
|
|
18
20
|
let { $slots, column, bordered, layout } = this
|
|
19
|
-
let child =
|
|
21
|
+
let child = getChildren($slots.default)
|
|
20
22
|
// let count = child.length
|
|
21
23
|
// let row = parseInt(count / column)
|
|
22
24
|
|
|
@@ -24,7 +26,7 @@ export default {
|
|
|
24
26
|
let rows = { 0: [] }, len = 0, temps = [], v = 0;
|
|
25
27
|
|
|
26
28
|
for (let i = 0; i < child.length; i++) {
|
|
27
|
-
let { children, label, span = 1 } = this.
|
|
29
|
+
let { children, label, span = 1 } = this.getProps(child[i])
|
|
28
30
|
let row = rows[len] || []
|
|
29
31
|
let vertical = layout == 'vertical'
|
|
30
32
|
|
|
@@ -132,9 +134,11 @@ export default {
|
|
|
132
134
|
{extra ? <div class="k-descriptions-extra">{extra}</div> : null}
|
|
133
135
|
</div>
|
|
134
136
|
<div class="k-descriptions-view">
|
|
135
|
-
{this.
|
|
137
|
+
{this.renderBody()}
|
|
136
138
|
</div>
|
|
137
139
|
</div>
|
|
138
140
|
)
|
|
139
141
|
}
|
|
140
|
-
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default withInstall(Descriptions)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { withInstall } from '../utils/vue'
|
|
2
|
+
const DescriptionsItem = {
|
|
3
|
+
name: 'DescriptionsItem',
|
|
2
4
|
props: {
|
|
3
5
|
label: String,
|
|
4
6
|
span: { type: Number, default: 1 },
|
|
@@ -51,4 +53,5 @@ export default {
|
|
|
51
53
|
</td>
|
|
52
54
|
)
|
|
53
55
|
}
|
|
54
|
-
}
|
|
56
|
+
}
|
|
57
|
+
export default withInstall(DescriptionsItem)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Button } from "../button";
|
|
2
2
|
import Icon from "../icon";
|
|
3
3
|
import { t } from "../locale";
|
|
4
|
-
import transfer from "../
|
|
5
|
-
import { measureScrollBar } from
|
|
6
|
-
import { Close } from
|
|
4
|
+
import transfer from "../directives/transfer";
|
|
5
|
+
import { measureScrollBar } from "../utils/element";
|
|
6
|
+
import { Close } from "kui-icons";
|
|
7
7
|
|
|
8
8
|
let cacheBodyOverflow = {};
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { withInstall } from '../utils/vue'
|
|
11
|
+
const Drawer = {
|
|
11
12
|
name: "Drawer",
|
|
12
13
|
directives: { transfer },
|
|
13
14
|
props: {
|
|
@@ -17,7 +18,7 @@ export default {
|
|
|
17
18
|
height: { default: 256, type: [Number, String] },
|
|
18
19
|
okText: String,
|
|
19
20
|
cancelText: String,
|
|
20
|
-
placement: { type: String, default:
|
|
21
|
+
placement: { type: String, default: "right" },
|
|
21
22
|
closable: { type: Boolean, default: true },
|
|
22
23
|
footer: { type: Boolean, default: true },
|
|
23
24
|
maskClosable: { type: Boolean, default: false },
|
|
@@ -27,23 +28,23 @@ export default {
|
|
|
27
28
|
},
|
|
28
29
|
watch: {
|
|
29
30
|
value(v) {
|
|
30
|
-
this.rendered = true
|
|
31
|
-
this.$nextTick(
|
|
32
|
-
this.visible = v
|
|
33
|
-
this.openHandle()
|
|
34
|
-
this.resetBodyStyle(v)
|
|
35
|
-
})
|
|
31
|
+
this.rendered = true;
|
|
32
|
+
this.$nextTick(() => {
|
|
33
|
+
this.visible = v;
|
|
34
|
+
this.openHandle();
|
|
35
|
+
this.resetBodyStyle(v);
|
|
36
|
+
});
|
|
36
37
|
},
|
|
37
38
|
},
|
|
38
39
|
data() {
|
|
39
40
|
return {
|
|
40
41
|
visible: this.value,
|
|
41
42
|
rendered: this.value,
|
|
42
|
-
open: this.value
|
|
43
|
+
open: this.value,
|
|
43
44
|
};
|
|
44
45
|
},
|
|
45
46
|
beforeDestroy() {
|
|
46
|
-
this.resetBodyStyle(false)
|
|
47
|
+
this.resetBodyStyle(false);
|
|
47
48
|
},
|
|
48
49
|
methods: {
|
|
49
50
|
ok() {
|
|
@@ -60,10 +61,10 @@ export default {
|
|
|
60
61
|
},
|
|
61
62
|
openHandle() {
|
|
62
63
|
if (this.visible) {
|
|
63
|
-
this.open = true
|
|
64
|
+
this.open = true;
|
|
64
65
|
} else {
|
|
65
66
|
setTimeout(() => {
|
|
66
|
-
this.open = false
|
|
67
|
+
this.open = false;
|
|
67
68
|
}, 300);
|
|
68
69
|
}
|
|
69
70
|
},
|
|
@@ -72,92 +73,96 @@ export default {
|
|
|
72
73
|
this.$emit("input", false);
|
|
73
74
|
this.$emit("cancel");
|
|
74
75
|
this.$emit("close");
|
|
75
|
-
this.openHandle()
|
|
76
|
+
this.openHandle();
|
|
76
77
|
},
|
|
77
78
|
maskToClose() {
|
|
78
79
|
if (this.maskClosable) {
|
|
79
|
-
this.close()
|
|
80
|
+
this.close();
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
resetBodyStyle(opened) {
|
|
83
84
|
let target = this.target();
|
|
84
|
-
if (opened && !
|
|
85
|
+
if (opened && !Object.prototype.hasOwnProperty.call(cacheBodyOverflow, "overflow")) {
|
|
85
86
|
cacheBodyOverflow = {
|
|
86
87
|
width: target.style.width,
|
|
87
88
|
overflow: target.style.overflow,
|
|
88
89
|
overflowX: target.style.overflowX,
|
|
89
90
|
overflowY: target.style.overflowY,
|
|
90
|
-
}
|
|
91
|
+
};
|
|
91
92
|
}
|
|
92
93
|
if (opened) {
|
|
93
|
-
let barWidth = measureScrollBar(true)
|
|
94
|
-
let el = target == document.body ? document.documentElement : target
|
|
95
|
-
let hasBar = el.scrollHeight > el.clientHeight || el.offsetHeight > el.clientHeight
|
|
94
|
+
let barWidth = measureScrollBar(true);
|
|
95
|
+
let el = target == document.body ? document.documentElement : target;
|
|
96
|
+
let hasBar = el.scrollHeight > el.clientHeight || el.offsetHeight > el.clientHeight;
|
|
96
97
|
if (barWidth && hasBar) {
|
|
97
|
-
target.style.width = `calc(100% - ${barWidth}px)
|
|
98
|
-
target.style.overflowY = `hidden
|
|
98
|
+
target.style.width = `calc(100% - ${barWidth}px)`;
|
|
99
|
+
target.style.overflowY = `hidden`;
|
|
99
100
|
}
|
|
100
101
|
} else {
|
|
101
102
|
setTimeout(() => {
|
|
102
|
-
Object.keys(cacheBodyOverflow).forEach(key => {
|
|
103
|
-
target.style[key] = cacheBodyOverflow[key] ||
|
|
104
|
-
delete cacheBodyOverflow[key]
|
|
105
|
-
})
|
|
106
|
-
}, 300)
|
|
103
|
+
Object.keys(cacheBodyOverflow).forEach((key) => {
|
|
104
|
+
target.style[key] = cacheBodyOverflow[key] || "";
|
|
105
|
+
delete cacheBodyOverflow[key];
|
|
106
|
+
});
|
|
107
|
+
}, 300);
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
},
|
|
110
111
|
render() {
|
|
111
|
-
if (
|
|
112
|
-
const { title, visible, cancelText, okText, ok,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
if (typeof window === "undefined") return null;
|
|
113
|
+
const { title, visible, cancelText, okText, ok, placement, cancel, $slots, width, height, open, closable, close, loading } = this;
|
|
114
|
+
const hasFooter = this.footer || $slots.footer;
|
|
115
|
+
const cancelBtn = <Button onClick={cancel}>{cancelText || t("k.drawer.cancel")}</Button>;
|
|
116
|
+
const okBtn = (
|
|
117
|
+
<Button type="primary" onClick={ok} loading={loading}>
|
|
118
|
+
{okText || t("k.drawer.ok")}
|
|
119
|
+
</Button>
|
|
120
|
+
);
|
|
121
|
+
const footNode = hasFooter ? (
|
|
122
|
+
<div class="k-drawer-footer">
|
|
120
123
|
{$slots.footer}
|
|
121
|
-
{!$slots.footer && [
|
|
122
|
-
</div>
|
|
123
|
-
)
|
|
124
|
-
const closeNode = closable
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{ 'k-drawer-nobody': !inbody },
|
|
134
|
-
{ 'k-drawer-nomask': !this.mask },
|
|
135
|
-
]
|
|
124
|
+
{!$slots.footer && [cancelBtn, okBtn]}
|
|
125
|
+
</div>
|
|
126
|
+
) : null;
|
|
127
|
+
const closeNode = closable ? (
|
|
128
|
+
<span class="k-drawer-close" onClick={close}>
|
|
129
|
+
<Icon type={Close} />
|
|
130
|
+
</span>
|
|
131
|
+
) : null;
|
|
132
|
+
const transitionName = `k-drawer-${placement}`;
|
|
133
|
+
const target = this.target();
|
|
134
|
+
const isBody = target == document.body;
|
|
135
|
+
const classes = ["k-drawer", `k-drawer-${placement}`, { "k-drawer-open": open }, { "k-drawer-has-footer": hasFooter }, { "k-drawer-nobody": !isBody }, { "k-drawer-nomask": !this.mask }];
|
|
136
136
|
let styles = {};
|
|
137
|
-
if (placement ==
|
|
138
|
-
if (placement ==
|
|
137
|
+
if (placement == "left" || placement == "right") styles.width = /%/.test(width) ? width : width + "px";
|
|
138
|
+
if (placement == "top" || placement == "bottom") styles.height = /%/.test(height) ? height : height + "px";
|
|
139
139
|
// const wrapCls =
|
|
140
|
-
let maskNode = null
|
|
140
|
+
let maskNode = null;
|
|
141
141
|
if (this.mask) {
|
|
142
|
-
maskNode =
|
|
143
|
-
<
|
|
144
|
-
|
|
142
|
+
maskNode = (
|
|
143
|
+
<transition name="k-drawer-fade">
|
|
144
|
+
<div class={["k-drawer-mask", { "k-drawer-mask-nobody": !isBody }]} v-show={visible} onClick={this.maskToClose}></div>
|
|
145
|
+
</transition>
|
|
146
|
+
);
|
|
145
147
|
}
|
|
146
|
-
return (
|
|
147
|
-
|
|
148
|
+
return this.rendered ? (
|
|
149
|
+
<div class={classes} v-transfer={target}>
|
|
148
150
|
{maskNode}
|
|
149
|
-
<transition name={transitionName}
|
|
151
|
+
<transition name={transitionName}>
|
|
150
152
|
<div class="k-drawer-box" v-show={visible} style={styles}>
|
|
151
153
|
<div class="k-drawer-content">
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
{
|
|
154
|
+
<div class="k-drawer-header">
|
|
155
|
+
{closeNode}
|
|
156
|
+
<div class="k-drawer-header-inner">{title}</div>
|
|
155
157
|
</div>
|
|
158
|
+
<div class="k-drawer-body">{$slots.default}</div>
|
|
156
159
|
{footNode}
|
|
157
160
|
</div>
|
|
158
161
|
</div>
|
|
159
162
|
</transition>
|
|
160
|
-
</div>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
};
|
|
163
|
+
</div>
|
|
164
|
+
) : null;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default withInstall(Drawer);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BasePop from '../base/pop'
|
|
2
|
+
import { withInstall } from '../utils/vue'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const Dropdown = {
|
|
4
5
|
name: 'Dropdown',
|
|
5
6
|
props: {
|
|
6
7
|
dark: Boolean,
|
|
@@ -69,4 +70,6 @@ export default {
|
|
|
69
70
|
this.$emit('input', false)
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default withInstall(Dropdown);
|