eoss 0.1.0-alpha.20 → 0.1.0-alpha.21

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 (207) hide show
  1. package/lib/account-login.js +1943 -1890
  2. package/lib/alert.js +4 -4
  3. package/lib/aside.js +4 -4
  4. package/lib/autocomplete.js +4936 -4834
  5. package/lib/avatar.js +4 -4
  6. package/lib/backtop.js +4 -4
  7. package/lib/badge.js +4 -4
  8. package/lib/breadcrumb-item.js +6 -6
  9. package/lib/breadcrumb.js +7 -7
  10. package/lib/button-group.js +11 -14
  11. package/lib/button.js +6 -6
  12. package/lib/ca-login.js +2480 -2382
  13. package/lib/calendar.js +798 -798
  14. package/lib/card.js +4 -4
  15. package/lib/carousel-item.js +911 -813
  16. package/lib/carousel.js +1646 -1548
  17. package/lib/cascader-panel.js +2556 -2458
  18. package/lib/cascader.js +4546 -4444
  19. package/lib/checkbox-button.js +4 -4
  20. package/lib/checkbox-group.js +2894 -2841
  21. package/lib/checkbox.js +4 -4
  22. package/lib/col.js +2 -2
  23. package/lib/collapse-item.js +35159 -2572
  24. package/lib/collapse.js +35410 -2762
  25. package/lib/color-picker.js +494 -490
  26. package/lib/config/api.js +15 -1
  27. package/lib/container.js +4 -4
  28. package/lib/cron.js +4 -4
  29. package/lib/data-table.js +1895 -1842
  30. package/lib/date-picker.js +6422 -6320
  31. package/lib/dialog.js +2912 -2806
  32. package/lib/divider.js +4 -4
  33. package/lib/drawer.js +311 -299
  34. package/lib/dropdown-item.js +6 -6
  35. package/lib/dropdown-menu.js +539 -535
  36. package/lib/dropdown.js +2270 -2172
  37. package/lib/email-login.js +1783 -1730
  38. package/lib/empty.js +723 -0
  39. package/lib/eoss.common.js +63680 -56193
  40. package/lib/flip.js +4 -4
  41. package/lib/flow-group.js +2985 -2887
  42. package/lib/flow.js +28067 -28022
  43. package/lib/footer.js +4 -4
  44. package/lib/form-item.js +1935 -1837
  45. package/lib/form.js +9230 -9092
  46. package/lib/header.js +4 -4
  47. package/lib/icon.js +1708 -1590
  48. package/lib/icons.js +4 -4
  49. package/lib/image-viewer.js +1660 -1562
  50. package/lib/image.js +162 -162
  51. package/lib/index.js +1 -1
  52. package/lib/infinite-scroll.js +76 -76
  53. package/lib/input-number.js +172 -172
  54. package/lib/input.js +1362 -1264
  55. package/lib/link.js +4 -4
  56. package/lib/loading.js +321 -317
  57. package/lib/login.js +3306 -3300
  58. package/lib/lowcode.js +13320 -0
  59. package/lib/main.js +14465 -14339
  60. package/lib/marquee.js +1237 -1139
  61. package/lib/menu-item-group.js +119 -119
  62. package/lib/menu-item.js +114 -114
  63. package/lib/menu.js +6193 -6091
  64. package/lib/message-box.js +3582 -3480
  65. package/lib/message.js +2265 -2163
  66. package/lib/notification.js +2430 -2328
  67. package/lib/option-group.js +4 -4
  68. package/lib/option.js +842 -744
  69. package/lib/page-header.js +4 -4
  70. package/lib/pagination.js +1916 -1815
  71. package/lib/phone-login.js +1788 -1735
  72. package/lib/popconfirm.js +8 -8
  73. package/lib/popover.js +4559 -4457
  74. package/lib/progress.js +4 -4
  75. package/lib/qr-code.js +9 -9
  76. package/lib/qrcode-login.js +1600 -1543
  77. package/lib/radio-button.js +6 -6
  78. package/lib/radio-group.js +2142 -2089
  79. package/lib/radio.js +6 -6
  80. package/lib/rate.js +1226 -1128
  81. package/lib/row.js +2 -2
  82. package/lib/scrollbar.js +2695 -2597
  83. package/lib/select.js +5985 -5961
  84. package/lib/selector-panel.js +5239 -5186
  85. package/lib/selector.js +1712 -1659
  86. package/lib/slider.js +16 -16
  87. package/lib/step.js +35836 -2736
  88. package/lib/steps.js +1281 -1183
  89. package/lib/submenu.js +461 -457
  90. package/lib/switch.js +1010 -912
  91. package/lib/tab-pane.js +4 -4
  92. package/lib/table-column.js +2595 -2497
  93. package/lib/table.js +9225 -9239
  94. package/lib/tabs.js +2414 -2320
  95. package/lib/tag.js +4 -4
  96. package/lib/theme-chalk/account-login.css +1 -1
  97. package/lib/theme-chalk/autocomplete.css +1 -1
  98. package/lib/theme-chalk/base.css +1 -1
  99. package/lib/theme-chalk/cascader.css +1 -1
  100. package/lib/theme-chalk/date-picker.css +1 -1
  101. package/lib/theme-chalk/empty.css +1 -0
  102. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  103. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  104. package/lib/theme-chalk/form.css +1 -1
  105. package/lib/theme-chalk/icon.css +1 -1
  106. package/lib/theme-chalk/index.css +1 -1
  107. package/lib/theme-chalk/input-number.css +1 -1
  108. package/lib/theme-chalk/input.css +1 -1
  109. package/lib/theme-chalk/login.css +1 -1
  110. package/lib/theme-chalk/lowcode.css +1 -0
  111. package/lib/theme-chalk/main.css +1 -1
  112. package/lib/theme-chalk/message-box.css +1 -1
  113. package/lib/theme-chalk/pagination.css +1 -1
  114. package/lib/theme-chalk/qrcode-login.css +1 -1
  115. package/lib/theme-chalk/select.css +1 -1
  116. package/lib/theme-chalk/slider.css +1 -1
  117. package/lib/theme-chalk/tabs.css +1 -1
  118. package/lib/theme-chalk/time-picker.css +1 -1
  119. package/lib/theme-chalk/transfer.css +1 -1
  120. package/lib/time-picker.js +5823 -5819
  121. package/lib/time-select.js +3578 -3574
  122. package/lib/timeline-item.js +4 -4
  123. package/lib/timeline.js +4 -4
  124. package/lib/tips.js +1633 -1580
  125. package/lib/toolbar.js +213 -213
  126. package/lib/tooltip.js +4441 -4339
  127. package/lib/transfer.js +938 -840
  128. package/lib/tree-group.js +1875 -1757
  129. package/lib/tree.js +2626 -2573
  130. package/lib/upload.js +7209 -7156
  131. package/lib/utils/ajax.js +185 -243
  132. package/lib/utils/bus.js +2 -2
  133. package/lib/utils/popup/index.js +5 -1
  134. package/lib/utils/util.js +108 -11
  135. package/package.json +2 -2
  136. package/packages/button/src/button-group.vue +1 -4
  137. package/packages/collapse/src/collapse-item.vue +47 -33
  138. package/packages/dialog/src/dialog.vue +4 -1
  139. package/packages/drawer/src/drawer.vue +12 -4
  140. package/packages/empty/index.js +7 -0
  141. package/packages/empty/src/img-empty.vue +132 -0
  142. package/packages/empty/src/index.vue +49 -0
  143. package/packages/form/src/form-item-render.vue +16 -18
  144. package/packages/form/src/form.vue +27 -5
  145. package/packages/icons/src/icon.json +1 -1
  146. package/packages/login/src/login.vue +19 -21
  147. package/packages/login/src/mixins.js +2 -1
  148. package/packages/lowcode/index.js +5 -0
  149. package/packages/lowcode/src/aside.vue +331 -0
  150. package/packages/lowcode/src/attribute/bind.vue +441 -0
  151. package/packages/lowcode/src/attribute/dependency.vue +325 -0
  152. package/packages/lowcode/src/attribute/function.vue +112 -0
  153. package/packages/lowcode/src/attribute/property.vue +331 -0
  154. package/packages/lowcode/src/attribute/styles.vue +318 -0
  155. package/packages/lowcode/src/attribute.vue +135 -0
  156. package/packages/lowcode/src/canvas.vue +296 -0
  157. package/packages/lowcode/src/json.vue +32 -0
  158. package/packages/lowcode/src/lowcode.vue +539 -0
  159. package/packages/lowcode/src/modules.vue +93 -0
  160. package/packages/lowcode/src/pages.vue +91 -0
  161. package/packages/lowcode/src/render.vue +247 -0
  162. package/packages/lowcode/src/source.vue +32 -0
  163. package/packages/lowcode/src/toolbar.vue +162 -0
  164. package/packages/main/src/components/pages.vue +28 -2
  165. package/packages/main/src/components/set-menus.vue +3 -3
  166. package/packages/main/src/components/user.vue +6 -1
  167. package/packages/main/src/early.vue +2 -2
  168. package/packages/main/src/gzw.vue +55 -61
  169. package/packages/main/src/minxs.js +113 -36
  170. package/packages/pagination/src/pager.vue +2 -2
  171. package/packages/pagination/src/pagination.js +4 -1
  172. package/packages/qrcode-login/src/qrcode-login.vue +6 -2
  173. package/packages/select/src/select.vue +28 -6
  174. package/packages/steps/src/step.vue +7 -5
  175. package/packages/tabs/src/tab-nav.vue +1 -0
  176. package/packages/tabs/src/tabs.vue +0 -2
  177. package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
  178. package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
  179. package/packages/theme-chalk/gulpfile.js +3 -0
  180. package/packages/theme-chalk/src/account-login.scss +1 -0
  181. package/packages/theme-chalk/src/base.scss +1 -1
  182. package/packages/theme-chalk/src/common/var.scss +16 -0
  183. package/packages/theme-chalk/src/empty.scss +45 -0
  184. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  185. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  186. package/packages/theme-chalk/src/form.scss +1 -8
  187. package/packages/theme-chalk/src/icon.scss +30 -1
  188. package/packages/theme-chalk/src/index.scss +2 -0
  189. package/packages/theme-chalk/src/input-number.scss +0 -4
  190. package/packages/theme-chalk/src/input.scss +9 -0
  191. package/packages/theme-chalk/src/login.scss +32 -29
  192. package/packages/theme-chalk/src/lowcode.scss +461 -0
  193. package/packages/theme-chalk/src/main.scss +28 -65
  194. package/packages/theme-chalk/src/pagination.scss +4 -55
  195. package/packages/theme-chalk/src/qrcode-login.scss +3 -1
  196. package/packages/theme-chalk/src/tabs.scss +81 -50
  197. package/src/config/api.js +13 -0
  198. package/src/index.js +17 -4
  199. package/src/utils/ajax.js +61 -65
  200. package/src/utils/bus.js +2 -2
  201. package/src/utils/popup/index.js +5 -1
  202. package/src/utils/util.js +104 -7
  203. package/lib/index_/345/211/257/346/234/254.js +0 -583
  204. package/packages/dialog copy/index.js +0 -8
  205. package/packages/dialog copy/src/dialog.vue +0 -615
  206. package/src/index_/345/211/257/346/234/254.js +0 -359
  207. /package/{packages/form/src → src/components}/field-render.vue +0 -0
package/lib/dropdown.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 190);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 194);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -91,13 +91,13 @@ module.exports =
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return noop; });
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return noop; });
95
95
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return hasOwn; });
96
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toObject; });
96
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toObject; });
97
97
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getValueByPath; });
98
98
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return getPropByPath; });
99
99
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return generateId; });
100
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return valueEquals; });
100
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return valueEquals; });
101
101
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return escapeRegexpString; });
102
102
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return arrayFindIndex; });
103
103
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFind; });
@@ -111,12 +111,12 @@ module.exports =
111
111
  /* unused harmony export looseEqual */
112
112
  /* unused harmony export arrayEquals */
113
113
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEqual; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return rafThrottle; });
114
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return rafThrottle; });
115
115
  /* unused harmony export objToArray */
116
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return requestAnimationFrame; });
116
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return requestAnimationFrame; });
117
117
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return cancelAnimationFrame; });
118
118
  /* unused harmony export debounce */
119
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return throttle; });
119
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return throttle; });
120
120
  /* unused harmony export guid */
121
121
  /* unused harmony export uid */
122
122
  /* unused harmony export get */
@@ -150,7 +150,7 @@ module.exports =
150
150
  /* unused harmony export getValues */
151
151
  /* unused harmony export getZoom */
152
152
  /* unused harmony export getLength */
153
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return timestampUrl; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return timestampUrl; });
154
154
  /* unused harmony export hasChars */
155
155
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return identical; });
156
156
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return indexOfObj; });
@@ -159,41 +159,42 @@ module.exports =
159
159
  /* unused harmony export isFunction */
160
160
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isObjectEqual; });
161
161
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return joinUrl; });
162
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return layoutWaterfall; });
162
163
  /* unused harmony export loadJs */
163
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return loading; });
164
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return loading; });
164
165
  /* unused harmony export lowerCase */
165
166
  /* unused harmony export overbrim */
166
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return queryParams; });
167
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return queryParams; });
167
168
  /* unused harmony export receiveMessage */
168
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return renderIcon; });
169
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return renderIcon; });
169
170
  /* unused harmony export replenish */
170
171
  /* unused harmony export rmbToCapital */
171
172
  /* unused harmony export setScale */
172
173
  /* unused harmony export sendMessage */
173
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return setFavicon; });
174
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return setFavicon; });
174
175
  /* unused harmony export sum */
175
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return startWith; });
176
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return startWith; });
176
177
  /* unused harmony export takeLeft */
177
178
  /* unused harmony export takeRight */
178
179
  /* unused harmony export trimWhitespace */
179
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return toFixed; });
180
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toFixed; });
180
181
  /* unused harmony export toFunction */
181
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return updateTheme; });
182
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return updateTheme; });
182
183
  /* unused harmony export upperType */
183
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return urlJoinParams; });
184
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return uuid; });
185
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return watermark; });
184
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return urlJoinParams; });
185
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return uuid; });
186
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return watermark; });
186
187
  /* unused harmony export winTopOpen */
187
188
  /* unused harmony export confirm */
188
189
  /* unused harmony export success */
189
190
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return error; });
190
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return warning; });
191
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
191
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return warning; });
192
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
192
193
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
193
- /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
194
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
195
- /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
196
- /* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
194
+ /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
195
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
196
+ /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
197
+ /* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
197
198
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
198
199
 
199
200
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@@ -203,9 +204,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
203
204
 
204
205
 
205
206
 
206
- var _get = __webpack_require__(15);
207
- var _set = __webpack_require__(16);
208
- var _cloneDeep = __webpack_require__(17);
207
+ var _get = __webpack_require__(20);
208
+ var _set = __webpack_require__(21);
209
+ var _cloneDeep = __webpack_require__(22);
209
210
  var hasOwnProperty = Object.prototype.hasOwnProperty;
210
211
 
211
212
  // 导入date中的formatDate函数
@@ -1404,7 +1405,9 @@ var getObjectType = function getObjectType(obj) {
1404
1405
  * @return {Object|string} 参数对象或指定参数值
1405
1406
  **/
1406
1407
  var getParams = function getParams() {
1407
- var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1408
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1409
+
1410
+ var _ref5 = typeof options === 'string' ? { name: options } : options,
1408
1411
  url = _ref5.url,
1409
1412
  name = _ref5.name;
1410
1413
 
@@ -1816,10 +1819,7 @@ var indexOfObj = function indexOfObj(arry, target, key) {
1816
1819
  return _i3;
1817
1820
  }
1818
1821
  } else if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object') {
1819
- if (currentItem[currentKey] === undefined) {
1820
- throw new Error('\u5C5E\u6027' + currentKey + '\u4E0D\u5B58\u5728');
1821
- }
1822
- if (currentItem[currentKey] === target[currentKey]) {
1822
+ if (currentItem[currentKey] !== undefined && currentItem[currentKey] === target[currentKey]) {
1823
1823
  return _i3;
1824
1824
  }
1825
1825
  }
@@ -2014,7 +2014,105 @@ var joinUrl = function joinUrl(_ref8) {
2014
2014
  // 如果前缀类型无效,直接返回URL
2015
2015
  return url;
2016
2016
  };
2017
+ /**
2018
+ * layoutWaterfall
2019
+ * @desc 布布流布局计算
2020
+ * @author huangbo
2021
+ * @date 2022年5月7日
2022
+ * @param {String} url - JS文件地址
2023
+ * @param {Function} [callback] - 回调函数
2024
+ **/
2025
+ var layoutWaterfall = function layoutWaterfall(self, container, pages, columns, gap) {
2026
+ if (!container) return;
2027
+
2028
+ if (pages.length === 0) return;
2029
+
2030
+ // 获取容器实际内容宽度(减去 padding)
2031
+ var computedStyle = getComputedStyle(container);
2032
+ var paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
2033
+ var paddingRight = parseFloat(computedStyle.paddingRight) || 0;
2034
+ var paddingTop = parseFloat(computedStyle.paddingTop) || 0;
2035
+ var containerWidth = container.clientWidth - paddingLeft - paddingRight;
2036
+ if (containerWidth === 0) return;
2037
+
2038
+ // 计算每列宽度
2039
+ var columnWidth = (containerWidth - gap * (columns - 1)) / columns;
2040
+
2041
+ // 初始化每列高度数组(以 paddingTop 为起始偏移)
2042
+ var columnHeights = new Array(columns).fill(paddingTop);
2043
+
2044
+ // 遍历所有元素,分配到高度最小的列
2045
+ pages.forEach(function (item) {
2046
+ // 确保span在有效范围内
2047
+ var span = Math.max(1, Math.min(item.style ? item.style.span || item.span || 1 : item.span || 1, columns));
2048
+
2049
+ // 找到可以容纳当前元素span宽度的最小高度起始列
2050
+ var minHeight = Infinity;
2051
+ var startColumn = 0;
2052
+
2053
+ // 遍历所有可能的起始列,找到可以放置span列元素的位置
2054
+ for (var i = 0; i <= columns - span; i++) {
2055
+ // 计算当前连续span列的最大高度
2056
+ var currentMaxHeight = 0;
2057
+ for (var j = i; j < i + span; j++) {
2058
+ if (columnHeights[j] > currentMaxHeight) {
2059
+ currentMaxHeight = columnHeights[j];
2060
+ }
2061
+ }
2062
+
2063
+ // 找到最小的最大高度
2064
+ if (currentMaxHeight < minHeight) {
2065
+ minHeight = currentMaxHeight;
2066
+ startColumn = i;
2067
+ }
2068
+ }
2069
+
2070
+ // 计算元素宽度和位置
2071
+ var existingWidth = item.style && item.style.width ? parseInt(item.style.width, 10) : null;
2072
+ var hasSpan = item.style && item.style.span || item.span;
2073
+ var calculatedWidth = columnWidth * span + gap * (span - 1);
2074
+ var useCustomWidth = !hasSpan && existingWidth;
2075
+ var elementWidth = useCustomWidth ? existingWidth : calculatedWidth;
2076
+
2077
+ // 根据是否使用自定义宽度计算 left(加上 padding 偏移)
2078
+ var left = void 0;
2079
+ if (useCustomWidth) {
2080
+ // 自定义宽度:在分配的列范围内居中(取整避免亚像素)
2081
+ var columnSpaceWidth = columnWidth * span + gap * (span - 1);
2082
+ left = Math.round(paddingLeft + startColumn * columnWidth + startColumn * gap + (columnSpaceWidth - elementWidth) / 2);
2083
+ } else {
2084
+ // 标准 span 宽度:正常计算位置
2085
+ left = paddingLeft + startColumn * columnWidth + startColumn * gap;
2086
+ }
2087
+ var top = minHeight;
2017
2088
 
2089
+ // 设置元素样式(使用Vue的$set确保响应式)
2090
+ if (!item.style) {
2091
+ self.$set(item, 'style', {});
2092
+ }
2093
+ var height = item.style.height ? parseInt(item.style.height, 10) : 30;
2094
+ self.$set(item.style, 'position', 'absolute');
2095
+ self.$set(item.style, 'width', elementWidth + 'px');
2096
+ self.$set(item.style, 'height', height + 'px');
2097
+ self.$set(item.style, 'left', left + 'px');
2098
+ self.$set(item.style, 'top', top + 'px');
2099
+ if (!useCustomWidth) {
2100
+ self.$set(item.style, 'span', span);
2101
+ }
2102
+
2103
+ // 更新所有被占用列的高度
2104
+ var newHeight = top + height + gap;
2105
+ for (var _i5 = startColumn; _i5 < startColumn + span; _i5++) {
2106
+ columnHeights[_i5] = newHeight;
2107
+ }
2108
+ });
2109
+
2110
+ // 设置容器高度
2111
+ var maxHeight = Math.max.apply(Math, columnHeights);
2112
+ container.style.position = 'relative';
2113
+ container.style.height = maxHeight - gap + 'px'; // 减去最后一个间隙
2114
+ return { columnWidth: columnWidth, width: containerWidth };
2115
+ };
2018
2116
  /**
2019
2117
  * loadJs
2020
2118
  * @desc 加载JS文件
@@ -2045,7 +2143,7 @@ var loadJs = function loadJs(url, callback) {
2045
2143
  var loading = function loading() {
2046
2144
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '请求中...';
2047
2145
 
2048
- var Loading = __webpack_require__(13).default;
2146
+ var Loading = __webpack_require__(19).default;
2049
2147
  return Loading.service({
2050
2148
  text: text,
2051
2149
  spinner: 'es-icon-jiazai',
@@ -2163,8 +2261,8 @@ var renderIcon = function renderIcon(data, node, icons) {
2163
2261
  var _ref9 = data || {},
2164
2262
  attributes = _ref9.attributes;
2165
2263
 
2166
- var orgType = attributes.orgType || data.orgType;
2167
- var layerlevel = attributes.layerlevel || data.layerlevel;
2264
+ var orgType = attributes ? attributes.orgType : data.orgType;
2265
+ var layerlevel = attributes ? attributes.layerlevel : data.layerlevel;
2168
2266
  if (!orgType) return '';
2169
2267
  var key = orgType === 'org' ? layerlevel ? 'bumen' : 'gongsi' : 'bumen';
2170
2268
  if (node.level === 1 && (data.subNode || data.isParent || data.hasChildren)) {
@@ -2243,10 +2341,10 @@ var rmbToCapital = function rmbToCapital(num) {
2243
2341
  // 处理小数部分
2244
2342
  var decimalCapital = '';
2245
2343
  if (parseInt(decimalPart, 10) > 0) {
2246
- for (var _i5 = 0; _i5 < decimalPart.length; _i5++) {
2247
- var _digit = parseInt(decimalPart[_i5], 10);
2344
+ for (var _i6 = 0; _i6 < decimalPart.length; _i6++) {
2345
+ var _digit = parseInt(decimalPart[_i6], 10);
2248
2346
  if (_digit > 0) {
2249
- decimalCapital += chineseNumbers[_digit] + decimalUnits[_i5];
2347
+ decimalCapital += chineseNumbers[_digit] + decimalUnits[_i6];
2250
2348
  } else if (decimalCapital[decimalCapital.length - 1] !== chineseNumbers[0]) {
2251
2349
  decimalCapital += chineseNumbers[_digit];
2252
2350
  }
@@ -2912,1997 +3010,6 @@ var warning = function warning(content, _callback3) {
2912
3010
  /***/ 1:
