@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.
Files changed (172) hide show
  1. package/dist/chunks/3d28cc08.js +57 -0
  2. package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
  3. package/dist/chunks/5d33812d.js +147 -0
  4. package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
  5. package/dist/chunks/9d848bf6.js +99 -0
  6. package/dist/chunks/a0bb327b.js +96 -0
  7. package/dist/chunks/a8891d2c.js +30 -0
  8. package/dist/chunks/c69d5628.js +248 -0
  9. package/dist/chunks/de9fe802.js +24 -0
  10. package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
  11. package/dist/components/address-input/index.js +56 -43
  12. package/dist/components/address-input/style.css +15 -1
  13. package/dist/components/aside-menu/index.js +36 -30
  14. package/dist/components/aside-menu/style.css +9 -1
  15. package/dist/components/awesome-button/index.js +35 -32
  16. package/dist/components/base.css +66 -1
  17. package/dist/components/capsule-tab/index.js +33 -27
  18. package/dist/components/capsule-tab/style.css +32 -1
  19. package/dist/components/chunk-file-uploader/index.js +88 -54
  20. package/dist/components/chunk-file-uploader/style.css +4 -1
  21. package/dist/components/chunk-file-uploader-button/index.js +31 -25
  22. package/dist/components/chunk-file-uploader-button/style.css +17 -1
  23. package/dist/components/chunk-file-uploader-drop/index.js +42 -28
  24. package/dist/components/chunk-file-uploader-drop/style.css +12 -1
  25. package/dist/components/chunk-file-uploader-file/index.js +212 -134
  26. package/dist/components/chunk-file-uploader-file/style.css +125 -1
  27. package/dist/components/chunk-file-uploader-files/index.js +34 -28
  28. package/dist/components/chunk-file-uploader-files/style.css +9 -1
  29. package/dist/components/chunk-file-uploader-list/index.js +35 -29
  30. package/dist/components/chunk-file-uploader-list/style.css +9 -1
  31. package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
  32. package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
  33. package/dist/components/code-mirror-editor/index.js +181 -153
  34. package/dist/components/code-mirror-editor/style.css +17 -1
  35. package/dist/components/color-picker/index.js +68 -49
  36. package/dist/components/confirm-button/index.js +21 -19
  37. package/dist/components/confirmable/index.js +19 -18
  38. package/dist/components/context-menu/index.js +130 -108
  39. package/dist/components/context-menu/style.css +88 -1
  40. package/dist/components/custom-scrollbar/index.js +67 -49
  41. package/dist/components/data-table-picker/index.js +81 -62
  42. package/dist/components/dynamic-table/index.js +113 -89
  43. package/dist/components/dynamic-table/style.css +30 -1
  44. package/dist/components/e-charts/index.js +201 -120
  45. package/dist/components/e-charts/style.css +10 -1
  46. package/dist/components/editable-progress/index.js +93 -60
  47. package/dist/components/editable-progress/style.css +37 -1
  48. package/dist/components/editable-tree/index.js +638 -423
  49. package/dist/components/editable-tree/style.css +82 -1
  50. package/dist/components/egd-collapse/index.js +46 -33
  51. package/dist/components/egd-collapse-item/index.js +76 -60
  52. package/dist/components/element-dialog/index.js +147 -95
  53. package/dist/components/element-dialog/style.css +102 -1
  54. package/dist/components/empty-view/index.js +34 -28
  55. package/dist/components/empty-view/style.css +17 -1
  56. package/dist/components/error-view/index.js +32 -26
  57. package/dist/components/error-view/style.css +17 -1
  58. package/dist/components/flex-column/index.js +40 -25
  59. package/dist/components/flex-item/index.js +57 -29
  60. package/dist/components/flex-row/index.js +40 -25
  61. package/dist/components/flex-scroller/index.js +32 -26
  62. package/dist/components/flex-scroller/style.css +20 -1
  63. package/dist/components/form-button/index.js +38 -34
  64. package/dist/components/form-cascader/index.js +81 -71
  65. package/dist/components/form-checkbox-group/index.js +113 -88
  66. package/dist/components/form-checkbox-group/style.css +51 -1
  67. package/dist/components/form-date-picker/index.js +132 -70
  68. package/dist/components/form-holder/index.js +39 -32
  69. package/dist/components/form-input/index.js +62 -56
  70. package/dist/components/form-input-email/index.js +60 -48
  71. package/dist/components/form-input-id-card/index.js +59 -53
  72. package/dist/components/form-input-number/index.js +68 -61
  73. package/dist/components/form-input-number/style.css +12 -1
  74. package/dist/components/form-input-phone-number/index.js +55 -49
  75. package/dist/components/form-input-time/index.js +59 -53
  76. package/dist/components/form-item/index.js +123 -80
  77. package/dist/components/form-item/style.css +11 -1
  78. package/dist/components/form-item-config-provider/index.js +26 -25
  79. package/dist/components/form-item-group/index.js +111 -85
  80. package/dist/components/form-item-group/style.css +30 -1
  81. package/dist/components/form-radio-group/index.js +104 -85
  82. package/dist/components/form-radio-group/style.css +53 -1
  83. package/dist/components/form-select/index.js +91 -76
  84. package/dist/components/form-switch/index.js +57 -51
  85. package/dist/components/form-textarea/index.js +57 -51
  86. package/dist/components/form-view/index.js +232 -165
  87. package/dist/components/form-view/style.css +158 -1
  88. package/dist/components/guide-steps/index.js +58 -44
  89. package/dist/components/guide-steps/style.css +34 -1
  90. package/dist/components/icon-card/index.js +35 -29
  91. package/dist/components/icon-card/style.css +56 -1
  92. package/dist/components/iframe-window/index.js +35 -29
  93. package/dist/components/iframe-window/style.css +20 -1
  94. package/dist/components/image-viewer/index.js +66 -48
  95. package/dist/components/image-viewer/style.css +21 -1
  96. package/dist/components/input-number/index.js +193 -127
  97. package/dist/components/input-number/style.css +15 -1
  98. package/dist/components/input-number-range/index.js +57 -45
  99. package/dist/components/input-number-range/style.css +12 -1
  100. package/dist/components/j-s-x-component/index.js +4 -4
  101. package/dist/components/keep-view-alive/index.js +120 -73
  102. package/dist/components/loading-view/index.js +32 -26
  103. package/dist/components/loading-view/style.css +17 -1
  104. package/dist/components/nav-bar/index.js +37 -27
  105. package/dist/components/nav-bar/style.css +17 -1
  106. package/dist/components/not-implement/index.js +31 -23
  107. package/dist/components/not-implement/style.css +15 -1
  108. package/dist/components/page/index.js +28 -22
  109. package/dist/components/page/style.css +12 -1
  110. package/dist/components/page-header/index.js +36 -30
  111. package/dist/components/page-header/style.css +14 -1
  112. package/dist/components/page-index/index.js +83 -62
  113. package/dist/components/page-index/style.css +23 -1
  114. package/dist/components/page-index-top/index.js +68 -53
  115. package/dist/components/page-skeleton/index.js +37 -31
  116. package/dist/components/page-skeleton/style.css +23 -1
  117. package/dist/components/page-skeleton-new/index.js +48 -42
  118. package/dist/components/page-skeleton-new/style.css +42 -1
  119. package/dist/components/pageable-table/index.js +253 -186
  120. package/dist/components/pageable-table/style.css +72 -1
  121. package/dist/components/pageable-view/index.js +199 -129
  122. package/dist/components/pageable-view/style.css +69 -1
  123. package/dist/components/photo-swipe/index.js +151 -110
  124. package/dist/components/photo-swipe/style.css +20 -1
  125. package/dist/components/resize-observer/index.js +68 -34
  126. package/dist/components/resize-observer/style.css +31 -1
  127. package/dist/components/search-popover/index.js +211 -153
  128. package/dist/components/search-popover/style.css +93 -1
  129. package/dist/components/sign-panel/index.js +142 -92
  130. package/dist/components/sign-panel/style.css +97 -1
  131. package/dist/components/split-pane/index.js +162 -101
  132. package/dist/components/split-pane/style.css +100 -1
  133. package/dist/components/stateful/index.js +34 -31
  134. package/dist/components/stateful/style.css +33 -1
  135. package/dist/components/static-pageable-table/index.js +44 -37
  136. package/dist/components/static-pageable-table/style.css +9 -1
  137. package/dist/components/swiper/index.js +150 -85
  138. package/dist/components/swiper/style.css +43 -1
  139. package/dist/components/tab/index.js +72 -54
  140. package/dist/components/tab/style.css +122 -1
  141. package/dist/components/tab-item/index.js +35 -30
  142. package/dist/components/table-column/index.js +32 -30
  143. package/dist/components/table-view/index.js +227 -156
  144. package/dist/components/table-view/style.css +95 -1
  145. package/dist/components/tag-render/index.js +58 -44
  146. package/dist/components/tag-render/style.css +33 -1
  147. package/dist/components/tinymce-editor/index.js +95 -79
  148. package/dist/components/tinymce-editor/style.css +43 -1
  149. package/dist/components/tinymce-wrapper/index.js +121 -92
  150. package/dist/components/tinymce-wrapper/style.css +36 -1
  151. package/dist/components/toolbar/index.js +84 -63
  152. package/dist/components/toolbar/style.css +39 -1
  153. package/dist/components/toolbar-button/index.js +48 -41
  154. package/dist/components/toolbar-button/style.css +21 -1
  155. package/dist/components/trigger/index.js +36 -29
  156. package/dist/components/vue-tags-input/index.js +308 -188
  157. package/dist/components/vue-tags-input/style.css +682 -1
  158. package/dist/components/watermark/index.js +37 -25
  159. package/dist/components/watermark/style.css +11 -1
  160. package/dist/components/x-dialog/index.js +93 -67
  161. package/dist/components/x-dialog/style.css +15 -1
  162. package/dist/index.css +1105 -193
  163. package/dist/index.es.js +7242 -4789
  164. package/package.json +2 -1
  165. package/web-types.json +1 -1
  166. package/dist/chunks/3a79781b.js +0 -75
  167. package/dist/chunks/5d4282fb.js +0 -30
  168. package/dist/chunks/76680a03.js +0 -24
  169. package/dist/chunks/8c0142e0.js +0 -81
  170. package/dist/chunks/97652d86.js +0 -26
  171. package/dist/chunks/b4acd3a6.js +0 -126
  172. 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/5d4282fb.js";
