@web-utils/component 2.0.9 → 2.0.11
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/dist/chunks/3d28cc08.js +57 -0
- package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
- package/dist/chunks/5d33812d.js +147 -0
- package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
- package/dist/chunks/9d848bf6.js +99 -0
- package/dist/chunks/a0bb327b.js +96 -0
- package/dist/chunks/a8891d2c.js +30 -0
- package/dist/chunks/c69d5628.js +248 -0
- package/dist/chunks/de9fe802.js +24 -0
- package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
- package/dist/components/address-input/index.js +56 -43
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/aside-menu/index.js +36 -30
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/awesome-button/index.js +35 -32
- package/dist/components/base.css +66 -1
- package/dist/components/capsule-tab/index.js +33 -27
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/chunk-file-uploader/index.js +88 -54
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +31 -25
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +42 -28
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +212 -134
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +34 -28
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +35 -29
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +181 -153
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +68 -49
- package/dist/components/confirm-button/index.js +21 -19
- package/dist/components/confirmable/index.js +19 -18
- package/dist/components/context-menu/index.js +130 -108
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/custom-scrollbar/index.js +67 -49
- package/dist/components/data-table-picker/index.js +81 -62
- package/dist/components/dynamic-table/index.js +113 -89
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +201 -120
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/editable-progress/index.js +93 -60
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +638 -423
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +46 -33
- package/dist/components/egd-collapse-item/index.js +76 -60
- package/dist/components/element-dialog/index.js +147 -95
- package/dist/components/element-dialog/style.css +102 -1
- package/dist/components/empty-view/index.js +34 -28
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +32 -26
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +40 -25
- package/dist/components/flex-item/index.js +57 -29
- package/dist/components/flex-row/index.js +40 -25
- package/dist/components/flex-scroller/index.js +32 -26
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/form-button/index.js +38 -34
- package/dist/components/form-cascader/index.js +81 -71
- package/dist/components/form-checkbox-group/index.js +113 -88
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +132 -70
- package/dist/components/form-holder/index.js +39 -32
- package/dist/components/form-input/index.js +62 -56
- package/dist/components/form-input-email/index.js +60 -48
- package/dist/components/form-input-id-card/index.js +59 -53
- package/dist/components/form-input-number/index.js +68 -61
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +55 -49
- package/dist/components/form-input-time/index.js +59 -53
- package/dist/components/form-item/index.js +123 -80
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +26 -25
- package/dist/components/form-item-group/index.js +111 -85
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +104 -85
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +91 -76
- package/dist/components/form-switch/index.js +57 -51
- package/dist/components/form-textarea/index.js +57 -51
- package/dist/components/form-view/index.js +232 -165
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/guide-steps/index.js +58 -44
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/icon-card/index.js +35 -29
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/iframe-window/index.js +35 -29
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-viewer/index.js +66 -48
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +193 -127
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +57 -45
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +120 -73
- package/dist/components/loading-view/index.js +32 -26
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/nav-bar/index.js +37 -27
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +31 -23
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/page/index.js +28 -22
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +36 -30
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +83 -62
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +68 -53
- package/dist/components/page-skeleton/index.js +37 -31
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +48 -42
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +253 -186
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +199 -129
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +151 -110
- package/dist/components/photo-swipe/style.css +20 -1
- package/dist/components/resize-observer/index.js +68 -34
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search-popover/index.js +211 -153
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign-panel/index.js +142 -92
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/split-pane/index.js +162 -101
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +34 -31
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +44 -37
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +150 -85
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +72 -54
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +35 -30
- package/dist/components/table-column/index.js +32 -30
- package/dist/components/table-view/index.js +227 -156
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +58 -44
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/tinymce-editor/index.js +95 -79
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +121 -92
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +84 -63
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +48 -41
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +36 -29
- package/dist/components/vue-tags-input/index.js +308 -188
- package/dist/components/vue-tags-input/style.css +682 -1
- package/dist/components/watermark/index.js +37 -25
- package/dist/components/watermark/style.css +11 -1
- package/dist/components/x-dialog/index.js +93 -67
- package/dist/components/x-dialog/style.css +15 -1
- package/dist/index.css +1105 -193
- package/dist/index.es.js +7242 -4789
- package/package.json +2 -1
- package/web-types.json +1 -1
- package/dist/chunks/3a79781b.js +0 -75
- package/dist/chunks/5d4282fb.js +0 -30
- package/dist/chunks/76680a03.js +0 -24
- package/dist/chunks/8c0142e0.js +0 -81
- package/dist/chunks/97652d86.js +0 -26
- package/dist/chunks/b4acd3a6.js +0 -126
- package/dist/chunks/f71045fc.js +0 -184
|
@@ -1,289 +1,297 @@
|
|
|
1
1
|
import { copy, isInContainer } from "@web-utils/core";
|
|
2
2
|
import ClickOutside from "element-ui/lib/utils/clickoutside";
|
|
3
|
-
import { n as normalizeComponent } from "../../chunks/
|
|
3
|
+
import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
|
|
4
4
|
var render = function() {
|
|
5
|
-
var
|
|
6
|
-
|
|
5
|
+
var _vm = this;
|
|
6
|
+
var _h = _vm.$createElement;
|
|
7
|
+
var _c = _vm._self._c || _h;
|
|
8
|
+
return _c("div", {
|
|
7
9
|
directives: [{
|
|
8
10
|
name: "show",
|
|
9
11
|
rawName: "v-show",
|
|
10
|
-
value:
|
|
12
|
+
value: _vm.showPopover,
|
|
11
13
|
expression: "showPopover"
|
|
12
14
|
}, {
|
|
13
15
|
name: "click-outside",
|
|
14
16
|
rawName: "v-click-outside",
|
|
15
|
-
value:
|
|
17
|
+
value: _vm.hidePopover,
|
|
16
18
|
expression: "hidePopover"
|
|
17
19
|
}],
|
|
18
20
|
staticClass: "search-popover"
|
|
19
|
-
}, [
|
|
21
|
+
}, [_c("div", {
|
|
20
22
|
staticStyle: {
|
|
21
|
-
padding: "10px"
|
|
23
|
+
"padding": "10px"
|
|
22
24
|
}
|
|
23
|
-
}, [
|
|
25
|
+
}, [_c("input", {
|
|
24
26
|
directives: [{
|
|
25
27
|
name: "model",
|
|
26
28
|
rawName: "v-model",
|
|
27
|
-
value:
|
|
29
|
+
value: _vm.keyword,
|
|
28
30
|
expression: "keyword"
|
|
29
31
|
}],
|
|
30
32
|
ref: "searchInput",
|
|
31
33
|
staticClass: "search-input",
|
|
32
34
|
attrs: {
|
|
33
|
-
placeholder:
|
|
35
|
+
"placeholder": _vm.currentItem ? _vm.currentItem.name : "输入关键字搜索 ..."
|
|
34
36
|
},
|
|
35
37
|
domProps: {
|
|
36
|
-
value:
|
|
38
|
+
"value": _vm.keyword
|
|
37
39
|
},
|
|
38
40
|
on: {
|
|
39
|
-
input: function(
|
|
40
|
-
|
|
41
|
+
"input": function($event) {
|
|
42
|
+
if ($event.target.composing)
|
|
43
|
+
return;
|
|
44
|
+
_vm.keyword = $event.target.value;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
})]),
|
|
47
|
+
})]), _c("ul", {
|
|
44
48
|
ref: "ul",
|
|
45
49
|
staticStyle: {
|
|
46
50
|
"list-style-type": "none",
|
|
47
|
-
flex: "1",
|
|
48
|
-
overflow: "auto"
|
|
51
|
+
"flex": "1",
|
|
52
|
+
"overflow": "auto"
|
|
49
53
|
}
|
|
50
|
-
}, [
|
|
51
|
-
return
|
|
52
|
-
key:
|
|
54
|
+
}, [_vm.filterList.length ? _vm._l(_vm.filterList, function(item, index) {
|
|
55
|
+
return _c("li", {
|
|
56
|
+
key: item.name + index,
|
|
53
57
|
staticClass: "search-li",
|
|
54
58
|
attrs: {
|
|
55
|
-
id: `item-${
|
|
59
|
+
"id": `item-${index}`
|
|
56
60
|
},
|
|
57
61
|
on: {
|
|
58
|
-
mousemove: function(
|
|
59
|
-
return
|
|
62
|
+
"mousemove": function($event) {
|
|
63
|
+
return _vm.mouseHoverItem(item, index);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
}, [
|
|
66
|
+
}, [_c("a", {
|
|
63
67
|
class: ["search-item", {
|
|
64
|
-
active:
|
|
68
|
+
active: _vm.currentIndex === index
|
|
65
69
|
}],
|
|
66
70
|
attrs: {
|
|
67
|
-
target:
|
|
68
|
-
rel: "noopener noreferrer",
|
|
69
|
-
href:
|
|
71
|
+
"target": item.url ? "_blank" : "",
|
|
72
|
+
"rel": "noopener noreferrer",
|
|
73
|
+
"href": item.url ? item.url : "javascript:void(0)"
|
|
70
74
|
},
|
|
71
75
|
on: {
|
|
72
|
-
click: function(
|
|
73
|
-
return
|
|
76
|
+
"click": function($event) {
|
|
77
|
+
return _vm.onItemClick(item);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
|
-
}, [
|
|
80
|
+
}, [_c("div", {
|
|
77
81
|
staticClass: "search-icon"
|
|
78
|
-
}, [
|
|
79
|
-
class:
|
|
80
|
-
})]),
|
|
82
|
+
}, [_c("i", {
|
|
83
|
+
class: item.icon || "el-icon-menu"
|
|
84
|
+
})]), _c("div", {
|
|
81
85
|
staticStyle: {
|
|
82
|
-
flex: "1",
|
|
86
|
+
"flex": "1",
|
|
83
87
|
"text-align": "left",
|
|
84
|
-
padding: "0 10px",
|
|
88
|
+
"padding": "0 10px",
|
|
85
89
|
"overflow-x": "hidden",
|
|
86
90
|
"box-sizing": "border-box"
|
|
87
91
|
}
|
|
88
|
-
}, [
|
|
92
|
+
}, [_c("p", {
|
|
89
93
|
staticStyle: {
|
|
90
94
|
"margin-bottom": "4px",
|
|
91
95
|
"font-size": "16px"
|
|
92
96
|
}
|
|
93
|
-
}, [
|
|
97
|
+
}, [_vm._v(_vm._s(item.name))]), _c("p", {
|
|
94
98
|
staticClass: "url"
|
|
95
|
-
}, [
|
|
99
|
+
}, [_vm._v(_vm._s(item.url || item.path))])]), _c("div", {
|
|
96
100
|
staticClass: "search-icon search-action"
|
|
97
|
-
}, [
|
|
101
|
+
}, [_c("svg", {
|
|
98
102
|
staticClass: "action",
|
|
99
103
|
attrs: {
|
|
100
|
-
width: "20",
|
|
101
|
-
height: "20",
|
|
102
|
-
viewBox: "0 0 20 20"
|
|
104
|
+
"width": "20",
|
|
105
|
+
"height": "20",
|
|
106
|
+
"viewBox": "0 0 20 20"
|
|
103
107
|
}
|
|
104
|
-
}, [
|
|
108
|
+
}, [_c("g", {
|
|
105
109
|
attrs: {
|
|
106
|
-
stroke: "currentColor",
|
|
107
|
-
fill: "none",
|
|
110
|
+
"stroke": "currentColor",
|
|
111
|
+
"fill": "none",
|
|
108
112
|
"fill-rule": "evenodd",
|
|
109
113
|
"stroke-linecap": "round",
|
|
110
114
|
"stroke-linejoin": "round"
|
|
111
115
|
}
|
|
112
|
-
}, [
|
|
116
|
+
}, [_c("path", {
|
|
113
117
|
attrs: {
|
|
114
|
-
d: "M18 3v4c0 2-2 4-4 4H2"
|
|
118
|
+
"d": "M18 3v4c0 2-2 4-4 4H2"
|
|
115
119
|
}
|
|
116
|
-
}),
|
|
120
|
+
}), _c("path", {
|
|
117
121
|
attrs: {
|
|
118
|
-
d: "M8 17l-6-6 6-6"
|
|
122
|
+
"d": "M8 17l-6-6 6-6"
|
|
119
123
|
}
|
|
120
124
|
})])])])])]);
|
|
121
|
-
}) :
|
|
125
|
+
}) : _vm.evalResult !== "" ? _c("li", {
|
|
122
126
|
staticClass: "search-li",
|
|
123
127
|
on: {
|
|
124
|
-
click:
|
|
125
|
-
mousemove: function(
|
|
126
|
-
return
|
|
128
|
+
"click": _vm.copyEvalResult,
|
|
129
|
+
"mousemove": function($event) {
|
|
130
|
+
return _vm.mouseHoverItem({}, -1);
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
|
-
}, [
|
|
133
|
+
}, [_c("a", {
|
|
130
134
|
class: ["search-item", {
|
|
131
|
-
active:
|
|
135
|
+
active: _vm.currentIndex === -1
|
|
132
136
|
}],
|
|
133
137
|
attrs: {
|
|
134
|
-
rel: "noopener noreferrer",
|
|
135
|
-
href: "javascript:void(0)"
|
|
138
|
+
"rel": "noopener noreferrer",
|
|
139
|
+
"href": "javascript:void(0)"
|
|
136
140
|
}
|
|
137
|
-
}, [
|
|
141
|
+
}, [_vm._m(0), _c("div", {
|
|
138
142
|
staticStyle: {
|
|
139
|
-
flex: "1",
|
|
143
|
+
"flex": "1",
|
|
140
144
|
"text-align": "left",
|
|
141
|
-
padding: "0 10px",
|
|
145
|
+
"padding": "0 10px",
|
|
142
146
|
"overflow-x": "hidden",
|
|
143
147
|
"box-sizing": "border-box"
|
|
144
148
|
}
|
|
145
|
-
}, [
|
|
149
|
+
}, [_c("p", {
|
|
146
150
|
staticStyle: {
|
|
147
151
|
"margin-bottom": "4px",
|
|
148
152
|
"font-size": "16px"
|
|
149
153
|
}
|
|
150
|
-
}, [
|
|
154
|
+
}, [_vm._v("Result: " + _vm._s(_vm.evalResult))]), _c("p", {
|
|
151
155
|
staticClass: "url"
|
|
152
|
-
}, [
|
|
156
|
+
}, [_vm._v("点击或这按 Enter 键复制")])]), _c("div", {
|
|
153
157
|
staticClass: "search-icon search-action"
|
|
154
|
-
}, [
|
|
158
|
+
}, [_c("svg", {
|
|
155
159
|
staticClass: "action",
|
|
156
160
|
attrs: {
|
|
157
|
-
width: "20",
|
|
158
|
-
height: "20",
|
|
159
|
-
viewBox: "0 0 20 20"
|
|
161
|
+
"width": "20",
|
|
162
|
+
"height": "20",
|
|
163
|
+
"viewBox": "0 0 20 20"
|
|
160
164
|
}
|
|
161
|
-
}, [
|
|
165
|
+
}, [_c("g", {
|
|
162
166
|
attrs: {
|
|
163
|
-
stroke: "currentColor",
|
|
164
|
-
fill: "none",
|
|
167
|
+
"stroke": "currentColor",
|
|
168
|
+
"fill": "none",
|
|
165
169
|
"fill-rule": "evenodd",
|
|
166
170
|
"stroke-linecap": "round",
|
|
167
171
|
"stroke-linejoin": "round"
|
|
168
172
|
}
|
|
169
|
-
}, [
|
|
173
|
+
}, [_c("path", {
|
|
170
174
|
attrs: {
|
|
171
|
-
d: "M18 3v4c0 2-2 4-4 4H2"
|
|
175
|
+
"d": "M18 3v4c0 2-2 4-4 4H2"
|
|
172
176
|
}
|
|
173
|
-
}),
|
|
177
|
+
}), _c("path", {
|
|
174
178
|
attrs: {
|
|
175
|
-
d: "M8 17l-6-6 6-6"
|
|
179
|
+
"d": "M8 17l-6-6 6-6"
|
|
176
180
|
}
|
|
177
|
-
})])])])])]) :
|
|
181
|
+
})])])])])]) : _c("li", {
|
|
178
182
|
staticStyle: {
|
|
179
|
-
height: "100%",
|
|
180
|
-
display: "flex",
|
|
183
|
+
"height": "100%",
|
|
184
|
+
"display": "flex",
|
|
181
185
|
"align-items": "center",
|
|
182
186
|
"justify-content": "center",
|
|
183
|
-
color: "#808080"
|
|
187
|
+
"color": "#808080"
|
|
184
188
|
}
|
|
185
|
-
}, [
|
|
189
|
+
}, [_vm._v(" Sorry,no result ! ")])], 2), _c("div", {
|
|
186
190
|
staticClass: "footer-tips"
|
|
187
|
-
}, [
|
|
191
|
+
}, [_c("span", {
|
|
188
192
|
staticClass: "keyboard-key"
|
|
189
|
-
}, [
|
|
193
|
+
}, [_c("svg", {
|
|
190
194
|
attrs: {
|
|
191
|
-
width: "15",
|
|
192
|
-
height: "15"
|
|
195
|
+
"width": "15",
|
|
196
|
+
"height": "15"
|
|
193
197
|
}
|
|
194
|
-
}, [
|
|
198
|
+
}, [_c("g", {
|
|
195
199
|
attrs: {
|
|
196
|
-
fill: "none",
|
|
197
|
-
stroke: "currentColor",
|
|
200
|
+
"fill": "none",
|
|
201
|
+
"stroke": "currentColor",
|
|
198
202
|
"stroke-linecap": "round",
|
|
199
203
|
"stroke-linejoin": "round",
|
|
200
204
|
"stroke-width": "1.2"
|
|
201
205
|
}
|
|
202
|
-
}, [
|
|
206
|
+
}, [_c("path", {
|
|
203
207
|
attrs: {
|
|
204
|
-
d: "M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"
|
|
208
|
+
"d": "M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"
|
|
205
209
|
}
|
|
206
|
-
})])])]),
|
|
210
|
+
})])])]), _c("span", {
|
|
207
211
|
staticStyle: {
|
|
208
212
|
"font-size": "12px",
|
|
209
213
|
"margin-right": "20px"
|
|
210
214
|
}
|
|
211
|
-
}, [
|
|
215
|
+
}, [_vm._v("选择")]), _c("span", {
|
|
212
216
|
staticClass: "keyboard-key"
|
|
213
|
-
}, [
|
|
217
|
+
}, [_c("svg", {
|
|
214
218
|
attrs: {
|
|
215
|
-
width: "15",
|
|
216
|
-
height: "15"
|
|
219
|
+
"width": "15",
|
|
220
|
+
"height": "15"
|
|
217
221
|
}
|
|
218
|
-
}, [
|
|
222
|
+
}, [_c("g", {
|
|
219
223
|
attrs: {
|
|
220
|
-
fill: "none",
|
|
221
|
-
stroke: "currentColor",
|
|
224
|
+
"fill": "none",
|
|
225
|
+
"stroke": "currentColor",
|
|
222
226
|
"stroke-linecap": "round",
|
|
223
227
|
"stroke-linejoin": "round",
|
|
224
228
|
"stroke-width": "1.2"
|
|
225
229
|
}
|
|
226
|
-
}, [
|
|
230
|
+
}, [_c("path", {
|
|
227
231
|
attrs: {
|
|
228
|
-
d: "M7.5 3.5v8M10.5 8.5l-3 3-3-3"
|
|
232
|
+
"d": "M7.5 3.5v8M10.5 8.5l-3 3-3-3"
|
|
229
233
|
}
|
|
230
|
-
})])])]),
|
|
234
|
+
})])])]), _c("span", {
|
|
231
235
|
staticClass: "keyboard-key"
|
|
232
|
-
}, [
|
|
236
|
+
}, [_c("svg", {
|
|
233
237
|
attrs: {
|
|
234
|
-
width: "15",
|
|
235
|
-
height: "15"
|
|
238
|
+
"width": "15",
|
|
239
|
+
"height": "15"
|
|
236
240
|
}
|
|
237
|
-
}, [
|
|
241
|
+
}, [_c("g", {
|
|
238
242
|
attrs: {
|
|
239
|
-
fill: "none",
|
|
240
|
-
stroke: "currentColor",
|
|
243
|
+
"fill": "none",
|
|
244
|
+
"stroke": "currentColor",
|
|
241
245
|
"stroke-linecap": "round",
|
|
242
246
|
"stroke-linejoin": "round",
|
|
243
247
|
"stroke-width": "1.2"
|
|
244
248
|
}
|
|
245
|
-
}, [
|
|
249
|
+
}, [_c("path", {
|
|
246
250
|
attrs: {
|
|
247
|
-
d: "M7.5 11.5v-8M10.5 6.5l-3-3-3 3"
|
|
251
|
+
"d": "M7.5 11.5v-8M10.5 6.5l-3-3-3 3"
|
|
248
252
|
}
|
|
249
|
-
})])])]),
|
|
253
|
+
})])])]), _c("span", {
|
|
250
254
|
staticStyle: {
|
|
251
255
|
"font-size": "12px",
|
|
252
256
|
"margin-right": "20px"
|
|
253
257
|
}
|
|
254
|
-
}, [
|
|
258
|
+
}, [_vm._v("切换")]), _c("span", {
|
|
255
259
|
staticClass: "keyboard-key"
|
|
256
|
-
}, [
|
|
260
|
+
}, [_c("svg", {
|
|
257
261
|
attrs: {
|
|
258
|
-
width: "15",
|
|
259
|
-
height: "15"
|
|
262
|
+
"width": "15",
|
|
263
|
+
"height": "15"
|
|
260
264
|
}
|
|
261
|
-
}, [
|
|
265
|
+
}, [_c("g", {
|
|
262
266
|
attrs: {
|
|
263
|
-
fill: "none",
|
|
264
|
-
stroke: "currentColor",
|
|
267
|
+
"fill": "none",
|
|
268
|
+
"stroke": "currentColor",
|
|
265
269
|
"stroke-linecap": "round",
|
|
266
270
|
"stroke-linejoin": "round",
|
|
267
271
|
"stroke-width": "1.2"
|
|
268
272
|
}
|
|
269
|
-
}, [
|
|
273
|
+
}, [_c("path", {
|
|
270
274
|
attrs: {
|
|
271
|
-
d: "M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"
|
|
275
|
+
"d": "M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"
|
|
272
276
|
}
|
|
273
|
-
})])])]),
|
|
277
|
+
})])])]), _c("span", {
|
|
274
278
|
staticStyle: {
|
|
275
279
|
"font-size": "12px"
|
|
276
280
|
}
|
|
277
|
-
}, [
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
}, [_vm._v("关闭")])])]);
|
|
282
|
+
};
|
|
283
|
+
var staticRenderFns = [function() {
|
|
284
|
+
var _vm = this;
|
|
285
|
+
var _h = _vm.$createElement;
|
|
286
|
+
var _c = _vm._self._c || _h;
|
|
287
|
+
return _c("div", {
|
|
281
288
|
staticClass: "search-icon"
|
|
282
|
-
}, [
|
|
289
|
+
}, [_c("i", {
|
|
283
290
|
staticClass: "fa fa-table"
|
|
284
291
|
})]);
|
|
285
292
|
}];
|
|
286
|
-
const SearchPopover_vue_vue_type_style_index_0_lang = ""
|
|
293
|
+
const SearchPopover_vue_vue_type_style_index_0_lang = "";
|
|
294
|
+
const __vue2_script = {
|
|
287
295
|
name: "SearchPopover",
|
|
288
296
|
directives: {
|
|
289
297
|
ClickOutside
|
|
@@ -296,7 +304,7 @@ const SearchPopover_vue_vue_type_style_index_0_lang = "", __vue2_script = {
|
|
|
296
304
|
},
|
|
297
305
|
data() {
|
|
298
306
|
return {
|
|
299
|
-
showPopover:
|
|
307
|
+
showPopover: false,
|
|
300
308
|
keyword: "",
|
|
301
309
|
currentIndex: 0,
|
|
302
310
|
last: 0
|
|
@@ -304,26 +312,33 @@ const SearchPopover_vue_vue_type_style_index_0_lang = "", __vue2_script = {
|
|
|
304
312
|
},
|
|
305
313
|
computed: {
|
|
306
314
|
filterList() {
|
|
307
|
-
return this.services.filter((
|
|
315
|
+
return this.services.filter((value) => value.name.indexOf(this.keyword) > -1);
|
|
308
316
|
},
|
|
309
317
|
currentItem() {
|
|
310
|
-
var
|
|
311
|
-
return (
|
|
318
|
+
var _a;
|
|
319
|
+
return (_a = this.filterList) == null ? void 0 : _a[this.currentIndex];
|
|
312
320
|
},
|
|
313
321
|
evalResult() {
|
|
314
322
|
try {
|
|
315
323
|
return eval(this.keyword);
|
|
316
|
-
} catch (
|
|
324
|
+
} catch (e) {
|
|
317
325
|
return "";
|
|
318
326
|
}
|
|
319
327
|
}
|
|
320
328
|
},
|
|
321
329
|
watch: {
|
|
322
330
|
keyword() {
|
|
323
|
-
this.currentIndex = 0
|
|
331
|
+
this.currentIndex = 0;
|
|
332
|
+
if (!this.currentItem && this.currentIndex !== -1) {
|
|
333
|
+
this.currentIndex = -1;
|
|
334
|
+
}
|
|
324
335
|
},
|
|
325
|
-
showPopover(
|
|
326
|
-
|
|
336
|
+
showPopover(newVal) {
|
|
337
|
+
if (newVal) {
|
|
338
|
+
document.body.style.overflow = "hidden";
|
|
339
|
+
} else {
|
|
340
|
+
document.body.style.overflow = "";
|
|
341
|
+
}
|
|
327
342
|
}
|
|
328
343
|
},
|
|
329
344
|
mounted() {
|
|
@@ -333,55 +348,98 @@ const SearchPopover_vue_vue_type_style_index_0_lang = "", __vue2_script = {
|
|
|
333
348
|
window.removeEventListener("keydown", this.keydown);
|
|
334
349
|
},
|
|
335
350
|
methods: {
|
|
336
|
-
async onItemClick(
|
|
337
|
-
|
|
351
|
+
async onItemClick(item) {
|
|
352
|
+
if (item.path) {
|
|
353
|
+
this.hidePopover();
|
|
354
|
+
await this.$router.push(item.path);
|
|
355
|
+
}
|
|
338
356
|
},
|
|
339
357
|
copyEvalResult() {
|
|
340
358
|
return copy(this.evalResult);
|
|
341
359
|
},
|
|
342
360
|
hidePopover() {
|
|
343
|
-
this.showPopover =
|
|
361
|
+
this.showPopover = false;
|
|
344
362
|
},
|
|
345
363
|
displayPopover() {
|
|
346
|
-
this.showPopover =
|
|
364
|
+
this.showPopover = true;
|
|
347
365
|
},
|
|
348
|
-
mouseHoverItem(
|
|
349
|
-
this.currentIndex =
|
|
366
|
+
mouseHoverItem(item, index) {
|
|
367
|
+
this.currentIndex = index;
|
|
350
368
|
},
|
|
351
|
-
async keydown(
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
|
|
369
|
+
async keydown(event) {
|
|
370
|
+
if (event.key === "Shift") {
|
|
371
|
+
const cost = Date.now() - this.last;
|
|
372
|
+
if (cost > 0 && cost < 500) {
|
|
373
|
+
this.showPopover = true;
|
|
374
|
+
await this.$nextTick();
|
|
375
|
+
this.$refs.searchInput.focus();
|
|
376
|
+
} else {
|
|
377
|
+
this.last = Date.now();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (this.showPopover === true) {
|
|
381
|
+
if (event.key === "Escape") {
|
|
382
|
+
this.hidePopover();
|
|
383
|
+
}
|
|
384
|
+
if (event.key === "Enter") {
|
|
385
|
+
if (this.currentItem) {
|
|
386
|
+
if (this.currentItem.url) {
|
|
387
|
+
window.open(this.currentItem.url, "_blank");
|
|
388
|
+
this.hidePopover();
|
|
389
|
+
} else if (this.currentItem.path) {
|
|
390
|
+
await this.onItemClick(this.currentItem);
|
|
391
|
+
}
|
|
392
|
+
} else {
|
|
393
|
+
this.copyEvalResult();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (event.key === "ArrowUp") {
|
|
397
|
+
this.currentIndex--;
|
|
398
|
+
if (this.currentIndex < 0) {
|
|
399
|
+
this.currentIndex = this.filterList.length - 1;
|
|
400
|
+
}
|
|
401
|
+
this.scrollIntoView(this.currentIndex);
|
|
402
|
+
}
|
|
403
|
+
if (event.key === "ArrowDown") {
|
|
404
|
+
this.currentIndex++;
|
|
405
|
+
if (this.currentIndex >= this.filterList.length) {
|
|
406
|
+
this.currentIndex = 0;
|
|
407
|
+
}
|
|
408
|
+
this.scrollIntoView(this.currentIndex);
|
|
409
|
+
}
|
|
355
410
|
}
|
|
356
|
-
this.showPopover === !0 && (t.key === "Escape" && this.hidePopover(), t.key === "Enter" && (this.currentItem ? this.currentItem.url ? (window.open(this.currentItem.url, "_blank"), this.hidePopover()) : this.currentItem.path && await this.onItemClick(this.currentItem) : this.copyEvalResult()), t.key === "ArrowUp" && (this.currentIndex--, this.currentIndex < 0 && (this.currentIndex = this.filterList.length - 1), this.scrollIntoView(this.currentIndex)), t.key === "ArrowDown" && (this.currentIndex++, this.currentIndex >= this.filterList.length && (this.currentIndex = 0), this.scrollIntoView(this.currentIndex)));
|
|
357
411
|
},
|
|
358
|
-
scrollIntoView(
|
|
359
|
-
if (
|
|
412
|
+
scrollIntoView(index) {
|
|
413
|
+
if (index === 0) {
|
|
360
414
|
this.$refs.ul.scrollTop = 0;
|
|
361
415
|
return;
|
|
362
416
|
}
|
|
363
|
-
if (
|
|
417
|
+
if (index === this.filterList.length) {
|
|
364
418
|
this.$refs.ul.scrollTop = this.$refs.ul.scrollHeight;
|
|
365
419
|
return;
|
|
366
420
|
}
|
|
367
|
-
const
|
|
368
|
-
isInContainer(
|
|
421
|
+
const item = this.$refs.ul.querySelector(`#item-${index}`);
|
|
422
|
+
if (!isInContainer(item, this.$refs.ul, { topOffset: -78, bottomOffset: 78 })) {
|
|
423
|
+
this.$refs.ul.scrollTop = item.offsetTop - item.clientHeight + 20;
|
|
424
|
+
}
|
|
369
425
|
}
|
|
370
426
|
}
|
|
371
|
-
}
|
|
427
|
+
};
|
|
428
|
+
const __cssModules = {};
|
|
372
429
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
373
430
|
__vue2_script,
|
|
374
431
|
render,
|
|
375
432
|
staticRenderFns,
|
|
376
|
-
|
|
433
|
+
false,
|
|
377
434
|
__vue2_injectStyles,
|
|
378
435
|
null,
|
|
379
436
|
null,
|
|
380
437
|
null
|
|
381
438
|
);
|
|
382
|
-
function __vue2_injectStyles(
|
|
383
|
-
for (let
|
|
384
|
-
this[
|
|
439
|
+
function __vue2_injectStyles(context) {
|
|
440
|
+
for (let o in __cssModules) {
|
|
441
|
+
this[o] = __cssModules[o];
|
|
442
|
+
}
|
|
385
443
|
}
|
|
386
444
|
const SearchPopover = /* @__PURE__ */ function() {
|
|
387
445
|
return __component__.exports;
|