2913
3011
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2914
3012
 
2915
- "use strict";
2916
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
2917
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
2918
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
2919
- /* unused harmony export setCookie */
2920
- /* unused harmony export getCookie */
2921
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2922
-
2923
- /**
2924
- * setStorage
2925
- * @desc:设置本地储存数据
2926
- * @author huangbo
2927
- * @date 2022年5月7日
2928
- * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
2929
- * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
2930
- **/
2931
- var setStorage = function setStorage(key, value) {
2932
- // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
2933
- var type = void 0,
2934
- finalKey = void 0,
2935
- finalValue = void 0;
2936
-
2937
- if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
2938
- // 对象调用方式:setStorage({type, key, value})
2939
- type = key.type;
2940
- finalKey = key.key;
2941
- finalValue = key.value;
2942
- } else {
2943
- // 字符串调用方式:setStorage(key, value)
2944
- type = getStorage('storageType');
2945
- finalKey = key;
2946
- finalValue = value;
2947
- }
2948
-
2949
- // 使用默认存储类型如果未指定
2950
- type = type || getStorage('storageType');
2951
-
2952
- // 获取存储对象
2953
- var storage = type === 'localStorage' ? localStorage : sessionStorage;
2954
-
2955
- // 处理不同类型的key
2956
- if (typeof finalKey === 'string') {
2957
- // 单个字符串key
2958
- var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
2959
- storage.setItem(finalKey, storedValue);
2960
- if (finalKey === 'token') {
2961
- setCookie('token', storedValue);
2962
- }
2963
- } else if (Array.isArray(finalKey)) {
2964
- // 数组key,为多个key设置同一个value
2965
- var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
2966
- for (var i = 0; i < finalKey.length; i++) {
2967
- storage.setItem(finalKey[i], _storedValue);
2968
- if (finalKey[i] === 'token') {
2969
- setCookie('token', _storedValue);
2970
- }
2971
- }
2972
- } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
2973
- // 对象key,对象的属性名称作为key,属性值作为value
2974
- for (var k in finalKey) {
2975
- if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
2976
- var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
2977
- storage.setItem(k, _storedValue2);
2978
- if (k === 'token') {
2979
- setCookie('token', _storedValue2);
2980
- }
2981
- }
2982
- }
2983
- }
2984
- };
2985
-
2986
- /**
2987
- * getStorage
2988
- * @desc:获取本地储存数据
2989
- * @author huangbo
2990
- * @date 2022年5月7日
2991
- * @param {String} [key] - 获取的名称
2992
- **/
2993
- var getStorage = function getStorage(key) {
2994
- if (key) {
2995
- var res = sessionStorage.getItem(key) || localStorage.getItem(key);
2996
- if (!res && key === 'token') {
2997
- res = getCookie('token');
2998
- }
2999
- if (key === 'host' && !res) {
3000
- res = '';
3001
- }
3002
- return res;
3003
- }
3004
- var defaults = {};
3005
- var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
3006
- var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
3007
-
3008
- var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
3009
- if (token) {
3010
- defaults.Authorization = token;
3011
- }
3012
- if (ssId) {
3013
- defaults.ssId = ssId;
3014
- }
3015
- if (deviceUnique) {
3016
- defaults.deviceUnique = deviceUnique;
3017
- }
3018
- return defaults;
3019
- };
3020
-
3021
- /**
3022
- * removeStorage
3023
- * @desc:删除本地储存数据
3024
- * @author huangbo
3025
- * @date 2022年5月7日
3026
- * @param {String, Array} [key] - 获取的名称
3027
- **/
3028
- var removeStorage = function removeStorage(key) {
3029
- if (Array.isArray(key)) {
3030
- for (var i = 0; i < key.length; i++) {
3031
- sessionStorage.removeItem(key[i]);
3032
- localStorage.removeItem(key[i]);
3033
- if (key[i] === 'token') {
3034
- removeCookie('token');
3035
- }
3036
- }
3037
- } else if (key) {
3038
- sessionStorage.removeItem(key);
3039
- localStorage.removeItem(key);
3040
- if (key === 'token') {
3041
- removeCookie('token');
3042
- }
3043
- } else {
3044
- sessionStorage.clear();
3045
- localStorage.clear();
3046
- removeCookie('token');
3047
- }
3048
- };
3049
-
3050
- /**
3051
- * setCookie
3052
- * @desc 设置cookie
3053
- * @author huangbo
3054
- * @param {string} [name] cookie名称
3055
- * @param {string} [value] cookie值
3056
- * @param {boolean} [isSession] 是否是会话cookie
3057
- **/
3058
- var setCookie = function setCookie(name, value) {
3059
- var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3060
- var time = arguments[3];
3061
-
3062
- try {
3063
- var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
3064
- ];
3065
- // 会话/持久Cookie设置
3066
- if (!isSession) {
3067
- if (/MSIE|Trident/.test(navigator.userAgent)) {
3068
- // IE使用expires
3069
- var date = new Date();
3070
- date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
3071
- cookieParts.push('expires=' + date.toUTCString());
3072
- } else {
3073
- // 其他浏览器使用max-age
3074
- cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
3075
- }
3076
- }
3077
- // 内核兼容处理
3078
- if (/MSIE|Trident/.test(navigator.userAgent)) {
3079
- // IE特殊处理:添加P3P协议头
3080
- cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
3081
- } else {
3082
- // 现代浏览器设置
3083
- cookieParts.push('samesite=lax');
3084
- if (window.location.protocol === 'https:') {
3085
- cookieParts.push('secure');
3086
- }
3087
- }
3088
-
3089
- // 设置Cookie
3090
- document.cookie = cookieParts.join('; ');
3091
- return true;
3092
- } catch (e) {
3093
- console.error('Cookie设置失败:', e);
3094
- return false;
3095
- }
3096
- };
3097
-
3098
- /**
3099
- * getCookie
3100
- * @desc 获取cookie中指定名称的值
3101
- * @author huangbo
3102
- * @param {string} [name] cookie名称
3103
- **/
3104
- var getCookie = function getCookie(name) {
3105
- var cookies = document.cookie.split(';');
3106
- for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
3107
- var _ref;
3108
-
3109
- if (_isArray) {
3110
- if (_i >= _iterator.length) break;
3111
- _ref = _iterator[_i++];
3112
- } else {
3113
- _i = _iterator.next();
3114
- if (_i.done) break;
3115
- _ref = _i.value;
3116
- }
3117
-
3118
- var cookie = _ref;
3119
-
3120
- var _cookie$trim$split = cookie.trim().split('='),
3121
- cookieName = _cookie$trim$split[0],
3122
- cookieValue = _cookie$trim$split[1];
3123
-
3124
- if (decodeURIComponent(cookieName) === name) {
3125
- return decodeURIComponent(cookieValue);
3126
- }
3127
- }
3128
- return null;
3129
- };
3130
-
3131
- /**
3132
- * removeCookie
3133
- * @desc:删除cookie
3134
- * @author huangbo
3135
- * @date 2022年5月7日
3136
- * @param {String, Array} [key] - 获取的名称
3137
- **/
3138
- var removeCookie = function removeCookie(key) {
3139
- if (Array.isArray(key)) {
3140
- for (var i = 0; i < key.length; i++) {
3141
- document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
3142
- }
3143
- } else {
3144
- document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
3145
- }
3146
- };
3147
-
3148
- /***/ }),
3149
-
3150
- /***/ 10:
3151
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3152
-
3153
- "use strict";
3154
- function _broadcast(componentName, eventName, params) {
3155
- this.$children.forEach(function (child) {
3156
- var name = child.$options.componentName;
3157
-
3158
- if (name === componentName) {
3159
- child.$emit.apply(child, [eventName].concat(params));
3160
- } else {
3161
- _broadcast.apply(child, [componentName, eventName].concat([params]));
3162
- }
3163
- });
3164
- }
3165
- /* harmony default export */ __webpack_exports__["a"] = ({
3166
- methods: {
3167
- dispatch: function dispatch(componentName, eventName, params) {
3168
- var parent = this.$parent || this.$root;
3169
- var name = parent.$options.componentName;
3170
-
3171
- while (parent && (!name || name !== componentName)) {
3172
- parent = parent.$parent;
3173
-
3174
- if (parent) {
3175
- name = parent.$options.componentName;
3176
- }
3177
- }
3178
- if (parent) {
3179
- parent.$emit.apply(parent, [eventName].concat(params));
3180
- }
3181
- },
3182
- broadcast: function broadcast(componentName, eventName, params) {
3183
- _broadcast.call(this, componentName, eventName, params);
3184
- }
3185
- }
3186
- });
3187
-
3188
- /***/ }),
3189
-
3190
- /***/ 100:
3191
- /***/ (function(module, exports) {
3192
-
3193
- module.exports = require("eoss/lib/dropdown-menu");
3194
-
3195
- /***/ }),
3196
-
3197
- /***/ 12:
3198
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3199
-
3200
- "use strict";
3201
- /* unused harmony export getHue */
3202
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
3203
- /* unused harmony export getLightness */
3204
- /* unused harmony export getSaturation */
3205
- /* unused harmony export rgbToHsv */
3206
- /* unused harmony export hsvTorgb */
3207
- /* unused harmony export mixColor */
3208
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
3209
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
3210
-
3211
- var $hueStep = 2;
3212
- var $saturationStep1 = 0.16;
3213
- var $saturationStep2 = 0.05;
3214
- var $brightnessStep1 = 0.05;
3215
- var $brightnessStep2 = 0.15;
3216
- var $lightColorCount = 5;
3217
- var $darkColorCount = 4;
3218
- /**
3219
- * getHue
3220
- * @desc:转换色相
3221
- * @author huangbo
3222
- * @date 2022年5月7日
3223
- **/
3224
- var getHue = function getHue($h, $i, $isLight) {
3225
- var $hue = void 0;
3226
- if ($h >= 60 && $h <= 240) {
3227
- $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
3228
- } else {
3229
- $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
3230
- }
3231
- $hue = ($hue + 360) % 360;
3232
- return Math.round($hue);
3233
- };
3234
-
3235
- /**
3236
- * getColor
3237
- * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
3238
- * @author huangbo
3239
- * @date 2022年5月7日
3240
- **/
3241
- var getColor = function getColor($color, $n) {
3242
- var $isLight = $n < 7;
3243
- var $hsv = rgbToHsv($color);
3244
- // 这里将i转换成以主色为中心,两侧的i值逐渐增大
3245
- var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
3246
- var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
3247
- return color;
3248
- };
3249
-
3250
- /**
3251
- * getLightness
3252
- * @desc:转换明度
3253
- * @author huangbo
3254
- * @date 2022年5月7日
3255
- * @return {string,array} 元素类名或者id
3256
- **/
3257
- var getLightness = function getLightness($v, $i, $isLight) {
3258
- var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3259
- $value = $value < 1 ? $value : 1;
3260
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
3261
- };
3262
-
3263
- /**
3264
- * getSaturation
3265
- * @desc:转换饱和度
3266
- * @author huangbo
3267
- * @date 2022年5月7日
3268
- **/
3269
- var getSaturation = function getSaturation($s, $i, $isLight) {
3270
- var $saturation = void 0;
3271
- if ($isLight) {
3272
- $saturation = $s - $saturationStep1 * $i;
3273
- } else if ($i === $darkColorCount) {
3274
- $saturation = $s + $saturationStep1;
3275
- } else {
3276
- $saturation = $s + $saturationStep2 * $i;
3277
- }
3278
- $saturation = $saturation < 1 ? $saturation : 1;
3279
-
3280
- if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
3281
- $saturation = 0.1;
3282
- }
3283
- $saturation = $saturation > 0.06 ? $saturation : 0.06;
3284
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
3285
- };
3286
-
3287
- /**
3288
- * rgbToHsv
3289
- * @desc:rgb转化成hsv
3290
- * @author huangbo
3291
- * @date 2022年5月7日
3292
- * @param {string} [$color] - 颜色值
3293
- **/
3294
- var rgbToHsv = function rgbToHsv($color) {
3295
- var rgb = getRgb($color);
3296
- var $red = rgb[0];
3297
- var $green = rgb[1];
3298
- var $blue = rgb[2];
3299
- var $max = Math.max($red, $green, $blue);
3300
- var $min = Math.min($red, $green, $blue);
3301
- var $diff = $max - $min;
3302
- var $h = 0;
3303
- if ($max === $min) {
3304
- $h = 0;
3305
- } else if ($max === $red) {
3306
- $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
3307
- } else if ($max === $green) {
3308
- $h = 60 * ($blue - $red) / $diff + 120;
3309
- } else if ($max === $blue) {
3310
- $h = 60 * ($red - $green) / $diff + 240;
3311
- }
3312
- var $s = $max === 0 ? 0 : $diff / $max;
3313
- var $v = $max / 255;
3314
- return [$h, $s, $v];
3315
- };
3316
-
3317
- /**
3318
- * hsvTorgb
3319
- * @desc:hsv转化成rgb
3320
- * @author huangbo
3321
- * @date 2022年5月7日
3322
- * @param {string} [$color] - 颜色值
3323
- **/
3324
- var hsvTorgb = function hsvTorgb($h, $s, $v) {
3325
- var $th = Math.floor($h / 60);
3326
- var $t1 = $h / 60 - $th;
3327
- var $t2 = $v * (1 - $s);
3328
- var $t3 = $v * (1 - $t1 * $s);
3329
- var $t4 = $v * (1 - (1 - $t1) * $s);
3330
- var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
3331
- var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
3332
- var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
3333
- // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
3334
- var red = Math.round($r * 255);
3335
- var green = Math.round($g * 255);
3336
- var blue = Math.round($b * 255);
3337
- red = red.toString(16);
3338
- green = green.toString(16);
3339
- blue = blue.toString(16);
3340
- red = red.length === 1 ? '0' + red : red;
3341
- green = green.length === 1 ? '0' + green : green;
3342
- blue = blue.length === 1 ? '0' + blue : blue;
3343
- return '#' + red + green + blue;
3344
- };
3345
-
3346
- /**
3347
- * mixColor
3348
- * @desc:生成混合色
3349
- * @author huangbo
3350
- * @date 2022年5月7日
3351
- * @param {string} [$color1] - 颜色值
3352
- * @param {string} [$color2] - 颜色值
3353
- * @param {string} [$n] - 百分比 0~1
3354
- **/
3355
- var mixColor = function mixColor($color1, $color2, $n) {
3356
- var rgb1 = getRgb($color1);
3357
- var rgb2 = getRgb($color2);
3358
- var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
3359
- var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
3360
- var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
3361
- return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3362
- };
3363
-
3364
- /**
3365
- * getRgb
3366
- * @desc:获取颜色值的rgb值
3367
- * @author huangbo
3368
- * @date 2022年5月7日
3369
- * @param {string} [$color] - 颜色值
3370
- **/
3371
- var getRgb = function getRgb($color) {
3372
- var rgb = [];
3373
- // 16进制颜色值的正则
3374
- var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
3375
- // 把颜色值变成小写
3376
- $color = $color.toLowerCase();
3377
- if (reg.test($color)) {
3378
- // 如果只有三位的值,需变成六位,如:#fff => #ffffff
3379
- if ($color.length === 4) {
3380
- var colorNew = '#';
3381
- for (var i = 1; i < 4; i++) {
3382
- colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
3383
- }
3384
- $color = colorNew;
3385
- }
3386
- // 处理六位的颜色值,转为RGB
3387
- for (var _i = 1; _i < 7; _i += 2) {
3388
- rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
3389
- }
3390
- } else {
3391
- rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
3392
- }
3393
- return rgb;
3394
- };
3395
-
3396
- /***/ }),
3397
-
3398
- /***/ 13:
3399
- /***/ (function(module, exports) {
3400
-
3401
- module.exports = require("eoss/lib/loading");
3402
-
3403
- /***/ }),
3404
-
3405
- /***/ 15:
3406
- /***/ (function(module, exports) {
3407
-
3408
- module.exports = require("lodash/get");
3409
-
3410
- /***/ }),
3411
-
3412
- /***/ 16:
3413
- /***/ (function(module, exports) {
3414
-
3415
- module.exports = require("lodash/set");
3416
-
3417
- /***/ }),
3418
-
3419
- /***/ 17:
3420
- /***/ (function(module, exports) {
3421
-
3422
- module.exports = require("lodash/cloneDeep");
3423
-
3424
- /***/ }),
3425
-
3426
- /***/ 190:
3427
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3428
-
3429
- "use strict";
3430
- // ESM COMPAT FLAG
3431
- __webpack_require__.r(__webpack_exports__);
3432
-
3433
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=template&id=cf516038&
3434
- var render = function () {
3435
- var _vm = this
3436
- var _h = _vm.$createElement
3437
- var _c = _vm._self._c || _h
3438
- return _c(
3439
- "div",
3440
- {
3441
- directives: [
3442
- {
3443
- name: "clickoutside",
3444
- rawName: "v-clickoutside",
3445
- value: _vm.hide,
3446
- expression: "hide",
3447
- },
3448
- ],
3449
- ref: "dropdownWrapper",
3450
- staticClass: "es-dropdown",
3451
- class: this.dropdownSize ? "es-dropdown--" + this.dropdownSize : "",
3452
- },
3453
- [
3454
- !_vm.splitButton
3455
- ? [
3456
- _vm._t("default", function () {
3457
- return [
3458
- _c(
3459
- "es-button",
3460
- _vm._b(
3461
- { ref: "trigger" },
3462
- "es-button",
3463
- _vm.buttonProps,
3464
- false
3465
- ),
3466
- [
3467
- _vm._v("\n " + _vm._s(_vm._text) + "\n "),
3468
- _c("i", {
3469
- staticClass: "es-dropdown__icon",
3470
- class: [_vm._icon, { "is-rotate": _vm.visible }],
3471
- }),
3472
- ]
3473
- ),
3474
- ]
3475
- }),
3476
- ]
3477
- : [
3478
- _c(
3479
- "es-button-group",
3480
- { attrs: { separate: false } },
3481
- [
3482
- _c(
3483
- "es-button",
3484
- {
3485
- attrs: {
3486
- type: _vm.type,
3487
- size: _vm.dropdownSize,
3488
- text: _vm._text,
3489
- },
3490
- on: { click: _vm.handleMainButtonClick },
3491
- },
3492
- [_vm._t("default")],
3493
- 2
3494
- ),
3495
- _c(
3496
- "es-button",
3497
- {
3498
- ref: "trigger",
3499
- staticClass: "es-dropdown__caret-button",
3500
- attrs: { type: _vm.type, size: _vm.dropdownSize },
3501
- },
3502
- [
3503
- _c("i", {
3504
- staticClass: "es-dropdown__icon",
3505
- class: [
3506
- "es-dropdown__icon",
3507
- _vm._icon,
3508
- { "is-rotate": _vm.visible },
3509
- ],
3510
- }),
3511
- ]
3512
- ),
3513
- ],
3514
- 1
3515
- ),
3516
- ],
3517
- _vm._t("dropdown", function () {
3518
- return [
3519
- _vm.contents
3520
- ? _c("es-dropdown-menu", {
3521
- attrs: { "max-height": _vm.maxHeight, contents: _vm.contents },
3522
- })
3523
- : _vm._e(),
3524
- ]
3525
- }),
3526
- ],
3527
- 2
3528
- )
3529
- }
3530
- var staticRenderFns = []
3531
- render._withStripped = true
3532
-
3533
-
3534
- // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=template&id=cf516038&
3535
-
3536
- // EXTERNAL MODULE: ./src/utils/clickoutside.js
3537
- var clickoutside = __webpack_require__(27);
3538
-
3539
- // EXTERNAL MODULE: ./src/mixins/emitter.js
3540
- var emitter = __webpack_require__(10);
3541
-
3542
- // EXTERNAL MODULE: ./src/mixins/migrating.js
3543
- var migrating = __webpack_require__(32);
3544
-
3545
- // EXTERNAL MODULE: external "eoss/lib/button"
3546
- var button_ = __webpack_require__(33);
3547
- var button_default = /*#__PURE__*/__webpack_require__.n(button_);
3548
-
3549
- // EXTERNAL MODULE: external "eoss/lib/button-group"
3550
- var button_group_ = __webpack_require__(89);
3551
- var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
3552
-
3553
- // EXTERNAL MODULE: external "eoss/lib/dropdown-menu"
3554
- var dropdown_menu_ = __webpack_require__(100);
3555
- var dropdown_menu_default = /*#__PURE__*/__webpack_require__.n(dropdown_menu_);
3556
-
3557
- // EXTERNAL MODULE: ./src/utils/util.js
3558
- var util = __webpack_require__(0);
3559
-
3560
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
3561
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
3562
-
3563
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
3564
-
3565
- //
3566
- //
3567
- //
3568
- //
3569
- //
3570
- //
3571
- //
3572
- //
3573
- //
3574
- //
3575
- //
3576
- //
3577
- //
3578
- //
3579
- //
3580
- //
3581
- //
3582
- //
3583
- //
3584
- //
3585
- //
3586
- //
3587
- //
3588
- //
3589
- //
3590
- //
3591
- //
3592
- //
3593
- //
3594
- //
3595
- //
3596
- //
3597
- //
3598
- //
3599
- //
3600
- //
3601
- //
3602
- //
3603
- //
3604
- //
3605
- //
3606
- //
3607
- //
3608
- //
3609
- //
3610
- //
3611
- //
3612
- //
3613
- //
3614
- //
3615
- //
3616
- //
3617
- //
3618
- //
3619
- //
3620
- //
3621
-
3622
-
3623
-
3624
-
3625
-
3626
-
3627
-
3628
-
3629
-
3630
- /**
3631
- * 下拉菜单组件
3632
- * 功能说明:提供下拉菜单功能,支持 hover 和 click 两种触发方式,可自定义菜单内容和位置
3633
- * 适用场景:需要展示一组操作选项,节省空间的场景
3634
- */
3635
- /* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
3636
- name: 'EsDropdown',
3637
-
3638
- componentName: 'EsDropdown',
3639
-
3640
- mixins: [emitter["a" /* default */], migrating["a" /* default */]],
3641
-
3642
- directives: {
3643
- Clickoutside: clickoutside["a" /* default */]
3644
- },
3645
-
3646
- components: {
3647
- EsButton: button_default.a,
3648
- EsButtonGroup: button_group_default.a,
3649
- EsDropdownMenu: dropdown_menu_default.a
3650
- },
3651
-
3652
- provide: function provide() {
3653
- return {
3654
- dropdown: this
3655
- };
3656
- },
3657
-
3658
-
3659
- props: {
3660
- /**
3661
- * 触发下拉的行为
3662
- */
3663
- trigger: {
3664
- type: String,
3665
- default: 'hover'
3666
- },
3667
- /**
3668
- * 菜单按钮类型,同 Button 组件(只在 split-button 为 true 或 button 为{}【空对象】的情况下有效)
3669
- */
3670
- type: {
3671
- type: String,
3672
- default: 'text'
3673
- },
3674
- /**
3675
- * 菜单尺寸,在 split-button 为 true 或 button 为{}【空对象】 的情况下也对触发按钮生效
3676
- */
3677
- size: String,
3678
- /**
3679
- * 下拉触发元素呈现为按钮组
3680
- */
3681
- splitButton: Boolean,
3682
- /**
3683
- * 是否在点击菜单项后隐藏菜单
3684
- */
3685
- hideOnClick: {
3686
- type: Boolean,
3687
- default: true
3688
- },
3689
- /**
3690
- * 菜单弹出位置
3691
- */
3692
- placement: {
3693
- type: String,
3694
- default: 'bottom-end'
3695
- },
3696
- /**
3697
- * 是否显示下拉菜单的箭头
3698
- */
3699
- visibleArrow: {
3700
- default: true
3701
- },
3702
- /**
3703
- * 展开下拉菜单的延时(仅在 trigger 为 hover 时有效)
3704
- */
3705
- showTimeout: {
3706
- type: Number,
3707
- default: 250
3708
- },
3709
- /**
3710
- * 收起下拉菜单的延时(仅在 trigger 为 hover 时有效)
3711
- */
3712
- hideTimeout: {
3713
- type: Number,
3714
- default: 150
3715
- },
3716
- /**
3717
- * Dropdown 组件的 tabindex
3718
- */
3719
- tabindex: {
3720
- type: Number,
3721
- default: -1
3722
- },
3723
- /**
3724
- * 下拉箭头的图标类名
3725
- */
3726
- icon: {
3727
- type: String,
3728
- default: 'es-icon-xia'
3729
- },
3730
- /**
3731
- * 按钮文本
3732
- */
3733
- text: String,
3734
- /**
3735
- * 在 split-button 为 false 时,触发元素呈现为 button 时的配置
3736
- */
3737
- button: Object,
3738
- /**
3739
- * 下拉菜单的内容
3740
- */
3741
- contents: Array,
3742
- /**
3743
- * 菜单的最大高度
3744
- */
3745
- maxHeight: Number,
3746
- /**
3747
- * 下拉菜单内容中,用于显示选项文本的键名
3748
- */
3749
- labelKey: String
3750
- },
3751
-
3752
- data: function data() {
3753
- return {
3754
- timeout: null,
3755
- visible: false,
3756
- triggerElm: null,
3757
- dropdownElm: null,
3758
- focusing: false,
3759
- listId: 'dropdown-menu-' + Object(util["r" /* generateId */])(),
3760
- _eventListeners: null
3761
- };
3762
- },
3763
-
3764
-
3765
- computed: {
3766
- /**
3767
- * 获取正确的下拉菜单尺寸
3768
- */
3769
- dropdownSize: function dropdownSize() {
3770
- var elementSize = this.$ELEMENT && this.$ELEMENT.size;
3771
- return this.size || elementSize || '';
3772
- },
3773
- _text: function _text() {
3774
- return (this.button || {}).text || this.text;
3775
- },
3776
-
3777
- /**
3778
- * 计算下拉箭头图标类名
3779
- * 优先使用 button 配置中的 icon,否则使用 prop 的 icon
3780
- */
3781
- _icon: function _icon() {
3782
- return (this.button || {}).icon || this.icon;
3783
- },
3784
-
3785
- /**
3786
- * 计算button属性,合并默认值
3787
- */
3788
- buttonProps: function buttonProps() {
3789
- var _ref = this.button || {},
3790
- icon = _ref.icon,
3791
- text = _ref.text,
3792
- other = _objectWithoutProperties(_ref, ['icon', 'text']);
3793
-
3794
- return _extends({
3795
- type: this.type,
3796
- size: this.dropdownSize
3797
- }, other);
3798
- }
3799
- },
3800
-
3801
- mounted: function mounted() {
3802
- this.$on('menu-item-click', this.handleMenuItemClick);
3803
- },
3804
- beforeDestroy: function beforeDestroy() {
3805
- // 清理定时器和事件监听器
3806
- this._clearTimeout();
3807
- this.cleanupEvents();
3808
- },
3809
-
3810
-
3811
- watch: {
3812
- /**
3813
- * 监听 visible 变化
3814
- */
3815
- visible: function visible(val) {
3816
- this.broadcast('EsDropdownMenu', 'visible', val);
3817
- this.$emit('visible-change', val);
3818
- },
3819
-
3820
- /**
3821
- * 监听 focusing 变化
3822
- */
3823
- focusing: function focusing(val) {
3824
- try {
3825
- var selfDefine = this.$el ? this.$el.querySelector('.es-dropdown-selfdefine') : null;
3826
- if (selfDefine && selfDefine.classList) {
3827
- // 使用classList API更安全地操作类名
3828
- if (val) {
3829
- selfDefine.classList.add('focusing');
3830
- } else {
3831
- selfDefine.classList.remove('focusing');
3832
- }
3833
- }
3834
- } catch (error) {
3835
- console.warn('EsDropdown: 处理焦点样式时出错:', error);
3836
- }
3837
- }
3838
- },
3839
-
3840
- methods: {
3841
- /**
3842
- * 获取迁移配置
3843
- */
3844
- getMigratingConfig: function getMigratingConfig() {
3845
- return {
3846
- props: {
3847
- 'menu-align': 'menu-align is renamed to placement.'
3848
- }
3849
- };
3850
- },
3851
-
3852
- /**
3853
- * 通用的可见性切换方法
3854
- * @param {boolean} shouldShow - 是否显示下拉菜单
3855
- */
3856
- _toggleVisible: function _toggleVisible(shouldShow) {
3857
- var _this = this;
3858
-
3859
- // 安全检查
3860
- if (!this.triggerElm || this.triggerElm.disabled) return;
3861
-
3862
- // 清除之前的定时器
3863
- this._clearTimeout();
3864
-
3865
- // 设置延时
3866
- var delay = this.trigger === 'click' ? 0 : shouldShow ? this.showTimeout : this.hideTimeout;
3867
-
3868
- this.timeout = setTimeout(function () {
3869
- _this.visible = shouldShow;
3870
- }, delay);
3871
- },
3872
-
3873
-
3874
- /**
3875
- * 显示下拉菜单
3876
- */
3877
- show: function show() {
3878
- this._toggleVisible(true);
3879
- },
3880
-
3881
-
3882
- /**
3883
- * 隐藏下拉菜单
3884
- */
3885
- hide: function hide() {
3886
- this._toggleVisible(false);
3887
- },
3888
-
3889
-
3890
- /**
3891
- * 统一的定时器清理方法
3892
- */
3893
- _clearTimeout: function _clearTimeout() {
3894
- if (this.timeout) {
3895
- clearTimeout(this.timeout);
3896
- this.timeout = null;
3897
- }
3898
- },
3899
-
3900
- /**
3901
- * 处理触发元素点击
3902
- * @param {Event} event - 点击事件对象
3903
- */
3904
- handleClick: function handleClick(event) {
3905
- if (!this.triggerElm || this.triggerElm.disabled) return;
3906
-
3907
- // 阻止事件冒泡以避免与clickoutside冲突
3908
- if (event && event.stopPropagation) {
3909
- event.stopPropagation();
3910
- }
3911
-
3912
- // 切换可见性
3913
- if (this.visible) {
3914
- this.hide();
3915
- } else {
3916
- this.show();
3917
- }
3918
- },
3919
-
3920
-
3921
- /**
3922
- * 处理主按钮点击
3923
- * @param {Event} event - 点击事件对象
3924
- */
3925
- handleMainButtonClick: function handleMainButtonClick(event) {
3926
- this.$emit('click', event);
3927
- this.hide();
3928
- },
3929
-
3930
-
3931
- /**
3932
- * 初始化ARIA属性
3933
- */
3934
- initAria: function initAria() {
3935
- // 安全地初始化ARIA属性
3936
- try {
3937
- if (!this.dropdownElm || !this.dropdownElm.setAttribute || !this.triggerElm || !this.triggerElm.setAttribute) {
3938
- return;
3939
- }
3940
-
3941
- this.dropdownElm.setAttribute('id', this.listId);
3942
- this.triggerElm.setAttribute('aria-haspopup', 'list');
3943
- this.triggerElm.setAttribute('aria-controls', this.listId);
3944
- this.triggerElm.setAttribute('aria-expanded', String(this.visible));
3945
-
3946
- if (!this.splitButton) {
3947
- // 使用classList API安全地添加类名
3948
- if (this.triggerElm.classList) {
3949
- this.triggerElm.classList.add('es-dropdown-selfdefine');
3950
- }
3951
- }
3952
- } catch (error) {
3953
- console.warn('EsDropdown: 初始化ARIA属性时出错:', error);
3954
- }
3955
- },
3956
-
3957
- /**
3958
- * 优化的事件绑定方法
3959
- * @param {Element} element - 要绑定事件的元素
3960
- * @param {string} event - 事件名称
3961
- * @param {Function} handler - 事件处理函数
3962
- * @param {boolean|Object} options - 事件选项
3963
- */
3964
- _bindEvent: function _bindEvent(element, event, handler) {
3965
- var _this2 = this;
3966
-
3967
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3968
-
3969
- if (!element || !element.addEventListener) return;
3970
-
3971
- // 使用闭包包装handler以保持this上下文
3972
- var wrappedHandler = function wrappedHandler(e) {
3973
- return handler.call(_this2, e);
3974
- };
3975
-
3976
- element.addEventListener(event, wrappedHandler, options);
3977
-
3978
- // 存储包装后的处理函数以便正确移除
3979
- if (!this._eventListeners) {
3980
- this._eventListeners = [];
3981
- }
3982
-
3983
- this._eventListeners.push({
3984
- elm: element,
3985
- event: event,
3986
- handler: wrappedHandler, // 存储包装后的函数
3987
- originalHandler: handler, // 可选:存储原始函数用于调试
3988
- options: options
3989
- });
3990
- },
3991
-
3992
-
3993
- /**
3994
- * 统一的事件解绑方法
3995
- * @param {Element} element - 要解绑事件的元素
3996
- * @param {string} event - 事件名称
3997
- * @param {Function} handler - 事件处理函数
3998
- * @param {boolean|Object} options - 事件选项
3999
- */
4000
- _unbindEvent: function _unbindEvent(element, event, handler) {
4001
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4002
-
4003
- if (!element || !element.removeEventListener) return;
4004
-
4005
- // 查找对应的监听器并移除
4006
- if (Array.isArray(this._eventListeners)) {
4007
- var index = this._eventListeners.findIndex(function (item) {
4008
- return item.elm === element && item.event === event && (item.originalHandler === handler || item.handler === handler);
4009
- });
4010
-
4011
- if (index > -1) {
4012
- var wrappedHandler = this._eventListeners[index].handler;
4013
-
4014
- element.removeEventListener(event, wrappedHandler, options);
4015
- this._eventListeners.splice(index, 1);
4016
- }
4017
- }
4018
- },
4019
-
4020
-
4021
- /**
4022
- * 使用事件委托优化的初始化事件方法
4023
- */
4024
- initEvent: function initEvent() {
4025
- var _this3 = this;
4026
-
4027
- try {
4028
- // 优先使用ref获取trigger
4029
- if (this.$refs.trigger) {
4030
- this.triggerElm = this.$refs.trigger.$el || this.$refs.trigger;
4031
- } else if (this.$slots.default) {
4032
- // 遍历slots查找含有trigger标识的元素
4033
- var foundTrigger = false;
4034
- for (var _iterator = this.$slots.default, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
4035
- var _ref2;
4036
-
4037
- if (_isArray) {
4038
- if (_i >= _iterator.length) break;
4039
- _ref2 = _iterator[_i++];
4040
- } else {
4041
- _i = _iterator.next();
4042
- if (_i.done) break;
4043
- _ref2 = _i.value;
4044
- }
4045
-
4046
- var slotItem = _ref2;
4047
-
4048
- if (slotItem && slotItem.elm) {
4049
- // 检查元素或其属性是否有trigger标识
4050
- var hasTriggerProp = slotItem.data && slotItem.data.attrs && slotItem.data.attrs['trigger'] === 'true';
4051
-
4052
- if (hasTriggerProp) {
4053
- this.triggerElm = slotItem.elm;
4054
- foundTrigger = true;
4055
- break;
4056
- }
4057
- }
4058
- }
4059
-
4060
- // 如果没找到有trigger标识的元素,则使用默认的第一个元素
4061
- if (!foundTrigger && this.$slots.default[0] && this.$slots.default[0].elm) {
4062
- this.triggerElm = this.$slots.default[0].elm;
4063
- }
4064
- }
4065
- if (!this.triggerElm || !this.dropdownElm || !this.$refs.dropdownWrapper) {
4066
- console.warn('EsDropdown: 无法正确初始化元素');
4067
- return;
4068
- }
4069
-
4070
- // 清空已存在的事件监听器
4071
- this.cleanupEvents();
4072
-
4073
- // 获取组件根元素作为委托容器
4074
- var container = this.$refs.dropdownWrapper;
4075
-
4076
- // 控制自定义元素的样式 - 使用事件委托
4077
- if (!this.splitButton) {
4078
- var handleFocusBlur = function handleFocusBlur(ev) {
4079
- if (ev.target === _this3.triggerElm) {
4080
- _this3.focusing = ev.type === 'focus';
4081
- if (ev.type === 'click') {
4082
- _this3.focusing = false;
4083
- }
4084
- }
4085
- };
4086
-
4087
- this._bindEvent(container, 'focus', handleFocusBlur, true);
4088
- this._bindEvent(container, 'blur', handleFocusBlur, true);
4089
- this._bindEvent(container, 'click', handleFocusBlur);
4090
- }
4091
-
4092
- // 根据trigger类型绑定不同的事件
4093
- if (this.trigger === 'hover') {
4094
- // 分别处理trigger和dropdown的hover事件
4095
- var handleTriggerMouseEnter = function handleTriggerMouseEnter() {
4096
- _this3.show();
4097
- };
4098
-
4099
- var handleDropdownMouseEnter = function handleDropdownMouseEnter() {
4100
- _this3._clearTimeout();
4101
- };
4102
-
4103
- var handleMouseLeave = function handleMouseLeave() {
4104
- // 延迟隐藏
4105
- _this3.timeout = setTimeout(function () {
4106
- _this3.hide();
4107
- }, _this3.hideTimeout);
4108
- };
4109
-
4110
- // 在trigger和dropdown上分别绑定事件
4111
- this._bindEvent(this.triggerElm, 'mouseenter', handleTriggerMouseEnter);
4112
- this._bindEvent(this.dropdownElm, 'mouseenter', handleDropdownMouseEnter);
4113
- this._bindEvent(this.triggerElm, 'mouseleave', handleMouseLeave);
4114
- this._bindEvent(this.dropdownElm, 'mouseleave', handleMouseLeave);
4115
- } else if (this.trigger === 'click') {
4116
- var handleClick = function handleClick(ev) {
4117
- if (ev.target === _this3.triggerElm || _this3.triggerElm.contains(ev.target)) {
4118
- _this3.handleClick(ev);
4119
- }
4120
- };
4121
-
4122
- this._bindEvent(this.splitButton ? this.triggerElm : container, 'click', handleClick);
4123
- }
4124
- } catch (error) {
4125
- console.error('EsDropdown: 初始化事件时发生错误:', error);
4126
- }
4127
- },
4128
-
4129
-
4130
- /**
4131
- * 优化的事件监听器清理方法
4132
- */
4133
- cleanupEvents: function cleanupEvents() {
4134
- try {
4135
- if (Array.isArray(this._eventListeners) && this._eventListeners.length > 0) {
4136
- // 分组清理相同元素的事件,提高性能
4137
- var groupedEvents = {};
4138
-
4139
- // 按元素分组
4140
- this._eventListeners.forEach(function (_ref3) {
4141
- var elm = _ref3.elm,
4142
- event = _ref3.event,
4143
- handler = _ref3.handler,
4144
- options = _ref3.options;
4145
-
4146
- if (!groupedEvents[elm]) {
4147
- groupedEvents[elm] = [];
4148
- }
4149
- groupedEvents[elm].push({ event: event, handler: handler, options: options });
4150
- });
4151
-
4152
- // 逐个元素清理
4153
- Object.entries(groupedEvents).forEach(function (_ref4) {
4154
- var elm = _ref4[0],
4155
- events = _ref4[1];
4156
-
4157
- if (elm && elm.removeEventListener) {
4158
- events.forEach(function (_ref5) {
4159
- var event = _ref5.event,
4160
- handler = _ref5.handler,
4161
- options = _ref5.options;
4162
-
4163
- try {
4164
- elm.removeEventListener(event, handler, options);
4165
- } catch (e) {
4166
- // 忽略移除不存在的监听器等错误
4167
- }
4168
- });
4169
- }
4170
- });
4171
-
4172
- this._eventListeners = null;
4173
- }
4174
- } catch (error) {
4175
- console.warn('EsDropdown: 清理事件监听器时出错:', error);
4176
- }
4177
- },
4178
-
4179
- /**
4180
- * 通用菜单点击处理
4181
- * @param {string} eventName - 事件名称
4182
- * @param {*} args - 事件参数
4183
- */
4184
- _handleMenuClick: function _handleMenuClick(eventName) {
4185
- if (this.hideOnClick) {
4186
- // 直接设置visible为false而不是调用hide()以避免不必要的延时
4187
- this.visible = false;
4188
- }
4189
-
4190
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4191
- args[_key - 1] = arguments[_key];
4192
- }
4193
-
4194
- this.$emit.apply(this, [eventName].concat(args));
4195
- },
4196
-
4197
-
4198
- /**
4199
- * 处理菜单项点击
4200
- * @param {*} command - 命令参数
4201
- * @param {Object} instance - 菜单项实例
4202
- */
4203
- handleMenuItemClick: function handleMenuItemClick(command, instance) {
4204
- this._handleMenuClick('command', command, instance);
4205
- },
4206
-
4207
- /**
4208
- * 初始化DOM操作
4209
- */
4210
- initDomOperation: function initDomOperation() {
4211
- // 安全地初始化DOM操作
4212
- if (!this.popperElm) {
4213
- console.warn('EsDropdown: popperElm未找到');
4214
- return;
4215
- }
4216
-
4217
- this.dropdownElm = this.popperElm;
4218
-
4219
- try {
4220
- this.initEvent();
4221
- this.initAria();
4222
- } catch (error) {
4223
- console.error('EsDropdown: 初始化DOM操作时出错:', error);
4224
- }
4225
- }
4226
- }
4227
- });
4228
- // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
4229
- /* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
4230
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
4231
- var componentNormalizer = __webpack_require__(5);
4232
-
4233
- // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
4234
-
4235
-
4236
-
4237
-
4238
-
4239
- /* normalize component */
4240
-
4241
- var component = Object(componentNormalizer["a" /* default */])(
4242
- src_dropdownvue_type_script_lang_js_,
4243
- render,
4244
- staticRenderFns,
4245
- false,
4246
- null,
4247
- null,
4248
- null
4249
-
4250
- )
4251
-
4252
- /* harmony default export */ var dropdown = (component.exports);
4253
- // CONCATENATED MODULE: ./packages/dropdown/index.js
4254
-
4255
-
4256
- /* istanbul ignore next */
4257
- dropdown.install = function (Vue) {
4258
- Vue.component(dropdown.name, dropdown);
4259
- };
4260
-
4261
- /* harmony default export */ var packages_dropdown = __webpack_exports__["default"] = (dropdown);
4262
-
4263
- /***/ }),
4264
-
4265
- /***/ 2:
4266
- /***/ (function(module, exports) {
4267
-
4268
- module.exports = require("vue");
4269
-
4270
- /***/ }),
4271
-
4272
- /***/ 27:
4273
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4274
-
4275
- "use strict";
4276
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4277
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4278
- /* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
4279
-
4280
-
4281
-
4282
- var nodeList = [];
4283
- var ctx = '@@clickoutsideContext';
4284
-
4285
- var startClick = void 0;
4286
- var seed = 0;
4287
-
4288
- !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* on */ "g"])(document, 'mousedown', function (e) {
4289
- return startClick = e;
4290
- });
4291
-
4292
- !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* on */ "g"])(document, 'mouseup', function (e) {
4293
- nodeList.forEach(function (node) {
4294
- return node[ctx].documentHandler(e, startClick);
4295
- });
4296
- });
4297
-
4298
- function createDocumentHandler(el, binding, vnode) {
4299
- return function () {
4300
- var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4301
- var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4302
-
4303
- if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
4304
- return;
4305
- }
4306
-
4307
- var context = vnode.context;
4308
-
4309
- // 检查点击是否在 popperElm 内部,即使它已经被添加到 document.body 中
4310
- if (context.popperElm) {
4311
- try {
4312
- if (context.popperElm.contains(mouseup.target) || context.popperElm.contains(mousedown.target)) {
4313
- return;
4314
- }
4315
- } catch (e) {
4316
- // 如果 popperElm 已经被销毁,忽略错误
4317
- }
4318
- }
4319
-
4320
- // 检查是否有其他相关的 popper 元素
4321
- if (context.popper) {
4322
- try {
4323
- if (context.popper.contains(mouseup.target) || context.popper.contains(mousedown.target)) {
4324
- return;
4325
- }
4326
- } catch (e) {
4327
- // 如果 popper 已经被销毁,忽略错误
4328
- }
4329
- }
4330
-
4331
- // 检查是否有其他相关的弹出元素(如 autocomplete 的建议列表)
4332
- if (context.suggestions && context.suggestions.length > 0) {
4333
- // 尝试找到建议列表的 DOM 元素
4334
- var suggestionsElm = document.querySelector('.es-autocomplete-suggestion');
4335
- if (suggestionsElm) {
4336
- try {
4337
- if (suggestionsElm.contains(mouseup.target) || suggestionsElm.contains(mousedown.target)) {
4338
- return;
4339
- }
4340
- } catch (e) {
4341
- // 如果元素已经被销毁,忽略错误
4342
- }
4343
- }
4344
- }
4345
-
4346
- if (binding.expression && el[ctx].methodName && context[el[ctx].methodName]) {
4347
- context[el[ctx].methodName]();
4348
- } else {
4349
- el[ctx].bindingFn && el[ctx].bindingFn();
4350
- }
4351
- };
4352
- }
4353
-
4354
- /**
4355
- * v-clickoutside
4356
- * @desc 点击元素外面才会触发的事件
4357
- * @example
4358
- * ```vue
4359
- * <div v-element-clickoutside="handleClose">
4360
- * ```
4361
- */
4362
- /* harmony default export */ __webpack_exports__["a"] = ({
4363
- bind: function bind(el, binding, vnode) {
4364
- nodeList.push(el);
4365
- var id = seed++;
4366
- el[ctx] = {
4367
- id: id,
4368
- documentHandler: createDocumentHandler(el, binding, vnode),
4369
- methodName: binding.expression,
4370
- bindingFn: binding.value
4371
- };
4372
- },
4373
- update: function update(el, binding, vnode) {
4374
- el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
4375
- el[ctx].methodName = binding.expression;
4376
- el[ctx].bindingFn = binding.value;
4377
- },
4378
- unbind: function unbind(el) {
4379
- var len = nodeList.length;
4380
-
4381
- for (var i = 0; i < len; i++) {
4382
- if (nodeList[i][ctx].id === el[ctx].id) {
4383
- nodeList.splice(i, 1);
4384
- break;
4385
- }
4386
- }
4387
- delete el[ctx];
4388
- }
4389
- });
4390
-
4391
- /***/ }),
4392
-
4393
- /***/ 3:
4394
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4395
-
4396
- "use strict";
4397
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
4398
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
4399
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
4400
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
4401
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
4402
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
4403
- /**
4404
- * 检查一个值是否为字符串类型
4405
- * @param {*} obj 要检查的值
4406
- * @returns {boolean} 如果值为字符串则返回true,否则返回false
4407
- */
4408
- function isString(obj) {
4409
- return Object.prototype.toString.call(obj) === '[object String]';
4410
- }
4411
-
4412
- /**
4413
- * 检查一个值是否为对象类型
4414
- * @param {*} obj 要检查的值
4415
- * @returns {boolean} 如果值为对象则返回true,否则返回false
4416
- */
4417
- function isObject(obj) {
4418
- return Object.prototype.toString.call(obj) === '[object Object]';
4419
- }
4420
-
4421
- /**
4422
- * 检查一个节点是否为HTML元素
4423
- * @param {Node} node 要检查的节点
4424
- * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
4425
- */
4426
- function isHtmlElement(node) {
4427
- return node && node.nodeType === Node.ELEMENT_NODE;
4428
- }
4429
-
4430
- /**
4431
- * 检查一个值是否为函数类型
4432
- * @param {*} functionToCheck 要检查的值
4433
- * @returns {boolean} 如果值为函数则返回true,否则返回false
4434
- */
4435
- function isFunction(functionToCheck) {
4436
- var getType = {};
4437
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
4438
- }
4439
-
4440
- /**
4441
- * 检查一个值是否为undefined
4442
- * @param {*} val 要检查的值
4443
- * @returns {boolean} 如果值为undefined则返回true,否则返回false
4444
- */
4445
- function isUndefined(val) {
4446
- return val === void 0;
4447
- }
4448
-
4449
- /**
4450
- * 检查一个值是否已定义(不是undefined或null)
4451
- * @param {*} val 要检查的值
4452
- * @returns {boolean} 如果值已定义则返回true,否则返回false
4453
- */
4454
- function isDefined(val) {
4455
- return val !== undefined && val !== null;
4456
- }
4457
-
4458
- /***/ }),
4459
-
4460
- /***/ 32:
4461
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4462
-
4463
- "use strict";
4464
- /* harmony import */ var eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4465
-
4466
- /**
4467
- * Show migrating guide in browser console.
4468
- *
4469
- * Usage:
4470
- * import Migrating from 'eoss/src/mixins/migrating';
4471
- *
4472
- * mixins: [Migrating]
4473
- *
4474
- * add getMigratingConfig method for your component.
4475
- * getMigratingConfig() {
4476
- * return {
4477
- * props: {
4478
- * 'allow-no-selection': 'allow-no-selection is removed.',
4479
- * 'selection-mode': 'selection-mode is removed.'
4480
- * },
4481
- * events: {
4482
- * selectionchange: 'selectionchange is renamed to selection-change.'
4483
- * }
4484
- * };
4485
- * },
4486
- */
4487
- /* harmony default export */ __webpack_exports__["a"] = ({
4488
- mounted: function mounted() {
4489
- if (true) return;
4490
- if (!this.$vnode) return;
4491
-
4492
- var _getMigratingConfig = this.getMigratingConfig(),
4493
- _getMigratingConfig$p = _getMigratingConfig.props,
4494
- props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
4495
- _getMigratingConfig$e = _getMigratingConfig.events,
4496
- events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
4497
-
4498
- var _$vnode = this.$vnode,
4499
- data = _$vnode.data,
4500
- componentOptions = _$vnode.componentOptions;
4501
-
4502
- var definedProps = data.attrs || {};
4503
- var definedEvents = componentOptions.listeners || {};
4504
-
4505
- for (var propName in definedProps) {
4506
- propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(propName); // compatible with camel case
4507
- if (props[propName]) {
4508
- console.warn('[Eoss Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
4509
- }
4510
- }
4511
-
4512
- for (var eventName in definedEvents) {
4513
- eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(eventName); // compatible with camel case
4514
- if (events[eventName]) {
4515
- console.warn('[Eoss Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
4516
- }
4517
- }
4518
- },
4519
-
4520
- methods: {
4521
- getMigratingConfig: function getMigratingConfig() {
4522
- return {
4523
- props: {},
4524
- events: {}
4525
- };
4526
- }
4527
- }
4528
- });
4529
-
4530
- /***/ }),
4531
-
4532
- /***/ 33:
4533
- /***/ (function(module, exports) {
4534
-
4535
- module.exports = require("eoss/lib/button");
4536
-
4537
- /***/ }),
4538
-
4539
- /***/ 4:
4540
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4541
-
4542
- "use strict";
4543
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
4544
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
4545
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
4546
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
4547
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
4548
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
4549
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
4550
- /* unused harmony export setStyle */
4551
- /* unused harmony export isScroll */
4552
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
4553
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
4554
- /* unused harmony export insertAfter */
4555
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4556
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4557
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4558
-
4559
- /* istanbul ignore next */
4560
-
4561
-
4562
-
4563
- var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
4564
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
4565
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
4566
- var ieVersion = isServer ? 0 : Number(document.documentMode);
4567
-
4568
- /* istanbul ignore next */
4569
- var trim = function trim(string) {
4570
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
4571
- };
4572
- /* istanbul ignore next */
4573
- var camelCase = function camelCase(name) {
4574
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
4575
- return offset ? letter.toUpperCase() : letter;
4576
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
4577
- };
4578
-
4579
- /* istanbul ignore next */
4580
- var on = function () {
4581
- if (!isServer && document.addEventListener) {
4582
- return function (element, event, handler) {
4583
- if (element && event && handler) {
4584
- element.addEventListener(event, handler, false);
4585
- }
4586
- };
4587
- } else {
4588
- return function (element, event, handler) {
4589
- if (element && event && handler) {
4590
- element.attachEvent('on' + event, handler);
4591
- }
4592
- };
4593
- }
4594
- }();
4595
-
4596
- /* istanbul ignore next */
4597
- var off = function () {
4598
- if (!isServer && document.removeEventListener) {
4599
- return function (element, event, handler) {
4600
- if (element && event) {
4601
- element.removeEventListener(event, handler, false);
4602
- }
4603
- };
4604
- } else {
4605
- return function (element, event, handler) {
4606
- if (element && event) {
4607
- element.detachEvent('on' + event, handler);
4608
- }
4609
- };
4610
- }
4611
- }();
4612
-
4613
- /* istanbul ignore next */
4614
- var once = function once(el, event, fn) {
4615
- var listener = function listener() {
4616
- if (fn) {
4617
- fn.apply(this, arguments);
4618
- }
4619
- off(el, event, listener);
4620
- };
4621
- on(el, event, listener);
4622
- };
4623
-
4624
- /* istanbul ignore next */
4625
- function hasClass(el, cls) {
4626
- if (!el || !cls) return false;
4627
- if (cls.indexOf(' ') !== -1) {
4628
- throw new Error('className should not contain space.');
4629
- }
4630
- if (el.classList) {
4631
- return el.classList.contains(cls);
4632
- } else {
4633
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
4634
- }
4635
- }
4636
-
4637
- /* istanbul ignore next */
4638
- function addClass(el, cls) {
4639
- if (!el) return;
4640
- var curClass = el.className;
4641
- var classes = (cls || '').split(' ');
4642
-
4643
- for (var i = 0, j = classes.length; i < j; i++) {
4644
- var clsName = classes[i];
4645
- if (!clsName) continue;
4646
-
4647
- if (el.classList) {
4648
- el.classList.add(clsName);
4649
- } else if (!hasClass(el, clsName)) {
4650
- curClass += ' ' + clsName;
4651
- }
4652
- }
4653
- if (!el.classList) {
4654
- el.className = curClass;
4655
- }
4656
- }
4657
-
4658
- /* istanbul ignore next */
4659
- function removeClass(el, cls) {
4660
- if (!el || !cls) return;
4661
- var classes = cls.split(' ');
4662
- var curClass = ' ' + el.className + ' ';
4663
-
4664
- for (var i = 0, j = classes.length; i < j; i++) {
4665
- var clsName = classes[i];
4666
- if (!clsName) continue;
4667
-
4668
- if (el.classList) {
4669
- el.classList.remove(clsName);
4670
- } else if (hasClass(el, clsName)) {
4671
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
4672
- }
4673
- }
4674
- if (!el.classList) {
4675
- el.className = trim(curClass);
4676
- }
4677
- }
4678
-
4679
- /* istanbul ignore next */
4680
- var getStyle = ieVersion < 9 ? function (element, styleName) {
4681
- if (isServer) return;
4682
- if (!element || !styleName) return null;
4683
- styleName = camelCase(styleName);
4684
- if (styleName === 'float') {
4685
- styleName = 'styleFloat';
4686
- }
4687
- try {
4688
- switch (styleName) {
4689
- case 'opacity':
4690
- try {
4691
- return element.filters.item('alpha').opacity / 100;
4692
- } catch (e) {
4693
- return 1.0;
4694
- }
4695
- default:
4696
- return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
4697
- }
4698
- } catch (e) {
4699
- return element.style[styleName];
4700
- }
4701
- } : function (element, styleName) {
4702
- if (isServer) return;
4703
- if (!element || !styleName) return null;
4704
- styleName = camelCase(styleName);
4705
- if (styleName === 'float') {
4706
- styleName = 'cssFloat';
4707
- }
4708
- try {
4709
- var computed = document.defaultView.getComputedStyle(element, '');
4710
- return element.style[styleName] || computed ? computed[styleName] : null;
4711
- } catch (e) {
4712
- return element.style[styleName];
4713
- }
4714
- };
4715
-
4716
- /* istanbul ignore next */
4717
- function setStyle(element, styleName, value) {
4718
- if (!element || !styleName) return;
4719
-
4720
- if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
4721
- for (var prop in styleName) {
4722
- if (styleName.hasOwnProperty(prop)) {
4723
- setStyle(element, prop, styleName[prop]);
4724
- }
4725
- }
4726
- } else {
4727
- styleName = camelCase(styleName);
4728
- if (styleName === 'opacity' && ieVersion < 9) {
4729
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
4730
- } else {
4731
- element.style[styleName] = value;
4732
- }
4733
- }
4734
- }
4735
-
4736
- var isScroll = function isScroll(el, vertical) {
4737
- if (isServer) return;
4738
-
4739
- var determinedDirection = vertical !== null || vertical !== undefined;
4740
- var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
4741
-
4742
- return overflow.match(/(scroll|auto)/);
4743
- };
4744
-
4745
- var getScrollContainer = function getScrollContainer(el, vertical) {
4746
- if (isServer) return;
4747
-
4748
- var parent = el;
4749
- while (parent) {
4750
- if ([window, document, document.documentElement].includes(parent)) {
4751
- return window;
4752
- }
4753
- if (isScroll(parent, vertical)) {
4754
- return parent;
4755
- }
4756
- parent = parent.parentNode;
4757
- }
4758
-
4759
- return parent;
4760
- };
4761
-
4762
- var isInContainer = function isInContainer(el, container) {
4763
- if (isServer || !el || !container) return false;
4764
-
4765
- var elRect = el.getBoundingClientRect();
4766
- var containerRect = void 0;
4767
-
4768
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
4769
- containerRect = {
4770
- top: 0,
4771
- right: window.innerWidth,
4772
- bottom: window.innerHeight,
4773
- left: 0
4774
- };
4775
- } else {
4776
- containerRect = container.getBoundingClientRect();
4777
- }
4778
-
4779
- return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
4780
- };
4781
-
4782
- /**
4783
- * 在元素前插入元素
4784
- * @param {HTMLElement} newEl 新DOM元素
4785
- * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
4786
- */
4787
- function insertAfter(newEl, targetEl) {
4788
- var parentEl = targetEl.parentNode;
4789
- if (parentEl.lastChild === targetEl) {
4790
- parentEl.appendChild(newEl);
4791
- } else {
4792
- parentEl.insertBefore(newEl, targetEl.nextSibling);
4793
- }
4794
- }
4795
-
4796
- /***/ }),
4797
-
4798
- /***/ 5:
4799
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4800
-
4801
- "use strict";
4802
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
4803
- /* globals __VUE_SSR_CONTEXT__ */
4804
-
4805
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
4806
- // This module is a runtime utility for cleaner component module output and will
4807
- // be included in the final webpack user bundle.
4808
-
4809
- function normalizeComponent(
4810
- scriptExports,
4811
- render,
4812
- staticRenderFns,
4813
- functionalTemplate,
4814
- injectStyles,
4815
- scopeId,
4816
- moduleIdentifier /* server only */,
4817
- shadowMode /* vue-cli only */
4818
- ) {
4819
- // Vue.extend constructor export interop
4820
- var options =
4821
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
4822
-
4823
- // render functions
4824
- if (render) {
4825
- options.render = render
4826
- options.staticRenderFns = staticRenderFns
4827
- options._compiled = true
4828
- }
4829
-
4830
- // functional template
4831
- if (functionalTemplate) {
4832
- options.functional = true
4833
- }
4834
-
4835
- // scopedId
4836
- if (scopeId) {
4837
- options._scopeId = 'data-v-' + scopeId
4838
- }
4839
-
4840
- var hook
4841
- if (moduleIdentifier) {
4842
- // server build
4843
- hook = function (context) {
4844
- // 2.3 injection
4845
- context =
4846
- context || // cached call
4847
- (this.$vnode && this.$vnode.ssrContext) || // stateful
4848
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
4849
- // 2.2 with runInNewContext: true
4850
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
4851
- context = __VUE_SSR_CONTEXT__
4852
- }
4853
- // inject component styles
4854
- if (injectStyles) {
4855
- injectStyles.call(this, context)
4856
- }
4857
- // register component module identifier for async chunk inferrence
4858
- if (context && context._registeredComponents) {
4859
- context._registeredComponents.add(moduleIdentifier)
4860
- }
4861
- }
4862
- // used by ssr in case component is cached and beforeCreate
4863
- // never gets called
4864
- options._ssrRegister = hook
4865
- } else if (injectStyles) {
4866
- hook = shadowMode
4867
- ? function () {
4868
- injectStyles.call(
4869
- this,
4870
- (options.functional ? this.parent : this).$root.$options.shadowRoot
4871
- )
4872
- }
4873
- : injectStyles
4874
- }
4875
-
4876
- if (hook) {
4877
- if (options.functional) {
4878
- // for template-only hot-reload because in that case the render fn doesn't
4879
- // go through the normalizer
4880
- options._injectStyles = hook
4881
- // register for functional component in vue file
4882
- var originalRender = options.render
4883
- options.render = function renderWithStyleInjection(h, context) {
4884
- hook.call(context)
4885
- return originalRender(h, context)
4886
- }
4887
- } else {
4888
- // inject component registration as beforeCreate hook
4889
- var existing = options.beforeCreate
4890
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
4891
- }
4892
- }
4893
-
4894
- return {
4895
- exports: scriptExports,
4896
- options: options
4897
- }
4898
- }
4899
-
4900
-
4901
- /***/ }),
4902
-
4903
- /***/ 6:
4904
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4905
-
4906
3013
  "use strict";
