vue-devui 1.0.0-beta.1 → 1.0.0-beta.10
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 +2 -3
- package/alert/index.umd.js +1 -1
- package/alert/style.css +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 +9 -8
- 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 +5 -4
- 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 +43 -8
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +85 -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 +176 -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 +32 -21
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +32 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +161 -41
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +527 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5718 -469
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2244 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +14 -4
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +6 -5
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +72 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +24 -13
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -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 +5 -4
- 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 +117 -99
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.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/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/MultiUpload.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +110 -93
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +6 -33
- 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/panel/index.es.js +25 -22
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +5 -2
- 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 +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -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 +35 -21
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +47 -11
- 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 +30 -177
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +107 -89
- package/splitter/index.umd.js +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +2 -2
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +101 -73
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +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 +1498 -156
- 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 +6 -3
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -13
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +241 -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 +50 -26
- 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 +8 -7
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +368 -79
- 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 +171 -35
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +8 -7
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +19214 -7637
- package/vue-devui.umd.js +29 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { defineComponent, createVNode } from "vue";
|
|
18
|
+
const resultProps = {
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "info"
|
|
22
|
+
},
|
|
23
|
+
title: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
desc: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var Icon = defineComponent({
|
|
33
|
+
name: "DIcon",
|
|
34
|
+
props: {
|
|
35
|
+
name: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "inherit"
|
|
42
|
+
},
|
|
43
|
+
color: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "inherit"
|
|
46
|
+
},
|
|
47
|
+
classPrefix: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "icon"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(props) {
|
|
53
|
+
return __spreadValues({}, props);
|
|
54
|
+
},
|
|
55
|
+
render() {
|
|
56
|
+
const {
|
|
57
|
+
name,
|
|
58
|
+
size,
|
|
59
|
+
color,
|
|
60
|
+
classPrefix
|
|
61
|
+
} = this;
|
|
62
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
63
|
+
"src": name,
|
|
64
|
+
"alt": name.split("/")[name.split("/").length - 1],
|
|
65
|
+
"style": {
|
|
66
|
+
width: size,
|
|
67
|
+
verticalAlign: "text-bottom"
|
|
68
|
+
}
|
|
69
|
+
}, null) : createVNode("i", {
|
|
70
|
+
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
71
|
+
"style": {
|
|
72
|
+
fontSize: size,
|
|
73
|
+
color
|
|
74
|
+
}
|
|
75
|
+
}, null);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var result = "";
|
|
79
|
+
var Result = defineComponent({
|
|
80
|
+
name: "DResult",
|
|
81
|
+
props: resultProps,
|
|
82
|
+
setup(props, ctx) {
|
|
83
|
+
let IconEnum;
|
|
84
|
+
(function(IconEnum2) {
|
|
85
|
+
IconEnum2["success"] = "right-o";
|
|
86
|
+
IconEnum2["danger"] = "error-o";
|
|
87
|
+
IconEnum2["warning"] = "warning-o";
|
|
88
|
+
IconEnum2["info"] = "info-o";
|
|
89
|
+
})(IconEnum || (IconEnum = {}));
|
|
90
|
+
return () => {
|
|
91
|
+
var _a, _b, _c, _d;
|
|
92
|
+
return createVNode("div", {
|
|
93
|
+
"class": "devui-result"
|
|
94
|
+
}, [ctx.slots.icon ? createVNode("div", null, [(_a = ctx.slots) == null ? void 0 : _a.icon()]) : createVNode(Icon, {
|
|
95
|
+
"name": IconEnum[props.icon] || "",
|
|
96
|
+
"class": `devui-result__icon-${props.icon}`,
|
|
97
|
+
"size": "64px"
|
|
98
|
+
}, null), createVNode("div", {
|
|
99
|
+
"class": "devui-result__title"
|
|
100
|
+
}, [ctx.slots.title ? (_b = ctx.slots) == null ? void 0 : _b.title() : props.title]), createVNode("div", {
|
|
101
|
+
"class": "devui-result__desc"
|
|
102
|
+
}, [ctx.slots.desc ? (_c = ctx.slots) == null ? void 0 : _c.desc() : props.desc]), createVNode("div", {
|
|
103
|
+
"class": "devui-result__extra"
|
|
104
|
+
}, [ctx.slots.extra ? (_d = ctx.slots) == null ? void 0 : _d.extra() : ""])]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Result.install = function(app) {
|
|
109
|
+
app.component(Result.name, Result);
|
|
110
|
+
};
|
|
111
|
+
var index = {
|
|
112
|
+
title: "Result \u7ED3\u679C",
|
|
113
|
+
category: "\u53CD\u9988",
|
|
114
|
+
status: "100%",
|
|
115
|
+
install(app) {
|
|
116
|
+
app.use(Result);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
export { Result, index as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var c=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var f=(t,e,s)=>e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,p=(t,e)=>{for(var s in e||(e={}))h.call(e,s)&&f(t,s,e[s]);if(c)for(var s of c(e))S.call(e,s)&&f(t,s,e[s]);return t};(function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";const s={icon:{type:String,default:"info"},title:{type:String,default:""},desc:{type:String,default:""}};var g=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(i){return p({},i)},render(){const{name:i,size:n,color:o,classPrefix:l}=this;return/^((https?):)?\/\//.test(i)?e.createVNode("img",{src:i,alt:i.split("/")[i.split("/").length-1],style:{width:n,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${l} ${l}-${i}`,style:{fontSize:n,color:o}},null)}}),_="",r=e.defineComponent({name:"DResult",props:s,setup(i,n){let o;return function(l){l.success="right-o",l.danger="error-o",l.warning="warning-o",l.info="info-o"}(o||(o={})),()=>{var l,d,u,a;return e.createVNode("div",{class:"devui-result"},[n.slots.icon?e.createVNode("div",null,[(l=n.slots)==null?void 0:l.icon()]):e.createVNode(g,{name:o[i.icon]||"",class:`devui-result__icon-${i.icon}`,size:"64px"},null),e.createVNode("div",{class:"devui-result__title"},[n.slots.title?(d=n.slots)==null?void 0:d.title():i.title]),e.createVNode("div",{class:"devui-result__desc"},[n.slots.desc?(u=n.slots)==null?void 0:u.desc():i.desc]),e.createVNode("div",{class:"devui-result__extra"},[n.slots.extra?(a=n.slots)==null?void 0:a.extra():""])])}}});r.install=function(i){i.component(r.name,r)};var y={title:"Result \u7ED3\u679C",category:"\u53CD\u9988",status:"100%",install(i){i.use(r)}};t.Result=r,t.default=y,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
|
package/result/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.devui-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:30px}.devui-result__icon-success:before{color:var(--devui-success, #50d4ab)}.devui-result__icon-danger:before{color:var(--devui-danger, #f66f6a)}.devui-result__icon-warning:before{color:var(--devui-warning, #fac20a)}.devui-result__icon-info:before{color:var(--devui-info, #5e7ce0)}.devui-result__title{margin-top:20px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size-lg, 14px)}.devui-result__desc{margin-top:10px;color:var(--devui-text-weak, #575d6c);font-size:var(--devui-font-size-md, 12px)}.devui-result__extra{margin-top:30px}
|
package/ripple/index.es.js
CHANGED
|
@@ -21,7 +21,8 @@ const DEFAULT_PLUGIN_OPTIONS = {
|
|
|
21
21
|
finalOpacity: 0.1,
|
|
22
22
|
duration: 0.8,
|
|
23
23
|
easing: "ease-out",
|
|
24
|
-
delayTime: 75
|
|
24
|
+
delayTime: 75,
|
|
25
|
+
disabled: false
|
|
25
26
|
};
|
|
26
27
|
const createContainer = ({
|
|
27
28
|
borderTopLeftRadius,
|
|
@@ -157,6 +158,8 @@ var RippleDirective = {
|
|
|
157
158
|
optionMap.set(el, (_a = binding.value) != null ? _a : {});
|
|
158
159
|
el.addEventListener("pointerdown", (event) => {
|
|
159
160
|
const options = optionMap.get(el);
|
|
161
|
+
if (binding.value && binding.value.disabled)
|
|
162
|
+
return;
|
|
160
163
|
if (options === false)
|
|
161
164
|
return;
|
|
162
165
|
ripple(event, el, __spreadValues(__spreadValues({}, globalOptions), options));
|
|
@@ -170,7 +173,7 @@ var RippleDirective = {
|
|
|
170
173
|
var index = {
|
|
171
174
|
title: "Ripple \u6C34\u6CE2\u7EB9",
|
|
172
175
|
category: "\u901A\u7528",
|
|
173
|
-
status: "
|
|
176
|
+
status: "100%",
|
|
174
177
|
install(app) {
|
|
175
178
|
app.directive("Ripple", RippleDirective);
|
|
176
179
|
}
|
package/ripple/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=Object.defineProperty;var T=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var $=(s,r,a)=>r in s?B(s,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[r]=a,y=(s,r)=>{for(var a in r||(r={}))F.call(r,a)&&$(s,a,r[a]);if(T)for(var a of T(r))j.call(r,a)&&$(s,a,r[a]);return s};(function(s,r){typeof exports=="object"&&typeof module!="undefined"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis!="undefined"?globalThis:s||self,r(s.index={}))})(this,function(s){"use strict";const r={directive:"ripple",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.8,easing:"ease-out",delayTime:75,disabled:!1},a=({borderTopLeftRadius:t,borderTopRightRadius:e,borderBottomLeftRadius:i,borderBottomRightRadius:o})=>{const n=document.createElement("div");return n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.borderRadius=`${t} ${e} ${o} ${i}`,n.style.overflow="hidden",n.style.pointerEvents="none",n.style.webkitMaskImage="-webkit-radial-gradient(white, black)",n},w=(t,e,i,o)=>{const n=document.createElement("div");return n.style.position="absolute",n.style.width=`${i}px`,n.style.height=`${i}px`,n.style.top=`${e}px`,n.style.left=`${t}px`,n.style.background=o.color,n.style.borderRadius="50%",n.style.opacity=`${o.initialOpacity}`,n.style.transform="translate(-50%,-50%) scale(0)",n.style.transition=`transform ${o.duration}s ${o.easing}, opacity ${o.duration}s ${o.easing}`,n};function u(t,e,i,o){const n=t-i,l=e-o;return Math.sqrt(n*n+l*l)}function M(t,e,{width:i,height:o}){const n=u(t,e,0,0),l=u(t,e,i,0),d=u(t,e,0,o),g=u(t,e,i,o);return Math.max(n,l,d,g)}const O=({x:t,y:e},{top:i,left:o})=>({x:t-o,y:e-i}),f="vRippleCountInternal";function P(t){const e=v(t);R(t,e+1)}function k(t){const e=v(t);R(t,e-1)}function R(t,e){t.dataset[f]=e.toString()}function v(t){var e;return parseInt((e=t.dataset[f])!=null?e:"0",10)}function I(t){delete t.dataset[f]}const x=2.05,S=(t,e,i)=>{const o=e.getBoundingClientRect(),n=window.getComputedStyle(e),{x:l,y:d}=O(t,o),g=x*M(l,d,o),m=a(n),p=w(l,d,g,i);P(e);let h="";n.position==="static"&&(e.style.position&&(h=e.style.position),e.style.position="relative"),m.appendChild(p),e.appendChild(m);let b=!1;const c=A=>{typeof A!="undefined"&&(document.removeEventListener("pointerup",c),document.removeEventListener("pointercancel",c)),b?U():b=!0},U=()=>{p.style.transition="opacity 150ms linear",p.style.opacity="0",setTimeout(()=>{m.remove(),k(e),v(e)===0&&(I(e),e.style.position=h)},150)};document.addEventListener("pointerup",c),document.addEventListener("pointercancel",c);const N=setTimeout(()=>{document.removeEventListener("pointercancel",C),requestAnimationFrame(()=>{p.style.transform="translate(-50%,-50%) scale(1)",p.style.opacity=`${i.finalOpacity}`,setTimeout(()=>c(),i.duration*1e3)})},i.delayTime),C=()=>{clearTimeout(N),m.remove(),document.removeEventListener("pointerup",c),document.removeEventListener("pointercancel",c),document.removeEventListener("pointercancel",C)};document.addEventListener("pointercancel",C)},E=new WeakMap,_=y({},r);var L={mounted(t,e){var i;E.set(t,(i=e.value)!=null?i:{}),t.addEventListener("pointerdown",o=>{const n=E.get(t);e.value&&e.value.disabled||n!==!1&&S(o,t,y(y({},_),n))})},updated(t,e){var i;E.set(t,(i=e.value)!=null?i:{})}},D={title:"Ripple \u6C34\u6CE2\u7EB9",category:"\u901A\u7528",status:"100%",install(t){t.directive("Ripple",L)}};s.RippleDirective=L,s.default=D,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/search/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, watch, defineComponent, createVNode, withDirectives, mergeProps, resolveDirective, resolveComponent } from "vue";
|
|
1
|
+
import { computed, ref, watch, defineComponent, inject, createVNode, withDirectives, mergeProps, resolveDirective, resolveComponent } from "vue";
|
|
2
2
|
const searchProps = {
|
|
3
3
|
size: {
|
|
4
4
|
type: String,
|
|
@@ -44,7 +44,7 @@ const searchProps = {
|
|
|
44
44
|
type: String,
|
|
45
45
|
default: ""
|
|
46
46
|
},
|
|
47
|
-
|
|
47
|
+
onSearch: {
|
|
48
48
|
type: Function,
|
|
49
49
|
default: void 0
|
|
50
50
|
},
|
|
@@ -282,7 +282,7 @@ const keydownHandles = (ctx, keywords, delay) => {
|
|
|
282
282
|
useEmitKeyword(keywords.value);
|
|
283
283
|
};
|
|
284
284
|
const useEmitKeyword = debounce((value) => {
|
|
285
|
-
ctx.emit("
|
|
285
|
+
ctx.emit("onSearch", value);
|
|
286
286
|
}, delay);
|
|
287
287
|
return {
|
|
288
288
|
onInputKeydown,
|
|
@@ -323,32 +323,38 @@ const inputProps = {
|
|
|
323
323
|
type: Boolean,
|
|
324
324
|
default: false
|
|
325
325
|
},
|
|
326
|
-
|
|
326
|
+
modelValue: {
|
|
327
327
|
type: String,
|
|
328
328
|
default: ""
|
|
329
329
|
},
|
|
330
|
-
"
|
|
330
|
+
"update:modelValue": {
|
|
331
331
|
type: Function,
|
|
332
332
|
default: void 0
|
|
333
333
|
},
|
|
334
|
-
|
|
334
|
+
onChange: {
|
|
335
335
|
type: Function,
|
|
336
336
|
default: void 0
|
|
337
337
|
},
|
|
338
|
-
|
|
338
|
+
onKeydown: {
|
|
339
339
|
type: Function,
|
|
340
340
|
default: void 0
|
|
341
341
|
},
|
|
342
|
-
|
|
342
|
+
onFocus: {
|
|
343
343
|
type: Function,
|
|
344
344
|
default: void 0
|
|
345
345
|
},
|
|
346
|
-
|
|
346
|
+
onBlur: {
|
|
347
347
|
type: Function,
|
|
348
348
|
default: void 0
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
var input = "";
|
|
352
|
+
const formItemInjectionKey = Symbol("dFormItem");
|
|
353
|
+
const dFormItemEvents = {
|
|
354
|
+
blur: "d.form.blur",
|
|
355
|
+
change: "d.form.change",
|
|
356
|
+
input: "d.form.input"
|
|
357
|
+
};
|
|
352
358
|
var DInput = defineComponent({
|
|
353
359
|
name: "DInput",
|
|
354
360
|
directives: {
|
|
@@ -361,8 +367,10 @@ var DInput = defineComponent({
|
|
|
361
367
|
}
|
|
362
368
|
},
|
|
363
369
|
props: inputProps,
|
|
364
|
-
emits: ["update:
|
|
370
|
+
emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
|
|
365
371
|
setup(props, ctx) {
|
|
372
|
+
const formItem = inject(formItemInjectionKey, {});
|
|
373
|
+
const hasFormItem = Object.keys(formItem).length > 0;
|
|
366
374
|
const sizeCls = computed(() => `devui-input-${props.size}`);
|
|
367
375
|
const showPwdIcon = ref(false);
|
|
368
376
|
const inputType = ref("text");
|
|
@@ -379,17 +387,20 @@ var DInput = defineComponent({
|
|
|
379
387
|
}, {
|
|
380
388
|
immediate: true
|
|
381
389
|
});
|
|
382
|
-
watch(() => props.
|
|
390
|
+
watch(() => props.modelValue, (value) => {
|
|
383
391
|
value && value.length > 0 && showPreviewIcon.value ? showPwdIcon.value = true : showPwdIcon.value = false;
|
|
384
392
|
});
|
|
385
393
|
const onInput = ($event) => {
|
|
386
|
-
ctx.emit("update:
|
|
394
|
+
ctx.emit("update:modelValue", $event.target.value);
|
|
395
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.input);
|
|
387
396
|
}, onFocus = () => {
|
|
388
397
|
ctx.emit("focus");
|
|
389
398
|
}, onBlur = () => {
|
|
390
399
|
ctx.emit("blur");
|
|
400
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.blur);
|
|
391
401
|
}, onChange = ($event) => {
|
|
392
402
|
ctx.emit("change", $event.target.value);
|
|
403
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.change);
|
|
393
404
|
}, onKeydown = ($event) => {
|
|
394
405
|
ctx.emit("keydown", $event);
|
|
395
406
|
}, onChangeInputType = () => {
|
|
@@ -410,7 +421,7 @@ var DInput = defineComponent({
|
|
|
410
421
|
},
|
|
411
422
|
render() {
|
|
412
423
|
const {
|
|
413
|
-
|
|
424
|
+
modelValue,
|
|
414
425
|
showPreviewIcon,
|
|
415
426
|
showPwdIcon,
|
|
416
427
|
inputCls,
|
|
@@ -431,7 +442,7 @@ var DInput = defineComponent({
|
|
|
431
442
|
}, [withDirectives(createVNode("input", mergeProps({
|
|
432
443
|
dinput: true
|
|
433
444
|
}, {
|
|
434
|
-
"value":
|
|
445
|
+
"value": modelValue,
|
|
435
446
|
"disabled": disabled,
|
|
436
447
|
"type": inputType,
|
|
437
448
|
"maxlength": maxLength,
|
|
@@ -460,7 +471,7 @@ var search = "";
|
|
|
460
471
|
var Search = defineComponent({
|
|
461
472
|
name: "DSearch",
|
|
462
473
|
props: searchProps,
|
|
463
|
-
emits: ["update:modelValue", "
|
|
474
|
+
emits: ["update:modelValue", "onSearch"],
|
|
464
475
|
setup(props, ctx) {
|
|
465
476
|
const rootClasses = getRootClass(props);
|
|
466
477
|
const {
|
|
@@ -488,29 +499,32 @@ var Search = defineComponent({
|
|
|
488
499
|
"onClick": onClickHandle
|
|
489
500
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
490
501
|
"name": "search",
|
|
491
|
-
"size": "inherit"
|
|
502
|
+
"size": "inherit",
|
|
503
|
+
"key": "search"
|
|
492
504
|
}, null)]), createVNode(DInput, {
|
|
493
505
|
"size": props.size,
|
|
494
506
|
"disabled": props.disabled,
|
|
495
507
|
"autoFocus": props.autoFocus,
|
|
496
|
-
"
|
|
508
|
+
"modelValue": keywords.value,
|
|
497
509
|
"maxLength": props.maxLength,
|
|
498
510
|
"placeholder": props.placeholder,
|
|
499
511
|
"cssClass": props.cssClass,
|
|
500
512
|
"onKeydown": onInputKeydown,
|
|
501
|
-
"onUpdate:
|
|
513
|
+
"onUpdate:modelValue": onInputUpdate
|
|
502
514
|
}, null), clearIconShow.value && createVNode("div", {
|
|
503
515
|
"class": "devui-search__clear",
|
|
504
516
|
"onClick": onClearHandle
|
|
505
517
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
506
518
|
"name": "close",
|
|
507
|
-
"size": "inherit"
|
|
519
|
+
"size": "inherit",
|
|
520
|
+
"key": "close"
|
|
508
521
|
}, null)]), props.iconPosition === "right" && createVNode("div", {
|
|
509
522
|
"class": "devui-search__icon",
|
|
510
523
|
"onClick": onClickHandle
|
|
511
524
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
512
525
|
"name": "search",
|
|
513
|
-
"size": "inherit"
|
|
526
|
+
"size": "inherit",
|
|
527
|
+
"key": "search"
|
|
514
528
|
}, null)])]);
|
|
515
529
|
};
|
|
516
530
|
}
|
|
@@ -521,7 +535,7 @@ Search.install = function(app) {
|
|
|
521
535
|
var index = {
|
|
522
536
|
title: "Search \u641C\u7D22\u6846",
|
|
523
537
|
category: "\u901A\u7528",
|
|
524
|
-
status: "
|
|
538
|
+
status: "100%",
|
|
525
539
|
install(app) {
|
|
526
540
|
app.use(Search);
|
|
527
541
|
}
|
package/search/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis!="undefined"?globalThis:m||self,t(m.index={},m.Vue))})(this,function(m,t){"use strict";const
|
|
1
|
+
(function(m,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis!="undefined"?globalThis:m||self,t(m.index={},m.Vue))})(this,function(m,t){"use strict";const K={size:{type:String,default:""},placeholder:{type:String,default:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57"},maxLength:{type:Number,default:Number.MAX_SAFE_INTEGER},delay:{type:Number,default:300},disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},isKeyupSearch:{type:Boolean,default:!1},iconPosition:{type:String,default:"right"},noBorder:{type:Boolean,default:!1},cssClass:{type:String,default:""},modelValue:{type:String,default:""},onSearch:{type:Function,default:void 0},"onUpdate:modelValue":{type:Function,default:void 0}},M={lg:"lg",sm:"sm"},L={right:"right",left:"left"},$=e=>t.computed(()=>({"devui-search":!0,"devui-search__disbaled":e.disabled,"devui-search__no-border":e.noBorder,[`devui-search__${e.size}`]:M[e.size],[`devui-search__${e.iconPosition}`]:L[e.iconPosition]})),A=(e,n)=>{const o=t.ref("");t.watch(()=>n.modelValue,d=>{o.value=d},{immediate:!0});const a=()=>{o.value="",e.emit("update:modelValue","")},u=t.computed(()=>o.value.length>0);return{keywords:o,clearIconShow:u,onClearHandle:a}};var H=typeof global=="object"&&global&&global.Object===Object&&global,D=H,R=typeof self=="object"&&self&&self.Object===Object&&self,W=D||R||Function("return this")(),N=W,G=N.Symbol,I=G,j=Object.prototype,U=j.hasOwnProperty,X=j.toString,S=I?I.toStringTag:void 0;function q(e){var n=U.call(e,S),o=e[S];try{e[S]=void 0;var a=!0}catch{}var u=X.call(e);return a&&(n?e[S]=o:delete e[S]),u}var Y=Object.prototype,Z=Y.toString;function J(e){return Z.call(e)}var Q="[object Null]",ee="[object Undefined]",E=I?I.toStringTag:void 0;function te(e){return e==null?e===void 0?ee:Q:E&&E in Object(e)?q(e):J(e)}function ne(e){return e!=null&&typeof e=="object"}var oe="[object Symbol]";function re(e){return typeof e=="symbol"||ne(e)&&te(e)==oe}var ae=/\s/;function ie(e){for(var n=e.length;n--&&ae.test(e.charAt(n)););return n}var le=/^\s+/;function ue(e){return e&&e.slice(0,ie(e)+1).replace(le,"")}function _(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var O=0/0,de=/^[-+]0x[0-9a-f]+$/i,se=/^0b[01]+$/i,ce=/^0o[0-7]+$/i,fe=parseInt;function P(e){if(typeof e=="number")return e;if(re(e))return O;if(_(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=_(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ue(e);var o=se.test(e);return o||ce.test(e)?fe(e.slice(2),o?2:8):de.test(e)?O:+e}var me=function(){return N.Date.now()},V=me,ye="Expected a function",he=Math.max,pe=Math.min;function ge(e,n,o){var a,u,d,i,r,s,f=0,y=!1,h=!1,g=!0;if(typeof e!="function")throw new TypeError(ye);n=P(n)||0,_(o)&&(y=!!o.leading,h="maxWait"in o,d=h?he(P(o.maxWait)||0,n):d,g="trailing"in o?!!o.trailing:g);function b(l){var p=a,w=u;return a=u=void 0,f=l,i=e.apply(w,p),i}function C(l){return f=l,r=setTimeout(T,n),y?b(l):i}function c(l){var p=l-s,w=l-f,z=n-p;return h?pe(z,d-w):z}function B(l){var p=l-s,w=l-f;return s===void 0||p>=n||p<0||h&&w>=d}function T(){var l=V();if(B(l))return x(l);r=setTimeout(T,c(l))}function x(l){return r=void 0,g&&a?b(l):(a=u=void 0,i)}function Te(){r!==void 0&&clearTimeout(r),f=0,a=s=u=r=void 0}function _e(){return r===void 0?i:x(V())}function F(){var l=V(),p=B(l);if(a=arguments,u=this,s=l,p){if(r===void 0)return C(s);if(h)return clearTimeout(r),r=setTimeout(T,n),b(s)}return r===void 0&&(r=setTimeout(T,n)),i}return F.cancel=Te,F.flush=_e,F}const be={enter:"Enter"},Se=(e,n,o)=>{const a=r=>{switch(r.key){case be.enter:u(r);break}},u=r=>{if(r.target instanceof HTMLInputElement){const s=r.target.value;i(s)}},d=()=>{i(n.value)},i=ge(r=>{e.emit("onSearch",r)},o);return{onInputKeydown:a,useEmitKeyword:i,onClickHandle:d}},ve={placeholder:{type:String,default:void 0},disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},maxLength:{type:Number,default:Number.MAX_SAFE_INTEGER},cssClass:{type:String,default:""},error:{type:Boolean,default:!1},size:{type:String,default:""},showPassword:{type:Boolean,default:!1},modelValue:{type:String,default:""},"update:modelValue":{type:Function,default:void 0},onChange:{type:Function,default:void 0},onKeydown:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onBlur:{type:Function,default:void 0}};var Ve="";const we=Symbol("dFormItem"),k={blur:"d.form.blur",change:"d.form.change",input:"d.form.input"};var Ie=t.defineComponent({name:"DInput",directives:{focus:{mounted:function(e,n){n.value&&e.focus()}}},props:ve,emits:["update:modelValue","focus","blur","change","keydown"],setup(e,n){const o=t.inject(we,{}),a=Object.keys(o).length>0,u=t.computed(()=>`devui-input-${e.size}`),d=t.ref(!1),i=t.ref("text"),r=t.computed(()=>({error:e.error,[e.cssClass]:!0,[u.value]:e.size!==""})),s=t.computed(()=>i.value==="password");return t.watch(()=>e.showPassword,c=>{i.value=c?"password":"text"},{immediate:!0}),t.watch(()=>e.modelValue,c=>{c&&c.length>0&&s.value?d.value=!0:d.value=!1}),{inputCls:r,inputType:i,showPreviewIcon:s,showPwdIcon:d,onInput:c=>{n.emit("update:modelValue",c.target.value),a&&o.formItemMitt.emit(k.input)},onFocus:()=>{n.emit("focus")},onBlur:()=>{n.emit("blur"),a&&o.formItemMitt.emit(k.blur)},onChange:c=>{n.emit("change",c.target.value),a&&o.formItemMitt.emit(k.change)},onKeydown:c=>{n.emit("keydown",c)},onChangeInputType:()=>{i.value=i.value==="password"?"text":"password"}}},render(){const{modelValue:e,showPreviewIcon:n,showPwdIcon:o,inputCls:a,inputType:u,maxLength:d,autoFocus:i,placeholder:r,disabled:s,onInput:f,onFocus:y,onBlur:h,onChange:g,onKeydown:b,onChangeInputType:C}=this;return t.createVNode("div",{class:"devui-input__wrap"},[t.withDirectives(t.createVNode("input",t.mergeProps({dinput:!0},{value:e,disabled:s,type:u,maxlength:d,placeholder:r,class:a,onInput:f,onFocus:y,onBlur:h,onChange:g,onKeydown:b}),null),[[t.resolveDirective("focus"),i]]),o&&t.createVNode("div",{class:"devui-input__preview",onClick:C},[n?t.createVNode(t.resolveComponent("d-icon"),{name:"preview",size:"12px",key:1},null):t.createVNode(t.resolveComponent("d-icon"),{name:"preview-forbidden",size:"12px",key:2},null)])])}}),ke="",v=t.defineComponent({name:"DSearch",props:K,emits:["update:modelValue","onSearch"],setup(e,n){const o=$(e),{keywords:a,clearIconShow:u,onClearHandle:d}=A(n,e),{onInputKeydown:i,onClickHandle:r,useEmitKeyword:s}=Se(n,a,e.delay),f=y=>{e.isKeyupSearch&&s(y),a.value=y,n.emit("update:modelValue",y)};return()=>t.createVNode("div",{class:o.value},[e.iconPosition==="left"&&t.createVNode("div",{class:"devui-search__icon",onClick:r},[t.createVNode(t.resolveComponent("d-icon"),{name:"search",size:"inherit",key:"search"},null)]),t.createVNode(Ie,{size:e.size,disabled:e.disabled,autoFocus:e.autoFocus,modelValue:a.value,maxLength:e.maxLength,placeholder:e.placeholder,cssClass:e.cssClass,onKeydown:i,"onUpdate:modelValue":f},null),u.value&&t.createVNode("div",{class:"devui-search__clear",onClick:d},[t.createVNode(t.resolveComponent("d-icon"),{name:"close",size:"inherit",key:"close"},null)]),e.iconPosition==="right"&&t.createVNode("div",{class:"devui-search__icon",onClick:r},[t.createVNode(t.resolveComponent("d-icon"),{name:"search",size:"inherit",key:"search"},null)])])}});v.install=function(e){e.component(v.name,v)};var Ce={title:"Search \u641C\u7D22\u6846",category:"\u901A\u7528",status:"100%",install(e){e.use(v)}};m.Search=v,m.default=Ce,Object.defineProperty(m,"__esModule",{value:!0}),m[Symbol.toStringTag]="Module"});
|
package/select/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, createVNode,
|
|
20
|
+
import { defineComponent, createVNode, inject, computed, mergeProps, toRef, provide, onMounted, onBeforeUnmount, ref, Transition, withDirectives, vShow } from "vue";
|
|
21
21
|
const selectProps = {
|
|
22
22
|
modelValue: {
|
|
23
23
|
type: [String, Number, Array],
|
|
@@ -98,11 +98,12 @@ var Icon = defineComponent({
|
|
|
98
98
|
color,
|
|
99
99
|
classPrefix
|
|
100
100
|
} = this;
|
|
101
|
-
return
|
|
101
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
102
102
|
"src": name,
|
|
103
103
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
104
104
|
"style": {
|
|
105
|
-
width: size
|
|
105
|
+
width: size,
|
|
106
|
+
verticalAlign: "text-bottom"
|
|
106
107
|
}
|
|
107
108
|
}, null) : createVNode("i", {
|
|
108
109
|
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
@@ -110,7 +111,7 @@ var Icon = defineComponent({
|
|
|
110
111
|
fontSize: size,
|
|
111
112
|
color
|
|
112
113
|
}
|
|
113
|
-
}, null)
|
|
114
|
+
}, null);
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
117
|
Icon.install = function(app) {
|
|
@@ -122,10 +123,17 @@ const commonProps = {
|
|
|
122
123
|
type: String,
|
|
123
124
|
default: void 0
|
|
124
125
|
},
|
|
126
|
+
halfchecked: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false
|
|
129
|
+
},
|
|
125
130
|
isShowTitle: {
|
|
126
131
|
type: Boolean,
|
|
127
132
|
default: true
|
|
128
133
|
},
|
|
134
|
+
title: {
|
|
135
|
+
type: String
|
|
136
|
+
},
|
|
129
137
|
color: {
|
|
130
138
|
type: String,
|
|
131
139
|
default: void 0
|
|
@@ -221,15 +229,15 @@ var Checkbox = defineComponent({
|
|
|
221
229
|
});
|
|
222
230
|
const mergedIsShowTitle = computed(() => {
|
|
223
231
|
var _a;
|
|
224
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle) != null ? _a : props.isShowTitle;
|
|
232
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
|
|
225
233
|
});
|
|
226
234
|
const mergedShowAnimation = computed(() => {
|
|
227
235
|
var _a;
|
|
228
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation) != null ? _a : props.showAnimation;
|
|
236
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
|
|
229
237
|
});
|
|
230
238
|
const mergedColor = computed(() => {
|
|
231
239
|
var _a;
|
|
232
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color) != null ? _a : props.color;
|
|
240
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
|
|
233
241
|
});
|
|
234
242
|
const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
|
|
235
243
|
const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
|
|
@@ -256,7 +264,7 @@ var Checkbox = defineComponent({
|
|
|
256
264
|
ctx.emit("change", current);
|
|
257
265
|
};
|
|
258
266
|
const handleClick = () => {
|
|
259
|
-
canChange(!isChecked.value, props.
|
|
267
|
+
canChange(!isChecked.value, props.label).then((res) => res && toggle());
|
|
260
268
|
};
|
|
261
269
|
return {
|
|
262
270
|
itemWidth,
|
|
@@ -371,8 +379,20 @@ var CheckboxGroup = defineComponent({
|
|
|
371
379
|
disabled: false
|
|
372
380
|
};
|
|
373
381
|
const toggleGroupVal = (val) => {
|
|
374
|
-
|
|
382
|
+
let index2 = -1;
|
|
383
|
+
if (typeof valList.value[0] === "string") {
|
|
384
|
+
index2 = valList.value.findIndex((item) => item === val);
|
|
385
|
+
} else if (typeof valList.value[0] === "object") {
|
|
386
|
+
index2 = valList.value.findIndex((item) => item.value === val);
|
|
387
|
+
}
|
|
375
388
|
if (index2 === -1) {
|
|
389
|
+
if (typeof props.options[0] === "object") {
|
|
390
|
+
const newOne = props.options.find((item) => item.value === val);
|
|
391
|
+
const res2 = [...valList.value, newOne];
|
|
392
|
+
ctx.emit("update:modelValue", res2);
|
|
393
|
+
ctx.emit("change", res2);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
376
396
|
const res = [...valList.value, val];
|
|
377
397
|
ctx.emit("update:modelValue", res);
|
|
378
398
|
ctx.emit("change", res);
|
|
@@ -382,7 +402,13 @@ var CheckboxGroup = defineComponent({
|
|
|
382
402
|
ctx.emit("update:modelValue", valList.value);
|
|
383
403
|
ctx.emit("change", valList.value);
|
|
384
404
|
};
|
|
385
|
-
const isItemChecked = (itemVal) =>
|
|
405
|
+
const isItemChecked = (itemVal) => {
|
|
406
|
+
if (typeof valList.value[0] === "string") {
|
|
407
|
+
return valList.value.includes(itemVal);
|
|
408
|
+
} else if (typeof valList.value[0] === "object") {
|
|
409
|
+
return valList.value.some((item) => item.value === itemVal);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
386
412
|
provide(checkboxGroupInjectionKey, {
|
|
387
413
|
disabled: toRef(props, "disabled"),
|
|
388
414
|
isShowTitle: toRef(props, "isShowTitle"),
|
|
@@ -409,7 +435,17 @@ var CheckboxGroup = defineComponent({
|
|
|
409
435
|
let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
|
|
410
436
|
if ((options == null ? void 0 : options.length) > 0) {
|
|
411
437
|
children = options.map((opt) => {
|
|
412
|
-
|
|
438
|
+
let mergedOpt = null;
|
|
439
|
+
if (typeof opt === "string") {
|
|
440
|
+
mergedOpt = Object.assign({}, defaultOpt, {
|
|
441
|
+
label: opt,
|
|
442
|
+
value: opt
|
|
443
|
+
});
|
|
444
|
+
} else if (typeof opt === "object") {
|
|
445
|
+
mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
|
|
446
|
+
label: opt.name
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
413
449
|
return createVNode(Checkbox, mergedOpt, null);
|
|
414
450
|
});
|
|
415
451
|
}
|
package/select/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var q=Object.defineProperty,L=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var _=(u,e,y)=>e in u?q(u,e,{enumerable:!0,configurable:!0,writable:!0,value:y}):u[e]=y,N=(u,e)=>{for(var y in e||(e={}))J.call(e,y)&&_(u,y,e[y]);if(I)for(var y of I(e))Q.call(e,y)&&_(u,y,e[y]);return u},D=(u,e)=>L(u,H(e));(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";const y={modelValue:{type:[String,Number,Array],default:""},"onUpdate:modelValue":{type:Function,default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"md"},overview:{type:String,default:"border"},placeholder:{type:String,default:"\u8BF7\u9009\u62E9"},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},optionDisabledKey:{type:String,default:""},onToggleChange:{type:Function,default:void 0},onValueChange:{type:Function,default:void 0}};var w=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return N({},t)},render(){const{name:t,size:n,color:l,classPrefix:a}=this;return e.createVNode(e.Fragment,null,[/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:n}},null):e.createVNode("i",{class:`${a} ${a}-${t}`,style:{fontSize:n,color:l}},null)])}});w.install=function(t){t.component(w.name,w)};var X="";const T={name:{type:String,default:void 0},isShowTitle:{type:Boolean,default:!0},color:{type:String,default:void 0},showAnimation:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},beforeChange:{type:Function,default:void 0}},j=D(N({},T),{halfchecked:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},value:{type:String},label:{type:String,default:void 0},title:{type:String,default:void 0},"onUpdate:checked":{type:Function,default:void 0},onChange:{type:Function,default:void 0},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}}),K=D(N({},T),{modelValue:{type:Array,required:!0},direction:{type:String,default:"column"},itemWidth:{type:Number,default:void 0},options:{type:Array,default:()=>[]},onChange:{type:Function,default:void 0},"onUpdate:modelValue":{type:Function,default:void 0}}),B=Symbol("d-checkbox-group");var C=e.defineComponent({name:"DCheckbox",props:j,emits:["change","update:checked","update:modelValue"],setup(t,n){const l=e.inject(B,null),a=e.computed(()=>t.checked||t.modelValue),d=e.computed(()=>(l==null?void 0:l.disabled.value)||t.disabled),s=e.computed(()=>{var o,r;return(r=(o=l==null?void 0:l.isItemChecked)==null?void 0:o.call(l,t.value))!=null?r:a.value}),c=e.computed(()=>{var o;return(o=l==null?void 0:l.isShowTitle)!=null?o:t.isShowTitle}),f=e.computed(()=>{var o;return(o=l==null?void 0:l.showAnimation)!=null?o:t.showAnimation}),m=e.computed(()=>{var o;return(o=l==null?void 0:l.color)!=null?o:t.color}),b=l==null?void 0:l.itemWidth.value,V=l==null?void 0:l.direction.value,k=(o,r)=>{var g;if(d.value)return Promise.resolve(!1);const p=(g=t.beforeChange)!=null?g:l==null?void 0:l.beforeChange;if(p){const v=p(o,r);return typeof v=="boolean"?Promise.resolve(v):v}return Promise.resolve(!0)},h=()=>{const o=!a.value;l==null||l.toggleGroupVal(t.value),n.emit("update:checked",o),n.emit("update:modelValue",o),n.emit("change",o)};return{itemWidth:b,direction:V,mergedColor:m,mergedDisabled:d,mergedIsShowTitle:c,mergedChecked:s,mergedShowAnimation:f,handleClick:()=>{k(!a.value,t.value).then(o=>o&&h())}}},render(){var R;const{itemWidth:t,direction:n,mergedChecked:l,mergedDisabled:a,mergedIsShowTitle:d,mergedShowAnimation:s,halfchecked:c,title:f,label:m,handleClick:b,name:V,value:k,mergedColor:h,$slots:i}=this,o={"devui-checkbox-column-margin":n==="column","devui-checkbox-wrap":typeof t!="undefined"},r=t?[`width: ${t}px`]:[],p={"devui-checkbox":!0,active:l,halfchecked:c,disabled:a,unchecked:!l},g=d?f||m:"",v=h&&c||h?`linear-gradient(${h}, ${h})`:"",P=[`border-color:${(l||c)&&h?h:""}`,`background-image:${v}`,`background-color:${h&&c?h:""}`],W={"devui-checkbox-material":!0,"custom-color":h,"devui-checkbox-no-label":!m&&!i.default,"devui-no-animation":!s,"devui-checkbox-default-background":!c},M={"devui-tick":!0,"devui-no-animation":!s},F=x=>x.stopPropagation(),U={indeterminate:c};return e.createVNode("div",{class:o,style:r},[e.createVNode("div",{class:p},[e.createVNode("label",{title:g,onClick:b},[e.createVNode("input",e.mergeProps({name:V||k,class:"devui-checkbox-input",type:"checkbox"},U,{checked:l,disabled:a,onClick:F,onChange:F}),null),e.createVNode("span",{style:P,class:W},[e.createVNode("span",{class:"devui-checkbox-halfchecked-bg"},null),e.createVNode("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",class:"devui-checkbox-tick"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{"fill-rule":"nonzero",points:"5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",class:M},null)])])]),m||((R=i.default)==null?void 0:R.call(i))])])])}}),Y="",O=e.defineComponent({name:"DCheckboxGroup",props:K,emits:["change","update:modelValue"],setup(t,n){const l=e.toRef(t,"modelValue"),a={checked:!1,isShowTitle:!0,halfchecked:!1,showAnimation:!0,disabled:!1},d=c=>{const f=l.value.findIndex(m=>m===c);if(f===-1){const m=[...l.value,c];n.emit("update:modelValue",m),n.emit("change",m);return}l.value.splice(f,1),n.emit("update:modelValue",l.value),n.emit("change",l.value)},s=c=>l.value.includes(c);return e.provide(B,{disabled:e.toRef(t,"disabled"),isShowTitle:e.toRef(t,"isShowTitle"),color:e.toRef(t,"color"),showAnimation:e.toRef(t,"showAnimation"),beforeChange:t.beforeChange,isItemChecked:s,toggleGroupVal:d,itemWidth:e.toRef(t,"itemWidth"),direction:e.toRef(t,"direction")}),{defaultOpt:a}},render(){var s;const{direction:t,$slots:n,defaultOpt:l,options:a}=this;let d=(s=n.default)==null?void 0:s.call(n);return(a==null?void 0:a.length)>0&&(d=a.map(c=>{const f=Object.assign({},l,c);return e.createVNode(C,f,null)})),e.createVNode("div",{class:"devui-checkbox-group"},[e.createVNode("div",{class:{"devui-checkbox-list-inline":t==="row"}},[d])])}});C.install=function(t){t.component(C.name,C)},O.install=function(t){t.component(O.name,O)};function A(t,n){let l=t;return typeof n=="object"&&Object.keys(n).forEach(a=>{n[a]&&(l+=` ${a}`)}),l}function $(t){const n=e.computed(()=>{const a=new Map;return t.value.forEach(d=>{a.set(d.value,d)}),a});return a=>a.map(d=>n.value.get(d))}function E(t,n,l){function a(d){var f,m;let s=d.target;s.shadowRoot&&d.composed&&(s=d.composedPath()[0]||s);const c=[(f=t[0])==null?void 0:f.value,(m=t[1])==null?void 0:m.value];n.value&&c.every(b=>b&&!b.contains(s)&&b!==s)&&l(!1)}e.onMounted(()=>{document.body.addEventListener("mousedown",a,!1)}),e.onBeforeUnmount(()=>{document.body.addEventListener("mousedown",a,!1)})}var Z="",S=e.defineComponent({name:"DSelect",props:y,emits:["toggleChange","valueChange","update:modelValue"],setup(t,n){const l=e.ref(null),a=e.ref(null),d=e.ref(!1);function s(i){t.disabled||(d.value=i,n.emit("toggleChange",i))}E([l,a],d,s);const c=e.computed(()=>{const{multiple:i,modelValue:o}=t;return t.options.map(r=>{let p;return typeof r=="object"?p=N({name:r.name?r.name:r.value+"",value:r.value,_checked:!1},r):p={name:r+"",value:r,_checked:!1},i&&(Array.isArray(o)?p._checked=o.includes(p.value):p._checked=!1),p})}),f=$(c),m=e.computed(()=>{var i;return t.multiple&&Array.isArray(t.modelValue)?f(t.modelValue).map(r=>r.name).join(","):Array.isArray(t.modelValue)?"":((i=f([t.modelValue])[0])==null?void 0:i.name)||""}),b=e.computed(()=>!t.disabled&&t.allowClear&&m.value.length>0);function V(i,o){const{multiple:r,optionDisabledKey:p}=t;let{modelValue:g}=t;p&&!!i[p]||(r?(i._checked=!i._checked,g=c.value.filter(v=>v._checked).map(v=>v.value),n.emit("update:modelValue",g)):(n.emit("update:modelValue",i.value),s(!1)),n.emit("valueChange",i,o))}function k(i){const{optionDisabledKey:o}=t;return A("devui-select-item",{active:i.value===t.modelValue,disabled:o?!!i[o]:!1})}function h(i){i.preventDefault(),i.stopPropagation(),t.multiple?n.emit("update:modelValue",[]):n.emit("update:modelValue","")}return{isOpen:d,containerRef:l,dropdownRef:a,inputValue:m,mergeOptions:c,mergeClearable:b,valueChange:V,toggleChange:s,getItemClassName:k,handleClear:h}},render(){const{mergeOptions:t,isOpen:n,inputValue:l,size:a,multiple:d,disabled:s,optionDisabledKey:c,placeholder:f,overview:m,valueChange:b,toggleChange:V,getItemClassName:k,mergeClearable:h,handleClear:i}=this,o=A("devui-select",{"devui-select-open":n,"devui-dropdown-menu-multiple":d,"devui-select-lg":a==="lg","devui-select-sm":a==="sm","devui-select-underlined":m==="underlined","devui-select-disabled":s}),r=A("devui-select-input",{"devui-select-input-lg":a==="lg","devui-select-input-sm":a==="sm"}),p=A("devui-select-selection",{"devui-select-clearable":h});return e.createVNode("div",{class:o,ref:"containerRef"},[e.createVNode("div",{class:p,onClick:()=>V(!n)},[e.createVNode("input",{value:l,type:"text",class:r,placeholder:f,readonly:!0,disabled:s},null),e.createVNode("span",{onClick:i,class:"devui-select-clear"},[e.createVNode(w,{name:"close"},null)]),e.createVNode("span",{class:"devui-select-arrow"},[e.createVNode(w,{name:"select-arrow"},null)])]),e.createVNode(e.Transition,{name:"fade",ref:"dropdownRef"},{default:()=>[e.withDirectives(e.createVNode("div",{class:"devui-select-dropdown"},[e.createVNode("ul",{class:"devui-select-dropdown-list devui-scrollbar"},[t.map((g,v)=>e.createVNode("li",{onClick:P=>{P.preventDefault(),P.stopPropagation(),b(g,v)},class:k(g),key:v},[d?e.createVNode(C,{modelValue:g._checked,label:g.name,disabled:c?!!g[c]:!1},null):g.name]))])]),[[e.vShow,n]])]})])}});S.install=function(t){t.component(S.name,S)};var z={title:"Select \u4E0B\u62C9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"10%",install(t){t.use(S)}};u.Select=S,u.default=z,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|
|
1
|
+
var q=Object.defineProperty,L=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var F=(f,e,v)=>e in f?q(f,e,{enumerable:!0,configurable:!0,writable:!0,value:v}):f[e]=v,w=(f,e)=>{for(var v in e||(e={}))J.call(e,v)&&F(f,v,e[v]);if(R)for(var v of R(e))Q.call(e,v)&&F(f,v,e[v]);return f},P=(f,e)=>L(f,H(e));(function(f,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis!="undefined"?globalThis:f||self,e(f.index={},f.Vue))})(this,function(f,e){"use strict";const v={modelValue:{type:[String,Number,Array],default:""},"onUpdate:modelValue":{type:Function,default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"md"},overview:{type:String,default:"border"},placeholder:{type:String,default:"\u8BF7\u9009\u62E9"},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},optionDisabledKey:{type:String,default:""},onToggleChange:{type:Function,default:void 0},onValueChange:{type:Function,default:void 0}};var C=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return w({},t)},render(){const{name:t,size:n,color:l,classPrefix:a}=this;return/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:n,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${a} ${a}-${t}`,style:{fontSize:n,color:l}},null)}});C.install=function(t){t.component(C.name,C)};var X="";const B={name:{type:String,default:void 0},halfchecked:{type:Boolean,default:!1},isShowTitle:{type:Boolean,default:!0},title:{type:String},color:{type:String,default:void 0},showAnimation:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},beforeChange:{type:Function,default:void 0}},_=P(w({},B),{halfchecked:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},value:{type:String},label:{type:String,default:void 0},title:{type:String,default:void 0},"onUpdate:checked":{type:Function,default:void 0},onChange:{type:Function,default:void 0},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}}),K=P(w({},B),{modelValue:{type:Array,required:!0},direction:{type:String,default:"column"},itemWidth:{type:Number,default:void 0},options:{type:Array,default:()=>[]},onChange:{type:Function,default:void 0},"onUpdate:modelValue":{type:Function,default:void 0}}),D=Symbol("d-checkbox-group");var S=e.defineComponent({name:"DCheckbox",props:_,emits:["change","update:checked","update:modelValue"],setup(t,n){const l=e.inject(D,null),a=e.computed(()=>t.checked||t.modelValue),c=e.computed(()=>(l==null?void 0:l.disabled.value)||t.disabled),s=e.computed(()=>{var i,r;return(r=(i=l==null?void 0:l.isItemChecked)==null?void 0:i.call(l,t.value))!=null?r:a.value}),o=e.computed(()=>{var i;return(i=l==null?void 0:l.isShowTitle.value)!=null?i:t.isShowTitle}),u=e.computed(()=>{var i;return(i=l==null?void 0:l.showAnimation.value)!=null?i:t.showAnimation}),m=e.computed(()=>{var i;return(i=l==null?void 0:l.color.value)!=null?i:t.color}),y=l==null?void 0:l.itemWidth.value,V=l==null?void 0:l.direction.value,k=(i,r)=>{var h;if(c.value)return Promise.resolve(!1);const g=(h=t.beforeChange)!=null?h:l==null?void 0:l.beforeChange;if(g){const b=g(i,r);return typeof b=="boolean"?Promise.resolve(b):b}return Promise.resolve(!0)},p=()=>{const i=!a.value;l==null||l.toggleGroupVal(t.value),n.emit("update:checked",i),n.emit("update:modelValue",i),n.emit("change",i)};return{itemWidth:y,direction:V,mergedColor:m,mergedDisabled:c,mergedIsShowTitle:o,mergedChecked:s,mergedShowAnimation:u,handleClick:()=>{k(!a.value,t.label).then(i=>i&&p())}}},render(){var I;const{itemWidth:t,direction:n,mergedChecked:l,mergedDisabled:a,mergedIsShowTitle:c,mergedShowAnimation:s,halfchecked:o,title:u,label:m,handleClick:y,name:V,value:k,mergedColor:p,$slots:d}=this,i={"devui-checkbox-column-margin":n==="column","devui-checkbox-wrap":typeof t!="undefined"},r=t?[`width: ${t}px`]:[],g={"devui-checkbox":!0,active:l,halfchecked:o,disabled:a,unchecked:!l},h=c?u||m:"",b=p&&o||p?`linear-gradient(${p}, ${p})`:"",O=[`border-color:${(l||o)&&p?p:""}`,`background-image:${b}`,`background-color:${p&&o?p:""}`],W={"devui-checkbox-material":!0,"custom-color":p,"devui-checkbox-no-label":!m&&!d.default,"devui-no-animation":!s,"devui-checkbox-default-background":!o},M={"devui-tick":!0,"devui-no-animation":!s},T=x=>x.stopPropagation(),U={indeterminate:o};return e.createVNode("div",{class:i,style:r},[e.createVNode("div",{class:g},[e.createVNode("label",{title:h,onClick:y},[e.createVNode("input",e.mergeProps({name:V||k,class:"devui-checkbox-input",type:"checkbox"},U,{checked:l,disabled:a,onClick:T,onChange:T}),null),e.createVNode("span",{style:O,class:W},[e.createVNode("span",{class:"devui-checkbox-halfchecked-bg"},null),e.createVNode("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",class:"devui-checkbox-tick"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{"fill-rule":"nonzero",points:"5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",class:M},null)])])]),m||((I=d.default)==null?void 0:I.call(d))])])])}}),Y="",j=e.defineComponent({name:"DCheckboxGroup",props:K,emits:["change","update:modelValue"],setup(t,n){const l=e.toRef(t,"modelValue"),a={checked:!1,isShowTitle:!0,halfchecked:!1,showAnimation:!0,disabled:!1},c=o=>{let u=-1;if(typeof l.value[0]=="string"?u=l.value.findIndex(m=>m===o):typeof l.value[0]=="object"&&(u=l.value.findIndex(m=>m.value===o)),u===-1){if(typeof t.options[0]=="object"){const y=t.options.find(k=>k.value===o),V=[...l.value,y];n.emit("update:modelValue",V),n.emit("change",V);return}const m=[...l.value,o];n.emit("update:modelValue",m),n.emit("change",m);return}l.value.splice(u,1),n.emit("update:modelValue",l.value),n.emit("change",l.value)},s=o=>{if(typeof l.value[0]=="string")return l.value.includes(o);if(typeof l.value[0]=="object")return l.value.some(u=>u.value===o)};return e.provide(D,{disabled:e.toRef(t,"disabled"),isShowTitle:e.toRef(t,"isShowTitle"),color:e.toRef(t,"color"),showAnimation:e.toRef(t,"showAnimation"),beforeChange:t.beforeChange,isItemChecked:s,toggleGroupVal:c,itemWidth:e.toRef(t,"itemWidth"),direction:e.toRef(t,"direction")}),{defaultOpt:a}},render(){var s;const{direction:t,$slots:n,defaultOpt:l,options:a}=this;let c=(s=n.default)==null?void 0:s.call(n);return(a==null?void 0:a.length)>0&&(c=a.map(o=>{let u=null;return typeof o=="string"?u=Object.assign({},l,{label:o,value:o}):typeof o=="object"&&(u=Object.assign({},l,P(w({},o),{label:o.name}))),e.createVNode(S,u,null)})),e.createVNode("div",{class:"devui-checkbox-group"},[e.createVNode("div",{class:{"devui-checkbox-list-inline":t==="row"}},[c])])}});S.install=function(t){t.component(S.name,S)},j.install=function(t){t.component(j.name,j)};function A(t,n){let l=t;return typeof n=="object"&&Object.keys(n).forEach(a=>{n[a]&&(l+=` ${a}`)}),l}function $(t){const n=e.computed(()=>{const a=new Map;return t.value.forEach(c=>{a.set(c.value,c)}),a});return a=>a.map(c=>n.value.get(c))}function E(t,n,l){function a(c){var u,m;let s=c.target;s.shadowRoot&&c.composed&&(s=c.composedPath()[0]||s);const o=[(u=t[0])==null?void 0:u.value,(m=t[1])==null?void 0:m.value];n.value&&o.every(y=>y&&!y.contains(s)&&y!==s)&&l(!1)}e.onMounted(()=>{document.body.addEventListener("mousedown",a,!1)}),e.onBeforeUnmount(()=>{document.body.addEventListener("mousedown",a,!1)})}var Z="",N=e.defineComponent({name:"DSelect",props:v,emits:["toggleChange","valueChange","update:modelValue"],setup(t,n){const l=e.ref(null),a=e.ref(null),c=e.ref(!1);function s(d){t.disabled||(c.value=d,n.emit("toggleChange",d))}E([l,a],c,s);const o=e.computed(()=>{const{multiple:d,modelValue:i}=t;return t.options.map(r=>{let g;return typeof r=="object"?g=w({name:r.name?r.name:r.value+"",value:r.value,_checked:!1},r):g={name:r+"",value:r,_checked:!1},d&&(Array.isArray(i)?g._checked=i.includes(g.value):g._checked=!1),g})}),u=$(o),m=e.computed(()=>{var d;return t.multiple&&Array.isArray(t.modelValue)?u(t.modelValue).map(r=>r.name).join(","):Array.isArray(t.modelValue)?"":((d=u([t.modelValue])[0])==null?void 0:d.name)||""}),y=e.computed(()=>!t.disabled&&t.allowClear&&m.value.length>0);function V(d,i){const{multiple:r,optionDisabledKey:g}=t;let{modelValue:h}=t;g&&!!d[g]||(r?(d._checked=!d._checked,h=o.value.filter(b=>b._checked).map(b=>b.value),n.emit("update:modelValue",h)):(n.emit("update:modelValue",d.value),s(!1)),n.emit("valueChange",d,i))}function k(d){const{optionDisabledKey:i}=t;return A("devui-select-item",{active:d.value===t.modelValue,disabled:i?!!d[i]:!1})}function p(d){d.preventDefault(),d.stopPropagation(),t.multiple?n.emit("update:modelValue",[]):n.emit("update:modelValue","")}return{isOpen:c,containerRef:l,dropdownRef:a,inputValue:m,mergeOptions:o,mergeClearable:y,valueChange:V,toggleChange:s,getItemClassName:k,handleClear:p}},render(){const{mergeOptions:t,isOpen:n,inputValue:l,size:a,multiple:c,disabled:s,optionDisabledKey:o,placeholder:u,overview:m,valueChange:y,toggleChange:V,getItemClassName:k,mergeClearable:p,handleClear:d}=this,i=A("devui-select",{"devui-select-open":n,"devui-dropdown-menu-multiple":c,"devui-select-lg":a==="lg","devui-select-sm":a==="sm","devui-select-underlined":m==="underlined","devui-select-disabled":s}),r=A("devui-select-input",{"devui-select-input-lg":a==="lg","devui-select-input-sm":a==="sm"}),g=A("devui-select-selection",{"devui-select-clearable":p});return e.createVNode("div",{class:i,ref:"containerRef"},[e.createVNode("div",{class:g,onClick:()=>V(!n)},[e.createVNode("input",{value:l,type:"text",class:r,placeholder:u,readonly:!0,disabled:s},null),e.createVNode("span",{onClick:d,class:"devui-select-clear"},[e.createVNode(C,{name:"close"},null)]),e.createVNode("span",{class:"devui-select-arrow"},[e.createVNode(C,{name:"select-arrow"},null)])]),e.createVNode(e.Transition,{name:"fade",ref:"dropdownRef"},{default:()=>[e.withDirectives(e.createVNode("div",{class:"devui-select-dropdown"},[e.createVNode("ul",{class:"devui-select-dropdown-list devui-scrollbar"},[t.map((h,b)=>e.createVNode("li",{onClick:O=>{O.preventDefault(),O.stopPropagation(),y(h,b)},class:k(h),key:b},[c?e.createVNode(S,{modelValue:h._checked,label:h.name,disabled:o?!!h[o]:!1},null):h.name]))])]),[[e.vShow,n]])]})])}});N.install=function(t){t.component(N.name,N)};var z={title:"Select \u4E0B\u62C9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"10%",install(t){t.use(N)}};f.Select=N,f.default=z,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
|