@cloudtower/eagle 0.27.53 → 0.27.55

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/cjs/UIKitProvider/index.js +77 -0
  2. package/dist/cjs/core/AccordionCard/index.js +59 -0
  3. package/dist/cjs/core/Alert/index.js +80 -0
  4. package/dist/cjs/core/Arch/index.js +17 -0
  5. package/dist/cjs/core/Badge/index.js +51 -0
  6. package/dist/cjs/core/BaseIcon/index.js +76 -0
  7. package/dist/cjs/core/Bit/index.js +40 -0
  8. package/dist/cjs/core/BitPerSecond/index.js +40 -0
  9. package/dist/cjs/core/Bps/index.js +40 -0
  10. package/dist/cjs/core/Breadcrumb/index.js +58 -0
  11. package/dist/cjs/core/Button/HoverableElement.js +14 -0
  12. package/dist/cjs/core/Button/index.js +89 -0
  13. package/dist/cjs/core/ButtonGroup/index.js +110 -0
  14. package/dist/cjs/core/Byte/index.js +49 -0
  15. package/dist/cjs/core/Calendar/index.js +25 -0
  16. package/dist/cjs/core/Card/CardBody.js +12 -0
  17. package/dist/cjs/core/Card/CardTitle.js +12 -0
  18. package/dist/cjs/core/Card/CardWrapper.js +55 -0
  19. package/dist/cjs/core/Card/index.js +94 -0
  20. package/dist/cjs/core/Cascader/cascader.style.js +23 -0
  21. package/dist/cjs/core/Cascader/cascader.widget.js +86 -0
  22. package/dist/cjs/core/Cascader/index.js +74 -0
  23. package/dist/cjs/core/Checkbox/checkbox.style.js +5 -0
  24. package/dist/cjs/core/Checkbox/index.js +53 -0
  25. package/dist/cjs/core/DetailCard/index.js +23 -0
  26. package/dist/cjs/core/DonutChart/index.js +167 -0
  27. package/dist/cjs/core/DropdownMenu/index.js +66 -0
  28. package/dist/cjs/core/Empty/index.js +11 -0
  29. package/dist/cjs/core/ExpandableList/ExpandIcon.js +17 -0
  30. package/dist/cjs/core/ExpandableList/ExpandableContainer.js +17 -0
  31. package/dist/cjs/core/ExpandableList/ExpandableItem.js +48 -0
  32. package/dist/cjs/core/ExpandableList/RoundOrder.js +22 -0
  33. package/dist/cjs/core/FailedLoad/index.js +32 -0
  34. package/dist/cjs/core/Fields/FieldsBoolean/index.js +47 -0
  35. package/dist/cjs/core/Fields/FieldsDateTime/index.js +24 -0
  36. package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +50 -0
  37. package/dist/cjs/core/Fields/FieldsEnum/index.js +60 -0
  38. package/dist/cjs/core/Fields/FieldsFloat/index.js +60 -0
  39. package/dist/cjs/core/Fields/FieldsInt/index.js +78 -0
  40. package/dist/cjs/core/Fields/FieldsInteger/index.js +57 -0
  41. package/dist/cjs/core/Fields/FieldsString/index.js +116 -0
  42. package/dist/cjs/core/Fields/FieldsTextArea/index.js +64 -0
  43. package/dist/cjs/core/Fields/FieldsTimePicker/index.js +54 -0
  44. package/dist/cjs/core/Fields/index.js +28 -0
  45. package/dist/cjs/core/Form/index.js +10 -0
  46. package/dist/cjs/core/FormItem/index.js +38 -0
  47. package/dist/cjs/core/Frequency/index.js +40 -0
  48. package/dist/cjs/core/Icon/index.js +117 -0
  49. package/dist/cjs/core/Input/index.js +66 -0
  50. package/dist/cjs/core/InputGroup/index.js +14 -0
  51. package/dist/cjs/core/InputInteger/formatterInteger.js +15 -0
  52. package/dist/cjs/core/InputInteger/index.js +97 -0
  53. package/dist/cjs/core/InputNumber/index.js +90 -0
  54. package/dist/cjs/core/InputTagItem/index.js +12 -0
  55. package/dist/cjs/core/KitStoreProvider/index.js +23 -0
  56. package/dist/cjs/core/Link/index.js +56 -0
  57. package/dist/cjs/core/Loading/index.js +33 -0
  58. package/dist/cjs/core/Loading/style.js +11 -0
  59. package/dist/cjs/core/Metric/metric.js +21 -0
  60. package/dist/cjs/core/Modal/index.js +214 -0
  61. package/dist/cjs/core/ModalStack/index.js +47 -0
  62. package/dist/cjs/core/Overflow/index.js +117 -0
  63. package/dist/cjs/core/Pagination/index.js +120 -0
  64. package/dist/cjs/core/ParrotTrans/index.js +28 -0
  65. package/dist/cjs/core/Percent/index.js +41 -0
  66. package/dist/cjs/core/Progress/index.js +25 -0
  67. package/dist/cjs/core/Radio/index.js +142 -0
  68. package/dist/cjs/core/SearchInput/index.js +50 -0
  69. package/dist/cjs/core/Second/index.js +43 -0
  70. package/dist/cjs/core/SegmentControl/index.js +43 -0
  71. package/dist/cjs/core/Select/index.js +140 -0
  72. package/dist/cjs/core/SimplePagination/index.js +90 -0
  73. package/dist/cjs/core/Speed/index.js +40 -0
  74. package/dist/cjs/core/StatusCapsule/index.js +100 -0
  75. package/dist/cjs/core/StepProgress/index.js +44 -0
  76. package/dist/cjs/core/Steps/index.js +126 -0
  77. package/dist/cjs/core/Steps/style.js +13 -0
  78. package/dist/cjs/core/Styled/index.js +57 -0
  79. package/dist/cjs/core/Switch/index.js +61 -0
  80. package/dist/cjs/core/Table/TableWidget.js +47 -0
  81. package/dist/cjs/core/Table/common.js +46 -0
  82. package/dist/cjs/core/Table/index.js +112 -0
  83. package/dist/cjs/core/TableForm/AddRowButton.js +108 -0
  84. package/dist/cjs/core/TableForm/Columns/AffixColumn.js +48 -0
  85. package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +35 -0
  86. package/dist/cjs/core/TableForm/Columns/FormItem.js +20 -0
  87. package/dist/cjs/core/TableForm/Columns/InputColumn.js +117 -0
  88. package/dist/cjs/core/TableForm/Columns/TextColumn.js +44 -0
  89. package/dist/cjs/core/TableForm/Columns/index.js +24 -0
  90. package/dist/cjs/core/TableForm/TableFormBodyCell.js +165 -0
  91. package/dist/cjs/core/TableForm/TableFormBodyRows.js +215 -0
  92. package/dist/cjs/core/TableForm/TableFormHeaderCell.js +93 -0
  93. package/dist/cjs/core/TableForm/index.js +187 -0
  94. package/dist/cjs/core/TableForm/style.js +35 -0
  95. package/dist/cjs/core/TableForm/types.js +10 -0
  96. package/dist/cjs/core/TableForm/utils.js +36 -0
  97. package/dist/cjs/core/Tag/SplitTag.js +64 -0
  98. package/dist/cjs/core/Tag/const.js +12 -0
  99. package/dist/cjs/core/Tag/index.js +96 -0
  100. package/dist/cjs/core/Tag/style.js +14 -0
  101. package/dist/cjs/core/TextArea/index.js +72 -0
  102. package/dist/cjs/core/Time/index.js +31 -0
  103. package/dist/cjs/core/TimePicker/index.js +66 -0
  104. package/dist/cjs/core/TimeZoneSelect/index.js +165 -0
  105. package/dist/cjs/core/Token/index.js +86 -0
  106. package/dist/cjs/core/Token/style.js +5 -0
  107. package/dist/cjs/core/Tooltip/index.js +89 -0
  108. package/dist/cjs/core/Truncate/index.js +49 -0
  109. package/dist/cjs/core/Typo/index.js +130 -0
  110. package/dist/cjs/core/antd.js +208 -0
  111. package/dist/cjs/core/message/index.js +203 -0
  112. package/dist/cjs/core/message-group/index.js +147 -0
  113. package/dist/cjs/coreX/BarChart/index.js +39 -0
  114. package/dist/cjs/coreX/BatchOperation/index.js +149 -0
  115. package/dist/cjs/coreX/ChartWithTooltip/index.js +154 -0
  116. package/dist/cjs/coreX/Counting/index.js +22 -0
  117. package/dist/cjs/coreX/CronCalendar/index.js +105 -0
  118. package/dist/cjs/coreX/CronPlan/index.js +462 -0
  119. package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +179 -0
  120. package/dist/cjs/coreX/DateRangePicker/Calendar.js +286 -0
  121. package/dist/cjs/coreX/DateRangePicker/DateRangePicker.style.js +84 -0
  122. package/dist/cjs/coreX/DateRangePicker/InputTime.js +151 -0
  123. package/dist/cjs/coreX/DateRangePicker/RelativeTime.js +53 -0
  124. package/dist/cjs/coreX/DateRangePicker/common.js +195 -0
  125. package/dist/cjs/coreX/DateRangePicker/index.js +331 -0
  126. package/dist/cjs/coreX/DeprecatedDonutChart/index.js +39 -0
  127. package/dist/cjs/coreX/DropdownTransition/index.js +73 -0
  128. package/dist/cjs/coreX/GoBackButton/index.js +45 -0
  129. package/dist/cjs/coreX/I18nNameTag/index.js +37 -0
  130. package/dist/cjs/coreX/NamesTooltip/index.js +34 -0
  131. package/dist/cjs/coreX/OverflowTooltip/index.js +92 -0
  132. package/dist/cjs/coreX/SidebarSubtitle/index.js +13 -0
  133. package/dist/cjs/coreX/SortableList/index.js +33 -0
  134. package/dist/cjs/coreX/SummaryTable/index.js +113 -0
  135. package/dist/cjs/coreX/SwitchWithText/index.js +59 -0
  136. package/dist/cjs/coreX/TabMenu/index.js +152 -0
  137. package/dist/cjs/coreX/TruncatedTextWithTooltip/index.js +69 -0
  138. package/dist/cjs/coreX/UnitWithChart/index.js +118 -0
  139. package/dist/cjs/coreX/common/getCalendarTitle.js +26 -0
  140. package/dist/cjs/hooks/useElementIntersectionRatio.js +30 -0
  141. package/dist/cjs/hooks/useElementResize.js +69 -0
  142. package/dist/cjs/hooks/useElementsSize.js +58 -0
  143. package/dist/cjs/hooks/useMemoCompare.js +17 -0
  144. package/dist/cjs/hooks/useParrotTranslation.js +13 -0
  145. package/dist/cjs/index.js +120 -0
  146. package/dist/cjs/spec/type.js +9 -0
  147. package/dist/{umd → cjs}/stats1.html +1 -1
  148. package/dist/cjs/store/chart.js +65 -0
  149. package/dist/cjs/store/index.js +48 -0
  150. package/dist/cjs/store/modal.js +67 -0
  151. package/dist/cjs/styles/token/color.js +273 -0
  152. package/dist/cjs/utils/constants.js +8 -0
  153. package/dist/cjs/utils/cron-time.js +450 -0
  154. package/dist/cjs/utils/dom.js +16 -0
  155. package/dist/cjs/utils/icon.js +22 -0
  156. package/dist/cjs/utils/isEmpty.js +12 -0
  157. package/dist/cjs/utils/time.js +86 -0
  158. package/dist/cjs/utils/tower.js +188 -0
  159. package/dist/components.css +3101 -2209
  160. package/dist/esm/UIKitProvider/index.js +71 -0
  161. package/dist/esm/core/AccordionCard/index.js +57 -0
  162. package/dist/esm/core/Alert/index.js +78 -0
  163. package/dist/esm/core/Arch/index.js +15 -0
  164. package/dist/esm/core/Badge/index.js +49 -0
  165. package/dist/esm/core/BaseIcon/index.js +74 -0
  166. package/dist/esm/core/Bit/index.js +38 -0
  167. package/dist/esm/core/BitPerSecond/index.js +38 -0
  168. package/dist/esm/core/Bps/index.js +38 -0
  169. package/dist/esm/core/Breadcrumb/index.js +53 -0
  170. package/dist/esm/core/Button/HoverableElement.js +12 -0
  171. package/dist/esm/core/Button/index.js +87 -0
  172. package/dist/esm/core/ButtonGroup/index.js +105 -0
  173. package/dist/esm/core/Byte/index.js +47 -0
  174. package/dist/esm/core/Calendar/index.js +23 -0
  175. package/dist/esm/core/Card/CardBody.js +10 -0
  176. package/dist/esm/core/Card/CardTitle.js +10 -0
  177. package/dist/esm/core/Card/CardWrapper.js +53 -0
  178. package/dist/esm/core/Card/index.js +92 -0
  179. package/dist/esm/core/Cascader/cascader.style.js +12 -0
  180. package/dist/esm/core/Cascader/cascader.widget.js +79 -0
  181. package/dist/esm/core/Cascader/index.js +72 -0
  182. package/dist/esm/core/Checkbox/checkbox.style.js +3 -0
  183. package/dist/esm/core/Checkbox/index.js +51 -0
  184. package/dist/esm/core/DetailCard/index.js +21 -0
  185. package/dist/esm/core/DonutChart/index.js +161 -0
  186. package/dist/esm/core/DropdownMenu/index.js +61 -0
  187. package/dist/esm/core/Empty/index.js +9 -0
  188. package/dist/esm/core/ExpandableList/ExpandIcon.js +15 -0
  189. package/dist/esm/core/ExpandableList/ExpandableContainer.js +15 -0
  190. package/dist/esm/core/ExpandableList/ExpandableItem.js +46 -0
  191. package/dist/esm/core/ExpandableList/RoundOrder.js +20 -0
  192. package/dist/esm/core/FailedLoad/index.js +30 -0
  193. package/dist/esm/core/Fields/FieldsBoolean/index.js +45 -0
  194. package/dist/esm/core/Fields/FieldsDateTime/index.js +22 -0
  195. package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +48 -0
  196. package/dist/esm/core/Fields/FieldsEnum/index.js +58 -0
  197. package/dist/esm/core/Fields/FieldsFloat/index.js +58 -0
  198. package/dist/esm/core/Fields/FieldsInt/index.js +76 -0
  199. package/dist/esm/core/Fields/FieldsInteger/index.js +55 -0
  200. package/dist/esm/core/Fields/FieldsString/index.js +114 -0
  201. package/dist/esm/core/Fields/FieldsTextArea/index.js +62 -0
  202. package/dist/esm/core/Fields/FieldsTimePicker/index.js +52 -0
  203. package/dist/esm/core/Fields/index.js +26 -0
  204. package/dist/esm/core/Form/index.js +8 -0
  205. package/dist/esm/core/FormItem/index.js +36 -0
  206. package/dist/esm/core/Frequency/index.js +38 -0
  207. package/dist/esm/core/Icon/index.js +115 -0
  208. package/dist/esm/core/Input/index.js +64 -0
  209. package/dist/esm/core/InputGroup/index.js +12 -0
  210. package/dist/esm/core/InputInteger/formatterInteger.js +13 -0
  211. package/dist/esm/core/InputInteger/index.js +92 -0
  212. package/dist/esm/core/InputNumber/index.js +85 -0
  213. package/dist/esm/core/InputTagItem/index.js +10 -0
  214. package/dist/esm/core/KitStoreProvider/index.js +17 -0
  215. package/dist/esm/core/Link/index.js +54 -0
  216. package/dist/esm/core/Loading/index.js +31 -0
  217. package/dist/esm/core/Loading/style.js +6 -0
  218. package/dist/esm/core/Metric/metric.js +19 -0
  219. package/dist/esm/core/Modal/index.js +212 -0
  220. package/dist/esm/core/ModalStack/index.js +45 -0
  221. package/dist/esm/core/Overflow/index.js +112 -0
  222. package/dist/esm/core/Pagination/index.js +115 -0
  223. package/dist/esm/core/ParrotTrans/index.js +26 -0
  224. package/dist/esm/core/Percent/index.js +39 -0
  225. package/dist/esm/core/Progress/index.js +23 -0
  226. package/dist/esm/core/Radio/index.js +136 -0
  227. package/dist/esm/core/SearchInput/index.js +48 -0
  228. package/dist/esm/core/Second/index.js +41 -0
  229. package/dist/esm/core/SegmentControl/index.js +41 -0
  230. package/dist/esm/core/Select/index.js +138 -0
  231. package/dist/esm/core/SimplePagination/index.js +88 -0
  232. package/dist/esm/core/Speed/index.js +38 -0
  233. package/dist/esm/core/StatusCapsule/index.js +94 -0
  234. package/dist/esm/core/StepProgress/index.js +42 -0
  235. package/dist/esm/core/Steps/index.js +124 -0
  236. package/dist/esm/core/Steps/style.js +7 -0
  237. package/dist/esm/core/Styled/index.js +45 -0
  238. package/dist/esm/core/Switch/index.js +59 -0
  239. package/dist/esm/core/Table/TableWidget.js +44 -0
  240. package/dist/esm/core/Table/common.js +44 -0
  241. package/dist/esm/core/Table/index.js +104 -0
  242. package/dist/esm/core/TableForm/AddRowButton.js +106 -0
  243. package/dist/esm/core/TableForm/Columns/AffixColumn.js +46 -0
  244. package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +32 -0
  245. package/dist/esm/core/TableForm/Columns/FormItem.js +18 -0
  246. package/dist/esm/core/TableForm/Columns/InputColumn.js +114 -0
  247. package/dist/esm/core/TableForm/Columns/TextColumn.js +41 -0
  248. package/dist/esm/core/TableForm/Columns/index.js +21 -0
  249. package/dist/esm/core/TableForm/TableFormBodyCell.js +163 -0
  250. package/dist/esm/core/TableForm/TableFormBodyRows.js +213 -0
  251. package/dist/esm/core/TableForm/TableFormHeaderCell.js +91 -0
  252. package/dist/esm/core/TableForm/index.js +185 -0
  253. package/dist/esm/core/TableForm/style.js +27 -0
  254. package/dist/esm/core/TableForm/types.js +8 -0
  255. package/dist/esm/core/TableForm/utils.js +32 -0
  256. package/dist/esm/core/Tag/SplitTag.js +62 -0
  257. package/dist/esm/core/Tag/const.js +10 -0
  258. package/dist/esm/core/Tag/index.js +91 -0
  259. package/dist/esm/core/Tag/style.js +9 -0
  260. package/dist/esm/core/TextArea/index.js +70 -0
  261. package/dist/esm/core/Time/index.js +29 -0
  262. package/dist/esm/core/TimePicker/index.js +64 -0
  263. package/dist/esm/core/TimeZoneSelect/index.js +163 -0
  264. package/dist/esm/core/Token/index.js +81 -0
  265. package/dist/esm/core/Token/style.js +3 -0
  266. package/dist/esm/core/Tooltip/index.js +87 -0
  267. package/dist/esm/core/Truncate/index.js +47 -0
  268. package/dist/esm/core/Typo/index.js +128 -0
  269. package/dist/esm/core/antd.js +205 -0
  270. package/dist/esm/core/message/index.js +179 -0
  271. package/dist/esm/core/message-group/index.js +143 -0
  272. package/dist/esm/coreX/BarChart/index.js +34 -0
  273. package/dist/esm/coreX/BatchOperation/index.js +144 -0
  274. package/dist/esm/coreX/ChartWithTooltip/index.js +149 -0
  275. package/dist/esm/coreX/Counting/index.js +20 -0
  276. package/dist/esm/coreX/CronCalendar/index.js +103 -0
  277. package/dist/esm/coreX/CronPlan/index.js +457 -0
  278. package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +177 -0
  279. package/dist/esm/coreX/DateRangePicker/Calendar.js +284 -0
  280. package/dist/esm/coreX/DateRangePicker/DateRangePicker.style.js +77 -0
  281. package/dist/esm/coreX/DateRangePicker/InputTime.js +149 -0
  282. package/dist/esm/coreX/DateRangePicker/RelativeTime.js +51 -0
  283. package/dist/esm/coreX/DateRangePicker/common.js +183 -0
  284. package/dist/esm/coreX/DateRangePicker/index.js +325 -0
  285. package/dist/esm/coreX/DeprecatedDonutChart/index.js +37 -0
  286. package/dist/esm/coreX/DropdownTransition/index.js +71 -0
  287. package/dist/esm/coreX/GoBackButton/index.js +43 -0
  288. package/dist/esm/coreX/I18nNameTag/index.js +35 -0
  289. package/dist/esm/coreX/NamesTooltip/index.js +32 -0
  290. package/dist/esm/coreX/OverflowTooltip/index.js +90 -0
  291. package/dist/esm/coreX/SidebarSubtitle/index.js +11 -0
  292. package/dist/esm/coreX/SortableList/index.js +31 -0
  293. package/dist/esm/coreX/SummaryTable/index.js +108 -0
  294. package/dist/esm/coreX/SwitchWithText/index.js +57 -0
  295. package/dist/esm/coreX/TabMenu/index.js +150 -0
  296. package/dist/esm/coreX/TruncatedTextWithTooltip/index.js +67 -0
  297. package/dist/esm/coreX/UnitWithChart/index.js +113 -0
  298. package/dist/esm/coreX/common/getCalendarTitle.js +24 -0
  299. package/dist/esm/hooks/useElementIntersectionRatio.js +28 -0
  300. package/dist/esm/hooks/useElementResize.js +67 -0
  301. package/dist/esm/hooks/useElementsSize.js +56 -0
  302. package/dist/esm/hooks/useMemoCompare.js +15 -0
  303. package/dist/esm/hooks/useParrotTranslation.js +11 -0
  304. package/dist/esm/index.js +34 -10233
  305. package/dist/esm/spec/type.js +7 -0
  306. package/dist/esm/stats1.html +1 -1
  307. package/dist/esm/store/chart.js +62 -0
  308. package/dist/esm/store/index.js +37 -0
  309. package/dist/esm/store/modal.js +63 -0
  310. package/dist/esm/styles/token/color.js +271 -0
  311. package/dist/esm/utils/constants.js +5 -0
  312. package/dist/esm/utils/cron-time.js +448 -0
  313. package/dist/esm/utils/dom.js +14 -0
  314. package/dist/esm/utils/icon.js +20 -0
  315. package/dist/esm/utils/isEmpty.js +10 -0
  316. package/dist/esm/utils/time.js +76 -0
  317. package/dist/esm/utils/tower.js +173 -0
  318. package/dist/src/index.d.ts +0 -1
  319. package/dist/style.css +2011 -2011
  320. package/dist/token.css +209 -415
  321. package/package.json +8 -6
  322. package/dist/src/styles/token/token.d.ts +0 -1
  323. package/dist/umd/index.js +0 -10322
@@ -0,0 +1,448 @@
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 };
@@ -0,0 +1,14 @@
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 };
@@ -0,0 +1,20 @@
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 };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,76 @@
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 };