4907
3014
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
4908
3015
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
@@ -5737,156 +3844,2140 @@ const dateDiff = function (start_date, end_date, unit = 'day') {
5737
3844
  };
5738
3845
 
5739
3846
  /**
5740
- * 获取月份中的日期
5741
- * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
5742
- * @returns {number} 月份中的日期(1-31)
5743
- */
5744
- const dayOfMonth = function (date) {
5745
- if (typeof date !== 'string') {
5746
- throw new Error(
5747
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
5748
- );
5749
- }
5750
-
5751
- const dateObj = new Date(date);
5752
- if (isNaN(dateObj.getTime())) {
5753
- throw new Error(
5754
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5755
- );
5756
- }
5757
-
5758
- return dateObj.getDate();
5759
- };
5760
-
3847
+ * 获取月份中的日期
3848
+ * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
3849
+ * @returns {number} 月份中的日期(1-31)
3850
+ */
3851
+ const dayOfMonth = function (date) {
3852
+ if (typeof date !== 'string') {
3853
+ throw new Error(
3854
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
3855
+ );
3856
+ }
3857
+
3858
+ const dateObj = new Date(date);
3859
+ if (isNaN(dateObj.getTime())) {
3860
+ throw new Error(
3861
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
3862
+ );
3863
+ }
3864
+
3865
+ return dateObj.getDate();
3866
+ };
3867
+
3868
+ /**
3869
+ * 获取当前日期
3870
+ * @date 2022年5月7日
3871
+ * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
3872
+ * @returns {string} 当前日期的格式化字符串
3873
+ */
3874
+ const getCurrentDate = function (format = 'YYYY-MM-DD') {
3875
+ return formatDate(new Date(), format);
3876
+ };
3877
+
3878
+ /**
3879
+ * 获取当前日期时间
3880
+ * @date 2022年5月7日
3881
+ * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
3882
+ * @returns {string} 当前日期时间的格式化字符串
3883
+ */
3884
+ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
3885
+ return formatDate(new Date(), format);
3886
+ };
3887
+
3888
+ /**
3889
+ * 获取小时
3890
+ * @date 2022年5月7日
3891
+ * @param {Date|string} [date] - 日期对象或日期字符串
3892
+ * @returns {number} 小时数(0-23)
3893
+ */
3894
+ const getHour = function (date) {
3895
+ if (!date) {
3896
+ return new Date().getHours();
3897
+ }
3898
+ if (typeof date === 'string') {
3899
+ date = new Date(date);
3900
+ }
3901
+ return date.getHours();
3902
+ };
3903
+
3904
+ /**
3905
+ * 获取分钟
3906
+ * @date 2022年5月7日
3907
+ * @param {Date|string} [date] - 日期对象或日期字符串
3908
+ * @returns {number} 分钟数(0-59)
3909
+ */
3910
+ const getMinute = function (date) {
3911
+ if (!date) {
3912
+ return new Date().getMinutes();
3913
+ }
3914
+ if (typeof date === 'string') {
3915
+ date = new Date(date);
3916
+ }
3917
+ return date.getMinutes();
3918
+ };
3919
+
3920
+ /**
3921
+ * 获取月份
3922
+ * @date 2022年5月7日
3923
+ * @param {Date|string} [date] - 日期对象或日期字符串
3924
+ * @returns {number} 月份数(1-12)
3925
+ */
3926
+ const getMonth = function (date) {
3927
+ if (!date) {
3928
+ return new Date().getMonth() + 1;
3929
+ }
3930
+ if (typeof date === 'string') {
3931
+ date = new Date(date);
3932
+ }
3933
+ return date.getMonth() + 1;
3934
+ };
3935
+
3936
+ /**
3937
+ * 获取秒
3938
+ * @date 2022年5月7日
3939
+ * @param {Date|string} [date] - 日期对象或日期字符串
3940
+ * @returns {number} 秒数(0-59)
3941
+ */
3942
+ const getSecond = function (date) {
3943
+ if (!date) {
3944
+ return new Date().getSeconds();
3945
+ }
3946
+ if (typeof date === 'string') {
3947
+ date = new Date(date);
3948
+ }
3949
+ return date.getSeconds();
3950
+ };
3951
+
3952
+ /**
3953
+ * 获取星期几
3954
+ * @date 2022年5月7日
3955
+ * @param {Date|string} [date] - 日期对象或日期字符串
3956
+ * @returns {number} 星期几(0-6,0表示星期日)
3957
+ */
3958
+ const getWeekday = function (date) {
3959
+ if (!date) {
3960
+ return new Date().getDay();
3961
+ }
3962
+ if (typeof date === 'string') {
3963
+ date = new Date(date);
3964
+ }
3965
+ return date.getDay();
3966
+ };
3967
+
3968
+
3969
+ /**
3970
+ * @desc 获取上午/下午/晚上
3971
+ * @author huangbo
3972
+ * @date 2022年5月7日
3973
+ * @param {String} [time] - 时间
3974
+ **/
3975
+ const timeCycle = function (time) {
3976
+ let hour = 0;
3977
+ if (!time) {
3978
+ hour = new Date().getHours();
3979
+ } else if (typeof time === 'string') {
3980
+ // 从时间字符串中提取小时
3981
+ const match = time.match(/^(\d{1,2})/);
3982
+ if (match) {
3983
+ hour = parseInt(match[1], 10);
3984
+ }
3985
+ } else if (typeof time === 'number') {
3986
+ hour = time;
3987
+ }
3988
+ // 判断时间段
3989
+ if (hour >= 5 && hour < 12) {
3990
+ return '上午';
3991
+ } else if (hour >= 12 && hour < 18) {
3992
+ return '下午';
3993
+ } else {
3994
+ return '晚上';
3995
+ }
3996
+ };
3997
+
3998
+ /***/ }),
3999
+
4000
+ /***/ 10:
4001
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4002
+
4003
+ "use strict";
4004
+ function _broadcast(componentName, eventName, params) {
4005
+ this.$children.forEach(function (child) {
4006
+ var name = child.$options.componentName;
4007
+
4008
+ if (name === componentName) {
4009
+ child.$emit.apply(child, [eventName].concat(params));
4010
+ } else {
4011
+ _broadcast.apply(child, [componentName, eventName].concat([params]));
4012
+ }
4013
+ });
4014
+ }
4015
+ /* harmony default export */ __webpack_exports__["a"] = ({
4016
+ methods: {
4017
+ dispatch: function dispatch(componentName, eventName, params) {
4018
+ var parent = this.$parent || this.$root;
4019
+ var name = parent.$options.componentName;
4020
+
4021
+ while (parent && (!name || name !== componentName)) {
4022
+ parent = parent.$parent;
4023
+
4024
+ if (parent) {
4025
+ name = parent.$options.componentName;
4026
+ }
4027
+ }
4028
+ if (parent) {
4029
+ parent.$emit.apply(parent, [eventName].concat(params));
4030
+ }
4031
+ },
4032
+ broadcast: function broadcast(componentName, eventName, params) {
4033
+ _broadcast.call(this, componentName, eventName, params);
4034
+ }
4035
+ }
4036
+ });
4037
+
4038
+ /***/ }),
4039
+
4040
+ /***/ 13:
4041
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4042
+
4043
+ "use strict";
4044
+ /* unused harmony export getHue */
4045
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
4046
+ /* unused harmony export getLightness */
4047
+ /* unused harmony export getSaturation */
4048
+ /* unused harmony export rgbToHsv */
4049
+ /* unused harmony export hsvTorgb */
4050
+ /* unused harmony export mixColor */
4051
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
4052
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4053
+
4054
+ var $hueStep = 2;
4055
+ var $saturationStep1 = 0.16;
4056
+ var $saturationStep2 = 0.05;
4057
+ var $brightnessStep1 = 0.05;
4058
+ var $brightnessStep2 = 0.15;
4059
+ var $lightColorCount = 5;
4060
+ var $darkColorCount = 4;
4061
+ /**
4062
+ * getHue
4063
+ * @desc:转换色相
4064
+ * @author huangbo
4065
+ * @date 2022年5月7日
4066
+ **/
4067
+ var getHue = function getHue($h, $i, $isLight) {
4068
+ var $hue = void 0;
4069
+ if ($h >= 60 && $h <= 240) {
4070
+ $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
4071
+ } else {
4072
+ $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
4073
+ }
4074
+ $hue = ($hue + 360) % 360;
4075
+ return Math.round($hue);
4076
+ };
4077
+
4078
+ /**
4079
+ * getColor
4080
+ * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
4081
+ * @author huangbo
4082
+ * @date 2022年5月7日
4083
+ **/
4084
+ var getColor = function getColor($color, $n) {
4085
+ var $isLight = $n < 7;
4086
+ var $hsv = rgbToHsv($color);
4087
+ // 这里将i转换成以主色为中心,两侧的i值逐渐增大
4088
+ var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
4089
+ var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
4090
+ return color;
4091
+ };
4092
+
4093
+ /**
4094
+ * getLightness
4095
+ * @desc:转换明度
4096
+ * @author huangbo
4097
+ * @date 2022年5月7日
4098
+ * @return {string,array} 元素类名或者id
4099
+ **/
4100
+ var getLightness = function getLightness($v, $i, $isLight) {
4101
+ var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
4102
+ $value = $value < 1 ? $value : 1;
4103
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
4104
+ };
4105
+
4106
+ /**
4107
+ * getSaturation
4108
+ * @desc:转换饱和度
4109
+ * @author huangbo
4110
+ * @date 2022年5月7日
4111
+ **/
4112
+ var getSaturation = function getSaturation($s, $i, $isLight) {
4113
+ var $saturation = void 0;
4114
+ if ($isLight) {
4115
+ $saturation = $s - $saturationStep1 * $i;
4116
+ } else if ($i === $darkColorCount) {
4117
+ $saturation = $s + $saturationStep1;
4118
+ } else {
4119
+ $saturation = $s + $saturationStep2 * $i;
4120
+ }
4121
+ $saturation = $saturation < 1 ? $saturation : 1;
4122
+
4123
+ if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
4124
+ $saturation = 0.1;
4125
+ }
4126
+ $saturation = $saturation > 0.06 ? $saturation : 0.06;
4127
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
4128
+ };
4129
+
4130
+ /**
4131
+ * rgbToHsv
4132
+ * @desc:rgb转化成hsv
4133
+ * @author huangbo
4134
+ * @date 2022年5月7日
4135
+ * @param {string} [$color] - 颜色值
4136
+ **/
4137
+ var rgbToHsv = function rgbToHsv($color) {
4138
+ var rgb = getRgb($color);
4139
+ var $red = rgb[0];
4140
+ var $green = rgb[1];
4141
+ var $blue = rgb[2];
4142
+ var $max = Math.max($red, $green, $blue);
4143
+ var $min = Math.min($red, $green, $blue);
4144
+ var $diff = $max - $min;
4145
+ var $h = 0;
4146
+ if ($max === $min) {
4147
+ $h = 0;
4148
+ } else if ($max === $red) {
4149
+ $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
4150
+ } else if ($max === $green) {
4151
+ $h = 60 * ($blue - $red) / $diff + 120;
4152
+ } else if ($max === $blue) {
4153
+ $h = 60 * ($red - $green) / $diff + 240;
4154
+ }
4155
+ var $s = $max === 0 ? 0 : $diff / $max;
4156
+ var $v = $max / 255;
4157
+ return [$h, $s, $v];
4158
+ };
4159
+
4160
+ /**
4161
+ * hsvTorgb
4162
+ * @desc:hsv转化成rgb
4163
+ * @author huangbo
4164
+ * @date 2022年5月7日
4165
+ * @param {string} [$color] - 颜色值
4166
+ **/
4167
+ var hsvTorgb = function hsvTorgb($h, $s, $v) {
4168
+ var $th = Math.floor($h / 60);
4169
+ var $t1 = $h / 60 - $th;
4170
+ var $t2 = $v * (1 - $s);
4171
+ var $t3 = $v * (1 - $t1 * $s);
4172
+ var $t4 = $v * (1 - (1 - $t1) * $s);
4173
+ var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
4174
+ var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
4175
+ var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
4176
+ // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
4177
+ var red = Math.round($r * 255);
4178
+ var green = Math.round($g * 255);
4179
+ var blue = Math.round($b * 255);
4180
+ red = red.toString(16);
4181
+ green = green.toString(16);
4182
+ blue = blue.toString(16);
4183
+ red = red.length === 1 ? '0' + red : red;
4184
+ green = green.length === 1 ? '0' + green : green;
4185
+ blue = blue.length === 1 ? '0' + blue : blue;
4186
+ return '#' + red + green + blue;
4187
+ };
4188
+
4189
+ /**
4190
+ * mixColor
4191
+ * @desc:生成混合色
4192
+ * @author huangbo
4193
+ * @date 2022年5月7日
4194
+ * @param {string} [$color1] - 颜色值
4195
+ * @param {string} [$color2] - 颜色值
4196
+ * @param {string} [$n] - 百分比 0~1
4197
+ **/
4198
+ var mixColor = function mixColor($color1, $color2, $n) {
4199
+ var rgb1 = getRgb($color1);
4200
+ var rgb2 = getRgb($color2);
4201
+ var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
4202
+ var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
4203
+ var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
4204
+ return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
4205
+ };
4206
+
4207
+ /**
4208
+ * getRgb
4209
+ * @desc:获取颜色值的rgb值
4210
+ * @author huangbo
4211
+ * @date 2022年5月7日
4212
+ * @param {string} [$color] - 颜色值
4213
+ **/
4214
+ var getRgb = function getRgb($color) {
4215
+ var rgb = [];
4216
+ // 16进制颜色值的正则
4217
+ var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
4218
+ // 把颜色值变成小写
4219
+ $color = $color.toLowerCase();
4220
+ if (reg.test($color)) {
4221
+ // 如果只有三位的值,需变成六位,如:#fff => #ffffff
4222
+ if ($color.length === 4) {
4223
+ var colorNew = '#';
4224
+ for (var i = 1; i < 4; i++) {
4225
+ colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
4226
+ }
4227
+ $color = colorNew;
4228
+ }
4229
+ // 处理六位的颜色值,转为RGB
4230
+ for (var _i = 1; _i < 7; _i += 2) {
4231
+ rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
4232
+ }
4233
+ } else {
4234
+ rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
4235
+ }
4236
+ return rgb;
4237
+ };
4238
+
4239
+ /***/ }),
4240
+
4241
+ /***/ 18:
4242
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4243
+
4244
+ "use strict";
4245
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
4246
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4247
+ /* harmony import */ var eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
4248
+
4249
+
4250
+
4251
+ var nodeList = [];
4252
+ var ctx = '@@clickoutsideContext';
4253
+
4254
+ var startClick = void 0;
4255
+ var seed = 0;
4256
+
4257
+ !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* on */ "g"])(document, 'mousedown', function (e) {
4258
+ return startClick = e;
4259
+ });
4260
+
4261
+ !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(eoss_src_utils_dom__WEBPACK_IMPORTED_MODULE_1__[/* on */ "g"])(document, 'mouseup', function (e) {
4262
+ nodeList.forEach(function (node) {
4263
+ return node[ctx].documentHandler(e, startClick);
4264
+ });
4265
+ });
4266
+
4267
+ function createDocumentHandler(el, binding, vnode) {
4268
+ return function () {
4269
+ var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4270
+ var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4271
+
4272
+ if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target) {
4273
+ return;
4274
+ }
4275
+
4276
+ var context = vnode.context;
4277
+
4278
+ // 检查点击是否在 popperElm 内部,即使它已经被添加到 document.body 中
4279
+ if (context.popperElm) {
4280
+ try {
4281
+ if (context.popperElm.contains(mouseup.target) || context.popperElm.contains(mousedown.target)) {
4282
+ return;
4283
+ }
4284
+ } catch (e) {
4285
+ // 如果 popperElm 已经被销毁,忽略错误
4286
+ }
4287
+ }
4288
+
4289
+ // 检查是否有其他相关的 popper 元素
4290
+ if (context.popper) {
4291
+ try {
4292
+ if (context.popper.contains(mouseup.target) || context.popper.contains(mousedown.target)) {
4293
+ return;
4294
+ }
4295
+ } catch (e) {
4296
+ // 如果 popper 已经被销毁,忽略错误
4297
+ }
4298
+ }
4299
+
4300
+ // 检查是否有其他相关的弹出元素(如 autocomplete 的建议列表)
4301
+ if (context.suggestions && context.suggestions.length > 0) {
4302
+ // 尝试找到建议列表的 DOM 元素
4303
+ var suggestionsElm = document.querySelector('.es-autocomplete-suggestion');
4304
+ if (suggestionsElm) {
4305
+ try {
4306
+ if (suggestionsElm.contains(mouseup.target) || suggestionsElm.contains(mousedown.target)) {
4307
+ return;
4308
+ }
4309
+ } catch (e) {
4310
+ // 如果元素已经被销毁,忽略错误
4311
+ }
4312
+ }
4313
+ }
4314
+
4315
+ if (binding.expression && el[ctx].methodName && context[el[ctx].methodName]) {
4316
+ context[el[ctx].methodName]();
4317
+ } else {
4318
+ el[ctx].bindingFn && el[ctx].bindingFn();
4319
+ }
4320
+ };
4321
+ }
4322
+
4323
+ /**
4324
+ * v-clickoutside
4325
+ * @desc 点击元素外面才会触发的事件
4326
+ * @example
4327
+ * ```vue
4328
+ * <div v-element-clickoutside="handleClose">
4329
+ * ```
4330
+ */
4331
+ /* harmony default export */ __webpack_exports__["a"] = ({
4332
+ bind: function bind(el, binding, vnode) {
4333
+ nodeList.push(el);
4334
+ var id = seed++;
4335
+ el[ctx] = {
4336
+ id: id,
4337
+ documentHandler: createDocumentHandler(el, binding, vnode),
4338
+ methodName: binding.expression,
4339
+ bindingFn: binding.value
4340
+ };
4341
+ },
4342
+ update: function update(el, binding, vnode) {
4343
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
4344
+ el[ctx].methodName = binding.expression;
4345
+ el[ctx].bindingFn = binding.value;
4346
+ },
4347
+ unbind: function unbind(el) {
4348
+ var len = nodeList.length;
4349
+
4350
+ for (var i = 0; i < len; i++) {
4351
+ if (nodeList[i][ctx].id === el[ctx].id) {
4352
+ nodeList.splice(i, 1);
4353
+ break;
4354
+ }
4355
+ }
4356
+ delete el[ctx];
4357
+ }
4358
+ });
4359
+
4360
+ /***/ }),
4361
+
4362
+ /***/ 19:
4363
+ /***/ (function(module, exports) {
4364
+
4365
+ module.exports = require("eoss/lib/loading");
4366
+
4367
+ /***/ }),
4368
+
4369
+ /***/ 194:
4370
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4371
+
4372
+ "use strict";
4373
+ // ESM COMPAT FLAG
4374
+ __webpack_require__.r(__webpack_exports__);
4375
+
4376
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=template&id=cf516038&
4377
+ var render = function () {
4378
+ var _vm = this
4379
+ var _h = _vm.$createElement
4380
+ var _c = _vm._self._c || _h
4381
+ return _c(
4382
+ "div",
4383
+ {
4384
+ directives: [
4385
+ {
4386
+ name: "clickoutside",
4387
+ rawName: "v-clickoutside",
4388
+ value: _vm.hide,
4389
+ expression: "hide",
4390
+ },
4391
+ ],
4392
+ ref: "dropdownWrapper",
4393
+ staticClass: "es-dropdown",
4394
+ class: this.dropdownSize ? "es-dropdown--" + this.dropdownSize : "",
4395
+ },
4396
+ [
4397
+ !_vm.splitButton
4398
+ ? [
4399
+ _vm._t("default", function () {
4400
+ return [
4401
+ _c(
4402
+ "es-button",
4403
+ _vm._b(
4404
+ { ref: "trigger" },
4405
+ "es-button",
4406
+ _vm.buttonProps,
4407
+ false
4408
+ ),
4409
+ [
4410
+ _vm._v("\n " + _vm._s(_vm._text) + "\n "),
4411
+ _c("i", {
4412
+ staticClass: "es-dropdown__icon",
4413
+ class: [_vm._icon, { "is-rotate": _vm.visible }],
4414
+ }),
4415
+ ]
4416
+ ),
4417
+ ]
4418
+ }),
4419
+ ]
4420
+ : [
4421
+ _c(
4422
+ "es-button-group",
4423
+ { attrs: { separate: false } },
4424
+ [
4425
+ _c(
4426
+ "es-button",
4427
+ {
4428
+ attrs: {
4429
+ type: _vm.type,
4430
+ size: _vm.dropdownSize,
4431
+ text: _vm._text,
4432
+ },
4433
+ on: { click: _vm.handleMainButtonClick },
4434
+ },
4435
+ [_vm._t("default")],
4436
+ 2
4437
+ ),
4438
+ _c(
4439
+ "es-button",
4440
+ {
4441
+ ref: "trigger",
4442
+ staticClass: "es-dropdown__caret-button",
4443
+ attrs: { type: _vm.type, size: _vm.dropdownSize },
4444
+ },
4445
+ [
4446
+ _c("i", {
4447
+ staticClass: "es-dropdown__icon",
4448
+ class: [
4449
+ "es-dropdown__icon",
4450
+ _vm._icon,
4451
+ { "is-rotate": _vm.visible },
4452
+ ],
4453
+ }),
4454
+ ]
4455
+ ),
4456
+ ],
4457
+ 1
4458
+ ),
4459
+ ],
4460
+ _vm._t("dropdown", function () {
4461
+ return [
4462
+ _vm.contents
4463
+ ? _c("es-dropdown-menu", {
4464
+ attrs: { "max-height": _vm.maxHeight, contents: _vm.contents },
4465
+ })
4466
+ : _vm._e(),
4467
+ ]
4468
+ }),
4469
+ ],
4470
+ 2
4471
+ )
4472
+ }
4473
+ var staticRenderFns = []
4474
+ render._withStripped = true
4475
+
4476
+
4477
+ // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=template&id=cf516038&
4478
+
4479
+ // EXTERNAL MODULE: ./src/utils/clickoutside.js
4480
+ var clickoutside = __webpack_require__(18);
4481
+
4482
+ // EXTERNAL MODULE: ./src/mixins/emitter.js
4483
+ var emitter = __webpack_require__(10);
4484
+
4485
+ // EXTERNAL MODULE: ./src/mixins/migrating.js
4486
+ var migrating = __webpack_require__(27);
4487
+
4488
+ // EXTERNAL MODULE: external "eoss/lib/button"
4489
+ var button_ = __webpack_require__(28);
4490
+ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
4491
+
4492
+ // EXTERNAL MODULE: external "eoss/lib/button-group"
4493
+ var button_group_ = __webpack_require__(86);
4494
+ var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
4495
+
4496
+ // EXTERNAL MODULE: external "eoss/lib/dropdown-menu"
4497
+ var dropdown_menu_ = __webpack_require__(93);
4498
+ var dropdown_menu_default = /*#__PURE__*/__webpack_require__.n(dropdown_menu_);
4499
+
4500
+ // EXTERNAL MODULE: ./src/utils/util.js
4501
+ var util = __webpack_require__(0);
4502
+
4503
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
4504
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4505
+
4506
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
4507
+
4508
+ //
4509
+ //
4510
+ //
4511
+ //
4512
+ //
4513
+ //
4514
+ //
4515
+ //
4516
+ //
4517
+ //
4518
+ //
4519
+ //
4520
+ //
4521
+ //
4522
+ //
4523
+ //
4524
+ //
4525
+ //
4526
+ //
4527
+ //
4528
+ //
4529
+ //
4530
+ //
4531
+ //
4532
+ //
4533
+ //
4534
+ //
4535
+ //
4536
+ //
4537
+ //
4538
+ //
4539
+ //
4540
+ //
4541
+ //
4542
+ //
4543
+ //
4544
+ //
4545
+ //
4546
+ //
4547
+ //
4548
+ //
4549
+ //
4550
+ //
4551
+ //
4552
+ //
4553
+ //
4554
+ //
4555
+ //
4556
+ //
4557
+ //
4558
+ //
4559
+ //
4560
+ //
4561
+ //
4562
+ //
4563
+ //
4564
+
4565
+
4566
+
4567
+
4568
+
4569
+
4570
+
4571
+
4572
+
4573
+ /**
4574
+ * 下拉菜单组件
4575
+ * 功能说明:提供下拉菜单功能,支持 hover 和 click 两种触发方式,可自定义菜单内容和位置
4576
+ * 适用场景:需要展示一组操作选项,节省空间的场景
4577
+ */
4578
+ /* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
4579
+ name: 'EsDropdown',
4580
+
4581
+ componentName: 'EsDropdown',
4582
+
4583
+ mixins: [emitter["a" /* default */], migrating["a" /* default */]],
4584
+
4585
+ directives: {
4586
+ Clickoutside: clickoutside["a" /* default */]
4587
+ },
4588
+
4589
+ components: {
4590
+ EsButton: button_default.a,
4591
+ EsButtonGroup: button_group_default.a,
4592
+ EsDropdownMenu: dropdown_menu_default.a
4593
+ },
4594
+
4595
+ provide: function provide() {
4596
+ return {
4597
+ dropdown: this
4598
+ };
4599
+ },
4600
+
4601
+
4602
+ props: {
4603
+ /**
4604
+ * 触发下拉的行为
4605
+ */
4606
+ trigger: {
4607
+ type: String,
4608
+ default: 'hover'
4609
+ },
4610
+ /**
4611
+ * 菜单按钮类型,同 Button 组件(只在 split-button 为 true 或 button 为{}【空对象】的情况下有效)
4612
+ */
4613
+ type: {
4614
+ type: String,
4615
+ default: 'text'
4616
+ },
4617
+ /**
4618
+ * 菜单尺寸,在 split-button 为 true 或 button 为{}【空对象】 的情况下也对触发按钮生效
4619
+ */
4620
+ size: String,
4621
+ /**
4622
+ * 下拉触发元素呈现为按钮组
4623
+ */
4624
+ splitButton: Boolean,
4625
+ /**
4626
+ * 是否在点击菜单项后隐藏菜单
4627
+ */
4628
+ hideOnClick: {
4629
+ type: Boolean,
4630
+ default: true
4631
+ },
4632
+ /**
4633
+ * 菜单弹出位置
4634
+ */
4635
+ placement: {
4636
+ type: String,
4637
+ default: 'bottom-end'
4638
+ },
4639
+ /**
4640
+ * 是否显示下拉菜单的箭头
4641
+ */
4642
+ visibleArrow: {
4643
+ default: true
4644
+ },
4645
+ /**
4646
+ * 展开下拉菜单的延时(仅在 trigger 为 hover 时有效)
4647
+ */
4648
+ showTimeout: {
4649
+ type: Number,
4650
+ default: 250
4651
+ },
4652
+ /**
4653
+ * 收起下拉菜单的延时(仅在 trigger 为 hover 时有效)
4654
+ */
4655
+ hideTimeout: {
4656
+ type: Number,
4657
+ default: 150
4658
+ },
4659
+ /**
4660
+ * Dropdown 组件的 tabindex
4661
+ */
4662
+ tabindex: {
4663
+ type: Number,
4664
+ default: -1
4665
+ },
4666
+ /**
4667
+ * 下拉箭头的图标类名
4668
+ */
4669
+ icon: {
4670
+ type: String,
4671
+ default: 'es-icon-xia'
4672
+ },
4673
+ /**
4674
+ * 按钮文本
4675
+ */
4676
+ text: String,
4677
+ /**
4678
+ * 在 split-button 为 false 时,触发元素呈现为 button 时的配置
4679
+ */
4680
+ button: Object,
4681
+ /**
4682
+ * 下拉菜单的内容
4683
+ */
4684
+ contents: Array,
4685
+ /**
4686
+ * 菜单的最大高度
4687
+ */
4688
+ maxHeight: Number,
4689
+ /**
4690
+ * 下拉菜单内容中,用于显示选项文本的键名
4691
+ */
4692
+ labelKey: String
4693
+ },
4694
+
4695
+ data: function data() {
4696
+ return {
4697
+ timeout: null,
4698
+ visible: false,
4699
+ triggerElm: null,
4700
+ dropdownElm: null,
4701
+ focusing: false,
4702
+ listId: 'dropdown-menu-' + Object(util["r" /* generateId */])(),
4703
+ _eventListeners: null
4704
+ };
4705
+ },
4706
+
4707
+
4708
+ computed: {
4709
+ /**
4710
+ * 获取正确的下拉菜单尺寸
4711
+ */
4712
+ dropdownSize: function dropdownSize() {
4713
+ var elementSize = this.$ELEMENT && this.$ELEMENT.size;
4714
+ return this.size || elementSize || '';
4715
+ },
4716
+ _text: function _text() {
4717
+ return (this.button || {}).text || this.text;
4718
+ },
4719
+
4720
+ /**
4721
+ * 计算下拉箭头图标类名
4722
+ * 优先使用 button 配置中的 icon,否则使用 prop 的 icon
4723
+ */
4724
+ _icon: function _icon() {
4725
+ return (this.button || {}).icon || this.icon;
4726
+ },
4727
+
4728
+ /**
4729
+ * 计算button属性,合并默认值
4730
+ */
4731
+ buttonProps: function buttonProps() {
4732
+ var _ref = this.button || {},
4733
+ icon = _ref.icon,
4734
+ text = _ref.text,
4735
+ other = _objectWithoutProperties(_ref, ['icon', 'text']);
4736
+
4737
+ return _extends({
4738
+ type: this.type,
4739
+ size: this.dropdownSize
4740
+ }, other);
4741
+ }
4742
+ },
4743
+
4744
+ mounted: function mounted() {
4745
+ this.$on('menu-item-click', this.handleMenuItemClick);
4746
+ },
4747
+ beforeDestroy: function beforeDestroy() {
4748
+ // 清理定时器和事件监听器
4749
+ this._clearTimeout();
4750
+ this.cleanupEvents();
4751
+ },
4752
+
4753
+
4754
+ watch: {
4755
+ /**
4756
+ * 监听 visible 变化
4757
+ */
4758
+ visible: function visible(val) {
4759
+ this.broadcast('EsDropdownMenu', 'visible', val);
4760
+ this.$emit('visible-change', val);
4761
+ },
4762
+
4763
+ /**
4764
+ * 监听 focusing 变化
4765
+ */
4766
+ focusing: function focusing(val) {
4767
+ try {
4768
+ var selfDefine = this.$el ? this.$el.querySelector('.es-dropdown-selfdefine') : null;
4769
+ if (selfDefine && selfDefine.classList) {
4770
+ // 使用classList API更安全地操作类名
4771
+ if (val) {
4772
+ selfDefine.classList.add('focusing');
4773
+ } else {
4774
+ selfDefine.classList.remove('focusing');
4775
+ }
4776
+ }
4777
+ } catch (error) {
4778
+ console.warn('EsDropdown: 处理焦点样式时出错:', error);
4779
+ }
4780
+ }
4781
+ },
4782
+
4783
+ methods: {
4784
+ /**
4785
+ * 获取迁移配置
4786
+ */
4787
+ getMigratingConfig: function getMigratingConfig() {
4788
+ return {
4789
+ props: {
4790
+ 'menu-align': 'menu-align is renamed to placement.'
4791
+ }
4792
+ };
4793
+ },
4794
+
4795
+ /**
4796
+ * 通用的可见性切换方法
4797
+ * @param {boolean} shouldShow - 是否显示下拉菜单
4798
+ */
4799
+ _toggleVisible: function _toggleVisible(shouldShow) {
4800
+ var _this = this;
4801
+
4802
+ // 安全检查
4803
+ if (!this.triggerElm || this.triggerElm.disabled) return;
4804
+
4805
+ // 清除之前的定时器
4806
+ this._clearTimeout();
4807
+
4808
+ // 设置延时
4809
+ var delay = this.trigger === 'click' ? 0 : shouldShow ? this.showTimeout : this.hideTimeout;
4810
+
4811
+ this.timeout = setTimeout(function () {
4812
+ _this.visible = shouldShow;
4813
+ }, delay);
4814
+ },
4815
+
4816
+
4817
+ /**
4818
+ * 显示下拉菜单
4819
+ */
4820
+ show: function show() {
4821
+ this._toggleVisible(true);
4822
+ },
4823
+
4824
+
4825
+ /**
4826
+ * 隐藏下拉菜单
4827
+ */
4828
+ hide: function hide() {
4829
+ this._toggleVisible(false);
4830
+ },
4831
+
4832
+
4833
+ /**
4834
+ * 统一的定时器清理方法
4835
+ */
4836
+ _clearTimeout: function _clearTimeout() {
4837
+ if (this.timeout) {
4838
+ clearTimeout(this.timeout);
4839
+ this.timeout = null;
4840
+ }
4841
+ },
4842
+
4843
+ /**
4844
+ * 处理触发元素点击
4845
+ * @param {Event} event - 点击事件对象
4846
+ */
4847
+ handleClick: function handleClick(event) {
4848
+ if (!this.triggerElm || this.triggerElm.disabled) return;
4849
+
4850
+ // 阻止事件冒泡以避免与clickoutside冲突
4851
+ if (event && event.stopPropagation) {
4852
+ event.stopPropagation();
4853
+ }
4854
+
4855
+ // 切换可见性
4856
+ if (this.visible) {
4857
+ this.hide();
4858
+ } else {
4859
+ this.show();
4860
+ }
4861
+ },
4862
+
4863
+
4864
+ /**
4865
+ * 处理主按钮点击
4866
+ * @param {Event} event - 点击事件对象
4867
+ */
4868
+ handleMainButtonClick: function handleMainButtonClick(event) {
4869
+ this.$emit('click', event);
4870
+ this.hide();
4871
+ },
4872
+
4873
+
4874
+ /**
4875
+ * 初始化ARIA属性
4876
+ */
4877
+ initAria: function initAria() {
4878
+ // 安全地初始化ARIA属性
4879
+ try {
4880
+ if (!this.dropdownElm || !this.dropdownElm.setAttribute || !this.triggerElm || !this.triggerElm.setAttribute) {
4881
+ return;
4882
+ }
4883
+
4884
+ this.dropdownElm.setAttribute('id', this.listId);
4885
+ this.triggerElm.setAttribute('aria-haspopup', 'list');
4886
+ this.triggerElm.setAttribute('aria-controls', this.listId);
4887
+ this.triggerElm.setAttribute('aria-expanded', String(this.visible));
4888
+
4889
+ if (!this.splitButton) {
4890
+ // 使用classList API安全地添加类名
4891
+ if (this.triggerElm.classList) {
4892
+ this.triggerElm.classList.add('es-dropdown-selfdefine');
4893
+ }
4894
+ }
4895
+ } catch (error) {
4896
+ console.warn('EsDropdown: 初始化ARIA属性时出错:', error);
4897
+ }
4898
+ },
4899
+
4900
+ /**
4901
+ * 优化的事件绑定方法
4902
+ * @param {Element} element - 要绑定事件的元素
4903
+ * @param {string} event - 事件名称
4904
+ * @param {Function} handler - 事件处理函数
4905
+ * @param {boolean|Object} options - 事件选项
4906
+ */
4907
+ _bindEvent: function _bindEvent(element, event, handler) {
4908
+ var _this2 = this;
4909
+
4910
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4911
+
4912
+ if (!element || !element.addEventListener) return;
4913
+
4914
+ // 使用闭包包装handler以保持this上下文
4915
+ var wrappedHandler = function wrappedHandler(e) {
4916
+ return handler.call(_this2, e);
4917
+ };
4918
+
4919
+ element.addEventListener(event, wrappedHandler, options);
4920
+
4921
+ // 存储包装后的处理函数以便正确移除
4922
+ if (!this._eventListeners) {
4923
+ this._eventListeners = [];
4924
+ }
4925
+
4926
+ this._eventListeners.push({
4927
+ elm: element,
4928
+ event: event,
4929
+ handler: wrappedHandler, // 存储包装后的函数
4930
+ originalHandler: handler, // 可选:存储原始函数用于调试
4931
+ options: options
4932
+ });
4933
+ },
4934
+
4935
+
4936
+ /**
4937
+ * 统一的事件解绑方法
4938
+ * @param {Element} element - 要解绑事件的元素
4939
+ * @param {string} event - 事件名称
4940
+ * @param {Function} handler - 事件处理函数
4941
+ * @param {boolean|Object} options - 事件选项
4942
+ */
4943
+ _unbindEvent: function _unbindEvent(element, event, handler) {
4944
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4945
+
4946
+ if (!element || !element.removeEventListener) return;
4947
+
4948
+ // 查找对应的监听器并移除
4949
+ if (Array.isArray(this._eventListeners)) {
4950
+ var index = this._eventListeners.findIndex(function (item) {
4951
+ return item.elm === element && item.event === event && (item.originalHandler === handler || item.handler === handler);
4952
+ });
4953
+
4954
+ if (index > -1) {
4955
+ var wrappedHandler = this._eventListeners[index].handler;
4956
+
4957
+ element.removeEventListener(event, wrappedHandler, options);
4958
+ this._eventListeners.splice(index, 1);
4959
+ }
4960
+ }
4961
+ },
4962
+
4963
+
4964
+ /**
4965
+ * 使用事件委托优化的初始化事件方法
4966
+ */
4967
+ initEvent: function initEvent() {
4968
+ var _this3 = this;
4969
+
4970
+ try {
4971
+ // 优先使用ref获取trigger
4972
+ if (this.$refs.trigger) {
4973
+ this.triggerElm = this.$refs.trigger.$el || this.$refs.trigger;
4974
+ } else if (this.$slots.default) {
4975
+ // 遍历slots查找含有trigger标识的元素
4976
+ var foundTrigger = false;
4977
+ for (var _iterator = this.$slots.default, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
4978
+ var _ref2;
4979
+
4980
+ if (_isArray) {
4981
+ if (_i >= _iterator.length) break;
4982
+ _ref2 = _iterator[_i++];
4983
+ } else {
4984
+ _i = _iterator.next();
4985
+ if (_i.done) break;
4986
+ _ref2 = _i.value;
4987
+ }
4988
+
4989
+ var slotItem = _ref2;
4990
+
4991
+ if (slotItem && slotItem.elm) {
4992
+ // 检查元素或其属性是否有trigger标识
4993
+ var hasTriggerProp = slotItem.data && slotItem.data.attrs && slotItem.data.attrs['trigger'] === 'true';
4994
+
4995
+ if (hasTriggerProp) {
4996
+ this.triggerElm = slotItem.elm;
4997
+ foundTrigger = true;
4998
+ break;
4999
+ }
5000
+ }
5001
+ }
5002
+
5003
+ // 如果没找到有trigger标识的元素,则使用默认的第一个元素
5004
+ if (!foundTrigger && this.$slots.default[0] && this.$slots.default[0].elm) {
5005
+ this.triggerElm = this.$slots.default[0].elm;
5006
+ }
5007
+ }
5008
+ if (!this.triggerElm || !this.dropdownElm || !this.$refs.dropdownWrapper) {
5009
+ console.warn('EsDropdown: 无法正确初始化元素');
5010
+ return;
5011
+ }
5012
+
5013
+ // 清空已存在的事件监听器
5014
+ this.cleanupEvents();
5015
+
5016
+ // 获取组件根元素作为委托容器
5017
+ var container = this.$refs.dropdownWrapper;
5018
+
5019
+ // 控制自定义元素的样式 - 使用事件委托
5020
+ if (!this.splitButton) {
5021
+ var handleFocusBlur = function handleFocusBlur(ev) {
5022
+ if (ev.target === _this3.triggerElm) {
5023
+ _this3.focusing = ev.type === 'focus';
5024
+ if (ev.type === 'click') {
5025
+ _this3.focusing = false;
5026
+ }
5027
+ }
5028
+ };
5029
+
5030
+ this._bindEvent(container, 'focus', handleFocusBlur, true);
5031
+ this._bindEvent(container, 'blur', handleFocusBlur, true);
5032
+ this._bindEvent(container, 'click', handleFocusBlur);
5033
+ }
5034
+
5035
+ // 根据trigger类型绑定不同的事件
5036
+ if (this.trigger === 'hover') {
5037
+ // 分别处理trigger和dropdown的hover事件
5038
+ var handleTriggerMouseEnter = function handleTriggerMouseEnter() {
5039
+ _this3.show();
5040
+ };
5041
+
5042
+ var handleDropdownMouseEnter = function handleDropdownMouseEnter() {
5043
+ _this3._clearTimeout();
5044
+ };
5045
+
5046
+ var handleMouseLeave = function handleMouseLeave() {
5047
+ // 延迟隐藏
5048
+ _this3.timeout = setTimeout(function () {
5049
+ _this3.hide();
5050
+ }, _this3.hideTimeout);
5051
+ };
5052
+
5053
+ // 在trigger和dropdown上分别绑定事件
5054
+ this._bindEvent(this.triggerElm, 'mouseenter', handleTriggerMouseEnter);
5055
+ this._bindEvent(this.dropdownElm, 'mouseenter', handleDropdownMouseEnter);
5056
+ this._bindEvent(this.triggerElm, 'mouseleave', handleMouseLeave);
5057
+ this._bindEvent(this.dropdownElm, 'mouseleave', handleMouseLeave);
5058
+ } else if (this.trigger === 'click') {
5059
+ var handleClick = function handleClick(ev) {
5060
+ if (ev.target === _this3.triggerElm || _this3.triggerElm.contains(ev.target)) {
5061
+ _this3.handleClick(ev);
5062
+ }
5063
+ };
5064
+
5065
+ this._bindEvent(this.splitButton ? this.triggerElm : container, 'click', handleClick);
5066
+ }
5067
+ } catch (error) {
5068
+ console.error('EsDropdown: 初始化事件时发生错误:', error);
5069
+ }
5070
+ },
5071
+
5072
+
5073
+ /**
5074
+ * 优化的事件监听器清理方法
5075
+ */
5076
+ cleanupEvents: function cleanupEvents() {
5077
+ try {
5078
+ if (Array.isArray(this._eventListeners) && this._eventListeners.length > 0) {
5079
+ // 分组清理相同元素的事件,提高性能
5080
+ var groupedEvents = {};
5081
+
5082
+ // 按元素分组
5083
+ this._eventListeners.forEach(function (_ref3) {
5084
+ var elm = _ref3.elm,
5085
+ event = _ref3.event,
5086
+ handler = _ref3.handler,
5087
+ options = _ref3.options;
5088
+
5089
+ if (!groupedEvents[elm]) {
5090
+ groupedEvents[elm] = [];
5091
+ }
5092
+ groupedEvents[elm].push({ event: event, handler: handler, options: options });
5093
+ });
5094
+
5095
+ // 逐个元素清理
5096
+ Object.entries(groupedEvents).forEach(function (_ref4) {
5097
+ var elm = _ref4[0],
5098
+ events = _ref4[1];
5099
+
5100
+ if (elm && elm.removeEventListener) {
5101
+ events.forEach(function (_ref5) {
5102
+ var event = _ref5.event,
5103
+ handler = _ref5.handler,
5104
+ options = _ref5.options;
5105
+
5106
+ try {
5107
+ elm.removeEventListener(event, handler, options);
5108
+ } catch (e) {
5109
+ // 忽略移除不存在的监听器等错误
5110
+ }
5111
+ });
5112
+ }
5113
+ });
5114
+
5115
+ this._eventListeners = null;
5116
+ }
5117
+ } catch (error) {
5118
+ console.warn('EsDropdown: 清理事件监听器时出错:', error);
5119
+ }
5120
+ },
5121
+
5122
+ /**
5123
+ * 通用菜单点击处理
5124
+ * @param {string} eventName - 事件名称
5125
+ * @param {*} args - 事件参数
5126
+ */
5127
+ _handleMenuClick: function _handleMenuClick(eventName) {
5128
+ if (this.hideOnClick) {
5129
+ // 直接设置visible为false而不是调用hide()以避免不必要的延时
5130
+ this.visible = false;
5131
+ }
5132
+
5133
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5134
+ args[_key - 1] = arguments[_key];
5135
+ }
5136
+
5137
+ this.$emit.apply(this, [eventName].concat(args));
5138
+ },
5139
+
5140
+
5141
+ /**
5142
+ * 处理菜单项点击
5143
+ * @param {*} command - 命令参数
5144
+ * @param {Object} instance - 菜单项实例
5145
+ */
5146
+ handleMenuItemClick: function handleMenuItemClick(command, instance) {
5147
+ this._handleMenuClick('command', command, instance);
5148
+ },
5149
+
5150
+ /**
5151
+ * 初始化DOM操作
5152
+ */
5153
+ initDomOperation: function initDomOperation() {
5154
+ // 安全地初始化DOM操作
5155
+ if (!this.popperElm) {
5156
+ console.warn('EsDropdown: popperElm未找到');
5157
+ return;
5158
+ }
5159
+
5160
+ this.dropdownElm = this.popperElm;
5161
+
5162
+ try {
5163
+ this.initEvent();
5164
+ this.initAria();
5165
+ } catch (error) {
5166
+ console.error('EsDropdown: 初始化DOM操作时出错:', error);
5167
+ }
5168
+ }
5169
+ }
5170
+ });
5171
+ // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
5172
+ /* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
5173
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
5174
+ var componentNormalizer = __webpack_require__(3);
5175
+
5176
+ // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
5177
+
5178
+
5179
+
5180
+
5181
+
5182
+ /* normalize component */
5183
+
5184
+ var component = Object(componentNormalizer["a" /* default */])(
5185
+ src_dropdownvue_type_script_lang_js_,
5186
+ render,
5187
+ staticRenderFns,
5188
+ false,
5189
+ null,
5190
+ null,
5191
+ null
5192
+
5193
+ )
5194
+
5195
+ /* harmony default export */ var dropdown = (component.exports);
5196
+ // CONCATENATED MODULE: ./packages/dropdown/index.js
5197
+
5198
+
5199
+ /* istanbul ignore next */
5200
+ dropdown.install = function (Vue) {
5201
+ Vue.component(dropdown.name, dropdown);
5202
+ };
5203
+
5204
+ /* harmony default export */ var packages_dropdown = __webpack_exports__["default"] = (dropdown);
5205
+
5206
+ /***/ }),
5207
+
5208
+ /***/ 2:
5209
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5210
+
5211
+ "use strict";
5212
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
5213
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
5214
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
5215
+ /* unused harmony export setCookie */
5216
+ /* unused harmony export getCookie */
5217
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
5218
+
5219
+ /**
5220
+ * setStorage
5221
+ * @desc:设置本地储存数据
5222
+ * @author huangbo
5223
+ * @date 2022年5月7日
5224
+ * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
5225
+ * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
5226
+ **/
5227
+ var setStorage = function setStorage(key, value) {
5228
+ // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
5229
+ var type = void 0,
5230
+ finalKey = void 0,
5231
+ finalValue = void 0;
5232
+
5233
+ if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
5234
+ // 对象调用方式:setStorage({type, key, value})
5235
+ type = key.type;
5236
+ finalKey = key.key;
5237
+ finalValue = key.value;
5238
+ } else {
5239
+ // 字符串调用方式:setStorage(key, value)
5240
+ type = getStorage('storageType');
5241
+ finalKey = key;
5242
+ finalValue = value;
5243
+ }
5244
+
5245
+ // 使用默认存储类型如果未指定
5246
+ type = type || getStorage('storageType');
5247
+
5248
+ // 获取存储对象
5249
+ var storage = type === 'localStorage' ? localStorage : sessionStorage;
5250
+
5251
+ // 处理不同类型的key
5252
+ if (typeof finalKey === 'string') {
5253
+ // 单个字符串key
5254
+ var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
5255
+ storage.setItem(finalKey, storedValue);
5256
+ if (finalKey === 'token') {
5257
+ setCookie('token', storedValue);
5258
+ }
5259
+ } else if (Array.isArray(finalKey)) {
5260
+ // 数组key,为多个key设置同一个value
5261
+ var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
5262
+ for (var i = 0; i < finalKey.length; i++) {
5263
+ storage.setItem(finalKey[i], _storedValue);
5264
+ if (finalKey[i] === 'token') {
5265
+ setCookie('token', _storedValue);
5266
+ }
5267
+ }
5268
+ } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
5269
+ // 对象key,对象的属性名称作为key,属性值作为value
5270
+ for (var k in finalKey) {
5271
+ if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
5272
+ var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
5273
+ storage.setItem(k, _storedValue2);
5274
+ if (k === 'token') {
5275
+ setCookie('token', _storedValue2);
5276
+ }
5277
+ }
5278
+ }
5279
+ }
5280
+ };
5281
+
5282
+ /**
5283
+ * getStorage
5284
+ * @desc:获取本地储存数据
5285
+ * @author huangbo
5286
+ * @date 2022年5月7日
5287
+ * @param {String} [key] - 获取的名称
5288
+ **/
5289
+ var getStorage = function getStorage(key) {
5290
+ if (key) {
5291
+ var res = sessionStorage.getItem(key) || localStorage.getItem(key);
5292
+ if (!res && key === 'token') {
5293
+ res = getCookie('token');
5294
+ }
5295
+ if (key === 'host' && !res) {
5296
+ res = '';
5297
+ }
5298
+ return res;
5299
+ }
5300
+ var defaults = {};
5301
+ var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
5302
+ var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
5303
+
5304
+ var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
5305
+ if (token) {
5306
+ defaults.Authorization = token;
5307
+ }
5308
+ if (ssId) {
5309
+ defaults.ssId = ssId;
5310
+ }
5311
+ if (deviceUnique) {
5312
+ defaults.deviceUnique = deviceUnique;
5313
+ }
5314
+ return defaults;
5315
+ };
5316
+
5317
+ /**
5318
+ * removeStorage
5319
+ * @desc:删除本地储存数据
5320
+ * @author huangbo
5321
+ * @date 2022年5月7日
5322
+ * @param {String, Array} [key] - 获取的名称
5323
+ **/
5324
+ var removeStorage = function removeStorage(key) {
5325
+ if (Array.isArray(key)) {
5326
+ for (var i = 0; i < key.length; i++) {
5327
+ sessionStorage.removeItem(key[i]);
5328
+ localStorage.removeItem(key[i]);
5329
+ if (key[i] === 'token') {
5330
+ removeCookie('token');
5331
+ }
5332
+ }
5333
+ } else if (key) {
5334
+ sessionStorage.removeItem(key);
5335
+ localStorage.removeItem(key);
5336
+ if (key === 'token') {
5337
+ removeCookie('token');
5338
+ }
5339
+ } else {
5340
+ sessionStorage.clear();
5341
+ localStorage.clear();
5342
+ removeCookie('token');
5343
+ }
5344
+ };
5345
+
5346
+ /**
5347
+ * setCookie
5348
+ * @desc 设置cookie
5349
+ * @author huangbo
5350
+ * @param {string} [name] cookie名称
5351
+ * @param {string} [value] cookie值
5352
+ * @param {boolean} [isSession] 是否是会话cookie
5353
+ **/
5354
+ var setCookie = function setCookie(name, value) {
5355
+ var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
5356
+ var time = arguments[3];
5357
+
5358
+ try {
5359
+ var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
5360
+ ];
5361
+ // 会话/持久Cookie设置
5362
+ if (!isSession) {
5363
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
5364
+ // IE使用expires
5365
+ var date = new Date();
5366
+ date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
5367
+ cookieParts.push('expires=' + date.toUTCString());
5368
+ } else {
5369
+ // 其他浏览器使用max-age
5370
+ cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
5371
+ }
5372
+ }
5373
+ // 内核兼容处理
5374
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
5375
+ // IE特殊处理:添加P3P协议头
5376
+ cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
5377
+ } else {
5378
+ // 现代浏览器设置
5379
+ cookieParts.push('samesite=lax');
5380
+ if (window.location.protocol === 'https:') {
5381
+ cookieParts.push('secure');
5382
+ }
5383
+ }
5384
+
5385
+ // 设置Cookie
5386
+ document.cookie = cookieParts.join('; ');
5387
+ return true;
5388
+ } catch (e) {
5389
+ console.error('Cookie设置失败:', e);
5390
+ return false;
5391
+ }
5392
+ };
5393
+
5394
+ /**
5395
+ * getCookie
5396
+ * @desc 获取cookie中指定名称的值
5397
+ * @author huangbo
5398
+ * @param {string} [name] cookie名称
5399
+ **/
5400
+ var getCookie = function getCookie(name) {
5401
+ var cookies = document.cookie.split(';');
5402
+ for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
5403
+ var _ref;
5404
+
5405
+ if (_isArray) {
5406
+ if (_i >= _iterator.length) break;
5407
+ _ref = _iterator[_i++];
5408
+ } else {
5409
+ _i = _iterator.next();
5410
+ if (_i.done) break;
5411
+ _ref = _i.value;
5412
+ }
5413
+
5414
+ var cookie = _ref;
5415
+
5416
+ var _cookie$trim$split = cookie.trim().split('='),
5417
+ cookieName = _cookie$trim$split[0],
5418
+ cookieValue = _cookie$trim$split[1];
5419
+
5420
+ if (decodeURIComponent(cookieName) === name) {
5421
+ return decodeURIComponent(cookieValue);
5422
+ }
5423
+ }
5424
+ return null;
5425
+ };
5426
+
5427
+ /**
5428
+ * removeCookie
5429
+ * @desc:删除cookie
5430
+ * @author huangbo
5431
+ * @date 2022年5月7日
5432
+ * @param {String, Array} [key] - 获取的名称
5433
+ **/
5434
+ var removeCookie = function removeCookie(key) {
5435
+ if (Array.isArray(key)) {
5436
+ for (var i = 0; i < key.length; i++) {
5437
+ document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5438
+ }
5439
+ } else {
5440
+ document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5441
+ }
5442
+ };
5443
+
5444
+ /***/ }),
5445
+
5446
+ /***/ 20:
5447
+ /***/ (function(module, exports) {
5448
+
5449
+ module.exports = require("lodash/get");
5450
+
5451
+ /***/ }),
5452
+
5453
+ /***/ 21:
5454
+ /***/ (function(module, exports) {
5455
+
5456
+ module.exports = require("lodash/set");
5457
+
5458
+ /***/ }),
5459
+
5460
+ /***/ 22:
5461
+ /***/ (function(module, exports) {
5462
+
5463
+ module.exports = require("lodash/cloneDeep");
5464
+
5465
+ /***/ }),
5466
+
5467
+ /***/ 27:
5468
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5469
+
5470
+ "use strict";
5471
+ /* harmony import */ var eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
5472
+
5761
5473
  /**
5762
- * 获取当前日期
5763
- * @date 2022年5月7日
5764
- * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
5765
- * @returns {string} 当前日期的格式化字符串
5766
- */
5767
- const getCurrentDate = function (format = 'YYYY-MM-DD') {
5768
- return formatDate(new Date(), format);
5769
- };
5770
-
5474
+ * Show migrating guide in browser console.
5475
+ *
5476
+ * Usage:
5477
+ * import Migrating from 'eoss/src/mixins/migrating';
5478
+ *
5479
+ * mixins: [Migrating]
5480
+ *
5481
+ * add getMigratingConfig method for your component.
5482
+ * getMigratingConfig() {
5483
+ * return {
5484
+ * props: {
5485
+ * 'allow-no-selection': 'allow-no-selection is removed.',
5486
+ * 'selection-mode': 'selection-mode is removed.'
5487
+ * },
5488
+ * events: {
5489
+ * selectionchange: 'selectionchange is renamed to selection-change.'
5490
+ * }
5491
+ * };
5492
+ * },
5493
+ */
5494
+ /* harmony default export */ __webpack_exports__["a"] = ({
5495
+ mounted: function mounted() {
5496
+ if (true) return;
5497
+ if (!this.$vnode) return;
5498
+
5499
+ var _getMigratingConfig = this.getMigratingConfig(),
5500
+ _getMigratingConfig$p = _getMigratingConfig.props,
5501
+ props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
5502
+ _getMigratingConfig$e = _getMigratingConfig.events,
5503
+ events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
5504
+
5505
+ var _$vnode = this.$vnode,
5506
+ data = _$vnode.data,
5507
+ componentOptions = _$vnode.componentOptions;
5508
+
5509
+ var definedProps = data.attrs || {};
5510
+ var definedEvents = componentOptions.listeners || {};
5511
+
5512
+ for (var propName in definedProps) {
5513
+ propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(propName); // compatible with camel case
5514
+ if (props[propName]) {
5515
+ console.warn('[Eoss Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
5516
+ }
5517
+ }
5518
+
5519
+ for (var eventName in definedEvents) {
5520
+ eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(eventName); // compatible with camel case
5521
+ if (events[eventName]) {
5522
+ console.warn('[Eoss Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
5523
+ }
5524
+ }
5525
+ },
5526
+
5527
+ methods: {
5528
+ getMigratingConfig: function getMigratingConfig() {
5529
+ return {
5530
+ props: {},
5531
+ events: {}
5532
+ };
5533
+ }
5534
+ }
5535
+ });
5536
+
5537
+ /***/ }),
5538
+
5539
+ /***/ 28:
5540
+ /***/ (function(module, exports) {
5541
+
5542
+ module.exports = require("eoss/lib/button");
5543
+
5544
+ /***/ }),
5545
+
5546
+ /***/ 3:
5547
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5548
+
5549
+ "use strict";
5550
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
5551
+ /* globals __VUE_SSR_CONTEXT__ */
5552
+
5553
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
5554
+ // This module is a runtime utility for cleaner component module output and will
5555
+ // be included in the final webpack user bundle.
5556
+
5557
+ function normalizeComponent(
5558
+ scriptExports,
5559
+ render,
5560
+ staticRenderFns,
5561
+ functionalTemplate,
5562
+ injectStyles,
5563
+ scopeId,
5564
+ moduleIdentifier /* server only */,
5565
+ shadowMode /* vue-cli only */
5566
+ ) {
5567
+ // Vue.extend constructor export interop
5568
+ var options =
5569
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
5570
+
5571
+ // render functions
5572
+ if (render) {
5573
+ options.render = render
5574
+ options.staticRenderFns = staticRenderFns
5575
+ options._compiled = true
5576
+ }
5577
+
5578
+ // functional template
5579
+ if (functionalTemplate) {
5580
+ options.functional = true
5581
+ }
5582
+
5583
+ // scopedId
5584
+ if (scopeId) {
5585
+ options._scopeId = 'data-v-' + scopeId
5586
+ }
5587
+
5588
+ var hook
5589
+ if (moduleIdentifier) {
5590
+ // server build
5591
+ hook = function (context) {
5592
+ // 2.3 injection
5593
+ context =
5594
+ context || // cached call
5595
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
5596
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
5597
+ // 2.2 with runInNewContext: true
5598
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
5599
+ context = __VUE_SSR_CONTEXT__
5600
+ }
5601
+ // inject component styles
5602
+ if (injectStyles) {
5603
+ injectStyles.call(this, context)
5604
+ }
5605
+ // register component module identifier for async chunk inferrence
5606
+ if (context && context._registeredComponents) {
5607
+ context._registeredComponents.add(moduleIdentifier)
5608
+ }
5609
+ }
5610
+ // used by ssr in case component is cached and beforeCreate
5611
+ // never gets called
5612
+ options._ssrRegister = hook
5613
+ } else if (injectStyles) {
5614
+ hook = shadowMode
5615
+ ? function () {
5616
+ injectStyles.call(
5617
+ this,
5618
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
5619
+ )
5620
+ }
5621
+ : injectStyles
5622
+ }
5623
+
5624
+ if (hook) {
5625
+ if (options.functional) {
5626
+ // for template-only hot-reload because in that case the render fn doesn't
5627
+ // go through the normalizer
5628
+ options._injectStyles = hook
5629
+ // register for functional component in vue file
5630
+ var originalRender = options.render
5631
+ options.render = function renderWithStyleInjection(h, context) {
5632
+ hook.call(context)
5633
+ return originalRender(h, context)
5634
+ }
5635
+ } else {
5636
+ // inject component registration as beforeCreate hook
5637
+ var existing = options.beforeCreate
5638
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
5639
+ }
5640
+ }
5641
+
5642
+ return {
5643
+ exports: scriptExports,
5644
+ options: options
5645
+ }
5646
+ }
5647
+
5648
+
5649
+ /***/ }),
5650
+
5651
+ /***/ 4:
5652
+ /***/ (function(module, exports) {
5653
+
5654
+ module.exports = require("vue");
5655
+
5656
+ /***/ }),
5657
+
5658
+ /***/ 5:
5659
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5660
+
5661
+ "use strict";
5662
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
5663
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
5664
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
5665
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
5666
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
5667
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
5668
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
5669
+ /* unused harmony export setStyle */
5670
+ /* unused harmony export isScroll */
5671
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
5672
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
5673
+ /* unused harmony export insertAfter */
5674
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
5675
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
5676
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
5677
+
5678
+ /* istanbul ignore next */
5679
+
5680
+
5681
+
5682
+ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
5683
+ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
5684
+ var MOZ_HACK_REGEXP = /^moz([A-Z])/;
5685
+ var ieVersion = isServer ? 0 : Number(document.documentMode);
5686
+
5687
+ /* istanbul ignore next */
5688
+ var trim = function trim(string) {
5689
+ return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
5690
+ };
5691
+ /* istanbul ignore next */
5692
+ var camelCase = function camelCase(name) {
5693
+ return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
5694
+ return offset ? letter.toUpperCase() : letter;
5695
+ }).replace(MOZ_HACK_REGEXP, 'Moz$1');
5696
+ };
5697
+
5698
+ /* istanbul ignore next */
5699
+ var on = function () {
5700
+ if (!isServer && document.addEventListener) {
5701
+ return function (element, event, handler) {
5702
+ if (element && event && handler) {
5703
+ element.addEventListener(event, handler, false);
5704
+ }
5705
+ };
5706
+ } else {
5707
+ return function (element, event, handler) {
5708
+ if (element && event && handler) {
5709
+ element.attachEvent('on' + event, handler);
5710
+ }
5711
+ };
5712
+ }
5713
+ }();
5714
+
5715
+ /* istanbul ignore next */
5716
+ var off = function () {
5717
+ if (!isServer && document.removeEventListener) {
5718
+ return function (element, event, handler) {
5719
+ if (element && event) {
5720
+ element.removeEventListener(event, handler, false);
5721
+ }
5722
+ };
5723
+ } else {
5724
+ return function (element, event, handler) {
5725
+ if (element && event) {
5726
+ element.detachEvent('on' + event, handler);
5727
+ }
5728
+ };
5729
+ }
5730
+ }();
5731
+
5732
+ /* istanbul ignore next */
5733
+ var once = function once(el, event, fn) {
5734
+ var listener = function listener() {
5735
+ if (fn) {
5736
+ fn.apply(this, arguments);
5737
+ }
5738
+ off(el, event, listener);
5739
+ };
5740
+ on(el, event, listener);
5741
+ };
5742
+
5743
+ /* istanbul ignore next */
5744
+ function hasClass(el, cls) {
5745
+ if (!el || !cls) return false;
5746
+ if (cls.indexOf(' ') !== -1) {
5747
+ throw new Error('className should not contain space.');
5748
+ }
5749
+ if (el.classList) {
5750
+ return el.classList.contains(cls);
5751
+ } else {
5752
+ return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
5753
+ }
5754
+ }
5755
+
5756
+ /* istanbul ignore next */
5757
+ function addClass(el, cls) {
5758
+ if (!el) return;
5759
+ var curClass = el.className;
5760
+ var classes = (cls || '').split(' ');
5761
+
5762
+ for (var i = 0, j = classes.length; i < j; i++) {
5763
+ var clsName = classes[i];
5764
+ if (!clsName) continue;
5765
+
5766
+ if (el.classList) {
5767
+ el.classList.add(clsName);
5768
+ } else if (!hasClass(el, clsName)) {
5769
+ curClass += ' ' + clsName;
5770
+ }
5771
+ }
5772
+ if (!el.classList) {
5773
+ el.className = curClass;
5774
+ }
5775
+ }
5776
+
5777
+ /* istanbul ignore next */
5778
+ function removeClass(el, cls) {
5779
+ if (!el || !cls) return;
5780
+ var classes = cls.split(' ');
5781
+ var curClass = ' ' + el.className + ' ';
5782
+
5783
+ for (var i = 0, j = classes.length; i < j; i++) {
5784
+ var clsName = classes[i];
5785
+ if (!clsName) continue;
5786
+
5787
+ if (el.classList) {
5788
+ el.classList.remove(clsName);
5789
+ } else if (hasClass(el, clsName)) {
5790
+ curClass = curClass.replace(' ' + clsName + ' ', ' ');
5791
+ }
5792
+ }
5793
+ if (!el.classList) {
5794
+ el.className = trim(curClass);
5795
+ }
5796
+ }
5797
+
5798
+ /* istanbul ignore next */
5799
+ var getStyle = ieVersion < 9 ? function (element, styleName) {
5800
+ if (isServer) return;
5801
+ if (!element || !styleName) return null;
5802
+ styleName = camelCase(styleName);
5803
+ if (styleName === 'float') {
5804
+ styleName = 'styleFloat';
5805
+ }
5806
+ try {
5807
+ switch (styleName) {
5808
+ case 'opacity':
5809
+ try {
5810
+ return element.filters.item('alpha').opacity / 100;
5811
+ } catch (e) {
5812
+ return 1.0;
5813
+ }
5814
+ default:
5815
+ return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
5816
+ }
5817
+ } catch (e) {
5818
+ return element.style[styleName];
5819
+ }
5820
+ } : function (element, styleName) {
5821
+ if (isServer) return;
5822
+ if (!element || !styleName) return null;
5823
+ styleName = camelCase(styleName);
5824
+ if (styleName === 'float') {
5825
+ styleName = 'cssFloat';
5826
+ }
5827
+ try {
5828
+ var computed = document.defaultView.getComputedStyle(element, '');
5829
+ return element.style[styleName] || computed ? computed[styleName] : null;
5830
+ } catch (e) {
5831
+ return element.style[styleName];
5832
+ }
5833
+ };
5834
+
5835
+ /* istanbul ignore next */
5836
+ function setStyle(element, styleName, value) {
5837
+ if (!element || !styleName) return;
5838
+
5839
+ if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
5840
+ for (var prop in styleName) {
5841
+ if (styleName.hasOwnProperty(prop)) {
5842
+ setStyle(element, prop, styleName[prop]);
5843
+ }
5844
+ }
5845
+ } else {
5846
+ styleName = camelCase(styleName);
5847
+ if (styleName === 'opacity' && ieVersion < 9) {
5848
+ element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
5849
+ } else {
5850
+ element.style[styleName] = value;
5851
+ }
5852
+ }
5853
+ }
5854
+
5855
+ var isScroll = function isScroll(el, vertical) {
5856
+ if (isServer) return;
5857
+
5858
+ var determinedDirection = vertical !== null || vertical !== undefined;
5859
+ var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
5860
+
5861
+ return overflow.match(/(scroll|auto)/);
5862
+ };
5863
+
5864
+ var getScrollContainer = function getScrollContainer(el, vertical) {
5865
+ if (isServer) return;
5866
+
5867
+ var parent = el;
5868
+ while (parent) {
5869
+ if ([window, document, document.documentElement].includes(parent)) {
5870
+ return window;
5871
+ }
5872
+ if (isScroll(parent, vertical)) {
5873
+ return parent;
5874
+ }
5875
+ parent = parent.parentNode;
5876
+ }
5877
+
5878
+ return parent;
5879
+ };
5880
+
5881
+ var isInContainer = function isInContainer(el, container) {
5882
+ if (isServer || !el || !container) return false;
5883
+
5884
+ var elRect = el.getBoundingClientRect();
5885
+ var containerRect = void 0;
5886
+
5887
+ if ([window, document, document.documentElement, null, undefined].includes(container)) {
5888
+ containerRect = {
5889
+ top: 0,
5890
+ right: window.innerWidth,
5891
+ bottom: window.innerHeight,
5892
+ left: 0
5893
+ };
5894
+ } else {
5895
+ containerRect = container.getBoundingClientRect();
5896
+ }
5897
+
5898
+ return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
5899
+ };
5900
+
5771
5901
  /**
5772
- * 获取当前日期时间
5773
- * @date 2022年5月7日
5774
- * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
5775
- * @returns {string} 当前日期时间的格式化字符串
5776
- */
5777
- const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
5778
- return formatDate(new Date(), format);
5779
- };
5780
-
5902
+ * 在元素前插入元素
5903
+ * @param {HTMLElement} newEl 新DOM元素
5904
+ * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
5905
+ */
5906
+ function insertAfter(newEl, targetEl) {
5907
+ var parentEl = targetEl.parentNode;
5908
+ if (parentEl.lastChild === targetEl) {
5909
+ parentEl.appendChild(newEl);
5910
+ } else {
5911
+ parentEl.insertBefore(newEl, targetEl.nextSibling);
5912
+ }
5913
+ }
5914
+
5915
+ /***/ }),
5916
+
5917
+ /***/ 6:
5918
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5919
+
5920
+ "use strict";
5921
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
5922
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
5923
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
5924
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
5925
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
5926
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
5781
5927
  /**
5782
- * 获取小时
5783
- * @date 2022年5月7日
5784
- * @param {Date|string} [date] - 日期对象或日期字符串
5785
- * @returns {number} 小时数(0-23)
5786
- */
5787
- const getHour = function (date) {
5788
- if (!date) {
5789
- return new Date().getHours();
5790
- }
5791
- if (typeof date === 'string') {
5792
- date = new Date(date);
5793
- }
5794
- return date.getHours();
5795
- };
5796
-
5928
+ * 检查一个值是否为字符串类型
5929
+ * @param {*} obj 要检查的值
5930
+ * @returns {boolean} 如果值为字符串则返回true,否则返回false
5931
+ */
5932
+ function isString(obj) {
5933
+ return Object.prototype.toString.call(obj) === '[object String]';
5934
+ }
5935
+
5797
5936
  /**
5798
- * 获取分钟
5799
- * @date 2022年5月7日
5800
- * @param {Date|string} [date] - 日期对象或日期字符串
5801
- * @returns {number} 分钟数(0-59)
5802
- */
5803
- const getMinute = function (date) {
5804
- if (!date) {
5805
- return new Date().getMinutes();
5806
- }
5807
- if (typeof date === 'string') {
5808
- date = new Date(date);
5809
- }
5810
- return date.getMinutes();
5811
- };
5812
-
5937
+ * 检查一个值是否为对象类型
5938
+ * @param {*} obj 要检查的值
5939
+ * @returns {boolean} 如果值为对象则返回true,否则返回false
5940
+ */
5941
+ function isObject(obj) {
5942
+ return Object.prototype.toString.call(obj) === '[object Object]';
5943
+ }
5944
+
5813
5945
  /**
5814
- * 获取月份
5815
- * @date 2022年5月7日
5816
- * @param {Date|string} [date] - 日期对象或日期字符串
5817
- * @returns {number} 月份数(1-12)
5818
- */
5819
- const getMonth = function (date) {
5820
- if (!date) {
5821
- return new Date().getMonth() + 1;
5822
- }
5823
- if (typeof date === 'string') {
5824
- date = new Date(date);
5825
- }
5826
- return date.getMonth() + 1;
5827
- };
5828
-
5946
+ * 检查一个节点是否为HTML元素
5947
+ * @param {Node} node 要检查的节点
5948
+ * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
5949
+ */
5950
+ function isHtmlElement(node) {
5951
+ return node && node.nodeType === Node.ELEMENT_NODE;
5952
+ }
5953
+
5829
5954
  /**
5830
- * 获取秒
5831
- * @date 2022年5月7日
5832
- * @param {Date|string} [date] - 日期对象或日期字符串
5833
- * @returns {number} 秒数(0-59)
5834
- */
5835
- const getSecond = function (date) {
5836
- if (!date) {
5837
- return new Date().getSeconds();
5838
- }
5839
- if (typeof date === 'string') {
5840
- date = new Date(date);
5841
- }
5842
- return date.getSeconds();
5843
- };
5844
-
5955
+ * 检查一个值是否为函数类型
5956
+ * @param {*} functionToCheck 要检查的值
5957
+ * @returns {boolean} 如果值为函数则返回true,否则返回false
5958
+ */
5959
+ function isFunction(functionToCheck) {
5960
+ var getType = {};
5961
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
5962
+ }
5963
+
5845
5964
  /**
5846
- * 获取星期几
5847
- * @date 2022年5月7日
5848
- * @param {Date|string} [date] - 日期对象或日期字符串
5849
- * @returns {number} 星期几(0-6,0表示星期日)
5850
- */
5851
- const getWeekday = function (date) {
5852
- if (!date) {
5853
- return new Date().getDay();
5854
- }
5855
- if (typeof date === 'string') {
5856
- date = new Date(date);
5857
- }
5858
- return date.getDay();
5859
- };
5860
-
5861
-
5965
+ * 检查一个值是否为undefined
5966
+ * @param {*} val 要检查的值
5967
+ * @returns {boolean} 如果值为undefined则返回true,否则返回false
5968
+ */
5969
+ function isUndefined(val) {
5970
+ return val === void 0;
5971
+ }
5972
+
5862
5973
  /**
5863
- * @desc 获取上午/下午/晚上
5864
- * @author huangbo
5865
- * @date 2022年5月7日
5866
- * @param {String} [time] - 时间
5867
- **/
5868
- const timeCycle = function (time) {
5869
- let hour = 0;
5870
- if (!time) {
5871
- hour = new Date().getHours();
5872
- } else if (typeof time === 'string') {
5873
- // 从时间字符串中提取小时
5874
- const match = time.match(/^(\d{1,2})/);
5875
- if (match) {
5876
- hour = parseInt(match[1], 10);
5877
- }
5878
- } else if (typeof time === 'number') {
5879
- hour = time;
5880
- }
5881
- // 判断时间段
5882
- if (hour >= 5 && hour < 12) {
5883
- return '上午';
5884
- } else if (hour >= 12 && hour < 18) {
5885
- return '下午';
5886
- } else {
5887
- return '晚上';
5888
- }
5889
- };
5974
+ * 检查一个值是否已定义(不是undefined或null)
5975
+ * @param {*} val 要检查的值
5976
+ * @returns {boolean} 如果值已定义则返回true,否则返回false
5977
+ */
5978
+ function isDefined(val) {
5979
+ return val !== undefined && val !== null;
5980
+ }
5890
5981
 
5891
5982
  /***/ }),
5892
5983
 
@@ -5897,11 +5988,18 @@ module.exports = require("eoss/lib/message-box");
5897
5988
 
5898
5989
  /***/ }),
5899
5990
 
5900
- /***/ 89:
5991
+ /***/ 86:
5901
5992
  /***/ (function(module, exports) {
5902
5993
 
5903
5994
  module.exports = require("eoss/lib/button-group");
5904
5995
 
5996
+ /***/ }),
5997
+
5998
+ /***/ 93:
5999
+ /***/ (function(module, exports) {
6000
+
6001
+ module.exports = require("eoss/lib/dropdown-menu");
6002
+
5905
6003
  /***/ })
5906
6004
 
5907
6005
  /******/ });