eoss 0.1.0-alpha.25 → 0.1.0-alpha.26

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 (254) hide show
  1. package/lib/0.js +1 -1
  2. package/lib/1.js +1 -1
  3. package/lib/10.js +1 -1
  4. package/lib/11.js +1 -1
  5. package/lib/12.js +1 -1
  6. package/lib/13.js +1 -1
  7. package/lib/14.js +1 -1
  8. package/lib/15.js +1 -1
  9. package/lib/16.js +1 -1
  10. package/lib/17.js +1 -1
  11. package/lib/18.js +1 -1
  12. package/lib/19.js +1 -1
  13. package/lib/20.js +1 -1
  14. package/lib/21.js +1 -1
  15. package/lib/22.js +1 -1
  16. package/lib/23.js +1 -1
  17. package/lib/24.js +1 -1
  18. package/lib/25.js +1 -1
  19. package/lib/26.js +1 -1
  20. package/lib/27.js +1 -1
  21. package/lib/28.js +1 -1
  22. package/lib/29.js +1 -1
  23. package/lib/3.js +1 -1
  24. package/lib/30.js +1 -1
  25. package/lib/31.js +1 -1
  26. package/lib/32.js +1 -1
  27. package/lib/33.js +1 -1
  28. package/lib/34.js +1 -1
  29. package/lib/35.js +1 -1
  30. package/lib/36.js +1 -1
  31. package/lib/37.js +1 -1
  32. package/lib/38.js +1 -1
  33. package/lib/39.js +1 -1
  34. package/lib/4.js +1 -1
  35. package/lib/40.js +1 -1
  36. package/lib/41.js +1 -1
  37. package/lib/42.js +1 -1
  38. package/lib/43.js +1 -1
  39. package/lib/44.js +1 -1
  40. package/lib/45.js +1 -1
  41. package/lib/46.js +1 -1
  42. package/lib/47.js +1 -1
  43. package/lib/48.js +1 -1
  44. package/lib/49.js +1 -1
  45. package/lib/5.js +1 -1
  46. package/lib/50.js +1 -1
  47. package/lib/51.js +1 -1
  48. package/lib/52.js +1 -1
  49. package/lib/53.js +1 -1
  50. package/lib/54.js +1 -1
  51. package/lib/55.js +1 -1
  52. package/lib/56.js +1 -1
  53. package/lib/57.js +1 -1
  54. package/lib/58.js +1 -1
  55. package/lib/59.js +1 -1
  56. package/lib/6.js +1 -1
  57. package/lib/60.js +1 -1
  58. package/lib/61.js +1 -1
  59. package/lib/62.js +1 -1
  60. package/lib/63.js +1 -1
  61. package/lib/64.js +1 -1
  62. package/lib/65.js +1 -1
  63. package/lib/66.js +1 -1
  64. package/lib/67.js +1 -1
  65. package/lib/68.js +1 -1
  66. package/lib/69.js +1 -1
  67. package/lib/7.js +1 -1
  68. package/lib/70.js +1 -1
  69. package/lib/71.js +1 -1
  70. package/lib/72.js +1 -1
  71. package/lib/73.js +1 -1
  72. package/lib/74.js +1 -1
  73. package/lib/75.js +1 -1
  74. package/lib/76.js +1 -1
  75. package/lib/77.js +1 -1
  76. package/lib/78.js +1 -1
  77. package/lib/79.js +1 -1
  78. package/lib/8.js +1 -1
  79. package/lib/80.js +1 -1
  80. package/lib/81.js +1 -1
  81. package/lib/9.js +1 -1
  82. package/lib/account-login.js +1000 -971
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +75 -71
  86. package/lib/autocomplete.js +2136 -1951
  87. package/lib/avatar.js +2 -2
  88. package/lib/backtop.js +2 -2
  89. package/lib/badge.js +2 -2
  90. package/lib/breadcrumb-item.js +4 -4
  91. package/lib/breadcrumb.js +4 -4
  92. package/lib/button-group.js +12 -12
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +913 -888
  95. package/lib/calendar.js +872 -847
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +905 -880
  98. package/lib/carousel.js +1042 -1017
  99. package/lib/cascader-panel.js +926 -901
  100. package/lib/cascader.js +2022 -1837
  101. package/lib/checkbox-button.js +2 -2
  102. package/lib/checkbox-group.js +1000 -971
  103. package/lib/checkbox.js +2 -2
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +2174 -1980
  106. package/lib/collapse.js +2175 -1980
  107. package/lib/color-picker.js +1112 -952
  108. package/lib/config/api.js +3 -0
  109. package/lib/container.js +2 -2
  110. package/lib/cron.js +2 -2
  111. package/lib/data-table.js +1007 -978
  112. package/lib/date-picker.js +2142 -1957
  113. package/lib/dialog.js +910 -885
  114. package/lib/divider.js +2 -2
  115. package/lib/drawer.js +2 -2
  116. package/lib/dropdown-item.js +4 -4
  117. package/lib/dropdown-menu.js +1104 -944
  118. package/lib/dropdown.js +925 -900
  119. package/lib/email-login.js +999 -970
  120. package/lib/empty.js +2 -2
  121. package/lib/eoss.common.js +8751 -4166
  122. package/lib/flip.js +2 -2
  123. package/lib/flow-group.js +906 -881
  124. package/lib/flow.js +1112 -1083
  125. package/lib/flows.js +1010 -981
  126. package/lib/footer.js +2 -2
  127. package/lib/form-item.js +909 -884
  128. package/lib/form.js +2185 -1986
  129. package/lib/guide.js +620 -0
  130. package/lib/header.js +2 -2
  131. package/lib/icon.js +981 -952
  132. package/lib/icons.js +2 -2
  133. package/lib/image-viewer.js +907 -882
  134. package/lib/image.js +4 -4
  135. package/lib/index.js +1 -1
  136. package/lib/infinite-scroll.js +2 -2
  137. package/lib/input-number.js +4 -4
  138. package/lib/input.js +910 -885
  139. package/lib/link.js +2 -2
  140. package/lib/loading.js +2 -2
  141. package/lib/login.js +1027 -998
  142. package/lib/lowcode.js +17336 -13510
  143. package/lib/main.js +14933 -14625
  144. package/lib/marquee.js +907 -882
  145. package/lib/menu-item-group.js +2 -2
  146. package/lib/menu-item.js +2 -2
  147. package/lib/menu.js +2011 -1826
  148. package/lib/message-box.js +923 -898
  149. package/lib/message.js +911 -886
  150. package/lib/notification.js +911 -886
  151. package/lib/option-group.js +2 -2
  152. package/lib/option.js +907 -882
  153. package/lib/page-header.js +2 -2
  154. package/lib/pagination.js +910 -885
  155. package/lib/phone-login.js +998 -969
  156. package/lib/popconfirm.js +12 -12
  157. package/lib/popover.js +2009 -1824
  158. package/lib/process-config.js +1015 -986
  159. package/lib/process-module.js +1001 -972
  160. package/lib/process-rule.js +1019 -990
  161. package/lib/progress.js +5 -5
  162. package/lib/qr-code.js +4 -4
  163. package/lib/qrcode-login.js +1057 -1028
  164. package/lib/radio-button.js +2 -2
  165. package/lib/radio-group.js +998 -969
  166. package/lib/radio.js +2 -2
  167. package/lib/rate.js +907 -882
  168. package/lib/row.js +2 -2
  169. package/lib/scrollbar.js +904 -879
  170. package/lib/select.js +2135 -1945
  171. package/lib/selector-panel.js +1009 -980
  172. package/lib/selector.js +1001 -972
  173. package/lib/slider.js +2 -2
  174. package/lib/step.js +2172 -1977
  175. package/lib/steps.js +907 -882
  176. package/lib/submenu.js +1119 -959
  177. package/lib/switch.js +907 -882
  178. package/lib/tab-pane.js +2 -2
  179. package/lib/table-column.js +906 -881
  180. package/lib/table.js +2236 -2047
  181. package/lib/tabs.js +911 -886
  182. package/lib/tag.js +2 -2
  183. package/lib/theme-chalk/base.css +1 -1
  184. package/lib/theme-chalk/guide.css +1 -0
  185. package/lib/theme-chalk/icon.css +1 -1
  186. package/lib/theme-chalk/index.css +1 -1
  187. package/lib/theme-chalk/lowcode-view.css +1 -0
  188. package/lib/theme-chalk/lowcode.css +1 -1
  189. package/lib/theme-chalk/main.css +1 -1
  190. package/lib/theme-chalk/pagination.css +1 -1
  191. package/lib/theme-chalk/select-dropdown.css +1 -1
  192. package/lib/theme-chalk/select.css +1 -1
  193. package/lib/theme-chalk/wujie.css +1 -0
  194. package/lib/time-picker.js +1977 -1792
  195. package/lib/time-select.js +1978 -1793
  196. package/lib/timeline-item.js +2 -2
  197. package/lib/timeline.js +2 -2
  198. package/lib/tips.js +998 -969
  199. package/lib/toolbar.js +2 -2
  200. package/lib/tooltip.js +2006 -1821
  201. package/lib/transfer.js +916 -891
  202. package/lib/tree-group.js +978 -949
  203. package/lib/tree.js +999 -970
  204. package/lib/update-history.js +76 -72
  205. package/lib/upload.js +1028 -999
  206. package/lib/utils/frame.js +133 -0
  207. package/lib/wujie.js +5037 -0
  208. package/package.json +3 -2
  209. package/packages/cascader/src/cascader.vue +1 -1
  210. package/packages/date-picker/src/picker.vue +1 -1
  211. package/packages/form/src/form-item-render.vue +10 -6
  212. package/packages/guide/index.js +8 -0
  213. package/packages/guide/src/directive.js +47 -0
  214. package/packages/guide/src/guide.vue +89 -0
  215. package/packages/guide/src/manager.js +133 -0
  216. package/packages/input/src/input.vue +1 -1
  217. package/packages/lowcode/src/aside.vue +41 -8
  218. package/packages/lowcode/src/attribute/bind.vue +2 -4
  219. package/packages/lowcode/src/attribute/dependency.vue +3 -16
  220. package/packages/lowcode/src/attribute/function.vue +2 -4
  221. package/packages/lowcode/src/attribute/property.vue +3 -15
  222. package/packages/lowcode/src/attribute/styles.vue +105 -11
  223. package/packages/lowcode/src/attribute.vue +5 -35
  224. package/packages/lowcode/src/canvas.vue +223 -97
  225. package/packages/lowcode/src/iframe.vue +60 -0
  226. package/packages/lowcode/src/lowcode.vue +32 -8
  227. package/packages/lowcode/src/pages.vue +1 -1
  228. package/packages/lowcode/src/render.vue +312 -70
  229. package/packages/lowcode/src/util/source-generator.js +7 -11
  230. package/packages/lowcode/src/util/source-parser.js +1 -1
  231. package/packages/lowcode-view/index.js +1 -1
  232. package/packages/lowcode-view/src/Iframe.vue +55 -0
  233. package/packages/lowcode-view/src/Modulels.vue +239 -0
  234. package/packages/lowcode-view/src/render.vue +337 -0
  235. package/packages/lowcode-view/src/view.vue +763 -0
  236. package/packages/main/src/components/pages.vue +11 -2
  237. package/packages/main/src/event-center.js +160 -0
  238. package/packages/main/src/minxs.js +60 -90
  239. package/packages/progress/src/progress.vue +1 -1
  240. package/packages/select/src/select.vue +2 -1
  241. package/packages/theme-chalk/src/common/var.scss +34 -10
  242. package/packages/theme-chalk/src/guide.scss +93 -0
  243. package/packages/theme-chalk/src/icon.scss +425 -426
  244. package/packages/theme-chalk/src/index.scss +2 -0
  245. package/packages/theme-chalk/src/lowcode-view.scss +288 -0
  246. package/packages/theme-chalk/src/lowcode.scss +11 -1
  247. package/packages/theme-chalk/src/select-dropdown.scss +1 -1
  248. package/packages/theme-chalk/src/wujie.scss +5 -0
  249. package/packages/wujie/index.js +10 -0
  250. package/packages/wujie/src/wujie.vue +205 -0
  251. package/src/config/api.js +3 -0
  252. package/src/index.js +325 -319
  253. package/src/utils/frame.js +102 -0
  254. package/packages/lowcode/src/view.vue +0 -187
