@antscorp/antsomi-ui 1.3.5-beta.2 → 1.3.5-beta.21

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 (255) hide show
  1. package/es/assets/css/main.scss +0 -2
  2. package/es/assets/images/background/skeleton-background.png +0 -0
  3. package/es/assets/images/skeleton_bg.png +0 -0
  4. package/es/assets/svg/mobile-frame.svg +3 -0
  5. package/es/components/atoms/Spin/Spin.js +2 -2
  6. package/es/components/common/ConfigProvider/ConfigProvider.js +8 -4
  7. package/es/components/common/ConfigProvider/GlobalStyle.js +85 -16
  8. package/es/components/molecules/CalendarSelection/CalendarSelection.d.ts +3 -0
  9. package/es/components/molecules/CalendarSelection/CalendarSelection.js +45 -0
  10. package/es/components/molecules/CalendarSelection/actions.d.ts +55 -0
  11. package/es/components/molecules/CalendarSelection/actions.js +39 -0
  12. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.d.ts +7 -0
  13. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.js +24 -0
  14. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.d.ts +1 -0
  15. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.js +1 -0
  16. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.d.ts +1 -0
  17. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +10 -0
  18. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.d.ts +3 -0
  19. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +96 -0
  20. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.d.ts +1 -0
  21. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.js +1 -0
  22. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.d.ts +6 -0
  23. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +152 -0
  24. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.d.ts +1 -0
  25. package/es/components/molecules/CalendarSelection/components/Footer/Footer.d.ts +2 -0
  26. package/es/components/molecules/CalendarSelection/components/Footer/Footer.js +11 -0
  27. package/es/components/molecules/CalendarSelection/components/Footer/index.d.ts +1 -0
  28. package/es/components/molecules/CalendarSelection/components/Footer/index.js +1 -0
  29. package/es/components/molecules/CalendarSelection/components/Footer/styled.d.ts +1 -0
  30. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +6 -0
  31. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +5 -0
  32. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +4 -0
  33. package/es/components/molecules/CalendarSelection/components/RangePicker/index.d.ts +1 -0
  34. package/es/components/molecules/CalendarSelection/components/RangePicker/index.js +1 -0
  35. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +5 -0
  36. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +13 -0
  37. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.d.ts +3 -0
  38. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.js +23 -0
  39. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.d.ts +2 -0
  40. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.js +41 -0
  41. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.d.ts +1 -0
  42. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.js +1 -0
  43. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.d.ts +11 -0
  44. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +40 -0
  45. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.d.ts +1 -0
  46. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.js +1 -0
  47. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.d.ts +1 -0
  48. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.js +29 -0
  49. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.d.ts +2 -0
  50. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.js +2 -0
  51. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.d.ts +1 -0
  52. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.js +1 -0
  53. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +3 -0
  54. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +34 -0
  55. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.d.ts +1 -0
  56. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.js +1 -0
  57. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.d.ts +8 -0
  58. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.js +49 -0
  59. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.d.ts +2 -0
  60. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.js +2 -0
  61. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.d.ts +1 -0
  62. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +70 -0
  63. package/es/components/molecules/CalendarSelection/components/index.d.ts +5 -0
  64. package/es/components/molecules/CalendarSelection/components/index.js +5 -0
  65. package/es/components/molecules/CalendarSelection/constants.d.ts +97 -0
  66. package/es/components/molecules/CalendarSelection/constants.js +183 -0
  67. package/es/components/molecules/CalendarSelection/context.d.ts +4 -0
  68. package/es/components/molecules/CalendarSelection/context.js +6 -0
  69. package/es/components/molecules/CalendarSelection/hooks/index.d.ts +2 -0
  70. package/es/components/molecules/CalendarSelection/hooks/index.js +2 -0
  71. package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +4 -0
  72. package/es/components/molecules/CalendarSelection/hooks/useStateContext.js +13 -0
  73. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.d.ts +9 -0
  74. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.js +19 -0
  75. package/es/components/molecules/CalendarSelection/index.d.ts +25 -0
  76. package/es/components/molecules/CalendarSelection/index.js +6 -0
  77. package/es/components/molecules/CalendarSelection/reducer.d.ts +3 -0
  78. package/es/components/molecules/CalendarSelection/reducer.js +121 -0
  79. package/es/components/molecules/CalendarSelection/styled.d.ts +6 -0
  80. package/es/components/molecules/CalendarSelection/styled.js +13 -0
  81. package/es/components/molecules/CalendarSelection/types.d.ts +97 -0
  82. package/es/components/molecules/CalendarSelection/types.js +1 -0
  83. package/es/components/molecules/CalendarSelection/utils.d.ts +52 -0
  84. package/es/components/molecules/CalendarSelection/utils.js +304 -0
  85. package/es/components/molecules/ColorPicker/CustomPicker/index.js +3 -3
  86. package/es/components/molecules/ColorPicker/index.d.ts +1 -0
  87. package/es/components/molecules/ColorPicker/index.js +3 -2
  88. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +24 -16
  89. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +5 -0
  90. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +31 -1
  91. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
  92. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +3 -1
  93. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +5 -4
  94. package/es/components/molecules/ModalV2/styled.js +4 -0
  95. package/es/components/molecules/ResizeGrid/ResizeGrid.js +10 -2
  96. package/es/components/molecules/ResizeGrid/types.d.ts +1 -0
  97. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +1 -0
  98. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +2 -2
  99. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +1 -0
  100. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
  101. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
  102. package/es/components/molecules/ShareAccess/index.d.ts +2 -3
  103. package/es/components/molecules/ShareAccess/index.js +2 -3
  104. package/es/components/molecules/ShareAccess/types.d.ts +1 -0
  105. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.d.ts +52 -0
  106. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +144 -0
  107. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.d.ts +10 -0
  108. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.js +38 -0
  109. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.d.ts +15 -0
  110. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.js +68 -0
  111. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.d.ts +1 -0
  112. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.js +1 -0
  113. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +5 -0
  114. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +175 -0
  115. package/es/components/molecules/TemplateSaveAs/components/index.d.ts +1 -0
  116. package/es/components/molecules/TemplateSaveAs/components/index.js +1 -0
  117. package/es/components/molecules/TemplateSaveAs/index.d.ts +3 -0
  118. package/es/components/molecules/TemplateSaveAs/index.js +2 -0
  119. package/es/components/molecules/TemplateSaveAs/styled.d.ts +4 -0
  120. package/es/components/molecules/TemplateSaveAs/styled.js +70 -0
  121. package/es/components/molecules/ThumbnailCard/ThumbnailCard.d.ts +3 -0
  122. package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +72 -0
  123. package/es/components/molecules/ThumbnailCard/constants.d.ts +3 -0
  124. package/es/components/molecules/ThumbnailCard/constants.js +3 -0
  125. package/es/components/molecules/ThumbnailCard/index.d.ts +2 -0
  126. package/es/components/molecules/ThumbnailCard/index.js +2 -0
  127. package/es/components/molecules/ThumbnailCard/styled.d.ts +1 -0
  128. package/es/components/{template/TemplateListing/components/TemplateItem → molecules/ThumbnailCard}/styled.js +14 -7
  129. package/es/components/molecules/ThumbnailCard/types.d.ts +21 -0
  130. package/es/components/molecules/ThumbnailCard/types.js +1 -0
  131. package/es/components/molecules/UploadImage/index.js +1 -1
  132. package/es/components/molecules/index.d.ts +5 -0
  133. package/es/components/molecules/index.js +3 -0
  134. package/es/components/organism/Help/Help.js +23 -1
  135. package/es/components/organism/Menu/Menu.d.ts +2 -0
  136. package/es/components/organism/Menu/Menu.js +3 -0
  137. package/es/components/organism/Menu/index.d.ts +1 -0
  138. package/es/components/organism/Menu/index.js +3 -0
  139. package/es/components/organism/PreviewTemplateModal/components/Banner/index.d.ts +3 -0
  140. package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +12 -0
  141. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.d.ts +4 -0
  142. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +91 -0
  143. package/es/components/organism/PreviewTemplateModal/components/Information/index.d.ts +3 -0
  144. package/es/components/organism/PreviewTemplateModal/components/Information/index.js +29 -0
  145. package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +2 -0
  146. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +41 -0
  147. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.d.ts +3 -0
  148. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +29 -0
  149. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +2 -0
  150. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +12 -0
  151. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.d.ts +6 -0
  152. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.js +77 -0
  153. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.d.ts +3 -0
  154. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +62 -0
  155. package/es/components/organism/PreviewTemplateModal/components/index.d.ts +4 -0
  156. package/es/components/organism/PreviewTemplateModal/components/index.js +4 -0
  157. package/es/components/organism/PreviewTemplateModal/constants/dataSample.d.ts +2 -0
  158. package/es/components/organism/PreviewTemplateModal/constants/dataSample.js +9 -0
  159. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.d.ts +8 -0
  160. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.js +11 -0
  161. package/es/components/organism/PreviewTemplateModal/constants/index.d.ts +3 -0
  162. package/es/components/organism/PreviewTemplateModal/constants/index.js +3 -0
  163. package/es/components/organism/PreviewTemplateModal/constants/variables.d.ts +12 -0
  164. package/es/components/organism/PreviewTemplateModal/constants/variables.js +12 -0
  165. package/es/components/organism/PreviewTemplateModal/index.d.ts +3 -0
  166. package/es/components/organism/PreviewTemplateModal/index.js +34 -0
  167. package/es/components/organism/PreviewTemplateModal/styled.d.ts +4 -0
  168. package/es/components/organism/PreviewTemplateModal/styled.js +26 -0
  169. package/es/components/organism/PreviewTemplateModal/types.d.ts +39 -0
  170. package/es/components/organism/PreviewTemplateModal/types.js +1 -0
  171. package/es/components/organism/index.d.ts +1 -0
  172. package/es/components/organism/index.js +1 -0
  173. package/es/components/template/TemplateListing/Loadable.d.ts +6 -0
  174. package/es/components/template/TemplateListing/Loadable.js +7 -0
  175. package/es/components/template/TemplateListing/components/BlankTemplate/index.js +9 -7
  176. package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +2 -0
  177. package/es/components/template/TemplateListing/components/CategoryListing/index.js +19 -10
  178. package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +2 -0
  179. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +44 -7
  180. package/es/components/template/TemplateListing/components/CategoryListing/types.d.ts +2 -1
  181. package/es/components/template/TemplateListing/components/Empty/index.d.ts +3 -0
  182. package/es/components/template/TemplateListing/components/Empty/index.js +18 -0
  183. package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -0
  184. package/es/components/template/TemplateListing/components/Empty/styled.js +35 -0
  185. package/es/components/template/TemplateListing/components/index.d.ts +1 -1
  186. package/es/components/template/TemplateListing/components/index.js +1 -1
  187. package/es/components/template/TemplateListing/constants/defaultProps.d.ts +8 -4
  188. package/es/components/template/TemplateListing/constants/defaultProps.js +9 -6
  189. package/es/components/template/TemplateListing/hooks/index.d.ts +1 -0
  190. package/es/components/template/TemplateListing/hooks/index.js +1 -0
  191. package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +62 -0
  192. package/es/components/template/TemplateListing/hooks/useTemplateListing.js +206 -0
  193. package/es/components/template/TemplateListing/index.js +77 -13
  194. package/es/components/template/TemplateListing/styled/index.d.ts +2 -0
  195. package/es/components/template/TemplateListing/styled/index.js +29 -5
  196. package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +3 -2
  197. package/es/components/template/TemplateListing/types/CategoryListing.d.ts +5 -2
  198. package/es/components/template/TemplateListing/types/Empty.d.ts +5 -0
  199. package/es/components/template/TemplateListing/types/Empty.js +1 -0
  200. package/es/components/template/TemplateListing/types/TemplateListing.d.ts +20 -9
  201. package/es/components/template/TemplateListing/types/index.d.ts +0 -1
  202. package/es/components/template/TemplateListing/types/index.js +0 -1
  203. package/es/components/template/index.d.ts +2 -1
  204. package/es/components/template/index.js +5 -1
  205. package/es/constants/datetime.d.ts +8 -0
  206. package/es/constants/datetime.js +1594 -0
  207. package/es/constants/index.d.ts +4 -1
  208. package/es/constants/index.js +4 -1
  209. package/es/constants/queries.d.ts +3 -0
  210. package/es/constants/queries.js +4 -0
  211. package/es/constants/templateListing.d.ts +58 -0
  212. package/es/constants/templateListing.js +58 -0
  213. package/es/hooks/index.d.ts +4 -0
  214. package/es/hooks/index.js +4 -0
  215. package/es/hooks/useEffectOnlyOnce.d.ts +2 -0
  216. package/es/hooks/useEffectOnlyOnce.js +12 -0
  217. package/es/hooks/useForceUpdate.d.ts +1 -0
  218. package/es/hooks/useForceUpdate.js +5 -0
  219. package/es/hooks/useIntersectionObserver.d.ts +57 -0
  220. package/es/hooks/useIntersectionObserver.js +97 -0
  221. package/es/hooks/useListingItemResize.d.ts +12 -0
  222. package/es/hooks/useListingItemResize.js +58 -0
  223. package/es/hooks/useScrollToEnd.d.ts +1 -0
  224. package/es/hooks/useScrollToEnd.js +30 -0
  225. package/es/index.d.ts +2 -0
  226. package/es/index.js +2 -0
  227. package/es/locales/en/translation.json +11 -3
  228. package/es/locales/i18n.d.ts +16 -0
  229. package/es/locales/translations.d.ts +8 -0
  230. package/es/locales/vi/translation.json +9 -1
  231. package/es/models/ObjectTemplate.d.ts +53 -0
  232. package/es/models/ObjectTemplate.js +80 -0
  233. package/es/models/TemplateCategory.d.ts +13 -0
  234. package/es/models/TemplateCategory.js +28 -0
  235. package/es/queries/TemplateListing/index.d.ts +47 -0
  236. package/es/queries/TemplateListing/index.js +93 -0
  237. package/es/queries/index.d.ts +1 -0
  238. package/es/queries/index.js +1 -0
  239. package/es/services/TemplateListing/index.d.ts +64 -0
  240. package/es/services/TemplateListing/index.js +149 -0
  241. package/es/test.js +62 -11
  242. package/es/types/index.d.ts +4 -0
  243. package/es/types/index.js +2 -0
  244. package/es/types/service.d.ts +22 -0
  245. package/es/types/service.js +1 -0
  246. package/es/types/templateListing.d.ts +11 -0
  247. package/es/types/templateListing.js +1 -0
  248. package/es/utils/common.d.ts +2 -0
  249. package/es/utils/common.js +12 -0
  250. package/package.json +6 -1
  251. package/es/components/template/TemplateListing/components/TemplateItem/index.d.ts +0 -3
  252. package/es/components/template/TemplateListing/components/TemplateItem/index.js +0 -53
  253. package/es/components/template/TemplateListing/components/TemplateItem/styled.d.ts +0 -1
  254. package/es/components/template/TemplateListing/types/TemplateItem.d.ts +0 -14
  255. /package/es/components/{template/TemplateListing/types/TemplateItem.js → molecules/CalendarSelection/components/CustomPicker/types.js} +0 -0
