vue-devui 1.0.0-rc.0 → 1.0.0-rc.11
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 +78 -116
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8190 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +34 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8167 -288
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1176
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8074 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +11 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7972 -157
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3653 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9170 -596
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -137
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10459 -1511
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +344 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/{anchor → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4171 -2898
- package/time-select/index.umd.js +27 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{back-top → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5198 -1850
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +427 -132
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +12064 -15841
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -258
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/accordion/index.es.js
DELETED
|
@@ -1,720 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, isVNode, createTextVNode, provide, onMounted, watch } from "vue";
|
|
21
|
-
import { useRoute } from "vue-router";
|
|
22
|
-
const accordionProps = {
|
|
23
|
-
data: {
|
|
24
|
-
type: Array,
|
|
25
|
-
default: null
|
|
26
|
-
},
|
|
27
|
-
titleKey: { type: String, default: "title" },
|
|
28
|
-
loadingKey: { type: String, default: "loading" },
|
|
29
|
-
childrenKey: { type: String, default: "children" },
|
|
30
|
-
disabledKey: { type: String, default: "disabled" },
|
|
31
|
-
activeKey: { type: String, default: "active" },
|
|
32
|
-
openKey: { type: String, default: "open" },
|
|
33
|
-
menuItemTemplate: { type: Boolean, default: true },
|
|
34
|
-
itemTemplate: { type: Boolean, default: true },
|
|
35
|
-
menuToggle: {
|
|
36
|
-
type: Function,
|
|
37
|
-
default: null
|
|
38
|
-
},
|
|
39
|
-
itemClick: {
|
|
40
|
-
type: Function,
|
|
41
|
-
default: null
|
|
42
|
-
},
|
|
43
|
-
activeItemChange: {
|
|
44
|
-
type: Function,
|
|
45
|
-
default: null
|
|
46
|
-
},
|
|
47
|
-
restrictOneOpen: { type: Boolean, default: false },
|
|
48
|
-
autoOpenActiveMenu: { type: Boolean, default: false },
|
|
49
|
-
showNoContent: { type: Boolean, default: true },
|
|
50
|
-
noContentTemplate: { type: Boolean, default: true },
|
|
51
|
-
loadingTemplate: { type: Boolean, default: true },
|
|
52
|
-
innerListTemplate: { type: Boolean, default: true },
|
|
53
|
-
linkType: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: ""
|
|
56
|
-
},
|
|
57
|
-
linkTypeKey: { type: String, default: "linkType" },
|
|
58
|
-
linkKey: { type: String, default: "link" },
|
|
59
|
-
linkTargetKey: { type: String, default: "target" },
|
|
60
|
-
linkDefaultTarget: { type: String, default: "_self" },
|
|
61
|
-
accordionType: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: "normal"
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const OpenIcon = () => {
|
|
67
|
-
return createVNode("svg", {
|
|
68
|
-
"width": "1em",
|
|
69
|
-
"height": "1em",
|
|
70
|
-
"viewBox": "0 0 16 16",
|
|
71
|
-
"version": "1.1",
|
|
72
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
73
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
74
|
-
}, [createVNode("g", {
|
|
75
|
-
"stroke": "none",
|
|
76
|
-
"stroke-width": "1",
|
|
77
|
-
"fill": "none",
|
|
78
|
-
"fill-rule": "evenodd"
|
|
79
|
-
}, [createVNode("path", {
|
|
80
|
-
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
81
|
-
"fill-rule": "nonzero"
|
|
82
|
-
}, null)])]);
|
|
83
|
-
};
|
|
84
|
-
const getRootSlots = () => {
|
|
85
|
-
const rootComponentName = "DAccordion";
|
|
86
|
-
const getRootComponent = (component) => {
|
|
87
|
-
if (component && component.type.name === rootComponentName) {
|
|
88
|
-
return component;
|
|
89
|
-
}
|
|
90
|
-
if (component && component.parent) {
|
|
91
|
-
const parent = component.parent;
|
|
92
|
-
return getRootComponent(parent);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const rootComponent = getRootComponent(getCurrentInstance());
|
|
96
|
-
return rootComponent == null ? void 0 : rootComponent.slots;
|
|
97
|
-
};
|
|
98
|
-
var DAccordionMenu = defineComponent({
|
|
99
|
-
name: "DAccordionMenu",
|
|
100
|
-
components: {
|
|
101
|
-
OpenIcon
|
|
102
|
-
},
|
|
103
|
-
props: __spreadValues({
|
|
104
|
-
item: Object,
|
|
105
|
-
deepth: {
|
|
106
|
-
type: Number,
|
|
107
|
-
default: 0
|
|
108
|
-
},
|
|
109
|
-
parent: {
|
|
110
|
-
type: Object,
|
|
111
|
-
default: null
|
|
112
|
-
}
|
|
113
|
-
}, accordionProps),
|
|
114
|
-
setup(props) {
|
|
115
|
-
const {
|
|
116
|
-
item,
|
|
117
|
-
deepth,
|
|
118
|
-
parent,
|
|
119
|
-
openKey,
|
|
120
|
-
activeKey,
|
|
121
|
-
autoOpenActiveMenu,
|
|
122
|
-
disabledKey,
|
|
123
|
-
childrenKey,
|
|
124
|
-
titleKey,
|
|
125
|
-
menuItemTemplate
|
|
126
|
-
} = toRefs(props);
|
|
127
|
-
const rootSlots = getRootSlots();
|
|
128
|
-
const accordionCtx = inject("accordionContext");
|
|
129
|
-
const parentValue = parent.value;
|
|
130
|
-
const deepValue = deepth.value;
|
|
131
|
-
const toggle = (itemEvent) => {
|
|
132
|
-
accordionCtx.menuToggleFn(itemEvent);
|
|
133
|
-
};
|
|
134
|
-
const hasActiveChildren = (item2) => {
|
|
135
|
-
if (item2[activeKey.value] === true)
|
|
136
|
-
return true;
|
|
137
|
-
if (item2[childrenKey.value]) {
|
|
138
|
-
return hasChildActive(item2[childrenKey.value]);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
const hasChildActive = (arr) => {
|
|
142
|
-
let flag = false;
|
|
143
|
-
if (!arr.length)
|
|
144
|
-
return false;
|
|
145
|
-
for (let i = 0; i < arr.length; i++) {
|
|
146
|
-
if (arr[i][activeKey.value] === true) {
|
|
147
|
-
flag = true;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
if (arr[i][childrenKey.value]) {
|
|
151
|
-
flag = hasChildActive(arr[i][childrenKey.value]);
|
|
152
|
-
if (flag)
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return flag;
|
|
157
|
-
};
|
|
158
|
-
const keyOpen = computed(() => {
|
|
159
|
-
return item.value && item.value[openKey.value];
|
|
160
|
-
});
|
|
161
|
-
const disabled = computed(() => {
|
|
162
|
-
return item.value && item.value[disabledKey.value];
|
|
163
|
-
});
|
|
164
|
-
const title = computed(() => {
|
|
165
|
-
return item.value && item.value[titleKey.value];
|
|
166
|
-
});
|
|
167
|
-
const children = computed(() => {
|
|
168
|
-
return item.value && item.value[childrenKey.value];
|
|
169
|
-
});
|
|
170
|
-
const childActived = computed(() => {
|
|
171
|
-
return hasActiveChildren(item.value);
|
|
172
|
-
});
|
|
173
|
-
const open = computed(() => {
|
|
174
|
-
return keyOpen.value === void 0 && autoOpenActiveMenu.value ? childActived.value : keyOpen.value;
|
|
175
|
-
});
|
|
176
|
-
return () => {
|
|
177
|
-
var _a;
|
|
178
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
179
|
-
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", open.value && "open", childActived.value && "active", disabled.value && "disabled"],
|
|
180
|
-
"title": title.value,
|
|
181
|
-
"style": {
|
|
182
|
-
textIndent: deepValue * 20 + "px"
|
|
183
|
-
},
|
|
184
|
-
"onClick": (e) => !disabled.value && toggle({
|
|
185
|
-
item: item.value,
|
|
186
|
-
open: !open.value,
|
|
187
|
-
parent: parentValue,
|
|
188
|
-
event: e
|
|
189
|
-
})
|
|
190
|
-
}, [createVNode("div", {
|
|
191
|
-
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
192
|
-
"style": {
|
|
193
|
-
left: deepValue * 20 + 10 + "px"
|
|
194
|
-
}
|
|
195
|
-
}, null), (!rootSlots.menuItemTemplate || menuItemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.menuItemTemplate && menuItemTemplate.value !== false && ((_a = rootSlots.menuItemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
196
|
-
parent: parentValue,
|
|
197
|
-
deepth: deepValue,
|
|
198
|
-
item: item.value
|
|
199
|
-
})), createVNode("span", {
|
|
200
|
-
"class": "devui-accordion-open-icon"
|
|
201
|
-
}, [createVNode(OpenIcon, null, null)])]), createVNode("div", {
|
|
202
|
-
"class": [!open.value && "devui-accordion-menu-hidden", "devui-accordion-submenu", "devui-accordion-show-animate"]
|
|
203
|
-
}, [createVNode(AccordionList, mergeProps(props, {
|
|
204
|
-
"deepth": deepValue + 1,
|
|
205
|
-
"data": children.value || [],
|
|
206
|
-
"parent": item.value
|
|
207
|
-
}), null)])]);
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
var DAccordionItem = defineComponent({
|
|
212
|
-
name: "DAccordionItem",
|
|
213
|
-
props: __spreadValues({
|
|
214
|
-
item: Object,
|
|
215
|
-
deepth: {
|
|
216
|
-
type: Number,
|
|
217
|
-
default: 0
|
|
218
|
-
},
|
|
219
|
-
parent: {
|
|
220
|
-
type: Object,
|
|
221
|
-
default: null
|
|
222
|
-
}
|
|
223
|
-
}, accordionProps),
|
|
224
|
-
setup(props) {
|
|
225
|
-
const {
|
|
226
|
-
item,
|
|
227
|
-
deepth,
|
|
228
|
-
parent,
|
|
229
|
-
titleKey,
|
|
230
|
-
activeKey,
|
|
231
|
-
disabledKey,
|
|
232
|
-
itemTemplate
|
|
233
|
-
} = toRefs(props);
|
|
234
|
-
const rootSlots = getRootSlots();
|
|
235
|
-
const accordionCtx = inject("accordionContext");
|
|
236
|
-
const parentValue = parent.value;
|
|
237
|
-
const deepValue = deepth.value;
|
|
238
|
-
const disabled = computed(() => {
|
|
239
|
-
return item.value && item.value[disabledKey.value];
|
|
240
|
-
});
|
|
241
|
-
const title = computed(() => {
|
|
242
|
-
return item.value && item.value[titleKey.value];
|
|
243
|
-
});
|
|
244
|
-
const active = computed(() => {
|
|
245
|
-
return item.value && item.value[activeKey.value];
|
|
246
|
-
});
|
|
247
|
-
const childActived = computed(() => {
|
|
248
|
-
return active.value;
|
|
249
|
-
});
|
|
250
|
-
const itemClick = (itemEvent) => {
|
|
251
|
-
if (item.value && !disabled.value) {
|
|
252
|
-
accordionCtx.itemClickFn(itemEvent);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
return () => {
|
|
256
|
-
var _a;
|
|
257
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
258
|
-
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", childActived.value && "active", disabled.value && "disabled"],
|
|
259
|
-
"title": title.value,
|
|
260
|
-
"style": {
|
|
261
|
-
textIndent: deepValue * 20 + "px"
|
|
262
|
-
},
|
|
263
|
-
"onClick": (e) => itemClick({
|
|
264
|
-
item: item.value,
|
|
265
|
-
parent: parentValue,
|
|
266
|
-
event: e
|
|
267
|
-
})
|
|
268
|
-
}, [createVNode("div", {
|
|
269
|
-
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
270
|
-
"style": {
|
|
271
|
-
left: deepValue * 20 + 10 + "px"
|
|
272
|
-
}
|
|
273
|
-
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
274
|
-
parent: parentValue,
|
|
275
|
-
deepth: deepValue,
|
|
276
|
-
item: item.value
|
|
277
|
-
}))])]);
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
var DAccordionItemHreflink = defineComponent({
|
|
282
|
-
name: "DAccordionItemHreflink",
|
|
283
|
-
component: {
|
|
284
|
-
DAccordionItem
|
|
285
|
-
},
|
|
286
|
-
props: __spreadValues({
|
|
287
|
-
item: Object,
|
|
288
|
-
deepth: {
|
|
289
|
-
type: Number,
|
|
290
|
-
default: 0
|
|
291
|
-
},
|
|
292
|
-
parent: {
|
|
293
|
-
type: Object,
|
|
294
|
-
default: null
|
|
295
|
-
}
|
|
296
|
-
}, accordionProps),
|
|
297
|
-
setup(props) {
|
|
298
|
-
const {
|
|
299
|
-
item,
|
|
300
|
-
deepth,
|
|
301
|
-
parent,
|
|
302
|
-
titleKey,
|
|
303
|
-
linkKey,
|
|
304
|
-
linkTargetKey,
|
|
305
|
-
linkDefaultTarget,
|
|
306
|
-
disabledKey,
|
|
307
|
-
itemTemplate
|
|
308
|
-
} = toRefs(props);
|
|
309
|
-
const rootSlots = getRootSlots();
|
|
310
|
-
const accordionCtx = inject("accordionContext");
|
|
311
|
-
const title = computed(() => {
|
|
312
|
-
return item.value && item.value[titleKey.value];
|
|
313
|
-
});
|
|
314
|
-
const link = computed(() => {
|
|
315
|
-
return item.value && item.value[linkKey.value];
|
|
316
|
-
});
|
|
317
|
-
const target = computed(() => {
|
|
318
|
-
return item.value && (item.value[linkTargetKey.value] || linkDefaultTarget.value);
|
|
319
|
-
});
|
|
320
|
-
const disabled = computed(() => {
|
|
321
|
-
return item.value && item.value[disabledKey.value];
|
|
322
|
-
});
|
|
323
|
-
const parentValue = parent.value;
|
|
324
|
-
const deepValue = deepth.value;
|
|
325
|
-
const linkItemClickFn = (itemEvent) => {
|
|
326
|
-
if (item.value && !disabled.value) {
|
|
327
|
-
accordionCtx.itemClickFn(itemEvent);
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
const renderContent = () => {
|
|
331
|
-
var _a;
|
|
332
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
333
|
-
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
334
|
-
"style": {
|
|
335
|
-
left: deepValue * 20 + 10 + "px"
|
|
336
|
-
}
|
|
337
|
-
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
338
|
-
parent: parentValue,
|
|
339
|
-
deepth: deepValue,
|
|
340
|
-
item: item.value
|
|
341
|
-
}))]);
|
|
342
|
-
};
|
|
343
|
-
return () => {
|
|
344
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
345
|
-
"class": ["devui-accordion-item-title", disabled.value && "disabled"],
|
|
346
|
-
"style": {
|
|
347
|
-
textIndent: deepValue * 20 + "px"
|
|
348
|
-
}
|
|
349
|
-
}, [!disabled.value && createVNode("a", {
|
|
350
|
-
"href": link.value,
|
|
351
|
-
"target": target.value,
|
|
352
|
-
"class": "devui-over-flow-ellipsis",
|
|
353
|
-
"title": title.value,
|
|
354
|
-
"onClick": (e) => linkItemClickFn({
|
|
355
|
-
item: item.value,
|
|
356
|
-
parent: parentValue,
|
|
357
|
-
event: e
|
|
358
|
-
})
|
|
359
|
-
}, [renderContent()]), disabled.value && createVNode("a", {
|
|
360
|
-
"class": "devui-over-flow-ellipsis",
|
|
361
|
-
"title": title.value
|
|
362
|
-
}, [renderContent()])])]);
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
function _isSlot(s) {
|
|
367
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
368
|
-
}
|
|
369
|
-
var DAccordionItemRouterlink = defineComponent({
|
|
370
|
-
name: "DAccordionItemRouterlink",
|
|
371
|
-
component: {
|
|
372
|
-
DAccordionItem
|
|
373
|
-
},
|
|
374
|
-
props: __spreadValues({
|
|
375
|
-
item: Object,
|
|
376
|
-
deepth: {
|
|
377
|
-
type: Number,
|
|
378
|
-
default: 0
|
|
379
|
-
},
|
|
380
|
-
parent: {
|
|
381
|
-
type: Object,
|
|
382
|
-
default: null
|
|
383
|
-
}
|
|
384
|
-
}, accordionProps),
|
|
385
|
-
setup(props) {
|
|
386
|
-
const {
|
|
387
|
-
item,
|
|
388
|
-
deepth,
|
|
389
|
-
parent,
|
|
390
|
-
titleKey,
|
|
391
|
-
linkKey,
|
|
392
|
-
linkDefaultTarget,
|
|
393
|
-
disabledKey,
|
|
394
|
-
itemTemplate
|
|
395
|
-
} = toRefs(props);
|
|
396
|
-
const route = useRoute();
|
|
397
|
-
const rootSlots = getRootSlots();
|
|
398
|
-
const accordionCtx = inject("accordionContext");
|
|
399
|
-
console.log(useRoute());
|
|
400
|
-
const title = computed(() => {
|
|
401
|
-
return item.value && item.value[titleKey.value];
|
|
402
|
-
});
|
|
403
|
-
const link = computed(() => {
|
|
404
|
-
return item.value && item.value[linkKey.value];
|
|
405
|
-
});
|
|
406
|
-
const isUsedVueRouter = computed(() => route !== void 0);
|
|
407
|
-
const routerLinkActive = computed(() => {
|
|
408
|
-
return route === link.value;
|
|
409
|
-
});
|
|
410
|
-
const disabled = computed(() => {
|
|
411
|
-
return item.value && item.value[disabledKey.value];
|
|
412
|
-
});
|
|
413
|
-
const parentValue = parent.value;
|
|
414
|
-
const deepValue = deepth.value;
|
|
415
|
-
const linkItemClickFn = (itemEvent) => {
|
|
416
|
-
if (item.value && !disabled.value) {
|
|
417
|
-
accordionCtx.itemClickFn(itemEvent);
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
const renderContent = () => {
|
|
421
|
-
var _a;
|
|
422
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
423
|
-
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
424
|
-
"style": {
|
|
425
|
-
left: deepValue * 20 + 10 + "px"
|
|
426
|
-
}
|
|
427
|
-
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
428
|
-
parent: parentValue,
|
|
429
|
-
deepth: deepValue,
|
|
430
|
-
item: item.value
|
|
431
|
-
}))]);
|
|
432
|
-
};
|
|
433
|
-
return () => {
|
|
434
|
-
let _slot;
|
|
435
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
436
|
-
"class": ["devui-accordion-item-title", disabled.value && "disabled"],
|
|
437
|
-
"style": {
|
|
438
|
-
textIndent: deepValue * 20 + "px"
|
|
439
|
-
}
|
|
440
|
-
}, [!disabled.value && createVNode(Fragment, null, [isUsedVueRouter.value && createVNode(resolveComponent("router-link"), {
|
|
441
|
-
"to": link.value,
|
|
442
|
-
"class": ["devui-over-flow-ellipsis", routerLinkActive.value && ".devui-router-active"],
|
|
443
|
-
"custom": true,
|
|
444
|
-
"title": title.value,
|
|
445
|
-
"onClick": (e) => linkItemClickFn({
|
|
446
|
-
item: item.value,
|
|
447
|
-
parent: parentValue,
|
|
448
|
-
event: e
|
|
449
|
-
})
|
|
450
|
-
}, _isSlot(_slot = renderContent()) ? _slot : {
|
|
451
|
-
default: () => [_slot]
|
|
452
|
-
}), !isUsedVueRouter.value && createVNode("a", {
|
|
453
|
-
"href": link.value,
|
|
454
|
-
"target": linkDefaultTarget.value,
|
|
455
|
-
"class": "devui-over-flow-ellipsis",
|
|
456
|
-
"title": title.value,
|
|
457
|
-
"onClick": (e) => linkItemClickFn({
|
|
458
|
-
item: item.value,
|
|
459
|
-
parent: parentValue,
|
|
460
|
-
event: e
|
|
461
|
-
})
|
|
462
|
-
}, [renderContent()])]), disabled.value && createVNode("a", {
|
|
463
|
-
"class": "devui-over-flow-ellipsis",
|
|
464
|
-
"title": title.value
|
|
465
|
-
}, [renderContent()])])]);
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
var AccordionList = defineComponent({
|
|
470
|
-
name: "DAccordionList",
|
|
471
|
-
components: {
|
|
472
|
-
DAccordionMenu,
|
|
473
|
-
DAccordionItem,
|
|
474
|
-
DAccordionItemHreflink,
|
|
475
|
-
DAccordionItemRouterlink
|
|
476
|
-
},
|
|
477
|
-
inheritAttrs: false,
|
|
478
|
-
props: __spreadValues({
|
|
479
|
-
data: {
|
|
480
|
-
type: Array,
|
|
481
|
-
default: null
|
|
482
|
-
},
|
|
483
|
-
deepth: {
|
|
484
|
-
type: Number,
|
|
485
|
-
default: 0
|
|
486
|
-
},
|
|
487
|
-
parent: {
|
|
488
|
-
type: Object,
|
|
489
|
-
default: null
|
|
490
|
-
},
|
|
491
|
-
innerListTemplate: Boolean
|
|
492
|
-
}, accordionProps),
|
|
493
|
-
setup(props, {
|
|
494
|
-
attrs
|
|
495
|
-
}) {
|
|
496
|
-
const {
|
|
497
|
-
childrenKey,
|
|
498
|
-
deepth,
|
|
499
|
-
parent,
|
|
500
|
-
data,
|
|
501
|
-
linkType,
|
|
502
|
-
showNoContent,
|
|
503
|
-
loadingKey,
|
|
504
|
-
titleKey,
|
|
505
|
-
linkTypeKey,
|
|
506
|
-
loadingTemplate,
|
|
507
|
-
noContentTemplate,
|
|
508
|
-
innerListTemplate
|
|
509
|
-
} = toRefs(props);
|
|
510
|
-
const parentValue = parent.value;
|
|
511
|
-
const deepValue = deepth.value;
|
|
512
|
-
const rootSlots = getRootSlots();
|
|
513
|
-
const accordionCtx = inject("accordionContext");
|
|
514
|
-
const loading = computed(() => {
|
|
515
|
-
return parentValue && parentValue[loadingKey.value];
|
|
516
|
-
});
|
|
517
|
-
const noContent = computed(() => {
|
|
518
|
-
const dataValue = data.value;
|
|
519
|
-
return dataValue === void 0 || dataValue === null || dataValue.length === 0;
|
|
520
|
-
});
|
|
521
|
-
return () => {
|
|
522
|
-
var _a, _b, _c;
|
|
523
|
-
return createVNode(Fragment, null, [(!rootSlots.innerListTemplate || deepth.value === 0 || innerListTemplate.value === false) && createVNode("ul", mergeProps({
|
|
524
|
-
"class": ["devui-accordion-list"]
|
|
525
|
-
}, attrs), [data.value.map((item) => {
|
|
526
|
-
return createVNode("li", {
|
|
527
|
-
"class": "devui-accordion-item",
|
|
528
|
-
"key": item[titleKey.value]
|
|
529
|
-
}, [item[childrenKey.value] !== void 0 && createVNode("div", {
|
|
530
|
-
"class": "devui-accordion-menu-item"
|
|
531
|
-
}, [createVNode(resolveComponent("d-accordion-menu"), mergeProps(props, {
|
|
532
|
-
"item": item,
|
|
533
|
-
"deepth": deepValue,
|
|
534
|
-
"parent": parentValue
|
|
535
|
-
}), null)]), item[childrenKey.value] === void 0 && createVNode(Fragment, null, [(!linkType.value || linkType.value === "") && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
|
|
536
|
-
"item": item,
|
|
537
|
-
"deepth": deepValue,
|
|
538
|
-
"parent": parentValue
|
|
539
|
-
}), null), linkType.value === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
|
|
540
|
-
"item": item,
|
|
541
|
-
"deepth": deepValue,
|
|
542
|
-
"parent": parentValue
|
|
543
|
-
}), null), linkType.value === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
|
|
544
|
-
"item": item,
|
|
545
|
-
"deepth": deepValue,
|
|
546
|
-
"parent": parentValue
|
|
547
|
-
}), null), linkType.value === "dependOnLinkTypeKey" && createVNode(Fragment, null, [item[linkTypeKey.value] === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
|
|
548
|
-
"item": item,
|
|
549
|
-
"deepth": deepValue,
|
|
550
|
-
"parent": parentValue
|
|
551
|
-
}), null), item[linkTypeKey.value] === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
|
|
552
|
-
"item": item,
|
|
553
|
-
"deepth": deepValue,
|
|
554
|
-
"parent": parentValue
|
|
555
|
-
}), null), item[linkTypeKey.value] !== "routerLink" && item[linkTypeKey.value] !== "hrefLink" && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
|
|
556
|
-
"item": item,
|
|
557
|
-
"deepth": deepValue,
|
|
558
|
-
"parent": parentValue
|
|
559
|
-
}), null)])])]);
|
|
560
|
-
})]), rootSlots.innerListTemplate && innerListTemplate.value !== false && deepValue !== 0 && ((_a = rootSlots.innerListTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
561
|
-
item: parentValue,
|
|
562
|
-
deepth: deepValue,
|
|
563
|
-
itemClickFn: accordionCtx.itemClickFn,
|
|
564
|
-
menuToggleFn: accordionCtx.menuToggleFn
|
|
565
|
-
})), (!rootSlots.innerListTemplate || innerListTemplate.value === false) && (loading.value || noContent.value && showNoContent.value) && createVNode("ul", mergeProps({
|
|
566
|
-
"class": ["devui-accordion-list"]
|
|
567
|
-
}, attrs), [
|
|
568
|
-
loading.value && (!rootSlots.loadingTemplate || loadingTemplate.value === false) && createVNode("li", {
|
|
569
|
-
"class": "devui-accordion-item"
|
|
570
|
-
}, [createVNode("div", {
|
|
571
|
-
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis"],
|
|
572
|
-
"style": {
|
|
573
|
-
textIndent: deepValue * 20 + "px"
|
|
574
|
-
}
|
|
575
|
-
}, [createTextVNode("\u52A0\u8F7D\u4E2D...")])]),
|
|
576
|
-
loading.value && rootSlots.loadingTemplate && loadingTemplate.value !== false && ((_b = rootSlots.loadingTemplate) == null ? void 0 : _b.call(rootSlots, {
|
|
577
|
-
item: parentValue,
|
|
578
|
-
deepth: deepValue
|
|
579
|
-
})),
|
|
580
|
-
showNoContent.value && !loading.value && noContent.value && (!rootSlots.noContentTemplate || noContentTemplate.value === false) && createVNode("li", {
|
|
581
|
-
"class": "devui-accordion-item"
|
|
582
|
-
}, [createVNode("div", {
|
|
583
|
-
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis disabled"],
|
|
584
|
-
"style": {
|
|
585
|
-
textIndent: deepValue * 20 + "px"
|
|
586
|
-
}
|
|
587
|
-
}, [createTextVNode("\u6CA1\u6709\u6570\u636E")])]),
|
|
588
|
-
showNoContent.value && !loading.value && noContent.value && rootSlots.noContentTemplate && noContentTemplate.value !== false && ((_c = rootSlots.noContentTemplate) == null ? void 0 : _c.call(rootSlots, {
|
|
589
|
-
item: parentValue,
|
|
590
|
-
deepth: deepValue
|
|
591
|
-
}))
|
|
592
|
-
])]);
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
var accordion = "";
|
|
597
|
-
var Accordion = defineComponent({
|
|
598
|
-
name: "DAccordion",
|
|
599
|
-
props: accordionProps,
|
|
600
|
-
setup(props, {
|
|
601
|
-
emit
|
|
602
|
-
}) {
|
|
603
|
-
const {
|
|
604
|
-
data,
|
|
605
|
-
childrenKey,
|
|
606
|
-
activeKey,
|
|
607
|
-
openKey,
|
|
608
|
-
accordionType,
|
|
609
|
-
autoOpenActiveMenu,
|
|
610
|
-
restrictOneOpen
|
|
611
|
-
} = toRefs(props);
|
|
612
|
-
let clickActiveItem = void 0;
|
|
613
|
-
const flatten = (arr, childrenKey2 = "children", includeParent = false, includeLeaf = true) => {
|
|
614
|
-
return arr.reduce((acc, cur) => {
|
|
615
|
-
const children = cur[childrenKey2];
|
|
616
|
-
if (children === void 0) {
|
|
617
|
-
if (includeLeaf) {
|
|
618
|
-
acc.push(cur);
|
|
619
|
-
}
|
|
620
|
-
} else {
|
|
621
|
-
if (includeParent) {
|
|
622
|
-
acc.push(cur);
|
|
623
|
-
}
|
|
624
|
-
if (Array.isArray(children)) {
|
|
625
|
-
acc.push(...flatten(children, childrenKey2, includeParent));
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
return acc;
|
|
629
|
-
}, []);
|
|
630
|
-
};
|
|
631
|
-
const initActiveItem = () => {
|
|
632
|
-
const activeItem = flatten(data.value, childrenKey.value).filter((item) => item[activeKey.value]).pop();
|
|
633
|
-
if (activeItem) {
|
|
634
|
-
if (!clickActiveItem) {
|
|
635
|
-
activeItemFn(activeItem);
|
|
636
|
-
}
|
|
637
|
-
} else {
|
|
638
|
-
clickActiveItem = void 0;
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
const activeItemFn = (item) => {
|
|
642
|
-
if (clickActiveItem && clickActiveItem[activeKey.value]) {
|
|
643
|
-
clickActiveItem[activeKey.value] = false;
|
|
644
|
-
}
|
|
645
|
-
item[activeKey.value] = true;
|
|
646
|
-
clickActiveItem = item;
|
|
647
|
-
emit("activeItemChange", clickActiveItem);
|
|
648
|
-
};
|
|
649
|
-
const openMenuFn = (item, open) => {
|
|
650
|
-
if (open && restrictOneOpen.value) {
|
|
651
|
-
data.value.forEach((itemtemp) => {
|
|
652
|
-
itemtemp[openKey.value] = false;
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
item[openKey.value] = open;
|
|
656
|
-
};
|
|
657
|
-
const itemClickFn = (itemEvent) => {
|
|
658
|
-
const prevActiveItem = clickActiveItem;
|
|
659
|
-
activeItemFn(itemEvent.item);
|
|
660
|
-
emit("itemClick", __spreadProps(__spreadValues({}, itemEvent), {
|
|
661
|
-
prevActiveItem
|
|
662
|
-
}));
|
|
663
|
-
};
|
|
664
|
-
const linkItemClickFn = (itemEvent) => {
|
|
665
|
-
const prevActiveItem = clickActiveItem;
|
|
666
|
-
clickActiveItem = itemEvent.item;
|
|
667
|
-
emit("linkItemClick", __spreadProps(__spreadValues({}, itemEvent), {
|
|
668
|
-
prevActiveItem
|
|
669
|
-
}));
|
|
670
|
-
};
|
|
671
|
-
const menuToggleFn = (menuEvent) => {
|
|
672
|
-
openMenuFn(menuEvent.item, menuEvent.open);
|
|
673
|
-
emit("menuToggle", menuEvent);
|
|
674
|
-
};
|
|
675
|
-
const cleanOpenData = () => {
|
|
676
|
-
flatten(data.value, childrenKey.value, true, false).forEach((item) => item[openKey.value] = void 0);
|
|
677
|
-
};
|
|
678
|
-
provide("accordionContext", {
|
|
679
|
-
itemClickFn,
|
|
680
|
-
linkItemClickFn,
|
|
681
|
-
menuToggleFn
|
|
682
|
-
});
|
|
683
|
-
onMounted(() => {
|
|
684
|
-
if (data.value) {
|
|
685
|
-
initActiveItem();
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
watch(() => autoOpenActiveMenu.value, (current, preV) => {
|
|
689
|
-
if (current && preV === false) {
|
|
690
|
-
cleanOpenData();
|
|
691
|
-
}
|
|
692
|
-
});
|
|
693
|
-
watch(data.value, (current, preV) => {
|
|
694
|
-
initActiveItem();
|
|
695
|
-
}, {
|
|
696
|
-
deep: true
|
|
697
|
-
});
|
|
698
|
-
return () => {
|
|
699
|
-
return createVNode("div", {
|
|
700
|
-
"class": ["devui-accordion-menu", "devui-scrollbar", "devui-accordion-show-animate", accordionType.value === "normal" && "devui-accordion-menu-normal"]
|
|
701
|
-
}, [createVNode(AccordionList, mergeProps(props, {
|
|
702
|
-
"data": data.value,
|
|
703
|
-
"deepth": 0,
|
|
704
|
-
"parent": null
|
|
705
|
-
}), null)]);
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
Accordion.install = function(app) {
|
|
710
|
-
app.component(Accordion.name, Accordion);
|
|
711
|
-
};
|
|
712
|
-
var index = {
|
|
713
|
-
title: "Accordion \u624B\u98CE\u7434",
|
|
714
|
-
category: "\u5BFC\u822A",
|
|
715
|
-
status: "10%",
|
|
716
|
-
install(app) {
|
|
717
|
-
app.use(Accordion);
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
export { Accordion, index as default };
|