package/lib/dropdown.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 207);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 212);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -91,32 +91,32 @@ 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__, "M", function() { return noop; });
95
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return hasOwn; });
96
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return toObject; });
97
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return getValueByPath; });
98
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return getPropByPath; });
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return noop; });
95
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return hasOwn; });
96
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toObject; });
97
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getValueByPath; });
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__, "ab", 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; });
104
104
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return coerceTruthyValueToArray; });
105
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isIE; });
106
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return isEdge; });
107
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return isFirefox; });
105
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return isIE; });
106
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return isEdge; });
107
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return isFirefox; });
108
108
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return autoprefixer; });
109
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return kebabCase; });
109
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return kebabCase; });
110
110
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return capitalize; });
111
111
  /* unused harmony export looseEqual */
112
112
  /* unused harmony export arrayEquals */
113
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return isEqual; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return rafThrottle; });
113
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEqual; });
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__, "Q", 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__, "T", 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 */
@@ -124,7 +124,7 @@ module.exports =
124
124
  /* unused harmony export cloneDeep */
125
125
  /* unused harmony export grouping */
126
126
  /* unused harmony export pager */
127
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return getWinTop; });
127
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return getWinTop; });
128
128
  /* unused harmony export getFileType */
129
129
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrUnique; });
130
130
  /* unused harmony export average */
@@ -142,54 +142,54 @@ module.exports =
142
142
  /* unused harmony export exportXls */
143
143
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return extend; });
144
144
  /* unused harmony export getObjectType */
145
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return getParams; });
145
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return getParams; });
146
146
  /* unused harmony export getScript */
147
147
  /* unused harmony export getStyle */
148
148
  /* unused harmony export getTypeName */
149
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getTypePrefix; });
149
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return getTypePrefix; });
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__, "U", function() { return timestampUrl; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return timestampUrl; });
154
154
  /* unused harmony export hasChars */
155
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return identical; });
156
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return indexOfObj; });
157
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEmpty; });
158
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return isExist; });
155
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return identical; });
156
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return indexOfObj; });
157
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return isEmpty; });
158
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return isExist; });
159
159
  /* unused harmony export isFunction */
160
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return isObjectEqual; });
161
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return joinUrl; });
162
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return getHorizontalMargin; });
163
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return layoutWaterfall; });
160
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isObjectEqual; });
161
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return joinUrl; });
162
+ /* unused harmony export getHorizontalMargin */
163
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return layoutWaterfall; });
164
164
  /* unused harmony export loadJs */
165
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return loading; });
165
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return loading; });
166
166
  /* unused harmony export lowerCase */
167
167
  /* unused harmony export overbrim */
168
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return queryParams; });
168
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return queryParams; });
169
169
  /* unused harmony export receiveMessage */
170
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return renderIcon; });
170
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return renderIcon; });
171
171
  /* unused harmony export replenish */
172
172
  /* unused harmony export rmbToCapital */
173
173
  /* unused harmony export setScale */
174
174
  /* unused harmony export sendMessage */
175
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return setFavicon; });
175
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return setFavicon; });
176
176
  /* unused harmony export sum */
177
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return startWith; });
177
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return startWith; });
178
178
  /* unused harmony export takeLeft */
179
179
  /* unused harmony export takeRight */
180
180
  /* unused harmony export trimWhitespace */
181
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toFixed; });
181
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toFixed; });
182
182
  /* unused harmony export toFunction */
183
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return updateTheme; });
183
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return updateTheme; });
184
184
  /* unused harmony export upperType */
185
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return urlJoinParams; });
186
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return uuid; });
187
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cb", function() { return watermark; });
185
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return urlJoinParams; });
186
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return uuid; });
187
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return watermark; });
188
188
  /* unused harmony export winTopOpen */
189
189
  /* unused harmony export confirm */
190
190
  /* unused harmony export success */
191
191
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return error; });
192
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return warning; });
192
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return warning; });
193
193
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
194
194
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
195
195
  /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
