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
@@ -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 = 172);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 176);
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,2030 +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
- /***/ 12:
3151
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3152
-
3153
- "use strict";
3154
- /* unused harmony export getHue */
3155
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
3156
- /* unused harmony export getLightness */
3157
- /* unused harmony export getSaturation */
3158
- /* unused harmony export rgbToHsv */
3159
- /* unused harmony export hsvTorgb */
3160
- /* unused harmony export mixColor */
3161
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
3162
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
3163
-
3164
- var $hueStep = 2;
3165
- var $saturationStep1 = 0.16;
3166
- var $saturationStep2 = 0.05;
3167
- var $brightnessStep1 = 0.05;
3168
- var $brightnessStep2 = 0.15;
3169
- var $lightColorCount = 5;
3170
- var $darkColorCount = 4;
3171
- /**
3172
- * getHue
3173
- * @desc:转换色相
3174
- * @author huangbo
3175
- * @date 2022年5月7日
3176
- **/
3177
- var getHue = function getHue($h, $i, $isLight) {
3178
- var $hue = void 0;
3179
- if ($h >= 60 && $h <= 240) {
3180
- $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
3181
- } else {
3182
- $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
3183
- }
3184
- $hue = ($hue + 360) % 360;
3185
- return Math.round($hue);
3186
- };
3187
-
3188
- /**
3189
- * getColor
3190
- * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
3191
- * @author huangbo
3192
- * @date 2022年5月7日
3193
- **/
3194
- var getColor = function getColor($color, $n) {
3195
- var $isLight = $n < 7;
3196
- var $hsv = rgbToHsv($color);
3197
- // 这里将i转换成以主色为中心,两侧的i值逐渐增大
3198
- var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
3199
- var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
3200
- return color;
3201
- };
3202
-
3203
- /**
3204
- * getLightness
3205
- * @desc:转换明度
3206
- * @author huangbo
3207
- * @date 2022年5月7日
3208
- * @return {string,array} 元素类名或者id
3209
- **/
3210
- var getLightness = function getLightness($v, $i, $isLight) {
3211
- var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3212
- $value = $value < 1 ? $value : 1;
3213
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
3214
- };
3215
-
3216
- /**
3217
- * getSaturation
3218
- * @desc:转换饱和度
3219
- * @author huangbo
3220
- * @date 2022年5月7日
3221
- **/
3222
- var getSaturation = function getSaturation($s, $i, $isLight) {
3223
- var $saturation = void 0;
3224
- if ($isLight) {
3225
- $saturation = $s - $saturationStep1 * $i;
3226
- } else if ($i === $darkColorCount) {
3227
- $saturation = $s + $saturationStep1;
3228
- } else {
3229
- $saturation = $s + $saturationStep2 * $i;
3230
- }
3231
- $saturation = $saturation < 1 ? $saturation : 1;
3232
-
3233
- if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
3234
- $saturation = 0.1;
3235
- }
3236
- $saturation = $saturation > 0.06 ? $saturation : 0.06;
3237
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
3238
- };
3239
-
3240
- /**
3241
- * rgbToHsv
3242
- * @desc:rgb转化成hsv
3243
- * @author huangbo
3244
- * @date 2022年5月7日
3245
- * @param {string} [$color] - 颜色值
3246
- **/
3247
- var rgbToHsv = function rgbToHsv($color) {
3248
- var rgb = getRgb($color);
3249
- var $red = rgb[0];
3250
- var $green = rgb[1];
3251
- var $blue = rgb[2];
3252
- var $max = Math.max($red, $green, $blue);
3253
- var $min = Math.min($red, $green, $blue);
3254
- var $diff = $max - $min;
3255
- var $h = 0;
3256
- if ($max === $min) {
3257
- $h = 0;
3258
- } else if ($max === $red) {
3259
- $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
3260
- } else if ($max === $green) {
3261
- $h = 60 * ($blue - $red) / $diff + 120;
3262
- } else if ($max === $blue) {
3263
- $h = 60 * ($red - $green) / $diff + 240;
3264
- }
3265
- var $s = $max === 0 ? 0 : $diff / $max;
3266
- var $v = $max / 255;
3267
- return [$h, $s, $v];
3268
- };
3269
-
3270
- /**
3271
- * hsvTorgb
3272
- * @desc:hsv转化成rgb
3273
- * @author huangbo
3274
- * @date 2022年5月7日
3275
- * @param {string} [$color] - 颜色值
3276
- **/
3277
- var hsvTorgb = function hsvTorgb($h, $s, $v) {
3278
- var $th = Math.floor($h / 60);
3279
- var $t1 = $h / 60 - $th;
3280
- var $t2 = $v * (1 - $s);
3281
- var $t3 = $v * (1 - $t1 * $s);
3282
- var $t4 = $v * (1 - (1 - $t1) * $s);
3283
- var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
3284
- var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
3285
- var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
3286
- // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
3287
- var red = Math.round($r * 255);
3288
- var green = Math.round($g * 255);
3289
- var blue = Math.round($b * 255);
3290
- red = red.toString(16);
3291
- green = green.toString(16);
3292
- blue = blue.toString(16);
3293
- red = red.length === 1 ? '0' + red : red;
3294
- green = green.length === 1 ? '0' + green : green;
3295
- blue = blue.length === 1 ? '0' + blue : blue;
3296
- return '#' + red + green + blue;
3297
- };
3298
-
3299
- /**
3300
- * mixColor
3301
- * @desc:生成混合色
3302
- * @author huangbo
3303
- * @date 2022年5月7日
3304
- * @param {string} [$color1] - 颜色值
3305
- * @param {string} [$color2] - 颜色值
3306
- * @param {string} [$n] - 百分比 0~1
3307
- **/
3308
- var mixColor = function mixColor($color1, $color2, $n) {
3309
- var rgb1 = getRgb($color1);
3310
- var rgb2 = getRgb($color2);
3311
- var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
3312
- var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
3313
- var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
3314
- return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3315
- };
3316
-
3317
- /**
3318
- * getRgb
3319
- * @desc:获取颜色值的rgb值
3320
- * @author huangbo
3321
- * @date 2022年5月7日
3322
- * @param {string} [$color] - 颜色值
3323
- **/
3324
- var getRgb = function getRgb($color) {
3325
- var rgb = [];
3326
- // 16进制颜色值的正则
3327
- var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
3328
- // 把颜色值变成小写
3329
- $color = $color.toLowerCase();
3330
- if (reg.test($color)) {
3331
- // 如果只有三位的值,需变成六位,如:#fff => #ffffff
3332
- if ($color.length === 4) {
3333
- var colorNew = '#';
3334
- for (var i = 1; i < 4; i++) {
3335
- colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
3336
- }
3337
- $color = colorNew;
3338
- }
3339
- // 处理六位的颜色值,转为RGB
3340
- for (var _i = 1; _i < 7; _i += 2) {
3341
- rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
3342
- }
3343
- } else {
3344
- rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
3345
- }
3346
- return rgb;
3347
- };
3348
-
3349
- /***/ }),
3350
-
3351
- /***/ 13:
3352
- /***/ (function(module, exports) {
3353
-
3354
- module.exports = require("eoss/lib/loading");
3355
-
3356
- /***/ }),
3357
-
3358
- /***/ 15:
3359
- /***/ (function(module, exports) {
3360
-
3361
- module.exports = require("lodash/get");
3362
-
3363
- /***/ }),
3364
-
3365
- /***/ 16:
3366
- /***/ (function(module, exports) {
3367
-
3368
- module.exports = require("lodash/set");
3369
-
3370
- /***/ }),
3371
-
3372
- /***/ 17:
3373
- /***/ (function(module, exports) {
3374
-
3375
- module.exports = require("lodash/cloneDeep");
3376
-
3377
- /***/ }),
3378
-
3379
- /***/ 172:
3380
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3381
-
3382
- "use strict";
3383
- // ESM COMPAT FLAG
3384
- __webpack_require__.r(__webpack_exports__);
3385
-
3386
- // EXTERNAL MODULE: external "vue"
3387
- var external_vue_ = __webpack_require__(2);
3388
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
3389
-
3390
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=template&id=6638efd1&
3391
- var render = function () {
3392
- var _vm = this
3393
- var _h = _vm.$createElement
3394
- var _c = _vm._self._c || _h
3395
- return _c("transition", { attrs: { name: "es-notification-fade" } }, [
3396
- _c(
3397
- "div",
3398
- {
3399
- directives: [
3400
- {
3401
- name: "show",
3402
- rawName: "v-show",
3403
- value: _vm.visible,
3404
- expression: "visible",
3405
- },
3406
- ],
3407
- class: ["es-notification", _vm.customClass, _vm.horizontalClass],
3408
- style: _vm.positionStyle,
3409
- attrs: { role: "alert" },
3410
- on: {
3411
- mouseenter: function ($event) {
3412
- return _vm.clearTimer()
3413
- },
3414
- mouseleave: function ($event) {
3415
- return _vm.startTimer()
3416
- },
3417
- click: _vm.click,
3418
- },
3419
- },
3420
- [
3421
- _vm.type || _vm.iconClass
3422
- ? _c("i", {
3423
- staticClass: "es-notification__icon",
3424
- class: [_vm.typeClass, _vm.iconClass],
3425
- })
3426
- : _vm._e(),
3427
- _c(
3428
- "div",
3429
- {
3430
- staticClass: "es-notification__group",
3431
- class: { "is-with-icon": _vm.typeClass || _vm.iconClass },
3432
- },
3433
- [
3434
- _c("h2", {
3435
- staticClass: "es-notification__title",
3436
- domProps: { textContent: _vm._s(_vm.title) },
3437
- }),
3438
- _c(
3439
- "div",
3440
- {
3441
- directives: [
3442
- {
3443
- name: "show",
3444
- rawName: "v-show",
3445
- value: _vm.message,
3446
- expression: "message",
3447
- },
3448
- ],
3449
- staticClass: "es-notification__content",
3450
- },
3451
- [
3452
- _vm._t("default", function () {
3453
- return [
3454
- !_vm.dangerouslyUseHTMLString
3455
- ? _c("p", [_vm._v(_vm._s(_vm.message))])
3456
- : _c("p", {
3457
- domProps: { innerHTML: _vm._s(_vm.message) },
3458
- }),
3459
- ]
3460
- }),
3461
- ],
3462
- 2
3463
- ),
3464
- _vm.showClose
3465
- ? _c("div", {
3466
- staticClass: "es-notification__closeBtn es-icon-guanbi",
3467
- on: {
3468
- click: function ($event) {
3469
- $event.stopPropagation()
3470
- return _vm.close.apply(null, arguments)
3471
- },
3472
- },
3473
- })
3474
- : _vm._e(),
3475
- ]
3476
- ),
3477
- ]
3478
- ),
3479
- ])
3480
- }
3481
- var staticRenderFns = []
3482
- render._withStripped = true
3483
-
3484
-
3485
- // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=6638efd1&
3486
-
3487
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=script&lang=js&
3488
- //
3489
- //
3490
- //
3491
- //
3492
- //
3493
- //
3494
- //
3495
- //
3496
- //
3497
- //
3498
- //
3499
- //
3500
- //
3501
- //
3502
- //
3503
- //
3504
- //
3505
- //
3506
- //
3507
- //
3508
- //
3509
- //
3510
- //
3511
- //
3512
- //
3513
- //
3514
- //
3515
- //
3516
- //
3517
- //
3518
- //
3519
- //
3520
- //
3521
- //
3522
- //
3523
- //
3524
- //
3525
- //
3526
-
3527
- /**
3528
- * 通知组件类型图标映射
3529
- */
3530
- var typeMap = {
3531
- success: 'success',
3532
- info: 'info',
3533
- warning: 'solid-zhuyi',
3534
- error: 'solid-guanbi'
3535
- };
3536
-
3537
- /**
3538
- * 通知组件
3539
- * @description 悬浮出现在页面角落,显示全局的通知提醒消息
3540
- * @props {Boolean} visible - 是否可见
3541
- * @props {String} title - 标题
3542
- * @props {String|Vue.VNode} message - 说明文字
3543
- * @props {Number} duration - 显示时间,毫秒,设为0则不会自动关闭
3544
- * @props {String} type - 主题样式,可选值:success/warning/info/error
3545
- * @props {Boolean} showClose - 是否显示关闭按钮
3546
- * @props {String} customClass - 自定义类名
3547
- * @props {String} iconClass - 自定义图标的类名
3548
- * @props {Function} onClose - 关闭时的回调函数
3549
- * @props {Function} onClick - 点击Notification时的回调函数
3550
- * @props {Boolean} closed - 是否已关闭
3551
- * @props {Number} verticalOffset - 垂直偏移量
3552
- * @props {Number} timer - 定时器
3553
- * @props {Boolean} dangerouslyUseHTMLString - 是否将message作为HTML片段处理
3554
- * @props {String} position - 弹出位置,可选值:top-right/top-left/bottom-right/bottom-left
3555
- */
3556
- /* harmony default export */ var mainvue_type_script_lang_js_ = ({
3557
- data: function data() {
3558
- return {
3559
- visible: false,
3560
- title: '',
3561
- message: '',
3562
- duration: 4500,
3563
- type: '',
3564
- showClose: true,
3565
- customClass: '',
3566
- iconClass: '',
3567
- onClose: null,
3568
- onClick: null,
3569
- closed: false,
3570
- verticalOffset: 0,
3571
- timer: null,
3572
- dangerouslyUseHTMLString: false,
3573
- position: 'top-right'
3574
- };
3575
- },
3576
-
3577
-
3578
- computed: {
3579
- /**
3580
- * 类型图标类名
3581
- * @returns {String} 图标类名
3582
- */
3583
- typeClass: function typeClass() {
3584
- return this.type && typeMap[this.type] ? 'es-icon-' + typeMap[this.type] : '';
3585
- },
3586
-
3587
-
3588
- /**
3589
- * 水平位置类名
3590
- * @returns {String} 水平位置类名
3591
- */
3592
- horizontalClass: function horizontalClass() {
3593
- return this.position.indexOf('right') > -1 ? 'right' : 'left';
3594
- },
3595
-
3596
-
3597
- /**
3598
- * 垂直位置属性
3599
- * @returns {String} 垂直位置属性
3600
- */
3601
- verticalProperty: function verticalProperty() {
3602
- return (/^top-/.test(this.position) ? 'top' : 'bottom'
3603
- );
3604
- },
3605
-
3606
-
3607
- /**
3608
- * 位置样式
3609
- * @returns {Object} 位置样式对象
3610
- */
3611
- positionStyle: function positionStyle() {
3612
- var _ref;
3613
-
3614
- return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
3615
- }
3616
- },
3617
-
3618
- watch: {
3619
- closed: function closed(newVal) {
3620
- if (newVal) {
3621
- this.visible = false;
3622
- this.$el.addEventListener('transitionend', this.destroyElement);
3623
- }
3624
- }
3625
- },
3626
-
3627
- methods: {
3628
- /**
3629
- * 销毁元素
3630
- */
3631
- destroyElement: function destroyElement() {
3632
- this.$el.removeEventListener('transitionend', this.destroyElement);
3633
- this.$destroy(true);
3634
- this.$el.parentNode.removeChild(this.$el);
3635
- },
3636
-
3637
-
3638
- /**
3639
- * 点击事件处理
3640
- */
3641
- click: function click() {
3642
- if (typeof this.onClick === 'function') {
3643
- this.onClick();
3644
- }
3645
- },
3646
-
3647
-
3648
- /**
3649
- * 关闭通知
3650
- */
3651
- close: function close() {
3652
- this.closed = true;
3653
- if (typeof this.onClose === 'function') {
3654
- this.onClose();
3655
- }
3656
- },
3657
-
3658
-
3659
- /**
3660
- * 清除定时器
3661
- */
3662
- clearTimer: function clearTimer() {
3663
- clearTimeout(this.timer);
3664
- },
3665
-
3666
-
3667
- /**
3668
- * 开始定时器
3669
- */
3670
- startTimer: function startTimer() {
3671
- var _this = this;
3672
-
3673
- if (this.duration > 0) {
3674
- this.timer = setTimeout(function () {
3675
- if (!_this.closed) {
3676
- _this.close();
3677
- }
3678
- }, this.duration);
3679
- }
3680
- },
3681
-
3682
- /**
3683
- * 键盘事件处理
3684
- * @param {KeyboardEvent} e - 键盘事件对象
3685
- */
3686
- keydown: function keydown(e) {
3687
- if (e.keyCode === 46 || e.keyCode === 8) {
3688
- this.clearTimer(); // detele 取消倒计时
3689
- } else if (e.keyCode === 27) {
3690
- // esc关闭消息
3691
- if (!this.closed) {
3692
- this.close();
3693
- }
3694
- } else {
3695
- this.startTimer(); // 恢复倒计时
3696
- }
3697
- }
3698
- },
3699
- mounted: function mounted() {
3700
- var _this2 = this;
3701
-
3702
- if (this.duration > 0) {
3703
- this.timer = setTimeout(function () {
3704
- if (!_this2.closed) {
3705
- _this2.close();
3706
- }
3707
- }, this.duration);
3708
- }
3709
- document.addEventListener('keydown', this.keydown);
3710
- },
3711
- beforeDestroy: function beforeDestroy() {
3712
- document.removeEventListener('keydown', this.keydown);
3713
- }
3714
- });
3715
- // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
3716
- /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
3717
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3718
- var componentNormalizer = __webpack_require__(5);
3719
-
3720
- // CONCATENATED MODULE: ./packages/notification/src/main.vue
3721
-
3722
-
3723
-
3724
-
3725
-
3726
- /* normalize component */
3727
-
3728
- var component = Object(componentNormalizer["a" /* default */])(
3729
- src_mainvue_type_script_lang_js_,
3730
- render,
3731
- staticRenderFns,
3732
- false,
3733
- null,
3734
- null,
3735
- null
3736
-
3737
- )
3738
-
3739
- /* harmony default export */ var main = (component.exports);
3740
- // EXTERNAL MODULE: ./src/utils/merge.js
3741
- var merge = __webpack_require__(18);
3742
-
3743
- // EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
3744
- var popup = __webpack_require__(22);
3745
-
3746
- // EXTERNAL MODULE: ./src/utils/vdom.js
3747
- var vdom = __webpack_require__(64);
3748
-
3749
- // CONCATENATED MODULE: ./packages/notification/src/main.js
3750
- /**
3751
- * 通知组件
3752
- * @description 悬浮出现在页面角落,显示全局的通知提醒消息
3753
- */
3754
-
3755
-
3756
-
3757
-
3758
-
3759
- var NotificationConstructor = external_vue_default.a.extend(main);
3760
-
3761
- var instance = void 0;
3762
- var instances = [];
3763
- var seed = 1;
3764
-
3765
- /**
3766
- * 创建通知
3767
- * @param {Object} options - 通知配置项
3768
- * @param {String} options.title - 标题
3769
- * @param {String|Vue.VNode} options.message - 说明文字
3770
- * @param {Boolean} options.dangerouslyUseHTMLString - 是否将message作为HTML片段处理
3771
- * @param {String} options.type - 主题样式,可选值:success/warning/info/error
3772
- * @param {String} options.iconClass - 自定义图标的类名
3773
- * @param {String} options.customClass - 自定义类名
3774
- * @param {Number} options.duration - 显示时间,毫秒,设为0则不会自动关闭
3775
- * @param {String} options.position - 弹出位置,可选值:top-right/top-left/bottom-right/bottom-left
3776
- * @param {Boolean} options.showClose - 是否显示关闭按钮
3777
- * @param {Function} options.onClose - 关闭时的回调函数
3778
- * @param {Function} options.onClick - 点击Notification时的回调函数
3779
- * @param {Number} options.offset - 偏移的距离
3780
- * @returns {Object} 通知实例
3781
- */
3782
- var main_Notification = function Notification(options) {
3783
- if (external_vue_default.a.prototype.$isServer) return;
3784
- options = Object(merge["a" /* default */])({}, options);
3785
- var userOnClose = options.onClose;
3786
- var id = 'notification_' + seed++;
3787
- var position = options.position || 'top-right';
3788
-
3789
- options.onClose = function () {
3790
- Notification.close(id, userOnClose);
3791
- };
3792
-
3793
- instance = new NotificationConstructor({
3794
- data: options
3795
- });
3796
-
3797
- if (Object(vdom["a" /* isVNode */])(options.message)) {
3798
- instance.$slots.default = [options.message];
3799
- options.message = 'REPLACED_BY_VNODE';
3800
- }
3801
- instance.id = id;
3802
- instance.$mount();
3803
- document.body.appendChild(instance.$el);
3804
- instance.visible = true;
3805
- instance.dom = instance.$el;
3806
- instance.dom.style.zIndex = popup["a" /* PopupManager */].nextZIndex();
3807
-
3808
- var verticalOffset = options.offset || 0;
3809
- instances.filter(function (item) {
3810
- return item.position === position;
3811
- }).forEach(function (item) {
3812
- verticalOffset += item.$el.offsetHeight + 16;
3813
- });
3814
- verticalOffset += 16;
3815
- instance.verticalOffset = verticalOffset;
3816
- instances.push(instance);
3817
- return instance;
3818
- };
3819
-
3820
- ['success', 'warning', 'info', 'error'].forEach(function (type) {
3821
- main_Notification[type] = function (options) {
3822
- if (typeof options === 'string' || Object(vdom["a" /* isVNode */])(options)) {
3823
- options = {
3824
- message: options
3825
- };
3826
- }
3827
- options.type = type;
3828
- return main_Notification(options);
3829
- };
3830
- });
3831
-
3832
- /**
3833
- * 关闭指定通知
3834
- * @param {String} id - 通知ID
3835
- * @param {Function} userOnClose - 用户自定义关闭回调函数
3836
- */
3837
- main_Notification.close = function (id, userOnClose) {
3838
- var index = -1;
3839
- var len = instances.length;
3840
- var instance = instances.filter(function (instance, i) {
3841
- if (instance.id === id) {
3842
- index = i;
3843
- return true;
3844
- }
3845
- return false;
3846
- })[0];
3847
- if (!instance) return;
3848
-
3849
- if (typeof userOnClose === 'function') {
3850
- userOnClose(instance);
3851
- }
3852
- instances.splice(index, 1);
3853
-
3854
- if (len <= 1) return;
3855
- var position = instance.position;
3856
- var removedHeight = instance.dom.offsetHeight;
3857
- for (var i = index; i < len - 1; i++) {
3858
- if (instances[i].position === position) {
3859
- instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
3860
- }
3861
- }
3862
- };
3863
-
3864
- /**
3865
- * 关闭所有通知
3866
- */
3867
- main_Notification.closeAll = function () {
3868
- for (var i = instances.length - 1; i >= 0; i--) {
3869
- instances[i].close();
3870
- }
3871
- };
3872
-
3873
- /* harmony default export */ var src_main = (main_Notification);
3874
- // CONCATENATED MODULE: ./packages/notification/index.js
3875
-
3876
- /* harmony default export */ var notification = __webpack_exports__["default"] = (src_main);
3877
-
3878
- /***/ }),
3879
-
3880
- /***/ 18:
3881
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3882
-
3883
- "use strict";
3884
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
3885
- for (var i = 1, j = arguments.length; i < j; i++) {
3886
- var source = arguments[i] || {};
3887
- for (var prop in source) {
3888
- if (source.hasOwnProperty(prop)) {
3889
- var value = source[prop];
3890
- if (value !== undefined) {
3891
- target[prop] = value;
3892
- }
3893
- }
3894
- }
3895
- }
3896
-
3897
- return target;
3898
- });;
3899
-
3900
- /***/ }),
3901
-
3902
- /***/ 19:
3903
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3904
-
3905
- "use strict";
3906
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollbarWidth; });
3907
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return scrollIntoView; });
3908
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollSize; });
3909
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return scrollMove; });
3910
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
3911
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
3912
-
3913
-
3914
- /**
3915
- * 缓存变量,用于存储计算过的滚动条宽度
3916
- */
3917
- var scrollBarWidth = void 0;
3918
-
3919
- /**
3920
- * 计算并返回浏览器滚动条的宽度
3921
- * @returns {number} 滚动条宽度(像素)
3922
- */
3923
- var getScrollbarWidth = function getScrollbarWidth() {
3924
- // 服务器端渲染时返回0
3925
- if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
3926
- // 如果已经计算过,直接返回缓存值
3927
- if (scrollBarWidth !== undefined) return scrollBarWidth;
3928
-
3929
- // 创建测试元素
3930
- var outer = document.createElement('div');
3931
- outer.className = 'es-scrollbar__wrap';
3932
- outer.style.visibility = 'hidden';
3933
- outer.style.width = '100px';
3934
- outer.style.position = 'absolute';
3935
- outer.style.top = '-9999px';
3936
- document.body.appendChild(outer);
3937
-
3938
- // 计算无滚动条时的宽度
3939
- var widthNoScroll = outer.offsetWidth;
3940
- outer.style.overflow = 'scroll';
3941
-
3942
- // 创建内部元素并计算有滚动条时的宽度
3943
- var inner = document.createElement('div');
3944
- inner.style.width = '100%';
3945
- outer.appendChild(inner);
3946
-
3947
- var widthWithScroll = inner.offsetWidth;
3948
- // 清理DOM
3949
- outer.parentNode.removeChild(outer);
3950
- // 计算滚动条宽度
3951
- scrollBarWidth = widthNoScroll - widthWithScroll;
3952
-
3953
- return scrollBarWidth;
3954
- };
3955
-
3956
- /**
3957
- * 将指定元素滚动到容器视图中
3958
- * @param {HTMLElement} container - 容器元素
3959
- * @param {HTMLElement} selected - 要滚动到视图中的元素
3960
- * @example
3961
- * // 用法示例
3962
- * const container = document.querySelector('.container');
3963
- * const element = document.querySelector('.target-element');
3964
- * scrollIntoView(container, element);
3965
- */
3966
- function scrollIntoView(container, selected) {
3967
- // 服务器端渲染时不执行
3968
- if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
3969
-
3970
- // 如果没有指定元素,滚动到顶部
3971
- if (!selected) {
3972
- container.scrollTop = 0;
3973
- return;
3974
- }
3975
-
3976
- // 收集所有偏移父元素
3977
- var offsetParents = [];
3978
- var pointer = selected.offsetParent;
3979
- while (pointer && container !== pointer && container.contains(pointer)) {
3980
- offsetParents.push(pointer);
3981
- pointer = pointer.offsetParent;
3982
- }
3983
-
3984
- // 计算元素相对于容器的顶部偏移量
3985
- var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {
3986
- return prev + curr.offsetTop;
3987
- }, 0);
3988
- var bottom = top + selected.offsetHeight;
3989
- var viewRectTop = container.scrollTop;
3990
- var viewRectBottom = viewRectTop + container.clientHeight;
3991
-
3992
- // 调整滚动位置使元素可见
3993
- if (top < viewRectTop) {
3994
- container.scrollTop = top;
3995
- } else if (bottom > viewRectBottom) {
3996
- container.scrollTop = bottom - container.clientHeight;
3997
- }
3998
- }
3999
-
4000
- // 获取滚动条大小
4001
- function getScrollSize(wrap) {
4002
- if (!wrap) {
4003
- return { width: '', height: '' };
4004
- };
4005
- var heightPercentage = 0;
4006
- var widthPercentage = 0;
4007
-
4008
- // 修复滚动条尺寸计算逻辑
4009
- var scrollHeight = wrap.scrollHeight;
4010
- var scrollWidth = wrap.scrollWidth;
4011
- var clientHeight = wrap.clientHeight;
4012
- var clientWidth = wrap.clientWidth;
4013
- var sizes = {
4014
- width: '',
4015
- height: ''
4016
- };
4017
- // 只有当内容高度超过容器高度时才显示垂直滚动条
4018
- if (scrollHeight > clientHeight) {
4019
- heightPercentage = clientHeight * 100 / scrollHeight;
4020
- sizes.height = heightPercentage < 100 ? heightPercentage + '%' : '100%';
4021
- } else {
4022
- sizes.height = '';
4023
- }
4024
-
4025
- // 只有当内容宽度超过容器宽度时才显示水平滚动条
4026
- if (scrollWidth > clientWidth) {
4027
- widthPercentage = clientWidth * 100 / scrollWidth;
4028
- sizes.width = widthPercentage < 100 ? widthPercentage + '%' : '100%';
4029
- } else {
4030
- sizes.width = '';
4031
- }
4032
- return sizes;
4033
- }
4034
-
4035
- // 滚动条移动
4036
- function scrollMove(wrap) {
4037
- if (!wrap) return;
4038
-
4039
- // 立即更新滚动条位置,不使用阈值判断
4040
- var y = wrap.scrollTop * 100 / wrap.clientHeight;
4041
- var x = wrap.scrollLeft * 100 / wrap.clientWidth;
4042
- return { y: y, x: x };
4043
- }
4044
-
4045
- /***/ }),
4046
-
4047
- /***/ 2:
4048
- /***/ (function(module, exports) {
4049
-
4050
- module.exports = require("vue");
4051
-
4052
- /***/ }),
4053
-
4054
- /***/ 22:
4055
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4056
-
4057
- "use strict";
4058
-
4059
- // EXPORTS
4060
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
4061
-
4062
- // EXTERNAL MODULE: external "vue"
4063
- var external_vue_ = __webpack_require__(2);
4064
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
4065
-
4066
- // EXTERNAL MODULE: ./src/utils/merge.js
4067
- var merge = __webpack_require__(18);
4068
-
4069
- // EXTERNAL MODULE: ./src/utils/dom.js
4070
- var utils_dom = __webpack_require__(4);
4071
-
4072
- // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
4073
-
4074
-
4075
-
4076
- var hasModal = false;
4077
- var hasInitZIndex = false;
4078
- var popup_manager_zIndex = void 0;
4079
-
4080
- var popup_manager_getModal = function getModal() {
4081
- if (external_vue_default.a.prototype.$isServer) return;
4082
- var modalDom = PopupManager.modalDom;
4083
- if (modalDom) {
4084
- hasModal = true;
4085
- } else {
4086
- hasModal = false;
4087
- modalDom = document.createElement('div');
4088
- PopupManager.modalDom = modalDom;
4089
-
4090
- modalDom.addEventListener('touchmove', function (event) {
4091
- event.preventDefault();
4092
- event.stopPropagation();
4093
- });
4094
-
4095
- modalDom.addEventListener('click', function () {
4096
- PopupManager.doOnModalClick && PopupManager.doOnModalClick();
4097
- });
4098
- }
4099
-
4100
- return modalDom;
4101
- };
4102
-
4103
- var instances = {};
4104
-
4105
- var PopupManager = {
4106
- modalFade: true,
4107
-
4108
- getInstance: function getInstance(id) {
4109
- return instances[id];
4110
- },
4111
-
4112
- register: function register(id, instance) {
4113
- if (id && instance) {
4114
- instances[id] = instance;
4115
- }
4116
- },
4117
-
4118
- deregister: function deregister(id) {
4119
- if (id) {
4120
- instances[id] = null;
4121
- delete instances[id];
4122
- }
4123
- },
4124
-
4125
- nextZIndex: function nextZIndex() {
4126
- return PopupManager.zIndex++;
4127
- },
4128
-
4129
- modalStack: [],
4130
-
4131
- doOnModalClick: function doOnModalClick() {
4132
- var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
4133
- if (!topItem) return;
4134
-
4135
- var instance = PopupManager.getInstance(topItem.id);
4136
- if (instance && instance.closeOnClickModal) {
4137
- instance.close();
4138
- }
4139
- },
4140
-
4141
- openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
4142
- if (external_vue_default.a.prototype.$isServer) return;
4143
- if (!id || zIndex === undefined) return;
4144
- this.modalFade = modalFade;
4145
-
4146
- var modalStack = this.modalStack;
4147
-
4148
- for (var i = 0, j = modalStack.length; i < j; i++) {
4149
- var item = modalStack[i];
4150
- if (item.id === id) {
4151
- return;
4152
- }
4153
- }
4154
-
4155
- var modalDom = popup_manager_getModal();
4156
-
4157
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
4158
- if (this.modalFade && !hasModal) {
4159
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
4160
- }
4161
- if (modalClass) {
4162
- var classArr = modalClass.trim().split(/\s+/);
4163
- classArr.forEach(function (item) {
4164
- return Object(utils_dom["a" /* addClass */])(modalDom, item);
4165
- });
4166
- }
4167
- setTimeout(function () {
4168
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
4169
- }, 200);
4170
-
4171
- if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
4172
- dom.parentNode.appendChild(modalDom);
4173
- } else {
4174
- document.body.appendChild(modalDom);
4175
- }
4176
-
4177
- if (zIndex) {
4178
- modalDom.style.zIndex = zIndex;
4179
- }
4180
- modalDom.tabIndex = 0;
4181
- modalDom.style.display = '';
4182
-
4183
- this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
4184
- },
4185
-
4186
- closeModal: function closeModal(id) {
4187
- var modalStack = this.modalStack;
4188
- var modalDom = popup_manager_getModal();
4189
- var topItem = null;
4190
-
4191
- if (modalStack.length > 0) {
4192
- topItem = modalStack[modalStack.length - 1];
4193
- if (topItem.id === id) {
4194
- modalStack.pop();
4195
- if (modalStack.length > 0) {
4196
- modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
4197
- }
4198
- } else {
4199
- for (var i = modalStack.length - 1; i >= 0; i--) {
4200
- if (modalStack[i].id === id) {
4201
- modalStack.splice(i, 1);
4202
- break;
4203
- }
4204
- }
4205
- }
4206
- }
4207
-
4208
- if (modalStack.length === 0) {
4209
- if (this.modalFade) {
4210
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
4211
- }
4212
- setTimeout(function () {
4213
- if (modalStack.length === 0) {
4214
- if (topItem && topItem.modalClass) {
4215
- var classArr = topItem.modalClass.trim().split(/\s+/);
4216
- classArr.forEach(function (item) {
4217
- return Object(utils_dom["i" /* removeClass */])(modalDom, item);
4218
- });
4219
- }
4220
- if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
4221
- modalDom.style.display = 'none';
4222
- PopupManager.modalDom = undefined;
4223
- }
4224
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
4225
- }, 200);
4226
- } else {
4227
- if (topItem && topItem.modalClass) {
4228
- var classArr = topItem.modalClass.trim().split(/\s+/);
4229
- classArr.forEach(function (item) {
4230
- return Object(utils_dom["i" /* removeClass */])(modalDom, item);
4231
- });
4232
- }
4233
- }
4234
- }
4235
- };
4236
-
4237
- Object.defineProperty(PopupManager, 'zIndex', {
4238
- configurable: true,
4239
- get: function get() {
4240
- if (!hasInitZIndex) {
4241
- if (!popup_manager_zIndex) {
4242
- popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$EOSS || {}).zIndex || 2000;
4243
- }
4244
- hasInitZIndex = true;
4245
- }
4246
- return popup_manager_zIndex;
4247
- },
4248
- set: function set(value) {
4249
- popup_manager_zIndex = value;
4250
- }
4251
- });
4252
-
4253
- var popup_manager_getTopPopup = function getTopPopup() {
4254
- if (external_vue_default.a.prototype.$isServer) return;
4255
- if (PopupManager.modalStack.length > 0) {
4256
- var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
4257
- if (!topPopup) return;
4258
- var instance = PopupManager.getInstance(topPopup.id);
4259
-
4260
- return instance;
4261
- }
4262
- };
4263
-
4264
- if (!external_vue_default.a.prototype.$isServer) {
4265
- // handle `esc` key when the popup is shown
4266
- window.addEventListener('keydown', function (event) {
4267
- if (event.keyCode === 27) {
4268
- var topPopup = popup_manager_getTopPopup();
4269
-
4270
- if (topPopup && topPopup.closeOnPressEscape) {
4271
- topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
4272
- }
4273
- }
4274
- });
4275
- }
4276
-
4277
- /* harmony default export */ var popup_manager = (PopupManager);
4278
- // EXTERNAL MODULE: ./src/utils/scrollbar.js
4279
- var scrollbar = __webpack_require__(19);
4280
-
4281
- // CONCATENATED MODULE: ./src/utils/popup/index.js
4282
-
4283
-
4284
-
4285
-
4286
-
4287
-
4288
- var idSeed = 1;
4289
-
4290
- var scrollBarWidth = void 0;
4291
-
4292
- /* harmony default export */ var popup = __webpack_exports__["b"] = ({
4293
- props: {
4294
- visible: {
4295
- type: Boolean,
4296
- default: false
4297
- },
4298
- openDelay: {},
4299
- closeDelay: {},
4300
- zIndex: {},
4301
- modal: {
4302
- type: Boolean,
4303
- default: false
4304
- },
4305
- modalFade: {
4306
- type: Boolean,
4307
- default: true
4308
- },
4309
- modalClass: {},
4310
- modalAppendToBody: {
4311
- type: Boolean,
4312
- default: false
4313
- },
4314
- lockScroll: {
4315
- type: Boolean,
4316
- default: true
4317
- },
4318
- closeOnPressEscape: {
4319
- type: Boolean,
4320
- default: false
4321
- },
4322
- closeOnClickModal: {
4323
- type: Boolean,
4324
- default: false
4325
- }
4326
- },
4327
-
4328
- beforeMount: function beforeMount() {
4329
- this._popupId = 'popup-' + idSeed++;
4330
- popup_manager.register(this._popupId, this);
4331
- },
4332
- mounted: function mounted() {
4333
- var _this = this;
4334
-
4335
- // 监听组件的 'opened' 事件,在过渡动画完成后设置 rendered = true
4336
- this.$on('opened', function () {
4337
- _this.$nextTick(function () {
4338
- _this.rendered = true;
4339
- });
4340
- });
4341
- },
4342
- beforeDestroy: function beforeDestroy() {
4343
- popup_manager.deregister(this._popupId);
4344
- popup_manager.closeModal(this._popupId);
4345
-
4346
- this.restoreBodyStyle();
4347
- },
4348
- data: function data() {
4349
- return {
4350
- opened: false,
4351
- bodyPaddingRight: null,
4352
- computedBodyPaddingRight: 0,
4353
- withoutHiddenClass: true,
4354
- rendered: false
4355
- };
4356
- },
4357
-
4358
-
4359
- watch: {
4360
- visible: function visible(val) {
4361
- var _this2 = this;
4362
-
4363
- if (val) {
4364
- if (this._opening) return;
4365
- if (!this.rendered) {
4366
- external_vue_default.a.nextTick(function () {
4367
- _this2.open();
4368
- });
4369
- } else {
4370
- this.open();
4371
- }
4372
- } else {
4373
- this.close();
4374
- }
4375
- }
4376
- },
4377
-
4378
- methods: {
4379
- open: function open(options) {
4380
- var _this3 = this;
4381
-
4382
- var props = Object(merge["a" /* default */])({}, this.$props || this, options);
4383
-
4384
- if (this._closeTimer) {
4385
- clearTimeout(this._closeTimer);
4386
- this._closeTimer = null;
4387
- }
4388
- clearTimeout(this._openTimer);
4389
-
4390
- var openDelay = Number(props.openDelay);
4391
- if (openDelay > 0) {
4392
- this._openTimer = setTimeout(function () {
4393
- _this3._openTimer = null;
4394
- _this3.doOpen(props);
4395
- }, openDelay);
4396
- } else {
4397
- this.doOpen(props);
4398
- }
4399
- },
4400
- doOpen: function doOpen(props) {
4401
- if (this.$isServer) return;
4402
- if (this.willOpen && !this.willOpen()) return;
4403
- if (this.opened) return;
4404
-
4405
- this._opening = true;
4406
-
4407
- var dom = this.$el;
4408
-
4409
- var modal = props.modal;
4410
-
4411
- var zIndex = props.zIndex;
4412
- if (zIndex) {
4413
- popup_manager.zIndex = zIndex;
4414
- }
4415
-
4416
- if (modal) {
4417
- if (this._closing) {
4418
- popup_manager.closeModal(this._popupId);
4419
- this._closing = false;
4420
- }
4421
- popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
4422
- if (props.lockScroll) {
4423
- this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'es-popup-parent--hidden');
4424
- if (this.withoutHiddenClass) {
4425
- this.bodyPaddingRight = document.body.style.paddingRight;
4426
- this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
4427
- }
4428
- scrollBarWidth = Object(scrollbar["b" /* getScrollbarWidth */])();
4429
- var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
4430
- var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
4431
- if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
4432
- document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
4433
- }
4434
- Object(utils_dom["a" /* addClass */])(document.body, 'es-popup-parent--hidden');
4435
- }
4436
- }
4437
-
4438
- if (getComputedStyle(dom).position === 'static') {
4439
- dom.style.position = 'absolute';
4440
- }
4441
-
4442
- dom.style.zIndex = popup_manager.nextZIndex();
4443
- this.opened = true;
4444
-
4445
- this.onOpen && this.onOpen();
4446
-
4447
- this.doAfterOpen();
4448
- },
4449
- doAfterOpen: function doAfterOpen() {
4450
- this._opening = false;
4451
- },
4452
- close: function close() {
4453
- var _this4 = this;
4454
-
4455
- if (this.willClose && !this.willClose()) return;
4456
-
4457
- if (this._openTimer !== null) {
4458
- clearTimeout(this._openTimer);
4459
- this._openTimer = null;
4460
- }
4461
- clearTimeout(this._closeTimer);
4462
-
4463
- var closeDelay = Number(this.closeDelay);
4464
-
4465
- if (closeDelay > 0) {
4466
- this._closeTimer = setTimeout(function () {
4467
- _this4._closeTimer = null;
4468
- _this4.doClose();
4469
- }, closeDelay);
4470
- } else {
4471
- this.doClose();
4472
- }
4473
- },
4474
- doClose: function doClose() {
4475
- this._closing = true;
4476
-
4477
- this.onClose && this.onClose();
4478
-
4479
- if (this.lockScroll) {
4480
- setTimeout(this.restoreBodyStyle, 200);
4481
- }
4482
-
4483
- this.opened = false;
4484
-
4485
- this.doAfterClose();
4486
- },
4487
- doAfterClose: function doAfterClose() {
4488
- popup_manager.closeModal(this._popupId);
4489
- this._closing = false;
4490
- },
4491
- restoreBodyStyle: function restoreBodyStyle() {
4492
- if (this.modal && this.withoutHiddenClass) {
4493
- document.body.style.paddingRight = this.bodyPaddingRight;
4494
- Object(utils_dom["i" /* removeClass */])(document.body, 'es-popup-parent--hidden');
4495
- }
4496
- this.withoutHiddenClass = true;
4497
- }
4498
- }
4499
- });
4500
-
4501
-
4502
-
4503
- /***/ }),
4504
-
4505
- /***/ 3:
4506
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4507
-
4508
- "use strict";
4509
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
4510
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
4511
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
4512
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
4513
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
4514
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
4515
- /**
4516
- * 检查一个值是否为字符串类型
4517
- * @param {*} obj 要检查的值
4518
- * @returns {boolean} 如果值为字符串则返回true,否则返回false
4519
- */
4520
- function isString(obj) {
4521
- return Object.prototype.toString.call(obj) === '[object String]';
4522
- }
4523
-
4524
- /**
4525
- * 检查一个值是否为对象类型
4526
- * @param {*} obj 要检查的值
4527
- * @returns {boolean} 如果值为对象则返回true,否则返回false
4528
- */
4529
- function isObject(obj) {
4530
- return Object.prototype.toString.call(obj) === '[object Object]';
4531
- }
4532
-
4533
- /**
4534
- * 检查一个节点是否为HTML元素
4535
- * @param {Node} node 要检查的节点
4536
- * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
4537
- */
4538
- function isHtmlElement(node) {
4539
- return node && node.nodeType === Node.ELEMENT_NODE;
4540
- }
4541
-
4542
- /**
4543
- * 检查一个值是否为函数类型
4544
- * @param {*} functionToCheck 要检查的值
4545
- * @returns {boolean} 如果值为函数则返回true,否则返回false
4546
- */
4547
- function isFunction(functionToCheck) {
4548
- var getType = {};
4549
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
4550
- }
4551
-
4552
- /**
4553
- * 检查一个值是否为undefined
4554
- * @param {*} val 要检查的值
4555
- * @returns {boolean} 如果值为undefined则返回true,否则返回false
4556
- */
4557
- function isUndefined(val) {
4558
- return val === void 0;
4559
- }
4560
-
4561
- /**
4562
- * 检查一个值是否已定义(不是undefined或null)
4563
- * @param {*} val 要检查的值
4564
- * @returns {boolean} 如果值已定义则返回true,否则返回false
4565
- */
4566
- function isDefined(val) {
4567
- return val !== undefined && val !== null;
4568
- }
4569
-
4570
- /***/ }),
4571
-
4572
- /***/ 4:
4573
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4574
-
4575
- "use strict";
4576
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
4577
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
4578
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
4579
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
4580
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
4581
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
4582
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
4583
- /* unused harmony export setStyle */
4584
- /* unused harmony export isScroll */
4585
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
4586
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
4587
- /* unused harmony export insertAfter */
4588
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4589
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4590
- 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; };
4591
-
4592
- /* istanbul ignore next */
4593
-
4594
-
4595
-
4596
- var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
4597
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
4598
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
4599
- var ieVersion = isServer ? 0 : Number(document.documentMode);
4600
-
4601
- /* istanbul ignore next */
4602
- var trim = function trim(string) {
4603
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
4604
- };
4605
- /* istanbul ignore next */
4606
- var camelCase = function camelCase(name) {
4607
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
4608
- return offset ? letter.toUpperCase() : letter;
4609
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
4610
- };
4611
-
4612
- /* istanbul ignore next */
4613
- var on = function () {
4614
- if (!isServer && document.addEventListener) {
4615
- return function (element, event, handler) {
4616
- if (element && event && handler) {
4617
- element.addEventListener(event, handler, false);
4618
- }
4619
- };
4620
- } else {
4621
- return function (element, event, handler) {
4622
- if (element && event && handler) {
4623
- element.attachEvent('on' + event, handler);
4624
- }
4625
- };
4626
- }
4627
- }();
4628
-
4629
- /* istanbul ignore next */
4630
- var off = function () {
4631
- if (!isServer && document.removeEventListener) {
4632
- return function (element, event, handler) {
4633
- if (element && event) {
4634
- element.removeEventListener(event, handler, false);
4635
- }
4636
- };
4637
- } else {
4638
- return function (element, event, handler) {
4639
- if (element && event) {
4640
- element.detachEvent('on' + event, handler);
4641
- }
4642
- };
4643
- }
4644
- }();
4645
-
4646
- /* istanbul ignore next */
4647
- var once = function once(el, event, fn) {
4648
- var listener = function listener() {
4649
- if (fn) {
4650
- fn.apply(this, arguments);
4651
- }
4652
- off(el, event, listener);
4653
- };
4654
- on(el, event, listener);
4655
- };
4656
-
4657
- /* istanbul ignore next */
4658
- function hasClass(el, cls) {
4659
- if (!el || !cls) return false;
4660
- if (cls.indexOf(' ') !== -1) {
4661
- throw new Error('className should not contain space.');
4662
- }
4663
- if (el.classList) {
4664
- return el.classList.contains(cls);
4665
- } else {
4666
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
4667
- }
4668
- }
4669
-
4670
- /* istanbul ignore next */
4671
- function addClass(el, cls) {
4672
- if (!el) return;
4673
- var curClass = el.className;
4674
- var classes = (cls || '').split(' ');
4675
-
4676
- for (var i = 0, j = classes.length; i < j; i++) {
4677
- var clsName = classes[i];
4678
- if (!clsName) continue;
4679
-
4680
- if (el.classList) {
4681
- el.classList.add(clsName);
4682
- } else if (!hasClass(el, clsName)) {
4683
- curClass += ' ' + clsName;
4684
- }
4685
- }
4686
- if (!el.classList) {
4687
- el.className = curClass;
4688
- }
4689
- }
4690
-
4691
- /* istanbul ignore next */
4692
- function removeClass(el, cls) {
4693
- if (!el || !cls) return;
4694
- var classes = cls.split(' ');
4695
- var curClass = ' ' + el.className + ' ';
4696
-
4697
- for (var i = 0, j = classes.length; i < j; i++) {
4698
- var clsName = classes[i];
4699
- if (!clsName) continue;
4700
-
4701
- if (el.classList) {
4702
- el.classList.remove(clsName);
4703
- } else if (hasClass(el, clsName)) {
4704
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
4705
- }
4706
- }
4707
- if (!el.classList) {
4708
- el.className = trim(curClass);
4709
- }
4710
- }
4711
-
4712
- /* istanbul ignore next */
4713
- var getStyle = ieVersion < 9 ? function (element, styleName) {
4714
- if (isServer) return;
4715
- if (!element || !styleName) return null;
4716
- styleName = camelCase(styleName);
4717
- if (styleName === 'float') {
4718
- styleName = 'styleFloat';
4719
- }
4720
- try {
4721
- switch (styleName) {
4722
- case 'opacity':
4723
- try {
4724
- return element.filters.item('alpha').opacity / 100;
4725
- } catch (e) {
4726
- return 1.0;
4727
- }
4728
- default:
4729
- return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
4730
- }
4731
- } catch (e) {
4732
- return element.style[styleName];
4733
- }
4734
- } : function (element, styleName) {
4735
- if (isServer) return;
4736
- if (!element || !styleName) return null;
4737
- styleName = camelCase(styleName);
4738
- if (styleName === 'float') {
4739
- styleName = 'cssFloat';
4740
- }
4741
- try {
4742
- var computed = document.defaultView.getComputedStyle(element, '');
4743
- return element.style[styleName] || computed ? computed[styleName] : null;
4744
- } catch (e) {
4745
- return element.style[styleName];
4746
- }
4747
- };
4748
-
4749
- /* istanbul ignore next */
4750
- function setStyle(element, styleName, value) {
4751
- if (!element || !styleName) return;
4752
-
4753
- if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
4754
- for (var prop in styleName) {
4755
- if (styleName.hasOwnProperty(prop)) {
4756
- setStyle(element, prop, styleName[prop]);
4757
- }
4758
- }
4759
- } else {
4760
- styleName = camelCase(styleName);
4761
- if (styleName === 'opacity' && ieVersion < 9) {
4762
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
4763
- } else {
4764
- element.style[styleName] = value;
4765
- }
4766
- }
4767
- }
4768
-
4769
- var isScroll = function isScroll(el, vertical) {
4770
- if (isServer) return;
4771
-
4772
- var determinedDirection = vertical !== null || vertical !== undefined;
4773
- var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
4774
-
4775
- return overflow.match(/(scroll|auto)/);
4776
- };
4777
-
4778
- var getScrollContainer = function getScrollContainer(el, vertical) {
4779
- if (isServer) return;
4780
-
4781
- var parent = el;
4782
- while (parent) {
4783
- if ([window, document, document.documentElement].includes(parent)) {
4784
- return window;
4785
- }
4786
- if (isScroll(parent, vertical)) {
4787
- return parent;
4788
- }
4789
- parent = parent.parentNode;
4790
- }
4791
-
4792
- return parent;
4793
- };
4794
-
4795
- var isInContainer = function isInContainer(el, container) {
4796
- if (isServer || !el || !container) return false;
4797
-
4798
- var elRect = el.getBoundingClientRect();
4799
- var containerRect = void 0;
4800
-
4801
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
4802
- containerRect = {
4803
- top: 0,
4804
- right: window.innerWidth,
4805
- bottom: window.innerHeight,
4806
- left: 0
4807
- };
4808
- } else {
4809
- containerRect = container.getBoundingClientRect();
4810
- }
4811
-
4812
- return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
4813
- };
4814
-
4815
- /**
4816
- * 在元素前插入元素
4817
- * @param {HTMLElement} newEl 新DOM元素
4818
- * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
4819
- */
4820
- function insertAfter(newEl, targetEl) {
4821
- var parentEl = targetEl.parentNode;
4822
- if (parentEl.lastChild === targetEl) {
4823
- parentEl.appendChild(newEl);
4824
- } else {
4825
- parentEl.insertBefore(newEl, targetEl.nextSibling);
4826
- }
4827
- }
4828
-
4829
- /***/ }),
4830
-
4831
- /***/ 5:
4832
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4833
-
4834
- "use strict";
4835
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
4836
- /* globals __VUE_SSR_CONTEXT__ */
4837
-
4838
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
4839
- // This module is a runtime utility for cleaner component module output and will
4840
- // be included in the final webpack user bundle.
4841
-
4842
- function normalizeComponent(
4843
- scriptExports,
4844
- render,
4845
- staticRenderFns,
4846
- functionalTemplate,
4847
- injectStyles,
4848
- scopeId,
4849
- moduleIdentifier /* server only */,
4850
- shadowMode /* vue-cli only */
4851
- ) {
4852
- // Vue.extend constructor export interop
4853
- var options =
4854
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
4855
-
4856
- // render functions
4857
- if (render) {
4858
- options.render = render
4859
- options.staticRenderFns = staticRenderFns
4860
- options._compiled = true
4861
- }
4862
-
4863
- // functional template
4864
- if (functionalTemplate) {
4865
- options.functional = true
4866
- }
4867
-
4868
- // scopedId
4869
- if (scopeId) {
4870
- options._scopeId = 'data-v-' + scopeId
4871
- }
4872
-
4873
- var hook
4874
- if (moduleIdentifier) {
4875
- // server build
4876
- hook = function (context) {
4877
- // 2.3 injection
4878
- context =
4879
- context || // cached call
4880
- (this.$vnode && this.$vnode.ssrContext) || // stateful
4881
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
4882
- // 2.2 with runInNewContext: true
4883
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
4884
- context = __VUE_SSR_CONTEXT__
4885
- }
4886
- // inject component styles
4887
- if (injectStyles) {
4888
- injectStyles.call(this, context)
4889
- }
4890
- // register component module identifier for async chunk inferrence
4891
- if (context && context._registeredComponents) {
4892
- context._registeredComponents.add(moduleIdentifier)
4893
- }
4894
- }
4895
- // used by ssr in case component is cached and beforeCreate
4896
- // never gets called
4897
- options._ssrRegister = hook
4898
- } else if (injectStyles) {
4899
- hook = shadowMode
4900
- ? function () {
4901
- injectStyles.call(
4902
- this,
4903
- (options.functional ? this.parent : this).$root.$options.shadowRoot
4904
- )
4905
- }
4906
- : injectStyles
4907
- }
4908
-
4909
- if (hook) {
4910
- if (options.functional) {
4911
- // for template-only hot-reload because in that case the render fn doesn't
4912
- // go through the normalizer
4913
- options._injectStyles = hook
4914
- // register for functional component in vue file
4915
- var originalRender = options.render
4916
- options.render = function renderWithStyleInjection(h, context) {
4917
- hook.call(context)
4918
- return originalRender(h, context)
4919
- }
4920
- } else {
4921
- // inject component registration as beforeCreate hook
4922
- var existing = options.beforeCreate
4923
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
4924
- }
4925
- }
4926
-
4927
- return {
4928
- exports: scriptExports,
4929
- options: options
4930
- }
4931
- }
4932
-
4933
-
4934
- /***/ }),
4935
-
4936
- /***/ 6:
4937
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4938
-
4939
3013
  "use strict";
