@axelor/aos-mobile-ui 9.1.10 → 9.2.0

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 (434) hide show
  1. package/lib/components/atoms/BorderBar/BorderBar.d.ts +9 -0
  2. package/lib/components/atoms/BorderBar/BorderBar.js +30 -0
  3. package/lib/components/atoms/BorderBar/BorderBar.js.map +1 -0
  4. package/lib/components/atoms/Card/Card.d.ts +2 -1
  5. package/lib/components/atoms/Card/Card.js +2 -2
  6. package/lib/components/atoms/Card/Card.js.map +1 -1
  7. package/lib/components/atoms/HorizontalRule/HorizontalRule.d.ts +3 -1
  8. package/lib/components/atoms/HorizontalRule/HorizontalRule.js +5 -7
  9. package/lib/components/atoms/HorizontalRule/HorizontalRule.js.map +1 -1
  10. package/lib/components/atoms/HtmlInput/HtmlInput.d.ts +3 -1
  11. package/lib/components/atoms/HtmlInput/HtmlInput.js +13 -8
  12. package/lib/components/atoms/HtmlInput/HtmlInput.js.map +1 -1
  13. package/lib/components/atoms/HtmlViewer/HtmlViewer.d.ts +10 -0
  14. package/lib/components/atoms/HtmlViewer/HtmlViewer.js +93 -0
  15. package/lib/components/atoms/HtmlViewer/HtmlViewer.js.map +1 -0
  16. package/lib/components/atoms/Icon/Icon.d.ts +2 -1
  17. package/lib/components/atoms/Icon/Icon.js +4 -5
  18. package/lib/components/atoms/Icon/Icon.js.map +1 -1
  19. package/lib/components/atoms/Input/Input.d.ts +5 -5
  20. package/lib/components/atoms/Input/Input.js +6 -5
  21. package/lib/components/atoms/Input/Input.js.map +1 -1
  22. package/lib/components/atoms/ProgressCircle/ProgressCircle.js +11 -7
  23. package/lib/components/atoms/ProgressCircle/ProgressCircle.js.map +1 -1
  24. package/lib/components/atoms/RadioButton/RadioButton.js +25 -21
  25. package/lib/components/atoms/RadioButton/RadioButton.js.map +1 -1
  26. package/lib/components/atoms/Screen/Screen.d.ts +1 -2
  27. package/lib/components/atoms/Screen/Screen.js +2 -9
  28. package/lib/components/atoms/Screen/Screen.js.map +1 -1
  29. package/lib/components/atoms/Switch/Switch.d.ts +1 -1
  30. package/lib/components/atoms/Switch/Switch.js +5 -5
  31. package/lib/components/atoms/Switch/Switch.js.map +1 -1
  32. package/lib/components/atoms/Text/Text.d.ts +2 -1
  33. package/lib/components/atoms/Text/Text.js +1 -1
  34. package/lib/components/atoms/Text/Text.js.map +1 -1
  35. package/lib/components/atoms/VerticalRule/VerticalRule.d.ts +8 -0
  36. package/lib/components/atoms/VerticalRule/VerticalRule.js +33 -0
  37. package/lib/components/atoms/VerticalRule/VerticalRule.js.map +1 -0
  38. package/lib/components/atoms/index.d.ts +3 -0
  39. package/lib/components/atoms/index.js +3 -0
  40. package/lib/components/atoms/index.js.map +1 -1
  41. package/lib/components/molecules/Alert/Alert.js +18 -30
  42. package/lib/components/molecules/Alert/Alert.js.map +1 -1
  43. package/lib/components/molecules/Badge/Badge.d.ts +2 -1
  44. package/lib/components/molecules/Badge/Badge.js +15 -12
  45. package/lib/components/molecules/Badge/Badge.js.map +1 -1
  46. package/lib/components/molecules/BottomSheet/BottomSheet.js +1 -1
  47. package/lib/components/molecules/BottomSheet/BottomSheet.js.map +1 -1
  48. package/lib/components/molecules/Breadcrumb/Breadcrumb.js +1 -1
  49. package/lib/components/molecules/Button/Button.d.ts +2 -1
  50. package/lib/components/molecules/Button/Button.js +6 -12
  51. package/lib/components/molecules/Button/Button.js.map +1 -1
  52. package/lib/components/molecules/CalendarLegend/CalendarLegend.d.ts +13 -0
  53. package/lib/components/molecules/CalendarLegend/CalendarLegend.js +89 -0
  54. package/lib/components/molecules/CalendarLegend/CalendarLegend.js.map +1 -0
  55. package/lib/components/molecules/CalendarLegend/index.d.ts +2 -0
  56. package/lib/components/molecules/CalendarLegend/index.js +19 -0
  57. package/lib/components/molecules/CalendarLegend/index.js.map +1 -0
  58. package/lib/components/molecules/CalendarLegend/types.d.ts +6 -0
  59. package/lib/components/molecules/CalendarLegend/types.js +19 -0
  60. package/lib/components/molecules/CalendarLegend/types.js.map +1 -0
  61. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.d.ts +15 -0
  62. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.js +49 -0
  63. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.js.map +1 -0
  64. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.d.ts +8 -0
  65. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.js +35 -0
  66. package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.js.map +1 -0
  67. package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.d.ts +7 -0
  68. package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.js +44 -0
  69. package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.js.map +1 -0
  70. package/lib/components/molecules/CalendarMonthGrid/index.d.ts +3 -0
  71. package/lib/components/molecules/CalendarMonthGrid/index.js +21 -0
  72. package/lib/components/molecules/CalendarMonthGrid/index.js.map +1 -0
  73. package/lib/components/molecules/CardIconButton/CardIconButton.js +1 -1
  74. package/lib/components/molecules/Checkbox/Checkbox.d.ts +1 -1
  75. package/lib/components/molecules/Checkbox/Checkbox.js +11 -27
  76. package/lib/components/molecules/Checkbox/Checkbox.js.map +1 -1
  77. package/lib/components/molecules/Chip/Chip.d.ts +1 -1
  78. package/lib/components/molecules/Chip/Chip.js +23 -19
  79. package/lib/components/molecules/Chip/Chip.js.map +1 -1
  80. package/lib/components/molecules/CircleButton/CircleButton.js +1 -1
  81. package/lib/components/molecules/CircleButton/CircleButton.js.map +1 -1
  82. package/lib/components/molecules/ClearableCard/ClearableCard.js +2 -7
  83. package/lib/components/molecules/ClearableCard/ClearableCard.js.map +1 -1
  84. package/lib/components/molecules/DoubleIcon/DoubleIcon.js +1 -1
  85. package/lib/components/molecules/DoubleIcon/DoubleIcon.js.map +1 -1
  86. package/lib/components/molecules/DropdownCard/DropdownCard.d.ts +4 -3
  87. package/lib/components/molecules/DropdownCard/DropdownCard.js +36 -55
  88. package/lib/components/molecules/DropdownCard/DropdownCard.js.map +1 -1
  89. package/lib/components/molecules/DropdownMenu/DropdownMenu.d.ts +4 -2
  90. package/lib/components/molecules/DropdownMenu/DropdownMenu.js +52 -26
  91. package/lib/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -1
  92. package/lib/components/molecules/EditableHtmlInput/EditableHtmlInput.js +2 -3
  93. package/lib/components/molecules/EditableHtmlInput/EditableHtmlInput.js.map +1 -1
  94. package/lib/components/molecules/EditableInput/EditableInput.js +4 -17
  95. package/lib/components/molecules/EditableInput/EditableInput.js.map +1 -1
  96. package/lib/components/molecules/FormHtmlInput/FormHtmlInput.d.ts +2 -2
  97. package/lib/components/molecules/FormHtmlInput/FormHtmlInput.js +13 -23
  98. package/lib/components/molecules/FormHtmlInput/FormHtmlInput.js.map +1 -1
  99. package/lib/components/molecules/FormIncrementInput/FormIncrementInput.js +6 -17
  100. package/lib/components/molecules/FormIncrementInput/FormIncrementInput.js.map +1 -1
  101. package/lib/components/molecules/FormInput/FormInput.d.ts +1 -1
  102. package/lib/components/molecules/FormInput/FormInput.js +2 -9
  103. package/lib/components/molecules/FormInput/FormInput.js.map +1 -1
  104. package/lib/components/molecules/FormSlider/FormSlider.js +3 -13
  105. package/lib/components/molecules/FormSlider/FormSlider.js.map +1 -1
  106. package/lib/components/molecules/GroupedCard/GroupedCard.d.ts +13 -0
  107. package/lib/components/molecules/GroupedCard/GroupedCard.js +60 -0
  108. package/lib/components/molecules/GroupedCard/GroupedCard.js.map +1 -0
  109. package/lib/components/molecules/HorizontalRuleText/HorizontalRuleText.js +5 -6
  110. package/lib/components/molecules/HorizontalRuleText/HorizontalRuleText.js.map +1 -1
  111. package/lib/components/molecules/IconInput/IconInput.d.ts +4 -4
  112. package/lib/components/molecules/IconInput/IconInput.js +15 -23
  113. package/lib/components/molecules/IconInput/IconInput.js.map +1 -1
  114. package/lib/components/molecules/IconTile/IconTile.d.ts +19 -0
  115. package/lib/components/molecules/IconTile/IconTile.js +43 -0
  116. package/lib/components/molecules/IconTile/IconTile.js.map +1 -0
  117. package/lib/components/molecules/Increment/Increment.d.ts +1 -1
  118. package/lib/components/molecules/Increment/Increment.js +3 -5
  119. package/lib/components/molecules/Increment/Increment.js.map +1 -1
  120. package/lib/components/molecules/Increment/IncrementButton.js +7 -14
  121. package/lib/components/molecules/Increment/IncrementButton.js.map +1 -1
  122. package/lib/components/molecules/Label/Label.d.ts +1 -1
  123. package/lib/components/molecules/Label/Label.js +11 -15
  124. package/lib/components/molecules/Label/Label.js.map +1 -1
  125. package/lib/components/molecules/LabelText/LabelText.js +6 -4
  126. package/lib/components/molecules/LabelText/LabelText.js.map +1 -1
  127. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.d.ts +6 -7
  128. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js +91 -33
  129. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js.map +1 -1
  130. package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js +21 -33
  131. package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js.map +1 -1
  132. package/lib/components/molecules/NotesCard/NotesCard.d.ts +2 -1
  133. package/lib/components/molecules/NotesCard/NotesCard.js +11 -15
  134. package/lib/components/molecules/NotesCard/NotesCard.js.map +1 -1
  135. package/lib/components/molecules/NumberBubble/NumberBubble.js +2 -2
  136. package/lib/components/molecules/NumberBubble/NumberBubble.js.map +1 -1
  137. package/lib/components/molecules/NumberChevronInput/NumberChevronInput.d.ts +5 -3
  138. package/lib/components/molecules/NumberChevronInput/NumberChevronInput.js +35 -28
  139. package/lib/components/molecules/NumberChevronInput/NumberChevronInput.js.map +1 -1
  140. package/lib/components/molecules/PanelTabs/PanelTabs.js +1 -1
  141. package/lib/components/molecules/PeriodNavigation/PeriodNavigation.d.ts +14 -0
  142. package/lib/components/molecules/PeriodNavigation/PeriodNavigation.js +45 -0
  143. package/lib/components/molecules/PeriodNavigation/PeriodNavigation.js.map +1 -0
  144. package/lib/components/molecules/RadioSelect/RadioSelect.js +8 -8
  145. package/lib/components/molecules/RadioSelect/RadioSelect.js.map +1 -1
  146. package/lib/components/molecules/RightIconButton/RightIconButton.d.ts +4 -1
  147. package/lib/components/molecules/RightIconButton/RightIconButton.js +8 -7
  148. package/lib/components/molecules/RightIconButton/RightIconButton.js.map +1 -1
  149. package/lib/components/molecules/SelectionContainer/SelectionContainer.d.ts +2 -1
  150. package/lib/components/molecules/SelectionContainer/SelectionContainer.js +46 -58
  151. package/lib/components/molecules/SelectionContainer/SelectionContainer.js.map +1 -1
  152. package/lib/components/molecules/StarScore/StarScore.d.ts +1 -1
  153. package/lib/components/molecules/StarScore/StarScore.js +7 -10
  154. package/lib/components/molecules/StarScore/StarScore.js.map +1 -1
  155. package/lib/components/molecules/Stepper/StepList.d.ts +2 -1
  156. package/lib/components/molecules/Stepper/StepList.js +14 -12
  157. package/lib/components/molecules/Stepper/StepList.js.map +1 -1
  158. package/lib/components/molecules/Stepper/Stepper.d.ts +1 -2
  159. package/lib/components/molecules/Stepper/Stepper.js +17 -28
  160. package/lib/components/molecules/Stepper/Stepper.js.map +1 -1
  161. package/lib/components/molecules/SwitchCard/SwitchCard.d.ts +6 -2
  162. package/lib/components/molecules/SwitchCard/SwitchCard.js +6 -13
  163. package/lib/components/molecules/SwitchCard/SwitchCard.js.map +1 -1
  164. package/lib/components/molecules/TextUnit/TextUnit.js +3 -3
  165. package/lib/components/molecules/TextUnit/TextUnit.js.map +1 -1
  166. package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js +34 -34
  167. package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js.map +1 -1
  168. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.d.ts +2 -1
  169. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js +24 -33
  170. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js.map +1 -1
  171. package/lib/components/molecules/index.d.ts +5 -0
  172. package/lib/components/molecules/index.js +5 -0
  173. package/lib/components/molecules/index.js.map +1 -1
  174. package/lib/components/organisms/ActionCard/ActionCard.js +4 -5
  175. package/lib/components/organisms/ActionCard/ActionCard.js.map +1 -1
  176. package/lib/components/organisms/ActionSheet/ActionSheet.d.ts +2 -1
  177. package/lib/components/organisms/ActionSheet/ActionSheet.js +18 -8
  178. package/lib/components/organisms/ActionSheet/ActionSheet.js.map +1 -1
  179. package/lib/components/organisms/AgendaView/AgendaDayCell.d.ts +13 -0
  180. package/lib/components/organisms/AgendaView/AgendaDayCell.js +71 -0
  181. package/lib/components/organisms/AgendaView/AgendaDayCell.js.map +1 -0
  182. package/lib/components/organisms/AgendaView/AgendaDayRow.d.ts +14 -0
  183. package/lib/components/organisms/AgendaView/AgendaDayRow.js +65 -0
  184. package/lib/components/organisms/AgendaView/AgendaDayRow.js.map +1 -0
  185. package/lib/components/organisms/AgendaView/AgendaHeader.d.ts +12 -0
  186. package/lib/components/organisms/AgendaView/AgendaHeader.js +44 -0
  187. package/lib/components/organisms/AgendaView/AgendaHeader.js.map +1 -0
  188. package/lib/components/organisms/AgendaView/AgendaItemRow.d.ts +8 -0
  189. package/lib/components/organisms/AgendaView/AgendaItemRow.js +58 -0
  190. package/lib/components/organisms/AgendaView/AgendaItemRow.js.map +1 -0
  191. package/lib/components/organisms/AgendaView/AgendaMonth.d.ts +16 -0
  192. package/lib/components/organisms/AgendaView/AgendaMonth.js +26 -0
  193. package/lib/components/organisms/AgendaView/AgendaMonth.js.map +1 -0
  194. package/lib/components/organisms/AgendaView/AgendaMonthSeparator.d.ts +7 -0
  195. package/lib/components/organisms/AgendaView/AgendaMonthSeparator.js +41 -0
  196. package/lib/components/organisms/AgendaView/AgendaMonthSeparator.js.map +1 -0
  197. package/lib/components/organisms/AgendaView/AgendaView.d.ts +24 -0
  198. package/lib/components/organisms/AgendaView/AgendaView.js +134 -0
  199. package/lib/components/organisms/AgendaView/AgendaView.js.map +1 -0
  200. package/lib/components/organisms/AgendaView/MonthList.d.ts +16 -0
  201. package/lib/components/organisms/AgendaView/MonthList.js +64 -0
  202. package/lib/components/organisms/AgendaView/MonthList.js.map +1 -0
  203. package/lib/components/organisms/AgendaView/MonthPanel.d.ts +17 -0
  204. package/lib/components/organisms/AgendaView/MonthPanel.js +108 -0
  205. package/lib/components/organisms/AgendaView/MonthPanel.js.map +1 -0
  206. package/lib/components/organisms/AgendaView/agenda-view.helpers.d.ts +6 -0
  207. package/lib/components/organisms/AgendaView/agenda-view.helpers.js +53 -0
  208. package/lib/components/organisms/AgendaView/agenda-view.helpers.js.map +1 -0
  209. package/lib/components/organisms/AgendaView/index.d.ts +3 -0
  210. package/lib/components/organisms/AgendaView/index.js +20 -0
  211. package/lib/components/organisms/AgendaView/index.js.map +1 -0
  212. package/lib/components/organisms/AgendaView/types.d.ts +12 -0
  213. package/lib/components/organisms/AgendaView/types.js +19 -0
  214. package/lib/components/organisms/AgendaView/types.js.map +1 -0
  215. package/lib/components/organisms/AgendaView/use-month-panel-drag.d.ts +13 -0
  216. package/lib/components/organisms/AgendaView/use-month-panel-drag.js +77 -0
  217. package/lib/components/organisms/AgendaView/use-month-panel-drag.js.map +1 -0
  218. package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js +5 -5
  219. package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js.map +1 -1
  220. package/lib/components/organisms/AutoCompleteSearch/ItemCard.d.ts +2 -2
  221. package/lib/components/organisms/AutoCompleteSearch/ItemCard.js +13 -20
  222. package/lib/components/organisms/AutoCompleteSearch/ItemCard.js.map +1 -1
  223. package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js +8 -9
  224. package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js.map +1 -1
  225. package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.d.ts +12 -0
  226. package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.js +60 -0
  227. package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.js.map +1 -0
  228. package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.d.ts +28 -0
  229. package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.js +140 -0
  230. package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.js.map +1 -0
  231. package/lib/components/organisms/CalendarRangePicker/DayCell.d.ts +17 -0
  232. package/lib/components/organisms/CalendarRangePicker/DayCell.js +131 -0
  233. package/lib/components/organisms/CalendarRangePicker/DayCell.js.map +1 -0
  234. package/lib/components/organisms/CalendarRangePicker/RangeMonth.d.ts +18 -0
  235. package/lib/components/organisms/CalendarRangePicker/RangeMonth.js +35 -0
  236. package/lib/components/organisms/CalendarRangePicker/RangeMonth.js.map +1 -0
  237. package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.d.ts +12 -0
  238. package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.js +68 -0
  239. package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.js.map +1 -0
  240. package/lib/components/organisms/CalendarRangePicker/index.d.ts +2 -0
  241. package/lib/components/organisms/CalendarRangePicker/index.js +19 -0
  242. package/lib/components/organisms/CalendarRangePicker/index.js.map +1 -0
  243. package/lib/components/organisms/CalendarRangePicker/types.d.ts +11 -0
  244. package/lib/components/organisms/CalendarRangePicker/types.js +19 -0
  245. package/lib/components/organisms/CalendarRangePicker/types.js.map +1 -0
  246. package/lib/components/organisms/ChipSelect/ChipSelect.js +24 -21
  247. package/lib/components/organisms/ChipSelect/ChipSelect.js.map +1 -1
  248. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.d.ts +2 -0
  249. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js +2 -2
  250. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js.map +1 -1
  251. package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.d.ts +3 -2
  252. package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.js +36 -34
  253. package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.js.map +1 -1
  254. package/lib/components/organisms/FloatingButton/FloatingActionButton.d.ts +2 -2
  255. package/lib/components/organisms/FloatingButton/FloatingActionButton.js +2 -1
  256. package/lib/components/organisms/FloatingButton/FloatingActionButton.js.map +1 -1
  257. package/lib/components/organisms/GanttView/GanttView.d.ts +36 -0
  258. package/lib/components/organisms/GanttView/GanttView.js +267 -0
  259. package/lib/components/organisms/GanttView/GanttView.js.map +1 -0
  260. package/lib/components/organisms/GanttView/body/GanttBar.d.ts +12 -0
  261. package/lib/components/organisms/GanttView/body/GanttBar.js +52 -0
  262. package/lib/components/organisms/GanttView/body/GanttBar.js.map +1 -0
  263. package/lib/components/organisms/GanttView/body/GanttCellStrip.d.ts +10 -0
  264. package/lib/components/organisms/GanttView/body/GanttCellStrip.js +55 -0
  265. package/lib/components/organisms/GanttView/body/GanttCellStrip.js.map +1 -0
  266. package/lib/components/organisms/GanttView/body/GanttGridLines.d.ts +9 -0
  267. package/lib/components/organisms/GanttView/body/GanttGridLines.js +45 -0
  268. package/lib/components/organisms/GanttView/body/GanttGridLines.js.map +1 -0
  269. package/lib/components/organisms/GanttView/body/GanttGroupHeader.d.ts +9 -0
  270. package/lib/components/organisms/GanttView/body/GanttGroupHeader.js +61 -0
  271. package/lib/components/organisms/GanttView/body/GanttGroupHeader.js.map +1 -0
  272. package/lib/components/organisms/GanttView/body/GanttGroupLane.d.ts +10 -0
  273. package/lib/components/organisms/GanttView/body/GanttGroupLane.js +43 -0
  274. package/lib/components/organisms/GanttView/body/GanttGroupLane.js.map +1 -0
  275. package/lib/components/organisms/GanttView/body/GanttRowLane.d.ts +13 -0
  276. package/lib/components/organisms/GanttView/body/GanttRowLane.js +53 -0
  277. package/lib/components/organisms/GanttView/body/GanttRowLane.js.map +1 -0
  278. package/lib/components/organisms/GanttView/body/GanttRowName.d.ts +9 -0
  279. package/lib/components/organisms/GanttView/body/GanttRowName.js +51 -0
  280. package/lib/components/organisms/GanttView/body/GanttRowName.js.map +1 -0
  281. package/lib/components/organisms/GanttView/body/index.d.ts +6 -0
  282. package/lib/components/organisms/GanttView/body/index.js +24 -0
  283. package/lib/components/organisms/GanttView/body/index.js.map +1 -0
  284. package/lib/components/organisms/GanttView/gantt-view.helpers.d.ts +19 -0
  285. package/lib/components/organisms/GanttView/gantt-view.helpers.js +219 -0
  286. package/lib/components/organisms/GanttView/gantt-view.helpers.js.map +1 -0
  287. package/lib/components/organisms/GanttView/gantt-view.styles.d.ts +124 -0
  288. package/lib/components/organisms/GanttView/gantt-view.styles.js +148 -0
  289. package/lib/components/organisms/GanttView/gantt-view.styles.js.map +1 -0
  290. package/lib/components/organisms/GanttView/header/GanttControls.d.ts +13 -0
  291. package/lib/components/organisms/GanttView/header/GanttControls.js +53 -0
  292. package/lib/components/organisms/GanttView/header/GanttControls.js.map +1 -0
  293. package/lib/components/organisms/GanttView/header/GanttHeader.d.ts +24 -0
  294. package/lib/components/organisms/GanttView/header/GanttHeader.js +75 -0
  295. package/lib/components/organisms/GanttView/header/GanttHeader.js.map +1 -0
  296. package/lib/components/organisms/GanttView/header/index.d.ts +1 -0
  297. package/lib/components/organisms/GanttView/header/index.js +19 -0
  298. package/lib/components/organisms/GanttView/header/index.js.map +1 -0
  299. package/lib/components/organisms/GanttView/index.d.ts +4 -0
  300. package/lib/components/organisms/GanttView/index.js +21 -0
  301. package/lib/components/organisms/GanttView/index.js.map +1 -0
  302. package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.d.ts +10 -0
  303. package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.js +67 -0
  304. package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.js.map +1 -0
  305. package/lib/components/organisms/GanttView/scale/GanttScaleHeader.d.ts +15 -0
  306. package/lib/components/organisms/GanttView/scale/GanttScaleHeader.js +46 -0
  307. package/lib/components/organisms/GanttView/scale/GanttScaleHeader.js.map +1 -0
  308. package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.d.ts +8 -0
  309. package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.js +69 -0
  310. package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.js.map +1 -0
  311. package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.d.ts +6 -0
  312. package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.js +53 -0
  313. package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.js.map +1 -0
  314. package/lib/components/organisms/GanttView/scale/index.d.ts +1 -0
  315. package/lib/components/organisms/GanttView/scale/index.js +19 -0
  316. package/lib/components/organisms/GanttView/scale/index.js.map +1 -0
  317. package/lib/components/organisms/GanttView/types.d.ts +87 -0
  318. package/lib/components/organisms/GanttView/types.js +19 -0
  319. package/lib/components/organisms/GanttView/types.js.map +1 -0
  320. package/lib/components/organisms/GanttView/use-default-zoom.d.ts +2 -0
  321. package/lib/components/organisms/GanttView/use-default-zoom.js +23 -0
  322. package/lib/components/organisms/GanttView/use-default-zoom.js.map +1 -0
  323. package/lib/components/organisms/GroupByScrollList/GroupByScrollList.js +6 -2
  324. package/lib/components/organisms/GroupByScrollList/GroupByScrollList.js.map +1 -1
  325. package/lib/components/organisms/HeaderContainer/HeaderContainer.js +21 -17
  326. package/lib/components/organisms/HeaderContainer/HeaderContainer.js.map +1 -1
  327. package/lib/components/organisms/ImageBubble/ImageBubble.d.ts +1 -1
  328. package/lib/components/organisms/ImageBubble/ImageBubble.js +4 -7
  329. package/lib/components/organisms/ImageBubble/ImageBubble.js.map +1 -1
  330. package/lib/components/organisms/InfoBubble/InfoBubble.js +1 -1
  331. package/lib/components/organisms/InfoBubble/InfoBubble.js.map +1 -1
  332. package/lib/components/organisms/InfoButton/InfoButton.d.ts +1 -1
  333. package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js +6 -10
  334. package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js.map +1 -1
  335. package/lib/components/organisms/Picker/Picker.d.ts +2 -1
  336. package/lib/components/organisms/Picker/Picker.js +25 -29
  337. package/lib/components/organisms/Picker/Picker.js.map +1 -1
  338. package/lib/components/organisms/ProgressBar/ProgressBar.d.ts +1 -1
  339. package/lib/components/organisms/ProgressBar/ProgressBar.js +11 -16
  340. package/lib/components/organisms/ProgressBar/ProgressBar.js.map +1 -1
  341. package/lib/components/organisms/QuantityCard/QuantityCard.d.ts +3 -2
  342. package/lib/components/organisms/QuantityCard/QuantityCard.js +47 -56
  343. package/lib/components/organisms/QuantityCard/QuantityCard.js.map +1 -1
  344. package/lib/components/organisms/ScrollList/DottedButton.js +10 -18
  345. package/lib/components/organisms/ScrollList/DottedButton.js.map +1 -1
  346. package/lib/components/organisms/ScrollList/ScrollList.js +9 -7
  347. package/lib/components/organisms/ScrollList/ScrollList.js.map +1 -1
  348. package/lib/components/organisms/ScrollList/TopActions.js +5 -3
  349. package/lib/components/organisms/ScrollList/TopActions.js.map +1 -1
  350. package/lib/components/organisms/SearchBar/SearchBar.d.ts +3 -3
  351. package/lib/components/organisms/SearchBar/SearchBar.js +15 -32
  352. package/lib/components/organisms/SearchBar/SearchBar.js.map +1 -1
  353. package/lib/components/organisms/SingleSelectScrollList/SingleSelectScrollList.js +1 -1
  354. package/lib/components/organisms/ToggleButton/ToggleButton.js +2 -2
  355. package/lib/components/organisms/ToggleButton/ToggleButton.js.map +1 -1
  356. package/lib/components/organisms/ViewAllEditList/AllLinesAlert.js +14 -16
  357. package/lib/components/organisms/ViewAllEditList/AllLinesAlert.js.map +1 -1
  358. package/lib/components/organisms/ViewAllEditList/LineComponent.js +6 -8
  359. package/lib/components/organisms/ViewAllEditList/LineComponent.js.map +1 -1
  360. package/lib/components/organisms/ViewAllEditList/ViewAllEditList.d.ts +3 -2
  361. package/lib/components/organisms/ViewAllEditList/ViewAllEditList.js +5 -9
  362. package/lib/components/organisms/ViewAllEditList/ViewAllEditList.js.map +1 -1
  363. package/lib/components/organisms/WeekDayPicker/DayGauge.d.ts +18 -0
  364. package/lib/components/organisms/WeekDayPicker/DayGauge.js +112 -0
  365. package/lib/components/organisms/WeekDayPicker/DayGauge.js.map +1 -0
  366. package/lib/components/organisms/WeekDayPicker/WeekDayPicker.d.ts +18 -0
  367. package/lib/components/organisms/WeekDayPicker/WeekDayPicker.js +118 -0
  368. package/lib/components/organisms/WeekDayPicker/WeekDayPicker.js.map +1 -0
  369. package/lib/components/organisms/WeekDayPicker/WeekRow.d.ts +15 -0
  370. package/lib/components/organisms/WeekDayPicker/WeekRow.js +39 -0
  371. package/lib/components/organisms/WeekDayPicker/WeekRow.js.map +1 -0
  372. package/lib/components/organisms/WeekDayPicker/index.d.ts +3 -0
  373. package/lib/components/organisms/WeekDayPicker/index.js +20 -0
  374. package/lib/components/organisms/WeekDayPicker/index.js.map +1 -0
  375. package/lib/components/organisms/WeekDayPicker/types.d.ts +17 -0
  376. package/lib/components/organisms/WeekDayPicker/types.js +19 -0
  377. package/lib/components/organisms/WeekDayPicker/types.js.map +1 -0
  378. package/lib/components/organisms/WeekDayPicker/week-day.helpers.d.ts +9 -0
  379. package/lib/components/organisms/WeekDayPicker/week-day.helpers.js +83 -0
  380. package/lib/components/organisms/WeekDayPicker/week-day.helpers.js.map +1 -0
  381. package/lib/components/organisms/index.d.ts +4 -0
  382. package/lib/components/organisms/index.js +4 -0
  383. package/lib/components/organisms/index.js.map +1 -1
  384. package/lib/components/templates/BottomBar/BottomBar.js +81 -22
  385. package/lib/components/templates/BottomBar/BottomBar.js.map +1 -1
  386. package/lib/components/templates/BottomBar/ItemTitle.d.ts +1 -1
  387. package/lib/components/templates/BottomBar/ItemTitle.js +1 -2
  388. package/lib/components/templates/BottomBar/ItemTitle.js.map +1 -1
  389. package/lib/components/templates/Dashboard/Chart/BarChart.js +3 -3
  390. package/lib/components/templates/Dashboard/Chart/BarChart.js.map +1 -1
  391. package/lib/components/templates/Dashboard/Chart/IndicatorChart/IndicatorItem.js +1 -1
  392. package/lib/components/templates/Dashboard/Chart/IndicatorChart/IndicatorItem.js.map +1 -1
  393. package/lib/components/templates/Dashboard/Chart/IndicatorChart/SimpleIndicator.js +24 -20
  394. package/lib/components/templates/Dashboard/Chart/IndicatorChart/SimpleIndicator.js.map +1 -1
  395. package/lib/components/templates/ObjectCard/ObjectCard.d.ts +3 -2
  396. package/lib/components/templates/ObjectCard/ObjectCard.js +46 -32
  397. package/lib/components/templates/ObjectCard/ObjectCard.js.map +1 -1
  398. package/lib/components/templates/TabsScreen/Tab.js +1 -1
  399. package/lib/components/templates/TabsScreen/Tab.js.map +1 -1
  400. package/lib/hooks/index.d.ts +1 -0
  401. package/lib/hooks/index.js +1 -0
  402. package/lib/hooks/index.js.map +1 -1
  403. package/lib/hooks/use-click-outside.js +2 -2
  404. package/lib/hooks/use-click-outside.js.map +1 -1
  405. package/lib/hooks/use-orientation.d.ts +1 -0
  406. package/lib/hooks/use-orientation.js +23 -0
  407. package/lib/hooks/use-orientation.js.map +1 -0
  408. package/lib/theme/color/ThemeContext.js +1 -1
  409. package/lib/theme/color/ThemeContext.js.map +1 -1
  410. package/lib/theme/color/color.defaults.js +22 -22
  411. package/lib/theme/color/content.helpers.d.ts +2 -1
  412. package/lib/theme/color/content.helpers.js +47 -45
  413. package/lib/theme/color/content.helpers.js.map +1 -1
  414. package/lib/theme/color/themes.js +83 -80
  415. package/lib/theme/color/themes.js.map +1 -1
  416. package/lib/theme/color/types.d.ts +1 -0
  417. package/lib/theme/writing/writingTheme.js +5 -5
  418. package/lib/tools/AnimationUtil.d.ts +18 -3
  419. package/lib/utils/calendar.d.ts +42 -0
  420. package/lib/utils/calendar.js +64 -0
  421. package/lib/utils/calendar.js.map +1 -0
  422. package/lib/utils/commons-styles.d.ts +8 -20
  423. package/lib/utils/commons-styles.js +14 -22
  424. package/lib/utils/commons-styles.js.map +1 -1
  425. package/lib/utils/commons-utlis.d.ts +1 -0
  426. package/lib/utils/commons-utlis.js +7 -0
  427. package/lib/utils/commons-utlis.js.map +1 -1
  428. package/lib/utils/dates.d.ts +30 -0
  429. package/lib/utils/dates.js +142 -0
  430. package/lib/utils/dates.js.map +1 -0
  431. package/lib/utils/index.d.ts +10 -8
  432. package/lib/utils/index.js +4 -2
  433. package/lib/utils/index.js.map +1 -1
  434. package/package.json +14 -14