@@ -2172,7 +2172,7 @@ var loadJs = function loadJs(url, callback) {
2172
2172
  var loading = function loading() {
2173
2173
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '请求中...';
2174
2174
 
2175
- var Loading = __webpack_require__(18).default;
2175
+ var Loading = __webpack_require__(17).default;
2176
2176
  return Loading.service({
2177
2177
  text: text,
2178
2178
  spinner: 'es-icon-jiazai',
@@ -3377,7 +3377,7 @@ var getColor = function getColor($color, $n) {
3377
3377
  var getLightness = function getLightness($v, $i, $isLight) {
3378
3378
  var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3379
3379
  $value = $value < 1 ? $value : 1;
3380
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($value, 2);
3380
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
3381
3381
  };
3382
3382
 
3383
3383
  /**
@@ -3401,7 +3401,7 @@ var getSaturation = function getSaturation($s, $i, $isLight) {
3401
3401
  $saturation = 0.1;
3402
3402
  }
3403
3403
  $saturation = $saturation > 0.06 ? $saturation : 0.06;
3404
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($saturation, 2);
3404
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
3405
3405
  };
3406
3406
 
3407
3407
  /**
@@ -3515,7 +3515,7 @@ var getRgb = function getRgb($color) {
3515
3515
 
3516
3516
  /***/ }),
3517
3517
 
3518
- /***/ 18:
3518
+ /***/ 17:
3519
3519
  /***/ (function(module, exports) {
3520
3520
 
3521
3521
  module.exports = require("eoss/lib/loading");
@@ -3579,736 +3579,759 @@ module.exports = require("lodash/get");
3579
3579
  /* unused harmony export getSecond */
3580
3580
  /* unused harmony export getWeekday */
3581
3581
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return timeCycle; });
3582
-
3583
-
3582
+ /* Modified from https://github.com/taylorhakes/fecha
3583
+ *
3584
+ * The MIT License (MIT)
3585
+ *
3586
+ * Copyright (c) 2015 Taylor Hakes
3587
+ *
3588
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
3589
+ * of this software and associated documentation files (the "Software"), to deal
3590
+ * in the Software without restriction, including without limitation the rights
3591
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3592
+ * copies of the Software, and to permit persons to whom the Software is
3593
+ * furnished to do so, subject to the following conditions:
3594
+ *
3595
+ * The above copyright notice and this permission notice shall be included in all
3596
+ * copies or substantial portions of the Software.
3597
+ *
3598
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3599
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3600
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3601
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3602
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3603
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3604
+ * SOFTWARE.
3605
+ */
3606
+
3607
+ /*eslint-disable*/
3608
+ // 把 YYYY-MM-DD 改成了 yyyy-MM-dd
3609
+
3610
+
3584
3611
  /**
3585
3612
  * Parse or format dates
3586
3613
  * @class fecha
3587
- */
3588
- var fecha = {};
3589
- var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
3590
- var twoDigits = '\\d\\d?';
3591
- var threeDigits = '\\d{3}';
3592
- var fourDigits = '\\d{4}';
3593
- var word = '[^\\s]+';
3594
- var literal = /\[([^]*?)\]/gm;
3595
- var noop = function noop() {};
3596
-
3597
- function regexEscape(str) {
3598
- return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
3599
- }
3600
-
3601
- function shorten(arr, sLen) {
3602
- var newArr = [];
3603
- for (var i = 0, len = arr.length; i < len; i++) {
3604
- newArr.push(arr[i].substr(0, sLen));
3605
- }
3606
- return newArr;
3607
- }
3608
-
3609
- function monthUpdate() {
3610
- return function (d, v) {
3611
- var index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
3612
- if (~index) {
3613
- d.month = index;
3614
- }
3615
- };
3616
- }
3617
-
3618
- function pad(val, len) {
3619
- val = String(val);
3620
- len = len || 2;
3621
- while (val.length < len) {
3622
- val = '0' + val;
3623
- }
3624
- return val;
3625
- }
3626
-
3627
- // 直接使用中文日期名称常量
3628
- var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
3629
- var monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
3630
- var monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
3631
- var dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
3632
- var amPm = ['上午', '下午'];
3633
- var DoFn = function DoFn(D) {
3634
- return D + '日';
3635
- };
3636
-
3637
- var formatFlags = {
3638
- D: function D(dateObj) {
3639
- return dateObj.getDay();
3640
- },
3641
- DD: function DD(dateObj) {
3642
- return pad(dateObj.getDay());
3643
- },
3644
- Do: function Do(dateObj) {
3645
- return DoFn(dateObj.getDate());
3646
- },
3647
- d: function d(dateObj) {
3648
- return dateObj.getDate();
3649
- },
3650
- dd: function dd(dateObj) {
3651
- return pad(dateObj.getDate());
3652
- },
3653
- ddd: function ddd(dateObj) {
3654
- return dayNamesShort[dateObj.getDay()];
3655
- },
3656
- dddd: function dddd(dateObj) {
3657
- return dayNames[dateObj.getDay()];
3658
- },
3659
- M: function M(dateObj) {
3660
- return dateObj.getMonth() + 1;
3661
- },
3662
- MM: function MM(dateObj) {
3663
- return pad(dateObj.getMonth() + 1);
3664
- },
3665
- MMM: function MMM(dateObj) {
3666
- return monthNamesShort[dateObj.getMonth()];
3667
- },
3668
- MMMM: function MMMM(dateObj) {
3669
- return monthNames[dateObj.getMonth()];
3670
- },
3671
- yy: function yy(dateObj) {
3672
- return pad(String(dateObj.getFullYear()), 4).substr(2);
3673
- },
3674
- yyyy: function yyyy(dateObj) {
3675
- return pad(dateObj.getFullYear(), 4);
3676
- },
3677
- h: function h(dateObj) {
3678
- return dateObj.getHours() % 12 || 12;
3679
- },
3680
- hh: function hh(dateObj) {
3681
- return pad(dateObj.getHours() % 12 || 12);
3682
- },
3683
- H: function H(dateObj) {
3684
- return dateObj.getHours();
3685
- },
3686
- HH: function HH(dateObj) {
3687
- return pad(dateObj.getHours());
3688
- },
3689
- m: function m(dateObj) {
3690
- return dateObj.getMinutes();
3691
- },
3692
- mm: function mm(dateObj) {
3693
- return pad(dateObj.getMinutes());
3694
- },
3695
- s: function s(dateObj) {
3696
- return dateObj.getSeconds();
3697
- },
3698
- ss: function ss(dateObj) {
3699
- return pad(dateObj.getSeconds());
3700
- },
3701
- S: function S(dateObj) {
3702
- return Math.round(dateObj.getMilliseconds() / 100);
3703
- },
3704
- SS: function SS(dateObj) {
3705
- return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
3706
- },
3707
- SSS: function SSS(dateObj) {
3708
- return pad(dateObj.getMilliseconds(), 3);
3709
- },
3710
- a: function a(dateObj) {
3711
- return dateObj.getHours() < 12 ? '上午' : '下午';
3712
- },
3713
- A: function A(dateObj) {
3714
- return dateObj.getHours() < 12 ? '上午' : '下午';
3715
- },
3716
- ZZ: function ZZ(dateObj) {
3717
- var o = dateObj.getTimezoneOffset();
3718
- return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
3719
- }
3720
- };
3721
-
3722
- var parseFlags = {
3723
- d: [twoDigits, function (d, v) {
3724
- d.day = v;
3725
- }],
3726
- Do: [twoDigits + word, function (d, v) {
3727
- d.day = parseInt(v, 10);
3728
- }],
3729
- M: [twoDigits, function (d, v) {
3730
- d.month = v - 1;
3731
- }],
3732
- yy: [twoDigits, function (d, v) {
3733
- var da = new Date(),
3734
- cent = +('' + da.getFullYear()).substr(0, 2);
3735
- d.year = '' + (v > 68 ? cent - 1 : cent) + v;
3736
- }],
3737
- h: [twoDigits, function (d, v) {
3738
- d.hour = v;
3739
- }],
3740
- m: [twoDigits, function (d, v) {
3741
- d.minute = v;
3742
- }],
3743
- s: [twoDigits, function (d, v) {
3744
- d.second = v;
3745
- }],
3746
- yyyy: [fourDigits, function (d, v) {
3747
- d.year = v;
3748
- }],
3749
- S: ['\\d', function (d, v) {
3750
- d.millisecond = v * 100;
3751
- }],
3752
- SS: ['\\d{2}', function (d, v) {
3753
- d.millisecond = v * 10;
3754
- }],
3755
- SSS: [threeDigits, function (d, v) {
3756
- d.millisecond = v;
3757
- }],
3758
- D: [twoDigits, noop],
3759
- ddd: [word, noop],
3760
- MMM: [word, monthUpdate('monthNamesShort')],
3761
- MMMM: [word, monthUpdate('monthNames')],
3762
- a: [word, function (d, v) {
3763
- var val = v.toLowerCase();
3764
- if (val === '上午') {
3765
- d.isPm = false;
3766
- } else if (val === '下午') {
3767
- d.isPm = true;
3768
- }
3769
- }],
3770
- ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
3771
- var parts = (v + '').match(/([+-]|\d\d)/gi),
3772
- minutes = void 0;
3773
-
3774
- if (parts) {
3775
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
3776
- d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
3777
- }
3778
- }]
3779
- };
3780
- parseFlags.dd = parseFlags.d;
3781
- parseFlags.dddd = parseFlags.ddd;
3782
- parseFlags.DD = parseFlags.D;
3783
- parseFlags.mm = parseFlags.m;
3784
- parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
3785
- parseFlags.MM = parseFlags.M;
3786
- parseFlags.ss = parseFlags.s;
3787
- parseFlags.A = parseFlags.a;
3788
-
3789
- // Some common format strings
3790
- fecha.masks = {
3791
- default: 'ddd MMM dd yyyy HH:mm:ss',
3792
- shortDate: 'M/D/yy',
3793
- mediumDate: 'MMM d, yyyy',
3794
- longDate: 'MMMM d, yyyy',
3795
- fullDate: 'dddd, MMMM d, yyyy',
3796
- shortTime: 'HH:mm',
3797
- mediumTime: 'HH:mm:ss',
3798
- longTime: 'HH:mm:ss.SSS'
3799
- };
3800
-
3614
+ */
3615
+ const fecha = {};
3616
+ const token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
3617
+ const twoDigits = '\\d\\d?';
3618
+ const threeDigits = '\\d{3}';
3619
+ const fourDigits = '\\d{4}';
3620
+ const word = '[^\\s]+';
3621
+ const literal = /\[([^]*?)\]/gm;
3622
+ const noop = function () {};
3623
+
3624
+ function regexEscape(str) {
3625
+ return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
3626
+ }
3627
+
3628
+ function shorten(arr, sLen) {
3629
+ const newArr = [];
3630
+ for (let i = 0, len = arr.length; i < len; i++) {
3631
+ newArr.push(arr[i].substr(0, sLen));
3632
+ }
3633
+ return newArr;
3634
+ }
3635
+
3636
+ function monthUpdate() {
3637
+ return function (d, v) {
3638
+ const index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
3639
+ if (~index) {
3640
+ d.month = index;
3641
+ }
3642
+ };
3643
+ }
3644
+
3645
+ function pad(val, len) {
3646
+ val = String(val);
3647
+ len = len || 2;
3648
+ while (val.length < len) {
3649
+ val = '0' + val;
3650
+ }
3651
+ return val;
3652
+ }
3653
+
3654
+ // 直接使用中文日期名称常量
3655
+ const dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
3656
+ const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
3657
+ const monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
3658
+ const dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
3659
+ const amPm = ['上午', '下午'];
3660
+ const DoFn = function DoFn(D) {
3661
+ return D + '日';
3662
+ };
3663
+
3664
+ const formatFlags = {
3665
+ D: function(dateObj) {
3666
+ return dateObj.getDay();
3667
+ },
3668
+ DD: function(dateObj) {
3669
+ return pad(dateObj.getDay());
3670
+ },
3671
+ Do: function(dateObj) {
3672
+ return DoFn(dateObj.getDate());
3673
+ },
3674
+ d: function(dateObj) {
3675
+ return dateObj.getDate();
3676
+ },
3677
+ dd: function(dateObj) {
3678
+ return pad(dateObj.getDate());
3679
+ },
3680
+ ddd: function(dateObj) {
3681
+ return dayNamesShort[dateObj.getDay()];
3682
+ },
3683
+ dddd: function(dateObj) {
3684
+ return dayNames[dateObj.getDay()];
3685
+ },
3686
+ M: function(dateObj) {
3687
+ return dateObj.getMonth() + 1;
3688
+ },
3689
+ MM: function(dateObj) {
3690
+ return pad(dateObj.getMonth() + 1);
3691
+ },
3692
+ MMM: function(dateObj) {
3693
+ return monthNamesShort[dateObj.getMonth()];
3694
+ },
3695
+ MMMM: function(dateObj) {
3696
+ return monthNames[dateObj.getMonth()];
3697
+ },
3698
+ yy: function(dateObj) {
3699
+ return pad(String(dateObj.getFullYear()), 4).substr(2);
3700
+ },
3701
+ yyyy: function(dateObj) {
3702
+ return pad(dateObj.getFullYear(), 4);
3703
+ },
3704
+ h: function(dateObj) {
3705
+ return dateObj.getHours() % 12 || 12;
3706
+ },
3707
+ hh: function(dateObj) {
3708
+ return pad(dateObj.getHours() % 12 || 12);
3709
+ },
3710
+ H: function(dateObj) {
3711
+ return dateObj.getHours();
3712
+ },
3713
+ HH: function(dateObj) {
3714
+ return pad(dateObj.getHours());
3715
+ },
3716
+ m: function(dateObj) {
3717
+ return dateObj.getMinutes();
3718
+ },
3719
+ mm: function(dateObj) {
3720
+ return pad(dateObj.getMinutes());
3721
+ },
3722
+ s: function(dateObj) {
3723
+ return dateObj.getSeconds();
3724
+ },
3725
+ ss: function(dateObj) {
3726
+ return pad(dateObj.getSeconds());
3727
+ },
3728
+ S: function(dateObj) {
3729
+ return Math.round(dateObj.getMilliseconds() / 100);
3730
+ },
3731
+ SS: function(dateObj) {
3732
+ return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
3733
+ },
3734
+ SSS: function(dateObj) {
3735
+ return pad(dateObj.getMilliseconds(), 3);
3736
+ },
3737
+ a: function(dateObj) {
3738
+ return dateObj.getHours() < 12 ? '上午' : '下午';
3739
+ },
3740
+ A: function(dateObj) {
3741
+ return dateObj.getHours() < 12 ? '上午' : '下午';
3742
+ },
3743
+ ZZ: function(dateObj) {
3744
+ const o = dateObj.getTimezoneOffset();
3745
+ return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
3746
+ }
3747
+ };
3748
+
3749
+ const parseFlags = {
3750
+ d: [twoDigits, function (d, v) {
3751
+ d.day = v;
3752
+ }],
3753
+ Do: [twoDigits + word, function (d, v) {
3754
+ d.day = parseInt(v, 10);
3755
+ }],
3756
+ M: [twoDigits, function (d, v) {
3757
+ d.month = v - 1;
3758
+ }],
3759
+ yy: [twoDigits, function (d, v) {
3760
+ const da = new Date(), cent = +('' + da.getFullYear()).substr(0, 2);
3761
+ d.year = '' + (v > 68 ? cent - 1 : cent) + v;
3762
+ }],
3763
+ h: [twoDigits, function (d, v) {
3764
+ d.hour = v;
3765
+ }],
3766
+ m: [twoDigits, function (d, v) {
3767
+ d.minute = v;
3768
+ }],
3769
+ s: [twoDigits, function (d, v) {
3770
+ d.second = v;
3771
+ }],
3772
+ yyyy: [fourDigits, function (d, v) {
3773
+ d.year = v;
3774
+ }],
3775
+ S: ['\\d', function (d, v) {
3776
+ d.millisecond = v * 100;
3777
+ }],
3778
+ SS: ['\\d{2}', function (d, v) {
3779
+ d.millisecond = v * 10;
3780
+ }],
3781
+ SSS: [threeDigits, function (d, v) {
3782
+ d.millisecond = v;
3783
+ }],
3784
+ D: [twoDigits, noop],
3785
+ ddd: [word, noop],
3786
+ MMM: [word, monthUpdate('monthNamesShort')],
3787
+ MMMM: [word, monthUpdate('monthNames')],
3788
+ a: [word, function (d, v) {
3789
+ const val = v.toLowerCase();
3790
+ if (val === '上午') {
3791
+ d.isPm = false;
3792
+ } else if (val === '下午') {
3793
+ d.isPm = true;
3794
+ }
3795
+ }],
3796
+ ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
3797
+ let parts = (v + '').match(/([+-]|\d\d)/gi), minutes;
3798
+
3799
+ if (parts) {
3800
+ minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
3801
+ d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
3802
+ }
3803
+ }]
3804
+ };
3805
+ parseFlags.dd = parseFlags.d;
3806
+ parseFlags.dddd = parseFlags.ddd;
3807
+ parseFlags.DD = parseFlags.D;
3808
+ parseFlags.mm = parseFlags.m;
3809
+ parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
3810
+ parseFlags.MM = parseFlags.M;
3811
+ parseFlags.ss = parseFlags.s;
3812
+ parseFlags.A = parseFlags.a;
3813
+
3814
+
3815
+ // Some common format strings
3816
+ fecha.masks = {
3817
+ default: 'ddd MMM dd yyyy HH:mm:ss',
3818
+ shortDate: 'M/D/yy',
3819
+ mediumDate: 'MMM d, yyyy',
3820
+ longDate: 'MMMM d, yyyy',
3821
+ fullDate: 'dddd, MMMM d, yyyy',
3822
+ shortTime: 'HH:mm',
3823
+ mediumTime: 'HH:mm:ss',
3824
+ longTime: 'HH:mm:ss.SSS'
3825
+ };
3826
+
3801
3827
  /***
3802
3828
  * Format a date
3803
3829
  * @method format
3804
3830
  * @param {Date|number} dateObj
3805
3831
  * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
3806
- */
3807
- fecha.format = function (dateObj, mask) {
3808
- if (typeof dateObj === 'number') {
3809
- dateObj = new Date(dateObj);
3810
- }
3811
-
3812
- if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
3813
- throw new Error('Invalid Date in fecha.format');
3814
- }
3815
-
3816
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
3817
-
3818
- var literals = [];
3819
-
3820
- // Make literals inactive by replacing them with ??
3821
- mask = mask.replace(literal, function ($0, $1) {
3822
- literals.push($1);
3823
- return '@@@';
3824
- });
3825
- // Apply formatting rules
3826
- mask = mask.replace(token, function ($0) {
3827
- return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
3828
- });
3829
- // Inline literal values back into the formatted value
3830
- return mask.replace(/@@@/g, function () {
3831
- return literals.shift();
3832
- });
3833
- };
3834
-
3832
+ */
3833
+ fecha.format = function (dateObj, mask) {
3834
+ if (typeof dateObj === 'number') {
3835
+ dateObj = new Date(dateObj);
3836
+ }
3837
+
3838
+ if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
3839
+ throw new Error('Invalid Date in fecha.format');
3840
+ }
3841
+
3842
+ mask = fecha.masks[mask] || mask || fecha.masks['default'];
3843
+
3844
+ const literals = [];
3845
+
3846
+ // Make literals inactive by replacing them with ??
3847
+ mask = mask.replace(literal, function($0, $1) {
3848
+ literals.push($1);
3849
+ return '@@@';
3850
+ });
3851
+ // Apply formatting rules
3852
+ mask = mask.replace(token, function ($0) {
3853
+ return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
3854
+ });
3855
+ // Inline literal values back into the formatted value
3856
+ return mask.replace(/@@@/g, function() {
3857
+ return literals.shift();
3858
+ });
3859
+ };
3860
+
3835
3861
  /**
3836
3862
  * Parse a date string into an object, changes - into /
3837
3863
  * @method parse
3838
3864
  * @param {string} dateStr Date string
3839
3865
  * @param {string} format Date parse format
3840
3866
  * @returns {Date|boolean}
3841
- */
3842
- fecha.parse = function (dateStr, format) {
3843
- if (typeof format !== 'string') {
3844
- throw new Error('Invalid format in fecha.parse');
3845
- }
3846
-
3847
- format = fecha.masks[format] || format;
3848
-
3849
- // Avoid regular expression denial of service, fail early for really long strings
3850
- // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
3851
- if (dateStr.length > 1000) {
3852
- return null;
3853
- }
3854
-
3855
- var dateInfo = {};
3856
- var parseInfo = [];
3857
- var literals = [];
3858
- format = format.replace(literal, function ($0, $1) {
3859
- literals.push($1);
3860
- return '@@@';
3861
- });
3862
- var newFormat = regexEscape(format).replace(token, function ($0) {
3863
- if (parseFlags[$0]) {
3864
- var info = parseFlags[$0];
3865
- parseInfo.push(info[1]);
3866
- return '(' + info[0] + ')';
3867
- }
3868
-
3869
- return $0;
3870
- });
3871
- newFormat = newFormat.replace(/@@@/g, function () {
3872
- return literals.shift();
3873
- });
3874
- var matches = dateStr.match(new RegExp(newFormat, 'i'));
3875
- if (!matches) {
3876
- return null;
3877
- }
3878
-
3879
- for (var i = 1; i < matches.length; i++) {
3880
- parseInfo[i - 1](dateInfo, matches[i]);
3881
- }
3882
-
3883
- var today = new Date();
3884
- if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
3885
- dateInfo.hour = +dateInfo.hour + 12;
3886
- } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
3887
- dateInfo.hour = 0;
3888
- }
3889
-
3890
- var date = void 0;
3891
- if (dateInfo.timezoneOffset != null) {
3892
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
3893
- date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
3894
- } else {
3895
- date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
3896
- }
3897
- return date;
3898
- };
3899
-
3900
- // 导出fecha对象
3901
-
3902
-
3903
- // 以下是从date-util.js合并的函数
3904
- var newArray = function newArray(start, end) {
3905
- var result = [];
3906
- for (var i = start; i <= end; i++) {
3907
- result.push(i);
3908
- }
3909
- return result;
3910
- };
3911
-
3912
- var getSettings = function getSettings() {
3913
- return {
3914
- dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
3915
- dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
3916
- monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
3917
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
3918
- amPm: ['上午', '下午']
3919
- };
3920
- };
3921
-
3922
- var toDate = function toDate(date) {
3923
- return isDate(date) ? new Date(date) : null;
3924
- };
3925
-
3926
- var isDate = function isDate(date) {
3927
- if (date === null || date === undefined) return false;
3928
- if (isNaN(new Date(date).getTime())) return false;
3929
- if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
3930
- return true;
3931
- };
3932
-
3933
- var isDateObject = function isDateObject(val) {
3934
- return val instanceof Date;
3935
- };
3936
-
3937
- var formatDate = function formatDate(date) {
3938
- var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
3939
-
3940
- // 处理多种输入类型
3941
- if (!date) return '';
3942
-
3943
- // 如果是时间戳,转成日期对象
3944
- if (typeof date === 'number') {
3945
- date = new Date(date);
3946
- }
3947
- // 如果是字符串,转成日期对象
3948
- if (typeof date === 'string') {
3949
- date = new Date(date);
3950
- }
3951
-
3952
- // 调用toDate进一步验证和转换
3953
- date = toDate(date);
3954
- if (!date) return '';
3955
-
3956
- // 兼容大写和小写的格式标记
3957
- // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
3958
- var lowercaseFormat = format.replace(/YYYY/g, 'yyyy').replace(/D/g, 'd');
3959
-
3960
- // 使用fecha库进行格式化,支持中文配置
3961
- var str = fecha.format(date, lowercaseFormat, getSettings());
3962
- return str;
3963
- };
3964
-
3965
- var parseDate = function parseDate(string, format) {
3966
- return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
3967
- };
3968
-
3969
- var getDayCountOfMonth = function getDayCountOfMonth(year, month) {
3970
- if (month === 3 || month === 5 || month === 8 || month === 10) {
3971
- return 30;
3972
- }
3973
-
3974
- if (month === 1) {
3975
- if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
3976
- return 29;
3977
- } else {
3978
- return 28;
3979
- }
3980
- }
3981
-
3982
- return 31;
3983
- };
3984
-
3985
- var getDayCountOfYear = function getDayCountOfYear(year) {
3986
- var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
3987
- return isLeapYear ? 366 : 365;
3988
- };
3989
-
3990
- var getFirstDayOfMonth = function getFirstDayOfMonth(date) {
3991
- var temp = new Date(date.getTime());
3992
- temp.setDate(1);
3993
- return temp.getDay();
3994
- };
3995
-
3996
- // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
3997
- // {prev, next} Date should work for Daylight Saving Time
3998
- // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
3999
- var prevDate = function prevDate(date) {
4000
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4001
-
4002
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
4003
- };
4004
-
4005
- var nextDate = function nextDate(date) {
4006
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4007
-
4008
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
4009
- };
4010
-
4011
- var getStartDateOfMonth = function getStartDateOfMonth(year, month) {
4012
- var result = new Date(year, month, 1);
4013
- var day = result.getDay();
4014
-
4015
- if (day === 0) {
4016
- return prevDate(result, 7);
4017
- } else {
4018
- return prevDate(result, day);
4019
- }
4020
- };
4021
-
4022
- var getWeekNumber = function getWeekNumber(date) {
4023
- // 支持多种输入类型
4024
- if (!date || !isDate(date)) {
4025
- date = new Date();
4026
- }
4027
- if (typeof date === 'string') {
4028
- date = new Date(date);
4029
- }
4030
-
4031
- // 验证日期有效性
4032
- if (!isDate(date)) return null;
4033
-
4034
- var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
4035
- // 设置为最近的星期四:当前日期 + 4 - 当前星期数
4036
- // 将星期日的星期数设为7
4037
- d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
4038
- // 获取当年的第一天
4039
- var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
4040
- // 计算到最近的星期四的完整周数
4041
- var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
4042
- // 返回周数
4043
- return weekNo;
4044
- };
4045
-
4046
- var getRangeHours = function getRangeHours(ranges) {
4047
- var hours = [];
4048
- var disabledHours = [];
4049
-
4050
- (ranges || []).forEach(function (range) {
4051
- var value = range.map(function (date) {
4052
- return date.getHours();
4053
- });
4054
-
4055
- disabledHours = disabledHours.concat(newArray(value[0], value[1]));
4056
- });
4057
-
4058
- if (disabledHours.length) {
4059
- for (var i = 0; i < 24; i++) {
4060
- hours[i] = disabledHours.indexOf(i) === -1;
4061
- }
4062
- } else {
4063
- for (var _i = 0; _i < 24; _i++) {
4064
- hours[_i] = false;
4065
- }
4066
- }
4067
-
4068
- return hours;
4069
- };
4070
-
4071
- var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
4072
- if (amount <= 0) return [];
4073
- var temp = new Date(date.getTime());
4074
- temp.setDate(0);
4075
- var lastDay = temp.getDate();
4076
- return range(amount).map(function (_, index) {
4077
- return lastDay - (amount - index - 1);
4078
- });
4079
- };
4080
-
4081
- var getMonthDays = function getMonthDays(date) {
4082
- var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
4083
- var days = temp.getDate();
4084
- return range(days).map(function (_, index) {
4085
- return index + 1;
4086
- });
4087
- };
4088
-
4089
- function setRangeData(arr, start, end, value) {
4090
- for (var i = start; i < end; i++) {
4091
- arr[i] = value;
4092
- }
4093
- }
4094
-
4095
- var getRangeMinutes = function getRangeMinutes(ranges, hour) {
4096
- var minutes = new Array(60);
4097
-
4098
- if (ranges.length > 0) {
4099
- ranges.forEach(function (range) {
4100
- var start = range[0];
4101
- var end = range[1];
4102
- var startHour = start.getHours();
4103
- var startMinute = start.getMinutes();
4104
- var endHour = end.getHours();
4105
- var endMinute = end.getMinutes();
4106
- if (startHour === hour && endHour !== hour) {
4107
- setRangeData(minutes, startMinute, 60, true);
4108
- } else if (startHour === hour && endHour === hour) {
4109
- setRangeData(minutes, startMinute, endMinute + 1, true);
4110
- } else if (startHour !== hour && endHour === hour) {
4111
- setRangeData(minutes, 0, endMinute + 1, true);
4112
- } else if (startHour < hour && endHour > hour) {
4113
- setRangeData(minutes, 0, 60, true);
4114
- }
4115
- });
4116
- } else {
4117
- setRangeData(minutes, 0, 60, true);
4118
- }
4119
- return minutes;
4120
- };
4121
-
4122
- var range = function range(n) {
4123
- // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
4124
- return Array.apply(null, { length: n }).map(function (_, n) {
4125
- return n;
4126
- });
4127
- };
4128
-
4129
- var modifyDate = function modifyDate(date, y, m, d) {
4130
- return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
4131
- };
4132
-
4133
- var modifyTime = function modifyTime(date, h, m, s) {
4134
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
4135
- };
4136
-
4137
- var modifyWithTimeString = function modifyWithTimeString(date, time) {
4138
- if (date == null || !time) {
4139
- return date;
4140
- }
4141
- time = parseDate(time, 'HH:mm:ss');
4142
- return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
4143
- };
4144
-
4145
- var clearTime = function clearTime(date) {
4146
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
4147
- };
4148
-
4149
- var clearMilliseconds = function clearMilliseconds(date) {
4150
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
4151
- };
4152
-
4153
- var limitTimeRange = function limitTimeRange(date, ranges) {
4154
- var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
4155
-
4156
- // TODO: refactory a more elegant solution
4157
- if (ranges.length === 0) return date;
4158
- var normalizeDate = function normalizeDate(date) {
4159
- return fecha.parse(fecha.format(date, format), format);
4160
- };
4161
- var ndate = normalizeDate(date);
4162
- var nranges = ranges.map(function (range) {
4163
- return range.map(normalizeDate);
4164
- });
4165
- if (nranges.some(function (nrange) {
4166
- return ndate >= nrange[0] && ndate <= nrange[1];
4167
- })) return date;
4168
-
4169
- var minDate = nranges[0][0];
4170
- var maxDate = nranges[0][0];
4171
-
4172
- nranges.forEach(function (nrange) {
4173
- minDate = new Date(Math.min(nrange[0], minDate));
4174
- maxDate = new Date(Math.max(nrange[1], minDate));
4175
- });
4176
-
4177
- var ret = ndate < minDate ? minDate : maxDate;
4178
- // preserve Year/Month/Date
4179
- return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
4180
- };
4181
-
4182
- var timeWithinRange = function timeWithinRange(date, selectableRange, format) {
4183
- var limitedDate = limitTimeRange(date, selectableRange, format);
4184
- return limitedDate.getTime() === date.getTime();
4185
- };
4186
-
4187
- var changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
4188
- // clamp date to the number of days in `year`, `month`
4189
- // eg: (2010-1-31, 2010, 2) => 2010-2-28
4190
- var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
4191
- return modifyDate(date, year, month, monthDate);
4192
- };
4193
-
4194
- var prevMonth = function prevMonth(date) {
4195
- var year = date.getFullYear();
4196
- var month = date.getMonth();
4197
- return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
4198
- };
4199
-
4200
- var nextMonth = function nextMonth(date) {
4201
- var year = date.getFullYear();
4202
- var month = date.getMonth();
4203
- return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
4204
- };
4205
-
4206
- var prevYear = function prevYear(date) {
4207
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4208
-
4209
- var year = date.getFullYear();
4210
- var month = date.getMonth();
4211
- return changeYearMonthAndClampDate(date, year - amount, month);
4212
- };
4213
-
4214
- var nextYear = function nextYear(date) {
4215
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4216
-
4217
- var year = date.getFullYear();
4218
- var month = date.getMonth();
4219
- return changeYearMonthAndClampDate(date, year + amount, month);
4220
- };
4221
-
4222
- var extractDateFormat = function extractDateFormat(format) {
4223
- return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
4224
- };
4225
-
4226
- var extractTimeFormat = function extractTimeFormat(format) {
4227
- return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
4228
- };
4229
-
4230
- var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
4231
- return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
4232
- };
4233
-
3867
+ */
3868
+ fecha.parse = function (dateStr, format) {
3869
+ if (typeof format !== 'string') {
3870
+ throw new Error('Invalid format in fecha.parse');
3871
+ }
3872
+
3873
+ format = fecha.masks[format] || format;
3874
+
3875
+ // Avoid regular expression denial of service, fail early for really long strings
3876
+ // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
3877
+ if (dateStr.length > 1000) {
3878
+ return null;
3879
+ }
3880
+
3881
+ const dateInfo = {};
3882
+ const parseInfo = [];
3883
+ const literals = [];
3884
+ format = format.replace(literal, function($0, $1) {
3885
+ literals.push($1);
3886
+ return '@@@';
3887
+ });
3888
+ let newFormat = regexEscape(format).replace(token, function ($0) {
3889
+ if (parseFlags[$0]) {
3890
+ const info = parseFlags[$0];
3891
+ parseInfo.push(info[1]);
3892
+ return '(' + info[0] + ')';
3893
+ }
3894
+
3895
+ return $0;
3896
+ });
3897
+ newFormat = newFormat.replace(/@@@/g, function() {
3898
+ return literals.shift();
3899
+ });
3900
+ const matches = dateStr.match(new RegExp(newFormat, 'i'));
3901
+ if (!matches) {
3902
+ return null;
3903
+ }
3904
+
3905
+ for (let i = 1; i < matches.length; i++) {
3906
+ parseInfo[i - 1](dateInfo, matches[i]);
3907
+ }
3908
+
3909
+ const today = new Date();
3910
+ if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
3911
+ dateInfo.hour = +dateInfo.hour + 12;
3912
+ } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
3913
+ dateInfo.hour = 0;
3914
+ }
3915
+
3916
+ let date;
3917
+ if (dateInfo.timezoneOffset != null) {
3918
+ dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
3919
+ date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
3920
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
3921
+ } else {
3922
+ date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
3923
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
3924
+ }
3925
+ return date;
3926
+ };
3927
+
3928
+ // 导出fecha对象
3929
+
3930
+
3931
+ // 以下是从date-util.js合并的函数
3932
+ const newArray = function(start, end) {
3933
+ let result = [];
3934
+ for (let i = start; i <= end; i++) {
3935
+ result.push(i);
3936
+ }
3937
+ return result;
3938
+ };
3939
+
3940
+ const getSettings = () => {
3941
+ return {
3942
+ dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
3943
+ dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
3944
+ monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
3945
+ monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
3946
+ amPm: ['上午', '下午']
3947
+ };
3948
+ };
3949
+
3950
+ const toDate = function(date) {
3951
+ return isDate(date) ? new Date(date) : null;
3952
+ };
3953
+
3954
+ const isDate = function(date) {
3955
+ if (date === null || date === undefined) return false;
3956
+ if (isNaN(new Date(date).getTime())) return false;
3957
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
3958
+ return true;
3959
+ };
3960
+
3961
+ const isDateObject = function(val) {
3962
+ return val instanceof Date;
3963
+ };
3964
+
3965
+ const formatDate = function (date, format = 'yyyy-MM-dd') {
3966
+ // 处理多种输入类型
3967
+ if (!date) return '';
3968
+
3969
+ // 如果是时间戳,转成日期对象
3970
+ if (typeof date === 'number') {
3971
+ date = new Date(date);
3972
+ }
3973
+ // 如果是字符串,转成日期对象
3974
+ if (typeof date === 'string') {
3975
+ date = new Date(date);
3976
+ }
3977
+
3978
+ // 调用toDate进一步验证和转换
3979
+ date = toDate(date);
3980
+ if (!date) return '';
3981
+
3982
+ // 兼容大写和小写的格式标记
3983
+ // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
3984
+ const lowercaseFormat = format
3985
+ .replace(/YYYY/g, 'yyyy')
3986
+ .replace(/D/g, 'd')
3987
+
3988
+ // 使用fecha库进行格式化,支持中文配置
3989
+ const str = fecha.format(date, lowercaseFormat, getSettings());
3990
+ return str;
3991
+ };
3992
+
3993
+ const parseDate = function(string, format) {
3994
+ return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
3995
+ };
3996
+
3997
+ const getDayCountOfMonth = function(year, month) {
3998
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
3999
+ return 30;
4000
+ }
4001
+
4002
+ if (month === 1) {
4003
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
4004
+ return 29;
4005
+ } else {
4006
+ return 28;
4007
+ }
4008
+ }
4009
+
4010
+ return 31;
4011
+ };
4012
+
4013
+ const getDayCountOfYear = function(year) {
4014
+ const isLeapYear = year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);
4015
+ return isLeapYear ? 366 : 365;
4016
+ };
4017
+
4018
+ const getFirstDayOfMonth = function(date) {
4019
+ const temp = new Date(date.getTime());
4020
+ temp.setDate(1);
4021
+ return temp.getDay();
4022
+ };
4023
+
4024
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
4025
+ // {prev, next} Date should work for Daylight Saving Time
4026
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
4027
+ const prevDate = function(date, amount = 1) {
4028
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
4029
+ };
4030
+
4031
+ const nextDate = function(date, amount = 1) {
4032
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
4033
+ };
4034
+
4035
+ const getStartDateOfMonth = function(year, month) {
4036
+ const result = new Date(year, month, 1);
4037
+ const day = result.getDay();
4038
+
4039
+ if (day === 0) {
4040
+ return prevDate(result, 7);
4041
+ } else {
4042
+ return prevDate(result, day);
4043
+ }
4044
+ };
4045
+
4046
+ const getWeekNumber = function(date) {
4047
+ // 支持多种输入类型
4048
+ if (!date||!isDate(date)) {
4049
+ date = new Date();
4050
+ }
4051
+ if (typeof date === 'string') {
4052
+ date = new Date(date);
4053
+ }
4054
+
4055
+ // 验证日期有效性
4056
+ if (!isDate(date)) return null;
4057
+
4058
+ const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
4059
+ // 设置为最近的星期四:当前日期 + 4 - 当前星期数
4060
+ // 将星期日的星期数设为7
4061
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
4062
+ // 获取当年的第一天
4063
+ const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
4064
+ // 计算到最近的星期四的完整周数
4065
+ const weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
4066
+ // 返回周数
4067
+ return weekNo;
4068
+ };
4069
+
4070
+ const getRangeHours = function(ranges) {
4071
+ const hours = [];
4072
+ let disabledHours = [];
4073
+
4074
+ (ranges || []).forEach(range => {
4075
+ const value = range.map(date => date.getHours());
4076
+
4077
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
4078
+ });
4079
+
4080
+ if (disabledHours.length) {
4081
+ for (let i = 0; i < 24; i++) {
4082
+ hours[i] = disabledHours.indexOf(i) === -1;
4083
+ }
4084
+ } else {
4085
+ for (let i = 0; i < 24; i++) {
4086
+ hours[i] = false;
4087
+ }
4088
+ }
4089
+
4090
+ return hours;
4091
+ };
4092
+
4093
+ const getPrevMonthLastDays = (date, amount) => {
4094
+ if (amount <= 0) return [];
4095
+ const temp = new Date(date.getTime());
4096
+ temp.setDate(0);
4097
+ const lastDay = temp.getDate();
4098
+ return range(amount).map((_, index) => lastDay - (amount - index - 1));
4099
+ };
4100
+
4101
+ const getMonthDays = (date) => {
4102
+ const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
4103
+ const days = temp.getDate();
4104
+ return range(days).map((_, index) => index + 1);
4105
+ };
4106
+
4107
+ function setRangeData(arr, start, end, value) {
4108
+ for (let i = start; i < end; i++) {
4109
+ arr[i] = value;
4110
+ }
4111
+ }
4112
+
4113
+ const getRangeMinutes = function(ranges, hour) {
4114
+ const minutes = new Array(60);
4115
+
4116
+ if (ranges.length > 0) {
4117
+ ranges.forEach(range => {
4118
+ const start = range[0];
4119
+ const end = range[1];
4120
+ const startHour = start.getHours();
4121
+ const startMinute = start.getMinutes();
4122
+ const endHour = end.getHours();
4123
+ const endMinute = end.getMinutes();
4124
+ if (startHour === hour && endHour !== hour) {
4125
+ setRangeData(minutes, startMinute, 60, true);
4126
+ } else if (startHour === hour && endHour === hour) {
4127
+ setRangeData(minutes, startMinute, endMinute + 1, true);
4128
+ } else if (startHour !== hour && endHour === hour) {
4129
+ setRangeData(minutes, 0, endMinute + 1, true);
4130
+ } else if (startHour < hour && endHour > hour) {
4131
+ setRangeData(minutes, 0, 60, true);
4132
+ }
4133
+ });
4134
+ } else {
4135
+ setRangeData(minutes, 0, 60, true);
4136
+ }
4137
+ return minutes;
4138
+ };
4139
+
4140
+ const range = function(n) {
4141
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
4142
+ return Array.apply(null, {length: n}).map((_, n) => n);
4143
+ };
4144
+
4145
+ const modifyDate = function(date, y, m, d) {
4146
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
4147
+ };
4148
+
4149
+ const modifyTime = function(date, h, m, s) {
4150
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
4151
+ };
4152
+
4153
+ const modifyWithTimeString = (date, time) => {
4154
+ if (date == null || !time) {
4155
+ return date;
4156
+ }
4157
+ time = parseDate(time, 'HH:mm:ss');
4158
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
4159
+ };
4160
+
4161
+ const clearTime = function(date) {
4162
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
4163
+ };
4164
+
4165
+ const clearMilliseconds = function(date) {
4166
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
4167
+ };
4168
+
4169
+ const limitTimeRange = function(date, ranges, format = 'HH:mm:ss') {
4170
+ // TODO: refactory a more elegant solution
4171
+ if (ranges.length === 0) return date;
4172
+ const normalizeDate = date => fecha.parse(fecha.format(date, format), format);
4173
+ const ndate = normalizeDate(date);
4174
+ const nranges = ranges.map(range => range.map(normalizeDate));
4175
+ if (nranges.some(nrange => ndate >= nrange[0] && ndate <= nrange[1])) return date;
4176
+
4177
+ let minDate = nranges[0][0];
4178
+ let maxDate = nranges[0][0];
4179
+
4180
+ nranges.forEach(nrange => {
4181
+ minDate = new Date(Math.min(nrange[0], minDate));
4182
+ maxDate = new Date(Math.max(nrange[1], minDate));
4183
+ });
4184
+
4185
+ const ret = ndate < minDate ? minDate : maxDate;
4186
+ // preserve Year/Month/Date
4187
+ return modifyDate(
4188
+ ret,
4189
+ date.getFullYear(),
4190
+ date.getMonth(),
4191
+ date.getDate()
4192
+ );
4193
+ };
4194
+
4195
+ const timeWithinRange = function(date, selectableRange, format) {
4196
+ const limitedDate = limitTimeRange(date, selectableRange, format);
4197
+ return limitedDate.getTime() === date.getTime();
4198
+ };
4199
+
4200
+ const changeYearMonthAndClampDate = function(date, year, month) {
4201
+ // clamp date to the number of days in `year`, `month`
4202
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
4203
+ const monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
4204
+ return modifyDate(date, year, month, monthDate);
4205
+ };
4206
+
4207
+ const prevMonth = function(date) {
4208
+ const year = date.getFullYear();
4209
+ const month = date.getMonth();
4210
+ return month === 0
4211
+ ? changeYearMonthAndClampDate(date, year - 1, 11)
4212
+ : changeYearMonthAndClampDate(date, year, month - 1);
4213
+ };
4214
+
4215
+ const nextMonth = function(date) {
4216
+ const year = date.getFullYear();
4217
+ const month = date.getMonth();
4218
+ return month === 11
4219
+ ? changeYearMonthAndClampDate(date, year + 1, 0)
4220
+ : changeYearMonthAndClampDate(date, year, month + 1);
4221
+ };
4222
+
4223
+ const prevYear = function(date, amount = 1) {
4224
+ const year = date.getFullYear();
4225
+ const month = date.getMonth();
4226
+ return changeYearMonthAndClampDate(date, year - amount, month);
4227
+ };
4228
+
4229
+ const nextYear = function(date, amount = 1) {
4230
+ const year = date.getFullYear();
4231
+ const month = date.getMonth();
4232
+ return changeYearMonthAndClampDate(date, year + amount, month);
4233
+ };
4234
+
4235
+ const extractDateFormat = function(format) {
4236
+ return format
4237
+ .replace(/\W?m{1,2}|\W?ZZ/g, '')
4238
+ .replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '')
4239
+ .trim();
4240
+ };
4241
+
4242
+ const extractTimeFormat = function(format) {
4243
+ return format
4244
+ .replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '')
4245
+ .trim();
4246
+ };
4247
+
4248
+ const validateRangeInOneMonth = function(start, end) {
4249
+ return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
4250
+ };
4251
+
4234
4252
  /**
4235
4253
  * 计算两个日期之间的工作日数量(不包括周末和节假日)
4236
4254
  * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
4237
4255
  * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
4238
4256
  * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
4239
4257
  * @returns {number} 工作日数量
4240
- */
4241
- var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
4242
- var holidays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4243
-
4244
- if (typeof start_date !== 'string' || typeof end_date !== 'string') {
4245
- throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
4246
- }
4247
-
4248
- var startDateObj = new Date(start_date);
4249
- var endDateObj = new Date(end_date);
4250
-
4251
- if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
4252
- throw new Error("Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'.");
4253
- }
4254
-
4255
- if (startDateObj > endDateObj) {
4256
- throw new Error('Start date should be earlier than or equal to end date.');
4257
- }
4258
-
4259
- var workdays = 0;
4260
-
4261
- // Iterate through each day in the date range
4262
-
4263
- var _loop = function _loop(currentDate) {
4264
- // Check if the current day is a weekend (Saturday or Sunday)
4265
- var isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
4266
-
4267
- // Check if the current day is a holiday
4268
- var isHoliday = holidays.some(function (holiday) {
4269
- var holidayDate = new Date(holiday);
4270
- return currentDate.toDateString() === holidayDate.toDateString();
4271
- });
4272
-
4273
- // If it's a workday (not a weekend or holiday), increment the workdays count
4274
- if (!isWeekend && !isHoliday) {
4275
- workdays++;
4276
- }
4277
- };
4278
-
4279
- for (var currentDate = new Date(startDateObj); currentDate <= endDateObj; currentDate.setDate(currentDate.getDate() + 1)) {
4280
- _loop(currentDate);
4281
- }
4282
-
4283
- return workdays;
4284
- };
4285
-
4258
+ */
4259
+ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
4260
+ if (typeof start_date !== 'string' || typeof end_date !== 'string') {
4261
+ throw new Error(
4262
+ "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
4263
+ );
4264
+ }
4265
+
4266
+ const startDateObj = new Date(start_date);
4267
+ const endDateObj = new Date(end_date);
4268
+
4269
+ if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
4270
+ throw new Error(
4271
+ "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
4272
+ );
4273
+ }
4274
+
4275
+ if (startDateObj > endDateObj) {
4276
+ throw new Error('Start date should be earlier than or equal to end date.');
4277
+ }
4278
+
4279
+ let workdays = 0;
4280
+
4281
+ // Iterate through each day in the date range
4282
+ for (
4283
+ let currentDate = new Date(startDateObj);
4284
+ currentDate <= endDateObj;
4285
+ currentDate.setDate(currentDate.getDate() + 1)
4286
+ ) {
4287
+ // Check if the current day is a weekend (Saturday or Sunday)
4288
+ const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
4289
+
4290
+ // Check if the current day is a holiday
4291
+ const isHoliday = holidays.some((holiday) => {
4292
+ const holidayDate = new Date(holiday);
4293
+ return currentDate.toDateString() === holidayDate.toDateString();
4294
+ });
4295
+
4296
+ // If it's a workday (not a weekend or holiday), increment the workdays count
4297
+ if (!isWeekend && !isHoliday) {
4298
+ workdays++;
4299
+ }
4300
+ }
4301
+
4302
+ return workdays;
4303
+ };
4304
+
4286
4305
  /**
4287
4306
  * 日期加减天数
4288
4307
  * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
4289
4308
  * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
4290
4309
  * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
4291
- */
4292
- var dateAddDays = function dateAddDays(start_date, days) {
4293
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
4294
- throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days.");
4295
- }
4296
-
4297
- var startDateObj = new Date(start_date);
4298
- if (isNaN(startDateObj.getTime())) {
4299
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4300
- }
4301
-
4302
- var resultDateObj = new Date(startDateObj);
4303
- resultDateObj.setDate(resultDateObj.getDate() + days);
4304
-
4305
- var resultYear = resultDateObj.getFullYear();
4306
- var resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
4307
- var resultDay = String(resultDateObj.getDate()).padStart(2, '0');
4308
-
4309
- return resultYear + '-' + resultMonth + '-' + resultDay;
4310
- };
4311
-
4310
+ */
4311
+ const dateAddDays = function (start_date, days) {
4312
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
4313
+ throw new Error(
4314
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
4315
+ );
4316
+ }
4317
+
4318
+ const startDateObj = new Date(start_date);
4319
+ if (isNaN(startDateObj.getTime())) {
4320
+ throw new Error(
4321
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4322
+ );
4323
+ }
4324
+
4325
+ const resultDateObj = new Date(startDateObj);
4326
+ resultDateObj.setDate(resultDateObj.getDate() + days);
4327
+
4328
+ const resultYear = resultDateObj.getFullYear();
4329
+ const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
4330
+ const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
4331
+
4332
+ return `${resultYear}-${resultMonth}-${resultDay}`;
4333
+ };
4334
+
4312
4335
  /**
4313
4336
  * 计算两个日期之间的差值
4314
4337
  * @date 2023年12月14日
@@ -4316,180 +4339,182 @@ var dateAddDays = function dateAddDays(start_date, days) {
4316
4339
  * @param {String} end_date - 结束日期字符串
4317
4340
  * @param {String} unit - 单位:year/month/day
4318
4341
  * @returns {Number} 差值
4319
- */
4320
- var dateDiff = function dateDiff(start_date, end_date) {
4321
- var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
4322
-
4323
- // Assuming date strings are in "YYYY-MM-DD" format
4324
- var startDate = new Date(start_date);
4325
- var endDate = new Date(end_date);
4326
-
4327
- // If the date is invalid, return 0
4328
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
4329
- return 0;
4330
- }
4331
-
4332
- if (unit === 'year') {
4333
- return endDate.getFullYear() - startDate.getFullYear();
4334
- } else if (unit === 'month') {
4335
- return (endDate.getFullYear() - startDate.getFullYear()) * 12 + (endDate.getMonth() - startDate.getMonth());
4336
- } else {
4337
- // Default to day
4338
- var timeDifference = endDate - startDate;
4339
- // Calculate days (86400000 milliseconds per day)
4340
- return Math.floor(timeDifference / 86400000);
4341
- }
4342
- };
4343
-
4342
+ */
4343
+ const dateDiff = function (start_date, end_date, unit = 'day') {
4344
+ // Assuming date strings are in "YYYY-MM-DD" format
4345
+ var startDate = new Date(start_date);
4346
+ var endDate = new Date(end_date);
4347
+
4348
+ // If the date is invalid, return 0
4349
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
4350
+ return 0;
4351
+ }
4352
+
4353
+ if (unit === 'year') {
4354
+ return endDate.getFullYear() - startDate.getFullYear();
4355
+ } else if (unit === 'month') {
4356
+ return (
4357
+ (endDate.getFullYear() - startDate.getFullYear()) * 12 +
4358
+ (endDate.getMonth() - startDate.getMonth())
4359
+ );
4360
+ } else {
4361
+ // Default to day
4362
+ var timeDifference = endDate - startDate;
4363
+ // Calculate days (86400000 milliseconds per day)
4364
+ return Math.floor(timeDifference / 86400000);
4365
+ }
4366
+ };
4367
+
4344
4368
  /**
4345
4369
  * 获取月份中的日期
4346
4370
  * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
4347
4371
  * @returns {number} 月份中的日期(1-31)
4348
- */
4349
- var dayOfMonth = function dayOfMonth(date) {
4350
- if (typeof date !== 'string') {
4351
- throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4352
- }
4353
-
4354
- var dateObj = new Date(date);
4355
- if (isNaN(dateObj.getTime())) {
4356
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4357
- }
4358
-
4359
- return dateObj.getDate();
4360
- };
4361
-
4372
+ */
4373
+ const dayOfMonth = function (date) {
4374
+ if (typeof date !== 'string') {
4375
+ throw new Error(
4376
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
4377
+ );
4378
+ }
4379
+
4380
+ const dateObj = new Date(date);
4381
+ if (isNaN(dateObj.getTime())) {
4382
+ throw new Error(
4383
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4384
+ );
4385
+ }
4386
+
4387
+ return dateObj.getDate();
4388
+ };
4389
+
4362
4390
  /**
4363
4391
  * 获取当前日期
4364
4392
  * @date 2022年5月7日
4365
4393
  * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
4366
4394
  * @returns {string} 当前日期的格式化字符串
4367
- */
4368
- var getCurrentDate = function getCurrentDate() {
4369
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD';
4370
-
4371
- return formatDate(new Date(), format);
4372
- };
4373
-
4395
+ */
4396
+ const getCurrentDate = function (format = 'YYYY-MM-DD') {
4397
+ return formatDate(new Date(), format);
4398
+ };
4399
+
4374
4400
  /**
4375
4401
  * 获取当前日期时间
4376
4402
  * @date 2022年5月7日
4377
4403
  * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
4378
4404
  * @returns {string} 当前日期时间的格式化字符串
4379
- */
4380
- var getCurrentDateTime = function getCurrentDateTime() {
4381
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD HH:mm:ss';
4382
-
4383
- return formatDate(new Date(), format);
4384
- };
4385
-
4405
+ */
4406
+ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
4407
+ return formatDate(new Date(), format);
4408
+ };
4409
+
4386
4410
  /**
4387
4411
  * 获取小时
4388
4412
  * @date 2022年5月7日
4389
4413
  * @param {Date|string} [date] - 日期对象或日期字符串
4390
4414
  * @returns {number} 小时数(0-23)
4391
- */
4392
- var getHour = function getHour(date) {
4393
- if (!date) {
4394
- return new Date().getHours();
4395
- }
4396
- if (typeof date === 'string') {
4397
- date = new Date(date);
4398
- }
4399
- return date.getHours();
4400
- };
4401
-
4415
+ */
4416
+ const getHour = function (date) {
4417
+ if (!date) {
4418
+ return new Date().getHours();
4419
+ }
4420
+ if (typeof date === 'string') {
4421
+ date = new Date(date);
4422
+ }
4423
+ return date.getHours();
4424
+ };
4425
+
4402
4426
  /**
4403
4427
  * 获取分钟
4404
4428
  * @date 2022年5月7日
4405
4429
  * @param {Date|string} [date] - 日期对象或日期字符串
4406
4430
  * @returns {number} 分钟数(0-59)
4407
- */
4408
- var getMinute = function getMinute(date) {
4409
- if (!date) {
4410
- return new Date().getMinutes();
4411
- }
4412
- if (typeof date === 'string') {
4413
- date = new Date(date);
4414
- }
4415
- return date.getMinutes();
4416
- };
4417
-
4431
+ */
4432
+ const getMinute = function (date) {
4433
+ if (!date) {
4434
+ return new Date().getMinutes();
4435
+ }
4436
+ if (typeof date === 'string') {
4437
+ date = new Date(date);
4438
+ }
4439
+ return date.getMinutes();
4440
+ };
4441
+
4418
4442
  /**
4419
4443
  * 获取月份
4420
4444
  * @date 2022年5月7日
4421
4445
  * @param {Date|string} [date] - 日期对象或日期字符串
4422
4446
  * @returns {number} 月份数(1-12)
4423
- */
4424
- var getMonth = function getMonth(date) {
4425
- if (!date) {
4426
- return new Date().getMonth() + 1;
4427
- }
4428
- if (typeof date === 'string') {
4429
- date = new Date(date);
4430
- }
4431
- return date.getMonth() + 1;
4432
- };
4433
-
4447
+ */
4448
+ const getMonth = function (date) {
4449
+ if (!date) {
4450
+ return new Date().getMonth() + 1;
4451
+ }
4452
+ if (typeof date === 'string') {
4453
+ date = new Date(date);
4454
+ }
4455
+ return date.getMonth() + 1;
4456
+ };
4457
+
4434
4458
  /**
4435
4459
  * 获取秒
4436
4460
  * @date 2022年5月7日
4437
4461
  * @param {Date|string} [date] - 日期对象或日期字符串
4438
4462
  * @returns {number} 秒数(0-59)
4439
- */
4440
- var getSecond = function getSecond(date) {
4441
- if (!date) {
4442
- return new Date().getSeconds();
4443
- }
4444
- if (typeof date === 'string') {
4445
- date = new Date(date);
4446
- }
4447
- return date.getSeconds();
4448
- };
4449
-
4463
+ */
4464
+ const getSecond = function (date) {
4465
+ if (!date) {
4466
+ return new Date().getSeconds();
4467
+ }
4468
+ if (typeof date === 'string') {
4469
+ date = new Date(date);
4470
+ }
4471
+ return date.getSeconds();
4472
+ };
4473
+
4450
4474
  /**
4451
4475
  * 获取星期几
4452
4476
  * @date 2022年5月7日
4453
4477
  * @param {Date|string} [date] - 日期对象或日期字符串
4454
4478
  * @returns {number} 星期几(0-6,0表示星期日)
4455
- */
4456
- var getWeekday = function getWeekday(date) {
4457
- if (!date) {
4458
- return new Date().getDay();
4459
- }
4460
- if (typeof date === 'string') {
4461
- date = new Date(date);
4462
- }
4463
- return date.getDay();
4464
- };
4465
-
4479
+ */
4480
+ const getWeekday = function (date) {
4481
+ if (!date) {
4482
+ return new Date().getDay();
4483
+ }
4484
+ if (typeof date === 'string') {
4485
+ date = new Date(date);
4486
+ }
4487
+ return date.getDay();
4488
+ };
4489
+
4490
+
4466
4491
  /**
4467
4492
  * @desc 获取上午/下午/晚上
4468
4493
  * @author huangbo
4469
4494
  * @date 2022年5月7日
4470
4495
  * @param {String} [time] - 时间
4471
- **/
4472
- var timeCycle = function timeCycle(time) {
4473
- var hour = 0;
4474
- if (!time) {
4475
- hour = new Date().getHours();
4476
- } else if (typeof time === 'string') {
4477
- // 从时间字符串中提取小时
4478
- var match = time.match(/^(\d{1,2})/);
4479
- if (match) {
4480
- hour = parseInt(match[1], 10);
4481
- }
4482
- } else if (typeof time === 'number') {
4483
- hour = time;
4484
- }
4485
- // 判断时间段
4486
- if (hour >= 5 && hour < 12) {
4487
- return '上午';
4488
- } else if (hour >= 12 && hour < 18) {
4489
- return '下午';
4490
- } else {
4491
- return '晚上';
4492
- }
4496
+ **/
4497
+ const timeCycle = function (time) {
4498
+ let hour = 0;
4499
+ if (!time) {
4500
+ hour = new Date().getHours();
4501
+ } else if (typeof time === 'string') {
4502
+ // 从时间字符串中提取小时
4503
+ const match = time.match(/^(\d{1,2})/);
4504
+ if (match) {
4505
+ hour = parseInt(match[1], 10);
4506
+ }
4507
+ } else if (typeof time === 'number') {
4508
+ hour = time;
4509
+ }
4510
+ // 判断时间段
4511
+ if (hour >= 5 && hour < 12) {
4512
+ return '上午';
4513
+ } else if (hour >= 12 && hour < 18) {
4514
+ return '下午';
4515
+ } else {
4516
+ return '晚上';
4517
+ }
4493
4518
  };
4494
4519
 
4495
4520
  /***/ }),