4940
3014
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
4941
3015
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
@@ -5649,281 +3723,2316 @@ const extractTimeFormat = function(format) {
5649
3723
  .trim();
5650
3724
  };
5651
3725
 
5652
- const validateRangeInOneMonth = function(start, end) {
5653
- return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
5654
- };
3726
+ const validateRangeInOneMonth = function(start, end) {
3727
+ return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
3728
+ };
3729
+
3730
+ /**
3731
+ * 计算两个日期之间的工作日数量(不包括周末和节假日)
3732
+ * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
3733
+ * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
3734
+ * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
3735
+ * @returns {number} 工作日数量
3736
+ */
3737
+ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
3738
+ if (typeof start_date !== 'string' || typeof end_date !== 'string') {
3739
+ throw new Error(
3740
+ "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
3741
+ );
3742
+ }
3743
+
3744
+ const startDateObj = new Date(start_date);
3745
+ const endDateObj = new Date(end_date);
3746
+
3747
+ if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
3748
+ throw new Error(
3749
+ "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
3750
+ );
3751
+ }
3752
+
3753
+ if (startDateObj > endDateObj) {
3754
+ throw new Error('Start date should be earlier than or equal to end date.');
3755
+ }
3756
+
3757
+ let workdays = 0;
3758
+
3759
+ // Iterate through each day in the date range
3760
+ for (
3761
+ let currentDate = new Date(startDateObj);
3762
+ currentDate <= endDateObj;
3763
+ currentDate.setDate(currentDate.getDate() + 1)
3764
+ ) {
3765
+ // Check if the current day is a weekend (Saturday or Sunday)
3766
+ const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
3767
+
3768
+ // Check if the current day is a holiday
3769
+ const isHoliday = holidays.some((holiday) => {
3770
+ const holidayDate = new Date(holiday);
3771
+ return currentDate.toDateString() === holidayDate.toDateString();
3772
+ });
3773
+
3774
+ // If it's a workday (not a weekend or holiday), increment the workdays count
3775
+ if (!isWeekend && !isHoliday) {
3776
+ workdays++;
3777
+ }
3778
+ }
3779
+
3780
+ return workdays;
3781
+ };
3782
+
3783
+ /**
3784
+ * 日期加减天数
3785
+ * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
3786
+ * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
3787
+ * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
3788
+ */
3789
+ const dateAddDays = function (start_date, days) {
3790
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
3791
+ throw new Error(
3792
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
3793
+ );
3794
+ }
3795
+
3796
+ const startDateObj = new Date(start_date);
3797
+ if (isNaN(startDateObj.getTime())) {
3798
+ throw new Error(
3799
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
3800
+ );
3801
+ }
3802
+
3803
+ const resultDateObj = new Date(startDateObj);
3804
+ resultDateObj.setDate(resultDateObj.getDate() + days);
3805
+
3806
+ const resultYear = resultDateObj.getFullYear();
3807
+ const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
3808
+ const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
3809
+
3810
+ return `${resultYear}-${resultMonth}-${resultDay}`;
3811
+ };
3812
+
3813
+ /**
3814
+ * 计算两个日期之间的差值
3815
+ * @date 2023年12月14日
3816
+ * @param {String} start_date - 起始日期字符串
3817
+ * @param {String} end_date - 结束日期字符串
3818
+ * @param {String} unit - 单位:year/month/day
3819
+ * @returns {Number} 差值
3820
+ */
3821
+ const dateDiff = function (start_date, end_date, unit = 'day') {
3822
+ // Assuming date strings are in "YYYY-MM-DD" format
3823
+ var startDate = new Date(start_date);
3824
+ var endDate = new Date(end_date);
3825
+
3826
+ // If the date is invalid, return 0
3827
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
3828
+ return 0;
3829
+ }
3830
+
3831
+ if (unit === 'year') {
3832
+ return endDate.getFullYear() - startDate.getFullYear();
3833
+ } else if (unit === 'month') {
3834
+ return (
3835
+ (endDate.getFullYear() - startDate.getFullYear()) * 12 +
3836
+ (endDate.getMonth() - startDate.getMonth())
3837
+ );
3838
+ } else {
3839
+ // Default to day
3840
+ var timeDifference = endDate - startDate;
3841
+ // Calculate days (86400000 milliseconds per day)
3842
+ return Math.floor(timeDifference / 86400000);
3843
+ }
3844
+ };
3845
+
3846
+ /**
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
+
5655
3968
 
5656
3969
  /**
5657
- * 计算两个日期之间的工作日数量(不包括周末和节假日)
5658
- * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
5659
- * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
5660
- * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
5661
- * @returns {number} 工作日数量
5662
- */
5663
- const calculateNetworkDays = function (start_date, end_date, holidays = []) {
5664
- if (typeof start_date !== 'string' || typeof end_date !== 'string') {
5665
- throw new Error(
5666
- "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
5667
- );
5668
- }
5669
-
5670
- const startDateObj = new Date(start_date);
5671
- const endDateObj = new Date(end_date);
5672
-
5673
- if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
5674
- throw new Error(
5675
- "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
5676
- );
5677
- }
5678
-
5679
- if (startDateObj > endDateObj) {
5680
- throw new Error('Start date should be earlier than or equal to end date.');
5681
- }
5682
-
5683
- let workdays = 0;
5684
-
5685
- // Iterate through each day in the date range
5686
- for (
5687
- let currentDate = new Date(startDateObj);
5688
- currentDate <= endDateObj;
5689
- currentDate.setDate(currentDate.getDate() + 1)
5690
- ) {
5691
- // Check if the current day is a weekend (Saturday or Sunday)
5692
- const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
5693
-
5694
- // Check if the current day is a holiday
5695
- const isHoliday = holidays.some((holiday) => {
5696
- const holidayDate = new Date(holiday);
5697
- return currentDate.toDateString() === holidayDate.toDateString();
5698
- });
5699
-
5700
- // If it's a workday (not a weekend or holiday), increment the workdays count
5701
- if (!isWeekend && !isHoliday) {
5702
- workdays++;
5703
- }
5704
- }
5705
-
5706
- return workdays;
5707
- };
5708
-
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
+ /***/ 13:
4001
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4002
+
4003
+ "use strict";
4004
+ /* unused harmony export getHue */
4005
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
4006
+ /* unused harmony export getLightness */
4007
+ /* unused harmony export getSaturation */
4008
+ /* unused harmony export rgbToHsv */
4009
+ /* unused harmony export hsvTorgb */
4010
+ /* unused harmony export mixColor */
4011
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
4012
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4013
+
4014
+ var $hueStep = 2;
4015
+ var $saturationStep1 = 0.16;
4016
+ var $saturationStep2 = 0.05;
4017
+ var $brightnessStep1 = 0.05;
4018
+ var $brightnessStep2 = 0.15;
4019
+ var $lightColorCount = 5;
4020
+ var $darkColorCount = 4;
4021
+ /**
4022
+ * getHue
4023
+ * @desc:转换色相
4024
+ * @author huangbo
4025
+ * @date 2022年5月7日
4026
+ **/
4027
+ var getHue = function getHue($h, $i, $isLight) {
4028
+ var $hue = void 0;
4029
+ if ($h >= 60 && $h <= 240) {
4030
+ $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
4031
+ } else {
4032
+ $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
4033
+ }
4034
+ $hue = ($hue + 360) % 360;
4035
+ return Math.round($hue);
4036
+ };
4037
+
4038
+ /**
4039
+ * getColor
4040
+ * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
4041
+ * @author huangbo
4042
+ * @date 2022年5月7日
4043
+ **/
4044
+ var getColor = function getColor($color, $n) {
4045
+ var $isLight = $n < 7;
4046
+ var $hsv = rgbToHsv($color);
4047
+ // 这里将i转换成以主色为中心,两侧的i值逐渐增大
4048
+ var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
4049
+ var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
4050
+ return color;
4051
+ };
4052
+
4053
+ /**
4054
+ * getLightness
4055
+ * @desc:转换明度
4056
+ * @author huangbo
4057
+ * @date 2022年5月7日
4058
+ * @return {string,array} 元素类名或者id
4059
+ **/
4060
+ var getLightness = function getLightness($v, $i, $isLight) {
4061
+ var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
4062
+ $value = $value < 1 ? $value : 1;
4063
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
4064
+ };
4065
+
4066
+ /**
4067
+ * getSaturation
4068
+ * @desc:转换饱和度
4069
+ * @author huangbo
4070
+ * @date 2022年5月7日
4071
+ **/
4072
+ var getSaturation = function getSaturation($s, $i, $isLight) {
4073
+ var $saturation = void 0;
4074
+ if ($isLight) {
4075
+ $saturation = $s - $saturationStep1 * $i;
4076
+ } else if ($i === $darkColorCount) {
4077
+ $saturation = $s + $saturationStep1;
4078
+ } else {
4079
+ $saturation = $s + $saturationStep2 * $i;
4080
+ }
4081
+ $saturation = $saturation < 1 ? $saturation : 1;
4082
+
4083
+ if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
4084
+ $saturation = 0.1;
4085
+ }
4086
+ $saturation = $saturation > 0.06 ? $saturation : 0.06;
4087
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
4088
+ };
4089
+
4090
+ /**
4091
+ * rgbToHsv
4092
+ * @desc:rgb转化成hsv
4093
+ * @author huangbo
4094
+ * @date 2022年5月7日
4095
+ * @param {string} [$color] - 颜色值
4096
+ **/
4097
+ var rgbToHsv = function rgbToHsv($color) {
4098
+ var rgb = getRgb($color);
4099
+ var $red = rgb[0];
4100
+ var $green = rgb[1];
4101
+ var $blue = rgb[2];
4102
+ var $max = Math.max($red, $green, $blue);
4103
+ var $min = Math.min($red, $green, $blue);
4104
+ var $diff = $max - $min;
4105
+ var $h = 0;
4106
+ if ($max === $min) {
4107
+ $h = 0;
4108
+ } else if ($max === $red) {
4109
+ $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
4110
+ } else if ($max === $green) {
4111
+ $h = 60 * ($blue - $red) / $diff + 120;
4112
+ } else if ($max === $blue) {
4113
+ $h = 60 * ($red - $green) / $diff + 240;
4114
+ }
4115
+ var $s = $max === 0 ? 0 : $diff / $max;
4116
+ var $v = $max / 255;
4117
+ return [$h, $s, $v];
4118
+ };
4119
+
4120
+ /**
4121
+ * hsvTorgb
4122
+ * @desc:hsv转化成rgb
4123
+ * @author huangbo
4124
+ * @date 2022年5月7日
4125
+ * @param {string} [$color] - 颜色值
4126
+ **/
4127
+ var hsvTorgb = function hsvTorgb($h, $s, $v) {
4128
+ var $th = Math.floor($h / 60);
4129
+ var $t1 = $h / 60 - $th;
4130
+ var $t2 = $v * (1 - $s);
4131
+ var $t3 = $v * (1 - $t1 * $s);
4132
+ var $t4 = $v * (1 - (1 - $t1) * $s);
4133
+ var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
4134
+ var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
4135
+ var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
4136
+ // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
4137
+ var red = Math.round($r * 255);
4138
+ var green = Math.round($g * 255);
4139
+ var blue = Math.round($b * 255);
4140
+ red = red.toString(16);
4141
+ green = green.toString(16);
4142
+ blue = blue.toString(16);
4143
+ red = red.length === 1 ? '0' + red : red;
4144
+ green = green.length === 1 ? '0' + green : green;
4145
+ blue = blue.length === 1 ? '0' + blue : blue;
4146
+ return '#' + red + green + blue;
4147
+ };
4148
+
4149
+ /**
4150
+ * mixColor
4151
+ * @desc:生成混合色
4152
+ * @author huangbo
4153
+ * @date 2022年5月7日
4154
+ * @param {string} [$color1] - 颜色值
4155
+ * @param {string} [$color2] - 颜色值
4156
+ * @param {string} [$n] - 百分比 0~1
4157
+ **/
4158
+ var mixColor = function mixColor($color1, $color2, $n) {
4159
+ var rgb1 = getRgb($color1);
4160
+ var rgb2 = getRgb($color2);
4161
+ var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
4162
+ var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
4163
+ var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
4164
+ return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
4165
+ };
4166
+
4167
+ /**
4168
+ * getRgb
4169
+ * @desc:获取颜色值的rgb值
4170
+ * @author huangbo
4171
+ * @date 2022年5月7日
4172
+ * @param {string} [$color] - 颜色值
4173
+ **/
4174
+ var getRgb = function getRgb($color) {
4175
+ var rgb = [];
4176
+ // 16进制颜色值的正则
4177
+ var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
4178
+ // 把颜色值变成小写
4179
+ $color = $color.toLowerCase();
4180
+ if (reg.test($color)) {
4181
+ // 如果只有三位的值,需变成六位,如:#fff => #ffffff
4182
+ if ($color.length === 4) {
4183
+ var colorNew = '#';
4184
+ for (var i = 1; i < 4; i++) {
4185
+ colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
4186
+ }
4187
+ $color = colorNew;
4188
+ }
4189
+ // 处理六位的颜色值,转为RGB
4190
+ for (var _i = 1; _i < 7; _i += 2) {
4191
+ rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
4192
+ }
4193
+ } else {
4194
+ rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
4195
+ }
4196
+ return rgb;
4197
+ };
4198
+
4199
+ /***/ }),
4200
+
4201
+ /***/ 15:
4202
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4203
+
4204
+ "use strict";
4205
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollbarWidth; });
4206
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return scrollIntoView; });
4207
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollSize; });
4208
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return scrollMove; });
4209
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
4210
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4211
+
4212
+
4213
+ /**
4214
+ * 缓存变量,用于存储计算过的滚动条宽度
4215
+ */
4216
+ var scrollBarWidth = void 0;
4217
+
4218
+ /**
4219
+ * 计算并返回浏览器滚动条的宽度
4220
+ * @returns {number} 滚动条宽度(像素)
4221
+ */
4222
+ var getScrollbarWidth = function getScrollbarWidth() {
4223
+ // 服务器端渲染时返回0
4224
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
4225
+ // 如果已经计算过,直接返回缓存值
4226
+ if (scrollBarWidth !== undefined) return scrollBarWidth;
4227
+
4228
+ // 创建测试元素
4229
+ var outer = document.createElement('div');
4230
+ outer.className = 'es-scrollbar__wrap';
4231
+ outer.style.visibility = 'hidden';
4232
+ outer.style.width = '100px';
4233
+ outer.style.position = 'absolute';
4234
+ outer.style.top = '-9999px';
4235
+ document.body.appendChild(outer);
4236
+
4237
+ // 计算无滚动条时的宽度
4238
+ var widthNoScroll = outer.offsetWidth;
4239
+ outer.style.overflow = 'scroll';
4240
+
4241
+ // 创建内部元素并计算有滚动条时的宽度
4242
+ var inner = document.createElement('div');
4243
+ inner.style.width = '100%';
4244
+ outer.appendChild(inner);
4245
+
4246
+ var widthWithScroll = inner.offsetWidth;
4247
+ // 清理DOM
4248
+ outer.parentNode.removeChild(outer);
4249
+ // 计算滚动条宽度
4250
+ scrollBarWidth = widthNoScroll - widthWithScroll;
4251
+
4252
+ return scrollBarWidth;
4253
+ };
4254
+
4255
+ /**
4256
+ * 将指定元素滚动到容器视图中
4257
+ * @param {HTMLElement} container - 容器元素
4258
+ * @param {HTMLElement} selected - 要滚动到视图中的元素
4259
+ * @example
4260
+ * // 用法示例
4261
+ * const container = document.querySelector('.container');
4262
+ * const element = document.querySelector('.target-element');
4263
+ * scrollIntoView(container, element);
4264
+ */
4265
+ function scrollIntoView(container, selected) {
4266
+ // 服务器端渲染时不执行
4267
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
4268
+
4269
+ // 如果没有指定元素,滚动到顶部
4270
+ if (!selected) {
4271
+ container.scrollTop = 0;
4272
+ return;
4273
+ }
4274
+
4275
+ // 收集所有偏移父元素
4276
+ var offsetParents = [];
4277
+ var pointer = selected.offsetParent;
4278
+ while (pointer && container !== pointer && container.contains(pointer)) {
4279
+ offsetParents.push(pointer);
4280
+ pointer = pointer.offsetParent;
4281
+ }
4282
+
4283
+ // 计算元素相对于容器的顶部偏移量
4284
+ var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {
4285
+ return prev + curr.offsetTop;
4286
+ }, 0);
4287
+ var bottom = top + selected.offsetHeight;
4288
+ var viewRectTop = container.scrollTop;
4289
+ var viewRectBottom = viewRectTop + container.clientHeight;
4290
+
4291
+ // 调整滚动位置使元素可见
4292
+ if (top < viewRectTop) {
4293
+ container.scrollTop = top;
4294
+ } else if (bottom > viewRectBottom) {
4295
+ container.scrollTop = bottom - container.clientHeight;
4296
+ }
4297
+ }
4298
+
4299
+ // 获取滚动条大小
4300
+ function getScrollSize(wrap) {
4301
+ if (!wrap) {
4302
+ return { width: '', height: '' };
4303
+ };
4304
+ var heightPercentage = 0;
4305
+ var widthPercentage = 0;
4306
+
4307
+ // 修复滚动条尺寸计算逻辑
4308
+ var scrollHeight = wrap.scrollHeight;
4309
+ var scrollWidth = wrap.scrollWidth;
4310
+ var clientHeight = wrap.clientHeight;
4311
+ var clientWidth = wrap.clientWidth;
4312
+ var sizes = {
4313
+ width: '',
4314
+ height: ''
4315
+ };
4316
+ // 只有当内容高度超过容器高度时才显示垂直滚动条
4317
+ if (scrollHeight > clientHeight) {
4318
+ heightPercentage = clientHeight * 100 / scrollHeight;
4319
+ sizes.height = heightPercentage < 100 ? heightPercentage + '%' : '100%';
4320
+ } else {
4321
+ sizes.height = '';
4322
+ }
4323
+
4324
+ // 只有当内容宽度超过容器宽度时才显示水平滚动条
4325
+ if (scrollWidth > clientWidth) {
4326
+ widthPercentage = clientWidth * 100 / scrollWidth;
4327
+ sizes.width = widthPercentage < 100 ? widthPercentage + '%' : '100%';
4328
+ } else {
4329
+ sizes.width = '';
4330
+ }
4331
+ return sizes;
4332
+ }
4333
+
4334
+ // 滚动条移动
4335
+ function scrollMove(wrap) {
4336
+ if (!wrap) return;
4337
+
4338
+ // 立即更新滚动条位置,不使用阈值判断
4339
+ var y = wrap.scrollTop * 100 / wrap.clientHeight;
4340
+ var x = wrap.scrollLeft * 100 / wrap.clientWidth;
4341
+ return { y: y, x: x };
4342
+ }
4343
+
4344
+ /***/ }),
4345
+
4346
+ /***/ 16:
4347
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4348
+
4349
+ "use strict";
4350
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
4351
+ for (var i = 1, j = arguments.length; i < j; i++) {
4352
+ var source = arguments[i] || {};
4353
+ for (var prop in source) {
4354
+ if (source.hasOwnProperty(prop)) {
4355
+ var value = source[prop];
4356
+ if (value !== undefined) {
4357
+ target[prop] = value;
4358
+ }
4359
+ }
4360
+ }
4361
+ }
4362
+
4363
+ return target;
4364
+ });;
4365
+
4366
+ /***/ }),
4367
+
4368
+ /***/ 176:
4369
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4370
+
4371
+ "use strict";
4372
+ // ESM COMPAT FLAG
4373
+ __webpack_require__.r(__webpack_exports__);
4374
+
4375
+ // EXTERNAL MODULE: external "vue"
4376
+ var external_vue_ = __webpack_require__(4);
4377
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
4378
+
4379
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=template&id=6638efd1&
4380
+ var render = function () {
4381
+ var _vm = this
4382
+ var _h = _vm.$createElement
4383
+ var _c = _vm._self._c || _h
4384
+ return _c("transition", { attrs: { name: "es-notification-fade" } }, [
4385
+ _c(
4386
+ "div",
4387
+ {
4388
+ directives: [
4389
+ {
4390
+ name: "show",
4391
+ rawName: "v-show",
4392
+ value: _vm.visible,
4393
+ expression: "visible",
4394
+ },
4395
+ ],
4396
+ class: ["es-notification", _vm.customClass, _vm.horizontalClass],
4397
+ style: _vm.positionStyle,
4398
+ attrs: { role: "alert" },
4399
+ on: {
4400
+ mouseenter: function ($event) {
4401
+ return _vm.clearTimer()
4402
+ },
4403
+ mouseleave: function ($event) {
4404
+ return _vm.startTimer()
4405
+ },
4406
+ click: _vm.click,
4407
+ },
4408
+ },
4409
+ [
4410
+ _vm.type || _vm.iconClass
4411
+ ? _c("i", {
4412
+ staticClass: "es-notification__icon",
4413
+ class: [_vm.typeClass, _vm.iconClass],
4414
+ })
4415
+ : _vm._e(),
4416
+ _c(
4417
+ "div",
4418
+ {
4419
+ staticClass: "es-notification__group",
4420
+ class: { "is-with-icon": _vm.typeClass || _vm.iconClass },
4421
+ },
4422
+ [
4423
+ _c("h2", {
4424
+ staticClass: "es-notification__title",
4425
+ domProps: { textContent: _vm._s(_vm.title) },
4426
+ }),
4427
+ _c(
4428
+ "div",
4429
+ {
4430
+ directives: [
4431
+ {
4432
+ name: "show",
4433
+ rawName: "v-show",
4434
+ value: _vm.message,
4435
+ expression: "message",
4436
+ },
4437
+ ],
4438
+ staticClass: "es-notification__content",
4439
+ },
4440
+ [
4441
+ _vm._t("default", function () {
4442
+ return [
4443
+ !_vm.dangerouslyUseHTMLString
4444
+ ? _c("p", [_vm._v(_vm._s(_vm.message))])
4445
+ : _c("p", {
4446
+ domProps: { innerHTML: _vm._s(_vm.message) },
4447
+ }),
4448
+ ]
4449
+ }),
4450
+ ],
4451
+ 2
4452
+ ),
4453
+ _vm.showClose
4454
+ ? _c("div", {
4455
+ staticClass: "es-notification__closeBtn es-icon-guanbi",
4456
+ on: {
4457
+ click: function ($event) {
4458
+ $event.stopPropagation()
4459
+ return _vm.close.apply(null, arguments)
4460
+ },
4461
+ },
4462
+ })
4463
+ : _vm._e(),
4464
+ ]
4465
+ ),
4466
+ ]
4467
+ ),
4468
+ ])
4469
+ }
4470
+ var staticRenderFns = []
4471
+ render._withStripped = true
4472
+
4473
+
4474
+ // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=6638efd1&
4475
+
4476
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=script&lang=js&
4477
+ //
4478
+ //
4479
+ //
4480
+ //
4481
+ //
4482
+ //
4483
+ //
4484
+ //
4485
+ //
4486
+ //
4487
+ //
4488
+ //
4489
+ //
4490
+ //
4491
+ //
4492
+ //
4493
+ //
4494
+ //
4495
+ //
4496
+ //
4497
+ //
4498
+ //
4499
+ //
4500
+ //
4501
+ //
4502
+ //
4503
+ //
4504
+ //
4505
+ //
4506
+ //
4507
+ //
4508
+ //
4509
+ //
4510
+ //
4511
+ //
4512
+ //
4513
+ //
4514
+ //
4515
+
4516
+ /**
4517
+ * 通知组件类型图标映射
4518
+ */
4519
+ var typeMap = {
4520
+ success: 'success',
4521
+ info: 'info',
4522
+ warning: 'solid-zhuyi',
4523
+ error: 'solid-guanbi'
4524
+ };
4525
+
4526
+ /**
4527
+ * 通知组件
4528
+ * @description 悬浮出现在页面角落,显示全局的通知提醒消息
4529
+ * @props {Boolean} visible - 是否可见
4530
+ * @props {String} title - 标题
4531
+ * @props {String|Vue.VNode} message - 说明文字
4532
+ * @props {Number} duration - 显示时间,毫秒,设为0则不会自动关闭
4533
+ * @props {String} type - 主题样式,可选值:success/warning/info/error
4534
+ * @props {Boolean} showClose - 是否显示关闭按钮
4535
+ * @props {String} customClass - 自定义类名
4536
+ * @props {String} iconClass - 自定义图标的类名
4537
+ * @props {Function} onClose - 关闭时的回调函数
4538
+ * @props {Function} onClick - 点击Notification时的回调函数
4539
+ * @props {Boolean} closed - 是否已关闭
4540
+ * @props {Number} verticalOffset - 垂直偏移量
4541
+ * @props {Number} timer - 定时器
4542
+ * @props {Boolean} dangerouslyUseHTMLString - 是否将message作为HTML片段处理
4543
+ * @props {String} position - 弹出位置,可选值:top-right/top-left/bottom-right/bottom-left
4544
+ */
4545
+ /* harmony default export */ var mainvue_type_script_lang_js_ = ({
4546
+ data: function data() {
4547
+ return {
4548
+ visible: false,
4549
+ title: '',
4550
+ message: '',
4551
+ duration: 4500,
4552
+ type: '',
4553
+ showClose: true,
4554
+ customClass: '',
4555
+ iconClass: '',
4556
+ onClose: null,
4557
+ onClick: null,
4558
+ closed: false,
4559
+ verticalOffset: 0,
4560
+ timer: null,
4561
+ dangerouslyUseHTMLString: false,
4562
+ position: 'top-right'
4563
+ };
4564
+ },
4565
+
4566
+
4567
+ computed: {
4568
+ /**
4569
+ * 类型图标类名
4570
+ * @returns {String} 图标类名
4571
+ */
4572
+ typeClass: function typeClass() {
4573
+ return this.type && typeMap[this.type] ? 'es-icon-' + typeMap[this.type] : '';
4574
+ },
4575
+
4576
+
4577
+ /**
4578
+ * 水平位置类名
4579
+ * @returns {String} 水平位置类名
4580
+ */
4581
+ horizontalClass: function horizontalClass() {
4582
+ return this.position.indexOf('right') > -1 ? 'right' : 'left';
4583
+ },
4584
+
4585
+
4586
+ /**
4587
+ * 垂直位置属性
4588
+ * @returns {String} 垂直位置属性
4589
+ */
4590
+ verticalProperty: function verticalProperty() {
4591
+ return (/^top-/.test(this.position) ? 'top' : 'bottom'
4592
+ );
4593
+ },
4594
+
4595
+
4596
+ /**
4597
+ * 位置样式
4598
+ * @returns {Object} 位置样式对象
4599
+ */
4600
+ positionStyle: function positionStyle() {
4601
+ var _ref;
4602
+
4603
+ return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
4604
+ }
4605
+ },
4606
+
4607
+ watch: {
4608
+ closed: function closed(newVal) {
4609
+ if (newVal) {
4610
+ this.visible = false;
4611
+ this.$el.addEventListener('transitionend', this.destroyElement);
4612
+ }
4613
+ }
4614
+ },
4615
+
4616
+ methods: {
4617
+ /**
4618
+ * 销毁元素
4619
+ */
4620
+ destroyElement: function destroyElement() {
4621
+ this.$el.removeEventListener('transitionend', this.destroyElement);
4622
+ this.$destroy(true);
4623
+ this.$el.parentNode.removeChild(this.$el);
4624
+ },
4625
+
4626
+
4627
+ /**
4628
+ * 点击事件处理
4629
+ */
4630
+ click: function click() {
4631
+ if (typeof this.onClick === 'function') {
4632
+ this.onClick();
4633
+ }
4634
+ },
4635
+
4636
+
4637
+ /**
4638
+ * 关闭通知
4639
+ */
4640
+ close: function close() {
4641
+ this.closed = true;
4642
+ if (typeof this.onClose === 'function') {
4643
+ this.onClose();
4644
+ }
4645
+ },
4646
+
4647
+
4648
+ /**
4649
+ * 清除定时器
4650
+ */
4651
+ clearTimer: function clearTimer() {
4652
+ clearTimeout(this.timer);
4653
+ },
4654
+
4655
+
4656
+ /**
4657
+ * 开始定时器
4658
+ */
4659
+ startTimer: function startTimer() {
4660
+ var _this = this;
4661
+
4662
+ if (this.duration > 0) {
4663
+ this.timer = setTimeout(function () {
4664
+ if (!_this.closed) {
4665
+ _this.close();
4666
+ }
4667
+ }, this.duration);
4668
+ }
4669
+ },
4670
+
4671
+ /**
4672
+ * 键盘事件处理
4673
+ * @param {KeyboardEvent} e - 键盘事件对象
4674
+ */
4675
+ keydown: function keydown(e) {
4676
+ if (e.keyCode === 46 || e.keyCode === 8) {
4677
+ this.clearTimer(); // detele 取消倒计时
4678
+ } else if (e.keyCode === 27) {
4679
+ // esc关闭消息
4680
+ if (!this.closed) {
4681
+ this.close();
4682
+ }
4683
+ } else {
4684
+ this.startTimer(); // 恢复倒计时
4685
+ }
4686
+ }
4687
+ },
4688
+ mounted: function mounted() {
4689
+ var _this2 = this;
4690
+
4691
+ if (this.duration > 0) {
4692
+ this.timer = setTimeout(function () {
4693
+ if (!_this2.closed) {
4694
+ _this2.close();
4695
+ }
4696
+ }, this.duration);
4697
+ }
4698
+ document.addEventListener('keydown', this.keydown);
4699
+ },
4700
+ beforeDestroy: function beforeDestroy() {
4701
+ document.removeEventListener('keydown', this.keydown);
4702
+ }
4703
+ });
4704
+ // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
4705
+ /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
4706
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
4707
+ var componentNormalizer = __webpack_require__(3);
4708
+
4709
+ // CONCATENATED MODULE: ./packages/notification/src/main.vue
4710
+
4711
+
4712
+
4713
+
4714
+
4715
+ /* normalize component */
4716
+
4717
+ var component = Object(componentNormalizer["a" /* default */])(
4718
+ src_mainvue_type_script_lang_js_,
4719
+ render,
4720
+ staticRenderFns,
4721
+ false,
4722
+ null,
4723
+ null,
4724
+ null
4725
+
4726
+ )
4727
+
4728
+ /* harmony default export */ var main = (component.exports);
4729
+ // EXTERNAL MODULE: ./src/utils/merge.js
4730
+ var merge = __webpack_require__(16);
4731
+
4732
+ // EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
4733
+ var popup = __webpack_require__(23);
4734
+
4735
+ // EXTERNAL MODULE: ./src/utils/vdom.js
4736
+ var vdom = __webpack_require__(85);
4737
+
4738
+ // CONCATENATED MODULE: ./packages/notification/src/main.js
5709
4739
  /**
5710
- * 日期加减天数
5711
- * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
5712
- * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
5713
- * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
5714
- */
5715
- const dateAddDays = function (start_date, days) {
5716
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
5717
- throw new Error(
5718
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
5719
- );
5720
- }
5721
-
5722
- const startDateObj = new Date(start_date);
5723
- if (isNaN(startDateObj.getTime())) {
5724
- throw new Error(
5725
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5726
- );
5727
- }
5728
-
5729
- const resultDateObj = new Date(startDateObj);
5730
- resultDateObj.setDate(resultDateObj.getDate() + days);
5731
-
5732
- const resultYear = resultDateObj.getFullYear();
5733
- const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
5734
- const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
5735
-
5736
- return `${resultYear}-${resultMonth}-${resultDay}`;
5737
- };
5738
-
4740
+ * 通知组件
4741
+ * @description 悬浮出现在页面角落,显示全局的通知提醒消息
4742
+ */
4743
+
4744
+
4745
+
4746
+
4747
+
4748
+ var NotificationConstructor = external_vue_default.a.extend(main);
4749
+
4750
+ var instance = void 0;
4751
+ var instances = [];
4752
+ var seed = 1;
4753
+
5739
4754
  /**
5740
- * 计算两个日期之间的差值
5741
- * @date 2023年12月14日
5742
- * @param {String} start_date - 起始日期字符串
5743
- * @param {String} end_date - 结束日期字符串
5744
- * @param {String} unit - 单位:year/month/day
5745
- * @returns {Number} 差值
5746
- */
5747
- const dateDiff = function (start_date, end_date, unit = 'day') {
5748
- // Assuming date strings are in "YYYY-MM-DD" format
5749
- var startDate = new Date(start_date);
5750
- var endDate = new Date(end_date);
5751
-
5752
- // If the date is invalid, return 0
5753
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
5754
- return 0;
5755
- }
5756
-
5757
- if (unit === 'year') {
5758
- return endDate.getFullYear() - startDate.getFullYear();
5759
- } else if (unit === 'month') {
5760
- return (
5761
- (endDate.getFullYear() - startDate.getFullYear()) * 12 +
5762
- (endDate.getMonth() - startDate.getMonth())
5763
- );
5764
- } else {
5765
- // Default to day
5766
- var timeDifference = endDate - startDate;
5767
- // Calculate days (86400000 milliseconds per day)
5768
- return Math.floor(timeDifference / 86400000);
5769
- }
5770
- };
5771
-
4755
+ * 创建通知
4756
+ * @param {Object} options - 通知配置项
4757
+ * @param {String} options.title - 标题
4758
+ * @param {String|Vue.VNode} options.message - 说明文字
4759
+ * @param {Boolean} options.dangerouslyUseHTMLString - 是否将message作为HTML片段处理
4760
+ * @param {String} options.type - 主题样式,可选值:success/warning/info/error
4761
+ * @param {String} options.iconClass - 自定义图标的类名
4762
+ * @param {String} options.customClass - 自定义类名
4763
+ * @param {Number} options.duration - 显示时间,毫秒,设为0则不会自动关闭
4764
+ * @param {String} options.position - 弹出位置,可选值:top-right/top-left/bottom-right/bottom-left
4765
+ * @param {Boolean} options.showClose - 是否显示关闭按钮
4766
+ * @param {Function} options.onClose - 关闭时的回调函数
4767
+ * @param {Function} options.onClick - 点击Notification时的回调函数
4768
+ * @param {Number} options.offset - 偏移的距离
4769
+ * @returns {Object} 通知实例
4770
+ */
4771
+ var main_Notification = function Notification(options) {
4772
+ if (external_vue_default.a.prototype.$isServer) return;
4773
+ options = Object(merge["a" /* default */])({}, options);
4774
+ var userOnClose = options.onClose;
4775
+ var id = 'notification_' + seed++;
4776
+ var position = options.position || 'top-right';
4777
+
4778
+ options.onClose = function () {
4779
+ Notification.close(id, userOnClose);
4780
+ };
4781
+
4782
+ instance = new NotificationConstructor({
4783
+ data: options
4784
+ });
4785
+
4786
+ if (Object(vdom["a" /* isVNode */])(options.message)) {
4787
+ instance.$slots.default = [options.message];
4788
+ options.message = 'REPLACED_BY_VNODE';
4789
+ }
4790
+ instance.id = id;
4791
+ instance.$mount();
4792
+ document.body.appendChild(instance.$el);
4793
+ instance.visible = true;
4794
+ instance.dom = instance.$el;
4795
+ instance.dom.style.zIndex = popup["a" /* PopupManager */].nextZIndex();
4796
+
4797
+ var verticalOffset = options.offset || 0;
4798
+ instances.filter(function (item) {
4799
+ return item.position === position;
4800
+ }).forEach(function (item) {
4801
+ verticalOffset += item.$el.offsetHeight + 16;
4802
+ });
4803
+ verticalOffset += 16;
4804
+ instance.verticalOffset = verticalOffset;
4805
+ instances.push(instance);
4806
+ return instance;
4807
+ };
4808
+
4809
+ ['success', 'warning', 'info', 'error'].forEach(function (type) {
4810
+ main_Notification[type] = function (options) {
4811
+ if (typeof options === 'string' || Object(vdom["a" /* isVNode */])(options)) {
4812
+ options = {
4813
+ message: options
4814
+ };
4815
+ }
4816
+ options.type = type;
4817
+ return main_Notification(options);
4818
+ };
4819
+ });
4820
+
5772
4821
  /**
5773
- * 获取月份中的日期
5774
- * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
5775
- * @returns {number} 月份中的日期(1-31)
5776
- */
5777
- const dayOfMonth = function (date) {
5778
- if (typeof date !== 'string') {
5779
- throw new Error(
5780
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
5781
- );
5782
- }
5783
-
5784
- const dateObj = new Date(date);
5785
- if (isNaN(dateObj.getTime())) {
5786
- throw new Error(
5787
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5788
- );
5789
- }
5790
-
5791
- return dateObj.getDate();
5792
- };
5793
-
4822
+ * 关闭指定通知
4823
+ * @param {String} id - 通知ID
4824
+ * @param {Function} userOnClose - 用户自定义关闭回调函数
4825
+ */
4826
+ main_Notification.close = function (id, userOnClose) {
4827
+ var index = -1;
4828
+ var len = instances.length;
4829
+ var instance = instances.filter(function (instance, i) {
4830
+ if (instance.id === id) {
4831
+ index = i;
4832
+ return true;
4833
+ }
4834
+ return false;
4835
+ })[0];
4836
+ if (!instance) return;
4837
+
4838
+ if (typeof userOnClose === 'function') {
4839
+ userOnClose(instance);
4840
+ }
4841
+ instances.splice(index, 1);
4842
+
4843
+ if (len <= 1) return;
4844
+ var position = instance.position;
4845
+ var removedHeight = instance.dom.offsetHeight;
4846
+ for (var i = index; i < len - 1; i++) {
4847
+ if (instances[i].position === position) {
4848
+ instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
4849
+ }
4850
+ }
4851
+ };
4852
+
5794
4853
  /**
5795
- * 获取当前日期
5796
- * @date 2022年5月7日
5797
- * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
5798
- * @returns {string} 当前日期的格式化字符串
5799
- */
5800
- const getCurrentDate = function (format = 'YYYY-MM-DD') {
5801
- return formatDate(new Date(), format);
5802
- };
5803
-
4854
+ * 关闭所有通知
4855
+ */
4856
+ main_Notification.closeAll = function () {
4857
+ for (var i = instances.length - 1; i >= 0; i--) {
4858
+ instances[i].close();
4859
+ }
4860
+ };
4861
+
4862
+ /* harmony default export */ var src_main = (main_Notification);
4863
+ // CONCATENATED MODULE: ./packages/notification/index.js
4864
+
4865
+ /* harmony default export */ var notification = __webpack_exports__["default"] = (src_main);
4866
+
4867
+ /***/ }),
4868
+
4869
+ /***/ 19:
4870
+ /***/ (function(module, exports) {
4871
+
4872
+ module.exports = require("eoss/lib/loading");
4873
+
4874
+ /***/ }),
4875
+
4876
+ /***/ 2:
4877
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4878
+
4879
+ "use strict";
4880
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
4881
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
4882
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
4883
+ /* unused harmony export setCookie */
4884
+ /* unused harmony export getCookie */
4885
+ 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; };
4886
+
4887
+ /**
4888
+ * setStorage
4889
+ * @desc:设置本地储存数据
4890
+ * @author huangbo
4891
+ * @date 2022年5月7日
4892
+ * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
4893
+ * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
4894
+ **/
4895
+ var setStorage = function setStorage(key, value) {
4896
+ // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
4897
+ var type = void 0,
4898
+ finalKey = void 0,
4899
+ finalValue = void 0;
4900
+
4901
+ if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
4902
+ // 对象调用方式:setStorage({type, key, value})
4903
+ type = key.type;
4904
+ finalKey = key.key;
4905
+ finalValue = key.value;
4906
+ } else {
4907
+ // 字符串调用方式:setStorage(key, value)
4908
+ type = getStorage('storageType');
4909
+ finalKey = key;
4910
+ finalValue = value;
4911
+ }
4912
+
4913
+ // 使用默认存储类型如果未指定
4914
+ type = type || getStorage('storageType');
4915
+
4916
+ // 获取存储对象
4917
+ var storage = type === 'localStorage' ? localStorage : sessionStorage;
4918
+
4919
+ // 处理不同类型的key
4920
+ if (typeof finalKey === 'string') {
4921
+ // 单个字符串key
4922
+ var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4923
+ storage.setItem(finalKey, storedValue);
4924
+ if (finalKey === 'token') {
4925
+ setCookie('token', storedValue);
4926
+ }
4927
+ } else if (Array.isArray(finalKey)) {
4928
+ // 数组key,为多个key设置同一个value
4929
+ var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4930
+ for (var i = 0; i < finalKey.length; i++) {
4931
+ storage.setItem(finalKey[i], _storedValue);
4932
+ if (finalKey[i] === 'token') {
4933
+ setCookie('token', _storedValue);
4934
+ }
4935
+ }
4936
+ } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
4937
+ // 对象key,对象的属性名称作为key,属性值作为value
4938
+ for (var k in finalKey) {
4939
+ if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
4940
+ var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
4941
+ storage.setItem(k, _storedValue2);
4942
+ if (k === 'token') {
4943
+ setCookie('token', _storedValue2);
4944
+ }
4945
+ }
4946
+ }
4947
+ }
4948
+ };
4949
+
4950
+ /**
4951
+ * getStorage
4952
+ * @desc:获取本地储存数据
4953
+ * @author huangbo
4954
+ * @date 2022年5月7日
4955
+ * @param {String} [key] - 获取的名称
4956
+ **/
4957
+ var getStorage = function getStorage(key) {
4958
+ if (key) {
4959
+ var res = sessionStorage.getItem(key) || localStorage.getItem(key);
4960
+ if (!res && key === 'token') {
4961
+ res = getCookie('token');
4962
+ }
4963
+ if (key === 'host' && !res) {
4964
+ res = '';
4965
+ }
4966
+ return res;
4967
+ }
4968
+ var defaults = {};
4969
+ var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
4970
+ var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
4971
+
4972
+ var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
4973
+ if (token) {
4974
+ defaults.Authorization = token;
4975
+ }
4976
+ if (ssId) {
4977
+ defaults.ssId = ssId;
4978
+ }
4979
+ if (deviceUnique) {
4980
+ defaults.deviceUnique = deviceUnique;
4981
+ }
4982
+ return defaults;
4983
+ };
4984
+
4985
+ /**
4986
+ * removeStorage
4987
+ * @desc:删除本地储存数据
4988
+ * @author huangbo
4989
+ * @date 2022年5月7日
4990
+ * @param {String, Array} [key] - 获取的名称
4991
+ **/
4992
+ var removeStorage = function removeStorage(key) {
4993
+ if (Array.isArray(key)) {
4994
+ for (var i = 0; i < key.length; i++) {
4995
+ sessionStorage.removeItem(key[i]);
4996
+ localStorage.removeItem(key[i]);
4997
+ if (key[i] === 'token') {
4998
+ removeCookie('token');
4999
+ }
5000
+ }
5001
+ } else if (key) {
5002
+ sessionStorage.removeItem(key);
5003
+ localStorage.removeItem(key);
5004
+ if (key === 'token') {
5005
+ removeCookie('token');
5006
+ }
5007
+ } else {
5008
+ sessionStorage.clear();
5009
+ localStorage.clear();
5010
+ removeCookie('token');
5011
+ }
5012
+ };
5013
+
5014
+ /**
5015
+ * setCookie
5016
+ * @desc 设置cookie
5017
+ * @author huangbo
5018
+ * @param {string} [name] cookie名称
5019
+ * @param {string} [value] cookie值
5020
+ * @param {boolean} [isSession] 是否是会话cookie
5021
+ **/
5022
+ var setCookie = function setCookie(name, value) {
5023
+ var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
5024
+ var time = arguments[3];
5025
+
5026
+ try {
5027
+ var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
5028
+ ];
5029
+ // 会话/持久Cookie设置
5030
+ if (!isSession) {
5031
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
5032
+ // IE使用expires
5033
+ var date = new Date();
5034
+ date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
5035
+ cookieParts.push('expires=' + date.toUTCString());
5036
+ } else {
5037
+ // 其他浏览器使用max-age
5038
+ cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
5039
+ }
5040
+ }
5041
+ // 内核兼容处理
5042
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
5043
+ // IE特殊处理:添加P3P协议头
5044
+ cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
5045
+ } else {
5046
+ // 现代浏览器设置
5047
+ cookieParts.push('samesite=lax');
5048
+ if (window.location.protocol === 'https:') {
5049
+ cookieParts.push('secure');
5050
+ }
5051
+ }
5052
+
5053
+ // 设置Cookie
5054
+ document.cookie = cookieParts.join('; ');
5055
+ return true;
5056
+ } catch (e) {
5057
+ console.error('Cookie设置失败:', e);
5058
+ return false;
5059
+ }
5060
+ };
5061
+
5062
+ /**
5063
+ * getCookie
5064
+ * @desc 获取cookie中指定名称的值
5065
+ * @author huangbo
5066
+ * @param {string} [name] cookie名称
5067
+ **/
5068
+ var getCookie = function getCookie(name) {
5069
+ var cookies = document.cookie.split(';');
5070
+ for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
5071
+ var _ref;
5072
+
5073
+ if (_isArray) {
5074
+ if (_i >= _iterator.length) break;
5075
+ _ref = _iterator[_i++];
5076
+ } else {
5077
+ _i = _iterator.next();
5078
+ if (_i.done) break;
5079
+ _ref = _i.value;
5080
+ }
5081
+
5082
+ var cookie = _ref;
5083
+
5084
+ var _cookie$trim$split = cookie.trim().split('='),
5085
+ cookieName = _cookie$trim$split[0],
5086
+ cookieValue = _cookie$trim$split[1];
5087
+
5088
+ if (decodeURIComponent(cookieName) === name) {
5089
+ return decodeURIComponent(cookieValue);
5090
+ }
5091
+ }
5092
+ return null;
5093
+ };
5094
+
5095
+ /**
5096
+ * removeCookie
5097
+ * @desc:删除cookie
5098
+ * @author huangbo
5099
+ * @date 2022年5月7日
5100
+ * @param {String, Array} [key] - 获取的名称
5101
+ **/
5102
+ var removeCookie = function removeCookie(key) {
5103
+ if (Array.isArray(key)) {
5104
+ for (var i = 0; i < key.length; i++) {
5105
+ document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5106
+ }
5107
+ } else {
5108
+ document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5109
+ }
5110
+ };
5111
+
5112
+ /***/ }),
5113
+
5114
+ /***/ 20:
5115
+ /***/ (function(module, exports) {
5116
+
5117
+ module.exports = require("lodash/get");
5118
+
5119
+ /***/ }),
5120
+
5121
+ /***/ 21:
5122
+ /***/ (function(module, exports) {
5123
+
5124
+ module.exports = require("lodash/set");
5125
+
5126
+ /***/ }),
5127
+
5128
+ /***/ 22:
5129
+ /***/ (function(module, exports) {
5130
+
5131
+ module.exports = require("lodash/cloneDeep");
5132
+
5133
+ /***/ }),
5134
+
5135
+ /***/ 23:
5136
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5137
+
5138
+ "use strict";
5139
+
5140
+ // EXPORTS
5141
+ __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
5142
+
5143
+ // EXTERNAL MODULE: external "vue"
5144
+ var external_vue_ = __webpack_require__(4);
5145
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
5146
+
5147
+ // EXTERNAL MODULE: ./src/utils/merge.js
5148
+ var merge = __webpack_require__(16);
5149
+
5150
+ // EXTERNAL MODULE: ./src/utils/dom.js
5151
+ var utils_dom = __webpack_require__(5);
5152
+
5153
+ // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
5154
+
5155
+
5156
+
5157
+ var hasModal = false;
5158
+ var hasInitZIndex = false;
5159
+ var popup_manager_zIndex = void 0;
5160
+
5161
+ var popup_manager_getModal = function getModal() {
5162
+ if (external_vue_default.a.prototype.$isServer) return;
5163
+ var modalDom = PopupManager.modalDom;
5164
+ if (modalDom) {
5165
+ hasModal = true;
5166
+ } else {
5167
+ hasModal = false;
5168
+ modalDom = document.createElement('div');
5169
+ PopupManager.modalDom = modalDom;
5170
+
5171
+ modalDom.addEventListener('touchmove', function (event) {
5172
+ event.preventDefault();
5173
+ event.stopPropagation();
5174
+ });
5175
+
5176
+ modalDom.addEventListener('click', function () {
5177
+ PopupManager.doOnModalClick && PopupManager.doOnModalClick();
5178
+ });
5179
+ }
5180
+
5181
+ return modalDom;
5182
+ };
5183
+
5184
+ var instances = {};
5185
+
5186
+ var PopupManager = {
5187
+ modalFade: true,
5188
+
5189
+ getInstance: function getInstance(id) {
5190
+ return instances[id];
5191
+ },
5192
+
5193
+ register: function register(id, instance) {
5194
+ if (id && instance) {
5195
+ instances[id] = instance;
5196
+ }
5197
+ },
5198
+
5199
+ deregister: function deregister(id) {
5200
+ if (id) {
5201
+ instances[id] = null;
5202
+ delete instances[id];
5203
+ }
5204
+ },
5205
+
5206
+ nextZIndex: function nextZIndex() {
5207
+ return PopupManager.zIndex++;
5208
+ },
5209
+
5210
+ modalStack: [],
5211
+
5212
+ doOnModalClick: function doOnModalClick() {
5213
+ var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
5214
+ if (!topItem) return;
5215
+
5216
+ var instance = PopupManager.getInstance(topItem.id);
5217
+ if (instance && instance.closeOnClickModal) {
5218
+ instance.close();
5219
+ }
5220
+ },
5221
+
5222
+ openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
5223
+ if (external_vue_default.a.prototype.$isServer) return;
5224
+ if (!id || zIndex === undefined) return;
5225
+ this.modalFade = modalFade;
5226
+
5227
+ var modalStack = this.modalStack;
5228
+
5229
+ for (var i = 0, j = modalStack.length; i < j; i++) {
5230
+ var item = modalStack[i];
5231
+ if (item.id === id) {
5232
+ return;
5233
+ }
5234
+ }
5235
+
5236
+ var modalDom = popup_manager_getModal();
5237
+
5238
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
5239
+ if (this.modalFade && !hasModal) {
5240
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
5241
+ }
5242
+ if (modalClass) {
5243
+ var classArr = modalClass.trim().split(/\s+/);
5244
+ classArr.forEach(function (item) {
5245
+ return Object(utils_dom["a" /* addClass */])(modalDom, item);
5246
+ });
5247
+ }
5248
+ setTimeout(function () {
5249
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
5250
+ }, 200);
5251
+
5252
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
5253
+ dom.parentNode.appendChild(modalDom);
5254
+ } else {
5255
+ document.body.appendChild(modalDom);
5256
+ }
5257
+
5258
+ if (zIndex) {
5259
+ modalDom.style.zIndex = zIndex;
5260
+ }
5261
+ modalDom.tabIndex = 0;
5262
+ modalDom.style.display = '';
5263
+
5264
+ this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
5265
+ },
5266
+
5267
+ closeModal: function closeModal(id) {
5268
+ var modalStack = this.modalStack;
5269
+ var modalDom = popup_manager_getModal();
5270
+ var topItem = null;
5271
+
5272
+ if (modalStack.length > 0) {
5273
+ topItem = modalStack[modalStack.length - 1];
5274
+ if (topItem.id === id) {
5275
+ modalStack.pop();
5276
+ if (modalStack.length > 0) {
5277
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
5278
+ }
5279
+ } else {
5280
+ for (var i = modalStack.length - 1; i >= 0; i--) {
5281
+ if (modalStack[i].id === id) {
5282
+ modalStack.splice(i, 1);
5283
+ break;
5284
+ }
5285
+ }
5286
+ }
5287
+ }
5288
+
5289
+ if (modalStack.length === 0) {
5290
+ if (this.modalFade) {
5291
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
5292
+ }
5293
+ setTimeout(function () {
5294
+ if (modalStack.length === 0) {
5295
+ if (topItem && topItem.modalClass) {
5296
+ var classArr = topItem.modalClass.trim().split(/\s+/);
5297
+ classArr.forEach(function (item) {
5298
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
5299
+ });
5300
+ }
5301
+ if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
5302
+ modalDom.style.display = 'none';
5303
+ PopupManager.modalDom = undefined;
5304
+ }
5305
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
5306
+ }, 200);
5307
+ } else {
5308
+ if (topItem && topItem.modalClass) {
5309
+ var classArr = topItem.modalClass.trim().split(/\s+/);
5310
+ classArr.forEach(function (item) {
5311
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
5312
+ });
5313
+ }
5314
+ }
5315
+ }
5316
+ };
5317
+
5318
+ Object.defineProperty(PopupManager, 'zIndex', {
5319
+ configurable: true,
5320
+ get: function get() {
5321
+ if (!hasInitZIndex) {
5322
+ if (!popup_manager_zIndex) {
5323
+ popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$EOSS || {}).zIndex || 2000;
5324
+ }
5325
+ hasInitZIndex = true;
5326
+ }
5327
+ return popup_manager_zIndex;
5328
+ },
5329
+ set: function set(value) {
5330
+ popup_manager_zIndex = value;
5331
+ }
5332
+ });
5333
+
5334
+ var popup_manager_getTopPopup = function getTopPopup() {
5335
+ if (external_vue_default.a.prototype.$isServer) return;
5336
+ if (PopupManager.modalStack.length > 0) {
5337
+ var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
5338
+ if (!topPopup) return;
5339
+ var instance = PopupManager.getInstance(topPopup.id);
5340
+
5341
+ return instance;
5342
+ }
5343
+ };
5344
+
5345
+ if (!external_vue_default.a.prototype.$isServer) {
5346
+ // handle `esc` key when the popup is shown
5347
+ window.addEventListener('keydown', function (event) {
5348
+ if (event.keyCode === 27) {
5349
+ var topPopup = popup_manager_getTopPopup();
5350
+
5351
+ if (topPopup && topPopup.closeOnPressEscape) {
5352
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
5353
+ }
5354
+ }
5355
+ });
5356
+ }
5357
+
5358
+ /* harmony default export */ var popup_manager = (PopupManager);
5359
+ // EXTERNAL MODULE: ./src/utils/scrollbar.js
5360
+ var scrollbar = __webpack_require__(15);
5361
+
5362
+ // CONCATENATED MODULE: ./src/utils/popup/index.js
5363
+
5364
+
5365
+
5366
+
5367
+
5368
+
5369
+ var idSeed = 1;
5370
+
5371
+ var scrollBarWidth = void 0;
5372
+
5373
+ /* harmony default export */ var popup = __webpack_exports__["b"] = ({
5374
+ props: {
5375
+ visible: {
5376
+ type: Boolean,
5377
+ default: false
5378
+ },
5379
+ openDelay: {},
5380
+ closeDelay: {},
5381
+ zIndex: {},
5382
+ modal: {
5383
+ type: Boolean,
5384
+ default: false
5385
+ },
5386
+ modalFade: {
5387
+ type: Boolean,
5388
+ default: true
5389
+ },
5390
+ modalClass: {},
5391
+ modalAppendToBody: {
5392
+ type: Boolean,
5393
+ default: false
5394
+ },
5395
+ lockScroll: {
5396
+ type: Boolean,
5397
+ default: true
5398
+ },
5399
+ closeOnPressEscape: {
5400
+ type: Boolean,
5401
+ default: false
5402
+ },
5403
+ closeOnClickModal: {
5404
+ type: Boolean,
5405
+ default: false
5406
+ },
5407
+ lazy: {
5408
+ type: Boolean,
5409
+ default: true
5410
+ }
5411
+ },
5412
+
5413
+ beforeMount: function beforeMount() {
5414
+ this._popupId = 'popup-' + idSeed++;
5415
+ popup_manager.register(this._popupId, this);
5416
+ },
5417
+ mounted: function mounted() {
5418
+ var _this = this;
5419
+
5420
+ // 监听组件的 'opened' 事件,在过渡动画完成后设置 rendered = true
5421
+ this.$on('opened', function () {
5422
+ _this.$nextTick(function () {
5423
+ _this.rendered = true;
5424
+ });
5425
+ });
5426
+ },
5427
+ beforeDestroy: function beforeDestroy() {
5428
+ popup_manager.deregister(this._popupId);
5429
+ popup_manager.closeModal(this._popupId);
5430
+
5431
+ this.restoreBodyStyle();
5432
+ },
5433
+ data: function data() {
5434
+ return {
5435
+ opened: false,
5436
+ bodyPaddingRight: null,
5437
+ computedBodyPaddingRight: 0,
5438
+ withoutHiddenClass: true,
5439
+ rendered: !this.lazy
5440
+ };
5441
+ },
5442
+
5443
+
5444
+ watch: {
5445
+ visible: function visible(val) {
5446
+ var _this2 = this;
5447
+
5448
+ if (val) {
5449
+ if (this._opening) return;
5450
+ if (!this.rendered) {
5451
+ external_vue_default.a.nextTick(function () {
5452
+ _this2.open();
5453
+ });
5454
+ } else {
5455
+ this.open();
5456
+ }
5457
+ } else {
5458
+ this.close();
5459
+ }
5460
+ }
5461
+ },
5462
+
5463
+ methods: {
5464
+ open: function open(options) {
5465
+ var _this3 = this;
5466
+
5467
+ var props = Object(merge["a" /* default */])({}, this.$props || this, options);
5468
+
5469
+ if (this._closeTimer) {
5470
+ clearTimeout(this._closeTimer);
5471
+ this._closeTimer = null;
5472
+ }
5473
+ clearTimeout(this._openTimer);
5474
+
5475
+ var openDelay = Number(props.openDelay);
5476
+ if (openDelay > 0) {
5477
+ this._openTimer = setTimeout(function () {
5478
+ _this3._openTimer = null;
5479
+ _this3.doOpen(props);
5480
+ }, openDelay);
5481
+ } else {
5482
+ this.doOpen(props);
5483
+ }
5484
+ },
5485
+ doOpen: function doOpen(props) {
5486
+ if (this.$isServer) return;
5487
+ if (this.willOpen && !this.willOpen()) return;
5488
+ if (this.opened) return;
5489
+
5490
+ this._opening = true;
5491
+
5492
+ var dom = this.$el;
5493
+
5494
+ var modal = props.modal;
5495
+
5496
+ var zIndex = props.zIndex;
5497
+ if (zIndex) {
5498
+ popup_manager.zIndex = zIndex;
5499
+ }
5500
+
5501
+ if (modal) {
5502
+ if (this._closing) {
5503
+ popup_manager.closeModal(this._popupId);
5504
+ this._closing = false;
5505
+ }
5506
+ popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
5507
+ if (props.lockScroll) {
5508
+ this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'es-popup-parent--hidden');
5509
+ if (this.withoutHiddenClass) {
5510
+ this.bodyPaddingRight = document.body.style.paddingRight;
5511
+ this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
5512
+ }
5513
+ scrollBarWidth = Object(scrollbar["b" /* getScrollbarWidth */])();
5514
+ var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
5515
+ var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
5516
+ if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
5517
+ document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
5518
+ }
5519
+ Object(utils_dom["a" /* addClass */])(document.body, 'es-popup-parent--hidden');
5520
+ }
5521
+ }
5522
+
5523
+ if (getComputedStyle(dom).position === 'static') {
5524
+ dom.style.position = 'absolute';
5525
+ }
5526
+
5527
+ dom.style.zIndex = popup_manager.nextZIndex();
5528
+ this.opened = true;
5529
+
5530
+ this.onOpen && this.onOpen();
5531
+
5532
+ this.doAfterOpen();
5533
+ },
5534
+ doAfterOpen: function doAfterOpen() {
5535
+ this._opening = false;
5536
+ },
5537
+ close: function close() {
5538
+ var _this4 = this;
5539
+
5540
+ if (this.willClose && !this.willClose()) return;
5541
+
5542
+ if (this._openTimer !== null) {
5543
+ clearTimeout(this._openTimer);
5544
+ this._openTimer = null;
5545
+ }
5546
+ clearTimeout(this._closeTimer);
5547
+
5548
+ var closeDelay = Number(this.closeDelay);
5549
+
5550
+ if (closeDelay > 0) {
5551
+ this._closeTimer = setTimeout(function () {
5552
+ _this4._closeTimer = null;
5553
+ _this4.doClose();
5554
+ }, closeDelay);
5555
+ } else {
5556
+ this.doClose();
5557
+ }
5558
+ },
5559
+ doClose: function doClose() {
5560
+ this._closing = true;
5561
+
5562
+ this.onClose && this.onClose();
5563
+
5564
+ if (this.lockScroll) {
5565
+ setTimeout(this.restoreBodyStyle, 200);
5566
+ }
5567
+
5568
+ this.opened = false;
5569
+
5570
+ this.doAfterClose();
5571
+ },
5572
+ doAfterClose: function doAfterClose() {
5573
+ popup_manager.closeModal(this._popupId);
5574
+ this._closing = false;
5575
+ },
5576
+ restoreBodyStyle: function restoreBodyStyle() {
5577
+ if (this.modal && this.withoutHiddenClass) {
5578
+ document.body.style.paddingRight = this.bodyPaddingRight;
5579
+ Object(utils_dom["i" /* removeClass */])(document.body, 'es-popup-parent--hidden');
5580
+ }
5581
+ this.withoutHiddenClass = true;
5582
+ }
5583
+ }
5584
+ });
5585
+
5586
+
5587
+
5588
+ /***/ }),
5589
+
5590
+ /***/ 3:
5591
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5592
+
5593
+ "use strict";
5594
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
5595
+ /* globals __VUE_SSR_CONTEXT__ */
5596
+
5597
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
5598
+ // This module is a runtime utility for cleaner component module output and will
5599
+ // be included in the final webpack user bundle.
5600
+
5601
+ function normalizeComponent(
5602
+ scriptExports,
5603
+ render,
5604
+ staticRenderFns,
5605
+ functionalTemplate,
5606
+ injectStyles,
5607
+ scopeId,
5608
+ moduleIdentifier /* server only */,
5609
+ shadowMode /* vue-cli only */
5610
+ ) {
5611
+ // Vue.extend constructor export interop
5612
+ var options =
5613
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
5614
+
5615
+ // render functions
5616
+ if (render) {
5617
+ options.render = render
5618
+ options.staticRenderFns = staticRenderFns
5619
+ options._compiled = true
5620
+ }
5621
+
5622
+ // functional template
5623
+ if (functionalTemplate) {
5624
+ options.functional = true
5625
+ }
5626
+
5627
+ // scopedId
5628
+ if (scopeId) {
5629
+ options._scopeId = 'data-v-' + scopeId
5630
+ }
5631
+
5632
+ var hook
5633
+ if (moduleIdentifier) {
5634
+ // server build
5635
+ hook = function (context) {
5636
+ // 2.3 injection
5637
+ context =
5638
+ context || // cached call
5639
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
5640
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
5641
+ // 2.2 with runInNewContext: true
5642
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
5643
+ context = __VUE_SSR_CONTEXT__
5644
+ }
5645
+ // inject component styles
5646
+ if (injectStyles) {
5647
+ injectStyles.call(this, context)
5648
+ }
5649
+ // register component module identifier for async chunk inferrence
5650
+ if (context && context._registeredComponents) {
5651
+ context._registeredComponents.add(moduleIdentifier)
5652
+ }
5653
+ }
5654
+ // used by ssr in case component is cached and beforeCreate
5655
+ // never gets called
5656
+ options._ssrRegister = hook
5657
+ } else if (injectStyles) {
5658
+ hook = shadowMode
5659
+ ? function () {
5660
+ injectStyles.call(
5661
+ this,
5662
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
5663
+ )
5664
+ }
5665
+ : injectStyles
5666
+ }
5667
+
5668
+ if (hook) {
5669
+ if (options.functional) {
5670
+ // for template-only hot-reload because in that case the render fn doesn't
5671
+ // go through the normalizer
5672
+ options._injectStyles = hook
5673
+ // register for functional component in vue file
5674
+ var originalRender = options.render
5675
+ options.render = function renderWithStyleInjection(h, context) {
5676
+ hook.call(context)
5677
+ return originalRender(h, context)
5678
+ }
5679
+ } else {
5680
+ // inject component registration as beforeCreate hook
5681
+ var existing = options.beforeCreate
5682
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
5683
+ }
5684
+ }
5685
+
5686
+ return {
5687
+ exports: scriptExports,
5688
+ options: options
5689
+ }
5690
+ }
5691
+
5692
+
5693
+ /***/ }),
5694
+
5695
+ /***/ 4:
5696
+ /***/ (function(module, exports) {
5697
+
5698
+ module.exports = require("vue");
5699
+
5700
+ /***/ }),
5701
+
5702
+ /***/ 5:
5703
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5704
+
5705
+ "use strict";
5706
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
5707
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
5708
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
5709
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
5710
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
5711
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
5712
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
5713
+ /* unused harmony export setStyle */
5714
+ /* unused harmony export isScroll */
5715
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
5716
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
5717
+ /* unused harmony export insertAfter */
5718
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
5719
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
5720
+ 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; };
5721
+
5722
+ /* istanbul ignore next */
5723
+
5724
+
5725
+
5726
+ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
5727
+ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
5728
+ var MOZ_HACK_REGEXP = /^moz([A-Z])/;
5729
+ var ieVersion = isServer ? 0 : Number(document.documentMode);
5730
+
5731
+ /* istanbul ignore next */
5732
+ var trim = function trim(string) {
5733
+ return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
5734
+ };
5735
+ /* istanbul ignore next */
5736
+ var camelCase = function camelCase(name) {
5737
+ return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
5738
+ return offset ? letter.toUpperCase() : letter;
5739
+ }).replace(MOZ_HACK_REGEXP, 'Moz$1');
5740
+ };
5741
+
5742
+ /* istanbul ignore next */
5743
+ var on = function () {
5744
+ if (!isServer && document.addEventListener) {
5745
+ return function (element, event, handler) {
5746
+ if (element && event && handler) {
5747
+ element.addEventListener(event, handler, false);
5748
+ }
5749
+ };
5750
+ } else {
5751
+ return function (element, event, handler) {
5752
+ if (element && event && handler) {
5753
+ element.attachEvent('on' + event, handler);
5754
+ }
5755
+ };
5756
+ }
5757
+ }();
5758
+
5759
+ /* istanbul ignore next */
5760
+ var off = function () {
5761
+ if (!isServer && document.removeEventListener) {
5762
+ return function (element, event, handler) {
5763
+ if (element && event) {
5764
+ element.removeEventListener(event, handler, false);
5765
+ }
5766
+ };
5767
+ } else {
5768
+ return function (element, event, handler) {
5769
+ if (element && event) {
5770
+ element.detachEvent('on' + event, handler);
5771
+ }
5772
+ };
5773
+ }
5774
+ }();
5775
+
5776
+ /* istanbul ignore next */
5777
+ var once = function once(el, event, fn) {
5778
+ var listener = function listener() {
5779
+ if (fn) {
5780
+ fn.apply(this, arguments);
5781
+ }
5782
+ off(el, event, listener);
5783
+ };
5784
+ on(el, event, listener);
5785
+ };
5786
+
5787
+ /* istanbul ignore next */
5788
+ function hasClass(el, cls) {
5789
+ if (!el || !cls) return false;
5790
+ if (cls.indexOf(' ') !== -1) {
5791
+ throw new Error('className should not contain space.');
5792
+ }
5793
+ if (el.classList) {
5794
+ return el.classList.contains(cls);
5795
+ } else {
5796
+ return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
5797
+ }
5798
+ }
5799
+
5800
+ /* istanbul ignore next */
5801
+ function addClass(el, cls) {
5802
+ if (!el) return;
5803
+ var curClass = el.className;
5804
+ var classes = (cls || '').split(' ');
5805
+
5806
+ for (var i = 0, j = classes.length; i < j; i++) {
5807
+ var clsName = classes[i];
5808
+ if (!clsName) continue;
5809
+
5810
+ if (el.classList) {
5811
+ el.classList.add(clsName);
5812
+ } else if (!hasClass(el, clsName)) {
5813
+ curClass += ' ' + clsName;
5814
+ }
5815
+ }
5816
+ if (!el.classList) {
5817
+ el.className = curClass;
5818
+ }
5819
+ }
5820
+
5821
+ /* istanbul ignore next */
5822
+ function removeClass(el, cls) {
5823
+ if (!el || !cls) return;
5824
+ var classes = cls.split(' ');
5825
+ var curClass = ' ' + el.className + ' ';
5826
+
5827
+ for (var i = 0, j = classes.length; i < j; i++) {
5828
+ var clsName = classes[i];
5829
+ if (!clsName) continue;
5830
+
5831
+ if (el.classList) {
5832
+ el.classList.remove(clsName);
5833
+ } else if (hasClass(el, clsName)) {
5834
+ curClass = curClass.replace(' ' + clsName + ' ', ' ');
5835
+ }
5836
+ }
5837
+ if (!el.classList) {
5838
+ el.className = trim(curClass);
5839
+ }
5840
+ }
5841
+
5842
+ /* istanbul ignore next */
5843
+ var getStyle = ieVersion < 9 ? function (element, styleName) {
5844
+ if (isServer) return;
5845
+ if (!element || !styleName) return null;
5846
+ styleName = camelCase(styleName);
5847
+ if (styleName === 'float') {
5848
+ styleName = 'styleFloat';
5849
+ }
5850
+ try {
5851
+ switch (styleName) {
5852
+ case 'opacity':
5853
+ try {
5854
+ return element.filters.item('alpha').opacity / 100;
5855
+ } catch (e) {
5856
+ return 1.0;
5857
+ }
5858
+ default:
5859
+ return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
5860
+ }
5861
+ } catch (e) {
5862
+ return element.style[styleName];
5863
+ }
5864
+ } : function (element, styleName) {
5865
+ if (isServer) return;
5866
+ if (!element || !styleName) return null;
5867
+ styleName = camelCase(styleName);
5868
+ if (styleName === 'float') {
5869
+ styleName = 'cssFloat';
5870
+ }
5871
+ try {
5872
+ var computed = document.defaultView.getComputedStyle(element, '');
5873
+ return element.style[styleName] || computed ? computed[styleName] : null;
5874
+ } catch (e) {
5875
+ return element.style[styleName];
5876
+ }
5877
+ };
5878
+
5879
+ /* istanbul ignore next */
5880
+ function setStyle(element, styleName, value) {
5881
+ if (!element || !styleName) return;
5882
+
5883
+ if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
5884
+ for (var prop in styleName) {
5885
+ if (styleName.hasOwnProperty(prop)) {
5886
+ setStyle(element, prop, styleName[prop]);
5887
+ }
5888
+ }
5889
+ } else {
5890
+ styleName = camelCase(styleName);
5891
+ if (styleName === 'opacity' && ieVersion < 9) {
5892
+ element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
5893
+ } else {
5894
+ element.style[styleName] = value;
5895
+ }
5896
+ }
5897
+ }
5898
+
5899
+ var isScroll = function isScroll(el, vertical) {
5900
+ if (isServer) return;
5901
+
5902
+ var determinedDirection = vertical !== null || vertical !== undefined;
5903
+ var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
5904
+
5905
+ return overflow.match(/(scroll|auto)/);
5906
+ };
5907
+
5908
+ var getScrollContainer = function getScrollContainer(el, vertical) {
5909
+ if (isServer) return;
5910
+
5911
+ var parent = el;
5912
+ while (parent) {
5913
+ if ([window, document, document.documentElement].includes(parent)) {
5914
+ return window;
5915
+ }
5916
+ if (isScroll(parent, vertical)) {
5917
+ return parent;
5918
+ }
5919
+ parent = parent.parentNode;
5920
+ }
5921
+
5922
+ return parent;
5923
+ };
5924
+
5925
+ var isInContainer = function isInContainer(el, container) {
5926
+ if (isServer || !el || !container) return false;
5927
+
5928
+ var elRect = el.getBoundingClientRect();
5929
+ var containerRect = void 0;
5930
+
5931
+ if ([window, document, document.documentElement, null, undefined].includes(container)) {
5932
+ containerRect = {
5933
+ top: 0,
5934
+ right: window.innerWidth,
5935
+ bottom: window.innerHeight,
5936
+ left: 0
5937
+ };
5938
+ } else {
5939
+ containerRect = container.getBoundingClientRect();
5940
+ }
5941
+
5942
+ return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
5943
+ };
5944
+
5804
5945
  /**
5805
- * 获取当前日期时间
5806
- * @date 2022年5月7日
5807
- * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
5808
- * @returns {string} 当前日期时间的格式化字符串
5809
- */
5810
- const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
5811
- return formatDate(new Date(), format);
5812
- };
5813
-
5946
+ * 在元素前插入元素
5947
+ * @param {HTMLElement} newEl 新DOM元素
5948
+ * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
5949
+ */
5950
+ function insertAfter(newEl, targetEl) {
5951
+ var parentEl = targetEl.parentNode;
5952
+ if (parentEl.lastChild === targetEl) {
5953
+ parentEl.appendChild(newEl);
5954
+ } else {
5955
+ parentEl.insertBefore(newEl, targetEl.nextSibling);
5956
+ }
5957
+ }
5958
+
5959
+ /***/ }),
5960
+
5961
+ /***/ 6:
5962
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5963
+
5964
+ "use strict";
5965
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
5966
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
5967
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
5968
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
5969
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
5970
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
5814
5971
  /**
5815
- * 获取小时
5816
- * @date 2022年5月7日
5817
- * @param {Date|string} [date] - 日期对象或日期字符串
5818
- * @returns {number} 小时数(0-23)
5819
- */
5820
- const getHour = function (date) {
5821
- if (!date) {
5822
- return new Date().getHours();
5823
- }
5824
- if (typeof date === 'string') {
5825
- date = new Date(date);
5826
- }
5827
- return date.getHours();
5828
- };
5829
-
5972
+ * 检查一个值是否为字符串类型
5973
+ * @param {*} obj 要检查的值
5974
+ * @returns {boolean} 如果值为字符串则返回true,否则返回false
5975
+ */
5976
+ function isString(obj) {
5977
+ return Object.prototype.toString.call(obj) === '[object String]';
5978
+ }
5979
+
5830
5980
  /**
5831
- * 获取分钟
5832
- * @date 2022年5月7日
5833
- * @param {Date|string} [date] - 日期对象或日期字符串
5834
- * @returns {number} 分钟数(0-59)
5835
- */
5836
- const getMinute = function (date) {
5837
- if (!date) {
5838
- return new Date().getMinutes();
5839
- }
5840
- if (typeof date === 'string') {
5841
- date = new Date(date);
5842
- }
5843
- return date.getMinutes();
5844
- };
5845
-
5981
+ * 检查一个值是否为对象类型
5982
+ * @param {*} obj 要检查的值
5983
+ * @returns {boolean} 如果值为对象则返回true,否则返回false
5984
+ */
5985
+ function isObject(obj) {
5986
+ return Object.prototype.toString.call(obj) === '[object Object]';
5987
+ }
5988
+
5846
5989
  /**
5847
- * 获取月份
5848
- * @date 2022年5月7日
5849
- * @param {Date|string} [date] - 日期对象或日期字符串
5850
- * @returns {number} 月份数(1-12)
5851
- */
5852
- const getMonth = function (date) {
5853
- if (!date) {
5854
- return new Date().getMonth() + 1;
5855
- }
5856
- if (typeof date === 'string') {
5857
- date = new Date(date);
5858
- }
5859
- return date.getMonth() + 1;
5860
- };
5861
-
5990
+ * 检查一个节点是否为HTML元素
5991
+ * @param {Node} node 要检查的节点
5992
+ * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
5993
+ */
5994
+ function isHtmlElement(node) {
5995
+ return node && node.nodeType === Node.ELEMENT_NODE;
5996
+ }
5997
+
5862
5998
  /**
5863
- * 获取秒
5864
- * @date 2022年5月7日
5865
- * @param {Date|string} [date] - 日期对象或日期字符串
5866
- * @returns {number} 秒数(0-59)
5867
- */
5868
- const getSecond = function (date) {
5869
- if (!date) {
5870
- return new Date().getSeconds();
5871
- }
5872
- if (typeof date === 'string') {
5873
- date = new Date(date);
5874
- }
5875
- return date.getSeconds();
5876
- };
5877
-
5999
+ * 检查一个值是否为函数类型
6000
+ * @param {*} functionToCheck 要检查的值
6001
+ * @returns {boolean} 如果值为函数则返回true,否则返回false
6002
+ */
6003
+ function isFunction(functionToCheck) {
6004
+ var getType = {};
6005
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
6006
+ }
6007
+
5878
6008
  /**
5879
- * 获取星期几
5880
- * @date 2022年5月7日
5881
- * @param {Date|string} [date] - 日期对象或日期字符串
5882
- * @returns {number} 星期几(0-6,0表示星期日)
5883
- */
5884
- const getWeekday = function (date) {
5885
- if (!date) {
5886
- return new Date().getDay();
5887
- }
5888
- if (typeof date === 'string') {
5889
- date = new Date(date);
5890
- }
5891
- return date.getDay();
5892
- };
5893
-
5894
-
6009
+ * 检查一个值是否为undefined
6010
+ * @param {*} val 要检查的值
6011
+ * @returns {boolean} 如果值为undefined则返回true,否则返回false
6012
+ */
6013
+ function isUndefined(val) {
6014
+ return val === void 0;
6015
+ }
6016
+
5895
6017
  /**
5896
- * @desc 获取上午/下午/晚上
5897
- * @author huangbo
5898
- * @date 2022年5月7日
5899
- * @param {String} [time] - 时间
5900
- **/
5901
- const timeCycle = function (time) {
5902
- let hour = 0;
5903
- if (!time) {
5904
- hour = new Date().getHours();
5905
- } else if (typeof time === 'string') {
5906
- // 从时间字符串中提取小时
5907
- const match = time.match(/^(\d{1,2})/);
5908
- if (match) {
5909
- hour = parseInt(match[1], 10);
5910
- }
5911
- } else if (typeof time === 'number') {
5912
- hour = time;
5913
- }
5914
- // 判断时间段
5915
- if (hour >= 5 && hour < 12) {
5916
- return '上午';
5917
- } else if (hour >= 12 && hour < 18) {
5918
- return '下午';
5919
- } else {
5920
- return '晚上';
5921
- }
5922
- };
6018
+ * 检查一个值是否已定义(不是undefined或null)
6019
+ * @param {*} val 要检查的值
6020
+ * @returns {boolean} 如果值已定义则返回true,否则返回false
6021
+ */
6022
+ function isDefined(val) {
6023
+ return val !== undefined && val !== null;
6024
+ }
6025
+
6026
+ /***/ }),
6027
+
6028
+ /***/ 8:
6029
+ /***/ (function(module, exports) {
6030
+
6031
+ module.exports = require("eoss/lib/message-box");
5923
6032
 
5924
6033
  /***/ }),
5925
6034
 
5926
- /***/ 64:
6035
+ /***/ 85:
5927
6036
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5928
6037
 
5929
6038
  "use strict";
@@ -5942,13 +6051,6 @@ function isVNode(node) {
5942
6051
  return node !== null && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "x"])(node, 'componentOptions');
5943
6052
  }
5944
6053
 
5945
- /***/ }),
5946
-
5947
- /***/ 8:
5948
- /***/ (function(module, exports) {
5949
-
5950
- module.exports = require("eoss/lib/message-box");
5951
-
5952
6054
  /***/ })
5953
6055
 
5954
6056
  /******/ });