vue-devui 1.0.0-beta.18 → 1.0.0-beta.220801
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 +94 -118
- 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 +8349 -426
- 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 +45 -20
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5743 -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 +8070 -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 +213 -0
- package/collapse/index.umd.js +1 -0
- package/{back-top → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +60 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +12018 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +184 -5736
- package/drawer/index.umd.js +1 -27
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +615 -396
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +786 -195
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +2360 -2094
- package/form/index.umd.js +17 -17
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +137 -134
- 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 +199 -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 +8254 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +270 -187
- 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/{back-top → mention}/index.d.ts +0 -0
- package/{color-picker → mention}/index.es.js +2983 -2861
- package/mention/index.umd.js +36 -0
- package/{anchor → mention}/package.json +1 -1
- package/mention/style.css +1 -0
- package/{breadcrumb → menu}/index.d.ts +0 -0
- package/menu/index.es.js +870 -0
- package/menu/index.umd.js +1 -0
- package/{toast → menu}/package.json +1 -1
- package/menu/style.css +1 -0
- package/{carousel → message}/index.d.ts +0 -0
- package/message/index.es.js +538 -0
- package/message/index.umd.js +1 -0
- package/{comment → message}/package.json +1 -1
- package/message/style.css +1 -0
- package/modal/index.es.js +598 -1025
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/{cascader → notification}/index.d.ts +0 -0
- package/notification/index.es.js +545 -0
- package/notification/index.umd.js +1 -0
- package/{accordion → notification}/package.json +1 -1
- package/notification/style.css +1 -0
- 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/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/DropdownMenu.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/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.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/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.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/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.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/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.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/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.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/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.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/roundInjectionKey.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/skeletonItemProps.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/stepProps.js +3 -0
- package/nuxt/components/stepsProps.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/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/overlay/index.es.js +239 -314
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +44 -87
- package/pagination/index.es.js +331 -153
- 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 +6034 -215
- package/popover/index.umd.js +27 -1
- 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 +7974 -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 +186 -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 +3868 -1149
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9191 -493
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +113 -265
- 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 +6220 -226
- package/splitter/index.umd.js +27 -1
- 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/{color-picker → steps}/index.d.ts +0 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7804 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +11010 -1367
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +356 -144
- 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 +7924 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8914 -602
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{comment → time-select}/index.d.ts +0 -0
- package/{transfer → time-select}/index.es.js +4912 -2667
- package/time-select/index.umd.js +27 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{date-picker → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/{carousel → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5871 -96
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +7556 -2491
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +865 -6117
- package/upload/index.umd.js +1 -27
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20283 -18856
- package/vue-devui.umd.js +30 -19
- package/accordion/index.es.js +0 -508
- package/accordion/index.umd.js +0 -1
- 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.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- 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.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/style.css +0 -1
- package/date-picker/index.es.js +0 -1171
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/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/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/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/DatePicker.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/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/StickSlider.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/Toast.js +0 -3
- package/nuxt/components/ToastService.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.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/toast/index.d.ts +0 -7
- package/toast/index.es.js +0 -5918
- package/toast/index.umd.js +0 -27
- package/toast/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- 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/anchor/index.es.js
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createVNode, createTextVNode } from "vue";
|
|
2
|
-
var Anchor = defineComponent({
|
|
3
|
-
name: "DAnchor",
|
|
4
|
-
props: {},
|
|
5
|
-
setup() {
|
|
6
|
-
return () => {
|
|
7
|
-
return createVNode("div", null, [createTextVNode(" ")]);
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
let repeatCount = 0;
|
|
12
|
-
let cTimeout;
|
|
13
|
-
const timeoutIntervalSpeed = 10;
|
|
14
|
-
let hashName;
|
|
15
|
-
let scollFlag = false;
|
|
16
|
-
function elementPosition(obj) {
|
|
17
|
-
let curleft = 0, curtop = 0;
|
|
18
|
-
curleft = obj.offsetLeft;
|
|
19
|
-
curtop = obj.offsetTop;
|
|
20
|
-
return { x: curleft, y: curtop };
|
|
21
|
-
}
|
|
22
|
-
function scrollToControl(elem, container) {
|
|
23
|
-
hashName = elem.getAttribute("name");
|
|
24
|
-
scollFlag = true;
|
|
25
|
-
const tops = container.scrollTop >= 0 ? container.scrollTop : -document.getElementsByClassName("mycontainer")[0].offsetTop;
|
|
26
|
-
let scrollPos = elementPosition(elem).y - tops;
|
|
27
|
-
scrollPos = scrollPos - document.documentElement.scrollTop;
|
|
28
|
-
const remainder = scrollPos % timeoutIntervalSpeed;
|
|
29
|
-
const repeatTimes = Math.abs((scrollPos - remainder) / timeoutIntervalSpeed);
|
|
30
|
-
if (scrollPos < 0 && container || elem.getBoundingClientRect().top < container.offsetTop) {
|
|
31
|
-
window.scrollBy(0, elem.getBoundingClientRect().top - container.offsetTop - 16);
|
|
32
|
-
}
|
|
33
|
-
scrollSmoothly(scrollPos, repeatTimes, container);
|
|
34
|
-
}
|
|
35
|
-
function scrollSmoothly(scrollPos, repeatTimes, container) {
|
|
36
|
-
if (repeatCount <= repeatTimes) {
|
|
37
|
-
scrollPos > 0 ? container.scrollBy(0, timeoutIntervalSpeed) : container.scrollBy(0, -timeoutIntervalSpeed);
|
|
38
|
-
} else {
|
|
39
|
-
repeatCount = 0;
|
|
40
|
-
clearTimeout(cTimeout);
|
|
41
|
-
history.replaceState(null, null, document.location.pathname + "#" + hashName);
|
|
42
|
-
hightLightFn(hashName);
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
scollFlag = false;
|
|
45
|
-
}, 310);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
repeatCount++;
|
|
49
|
-
cTimeout = setTimeout(() => {
|
|
50
|
-
scrollSmoothly(scrollPos, repeatTimes, container);
|
|
51
|
-
}, 10);
|
|
52
|
-
}
|
|
53
|
-
function hightLightFn(hashName2) {
|
|
54
|
-
const childLength = document.getElementsByClassName("mysidebar")[0].children.length;
|
|
55
|
-
for (let i = 0; i < childLength; i++) {
|
|
56
|
-
if (document.getElementsByClassName("mysidebar")[0].children[i].classList.value.indexOf("active") > -1) {
|
|
57
|
-
document.getElementsByClassName("mysidebar")[0].children[i].classList.remove("active");
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
document.getElementById(hashName2).classList.add("active");
|
|
61
|
-
}
|
|
62
|
-
let activeLink = null;
|
|
63
|
-
let rootActiveLink = null;
|
|
64
|
-
let rootClassName = "";
|
|
65
|
-
const setActiveLink = (timeId) => {
|
|
66
|
-
if (scollFlag) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
timeId ? rootClassName = timeId : rootClassName = document.getElementsByClassName("mymain")[0].id;
|
|
70
|
-
const sidebarLinks = getSidebarLinks(rootClassName);
|
|
71
|
-
const anchors = getAnchors(sidebarLinks);
|
|
72
|
-
try {
|
|
73
|
-
anchors.forEach((index2, i) => {
|
|
74
|
-
const anchor2 = anchors[i];
|
|
75
|
-
const nextAnchor = anchors[i + 1];
|
|
76
|
-
const [isActive, hash] = isAnchorActive(i, anchor2, nextAnchor);
|
|
77
|
-
if (isActive) {
|
|
78
|
-
history.replaceState(null, document.title, hash ? hash : " ");
|
|
79
|
-
activateLink(hash);
|
|
80
|
-
throw Error(hash + "");
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
} catch (e) {
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
function throttleAndDebounce(fn, delay) {
|
|
87
|
-
let timeout;
|
|
88
|
-
let called = false;
|
|
89
|
-
return () => {
|
|
90
|
-
if (timeout) {
|
|
91
|
-
clearTimeout(timeout);
|
|
92
|
-
}
|
|
93
|
-
if (!called) {
|
|
94
|
-
fn();
|
|
95
|
-
called = true;
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
called = false;
|
|
98
|
-
}, delay);
|
|
99
|
-
} else {
|
|
100
|
-
timeout = setTimeout(fn, delay);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
const onScroll = throttleAndDebounce(setActiveLink, 300);
|
|
105
|
-
function activateLink(hash) {
|
|
106
|
-
deactiveLink(activeLink);
|
|
107
|
-
deactiveLink(rootActiveLink);
|
|
108
|
-
hash ? activeLink = document.querySelector(`${hash}`) : activeLink = document.querySelector(`.${rootClassName} ul li`);
|
|
109
|
-
if (!activeLink) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (!scollFlag) {
|
|
113
|
-
hash && hightLightFn(hash.split("#")[1]);
|
|
114
|
-
} else {
|
|
115
|
-
hightLightFn(hashName);
|
|
116
|
-
}
|
|
117
|
-
const rootLi = activeLink.closest(".mycontainer > ul > li");
|
|
118
|
-
if (rootLi && rootLi !== activeLink.parentElement) {
|
|
119
|
-
rootActiveLink = rootLi;
|
|
120
|
-
rootActiveLink && rootActiveLink.classList.add("active");
|
|
121
|
-
} else {
|
|
122
|
-
rootActiveLink = null;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function deactiveLink(link) {
|
|
126
|
-
link && link.classList.remove("active");
|
|
127
|
-
}
|
|
128
|
-
function getPageOffset() {
|
|
129
|
-
return document.querySelector(".mysidebar ").getBoundingClientRect().y;
|
|
130
|
-
}
|
|
131
|
-
function getAnchorTop(anchor2) {
|
|
132
|
-
const pageOffset = getPageOffset();
|
|
133
|
-
return anchor2.parentElement.offsetTop - pageOffset - 5;
|
|
134
|
-
}
|
|
135
|
-
function isAnchorActive(index2, anchor2, nextAnchor) {
|
|
136
|
-
let scrollTop;
|
|
137
|
-
document.getElementsByClassName("scrollTarget").length ? scrollTop = document.getElementsByClassName("scrollTarget")[0].scrollTop : scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
138
|
-
if (index2 === 0 && scrollTop === 0) {
|
|
139
|
-
return [true, null];
|
|
140
|
-
}
|
|
141
|
-
if (scrollTop < getAnchorTop(anchor2)) {
|
|
142
|
-
return [false, null];
|
|
143
|
-
}
|
|
144
|
-
if (!nextAnchor || scrollTop < getAnchorTop(nextAnchor)) {
|
|
145
|
-
return [true, decodeURIComponent(anchor2.hash)];
|
|
146
|
-
}
|
|
147
|
-
return [false, null];
|
|
148
|
-
}
|
|
149
|
-
function getSidebarLinks(rootClassName2) {
|
|
150
|
-
return [].slice.call(document.querySelectorAll(`.${rootClassName2} > .step-nav > li.bar-link-item > a`));
|
|
151
|
-
}
|
|
152
|
-
function getAnchors(sidebarLinks) {
|
|
153
|
-
return [].slice.call(document.querySelectorAll(".box-anchor")).filter((anchor2) => sidebarLinks.some((sidebarLink) => sidebarLink.hash === anchor2.hash));
|
|
154
|
-
}
|
|
155
|
-
const randomId = function(n = 8) {
|
|
156
|
-
const str = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
157
|
-
let result = "";
|
|
158
|
-
for (let i = 0; i < n; i++) {
|
|
159
|
-
result += str[parseInt((Math.random() * str.length).toString())];
|
|
160
|
-
}
|
|
161
|
-
return result;
|
|
162
|
-
};
|
|
163
|
-
const inBrowser = typeof window !== "undefined";
|
|
164
|
-
var dAnchorBox = {
|
|
165
|
-
name: "d-anchor-box",
|
|
166
|
-
mounted(el) {
|
|
167
|
-
const timeId = "m" + randomId(8);
|
|
168
|
-
el.id = timeId;
|
|
169
|
-
const classList = el.classList;
|
|
170
|
-
classList.add("mycontainer", "mymain", timeId);
|
|
171
|
-
let windoScrollTop;
|
|
172
|
-
const div = document.querySelector(`#${timeId}`);
|
|
173
|
-
const mysidebar = document.querySelector(`#${timeId} .mysidebar`);
|
|
174
|
-
const mysidebarHeight = mysidebar.clientHeight;
|
|
175
|
-
window.addEventListener("resize", () => {
|
|
176
|
-
cssChange(mysidebar, "absolute", 0, 0);
|
|
177
|
-
});
|
|
178
|
-
window.onscroll = function() {
|
|
179
|
-
windoScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
180
|
-
if (!document.getElementsByClassName("scrollTarget").length) {
|
|
181
|
-
if (windoScrollTop + mysidebarHeight - 16 >= div.offsetTop + div.clientHeight) {
|
|
182
|
-
cssChange(mysidebar, "absolute", div.clientHeight - mysidebarHeight - 8, 0);
|
|
183
|
-
} else if (windoScrollTop > div.offsetTop) {
|
|
184
|
-
cssChange(mysidebar, "fixed", div.offsetTop, div.getBoundingClientRect().left);
|
|
185
|
-
} else if (div.offsetTop >= windoScrollTop && windoScrollTop >= 0) {
|
|
186
|
-
cssChange(mysidebar, "absolute", 0, 0);
|
|
187
|
-
} else {
|
|
188
|
-
cssChange(mysidebar, "absolute", div.clientHeight - mysidebarHeight - 8, 0);
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
cssChange(mysidebar, "absolute", div.scrollTop, 0);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
addEvent(div, "scroll", function() {
|
|
195
|
-
if (document.getElementsByClassName("scrollTarget").length) {
|
|
196
|
-
cssChange(mysidebar, "fixed", div.getBoundingClientRect().top, div.getBoundingClientRect().left);
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
setActiveLink(timeId);
|
|
200
|
-
document.getElementsByClassName("scrollTarget").length ? addEvent(div, "scroll", onScroll) : window.addEventListener("scroll", onScroll);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
const cssChange = (mysidebar, postion, top, left) => {
|
|
204
|
-
mysidebar.style.position = postion;
|
|
205
|
-
mysidebar.style.top = top + "px";
|
|
206
|
-
mysidebar.style.left = left + "px";
|
|
207
|
-
};
|
|
208
|
-
const addEvent = function() {
|
|
209
|
-
if (inBrowser && window.addEventListener) {
|
|
210
|
-
return function(elm, type, handle) {
|
|
211
|
-
elm.addEventListener(type, handle, false);
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
}();
|
|
215
|
-
var dAnchorLink = {
|
|
216
|
-
name: "d-anchor-link",
|
|
217
|
-
mounted(el, binding) {
|
|
218
|
-
const parent = el.parentNode;
|
|
219
|
-
if (!parent.className) {
|
|
220
|
-
parent.className = "mysidebar step-nav";
|
|
221
|
-
}
|
|
222
|
-
el.className = "bar-link-item";
|
|
223
|
-
el.innerHTML += '<a class="d-d-anchor" style="display:none" href="#' + binding.value + '">?</a>';
|
|
224
|
-
el.setAttribute("id", binding.value);
|
|
225
|
-
el.onclick = () => {
|
|
226
|
-
let scrollContainer;
|
|
227
|
-
const scollToDomY = document.getElementsByName(binding.value)[0];
|
|
228
|
-
document.getElementsByClassName("scrollTarget").length ? scrollContainer = document.getElementsByClassName("scrollTarget")[0] : scrollContainer = window;
|
|
229
|
-
scrollToControl(scollToDomY, scrollContainer);
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
var dAnchor = {
|
|
234
|
-
name: "d-anchor",
|
|
235
|
-
mounted(el, binding) {
|
|
236
|
-
const parent = el.parentNode;
|
|
237
|
-
if (!parent.className) {
|
|
238
|
-
parent.className = "mycontent";
|
|
239
|
-
}
|
|
240
|
-
el.innerHTML = '<a class="box-anchor" style="display:none" href="#' + binding.value + '">?</a>' + el.innerHTML;
|
|
241
|
-
el.className = "section-block";
|
|
242
|
-
el.setAttribute("name", binding.value);
|
|
243
|
-
el.onclick = (e) => {
|
|
244
|
-
hightLightFn(binding.value);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var anchor = "";
|
|
249
|
-
Anchor.install = function(Vue) {
|
|
250
|
-
Vue.directive(dAnchor.name, dAnchor);
|
|
251
|
-
Vue.directive(dAnchorLink.name, dAnchorLink);
|
|
252
|
-
Vue.directive(dAnchorBox.name, dAnchorBox);
|
|
253
|
-
Vue.component(Anchor.name, Anchor);
|
|
254
|
-
};
|
|
255
|
-
var index = {
|
|
256
|
-
title: "Anchor \u951A\u70B9",
|
|
257
|
-
category: "\u5BFC\u822A",
|
|
258
|
-
status: "50%",
|
|
259
|
-
install(app) {
|
|
260
|
-
app.use(Anchor);
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
export { Anchor, index as default };
|
package/anchor/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(c,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(c=typeof globalThis!="undefined"?globalThis:c||self,r(c.index={},c.Vue))})(this,function(c,r){"use strict";var u=r.defineComponent({name:"DAnchor",props:{},setup(){return()=>r.createVNode("div",null,[r.createTextVNode(" ")])}});let v=0,B;const f=10;let p,h=!1;function k(e){let t=0,n=0;return t=e.offsetLeft,n=e.offsetTop,{x:t,y:n}}function q(e,t){p=e.getAttribute("name"),h=!0;const n=t.scrollTop>=0?t.scrollTop:-document.getElementsByClassName("mycontainer")[0].offsetTop;let o=k(e).y-n;o=o-document.documentElement.scrollTop;const l=o%f,s=Math.abs((o-l)/f);(o<0&&t||e.getBoundingClientRect().top<t.offsetTop)&&window.scrollBy(0,e.getBoundingClientRect().top-t.offsetTop-16),L(o,s,t)}function L(e,t,n){if(v<=t)e>0?n.scrollBy(0,f):n.scrollBy(0,-f);else{v=0,clearTimeout(B),history.replaceState(null,null,document.location.pathname+"#"+p),y(p),setTimeout(()=>{h=!1},310);return}v++,B=setTimeout(()=>{L(e,t,n)},10)}function y(e){const t=document.getElementsByClassName("mysidebar")[0].children.length;for(let n=0;n<t;n++)document.getElementsByClassName("mysidebar")[0].children[n].classList.value.indexOf("active")>-1&&document.getElementsByClassName("mysidebar")[0].children[n].classList.remove("active");document.getElementById(e).classList.add("active")}let a=null,d=null,g="";const C=e=>{if(h)return;e?g=e:g=document.getElementsByClassName("mymain")[0].id;const t=$(g),n=O(t);try{n.forEach((o,l)=>{const s=n[l],m=n[l+1],[j,T]=I(l,s,m);if(j)throw history.replaceState(null,document.title,T||" "),M(T),Error(T+"")})}catch{}};function H(e,t){let n,o=!1;return()=>{n&&clearTimeout(n),o?n=setTimeout(e,t):(e(),o=!0,setTimeout(()=>{o=!1},t))}}const E=H(C,300);function M(e){if(N(a),N(d),e?a=document.querySelector(`${e}`):a=document.querySelector(`.${g} ul li`),!a)return;h?y(p):e&&y(e.split("#")[1]);const t=a.closest(".mycontainer > ul > li");t&&t!==a.parentElement?(d=t,d&&d.classList.add("active")):d=null}function N(e){e&&e.classList.remove("active")}function R(){return document.querySelector(".mysidebar ").getBoundingClientRect().y}function b(e){const t=R();return e.parentElement.offsetTop-t-5}function I(e,t,n){let o;return document.getElementsByClassName("scrollTarget").length?o=document.getElementsByClassName("scrollTarget")[0].scrollTop:o=document.documentElement.scrollTop||document.body.scrollTop,e===0&&o===0?[!0,null]:o<b(t)?[!1,null]:!n||o<b(n)?[!0,decodeURIComponent(t.hash)]:[!1,null]}function $(e){return[].slice.call(document.querySelectorAll(`.${e} > .step-nav > li.bar-link-item > a`))}function O(e){return[].slice.call(document.querySelectorAll(".box-anchor")).filter(t=>e.some(n=>n.hash===t.hash))}const D=function(e=8){const t="abcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let o=0;o<e;o++)n+=t[parseInt((Math.random()*t.length).toString())];return n},F=typeof window!="undefined";var A={name:"d-anchor-box",mounted(e){const t="m"+D(8);e.id=t,e.classList.add("mycontainer","mymain",t);let o;const l=document.querySelector(`#${t}`),s=document.querySelector(`#${t} .mysidebar`),m=s.clientHeight;window.addEventListener("resize",()=>{i(s,"absolute",0,0)}),window.onscroll=function(){o=document.documentElement.scrollTop||document.body.scrollTop,document.getElementsByClassName("scrollTarget").length?i(s,"absolute",l.scrollTop,0):o+m-16>=l.offsetTop+l.clientHeight?i(s,"absolute",l.clientHeight-m-8,0):o>l.offsetTop?i(s,"fixed",l.offsetTop,l.getBoundingClientRect().left):l.offsetTop>=o&&o>=0?i(s,"absolute",0,0):i(s,"absolute",l.clientHeight-m-8,0)},w(l,"scroll",function(){document.getElementsByClassName("scrollTarget").length&&i(s,"fixed",l.getBoundingClientRect().top,l.getBoundingClientRect().left)}),C(t),document.getElementsByClassName("scrollTarget").length?w(l,"scroll",E):window.addEventListener("scroll",E)}};const i=(e,t,n,o)=>{e.style.position=t,e.style.top=n+"px",e.style.left=o+"px"},w=function(){if(F&&window.addEventListener)return function(e,t,n){e.addEventListener(t,n,!1)}}();var S={name:"d-anchor-link",mounted(e,t){const n=e.parentNode;n.className||(n.className="mysidebar step-nav"),e.className="bar-link-item",e.innerHTML+='<a class="d-d-anchor" style="display:none" href="#'+t.value+'">?</a>',e.setAttribute("id",t.value),e.onclick=()=>{let o;const l=document.getElementsByName(t.value)[0];document.getElementsByClassName("scrollTarget").length?o=document.getElementsByClassName("scrollTarget")[0]:o=window,q(l,o)}}},x={name:"d-anchor",mounted(e,t){const n=e.parentNode;n.className||(n.className="mycontent"),e.innerHTML='<a class="box-anchor" style="display:none" href="#'+t.value+'">?</a>'+e.innerHTML,e.className="section-block",e.setAttribute("name",t.value),e.onclick=o=>{y(t.value)}}},z="";u.install=function(e){e.directive(x.name,x),e.directive(S.name,S),e.directive(A.name,A),e.component(u.name,u)};var P={title:"Anchor \u951A\u70B9",category:"\u5BFC\u822A",status:"50%",install(e){e.use(u)}};c.Anchor=u,c.default=P,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
package/anchor/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.mysidebar{width:240px;position:absolute;top:0;left:0;height:auto}.scrollTarget{height:450px!important;overflow-y:auto}.mycontainer{height:auto}.devui-scrollbar::-webkit-scrollbar{width:8px;height:8px}.devui-scrollbar::-webkit-scrollbar-track{background-color:transparent}.devui-scrollbar::-webkit-scrollbar-thumb{border-radius:8px;background-color:#adb0b8;background-color:var(--devui-line, #adb0b8)}.devui-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#8a8e99;background-color:var(--devui-placeholder, #8a8e99)}body>* ::-webkit-scrollbar{width:8px;height:8px}body>* ::-webkit-scrollbar-track{background-color:transparent}body>* ::-webkit-scrollbar-thumb{border-radius:8px;background-color:#adb0b8;background-color:var(--devui-line, #adb0b8)}body>* ::-webkit-scrollbar-thumb:hover{background-color:#8a8e99;background-color:var(--devui-placeholder, #8a8e99)}body>* ::-webkit-scrollbar-corner{background-color:transparent}.step-nav{padding-top:8px;width:240px}.step-nav>li{list-style:none;counter-increment:stepli;padding:0;cursor:pointer;height:30px;line-height:1.5;font-size:12px;font-size:var(--devui-font-size, 12px);color:#575d6c;color:var(--devui-text-weak, #575d6c);position:relative;display:flex;align-items:center}.step-nav>li.active,.step-nav>li:hover{color:#526ecc;color:var(--devui-brand-active, #526ecc)}.step-nav>li.active:before{border-color:#526ecc;border-color:var(--devui-brand-active, #526ecc)}.step-nav>li:before{content:"";display:inline-block;width:12px;height:12px;text-align:center;line-height:26px;border-radius:50%;background-color:#fff;background-color:var(--devui-base-bg, #ffffff);margin-right:20px;border:2px solid #dfe1e6;border:2px solid var(--devui-dividing-line, #dfe1e6)}.step-nav>li:not(:first-of-type){margin-top:32px}.step-nav>li:not(:first-of-type):after{content:"";display:block;position:absolute;top:-32px;left:5px;width:1px;height:32px;border-left:2px solid #dfe1e6;border-left:2px solid var(--devui-dividing-line, #dfe1e6)}.mymain{position:relative}.mycontent{padding:8px;margin-left:240px;border-left:1px solid #adb0b8;border-left:1px solid var(--devui-line, #adb0b8)}.section-block{min-height:200px;border-bottom:1px dashed #adb0b8;border-bottom:1px dashed var(--devui-line, #adb0b8)}.section-block.active.anchor-active-by-anchor-link{-webkit-animation:hightlight-and-disapear 3s linear 1;animation:hightlight-and-disapear 3s linear 1}@-webkit-keyframes hightlight-and-disapear{0%{outline:medium none invert}2%{outline:0 none rgba(255,255,255,0)}10%{outline:1px solid #5e7ce0;outline:1px solid var(--devui-brand, #5e7ce0)}50%{outline:1px solid #5e7ce0;outline:1px solid var(--devui-brand, #5e7ce0)}90%{outline:1px solid rgba(255,255,255,0)}99%{outline:0 none rgba(255,255,255,0)}to{outline:medium none invert}}@keyframes hightlight-and-disapear{0%{outline:medium none invert}2%{outline:0 none rgba(255,255,255,0)}10%{outline:1px solid #5e7ce0;outline:1px solid var(--devui-brand, #5e7ce0)}50%{outline:1px solid #5e7ce0;outline:1px solid var(--devui-brand, #5e7ce0)}90%{outline:1px solid rgba(255,255,255,0)}99%{outline:0 none rgba(255,255,255,0)}to{outline:medium none invert}}
|
package/back-top/index.es.js
DELETED
|
@@ -1,128 +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 { ref, onMounted, computed, defineComponent, createVNode } from "vue";
|
|
21
|
-
const backTopProps = {
|
|
22
|
-
bottom: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "50px"
|
|
25
|
-
},
|
|
26
|
-
right: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "30px"
|
|
29
|
-
},
|
|
30
|
-
target: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: "window"
|
|
33
|
-
},
|
|
34
|
-
visibleHeight: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 300
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
function usePosition(props) {
|
|
40
|
-
const { bottom, right } = props;
|
|
41
|
-
return {
|
|
42
|
-
bottom,
|
|
43
|
-
right
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function useTarget(props, backTopRef) {
|
|
47
|
-
const target = props.target;
|
|
48
|
-
const getTargetEl = () => {
|
|
49
|
-
const targetEl = document.querySelector(target);
|
|
50
|
-
if (!targetEl)
|
|
51
|
-
throw new Error(`props ${target} is not existed`);
|
|
52
|
-
targetEl.parentElement.style.position = "relative";
|
|
53
|
-
backTopRef.value.style.position = "absolute";
|
|
54
|
-
return targetEl;
|
|
55
|
-
};
|
|
56
|
-
const currTarget = target === "window" ? window || document.documentElement || document.body : getTargetEl();
|
|
57
|
-
return currTarget;
|
|
58
|
-
}
|
|
59
|
-
function useVisibility(props, backTopRef) {
|
|
60
|
-
const visibleHeight = props.visibleHeight;
|
|
61
|
-
const currScrollTop = ref(0);
|
|
62
|
-
const ThrottleCBFn = function() {
|
|
63
|
-
currScrollTop.value = currTarget === window ? window.pageYOffset : currTarget.scrollTop;
|
|
64
|
-
};
|
|
65
|
-
let currTarget = null;
|
|
66
|
-
onMounted(() => {
|
|
67
|
-
currTarget = useTarget(props, backTopRef);
|
|
68
|
-
useEventListener(currTarget, "scroll", useThrottle(ThrottleCBFn, 150));
|
|
69
|
-
});
|
|
70
|
-
const isVisible = computed(() => currScrollTop.value >= visibleHeight);
|
|
71
|
-
return isVisible;
|
|
72
|
-
}
|
|
73
|
-
function useEventListener(target, event, cb) {
|
|
74
|
-
if (target)
|
|
75
|
-
target.addEventListener(event, cb);
|
|
76
|
-
}
|
|
77
|
-
function useThrottle(fn, delay) {
|
|
78
|
-
let last = null;
|
|
79
|
-
return (...args) => {
|
|
80
|
-
const now = +Date.now();
|
|
81
|
-
if (now - last > delay) {
|
|
82
|
-
last = now;
|
|
83
|
-
return fn.apply(this, args);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
var backTop = "";
|
|
88
|
-
var IconTop = "data:image/svg+xml;base64,PHN2ZyB0PSIxNjM2MjU2NTI0MjUxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NTciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTAgMGgxMDI0djEwMjRIMHoiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMCIgcC1pZD0iMzQ1OCI+PC9wYXRoPjxwYXRoIGQ9Ik04NzguOTMzMzMzIDY1OC40MTA2NjdhNDEuNjg1MzMzIDQxLjY4NTMzMyAwIDAgMS01OC45NDQgMC4zMmwtMzA3Ljk2OC0zMDQuNjRMMjA0LjAxMDY2NyA2NTguNzczMzMzYTQxLjY4NTMzMyA0MS42ODUzMzMgMCAwIDEtNTguNTYgMC4wNjQgNDAuNjE4NjY3IDQwLjYxODY2NyAwIDAgMS0wLjA2NC01Ny44MTMzMzNsMzM1LjQyNC0zMzEuNzMzMzMzYTQxLjU3ODY2NyA0MS41Nzg2NjcgMCAwIDEgMzEuMDQtMTIuMDEwNjY3IDQxLjQ5MzMzMyA0MS40OTMzMzMgMCAwIDEgMzEuMzYgMTEuOTg5MzMzbDMzNS40MDI2NjYgMzMxLjczMzMzNGMxNS45MzYgMTUuNzg2NjY3IDE2LjA4NTMzMyA0MS40OTMzMzMgMC4zMiA1Ny40MjkzMzN6IiBmaWxsPSIjZmZmZmZmIiBwLWlkPSIzNDU5Ij48L3BhdGg+PHBhdGggZD0iTTU1NC42NjY2NjcgMzYyLjY2NjY2N3Y1MzMuMzMzMzMzYTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAxIDEtODUuMzMzMzM0IDBWMzYyLjY2NjY2N2E0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDg1LjMzMzMzNCAwek0xMjggODUuMzMzMzMzaDc2OGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAgODUuMzMzMzM0SDEyOGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAtODUuMzMzMzM0eiIgZmlsbD0iI2ZmZmZmZiIgcC1pZD0iMzQ2MCI+PC9wYXRoPjwvc3ZnPg==";
|
|
89
|
-
var BackTop = defineComponent({
|
|
90
|
-
name: "DBackTop",
|
|
91
|
-
props: backTopProps,
|
|
92
|
-
emits: [],
|
|
93
|
-
setup(props, ctx) {
|
|
94
|
-
const slots = ctx.slots;
|
|
95
|
-
const backTopRef = ref(null);
|
|
96
|
-
const position = usePosition(props);
|
|
97
|
-
const isVisible = useVisibility(props, backTopRef);
|
|
98
|
-
const scrollToTop = () => {
|
|
99
|
-
window && window.scrollTo({
|
|
100
|
-
top: 0,
|
|
101
|
-
left: 0,
|
|
102
|
-
behavior: "smooth"
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
return () => createVNode("div", {
|
|
106
|
-
"class": "devui-back-top",
|
|
107
|
-
"ref": backTopRef,
|
|
108
|
-
"style": __spreadProps(__spreadValues({}, position), {
|
|
109
|
-
display: isVisible.value ? "block" : "none"
|
|
110
|
-
}),
|
|
111
|
-
"onClick": scrollToTop
|
|
112
|
-
}, [createVNode("div", {
|
|
113
|
-
"class": ["devui-back-top-base", slots.default ? "devui-backtop-custom" : "devui-back-top-content"]
|
|
114
|
-
}, [slots.default ? slots.default() : createVNode(IconTop, null, null)])]);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
BackTop.install = function(app) {
|
|
118
|
-
app.component(BackTop.name, BackTop);
|
|
119
|
-
};
|
|
120
|
-
var index = {
|
|
121
|
-
title: "BackTop \u56DE\u5230\u9876\u90E8",
|
|
122
|
-
category: "\u5BFC\u822A",
|
|
123
|
-
status: "60%",
|
|
124
|
-
install(app) {
|
|
125
|
-
app.use(BackTop);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
export { BackTop, index as default };
|
package/back-top/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=Object.defineProperty,w=Object.defineProperties;var f=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var g=(e,t,o)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,r=(e,t)=>{for(var o in t||(t={}))y.call(t,o)&&g(e,o,t[o]);if(N)for(var o of N(t))A.call(t,o)&&g(e,o,t[o]);return e},a=(e,t)=>w(e,f(t));(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";const o={bottom:{type:String,default:"50px"},right:{type:String,default:"30px"},target:{type:String,default:"window"},visibleHeight:{type:Number,default:300}};function d(M){const{bottom:n,right:i}=M;return{bottom:n,right:i}}function j(M,n){const i=M.target;return i==="window"?window||document.documentElement||document.body:(()=>{const u=document.querySelector(i);if(!u)throw new Error(`props ${i} is not existed`);return u.parentElement.style.position="relative",n.value.style.position="absolute",u})()}function I(M,n){const i=M.visibleHeight,c=t.ref(0),s=function(){c.value=u===window?window.pageYOffset:u.scrollTop};let u=null;return t.onMounted(()=>{u=j(M,n),D(u,"scroll",T(s,150))}),t.computed(()=>c.value>=i)}function D(M,n,i){M&&M.addEventListener(n,i)}function T(M,n){let i=null;return(...c)=>{const s=+Date.now();if(s-i>n)return i=s,M.apply(this,c)}}var b="",p="data:image/svg+xml;base64,PHN2ZyB0PSIxNjM2MjU2NTI0MjUxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NTciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTAgMGgxMDI0djEwMjRIMHoiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMCIgcC1pZD0iMzQ1OCI+PC9wYXRoPjxwYXRoIGQ9Ik04NzguOTMzMzMzIDY1OC40MTA2NjdhNDEuNjg1MzMzIDQxLjY4NTMzMyAwIDAgMS01OC45NDQgMC4zMmwtMzA3Ljk2OC0zMDQuNjRMMjA0LjAxMDY2NyA2NTguNzczMzMzYTQxLjY4NTMzMyA0MS42ODUzMzMgMCAwIDEtNTguNTYgMC4wNjQgNDAuNjE4NjY3IDQwLjYxODY2NyAwIDAgMS0wLjA2NC01Ny44MTMzMzNsMzM1LjQyNC0zMzEuNzMzMzMzYTQxLjU3ODY2NyA0MS41Nzg2NjcgMCAwIDEgMzEuMDQtMTIuMDEwNjY3IDQxLjQ5MzMzMyA0MS40OTMzMzMgMCAwIDEgMzEuMzYgMTEuOTg5MzMzbDMzNS40MDI2NjYgMzMxLjczMzMzNGMxNS45MzYgMTUuNzg2NjY3IDE2LjA4NTMzMyA0MS40OTMzMzMgMC4zMiA1Ny40MjkzMzN6IiBmaWxsPSIjZmZmZmZmIiBwLWlkPSIzNDU5Ij48L3BhdGg+PHBhdGggZD0iTTU1NC42NjY2NjcgMzYyLjY2NjY2N3Y1MzMuMzMzMzMzYTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAxIDEtODUuMzMzMzM0IDBWMzYyLjY2NjY2N2E0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDg1LjMzMzMzNCAwek0xMjggODUuMzMzMzMzaDc2OGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAgODUuMzMzMzM0SDEyOGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAtODUuMzMzMzM0eiIgZmlsbD0iI2ZmZmZmZiIgcC1pZD0iMzQ2MCI+PC9wYXRoPjwvc3ZnPg==",l=t.defineComponent({name:"DBackTop",props:o,emits:[],setup(M,n){const i=n.slots,c=t.ref(null),s=d(M),u=I(M,c),z=()=>{window&&window.scrollTo({top:0,left:0,behavior:"smooth"})};return()=>t.createVNode("div",{class:"devui-back-top",ref:c,style:a(r({},s),{display:u.value?"block":"none"}),onClick:z},[t.createVNode("div",{class:["devui-back-top-base",i.default?"devui-backtop-custom":"devui-back-top-content"]},[i.default?i.default():t.createVNode(p,null,null)])])}});l.install=function(M){M.component(l.name,l)};var Y={title:"BackTop \u56DE\u5230\u9876\u90E8",category:"\u5BFC\u822A",status:"60%",install(M){M.use(l)}};e.BackTop=l,e.default=Y,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
|
package/back-top/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.devui-back-top{position:fixed;width:40px;height:40px;cursor:pointer;z-index:9}.devui-back-top .devui-back-top-base{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center}.devui-back-top .devui-back-top-base:hover{opacity:1}.devui-back-top .devui-back-top-content{opacity:.4;background-color:var(--devui-text-weak, #575d6c);box-shadow:0 0 8px #0003}.devui-back-top .devui-backtop-custom{background-color:#fff}
|
package/breadcrumb/index.es.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, provide, resolveComponent } from "vue";
|
|
2
|
-
const breadcrumbProps = {
|
|
3
|
-
source: {
|
|
4
|
-
type: Array,
|
|
5
|
-
default: []
|
|
6
|
-
},
|
|
7
|
-
separatorIcon: {
|
|
8
|
-
type: String
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const breadcrumbItemProps = {
|
|
12
|
-
showMenu: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: false
|
|
15
|
-
},
|
|
16
|
-
menuList: {
|
|
17
|
-
type: Array
|
|
18
|
-
},
|
|
19
|
-
isSearch: {
|
|
20
|
-
type: Boolean,
|
|
21
|
-
dafault: false
|
|
22
|
-
},
|
|
23
|
-
to: {
|
|
24
|
-
type: [String, Object],
|
|
25
|
-
default: ""
|
|
26
|
-
},
|
|
27
|
-
replace: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var breadcrumbItem = "";
|
|
33
|
-
var BreadcrumbItem = defineComponent({
|
|
34
|
-
name: "DBreadcrumbItem",
|
|
35
|
-
props: breadcrumbItemProps,
|
|
36
|
-
setup(props, {
|
|
37
|
-
slots
|
|
38
|
-
}) {
|
|
39
|
-
const separatorIcon = inject("separatorIcon");
|
|
40
|
-
const linkClass = props.to ? "is-link" : "";
|
|
41
|
-
const link = ref(null);
|
|
42
|
-
const instance = getCurrentInstance();
|
|
43
|
-
const router = instance.appContext.config.globalProperties.$router;
|
|
44
|
-
const handleClickLink = () => {
|
|
45
|
-
if (!props.to || !router)
|
|
46
|
-
return;
|
|
47
|
-
props.replace ? router.replace(props.to) : router.push(props.to);
|
|
48
|
-
};
|
|
49
|
-
onMounted(() => {
|
|
50
|
-
link.value.addEventListener("click", handleClickLink);
|
|
51
|
-
});
|
|
52
|
-
onBeforeUnmount(() => {
|
|
53
|
-
link.value.removeEventListener("click", handleClickLink);
|
|
54
|
-
});
|
|
55
|
-
return () => {
|
|
56
|
-
const renderBreadcrumbSperator = () => {
|
|
57
|
-
return createVNode("span", {
|
|
58
|
-
"class": "devui-breadcrumb-separator"
|
|
59
|
-
}, [separatorIcon]);
|
|
60
|
-
};
|
|
61
|
-
return createVNode("div", {
|
|
62
|
-
"class": "devui-breadcrumb-item"
|
|
63
|
-
}, [createVNode("span", {
|
|
64
|
-
"ref": link,
|
|
65
|
-
"class": linkClass
|
|
66
|
-
}, [slots == null ? void 0 : slots.default()]), renderBreadcrumbSperator()]);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
function getPropsSlot(slots, props, prop = "default") {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
return (_b = props[prop]) != null ? _b : (_a = slots[prop]) == null ? void 0 : _a.call(slots);
|
|
73
|
-
}
|
|
74
|
-
var breadcrumb = "";
|
|
75
|
-
var Breadcrumb = defineComponent({
|
|
76
|
-
name: "DBreadcrumb",
|
|
77
|
-
components: {
|
|
78
|
-
DBreadcrumbItem: BreadcrumbItem
|
|
79
|
-
},
|
|
80
|
-
props: breadcrumbProps,
|
|
81
|
-
setup(props, {
|
|
82
|
-
slots
|
|
83
|
-
}) {
|
|
84
|
-
var _a;
|
|
85
|
-
const separatorIcon = (_a = getPropsSlot(slots, props, "separatorIcon")) != null ? _a : "/";
|
|
86
|
-
provide("separatorIcon", separatorIcon);
|
|
87
|
-
const renderBreadcrumbItemRouted = (item) => {
|
|
88
|
-
return createVNode(resolveComponent("d-breadcrumb-item"), {
|
|
89
|
-
"to": `path: ${item.link}`,
|
|
90
|
-
"replace": item.replace
|
|
91
|
-
}, {
|
|
92
|
-
default: () => [item.title]
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
const renderBreadItemList = (source) => {
|
|
96
|
-
return source.map((item) => {
|
|
97
|
-
if (!item.noNavigation && item.linkType === "routerLink") {
|
|
98
|
-
return renderBreadcrumbItemRouted(item);
|
|
99
|
-
}
|
|
100
|
-
return createVNode(resolveComponent("d-breadcrumb-item"), null, {
|
|
101
|
-
default: () => [!item.noNavigation && (!item.linkType || item.linkType === "hrefLink") ? createVNode("a", {
|
|
102
|
-
"href": item.link,
|
|
103
|
-
"target": item.target ? item.target : "_self"
|
|
104
|
-
}, [item.title]) : null, item.noNavigation ? createVNode("span", null, [item.title]) : null]
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
return () => {
|
|
109
|
-
return createVNode("div", {
|
|
110
|
-
"class": "devui-breadcrumb"
|
|
111
|
-
}, [props.source && props.source.length ? renderBreadItemList(props.source) : slots == null ? void 0 : slots.default()]);
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
Breadcrumb.install = function(app) {
|
|
116
|
-
app.component(Breadcrumb.name, Breadcrumb);
|
|
117
|
-
app.component(BreadcrumbItem.name, BreadcrumbItem);
|
|
118
|
-
};
|
|
119
|
-
var index = {
|
|
120
|
-
title: "Breadcrumb \u9762\u5305\u5C51",
|
|
121
|
-
category: "\u5BFC\u822A",
|
|
122
|
-
status: "50%",
|
|
123
|
-
install(app) {
|
|
124
|
-
app.use(Breadcrumb);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
export { Breadcrumb, index as default };
|
package/breadcrumb/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const f={source:{type:Array,default:[]},separatorIcon:{type:String}},p={showMenu:{type:Boolean,default:!1},menuList:{type:Array},isSearch:{type:Boolean,dafault:!1},to:{type:[String,Object],default:""},replace:{type:Boolean,default:!1}};var g="",l=e.defineComponent({name:"DBreadcrumbItem",props:p,setup(r,{slots:t}){const u=e.inject("separatorIcon"),d=r.to?"is-link":"",c=e.ref(null),o=e.getCurrentInstance().appContext.config.globalProperties.$router,n=()=>{!r.to||!o||(r.replace?o.replace(r.to):o.push(r.to))};return e.onMounted(()=>{c.value.addEventListener("click",n)}),e.onBeforeUnmount(()=>{c.value.removeEventListener("click",n)}),()=>{const y=()=>e.createVNode("span",{class:"devui-breadcrumb-separator"},[u]);return e.createVNode("div",{class:"devui-breadcrumb-item"},[e.createVNode("span",{ref:c,class:d},[t==null?void 0:t.default()]),y()])}}});function m(r,t,u="default"){var d,c;return(c=t[u])!=null?c:(d=r[u])==null?void 0:d.call(r)}var B="",i=e.defineComponent({name:"DBreadcrumb",components:{DBreadcrumbItem:l},props:f,setup(r,{slots:t}){var s;const u=(s=m(t,r,"separatorIcon"))!=null?s:"/";e.provide("separatorIcon",u);const d=o=>e.createVNode(e.resolveComponent("d-breadcrumb-item"),{to:`path: ${o.link}`,replace:o.replace},{default:()=>[o.title]}),c=o=>o.map(n=>!n.noNavigation&&n.linkType==="routerLink"?d(n):e.createVNode(e.resolveComponent("d-breadcrumb-item"),null,{default:()=>[!n.noNavigation&&(!n.linkType||n.linkType==="hrefLink")?e.createVNode("a",{href:n.link,target:n.target?n.target:"_self"},[n.title]):null,n.noNavigation?e.createVNode("span",null,[n.title]):null]}));return()=>e.createVNode("div",{class:"devui-breadcrumb"},[r.source&&r.source.length?c(r.source):t==null?void 0:t.default()])}});i.install=function(r){r.component(i.name,i),r.component(l.name,l)};var b={title:"Breadcrumb \u9762\u5305\u5C51",category:"\u5BFC\u822A",status:"50%",install(r){r.use(i)}};a.Breadcrumb=i,a.default=b,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/breadcrumb/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.devui-breadcrumb-font-style,.devui-breadcrumb-separator,.devui-breadcrumb-item a,.devui-breadcrumb-item{font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #8a8e99);line-height:18px}.devui-breadcrumb-item{cursor:auto}.devui-breadcrumb-item a{cursor:pointer}.devui-breadcrumb-item a:hover{color:var(--devui-text, #252b3a);text-decoration:none}.devui-breadcrumb-item a,.devui-breadcrumb-item span{transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-breadcrumb-item .is-link{cursor:pointer}.devui-breadcrumb-item .is-link:hover{color:var(--devui-text, #252b3a);text-decoration:none}.devui-breadcrumb-separator{margin:0 4px}.devui-breadcrumb{display:flex;align-items:center}.devui-breadcrumb .devui-breadcrumb-item:last-child .devui-breadcrumb-separator{display:none}
|