vue-devui 1.0.0-rc.0 → 1.0.0-rc.3
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 +55 -113
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +143 -103
- package/auto-complete/index.umd.js +5 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +77 -81
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +43 -43
- package/button/index.umd.js +1 -1
- package/card/index.es.js +3 -6
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +5 -11
- package/checkbox/index.umd.js +1 -1
- package/comment/index.es.js +2 -5
- package/comment/index.umd.js +1 -1
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/editable-select/index.es.js +124 -168
- package/editable-select/index.umd.js +1 -1
- package/fullscreen/index.es.js +13 -16
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +30 -36
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +21 -20
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +2 -5
- package/input/index.umd.js +1 -1
- package/layout/index.es.js +6 -21
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +20 -12
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +135 -122
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +38 -40
- package/notification/index.umd.js +1 -1
- package/nuxt/components/DropdownPropsKey.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/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/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/commentProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.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/readTipProps.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/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tagInputProps.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/overlay/index.es.js +49 -42
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -43
- package/pagination/index.es.js +24 -25
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +51 -44
- package/popover/index.umd.js +12 -12
- package/popover/style.css +1 -1
- package/progress/index.es.js +34 -36
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +11 -11
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +4 -7
- package/rate/index.umd.js +1 -1
- package/read-tip/index.es.js +8 -8
- package/read-tip/index.umd.js +1 -1
- package/result/index.es.js +40 -58
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +13 -16
- package/search/index.umd.js +8 -8
- package/skeleton/index.es.js +20 -23
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +60 -59
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +223 -171
- package/splitter/index.umd.js +13 -13
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +3 -6
- package/switch/index.umd.js +1 -1
- package/tag/index.es.js +15 -18
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +7 -8
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.es.js +2 -5
- package/textarea/index.umd.js +1 -1
- package/{accordion → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +64 -83
- package/timeline/index.umd.js +1 -0
- package/{anchor → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/upload/index.es.js +98 -97
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +12477 -24991
- package/vue-devui.umd.js +24 -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.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- 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/package.json +0 -7
- 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.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- 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/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -638
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7865
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- 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/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -240
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/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/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.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/Select.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/Table.js +0 -3
- package/nuxt/components/Tabs.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/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.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/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/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/table/index.d.ts +0 -7
- package/table/index.es.js +0 -1969
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- 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/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5828
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/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/index.d.ts +0 -7
- package/tree/index.es.js +0 -6490
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/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/notification/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent,
|
|
20
|
+
import { defineComponent, toRefs, createVNode, computed, watch, Transition, reactive, createApp, onUnmounted, mergeProps, isVNode } from "vue";
|
|
21
21
|
const notificationProps = {
|
|
22
22
|
modelValue: {
|
|
23
23
|
type: Boolean,
|
|
@@ -39,55 +39,53 @@ const notificationProps = {
|
|
|
39
39
|
type: Function
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
const iconProps = {
|
|
43
|
+
name: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "",
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "inherit"
|
|
51
|
+
},
|
|
52
|
+
color: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "inherit"
|
|
55
|
+
},
|
|
56
|
+
classPrefix: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "icon"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
42
61
|
var Icon = defineComponent({
|
|
43
62
|
name: "DIcon",
|
|
44
|
-
props:
|
|
45
|
-
name: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: true
|
|
48
|
-
},
|
|
49
|
-
size: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "inherit"
|
|
52
|
-
},
|
|
53
|
-
color: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "inherit"
|
|
56
|
-
},
|
|
57
|
-
classPrefix: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "icon"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
63
|
+
props: iconProps,
|
|
62
64
|
setup(props) {
|
|
63
|
-
return __spreadValues({}, props);
|
|
64
|
-
},
|
|
65
|
-
render() {
|
|
66
65
|
const {
|
|
67
66
|
name,
|
|
68
67
|
size,
|
|
69
68
|
color,
|
|
70
69
|
classPrefix
|
|
71
|
-
} =
|
|
72
|
-
return
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
} = toRefs(props);
|
|
71
|
+
return () => {
|
|
72
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
73
|
+
"src": name.value,
|
|
74
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
75
|
+
"style": {
|
|
76
|
+
width: size.value,
|
|
77
|
+
verticalAlign: "text-bottom"
|
|
78
|
+
}
|
|
79
|
+
}, null) : createVNode("i", {
|
|
80
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
81
|
+
"style": {
|
|
82
|
+
fontSize: size.value,
|
|
83
|
+
color: color.value
|
|
84
|
+
}
|
|
85
|
+
}, null);
|
|
86
|
+
};
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
Icon.install = function(app) {
|
|
89
|
-
app.component(Icon.name, Icon);
|
|
90
|
-
};
|
|
91
89
|
var Close = defineComponent({
|
|
92
90
|
emits: ["click"],
|
|
93
91
|
setup(props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I=Object.defineProperty,M=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var N=(i,e,l)=>e in i?I(i,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[e]=l,m=(i,e)=>{for(var l in e||(e={}))k.call(e,l)&&N(i,l,e[l]);if(v)for(var l of v(e))A.call(e,l)&&N(i,l,e[l]);return i},g=(i,e)=>M(i,R(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const l={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},S={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var p=e.defineComponent({name:"DIcon",props:S,setup(n){const{name:t,size:o,color:a,classPrefix:c}=e.toRefs(n);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:o.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${c.value} ${c.value}-${t.value}`,style:{fontSize:o.value,color:a.value}},null)}}),h=e.defineComponent({emits:["click"],setup(n,{emit:t}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>t("click",o)},[e.createVNode(p,{name:"close",size:"14px"},null)])}}),C=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=e.computed(()=>({"devui-notification-image":!0,[`devui-notification-image-${t.value}`]:!0})),a={info:"info-o",success:"right-o",warning:"warning-o",error:"error-o"};return()=>e.createVNode("span",{class:o.value},[t.value!=="normal"&&e.createVNode(p,{name:a[t.value],size:"16px"},null)])}});function T(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function b(n,t){let o=null,a;const c=()=>{var s;clearTimeout(o),o=null,(s=n.onClose)==null||s.call(n),t("update:modelValue",!1)},r=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const s=n.duration-(Date.now()-a);o=setTimeout(c,s)}},f=()=>{t("destroy")};return e.watch(()=>n.modelValue,s=>{s&&(a=Date.now(),n.duration&&(o=setTimeout(c,n.duration)))}),{interrupt:r,removeReset:d,close:c,handleDestroy:f}}var E="",u=e.defineComponent({name:"DNotification",props:l,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:a,title:c,type:r}=e.toRefs(n),{classes:d}=T(n),{interrupt:f,removeReset:s,close:x,handleDestroy:z}=b(n,t);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:z},{default:()=>{var V;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:d.value,onMouseenter:f,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(h,{onClick:x},null),c.value&&e.createVNode(C,{type:r.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[c.value]),e.createVNode("span",{class:"devui-notification-content"},[(V=o.default)==null?void 0:V.call(o)])])])])])]}})}});function D(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const P={modelValue:!1,duration:3e3,type:"normal"};function w(n,t){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(u,e.mergeProps(n,{onDestroy:a.unmount}),D(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),a.mount(o),a}function $(n,t){n.modelValue=!1,t==null||t()}class y{static open(t){const o=t.onClose||null,a=t.content;let c;delete t.content;const r=e.reactive(g(m(m({},P),t),{onClose:()=>{$(r,o)}}));w(r,a),r.modelValue=!0,clearTimeout(c),t.duration&&(c=setTimeout(r.onClose,t.duration))}}var j={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(u.name,u),n.config.globalProperties.$notificationService=y}};i.Notification=u,i.NotificationService=y,i.default=j,i.notificationProps=l,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
package/overlay/index.es.js
CHANGED
|
@@ -17,9 +17,9 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref,
|
|
21
|
-
import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
22
|
-
var
|
|
20
|
+
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
|
|
21
|
+
import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
22
|
+
var baseOverlay = "";
|
|
23
23
|
function _isSlot(s) {
|
|
24
24
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
25
25
|
}
|
|
@@ -66,43 +66,13 @@ const overlayProps = {
|
|
|
66
66
|
default: true
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
const overlayEmits = ["update:visible", "backdropClick"];
|
|
70
69
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
71
70
|
overlayStyle: {
|
|
72
71
|
type: [String, Object],
|
|
73
72
|
default: void 0
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
|
-
const
|
|
77
|
-
modelValue: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false
|
|
80
|
-
},
|
|
81
|
-
origin: {
|
|
82
|
-
type: Object,
|
|
83
|
-
require: true
|
|
84
|
-
},
|
|
85
|
-
position: {
|
|
86
|
-
type: Array,
|
|
87
|
-
default: ["bottom"]
|
|
88
|
-
},
|
|
89
|
-
offset: {
|
|
90
|
-
type: [Number, Object],
|
|
91
|
-
default: 8
|
|
92
|
-
},
|
|
93
|
-
align: {
|
|
94
|
-
type: String,
|
|
95
|
-
default: null
|
|
96
|
-
},
|
|
97
|
-
showArrow: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: false
|
|
100
|
-
},
|
|
101
|
-
isArrowCenter: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: true
|
|
104
|
-
}
|
|
105
|
-
};
|
|
75
|
+
const overlayEmits = ["update:visible", "backdropClick"];
|
|
106
76
|
function useOverlayLogic(props, ctx) {
|
|
107
77
|
const backgroundClass = computed(() => {
|
|
108
78
|
return [
|
|
@@ -153,6 +123,7 @@ function useOverlayLogic(props, ctx) {
|
|
|
153
123
|
handleOverlayBubbleCancel
|
|
154
124
|
};
|
|
155
125
|
}
|
|
126
|
+
var fixedOverlay = "";
|
|
156
127
|
const FixedOverlay = defineComponent({
|
|
157
128
|
name: "DFixedOverlay",
|
|
158
129
|
props: fixedOverlayProps,
|
|
@@ -177,6 +148,36 @@ const FixedOverlay = defineComponent({
|
|
|
177
148
|
});
|
|
178
149
|
}
|
|
179
150
|
});
|
|
151
|
+
const flexibleOverlayProps = {
|
|
152
|
+
modelValue: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: false
|
|
155
|
+
},
|
|
156
|
+
origin: {
|
|
157
|
+
type: Object,
|
|
158
|
+
require: true
|
|
159
|
+
},
|
|
160
|
+
position: {
|
|
161
|
+
type: Array,
|
|
162
|
+
default: ["bottom"]
|
|
163
|
+
},
|
|
164
|
+
offset: {
|
|
165
|
+
type: [Number, Object],
|
|
166
|
+
default: 8
|
|
167
|
+
},
|
|
168
|
+
align: {
|
|
169
|
+
type: String,
|
|
170
|
+
default: null
|
|
171
|
+
},
|
|
172
|
+
showArrow: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false
|
|
175
|
+
},
|
|
176
|
+
isArrowCenter: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: true
|
|
179
|
+
}
|
|
180
|
+
};
|
|
180
181
|
function getScrollParent(element) {
|
|
181
182
|
const overflowRegex = /(auto|scroll|hidden)/;
|
|
182
183
|
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
@@ -209,6 +210,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
209
210
|
function useOverlay(props, emit) {
|
|
210
211
|
const overlayRef = ref();
|
|
211
212
|
const arrowRef = ref();
|
|
213
|
+
let originParent = null;
|
|
212
214
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
213
215
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
214
216
|
const staticSide = {
|
|
@@ -230,6 +232,7 @@ function useOverlay(props, emit) {
|
|
|
230
232
|
const overlayEl = unref(overlayRef.value);
|
|
231
233
|
const arrowEl = unref(arrowRef.value);
|
|
232
234
|
const middleware = [
|
|
235
|
+
shift(),
|
|
233
236
|
offset(props.offset),
|
|
234
237
|
autoPlacement({
|
|
235
238
|
alignment: props.align,
|
|
@@ -246,25 +249,24 @@ function useOverlay(props, emit) {
|
|
|
246
249
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
247
250
|
};
|
|
248
251
|
watch(() => props.modelValue, () => {
|
|
249
|
-
const originParent = getScrollParent(props.origin);
|
|
250
252
|
if (props.modelValue && props.origin) {
|
|
253
|
+
originParent = getScrollParent(props.origin);
|
|
251
254
|
nextTick(updatePosition);
|
|
252
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
255
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
253
256
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
254
257
|
window.addEventListener("resize", updatePosition);
|
|
255
258
|
} else {
|
|
256
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
259
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
257
260
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
258
261
|
window.removeEventListener("resize", updatePosition);
|
|
259
262
|
}
|
|
260
263
|
});
|
|
261
264
|
onUnmounted(() => {
|
|
262
|
-
|
|
263
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
265
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
264
266
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
265
267
|
window.removeEventListener("resize", updatePosition);
|
|
266
268
|
});
|
|
267
|
-
return { arrowRef, overlayRef };
|
|
269
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
268
270
|
}
|
|
269
271
|
var flexibleOverlay = "";
|
|
270
272
|
const FlexibleOverlay = defineComponent({
|
|
@@ -275,12 +277,17 @@ const FlexibleOverlay = defineComponent({
|
|
|
275
277
|
setup(props, {
|
|
276
278
|
slots,
|
|
277
279
|
attrs,
|
|
278
|
-
emit
|
|
280
|
+
emit,
|
|
281
|
+
expose
|
|
279
282
|
}) {
|
|
280
283
|
const {
|
|
281
284
|
arrowRef,
|
|
282
|
-
overlayRef
|
|
285
|
+
overlayRef,
|
|
286
|
+
updatePosition
|
|
283
287
|
} = useOverlay(props, emit);
|
|
288
|
+
expose({
|
|
289
|
+
updatePosition
|
|
290
|
+
});
|
|
284
291
|
return () => {
|
|
285
292
|
var _a;
|
|
286
293
|
return props.modelValue && createVNode("div", mergeProps({
|
package/overlay/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Object.defineProperty,T=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(l,e,a)=>e in l?R(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,B=(l,e)=>{for(var a in e||(e={}))z.call(e,a)&&x(l,a,e[a]);if(O)for(var a of O(e))D.call(e,a)&&x(l,a,e[a]);return l},E=(l,e)=>T(l,$(e));(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue,l.dom))})(this,function(l,e,a){"use strict";var M="";function S(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const V=e.defineComponent({setup(t,r){return()=>{let i;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},S(i=e.renderSlot(r.slots,"default"))?i:{default:()=>[i]})]})}}}),p={visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},h=E(B({},p),{overlayStyle:{type:[String,Object],default:void 0}}),k=["update:visible","backdropClick"];function A(t,r){const i=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),n=o=>{var c;o.preventDefault(),(c=t.onBackdropClick)==null||c.call(t),t.backdropClose&&r.emit("update:visible",!1)},s=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,c=o.style.overflow,u=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([f,v])=>{if(v){const y=o.getBoundingClientRect().y;f?(o.style.overflowY="scroll",o.style.position=f?"fixed":"",o.style.top=`${y}px`):(o.style.overflowY=c,o.style.position=u,o.style.top="",window.scrollTo(0,-y))}}),e.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}}var q="";const m=e.defineComponent({name:"DFixedOverlay",props:h,emits:k,setup(t,r){const{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}=A(t,r);return()=>e.createVNode(V,null,{default:()=>[t.visible&&e.createVNode("div",{class:i.value,style:t.backgroundStyle,onClick:n},[e.createVNode("div",{class:d.value,style:t.overlayStyle,onClick:s},[e.renderSlot(r.slots,"default")])])]})}}),C={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function j(t){const r=/(auto|scroll|hidden)/;for(let i=t;i=i.parentElement;i.parentElement!==document.body){const d=window.getComputedStyle(i);if(r.test(d.overflow+d.overflowX+d.overflowY))return i}return window}function P(t,r,i,d){let{x:n,y:s}=r;if(!t){const{width:o,height:c}=d;n&&i.includes("start")&&(n=12),n&&i.includes("end")&&(n=Math.round(o-24)),s&&i.includes("start")&&(s=10),s&&i.includes("end")&&(s=c-14)}return{x:n,y:s}}function L(t,r){const i=e.ref(),d=e.ref();let n=null;const s=(c,u,f,v)=>{const{x:y,y:w}=P(t.isArrowCenter,f,u,v.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(c.style,{left:y?`${y}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},o=async()=>{const c=t.origin,u=e.unref(i.value),f=e.unref(d.value),v=[a.shift(),a.offset(t.offset),a.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&v.push(a.arrow({element:f}));const{x:y,y:w,placement:b,middlewareData:_}=await a.computePosition(c,u,{strategy:"fixed",middleware:v});r("positionChange",b),Object.assign(u.style,{top:`${w}px`,left:`${y}px`}),t.showArrow&&s(f,b,_.arrow,u)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(n=j(t.origin),e.nextTick(o),n==null||n.addEventListener("scroll",o),n!==window&&window.addEventListener("scroll",o),window.addEventListener("resize",o)):(n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o))}),e.onUnmounted(()=>{n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}),{arrowRef:d,overlayRef:i,updatePosition:o}}var Y="";const g=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:C,emits:["update:modelValue","positionChange"],setup(t,{slots:r,attrs:i,emit:d,expose:n}){const{arrowRef:s,overlayRef:o,updatePosition:c}=L(t,d);return n({updatePosition:c}),()=>{var u;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:o,class:"devui-flexible-overlay"},i),[(u=r.default)==null?void 0:u.call(r),t.showArrow&&e.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}}),N=typeof window!="undefined";var F={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(t){if(t.component(m.name,m),t.component(g.name,g),N&&!document.getElementById("d-overlay-anchor")){const r=document.createElement("div");r.setAttribute("id","d-overlay-anchor"),r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.zIndex="1000",document.body.appendChild(r)}}};l.FixedOverlay=m,l.FlexibleOverlay=g,l.default=F,l.fixedOverlayProps=h,l.flexibleOverlayProps=C,l.overlayEmits=k,l.overlayProps=p,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
package/overlay/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-devui",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "DevUI components based on Vite and Vue3",
|
|
6
6
|
"keywords": [
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"jsx",
|
|
16
16
|
"devui"
|
|
17
17
|
],
|
|
18
|
+
"homepage": "https://vue-devui.github.io/",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git@github.com:DevCloudFE/vue-devui.git"
|
|
22
|
+
},
|
|
18
23
|
"main": "vue-devui.umd.js",
|
|
19
24
|
"module": "vue-devui.es.js",
|
|
20
25
|
"style": "style.css",
|
|
@@ -24,52 +29,12 @@
|
|
|
24
29
|
"@types/lodash-es": "^4.17.4",
|
|
25
30
|
"@vueuse/core": "^7.7.1",
|
|
26
31
|
"async-validator": "^4.0.2",
|
|
27
|
-
"devui-theme": "
|
|
32
|
+
"devui-theme": "^0.0.1",
|
|
28
33
|
"fs-extra": "^10.0.0",
|
|
29
34
|
"lodash": "^4.17.21",
|
|
30
35
|
"lodash-es": "^4.17.20",
|
|
31
36
|
"mitt": "^3.0.0",
|
|
32
37
|
"vue": "^3.1.1",
|
|
33
38
|
"vue-router": "^4.0.3"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@babel/parser": "^7.15.5",
|
|
37
|
-
"@babel/preset-env": "^7.14.5",
|
|
38
|
-
"@babel/preset-typescript": "^7.14.5",
|
|
39
|
-
"@babel/traverse": "^7.15.4",
|
|
40
|
-
"@commitlint/cli": "^11.0.0",
|
|
41
|
-
"@commitlint/config-conventional": "^11.0.0",
|
|
42
|
-
"@docsearch/css": "^3.0.0-alpha.50",
|
|
43
|
-
"@docsearch/js": "^3.0.0-alpha.50",
|
|
44
|
-
"@types/chalk": "^2.2.0",
|
|
45
|
-
"@types/commander": "^2.12.2",
|
|
46
|
-
"@types/jest": "^26.0.23",
|
|
47
|
-
"@types/ora": "^3.2.0",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^4.27.0",
|
|
49
|
-
"@typescript-eslint/parser": "^4.27.0",
|
|
50
|
-
"@vitejs/plugin-vue": "^1.3.0",
|
|
51
|
-
"@vitejs/plugin-vue-jsx": "^1.1.0",
|
|
52
|
-
"@vue/babel-plugin-jsx": "^1.0.6",
|
|
53
|
-
"@vue/compiler-sfc": "^3.0.5",
|
|
54
|
-
"@vue/test-utils": "^2.0.0-rc.9",
|
|
55
|
-
"@vuedx/typecheck": "^0.4.1",
|
|
56
|
-
"@vuedx/typescript-plugin-vue": "^0.4.1",
|
|
57
|
-
"babel-jest": "^27.0.2",
|
|
58
|
-
"chalk": "^4.1.2",
|
|
59
|
-
"commander": "^8.1.0",
|
|
60
|
-
"devui-cli": "workspace:^0.0.2",
|
|
61
|
-
"inquirer": "^8.1.2",
|
|
62
|
-
"jest": "^27.0.4",
|
|
63
|
-
"ora": "^5.4.1",
|
|
64
|
-
"patch-vue-directive-ssr": "^0.0.1",
|
|
65
|
-
"sass": "^1.32.2",
|
|
66
|
-
"shelljs": "^0.8.4",
|
|
67
|
-
"typescript": "^4.3.2",
|
|
68
|
-
"vite": "^2.4.4",
|
|
69
|
-
"vite-plugin-md": "^0.6.0",
|
|
70
|
-
"vite-svg-loader": "^2.2.0",
|
|
71
|
-
"vitepress": "0.20.1",
|
|
72
|
-
"vitepress-theme-demoblock": "1.3.2",
|
|
73
|
-
"vue-tsc": "^0.2.2"
|
|
74
39
|
}
|
|
75
|
-
}
|
|
40
|
+
}
|