@antscorp/antsomi-ui 1.3.5-beta.7 → 1.3.5-beta.71

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 (327) hide show
  1. package/es/assets/images/background/skeleton-background.png +0 -0
  2. package/es/assets/images/components/PreviewModal/Banner/skeletonBackground.png +0 -0
  3. package/es/assets/images/components/PreviewModal/Information/buttonText.png +0 -0
  4. package/es/assets/images/components/PreviewModal/Information/clickButton.png +0 -0
  5. package/es/assets/images/components/PreviewModal/Information/description.png +0 -0
  6. package/es/assets/images/components/PreviewModal/Information/deviceRadio.png +0 -0
  7. package/es/assets/images/components/PreviewModal/Information/itemName.png +0 -0
  8. package/es/assets/images/components/PreviewModal/banner.png +0 -0
  9. package/es/assets/images/components/PreviewModal/information.png +0 -0
  10. package/es/assets/images/components/PreviewModal/similarTemplate.png +0 -0
  11. package/es/assets/images/components/PreviewModal/thumbnails.png +0 -0
  12. package/es/assets/images/components/TemplateListing/blankTemplate.png +0 -0
  13. package/es/assets/images/components/TemplateListing/categoryListing.png +0 -0
  14. package/es/assets/images/components/TemplateListing/empty.png +0 -0
  15. package/es/assets/images/components/TemplateListing/previewModal.png +0 -0
  16. package/es/assets/images/components/TemplateListing/templateItem.png +0 -0
  17. package/es/assets/images/components/TemplateListing/templates.png +0 -0
  18. package/es/assets/images/profile.png +0 -0
  19. package/es/assets/images/skeleton_bg.png +0 -0
  20. package/es/assets/images/tail.png +0 -0
  21. package/es/assets/svg/mobile-frame.svg +3 -0
  22. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +2 -0
  23. package/es/components/atoms/MobileFrame/MobileFrame.js +1 -1
  24. package/es/components/atoms/MobileFrame/styled.d.ts +2 -1
  25. package/es/components/atoms/MobileFrame/styled.js +11 -6
  26. package/es/components/atoms/SlideBar/SlideBar.js +1 -1
  27. package/es/components/atoms/Spin/Spin.js +2 -2
  28. package/es/components/common/ConfigProvider/ConfigProvider.js +4 -3
  29. package/es/components/common/ConfigProvider/GlobalStyle.js +85 -16
  30. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +3 -2
  31. package/es/components/molecules/CalendarSelection/CalendarSelection.d.ts +3 -0
  32. package/es/components/molecules/CalendarSelection/CalendarSelection.js +45 -0
  33. package/es/components/molecules/CalendarSelection/actions.d.ts +55 -0
  34. package/es/components/molecules/CalendarSelection/actions.js +39 -0
  35. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.d.ts +7 -0
  36. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.js +24 -0
  37. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.d.ts +1 -0
  38. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.js +1 -0
  39. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.d.ts +1 -0
  40. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +10 -0
  41. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.d.ts +3 -0
  42. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +108 -0
  43. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.d.ts +1 -0
  44. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.js +1 -0
  45. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.d.ts +6 -0
  46. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +152 -0
  47. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.d.ts +1 -0
  48. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.js +1 -0
  49. package/es/components/molecules/CalendarSelection/components/Footer/Footer.d.ts +2 -0
  50. package/es/components/molecules/CalendarSelection/components/Footer/Footer.js +11 -0
  51. package/es/components/molecules/CalendarSelection/components/Footer/index.d.ts +1 -0
  52. package/es/components/molecules/CalendarSelection/components/Footer/index.js +1 -0
  53. package/es/components/molecules/CalendarSelection/components/Footer/styled.d.ts +1 -0
  54. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +6 -0
  55. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +5 -0
  56. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +4 -0
  57. package/es/components/molecules/CalendarSelection/components/RangePicker/index.d.ts +1 -0
  58. package/es/components/molecules/CalendarSelection/components/RangePicker/index.js +1 -0
  59. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +5 -0
  60. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +13 -0
  61. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.d.ts +3 -0
  62. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.js +23 -0
  63. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.d.ts +2 -0
  64. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.js +41 -0
  65. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.d.ts +1 -0
  66. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.js +1 -0
  67. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.d.ts +11 -0
  68. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +40 -0
  69. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.d.ts +1 -0
  70. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.js +1 -0
  71. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.d.ts +1 -0
  72. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.js +29 -0
  73. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.d.ts +2 -0
  74. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.js +2 -0
  75. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.d.ts +1 -0
  76. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.js +1 -0
  77. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +3 -0
  78. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +34 -0
  79. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.d.ts +1 -0
  80. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.js +1 -0
  81. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.d.ts +8 -0
  82. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.js +49 -0
  83. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.d.ts +2 -0
  84. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.js +2 -0
  85. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.d.ts +1 -0
  86. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +70 -0
  87. package/es/components/molecules/CalendarSelection/components/index.d.ts +5 -0
  88. package/es/components/molecules/CalendarSelection/components/index.js +5 -0
  89. package/es/components/molecules/CalendarSelection/constants.d.ts +97 -0
  90. package/es/components/molecules/CalendarSelection/constants.js +183 -0
  91. package/es/components/molecules/CalendarSelection/context.d.ts +4 -0
  92. package/es/components/molecules/CalendarSelection/context.js +6 -0
  93. package/es/components/molecules/CalendarSelection/hooks/index.d.ts +2 -0
  94. package/es/components/molecules/CalendarSelection/hooks/index.js +2 -0
  95. package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +4 -0
  96. package/es/components/molecules/CalendarSelection/hooks/useStateContext.js +13 -0
  97. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.d.ts +9 -0
  98. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.js +19 -0
  99. package/es/components/molecules/CalendarSelection/index.d.ts +25 -0
  100. package/es/components/molecules/CalendarSelection/index.js +6 -0
  101. package/es/components/molecules/CalendarSelection/reducer.d.ts +3 -0
  102. package/es/components/molecules/CalendarSelection/reducer.js +121 -0
  103. package/es/components/molecules/CalendarSelection/styled.d.ts +6 -0
  104. package/es/components/molecules/CalendarSelection/styled.js +13 -0
  105. package/es/components/molecules/CalendarSelection/types.d.ts +98 -0
  106. package/es/components/molecules/CalendarSelection/types.js +1 -0
  107. package/es/components/molecules/CalendarSelection/utils.d.ts +52 -0
  108. package/es/components/molecules/CalendarSelection/utils.js +304 -0
  109. package/es/components/molecules/ColorPicker/CustomPicker/index.js +3 -3
  110. package/es/components/molecules/ColorPicker/index.d.ts +1 -0
  111. package/es/components/molecules/ColorPicker/index.js +3 -2
  112. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +20 -16
  113. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +3 -0
  114. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +23 -0
  115. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
  116. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -2
  117. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +1 -0
  118. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +3 -3
  119. package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.js +2 -2
  120. package/es/components/molecules/ModalV2/styled.js +4 -0
  121. package/es/components/molecules/ResizeGrid/ResizeGrid.js +10 -2
  122. package/es/components/molecules/ResizeGrid/types.d.ts +1 -0
  123. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +1 -0
  124. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +2 -2
  125. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +1 -0
  126. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +4 -3
  127. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +1 -0
  128. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +1 -1
  129. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +7 -0
  130. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +25 -6
  131. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +5 -0
  132. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +31 -0
  133. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +2 -2
  134. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +1 -0
  135. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
  136. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +1 -1
  137. package/es/components/molecules/ShareAccess/index.d.ts +2 -3
  138. package/es/components/molecules/ShareAccess/index.js +2 -3
  139. package/es/components/molecules/ShareAccess/types.d.ts +2 -0
  140. package/es/components/molecules/ShareAccess/utils.d.ts +2 -1
  141. package/es/components/molecules/ShareAccess/utils.js +9 -0
  142. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.d.ts +79 -0
  143. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +184 -0
  144. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.d.ts +10 -0
  145. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.js +50 -0
  146. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.d.ts +20 -0
  147. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.js +57 -0
  148. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.d.ts +1 -0
  149. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.js +1 -0
  150. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +9 -0
  151. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +182 -0
  152. package/es/components/molecules/TemplateSaveAs/components/index.d.ts +1 -0
  153. package/es/components/molecules/TemplateSaveAs/components/index.js +1 -0
  154. package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +65 -0
  155. package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.js +121 -0
  156. package/es/components/molecules/TemplateSaveAs/index.d.ts +4 -0
  157. package/es/components/molecules/TemplateSaveAs/index.js +3 -0
  158. package/es/components/molecules/TemplateSaveAs/styled.d.ts +4 -0
  159. package/es/components/molecules/TemplateSaveAs/styled.js +73 -0
  160. package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +29 -13
  161. package/es/components/molecules/ThumbnailCard/constants.d.ts +2 -2
  162. package/es/components/molecules/ThumbnailCard/constants.js +2 -2
  163. package/es/components/molecules/ThumbnailCard/styled.js +2 -1
  164. package/es/components/molecules/ThumbnailCard/types.d.ts +12 -6
  165. package/es/components/molecules/UploadImage/index.js +1 -1
  166. package/es/components/molecules/index.d.ts +3 -0
  167. package/es/components/molecules/index.js +2 -0
  168. package/es/components/organism/Help/Help.js +30 -1
  169. package/es/components/organism/Menu/Menu.d.ts +2 -0
  170. package/es/components/organism/Menu/Menu.js +2 -0
  171. package/es/components/organism/Menu/index.d.ts +1 -0
  172. package/es/components/organism/Menu/index.js +1 -0
  173. package/es/components/organism/PreviewTemplateModal/components/Banner/index.d.ts +3 -0
  174. package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +13 -0
  175. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.d.ts +4 -0
  176. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +98 -0
  177. package/es/components/organism/PreviewTemplateModal/components/Information/index.d.ts +3 -0
  178. package/es/components/organism/PreviewTemplateModal/components/Information/index.js +29 -0
  179. package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +2 -0
  180. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +41 -0
  181. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.d.ts +3 -0
  182. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +32 -0
  183. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +2 -0
  184. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +12 -0
  185. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.d.ts +6 -0
  186. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.js +77 -0
  187. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.d.ts +3 -0
  188. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +62 -0
  189. package/es/components/organism/PreviewTemplateModal/components/index.d.ts +4 -0
  190. package/es/components/organism/PreviewTemplateModal/components/index.js +4 -0
  191. package/es/components/organism/PreviewTemplateModal/constants/dataSample.d.ts +2 -0
  192. package/es/components/organism/PreviewTemplateModal/constants/dataSample.js +9 -0
  193. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.d.ts +8 -0
  194. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.js +12 -0
  195. package/es/components/organism/PreviewTemplateModal/constants/html.d.ts +1 -0
  196. package/es/components/organism/PreviewTemplateModal/constants/html.js +1 -0
  197. package/es/components/organism/PreviewTemplateModal/constants/index.d.ts +4 -0
  198. package/es/components/organism/PreviewTemplateModal/constants/index.js +4 -0
  199. package/es/components/organism/PreviewTemplateModal/constants/variables.d.ts +12 -0
  200. package/es/components/organism/PreviewTemplateModal/constants/variables.js +12 -0
  201. package/es/components/organism/PreviewTemplateModal/index.d.ts +3 -0
  202. package/es/components/organism/PreviewTemplateModal/index.js +34 -0
  203. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.d.ts +2 -0
  204. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.js +34 -0
  205. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.d.ts +2 -0
  206. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.js +62 -0
  207. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.d.ts +2 -0
  208. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.js +76 -0
  209. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.d.ts +2 -0
  210. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.js +40 -0
  211. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.d.ts +2 -0
  212. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.js +30 -0
  213. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.d.ts +2 -0
  214. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.js +46 -0
  215. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.d.ts +6 -0
  216. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.js +6 -0
  217. package/es/components/organism/PreviewTemplateModal/styled.d.ts +4 -0
  218. package/es/components/organism/PreviewTemplateModal/styled.js +26 -0
  219. package/es/components/organism/PreviewTemplateModal/types.d.ts +38 -0
  220. package/es/components/organism/PreviewTemplateModal/types.js +1 -0
  221. package/es/components/organism/index.d.ts +1 -0
  222. package/es/components/organism/index.js +1 -0
  223. package/es/components/template/TemplateListing/Loadable.d.ts +6 -0
  224. package/es/components/template/TemplateListing/Loadable.js +7 -0
  225. package/es/components/template/TemplateListing/components/BlankTemplate/index.js +3 -1
  226. package/es/components/template/TemplateListing/components/CategoryListing/index.js +19 -10
  227. package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +2 -0
  228. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +50 -8
  229. package/es/components/template/TemplateListing/components/Empty/index.d.ts +3 -0
  230. package/es/components/template/TemplateListing/components/Empty/index.js +18 -0
  231. package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -0
  232. package/es/components/template/TemplateListing/components/Empty/styled.js +35 -0
  233. package/es/components/template/TemplateListing/components/index.d.ts +1 -0
  234. package/es/components/template/TemplateListing/components/index.js +1 -0
  235. package/es/components/template/TemplateListing/constants/defaultProps.d.ts +5 -3
  236. package/es/components/template/TemplateListing/constants/defaultProps.js +8 -7
  237. package/es/components/template/TemplateListing/hooks/index.d.ts +1 -0
  238. package/es/components/template/TemplateListing/hooks/index.js +1 -0
  239. package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +62 -0
  240. package/es/components/template/TemplateListing/hooks/useTemplateListing.js +230 -0
  241. package/es/components/template/TemplateListing/index.js +75 -14
  242. package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.d.ts +2 -0
  243. package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.js +46 -0
  244. package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.d.ts +2 -0
  245. package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.js +57 -0
  246. package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.d.ts +2 -0
  247. package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.js +78 -0
  248. package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.d.ts +2 -0
  249. package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js +30 -0
  250. package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.d.ts +2 -0
  251. package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.js +46 -0
  252. package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.d.ts +2 -0
  253. package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.js +38 -0
  254. package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.d.ts +2 -0
  255. package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.js +50 -0
  256. package/es/components/template/TemplateListing/stories/dataTypes/components/index.d.ts +7 -0
  257. package/es/components/template/TemplateListing/stories/dataTypes/components/index.js +7 -0
  258. package/es/components/template/TemplateListing/stories/demo/styled.d.ts +1 -0
  259. package/es/components/template/TemplateListing/stories/demo/styled.js +7 -0
  260. package/es/components/template/TemplateListing/styled/index.d.ts +1 -0
  261. package/es/components/template/TemplateListing/styled/index.js +24 -5
  262. package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +1 -1
  263. package/es/components/template/TemplateListing/types/CategoryListing.d.ts +5 -2
  264. package/es/components/template/TemplateListing/types/Empty.d.ts +5 -0
  265. package/es/components/template/TemplateListing/types/Empty.js +1 -0
  266. package/es/components/template/TemplateListing/types/TemplateListing.d.ts +16 -6
  267. package/es/components/template/index.d.ts +2 -1
  268. package/es/components/template/index.js +5 -1
  269. package/es/constants/datetime.d.ts +8 -0
  270. package/es/constants/datetime.js +1594 -0
  271. package/es/constants/index.d.ts +5 -1
  272. package/es/constants/index.js +5 -1
  273. package/es/constants/queries.d.ts +4 -0
  274. package/es/constants/queries.js +5 -0
  275. package/es/constants/templateListing.d.ts +50 -0
  276. package/es/constants/templateListing.js +52 -0
  277. package/es/constants/theme.js +1 -1
  278. package/es/constants/variables.d.ts +19 -0
  279. package/es/constants/variables.js +19 -0
  280. package/es/hooks/index.d.ts +4 -0
  281. package/es/hooks/index.js +4 -0
  282. package/es/hooks/useEffectOnlyOnce.d.ts +2 -0
  283. package/es/hooks/useEffectOnlyOnce.js +12 -0
  284. package/es/hooks/useForceUpdate.d.ts +1 -0
  285. package/es/hooks/useForceUpdate.js +5 -0
  286. package/es/hooks/useIntersectionObserver.d.ts +57 -0
  287. package/es/hooks/useIntersectionObserver.js +97 -0
  288. package/es/hooks/useListingItemResize.d.ts +12 -0
  289. package/es/hooks/useListingItemResize.js +58 -0
  290. package/es/hooks/useScrollToEnd.d.ts +1 -0
  291. package/es/hooks/useScrollToEnd.js +30 -0
  292. package/es/index.d.ts +3 -0
  293. package/es/index.js +3 -0
  294. package/es/locales/en/translation.json +9 -1
  295. package/es/locales/i18n.d.ts +16 -0
  296. package/es/locales/translations.d.ts +8 -0
  297. package/es/locales/vi/translation.json +9 -1
  298. package/es/models/ObjectTemplate.d.ts +56 -0
  299. package/es/models/ObjectTemplate.js +82 -0
  300. package/es/models/TemplateCategory.d.ts +13 -0
  301. package/es/models/TemplateCategory.js +28 -0
  302. package/es/queries/CustomFunction/useCustomFunction.js +35 -35
  303. package/es/queries/TemplateListing/index.d.ts +52 -0
  304. package/es/queries/TemplateListing/index.js +105 -0
  305. package/es/queries/index.d.ts +1 -0
  306. package/es/queries/index.js +1 -0
  307. package/es/services/TemplateListing/index.d.ts +70 -0
  308. package/es/services/TemplateListing/index.js +161 -0
  309. package/es/test.js +65 -11
  310. package/es/types/index.d.ts +5 -0
  311. package/es/types/index.js +3 -0
  312. package/es/types/service.d.ts +22 -0
  313. package/es/types/service.js +1 -0
  314. package/es/types/share-access.d.ts +18 -0
  315. package/es/types/share-access.js +1 -0
  316. package/es/types/templateListing.d.ts +13 -0
  317. package/es/types/templateListing.js +1 -0
  318. package/es/types/variables.d.ts +3 -0
  319. package/es/utils/common.d.ts +4 -0
  320. package/es/utils/common.js +38 -0
  321. package/es/utils/commonComponent.d.ts +7 -0
  322. package/es/utils/commonComponent.js +28 -0
  323. package/es/utils/index.d.ts +1 -0
  324. package/es/utils/index.js +1 -0
  325. package/es/utils/templateListing.d.ts +2 -0
  326. package/es/utils/templateListing.js +12 -0
  327. package/package.json +6 -1