@@ -0,0 +1,152 @@
1
+ import styled from 'styled-components';
2
+ export const StyledCellDate = styled.div `
3
+ --cellTextColor: ${p => (p.rangeColor.isLight() ? '#000' : '#fff')};
4
+ --cellBgColor: ${p => p.rangeColor.lighten(40).toHexString()};
5
+ --cellHoverBgColor: ${p => p.rangeColor.lighten(30).toHexString()};
6
+ --rangeColor: ${p => p.rangeColor.toHexString()};
7
+
8
+ position: relative;
9
+
10
+ &:before {
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ height: 100%;
15
+ width: 100%;
16
+ content: '';
17
+ }
18
+ `;
19
+ export const StyledCustomPickerRoot = styled.div `
20
+ display: flex;
21
+ flex-direction: column;
22
+ gap: 8px;
23
+ padding: 8px 12px;
24
+
25
+ .range-inputs {
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 8px;
29
+
30
+ .range-input {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 4px;
34
+ }
35
+ }
36
+
37
+ .custom-label,
38
+ .range-inputs .range-input-label {
39
+ font-weight: bold;
40
+ text-transform: uppercase;
41
+ color: #838383;
42
+ }
43
+ `;
44
+ export const CalendarContainerStyled = styled.div `
45
+ /* Variables */
46
+ --cellHeight: 28px;
47
+ --cellWidth: 28px;
48
+ --colorToDay: rgb(211, 211, 211);
49
+ --colorSelected: rgb(0, 94, 184);
50
+ --colorInRange: rgb(216, 234, 252);
51
+
52
+ position: relative;
53
+
54
+ .antsomi-picker-dropdown {
55
+ position: relative;
56
+ top: 0 !important;
57
+ left: 0 !important;
58
+ box-shadow: none;
59
+ padding: 0;
60
+
61
+ .antsomi-picker-panel-container {
62
+ box-shadow: none;
63
+ }
64
+ .antsomi-picker-panels {
65
+ display: inline-flex;
66
+ flex-direction: column;
67
+ }
68
+
69
+ /* Content */
70
+ .antsomi-picker-content {
71
+ /* Rectangle */
72
+ & td,
73
+ & th,
74
+ & .antsomi-picker-cell-inner,
75
+ & td::before {
76
+ /* width: var(--cellWidth);
77
+ height: var(--cellHeight); */
78
+ }
79
+
80
+ /* Date node */
81
+ .antsomi-picker-cell-inner {
82
+ }
83
+
84
+ /* Today node */
85
+ .antsomi-picker-cell-today {
86
+ .antsomi-picker-cell-inner {
87
+ &::before {
88
+ border-radius: 18px;
89
+ border: 0.0001rem solid var(--colorToDay);
90
+ }
91
+ }
92
+ }
93
+
94
+ /* Selected node */
95
+ .antsomi-picker-cell-in-view {
96
+ &.antsomi-picker-cell-selected,
97
+ &.antsomi-picker-cell-range-start,
98
+ &.antsomi-picker-cell-range-end {
99
+ .antsomi-picker-cell-inner {
100
+ background: var(--colorSelected) !important;
101
+ border-radius: 18px !important;
102
+ }
103
+ }
104
+ }
105
+
106
+ /* In Range */
107
+ .antsomi-picker-cell-in-range.antsomi-picker-cell-in-view {
108
+ &::before {
109
+ background: var(--colorInRange) !important;
110
+ }
111
+ .antsomi-picker-cell-inner {
112
+ /* background: var(--colorInRange) !important; */
113
+ &::after {
114
+ content: none !important;
115
+ background: var(--colorInRange) !important;
116
+ }
117
+ }
118
+ }
119
+
120
+ /* In Range Start End */
121
+ .antsomi-picker-cell-in-view.antsomi-picker-cell-range-start:not(
122
+ .antsomi-picker-cell-range-start-single
123
+ ) {
124
+ &::before {
125
+ background: var(--colorInRange) !important;
126
+ }
127
+ }
128
+ .antsomi-picker-cell-in-view.antsomi-picker-cell-range-end:not(
129
+ .antsomi-picker-cell-range-end-single
130
+ ) {
131
+ &::before {
132
+ background: var(--colorInRange) !important;
133
+ }
134
+ }
135
+
136
+ /* Hover */
137
+ .antsomi-picker-cell-in-view {
138
+ &.antsomi-picker-cell-range-hover,
139
+ &.antsomi-picker-cell-range-hover-start,
140
+ &.antsomi-picker-cell-range-hover-end {
141
+ &:not(.antsomi-picker-cell-in-range)::after {
142
+ content: none !important;
143
+ border: none;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ .antsomi-picker-range-arrow {
149
+ display: none !important;
150
+ }
151
+ }
152
+ `;
@@ -0,0 +1 @@
1
+ export type CustomPickerProps = {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const Footer: () => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Button } from '@antscorp/antsomi-ui/es/components/atoms/Button';
3
+ import { useCalendarSelectionContext } from '../../hooks';
4
+ import { apply, togglePopover } from '../../actions';
5
+ import { StyledFooterRoot } from './styled';
6
+ export const Footer = () => {
7
+ const { action } = useCalendarSelectionContext();
8
+ return (React.createElement(StyledFooterRoot, null,
9
+ React.createElement(Button, { onClick: () => action.dispatch(apply()), type: "primary" }, "Apply"),
10
+ React.createElement(Button, { onClick: () => action.dispatch(togglePopover()) }, "Cancel")));
11
+ };
@@ -0,0 +1 @@
1
+ export * from './Footer';
@@ -0,0 +1 @@
1
+ export * from './Footer';
@@ -0,0 +1 @@
1
+ export declare const StyledFooterRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,6 @@
1
+ import styled from 'styled-components';
2
+ export const StyledFooterRoot = styled.div `
3
+ display: flex;
4
+ gap: 8px;
5
+ padding: 8px 12px;
6
+ `;
@@ -0,0 +1,5 @@
1
+ import { DatePicker } from 'src/components/molecules';
2
+ import React, { ComponentProps } from 'react';
3
+ type RangePickerProps = {} & ComponentProps<typeof DatePicker.RangePicker>;
4
+ export declare const RangePicker: React.FC<RangePickerProps>;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { StyledRangePicker } from './styled';
3
+ const DATE_FORMAT = 'DD/MM/YYYY';
4
+ export const RangePicker = props => (React.createElement(StyledRangePicker, Object.assign({}, props, { allowEmpty: [true, true], allowClear: false, autoFocus: false, size: "large", suffixIcon: false, format: DATE_FORMAT })));
@@ -0,0 +1 @@
1
+ export * from './RangePicker';
@@ -0,0 +1 @@
1
+ export * from './RangePicker';
@@ -0,0 +1,5 @@
1
+ export declare const StyledRangePicker: import("styled-components").StyledComponent<import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").RangePickerProps<import("dayjs").Dayjs> & {
2
+ dropdownClassName?: string | undefined;
3
+ popupClassName?: string | undefined;
4
+ rootClassName?: string | undefined;
5
+ }, unknown>, any, {}, never>;
@@ -0,0 +1,13 @@
1
+ import { DatePicker } from '@antscorp/antsomi-ui/es/components/molecules';
2
+ import styled from 'styled-components';
3
+ const { RangePicker } = DatePicker;
4
+ export const StyledRangePicker = styled(RangePicker) `
5
+ font-size: 12px;
6
+ padding-right: 8px;
7
+
8
+ .ant-picker-input {
9
+ input {
10
+ width: 80px;
11
+ }
12
+ }
13
+ `;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ListRangeSelectionProps } from './types';
3
+ export declare const RangeSelectOptions: React.FC<ListRangeSelectionProps>;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { RANGE_SELECTION_OPTIONS, RANGE_TIME, SELECTION_KEY } from '../../constants';
3
+ import { Divider } from '@antscorp/antsomi-ui/es/components/atoms';
4
+ import { List } from 'antd';
5
+ import { NumOfDaysRanges, Option } from './components';
6
+ import { RangeSelectOptionsRoot } from './styled';
7
+ const customOption = RANGE_SELECTION_OPTIONS[SELECTION_KEY.custom];
8
+ const baseOptions = RANGE_TIME.map(key => {
9
+ var _a;
10
+ const option = RANGE_SELECTION_OPTIONS[key];
11
+ return {
12
+ key,
13
+ type: key,
14
+ label: option.label.trim(),
15
+ options: ((_a = option.options) === null || _a === void 0 ? void 0 : _a.map(i => (Object.assign(Object.assign({}, i), { type: i.key })))) || [],
16
+ };
17
+ });
18
+ export const RangeSelectOptions = () => (React.createElement(RangeSelectOptionsRoot, null,
19
+ React.createElement(List, { dataSource: [customOption], renderItem: item => React.createElement(Option, { type: item.key, label: item.label }) }),
20
+ React.createElement(Divider, { style: { marginTop: 4, marginBottom: 4 } }),
21
+ React.createElement(List, { dataSource: baseOptions, renderItem: item => React.createElement(Option, { type: item.key, label: item.label, options: item.options }) }),
22
+ React.createElement(Divider, { style: { marginTop: 4, marginBottom: 4 } }),
23
+ React.createElement(NumOfDaysRanges, null)));
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NumOfDaysRanges: () => React.JSX.Element;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { DEFAULT_NUM_UP_TO, RANGE_SELECTION_OPTIONS, SELECTION_KEY } from '../../../../constants';
3
+ import { Option } from '../Option';
4
+ import { useCalendarSelectionContext } from '../../../../hooks';
5
+ import { updateRangeInfo } from '../../../../actions';
6
+ import { InputNumber } from '@antscorp/antsomi-ui/es/components/atoms';
7
+ import { List } from 'antd';
8
+ const numbericOptions = [
9
+ RANGE_SELECTION_OPTIONS[SELECTION_KEY.days_up_to_today],
10
+ RANGE_SELECTION_OPTIONS[SELECTION_KEY.days_up_to_yesterday],
11
+ ].map(i => (Object.assign(Object.assign({}, i), { type: i.key })));
12
+ export const NumOfDaysRanges = () => {
13
+ const { state, action } = useCalendarSelectionContext();
14
+ const { rangeInfo } = state.value.current;
15
+ let upToDaysRangeInfo = null;
16
+ if (rangeInfo.type === SELECTION_KEY.days_up_to_yesterday ||
17
+ rangeInfo.type === SELECTION_KEY.days_up_to_today) {
18
+ upToDaysRangeInfo = rangeInfo;
19
+ }
20
+ const handleChangeNumOfDays = (value, rangeType) => {
21
+ if (!upToDaysRangeInfo || upToDaysRangeInfo.type !== rangeType)
22
+ return;
23
+ action.dispatch(updateRangeInfo({
24
+ numOfDays: value,
25
+ }));
26
+ };
27
+ const renderInput = (rangeType) => {
28
+ let value = DEFAULT_NUM_UP_TO;
29
+ if (rangeType === (upToDaysRangeInfo === null || upToDaysRangeInfo === void 0 ? void 0 : upToDaysRangeInfo.type)) {
30
+ value = upToDaysRangeInfo.numOfDays;
31
+ }
32
+ return (React.createElement(InputNumber, { onChange: value => {
33
+ if (typeof value === 'number') {
34
+ handleChangeNumOfDays(value, rangeType);
35
+ }
36
+ }, readOnly: rangeType !== (upToDaysRangeInfo === null || upToDaysRangeInfo === void 0 ? void 0 : upToDaysRangeInfo.type), size: "small", type: "number", style: { width: 60 }, min: 1, step: 1, precision: 0, value: value }));
37
+ };
38
+ return (React.createElement(List, { className: "ants-text-normal", dataSource: numbericOptions, renderItem: item => (React.createElement(Option, { type: item.key, label: React.createElement("div", { className: "ants-flex ants-gap-2 ants-items-center" },
39
+ renderInput(item.type),
40
+ item.label) })) }));
41
+ };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ type ItemProps = {
3
+ type: string;
4
+ label?: React.ReactNode;
5
+ options?: {
6
+ type: string;
7
+ label: React.ReactNode;
8
+ }[];
9
+ };
10
+ export declare const Option: React.FC<ItemProps>;
11
+ export {};
@@ -0,0 +1,40 @@
1
+ import React, { useRef } from 'react';
2
+ import Icon from '@antscorp/icons';
3
+ import { Popover } from '@antscorp/antsomi-ui/es/components/atoms';
4
+ import classNames from 'classnames';
5
+ import { useCalendarSelectionContext } from '../../../../hooks';
6
+ import { changeRangeType } from '../../../../actions';
7
+ import { rangeInfoToStringType } from '../../../../utils';
8
+ import { StyledMenu } from './styled';
9
+ import { List } from 'antd';
10
+ export const Option = props => {
11
+ const itemRef = useRef(null);
12
+ const { label = '', options = [], type } = props;
13
+ const { state, action } = useCalendarSelectionContext();
14
+ const { rangeInfo } = state.value.current;
15
+ const selectedRangeType = rangeInfoToStringType(rangeInfo);
16
+ const optionsTypes = options.map(o => o.type);
17
+ const hasSubOptionActive = optionsTypes.includes(selectedRangeType);
18
+ const isActive = selectedRangeType === type || hasSubOptionActive;
19
+ const withDropdown = options.length > 0;
20
+ const handleClickOption = (rangeType) => {
21
+ if (rangeType !== selectedRangeType) {
22
+ action.dispatch(changeRangeType(rangeType));
23
+ }
24
+ };
25
+ const content = (React.createElement(List.Item, { ref: itemRef, className: classNames({ active: isActive }), onClick: () => {
26
+ if (!withDropdown) {
27
+ handleClickOption(type);
28
+ }
29
+ } },
30
+ React.createElement("div", { className: classNames({
31
+ 'ants-font-bold': isActive,
32
+ }) }, label),
33
+ withDropdown && (React.createElement(Icon, { style: {
34
+ fontSize: 8,
35
+ }, type: "icon-ants-angle-right" }))));
36
+ if (withDropdown) {
37
+ return (React.createElement(Popover, { placement: "rightTop", overlayClassName: "arrow-hidden", overlayInnerStyle: { padding: 0 }, arrow: false, content: React.createElement(StyledMenu, { selectedKeys: [selectedRangeType], items: options.map(o => (Object.assign(Object.assign({}, o), { key: o.type, onClick: () => handleClickOption(o.type) }))) }), destroyTooltipOnHide: true }, content));
38
+ }
39
+ return content;
40
+ };
@@ -0,0 +1,29 @@
1
+ import { Menu } from 'antd';
2
+ import styled from 'styled-components';
3
+ export const StyledMenu = styled(Menu) `
4
+ &.antsomi-menu-root {
5
+ .antsomi-menu-item {
6
+ position: relative;
7
+ color: black;
8
+ height: 32px;
9
+ line-height: 32px;
10
+ border-radius: 0;
11
+ width: 100%;
12
+ margin: 0;
13
+
14
+ &.antsomi-menu-item-selected {
15
+ font-weight: bold;
16
+
17
+ &:after {
18
+ content: '';
19
+ position: absolute;
20
+ left: 0;
21
+ top: 0;
22
+ width: 4px;
23
+ height: 100%;
24
+ background-color: #005fb8;
25
+ }
26
+ }
27
+ }
28
+ }
29
+ `;
@@ -0,0 +1,2 @@
1
+ export * from './Option';
2
+ export * from './NumOfDaysRanges';
@@ -0,0 +1,2 @@
1
+ export * from './Option';
2
+ export * from './NumOfDaysRanges';
@@ -0,0 +1 @@
1
+ export * from './RangeSelectOptions';
@@ -0,0 +1 @@
1
+ export * from './RangeSelectOptions';
@@ -0,0 +1,3 @@
1
+ import { List } from 'antd';
2
+ export declare const StyledList: import("styled-components").StyledComponent<typeof List, any, {}, never>;
3
+ export declare const RangeSelectOptionsRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,34 @@
1
+ import styled from 'styled-components';
2
+ import { List } from 'antd';
3
+ export const StyledList = styled(List) ``;
4
+ export const RangeSelectOptionsRoot = styled.div `
5
+ .antsomi-list-items {
6
+ font-size: inherit;
7
+
8
+ .antsomi-list-item {
9
+ border: none;
10
+ padding: 6px 12px;
11
+ cursor: pointer;
12
+ position: relative;
13
+
14
+ &.active {
15
+ background-color: #d8eafc;
16
+ font-weight: bold;
17
+
18
+ &:after {
19
+ position: absolute;
20
+ content: '';
21
+ width: 4px;
22
+ height: 100%;
23
+ left: 0;
24
+ top: 0;
25
+ background-color: #005fb8;
26
+ }
27
+ }
28
+
29
+ &:hover:not(.active) {
30
+ background-color: #f4f6f8;
31
+ }
32
+ }
33
+ }
34
+ `;
@@ -0,0 +1 @@
1
+ export type ListRangeSelectionProps = {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export type TimeRangeDisplayProps = {
3
+ showType?: boolean;
4
+ formatStart?: string;
5
+ formatEnd?: string;
6
+ operator?: string;
7
+ };
8
+ export declare const TimeRangeDisplay: React.FC<TimeRangeDisplayProps>;
@@ -0,0 +1,49 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import cls from 'clsx';
13
+ import React, { forwardRef, useEffect, useState } from 'react';
14
+ import { Typography } from '@antscorp/antsomi-ui/es/components/atoms';
15
+ import { ACTION_TYPES } from '../../actions';
16
+ import { useCalendarSelectionContext } from '../../hooks';
17
+ import { getRangeTypeSelectedTitle, getRangeValueSelctedTitle } from '../../utils';
18
+ import { StyledBtnDisplayWrapper } from './styled';
19
+ import Icon from '@antscorp/icons';
20
+ const { Text } = Typography;
21
+ export const TimeRangeDisplay = forwardRef((props, ref) => {
22
+ const { showType = true, formatStart, formatEnd, operator } = props, rest = __rest(props, ["showType", "formatStart", "formatEnd", "operator"]);
23
+ const { state, action } = useCalendarSelectionContext();
24
+ // console.log({ state, action });
25
+ const [collapse, setCollapse] = useState(false);
26
+ useEffect(() => {
27
+ setCollapse(false);
28
+ }, []);
29
+ const { rangeInfo, rangeValue } = state.value.original;
30
+ const handleOpenPopover = () => {
31
+ action.dispatch({ type: ACTION_TYPES.togglePopover });
32
+ };
33
+ const rangeSelectedTitle = getRangeTypeSelectedTitle(rangeInfo);
34
+ const rangeValueTitles = getRangeValueSelctedTitle(rangeValue, {
35
+ formatStart,
36
+ formatEnd,
37
+ operator,
38
+ });
39
+ // console.log({ rangeSelectedTitle, rangeValueTitles });
40
+ return (React.createElement(StyledBtnDisplayWrapper, Object.assign({ ref: ref }, rest, { onClick: handleOpenPopover, role: "button" }),
41
+ showType && (React.createElement(Text, { className: "range-type", ellipsis: { tooltip: rangeSelectedTitle } }, rangeSelectedTitle)),
42
+ React.createElement("div", { className: cls('range-date', { collapse: state.open }) },
43
+ rangeValue.length > 0 && (React.createElement(Text, { className: "range-date-title", ellipsis: { tooltip: rangeValueTitles[0] } },
44
+ rangeValueTitles[0],
45
+ React.createElement(Icon, { className: "collapse-btn", type: "icon-ants-angle-down", style: { fontSize: 9 } }))),
46
+ rangeValue.length > 1 && (React.createElement("div", { className: cls('collapse-wrapper') }, rangeValueTitles.slice(1).map(title => (React.createElement(React.Fragment, { key: title },
47
+ React.createElement("div", { className: "compare-title" }, "Compare"),
48
+ React.createElement(Text, { className: "range-date-title", ellipsis: { tooltip: title } }, title)))))))));
49
+ });
@@ -0,0 +1,2 @@
1
+ export { TimeRangeDisplay } from './TimeRangeDisplay';
2
+ export { StyledBtnDisplayWrapper } from './styled';
@@ -0,0 +1,2 @@
1
+ export { TimeRangeDisplay } from './TimeRangeDisplay';
2
+ export { StyledBtnDisplayWrapper } from './styled';
@@ -0,0 +1 @@
1
+ export declare const StyledBtnDisplayWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,70 @@
1
+ import styled from 'styled-components';
2
+ export const StyledBtnDisplayWrapper = styled.div `
3
+ display: flex;
4
+ overflow: hidden;
5
+ text-overflow: ellipsis;
6
+ background-color: transparent;
7
+ cursor: pointer;
8
+ width: fit-content;
9
+
10
+ .range-type {
11
+ /* font-size: 0.75rem;
12
+ width: fit-content;
13
+ padding: 2px 8px; */
14
+
15
+ display: block;
16
+ font-size: 0.813rem;
17
+ margin-right: 0.5rem;
18
+ color: rgb(127, 127, 127);
19
+ }
20
+
21
+ .range-date {
22
+ border-top: none;
23
+ border-right: none;
24
+ border-left: none;
25
+ border-image: initial;
26
+ background: transparent;
27
+ border-bottom: 1px solid rgb(184, 207, 230);
28
+ text-align: left;
29
+ display: flex;
30
+ -webkit-box-pack: justify;
31
+ justify-content: space-between;
32
+ -webkit-box-align: center;
33
+ align-items: center;
34
+ font-size: 0.75rem;
35
+ padding: 2px 8px;
36
+ max-width: unset;
37
+
38
+ .range-date-title {
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 8px;
42
+ }
43
+
44
+ .collapse-wrapper {
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 2px;
48
+ overflow: hidden;
49
+
50
+ .compare-title {
51
+ font-size: 11px;
52
+ color: #878d93;
53
+ }
54
+ }
55
+
56
+ .collapse-btn {
57
+ padding: 4px;
58
+ }
59
+
60
+ &.collapse {
61
+ .collapse-wrapper {
62
+ height: 0;
63
+ }
64
+
65
+ .collapse-btn {
66
+ transform: rotate(180deg);
67
+ }
68
+ }
69
+ }
70
+ `;
@@ -0,0 +1,5 @@
1
+ export * from './CustomPicker';
2
+ export * from './RangeSelectOptions';
3
+ export * from './RangePicker';
4
+ export * from './TimeRangeDisplay';
5
+ export * from './Footer';
@@ -0,0 +1,5 @@
1
+ export * from './CustomPicker';
2
+ export * from './RangeSelectOptions';
3
+ export * from './RangePicker';
4
+ export * from './TimeRangeDisplay';
5
+ export * from './Footer';