3
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
4
4
  var render = function() {
5
- var t = this, r = t.$createElement, e = t._self._c || r;
6
- return e("div", {
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: t.showPopover,
12
+ value: _vm.showPopover,
11
13
  expression: "showPopover"
12
14
  }, {
13
15
  name: "click-outside",
14
16
  rawName: "v-click-outside",
15
- value: t.hidePopover,
17
+ value: _vm.hidePopover,
16
18
  expression: "hidePopover"
17
19
  }],
18
20
  staticClass: "search-popover"
19
- }, [e("div", {
21
+ }, [_c("div", {
20
22
  staticStyle: {
21
- padding: "10px"
23
+ "padding": "10px"
22
24
  }
23
- }, [e("input", {
25
+ }, [_c("input", {
24
26
  directives: [{
25
27
  name: "model",
26
28
  rawName: "v-model",
27
- value: t.keyword,
29
+ value: _vm.keyword,
28
30
  expression: "keyword"
29
31
  }],
30
32
  ref: "searchInput",
31
33
  staticClass: "search-input",
32
34
  attrs: {
33
- placeholder: t.currentItem ? t.currentItem.name : "输入关键字搜索 ..."
35
+ "placeholder": _vm.currentItem ? _vm.currentItem.name : "输入关键字搜索 ..."
34
36
  },
35
37
  domProps: {
36
- value: t.keyword
38
+ "value": _vm.keyword
37
39
  },
38
40
  on: {
39
- input: function(s) {
40
- s.target.composing || (t.keyword = s.target.value);
41
+ "input": function($event) {
42
+ if ($event.target.composing)
43
+ return;
44
+ _vm.keyword = $event.target.value;
41
45
  }
42
46
  }
43
- })]), e("ul", {
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
- }, [t.filterList.length ? t._l(t.filterList, function(s, o) {
51
- return e("li", {
52
- key: s.name + o,
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-${o}`
59
+ "id": `item-${index}`
56
60
  },
57
61
  on: {
58
- mousemove: function(i) {
59
- return t.mouseHoverItem(s, o);
62
+ "mousemove": function($event) {
63
+ return _vm.mouseHoverItem(item, index);
60
64
  }
61
65
  }
62
- }, [e("a", {
66
+ }, [_c("a", {
63
67
  class: ["search-item", {
64
- active: t.currentIndex === o
68
+ active: _vm.currentIndex === index
65
69
  }],
66
70
  attrs: {
67
- target: s.url ? "_blank" : "",
68
- rel: "noopener noreferrer",
69
- href: s.url ? s.url : "javascript:void(0)"
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(i) {
73
- return t.onItemClick(s);
76
+ "click": function($event) {
77
+ return _vm.onItemClick(item);
74
78
  }
75
79
  }
76
- }, [e("div", {
80
+ }, [_c("div", {
77
81
  staticClass: "search-icon"
78
- }, [e("i", {
79
- class: s.icon || "el-icon-menu"
80
- })]), e("div", {
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
- }, [e("p", {
92
+ }, [_c("p", {
89
93
  staticStyle: {
90
94
  "margin-bottom": "4px",
91
95
  "font-size": "16px"
92
96
  }
93
- }, [t._v(t._s(s.name))]), e("p", {
97
+ }, [_vm._v(_vm._s(item.name))]), _c("p", {
94
98
  staticClass: "url"
95
- }, [t._v(t._s(s.url || s.path))])]), e("div", {
99
+ }, [_vm._v(_vm._s(item.url || item.path))])]), _c("div", {
96
100
  staticClass: "search-icon search-action"
97
- }, [e("svg", {
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
- }, [e("g", {
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
- }, [e("path", {
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
- }), e("path", {
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
- }) : t.evalResult !== "" ? e("li", {
125
+ }) : _vm.evalResult !== "" ? _c("li", {
122
126
  staticClass: "search-li",
123
127
  on: {
124
- click: t.copyEvalResult,
125
- mousemove: function(s) {
126
- return t.mouseHoverItem({}, -1);
128
+ "click": _vm.copyEvalResult,
129
+ "mousemove": function($event) {
130
+ return _vm.mouseHoverItem({}, -1);
127
131
  }
128
132
  }
129
- }, [e("a", {
133
+ }, [_c("a", {
130
134
  class: ["search-item", {
131
- active: t.currentIndex === -1
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
- }, [t._m(0), e("div", {
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
- }, [e("p", {
149
+ }, [_c("p", {
146
150
  staticStyle: {
147
151
  "margin-bottom": "4px",
148
152
  "font-size": "16px"
149
153
  }
150
- }, [t._v("Result: " + t._s(t.evalResult))]), e("p", {
154
+ }, [_vm._v("Result: " + _vm._s(_vm.evalResult))]), _c("p", {
151
155
  staticClass: "url"
152
- }, [t._v("点击或这按 Enter 键复制")])]), e("div", {
156
+ }, [_vm._v("点击或这按 Enter 键复制")])]), _c("div", {
153
157
  staticClass: "search-icon search-action"
154
- }, [e("svg", {
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
- }, [e("g", {
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
- }, [e("path", {
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
- }), e("path", {
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
- })])])])])]) : e("li", {
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
- }, [t._v(" Sorry,no result ! ")])], 2), e("div", {
189
+ }, [_vm._v(" Sorry,no result ! ")])], 2), _c("div", {
186
190
  staticClass: "footer-tips"
187
- }, [e("span", {
191
+ }, [_c("span", {
188
192
  staticClass: "keyboard-key"
189
- }, [e("svg", {
193
+ }, [_c("svg", {
190
194
  attrs: {
191
- width: "15",
192
- height: "15"
195
+ "width": "15",
196
+ "height": "15"
193
197
  }
194
- }, [e("g", {
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
- }, [e("path", {
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
- })])])]), e("span", {
210
+ })])])]), _c("span", {
207
211
  staticStyle: {
208
212
  "font-size": "12px",
209
213
  "margin-right": "20px"
210
214
  }
211
- }, [t._v("选择")]), e("span", {
215
+ }, [_vm._v("选择")]), _c("span", {
212
216
  staticClass: "keyboard-key"
213
- }, [e("svg", {
217
+ }, [_c("svg", {
214
218
  attrs: {
215
- width: "15",
216
- height: "15"
219
+ "width": "15",
220
+ "height": "15"
217
221
  }
218
- }, [e("g", {
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
- }, [e("path", {
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
- })])])]), e("span", {
234
+ })])])]), _c("span", {
231
235
  staticClass: "keyboard-key"
232
- }, [e("svg", {
236
+ }, [_c("svg", {
233
237
  attrs: {
234
- width: "15",
235
- height: "15"
238
+ "width": "15",
239
+ "height": "15"
236
240
  }
237
- }, [e("g", {
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
- }, [e("path", {
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
- })])])]), e("span", {
253
+ })])])]), _c("span", {
250
254
  staticStyle: {
251
255
  "font-size": "12px",
252
256
  "margin-right": "20px"
253
257
  }
254
- }, [t._v("切换")]), e("span", {
258
+ }, [_vm._v("切换")]), _c("span", {
255
259
  staticClass: "keyboard-key"
256
- }, [e("svg", {
260
+ }, [_c("svg", {
257
261
  attrs: {
258
- width: "15",
259
- height: "15"
262
+ "width": "15",
263
+ "height": "15"
260
264
  }
261
- }, [e("g", {
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
- }, [e("path", {
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
- })])])]), e("span", {
277
+ })])])]), _c("span", {
274
278
  staticStyle: {
275
279
  "font-size": "12px"
276
280
  }
277
- }, [t._v("关闭")])])]);
278
- }, staticRenderFns = [function() {
279
- var t = this, r = t.$createElement, e = t._self._c || r;
280
- return e("div", {
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
- }, [e("i", {
289
+ }, [_c("i", {
283
290
  staticClass: "fa fa-table"
284
291
  })]);
285
292
  }];
286
- const SearchPopover_vue_vue_type_style_index_0_lang = "", __vue2_script = {
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: !1,
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((t) => t.name.indexOf(this.keyword) > -1);
315
+ return this.services.filter((value) => value.name.indexOf(this.keyword) > -1);
308
316
  },
309
317
  currentItem() {
310
- var t;
311
- return (t = this.filterList) == null ? void 0 : t[this.currentIndex];
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 (t) {
324
+ } catch (e) {
317
325
  return "";
318
326
  }
319
327
  }
320
328
  },
321
329
  watch: {
322
330
  keyword() {
323
- this.currentIndex = 0, !this.currentItem && this.currentIndex !== -1 && (this.currentIndex = -1);
331
+ this.currentIndex = 0;
332
+ if (!this.currentItem && this.currentIndex !== -1) {
333
+ this.currentIndex = -1;
334
+ }
324
335
  },
325
- showPopover(t) {
326
- t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
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(t) {
337
- t.path && (this.hidePopover(), await this.$router.push(t.path));
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 = !1;
361
+ this.showPopover = false;
344
362
  },
345
363
  displayPopover() {
346
- this.showPopover = !0;
364
+ this.showPopover = true;
347
365
  },
348
- mouseHoverItem(t, r) {
349
- this.currentIndex = r;
366
+ mouseHoverItem(item, index) {
367
+ this.currentIndex = index;
350
368
  },
351
- async keydown(t) {
352
- if (t.key === "Shift") {
353
- const r = Date.now() - this.last;
354
- r > 0 && r < 500 ? (this.showPopover = !0, await this.$nextTick(), this.$refs.searchInput.focus()) : this.last = Date.now();
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(t) {
359
- if (t === 0) {
412
+ scrollIntoView(index) {
413
+ if (index === 0) {
360
414
  this.$refs.ul.scrollTop = 0;
361
415
  return;
362
416
  }
363
- if (t === this.filterList.length) {
417
+ if (index === this.filterList.length) {
364
418
  this.$refs.ul.scrollTop = this.$refs.ul.scrollHeight;
365
419
  return;
366
420
  }
367
- const r = this.$refs.ul.querySelector(`#item-${t}`);
368
- isInContainer(r, this.$refs.ul, { topOffset: -78, bottomOffset: 78 }) || (this.$refs.ul.scrollTop = r.offsetTop - r.clientHeight + 20);
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
- }, __cssModules = {};
427
+ };
428
+ const __cssModules = {};
372
429
  var __component__ = /* @__PURE__ */ normalizeComponent(
373
430
  __vue2_script,
374
431
  render,
375
432
  staticRenderFns,
376
- !1,
433
+ false,
377
434
  __vue2_injectStyles,
378
435
  null,
379
436
  null,
380
437
  null
381
438
  );
382
- function __vue2_injectStyles(t) {
383
- for (let r in __cssModules)
384
- this[r] = __cssModules[r];
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;