@@ -4501,7 +4526,14 @@ module.exports = require("lodash/set");
4501
4526
 
4502
4527
  /***/ }),
4503
4528
 
4504
- /***/ 207:
4529
+ /***/ 21:
4530
+ /***/ (function(module, exports) {
4531
+
4532
+ module.exports = require("lodash/cloneDeep");
4533
+
4534
+ /***/ }),
4535
+
4536
+ /***/ 212:
4505
4537
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4506
4538
 
4507
4539
  "use strict";
@@ -4618,18 +4650,18 @@ var clickoutside = __webpack_require__(22);
4618
4650
  var emitter = __webpack_require__(10);
4619
4651
 
4620
4652
  // EXTERNAL MODULE: ./src/mixins/migrating.js
4621
- var migrating = __webpack_require__(27);
4653
+ var migrating = __webpack_require__(28);
4622
4654
 
4623
4655
  // EXTERNAL MODULE: external "eoss/lib/button"
4624
- var button_ = __webpack_require__(31);
4656
+ var button_ = __webpack_require__(27);
4625
4657
  var button_default = /*#__PURE__*/__webpack_require__.n(button_);
4626
4658
 
4627
4659
  // EXTERNAL MODULE: external "eoss/lib/button-group"
4628
- var button_group_ = __webpack_require__(86);
4660
+ var button_group_ = __webpack_require__(87);
4629
4661
  var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
