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/tabs.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 = 177);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 182);
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',
@@ -3337,7 +3337,7 @@ var getColor = function getColor($color, $n) {
3337
3337
  var getLightness = function getLightness($v, $i, $isLight) {
3338
3338
  var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3339
3339
  $value = $value < 1 ? $value : 1;
3340
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($value, 2);
3340
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
3341
3341
  };
3342
3342
 
3343
3343
  /**
@@ -3361,7 +3361,7 @@ var getSaturation = function getSaturation($s, $i, $isLight) {
3361
3361
  $saturation = 0.1;
3362
3362
  }
3363
3363
  $saturation = $saturation > 0.06 ? $saturation : 0.06;
3364
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($saturation, 2);
3364
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
3365
3365
  };
3366
3366
 
3367
3367
  /**
@@ -3475,7 +3475,14 @@ var getRgb = function getRgb($color) {
3475
3475
 
3476
3476
  /***/ }),
3477
3477
 
3478
- /***/ 177:
3478
+ /***/ 17:
3479
+ /***/ (function(module, exports) {
3480
+
3481
+ module.exports = require("eoss/lib/loading");
3482
+
3483
+ /***/ }),
3484
+
3485
+ /***/ 182:
3479
3486
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3480
3487
 
3481
3488
  "use strict";
@@ -3483,7 +3490,7 @@ var getRgb = function getRgb($color) {
3483
3490
  __webpack_require__.r(__webpack_exports__);
3484
3491
 
3485
3492
  // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
3486
- var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(92);
3493
+ var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(94);
3487
3494
  var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
3488
3495
 
3489
3496
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-bar.vue?vue&type=template&id=61310203&
@@ -4714,13 +4721,6 @@ tabs.install = function (Vue) {
4714
4721
 
4715
4722
  /***/ }),
4716
4723
 
4717
- /***/ 18:
4718
- /***/ (function(module, exports) {
4719
-
4720
- module.exports = require("eoss/lib/loading");
4721
-
4722
- /***/ }),
4723
-
4724
4724
  /***/ 19:
