@cloudtower/eagle 0.27.53-alpha.3 → 0.27.54-alpha.0

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 (322) hide show
  1. package/dist/components.css +1872 -1872
  2. package/dist/esm/index.js +10233 -46
  3. package/dist/esm/stats1.html +1 -1
  4. package/dist/style.css +2304 -2304
  5. package/dist/umd/index.js +10322 -0
  6. package/dist/{cjs → umd}/stats1.html +1 -1
  7. package/package.json +6 -7
  8. package/dist/cjs/UIKitProvider/index.js +0 -96
  9. package/dist/cjs/core/AccordionCard/index.js +0 -58
  10. package/dist/cjs/core/Alert/index.js +0 -81
  11. package/dist/cjs/core/Arch/index.js +0 -16
  12. package/dist/cjs/core/Badge/index.js +0 -50
  13. package/dist/cjs/core/BaseIcon/index.js +0 -75
  14. package/dist/cjs/core/Bit/index.js +0 -39
  15. package/dist/cjs/core/BitPerSecond/index.js +0 -39
  16. package/dist/cjs/core/Bps/index.js +0 -39
  17. package/dist/cjs/core/Breadcrumb/index.js +0 -57
  18. package/dist/cjs/core/Button/HoverableElement.js +0 -14
  19. package/dist/cjs/core/Button/index.js +0 -88
  20. package/dist/cjs/core/ButtonGroup/index.js +0 -110
  21. package/dist/cjs/core/Byte/index.js +0 -48
  22. package/dist/cjs/core/Calendar/index.js +0 -24
  23. package/dist/cjs/core/Card/CardBody.js +0 -12
  24. package/dist/cjs/core/Card/CardTitle.js +0 -12
  25. package/dist/cjs/core/Card/CardWrapper.js +0 -55
  26. package/dist/cjs/core/Card/index.js +0 -93
  27. package/dist/cjs/core/Cascader/cascader.style.js +0 -23
  28. package/dist/cjs/core/Cascader/cascader.widget.js +0 -86
  29. package/dist/cjs/core/Cascader/index.js +0 -74
  30. package/dist/cjs/core/Checkbox/checkbox.style.js +0 -5
  31. package/dist/cjs/core/Checkbox/index.js +0 -52
  32. package/dist/cjs/core/DetailCard/index.js +0 -22
  33. package/dist/cjs/core/DonutChart/index.js +0 -166
  34. package/dist/cjs/core/DropdownMenu/index.js +0 -65
  35. package/dist/cjs/core/Empty/index.js +0 -10
  36. package/dist/cjs/core/ErrorBoundary/index.js +0 -21
  37. package/dist/cjs/core/ExpandableList/ExpandIcon.js +0 -17
  38. package/dist/cjs/core/ExpandableList/ExpandableContainer.js +0 -16
  39. package/dist/cjs/core/ExpandableList/ExpandableItem.js +0 -47
  40. package/dist/cjs/core/ExpandableList/RoundOrder.js +0 -22
  41. package/dist/cjs/core/FailedLoad/index.js +0 -31
  42. package/dist/cjs/core/Fields/FieldsBoolean/index.js +0 -47
  43. package/dist/cjs/core/Fields/FieldsDateTime/index.js +0 -24
  44. package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +0 -50
  45. package/dist/cjs/core/Fields/FieldsEnum/index.js +0 -60
  46. package/dist/cjs/core/Fields/FieldsFloat/index.js +0 -60
  47. package/dist/cjs/core/Fields/FieldsInt/index.js +0 -78
  48. package/dist/cjs/core/Fields/FieldsInteger/index.js +0 -57
  49. package/dist/cjs/core/Fields/FieldsString/index.js +0 -116
  50. package/dist/cjs/core/Fields/FieldsTextArea/index.js +0 -64
  51. package/dist/cjs/core/Fields/FieldsTimePicker/index.js +0 -54
  52. package/dist/cjs/core/Fields/index.js +0 -27
  53. package/dist/cjs/core/Form/index.js +0 -9
  54. package/dist/cjs/core/FormItem/index.js +0 -38
  55. package/dist/cjs/core/Frequency/index.js +0 -39
  56. package/dist/cjs/core/Icon/index.js +0 -116
  57. package/dist/cjs/core/Input/index.js +0 -65
  58. package/dist/cjs/core/InputGroup/index.js +0 -13
  59. package/dist/cjs/core/InputInteger/formatterInteger.js +0 -15
  60. package/dist/cjs/core/InputInteger/index.js +0 -97
  61. package/dist/cjs/core/InputNumber/index.js +0 -89
  62. package/dist/cjs/core/InputTagItem/index.js +0 -11
  63. package/dist/cjs/core/KitStoreProvider/index.js +0 -22
  64. package/dist/cjs/core/Link/index.js +0 -55
  65. package/dist/cjs/core/Loading/index.js +0 -32
  66. package/dist/cjs/core/Loading/style.js +0 -11
  67. package/dist/cjs/core/Metric/metric.js +0 -22
  68. package/dist/cjs/core/Modal/index.js +0 -214
  69. package/dist/cjs/core/ModalStack/index.js +0 -46
  70. package/dist/cjs/core/Overflow/index.js +0 -121
  71. package/dist/cjs/core/Pagination/index.js +0 -119
  72. package/dist/cjs/core/ParrotTrans/index.js +0 -28
  73. package/dist/cjs/core/Percent/index.js +0 -40
  74. package/dist/cjs/core/Progress/index.js +0 -24
  75. package/dist/cjs/core/Radio/index.js +0 -144
  76. package/dist/cjs/core/SearchInput/index.js +0 -49
  77. package/dist/cjs/core/Second/index.js +0 -42
  78. package/dist/cjs/core/SegmentControl/index.js +0 -42
  79. package/dist/cjs/core/Select/index.js +0 -139
  80. package/dist/cjs/core/SimplePagination/index.js +0 -89
  81. package/dist/cjs/core/Speed/index.js +0 -39
  82. package/dist/cjs/core/StatusCapsule/index.js +0 -99
  83. package/dist/cjs/core/StepProgress/index.js +0 -44
  84. package/dist/cjs/core/Steps/index.js +0 -125
  85. package/dist/cjs/core/Steps/style.js +0 -13
  86. package/dist/cjs/core/Styled/index.js +0 -57
  87. package/dist/cjs/core/Switch/index.js +0 -60
  88. package/dist/cjs/core/Table/TableWidget.js +0 -48
  89. package/dist/cjs/core/Table/common.js +0 -46
  90. package/dist/cjs/core/Table/index.js +0 -112
  91. package/dist/cjs/core/TableForm/AddRowButton.js +0 -108
  92. package/dist/cjs/core/TableForm/Columns/AffixColumn.js +0 -48
  93. package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +0 -35
  94. package/dist/cjs/core/TableForm/Columns/FormItem.js +0 -20
  95. package/dist/cjs/core/TableForm/Columns/InputColumn.js +0 -117
  96. package/dist/cjs/core/TableForm/Columns/TextColumn.js +0 -44
  97. package/dist/cjs/core/TableForm/Columns/index.js +0 -24
  98. package/dist/cjs/core/TableForm/TableFormBodyCell.js +0 -165
  99. package/dist/cjs/core/TableForm/TableFormBodyRows.js +0 -215
  100. package/dist/cjs/core/TableForm/TableFormHeaderCell.js +0 -93
  101. package/dist/cjs/core/TableForm/index.js +0 -186
  102. package/dist/cjs/core/TableForm/style.js +0 -35
  103. package/dist/cjs/core/TableForm/types.js +0 -10
  104. package/dist/cjs/core/TableForm/utils.js +0 -36
  105. package/dist/cjs/core/Tag/SplitTag.js +0 -64
  106. package/dist/cjs/core/Tag/const.js +0 -12
  107. package/dist/cjs/core/Tag/index.js +0 -95
  108. package/dist/cjs/core/Tag/style.js +0 -14
  109. package/dist/cjs/core/TextArea/index.js +0 -71
  110. package/dist/cjs/core/Time/index.js +0 -30
  111. package/dist/cjs/core/TimePicker/index.js +0 -66
  112. package/dist/cjs/core/TimeZoneSelect/index.js +0 -164
  113. package/dist/cjs/core/Token/index.js +0 -85
  114. package/dist/cjs/core/Token/style.js +0 -5
  115. package/dist/cjs/core/Tooltip/index.js +0 -88
  116. package/dist/cjs/core/Truncate/index.js +0 -48
  117. package/dist/cjs/core/Typo/index.js +0 -130
  118. package/dist/cjs/core/antd.js +0 -208
  119. package/dist/cjs/core/message/index.js +0 -202
  120. package/dist/cjs/core/message-group/index.js +0 -147
  121. package/dist/cjs/coreX/BarChart/index.js +0 -38
  122. package/dist/cjs/coreX/BatchOperation/index.js +0 -148
  123. package/dist/cjs/coreX/ChartWithTooltip/index.js +0 -153
  124. package/dist/cjs/coreX/Counting/index.js +0 -21
  125. package/dist/cjs/coreX/CronCalendar/index.js +0 -104
  126. package/dist/cjs/coreX/CronPlan/index.js +0 -462
  127. package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +0 -178
  128. package/dist/cjs/coreX/DateRangePicker/Calendar.js +0 -285
  129. package/dist/cjs/coreX/DateRangePicker/DateRangePicker.style.js +0 -84
  130. package/dist/cjs/coreX/DateRangePicker/InputTime.js +0 -150
  131. package/dist/cjs/coreX/DateRangePicker/RelativeTime.js +0 -52
  132. package/dist/cjs/coreX/DateRangePicker/common.js +0 -195
  133. package/dist/cjs/coreX/DateRangePicker/index.js +0 -331
  134. package/dist/cjs/coreX/DeprecatedDonutChart/index.js +0 -38
  135. package/dist/cjs/coreX/DropdownTransition/index.js +0 -72
  136. package/dist/cjs/coreX/GoBackButton/index.js +0 -44
  137. package/dist/cjs/coreX/I18nNameTag/index.js +0 -36
  138. package/dist/cjs/coreX/NamesTooltip/index.js +0 -33
  139. package/dist/cjs/coreX/OverflowTooltip/index.js +0 -91
  140. package/dist/cjs/coreX/SidebarSubtitle/index.js +0 -12
  141. package/dist/cjs/coreX/SortableList/index.js +0 -32
  142. package/dist/cjs/coreX/SummaryTable/index.js +0 -112
  143. package/dist/cjs/coreX/SwitchWithText/index.js +0 -58
  144. package/dist/cjs/coreX/TabMenu/index.js +0 -152
  145. package/dist/cjs/coreX/TruncatedTextWithTooltip/index.js +0 -68
  146. package/dist/cjs/coreX/UnitWithChart/index.js +0 -117
  147. package/dist/cjs/coreX/common/getCalendarTitle.js +0 -26
  148. package/dist/cjs/hooks/useElementIntersectionRatio.js +0 -30
  149. package/dist/cjs/hooks/useElementResize.js +0 -68
  150. package/dist/cjs/hooks/useElementsSize.js +0 -61
  151. package/dist/cjs/hooks/useMemoCompare.js +0 -17
  152. package/dist/cjs/hooks/useParrotTranslation.js +0 -13
  153. package/dist/cjs/index.js +0 -132
  154. package/dist/cjs/spec/type.js +0 -9
  155. package/dist/cjs/store/chart.js +0 -65
  156. package/dist/cjs/store/index.js +0 -48
  157. package/dist/cjs/store/modal.js +0 -67
  158. package/dist/cjs/styles/token/color.js +0 -273
  159. package/dist/cjs/utils/constants.js +0 -8
  160. package/dist/cjs/utils/cron-time.js +0 -450
  161. package/dist/cjs/utils/dom.js +0 -16
  162. package/dist/cjs/utils/icon.js +0 -22
  163. package/dist/cjs/utils/isEmpty.js +0 -12
  164. package/dist/cjs/utils/time.js +0 -87
  165. package/dist/cjs/utils/tower.js +0 -188
  166. package/dist/esm/UIKitProvider/index.js +0 -90
  167. package/dist/esm/core/AccordionCard/index.js +0 -56
  168. package/dist/esm/core/Alert/index.js +0 -79
  169. package/dist/esm/core/Arch/index.js +0 -14
  170. package/dist/esm/core/Badge/index.js +0 -48
  171. package/dist/esm/core/BaseIcon/index.js +0 -73
  172. package/dist/esm/core/Bit/index.js +0 -37
  173. package/dist/esm/core/BitPerSecond/index.js +0 -37
  174. package/dist/esm/core/Bps/index.js +0 -37
  175. package/dist/esm/core/Breadcrumb/index.js +0 -52
  176. package/dist/esm/core/Button/HoverableElement.js +0 -12
  177. package/dist/esm/core/Button/index.js +0 -86
  178. package/dist/esm/core/ButtonGroup/index.js +0 -105
  179. package/dist/esm/core/Byte/index.js +0 -46
  180. package/dist/esm/core/Calendar/index.js +0 -22
  181. package/dist/esm/core/Card/CardBody.js +0 -10
  182. package/dist/esm/core/Card/CardTitle.js +0 -10
  183. package/dist/esm/core/Card/CardWrapper.js +0 -53
  184. package/dist/esm/core/Card/index.js +0 -91
  185. package/dist/esm/core/Cascader/cascader.style.js +0 -12
  186. package/dist/esm/core/Cascader/cascader.widget.js +0 -79
  187. package/dist/esm/core/Cascader/index.js +0 -72
  188. package/dist/esm/core/Checkbox/checkbox.style.js +0 -3
  189. package/dist/esm/core/Checkbox/index.js +0 -50
  190. package/dist/esm/core/DetailCard/index.js +0 -20
  191. package/dist/esm/core/DonutChart/index.js +0 -160
  192. package/dist/esm/core/DropdownMenu/index.js +0 -60
  193. package/dist/esm/core/Empty/index.js +0 -8
  194. package/dist/esm/core/ErrorBoundary/index.js +0 -19
  195. package/dist/esm/core/ExpandableList/ExpandIcon.js +0 -15
  196. package/dist/esm/core/ExpandableList/ExpandableContainer.js +0 -14
  197. package/dist/esm/core/ExpandableList/ExpandableItem.js +0 -45
  198. package/dist/esm/core/ExpandableList/RoundOrder.js +0 -20
  199. package/dist/esm/core/FailedLoad/index.js +0 -29
  200. package/dist/esm/core/Fields/FieldsBoolean/index.js +0 -45
  201. package/dist/esm/core/Fields/FieldsDateTime/index.js +0 -22
  202. package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +0 -48
  203. package/dist/esm/core/Fields/FieldsEnum/index.js +0 -58
  204. package/dist/esm/core/Fields/FieldsFloat/index.js +0 -58
  205. package/dist/esm/core/Fields/FieldsInt/index.js +0 -76
  206. package/dist/esm/core/Fields/FieldsInteger/index.js +0 -55
  207. package/dist/esm/core/Fields/FieldsString/index.js +0 -114
  208. package/dist/esm/core/Fields/FieldsTextArea/index.js +0 -62
  209. package/dist/esm/core/Fields/FieldsTimePicker/index.js +0 -52
  210. package/dist/esm/core/Fields/index.js +0 -25
  211. package/dist/esm/core/Form/index.js +0 -7
  212. package/dist/esm/core/FormItem/index.js +0 -36
  213. package/dist/esm/core/Frequency/index.js +0 -37
  214. package/dist/esm/core/Icon/index.js +0 -114
  215. package/dist/esm/core/Input/index.js +0 -63
  216. package/dist/esm/core/InputGroup/index.js +0 -11
  217. package/dist/esm/core/InputInteger/formatterInteger.js +0 -13
  218. package/dist/esm/core/InputInteger/index.js +0 -92
  219. package/dist/esm/core/InputNumber/index.js +0 -84
  220. package/dist/esm/core/InputTagItem/index.js +0 -9
  221. package/dist/esm/core/KitStoreProvider/index.js +0 -16
  222. package/dist/esm/core/Link/index.js +0 -53
  223. package/dist/esm/core/Loading/index.js +0 -30
  224. package/dist/esm/core/Loading/style.js +0 -6
  225. package/dist/esm/core/Metric/metric.js +0 -20
  226. package/dist/esm/core/Modal/index.js +0 -212
  227. package/dist/esm/core/ModalStack/index.js +0 -44
  228. package/dist/esm/core/Overflow/index.js +0 -116
  229. package/dist/esm/core/Pagination/index.js +0 -114
  230. package/dist/esm/core/ParrotTrans/index.js +0 -26
  231. package/dist/esm/core/Percent/index.js +0 -38
  232. package/dist/esm/core/Progress/index.js +0 -22
  233. package/dist/esm/core/Radio/index.js +0 -138
  234. package/dist/esm/core/SearchInput/index.js +0 -47
  235. package/dist/esm/core/Second/index.js +0 -40
  236. package/dist/esm/core/SegmentControl/index.js +0 -40
  237. package/dist/esm/core/Select/index.js +0 -137
  238. package/dist/esm/core/SimplePagination/index.js +0 -87
  239. package/dist/esm/core/Speed/index.js +0 -37
  240. package/dist/esm/core/StatusCapsule/index.js +0 -93
  241. package/dist/esm/core/StepProgress/index.js +0 -42
  242. package/dist/esm/core/Steps/index.js +0 -123
  243. package/dist/esm/core/Steps/style.js +0 -7
  244. package/dist/esm/core/Styled/index.js +0 -45
  245. package/dist/esm/core/Switch/index.js +0 -58
  246. package/dist/esm/core/Table/TableWidget.js +0 -45
  247. package/dist/esm/core/Table/common.js +0 -44
  248. package/dist/esm/core/Table/index.js +0 -104
  249. package/dist/esm/core/TableForm/AddRowButton.js +0 -106
  250. package/dist/esm/core/TableForm/Columns/AffixColumn.js +0 -46
  251. package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +0 -32
  252. package/dist/esm/core/TableForm/Columns/FormItem.js +0 -18
  253. package/dist/esm/core/TableForm/Columns/InputColumn.js +0 -114
  254. package/dist/esm/core/TableForm/Columns/TextColumn.js +0 -41
  255. package/dist/esm/core/TableForm/Columns/index.js +0 -21
  256. package/dist/esm/core/TableForm/TableFormBodyCell.js +0 -163
  257. package/dist/esm/core/TableForm/TableFormBodyRows.js +0 -213
  258. package/dist/esm/core/TableForm/TableFormHeaderCell.js +0 -91
  259. package/dist/esm/core/TableForm/index.js +0 -184
  260. package/dist/esm/core/TableForm/style.js +0 -27
  261. package/dist/esm/core/TableForm/types.js +0 -8
  262. package/dist/esm/core/TableForm/utils.js +0 -32
  263. package/dist/esm/core/Tag/SplitTag.js +0 -62
  264. package/dist/esm/core/Tag/const.js +0 -10
  265. package/dist/esm/core/Tag/index.js +0 -90
  266. package/dist/esm/core/Tag/style.js +0 -9
  267. package/dist/esm/core/TextArea/index.js +0 -69
  268. package/dist/esm/core/Time/index.js +0 -28
  269. package/dist/esm/core/TimePicker/index.js +0 -64
  270. package/dist/esm/core/TimeZoneSelect/index.js +0 -162
  271. package/dist/esm/core/Token/index.js +0 -80
  272. package/dist/esm/core/Token/style.js +0 -3
  273. package/dist/esm/core/Tooltip/index.js +0 -86
  274. package/dist/esm/core/Truncate/index.js +0 -46
  275. package/dist/esm/core/Typo/index.js +0 -128
  276. package/dist/esm/core/antd.js +0 -205
  277. package/dist/esm/core/message/index.js +0 -178
  278. package/dist/esm/core/message-group/index.js +0 -143
  279. package/dist/esm/coreX/BarChart/index.js +0 -33
  280. package/dist/esm/coreX/BatchOperation/index.js +0 -143
  281. package/dist/esm/coreX/ChartWithTooltip/index.js +0 -148
  282. package/dist/esm/coreX/Counting/index.js +0 -19
  283. package/dist/esm/coreX/CronCalendar/index.js +0 -102
  284. package/dist/esm/coreX/CronPlan/index.js +0 -457
  285. package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +0 -176
  286. package/dist/esm/coreX/DateRangePicker/Calendar.js +0 -283
  287. package/dist/esm/coreX/DateRangePicker/DateRangePicker.style.js +0 -77
  288. package/dist/esm/coreX/DateRangePicker/InputTime.js +0 -148
  289. package/dist/esm/coreX/DateRangePicker/RelativeTime.js +0 -50
  290. package/dist/esm/coreX/DateRangePicker/common.js +0 -183
  291. package/dist/esm/coreX/DateRangePicker/index.js +0 -325
  292. package/dist/esm/coreX/DeprecatedDonutChart/index.js +0 -36
  293. package/dist/esm/coreX/DropdownTransition/index.js +0 -70
  294. package/dist/esm/coreX/GoBackButton/index.js +0 -42
  295. package/dist/esm/coreX/I18nNameTag/index.js +0 -34
  296. package/dist/esm/coreX/NamesTooltip/index.js +0 -31
  297. package/dist/esm/coreX/OverflowTooltip/index.js +0 -89
  298. package/dist/esm/coreX/SidebarSubtitle/index.js +0 -10
  299. package/dist/esm/coreX/SortableList/index.js +0 -30
  300. package/dist/esm/coreX/SummaryTable/index.js +0 -107
  301. package/dist/esm/coreX/SwitchWithText/index.js +0 -56
  302. package/dist/esm/coreX/TabMenu/index.js +0 -150
  303. package/dist/esm/coreX/TruncatedTextWithTooltip/index.js +0 -66
  304. package/dist/esm/coreX/UnitWithChart/index.js +0 -112
  305. package/dist/esm/coreX/common/getCalendarTitle.js +0 -24
  306. package/dist/esm/hooks/useElementIntersectionRatio.js +0 -28
  307. package/dist/esm/hooks/useElementResize.js +0 -66
  308. package/dist/esm/hooks/useElementsSize.js +0 -59
  309. package/dist/esm/hooks/useMemoCompare.js +0 -15
  310. package/dist/esm/hooks/useParrotTranslation.js +0 -11
  311. package/dist/esm/spec/type.js +0 -7
  312. package/dist/esm/store/chart.js +0 -62
  313. package/dist/esm/store/index.js +0 -37
  314. package/dist/esm/store/modal.js +0 -63
  315. package/dist/esm/styles/token/color.js +0 -271
  316. package/dist/esm/utils/constants.js +0 -5
  317. package/dist/esm/utils/cron-time.js +0 -448
  318. package/dist/esm/utils/dom.js +0 -14
  319. package/dist/esm/utils/icon.js +0 -20
  320. package/dist/esm/utils/isEmpty.js +0 -10
  321. package/dist/esm/utils/time.js +0 -77
  322. package/dist/esm/utils/tower.js +0 -173