4630
4662
 
4631
4663
  // EXTERNAL MODULE: external "eoss/lib/dropdown-menu"
4632
- var dropdown_menu_ = __webpack_require__(93);
4664
+ var dropdown_menu_ = __webpack_require__(96);
4633
4665
  var dropdown_menu_default = /*#__PURE__*/__webpack_require__.n(dropdown_menu_);
4634
4666
 
4635
4667
  // EXTERNAL MODULE: ./src/utils/util.js
@@ -5340,13 +5372,6 @@ dropdown.install = function (Vue) {
5340
5372
 
5341
5373
  /***/ }),
5342
5374
 
5343
- /***/ 21:
5344
- /***/ (function(module, exports) {
5345
-
5346
- module.exports = require("lodash/cloneDeep");
5347
-
5348
- /***/ }),
5349
-
5350
5375
  /***/ 22:
5351
5376
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5352
5377
 
@@ -5469,6 +5494,13 @@ function createDocumentHandler(el, binding, vnode) {
5469
5494
  /***/ }),
5470
5495
 
5471
5496
  /***/ 27:
5497
+ /***/ (function(module, exports) {
5498
+
5499
+ module.exports = require("eoss/lib/button");
5500
+
5501
+ /***/ }),
5502
+
5503
+ /***/ 28:
5472
5504
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5473
5505
 
