vue-devui 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -200
- package/auto-complete/index.es.js +55 -77
- package/auto-complete/index.umd.js +3 -1
- package/auto-complete/style.css +1 -1
- package/editable-select/index.es.js +118 -162
- package/editable-select/index.umd.js +1 -1
- package/nuxt/components/tagProps.js +3 -0
- package/package.json +1 -1
- package/popover/index.es.js +2 -2
- package/popover/index.umd.js +4 -4
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/slider/index.es.js +58 -58
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +168 -125
- package/splitter/index.umd.js +11 -11
- package/style.css +1 -1
- package/tag/index.es.js +13 -17
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/vue-devui.es.js +765 -605
- package/vue-devui.umd.js +18 -16
- package/accordion/index.d.ts +0 -7
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/package.json +0 -7
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8196
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -693
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7876
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -229
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/Select.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/Table.js +0 -3
- package/nuxt/components/Tabs.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/table/index.d.ts +0 -7
- package/table/index.es.js +0 -2024
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1238
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5835
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree/index.d.ts +0 -7
- package/tree/index.es.js +0 -6495
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/select/index.es.js
DELETED
|
@@ -1,706 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, toRefs, createVNode, inject, computed, mergeProps, toRef, provide, onMounted, onBeforeUnmount, ref, Transition, withDirectives, vShow } from "vue";
|
|
21
|
-
const selectProps = {
|
|
22
|
-
modelValue: {
|
|
23
|
-
type: [String, Number, Array],
|
|
24
|
-
default: ""
|
|
25
|
-
},
|
|
26
|
-
"onUpdate:modelValue": {
|
|
27
|
-
type: Function,
|
|
28
|
-
default: void 0
|
|
29
|
-
},
|
|
30
|
-
options: {
|
|
31
|
-
type: Array,
|
|
32
|
-
default: () => []
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: "md"
|
|
37
|
-
},
|
|
38
|
-
overview: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "border"
|
|
41
|
-
},
|
|
42
|
-
placeholder: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "\u8BF7\u9009\u62E9"
|
|
45
|
-
},
|
|
46
|
-
multiple: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false
|
|
53
|
-
},
|
|
54
|
-
allowClear: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false
|
|
57
|
-
},
|
|
58
|
-
optionDisabledKey: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: ""
|
|
61
|
-
},
|
|
62
|
-
onToggleChange: {
|
|
63
|
-
type: Function,
|
|
64
|
-
default: void 0
|
|
65
|
-
},
|
|
66
|
-
onValueChange: {
|
|
67
|
-
type: Function,
|
|
68
|
-
default: void 0
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const iconProps = {
|
|
72
|
-
name: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: "",
|
|
75
|
-
required: true
|
|
76
|
-
},
|
|
77
|
-
size: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: "inherit"
|
|
80
|
-
},
|
|
81
|
-
color: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: "inherit"
|
|
84
|
-
},
|
|
85
|
-
classPrefix: {
|
|
86
|
-
type: String,
|
|
87
|
-
default: "icon"
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var Icon = defineComponent({
|
|
91
|
-
name: "DIcon",
|
|
92
|
-
props: iconProps,
|
|
93
|
-
setup(props) {
|
|
94
|
-
const {
|
|
95
|
-
name,
|
|
96
|
-
size,
|
|
97
|
-
color,
|
|
98
|
-
classPrefix
|
|
99
|
-
} = toRefs(props);
|
|
100
|
-
return () => {
|
|
101
|
-
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
102
|
-
"src": name.value,
|
|
103
|
-
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
104
|
-
"style": {
|
|
105
|
-
width: size.value,
|
|
106
|
-
verticalAlign: "text-bottom"
|
|
107
|
-
}
|
|
108
|
-
}, null) : createVNode("i", {
|
|
109
|
-
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
110
|
-
"style": {
|
|
111
|
-
fontSize: size.value,
|
|
112
|
-
color: color.value
|
|
113
|
-
}
|
|
114
|
-
}, null);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
var checkbox = "";
|
|
119
|
-
const commonProps = {
|
|
120
|
-
name: {
|
|
121
|
-
type: String,
|
|
122
|
-
default: void 0
|
|
123
|
-
},
|
|
124
|
-
halfchecked: {
|
|
125
|
-
type: Boolean,
|
|
126
|
-
default: false
|
|
127
|
-
},
|
|
128
|
-
isShowTitle: {
|
|
129
|
-
type: Boolean,
|
|
130
|
-
default: true
|
|
131
|
-
},
|
|
132
|
-
title: {
|
|
133
|
-
type: String
|
|
134
|
-
},
|
|
135
|
-
color: {
|
|
136
|
-
type: String,
|
|
137
|
-
default: void 0
|
|
138
|
-
},
|
|
139
|
-
showAnimation: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: true
|
|
142
|
-
},
|
|
143
|
-
disabled: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false
|
|
146
|
-
},
|
|
147
|
-
beforeChange: {
|
|
148
|
-
type: Function,
|
|
149
|
-
default: void 0
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
153
|
-
halfchecked: {
|
|
154
|
-
type: Boolean,
|
|
155
|
-
default: false
|
|
156
|
-
},
|
|
157
|
-
checked: {
|
|
158
|
-
type: Boolean,
|
|
159
|
-
default: false
|
|
160
|
-
},
|
|
161
|
-
value: {
|
|
162
|
-
type: String
|
|
163
|
-
},
|
|
164
|
-
label: {
|
|
165
|
-
type: String,
|
|
166
|
-
default: void 0
|
|
167
|
-
},
|
|
168
|
-
title: {
|
|
169
|
-
type: String,
|
|
170
|
-
default: void 0
|
|
171
|
-
},
|
|
172
|
-
"onUpdate:checked": {
|
|
173
|
-
type: Function,
|
|
174
|
-
default: void 0
|
|
175
|
-
},
|
|
176
|
-
onChange: {
|
|
177
|
-
type: Function,
|
|
178
|
-
default: void 0
|
|
179
|
-
},
|
|
180
|
-
modelValue: {
|
|
181
|
-
type: Boolean
|
|
182
|
-
},
|
|
183
|
-
"onUpdate:modelValue": {
|
|
184
|
-
type: Function
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
188
|
-
modelValue: {
|
|
189
|
-
type: Array,
|
|
190
|
-
required: true
|
|
191
|
-
},
|
|
192
|
-
direction: {
|
|
193
|
-
type: String,
|
|
194
|
-
default: "column"
|
|
195
|
-
},
|
|
196
|
-
itemWidth: {
|
|
197
|
-
type: Number,
|
|
198
|
-
default: void 0
|
|
199
|
-
},
|
|
200
|
-
options: {
|
|
201
|
-
type: Array,
|
|
202
|
-
default: () => []
|
|
203
|
-
},
|
|
204
|
-
onChange: {
|
|
205
|
-
type: Function,
|
|
206
|
-
default: void 0
|
|
207
|
-
},
|
|
208
|
-
"onUpdate:modelValue": {
|
|
209
|
-
type: Function,
|
|
210
|
-
default: void 0
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
|
|
214
|
-
var Checkbox = defineComponent({
|
|
215
|
-
name: "DCheckbox",
|
|
216
|
-
props: checkboxProps,
|
|
217
|
-
emits: ["change", "update:checked", "update:modelValue"],
|
|
218
|
-
setup(props, ctx) {
|
|
219
|
-
const checkboxGroupConf = inject(checkboxGroupInjectionKey, null);
|
|
220
|
-
const isChecked = computed(() => props.checked || props.modelValue);
|
|
221
|
-
const mergedDisabled = computed(() => {
|
|
222
|
-
return (checkboxGroupConf == null ? void 0 : checkboxGroupConf.disabled.value) || props.disabled;
|
|
223
|
-
});
|
|
224
|
-
const mergedChecked = computed(() => {
|
|
225
|
-
var _a, _b;
|
|
226
|
-
return (_b = (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isItemChecked) == null ? void 0 : _a.call(checkboxGroupConf, props.value)) != null ? _b : isChecked.value;
|
|
227
|
-
});
|
|
228
|
-
const mergedIsShowTitle = computed(() => {
|
|
229
|
-
var _a;
|
|
230
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
|
|
231
|
-
});
|
|
232
|
-
const mergedShowAnimation = computed(() => {
|
|
233
|
-
var _a;
|
|
234
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
|
|
235
|
-
});
|
|
236
|
-
const mergedColor = computed(() => {
|
|
237
|
-
var _a;
|
|
238
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
|
|
239
|
-
});
|
|
240
|
-
const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
|
|
241
|
-
const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
|
|
242
|
-
const canChange = (isChecked2, val) => {
|
|
243
|
-
var _a;
|
|
244
|
-
if (mergedDisabled.value) {
|
|
245
|
-
return Promise.resolve(false);
|
|
246
|
-
}
|
|
247
|
-
const beforeChange = (_a = props.beforeChange) != null ? _a : checkboxGroupConf == null ? void 0 : checkboxGroupConf.beforeChange;
|
|
248
|
-
if (beforeChange) {
|
|
249
|
-
const res = beforeChange(isChecked2, val);
|
|
250
|
-
if (typeof res === "boolean") {
|
|
251
|
-
return Promise.resolve(res);
|
|
252
|
-
}
|
|
253
|
-
return res;
|
|
254
|
-
}
|
|
255
|
-
return Promise.resolve(true);
|
|
256
|
-
};
|
|
257
|
-
const toggle = () => {
|
|
258
|
-
const current = !isChecked.value;
|
|
259
|
-
checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
|
|
260
|
-
ctx.emit("update:checked", current);
|
|
261
|
-
ctx.emit("update:modelValue", current);
|
|
262
|
-
ctx.emit("change", current);
|
|
263
|
-
};
|
|
264
|
-
const handleClick = () => {
|
|
265
|
-
canChange(!isChecked.value, props.label).then((res) => res && toggle());
|
|
266
|
-
};
|
|
267
|
-
return {
|
|
268
|
-
itemWidth,
|
|
269
|
-
direction,
|
|
270
|
-
mergedColor,
|
|
271
|
-
mergedDisabled,
|
|
272
|
-
mergedIsShowTitle,
|
|
273
|
-
mergedChecked,
|
|
274
|
-
mergedShowAnimation,
|
|
275
|
-
handleClick
|
|
276
|
-
};
|
|
277
|
-
},
|
|
278
|
-
render() {
|
|
279
|
-
var _a;
|
|
280
|
-
const {
|
|
281
|
-
itemWidth,
|
|
282
|
-
direction,
|
|
283
|
-
mergedChecked,
|
|
284
|
-
mergedDisabled,
|
|
285
|
-
mergedIsShowTitle,
|
|
286
|
-
mergedShowAnimation,
|
|
287
|
-
halfchecked,
|
|
288
|
-
title,
|
|
289
|
-
label,
|
|
290
|
-
handleClick,
|
|
291
|
-
name,
|
|
292
|
-
value,
|
|
293
|
-
mergedColor,
|
|
294
|
-
$slots
|
|
295
|
-
} = this;
|
|
296
|
-
const wrapperCls = {
|
|
297
|
-
"devui-checkbox-column-margin": direction === "column",
|
|
298
|
-
"devui-checkbox-wrap": typeof itemWidth !== "undefined"
|
|
299
|
-
};
|
|
300
|
-
const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
|
|
301
|
-
const checkboxCls = {
|
|
302
|
-
"devui-checkbox": true,
|
|
303
|
-
active: mergedChecked,
|
|
304
|
-
halfchecked,
|
|
305
|
-
disabled: mergedDisabled,
|
|
306
|
-
unchecked: !mergedChecked
|
|
307
|
-
};
|
|
308
|
-
const labelTitle = mergedIsShowTitle ? title || label : "";
|
|
309
|
-
const bgImgStyle = mergedColor && halfchecked || mergedColor ? `linear-gradient(${mergedColor}, ${mergedColor})` : "";
|
|
310
|
-
const spanStyle = [`border-color:${(mergedChecked || halfchecked) && mergedColor ? mergedColor : ""}`, `background-image:${bgImgStyle}`, `background-color:${mergedColor && halfchecked ? mergedColor : ""}`];
|
|
311
|
-
const spanCls = {
|
|
312
|
-
"devui-checkbox-material": true,
|
|
313
|
-
"custom-color": mergedColor,
|
|
314
|
-
"devui-checkbox-no-label": !label && !$slots.default,
|
|
315
|
-
"devui-no-animation": !mergedShowAnimation,
|
|
316
|
-
"devui-checkbox-default-background": !halfchecked
|
|
317
|
-
};
|
|
318
|
-
const polygonCls = {
|
|
319
|
-
"devui-tick": true,
|
|
320
|
-
"devui-no-animation": !mergedShowAnimation
|
|
321
|
-
};
|
|
322
|
-
const stopPropagation = ($event) => $event.stopPropagation();
|
|
323
|
-
const inputProps = {
|
|
324
|
-
indeterminate: halfchecked
|
|
325
|
-
};
|
|
326
|
-
return createVNode("div", {
|
|
327
|
-
"class": wrapperCls,
|
|
328
|
-
"style": wrapperStyle
|
|
329
|
-
}, [createVNode("div", {
|
|
330
|
-
"class": checkboxCls
|
|
331
|
-
}, [createVNode("label", {
|
|
332
|
-
"title": labelTitle,
|
|
333
|
-
"onClick": handleClick
|
|
334
|
-
}, [createVNode("input", mergeProps({
|
|
335
|
-
"name": name || value,
|
|
336
|
-
"class": "devui-checkbox-input",
|
|
337
|
-
"type": "checkbox"
|
|
338
|
-
}, inputProps, {
|
|
339
|
-
"checked": mergedChecked,
|
|
340
|
-
"disabled": mergedDisabled,
|
|
341
|
-
"onClick": stopPropagation,
|
|
342
|
-
"onChange": stopPropagation
|
|
343
|
-
}), null), createVNode("span", {
|
|
344
|
-
"style": spanStyle,
|
|
345
|
-
"class": spanCls
|
|
346
|
-
}, [createVNode("span", {
|
|
347
|
-
"class": "devui-checkbox-halfchecked-bg"
|
|
348
|
-
}, null), createVNode("svg", {
|
|
349
|
-
"viewBox": "0 0 16 16",
|
|
350
|
-
"version": "1.1",
|
|
351
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
352
|
-
"class": "devui-checkbox-tick"
|
|
353
|
-
}, [createVNode("g", {
|
|
354
|
-
"stroke": "none",
|
|
355
|
-
"stroke-width": "1",
|
|
356
|
-
"fill": "none",
|
|
357
|
-
"fill-rule": "evenodd"
|
|
358
|
-
}, [createVNode("polygon", {
|
|
359
|
-
"fill-rule": "nonzero",
|
|
360
|
-
"points": "5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",
|
|
361
|
-
"class": polygonCls
|
|
362
|
-
}, null)])])]), label || ((_a = $slots.default) == null ? void 0 : _a.call($slots))])])]);
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
var checkboxGroup = "";
|
|
366
|
-
var CheckboxGroup = defineComponent({
|
|
367
|
-
name: "DCheckboxGroup",
|
|
368
|
-
props: checkboxGroupProps,
|
|
369
|
-
emits: ["change", "update:modelValue"],
|
|
370
|
-
setup(props, ctx) {
|
|
371
|
-
const valList = toRef(props, "modelValue");
|
|
372
|
-
const defaultOpt = {
|
|
373
|
-
checked: false,
|
|
374
|
-
isShowTitle: true,
|
|
375
|
-
halfchecked: false,
|
|
376
|
-
showAnimation: true,
|
|
377
|
-
disabled: false
|
|
378
|
-
};
|
|
379
|
-
const toggleGroupVal = (val) => {
|
|
380
|
-
let index2 = -1;
|
|
381
|
-
if (typeof valList.value[0] === "string") {
|
|
382
|
-
index2 = valList.value.findIndex((item) => item === val);
|
|
383
|
-
} else if (typeof valList.value[0] === "object") {
|
|
384
|
-
index2 = valList.value.findIndex((item) => item.value === val);
|
|
385
|
-
}
|
|
386
|
-
if (index2 === -1) {
|
|
387
|
-
if (typeof props.options[0] === "object") {
|
|
388
|
-
const newOne = props.options.find((item) => item.value === val);
|
|
389
|
-
const res2 = [...valList.value, newOne];
|
|
390
|
-
ctx.emit("update:modelValue", res2);
|
|
391
|
-
ctx.emit("change", res2);
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const res = [...valList.value, val];
|
|
395
|
-
ctx.emit("update:modelValue", res);
|
|
396
|
-
ctx.emit("change", res);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
valList.value.splice(index2, 1);
|
|
400
|
-
ctx.emit("update:modelValue", valList.value);
|
|
401
|
-
ctx.emit("change", valList.value);
|
|
402
|
-
};
|
|
403
|
-
const isItemChecked = (itemVal) => {
|
|
404
|
-
if (typeof valList.value[0] === "string") {
|
|
405
|
-
return valList.value.includes(itemVal);
|
|
406
|
-
} else if (typeof valList.value[0] === "object") {
|
|
407
|
-
return valList.value.some((item) => item.value === itemVal);
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
provide(checkboxGroupInjectionKey, {
|
|
411
|
-
disabled: toRef(props, "disabled"),
|
|
412
|
-
isShowTitle: toRef(props, "isShowTitle"),
|
|
413
|
-
color: toRef(props, "color"),
|
|
414
|
-
showAnimation: toRef(props, "showAnimation"),
|
|
415
|
-
beforeChange: props.beforeChange,
|
|
416
|
-
isItemChecked,
|
|
417
|
-
toggleGroupVal,
|
|
418
|
-
itemWidth: toRef(props, "itemWidth"),
|
|
419
|
-
direction: toRef(props, "direction")
|
|
420
|
-
});
|
|
421
|
-
return {
|
|
422
|
-
defaultOpt
|
|
423
|
-
};
|
|
424
|
-
},
|
|
425
|
-
render() {
|
|
426
|
-
var _a;
|
|
427
|
-
const {
|
|
428
|
-
direction,
|
|
429
|
-
$slots,
|
|
430
|
-
defaultOpt,
|
|
431
|
-
options
|
|
432
|
-
} = this;
|
|
433
|
-
let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
|
|
434
|
-
if ((options == null ? void 0 : options.length) > 0) {
|
|
435
|
-
children = options.map((opt) => {
|
|
436
|
-
let mergedOpt = null;
|
|
437
|
-
if (typeof opt === "string") {
|
|
438
|
-
mergedOpt = Object.assign({}, defaultOpt, {
|
|
439
|
-
label: opt,
|
|
440
|
-
value: opt
|
|
441
|
-
});
|
|
442
|
-
} else if (typeof opt === "object") {
|
|
443
|
-
mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
|
|
444
|
-
label: opt.name
|
|
445
|
-
}));
|
|
446
|
-
}
|
|
447
|
-
return createVNode(Checkbox, mergedOpt, null);
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
return createVNode("div", {
|
|
451
|
-
"class": "devui-checkbox-group"
|
|
452
|
-
}, [createVNode("div", {
|
|
453
|
-
"class": {
|
|
454
|
-
"devui-checkbox-list-inline": direction === "row"
|
|
455
|
-
}
|
|
456
|
-
}, [children])]);
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
Checkbox.install = function(app) {
|
|
460
|
-
app.component(Checkbox.name, Checkbox);
|
|
461
|
-
};
|
|
462
|
-
CheckboxGroup.install = function(app) {
|
|
463
|
-
app.component(CheckboxGroup.name, CheckboxGroup);
|
|
464
|
-
};
|
|
465
|
-
function className(classStr, classOpt) {
|
|
466
|
-
let classname = classStr;
|
|
467
|
-
if (typeof classOpt === "object") {
|
|
468
|
-
Object.keys(classOpt).forEach((key) => {
|
|
469
|
-
classOpt[key] && (classname += ` ${key}`);
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
return classname;
|
|
473
|
-
}
|
|
474
|
-
function useCacheOptions(mergeOptions) {
|
|
475
|
-
const cacheOptions = computed(() => {
|
|
476
|
-
const map = /* @__PURE__ */ new Map();
|
|
477
|
-
mergeOptions.value.forEach((item) => {
|
|
478
|
-
map.set(item.value, item);
|
|
479
|
-
});
|
|
480
|
-
return map;
|
|
481
|
-
});
|
|
482
|
-
const getValuesOption = (values) => values.map((value) => cacheOptions.value.get(value));
|
|
483
|
-
return getValuesOption;
|
|
484
|
-
}
|
|
485
|
-
function useSelectOutsideClick(refs, isOpen, toggleChange) {
|
|
486
|
-
function onGlobalMouseDown(e) {
|
|
487
|
-
var _a, _b;
|
|
488
|
-
let target = e.target;
|
|
489
|
-
if (target.shadowRoot && e.composed) {
|
|
490
|
-
target = e.composedPath()[0] || target;
|
|
491
|
-
}
|
|
492
|
-
const element = [(_a = refs[0]) == null ? void 0 : _a.value, (_b = refs[1]) == null ? void 0 : _b.value];
|
|
493
|
-
if (isOpen.value && element.every((el) => el && !el.contains(target) && el !== target)) {
|
|
494
|
-
toggleChange(false);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
onMounted(() => {
|
|
498
|
-
document.body.addEventListener("mousedown", onGlobalMouseDown, false);
|
|
499
|
-
});
|
|
500
|
-
onBeforeUnmount(() => {
|
|
501
|
-
document.body.addEventListener("mousedown", onGlobalMouseDown, false);
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
var select = "";
|
|
505
|
-
var Select = defineComponent({
|
|
506
|
-
name: "DSelect",
|
|
507
|
-
props: selectProps,
|
|
508
|
-
emits: ["toggleChange", "valueChange", "update:modelValue"],
|
|
509
|
-
setup(props, ctx) {
|
|
510
|
-
const containerRef = ref(null);
|
|
511
|
-
const dropdownRef = ref(null);
|
|
512
|
-
const isOpen = ref(false);
|
|
513
|
-
function toggleChange(bool) {
|
|
514
|
-
if (props.disabled) {
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
isOpen.value = bool;
|
|
518
|
-
ctx.emit("toggleChange", bool);
|
|
519
|
-
}
|
|
520
|
-
useSelectOutsideClick([containerRef, dropdownRef], isOpen, toggleChange);
|
|
521
|
-
const mergeOptions = computed(() => {
|
|
522
|
-
const {
|
|
523
|
-
multiple,
|
|
524
|
-
modelValue
|
|
525
|
-
} = props;
|
|
526
|
-
return props.options.map((item) => {
|
|
527
|
-
let option;
|
|
528
|
-
if (typeof item === "object") {
|
|
529
|
-
option = __spreadValues({
|
|
530
|
-
name: item.name ? item.name : item.value + "",
|
|
531
|
-
value: item.value,
|
|
532
|
-
_checked: false
|
|
533
|
-
}, item);
|
|
534
|
-
} else {
|
|
535
|
-
option = {
|
|
536
|
-
name: item + "",
|
|
537
|
-
value: item,
|
|
538
|
-
_checked: false
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
if (multiple) {
|
|
542
|
-
if (Array.isArray(modelValue)) {
|
|
543
|
-
option._checked = modelValue.includes(option.value);
|
|
544
|
-
} else {
|
|
545
|
-
option._checked = false;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return option;
|
|
549
|
-
});
|
|
550
|
-
});
|
|
551
|
-
const getValuesOption = useCacheOptions(mergeOptions);
|
|
552
|
-
const inputValue = computed(() => {
|
|
553
|
-
var _a;
|
|
554
|
-
if (props.multiple && Array.isArray(props.modelValue)) {
|
|
555
|
-
const selectedOptions = getValuesOption(props.modelValue);
|
|
556
|
-
return selectedOptions.map((item) => item.name).join(",");
|
|
557
|
-
} else if (!Array.isArray(props.modelValue)) {
|
|
558
|
-
return ((_a = getValuesOption([props.modelValue])[0]) == null ? void 0 : _a.name) || "";
|
|
559
|
-
}
|
|
560
|
-
return "";
|
|
561
|
-
});
|
|
562
|
-
const mergeClearable = computed(() => {
|
|
563
|
-
return !props.disabled && props.allowClear && inputValue.value.length > 0;
|
|
564
|
-
});
|
|
565
|
-
function valueChange(item, index2) {
|
|
566
|
-
const {
|
|
567
|
-
multiple,
|
|
568
|
-
optionDisabledKey: disabledKey
|
|
569
|
-
} = props;
|
|
570
|
-
let {
|
|
571
|
-
modelValue
|
|
572
|
-
} = props;
|
|
573
|
-
if (disabledKey && !!item[disabledKey]) {
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
if (multiple) {
|
|
577
|
-
item._checked = !item._checked;
|
|
578
|
-
modelValue = mergeOptions.value.filter((item2) => item2._checked).map((item2) => item2.value);
|
|
579
|
-
ctx.emit("update:modelValue", modelValue);
|
|
580
|
-
} else {
|
|
581
|
-
ctx.emit("update:modelValue", item.value);
|
|
582
|
-
toggleChange(false);
|
|
583
|
-
}
|
|
584
|
-
ctx.emit("valueChange", item, index2);
|
|
585
|
-
}
|
|
586
|
-
function getItemClassName(item) {
|
|
587
|
-
const {
|
|
588
|
-
optionDisabledKey: disabledKey
|
|
589
|
-
} = props;
|
|
590
|
-
return className("devui-select-item", {
|
|
591
|
-
active: item.value === props.modelValue,
|
|
592
|
-
disabled: disabledKey ? !!item[disabledKey] : false
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
function handleClear(e) {
|
|
596
|
-
e.preventDefault();
|
|
597
|
-
e.stopPropagation();
|
|
598
|
-
if (props.multiple) {
|
|
599
|
-
ctx.emit("update:modelValue", []);
|
|
600
|
-
} else {
|
|
601
|
-
ctx.emit("update:modelValue", "");
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
return {
|
|
605
|
-
isOpen,
|
|
606
|
-
containerRef,
|
|
607
|
-
dropdownRef,
|
|
608
|
-
inputValue,
|
|
609
|
-
mergeOptions,
|
|
610
|
-
mergeClearable,
|
|
611
|
-
valueChange,
|
|
612
|
-
toggleChange,
|
|
613
|
-
getItemClassName,
|
|
614
|
-
handleClear
|
|
615
|
-
};
|
|
616
|
-
},
|
|
617
|
-
render() {
|
|
618
|
-
const {
|
|
619
|
-
mergeOptions,
|
|
620
|
-
isOpen,
|
|
621
|
-
inputValue,
|
|
622
|
-
size,
|
|
623
|
-
multiple,
|
|
624
|
-
disabled,
|
|
625
|
-
optionDisabledKey: disabledKey,
|
|
626
|
-
placeholder,
|
|
627
|
-
overview,
|
|
628
|
-
valueChange,
|
|
629
|
-
toggleChange,
|
|
630
|
-
getItemClassName,
|
|
631
|
-
mergeClearable,
|
|
632
|
-
handleClear
|
|
633
|
-
} = this;
|
|
634
|
-
const selectCls = className("devui-select", {
|
|
635
|
-
"devui-select-open": isOpen,
|
|
636
|
-
"devui-dropdown-menu-multiple": multiple,
|
|
637
|
-
"devui-select-lg": size === "lg",
|
|
638
|
-
"devui-select-sm": size === "sm",
|
|
639
|
-
"devui-select-underlined": overview === "underlined",
|
|
640
|
-
"devui-select-disabled": disabled
|
|
641
|
-
});
|
|
642
|
-
const inputCls = className("devui-select-input", {
|
|
643
|
-
"devui-select-input-lg": size === "lg",
|
|
644
|
-
"devui-select-input-sm": size === "sm"
|
|
645
|
-
});
|
|
646
|
-
const selectionCls = className("devui-select-selection", {
|
|
647
|
-
"devui-select-clearable": mergeClearable
|
|
648
|
-
});
|
|
649
|
-
return createVNode("div", {
|
|
650
|
-
"class": selectCls,
|
|
651
|
-
"ref": "containerRef"
|
|
652
|
-
}, [createVNode("div", {
|
|
653
|
-
"class": selectionCls,
|
|
654
|
-
"onClick": () => toggleChange(!isOpen)
|
|
655
|
-
}, [createVNode("input", {
|
|
656
|
-
"value": inputValue,
|
|
657
|
-
"type": "text",
|
|
658
|
-
"class": inputCls,
|
|
659
|
-
"placeholder": placeholder,
|
|
660
|
-
"readonly": true,
|
|
661
|
-
"disabled": disabled
|
|
662
|
-
}, null), createVNode("span", {
|
|
663
|
-
"onClick": handleClear,
|
|
664
|
-
"class": "devui-select-clear"
|
|
665
|
-
}, [createVNode(Icon, {
|
|
666
|
-
"name": "close"
|
|
667
|
-
}, null)]), createVNode("span", {
|
|
668
|
-
"class": "devui-select-arrow"
|
|
669
|
-
}, [createVNode(Icon, {
|
|
670
|
-
"name": "select-arrow"
|
|
671
|
-
}, null)])]), createVNode(Transition, {
|
|
672
|
-
"name": "fade",
|
|
673
|
-
"ref": "dropdownRef"
|
|
674
|
-
}, {
|
|
675
|
-
default: () => [withDirectives(createVNode("div", {
|
|
676
|
-
"class": "devui-select-dropdown"
|
|
677
|
-
}, [createVNode("ul", {
|
|
678
|
-
"class": "devui-select-dropdown-list devui-scrollbar"
|
|
679
|
-
}, [mergeOptions.map((item, i) => createVNode("li", {
|
|
680
|
-
"onClick": (e) => {
|
|
681
|
-
e.preventDefault();
|
|
682
|
-
e.stopPropagation();
|
|
683
|
-
valueChange(item, i);
|
|
684
|
-
},
|
|
685
|
-
"class": getItemClassName(item),
|
|
686
|
-
"key": i
|
|
687
|
-
}, [multiple ? createVNode(Checkbox, {
|
|
688
|
-
"modelValue": item._checked,
|
|
689
|
-
"label": item.name,
|
|
690
|
-
"disabled": disabledKey ? !!item[disabledKey] : false
|
|
691
|
-
}, null) : item.name]))])]), [[vShow, isOpen]])]
|
|
692
|
-
})]);
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
Select.install = function(app) {
|
|
696
|
-
app.component(Select.name, Select);
|
|
697
|
-
};
|
|
698
|
-
var index = {
|
|
699
|
-
title: "Select \u4E0B\u62C9\u6846",
|
|
700
|
-
category: "\u6570\u636E\u5F55\u5165",
|
|
701
|
-
status: "10%",
|
|
702
|
-
install(app) {
|
|
703
|
-
app.use(Select);
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
export { Select, index as default };
|