@@ -0,0 +1,131 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2026 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { memo, useCallback, useMemo } from 'react';
19
+ import { Pressable, StyleSheet, View } from 'react-native';
20
+ import { useThemeColor } from '../../../theme';
21
+ import { DAY_ROW_HEIGHT, dayCellStyles, getTodayOutlineStyle, } from '../../../utils';
22
+ import { Text } from '../../atoms';
23
+ const DayCell = ({ dateString, dayNumber, isWeekEnd, isSelected, isToday, isDisabled, hasEvents, morningColor, afternoonColor, disabledColor, onPress, }) => {
24
+ const Colors = useThemeColor();
25
+ const handlePress = useCallback(() => onPress(dateString), [dateString, onPress]);
26
+ const { baseStyle, overlayStyle } = useMemo(() => {
27
+ if (morningColor == null && afternoonColor == null)
28
+ return { baseStyle: null, overlayStyle: null };
29
+ if (afternoonColor == null)
30
+ return {
31
+ baseStyle: {
32
+ backgroundColor: morningColor.background_light,
33
+ right: '50%',
34
+ },
35
+ overlayStyle: null,
36
+ };
37
+ if (morningColor == null)
38
+ return {
39
+ baseStyle: {
40
+ backgroundColor: afternoonColor.background_light,
41
+ left: '50%',
42
+ },
43
+ overlayStyle: null,
44
+ };
45
+ return {
46
+ baseStyle: { backgroundColor: morningColor.background_light },
47
+ overlayStyle: morningColor === afternoonColor
48
+ ? null
49
+ : { backgroundColor: afternoonColor.background_light },
50
+ };
51
+ }, [afternoonColor, morningColor]);
52
+ const selectionStyle = useMemo(() => ({
53
+ backgroundColor: baseStyle == null
54
+ ? Colors.primaryColor.background_light
55
+ : 'transparent',
56
+ borderColor: Colors.primaryColor.background,
57
+ }), [Colors.primaryColor, baseStyle]);
58
+ const todayStyle = useMemo(() => getTodayOutlineStyle(Colors.secondaryColor.background), [Colors.secondaryColor.background]);
59
+ const disabledStyle = useMemo(() => ({
60
+ backgroundColor: disabledColor.background_light,
61
+ borderColor: disabledColor.background,
62
+ }), [disabledColor]);
63
+ const textColor = useMemo(() => {
64
+ if (isDisabled)
65
+ return disabledColor.background;
66
+ if (isWeekEnd)
67
+ return Colors.secondaryColor_dark.background;
68
+ const markColor = morningColor ?? afternoonColor;
69
+ if (markColor != null)
70
+ return markColor.background;
71
+ if (isSelected)
72
+ return Colors.primaryColor.background;
73
+ return Colors.text;
74
+ }, [
75
+ morningColor,
76
+ afternoonColor,
77
+ isSelected,
78
+ Colors,
79
+ isDisabled,
80
+ disabledColor.background,
81
+ isWeekEnd,
82
+ ]);
83
+ return (<Pressable style={dayCellStyles.container} onPress={handlePress} disabled={isDisabled && !hasEvents} testID={`calendarDay-${dateString}`}>
84
+ {baseStyle != null && (<View style={dayCellStyles.fillContainer} pointerEvents="none">
85
+ <View style={[styles.markBase, baseStyle]}/>
86
+ {overlayStyle != null && (<View style={[styles.markOverlay, overlayStyle]}/>)}
87
+ </View>)}
88
+ {isDisabled && (<View style={styles.badgeContainer} pointerEvents="none">
89
+ <View style={[styles.badge, disabledStyle]}/>
90
+ </View>)}
91
+ {isSelected && (<View style={[dayCellStyles.outline, selectionStyle]} pointerEvents="none" testID={`calendarDaySelected-${dateString}`}/>)}
92
+ {isToday && !isSelected && (<View style={[dayCellStyles.outline, todayStyle]} pointerEvents="none"/>)}
93
+ <Text style={dayCellStyles.text} textColor={textColor} writingType={isSelected || isToday ? 'important' : undefined} fontSize={12}>
94
+ {dayNumber}
95
+ </Text>
96
+ </Pressable>);
97
+ };
98
+ const BADGE_SIZE = DAY_ROW_HEIGHT - 16;
99
+ const styles = StyleSheet.create({
100
+ badgeContainer: {
101
+ position: 'absolute',
102
+ top: 0,
103
+ bottom: 0,
104
+ left: 0,
105
+ right: 0,
106
+ alignItems: 'center',
107
+ justifyContent: 'center',
108
+ },
109
+ badge: {
110
+ width: BADGE_SIZE,
111
+ height: BADGE_SIZE,
112
+ borderRadius: BADGE_SIZE / 2,
113
+ borderWidth: 1,
114
+ },
115
+ markBase: {
116
+ position: 'absolute',
117
+ top: 0,
118
+ bottom: 0,
119
+ left: 0,
120
+ right: 0,
121
+ },
122
+ markOverlay: {
123
+ position: 'absolute',
124
+ top: 0,
125
+ bottom: 0,
126
+ left: '50%',
127
+ right: 0,
128
+ },
129
+ });
130
+ export default memo(DayCell);
131
+ //# sourceMappingURL=DayCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayCell.js","sourceRoot":"","sources":["../../../../src/components/organisms/CalendarRangePicker/DayCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAY,MAAM,cAAc,CAAC;AACpE,OAAO,EAAQ,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAgBjC,MAAM,OAAO,GAAG,CAAC,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,OAAO,GACM,EAAE,EAAE;IACjB,MAAM,MAAM,GAAG,aAAa,EAAE,C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;AAEF,MAAM,UAAU,GAAG,cAAc,GAAG,EAAE,CAAC;AAEvC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,UAAU,GAAG,CAAC;QAC5B,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;KACT;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,CAAC;KACT;CACF,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { CalendarMonth } from '../../../utils';
3
+ import { Color } from '../../../theme';
4
+ import { DayMark } from './types';
5
+ interface RangeMonthProps {
6
+ month: CalendarMonth;
7
+ marks: Record<string, DayMark>;
8
+ disabledDates: Record<string, Color>;
9
+ selectionStart?: string;
10
+ selectionEnd?: string;
11
+ todayDateString: string;
12
+ firstDayOfWeek: number;
13
+ disabledColor: Color;
14
+ translator: (key: string) => string;
15
+ onDayPress: (dateString: string) => void;
16
+ }
17
+ declare const _default: React.MemoExoticComponent<({ month, marks, disabledDates, selectionStart, selectionEnd, todayDateString, firstDayOfWeek, disabledColor, translator, onDayPress, }: RangeMonthProps) => React.JSX.Element>;
18
+ export default _default;
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2026 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { memo, useCallback } from 'react';
19
+ import { CalendarMonthGrid } from '../../molecules';
20
+ import DayCell from './DayCell';
21
+ import { hasEvents, isInRange } from './calendar-range.helpers';
22
+ const RangeMonth = ({ month, marks, disabledDates, selectionStart, selectionEnd, todayDateString, firstDayOfWeek, disabledColor, translator, onDayPress, }) => {
23
+ const renderDay = useCallback((day) => (<DayCell dateString={day.dateString} dayNumber={day.dayNumber} isWeekEnd={day.isWeekEnd} isSelected={isInRange(day.dateString, selectionStart, selectionEnd)} isToday={day.dateString === todayDateString} isDisabled={disabledDates[day.dateString] != null} hasEvents={hasEvents(marks[day.dateString])} disabledColor={disabledDates[day.dateString] ?? disabledColor} morningColor={marks[day.dateString]?.morningColor} afternoonColor={marks[day.dateString]?.afternoonColor} onPress={onDayPress}/>), [
24
+ disabledColor,
25
+ disabledDates,
26
+ marks,
27
+ onDayPress,
28
+ selectionEnd,
29
+ selectionStart,
30
+ todayDateString,
31
+ ]);
32
+ return (<CalendarMonthGrid month={month} firstDayOfWeek={firstDayOfWeek} renderDay={renderDay} translator={translator}/>);
33
+ };
34
+ export default memo(RangeMonth);
35
+ //# sourceMappingURL=RangeMonth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeMonth.js","sourceRoot":"","sources":["../../../../src/components/organisms/CalendarRangePicker/RangeMonth.tsx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CAAC,UAAU,CAAC,EACpB,CACH,EACD;QACE,aAAa;QACb,aAAa;QACb,KAAK;QACL,UAAU;QACV,YAAY;QACZ,cAAc;QACd,eAAe;KAChB,CACF,CAAC;IAEF,OAAO,CACL,CAAC,iBAAiB,CAChB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Color } from '../../../theme';
2
+ import { CalendarMonth } from '../../../utils';
3
+ import { DateRange, DayMark } from './types';
4
+ export declare const isDayFull: (mark?: DayMark) => boolean;
5
+ export declare const hasEvents: (mark?: DayMark) => boolean;
6
+ export declare const normalizeRange: (first: string, second: string) => DateRange;
7
+ export declare const isInRange: (dateString: string, startDate?: string, endDate?: string) => boolean;
8
+ export declare const applyDayPress: (dateString: string, selection: DateRange) => DateRange;
9
+ export declare const clampRange: (range: DateRange, isBlocked: (dateString: string) => boolean) => DateRange;
10
+ export declare const sliceMarksByMonth: (marks: Record<string, DayMark>, months: CalendarMonth[]) => Record<string, Record<string, DayMark>>;
11
+ export declare const sliceDisabledByMonth: (disabledDates: Record<string, Color>, months: CalendarMonth[]) => Record<string, Record<string, Color>>;
12
+ export declare const getMonthSelection: (month: CalendarMonth, selection: DateRange) => DateRange;
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2026 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { fromDateString, sliceByMonth, toDateString, } from '../../../utils';
19
+ export const isDayFull = (mark) => mark?.fullDay ?? (mark?.morningColor != null && mark?.afternoonColor != null);
20
+ export const hasEvents = (mark) => Array.isArray(mark?.events) && mark.events.length > 0;
21
+ export const normalizeRange = (first, second) => first <= second
22
+ ? { startDate: first, endDate: second }
23
+ : { startDate: second, endDate: first };
24
+ export const isInRange = (dateString, startDate, endDate) => {
25
+ if (startDate == null)
26
+ return false;
27
+ if (endDate == null)
28
+ return dateString === startDate;
29
+ return dateString >= startDate && dateString <= endDate;
30
+ };
31
+ export const applyDayPress = (dateString, selection) => {
32
+ const { startDate, endDate } = selection;
33
+ if (startDate == null || endDate != null)
34
+ return { startDate: dateString, endDate: undefined };
35
+ return normalizeRange(startDate, dateString);
36
+ };
37
+ export const clampRange = (range, isBlocked) => {
38
+ const { startDate, endDate } = range;
39
+ if (startDate == null || endDate == null || startDate === endDate)
40
+ return range;
41
+ const lastDate = fromDateString(endDate);
42
+ const currentDate = fromDateString(startDate);
43
+ let lastAvailable = startDate;
44
+ while (currentDate <= lastDate) {
45
+ const dateString = toDateString(currentDate);
46
+ if (isBlocked(dateString))
47
+ return { startDate, endDate: lastAvailable };
48
+ lastAvailable = dateString;
49
+ currentDate.setDate(currentDate.getDate() + 1);
50
+ }
51
+ return range;
52
+ };
53
+ const EMPTY_MARKS = Object.freeze({});
54
+ const EMPTY_DISABLED = Object.freeze({});
55
+ export const sliceMarksByMonth = (marks, months) => sliceByMonth(marks, months, EMPTY_MARKS);
56
+ export const sliceDisabledByMonth = (disabledDates, months) => sliceByMonth(disabledDates, months, EMPTY_DISABLED);
57
+ export const getMonthSelection = (month, selection) => {
58
+ const { startDate, endDate } = selection;
59
+ if (startDate == null)
60
+ return { startDate: undefined, endDate: undefined };
61
+ const monthStart = `${month.monthKey}-01`;
62
+ const monthEnd = `${month.monthKey}-31`;
63
+ const rangeEnd = endDate ?? startDate;
64
+ if (startDate > monthEnd || rangeEnd < monthStart)
65
+ return { startDate: undefined, endDate: undefined };
66
+ return { startDate, endDate };
67
+ };
68
+ //# sourceMappingURL=calendar-range.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-range.helpers.js","sourceRoot":"","sources":["../../../../src/components/organisms/CalendarRangePicker/calendar-range.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAc,EAAW,EAAE,CACnD,IAAI,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE,YAAY,IAAI,IAAI,IAAI,IAAI,EAAE,cAAc,IAAI,IAAI,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAc,EAAW,EAAE,CACnD,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,MAAc,EAAa,EAAE,CACzE,KAAK,IAAI,MAAM;IACb,CAAC,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAC;IACrC,CAAC,CAAC,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,UAAkB,EAClB,SAAkB,EAClB,OAAgB,EACP,EAAE;IACX,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,OAAO,IAAI,IAAI;QAAE,OAAO,UAAU,KAAK,SAAS,CAAC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/D,MAAM,cAAc,GAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAA8B,EAC9B,MAAuB,EACkB,EAAE,CAC3C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,aAAoC,EACpC,MAAuB,EACgB,EAAE,CACzC,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAoB,EACpB,SAAoB,EACT,EAAE;IACb,MAAM,EAAC,SAAS,EAAE,OAAO,EAAC,GAAG,SAAS,CAAC;IAEvC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,GAAG,KAAK,CAAC,QAAQ,KAAK,CAAC;IAC1C,MAAM,QAAQ,GAAG,GAAG,KAAK,CAAC,QAAQ,KAAK,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,IAAI,SAAS,CAAC;IAEtC,IAAI,SAAS,GAAG,QAAQ,IAAI,QAAQ,GAAG,UAAU;QAC/C,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,CAAC;IAEpD,OAAO,EAAC,SAAS,EAAE,OAAO,EAAC,CAAC;AAC9B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as CalendarRangePicker } from './CalendarRangePicker';
2
+ export { DateRange, DayMark } from './types';
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2026 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { default as CalendarRangePicker } from './CalendarRangePicker';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/organisms/CalendarRangePicker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Color } from '../../../theme';
2
+ export interface DayMark {
3
+ morningColor?: Color;
4
+ afternoonColor?: Color;
5
+ events?: any[];
6
+ fullDay?: boolean;
7
+ }
8
+ export interface DateRange {
9
+ startDate?: string;
10
+ endDate?: string;
11
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2026 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/organisms/CalendarRangePicker/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -15,10 +15,10 @@
15
15
  * You should have received a copy of the GNU Affero General Public License
16
16
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
- import React, { useEffect, useMemo, useState } from 'react';
19
- import { Dimensions, StyleSheet, View, ScrollView } from 'react-native';
18
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
19
+ import { ScrollView, StyleSheet, View } from 'react-native';
20
20
  import { useThemeColor } from '../../../theme';
21
- import { Button, Chip } from '../../molecules';
21
+ import { Chip, IconTile } from '../../molecules';
22
22
  const CHIP_CONTAINER_MARGIN = 16;
23
23
  const CHIP_MARGIN = 2;
24
24
  const MODES = {
@@ -27,7 +27,11 @@ const MODES = {
27
27
  };
28
28
  const ChipSelect = ({ style, selectionItems, mode, isRefresh = false, width, marginHorizontal = CHIP_MARGIN, readonly = false, chipNumberOfLines, onChangeValue = () => { }, showClearButton = false, }) => {
29
29
  const Colors = useThemeColor();
30
+ const [containerWidth, setContainerWidth] = useState();
30
31
  const [selectedChip, setSelectedChip] = useState(selectionItems.filter(item => item.isActive === true));
32
+ const handleLayout = useCallback((event) => {
33
+ setContainerWidth(event.nativeEvent.layout.width);
34
+ }, []);
31
35
  useEffect(() => {
32
36
  if (isRefresh &&
33
37
  selectionItems.every(el => Object.keys(el).includes('isActive'))) {
@@ -35,18 +39,17 @@ const ChipSelect = ({ style, selectionItems, mode, isRefresh = false, width, mar
35
39
  }
36
40
  }, [isRefresh, selectionItems]);
37
41
  const _width = useMemo(() => {
38
- if (width != null) {
42
+ if (width != null)
39
43
  return width;
40
- }
44
+ if (containerWidth == null)
45
+ return undefined;
41
46
  const numberItems = selectionItems.length;
42
47
  if (numberItems < 5) {
43
- return ((Dimensions.get('window').width -
44
- CHIP_CONTAINER_MARGIN * 2 -
45
- marginHorizontal * 2 * numberItems) *
48
+ return ((containerWidth - marginHorizontal * 2 * numberItems) *
46
49
  (1 / numberItems));
47
50
  }
48
51
  return null;
49
- }, [marginHorizontal, selectionItems, width]);
52
+ }, [containerWidth, marginHorizontal, selectionItems, width]);
50
53
  const updateChip = (chip) => {
51
54
  let updatedChip = [];
52
55
  if (mode === MODES.multi) {
@@ -68,23 +71,22 @@ const ChipSelect = ({ style, selectionItems, mode, isRefresh = false, width, mar
68
71
  const chipIsSelected = (chip) => {
69
72
  if (isRefresh &&
70
73
  selectionItems.every(el => Object.keys(el).includes('isActive'))) {
71
- return chip.isActive;
74
+ return chip.isActive ?? false;
72
75
  }
73
- return (selectedChip?.find(activeChip => activeChip.key === chip.key) != null);
76
+ return selectedChip?.find(_c => _c.key === chip.key) != null;
74
77
  };
75
- const clearAllChips = () => {
78
+ const clearAllChips = useCallback(() => {
76
79
  setSelectedChip([]);
77
80
  onChangeValue([]);
78
- };
81
+ }, [onChangeValue]);
79
82
  if (selectionItems.length < 2 ||
80
- (mode !== MODES.multi && mode !== MODES.switch)) {
83
+ (mode !== MODES.multi && mode !== MODES.switch))
81
84
  return null;
82
- }
83
- return (<View style={[styles.chipContainer, style]} testID="chipSelectContainer">
85
+ return (<View style={[styles.chipContainer, style]} onLayout={handleLayout} testID="chipSelectContainer">
84
86
  <ScrollView horizontal={true} showsHorizontalScrollIndicator={false} contentContainerStyle={styles.scrollContainer}>
85
- {showClearButton && (<Button testID="chipSelectClearButton" iconName="trash" color={selectedChip.length > 0
87
+ {showClearButton && (<IconTile testID="chipSelectClearButton" icon="trash" color={selectedChip.length > 0
86
88
  ? Colors.primaryColor
87
- : Colors.secondaryColor} onPress={clearAllChips} disabled={selectedChip.length === 0} iconSize={18} width={40} style={styles.clearButton}/>)}
89
+ : Colors.secondaryColor} onPress={clearAllChips} disabled={selectedChip.length === 0} iconSize={16} style={styles.clearButton}/>)}
88
90
  {selectionItems?.map((item, index) => (<Chip key={index} selected={chipIsSelected(item)} title={item.title} selectedColor={item.color} onPress={() => updateChip(item)} readonly={readonly} marginHorizontal={marginHorizontal} width={_width} numberOfLines={chipNumberOfLines}/>))}
89
91
  </ScrollView>
90
92
  </View>);
@@ -98,11 +100,12 @@ const styles = StyleSheet.create({
98
100
  marginVertical: 2,
99
101
  },
100
102
  scrollContainer: {
101
- alignItems: 'center',
103
+ alignItems: 'stretch',
104
+ flexGrow: 1,
102
105
  },
103
106
  clearButton: {
104
- marginRight: 5,
105
- height: 40,
107
+ marginRight: 2,
108
+ flexShrink: 0,
106
109
  },
107
110
  });
108
111
  export default ChipSelect;
@@ -1 +1 @@
1
- {"version":3,"file":"ChipSelect.js","sourceRoot":"","sources":["../../../../src/components/organisms/ChipSelect/ChipSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACtE,OAAO,EAAC,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAE7C,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACf,CAAC;AAsBF,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,cAAc,EACd,IAAI,EACJ,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,gBAAgB,GAAG,WAAW,EAC9B,QAAQ,GAAG,KAAK,EAChB,iBAAiB,EACjB,aAAa,GAAG,GAAG,EAAE,GAAE,CAAC,EACxB,eAAe,GAAG,KAAK,GACP,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,cAAc,CAAC,MAAM,CAAC,IA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X,QAAQ,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAC/B,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAC1B,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,KAAK,CAAC,CAAC,MAAM,CAAC,CACd,aAAa,CAAC,CAAC,iBAAiB,CAAC,EACjC,CACH,CAAC,CACJ;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,gBAAgB,EAAE,qBAAqB;QACvC,cAAc,EAAE,CAAC;KAClB;IACD,eAAe,EAAE;QACf,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,CAAC;KACZ;IACD,WAAW,EAAE;QACX,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { Color } from '../../../theme';
2
3
  interface DropdownCardSwitchProps {
3
4
  style?: any;
4
5
  styleTitle?: any;
@@ -11,6 +12,7 @@ interface DropdownItem {
11
12
  childrenComp: ReactNode;
12
13
  isDefaultVisible?: boolean;
13
14
  iconName?: string;
15
+ iconColor?: Color;
14
16
  style?: any;
15
17
  }
16
18
  declare const DropdownCardSwitch: ({ style, styleTitle, dropdownItems, multiSelection, }: DropdownCardSwitchProps) => React.JSX.Element;
@@ -31,7 +31,7 @@ const DropdownCardSwitch = ({ style, styleTitle, dropdownItems, multiSelection =
31
31
  useEffect(() => {
32
32
  setOpenedCardKeys(getDefaultVisibleItemsKeys());
33
33
  }, [getDefaultVisibleItemsKeys]);
34
- const handlePress = useCallback(key => {
34
+ const handlePress = useCallback((key) => {
35
35
  setOpenedCardKeys(current => {
36
36
  const _current = [...current];
37
37
  const cardKeyIdx = _current.indexOf(key);
@@ -49,7 +49,7 @@ const DropdownCardSwitch = ({ style, styleTitle, dropdownItems, multiSelection =
49
49
  }, [multiSelection]);
50
50
  return (<View style={[styles.container, style]} testID="dropdownCardSwitchContainer">
51
51
  {dropdownItems.map((elt, index) => {
52
- return (<DropdownCard key={index} title={elt.title} styleCard={elt.style} styleText={styleTitle} onPress={() => handlePress(elt.key)} dropdownIsOpen={openedCardKeys.includes(elt.key)} iconName={elt.iconName}>
52
+ return (<DropdownCard key={index} title={elt.title} style={elt.style} styleText={styleTitle} onPress={() => handlePress(elt.key)} dropdownIsOpen={openedCardKeys.includes(elt.key)} iconName={elt.iconName} iconColor={elt.iconColor}>
53
53
  {elt.childrenComp}
54
54
  </DropdownCard>);
55
55
  })}
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownCardSwitch.js","sourceRoot":"","sources":["../../../../src/components/organisms/DropdownCardSwitch/DropdownCardSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAY,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzE,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAiB7C,MAAM,kBAAkB,GAAG,CAAC,EAC1B,KAAK,EACL,UAAU,EACV,aAAa,EACb,cAAc,GAAG,KAAK,GACE,EAAE,EAAE;IAC5B,MAAM,0BAA0B,GAAG,WAAW,CAAC,GAAG,EAAE;QAClD,MAAM,mBAAmB,GAAG,aAAa,C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AAI,CACH,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACjC,MAAM,CAAC,6BAA6B,CACpC;MAAA,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAChC,OAAO,CACL,CAAC,YAAY,CACX,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CACjB,SAAS,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CACrB,SAAS,CAAC,CAAC,UAAU,CAAC,CACtB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CACpC,cAAc,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CACjD,QAAQ,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CACvB;YAAA,CAAC,GAAG,CAAC,YAAY,CACnB;UAAA,EAAE,YAAY,CAAC,CAChB,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"DropdownCardSwitch.js","sourceRoot":"","sources":["../../../../src/components/organisms/DropdownCardSwitch/DropdownCardSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAY,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzE,OAAO,EAAC,UAA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AAK,EAAE,MAAM;QACb,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -10,7 +10,8 @@ interface DropdownMenuItemProps {
10
10
  hideIf?: boolean;
11
11
  disableIf?: boolean;
12
12
  customComponent?: ReactElement<any>;
13
- onPress: (any: any) => void;
13
+ onPress: () => void;
14
+ iconTileConfig?: any;
14
15
  }
15
- declare const DropdownMenuItem: ({ style, styleText, numberOfLines, icon, color, placeholder, indicator, hideIf, disableIf, customComponent, onPress, }: DropdownMenuItemProps) => React.JSX.Element;
16
+ declare const DropdownMenuItem: ({ style, styleText, numberOfLines, icon, color, placeholder, indicator, hideIf, disableIf, customComponent, onPress, iconTileConfig, }: DropdownMenuItemProps) => React.JSX.Element;
16
17
  export default DropdownMenuItem;
@@ -16,58 +16,60 @@
16
16
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React, { useMemo } from 'react';
19
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
19
+ import { StyleSheet, TouchableOpacity } from 'react-native';
20
20
  import { useThemeColor } from '../../../theme';
21
- import { Icon, Text } from '../../atoms';
22
- import { Badge } from '../../molecules';
23
- const BADGE_SIZE = 12;
24
- const DropdownMenuItem = ({ style, styleText, numberOfLines = null, icon = 'paperclip', color, placeholder, indicator = 0, hideIf = false, disableIf = false, customComponent, onPress, }) => {
21
+ import { Text } from '../../atoms';
22
+ import { Badge, IconTile } from '../../molecules';
23
+ const BADGE_SIZE = 16;
24
+ const DropdownMenuItem = ({ style, styleText, numberOfLines, icon = 'paperclip', color, placeholder, indicator = 0, hideIf = false, disableIf = false, customComponent, onPress, iconTileConfig, }) => {
25
25
  const Colors = useThemeColor();
26
26
  const _color = useMemo(() => {
27
- if (color != null) {
28
- return color;
29
- }
30
- if (disableIf) {
31
- return Colors.secondaryColor.background;
32
- }
33
- return Colors.secondaryColor_dark.background;
27
+ if (color != null)
28
+ return {
29
+ background: color,
30
+ background_light: color,
31
+ foreground: Colors.text,
32
+ };
33
+ if (disableIf)
34
+ return Colors.secondaryColor;
35
+ return Colors.primaryColor;
34
36
  }, [Colors, color, disableIf]);
35
- if (hideIf) {
37
+ if (hideIf)
36
38
  return null;
37
- }
38
- return (<TouchableOpacity onPress={onPress} style={[styles.menuItem, style]} disabled={disableIf} testID="dropdownMenuItemTouchable">
39
- <View style={styles.iconContainer}>
40
- {customComponent != null ? (React.cloneElement(customComponent)) : (<Icon name={icon} color={_color} size={15}/>)}
41
- {indicator > 0 && (<Badge style={styles.badge} txtStyle={styles.badgeText} color={{
42
- background_light: Colors.backgroundColor,
43
- foreground: Colors.text,
44
- background: Colors.primaryColor.background,
45
- }} title={indicator}/>)}
46
- </View>
47
- <Text style={[styles.text, styleText]} numberOfLines={numberOfLines}>
39
+ return (<TouchableOpacity onPress={onPress} style={[styles.menuItem, style]} disabled={disableIf} activeOpacity={0.9} testID="dropdownMenuItemTouchable">
40
+ <IconTile icon={React.isValidElement(customComponent) ? undefined : icon} iconSize={18} color={_color} padding={10} borderRadius={10} {...(iconTileConfig ?? {})}>
41
+ {customComponent}
42
+ {indicator > 0 && (<Badge style={styles.badge} txtStyle={styles.badgeText} color={Colors.errorColor} title={indicator}/>)}
43
+ </IconTile>
44
+ <Text style={[styles.title, styleText]} numberOfLines={numberOfLines}>
48
45
  {placeholder}
49
46
  </Text>
50
47
  </TouchableOpacity>);
51
48
  };
52
49
  const styles = StyleSheet.create({
50
+ menuItem: {
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ padding: 5,
54
+ gap: 5,
55
+ },
53
56
  badge: {
54
57
  width: BADGE_SIZE,
55
58
  height: BADGE_SIZE,
56
59
  borderRadius: Math.ceil(BADGE_SIZE / 2),
57
60
  position: 'absolute',
58
- top: -4,
59
- right: -8,
61
+ top: -6,
62
+ right: -6,
60
63
  zIndex: 10,
64
+ paddingVertical: 0,
65
+ paddingHorizontal: 0,
61
66
  },
62
- badgeText: { fontSize: Math.ceil(BADGE_SIZE / 2) },
63
- menuItem: {
64
- flexDirection: 'row',
65
- alignItems: 'center',
66
- marginVertical: 5,
67
- padding: 5,
67
+ badgeText: {
68
+ fontSize: Math.ceil(BADGE_SIZE / 1.8),
69
+ },
70
+ title: {
71
+ flex: 1,
68
72
  },
69
- text: { fontSize: 18 },
70
- iconContainer: { marginRight: 10 },
71
73
  });
72
74
  export default DropdownMenuItem;
73
75
  //# sourceMappingURL=DropdownMenuItem.js.map