@cloudtower/eagle 0.27.55 → 0.27.56

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