@@ -1,450 +0,0 @@
1
- 'use strict';
2
-
3
- var dayjs = require('dayjs');
4
- var UTC = require('dayjs/plugin/utc');
5
-
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __publicField = (obj, key, value) => {
9
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
10
- return value;
11
- };
12
- dayjs.extend(UTC);
13
- const CONSTRAINTS = [
14
- [0, 59],
15
- [0, 59],
16
- [0, 23],
17
- [1, 31],
18
- [0, 11],
19
- [0, 6]
20
- ];
21
- const MONTH_CONSTRAINTS = [
22
- 31,
23
- 29,
24
- // support leap year...not perfect
25
- 31,
26
- 30,
27
- 31,
28
- 30,
29
- 31,
30
- 31,
31
- 30,
32
- 31,
33
- 30,
34
- 31
35
- ];
36
- const PARSE_DEFAULTS = ["0", "*", "*", "*", "*", "*"];
37
- const ALIASES = {
38
- jan: 0,
39
- feb: 1,
40
- mar: 2,
41
- apr: 3,
42
- may: 4,
43
- jun: 5,
44
- jul: 6,
45
- aug: 7,
46
- sep: 8,
47
- oct: 9,
48
- nov: 10,
49
- dec: 11,
50
- sun: 0,
51
- mon: 1,
52
- tue: 2,
53
- wed: 3,
54
- thu: 4,
55
- fri: 5,
56
- sat: 6
57
- };
58
- const TIME_UNITS = [
59
- "second",
60
- "minute",
61
- "hour",
62
- "dayOfMonth",
63
- "month",
64
- "dayOfWeek"
65
- ];
66
- const TIME_UNITS_LEN = TIME_UNITS.length;
67
- const PRESETS = {
68
- "@monthly": {
69
- expression: () => "0 0 0 1 * *",
70
- validation: () => true
71
- },
72
- "@weekly": { expression: () => "0 0 0 * * 0", validation: () => true },
73
- "@daily": { expression: () => "0 0 0 * * *", validation: () => true },
74
- "@hourly": { expression: () => "0 0 * * * *", validation: () => true },
75
- "@minutely": { expression: () => "0 * * * * *", validation: () => true },
76
- "@secondly": { expression: () => "* * * * * *", validation: () => true },
77
- "@weekdays": { expression: () => "0 0 0 * * 1-5", validation: () => true },
78
- "@weekends": { expression: () => "0 0 0 * * 0,6", validation: () => true },
79
- "@x-every-n-day": {
80
- expression: (args) => `0 ${args[0]} ${args[1]} * * *`,
81
- validation: ({ date, lastSendAt, args }) => {
82
- if (!lastSendAt) {
83
- return true;
84
- }
85
- return date.diff(lastSendAt) >= parseInt(args[2], 10) * (864e5 - 6e4) - 1e4;
86
- },
87
- step: (_args) => 864e5 - 6e4
88
- },
89
- "@x-every-n-week": {
90
- expression: (args) => {
91
- const days = args.slice(3);
92
- return `0 ${args[0]} ${args[1]} * * ${days.includes("*") ? "*" : days.join(",")}`;
93
- },
94
- validation: ({ lastSendAt, date, args }) => {
95
- if (!lastSendAt) {
96
- return true;
97
- }
98
- if (date.isAfter(lastSendAt) && date.day(0).isSame(lastSendAt.day(0))) {
99
- return true;
100
- }
101
- return date.day(0).diff(lastSendAt.day(0)) >= parseInt(args[2], 10) * (6048e5 - 6e4) - 1e4;
102
- },
103
- step: (_args) => 6048e5 - 6e4
104
- },
105
- "@x-last-day": {
106
- expression: (args) => `0 ${args[0]} ${args[1]} 28-31 ${args[2]} *`,
107
- validation: ({ date }) => {
108
- const lastDayInMonth = MONTH_CONSTRAINTS[date.month()];
109
- return lastDayInMonth === date.date();
110
- }
111
- }
112
- };
113
- const RE_WILDCARDS = /\*/g;
114
- const RE_RANGE = /^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g;
115
- class CronTime {
116
- constructor(source, startAt, utcOffset) {
117
- __publicField(this, "source");
118
- __publicField(this, "presetValidation");
119
- __publicField(this, "presetArgs");
120
- __publicField(this, "presetStep");
121
- __publicField(this, "realDate", false);
122
- __publicField(this, "utcOffset");
123
- __publicField(this, "startAt");
124
- __publicField(this, "unitMap", {});
125
- // TODO: find a better way to do stateful cron?
126
- __publicField(this, "lastSendAt", null);
127
- if (typeof utcOffset !== "undefined") {
128
- this.utcOffset = utcOffset;
129
- }
130
- if (startAt !== void 0) {
131
- this.startAt = startAt;
132
- }
133
- TIME_UNITS.forEach((timeUnit) => {
134
- this.unitMap[timeUnit] = {};
135
- });
136
- if (source instanceof Date) {
137
- this.source = dayjs(source);
138
- this.realDate = true;
139
- } else {
140
- this.source = source;
141
- this.parse(this.source);
142
- this.verifyParse();
143
- }
144
- }
145
- sendAt(i) {
146
- let date = this.realDate ? this.source : dayjs();
147
- if (typeof this.utcOffset !== "undefined") {
148
- date = dayjs(date).utcOffset(this.utcOffset);
149
- }
150
- if (this.realDate) {
151
- if (dayjs().isAfter(date)) {
152
- throw new Error("WARNING: Date in past. Will never be fired.");
153
- }
154
- return date;
155
- }
156
- if (typeof i === "number" && i <= 0) {
157
- i = 1;
158
- }
159
- if (i === void 0) {
160
- return this.getNextDateFromWithValidation(date);
161
- } else {
162
- const dates = [];
163
- for (; i > 0; i--) {
164
- date = this.getNextDateFromWithValidation(date);
165
- dates.push(date);
166
- }
167
- return dates;
168
- }
169
- }
170
- /**
171
- * Get the number of milliseconds in the future at which to fire our callbacks.
172
- */
173
- getTimeout() {
174
- return Math.max(-1, this.sendAt().diff(dayjs()));
175
- }
176
- /**
177
- * writes out a cron string
178
- */
179
- toString() {
180
- return this.toJSON().join(" ");
181
- }
182
- /**
183
- * Json representation of the parsed cron syntax.
184
- */
185
- toJSON() {
186
- return TIME_UNITS.map((timeName) => {
187
- return this.wcOrAll(timeName);
188
- });
189
- }
190
- setLastSendAt(date) {
191
- this.lastSendAt = date;
192
- }
193
- /*
194
- * Parse the cron syntax into something useful for selecting the next execution time.
195
- *
196
- * Algorithm:
197
- * - Replace preset
198
- * - Replace aliases in the source.
199
- * - Trim string and split for processing.
200
- * - Loop over split options (ms -> month):
201
- * - Get the value (or default) in the current position.
202
- * - Parse the value.
203
- */
204
- parse(source) {
205
- source = source.toLowerCase();
206
- if (/^@/.test(source)) {
207
- const { key, args } = this.parsePrestArgs(source);
208
- const { expression, validation, step } = PRESETS[key];
209
- this.presetValidation = validation;
210
- this.presetArgs = args;
211
- this.presetStep = step == null ? void 0 : step(args);
212
- source = expression(args);
213
- }
214
- source = source.replace(/[a-z]{1,3}/gi, (alias) => {
215
- if (alias in ALIASES) {
216
- return ALIASES[alias].toString();
217
- }
218
- throw new Error(`Unknown alias: ${alias}`);
219
- });
220
- const units = source.trim().split(/\s+/);
221
- if (units.length < TIME_UNITS_LEN - 1) {
222
- throw new Error("Too few fields");
223
- }
224
- if (units.length > TIME_UNITS_LEN) {
225
- throw new Error("Too many fields");
226
- }
227
- const unitsLen = units.length;
228
- for (let i = 0; i < TIME_UNITS_LEN; i++) {
229
- const cur = units[i - (TIME_UNITS_LEN - unitsLen)] || PARSE_DEFAULTS[i];
230
- this.parseField(cur, TIME_UNITS[i], CONSTRAINTS[i]);
231
- }
232
- }
233
- parsePrestArgs(source) {
234
- const matchedArr = source.match(/(@[a-zA-Z-]+)(\((\S+)\)|)/);
235
- if (!matchedArr) {
236
- throw new Error(`Invalid preset ${source}`);
237
- }
238
- if (!matchedArr[3]) {
239
- return {
240
- key: matchedArr[1],
241
- args: []
242
- };
243
- }
244
- return {
245
- key: matchedArr[1],
246
- args: matchedArr[3].split(",")
247
- };
248
- }
249
- /*
250
- * Parse individual field from the cron syntax provided.
251
- *
252
- * Algorithm:
253
- * - Split field by commas aand check for wildcards to ensure proper user.
254
- * - Replace wildcard values with <low>-<high> boundaries.
255
- * - Split field by commas and then iterate over ranges inside field.
256
- * - If range matches pattern then map over matches using replace (to parse the range by the regex pattern)
257
- * - Starting with the lower bounds of the range iterate by step up to the upper bounds and toggle the CronTime field value flag on.
258
- */
259
- parseField(value, type, constraints) {
260
- const typeObj = this.unitMap[type];
261
- let pointer;
262
- const low = constraints[0];
263
- const high = constraints[1];
264
- const fields = value.split(",");
265
- fields.forEach((field) => {
266
- const wildcardIndex = field.indexOf("*");
267
- if (wildcardIndex !== -1 && wildcardIndex !== 0) {
268
- throw new Error(`Field (${field}) has an invalid wildcard expression`);
269
- }
270
- });
271
- value = value.replace(RE_WILDCARDS, `${low}-${high}`);
272
- const allRanges = value.split(",");
273
- for (let i = 0; i < allRanges.length; i++) {
274
- if (allRanges[i].match(RE_RANGE)) {
275
- allRanges[i].replace(RE_RANGE, ($0, _lower, _upper, step) => {
276
- let lower = parseInt(_lower, 10);
277
- let upper = parseInt(_upper, 10) || void 0;
278
- const wasStepDefined = !isNaN(parseInt(step, 10));
279
- if (step === "0") {
280
- throw new Error(`Field (${type}) has a step of zero`);
281
- }
282
- step = parseInt(step, 10) || 1;
283
- if (upper && lower > upper) {
284
- throw new Error(`Field (${type}) has an invalid range`);
285
- }
286
- const outOfRangeError = lower < low || upper && upper > high || !upper && lower > high;
287
- if (outOfRangeError) {
288
- throw new Error(`Field value (${value}) is out of range`);
289
- }
290
- lower = Math.min(Math.max(low, ~~Math.abs(lower)), high);
291
- if (upper) {
292
- upper = Math.min(high, ~~Math.abs(upper));
293
- } else {
294
- upper = wasStepDefined ? high : lower;
295
- }
296
- pointer = lower;
297
- do {
298
- typeObj[pointer] = true;
299
- pointer += step;
300
- } while (pointer <= upper);
301
- return "";
302
- });
303
- } else {
304
- throw new Error(`Field (${type}) cannot be parsed`);
305
- }
306
- }
307
- }
308
- /*
309
- * Ensure that the syntax parsed correctly and correct the specified values if needed.
310
- */
311
- verifyParse() {
312
- const months = Object.keys(this.unitMap.month);
313
- const dom = Object.keys(this.unitMap.dayOfMonth);
314
- let ok = false;
315
- let lastWrongMonth = NaN;
316
- for (let i = 0; i < months.length; i++) {
317
- const m = months[i];
318
- const con = MONTH_CONSTRAINTS[parseInt(m, 10)];
319
- for (const day of dom) {
320
- if (parseInt(day, 10) <= con) {
321
- ok = true;
322
- }
323
- }
324
- if (!ok) {
325
- lastWrongMonth = parseInt(m, 10);
326
- console.warn(`Month '${m}' is limited to '${con}' days.`);
327
- }
328
- }
329
- if (!ok) {
330
- const notOkCon = MONTH_CONSTRAINTS[lastWrongMonth];
331
- for (const notOkDay of dom) {
332
- if (parseInt(notOkDay, 10) > notOkCon) {
333
- delete this.unitMap.dayOfMonth[notOkDay];
334
- const fixedDay = Number(notOkDay) % notOkCon;
335
- this.unitMap.dayOfMonth[fixedDay] = true;
336
- }
337
- }
338
- }
339
- }
340
- getNextDateFromWithValidation(start) {
341
- let nextDate = this.getNextDateFrom(start);
342
- if (this.startAt && nextDate.isBefore(this.startAt)) {
343
- return this.getNextDateFromWithValidation(nextDate);
344
- }
345
- const valid = this.presetValidation ? this.presetValidation({
346
- date: nextDate,
347
- lastSendAt: this.lastSendAt,
348
- args: this.presetArgs || []
349
- }) : true;
350
- if (valid) {
351
- return nextDate;
352
- }
353
- if (this.presetStep) {
354
- nextDate = nextDate.add(this.presetStep, "ms");
355
- }
356
- return this.getNextDateFromWithValidation(nextDate);
357
- }
358
- /**
359
- * Get next date matching the specified cron time.
360
- *
361
- * Algorithm:
362
- * - Start with a start date and a parsed crontime.
363
- * - Loop until 5 seconds have passed, or we found the next date.
364
- * - Within the loop:
365
- * - If it took longer than 5 seconds to select a date, throw an exception.
366
- * - Find the next month to run at.
367
- * - Find the next day of the month to run at.
368
- * - Find the next day of the week to run at.
369
- * - Find the next hour to run at.
370
- * - Find the next minute to run at.
371
- * - Find the next second to run at.
372
- * - Check that the chosen time does not equal the current execution.
373
- * - Return the selected date object.
374
- */
375
- getNextDateFrom(start) {
376
- let date = start;
377
- const firstDate = start;
378
- if (date.millisecond() > 0) {
379
- date = date.millisecond(0).second(date.second() + 1);
380
- }
381
- const timeout = Date.now() + 5e3;
382
- while (true) {
383
- const diff = date.diff(start);
384
- if (Date.now() > timeout) {
385
- throw new Error(
386
- `Something went wrong. cron reached maximum iterations.
387
- Cron String: ${this} - UTC offset: ${date} - current Date: ${dayjs().toString()}`
388
- );
389
- }
390
- if (!(date.month() - 1 in this.unitMap.month) && Object.keys(this.unitMap.month).length !== 12) {
391
- date = date.add(1, "month").day(1).hour(0).minute(0).second(0);
392
- continue;
393
- }
394
- if (!(date.date() in this.unitMap.dayOfMonth) && Object.keys(this.unitMap.dayOfMonth).length !== 31 && !(date.day() in this.unitMap.dayOfWeek && Object.keys(this.unitMap.dayOfWeek).length !== 7)) {
395
- date = date.add(1, "day").hour(0).minute(0).second(0);
396
- continue;
397
- }
398
- if (!(date.day() in this.unitMap.dayOfWeek) && Object.keys(this.unitMap.dayOfWeek).length !== 7 && !(date.date() in this.unitMap.dayOfMonth && Object.keys(this.unitMap.dayOfMonth).length !== 31)) {
399
- date = date.add(1, "day").hour(0).minute(0).second(0);
400
- continue;
401
- }
402
- if (!(date.hour() in this.unitMap.hour) && Object.keys(this.unitMap.hour).length !== 24) {
403
- date = date.hour(date.hour() === 23 && diff > 864e5 ? 0 : date.hour() + 1).minute(0).second(0);
404
- continue;
405
- }
406
- if (!(date.minute() in this.unitMap.minute) && Object.keys(this.unitMap.minute).length !== 60) {
407
- date = date.minute(
408
- date.minute() === 59 && diff > 36e5 ? 0 : date.minute() + 1
409
- ).second(0);
410
- continue;
411
- }
412
- if (!(date.second() in this.unitMap.second) && Object.keys(this.unitMap.second).length !== 60) {
413
- date = date.second(
414
- date.second() === 59 && diff > 6e4 ? 0 : date.second() + 1
415
- );
416
- continue;
417
- }
418
- if (date.isSame(firstDate)) {
419
- date = date.add(1, "second");
420
- continue;
421
- }
422
- break;
423
- }
424
- return date;
425
- }
426
- /**
427
- * wildcard, or all params in array (for to string)
428
- */
429
- wcOrAll(type) {
430
- if (this.hasAll(type)) {
431
- return "*";
432
- }
433
- const all = [];
434
- for (const time in this.unitMap[type]) {
435
- all.push(time);
436
- }
437
- return all.join(",");
438
- }
439
- hasAll(type) {
440
- const constraints = CONSTRAINTS[TIME_UNITS.indexOf(type)];
441
- for (let i = constraints[0], n = constraints[1]; i < n; i++) {
442
- if (!(i in this.unitMap[type])) {
443
- return false;
444
- }
445
- }
446
- return true;
447
- }
448
- }
449
-
450
- exports.CronTime = CronTime;
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- function getSize(el) {
4
- if (!el) {
5
- return {
6
- width: 0,
7
- height: 0
8
- };
9
- }
10
- return {
11
- width: el.offsetWidth,
12
- height: el.offsetHeight
13
- };
14
- }
15
-
16
- exports.getSize = getSize;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- var iconsReact = require('@cloudtower/icons-react');
4
-
5
- function getAlertIcon(type) {
6
- switch (type) {
7
- case "success":
8
- return iconsReact.CheckmarkDoneSuccessCircleFill16GreenIcon;
9
- case "info":
10
- return iconsReact.InfoICircleFill16BlueIcon;
11
- case "warning":
12
- return iconsReact.NoticeAttention16YellowIcon;
13
- case "error":
14
- return iconsReact.XmarkFailedSeriousWarningFill16RedIcon;
15
- case "normal":
16
- return iconsReact.InfoICircleFill16SecondaryIcon;
17
- default:
18
- return iconsReact.InfoICircleFill16SecondaryIcon;
19
- }
20
- }
21
-
22
- exports.getAlertIcon = getAlertIcon;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var tower = require('./tower.js');
4
-
5
- function isEmpty(rawValue) {
6
- if (rawValue === null || rawValue === void 0 || rawValue === tower.MAGIC_METRIC_NULL || Number.isNaN(rawValue) || !Number.isFinite(rawValue)) {
7
- return true;
8
- }
9
- return false;
10
- }
11
-
12
- module.exports = isEmpty;
@@ -1,87 +0,0 @@
1
- 'use strict';
2
-
3
- var dayjs = require('dayjs');
4
- var customParseFormat = require('dayjs/plugin/customParseFormat');
5
- var UTC = require('dayjs/plugin/utc');
6
- var _ = require('lodash');
7
- require('./cron-time.js');
8
-
9
- dayjs.extend(UTC);
10
- dayjs.extend(customParseFormat);
11
- const DEFAULT_TIME = dayjs("00:00", "HH:mm");
12
- function getTime(cronTime, isUTC = false) {
13
- const { hour, minute } = cronTime.unitMap;
14
- const _hour = Object.keys(hour)[0];
15
- const _minute = Object.keys(minute)[0];
16
- if (isUTC) {
17
- return dayjs.utc(`${_hour}:${_minute}`, "HH:mm").local();
18
- }
19
- return dayjs(`${_hour}:${_minute}`, "HH:mm");
20
- }
21
- function getMode(source) {
22
- if (source.startsWith("@x-every-n-day")) {
23
- return "day";
24
- }
25
- if (source.startsWith("@x-every-n-week")) {
26
- return "week";
27
- }
28
- const [, , , monthDay, month] = source.split(" ");
29
- if (!monthDay || !month) {
30
- return "day";
31
- }
32
- if (!monthDay.includes("*") || month !== "*") {
33
- return "month";
34
- }
35
- return "day";
36
- }
37
- function getDaily(mode, source, time, defaultTime = DEFAULT_TIME) {
38
- const matchedArr = source.match(/@x-every-n-day\(\d+,\d+,(\d+)\)/);
39
- const step = matchedArr ? parseInt(matchedArr[1], 10) : 1;
40
- return {
41
- step,
42
- time: mode === "day" ? time : defaultTime
43
- };
44
- }
45
- function toDailyString(step, time) {
46
- return `@x-every-n-day(${time.minute()},${time.hour()},${step || 1})`;
47
- }
48
- function getWeekly(mode, source, time, defaultTime = DEFAULT_TIME) {
49
- const matchedArr = source.match(/@x-every-n-week\(\d+,\d+,(\d+),(.+)\)/);
50
- const step = matchedArr ? parseInt(matchedArr[1], 10) : 1;
51
- const days = matchedArr ? matchedArr[2] === "*" ? [] : matchedArr[2].split(",").map((v) => parseInt(v, 10)) : [];
52
- return {
53
- step,
54
- days,
55
- time: mode === "week" ? time : defaultTime
56
- };
57
- }
58
- function toWeeklyString(step, time, days) {
59
- return `@x-every-n-week(${time.minute()},${time.hour()},${step || 1},${days.join(",") || "*"})`;
60
- }
61
- function getMonthly(mode, month, day, time, defaultTime = DEFAULT_TIME) {
62
- return {
63
- step: month === "*" ? 1 : parseInt(_.last(month) || "1", 10),
64
- days: day === "*" || mode !== "month" || !month ? [] : day.split(",").map((v) => parseInt(v, 10)),
65
- time: mode === "month" ? time : defaultTime
66
- };
67
- }
68
- function toMonthlyString(step, time, days) {
69
- return [
70
- 0,
71
- time.minute(),
72
- time.hour(),
73
- days.join(",") || "*",
74
- step > 1 ? `*/${step}` : "*",
75
- "*"
76
- ].join(" ");
77
- }
78
-
79
- exports.DEFAULT_TIME = DEFAULT_TIME;
80
- exports.getDaily = getDaily;
81
- exports.getMode = getMode;
82
- exports.getMonthly = getMonthly;
83
- exports.getTime = getTime;
84
- exports.getWeekly = getWeekly;
85
- exports.toDailyString = toDailyString;
86
- exports.toMonthlyString = toMonthlyString;
87
- exports.toWeeklyString = toWeeklyString;