4725
4725
  /***/ (function(module, exports) {
4726
4726
 
@@ -4778,736 +4778,759 @@ module.exports = require("lodash/get");
4778
4778
  /* unused harmony export getSecond */
4779
4779
  /* unused harmony export getWeekday */
4780
4780
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return timeCycle; });
4781
-
4782
-
4781
+ /* Modified from https://github.com/taylorhakes/fecha
4782
+ *
4783
+ * The MIT License (MIT)
4784
+ *
4785
+ * Copyright (c) 2015 Taylor Hakes
4786
+ *
4787
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4788
+ * of this software and associated documentation files (the "Software"), to deal
4789
+ * in the Software without restriction, including without limitation the rights
4790
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
4791
+ * copies of the Software, and to permit persons to whom the Software is
4792
+ * furnished to do so, subject to the following conditions:
4793
+ *
4794
+ * The above copyright notice and this permission notice shall be included in all
4795
+ * copies or substantial portions of the Software.
4796
+ *
4797
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4798
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4799
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4800
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4801
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
4802
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
4803
+ * SOFTWARE.
4804
+ */
4805
+
4806
+ /*eslint-disable*/
4807
+ // 把 YYYY-MM-DD 改成了 yyyy-MM-dd
4808
+
4809
+
4783
4810
  /**
4784
4811
  * Parse or format dates
4785
4812
  * @class fecha
4786
- */
4787
- var fecha = {};
4788
- var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
4789
- var twoDigits = '\\d\\d?';
4790
- var threeDigits = '\\d{3}';
4791
- var fourDigits = '\\d{4}';
4792
- var word = '[^\\s]+';
4793
- var literal = /\[([^]*?)\]/gm;
4794
- var noop = function noop() {};
4795
-
4796
- function regexEscape(str) {
4797
- return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
4798
- }
4799
-
4800
- function shorten(arr, sLen) {
4801
- var newArr = [];
4802
- for (var i = 0, len = arr.length; i < len; i++) {
4803
- newArr.push(arr[i].substr(0, sLen));
4804
- }
4805
- return newArr;
4806
- }
4807
-
4808
- function monthUpdate() {
4809
- return function (d, v) {
4810
- var index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
4811
- if (~index) {
4812
- d.month = index;
4813
- }
4814
- };
4815
- }
4816
-
4817
- function pad(val, len) {
4818
- val = String(val);
4819
- len = len || 2;
4820
- while (val.length < len) {
4821
- val = '0' + val;
4822
- }
4823
- return val;
4824
- }
4825
-
4826
- // 直接使用中文日期名称常量
4827
- var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
4828
- var monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
4829
- var monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
4830
- var dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
4831
- var amPm = ['上午', '下午'];
4832
- var DoFn = function DoFn(D) {
4833
- return D + '日';
4834
- };
4835
-
4836
- var formatFlags = {
4837
- D: function D(dateObj) {
4838
- return dateObj.getDay();
4839
- },
4840
- DD: function DD(dateObj) {
4841
- return pad(dateObj.getDay());
4842
- },
4843
- Do: function Do(dateObj) {
4844
- return DoFn(dateObj.getDate());
4845
- },
4846
- d: function d(dateObj) {
4847
- return dateObj.getDate();
4848
- },
4849
- dd: function dd(dateObj) {
4850
- return pad(dateObj.getDate());
4851
- },
4852
- ddd: function ddd(dateObj) {
4853
- return dayNamesShort[dateObj.getDay()];
4854
- },
4855
- dddd: function dddd(dateObj) {
4856
- return dayNames[dateObj.getDay()];
4857
- },
4858
- M: function M(dateObj) {
4859
- return dateObj.getMonth() + 1;
4860
- },
4861
- MM: function MM(dateObj) {
4862
- return pad(dateObj.getMonth() + 1);
4863
- },
4864
- MMM: function MMM(dateObj) {
4865
- return monthNamesShort[dateObj.getMonth()];
4866
- },
4867
- MMMM: function MMMM(dateObj) {
4868
- return monthNames[dateObj.getMonth()];
4869
- },
4870
- yy: function yy(dateObj) {
4871
- return pad(String(dateObj.getFullYear()), 4).substr(2);
4872
- },
4873
- yyyy: function yyyy(dateObj) {
4874
- return pad(dateObj.getFullYear(), 4);
4875
- },
4876
- h: function h(dateObj) {
4877
- return dateObj.getHours() % 12 || 12;
4878
- },
4879
- hh: function hh(dateObj) {
4880
- return pad(dateObj.getHours() % 12 || 12);
4881
- },
4882
- H: function H(dateObj) {
4883
- return dateObj.getHours();
4884
- },
4885
- HH: function HH(dateObj) {
4886
- return pad(dateObj.getHours());
4887
- },
4888
- m: function m(dateObj) {
4889
- return dateObj.getMinutes();
4890
- },
4891
- mm: function mm(dateObj) {
4892
- return pad(dateObj.getMinutes());
4893
- },
4894
- s: function s(dateObj) {
4895
- return dateObj.getSeconds();
4896
- },
4897
- ss: function ss(dateObj) {
4898
- return pad(dateObj.getSeconds());
4899
- },
4900
- S: function S(dateObj) {
4901
- return Math.round(dateObj.getMilliseconds() / 100);
4902
- },
4903
- SS: function SS(dateObj) {
4904
- return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
4905
- },
4906
- SSS: function SSS(dateObj) {
4907
- return pad(dateObj.getMilliseconds(), 3);
4908
- },
4909
- a: function a(dateObj) {
4910
- return dateObj.getHours() < 12 ? '上午' : '下午';
4911
- },
4912
- A: function A(dateObj) {
4913
- return dateObj.getHours() < 12 ? '上午' : '下午';
4914
- },
4915
- ZZ: function ZZ(dateObj) {
4916
- var o = dateObj.getTimezoneOffset();
4917
- return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
4918
- }
4919
- };
4920
-
4921
- var parseFlags = {
4922
- d: [twoDigits, function (d, v) {
4923
- d.day = v;
4924
- }],
4925
- Do: [twoDigits + word, function (d, v) {
4926
- d.day = parseInt(v, 10);
4927
- }],
4928
- M: [twoDigits, function (d, v) {
4929
- d.month = v - 1;
4930
- }],
4931
- yy: [twoDigits, function (d, v) {
4932
- var da = new Date(),
4933
- cent = +('' + da.getFullYear()).substr(0, 2);
4934
- d.year = '' + (v > 68 ? cent - 1 : cent) + v;
4935
- }],
4936
- h: [twoDigits, function (d, v) {
4937
- d.hour = v;
4938
- }],
4939
- m: [twoDigits, function (d, v) {
4940
- d.minute = v;
4941
- }],
4942
- s: [twoDigits, function (d, v) {
4943
- d.second = v;
4944
- }],
4945
- yyyy: [fourDigits, function (d, v) {
4946
- d.year = v;
4947
- }],
4948
- S: ['\\d', function (d, v) {
4949
- d.millisecond = v * 100;
4950
- }],
4951
- SS: ['\\d{2}', function (d, v) {
4952
- d.millisecond = v * 10;
4953
- }],
4954
- SSS: [threeDigits, function (d, v) {
4955
- d.millisecond = v;
4956
- }],
4957
- D: [twoDigits, noop],
4958
- ddd: [word, noop],
4959
- MMM: [word, monthUpdate('monthNamesShort')],
4960
- MMMM: [word, monthUpdate('monthNames')],
4961
- a: [word, function (d, v) {
4962
- var val = v.toLowerCase();
4963
- if (val === '上午') {
4964
- d.isPm = false;
4965
- } else if (val === '下午') {
4966
- d.isPm = true;
4967
- }
4968
- }],
4969
- ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
4970
- var parts = (v + '').match(/([+-]|\d\d)/gi),
4971
- minutes = void 0;
4972
-
4973
- if (parts) {
4974
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
4975
- d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
4976
- }
4977
- }]
4978
- };
4979
- parseFlags.dd = parseFlags.d;
4980
- parseFlags.dddd = parseFlags.ddd;
4981
- parseFlags.DD = parseFlags.D;
4982
- parseFlags.mm = parseFlags.m;
4983
- parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
4984
- parseFlags.MM = parseFlags.M;
4985
- parseFlags.ss = parseFlags.s;
4986
- parseFlags.A = parseFlags.a;
4987
-
4988
- // Some common format strings
4989
- fecha.masks = {
4990
- default: 'ddd MMM dd yyyy HH:mm:ss',
4991
- shortDate: 'M/D/yy',
4992
- mediumDate: 'MMM d, yyyy',
4993
- longDate: 'MMMM d, yyyy',
4994
- fullDate: 'dddd, MMMM d, yyyy',
4995
- shortTime: 'HH:mm',
4996
- mediumTime: 'HH:mm:ss',
4997
- longTime: 'HH:mm:ss.SSS'
4998
- };
4999
-
4813
+ */
4814
+ const fecha = {};
4815
+ const token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
4816
+ const twoDigits = '\\d\\d?';
4817
+ const threeDigits = '\\d{3}';
4818
+ const fourDigits = '\\d{4}';
4819
+ const word = '[^\\s]+';
4820
+ const literal = /\[([^]*?)\]/gm;
4821
+ const noop = function () {};
4822
+
4823
+ function regexEscape(str) {
4824
+ return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
4825
+ }
4826
+
4827
+ function shorten(arr, sLen) {
4828
+ const newArr = [];
4829
+ for (let i = 0, len = arr.length; i < len; i++) {
4830
+ newArr.push(arr[i].substr(0, sLen));
4831
+ }
4832
+ return newArr;
4833
+ }
4834
+
4835
+ function monthUpdate() {
4836
+ return function (d, v) {
4837
+ const index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
4838
+ if (~index) {
4839
+ d.month = index;
4840
+ }
4841
+ };
4842
+ }
4843
+
4844
+ function pad(val, len) {
4845
+ val = String(val);
4846
+ len = len || 2;
4847
+ while (val.length < len) {
4848
+ val = '0' + val;
4849
+ }
4850
+ return val;
4851
+ }
4852
+
4853
+ // 直接使用中文日期名称常量
4854
+ const dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
4855
+ const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
4856
+ const monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
4857
+ const dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
4858
+ const amPm = ['上午', '下午'];
4859
+ const DoFn = function DoFn(D) {
4860
+ return D + '日';
4861
+ };
4862
+
4863
+ const formatFlags = {
4864
+ D: function(dateObj) {
4865
+ return dateObj.getDay();
4866
+ },
4867
+ DD: function(dateObj) {
4868
+ return pad(dateObj.getDay());
4869
+ },
4870
+ Do: function(dateObj) {
4871
+ return DoFn(dateObj.getDate());
4872
+ },
4873
+ d: function(dateObj) {
4874
+ return dateObj.getDate();
4875
+ },
4876
+ dd: function(dateObj) {
4877
+ return pad(dateObj.getDate());
4878
+ },
4879
+ ddd: function(dateObj) {
4880
+ return dayNamesShort[dateObj.getDay()];
4881
+ },
4882
+ dddd: function(dateObj) {
4883
+ return dayNames[dateObj.getDay()];
4884
+ },
4885
+ M: function(dateObj) {
4886
+ return dateObj.getMonth() + 1;
4887
+ },
4888
+ MM: function(dateObj) {
4889
+ return pad(dateObj.getMonth() + 1);
4890
+ },
4891
+ MMM: function(dateObj) {
4892
+ return monthNamesShort[dateObj.getMonth()];
4893
+ },
4894
+ MMMM: function(dateObj) {
4895
+ return monthNames[dateObj.getMonth()];
4896
+ },
4897
+ yy: function(dateObj) {
4898
+ return pad(String(dateObj.getFullYear()), 4).substr(2);
4899
+ },
4900
+ yyyy: function(dateObj) {
4901
+ return pad(dateObj.getFullYear(), 4);
4902
+ },
4903
+ h: function(dateObj) {
4904
+ return dateObj.getHours() % 12 || 12;
4905
+ },
4906
+ hh: function(dateObj) {
4907
+ return pad(dateObj.getHours() % 12 || 12);
4908
+ },
4909
+ H: function(dateObj) {
4910
+ return dateObj.getHours();
4911
+ },
4912
+ HH: function(dateObj) {
4913
+ return pad(dateObj.getHours());
4914
+ },
4915
+ m: function(dateObj) {
4916
+ return dateObj.getMinutes();
4917
+ },
4918
+ mm: function(dateObj) {
4919
+ return pad(dateObj.getMinutes());
4920
+ },
4921
+ s: function(dateObj) {
4922
+ return dateObj.getSeconds();
4923
+ },
4924
+ ss: function(dateObj) {
4925
+ return pad(dateObj.getSeconds());
4926
+ },
4927
+ S: function(dateObj) {
4928
+ return Math.round(dateObj.getMilliseconds() / 100);
4929
+ },
4930
+ SS: function(dateObj) {
4931
+ return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
4932
+ },
4933
+ SSS: function(dateObj) {
4934
+ return pad(dateObj.getMilliseconds(), 3);
4935
+ },
4936
+ a: function(dateObj) {
4937
+ return dateObj.getHours() < 12 ? '上午' : '下午';
4938
+ },
4939
+ A: function(dateObj) {
4940
+ return dateObj.getHours() < 12 ? '上午' : '下午';
4941
+ },
4942
+ ZZ: function(dateObj) {
4943
+ const o = dateObj.getTimezoneOffset();
4944
+ return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
4945
+ }
4946
+ };
4947
+
4948
+ const parseFlags = {
4949
+ d: [twoDigits, function (d, v) {
4950
+ d.day = v;
4951
+ }],
4952
+ Do: [twoDigits + word, function (d, v) {
4953
+ d.day = parseInt(v, 10);
4954
+ }],
4955
+ M: [twoDigits, function (d, v) {
4956
+ d.month = v - 1;
4957
+ }],
4958
+ yy: [twoDigits, function (d, v) {
4959
+ const da = new Date(), cent = +('' + da.getFullYear()).substr(0, 2);
4960
+ d.year = '' + (v > 68 ? cent - 1 : cent) + v;
4961
+ }],
4962
+ h: [twoDigits, function (d, v) {
4963
+ d.hour = v;
4964
+ }],
4965
+ m: [twoDigits, function (d, v) {
4966
+ d.minute = v;
4967
+ }],
4968
+ s: [twoDigits, function (d, v) {
4969
+ d.second = v;
4970
+ }],
4971
+ yyyy: [fourDigits, function (d, v) {
4972
+ d.year = v;
4973
+ }],
4974
+ S: ['\\d', function (d, v) {
4975
+ d.millisecond = v * 100;
4976
+ }],
4977
+ SS: ['\\d{2}', function (d, v) {
4978
+ d.millisecond = v * 10;
4979
+ }],
4980
+ SSS: [threeDigits, function (d, v) {
4981
+ d.millisecond = v;
4982
+ }],
4983
+ D: [twoDigits, noop],
4984
+ ddd: [word, noop],
4985
+ MMM: [word, monthUpdate('monthNamesShort')],
4986
+ MMMM: [word, monthUpdate('monthNames')],
4987
+ a: [word, function (d, v) {
4988
+ const val = v.toLowerCase();
4989
+ if (val === '上午') {
4990
+ d.isPm = false;
4991
+ } else if (val === '下午') {
4992
+ d.isPm = true;
4993
+ }
4994
+ }],
4995
+ ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
4996
+ let parts = (v + '').match(/([+-]|\d\d)/gi), minutes;
4997
+
4998
+ if (parts) {
4999
+ minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
5000
+ d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
5001
+ }
5002
+ }]
5003
+ };
5004
+ parseFlags.dd = parseFlags.d;
5005
+ parseFlags.dddd = parseFlags.ddd;
5006
+ parseFlags.DD = parseFlags.D;
5007
+ parseFlags.mm = parseFlags.m;
5008
+ parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
5009
+ parseFlags.MM = parseFlags.M;
5010
+ parseFlags.ss = parseFlags.s;
5011
+ parseFlags.A = parseFlags.a;
5012
+
5013
+
5014
+ // Some common format strings
5015
+ fecha.masks = {
5016
+ default: 'ddd MMM dd yyyy HH:mm:ss',
5017
+ shortDate: 'M/D/yy',
5018
+ mediumDate: 'MMM d, yyyy',
5019
+ longDate: 'MMMM d, yyyy',
5020
+ fullDate: 'dddd, MMMM d, yyyy',
5021
+ shortTime: 'HH:mm',
5022
+ mediumTime: 'HH:mm:ss',
5023
+ longTime: 'HH:mm:ss.SSS'
5024
+ };
5025
+
5000
5026
  /***
5001
5027
  * Format a date
5002
5028
  * @method format
5003
5029
  * @param {Date|number} dateObj
5004
5030
  * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
5005
- */
5006
- fecha.format = function (dateObj, mask) {
5007
- if (typeof dateObj === 'number') {
5008
- dateObj = new Date(dateObj);
5009
- }
5010
-
5011
- if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
5012
- throw new Error('Invalid Date in fecha.format');
5013
- }
5014
-
5015
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
5016
-
5017
- var literals = [];
5018
-
5019
- // Make literals inactive by replacing them with ??
5020
- mask = mask.replace(literal, function ($0, $1) {
5021
- literals.push($1);
5022
- return '@@@';
5023
- });
5024
- // Apply formatting rules
5025
- mask = mask.replace(token, function ($0) {
5026
- return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
5027
- });
5028
- // Inline literal values back into the formatted value
5029
- return mask.replace(/@@@/g, function () {
5030
- return literals.shift();
5031
- });
5032
- };
5033
-
5031
+ */
5032
+ fecha.format = function (dateObj, mask) {
5033
+ if (typeof dateObj === 'number') {
5034
+ dateObj = new Date(dateObj);
5035
+ }
5036
+
5037
+ if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
5038
+ throw new Error('Invalid Date in fecha.format');
5039
+ }
5040
+
5041
+ mask = fecha.masks[mask] || mask || fecha.masks['default'];
5042
+
5043
+ const literals = [];
5044
+
5045
+ // Make literals inactive by replacing them with ??
5046
+ mask = mask.replace(literal, function($0, $1) {
5047
+ literals.push($1);
5048
+ return '@@@';
5049
+ });
5050
+ // Apply formatting rules
5051
+ mask = mask.replace(token, function ($0) {
5052
+ return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
5053
+ });
5054
+ // Inline literal values back into the formatted value
5055
+ return mask.replace(/@@@/g, function() {
5056
+ return literals.shift();
5057
+ });
5058
+ };
5059
+
5034
5060
  /**
5035
5061
  * Parse a date string into an object, changes - into /
5036
5062
  * @method parse
5037
5063
  * @param {string} dateStr Date string
5038
5064
  * @param {string} format Date parse format
5039
5065
  * @returns {Date|boolean}
5040
- */
5041
- fecha.parse = function (dateStr, format) {
5042
- if (typeof format !== 'string') {
5043
- throw new Error('Invalid format in fecha.parse');
5044
- }
5045
-
5046
- format = fecha.masks[format] || format;
5047
-
5048
- // Avoid regular expression denial of service, fail early for really long strings
5049
- // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
5050
- if (dateStr.length > 1000) {
5051
- return null;
5052
- }
5053
-
5054
- var dateInfo = {};
5055
- var parseInfo = [];
5056
- var literals = [];
5057
- format = format.replace(literal, function ($0, $1) {
5058
- literals.push($1);
5059
- return '@@@';
5060
- });
5061
- var newFormat = regexEscape(format).replace(token, function ($0) {
5062
- if (parseFlags[$0]) {
5063
- var info = parseFlags[$0];
5064
- parseInfo.push(info[1]);
5065
- return '(' + info[0] + ')';
5066
- }
5067
-
5068
- return $0;
5069
- });
5070
- newFormat = newFormat.replace(/@@@/g, function () {
5071
- return literals.shift();
5072
- });
5073
- var matches = dateStr.match(new RegExp(newFormat, 'i'));
5074
- if (!matches) {
5075
- return null;
5076
- }
5077
-
5078
- for (var i = 1; i < matches.length; i++) {
5079
- parseInfo[i - 1](dateInfo, matches[i]);
5080
- }
5081
-
5082
- var today = new Date();
5083
- if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
5084
- dateInfo.hour = +dateInfo.hour + 12;
5085
- } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
5086
- dateInfo.hour = 0;
5087
- }
5088
-
5089
- var date = void 0;
5090
- if (dateInfo.timezoneOffset != null) {
5091
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
5092
- 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));
5093
- } else {
5094
- 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);
5095
- }
5096
- return date;
5097
- };
5098
-
5099
- // 导出fecha对象
5100
-
5101
-
5102
- // 以下是从date-util.js合并的函数
5103
- var newArray = function newArray(start, end) {
5104
- var result = [];
5105
- for (var i = start; i <= end; i++) {
5106
- result.push(i);
5107
- }
5108
- return result;
5109
- };
5110
-
5111
- var getSettings = function getSettings() {
5112
- return {
5113
- dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
5114
- dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
5115
- monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
5116
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
5117
- amPm: ['上午', '下午']
5118
- };
5119
- };
5120
-
5121
- var toDate = function toDate(date) {
5122
- return isDate(date) ? new Date(date) : null;
5123
- };
5124
-
5125
- var isDate = function isDate(date) {
5126
- if (date === null || date === undefined) return false;
5127
- if (isNaN(new Date(date).getTime())) return false;
5128
- if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
5129
- return true;
5130
- };
5131
-
5132
- var isDateObject = function isDateObject(val) {
5133
- return val instanceof Date;
5134
- };
5135
-
5136
- var formatDate = function formatDate(date) {
5137
- var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
5138
-
5139
- // 处理多种输入类型
5140
- if (!date) return '';
5141
-
5142
- // 如果是时间戳,转成日期对象
5143
- if (typeof date === 'number') {
5144
- date = new Date(date);
5145
- }
5146
- // 如果是字符串,转成日期对象
5147
- if (typeof date === 'string') {
5148
- date = new Date(date);
5149
- }
5150
-
5151
- // 调用toDate进一步验证和转换
5152
- date = toDate(date);
5153
- if (!date) return '';
5154
-
5155
- // 兼容大写和小写的格式标记
5156
- // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
5157
- var lowercaseFormat = format.replace(/YYYY/g, 'yyyy').replace(/D/g, 'd');
5158
-
5159
- // 使用fecha库进行格式化,支持中文配置
5160
- var str = fecha.format(date, lowercaseFormat, getSettings());
5161
- return str;
5162
- };
5163
-
5164
- var parseDate = function parseDate(string, format) {
5165
- return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
5166
- };
5167
-
5168
- var getDayCountOfMonth = function getDayCountOfMonth(year, month) {
5169
- if (month === 3 || month === 5 || month === 8 || month === 10) {
5170
- return 30;
5171
- }
5172
-
5173
- if (month === 1) {
5174
- if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
5175
- return 29;
5176
- } else {
5177
- return 28;
5178
- }
5179
- }
5180
-
5181
- return 31;
5182
- };
5183
-
5184
- var getDayCountOfYear = function getDayCountOfYear(year) {
5185
- var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
5186
- return isLeapYear ? 366 : 365;
5187
- };
5188
-
5189
- var getFirstDayOfMonth = function getFirstDayOfMonth(date) {
5190
- var temp = new Date(date.getTime());
5191
- temp.setDate(1);
5192
- return temp.getDay();
5193
- };
5194
-
5195
- // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
5196
- // {prev, next} Date should work for Daylight Saving Time
5197
- // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
5198
- var prevDate = function prevDate(date) {
5199
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5200
-
5201
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
5202
- };
5203
-
5204
- var nextDate = function nextDate(date) {
5205
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5206
-
5207
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
5208
- };
5209
-
5210
- var getStartDateOfMonth = function getStartDateOfMonth(year, month) {
5211
- var result = new Date(year, month, 1);
5212
- var day = result.getDay();
5213
-
5214
- if (day === 0) {
5215
- return prevDate(result, 7);
5216
- } else {
5217
- return prevDate(result, day);
5218
- }
5219
- };
5220
-
5221
- var getWeekNumber = function getWeekNumber(date) {
5222
- // 支持多种输入类型
5223
- if (!date || !isDate(date)) {
5224
- date = new Date();
5225
- }
5226
- if (typeof date === 'string') {
5227
- date = new Date(date);
5228
- }
5229
-
5230
- // 验证日期有效性
5231
- if (!isDate(date)) return null;
5232
-
5233
- var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
5234
- // 设置为最近的星期四:当前日期 + 4 - 当前星期数
5235
- // 将星期日的星期数设为7
5236
- d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
5237
- // 获取当年的第一天
5238
- var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
5239
- // 计算到最近的星期四的完整周数
5240
- var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
5241
- // 返回周数
5242
- return weekNo;
5243
- };
5244
-
5245
- var getRangeHours = function getRangeHours(ranges) {
5246
- var hours = [];
5247
- var disabledHours = [];
5248
-
5249
- (ranges || []).forEach(function (range) {
5250
- var value = range.map(function (date) {
5251
- return date.getHours();
5252
- });
5253
-
5254
- disabledHours = disabledHours.concat(newArray(value[0], value[1]));
5255
- });
5256
-
5257
- if (disabledHours.length) {
5258
- for (var i = 0; i < 24; i++) {
5259
- hours[i] = disabledHours.indexOf(i) === -1;
5260
- }
5261
- } else {
5262
- for (var _i = 0; _i < 24; _i++) {
5263
- hours[_i] = false;
5264
- }
5265
- }
5266
-
5267
- return hours;
5268
- };
5269
-
5270
- var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
5271
- if (amount <= 0) return [];
5272
- var temp = new Date(date.getTime());
5273
- temp.setDate(0);
5274
- var lastDay = temp.getDate();
5275
- return range(amount).map(function (_, index) {
5276
- return lastDay - (amount - index - 1);
5277
- });
5278
- };
5279
-
5280
- var getMonthDays = function getMonthDays(date) {
5281
- var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
5282
- var days = temp.getDate();
5283
- return range(days).map(function (_, index) {
5284
- return index + 1;
5285
- });
5286
- };
5287
-
5288
- function setRangeData(arr, start, end, value) {
5289
- for (var i = start; i < end; i++) {
5290
- arr[i] = value;
5291
- }
5292
- }
5293
-
5294
- var getRangeMinutes = function getRangeMinutes(ranges, hour) {
5295
- var minutes = new Array(60);
5296
-
5297
- if (ranges.length > 0) {
5298
- ranges.forEach(function (range) {
5299
- var start = range[0];
5300
- var end = range[1];
5301
- var startHour = start.getHours();
5302
- var startMinute = start.getMinutes();
5303
- var endHour = end.getHours();
5304
- var endMinute = end.getMinutes();
5305
- if (startHour === hour && endHour !== hour) {
5306
- setRangeData(minutes, startMinute, 60, true);
5307
- } else if (startHour === hour && endHour === hour) {
5308
- setRangeData(minutes, startMinute, endMinute + 1, true);
5309
- } else if (startHour !== hour && endHour === hour) {
5310
- setRangeData(minutes, 0, endMinute + 1, true);
5311
- } else if (startHour < hour && endHour > hour) {
5312
- setRangeData(minutes, 0, 60, true);
5313
- }
5314
- });
5315
- } else {
5316
- setRangeData(minutes, 0, 60, true);
5317
- }
5318
- return minutes;
5319
- };
5320
-
5321
- var range = function range(n) {
5322
- // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
5323
- return Array.apply(null, { length: n }).map(function (_, n) {
5324
- return n;
5325
- });
5326
- };
5327
-
5328
- var modifyDate = function modifyDate(date, y, m, d) {
5329
- return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
5330
- };
5331
-
5332
- var modifyTime = function modifyTime(date, h, m, s) {
5333
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
5334
- };
5335
-
5336
- var modifyWithTimeString = function modifyWithTimeString(date, time) {
5337
- if (date == null || !time) {
5338
- return date;
5339
- }
5340
- time = parseDate(time, 'HH:mm:ss');
5341
- return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
5342
- };
5343
-
5344
- var clearTime = function clearTime(date) {
5345
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
5346
- };
5347
-
5348
- var clearMilliseconds = function clearMilliseconds(date) {
5349
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
5350
- };
5351
-
5352
- var limitTimeRange = function limitTimeRange(date, ranges) {
5353
- var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
5354
-
5355
- // TODO: refactory a more elegant solution
5356
- if (ranges.length === 0) return date;
5357
- var normalizeDate = function normalizeDate(date) {
5358
- return fecha.parse(fecha.format(date, format), format);
5359
- };
5360
- var ndate = normalizeDate(date);
5361
- var nranges = ranges.map(function (range) {
5362
- return range.map(normalizeDate);
5363
- });
5364
- if (nranges.some(function (nrange) {
5365
- return ndate >= nrange[0] && ndate <= nrange[1];
5366
- })) return date;
5367
-
5368
- var minDate = nranges[0][0];
5369
- var maxDate = nranges[0][0];
5370
-
5371
- nranges.forEach(function (nrange) {
5372
- minDate = new Date(Math.min(nrange[0], minDate));
5373
- maxDate = new Date(Math.max(nrange[1], minDate));
5374
- });
5375
-
5376
- var ret = ndate < minDate ? minDate : maxDate;
5377
- // preserve Year/Month/Date
5378
- return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
5379
- };
5380
-
5381
- var timeWithinRange = function timeWithinRange(date, selectableRange, format) {
5382
- var limitedDate = limitTimeRange(date, selectableRange, format);
5383
- return limitedDate.getTime() === date.getTime();
5384
- };
5385
-
5386
- var changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
5387
- // clamp date to the number of days in `year`, `month`
5388
- // eg: (2010-1-31, 2010, 2) => 2010-2-28
5389
- var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
5390
- return modifyDate(date, year, month, monthDate);
5391
- };
5392
-
5393
- var prevMonth = function prevMonth(date) {
5394
- var year = date.getFullYear();
5395
- var month = date.getMonth();
5396
- return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
5397
- };
5398
-
5399
- var nextMonth = function nextMonth(date) {
5400
- var year = date.getFullYear();
5401
- var month = date.getMonth();
5402
- return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
5403
- };
5404
-
5405
- var prevYear = function prevYear(date) {
5406
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5407
-
5408
- var year = date.getFullYear();
5409
- var month = date.getMonth();
5410
- return changeYearMonthAndClampDate(date, year - amount, month);
5411
- };
5412
-
5413
- var nextYear = function nextYear(date) {
5414
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5415
-
5416
- var year = date.getFullYear();
5417
- var month = date.getMonth();
5418
- return changeYearMonthAndClampDate(date, year + amount, month);
5419
- };
5420
-
5421
- var extractDateFormat = function extractDateFormat(format) {
5422
- return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
5423
- };
5424
-
5425
- var extractTimeFormat = function extractTimeFormat(format) {
5426
- return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
5427
- };
5428
-
5429
- var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
5430
- return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
5431
- };
5432
-
5066
+ */
5067
+ fecha.parse = function (dateStr, format) {
5068
+ if (typeof format !== 'string') {
5069
+ throw new Error('Invalid format in fecha.parse');
5070
+ }
5071
+
5072
+ format = fecha.masks[format] || format;
5073
+
5074
+ // Avoid regular expression denial of service, fail early for really long strings
5075
+ // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
5076
+ if (dateStr.length > 1000) {
5077
+ return null;
5078
+ }
5079
+
5080
+ const dateInfo = {};
5081
+ const parseInfo = [];
5082
+ const literals = [];
5083
+ format = format.replace(literal, function($0, $1) {
5084
+ literals.push($1);
5085
+ return '@@@';
5086
+ });
5087
+ let newFormat = regexEscape(format).replace(token, function ($0) {
5088
+ if (parseFlags[$0]) {
5089
+ const info = parseFlags[$0];
5090
+ parseInfo.push(info[1]);
5091
+ return '(' + info[0] + ')';
5092
+ }
5093
+
5094
+ return $0;
5095
+ });
5096
+ newFormat = newFormat.replace(/@@@/g, function() {
5097
+ return literals.shift();
5098
+ });
5099
+ const matches = dateStr.match(new RegExp(newFormat, 'i'));
5100
+ if (!matches) {
5101
+ return null;
5102
+ }
5103
+
5104
+ for (let i = 1; i < matches.length; i++) {
5105
+ parseInfo[i - 1](dateInfo, matches[i]);
5106
+ }
5107
+
5108
+ const today = new Date();
5109
+ if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
5110
+ dateInfo.hour = +dateInfo.hour + 12;
5111
+ } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
5112
+ dateInfo.hour = 0;
5113
+ }
5114
+
5115
+ let date;
5116
+ if (dateInfo.timezoneOffset != null) {
5117
+ dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
5118
+ date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
5119
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
5120
+ } else {
5121
+ date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
5122
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
5123
+ }
5124
+ return date;
5125
+ };
5126
+
5127
+ // 导出fecha对象
5128
+
5129
+
5130
+ // 以下是从date-util.js合并的函数
5131
+ const newArray = function(start, end) {
5132
+ let result = [];
5133
+ for (let i = start; i <= end; i++) {
5134
+ result.push(i);
5135
+ }
5136
+ return result;
5137
+ };
5138
+
5139
+ const getSettings = () => {
5140
+ return {
5141
+ dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
5142
+ dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
5143
+ monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
5144
+ monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
5145
+ amPm: ['上午', '下午']
5146
+ };
5147
+ };
5148
+
5149
+ const toDate = function(date) {
5150
+ return isDate(date) ? new Date(date) : null;
5151
+ };
5152
+
5153
+ const isDate = function(date) {
5154
+ if (date === null || date === undefined) return false;
5155
+ if (isNaN(new Date(date).getTime())) return false;
5156
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
5157
+ return true;
5158
+ };
5159
+
5160
+ const isDateObject = function(val) {
5161
+ return val instanceof Date;
5162
+ };
5163
+
5164
+ const formatDate = function (date, format = 'yyyy-MM-dd') {
5165
+ // 处理多种输入类型
5166
+ if (!date) return '';
5167
+
5168
+ // 如果是时间戳,转成日期对象
5169
+ if (typeof date === 'number') {
5170
+ date = new Date(date);
5171
+ }
5172
+ // 如果是字符串,转成日期对象
5173
+ if (typeof date === 'string') {
5174
+ date = new Date(date);
5175
+ }
5176
+
5177
+ // 调用toDate进一步验证和转换
5178
+ date = toDate(date);
5179
+ if (!date) return '';
5180
+
5181
+ // 兼容大写和小写的格式标记
5182
+ // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
5183
+ const lowercaseFormat = format
5184
+ .replace(/YYYY/g, 'yyyy')
5185
+ .replace(/D/g, 'd')
5186
+
5187
+ // 使用fecha库进行格式化,支持中文配置
5188
+ const str = fecha.format(date, lowercaseFormat, getSettings());
5189
+ return str;
5190
+ };
5191
+
5192
+ const parseDate = function(string, format) {
5193
+ return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
5194
+ };
5195
+
5196
+ const getDayCountOfMonth = function(year, month) {
5197
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
5198
+ return 30;
5199
+ }
5200
+
5201
+ if (month === 1) {
5202
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
5203
+ return 29;
5204
+ } else {
5205
+ return 28;
5206
+ }
5207
+ }
5208
+
5209
+ return 31;
5210
+ };
5211
+
5212
+ const getDayCountOfYear = function(year) {
5213
+ const isLeapYear = year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);
5214
+ return isLeapYear ? 366 : 365;
5215
+ };
5216
+
5217
+ const getFirstDayOfMonth = function(date) {
5218
+ const temp = new Date(date.getTime());
5219
+ temp.setDate(1);
5220
+ return temp.getDay();
5221
+ };
5222
+
5223
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
5224
+ // {prev, next} Date should work for Daylight Saving Time
5225
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
5226
+ const prevDate = function(date, amount = 1) {
5227
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
5228
+ };
5229
+
5230
+ const nextDate = function(date, amount = 1) {
5231
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
5232
+ };
5233
+
5234
+ const getStartDateOfMonth = function(year, month) {
5235
+ const result = new Date(year, month, 1);
5236
+ const day = result.getDay();
5237
+
5238
+ if (day === 0) {
5239
+ return prevDate(result, 7);
5240
+ } else {
5241
+ return prevDate(result, day);
5242
+ }
5243
+ };
5244
+
5245
+ const getWeekNumber = function(date) {
5246
+ // 支持多种输入类型
5247
+ if (!date||!isDate(date)) {
5248
+ date = new Date();
5249
+ }
5250
+ if (typeof date === 'string') {
5251
+ date = new Date(date);
5252
+ }
5253
+
5254
+ // 验证日期有效性
5255
+ if (!isDate(date)) return null;
5256
+
5257
+ const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
5258
+ // 设置为最近的星期四:当前日期 + 4 - 当前星期数
5259
+ // 将星期日的星期数设为7
5260
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
5261
+ // 获取当年的第一天
5262
+ const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
5263
+ // 计算到最近的星期四的完整周数
5264
+ const weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
5265
+ // 返回周数
5266
+ return weekNo;
5267
+ };
5268
+
5269
+ const getRangeHours = function(ranges) {
5270
+ const hours = [];
5271
+ let disabledHours = [];
5272
+
5273
+ (ranges || []).forEach(range => {
5274
+ const value = range.map(date => date.getHours());
5275
+
5276
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
5277
+ });
5278
+
5279
+ if (disabledHours.length) {
5280
+ for (let i = 0; i < 24; i++) {
5281
+ hours[i] = disabledHours.indexOf(i) === -1;
5282
+ }
5283
+ } else {
5284
+ for (let i = 0; i < 24; i++) {
5285
+ hours[i] = false;
5286
+ }
5287
+ }
5288
+
5289
+ return hours;
5290
+ };
5291
+
5292
+ const getPrevMonthLastDays = (date, amount) => {
5293
+ if (amount <= 0) return [];
5294
+ const temp = new Date(date.getTime());
5295
+ temp.setDate(0);
5296
+ const lastDay = temp.getDate();
5297
+ return range(amount).map((_, index) => lastDay - (amount - index - 1));
5298
+ };
5299
+
5300
+ const getMonthDays = (date) => {
5301
+ const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
5302
+ const days = temp.getDate();
5303
+ return range(days).map((_, index) => index + 1);
5304
+ };
5305
+
5306
+ function setRangeData(arr, start, end, value) {
5307
+ for (let i = start; i < end; i++) {
5308
+ arr[i] = value;
5309
+ }
5310
+ }
5311
+
5312
+ const getRangeMinutes = function(ranges, hour) {
5313
+ const minutes = new Array(60);
5314
+
5315
+ if (ranges.length > 0) {
5316
+ ranges.forEach(range => {
5317
+ const start = range[0];
5318
+ const end = range[1];
5319
+ const startHour = start.getHours();
5320
+ const startMinute = start.getMinutes();
5321
+ const endHour = end.getHours();
5322
+ const endMinute = end.getMinutes();
5323
+ if (startHour === hour && endHour !== hour) {
5324
+ setRangeData(minutes, startMinute, 60, true);
5325
+ } else if (startHour === hour && endHour === hour) {
5326
+ setRangeData(minutes, startMinute, endMinute + 1, true);
5327
+ } else if (startHour !== hour && endHour === hour) {
5328
+ setRangeData(minutes, 0, endMinute + 1, true);
5329
+ } else if (startHour < hour && endHour > hour) {
5330
+ setRangeData(minutes, 0, 60, true);
5331
+ }
5332
+ });
5333
+ } else {
5334
+ setRangeData(minutes, 0, 60, true);
5335
+ }
5336
+ return minutes;
5337
+ };
5338
+
5339
+ const range = function(n) {
5340
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
5341
+ return Array.apply(null, {length: n}).map((_, n) => n);
5342
+ };
5343
+
5344
+ const modifyDate = function(date, y, m, d) {
5345
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
5346
+ };
5347
+
5348
+ const modifyTime = function(date, h, m, s) {
5349
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
5350
+ };
5351
+
5352
+ const modifyWithTimeString = (date, time) => {
5353
+ if (date == null || !time) {
5354
+ return date;
5355
+ }
5356
+ time = parseDate(time, 'HH:mm:ss');
5357
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
5358
+ };
5359
+
5360
+ const clearTime = function(date) {
5361
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
5362
+ };
5363
+
5364
+ const clearMilliseconds = function(date) {
5365
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
5366
+ };
5367
+
5368
+ const limitTimeRange = function(date, ranges, format = 'HH:mm:ss') {
5369
+ // TODO: refactory a more elegant solution
5370
+ if (ranges.length === 0) return date;
5371
+ const normalizeDate = date => fecha.parse(fecha.format(date, format), format);
5372
+ const ndate = normalizeDate(date);
5373
+ const nranges = ranges.map(range => range.map(normalizeDate));
5374
+ if (nranges.some(nrange => ndate >= nrange[0] && ndate <= nrange[1])) return date;
5375
+
5376
+ let minDate = nranges[0][0];
5377
+ let maxDate = nranges[0][0];
5378
+
5379
+ nranges.forEach(nrange => {
5380
+ minDate = new Date(Math.min(nrange[0], minDate));
5381
+ maxDate = new Date(Math.max(nrange[1], minDate));
5382
+ });
5383
+
5384
+ const ret = ndate < minDate ? minDate : maxDate;
5385
+ // preserve Year/Month/Date
5386
+ return modifyDate(
5387
+ ret,
5388
+ date.getFullYear(),
5389
+ date.getMonth(),
5390
+ date.getDate()
5391
+ );
5392
+ };
5393
+
5394
+ const timeWithinRange = function(date, selectableRange, format) {
5395
+ const limitedDate = limitTimeRange(date, selectableRange, format);
5396
+ return limitedDate.getTime() === date.getTime();
5397
+ };
5398
+
5399
+ const changeYearMonthAndClampDate = function(date, year, month) {
5400
+ // clamp date to the number of days in `year`, `month`
5401
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
5402
+ const monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
5403
+ return modifyDate(date, year, month, monthDate);
5404
+ };
5405
+
5406
+ const prevMonth = function(date) {
5407
+ const year = date.getFullYear();
5408
+ const month = date.getMonth();
5409
+ return month === 0
5410
+ ? changeYearMonthAndClampDate(date, year - 1, 11)
5411
+ : changeYearMonthAndClampDate(date, year, month - 1);
5412
+ };
5413
+
5414
+ const nextMonth = function(date) {
5415
+ const year = date.getFullYear();
5416
+ const month = date.getMonth();
5417
+ return month === 11
5418
+ ? changeYearMonthAndClampDate(date, year + 1, 0)
5419
+ : changeYearMonthAndClampDate(date, year, month + 1);
5420
+ };
5421
+
5422
+ const prevYear = function(date, amount = 1) {
5423
+ const year = date.getFullYear();
5424
+ const month = date.getMonth();
5425
+ return changeYearMonthAndClampDate(date, year - amount, month);
5426
+ };
5427
+
5428
+ const nextYear = function(date, amount = 1) {
5429
+ const year = date.getFullYear();
5430
+ const month = date.getMonth();
5431
+ return changeYearMonthAndClampDate(date, year + amount, month);
5432
+ };
5433
+
5434
+ const extractDateFormat = function(format) {
5435
+ return format
5436
+ .replace(/\W?m{1,2}|\W?ZZ/g, '')
5437
+ .replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '')
5438
+ .trim();
5439
+ };
5440
+
5441
+ const extractTimeFormat = function(format) {
5442
+ return format
5443
+ .replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '')
5444
+ .trim();
5445
+ };
5446
+
5447
+ const validateRangeInOneMonth = function(start, end) {
5448
+ return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
5449
+ };
5450
+
5433
5451
  /**
5434
5452
  * 计算两个日期之间的工作日数量(不包括周末和节假日)
5435
5453
  * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
5436
5454
  * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
5437
5455
  * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
5438
5456
  * @returns {number} 工作日数量
5439
- */
5440
- var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
5441
- var holidays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
5442
-
5443
- if (typeof start_date !== 'string' || typeof end_date !== 'string') {
5444
- throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
5445
- }
5446
-
5447
- var startDateObj = new Date(start_date);
5448
- var endDateObj = new Date(end_date);
5449
-
5450
- if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
5451
- throw new Error("Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'.");
5452
- }
5453
-
5454
- if (startDateObj > endDateObj) {
5455
- throw new Error('Start date should be earlier than or equal to end date.');
5456
- }
5457
-
5458
- var workdays = 0;
5459
-
5460
- // Iterate through each day in the date range
5461
-
5462
- var _loop = function _loop(currentDate) {
5463
- // Check if the current day is a weekend (Saturday or Sunday)
5464
- var isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
5465
-
5466
- // Check if the current day is a holiday
5467
- var isHoliday = holidays.some(function (holiday) {
5468
- var holidayDate = new Date(holiday);
5469
- return currentDate.toDateString() === holidayDate.toDateString();
5470
- });
5471
-
5472
- // If it's a workday (not a weekend or holiday), increment the workdays count
5473
- if (!isWeekend && !isHoliday) {
5474
- workdays++;
5475
- }
5476
- };
5477
-
5478
- for (var currentDate = new Date(startDateObj); currentDate <= endDateObj; currentDate.setDate(currentDate.getDate() + 1)) {
5479
- _loop(currentDate);
5480
- }
5481
-
5482
- return workdays;
5483
- };
5484
-
5457
+ */
5458
+ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
5459
+ if (typeof start_date !== 'string' || typeof end_date !== 'string') {
5460
+ throw new Error(
5461
+ "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
5462
+ );
5463
+ }
5464
+
5465
+ const startDateObj = new Date(start_date);
5466
+ const endDateObj = new Date(end_date);
5467
+
5468
+ if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
5469
+ throw new Error(
5470
+ "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
5471
+ );
5472
+ }
5473
+
5474
+ if (startDateObj > endDateObj) {
5475
+ throw new Error('Start date should be earlier than or equal to end date.');
5476
+ }
5477
+
5478
+ let workdays = 0;
5479
+
5480
+ // Iterate through each day in the date range
5481
+ for (
5482
+ let currentDate = new Date(startDateObj);
5483
+ currentDate <= endDateObj;
5484
+ currentDate.setDate(currentDate.getDate() + 1)
5485
+ ) {
5486
+ // Check if the current day is a weekend (Saturday or Sunday)
5487
+ const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
5488
+
5489
+ // Check if the current day is a holiday
5490
+ const isHoliday = holidays.some((holiday) => {
5491
+ const holidayDate = new Date(holiday);
5492
+ return currentDate.toDateString() === holidayDate.toDateString();
5493
+ });
5494
+
5495
+ // If it's a workday (not a weekend or holiday), increment the workdays count
5496
+ if (!isWeekend && !isHoliday) {
5497
+ workdays++;
5498
+ }
5499
+ }
5500
+
5501
+ return workdays;
5502
+ };
5503
+
5485
5504
  /**
5486
5505
  * 日期加减天数
5487
5506
  * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
5488
5507
  * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
5489
5508
  * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
5490
- */
5491
- var dateAddDays = function dateAddDays(start_date, days) {
5492
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
5493
- 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.");
5494
- }
5495
-
5496
- var startDateObj = new Date(start_date);
5497
- if (isNaN(startDateObj.getTime())) {
5498
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
5499
- }
5500
-
5501
- var resultDateObj = new Date(startDateObj);
5502
- resultDateObj.setDate(resultDateObj.getDate() + days);
5503
-
5504
- var resultYear = resultDateObj.getFullYear();
5505
- var resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
5506
- var resultDay = String(resultDateObj.getDate()).padStart(2, '0');
5507
-
5508
- return resultYear + '-' + resultMonth + '-' + resultDay;
5509
- };
5510
-
5509
+ */
5510
+ const dateAddDays = function (start_date, days) {
5511
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
5512
+ throw new Error(
5513
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
5514
+ );
5515
+ }
5516
+
5517
+ const startDateObj = new Date(start_date);
5518
+ if (isNaN(startDateObj.getTime())) {
5519
+ throw new Error(
5520
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5521
+ );
5522
+ }
5523
+
5524
+ const resultDateObj = new Date(startDateObj);
5525
+ resultDateObj.setDate(resultDateObj.getDate() + days);
5526
+
5527
+ const resultYear = resultDateObj.getFullYear();
5528
+ const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
5529
+ const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
5530
+
5531
+ return `${resultYear}-${resultMonth}-${resultDay}`;
5532
+ };
5533
+
5511
5534
  /**
5512
5535
  * 计算两个日期之间的差值
5513
5536
  * @date 2023年12月14日
@@ -5515,180 +5538,182 @@ var dateAddDays = function dateAddDays(start_date, days) {
5515
5538
  * @param {String} end_date - 结束日期字符串
5516
5539
  * @param {String} unit - 单位:year/month/day
5517
5540
  * @returns {Number} 差值
5518
- */
5519
- var dateDiff = function dateDiff(start_date, end_date) {
5520
- var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
5521
-
5522
- // Assuming date strings are in "YYYY-MM-DD" format
5523
- var startDate = new Date(start_date);
5524
- var endDate = new Date(end_date);
5525
-
5526
- // If the date is invalid, return 0
5527
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
5528
- return 0;
5529
- }
5530
-
5531
- if (unit === 'year') {
5532
- return endDate.getFullYear() - startDate.getFullYear();
5533
- } else if (unit === 'month') {
5534
- return (endDate.getFullYear() - startDate.getFullYear()) * 12 + (endDate.getMonth() - startDate.getMonth());
5535
- } else {
5536
- // Default to day
5537
- var timeDifference = endDate - startDate;
5538
- // Calculate days (86400000 milliseconds per day)
5539
- return Math.floor(timeDifference / 86400000);
5540
- }
5541
- };
5542
-
5541
+ */
5542
+ const dateDiff = function (start_date, end_date, unit = 'day') {
5543
+ // Assuming date strings are in "YYYY-MM-DD" format
5544
+ var startDate = new Date(start_date);
5545
+ var endDate = new Date(end_date);
5546
+
5547
+ // If the date is invalid, return 0
5548
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
5549
+ return 0;
5550
+ }
5551
+
5552
+ if (unit === 'year') {
5553
+ return endDate.getFullYear() - startDate.getFullYear();
5554
+ } else if (unit === 'month') {
5555
+ return (
5556
+ (endDate.getFullYear() - startDate.getFullYear()) * 12 +
5557
+ (endDate.getMonth() - startDate.getMonth())
5558
+ );
5559
+ } else {
5560
+ // Default to day
5561
+ var timeDifference = endDate - startDate;
5562
+ // Calculate days (86400000 milliseconds per day)
5563
+ return Math.floor(timeDifference / 86400000);
5564
+ }
5565
+ };
5566
+
5543
5567
  /**
5544
5568
  * 获取月份中的日期
5545
5569
  * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
5546
5570
  * @returns {number} 月份中的日期(1-31)
5547
- */
5548
- var dayOfMonth = function dayOfMonth(date) {
5549
- if (typeof date !== 'string') {
5550
- throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
5551
- }
5552
-
5553
- var dateObj = new Date(date);
5554
- if (isNaN(dateObj.getTime())) {
5555
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
5556
- }
5557
-
5558
- return dateObj.getDate();
5559
- };
5560
-
5571
+ */
5572
+ const dayOfMonth = function (date) {
5573
+ if (typeof date !== 'string') {
5574
+ throw new Error(
5575
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
5576
+ );
5577
+ }
5578
+
5579
+ const dateObj = new Date(date);
5580
+ if (isNaN(dateObj.getTime())) {
5581
+ throw new Error(
5582
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5583
+ );
5584
+ }
5585
+
5586
+ return dateObj.getDate();
5587
+ };
5588
+
5561
5589
  /**
5562
5590
  * 获取当前日期
5563
5591
  * @date 2022年5月7日
5564
5592
  * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
5565
5593
  * @returns {string} 当前日期的格式化字符串
5566
- */
5567
- var getCurrentDate = function getCurrentDate() {
5568
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD';
5569
-
5570
- return formatDate(new Date(), format);
5571
- };
5572
-
5594
+ */
5595
+ const getCurrentDate = function (format = 'YYYY-MM-DD') {
5596
+ return formatDate(new Date(), format);
5597
+ };
5598
+
5573
5599
  /**
5574
5600
  * 获取当前日期时间
5575
5601
  * @date 2022年5月7日
5576
5602
  * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
5577
5603
  * @returns {string} 当前日期时间的格式化字符串
5578
- */
5579
- var getCurrentDateTime = function getCurrentDateTime() {
5580
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD HH:mm:ss';
5581
-
5582
- return formatDate(new Date(), format);
5583
- };
5584
-
5604
+ */
5605
+ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
5606
+ return formatDate(new Date(), format);
5607
+ };
5608
+
5585
5609
  /**
5586
5610
  * 获取小时
5587
5611
  * @date 2022年5月7日
5588
5612
  * @param {Date|string} [date] - 日期对象或日期字符串
5589
5613
  * @returns {number} 小时数(0-23)
5590
- */
5591
- var getHour = function getHour(date) {
5592
- if (!date) {
5593
- return new Date().getHours();
5594
- }
5595
- if (typeof date === 'string') {
5596
- date = new Date(date);
5597
- }
5598
- return date.getHours();
5599
- };
5600
-
5614
+ */
5615
+ const getHour = function (date) {
5616
+ if (!date) {
5617
+ return new Date().getHours();
5618
+ }
5619
+ if (typeof date === 'string') {
5620
+ date = new Date(date);
5621
+ }
5622
+ return date.getHours();
5623
+ };
5624
+
5601
5625
  /**
5602
5626
  * 获取分钟
5603
5627
  * @date 2022年5月7日
5604
5628
  * @param {Date|string} [date] - 日期对象或日期字符串
5605
5629
  * @returns {number} 分钟数(0-59)
5606
- */
5607
- var getMinute = function getMinute(date) {
5608
- if (!date) {
5609
- return new Date().getMinutes();
5610
- }
5611
- if (typeof date === 'string') {
5612
- date = new Date(date);
5613
- }
5614
- return date.getMinutes();
5615
- };
5616
-
5630
+ */
5631
+ const getMinute = function (date) {
5632
+ if (!date) {
5633
+ return new Date().getMinutes();
5634
+ }
5635
+ if (typeof date === 'string') {
5636
+ date = new Date(date);
5637
+ }
5638
+ return date.getMinutes();
5639
+ };
5640
+
5617
5641
  /**
5618
5642
  * 获取月份
5619
5643
  * @date 2022年5月7日
5620
5644
  * @param {Date|string} [date] - 日期对象或日期字符串
5621
5645
  * @returns {number} 月份数(1-12)
5622
- */
5623
- var getMonth = function getMonth(date) {
5624
- if (!date) {
5625
- return new Date().getMonth() + 1;
5626
- }
5627
- if (typeof date === 'string') {
5628
- date = new Date(date);
5629
- }
5630
- return date.getMonth() + 1;
5631
- };
5632
-
5646
+ */
5647
+ const getMonth = function (date) {
5648
+ if (!date) {
5649
+ return new Date().getMonth() + 1;
5650
+ }
5651
+ if (typeof date === 'string') {
5652
+ date = new Date(date);
5653
+ }
5654
+ return date.getMonth() + 1;
5655
+ };
5656
+
5633
5657
  /**
5634
5658
  * 获取秒
5635
5659
  * @date 2022年5月7日
5636
5660
  * @param {Date|string} [date] - 日期对象或日期字符串
5637
5661
  * @returns {number} 秒数(0-59)
5638
- */
5639
- var getSecond = function getSecond(date) {
5640
- if (!date) {
5641
- return new Date().getSeconds();
5642
- }
5643
- if (typeof date === 'string') {
5644
- date = new Date(date);
5645
- }
5646
- return date.getSeconds();
5647
- };
5648
-
5662
+ */
5663
+ const getSecond = function (date) {
5664
+ if (!date) {
5665
+ return new Date().getSeconds();
5666
+ }
5667
+ if (typeof date === 'string') {
5668
+ date = new Date(date);
5669
+ }
5670
+ return date.getSeconds();
5671
+ };
5672
+
5649
5673
  /**
5650
5674
  * 获取星期几
5651
5675
  * @date 2022年5月7日
5652
5676
  * @param {Date|string} [date] - 日期对象或日期字符串
5653
5677
  * @returns {number} 星期几(0-6,0表示星期日)
5654
- */
5655
- var getWeekday = function getWeekday(date) {
5656
- if (!date) {
5657
- return new Date().getDay();
5658
- }
5659
- if (typeof date === 'string') {
5660
- date = new Date(date);
5661
- }
5662
- return date.getDay();
5663
- };
5664
-
5678
+ */
5679
+ const getWeekday = function (date) {
5680
+ if (!date) {
5681
+ return new Date().getDay();
5682
+ }
5683
+ if (typeof date === 'string') {
5684
+ date = new Date(date);
5685
+ }
5686
+ return date.getDay();
5687
+ };
5688
+
5689
+
5665
5690
  /**
5666
5691
  * @desc 获取上午/下午/晚上
5667
5692
  * @author huangbo
5668
5693
  * @date 2022年5月7日
5669
5694
  * @param {String} [time] - 时间
5670
- **/
5671
- var timeCycle = function timeCycle(time) {
5672
- var hour = 0;
5673
- if (!time) {
5674
- hour = new Date().getHours();
5675
- } else if (typeof time === 'string') {
5676
- // 从时间字符串中提取小时
5677
- var match = time.match(/^(\d{1,2})/);
5678
- if (match) {
5679
- hour = parseInt(match[1], 10);
5680
- }
5681
- } else if (typeof time === 'number') {
5682
- hour = time;
5683
- }
5684
- // 判断时间段
5685
- if (hour >= 5 && hour < 12) {
5686
- return '上午';
5687
- } else if (hour >= 12 && hour < 18) {
5688
- return '下午';
5689
- } else {
5690
- return '晚上';
5691
- }
5695
+ **/
5696
+ const timeCycle = function (time) {
5697
+ let hour = 0;
5698
+ if (!time) {
5699
+ hour = new Date().getHours();
5700
+ } else if (typeof time === 'string') {
5701
+ // 从时间字符串中提取小时
5702
+ const match = time.match(/^(\d{1,2})/);
5703
+ if (match) {
5704
+ hour = parseInt(match[1], 10);
5705
+ }
5706
+ } else if (typeof time === 'number') {
5707
+ hour = time;
5708
+ }
5709
+ // 判断时间段
5710
+ if (hour >= 5 && hour < 12) {
5711
+ return '上午';
5712
+ } else if (hour >= 12 && hour < 18) {
5713
+ return '下午';
5714
+ } else {
5715
+ return '晚上';
5716
+ }
5692
5717
  };
5693
5718
 
5694
5719
  /***/ }),
@@ -6106,7 +6131,7 @@ module.exports = require("eoss/lib/message-box");
6106
6131
 
6107
6132
  /***/ }),
6108
6133
 
6109
- /***/ 92:
6134
+ /***/ 94:
6110
6135
  /***/ (function(module, exports) {
6111
6136
 
6112
6137
  module.exports = require("babel-helper-vue-jsx-merge-props");