5474
5506
  "use strict";
@@ -5514,14 +5546,14 @@ function createDocumentHandler(el, binding, vnode) {
5514
5546
  var definedEvents = componentOptions.listeners || {};
5515
5547
 
5516
5548
  for (var propName in definedProps) {
5517
- propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "J"])(propName); // compatible with camel case
5549
+ propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(propName); // compatible with camel case
5518
5550
  if (props[propName]) {
5519
5551
  console.warn('[Eoss Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
5520
5552
  }
5521
5553
  }
5522
5554
 
5523
5555
  for (var eventName in definedEvents) {
5524
- eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "J"])(eventName); // compatible with camel case
5556
+ eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(eventName); // compatible with camel case
5525
5557
  if (events[eventName]) {
5526
5558
  console.warn('[Eoss Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
5527
5559
  }
@@ -5643,13 +5675,6 @@ function normalizeComponent(
5643
5675
  }
5644
5676
 
5645
5677
 
5646
- /***/ }),
5647
-
5648
- /***/ 31:
5649
- /***/ (function(module, exports) {
5650
-
5651
- module.exports = require("eoss/lib/button");
5652
-
5653
5678
  /***/ }),
5654
5679
 
5655
5680
  /***/ 4:
@@ -5992,14 +6017,14 @@ module.exports = require("eoss/lib/message-box");
5992
6017
 
5993
6018
  /***/ }),
5994
6019
 
5995
- /***/ 86:
6020
+ /***/ 87:
5996
6021
  /***/ (function(module, exports) {
5997
6022
 
5998
6023
  module.exports = require("eoss/lib/button-group");
5999
6024
 
6000
6025
  /***/ }),
6001
6026
 
6002
- /***/ 93:
6027
+ /***/ 96:
6003
6028
  /***/ (function(module, exports) {
6004
6029
 
6005
6030
  module.exports = require("eoss/lib/dropdown-menu");