vue-devui 1.0.0-beta.4 → 1.0.0-beta.8
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/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +186 -139
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +1 -1
- package/alert/index.umd.js +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +4 -4
- package/button/index.umd.js +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +3 -3
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +57 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +167 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +15 -15
- package/date-picker/index.umd.js +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +33 -9
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +61 -61
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +53 -26
- package/editable-select/index.umd.js +9 -9
- package/form/index.d.ts +7 -0
- package/form/index.es.js +175 -80
- package/form/index.umd.js +1 -1
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +1 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +2 -2
- package/grid/index.umd.js +1 -1
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +4 -4
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +23 -2
- package/image-preview/index.umd.js +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +12 -12
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +331 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +3 -3
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +58 -57
- package/modal/index.umd.js +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +56 -55
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -31
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +2 -2
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +61 -24
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +118 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +14 -14
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +3 -3
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +24 -25
- package/splitter/index.umd.js +1 -1
- package/status/index.d.ts +7 -0
- package/status/index.es.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +97 -74
- package/steps-guide/index.umd.js +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1492 -157
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +1 -0
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +94 -12
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +1 -1
- package/textarea/index.umd.js +1 -1
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +240 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +12 -7
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +4 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +301 -62
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +160 -31
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +435 -110
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +4 -4
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +14014 -11820
- package/vue-devui.umd.js +19 -19
package/drawer/index.es.js
CHANGED
|
@@ -39,6 +39,13 @@ const drawerProps = {
|
|
|
39
39
|
position: {
|
|
40
40
|
type: String,
|
|
41
41
|
default: "left"
|
|
42
|
+
},
|
|
43
|
+
backdropCloseable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
beforeHidden: {
|
|
48
|
+
type: [Promise, Function]
|
|
42
49
|
}
|
|
43
50
|
};
|
|
44
51
|
var drawerHeader = "";
|
|
@@ -122,35 +129,41 @@ var DrawerBody = defineComponent({
|
|
|
122
129
|
const position = inject("position");
|
|
123
130
|
const width = inject("width");
|
|
124
131
|
const visible = inject("visible");
|
|
132
|
+
const backdropCloseable = inject("backdropCloseable");
|
|
125
133
|
const navRight = computed(() => position.value === "right" ? {
|
|
126
134
|
"right": 0
|
|
127
135
|
} : {
|
|
128
136
|
"left": 0
|
|
129
137
|
});
|
|
130
138
|
const navWidth = computed(() => isFullScreen.value ? "100vw" : width.value);
|
|
131
|
-
|
|
139
|
+
const clickContent = (e) => {
|
|
132
140
|
e.stopPropagation();
|
|
133
141
|
};
|
|
142
|
+
const handleDrawerClose = () => {
|
|
143
|
+
if (!backdropCloseable.value)
|
|
144
|
+
return;
|
|
145
|
+
closeDrawer();
|
|
146
|
+
};
|
|
134
147
|
return {
|
|
135
|
-
closeDrawer,
|
|
136
148
|
zindex,
|
|
137
149
|
slots,
|
|
138
150
|
isCover,
|
|
139
151
|
navRight,
|
|
140
152
|
navWidth,
|
|
141
153
|
visible,
|
|
142
|
-
clickContent
|
|
154
|
+
clickContent,
|
|
155
|
+
handleDrawerClose
|
|
143
156
|
};
|
|
144
157
|
},
|
|
145
158
|
render() {
|
|
146
159
|
const {
|
|
147
160
|
zindex,
|
|
148
|
-
closeDrawer,
|
|
149
161
|
slots,
|
|
150
162
|
isCover,
|
|
151
163
|
navRight,
|
|
152
164
|
navWidth,
|
|
153
|
-
visible
|
|
165
|
+
visible,
|
|
166
|
+
handleDrawerClose
|
|
154
167
|
} = this;
|
|
155
168
|
if (!visible)
|
|
156
169
|
return null;
|
|
@@ -159,7 +172,7 @@ var DrawerBody = defineComponent({
|
|
|
159
172
|
"style": {
|
|
160
173
|
zIndex: zindex
|
|
161
174
|
},
|
|
162
|
-
"onClick":
|
|
175
|
+
"onClick": handleDrawerClose
|
|
163
176
|
}, [isCover ? createVNode("div", {
|
|
164
177
|
"class": "devui-overlay-backdrop"
|
|
165
178
|
}, null) : null, createVNode("div", {
|
|
@@ -189,13 +202,23 @@ var Drawer = defineComponent({
|
|
|
189
202
|
zIndex,
|
|
190
203
|
isCover,
|
|
191
204
|
escKeyCloseable,
|
|
192
|
-
position
|
|
205
|
+
position,
|
|
206
|
+
backdropCloseable
|
|
193
207
|
} = toRefs(props);
|
|
194
|
-
|
|
208
|
+
const isFullScreen = ref(false);
|
|
195
209
|
const fullScreenEvent = () => {
|
|
196
210
|
isFullScreen.value = !isFullScreen.value;
|
|
197
211
|
};
|
|
198
|
-
const closeDrawer = () => {
|
|
212
|
+
const closeDrawer = async () => {
|
|
213
|
+
var _a;
|
|
214
|
+
const beforeHidden = props.beforeHidden;
|
|
215
|
+
let result = (_a = typeof beforeHidden === "function" ? beforeHidden() : beforeHidden) != null ? _a : true;
|
|
216
|
+
if (result instanceof Promise) {
|
|
217
|
+
console.log(result);
|
|
218
|
+
result = await result;
|
|
219
|
+
}
|
|
220
|
+
if (result)
|
|
221
|
+
return;
|
|
199
222
|
emit("update:visible", false);
|
|
200
223
|
emit("close");
|
|
201
224
|
};
|
|
@@ -222,6 +245,7 @@ var Drawer = defineComponent({
|
|
|
222
245
|
provide("width", width);
|
|
223
246
|
provide("visible", visible);
|
|
224
247
|
provide("isFullScreen", isFullScreen);
|
|
248
|
+
provide("backdropCloseable", backdropCloseable);
|
|
225
249
|
onUnmounted(() => {
|
|
226
250
|
document.removeEventListener("keyup", escCloseDrawer);
|
|
227
251
|
});
|
package/drawer/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var j=Object.defineProperty;var D=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var N=(n,e,o)=>e in n?j(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,S=(n,e)=>{for(var o in e||(e={}))x.call(e,o)&&N(n,o,e[o]);if(D)for(var o of D(e))B.call(e,o)&&N(n,o,e[o]);return n};(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const o={width:{type:String,default:"300px"},visible:{type:Boolean,default:!1},zIndex:{type:Number,default:1e3},isCover:{type:Boolean,default:!0},escKeyCloseable:{type:Boolean,default:!0},position:{type:String,default:"left"},backdropCloseable:{type:Boolean,default:!0},beforeHidden:{type:[Promise,Function]}};var z="",V=e.defineComponent({name:"DrawerHeader",emits:["toggleFullScreen","close"],setup(r,t){const l=e.ref(!1),s=e.inject("visible");return{fullScreenClassName:e.computed(()=>l.value?"icon icon-minimize":"icon icon-maxmize"),visible:s,handleFullScreen:f=>{f.stopPropagation(),l.value=!l.value,t.emit("toggleFullScreen")},handleDrawerClose:()=>{t.emit("close")}}},render(){const{handleFullScreen:r,handleDrawerClose:t,visible:l,fullScreenClassName:s}=this;return l?e.createVNode("div",{class:"devui-drawer-header"},[e.createVNode("div",{class:"devui-drawer-header-item"},[e.createVNode("span",{class:"devui-drawer-header-item icon icon-more-operate"},null)]),e.createVNode("div",{class:"devui-drawer-header-item",onClick:r},[e.createVNode("span",{class:s},null)]),e.createVNode("div",{class:"devui-drawer-header-item",onClick:t},[e.createVNode("span",{class:"icon icon-close"},null)])]):null}}),g=e.defineComponent({name:"DrawerContainer",setup(){return{visible:e.inject("visible")}},render(){const{visible:r}=this;return r?e.createVNode("div",null,[e.createTextVNode("\u5185\u5BB9\u533A\u57DF")]):null}}),E="",k=e.defineComponent({name:"DrawerBody",setup(r,{slots:t}){const l=e.inject("isFullScreen"),s=e.inject("closeDrawer"),a=e.inject("zindex"),c=e.inject("isCover"),u=e.inject("position"),f=e.inject("width"),C=e.inject("visible"),v=e.inject("backdropCloseable"),d=e.computed(()=>u.value==="right"?{right:0}:{left:0}),b=e.computed(()=>l.value?"100vw":f.value);return{zindex:a,slots:t,isCover:c,navRight:d,navWidth:b,visible:C,clickContent:i=>{i.stopPropagation()},handleDrawerClose:()=>{!v.value||s()}}},render(){const{zindex:r,slots:t,isCover:l,navRight:s,navWidth:a,visible:c,handleDrawerClose:u}=this;return c?e.createVNode("div",{class:"devui-drawer",style:{zIndex:r},onClick:u},[l?e.createVNode("div",{class:"devui-overlay-backdrop"},null):null,e.createVNode("div",{class:"devui-overlay-wrapper"},[e.createVNode("div",{class:"devui-drawer-nav",style:S({width:a},s)},[e.createVNode("div",{class:"devui-drawer-content",onClick:this.clickContent},[t.default?t.default():null])])])]):null}}),p=e.defineComponent({name:"DDrawer",props:o,emits:["close","update:visible","afterOpened"],setup(r,{emit:t,slots:l}){const{width:s,visible:a,zIndex:c,isCover:u,escKeyCloseable:f,position:C,backdropCloseable:v}=e.toRefs(r),d=e.ref(!1),b=()=>{d.value=!d.value},h=async()=>{var y;const i=r.beforeHidden;let w=(y=typeof i=="function"?i():i)!=null?y:!0;w instanceof Promise&&(console.log(w),w=await w),!w&&(t("update:visible",!1),t("close"))},m=i=>{i.code==="Escape"&&h()};return e.watch(a,i=>{i&&(t("afterOpened"),d.value=!1),f&&i?document.addEventListener("keyup",m):document.removeEventListener("keyup",m)}),e.provide("closeDrawer",h),e.provide("zindex",c),e.provide("isCover",u),e.provide("position",C),e.provide("width",s),e.provide("visible",a),e.provide("isFullScreen",d),e.provide("backdropCloseable",v),e.onUnmounted(()=>{document.removeEventListener("keyup",m)}),{isFullScreen:d,visible:a,slots:l,fullScreenEvent:b,closeDrawer:h}},render(){const r=this.fullScreenEvent,t=this.closeDrawer;return this.visible?e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode(k,null,{default:()=>[e.createVNode(V,{onToggleFullScreen:r,onClose:t},null),this.slots.default?this.slots.default():e.createVNode(g,null,null)]})]}):null}});p.install=function(r){r.component(p.name,p)};var F={title:"Drawer \u62BD\u5C49\u677F",category:"\u53CD\u9988",status:"30%",install(r){r.use(p)}};n.Drawer=p,n.default=F,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
|
package/dropdown/index.es.js
CHANGED
|
@@ -17,11 +17,10 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, watch, defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, onUnmounted, withDirectives, vShow, reactive,
|
|
20
|
+
import { ref, watch, defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, onUnmounted, withDirectives, vShow, reactive, toRef, isRef, toRefs, Fragment } from "vue";
|
|
21
21
|
const dropdownProps = {
|
|
22
22
|
origin: {
|
|
23
|
-
type: Object
|
|
24
|
-
required: true
|
|
23
|
+
type: Object
|
|
25
24
|
},
|
|
26
25
|
isOpen: {
|
|
27
26
|
type: Boolean,
|
|
@@ -41,7 +40,7 @@ const dropdownProps = {
|
|
|
41
40
|
},
|
|
42
41
|
closeOnMouseLeaveMenu: {
|
|
43
42
|
type: Boolean,
|
|
44
|
-
default:
|
|
43
|
+
default: false
|
|
45
44
|
},
|
|
46
45
|
showAnimation: {
|
|
47
46
|
type: Boolean,
|
|
@@ -176,7 +175,7 @@ const overlayProps = {
|
|
|
176
175
|
backgroundStyle: {
|
|
177
176
|
type: [String, Object]
|
|
178
177
|
},
|
|
179
|
-
|
|
178
|
+
onBackdropClick: {
|
|
180
179
|
type: Function
|
|
181
180
|
},
|
|
182
181
|
backdropClose: {
|
|
@@ -188,6 +187,7 @@ const overlayProps = {
|
|
|
188
187
|
default: true
|
|
189
188
|
}
|
|
190
189
|
};
|
|
190
|
+
const overlayEmits = ["onUpdate:visible", "backdropClick"];
|
|
191
191
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
192
192
|
overlayStyle: {
|
|
193
193
|
type: [String, Object],
|
|
@@ -223,7 +223,7 @@ function useOverlayLogic(props) {
|
|
|
223
223
|
const handleBackdropClick = (event) => {
|
|
224
224
|
var _a, _b;
|
|
225
225
|
event.preventDefault();
|
|
226
|
-
(_a = props.
|
|
226
|
+
(_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
|
|
227
227
|
if (props.backdropClose) {
|
|
228
228
|
(_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
|
|
229
229
|
}
|
|
@@ -262,6 +262,7 @@ function useOverlayLogic(props) {
|
|
|
262
262
|
const FixedOverlay = defineComponent({
|
|
263
263
|
name: "DFixedOverlay",
|
|
264
264
|
props: fixedOverlayProps,
|
|
265
|
+
emits: overlayEmits,
|
|
265
266
|
setup(props, ctx) {
|
|
266
267
|
const {
|
|
267
268
|
backgroundClass,
|
|
@@ -285,61 +286,46 @@ const FixedOverlay = defineComponent({
|
|
|
285
286
|
const FlexibleOverlay = defineComponent({
|
|
286
287
|
name: "DFlexibleOverlay",
|
|
287
288
|
props: flexibleOverlayProps,
|
|
288
|
-
emits:
|
|
289
|
+
emits: overlayEmits,
|
|
289
290
|
setup(props, ctx) {
|
|
290
291
|
const overlayRef = ref(null);
|
|
291
292
|
const positionedStyle = reactive({
|
|
292
293
|
position: "absolute"
|
|
293
294
|
});
|
|
294
|
-
const instance = getCurrentInstance();
|
|
295
295
|
onMounted(async () => {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (!overlay2) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
const origin = getOrigin(props.origin);
|
|
302
|
-
if (!origin) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
const handleRectChange = (rect) => {
|
|
306
|
-
const point = calculatePosition(props.position, rect, origin);
|
|
296
|
+
const handleRectChange = (position, rect, origin) => {
|
|
297
|
+
const point = calculatePosition(position, rect, origin);
|
|
307
298
|
positionedStyle.left = `${point.x}px`;
|
|
308
299
|
positionedStyle.top = `${point.y}px`;
|
|
309
300
|
};
|
|
310
|
-
const
|
|
301
|
+
const locationElements = computed(() => {
|
|
302
|
+
const overlay2 = overlayRef.value;
|
|
303
|
+
const origin = getOrigin(props.origin);
|
|
304
|
+
if (!overlay2 || !origin) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
origin,
|
|
309
|
+
overlay: overlay2
|
|
310
|
+
};
|
|
311
|
+
});
|
|
311
312
|
const visibleRef = toRef(props, "visible");
|
|
312
313
|
const positionRef = toRef(props, "position");
|
|
313
|
-
watch(visibleRef, (visible, ov, onInvalidate) => {
|
|
314
|
-
if (visible) {
|
|
315
|
-
|
|
316
|
-
} else {
|
|
317
|
-
unsbscribeLayoutEvent(handleChange);
|
|
314
|
+
watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
|
|
315
|
+
if (!visible || !locationElements2) {
|
|
316
|
+
return;
|
|
318
317
|
}
|
|
318
|
+
const {
|
|
319
|
+
origin,
|
|
320
|
+
overlay: overlay2
|
|
321
|
+
} = locationElements2;
|
|
322
|
+
handleRectChange(position, overlay2.getBoundingClientRect(), origin);
|
|
323
|
+
const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
|
|
319
324
|
onInvalidate(() => {
|
|
320
|
-
|
|
325
|
+
unsubscriptions.forEach((fn) => fn());
|
|
321
326
|
});
|
|
322
327
|
});
|
|
323
|
-
|
|
324
|
-
handleChange();
|
|
325
|
-
});
|
|
326
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
327
|
-
handleRectChange(entries[0].contentRect);
|
|
328
|
-
});
|
|
329
|
-
resizeObserver.observe(overlay2);
|
|
330
|
-
onBeforeUnmount(() => {
|
|
331
|
-
resizeObserver.disconnect();
|
|
332
|
-
}, instance);
|
|
333
|
-
if (origin instanceof Element) {
|
|
334
|
-
const observer = new MutationObserver(handleChange);
|
|
335
|
-
observer.observe(origin, {
|
|
336
|
-
attributeFilter: ["style"]
|
|
337
|
-
});
|
|
338
|
-
onBeforeUnmount(() => {
|
|
339
|
-
observer.disconnect();
|
|
340
|
-
}, instance);
|
|
341
|
-
}
|
|
342
|
-
}, instance);
|
|
328
|
+
});
|
|
343
329
|
const {
|
|
344
330
|
backgroundClass,
|
|
345
331
|
overlayClass,
|
|
@@ -372,15 +358,9 @@ function getOrigin(origin) {
|
|
|
372
358
|
}
|
|
373
359
|
return origin;
|
|
374
360
|
}
|
|
375
|
-
function calculatePosition(position,
|
|
361
|
+
function calculatePosition(position, rect, origin) {
|
|
376
362
|
const originRect = getOriginRect(origin);
|
|
377
363
|
const originPoint = getOriginRelativePoint(originRect, position);
|
|
378
|
-
let rect;
|
|
379
|
-
if (panelOrRect instanceof HTMLElement) {
|
|
380
|
-
rect = panelOrRect.getBoundingClientRect();
|
|
381
|
-
} else {
|
|
382
|
-
rect = panelOrRect;
|
|
383
|
-
}
|
|
384
364
|
return getOverlayPoint(originPoint, rect, position);
|
|
385
365
|
}
|
|
386
366
|
function getOriginRect(origin) {
|
|
@@ -444,11 +424,31 @@ function subscribeLayoutEvent(event) {
|
|
|
444
424
|
window.addEventListener("scroll", event, true);
|
|
445
425
|
window.addEventListener("resize", event);
|
|
446
426
|
window.addEventListener("orientationchange", event);
|
|
427
|
+
return () => {
|
|
428
|
+
window.removeEventListener("scroll", event, true);
|
|
429
|
+
window.removeEventListener("resize", event);
|
|
430
|
+
window.removeEventListener("orientationchange", event);
|
|
431
|
+
};
|
|
447
432
|
}
|
|
448
|
-
function
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
433
|
+
function subscribeOverlayResize(overlay2, callback) {
|
|
434
|
+
if (overlay2 instanceof Element) {
|
|
435
|
+
const resizeObserver = new ResizeObserver(callback);
|
|
436
|
+
resizeObserver.observe(overlay2);
|
|
437
|
+
return () => resizeObserver.disconnect();
|
|
438
|
+
}
|
|
439
|
+
return () => {
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function subscribeOriginResize(origin, callback) {
|
|
443
|
+
if (origin instanceof Element) {
|
|
444
|
+
const observer = new MutationObserver(callback);
|
|
445
|
+
observer.observe(origin, {
|
|
446
|
+
attributeFilter: ["style"]
|
|
447
|
+
});
|
|
448
|
+
return () => observer.disconnect();
|
|
449
|
+
}
|
|
450
|
+
return () => {
|
|
451
|
+
};
|
|
452
452
|
}
|
|
453
453
|
FlexibleOverlay.install = function(app) {
|
|
454
454
|
app.component(FlexibleOverlay.name, FlexibleOverlay);
|
|
@@ -476,9 +476,9 @@ var Dropdown = defineComponent({
|
|
|
476
476
|
immediate: true
|
|
477
477
|
});
|
|
478
478
|
const position = {
|
|
479
|
-
originX: "
|
|
479
|
+
originX: "center",
|
|
480
480
|
originY: "bottom",
|
|
481
|
-
overlayX: "
|
|
481
|
+
overlayX: "center",
|
|
482
482
|
overlayY: "top"
|
|
483
483
|
};
|
|
484
484
|
const {
|
|
@@ -508,7 +508,7 @@ var Dropdown = defineComponent({
|
|
|
508
508
|
var _a, _b;
|
|
509
509
|
return [withDirectives(createVNode("div", {
|
|
510
510
|
"ref": dropdownEl,
|
|
511
|
-
"style": "width:
|
|
511
|
+
"style": "min-width:102px"
|
|
512
512
|
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), [[vShow, animatedVisible.value]])];
|
|
513
513
|
}
|
|
514
514
|
})]
|
|
@@ -522,7 +522,7 @@ Dropdown.install = function(app) {
|
|
|
522
522
|
var index = {
|
|
523
523
|
title: "Dropdown \u4E0B\u62C9\u83DC\u5355",
|
|
524
524
|
category: "\u5BFC\u822A",
|
|
525
|
-
status:
|
|
525
|
+
status: "10%",
|
|
526
526
|
install(app) {
|
|
527
527
|
app.use(Dropdown);
|
|
528
528
|
}
|
package/dropdown/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Q=Object.defineProperty,W=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var X=(a,t,f)=>t in a?Q(a,t,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[t]=f,V=(a,t)=>{for(var f in t||(t={}))ee.call(t,f)&&X(a,f,t[f]);if(j)for(var f of j(t))te.call(t,f)&&X(a,f,t[f]);return a},Y=(a,t)=>W(a,Z(t));(function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";const f={origin:{type:Object},isOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeScope:{type:String,default:"all"},closeOnMouseLeaveMenu:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0}};function F(e){return!!(e==null?void 0:e.$el)}function S(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}function g(e,o,n){return e==null||e.addEventListener(o,n),()=>{e==null||e.removeEventListener(o,n)}}const _=({visible:e,trigger:o,origin:n,closeScope:r,closeOnMouseLeaveMenu:i})=>{const l=t.ref(),s=()=>{r.value!=="none"&&(e.value=!1)};return t.watch([o,n,l],([u,v,y],m,b)=>{const c=S(v);if(!c||!y)return;const p=[g(y,"click",()=>{r.value==="all"&&(e.value=!1)})];if(u==="click")p.push(g(c,"click",()=>e.value=!e.value),g(document,"click",d=>{if(!e.value)return;const h=d.target;c.contains(h)||y.contains(h)||s()}),g(y,"mouseleave",()=>{i.value&&(e.value=!1)}));else if(u==="hover"){let d=!1,h=!1;const O=async w=>{await new Promise(k=>setTimeout(k,50)),!(w==="origin"&&d||w==="dropdown"&&h)&&s()};p.push(g(c,"mouseenter",()=>{h=!0,e.value=!0}),g(c,"mouseleave",()=>{h=!1,i.value||O("origin")}),g(y,"mouseenter",()=>{d=!0,e.value=!0}),g(y,"mouseleave",()=>{d=!1,O("dropdown")}))}b(()=>p.forEach(d=>d()))}),{dropdownEl:l}};var ne="";function M(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const R=t.defineComponent({setup(e,o){return()=>{let n;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},M(n=t.renderSlot(o.slots,"default"))?n:{default:()=>[n]})]})}}}),D={visible:{type:Boolean},"onUpdate:visible":{type:Function},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}},N=["onUpdate:visible","backdropClick"],T=Y(V({},D),{overlayStyle:{type:[String,Object],default:void 0}}),z=V({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},D);function L(e){const o=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),n=t.computed(()=>"devui-overlay"),r=l=>{var s,u;l.preventDefault(),(s=e.onBackdropClick)==null||s.call(e),e.backdropClose&&((u=e["onUpdate:visible"])==null||u.call(e,!1))},i=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,s=l.style.overflow,u=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([v,y])=>{if(y){const m=l.getBoundingClientRect().y;v?(l.style.overflowY="scroll",l.style.position=v?"fixed":"",l.style.top=`${m}px`):(l.style.overflowY=s,l.style.position=u,l.style.top="",window.scrollTo(0,-m))}}),t.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:o,overlayClass:n,handleBackdropClick:r,handleOverlayBubbleCancel:i}}const E=t.defineComponent({name:"DFixedOverlay",props:T,emits:N,setup(e,o){const{backgroundClass:n,overlayClass:r,handleBackdropClick:i,handleOverlayBubbleCancel:l}=L(e);return()=>t.createVNode(R,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:n.value,style:e.backgroundStyle,onClick:i},[t.createVNode("div",{class:r.value,style:e.overlayStyle,onClick:l},[t.renderSlot(o.slots,"default")])]),[[t.vShow,e.visible]])]})}}),B=t.defineComponent({name:"DFlexibleOverlay",props:z,emits:N,setup(e,o){const n=t.ref(null),r=t.reactive({position:"absolute"});t.onMounted(async()=>{const v=(c,p,d)=>{const h=$(c,p,d);r.left=`${h.x}px`,r.top=`${h.y}px`},y=t.computed(()=>{const c=n.value,p=P(e.origin);if(!(!c||!p))return{origin:p,overlay:c}}),m=t.toRef(e,"visible"),b=t.toRef(e,"position");t.watch([y,m,b],async([c,p,d],h,O)=>{if(!p||!c)return;const{origin:w,overlay:k}=c;v(d,k.getBoundingClientRect(),w);const K=[G(()=>v(d,k.getBoundingClientRect(),w)),H(k,x=>v(d,x[0].contentRect,w)),I(w,()=>v(d,k.getBoundingClientRect(),w))];O(()=>{K.forEach(x=>x())})})});const{backgroundClass:i,overlayClass:l,handleBackdropClick:s,handleOverlayBubbleCancel:u}=L(e);return()=>t.createVNode(R,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:i.value,onClick:s},[t.createVNode("div",{ref:n,class:l.value,style:r,onClick:u},[t.renderSlot(o.slots,"default")])]),[[t.vShow,e.visible]])]})}});function P(e){return e instanceof Element?e:t.isRef(e)?S(e.value):F(e)?S(e):e}function $(e,o,n){const r=U(n),i=q(r,e);return A(i,o,e)}function U(e){if(e instanceof Element)return e.getBoundingClientRect();const o=e.width||0,n=e.height||0;return{top:e.y,bottom:e.y+n,left:e.x,right:e.x+o,height:n,width:o}}function A(e,o,n){let r;const{width:i,height:l}=o;n.overlayX=="center"?r=e.x-i/2:r=n.overlayX=="left"?e.x:e.x-i;let s;return n.overlayY=="center"?s=e.y-l/2:s=n.overlayY=="top"?e.y:e.y-l,{x:r,y:s}}function q(e,o){let n;if(o.originX=="center")n=e.left+e.width/2;else{const i=e.left,l=e.right;n=o.originX=="left"?i:l}let r;return o.originY=="center"?r=e.top+e.height/2:r=o.originY=="top"?e.top:e.bottom,{x:n,y:r}}function G(e){return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}}function H(e,o){if(e instanceof Element){const n=new ResizeObserver(o);return n.observe(e),()=>n.disconnect()}return()=>{}}function I(e,o){if(e instanceof Element){const n=new MutationObserver(o);return n.observe(e,{attributeFilter:["style"]}),()=>n.disconnect()}return()=>{}}B.install=function(e){e.component(B.name,B)},E.install=function(e){e.component(E.name,E)};var oe="",C=t.defineComponent({name:"DDropdown",props:f,emits:[],setup(e,o){const{isOpen:n,origin:r,trigger:i,closeScope:l,closeOnMouseLeaveMenu:s}=t.toRefs(e),u=t.ref(!1);t.watch(n,b=>{u.value=b},{immediate:!0});const v={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{dropdownEl:y}=_({visible:u,origin:r,trigger:i,closeScope:l,closeOnMouseLeaveMenu:s}),m=t.computed(()=>e.showAnimation?u.value:!0);return()=>t.createVNode(t.Fragment,null,[t.createVNode(B,{origin:e.origin,visible:u.value,"onUpdate:visible":b=>u.value=b,position:v,hasBackdrop:!1},{default:()=>[t.createVNode(t.Transition,{name:"devui-dropdown-fade"},{default:()=>{var b,c;return[t.withDirectives(t.createVNode("div",{ref:y,style:"min-width:102px"},[(c=(b=o.slots).default)==null?void 0:c.call(b)]),[[t.vShow,m.value]])]}})]})])}});C.install=function(e){e.component(C.name,C)};var J={title:"Dropdown \u4E0B\u62C9\u83DC\u5355",category:"\u5BFC\u822A",status:"10%",install(e){e.use(C)}};a.Dropdown=C,a.default=J,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
|
@@ -14,7 +14,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
import { defineComponent, createVNode,
|
|
17
|
+
import { defineComponent, createVNode, ref, computed, withDirectives, Transition, renderSlot, vShow, resolveDirective } from "vue";
|
|
18
18
|
const editableSelectProps = {
|
|
19
19
|
modelValue: {
|
|
20
20
|
type: [String, Number]
|
|
@@ -43,6 +43,10 @@ const editableSelectProps = {
|
|
|
43
43
|
loading: {
|
|
44
44
|
type: Boolean
|
|
45
45
|
},
|
|
46
|
+
enableLazyLoad: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
46
50
|
remoteMethod: {
|
|
47
51
|
type: Function
|
|
48
52
|
},
|
|
@@ -84,7 +88,7 @@ var Icon = defineComponent({
|
|
|
84
88
|
color,
|
|
85
89
|
classPrefix
|
|
86
90
|
} = this;
|
|
87
|
-
return
|
|
91
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
88
92
|
"src": name,
|
|
89
93
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
90
94
|
"style": {
|
|
@@ -96,7 +100,7 @@ var Icon = defineComponent({
|
|
|
96
100
|
fontSize: size,
|
|
97
101
|
color
|
|
98
102
|
}
|
|
99
|
-
}, null)
|
|
103
|
+
}, null);
|
|
100
104
|
}
|
|
101
105
|
});
|
|
102
106
|
Icon.install = function(app) {
|
|
@@ -5586,24 +5590,15 @@ var EditableSelect = defineComponent({
|
|
|
5586
5590
|
props: editableSelectProps,
|
|
5587
5591
|
emits: ["update:modelValue"],
|
|
5588
5592
|
setup(props, ctx2) {
|
|
5589
|
-
const
|
|
5590
|
-
disabled: props.disabled
|
|
5591
|
-
});
|
|
5592
|
-
const getLiCls = (item) => {
|
|
5593
|
-
const {
|
|
5594
|
-
disabledKey
|
|
5595
|
-
} = props;
|
|
5596
|
-
return className("devui-dropdown-item", {
|
|
5597
|
-
disabled: disabledKey ? !!item[disabledKey] : false
|
|
5598
|
-
});
|
|
5599
|
-
};
|
|
5593
|
+
const dropdownRef = ref(null);
|
|
5600
5594
|
const visible = ref(false);
|
|
5601
5595
|
const inputValue = ref("");
|
|
5596
|
+
const activeIndex = ref(0);
|
|
5602
5597
|
const query = ref(props.modelValue);
|
|
5603
5598
|
const wait = computed(() => props.remote ? 300 : 0);
|
|
5604
5599
|
const emptyText = computed(() => {
|
|
5605
5600
|
const options = filteredOptions.value;
|
|
5606
|
-
if (!props.remote &&
|
|
5601
|
+
if (!props.remote && options.length === 0) {
|
|
5607
5602
|
return "\u6CA1\u6709\u76F8\u5173\u8BB0\u5F55";
|
|
5608
5603
|
}
|
|
5609
5604
|
if (options.length === 0) {
|
|
@@ -5626,7 +5621,7 @@ var EditableSelect = defineComponent({
|
|
|
5626
5621
|
const filteredOptions = computed(() => {
|
|
5627
5622
|
const isValidOption = (o) => {
|
|
5628
5623
|
const query2 = inputValue.value;
|
|
5629
|
-
const containsQueryString = query2 ? o.name.
|
|
5624
|
+
const containsQueryString = query2 ? o.name.toLocaleLowerCase().indexOf(query2.toLocaleLowerCase()) >= 0 : true;
|
|
5630
5625
|
return containsQueryString;
|
|
5631
5626
|
};
|
|
5632
5627
|
return normalizeOptions.value.map((item) => {
|
|
@@ -5636,6 +5631,11 @@ var EditableSelect = defineComponent({
|
|
|
5636
5631
|
return null;
|
|
5637
5632
|
}).filter((item) => item !== null);
|
|
5638
5633
|
});
|
|
5634
|
+
const findIndex = (o) => {
|
|
5635
|
+
return normalizeOptions.value.findIndex((item) => {
|
|
5636
|
+
return item.name === o.name;
|
|
5637
|
+
});
|
|
5638
|
+
};
|
|
5639
5639
|
const handleClose = () => {
|
|
5640
5640
|
visible.value = false;
|
|
5641
5641
|
};
|
|
@@ -5644,11 +5644,11 @@ var EditableSelect = defineComponent({
|
|
|
5644
5644
|
visible.value = !visible.value;
|
|
5645
5645
|
}
|
|
5646
5646
|
};
|
|
5647
|
-
const onInputChange = () => {
|
|
5647
|
+
const onInputChange = (val) => {
|
|
5648
5648
|
if (props.filterMethod) {
|
|
5649
|
-
props.filterMethod(
|
|
5649
|
+
props.filterMethod(val);
|
|
5650
5650
|
} else if (props.remote) {
|
|
5651
|
-
props.remoteMethod(
|
|
5651
|
+
props.remoteMethod(val);
|
|
5652
5652
|
}
|
|
5653
5653
|
};
|
|
5654
5654
|
const debouncedOnInputChange = lodash.exports.debounce(onInputChange, wait.value);
|
|
@@ -5657,9 +5657,9 @@ var EditableSelect = defineComponent({
|
|
|
5657
5657
|
inputValue.value = value;
|
|
5658
5658
|
query.value = value;
|
|
5659
5659
|
if (props.remote) {
|
|
5660
|
-
debouncedOnInputChange();
|
|
5660
|
+
debouncedOnInputChange(value);
|
|
5661
5661
|
} else {
|
|
5662
|
-
onInputChange();
|
|
5662
|
+
onInputChange(value);
|
|
5663
5663
|
}
|
|
5664
5664
|
};
|
|
5665
5665
|
const selectOptionClick = (e, item) => {
|
|
@@ -5670,12 +5670,37 @@ var EditableSelect = defineComponent({
|
|
|
5670
5670
|
e.stopPropagation();
|
|
5671
5671
|
} else {
|
|
5672
5672
|
query.value = item.name;
|
|
5673
|
+
activeIndex.value = findIndex(item);
|
|
5674
|
+
inputValue.value = "";
|
|
5673
5675
|
ctx2.emit("update:modelValue", item.name);
|
|
5674
5676
|
}
|
|
5675
5677
|
};
|
|
5678
|
+
const loadMore = () => {
|
|
5679
|
+
if (!props.enableLazyLoad)
|
|
5680
|
+
return;
|
|
5681
|
+
const dropdownVal = dropdownRef.value;
|
|
5682
|
+
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
5683
|
+
props.remoteMethod(inputValue.value);
|
|
5684
|
+
}
|
|
5685
|
+
};
|
|
5676
5686
|
return () => {
|
|
5687
|
+
const selectCls = className("devui-form-group devui-has-feedback", {
|
|
5688
|
+
"devui-select-open": visible.value
|
|
5689
|
+
});
|
|
5690
|
+
const inputCls = className("devui-form-control devui-dropdown-origin devui-dropdown-origin-open", {
|
|
5691
|
+
disabled: props.disabled
|
|
5692
|
+
});
|
|
5693
|
+
const getLiCls = (item, index2) => {
|
|
5694
|
+
const {
|
|
5695
|
+
disabledKey
|
|
5696
|
+
} = props;
|
|
5697
|
+
return className("devui-dropdown-item", {
|
|
5698
|
+
disabled: disabledKey ? !!item[disabledKey] : false,
|
|
5699
|
+
selected: activeIndex.value === index2
|
|
5700
|
+
});
|
|
5701
|
+
};
|
|
5677
5702
|
return withDirectives(createVNode("div", {
|
|
5678
|
-
"class":
|
|
5703
|
+
"class": selectCls,
|
|
5679
5704
|
"onClick": toggleMenu
|
|
5680
5705
|
}, [createVNode("input", {
|
|
5681
5706
|
"class": inputCls,
|
|
@@ -5697,12 +5722,14 @@ var EditableSelect = defineComponent({
|
|
|
5697
5722
|
"class": "devui-dropdown-menu"
|
|
5698
5723
|
}, [createVNode("ul", {
|
|
5699
5724
|
"class": "devui-list-unstyled scroll-height",
|
|
5725
|
+
"ref": dropdownRef,
|
|
5700
5726
|
"style": {
|
|
5701
5727
|
maxHeight: props.maxHeight + "px"
|
|
5702
|
-
}
|
|
5703
|
-
|
|
5728
|
+
},
|
|
5729
|
+
"onScroll": loadMore
|
|
5730
|
+
}, [filteredOptions.value.map((item, index2) => {
|
|
5704
5731
|
return createVNode("li", {
|
|
5705
|
-
"class": getLiCls(item),
|
|
5732
|
+
"class": getLiCls(item, index2),
|
|
5706
5733
|
"onClick": ($evnet) => selectOptionClick($evnet, item),
|
|
5707
5734
|
"key": item.name
|
|
5708
5735
|
}, [ctx2.slots.default ? renderSlot(ctx2.slots, "default", {
|
|
@@ -5723,7 +5750,7 @@ EditableSelect.install = function(app) {
|
|
|
5723
5750
|
var index = {
|
|
5724
5751
|
title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
|
|
5725
5752
|
category: "\u6570\u636E\u5F55\u5165",
|
|
5726
|
-
status:
|
|
5753
|
+
status: "10%",
|
|
5727
5754
|
install(app) {
|
|
5728
5755
|
app.use(EditableSelect);
|
|
5729
5756
|
}
|