@@ -0,0 +1,13 @@
1
+ import { Popover } from '@antscorp/antsomi-ui/es/components/atoms';
2
+ import styled from 'styled-components';
3
+ export const StyledPopover = styled(Popover) `
4
+ font-size: 12px;
5
+ `;
6
+ export const StyledPopoverContainer = styled.div ``;
7
+ export const StyledPopoverBody = styled.div `
8
+ font-size: 12px;
9
+ display: flex;
10
+ max-height: 75vh;
11
+
12
+ overflow: auto;
13
+ `;
@@ -0,0 +1,98 @@
1
+ import { DatePickerProps, PopoverProps } from 'antd';
2
+ import { Dispatch } from 'react';
3
+ import { ValueOf } from 'type-fest';
4
+ import { updateRangeInfo, changeRangeType, updateRangeValue, changeAutoUpdateTo, initState, togglePopover, apply, resetValue } from './actions';
5
+ import { SELECTION_KEY, AUTO_UPDATE_TO_KEY } from './constants';
6
+ import { TimeRangeDisplayProps } from './components/TimeRangeDisplay/TimeRangeDisplay';
7
+ export type CalendarSelectionProps = Partial<{
8
+ popoverProps: PopoverProps;
9
+ rangeLimit: number;
10
+ timezone: string;
11
+ toDay: Date;
12
+ value: CalendarSelectionValue;
13
+ timeDisplayProps: TimeRangeDisplayProps;
14
+ rangePickerProps: DatePickerProps;
15
+ onChange: (value: CalendarSelectionValue, info: TriggerOutInfo) => void;
16
+ }>;
17
+ export type Range = (typeof SELECTION_KEY)[keyof typeof SELECTION_KEY];
18
+ export type ActionType = {
19
+ dispatch: Dispatch<Action>;
20
+ };
21
+ export type TriggerOutInfo = {
22
+ id: number | null;
23
+ mode: 'auto' | 'manual';
24
+ };
25
+ export type ReducerState = {
26
+ value: {
27
+ original: CalendarSelectionValue;
28
+ current: ReducerState['value']['original'];
29
+ };
30
+ triggerOut: TriggerOutInfo;
31
+ rangeLimit: number;
32
+ timezone: string;
33
+ open: boolean;
34
+ };
35
+ export type Action = ReturnType<typeof changeRangeType> | ReturnType<typeof updateRangeInfo> | ReturnType<typeof updateRangeValue> | ReturnType<typeof changeAutoUpdateTo> | ReturnType<typeof initState> | ReturnType<typeof togglePopover> | ReturnType<typeof apply> | ReturnType<typeof resetValue>;
36
+ type ToDay = {
37
+ type: typeof SELECTION_KEY.today;
38
+ };
39
+ type Yesterday = {
40
+ type: typeof SELECTION_KEY.yesterday;
41
+ };
42
+ type ThisWeek = {
43
+ type: typeof SELECTION_KEY.this_week;
44
+ weekStartsOn: number;
45
+ };
46
+ type LastWeek = {
47
+ type: typeof SELECTION_KEY.last_week;
48
+ weekStartsOn: number;
49
+ };
50
+ type Last7Days = {
51
+ type: typeof SELECTION_KEY.last_7_days;
52
+ };
53
+ type Last14Days = {
54
+ type: typeof SELECTION_KEY.last_14_days;
55
+ };
56
+ type Last30Days = {
57
+ type: typeof SELECTION_KEY.last_30_days;
58
+ };
59
+ type ThisMonth = {
60
+ type: typeof SELECTION_KEY.this_month;
61
+ };
62
+ type LastMonth = {
63
+ type: typeof SELECTION_KEY.last_month;
64
+ };
65
+ type ThisQuarter = {
66
+ type: typeof SELECTION_KEY.this_quarter;
67
+ };
68
+ type LastQuarter = {
69
+ type: typeof SELECTION_KEY.last_quarter;
70
+ };
71
+ type AllTime = {
72
+ type: typeof SELECTION_KEY.all_time;
73
+ };
74
+ export type AutoUpdateTo = ValueOf<typeof AUTO_UPDATE_TO_KEY>;
75
+ export type Custom = {
76
+ type: typeof SELECTION_KEY.custom;
77
+ autoUpdateTo: AutoUpdateTo;
78
+ };
79
+ export type DaysUpToToday = {
80
+ type: typeof SELECTION_KEY.days_up_to_today;
81
+ numOfDays: number;
82
+ };
83
+ export type DaysUpToYesterday = {
84
+ type: typeof SELECTION_KEY.days_up_to_yesterday;
85
+ numOfDays: number;
86
+ };
87
+ export type RangeInfo = Custom | ToDay | Yesterday | ThisWeek | LastWeek | Last7Days | Last14Days | Last30Days | ThisMonth | LastMonth | ThisQuarter | LastQuarter | AllTime | DaysUpToToday | DaysUpToYesterday;
88
+ export type RangeValue = {
89
+ start: string | null;
90
+ end: string | null;
91
+ label?: string;
92
+ color?: string;
93
+ };
94
+ export type CalendarSelectionValue = {
95
+ rangeInfo: RangeInfo;
96
+ rangeValue: RangeValue[];
97
+ };
98
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ import { AutoUpdateTo, RangeInfo, RangeValue, ReducerState } from './types';
2
+ export declare const rangeInfoToStringType: (rangeInfo: RangeInfo) => string;
3
+ export declare const serializeWeekStartsOn: (rangeType: string) => number | undefined;
4
+ export declare const generateRangeInfo: (rangeType: string) => RangeInfo | null;
5
+ export declare const getDefaultDate: () => {
6
+ toDay: string;
7
+ yesterday: string;
8
+ startWeekSS: string;
9
+ startWeekMS: string;
10
+ last7Days: string;
11
+ startLastWeekSS: string;
12
+ startLastWeekMS: string;
13
+ endLastWeekSS: string;
14
+ endLastWeekMS: string;
15
+ last14Days: string;
16
+ startOfThisMonth: string;
17
+ endOfThisMonth: string;
18
+ last30Days: string;
19
+ lastMonthFirstDate: string;
20
+ lastMonthLastDate: string;
21
+ thisQuaterFirstDate: string;
22
+ thisQuaterLastDate: string;
23
+ lastQuaterFirstDate: string;
24
+ lastQuaterLastDate: string;
25
+ maxSub: number;
26
+ todayUptoCount: (val: number) => string;
27
+ yesterdayUptoCount: (val: number) => string;
28
+ };
29
+ export declare const getRangeValue: ({ rangeInfo, currentRangeValue, limitNumOfDays, }: {
30
+ rangeInfo: RangeInfo;
31
+ currentRangeValue: RangeValue[];
32
+ limitNumOfDays?: number | undefined;
33
+ }) => RangeValue[];
34
+ export declare const getRangeValueSelctedTitle: (rangeValue: RangeValue[], options?: {
35
+ formatStart?: string;
36
+ formatEnd?: string;
37
+ minimize?: boolean;
38
+ operator?: string;
39
+ }) => string[];
40
+ export declare const getRangeTypeSelectedTitle: (rangeInfo: RangeInfo) => string;
41
+ export declare const combineCurrentValue: (state: ReducerState) => {
42
+ rangeInfo: RangeInfo;
43
+ rangeValue: RangeValue[];
44
+ };
45
+ export declare const genTriggerOut: ({ mode, id, }: {
46
+ mode: ReducerState['triggerOut']['mode'];
47
+ id?: number | undefined;
48
+ }) => {
49
+ mode: "auto" | "manual";
50
+ id: number;
51
+ };
52
+ export declare const isAutoUpdateToOption: (value: unknown) => value is AutoUpdateTo;
@@ -0,0 +1,304 @@
1
+ import dayjs from 'dayjs';
2
+ import utc from 'dayjs/plugin/utc';
3
+ import timezone from 'dayjs/plugin/timezone';
4
+ import isoWeek from 'dayjs/plugin/isoWeek';
5
+ import weekday from 'dayjs/plugin/weekday';
6
+ import quarterOfYear from 'dayjs/plugin/quarterOfYear';
7
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
8
+ import { AUTO_UPDATE_TO_KEY, DEFAULT_NUM_UP_TO, MAP_TITLE, RANGE_LIMIT, SELECTION_KEY, } from './constants';
9
+ import { last } from 'lodash';
10
+ import { asssertCannotReach } from '@antscorp/antsomi-ui/es/utils/common';
11
+ dayjs.extend(utc);
12
+ dayjs.extend(timezone);
13
+ dayjs.extend(isoWeek);
14
+ dayjs.extend(quarterOfYear);
15
+ dayjs.extend(weekday);
16
+ dayjs.extend(isSameOrBefore);
17
+ const dayZero = new Date(0);
18
+ export const rangeInfoToStringType = (rangeInfo) => {
19
+ switch (rangeInfo.type) {
20
+ case SELECTION_KEY.last_week:
21
+ case SELECTION_KEY.this_week: {
22
+ return `${rangeInfo.type}_${rangeInfo.weekStartsOn}`;
23
+ }
24
+ default:
25
+ return rangeInfo.type;
26
+ }
27
+ };
28
+ export const serializeWeekStartsOn = (rangeType) => {
29
+ let startOn = last(rangeType.split('_'));
30
+ if (startOn) {
31
+ startOn = +startOn;
32
+ }
33
+ if (typeof startOn === 'number' && startOn >= 1 && startOn <= 7) {
34
+ return startOn;
35
+ }
36
+ };
37
+ export const generateRangeInfo = (rangeType) => {
38
+ const startOn = serializeWeekStartsOn(rangeType);
39
+ let rangeInfo = null;
40
+ switch (true) {
41
+ case rangeType.startsWith(SELECTION_KEY.this_week): {
42
+ if (startOn) {
43
+ rangeInfo = {
44
+ type: SELECTION_KEY.this_week,
45
+ weekStartsOn: startOn,
46
+ };
47
+ }
48
+ break;
49
+ }
50
+ case rangeType.startsWith(SELECTION_KEY.last_week): {
51
+ if (startOn) {
52
+ rangeInfo = {
53
+ type: SELECTION_KEY.last_week,
54
+ weekStartsOn: startOn,
55
+ };
56
+ }
57
+ break;
58
+ }
59
+ default:
60
+ break;
61
+ }
62
+ switch (rangeType) {
63
+ case SELECTION_KEY.custom: {
64
+ rangeInfo = {
65
+ type: rangeType,
66
+ autoUpdateTo: AUTO_UPDATE_TO_KEY.fixed,
67
+ };
68
+ break;
69
+ }
70
+ case SELECTION_KEY.yesterday:
71
+ case SELECTION_KEY.today:
72
+ case SELECTION_KEY.last_7_days:
73
+ case SELECTION_KEY.last_14_days:
74
+ case SELECTION_KEY.last_30_days:
75
+ case SELECTION_KEY.this_month:
76
+ case SELECTION_KEY.last_month:
77
+ case SELECTION_KEY.this_quarter:
78
+ case SELECTION_KEY.last_quarter:
79
+ case SELECTION_KEY.all_time: {
80
+ rangeInfo = { type: rangeType };
81
+ break;
82
+ }
83
+ case SELECTION_KEY.days_up_to_today:
84
+ case SELECTION_KEY.days_up_to_yesterday: {
85
+ rangeInfo = {
86
+ type: rangeType,
87
+ numOfDays: DEFAULT_NUM_UP_TO,
88
+ };
89
+ break;
90
+ }
91
+ default:
92
+ break;
93
+ }
94
+ return rangeInfo;
95
+ };
96
+ export const getDefaultDate = () => {
97
+ const toDayTz = dayjs(new Date());
98
+ return {
99
+ toDay: toDayTz.toISOString(),
100
+ yesterday: toDayTz.subtract(1, 'd').toISOString(),
101
+ startWeekSS: toDayTz.weekday(0).toISOString(),
102
+ startWeekMS: toDayTz.isoWeekday(1).toISOString(),
103
+ last7Days: toDayTz.subtract(1, 'w').toISOString(),
104
+ startLastWeekSS: toDayTz.subtract(1, 'w').weekday(0).toISOString(),
105
+ startLastWeekMS: toDayTz.subtract(1, 'w').isoWeekday(1).toISOString(),
106
+ endLastWeekSS: toDayTz.subtract(1, 'w').weekday(6).toISOString(),
107
+ endLastWeekMS: toDayTz.subtract(1, 'w').isoWeekday(7).toISOString(),
108
+ last14Days: toDayTz.subtract(14, 'd').toISOString(),
109
+ startOfThisMonth: toDayTz.startOf('M').toISOString(),
110
+ endOfThisMonth: toDayTz.endOf('M').toISOString(),
111
+ last30Days: toDayTz.subtract(30, 'd').toISOString(),
112
+ lastMonthFirstDate: toDayTz.subtract(1, 'M').startOf('M').toISOString(),
113
+ lastMonthLastDate: toDayTz.subtract(1, 'M').endOf('M').toISOString(),
114
+ thisQuaterFirstDate: toDayTz.startOf('Q').toISOString(),
115
+ thisQuaterLastDate: toDayTz.endOf('Q').toISOString(),
116
+ lastQuaterFirstDate: toDayTz.subtract(1, 'Q').startOf('Q').toISOString(),
117
+ lastQuaterLastDate: toDayTz.subtract(1, 'Q').endOf('Q').toISOString(),
118
+ maxSub: toDayTz.diff(dayZero, 'd'),
119
+ todayUptoCount: (val) => toDayTz.subtract(Math.round(val - 1), 'd').toISOString(),
120
+ yesterdayUptoCount: (val) => toDayTz.subtract(Math.round(val - 1) + 1, 'd').toISOString(),
121
+ };
122
+ };
123
+ export const getRangeValue = ({ rangeInfo, currentRangeValue, limitNumOfDays = RANGE_LIMIT, }) => {
124
+ const defaultDates = getDefaultDate();
125
+ const result = currentRangeValue.map(rangeValue => {
126
+ const temp = {
127
+ start: defaultDates.toDay,
128
+ end: defaultDates.toDay,
129
+ };
130
+ switch (rangeInfo.type) {
131
+ case SELECTION_KEY.custom: {
132
+ temp.start = rangeValue.start;
133
+ temp.end = rangeValue.end;
134
+ switch (rangeInfo.autoUpdateTo) {
135
+ case AUTO_UPDATE_TO_KEY.today: {
136
+ temp.end = defaultDates.toDay;
137
+ break;
138
+ }
139
+ case AUTO_UPDATE_TO_KEY.yesterday: {
140
+ temp.end = defaultDates.yesterday;
141
+ break;
142
+ }
143
+ default:
144
+ break;
145
+ }
146
+ break;
147
+ }
148
+ case SELECTION_KEY.today: {
149
+ temp.start = defaultDates.toDay;
150
+ temp.end = defaultDates.toDay;
151
+ break;
152
+ }
153
+ case SELECTION_KEY.yesterday: {
154
+ temp.start = defaultDates.yesterday;
155
+ temp.end = defaultDates.yesterday;
156
+ break;
157
+ }
158
+ case SELECTION_KEY.this_week: {
159
+ temp.start =
160
+ rangeInfo.weekStartsOn === 1 ? defaultDates.startWeekMS : defaultDates.startWeekSS;
161
+ temp.end = defaultDates.toDay;
162
+ break;
163
+ }
164
+ case SELECTION_KEY.last_week: {
165
+ temp.start =
166
+ rangeInfo.weekStartsOn === 1
167
+ ? defaultDates.startLastWeekMS
168
+ : defaultDates.startLastWeekSS;
169
+ temp.end =
170
+ rangeInfo.weekStartsOn === 1 ? defaultDates.endLastWeekMS : defaultDates.endLastWeekSS;
171
+ break;
172
+ }
173
+ case SELECTION_KEY.last_7_days: {
174
+ temp.start = defaultDates.last7Days;
175
+ temp.end = defaultDates.yesterday;
176
+ break;
177
+ }
178
+ case SELECTION_KEY.last_14_days: {
179
+ temp.start = defaultDates.last14Days;
180
+ temp.end = defaultDates.yesterday;
181
+ break;
182
+ }
183
+ case SELECTION_KEY.last_30_days: {
184
+ temp.start = defaultDates.last30Days;
185
+ temp.end = defaultDates.yesterday;
186
+ break;
187
+ }
188
+ case SELECTION_KEY.this_month: {
189
+ temp.start = defaultDates.startOfThisMonth;
190
+ temp.end = defaultDates.toDay;
191
+ break;
192
+ }
193
+ case SELECTION_KEY.last_month: {
194
+ temp.start = defaultDates.lastMonthFirstDate;
195
+ temp.end = defaultDates.lastMonthLastDate;
196
+ break;
197
+ }
198
+ case SELECTION_KEY.this_quarter: {
199
+ temp.start = defaultDates.thisQuaterFirstDate;
200
+ temp.end = defaultDates.toDay;
201
+ break;
202
+ }
203
+ case SELECTION_KEY.last_quarter: {
204
+ temp.start = defaultDates.lastQuaterFirstDate;
205
+ temp.end = defaultDates.lastQuaterLastDate;
206
+ break;
207
+ }
208
+ case SELECTION_KEY.all_time: {
209
+ temp.start = dayjs(defaultDates.toDay).subtract(limitNumOfDays, 'd').toISOString();
210
+ temp.end = defaultDates.toDay;
211
+ break;
212
+ }
213
+ case SELECTION_KEY.days_up_to_today: {
214
+ temp.start = dayjs(defaultDates.toDay).subtract(rangeInfo.numOfDays, 'd').toISOString();
215
+ temp.end = defaultDates.toDay;
216
+ break;
217
+ }
218
+ case SELECTION_KEY.days_up_to_yesterday: {
219
+ temp.start = dayjs(defaultDates.toDay).subtract(rangeInfo.numOfDays, 'd').toISOString();
220
+ temp.end = defaultDates.yesterday;
221
+ break;
222
+ }
223
+ default:
224
+ asssertCannotReach(rangeInfo);
225
+ }
226
+ return Object.assign(Object.assign({}, rangeValue), temp);
227
+ });
228
+ return result;
229
+ };
230
+ export const getRangeValueSelctedTitle = (rangeValue, options) => {
231
+ const { formatStart, formatEnd, operator = '-' } = options || {};
232
+ const result = [];
233
+ rangeValue.forEach(range => {
234
+ var _a, _b, _c, _d, _e;
235
+ const { start, end } = range;
236
+ let startFormat = formatStart || 'MMM D';
237
+ const endFormat = formatEnd || 'MMM D YYYY';
238
+ if ((_a = dayjs(start)) === null || _a === void 0 ? void 0 : _a.isSame(dayjs(end), 'D')) {
239
+ return result.push((_b = dayjs(start)) === null || _b === void 0 ? void 0 : _b.format('MMM D YYYY'));
240
+ }
241
+ if (!((_c = dayjs(start)) === null || _c === void 0 ? void 0 : _c.isSame(dayjs(end), 'y')) && !formatStart) {
242
+ startFormat = `${startFormat} YYYY`;
243
+ }
244
+ result.push(`${(_d = dayjs(start)) === null || _d === void 0 ? void 0 : _d.format(startFormat)} ${operator} ${(_e = dayjs(end)) === null || _e === void 0 ? void 0 : _e.format(endFormat)}`);
245
+ });
246
+ return result;
247
+ };
248
+ export const getRangeTypeSelectedTitle = (rangeInfo) => {
249
+ let label = MAP_TITLE[rangeInfo.type];
250
+ switch (rangeInfo.type) {
251
+ case SELECTION_KEY.days_up_to_yesterday:
252
+ case SELECTION_KEY.days_up_to_today: {
253
+ label = `${rangeInfo.numOfDays} ${label}`;
254
+ break;
255
+ }
256
+ default:
257
+ break;
258
+ }
259
+ return label;
260
+ };
261
+ export const combineCurrentValue = (state) => {
262
+ const { rangeValue, rangeInfo } = state.value.current;
263
+ return { rangeInfo, rangeValue };
264
+ };
265
+ export const genTriggerOut = (() => {
266
+ let catchedId = 0;
267
+ return function increaseTriggerOut({ mode, id, }) {
268
+ if (!id)
269
+ catchedId++;
270
+ return { mode, id: id || catchedId };
271
+ };
272
+ })();
273
+ // export const serializeRangeColors = (rangeValue: RangeValue[]) => {
274
+ // const listDate = rangeValue
275
+ // .flatMap(range => [range.start, range.end])
276
+ // .sort((a, b) => ascending(a.toDate(), b.toDate()));
277
+ // let rangeDates = listDate.reduce<RangeValue[]>((acc, current, idx) => {
278
+ // if (listDate[idx + 1]) {
279
+ // acc.push({ start: current, end: listDate[idx + 1] });
280
+ // }
281
+ // return acc;
282
+ // }, []);
283
+ // rangeDates = uniqWith(rangeDates, (a, b) => a.start.isSame(b.start) && a.end.isSame(b.end));
284
+ // rangeDates = rangeDates.map(rangeDate => {
285
+ // const colors: string[] = [];
286
+ // rangeValue.forEach(range => {
287
+ // if (
288
+ // range.color &&
289
+ // rangeDate.start.isBetween(range.start, range.end, 'd', '[]') &&
290
+ // rangeDate.end.isBetween(range.start, range.end, 'd', '[]')
291
+ // ) {
292
+ // colors.push(range.color);
293
+ // }
294
+ // });
295
+ // return { ...rangeDate, colors: uniq(colors) };
296
+ // });
297
+ // return rangeDates;
298
+ // };
299
+ export const isAutoUpdateToOption = (value) => {
300
+ if (typeof value === 'string' && Object.values(AUTO_UPDATE_TO_KEY).some(v => v === value)) {
301
+ return true;
302
+ }
303
+ return false;
304
+ };
@@ -53,7 +53,7 @@ const styleContainAlpha = {
53
53
  const CustomPicker = props => {
54
54
  var _a, _b, _c, _d;
55
55
  // Props
56
- const { className, style, children, onChange, onChangeComplete, presetColors } = props, restOf = __rest(props, ["className", "style", "children", "onChange", "onChangeComplete", "presetColors"]);
56
+ const { className, style, children, isHideAlpha, onChange, onChangeComplete, presetColors } = props, restOf = __rest(props, ["className", "style", "children", "isHideAlpha", "onChange", "onChangeComplete", "presetColors"]);
57
57
  // State
58
58
  const [isShowRgbaInput, setShowRgbaInput] = useState(true);
59
59
  const onChangeRgbaColor = (key, value) => {
@@ -101,9 +101,9 @@ const CustomPicker = props => {
101
101
  React.createElement("div", { style: rgbaStyling },
102
102
  React.createElement(InputNumberWrapper, { value: (_c = props.rgb) === null || _c === void 0 ? void 0 : _c.b, controls: false, onChange: value => onChangeRgbaColor('b', value) }),
103
103
  React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "B")),
104
- React.createElement("div", { style: rgbaStyling },
104
+ !isHideAlpha && (React.createElement("div", { style: rgbaStyling },
105
105
  React.createElement(InputNumberWrapper, { value: (_d = props.rgb) === null || _d === void 0 ? void 0 : _d.a, controls: false, onChange: value => onChangeRgbaColor('a', value) }),
106
- React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A")))) : (React.createElement(EditableInputWrapper, null,
106
+ React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A"))))) : (React.createElement(EditableInputWrapper, null,
107
107
  React.createElement(EditableInput, { value: props.color, onChange: onChange }),
108
108
  React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "HEX"))),
109
109
  React.createElement(Button, { onClick: () => {
@@ -3,6 +3,7 @@ export interface ColorPickerProps {
3
3
  className?: string;
4
4
  color?: string;
5
5
  presetColors?: any[] | ReactNode;
6
+ isHideAlpha?: boolean;
6
7
  defaultColor?: string;
7
8
  icon?: React.ReactNode | string;
8
9
  onChange?: (color: string) => void;
@@ -21,7 +21,7 @@ const styleBtnColor = {
21
21
  };
22
22
  export const ColorPicker = props => {
23
23
  // Props
24
- const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, } = props;
24
+ const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, isHideAlpha, } = props;
25
25
  const { onChange = () => { } } = props;
26
26
  // States
27
27
  const [color, setColor] = useState(defaultColor);
@@ -74,7 +74,7 @@ export const ColorPicker = props => {
74
74
  };
75
75
  return (React.createElement(ColorPickerWrapper, { className: `antsomi-color-picker ${className || ''}`, style: style },
76
76
  showInput && positionInput === 'left' && (React.createElement(Input, { style: { textTransform: 'uppercase' }, value: color, onChange: onChangeColorInput })),
77
- React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange },
77
+ React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors, isHideAlpha: isHideAlpha, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange },
78
78
  React.createElement("div", { className: "antsomi-popover-button", style: styleBtnColor }, iconNode || (React.createElement("span", { style: {
79
79
  backgroundColor: color,
80
80
  display: 'block',
@@ -88,6 +88,7 @@ ColorPicker.defaultProps = {
88
88
  className: '',
89
89
  color: '#000000',
90
90
  defaultColor: '#000000',
91
+ isHideAlpha: false,
91
92
  onChange: () => { },
92
93
  showInput: true,
93
94
  positionInput: 'left',
@@ -18,7 +18,7 @@ import { DropdownLabel } from '../DropdownLabel/DropdownLabel';
18
18
  import { handleError, reorder } from '@antscorp/antsomi-ui/es/utils';
19
19
  import { calculationDateAdvanced, getCellRender, getFormatDisplay, getPickerRender, getTimePickerRender, } from './utils';
20
20
  // Styled
21
- import { DatePickerCustomInput, DatePickerHeader, DropdownContent, DropdownHeader, DatePickerFooter, DropdownFooter, CalendarIconWrapper, InputStyled, } from './styled';
21
+ import { DatePickerCustomInput, DatePickerHeader, DropdownContent, DropdownHeader, DatePickerFooter, DropdownFooter, CalendarIconWrapper, InputStyled, TimeLabel, } from './styled';
22
22
  // Constants
23
23
  import { CALCULATION_DATES, CALCULATION_TYPES, DATE_TYPES, DEFAULT_DATE_FORMAT, VALUE_TYPES, ADVANCED_PICKER_TYPE, WEEK_ARR, QUARTER_PLACEHOLDER, WEEK_PLACEHOLDER, DAY_LABEL_SHORT, MONTH_LABEL_FULL, DAY_OF_MONTH, ANCHOR_LEAP_YEAR, GRANULARITY_MAPPING, } from './constants';
24
24
  import { THEME } from '@antscorp/antsomi-ui/es/constants';
@@ -244,7 +244,8 @@ export const AdvancedPicker = props => {
244
244
  };
245
245
  const onClickNow = () => {
246
246
  try {
247
- setState(state => (Object.assign(Object.assign({}, state), { date: dayjs().format(format) })));
247
+ const currentDate = dayjs();
248
+ setState(state => (Object.assign(Object.assign({}, state), { date: currentDate.format(format) })));
248
249
  }
249
250
  catch (error) {
250
251
  handleError(error, {
@@ -381,11 +382,7 @@ export const AdvancedPicker = props => {
381
382
  !!label && typeof label === 'string' ? (React.createElement(Text, { style: { color: '#666666' } }, label)) : (label),
382
383
  option.dateType.value === 'fixed' &&
383
384
  !['WEEK', 'DAY_OF_WEEK', 'MONTH_DAY', 'DAY'].includes(valueType) ? (React.createElement(Tooltip, { title: selectedDateTitle },
384
- React.createElement(DatePicker
385
- // ref={ref}
386
- , {
387
- // ref={ref}
388
- disabled: disabled, open: !disabled && isOpen, allowClear: false, inputReadOnly: true, status: errorMessage ? 'error' : '', inputRender: () => (React.createElement(DatePickerCustomInput, { readOnly: true, placeholder: "Select Date", value: selectedDateTitle, onClick: () => toggleOpenDropdown() })), value: currDate,
385
+ React.createElement(DatePicker, { disabled: disabled, open: !disabled && isOpen, allowClear: false, inputReadOnly: true, style: Object.assign({ textOverflow: 'ellipsis' }, inputStyle), status: errorMessage ? 'error' : '', inputRender: () => (React.createElement(DatePickerCustomInput, { readOnly: true, placeholder: "Select Date", value: selectedDateTitle, onClick: () => toggleOpenDropdown() })), value: currDate,
389
386
  // style={{
390
387
  // width: 120,
391
388
  // }}
@@ -395,15 +392,22 @@ export const AdvancedPicker = props => {
395
392
  'only-show-time-picker': ['HOUR', 'MINUTE'].includes(valueType),
396
393
  'is-minutes-picker': valueType === 'MINUTE',
397
394
  'is-hours-picker': valueType === 'HOUR',
398
- }), renderExtraFooter: () => (React.createElement(React.Fragment, null,
399
- React.createElement(DatePickerHeader, null,
400
- React.createElement(DropdownLabel, { valueType: valueType, date: date, format: format, type: type, showTime: showTime, operatorKey: operatorKey, formatInputDisplay: formatInputDisplay }),
401
- renderDateTypeOptions()),
402
- React.createElement(DatePickerFooter, null,
403
- React.createElement("div", { style: { padding: '0 10px' } },
404
- React.createElement(ErrorMessage, { errorMessage: errorMessage })),
405
- renderDropdownFooter()),
406
- React.createElement(Divider, null))), picker: getPickerRender(valueType), showTime: getTimePickerRender(valueType)
395
+ }), renderExtraFooter: () => {
396
+ const timeFormat = getTimePickerRender(valueType);
397
+ return (React.createElement(React.Fragment, null,
398
+ React.createElement(DatePickerHeader, null,
399
+ React.createElement(DropdownLabel, { valueType: valueType, date: date, format: format, type: type, showTime: showTime, operatorKey: operatorKey, formatInputDisplay: formatInputDisplay }),
400
+ renderDateTypeOptions()),
401
+ React.createElement(DatePickerFooter, null,
402
+ React.createElement("div", { style: { padding: '0 10px' } },
403
+ React.createElement(ErrorMessage, { errorMessage: errorMessage })),
404
+ renderDropdownFooter()),
405
+ React.createElement(Divider, null),
406
+ timeFormat && valueType !== 'HOUR' && valueType !== 'MINUTE' ? (React.createElement(TimeLabel, { "$width": timeFormat.length * 30 },
407
+ ['HH', 'HHmm', 'HHmmss'].includes(timeFormat) ? React.createElement("span", null, "Hours") : null,
408
+ ['HHmm', 'HHmmss', 'mm'].includes(timeFormat) ? React.createElement("span", null, "Minutes") : null,
409
+ timeFormat === 'HHmmss' ? React.createElement("span", null, "Seconds") : null)) : null));
410
+ }, picker: getPickerRender(valueType), showTime: getTimePickerRender(valueType)
407
411
  ? {
408
412
  format: getTimePickerRender(valueType),
409
413
  }
@@ -7,3 +7,6 @@ export declare const DatePickerCustomInput: import("styled-components").StyledCo
7
7
  export declare const InputStyled: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, import("../../../../atoms/Input").InputProps, any>;
8
8
  export declare const DatePickerFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
9
9
  export declare const CalendarIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const TimeLabel: import("styled-components").StyledComponent<"div", any, {
11
+ $width: number;
12
+ }, never>;
@@ -98,3 +98,26 @@ export const CalendarIconWrapper = styled.div `
98
98
  cursor: pointer;
99
99
  pointer-events: all;
100
100
  `;
101
+ export const TimeLabel = styled.div `
102
+ position: absolute;
103
+ right: 0;
104
+ top: 120px;
105
+ height: 39.1px;
106
+ width: ${props => `${props.$width}px`};
107
+ /* width: 180px; */
108
+ display: flex;
109
+ align-items: stretch;
110
+ justify-content: space-around;
111
+
112
+ span {
113
+ width: 60px;
114
+ display: block;
115
+ text-align: center;
116
+ font-weight: bold;
117
+ border-left: 1px solid rgba(5, 5, 5, 0.06);
118
+
119
+ &:first-child {
120
+ border-left-color: transparent;
121
+ }
122
+ }
123
+ `;
@@ -30,7 +30,7 @@ export declare const getCellRender: (current: number | Dayjs, valueType: ValueTy
30
30
  * @returns {'date' | 'week' | 'month' | 'quarter' | 'year'} picker ant-design props to render type of calendar
31
31
  */
32
32
  export declare const getPickerRender: (valueType: ValueTypes) => 'date' | 'week' | 'month' | 'quarter' | 'year';
33
- export declare const getTimePickerRender: (valueType: ValueTypes) => "HH" | "HHmm" | "HHmmss" | "mm" | undefined;
33
+ export declare const getTimePickerRender: (valueType: ValueTypes) => 'HH' | 'HHmm' | 'HHmmss' | 'mm' | undefined;
34
34
  export declare function getLabelQuarterRange(day: string, format: string, locale: string, showYear?: boolean): string;
35
35
  export declare function getLabelQuarterRange(quarter: number, year?: number): string;
36
36
  export declare const getFormatDisplay: (operatorKey?: TOperatorKey, type?: TAdvancedType, valueType?: ValueTypes, formatInputDisplay?: string) => {
@@ -161,7 +161,7 @@ export const getFormatDisplay = (operatorKey, type, valueType, formatInputDispla
161
161
  formatDisplay = 'MMMM, YYYY';
162
162
  break;
163
163
  case 'YEAR_WEEK':
164
- formatDisplay = `${WEEK_PLACEHOLDER}W, YYYY`;
164
+ formatDisplay = `${WEEK_PLACEHOLDER}w, YYYY`;
165
165
  break;
166
166
  case 'YEAR_MONTH_DAY':
167
167
  formatDisplay = 'MMMM DD, YYYY';
@@ -185,7 +185,7 @@ export const getFormatDisplay = (operatorKey, type, valueType, formatInputDispla
185
185
  formatDisplay = 'MMMM';
186
186
  break;
187
187
  case 'WEEK':
188
- formatDisplay = `${WEEK_PLACEHOLDER}W`;
188
+ formatDisplay = `${WEEK_PLACEHOLDER}w`;
189
189
  break;
190
190
  case 'MONTH_DAY':
191
191
  formatDisplay = 'MMMM DD';