@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,462 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var iconsReact = require('@cloudtower/icons-react');
6
+ var parrot = require('@cloudtower/parrot');
7
+ var core = require('@linaria/core');
8
+ var index = require('../../core/AccordionCard/index.js');
9
+ var index$4 = require('../../core/Button/index.js');
10
+ var index$3 = require('../../core/Fields/index.js');
11
+ var index$2 = require('../../core/Switch/index.js');
12
+ var index$5 = require('../../core/TimePicker/index.js');
13
+ var index$1 = require('../../core/Typo/index.js');
14
+ var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
15
+ var antd = require('antd');
16
+ var dayjs = require('dayjs');
17
+ var _ = require('lodash');
18
+ var moment = require('moment');
19
+ var React = require('react');
20
+ var cronTime = require('../../utils/cron-time.js');
21
+ var time = require('../../utils/time.js');
22
+
23
+ var __defProp = Object.defineProperty;
24
+ var __defProps = Object.defineProperties;
25
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
26
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
27
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
28
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
29
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value
34
+ }) : obj[key] = value;
35
+ var __spreadValues = (a, b) => {
36
+ for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
37
+ if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
38
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
39
+ }
40
+ return a;
41
+ };
42
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
43
+ const CronPlanWrapper = "c1up1pdz";
44
+ const CronPlanHeader = "c156wh19";
45
+ const ModeTabs = "m126spxy";
46
+ const Wrapper = "wpbf4pq";
47
+ const stringifyPlan = (mode, daily, weekly, monthly, i18n) => {
48
+ const isEn = i18n.language === parrot.ParrotLngs.en;
49
+ const mark = isEn ? " , " : "\u3001";
50
+ const days_map = isEn ? EN_WEEK_DAYS_MAP(i18n.t) : WEEK_DAYS_MAP(i18n.t);
51
+ if (mode === "day") {
52
+ const time = daily.time.format("HH:mm");
53
+ const count = daily.step || 0;
54
+ return count > 1 ? i18n.t("components.every_day_with_count_and_time", {
55
+ count: daily.step,
56
+ time
57
+ }) : i18n.t("components.every_day_with_time", {
58
+ time
59
+ });
60
+ }
61
+ if (mode === "week") {
62
+ const time = weekly.time.format("HH:mm");
63
+ const count = weekly.step || 0;
64
+ const day = weekly.days.map(d => days_map[d]).join(mark);
65
+ const repeat_day = weekly.days.length > 0;
66
+ return count > 1 ? repeat_day ? i18n.t("components.every_weeks_with_count_and_day_and_time", {
67
+ count,
68
+ day,
69
+ time
70
+ }) : i18n.t("components.every_weeks_with_count_and_time", {
71
+ count,
72
+ time
73
+ }) : repeat_day ? i18n.t("components.every_week_with_day_and_time", {
74
+ time,
75
+ day
76
+ }) : i18n.t("components.every_week_with_time", {
77
+ time
78
+ });
79
+ }
80
+ if (mode === "month") {
81
+ const time = monthly.time.format("HH:mm");
82
+ const count = monthly.step || 0;
83
+ const day = monthly.days.join(mark);
84
+ const repeat_day = monthly.days.length > 0;
85
+ return count > 1 ? repeat_day ? i18n.t("components.every_months_with_count_and_day_and_time", {
86
+ count,
87
+ time,
88
+ day
89
+ }) : i18n.t("components.every_months_with_count_and_time", {
90
+ count,
91
+ time
92
+ }) : repeat_day ? i18n.t("components.every_month_with_day_and_time", {
93
+ day,
94
+ time
95
+ }) : i18n.t("components.every_month_with_time", {
96
+ time
97
+ });
98
+ }
99
+ };
100
+ const Mode = ({
101
+ mode,
102
+ setMode
103
+ }) => {
104
+ const {
105
+ t
106
+ } = useParrotTranslation();
107
+ return /* @__PURE__ */React.createElement("div", {
108
+ className: ModeTabs
109
+ }, /* @__PURE__ */React.createElement(index$4, {
110
+ className: core.cx(mode === "day" && "active"),
111
+ type: "link",
112
+ onClick: () => setMode("day")
113
+ }, t("components.as_day")), /* @__PURE__ */React.createElement(index$4, {
114
+ className: core.cx(mode === "week" && "active"),
115
+ type: "link",
116
+ onClick: () => setMode("week")
117
+ }, t("components.as_week")), /* @__PURE__ */React.createElement(index$4, {
118
+ className: core.cx(mode === "month" && "active"),
119
+ type: "link",
120
+ onClick: () => setMode("month")
121
+ }, t("components.as_month")));
122
+ };
123
+ const Daily = ({
124
+ daily,
125
+ setDaily
126
+ }) => {
127
+ const {
128
+ t
129
+ } = useParrotTranslation();
130
+ return /* @__PURE__ */React.createElement("div", {
131
+ className: Wrapper
132
+ }, t("components.per_day_1"), /* @__PURE__ */React.createElement(index$3.Int, {
133
+ meta: {},
134
+ input: {
135
+ value: daily.step,
136
+ onChange: value => {
137
+ setDaily(__spreadProps(__spreadValues({}, daily), {
138
+ step: value
139
+ }));
140
+ },
141
+ name: "daily-step",
142
+ onBlur() {},
143
+ onFocus() {},
144
+ maxLength: 3
145
+ }
146
+ }), t("components.per_day_2"), /* @__PURE__ */React.createElement(index$5, {
147
+ format: "HH:mm",
148
+ value: daily.time,
149
+ onChange: value => {
150
+ if (value) {
151
+ setDaily(__spreadProps(__spreadValues({}, daily), {
152
+ time: value
153
+ }));
154
+ }
155
+ },
156
+ clearIcon: null,
157
+ suffixIcon: null
158
+ }), t("components.per_day_3"));
159
+ };
160
+ const WEEK_DAYS = t => [{
161
+ value: 1,
162
+ text: t("common.monday")
163
+ }, {
164
+ value: 2,
165
+ text: t("common.tuesday")
166
+ }, {
167
+ value: 3,
168
+ text: t("common.wednesday")
169
+ }, {
170
+ value: 4,
171
+ text: t("common.thursday")
172
+ }, {
173
+ value: 5,
174
+ text: t("common.friday")
175
+ }, {
176
+ value: 6,
177
+ text: t("common.saturday")
178
+ }, {
179
+ value: 0,
180
+ text: t("common.sunday")
181
+ }];
182
+ const WEEK_DAYS_MAP = t => WEEK_DAYS(t).reduce((prev, cur) => {
183
+ prev[cur.value] = cur.text[1];
184
+ return prev;
185
+ }, {});
186
+ const EN_WEEK_DAYS_MAP = t => WEEK_DAYS(t).reduce((prev, cur) => {
187
+ prev[cur.value] = cur.text;
188
+ return prev;
189
+ }, {});
190
+ const Weekly = ({
191
+ weekly,
192
+ setWeekly
193
+ }) => {
194
+ const {
195
+ t,
196
+ i18n
197
+ } = useParrotTranslation();
198
+ const week_days = React.useMemo(() => WEEK_DAYS(t), [t]);
199
+ return /* @__PURE__ */React.createElement("div", {
200
+ className: Wrapper
201
+ }, t("components.per_day_1"), /* @__PURE__ */React.createElement(index$3.Int, {
202
+ meta: {},
203
+ input: {
204
+ value: weekly.step,
205
+ onChange: value => {
206
+ setWeekly(__spreadProps(__spreadValues({}, weekly), {
207
+ step: value
208
+ }));
209
+ },
210
+ name: "weekly-step",
211
+ onBlur() {},
212
+ onFocus() {},
213
+ maxLength: 3
214
+ }
215
+ }), t("components.week_with_below_date"), /* @__PURE__ */React.createElement("div", {
216
+ className: "options"
217
+ }, week_days.map(d => {
218
+ const active = weekly.days.includes(d.value);
219
+ return /* @__PURE__ */React.createElement(index$4, {
220
+ className: core.cx("week-day-option", active && "active", i18n.language === parrot.ParrotLngs.en && "en-text"),
221
+ type: "default",
222
+ key: d.value,
223
+ onClick: () => setWeekly(__spreadProps(__spreadValues({}, weekly), {
224
+ days: active ? weekly.days.filter(day => day !== d.value) : weekly.days.concat(d.value).sort((a, b) => a - b)
225
+ }))
226
+ }, d.text);
227
+ })), t("components.execution_time"), /* @__PURE__ */React.createElement(index$5, {
228
+ style: {
229
+ marginLeft: 0
230
+ },
231
+ format: "HH:mm",
232
+ value: weekly.time,
233
+ onChange: value => {
234
+ if (value) {
235
+ setWeekly(__spreadProps(__spreadValues({}, weekly), {
236
+ time: value
237
+ }));
238
+ }
239
+ },
240
+ clearIcon: null,
241
+ suffixIcon: null
242
+ }));
243
+ };
244
+ const MONTH_DAYS = _.range(1, 32);
245
+ const Monthly = ({
246
+ monthly,
247
+ setMonthly
248
+ }) => {
249
+ const mayNotExistDays = _.intersection(monthly.days, [29, 30, 31]);
250
+ const {
251
+ t,
252
+ i18n
253
+ } = useParrotTranslation();
254
+ const mark = i18n.language === parrot.ParrotLngs.en ? " , " : "\u3001";
255
+ return /* @__PURE__ */React.createElement("div", {
256
+ className: Wrapper
257
+ }, t("components.per_day_1"), /* @__PURE__ */React.createElement(index$3.Int, {
258
+ meta: {},
259
+ input: {
260
+ value: monthly.step,
261
+ onChange: value => {
262
+ setMonthly(__spreadProps(__spreadValues({}, monthly), {
263
+ step: value
264
+ }));
265
+ },
266
+ name: "monthly-step",
267
+ onBlur() {},
268
+ onFocus() {},
269
+ maxLength: 3
270
+ }
271
+ }), t("components.month_with_below_date"), /* @__PURE__ */React.createElement("div", {
272
+ className: "options"
273
+ }, MONTH_DAYS.map(d => {
274
+ const active = monthly.days.includes(d);
275
+ return /* @__PURE__ */React.createElement(index$4, {
276
+ className: core.cx("month-day-option", active && "active"),
277
+ type: "default",
278
+ key: d,
279
+ onClick: () => setMonthly(__spreadProps(__spreadValues({}, monthly), {
280
+ days: active ? monthly.days.filter(day => day !== d) : monthly.days.concat(d).sort((a, b) => a - b)
281
+ }))
282
+ }, d);
283
+ }), mayNotExistDays.length > 0 && /* @__PURE__ */React.createElement("span", {
284
+ className: core.cx("help", index$1.Typo.Label.l4_regular)
285
+ }, t("components.will_excute_at_last_day_with_date", {
286
+ date: `${mayNotExistDays.join(mark)} `
287
+ }))), t("components.execution_time"), /* @__PURE__ */React.createElement(index$5, {
288
+ style: {
289
+ marginLeft: 0
290
+ },
291
+ format: "HH:mm",
292
+ value: monthly.time,
293
+ onChange: value => {
294
+ if (value) {
295
+ setMonthly(__spreadProps(__spreadValues({}, monthly), {
296
+ time: value
297
+ }));
298
+ }
299
+ },
300
+ clearIcon: null,
301
+ suffixIcon: null
302
+ }));
303
+ };
304
+ const CronPlan = props => {
305
+ const {
306
+ value,
307
+ onChange,
308
+ onRemove
309
+ } = props;
310
+ const {
311
+ t,
312
+ i18n
313
+ } = useParrotTranslation();
314
+ const cronTime$1 = React.useMemo(() => {
315
+ return new cronTime.CronTime(value.expression, value.startAt);
316
+ }, [value]);
317
+ const sendAtDate = React.useMemo(() => cronTime$1.sendAt(), [cronTime$1]);
318
+ const changeValue = newValue => {
319
+ onChange(__spreadValues(__spreadValues({}, value), newValue));
320
+ };
321
+ const [mode, setMode] = React.useState(time.getMode(cronTime$1["source"]));
322
+ const source = cronTime$1["source"];
323
+ const [,,, day, month] = source.split(" ");
324
+ const time$1 = time.getTime(cronTime$1);
325
+ const [daily, setDaily] = React.useState(() => {
326
+ const rawDaily = time.getDaily(mode, source, time$1);
327
+ return __spreadProps(__spreadValues({}, rawDaily), {
328
+ time: moment(rawDaily.time.format())
329
+ });
330
+ });
331
+ const [weekly, setWeekly] = React.useState(() => {
332
+ const rawWeekly = time.getWeekly(mode, source, time$1);
333
+ return __spreadProps(__spreadValues({}, rawWeekly), {
334
+ time: moment(rawWeekly.time.format())
335
+ });
336
+ });
337
+ const [monthly, setMonthly] = React.useState(() => {
338
+ const rawMonthly = time.getMonthly(mode, month, day, time$1);
339
+ return __spreadProps(__spreadValues({}, rawMonthly), {
340
+ time: moment(rawMonthly.time.format())
341
+ });
342
+ });
343
+ React.useEffect(() => {
344
+ let newExpression = "";
345
+ let empty = false;
346
+ switch (mode) {
347
+ case "day":
348
+ newExpression = time.toDailyString(daily.step, dayjs(daily.time.format()));
349
+ break;
350
+ case "week":
351
+ newExpression = time.toWeeklyString(weekly.step, dayjs(weekly.time.format()), weekly.days);
352
+ if (weekly.days.length === 0) {
353
+ empty = true;
354
+ }
355
+ break;
356
+ case "month":
357
+ newExpression = time.toMonthlyString(monthly.step, dayjs(monthly.time.format()), monthly.days);
358
+ if (monthly.days.length === 0) {
359
+ empty = true;
360
+ }
361
+ break;
362
+ }
363
+ if (newExpression === value.expression) {
364
+ return;
365
+ }
366
+ changeValue({
367
+ expression: newExpression,
368
+ empty
369
+ });
370
+ }, [mode, daily, weekly, monthly]);
371
+ const title = stringifyPlan(mode, daily, weekly, monthly, i18n);
372
+ return /* @__PURE__ */React.createElement(index, {
373
+ className: CronPlanWrapper,
374
+ header: /* @__PURE__ */React.createElement("div", {
375
+ className: CronPlanHeader
376
+ }, /* @__PURE__ */React.createElement("div", {
377
+ className: "left"
378
+ }, /* @__PURE__ */React.createElement(iconsReact.ClockIcon, null), /* @__PURE__ */React.createElement("span", {
379
+ className: core.cx(index$1.Typo.Label.l2_regular, "title"),
380
+ title
381
+ }, title), /* @__PURE__ */React.createElement("span", {
382
+ className: core.cx(index$1.Typo.Label.l4_regular, "retain")
383
+ }, t("components.retain_with_count", {
384
+ count: value.retain || 1
385
+ }))), /* @__PURE__ */React.createElement("div", {
386
+ className: "right",
387
+ onClick: e => e.stopPropagation()
388
+ }, /* @__PURE__ */React.createElement("span", {
389
+ className: "reverse"
390
+ }, /* @__PURE__ */React.createElement(index$2, {
391
+ checked: value.enabled,
392
+ onChange: v => changeValue({
393
+ enabled: v
394
+ })
395
+ }, value.enabled ? t("common.enable") : t("common.disable"))), /* @__PURE__ */React.createElement("span", {
396
+ className: "close",
397
+ onClick: onRemove
398
+ }, /* @__PURE__ */React.createElement(iconsReact.CloseIcon, null)))),
399
+ expand: /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Mode, {
400
+ mode,
401
+ setMode
402
+ }), mode === "day" && /* @__PURE__ */React.createElement(Daily, {
403
+ daily,
404
+ setDaily
405
+ }), mode === "week" && /* @__PURE__ */React.createElement(Weekly, {
406
+ weekly,
407
+ setWeekly
408
+ }), mode === "month" && /* @__PURE__ */React.createElement(Monthly, {
409
+ monthly,
410
+ setMonthly
411
+ }), /* @__PURE__ */React.createElement("div", {
412
+ className: "field-item"
413
+ }, /* @__PURE__ */React.createElement("label", {
414
+ className: index$1.Typo.Label.l3_regular_title
415
+ }, t("components.start_date")), /* @__PURE__ */React.createElement("div", {
416
+ className: "field"
417
+ }, /* @__PURE__ */React.createElement(antd.DatePicker, {
418
+ format: "YYYY/M/DD",
419
+ value: moment(value.startAt.toISOString()),
420
+ onChange: value2 => {
421
+ if (value2) {
422
+ changeValue({
423
+ startAt: dayjs(value2.toISOString())
424
+ });
425
+ }
426
+ },
427
+ suffixIcon: null,
428
+ clearIcon: null
429
+ }), /* @__PURE__ */React.createElement("div", {
430
+ className: core.cx("help", index$1.Typo.Footnote.f2_regular)
431
+ }, t("components.next_generate_with_date", {
432
+ date: sendAtDate.format("YYYY/M/DD HH:mm"),
433
+ interpolation: {
434
+ escapeValue: false
435
+ }
436
+ })))), /* @__PURE__ */React.createElement("div", {
437
+ className: "field-item"
438
+ }, /* @__PURE__ */React.createElement("label", {
439
+ className: index$1.Typo.Label.l3_regular_title
440
+ }, t("components.retain_date")), /* @__PURE__ */React.createElement("div", {
441
+ className: "field"
442
+ }, /* @__PURE__ */React.createElement(index$3.Int, {
443
+ suffix: t("components.count"),
444
+ meta: {},
445
+ input: {
446
+ value: value.retain,
447
+ onChange: v => changeValue({
448
+ retain: v
449
+ }),
450
+ onBlur() {},
451
+ onFocus() {},
452
+ name: "retain",
453
+ maxLength: 2
454
+ }
455
+ }), /* @__PURE__ */React.createElement("div", {
456
+ className: core.cx("help", index$1.Typo.Footnote.f2_regular)
457
+ }, t("components.will_save_one_to_thirty_report")))))
458
+ });
459
+ };
460
+
461
+ exports.default = CronPlan;
462
+ exports.stringifyPlan = stringifyPlan;
@@ -0,0 +1,179 @@
1
+ 'use strict';
2
+
3
+ var core = require('@linaria/core');
4
+ var index$1 = require('../../core/Button/index.js');
5
+ var index = require('../../core/Typo/index.js');
6
+ var Calendar = require('./Calendar.js');
7
+ var common = require('./common.js');
8
+ var DateRangePicker_style = require('./DateRangePicker.style.js');
9
+ var InputTime = require('./InputTime.js');
10
+ var useMemoCompare = require('../../hooks/useMemoCompare.js');
11
+ var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
12
+ var dayjs = require('dayjs');
13
+ var _ = require('lodash');
14
+ var React = require('react');
15
+
16
+ function transformTime(type, day, boundaryDate) {
17
+ if (day) {
18
+ const _boundaryDate = dayjs(boundaryDate);
19
+ if (type === "start" && _boundaryDate.isValid()) {
20
+ const start = day.isBefore(_boundaryDate) ? _boundaryDate : day;
21
+ return [
22
+ common.time2string(start.hour()),
23
+ common.time2string(start.minute()),
24
+ common.time2string(start.second())
25
+ ];
26
+ }
27
+ if (type === "end" && _boundaryDate.isValid()) {
28
+ const end = day.isAfter(_boundaryDate) ? _boundaryDate : day;
29
+ return [
30
+ common.time2string(end.hour()),
31
+ common.time2string(end.minute()),
32
+ common.time2string(end.second())
33
+ ];
34
+ }
35
+ }
36
+ return ["", "", ""];
37
+ }
38
+ function updateDate(time, date) {
39
+ const [hour, minute, second] = time;
40
+ return common.copyDay(dayjs(date == null ? void 0 : date.format())).set("hour", parseInt(hour || "0")).set("minute", parseInt(minute || "0")).set("second", parseInt(second || "0"));
41
+ }
42
+ function checkMinAndMaxTimeRange(t, range, timeRange, minDate, maxDate) {
43
+ const [startDate, endDate] = range;
44
+ const [startTime, endTime] = timeRange;
45
+ if (!startDate && !endDate) {
46
+ return void 0;
47
+ }
48
+ if (!minDate && !maxDate) {
49
+ return void 0;
50
+ }
51
+ const _minDate = common.copyDay(dayjs(minDate));
52
+ const _maxDate = common.copyDay(dayjs(maxDate));
53
+ if (!_minDate.isValid() && !_maxDate.isValid()) {
54
+ return void 0;
55
+ }
56
+ if (startDate && _minDate.isValid() && startTime.filter(Boolean).length) {
57
+ const _startDate = common.copyDay(startDate).set("hour", parseInt(startTime[0] || "0")).set("minute", parseInt(startTime[1] || "")).set("second", parseInt(startTime[2] || "0"));
58
+ if (_startDate.isBefore(_minDate)) {
59
+ return t("components.set_start_time_failed", {
60
+ time: _minDate.format("HH:mm:ss")
61
+ });
62
+ }
63
+ }
64
+ if (endDate && _maxDate.isValid() && endTime.filter(Boolean).length) {
65
+ const _endDate = common.copyDay(endDate).set("hour", parseInt(endTime[0] || "0")).set("minute", parseInt(endTime[1] || "")).set("second", parseInt(endTime[2] || "0"));
66
+ if (_endDate.isAfter(_maxDate)) {
67
+ return t("components.set_end_time_failed", {
68
+ time: _maxDate.format("HH:mm:ss")
69
+ });
70
+ }
71
+ }
72
+ return void 0;
73
+ }
74
+ const Time = React.forwardRef((props, ref) => {
75
+ const { range, minDate, maxDate, onOk } = props;
76
+ const { t } = useParrotTranslation();
77
+ const initRange = useMemoCompare(range, (prev, next) => {
78
+ const prevStringList = prev == null ? void 0 : prev.map((item) => item == null ? void 0 : item.format());
79
+ const nextStringList = next == null ? void 0 : next.map((item) => item == null ? void 0 : item.format());
80
+ return _.isEqual(prevStringList, nextStringList);
81
+ });
82
+ const [startTime, setStartTime] = React.useState(
83
+ transformTime("start", initRange == null ? void 0 : initRange[0], minDate)
84
+ );
85
+ const [endTime, setEndTime] = React.useState(
86
+ transformTime("end", initRange == null ? void 0 : initRange[1], maxDate)
87
+ );
88
+ const [error, setError] = React.useState("");
89
+ const [start, end] = props.range;
90
+ const startDate = start == null ? void 0 : start.format("YYYY-MM-DD");
91
+ const endDate = end == null ? void 0 : end.format("YYYY-MM-DD");
92
+ function reset() {
93
+ setError("");
94
+ setStartTime(transformTime("start", initRange == null ? void 0 : initRange[0], minDate));
95
+ setEndTime(transformTime("end", initRange == null ? void 0 : initRange[1], maxDate));
96
+ }
97
+ React.useImperativeHandle(ref, () => ({ reset }));
98
+ React.useEffect(() => {
99
+ reset();
100
+ }, [initRange]);
101
+ const validateTimeRange = React.useMemo(() => {
102
+ if (startDate && endDate) {
103
+ let _startDate = common.copyDay(dayjs(startDate));
104
+ let _endDate = common.copyDay(dayjs(endDate));
105
+ _startDate = _startDate.set("hour", parseInt(startTime[0] || "0")).set("minute", parseInt(startTime[1] || "0")).set("second", parseInt(startTime[2] || "0"));
106
+ _endDate = _endDate.set("hour", parseInt(endTime[0] || "0")).set("minute", parseInt(endTime[1] || "0")).set("second", parseInt(endTime[2] || "0"));
107
+ return _startDate.valueOf() <= _endDate.valueOf();
108
+ }
109
+ return false;
110
+ }, [endDate, endTime, startDate, startTime]);
111
+ function handleOk() {
112
+ if (!startDate || !endDate) {
113
+ return;
114
+ }
115
+ const validateResult = checkMinAndMaxTimeRange(
116
+ t,
117
+ range,
118
+ [startTime, endTime],
119
+ minDate,
120
+ maxDate
121
+ );
122
+ if (validateResult) {
123
+ setError(validateResult);
124
+ return;
125
+ } else if (!validateTimeRange && start && end) {
126
+ setError(t("components.end_time_cannot_be_less_than_start_time"));
127
+ return;
128
+ } else {
129
+ setError("");
130
+ }
131
+ onOk([startTime, endTime]);
132
+ }
133
+ return /* @__PURE__ */ React.createElement(DateRangePicker_style.AbsoluteTimeStyle.Time, null, /* @__PURE__ */ React.createElement("div", { className: "time-input-main" }, /* @__PURE__ */ React.createElement("div", { className: "time-input-container" }, /* @__PURE__ */ React.createElement("div", { className: "start-time" }, /* @__PURE__ */ React.createElement("p", { className: core.cx("date", index.Typo.Label.l4_regular) }, startDate || t("components.start_date")), /* @__PURE__ */ React.createElement(
134
+ InputTime,
135
+ {
136
+ value: startTime,
137
+ danger: !!error,
138
+ onChange: setStartTime
139
+ }
140
+ )), /* @__PURE__ */ React.createElement("div", { className: core.cx("to", index.Typo.Label.l3_regular) }, t("components.to")), /* @__PURE__ */ React.createElement("div", { className: "end-time" }, /* @__PURE__ */ React.createElement("p", { className: core.cx("date", index.Typo.Label.l4_regular) }, endDate || t("components.end_date")), /* @__PURE__ */ React.createElement(InputTime, { value: endTime, danger: !!error, onChange: setEndTime }))), /* @__PURE__ */ React.createElement(index$1, { disabled: !start || !end, type: "primary", onClick: handleOk }, t("components.confirm"))), error ? /* @__PURE__ */ React.createElement("p", { className: "time-input-error" }, error) : null);
141
+ });
142
+ const AbsoluteDate = React.forwardRef(
143
+ (props, ref) => {
144
+ const { range, minDate, maxDate, onChange, onOk } = props;
145
+ const timeRef = React.useRef(null);
146
+ React.useImperativeHandle(ref, () => {
147
+ var _a;
148
+ return { reset: (_a = timeRef.current) == null ? void 0 : _a.reset };
149
+ });
150
+ function handleOk(timeRange) {
151
+ const [startTime, endTime] = timeRange;
152
+ const nowDate = dayjs();
153
+ const startDate = updateDate(startTime, range[0] || nowDate);
154
+ const endDate = updateDate(endTime, range[1] || nowDate);
155
+ onOk == null ? void 0 : onOk([startDate, endDate]);
156
+ }
157
+ return /* @__PURE__ */ React.createElement(DateRangePicker_style.AbsoluteTimeStyle.Wrapper, null, /* @__PURE__ */ React.createElement(
158
+ Calendar,
159
+ {
160
+ range,
161
+ minDate,
162
+ maxDate,
163
+ onChange
164
+ }
165
+ ), /* @__PURE__ */ React.createElement(
166
+ Time,
167
+ {
168
+ ref: timeRef,
169
+ range,
170
+ minDate,
171
+ maxDate,
172
+ onOk: handleOk
173
+ }
174
+ ));
175
+ }
176
+ );
177
+ var AbsoluteDate$1 = AbsoluteDate;
178
+
179
+ module.exports = AbsoluteDate$1;