vue-devui 1.0.0-rc.3 → 1.0.0-rc.6
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 +144 -129
- package/auto-complete/index.es.js +45 -16
- package/auto-complete/index.umd.js +3 -3
- package/auto-complete/style.css +1 -1
- package/button/index.es.js +20 -13
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/comment/index.es.js +2 -1
- package/comment/index.umd.js +1 -1
- package/{tag-input → date-picker}/index.d.ts +0 -0
- package/date-picker/index.es.js +1145 -0
- package/date-picker/index.umd.js +1 -0
- package/date-picker/package.json +7 -0
- package/date-picker/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +236 -0
- package/drawer/index.umd.js +1 -0
- package/{tag-input → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +718 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7881 -0
- package/form/index.umd.js +27 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/input/index.es.js +13 -19
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +251 -0
- package/input-number/index.umd.js +1 -0
- package/input-number/package.json +7 -0
- package/input-number/style.css +1 -0
- package/layout/index.es.js +3 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +20 -13
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +16 -4
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +100 -10
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +15 -3
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -2
- package/popover/index.es.js +15 -3
- package/popover/index.umd.js +9 -9
- package/popover/style.css +1 -1
- package/rate/index.es.js +27 -34
- package/rate/index.umd.js +1 -1
- package/read-tip/index.es.js +32 -29
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/search/index.es.js +13 -19
- package/search/index.umd.js +12 -12
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +696 -0
- package/select/index.umd.js +1 -0
- package/select/package.json +7 -0
- package/select/style.css +1 -0
- package/skeleton/index.es.js +6 -6
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +19 -10
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +15 -3
- package/splitter/index.umd.js +11 -11
- package/style.css +1 -1
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +2661 -0
- package/table/index.umd.js +1 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +194 -0
- package/tabs/index.umd.js +1 -0
- package/tabs/package.json +7 -0
- package/tabs/style.css +1 -0
- package/timeline/index.es.js +2 -2
- package/timeline/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5847 -0
- package/tooltip/index.umd.js +27 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +1021 -0
- package/tree/index.umd.js +1 -0
- package/tree/package.json +7 -0
- package/tree/style.css +1 -0
- package/upload/index.es.js +100 -10
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +13211 -7394
- package/vue-devui.umd.js +24 -24
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/tagInputProps.js +0 -3
- package/tag-input/index.es.js +0 -328
- package/tag-input/index.umd.js +0 -1
- package/tag-input/style.css +0 -1
package/notification/index.es.js
CHANGED
|
@@ -100,6 +100,105 @@ var Close = defineComponent({
|
|
|
100
100
|
}, null)]);
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
+
function SuccessIcon() {
|
|
104
|
+
return createVNode("svg", {
|
|
105
|
+
"width": "16px",
|
|
106
|
+
"height": "16px",
|
|
107
|
+
"viewBox": "0 0 16 16",
|
|
108
|
+
"version": "1.1",
|
|
109
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
110
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
111
|
+
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
112
|
+
"id": "path-s",
|
|
113
|
+
"points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
|
|
114
|
+
}, null)]), createVNode("g", {
|
|
115
|
+
"id": "correct",
|
|
116
|
+
"stroke": "none",
|
|
117
|
+
"stroke-width": "1",
|
|
118
|
+
"fill": "none",
|
|
119
|
+
"fill-rule": "evenodd"
|
|
120
|
+
}, [createVNode("mask", {
|
|
121
|
+
"id": "mask-2",
|
|
122
|
+
"fill": "white"
|
|
123
|
+
}, [createVNode("use", {
|
|
124
|
+
"xlink:href": "#path-s"
|
|
125
|
+
}, null)]), createVNode("use", {
|
|
126
|
+
"id": "Mask",
|
|
127
|
+
"class": "devui-notification-image-success-path",
|
|
128
|
+
"xlink:href": "#path-s"
|
|
129
|
+
}, null)])]);
|
|
130
|
+
}
|
|
131
|
+
function WarningIcon() {
|
|
132
|
+
return createVNode("svg", {
|
|
133
|
+
"width": "16px",
|
|
134
|
+
"height": "16px",
|
|
135
|
+
"viewBox": "0 0 16 16",
|
|
136
|
+
"version": "1.1",
|
|
137
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
138
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
139
|
+
}, [createVNode("g", {
|
|
140
|
+
"stroke": "none",
|
|
141
|
+
"stroke-width": "1",
|
|
142
|
+
"fill": "none",
|
|
143
|
+
"fill-rule": "evenodd"
|
|
144
|
+
}, [createVNode("path", {
|
|
145
|
+
"class": "devui-icon-warning-outer",
|
|
146
|
+
"d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
|
|
147
|
+
}, null), createVNode("path", {
|
|
148
|
+
"class": "devui-icon-warning-inner",
|
|
149
|
+
"stroke-width": "0.3",
|
|
150
|
+
"fill-rule": "nonzero",
|
|
151
|
+
"d": "M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
|
|
152
|
+
}, null)])]);
|
|
153
|
+
}
|
|
154
|
+
function InfoIcon() {
|
|
155
|
+
return createVNode("svg", {
|
|
156
|
+
"width": "16px",
|
|
157
|
+
"height": "16px",
|
|
158
|
+
"viewBox": "0 0 16 16",
|
|
159
|
+
"version": "1.1",
|
|
160
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
161
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
162
|
+
}, [createVNode("g", {
|
|
163
|
+
"id": "info",
|
|
164
|
+
"stroke": "none",
|
|
165
|
+
"stroke-width": "1",
|
|
166
|
+
"fill": "none",
|
|
167
|
+
"fill-rule": "evenodd"
|
|
168
|
+
}, [createVNode("path", {
|
|
169
|
+
"class": "devui-notification-image-info-path",
|
|
170
|
+
"d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
|
|
171
|
+
"id": "info"
|
|
172
|
+
}, null)])]);
|
|
173
|
+
}
|
|
174
|
+
function ErrorIcon() {
|
|
175
|
+
return createVNode("svg", {
|
|
176
|
+
"width": "16px",
|
|
177
|
+
"height": "16px",
|
|
178
|
+
"viewBox": "0 0 16 16",
|
|
179
|
+
"version": "1.1",
|
|
180
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
181
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
182
|
+
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
183
|
+
"id": "path-e",
|
|
184
|
+
"points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
|
|
185
|
+
}, null)]), createVNode("g", {
|
|
186
|
+
"id": "error",
|
|
187
|
+
"stroke": "none",
|
|
188
|
+
"stroke-width": "1",
|
|
189
|
+
"fill": "none",
|
|
190
|
+
"fill-rule": "evenodd"
|
|
191
|
+
}, [createVNode("mask", {
|
|
192
|
+
"id": "mask-2",
|
|
193
|
+
"fill": "white"
|
|
194
|
+
}, [createVNode("use", {
|
|
195
|
+
"xlink:href": "#path-e"
|
|
196
|
+
}, null)]), createVNode("use", {
|
|
197
|
+
"id": "Mask",
|
|
198
|
+
"class": "devui-notification-image-error-path",
|
|
199
|
+
"xlink:href": "#path-e"
|
|
200
|
+
}, null)])]);
|
|
201
|
+
}
|
|
103
202
|
var TypeIcon = defineComponent({
|
|
104
203
|
props: {
|
|
105
204
|
type: {
|
|
@@ -115,18 +214,9 @@ var TypeIcon = defineComponent({
|
|
|
115
214
|
"devui-notification-image": true,
|
|
116
215
|
[`devui-notification-image-${type.value}`]: true
|
|
117
216
|
}));
|
|
118
|
-
const severityIconMap = {
|
|
119
|
-
info: "info-o",
|
|
120
|
-
success: "right-o",
|
|
121
|
-
warning: "warning-o",
|
|
122
|
-
error: "error-o"
|
|
123
|
-
};
|
|
124
217
|
return () => createVNode("span", {
|
|
125
218
|
"class": classes.value
|
|
126
|
-
}, [type.value !== "normal" && createVNode(
|
|
127
|
-
"name": severityIconMap[type.value],
|
|
128
|
-
"size": "16px"
|
|
129
|
-
}, null)]);
|
|
219
|
+
}, [type.value && type.value !== "normal" && (type.value === "success" && createVNode(SuccessIcon, null, null) || type.value === "info" && createVNode(InfoIcon, null, null) || type.value === "warning" && createVNode(WarningIcon, null, null) || type.value === "error" && createVNode(ErrorIcon, null, null))]);
|
|
130
220
|
}
|
|
131
221
|
});
|
|
132
222
|
function useNotification(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=Object.defineProperty,R=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var V=(i,e,l)=>e in i?B(i,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[e]=l,m=(i,e)=>{for(var l in e||(e={}))A.call(e,l)&&V(i,l,e[l]);if(w)for(var l of w(e))E.call(e,l)&&V(i,l,e[l]);return i},g=(i,e)=>R(i,Z(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}},N={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var x=e.defineComponent({name:"DIcon",props:N,setup(n){const{name:t,size:o,color:a,classPrefix:r}=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:`${r.value} ${r.value}-${t.value}`,style:{fontSize:o.value,color:a.value}},null)}}),y=e.defineComponent({emits:["click"],setup(n,{emit:t}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>t("click",o)},[e.createVNode(x,{name:"close",size:"14px"},null)])}});function k(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-s"},null)]),e.createVNode("use",{id:"Mask",class:"devui-notification-image-success-path","xlink:href":"#path-s"},null)])])}function v(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-icon-warning-outer",d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:"devui-icon-warning-inner","stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function L(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-notification-image-info-path",d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function C(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-e"},null)]),e.createVNode("use",{id:"Mask",class:"devui-notification-image-error-path","xlink:href":"#path-e"},null)])])}var S=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}));return()=>e.createVNode("span",{class:o.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode(k,null,null)||t.value==="info"&&e.createVNode(L,null,null)||t.value==="warning"&&e.createVNode(v,null,null)||t.value==="error"&&e.createVNode(C,null,null))])}});function T(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function M(n,t){let o=null,a;const r=()=>{var s;clearTimeout(o),o=null,(s=n.onClose)==null||s.call(n),t("update:modelValue",!1)},c=()=>{o&&(clearTimeout(o),o=null)},u=()=>{if(!n.modelValue){const s=n.duration-(Date.now()-a);o=setTimeout(r,s)}},f=()=>{t("destroy")};return e.watch(()=>n.modelValue,s=>{s&&(a=Date.now(),n.duration&&(o=setTimeout(r,n.duration)))}),{interrupt:c,removeReset:u,close:r,handleDestroy:f}}var _="",d=e.defineComponent({name:"DNotification",props:l,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:a,title:r,type:c}=e.toRefs(n),{classes:u}=T(n),{interrupt:f,removeReset:s,close:j,handleDestroy:z}=M(n,t);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:z},{default:()=>{var h;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:u.value,onMouseenter:f,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(y,{onClick:j},null),r.value&&e.createVNode(S,{type:c.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[r.value]),e.createVNode("span",{class:"devui-notification-content"},[(h=o.default)==null?void 0:h.call(o)])])])])])]}})}});function b(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const I={modelValue:!1,duration:3e3,type:"normal"};function D(n,t){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(d,e.mergeProps(n,{onDestroy:a.unmount}),b(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),a.mount(o),a}function P(n,t){n.modelValue=!1,t==null||t()}class p{static open(t){const o=t.onClose||null,a=t.content;let r;delete t.content;const c=e.reactive(g(m(m({},I),t),{onClose:()=>{P(c,o)}}));D(c,a),c.modelValue=!0,clearTimeout(r),t.duration&&(r=setTimeout(c.onClose,t.duration))}}var $={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(d.name,d),n.config.globalProperties.$notificationService=p}};i.Notification=d,i.NotificationService=p,i.default=$,i.notificationProps=l,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
package/notification/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 4px 16px 0) var(--devui-shadow, rgba(0, 0, 0, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification-item{position:relative;display:block;padding:12px 16px}.devui-notification-icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification-icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification-title{font-size:var(--devui-font-size-card-title, 14px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification-image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification-image.devui-notification-image-
|
|
1
|
+
.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 4px 16px 0) var(--devui-shadow, rgba(0, 0, 0, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification-item{position:relative;display:block;padding:12px 16px}.devui-notification-icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification-icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification-title{font-size:var(--devui-font-size-card-title, 14px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification-image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification-image.devui-notification-image-warning path.devui-icon-warning-outer{fill:var(--devui-warning-line, #fa9841)}.devui-notification-image.devui-notification-image-warning path.devui-icon-warning-inner{fill:var(--devui-light-text, #ffffff);stroke:var(--devui-light-text, #ffffff)}.devui-notification-image.devui-notification-image-info{background-color:var(--devui-info, #5e7ce0)}.devui-notification-image.devui-notification-image-error{background-color:var(--devui-danger, #f66f6a)}.devui-notification-image.devui-notification-image-success{background-color:var(--devui-success, #50d4ab)}.devui-notification-image .devui-notification-image-info-path,.devui-notification-image .devui-notification-image-error-path,.devui-notification-image .devui-notification-image-success-path{fill:var(--devui-light-text, #ffffff)}.devui-notification-message{margin-left:20px}.devui-notification-message .devui-notification-content{font-size:var(--devui-font-size, 12px);margin-top:4px}.devui-notification-message-common .devui-notification-message{margin-left:0}.devui-notification-message p{font-size:var(--devui-font-size, 12px);margin-top:4px}.notification-fade-enter-active,.notification-fade-leave-active{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.notification-fade-enter-from,.notification-fade-leave-to{transform:translate(100%)}
|
package/overlay/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
|
|
21
|
-
import {
|
|
21
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
22
22
|
var baseOverlay = "";
|
|
23
23
|
function _isSlot(s) {
|
|
24
24
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
@@ -165,6 +165,9 @@ const flexibleOverlayProps = {
|
|
|
165
165
|
type: [Number, Object],
|
|
166
166
|
default: 8
|
|
167
167
|
},
|
|
168
|
+
shiftOffset: {
|
|
169
|
+
type: Number
|
|
170
|
+
},
|
|
168
171
|
align: {
|
|
169
172
|
type: String,
|
|
170
173
|
default: null
|
|
@@ -232,7 +235,6 @@ function useOverlay(props, emit) {
|
|
|
232
235
|
const overlayEl = unref(overlayRef.value);
|
|
233
236
|
const arrowEl = unref(arrowRef.value);
|
|
234
237
|
const middleware = [
|
|
235
|
-
shift(),
|
|
236
238
|
offset(props.offset),
|
|
237
239
|
autoPlacement({
|
|
238
240
|
alignment: props.align,
|
|
@@ -240,12 +242,22 @@ function useOverlay(props, emit) {
|
|
|
240
242
|
})
|
|
241
243
|
];
|
|
242
244
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
245
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
243
246
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
244
247
|
strategy: "fixed",
|
|
245
248
|
middleware
|
|
246
249
|
});
|
|
250
|
+
let applyX = x;
|
|
251
|
+
let applyY = y;
|
|
252
|
+
if (props.shiftOffset !== void 0) {
|
|
253
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
254
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
255
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
256
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
257
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
258
|
+
}
|
|
247
259
|
emit("positionChange", placement);
|
|
248
|
-
Object.assign(overlayEl.style, { top: `${
|
|
260
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
249
261
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
250
262
|
};
|
|
251
263
|
watch(() => props.modelValue, () => {
|
package/overlay/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var z=Object.defineProperty,D=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var A=(l,t,a)=>t in l?z(l,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[t]=a,j=(l,t)=>{for(var a in t||(t={}))q.call(t,a)&&A(l,a,t[a]);if(V)for(var a of V(t))X.call(t,a)&&A(l,a,t[a]);return l},P=(l,t)=>D(l,M(t));(function(l,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(l=typeof globalThis!="undefined"?globalThis:l||self,t(l.index={},l.Vue,l.dom))})(this,function(l,t,a){"use strict";var I="";function L(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const N=t.defineComponent({setup(e,i){return()=>{let r;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},L(r=t.renderSlot(i.slots,"default"))?r:{default:()=>[r]})]})}}}),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}},k=P(j({},p),{overlayStyle:{type:[String,Object],default:void 0}}),C=["update:visible","backdropClick"];function F(e,i){const r=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=t.computed(()=>"devui-overlay"),n=o=>{var c;o.preventDefault(),(c=e.onBackdropClick)==null||c.call(e),e.backdropClose&&i.emit("update:visible",!1)},s=o=>o.cancelBubble=!0;return t.onMounted(()=>{const o=document.body,c=o.style.overflow,f=o.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([u,y])=>{if(y){const v=o.getBoundingClientRect().y;u?(o.style.overflowY="scroll",o.style.position=u?"fixed":"",o.style.top=`${v}px`):(o.style.overflowY=c,o.style.position=f,o.style.top="",window.scrollTo(0,-v))}}),t.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:r,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}}var U="";const m=t.defineComponent({name:"DFixedOverlay",props:k,emits:C,setup(e,i){const{backgroundClass:r,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}=F(e,i);return()=>t.createVNode(N,null,{default:()=>[e.visible&&t.createVNode("div",{class:r.value,style:e.backgroundStyle,onClick:n},[t.createVNode("div",{class:d.value,style:e.overlayStyle,onClick:s},[t.renderSlot(i.slots,"default")])])]})}}),x={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function _(e){const i=/(auto|scroll|hidden)/;for(let r=e;r=r.parentElement;r.parentElement!==document.body){const d=window.getComputedStyle(r);if(i.test(d.overflow+d.overflowX+d.overflowY))return r}return window}function R(e,i,r,d){let{x:n,y:s}=i;if(!e){const{width:o,height:c}=d;n&&r.includes("start")&&(n=12),n&&r.includes("end")&&(n=Math.round(o-24)),s&&r.includes("start")&&(s=10),s&&r.includes("end")&&(s=c-14)}return{x:n,y:s}}function T(e,i){const r=t.ref(),d=t.ref();let n=null;const s=(c,f,u,y)=>{const{x:v,y:w}=R(e.isArrowCenter,u,f,y.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]];Object.assign(c.style,{left:v?`${v}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},o=async()=>{const c=e.origin,f=t.unref(r.value),u=t.unref(d.value),y=[a.offset(e.offset),a.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&y.push(a.arrow({element:u})),e.shiftOffset!==void 0&&y.push(a.shift());const{x:v,y:w,placement:b,middlewareData:B}=await a.computePosition(c,f,{strategy:"fixed",middleware:y});let g=v,O=w;if(e.shiftOffset!==void 0){const{x:E,y:S}=B.shift;E<0&&(g-=e.shiftOffset),E>0&&(g+=e.shiftOffset),S<0&&(O-=e.shiftOffset),S>0&&(O+=e.shiftOffset)}i("positionChange",b),Object.assign(f.style,{top:`${O}px`,left:`${g}px`}),e.showArrow&&s(u,b,B.arrow,f)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(n=_(e.origin),t.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))}),t.onUnmounted(()=>{n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}),{arrowRef:d,overlayRef:r,updatePosition:o}}var G="";const h=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:x,emits:["update:modelValue","positionChange"],setup(e,{slots:i,attrs:r,emit:d,expose:n}){const{arrowRef:s,overlayRef:o,updatePosition:c}=T(e,d);return n({updatePosition:c}),()=>{var f;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:o,class:"devui-flexible-overlay"},r),[(f=i.default)==null?void 0:f.call(i),e.showArrow&&t.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}}),Y=typeof window!="undefined";var $={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(m.name,m),e.component(h.name,h),Y&&!document.getElementById("d-overlay-anchor")){const i=document.createElement("div");i.setAttribute("id","d-overlay-anchor"),i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.zIndex="1000",document.body.appendChild(i)}}};l.FixedOverlay=m,l.FlexibleOverlay=h,l.default=$,l.fixedOverlayProps=k,l.flexibleOverlayProps=x,l.overlayEmits=C,l.overlayProps=p,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
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.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "DevUI components based on Vite and Vue3",
|
|
6
6
|
"keywords": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"style": "style.css",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@devui-design/icons": "^1.3.0",
|
|
28
|
-
"@floating-ui/dom": "^0.4.
|
|
28
|
+
"@floating-ui/dom": "^0.4.4",
|
|
29
29
|
"@types/lodash-es": "^4.17.4",
|
|
30
30
|
"@vueuse/core": "^7.7.1",
|
|
31
31
|
"async-validator": "^4.0.2",
|
package/popover/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, toRefs, Fragment } from "vue";
|
|
21
|
-
import {
|
|
21
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
22
22
|
var baseOverlay = "";
|
|
23
23
|
function _isSlot(s) {
|
|
24
24
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
@@ -165,6 +165,9 @@ const flexibleOverlayProps = {
|
|
|
165
165
|
type: [Number, Object],
|
|
166
166
|
default: 8
|
|
167
167
|
},
|
|
168
|
+
shiftOffset: {
|
|
169
|
+
type: Number
|
|
170
|
+
},
|
|
168
171
|
align: {
|
|
169
172
|
type: String,
|
|
170
173
|
default: null
|
|
@@ -232,7 +235,6 @@ function useOverlay(props, emit) {
|
|
|
232
235
|
const overlayEl = unref(overlayRef.value);
|
|
233
236
|
const arrowEl = unref(arrowRef.value);
|
|
234
237
|
const middleware = [
|
|
235
|
-
shift(),
|
|
236
238
|
offset(props.offset),
|
|
237
239
|
autoPlacement({
|
|
238
240
|
alignment: props.align,
|
|
@@ -240,12 +242,22 @@ function useOverlay(props, emit) {
|
|
|
240
242
|
})
|
|
241
243
|
];
|
|
242
244
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
245
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
243
246
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
244
247
|
strategy: "fixed",
|
|
245
248
|
middleware
|
|
246
249
|
});
|
|
250
|
+
let applyX = x;
|
|
251
|
+
let applyY = y;
|
|
252
|
+
if (props.shiftOffset !== void 0) {
|
|
253
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
254
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
255
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
256
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
257
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
258
|
+
}
|
|
247
259
|
emit("positionChange", placement);
|
|
248
|
-
Object.assign(overlayEl.style, { top: `${
|
|
260
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
249
261
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
250
262
|
};
|
|
251
263
|
watch(() => props.modelValue, () => {
|