vue-devui 1.0.0-pre.0 → 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 -187
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +67 -82
- package/auto-complete/index.umd.js +3 -1
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/countdown/index.es.js +2 -1
- package/editable-select/index.es.js +122 -163
- package/editable-select/index.umd.js +1 -1
- package/fullscreen/index.es.js +13 -16
- package/fullscreen/index.umd.js +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/modal/index.es.js +81 -76
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +38 -40
- package/notification/index.umd.js +1 -1
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/overlay/index.es.js +44 -37
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -43
- package/pagination/index.es.js +10 -12
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +46 -39
- package/popover/index.umd.js +6 -6
- package/popover/style.css +1 -1
- 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 +11 -11
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +2 -5
- package/search/index.umd.js +4 -4
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +60 -59
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +215 -160
- package/splitter/index.umd.js +11 -11
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/tag/index.es.js +15 -18
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -2
- package/{accordion → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{anchor → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/upload/index.es.js +38 -40
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +1478 -1196
- package/vue-devui.umd.js +19 -17
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1171
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -638
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7865
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -240
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/Select.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/Table.js +0 -3
- package/nuxt/components/Tabs.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/table/index.d.ts +0 -7
- package/table/index.es.js +0 -1969
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5828
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree/index.d.ts +0 -7
- package/tree/index.es.js +0 -6490
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
|
|
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 { computed, nextTick, defineComponent, ref, reactive, watch, withDirectives, createVNode, withModifiers, resolveComponent, resolveDirective, vShow, Transition } from "vue";
|
|
1
|
+
import { computed, ref, nextTick, defineComponent, watch, withDirectives, createVNode, withModifiers, resolveComponent, vShow, resolveDirective } from "vue";
|
|
18
2
|
const editableSelectProps = {
|
|
19
|
-
appendToBody: {
|
|
20
|
-
type: Boolean
|
|
21
|
-
},
|
|
22
3
|
options: {
|
|
23
4
|
type: Array,
|
|
24
5
|
default: () => []
|
|
@@ -48,9 +29,6 @@ const editableSelectProps = {
|
|
|
48
29
|
},
|
|
49
30
|
filterOption: {
|
|
50
31
|
type: [Function, Boolean]
|
|
51
|
-
},
|
|
52
|
-
loadMore: {
|
|
53
|
-
type: Function
|
|
54
32
|
}
|
|
55
33
|
};
|
|
56
34
|
const inBrowser = typeof window !== "undefined";
|
|
@@ -145,17 +123,21 @@ const useInput = (inputValue, ctx2) => {
|
|
|
145
123
|
handleInput
|
|
146
124
|
};
|
|
147
125
|
};
|
|
148
|
-
const useLazyLoad = (dropdownRef, inputValue, filterOtion,
|
|
126
|
+
const useLazyLoad = (dropdownRef, inputValue, filterOtion, ctx2) => {
|
|
149
127
|
const loadMore = () => {
|
|
150
|
-
|
|
128
|
+
const dropdownVal = dropdownRef.value;
|
|
129
|
+
if (filterOtion !== false) {
|
|
151
130
|
return;
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
}
|
|
132
|
+
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
133
|
+
ctx2.emit("loadMore", inputValue.value);
|
|
154
134
|
}
|
|
155
135
|
};
|
|
156
136
|
return { loadMore };
|
|
157
137
|
};
|
|
158
|
-
const useKeyboardSelect = (dropdownRef,
|
|
138
|
+
const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, optionDisabledKey, filterOption, loading, handleClick, closeMenu, toggleMenu) => {
|
|
139
|
+
const hoverIndex = ref(0);
|
|
140
|
+
const selectedIndex = ref(0);
|
|
159
141
|
const updateHoveringIndex = (index2) => {
|
|
160
142
|
hoverIndex.value = index2;
|
|
161
143
|
};
|
|
@@ -174,64 +156,71 @@ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedI
|
|
|
174
156
|
}
|
|
175
157
|
});
|
|
176
158
|
};
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
|
|
159
|
+
const handleEscape = () => {
|
|
160
|
+
if (inputValue.value) {
|
|
161
|
+
inputValue.value = "";
|
|
162
|
+
} else {
|
|
163
|
+
closeMenu();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const handleEnter = () => {
|
|
167
|
+
const len = filteredOptions.value.length;
|
|
168
|
+
if (!visible.value) {
|
|
169
|
+
toggleMenu();
|
|
170
|
+
} else if (!len || len === 1) {
|
|
171
|
+
closeMenu();
|
|
172
|
+
} else if (len && len !== 1) {
|
|
173
|
+
handleClick(filteredOptions.value[hoverIndex.value]);
|
|
174
|
+
closeMenu();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const handleKeyboardNavigation = (direction) => {
|
|
178
|
+
const len = filteredOptions.value.length;
|
|
179
|
+
if (!len || len === 1) {
|
|
180
|
+
return;
|
|
180
181
|
}
|
|
181
|
-
if (!["ArrowDown", "ArrowUp"].includes(direction))
|
|
182
|
+
if (!["ArrowDown", "ArrowUp"].includes(direction)) {
|
|
182
183
|
return;
|
|
184
|
+
}
|
|
185
|
+
if (filterOption === false && loading.value) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
let newIndex = 0;
|
|
189
|
+
newIndex = hoverIndex.value;
|
|
183
190
|
if (direction === "ArrowUp") {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
updateHoveringIndex(newIndex);
|
|
188
|
-
return;
|
|
191
|
+
newIndex -= 1;
|
|
192
|
+
if (newIndex === -1) {
|
|
193
|
+
newIndex = len - 1;
|
|
189
194
|
}
|
|
190
|
-
newIndex = newIndex - 1;
|
|
191
195
|
} else if (direction === "ArrowDown") {
|
|
192
|
-
|
|
196
|
+
newIndex += 1;
|
|
197
|
+
if (newIndex === len) {
|
|
193
198
|
newIndex = 0;
|
|
194
|
-
scrollToItem(newIndex);
|
|
195
|
-
updateHoveringIndex(newIndex);
|
|
196
|
-
return;
|
|
197
199
|
}
|
|
198
|
-
newIndex = newIndex + 1;
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
hoverIndex.value = newIndex;
|
|
202
|
+
const option = filteredOptions.value[newIndex];
|
|
203
|
+
if (option[optionDisabledKey]) {
|
|
204
|
+
return handleKeyboardNavigation(direction);
|
|
203
205
|
}
|
|
204
|
-
scrollToItem(newIndex);
|
|
205
206
|
updateHoveringIndex(newIndex);
|
|
207
|
+
scrollToItem(newIndex);
|
|
206
208
|
};
|
|
207
209
|
const handleKeydown = (event) => {
|
|
208
210
|
const keyCode = event.key || event.code;
|
|
209
|
-
if (options.value.length === 0)
|
|
210
|
-
return;
|
|
211
|
-
if (!visible.value) {
|
|
212
|
-
return toggleMenu();
|
|
213
|
-
}
|
|
214
|
-
const onKeydownEnter = () => {
|
|
215
|
-
handleClick(options.value[hoverIndex.value]);
|
|
216
|
-
closeMenu();
|
|
217
|
-
};
|
|
218
|
-
const onKeydownEsc = () => {
|
|
219
|
-
closeMenu();
|
|
220
|
-
};
|
|
221
211
|
switch (keyCode) {
|
|
222
|
-
case "Enter":
|
|
223
|
-
onKeydownEnter();
|
|
224
|
-
break;
|
|
225
212
|
case "Escape":
|
|
226
|
-
|
|
213
|
+
event.preventDefault();
|
|
214
|
+
handleEscape();
|
|
215
|
+
break;
|
|
216
|
+
case "Enter":
|
|
217
|
+
handleEnter();
|
|
227
218
|
break;
|
|
228
219
|
default:
|
|
229
|
-
|
|
220
|
+
handleKeyboardNavigation(keyCode);
|
|
230
221
|
}
|
|
231
222
|
};
|
|
232
|
-
return {
|
|
233
|
-
handleKeydown
|
|
234
|
-
};
|
|
223
|
+
return { handleKeydown, hoverIndex, selectedIndex };
|
|
235
224
|
};
|
|
236
225
|
var EditableSelect = defineComponent({
|
|
237
226
|
name: "DEditableSelect",
|
|
@@ -241,101 +230,19 @@ var EditableSelect = defineComponent({
|
|
|
241
230
|
props: editableSelectProps,
|
|
242
231
|
emits: ["update:modelValue", "search", "loadMore"],
|
|
243
232
|
setup(props, ctx2) {
|
|
244
|
-
const
|
|
245
|
-
const {
|
|
246
|
-
optionDisabledKey: disabledKey
|
|
247
|
-
} = props;
|
|
248
|
-
return className("devui-dropdown-item", {
|
|
249
|
-
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
250
|
-
selected: index2 === selectIndex.value,
|
|
251
|
-
"devui-dropdown-bg": index2 === hoverIndex.value
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
const renderDropdown = () => {
|
|
255
|
-
if (props.appendToBody) {
|
|
256
|
-
return createVNode(resolveComponent("d-flexible-overlay"), {
|
|
257
|
-
"origin": origin,
|
|
258
|
-
"visible": visible.value,
|
|
259
|
-
"onUpdate:visible": ($event) => visible.value = $event,
|
|
260
|
-
"position": position,
|
|
261
|
-
"hasBackdrop": false
|
|
262
|
-
}, {
|
|
263
|
-
default: () => [createVNode("div", {
|
|
264
|
-
"class": "devui-editable-select-dropdown",
|
|
265
|
-
"style": {
|
|
266
|
-
width: props.width + "px"
|
|
267
|
-
}
|
|
268
|
-
}, [withDirectives(createVNode("div", {
|
|
269
|
-
"class": "devui-dropdown-menu"
|
|
270
|
-
}, [createVNode("ul", {
|
|
271
|
-
"ref": dopdownRef,
|
|
272
|
-
"class": "devui-list-unstyled scroll-height",
|
|
273
|
-
"style": {
|
|
274
|
-
maxHeight: props.maxHeight + "px"
|
|
275
|
-
},
|
|
276
|
-
"onScroll": loadMore
|
|
277
|
-
}, [filteredOptions.value.map((option, index2) => {
|
|
278
|
-
return createVNode("li", {
|
|
279
|
-
"class": getItemCls(option, index2),
|
|
280
|
-
"onClick": (e) => {
|
|
281
|
-
e.stopPropagation();
|
|
282
|
-
handleClick(option);
|
|
283
|
-
}
|
|
284
|
-
}, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
|
|
285
|
-
}), withDirectives(createVNode("li", {
|
|
286
|
-
"class": "devui-no-result-template"
|
|
287
|
-
}, [createVNode("div", {
|
|
288
|
-
"class": "devui-no-data-tip"
|
|
289
|
-
}, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
|
|
290
|
-
});
|
|
291
|
-
} else {
|
|
292
|
-
return createVNode(Transition, {
|
|
293
|
-
"name": "fade"
|
|
294
|
-
}, {
|
|
295
|
-
default: () => [withDirectives(createVNode("div", {
|
|
296
|
-
"class": "devui-dropdown-menu"
|
|
297
|
-
}, [createVNode("ul", {
|
|
298
|
-
"ref": dopdownRef,
|
|
299
|
-
"class": "devui-list-unstyled scroll-height",
|
|
300
|
-
"style": {
|
|
301
|
-
maxHeight: props.maxHeight + "px"
|
|
302
|
-
},
|
|
303
|
-
"onScroll": loadMore
|
|
304
|
-
}, [filteredOptions.value.map((option, index2) => {
|
|
305
|
-
return createVNode("li", {
|
|
306
|
-
"class": getItemCls(option, index2),
|
|
307
|
-
"onClick": (e) => {
|
|
308
|
-
e.stopPropagation();
|
|
309
|
-
handleClick(option);
|
|
310
|
-
}
|
|
311
|
-
}, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option) : option.label]);
|
|
312
|
-
}), withDirectives(createVNode("li", {
|
|
313
|
-
"class": "devui-no-result-template"
|
|
314
|
-
}, [createVNode("div", {
|
|
315
|
-
"class": "devui-no-data-tip"
|
|
316
|
-
}, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value]])]
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
const dopdownRef = ref();
|
|
233
|
+
const dropdownRef = ref();
|
|
321
234
|
const origin = ref();
|
|
322
|
-
const position =
|
|
323
|
-
originX: "left",
|
|
324
|
-
originY: "bottom",
|
|
325
|
-
overlayX: "left",
|
|
326
|
-
overlayY: "top"
|
|
327
|
-
});
|
|
235
|
+
const position = ref(["bottom", "left"]);
|
|
328
236
|
const visible = ref(false);
|
|
329
|
-
const inputValue = ref(props.modelValue);
|
|
330
|
-
const
|
|
331
|
-
const selectIndex = ref(0);
|
|
237
|
+
const inputValue = ref(props.modelValue || "");
|
|
238
|
+
const loading = ref(props.loading);
|
|
332
239
|
const normalizeOptions = computed(() => {
|
|
333
240
|
return props.options.map((option) => {
|
|
334
241
|
if (typeof option === "object") {
|
|
335
|
-
return
|
|
242
|
+
return Object.assign({}, option, {
|
|
336
243
|
label: option.label ? option.label : option.value,
|
|
337
244
|
value: option.value
|
|
338
|
-
}
|
|
245
|
+
});
|
|
339
246
|
}
|
|
340
247
|
return {
|
|
341
248
|
label: option + "",
|
|
@@ -345,13 +252,16 @@ var EditableSelect = defineComponent({
|
|
|
345
252
|
});
|
|
346
253
|
const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
|
|
347
254
|
const emptyText = computed(() => {
|
|
348
|
-
let text;
|
|
255
|
+
let text = "";
|
|
349
256
|
if (props.filterOption !== false && !filteredOptions.value.length) {
|
|
350
257
|
text = "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55";
|
|
351
258
|
} else if (props.filterOption === false && !filteredOptions.value.length) {
|
|
352
259
|
text = "\u6CA1\u6709\u6570\u636E";
|
|
353
260
|
}
|
|
354
|
-
return
|
|
261
|
+
return text;
|
|
262
|
+
});
|
|
263
|
+
watch(() => props.loading, (newVal) => {
|
|
264
|
+
loading.value = newVal;
|
|
355
265
|
});
|
|
356
266
|
const toggleMenu = () => {
|
|
357
267
|
visible.value = !visible.value;
|
|
@@ -361,7 +271,7 @@ var EditableSelect = defineComponent({
|
|
|
361
271
|
};
|
|
362
272
|
const {
|
|
363
273
|
loadMore
|
|
364
|
-
} = useLazyLoad(
|
|
274
|
+
} = useLazyLoad(dropdownRef, inputValue, props.filterOption, ctx2);
|
|
365
275
|
const {
|
|
366
276
|
handleInput
|
|
367
277
|
} = useInput(inputValue, ctx2);
|
|
@@ -369,17 +279,32 @@ var EditableSelect = defineComponent({
|
|
|
369
279
|
const {
|
|
370
280
|
optionDisabledKey: disabledKey
|
|
371
281
|
} = props;
|
|
372
|
-
if (disabledKey && !!option[disabledKey])
|
|
282
|
+
if (disabledKey && !!option[disabledKey]) {
|
|
373
283
|
return;
|
|
284
|
+
}
|
|
374
285
|
ctx2.emit("update:modelValue", option.label);
|
|
375
286
|
closeMenu();
|
|
376
287
|
};
|
|
377
288
|
const {
|
|
378
|
-
handleKeydown
|
|
379
|
-
|
|
289
|
+
handleKeydown,
|
|
290
|
+
hoverIndex,
|
|
291
|
+
selectedIndex
|
|
292
|
+
} = useKeyboardSelect(dropdownRef, visible, inputValue, filteredOptions, props.optionDisabledKey, props.filterOption, loading, handleClick, closeMenu, toggleMenu);
|
|
380
293
|
watch(() => props.modelValue, (newVal) => {
|
|
381
|
-
|
|
294
|
+
if (newVal) {
|
|
295
|
+
inputValue.value = newVal;
|
|
296
|
+
}
|
|
382
297
|
});
|
|
298
|
+
const getItemCls = (option, index2) => {
|
|
299
|
+
const {
|
|
300
|
+
optionDisabledKey: disabledKey
|
|
301
|
+
} = props;
|
|
302
|
+
return className("devui-dropdown-item", {
|
|
303
|
+
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
304
|
+
selected: index2 === selectedIndex.value,
|
|
305
|
+
"devui-dropdown-bg": index2 === hoverIndex.value
|
|
306
|
+
});
|
|
307
|
+
};
|
|
383
308
|
return () => {
|
|
384
309
|
const selectCls = className("devui-editable-select devui-form-group devui-has-feedback", {
|
|
385
310
|
"devui-select-open": visible.value === true
|
|
@@ -405,7 +330,41 @@ var EditableSelect = defineComponent({
|
|
|
405
330
|
"class": "devui-select-chevron-icon"
|
|
406
331
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
407
332
|
"name": "select-arrow"
|
|
408
|
-
}, null)])]),
|
|
333
|
+
}, null)])]), createVNode(resolveComponent("d-flexible-overlay"), {
|
|
334
|
+
"origin": origin.value,
|
|
335
|
+
"modelValue": visible.value,
|
|
336
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
337
|
+
"position": position.value,
|
|
338
|
+
"hasBackdrop": false
|
|
339
|
+
}, {
|
|
340
|
+
default: () => [createVNode("div", {
|
|
341
|
+
"class": "devui-editable-select-dropdown",
|
|
342
|
+
"style": {
|
|
343
|
+
width: props.width + "px"
|
|
344
|
+
}
|
|
345
|
+
}, [withDirectives(createVNode("div", {
|
|
346
|
+
"class": "devui-dropdown-menu"
|
|
347
|
+
}, [createVNode("ul", {
|
|
348
|
+
"ref": dropdownRef,
|
|
349
|
+
"class": "devui-list-unstyled scroll-height",
|
|
350
|
+
"style": {
|
|
351
|
+
maxHeight: props.maxHeight + "px"
|
|
352
|
+
},
|
|
353
|
+
"onScroll": loadMore
|
|
354
|
+
}, [filteredOptions.value.map((option, index2) => {
|
|
355
|
+
return createVNode("li", {
|
|
356
|
+
"class": getItemCls(option, index2),
|
|
357
|
+
"onClick": (e) => {
|
|
358
|
+
e.stopPropagation();
|
|
359
|
+
handleClick(option);
|
|
360
|
+
}
|
|
361
|
+
}, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
|
|
362
|
+
}), withDirectives(createVNode("li", {
|
|
363
|
+
"class": "devui-no-result-template"
|
|
364
|
+
}, [createVNode("div", {
|
|
365
|
+
"class": "devui-no-data-tip"
|
|
366
|
+
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem() : emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
|
|
367
|
+
})]), [[resolveDirective("click-outside"), closeMenu]]);
|
|
409
368
|
};
|
|
410
369
|
}
|
|
411
370
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(u,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(u=typeof globalThis!="undefined"?globalThis:u||self,t(u.index={},u.Vue))})(this,function(u,t){"use strict";const M={options:{type:Array,default:()=>[]},disabled:{type:Boolean},loading:{type:Boolean},optionDisabledKey:{type:String,default:""},placeholder:{type:String,default:"Search"},modelValue:{type:String},width:{type:Number},maxHeight:{type:Number},filterOption:{type:[Function,Boolean]}},B=typeof window!="undefined";function N(e,l,o){document.addEventListener?e&&l&&o&&e.addEventListener(l,o,!1):e&&l&&o&&e.attachEvent("on"+l,o)}const f=Symbol("@@clickoutside"),S=new Map;let x,k=0,F=!0;function K(e,l,o){return B&&F&&(F=!1,N(document,"mousedown",a=>{x=a}),N(document,"mouseup",a=>{for(const[c,i]of S)i[f].documentHandler(a,x)})),function(a,c){!o||!l.instance||!a.target||!c.target||e.contains(a.target)||e.contains(c.target)||e===a.target||e[f].bindingFn&&e[f].bindingFn()}}const O={beforeMount:function(e,l,o){k++,S.set(k,e),e[f]={nid:k,documentHandler:K(e,l,o),bindingFn:l.value}},updated:function(e,l,o){e[f].documentHandler=K(e,l,o),e[f].bindingFn=l.value},unmounted:function(e){S.delete(e[f].nid),delete e[f]}};function H(e,l){let o=e;return typeof l=="object"&&Object.keys(l).forEach(a=>{l[a]&&(o+=` ${a}`)}),o}var q="";const T=()=>(e,l)=>l.label.toLocaleLowerCase().indexOf(e.toLocaleLowerCase())>-1,j=(e,l,o)=>t.computed(()=>{const a=[];if(!l.value||o===!1)return e.value;const c=typeof o=="function"?o:T();return e.value.forEach(i=>{c(l.value,i)&&a.push(i)}),a}),A=(e,l)=>{const o=c=>{l.emit("search",c)};return{handleInput:c=>{const i=c.target.value;e.value=i,o(i)}}},R=(e,l,o,a)=>({loadMore:()=>{const i=e.value;o===!1&&i.clientHeight+i.scrollTop>=i.scrollHeight&&a.emit("loadMore",l.value)}}),P=(e,l,o,a,c,i,v,p,w,h)=>{const m=t.ref(0),I=t.ref(0),y=d=>{m.value=d},C=d=>{const r=e.value,n=r.children[d];t.nextTick(()=>{if(n.scrollIntoViewIfNeeded)n.scrollIntoViewIfNeeded(!1);else{const s=r.getBoundingClientRect(),b=n.getBoundingClientRect();(b.bottom>s.bottom||b.top<s.top)&&n.scrollIntoView(!1)}})},D=()=>{o.value?o.value="":w()},V=()=>{const d=a.value.length;l.value?!d||d===1?w():d&&d!==1&&(p(a.value[m.value]),w()):h()},E=d=>{const r=a.value.length;if(!r||r===1||!["ArrowDown","ArrowUp"].includes(d)||i===!1&&v.value)return;let n=0;if(n=m.value,d==="ArrowUp"?(n-=1,n===-1&&(n=r-1)):d==="ArrowDown"&&(n+=1,n===r&&(n=0)),m.value=n,a.value[n][c])return E(d);y(n),C(n)};return{handleKeydown:d=>{const r=d.key||d.code;switch(r){case"Escape":d.preventDefault(),D();break;case"Enter":V();break;default:E(r)}},hoverIndex:m,selectedIndex:I}};var g=t.defineComponent({name:"DEditableSelect",directives:{clickOutside:O},props:M,emits:["update:modelValue","search","loadMore"],setup(e,l){const o=t.ref(),a=t.ref(),c=t.ref(["bottom","left"]),i=t.ref(!1),v=t.ref(e.modelValue||""),p=t.ref(e.loading),w=t.computed(()=>e.options.map(n=>typeof n=="object"?Object.assign({},n,{label:n.label?n.label:n.value,value:n.value}):{label:n+"",value:n})),h=j(w,v,e.filterOption),m=t.computed(()=>{let n="";return e.filterOption!==!1&&!h.value.length?n="\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55":e.filterOption===!1&&!h.value.length&&(n="\u6CA1\u6709\u6570\u636E"),n});t.watch(()=>e.loading,n=>{p.value=n});const I=()=>{i.value=!i.value},y=()=>{i.value=!1},{loadMore:C}=R(o,v,e.filterOption,l),{handleInput:D}=A(v,l),V=n=>{const{optionDisabledKey:s}=e;s&&!!n[s]||(l.emit("update:modelValue",n.label),y())},{handleKeydown:E,hoverIndex:L,selectedIndex:d}=P(o,i,v,h,e.optionDisabledKey,e.filterOption,p,V,y,I);t.watch(()=>e.modelValue,n=>{n&&(v.value=n)});const r=(n,s)=>{const{optionDisabledKey:b}=e;return H("devui-dropdown-item",{disabled:b?!!n[b]:!1,selected:s===d.value,"devui-dropdown-bg":s===L.value})};return()=>{const n=H("devui-editable-select devui-form-group devui-has-feedback",{"devui-select-open":i.value===!0});return t.withDirectives(t.createVNode("div",{class:n,ref:a,style:{width:e.width+"px"}},[t.createVNode("input",{class:"devui-form-control devui-dropdown-origin devui-dropdown-origin-open",onClick:t.withModifiers(I,["self"]),onInput:D,onKeydown:E,value:v.value,disabled:e.disabled,placeholder:e.placeholder,type:"text"},null),t.createVNode("span",{class:"devui-form-control-feedback"},[t.createVNode("span",{class:"devui-select-chevron-icon"},[t.createVNode(t.resolveComponent("d-icon"),{name:"select-arrow"},null)])]),t.createVNode(t.resolveComponent("d-flexible-overlay"),{origin:a.value,modelValue:i.value,"onUpdate:modelValue":s=>i.value=s,position:c.value,hasBackdrop:!1},{default:()=>[t.createVNode("div",{class:"devui-editable-select-dropdown",style:{width:e.width+"px"}},[t.withDirectives(t.createVNode("div",{class:"devui-dropdown-menu"},[t.createVNode("ul",{ref:o,class:"devui-list-unstyled scroll-height",style:{maxHeight:e.maxHeight+"px"},onScroll:C},[h.value.map((s,b)=>t.createVNode("li",{class:r(s,b),onClick:_=>{_.stopPropagation(),V(s)}},[l.slots.item?l.slots.item(s):s.label])),t.withDirectives(t.createVNode("li",{class:"devui-no-result-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[l.slots.noResultItem?l.slots.noResultItem():m.value])]),[[t.vShow,!h.value.length]])])]),[[t.resolveDirective("dLoading"),e.loading],[t.vShow,i.value]])])]})]),[[t.resolveDirective("click-outside"),y]])}}});g.install=function(e){e.component(g.name,g)};var U={title:"EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.use(g)}};u.EditableSelect=g,u.default=U,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|
package/fullscreen/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ const launchNormalFullscreen = (targetElement, props) => {
|
|
|
36
36
|
};
|
|
37
37
|
const exitNormalFullscreen = (targetElement) => {
|
|
38
38
|
targetElement.classList.remove("devui-fullscreen");
|
|
39
|
-
targetElement.style.zIndex =
|
|
39
|
+
targetElement.style.zIndex = "";
|
|
40
40
|
};
|
|
41
41
|
const launchImmersiveFullScreen = async (docElement) => {
|
|
42
42
|
let fullscreenLaunch = null;
|
|
@@ -49,7 +49,7 @@ const launchImmersiveFullScreen = async (docElement) => {
|
|
|
49
49
|
} else if (docElement.msRequestFullscreen) {
|
|
50
50
|
fullscreenLaunch = Promise.resolve(docElement.msRequestFullscreen());
|
|
51
51
|
}
|
|
52
|
-
return await fullscreenLaunch.then(() => !!document.fullscreenElement);
|
|
52
|
+
return await (fullscreenLaunch == null ? void 0 : fullscreenLaunch.then(() => !!document.fullscreenElement));
|
|
53
53
|
};
|
|
54
54
|
const exitImmersiveFullScreen = async (doc) => {
|
|
55
55
|
let fullscreenExit = null;
|
|
@@ -62,7 +62,7 @@ const exitImmersiveFullScreen = async (doc) => {
|
|
|
62
62
|
} else if (doc.msExitFullscreen) {
|
|
63
63
|
fullscreenExit = Promise.resolve(doc.msExitFullscreen());
|
|
64
64
|
}
|
|
65
|
-
return await fullscreenExit.then(() => !!document.fullscreenElement);
|
|
65
|
+
return await (fullscreenExit == null ? void 0 : fullscreenExit.then(() => !!document.fullscreenElement));
|
|
66
66
|
};
|
|
67
67
|
const addFullScreenStyle = () => {
|
|
68
68
|
document.getElementsByTagName("html")[0].classList.add("devui-fullscreen-html");
|
|
@@ -73,14 +73,6 @@ const removeFullScreenStyle = () => {
|
|
|
73
73
|
function useFullscreen(props, slotElement, ctx) {
|
|
74
74
|
const { modelValue, mode } = toRefs(props);
|
|
75
75
|
let exitByKeydown = false;
|
|
76
|
-
watch(modelValue, (newVal) => {
|
|
77
|
-
if (mode.value === "normal") {
|
|
78
|
-
handleNormalFullscreen(newVal);
|
|
79
|
-
}
|
|
80
|
-
if (mode.value === "immersive") {
|
|
81
|
-
handleImmersiveFullscreen(newVal);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
76
|
const handleNormalFullscreen = (isOpen) => {
|
|
85
77
|
if (isOpen) {
|
|
86
78
|
launchNormalFullscreen(slotElement.value, props);
|
|
@@ -99,6 +91,14 @@ function useFullscreen(props, slotElement, ctx) {
|
|
|
99
91
|
}
|
|
100
92
|
}
|
|
101
93
|
};
|
|
94
|
+
watch(modelValue, (newVal) => {
|
|
95
|
+
if (mode.value === "normal") {
|
|
96
|
+
handleNormalFullscreen(newVal);
|
|
97
|
+
}
|
|
98
|
+
if (mode.value === "immersive") {
|
|
99
|
+
handleImmersiveFullscreen(newVal);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
102
|
const handleFullscreenChange = () => {
|
|
103
103
|
if (!document.fullscreenElement) {
|
|
104
104
|
ctx.emit("update:modelValue");
|
|
@@ -131,15 +131,12 @@ var Fullscreen = defineComponent({
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
Fullscreen.install = function(app) {
|
|
135
|
-
app.component(Fullscreen.name, Fullscreen);
|
|
136
|
-
};
|
|
137
134
|
var index = {
|
|
138
135
|
title: "Fullscreen \u5168\u5C4F",
|
|
139
136
|
category: "\u901A\u7528",
|
|
140
137
|
status: "100%",
|
|
141
138
|
install(app) {
|
|
142
|
-
app.
|
|
139
|
+
app.component(Fullscreen.name, Fullscreen);
|
|
143
140
|
}
|
|
144
141
|
};
|
|
145
|
-
export { Fullscreen, index as default };
|
|
142
|
+
export { Fullscreen, index as default, fullscreenProps };
|
package/fullscreen/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(t=typeof globalThis!="undefined"?globalThis:t||self,n(t.index={},t.Vue))})(this,function(t,n){"use strict";const
|
|
1
|
+
(function(t,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(t=typeof globalThis!="undefined"?globalThis:t||self,n(t.index={},t.Vue))})(this,function(t,n){"use strict";const a={modelValue:{type:Boolean,default:!1},mode:{type:String,default:"normal"},zIndex:{type:Number,default:10}},m=27;function f(e,l){const{modelValue:s}=n.toRefs(e),u=o=>{o.keyCode===m&&s&&l.emit("update:modelValue",!1)};n.onMounted(()=>{document.addEventListener("keydown",u)}),n.onUnmounted(()=>{document.removeEventListener("keydown",u)})}const F=(e,l)=>{e.classList.add("devui-fullscreen"),l.zIndex&&e.setAttribute("style",`z-index: ${l.zIndex}`)},y=e=>{e.classList.remove("devui-fullscreen"),e.style.zIndex=""},v=async e=>{let l=null;return e.requestFullscreen?l=e.requestFullscreen():e.mozRequestFullScreen?l=e.mozRequestFullScreen():e.webkitRequestFullScreen?l=Promise.resolve(e.webkitRequestFullScreen()):e.msRequestFullscreen&&(l=Promise.resolve(e.msRequestFullscreen())),await(l==null?void 0:l.then(()=>!!document.fullscreenElement))},S=async e=>{let l=null;return e.exitFullscreen?l=e.exitFullscreen():e.mozCancelFullScreen?l=e.mozCancelFullScreen():e.webkitCancelFullScreen?l=Promise.resolve(e.webkitCancelFullScreen()):e.msExitFullscreen&&(l=Promise.resolve(e.msExitFullscreen())),await(l==null?void 0:l.then(()=>!!document.fullscreenElement))},h=()=>{document.getElementsByTagName("html")[0].classList.add("devui-fullscreen-html")},p=()=>{document.getElementsByTagName("html")[0].classList.remove("devui-fullscreen-html")};function w(e,l,s){const{modelValue:u,mode:o}=n.toRefs(e);let c=!1;const C=r=>{r?(F(l.value,e),h()):(y(l.value),p())},q=r=>{r?v(l.value):c||S(document)};n.watch(u,r=>{o.value==="normal"&&C(r),o.value==="immersive"&&q(r)});const d=()=>{document.fullscreenElement?c=!1:(s.emit("update:modelValue"),c=!0)};n.onMounted(()=>{document.addEventListener("fullscreenchange",d)}),n.onUnmounted(()=>{document.removeEventListener("fullscreenchange",d)})}var z="",i=n.defineComponent({name:"DFullscreen",props:a,emits:["update:modelValue"],setup(e,l){const s=n.ref(null);return w(e,s,l),f(e,l),()=>{const u=n.renderSlot(n.useSlots(),"default");return n.createVNode("div",{ref:s},[u])}}}),x={title:"Fullscreen \u5168\u5C4F",category:"\u901A\u7528",status:"100%",install(e){e.component(i.name,i)}};t.Fullscreen=i,t.default=x,t.fullscreenProps=a,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
|
package/icon/index.es.js
CHANGED
|
@@ -1,75 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { defineComponent, toRefs, createVNode } from "vue";
|
|
2
|
+
const iconProps = {
|
|
3
|
+
name: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: "",
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "inherit"
|
|
11
|
+
},
|
|
12
|
+
color: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "inherit"
|
|
15
|
+
},
|
|
16
|
+
classPrefix: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "icon"
|
|
19
|
+
}
|
|
16
20
|
};
|
|
17
|
-
import { defineComponent, createVNode } from "vue";
|
|
18
21
|
var Icon = defineComponent({
|
|
19
22
|
name: "DIcon",
|
|
20
|
-
props:
|
|
21
|
-
name: {
|
|
22
|
-
type: String,
|
|
23
|
-
required: true
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "inherit"
|
|
28
|
-
},
|
|
29
|
-
color: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: "inherit"
|
|
32
|
-
},
|
|
33
|
-
classPrefix: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "icon"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
23
|
+
props: iconProps,
|
|
38
24
|
setup(props) {
|
|
39
|
-
return __spreadValues({}, props);
|
|
40
|
-
},
|
|
41
|
-
render() {
|
|
42
25
|
const {
|
|
43
26
|
name,
|
|
44
27
|
size,
|
|
45
28
|
color,
|
|
46
29
|
classPrefix
|
|
47
|
-
} =
|
|
48
|
-
return
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
30
|
+
} = toRefs(props);
|
|
31
|
+
return () => {
|
|
32
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
33
|
+
"src": name.value,
|
|
34
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
35
|
+
"style": {
|
|
36
|
+
width: size.value,
|
|
37
|
+
verticalAlign: "text-bottom"
|
|
38
|
+
}
|
|
39
|
+
}, null) : createVNode("i", {
|
|
40
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
41
|
+
"style": {
|
|
42
|
+
fontSize: size.value,
|
|
43
|
+
color: color.value
|
|
44
|
+
}
|
|
45
|
+
}, null);
|
|
46
|
+
};
|
|
62
47
|
}
|
|
63
48
|
});
|
|
64
|
-
Icon.install = function(app) {
|
|
65
|
-
app.component(Icon.name, Icon);
|
|
66
|
-
};
|
|
67
49
|
var index = {
|
|
68
50
|
title: "Icon \u56FE\u6807",
|
|
69
51
|
category: "\u901A\u7528",
|
|
70
52
|
status: "100%",
|
|
71
53
|
install(app) {
|
|
72
|
-
app.
|
|
54
|
+
app.component(Icon.name, Icon);
|
|
73
55
|
}
|
|
74
56
|
};
|
|
75
|
-
export { Icon, index as default };
|
|
57
|
+
export { Icon, index as default, iconProps };
|
package/icon/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";const o={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var i=t.defineComponent({name:"DIcon",props:o,setup(l){const{name:n,size:u,color:s,classPrefix:r}=t.toRefs(l);return()=>/^((https?):)?\/\//.test(n.value)?t.createVNode("img",{src:n.value,alt:n.value.split("/")[n.value.split("/").length-1],style:{width:u.value,verticalAlign:"text-bottom"}},null):t.createVNode("i",{class:`${r.value} ${r.value}-${n.value}`,style:{fontSize:u.value,color:s.value}},null)}}),a={title:"Icon \u56FE\u6807",category:"\u901A\u7528",status:"100%",install(l){l.component(i.name,i)}};e.Icon=i,e.default=a,e.iconProps=o,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
|
|
@@ -188,8 +188,9 @@ var imagePreview = defineComponent({
|
|
|
188
188
|
transform.setZoomOriginal();
|
|
189
189
|
}
|
|
190
190
|
function onKeyDown(event) {
|
|
191
|
-
if (event.defaultPrevented)
|
|
191
|
+
if (event.defaultPrevented) {
|
|
192
192
|
return;
|
|
193
|
+
}
|
|
193
194
|
if (event.code == "Escape") {
|
|
194
195
|
onClose();
|
|
195
196
|
} else if (event.code == "ArrowLeft") {
|