@axelor/aos-mobile-ui 9.1.12 → 9.2.1
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.
- package/lib/components/atoms/BorderBar/BorderBar.d.ts +9 -0
- package/lib/components/atoms/BorderBar/BorderBar.js +30 -0
- package/lib/components/atoms/BorderBar/BorderBar.js.map +1 -0
- package/lib/components/atoms/Card/Card.d.ts +2 -1
- package/lib/components/atoms/Card/Card.js +2 -2
- package/lib/components/atoms/Card/Card.js.map +1 -1
- package/lib/components/atoms/HorizontalRule/HorizontalRule.d.ts +3 -1
- package/lib/components/atoms/HorizontalRule/HorizontalRule.js +5 -7
- package/lib/components/atoms/HorizontalRule/HorizontalRule.js.map +1 -1
- package/lib/components/atoms/HtmlInput/HtmlInput.d.ts +3 -1
- package/lib/components/atoms/HtmlInput/HtmlInput.js +13 -8
- package/lib/components/atoms/HtmlInput/HtmlInput.js.map +1 -1
- package/lib/components/atoms/HtmlViewer/HtmlViewer.d.ts +10 -0
- package/lib/components/atoms/HtmlViewer/HtmlViewer.js +93 -0
- package/lib/components/atoms/HtmlViewer/HtmlViewer.js.map +1 -0
- package/lib/components/atoms/Icon/Icon.d.ts +2 -1
- package/lib/components/atoms/Icon/Icon.js +4 -5
- package/lib/components/atoms/Icon/Icon.js.map +1 -1
- package/lib/components/atoms/Input/Input.d.ts +5 -5
- package/lib/components/atoms/Input/Input.js +6 -5
- package/lib/components/atoms/Input/Input.js.map +1 -1
- package/lib/components/atoms/ProgressCircle/ProgressCircle.js +11 -7
- package/lib/components/atoms/ProgressCircle/ProgressCircle.js.map +1 -1
- package/lib/components/atoms/RadioButton/RadioButton.js +25 -21
- package/lib/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/atoms/Screen/Screen.d.ts +1 -2
- package/lib/components/atoms/Screen/Screen.js +2 -9
- package/lib/components/atoms/Screen/Screen.js.map +1 -1
- package/lib/components/atoms/Switch/Switch.d.ts +1 -1
- package/lib/components/atoms/Switch/Switch.js +5 -5
- package/lib/components/atoms/Switch/Switch.js.map +1 -1
- package/lib/components/atoms/Text/Text.d.ts +2 -1
- package/lib/components/atoms/Text/Text.js +1 -1
- package/lib/components/atoms/Text/Text.js.map +1 -1
- package/lib/components/atoms/VerticalRule/VerticalRule.d.ts +8 -0
- package/lib/components/atoms/VerticalRule/VerticalRule.js +33 -0
- package/lib/components/atoms/VerticalRule/VerticalRule.js.map +1 -0
- package/lib/components/atoms/index.d.ts +3 -0
- package/lib/components/atoms/index.js +3 -0
- package/lib/components/atoms/index.js.map +1 -1
- package/lib/components/molecules/Alert/Alert.js +18 -30
- package/lib/components/molecules/Alert/Alert.js.map +1 -1
- package/lib/components/molecules/Badge/Badge.d.ts +2 -1
- package/lib/components/molecules/Badge/Badge.js +15 -12
- package/lib/components/molecules/Badge/Badge.js.map +1 -1
- package/lib/components/molecules/BottomSheet/BottomSheet.js +1 -1
- package/lib/components/molecules/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/components/molecules/Breadcrumb/Breadcrumb.js +1 -1
- package/lib/components/molecules/Button/Button.d.ts +2 -1
- package/lib/components/molecules/Button/Button.js +6 -12
- package/lib/components/molecules/Button/Button.js.map +1 -1
- package/lib/components/molecules/CalendarLegend/CalendarLegend.d.ts +13 -0
- package/lib/components/molecules/CalendarLegend/CalendarLegend.js +89 -0
- package/lib/components/molecules/CalendarLegend/CalendarLegend.js.map +1 -0
- package/lib/components/molecules/CalendarLegend/index.d.ts +2 -0
- package/lib/components/molecules/CalendarLegend/index.js +19 -0
- package/lib/components/molecules/CalendarLegend/index.js.map +1 -0
- package/lib/components/molecules/CalendarLegend/types.d.ts +6 -0
- package/lib/components/molecules/CalendarLegend/types.js +19 -0
- package/lib/components/molecules/CalendarLegend/types.js.map +1 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.d.ts +15 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.js +49 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthGrid.js.map +1 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.d.ts +8 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.js +35 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarMonthTitle.js.map +1 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.d.ts +7 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.js +44 -0
- package/lib/components/molecules/CalendarMonthGrid/CalendarWeekDays.js.map +1 -0
- package/lib/components/molecules/CalendarMonthGrid/index.d.ts +3 -0
- package/lib/components/molecules/CalendarMonthGrid/index.js +21 -0
- package/lib/components/molecules/CalendarMonthGrid/index.js.map +1 -0
- package/lib/components/molecules/CardIconButton/CardIconButton.js +1 -1
- package/lib/components/molecules/Checkbox/Checkbox.d.ts +1 -1
- package/lib/components/molecules/Checkbox/Checkbox.js +11 -27
- package/lib/components/molecules/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/molecules/Chip/Chip.d.ts +1 -1
- package/lib/components/molecules/Chip/Chip.js +23 -19
- package/lib/components/molecules/Chip/Chip.js.map +1 -1
- package/lib/components/molecules/CircleButton/CircleButton.js +1 -1
- package/lib/components/molecules/CircleButton/CircleButton.js.map +1 -1
- package/lib/components/molecules/ClearableCard/ClearableCard.js +2 -7
- package/lib/components/molecules/ClearableCard/ClearableCard.js.map +1 -1
- package/lib/components/molecules/DoubleIcon/DoubleIcon.js +1 -1
- package/lib/components/molecules/DoubleIcon/DoubleIcon.js.map +1 -1
- package/lib/components/molecules/DropdownCard/DropdownCard.d.ts +4 -3
- package/lib/components/molecules/DropdownCard/DropdownCard.js +36 -55
- package/lib/components/molecules/DropdownCard/DropdownCard.js.map +1 -1
- package/lib/components/molecules/DropdownMenu/DropdownMenu.d.ts +4 -2
- package/lib/components/molecules/DropdownMenu/DropdownMenu.js +52 -26
- package/lib/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/components/molecules/EditableHtmlInput/EditableHtmlInput.js +2 -3
- package/lib/components/molecules/EditableHtmlInput/EditableHtmlInput.js.map +1 -1
- package/lib/components/molecules/EditableInput/EditableInput.js +4 -17
- package/lib/components/molecules/EditableInput/EditableInput.js.map +1 -1
- package/lib/components/molecules/FormHtmlInput/FormHtmlInput.d.ts +2 -2
- package/lib/components/molecules/FormHtmlInput/FormHtmlInput.js +13 -23
- package/lib/components/molecules/FormHtmlInput/FormHtmlInput.js.map +1 -1
- package/lib/components/molecules/FormIncrementInput/FormIncrementInput.js +6 -17
- package/lib/components/molecules/FormIncrementInput/FormIncrementInput.js.map +1 -1
- package/lib/components/molecules/FormInput/FormInput.d.ts +1 -1
- package/lib/components/molecules/FormInput/FormInput.js +2 -9
- package/lib/components/molecules/FormInput/FormInput.js.map +1 -1
- package/lib/components/molecules/FormSlider/FormSlider.js +3 -13
- package/lib/components/molecules/FormSlider/FormSlider.js.map +1 -1
- package/lib/components/molecules/GroupedCard/GroupedCard.d.ts +13 -0
- package/lib/components/molecules/GroupedCard/GroupedCard.js +60 -0
- package/lib/components/molecules/GroupedCard/GroupedCard.js.map +1 -0
- package/lib/components/molecules/HorizontalRuleText/HorizontalRuleText.js +5 -6
- package/lib/components/molecules/HorizontalRuleText/HorizontalRuleText.js.map +1 -1
- package/lib/components/molecules/IconInput/IconInput.d.ts +4 -4
- package/lib/components/molecules/IconInput/IconInput.js +15 -23
- package/lib/components/molecules/IconInput/IconInput.js.map +1 -1
- package/lib/components/molecules/IconTile/IconTile.d.ts +19 -0
- package/lib/components/molecules/IconTile/IconTile.js +43 -0
- package/lib/components/molecules/IconTile/IconTile.js.map +1 -0
- package/lib/components/molecules/Increment/Increment.d.ts +1 -1
- package/lib/components/molecules/Increment/Increment.js +3 -5
- package/lib/components/molecules/Increment/Increment.js.map +1 -1
- package/lib/components/molecules/Increment/IncrementButton.js +7 -14
- package/lib/components/molecules/Increment/IncrementButton.js.map +1 -1
- package/lib/components/molecules/Label/Label.d.ts +1 -1
- package/lib/components/molecules/Label/Label.js +11 -15
- package/lib/components/molecules/Label/Label.js.map +1 -1
- package/lib/components/molecules/LabelText/LabelText.js +6 -4
- package/lib/components/molecules/LabelText/LabelText.js.map +1 -1
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.d.ts +6 -7
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js +91 -33
- package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js.map +1 -1
- package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js +21 -33
- package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js.map +1 -1
- package/lib/components/molecules/NotesCard/NotesCard.d.ts +2 -1
- package/lib/components/molecules/NotesCard/NotesCard.js +11 -15
- package/lib/components/molecules/NotesCard/NotesCard.js.map +1 -1
- package/lib/components/molecules/NumberBubble/NumberBubble.js +2 -2
- package/lib/components/molecules/NumberBubble/NumberBubble.js.map +1 -1
- package/lib/components/molecules/NumberChevronInput/NumberChevronInput.d.ts +5 -3
- package/lib/components/molecules/NumberChevronInput/NumberChevronInput.js +35 -28
- package/lib/components/molecules/NumberChevronInput/NumberChevronInput.js.map +1 -1
- package/lib/components/molecules/PanelTabs/PanelTabs.js +1 -1
- package/lib/components/molecules/PeriodNavigation/PeriodNavigation.d.ts +14 -0
- package/lib/components/molecules/PeriodNavigation/PeriodNavigation.js +45 -0
- package/lib/components/molecules/PeriodNavigation/PeriodNavigation.js.map +1 -0
- package/lib/components/molecules/RadioSelect/RadioSelect.js +8 -8
- package/lib/components/molecules/RadioSelect/RadioSelect.js.map +1 -1
- package/lib/components/molecules/RightIconButton/RightIconButton.d.ts +4 -1
- package/lib/components/molecules/RightIconButton/RightIconButton.js +8 -7
- package/lib/components/molecules/RightIconButton/RightIconButton.js.map +1 -1
- package/lib/components/molecules/SelectionContainer/SelectionContainer.d.ts +2 -1
- package/lib/components/molecules/SelectionContainer/SelectionContainer.js +46 -58
- package/lib/components/molecules/SelectionContainer/SelectionContainer.js.map +1 -1
- package/lib/components/molecules/StarScore/StarScore.d.ts +1 -1
- package/lib/components/molecules/StarScore/StarScore.js +7 -10
- package/lib/components/molecules/StarScore/StarScore.js.map +1 -1
- package/lib/components/molecules/Stepper/StepList.d.ts +2 -1
- package/lib/components/molecules/Stepper/StepList.js +14 -12
- package/lib/components/molecules/Stepper/StepList.js.map +1 -1
- package/lib/components/molecules/Stepper/Stepper.d.ts +1 -2
- package/lib/components/molecules/Stepper/Stepper.js +17 -28
- package/lib/components/molecules/Stepper/Stepper.js.map +1 -1
- package/lib/components/molecules/SwitchCard/SwitchCard.d.ts +6 -2
- package/lib/components/molecules/SwitchCard/SwitchCard.js +6 -13
- package/lib/components/molecules/SwitchCard/SwitchCard.js.map +1 -1
- package/lib/components/molecules/TextUnit/TextUnit.js +3 -3
- package/lib/components/molecules/TextUnit/TextUnit.js.map +1 -1
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js +34 -34
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js.map +1 -1
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.d.ts +2 -1
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js +24 -33
- package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js.map +1 -1
- package/lib/components/molecules/index.d.ts +5 -0
- package/lib/components/molecules/index.js +5 -0
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/ActionCard/ActionCard.js +4 -5
- package/lib/components/organisms/ActionCard/ActionCard.js.map +1 -1
- package/lib/components/organisms/ActionSheet/ActionSheet.d.ts +2 -1
- package/lib/components/organisms/ActionSheet/ActionSheet.js +18 -8
- package/lib/components/organisms/ActionSheet/ActionSheet.js.map +1 -1
- package/lib/components/organisms/AgendaView/AgendaDayCell.d.ts +13 -0
- package/lib/components/organisms/AgendaView/AgendaDayCell.js +71 -0
- package/lib/components/organisms/AgendaView/AgendaDayCell.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaDayRow.d.ts +14 -0
- package/lib/components/organisms/AgendaView/AgendaDayRow.js +65 -0
- package/lib/components/organisms/AgendaView/AgendaDayRow.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaHeader.d.ts +12 -0
- package/lib/components/organisms/AgendaView/AgendaHeader.js +44 -0
- package/lib/components/organisms/AgendaView/AgendaHeader.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaItemRow.d.ts +8 -0
- package/lib/components/organisms/AgendaView/AgendaItemRow.js +58 -0
- package/lib/components/organisms/AgendaView/AgendaItemRow.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaMonth.d.ts +16 -0
- package/lib/components/organisms/AgendaView/AgendaMonth.js +26 -0
- package/lib/components/organisms/AgendaView/AgendaMonth.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaMonthSeparator.d.ts +7 -0
- package/lib/components/organisms/AgendaView/AgendaMonthSeparator.js +41 -0
- package/lib/components/organisms/AgendaView/AgendaMonthSeparator.js.map +1 -0
- package/lib/components/organisms/AgendaView/AgendaView.d.ts +24 -0
- package/lib/components/organisms/AgendaView/AgendaView.js +134 -0
- package/lib/components/organisms/AgendaView/AgendaView.js.map +1 -0
- package/lib/components/organisms/AgendaView/MonthList.d.ts +16 -0
- package/lib/components/organisms/AgendaView/MonthList.js +64 -0
- package/lib/components/organisms/AgendaView/MonthList.js.map +1 -0
- package/lib/components/organisms/AgendaView/MonthPanel.d.ts +17 -0
- package/lib/components/organisms/AgendaView/MonthPanel.js +108 -0
- package/lib/components/organisms/AgendaView/MonthPanel.js.map +1 -0
- package/lib/components/organisms/AgendaView/agenda-view.helpers.d.ts +6 -0
- package/lib/components/organisms/AgendaView/agenda-view.helpers.js +53 -0
- package/lib/components/organisms/AgendaView/agenda-view.helpers.js.map +1 -0
- package/lib/components/organisms/AgendaView/index.d.ts +3 -0
- package/lib/components/organisms/AgendaView/index.js +20 -0
- package/lib/components/organisms/AgendaView/index.js.map +1 -0
- package/lib/components/organisms/AgendaView/types.d.ts +12 -0
- package/lib/components/organisms/AgendaView/types.js +19 -0
- package/lib/components/organisms/AgendaView/types.js.map +1 -0
- package/lib/components/organisms/AgendaView/use-month-panel-drag.d.ts +13 -0
- package/lib/components/organisms/AgendaView/use-month-panel-drag.js +77 -0
- package/lib/components/organisms/AgendaView/use-month-panel-drag.js.map +1 -0
- package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js +5 -5
- package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js.map +1 -1
- package/lib/components/organisms/AutoCompleteSearch/ItemCard.d.ts +2 -2
- package/lib/components/organisms/AutoCompleteSearch/ItemCard.js +13 -20
- package/lib/components/organisms/AutoCompleteSearch/ItemCard.js.map +1 -1
- package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js +8 -9
- package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js.map +1 -1
- package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.d.ts +12 -0
- package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.js +60 -0
- package/lib/components/organisms/CalendarRangePicker/CalendarDaySheet.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.d.ts +28 -0
- package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.js +140 -0
- package/lib/components/organisms/CalendarRangePicker/CalendarRangePicker.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/DayCell.d.ts +17 -0
- package/lib/components/organisms/CalendarRangePicker/DayCell.js +131 -0
- package/lib/components/organisms/CalendarRangePicker/DayCell.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/RangeMonth.d.ts +18 -0
- package/lib/components/organisms/CalendarRangePicker/RangeMonth.js +35 -0
- package/lib/components/organisms/CalendarRangePicker/RangeMonth.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.d.ts +12 -0
- package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.js +68 -0
- package/lib/components/organisms/CalendarRangePicker/calendar-range.helpers.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/index.d.ts +2 -0
- package/lib/components/organisms/CalendarRangePicker/index.js +19 -0
- package/lib/components/organisms/CalendarRangePicker/index.js.map +1 -0
- package/lib/components/organisms/CalendarRangePicker/types.d.ts +11 -0
- package/lib/components/organisms/CalendarRangePicker/types.js +19 -0
- package/lib/components/organisms/CalendarRangePicker/types.js.map +1 -0
- package/lib/components/organisms/ChipSelect/ChipSelect.js +24 -21
- package/lib/components/organisms/ChipSelect/ChipSelect.js.map +1 -1
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.d.ts +2 -0
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js +2 -2
- package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js.map +1 -1
- package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.d.ts +3 -2
- package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.js +36 -34
- package/lib/components/organisms/DropdownMenuItem/DropdownMenuItem.js.map +1 -1
- package/lib/components/organisms/FloatingButton/FloatingActionButton.d.ts +2 -2
- package/lib/components/organisms/FloatingButton/FloatingActionButton.js +2 -1
- package/lib/components/organisms/FloatingButton/FloatingActionButton.js.map +1 -1
- package/lib/components/organisms/GanttView/GanttView.d.ts +36 -0
- package/lib/components/organisms/GanttView/GanttView.js +267 -0
- package/lib/components/organisms/GanttView/GanttView.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttBar.d.ts +12 -0
- package/lib/components/organisms/GanttView/body/GanttBar.js +52 -0
- package/lib/components/organisms/GanttView/body/GanttBar.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttCellStrip.d.ts +10 -0
- package/lib/components/organisms/GanttView/body/GanttCellStrip.js +55 -0
- package/lib/components/organisms/GanttView/body/GanttCellStrip.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttGridLines.d.ts +9 -0
- package/lib/components/organisms/GanttView/body/GanttGridLines.js +45 -0
- package/lib/components/organisms/GanttView/body/GanttGridLines.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttGroupHeader.d.ts +9 -0
- package/lib/components/organisms/GanttView/body/GanttGroupHeader.js +61 -0
- package/lib/components/organisms/GanttView/body/GanttGroupHeader.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttGroupLane.d.ts +10 -0
- package/lib/components/organisms/GanttView/body/GanttGroupLane.js +43 -0
- package/lib/components/organisms/GanttView/body/GanttGroupLane.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttRowLane.d.ts +13 -0
- package/lib/components/organisms/GanttView/body/GanttRowLane.js +53 -0
- package/lib/components/organisms/GanttView/body/GanttRowLane.js.map +1 -0
- package/lib/components/organisms/GanttView/body/GanttRowName.d.ts +9 -0
- package/lib/components/organisms/GanttView/body/GanttRowName.js +51 -0
- package/lib/components/organisms/GanttView/body/GanttRowName.js.map +1 -0
- package/lib/components/organisms/GanttView/body/index.d.ts +6 -0
- package/lib/components/organisms/GanttView/body/index.js +24 -0
- package/lib/components/organisms/GanttView/body/index.js.map +1 -0
- package/lib/components/organisms/GanttView/gantt-view.helpers.d.ts +19 -0
- package/lib/components/organisms/GanttView/gantt-view.helpers.js +219 -0
- package/lib/components/organisms/GanttView/gantt-view.helpers.js.map +1 -0
- package/lib/components/organisms/GanttView/gantt-view.styles.d.ts +124 -0
- package/lib/components/organisms/GanttView/gantt-view.styles.js +148 -0
- package/lib/components/organisms/GanttView/gantt-view.styles.js.map +1 -0
- package/lib/components/organisms/GanttView/header/GanttControls.d.ts +13 -0
- package/lib/components/organisms/GanttView/header/GanttControls.js +53 -0
- package/lib/components/organisms/GanttView/header/GanttControls.js.map +1 -0
- package/lib/components/organisms/GanttView/header/GanttHeader.d.ts +24 -0
- package/lib/components/organisms/GanttView/header/GanttHeader.js +75 -0
- package/lib/components/organisms/GanttView/header/GanttHeader.js.map +1 -0
- package/lib/components/organisms/GanttView/header/index.d.ts +1 -0
- package/lib/components/organisms/GanttView/header/index.js +19 -0
- package/lib/components/organisms/GanttView/header/index.js.map +1 -0
- package/lib/components/organisms/GanttView/index.d.ts +4 -0
- package/lib/components/organisms/GanttView/index.js +21 -0
- package/lib/components/organisms/GanttView/index.js.map +1 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.d.ts +10 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.js +67 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleDayRow.js.map +1 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleHeader.d.ts +15 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleHeader.js +46 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleHeader.js.map +1 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.d.ts +8 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.js +69 -0
- package/lib/components/organisms/GanttView/scale/GanttScaleSpanRow.js.map +1 -0
- package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.d.ts +6 -0
- package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.js +53 -0
- package/lib/components/organisms/GanttView/scale/gantt-scale.helpers.js.map +1 -0
- package/lib/components/organisms/GanttView/scale/index.d.ts +1 -0
- package/lib/components/organisms/GanttView/scale/index.js +19 -0
- package/lib/components/organisms/GanttView/scale/index.js.map +1 -0
- package/lib/components/organisms/GanttView/types.d.ts +87 -0
- package/lib/components/organisms/GanttView/types.js +19 -0
- package/lib/components/organisms/GanttView/types.js.map +1 -0
- package/lib/components/organisms/GanttView/use-default-zoom.d.ts +2 -0
- package/lib/components/organisms/GanttView/use-default-zoom.js +23 -0
- package/lib/components/organisms/GanttView/use-default-zoom.js.map +1 -0
- package/lib/components/organisms/GroupByScrollList/GroupByScrollList.js +6 -2
- package/lib/components/organisms/GroupByScrollList/GroupByScrollList.js.map +1 -1
- package/lib/components/organisms/HeaderContainer/HeaderContainer.js +21 -17
- package/lib/components/organisms/HeaderContainer/HeaderContainer.js.map +1 -1
- package/lib/components/organisms/ImageBubble/ImageBubble.d.ts +1 -1
- package/lib/components/organisms/ImageBubble/ImageBubble.js +4 -7
- package/lib/components/organisms/ImageBubble/ImageBubble.js.map +1 -1
- package/lib/components/organisms/InfoBubble/InfoBubble.js +1 -1
- package/lib/components/organisms/InfoBubble/InfoBubble.js.map +1 -1
- package/lib/components/organisms/InfoButton/InfoButton.d.ts +1 -1
- package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js +6 -10
- package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js.map +1 -1
- package/lib/components/organisms/Picker/Picker.d.ts +2 -1
- package/lib/components/organisms/Picker/Picker.js +25 -29
- package/lib/components/organisms/Picker/Picker.js.map +1 -1
- package/lib/components/organisms/ProgressBar/ProgressBar.d.ts +1 -1
- package/lib/components/organisms/ProgressBar/ProgressBar.js +11 -16
- package/lib/components/organisms/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/components/organisms/QuantityCard/QuantityCard.d.ts +3 -2
- package/lib/components/organisms/QuantityCard/QuantityCard.js +47 -56
- package/lib/components/organisms/QuantityCard/QuantityCard.js.map +1 -1
- package/lib/components/organisms/ScrollList/DottedButton.js +10 -18
- package/lib/components/organisms/ScrollList/DottedButton.js.map +1 -1
- package/lib/components/organisms/ScrollList/ScrollList.js +9 -7
- package/lib/components/organisms/ScrollList/ScrollList.js.map +1 -1
- package/lib/components/organisms/ScrollList/TopActions.js +5 -3
- package/lib/components/organisms/ScrollList/TopActions.js.map +1 -1
- package/lib/components/organisms/SearchBar/SearchBar.d.ts +3 -3
- package/lib/components/organisms/SearchBar/SearchBar.js +15 -32
- package/lib/components/organisms/SearchBar/SearchBar.js.map +1 -1
- package/lib/components/organisms/SingleSelectScrollList/SingleSelectScrollList.js +1 -1
- package/lib/components/organisms/ToggleButton/ToggleButton.js +2 -2
- package/lib/components/organisms/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/organisms/ViewAllEditList/AllLinesAlert.js +14 -16
- package/lib/components/organisms/ViewAllEditList/AllLinesAlert.js.map +1 -1
- package/lib/components/organisms/ViewAllEditList/LineComponent.js +6 -8
- package/lib/components/organisms/ViewAllEditList/LineComponent.js.map +1 -1
- package/lib/components/organisms/ViewAllEditList/ViewAllEditList.d.ts +3 -2
- package/lib/components/organisms/ViewAllEditList/ViewAllEditList.js +5 -9
- package/lib/components/organisms/ViewAllEditList/ViewAllEditList.js.map +1 -1
- package/lib/components/organisms/WeekDayPicker/DayGauge.d.ts +18 -0
- package/lib/components/organisms/WeekDayPicker/DayGauge.js +112 -0
- package/lib/components/organisms/WeekDayPicker/DayGauge.js.map +1 -0
- package/lib/components/organisms/WeekDayPicker/WeekDayPicker.d.ts +18 -0
- package/lib/components/organisms/WeekDayPicker/WeekDayPicker.js +118 -0
- package/lib/components/organisms/WeekDayPicker/WeekDayPicker.js.map +1 -0
- package/lib/components/organisms/WeekDayPicker/WeekRow.d.ts +15 -0
- package/lib/components/organisms/WeekDayPicker/WeekRow.js +39 -0
- package/lib/components/organisms/WeekDayPicker/WeekRow.js.map +1 -0
- package/lib/components/organisms/WeekDayPicker/index.d.ts +3 -0
- package/lib/components/organisms/WeekDayPicker/index.js +20 -0
- package/lib/components/organisms/WeekDayPicker/index.js.map +1 -0
- package/lib/components/organisms/WeekDayPicker/types.d.ts +17 -0
- package/lib/components/organisms/WeekDayPicker/types.js +19 -0
- package/lib/components/organisms/WeekDayPicker/types.js.map +1 -0
- package/lib/components/organisms/WeekDayPicker/week-day.helpers.d.ts +9 -0
- package/lib/components/organisms/WeekDayPicker/week-day.helpers.js +83 -0
- package/lib/components/organisms/WeekDayPicker/week-day.helpers.js.map +1 -0
- package/lib/components/organisms/index.d.ts +4 -0
- package/lib/components/organisms/index.js +4 -0
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/components/templates/BottomBar/BottomBar.js +81 -22
- package/lib/components/templates/BottomBar/BottomBar.js.map +1 -1
- package/lib/components/templates/BottomBar/ItemTitle.d.ts +1 -1
- package/lib/components/templates/BottomBar/ItemTitle.js +1 -2
- package/lib/components/templates/BottomBar/ItemTitle.js.map +1 -1
- package/lib/components/templates/Dashboard/Chart/BarChart.js +3 -3
- package/lib/components/templates/Dashboard/Chart/BarChart.js.map +1 -1
- package/lib/components/templates/Dashboard/Chart/IndicatorChart/IndicatorItem.js +1 -1
- package/lib/components/templates/Dashboard/Chart/IndicatorChart/IndicatorItem.js.map +1 -1
- package/lib/components/templates/Dashboard/Chart/IndicatorChart/SimpleIndicator.js +24 -20
- package/lib/components/templates/Dashboard/Chart/IndicatorChart/SimpleIndicator.js.map +1 -1
- package/lib/components/templates/ObjectCard/ObjectCard.d.ts +3 -2
- package/lib/components/templates/ObjectCard/ObjectCard.js +46 -32
- package/lib/components/templates/ObjectCard/ObjectCard.js.map +1 -1
- package/lib/components/templates/TabsScreen/Tab.js +1 -1
- package/lib/components/templates/TabsScreen/Tab.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-click-outside.js +2 -2
- package/lib/hooks/use-click-outside.js.map +1 -1
- package/lib/hooks/use-orientation.d.ts +1 -0
- package/lib/hooks/use-orientation.js +23 -0
- package/lib/hooks/use-orientation.js.map +1 -0
- package/lib/theme/color/ThemeContext.js +1 -1
- package/lib/theme/color/ThemeContext.js.map +1 -1
- package/lib/theme/color/color.defaults.js +22 -22
- package/lib/theme/color/content.helpers.d.ts +2 -1
- package/lib/theme/color/content.helpers.js +47 -45
- package/lib/theme/color/content.helpers.js.map +1 -1
- package/lib/theme/color/themes.js +83 -80
- package/lib/theme/color/themes.js.map +1 -1
- package/lib/theme/color/types.d.ts +1 -0
- package/lib/theme/writing/writingTheme.js +5 -5
- package/lib/tools/AnimationUtil.d.ts +18 -3
- package/lib/utils/calendar.d.ts +42 -0
- package/lib/utils/calendar.js +64 -0
- package/lib/utils/calendar.js.map +1 -0
- package/lib/utils/commons-styles.d.ts +8 -20
- package/lib/utils/commons-styles.js +14 -22
- package/lib/utils/commons-styles.js.map +1 -1
- package/lib/utils/commons-utlis.d.ts +1 -0
- package/lib/utils/commons-utlis.js +7 -0
- package/lib/utils/commons-utlis.js.map +1 -1
- package/lib/utils/dates.d.ts +30 -0
- package/lib/utils/dates.js +142 -0
- package/lib/utils/dates.js.map +1 -0
- package/lib/utils/index.d.ts +10 -8
- package/lib/utils/index.js +4 -2
- package/lib/utils/index.js.map +1 -1
- package/package.json +16 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayGauge.js","sourceRoot":"","sources":["../../../../src/components/organisms/WeekDayPicker/DayGauge.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,EAAC,MAAM,cAAc,CAAC;AACzD,OAAO,EAAQ,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,QAAQ,GAAG,CAAC,CAAC;AAiBnB,MAAM,WAAW,GAAG,CAAC,KAAyB,EAAE,QAAiB,EAAU,EAAE;IAC3E,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,UAAU,CAAC;IAElC,OAAO,KAAK,GAAG,UAAU,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,EAChB,UAAU,EACV,SAAS,EACT,QAAQ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C;KAC3B;CACF,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Color } from '../../../theme';
|
|
3
|
+
import { DayFill } from './types';
|
|
4
|
+
interface WeekDayPickerProps {
|
|
5
|
+
fromDate?: string;
|
|
6
|
+
toDate?: string;
|
|
7
|
+
selectedDate?: string;
|
|
8
|
+
onDateChange: (dateString: string) => void;
|
|
9
|
+
fillByDate?: Record<string, DayFill>;
|
|
10
|
+
firstDayOfWeek?: number;
|
|
11
|
+
color?: Color;
|
|
12
|
+
showNavigation?: boolean;
|
|
13
|
+
showTodayButton?: boolean;
|
|
14
|
+
translator: (key: string) => string;
|
|
15
|
+
style?: any;
|
|
16
|
+
}
|
|
17
|
+
declare const WeekDayPicker: ({ fromDate, toDate, selectedDate, onDateChange, fillByDate, firstDayOfWeek, color, showNavigation, showTodayButton, translator, style, }: WeekDayPickerProps) => React.JSX.Element;
|
|
18
|
+
export default WeekDayPicker;
|
|
@@ -0,0 +1,118 @@
|
|
|
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, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
19
|
+
import { FlatList, StyleSheet, useWindowDimensions, View, } from 'react-native';
|
|
20
|
+
import { DEFAULT_FIRST_DAY_OF_WEEK, formatDateRange, getWeekDayKeys, toDateString, } from '../../../utils';
|
|
21
|
+
import { useThemeColor } from '../../../theme';
|
|
22
|
+
import { PeriodNavigation } from '../../molecules';
|
|
23
|
+
import WeekRow from './WeekRow';
|
|
24
|
+
import { buildWeeks, sameWeekDayIn, sliceFillsByWeek, weekIndexOf, } from './week-day.helpers';
|
|
25
|
+
const EMPTY_FILL_BY_DATE = {};
|
|
26
|
+
const WeekDayPicker = ({ fromDate, toDate, selectedDate, onDateChange, fillByDate = EMPTY_FILL_BY_DATE, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, color, showNavigation = true, showTodayButton = true, translator, style, }) => {
|
|
27
|
+
const Colors = useThemeColor();
|
|
28
|
+
const { width: pageWidth } = useWindowDimensions();
|
|
29
|
+
const weeks = useMemo(() => buildWeeks(fromDate, toDate, firstDayOfWeek), [firstDayOfWeek, fromDate, toDate]);
|
|
30
|
+
const fillsByWeek = useMemo(() => sliceFillsByWeek(fillByDate, weeks), [fillByDate, weeks]);
|
|
31
|
+
const dayLabels = useMemo(() => getWeekDayKeys(firstDayOfWeek).map(key => translator(key)), [firstDayOfWeek, translator]);
|
|
32
|
+
const todayDateString = useMemo(() => toDateString(new Date()), []);
|
|
33
|
+
const defaultColor = useMemo(() => color ?? Colors.primaryColor, [Colors.primaryColor, color]);
|
|
34
|
+
const initialIndex = useMemo(() => {
|
|
35
|
+
const index = weekIndexOf(weeks, selectedDate);
|
|
36
|
+
return index < 0 ? 0 : index;
|
|
37
|
+
// Read on mount only, so it must not follow the selection.
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, [weeks]);
|
|
40
|
+
const visibleIndexRef = useRef(initialIndex);
|
|
41
|
+
const listRef = useRef(null);
|
|
42
|
+
const weeksRef = useRef(weeks);
|
|
43
|
+
weeksRef.current = weeks;
|
|
44
|
+
const selectedDateRef = useRef(selectedDate);
|
|
45
|
+
selectedDateRef.current = selectedDate;
|
|
46
|
+
const onDateChangeRef = useRef(onDateChange);
|
|
47
|
+
onDateChangeRef.current = onDateChange;
|
|
48
|
+
const firstDayOfWeekRef = useRef(firstDayOfWeek);
|
|
49
|
+
firstDayOfWeekRef.current = firstDayOfWeek;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const index = weekIndexOf(weeks, selectedDate);
|
|
52
|
+
if (index >= 0 && index !== visibleIndexRef.current) {
|
|
53
|
+
visibleIndexRef.current = index;
|
|
54
|
+
listRef.current?.scrollToIndex({ index, animated: true });
|
|
55
|
+
}
|
|
56
|
+
}, [selectedDate, weeks]);
|
|
57
|
+
const handleDayPress = useCallback((dateString) => {
|
|
58
|
+
if (dateString !== selectedDateRef.current) {
|
|
59
|
+
onDateChangeRef.current(dateString);
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
// The selection follows the swipe so the details below always describe a
|
|
63
|
+
// day the strip still shows.
|
|
64
|
+
const handleMomentumEnd = useCallback((event) => {
|
|
65
|
+
if (pageWidth <= 0)
|
|
66
|
+
return;
|
|
67
|
+
const index = Math.round(event.nativeEvent.contentOffset.x / pageWidth);
|
|
68
|
+
if (index === visibleIndexRef.current)
|
|
69
|
+
return;
|
|
70
|
+
visibleIndexRef.current = index;
|
|
71
|
+
const nextDate = sameWeekDayIn(weeksRef.current[index], selectedDateRef.current, firstDayOfWeekRef.current);
|
|
72
|
+
if (nextDate != null && nextDate !== selectedDateRef.current) {
|
|
73
|
+
onDateChangeRef.current(nextDate);
|
|
74
|
+
}
|
|
75
|
+
}, [pageWidth]);
|
|
76
|
+
const getItemLayout = useCallback((_data, index) => ({
|
|
77
|
+
length: pageWidth,
|
|
78
|
+
offset: pageWidth * index,
|
|
79
|
+
index,
|
|
80
|
+
}), [pageWidth]);
|
|
81
|
+
const renderItem = useCallback(({ item, index }) => (<WeekRow week={item} fills={fillsByWeek[index]} dayLabels={dayLabels} selectedDate={selectedDate} todayDateString={todayDateString} defaultColor={defaultColor} pageWidth={pageWidth} onDayPress={handleDayPress}/>), [
|
|
82
|
+
dayLabels,
|
|
83
|
+
defaultColor,
|
|
84
|
+
fillsByWeek,
|
|
85
|
+
handleDayPress,
|
|
86
|
+
pageWidth,
|
|
87
|
+
selectedDate,
|
|
88
|
+
todayDateString,
|
|
89
|
+
]);
|
|
90
|
+
const visibleIndex = weekIndexOf(weeks, selectedDate);
|
|
91
|
+
const visibleWeek = weeks[visibleIndex];
|
|
92
|
+
const todayIndex = weekIndexOf(weeks, todayDateString);
|
|
93
|
+
const isTodayReachable = showTodayButton && todayIndex >= 0 && todayDateString !== selectedDate;
|
|
94
|
+
const shiftWeek = useCallback((weekOffset) => {
|
|
95
|
+
const week = weeksRef.current[weekIndexOf(weeksRef.current, selectedDateRef.current) + weekOffset];
|
|
96
|
+
if (week == null)
|
|
97
|
+
return;
|
|
98
|
+
const nextDate = sameWeekDayIn(week, selectedDateRef.current, firstDayOfWeekRef.current);
|
|
99
|
+
if (nextDate != null)
|
|
100
|
+
onDateChangeRef.current(nextDate);
|
|
101
|
+
}, []);
|
|
102
|
+
const goToPreviousWeek = useCallback(() => shiftWeek(-1), [shiftWeek]);
|
|
103
|
+
const goToNextWeek = useCallback(() => shiftWeek(1), [shiftWeek]);
|
|
104
|
+
const goToToday = useCallback(() => onDateChangeRef.current(todayDateString), [todayDateString]);
|
|
105
|
+
if (weeks.length === 0)
|
|
106
|
+
return null;
|
|
107
|
+
return (<View style={style}>
|
|
108
|
+
{showNavigation && visibleWeek != null && (<PeriodNavigation style={styles.header} label={formatDateRange(visibleWeek.days[0].dateString, visibleWeek.days[6].dateString, translator)} previousDisabled={visibleIndex <= 0} onPrevious={goToPreviousWeek} nextDisabled={visibleIndex >= weeks.length - 1} onNext={goToNextWeek} todayDisabled={!isTodayReachable} onToday={goToToday}/>)}
|
|
109
|
+
<FlatList ref={listRef} data={weeks} keyExtractor={item => item.key} renderItem={renderItem} getItemLayout={getItemLayout} initialScrollIndex={initialIndex} onMomentumScrollEnd={handleMomentumEnd} horizontal pagingEnabled showsHorizontalScrollIndicator={false} windowSize={3} testID="weekDayPickerList"/>
|
|
110
|
+
</View>);
|
|
111
|
+
};
|
|
112
|
+
const styles = StyleSheet.create({
|
|
113
|
+
header: {
|
|
114
|
+
paddingHorizontal: 8,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
export default WeekDayPicker;
|
|
118
|
+
//# sourceMappingURL=WeekDayPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeekDayPicker.js","sourceRoot":"","sources":["../../../../src/components/organisms/WeekDayPicker/WeekDayPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACrE,OAAO,EACL,QAAQ,EAGR,UAAU,EACV,mBAAmB,EACnB,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAQ,aAAa,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EACL,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAiB5B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,aAAa,GAAG,CAAC,EACrB,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,UAAU,GAAG,kBAAkB,EAC/B,cAAc,GAAG,yBAAyB,EAC1C,KAAK,EACL,cAAc,GAAG,IAAI,EACrB,eA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,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Color } from '../../../theme';
|
|
3
|
+
import { DayFill, WeekPage } from './types';
|
|
4
|
+
interface WeekRowProps {
|
|
5
|
+
week: WeekPage;
|
|
6
|
+
fills: Record<string, DayFill>;
|
|
7
|
+
dayLabels: string[];
|
|
8
|
+
selectedDate?: string;
|
|
9
|
+
todayDateString: string;
|
|
10
|
+
defaultColor: Color;
|
|
11
|
+
pageWidth: number;
|
|
12
|
+
onDayPress: (dateString: string) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: React.MemoExoticComponent<({ week, fills, dayLabels, selectedDate, todayDateString, defaultColor, pageWidth, onDayPress, }: WeekRowProps) => React.JSX.Element>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
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, useMemo } from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { WEEK_ROW_HEIGHT } from './week-day.helpers';
|
|
21
|
+
import DayGauge from './DayGauge';
|
|
22
|
+
const WeekRow = ({ week, fills, dayLabels, selectedDate, todayDateString, defaultColor, pageWidth, onDayPress, }) => {
|
|
23
|
+
const containerStyle = useMemo(() => ({ width: pageWidth }), [pageWidth]);
|
|
24
|
+
return (<View style={[styles.container, containerStyle]}>
|
|
25
|
+
{week.days.map((day, index) => {
|
|
26
|
+
const fill = fills[day.dateString];
|
|
27
|
+
return (<DayGauge key={day.dateString} dateString={day.dateString} dayNumber={day.dayNumber} dayLabel={dayLabels[index]} ratio={fill?.ratio} isFilled={fill?.filled === true} isSelected={day.dateString === selectedDate} isDisabled={fill?.disabled === true} isOutOfPeriod={day.isOutOfPeriod} isWeekEnd={day.isWeekEnd} isToday={day.dateString === todayDateString} color={fill?.color ?? defaultColor} onPress={onDayPress}/>);
|
|
28
|
+
})}
|
|
29
|
+
</View>);
|
|
30
|
+
};
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
container: {
|
|
33
|
+
height: WEEK_ROW_HEIGHT,
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
paddingHorizontal: 8,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export default memo(WeekRow);
|
|
39
|
+
//# sourceMappingURL=WeekRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeekRow.js","sourceRoot":"","sources":["../../../../src/components/organisms/WeekDayPicker/WeekRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAEnD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAalC,MAAM,OAAO,GAAG,CAAC,EACf,IAAI,EACJ,KAAK,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,SAAS,E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AEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,MAAM,EAAE,eAAe;QACvB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,CAAC;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { getWeekDates } from './week-day.helpers';
|
|
19
|
+
export { default as WeekDayPicker } from './WeekDayPicker';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/organisms/WeekDayPicker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Color } from '../../../theme';
|
|
2
|
+
export interface DayFill {
|
|
3
|
+
ratio?: number;
|
|
4
|
+
filled?: boolean;
|
|
5
|
+
color?: Color;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface WeekDay {
|
|
9
|
+
dateString: string;
|
|
10
|
+
dayNumber: number;
|
|
11
|
+
isWeekEnd: boolean;
|
|
12
|
+
isOutOfPeriod: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface WeekPage {
|
|
15
|
+
key: string;
|
|
16
|
+
days: WeekDay[];
|
|
17
|
+
}
|
|
@@ -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/WeekDayPicker/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DayFill, WeekPage } from './types';
|
|
2
|
+
export declare const GAUGE_SIZE = 30;
|
|
3
|
+
export declare const DAY_LABEL_HEIGHT = 20;
|
|
4
|
+
export declare const WEEK_ROW_HEIGHT = 74;
|
|
5
|
+
export declare const buildWeeks: (fromDate: string | undefined, toDate: string | undefined, firstDayOfWeek: number) => WeekPage[];
|
|
6
|
+
export declare const getWeekDates: (dateString: string | undefined, firstDayOfWeek?: number) => string[];
|
|
7
|
+
export declare const weekIndexOf: (weeks: WeekPage[], dateString?: string) => number;
|
|
8
|
+
export declare const sliceFillsByWeek: (fillByDate: Record<string, DayFill>, weeks: WeekPage[]) => Record<string, DayFill>[];
|
|
9
|
+
export declare const sameWeekDayIn: (week: WeekPage, dateString: string, firstDayOfWeek: number) => string | undefined;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { DEFAULT_FIRST_DAY_OF_WEEK, fromDateString, isWeekEnd, startOfWeek, toDateString, } from '../../../utils';
|
|
19
|
+
export const GAUGE_SIZE = 30;
|
|
20
|
+
export const DAY_LABEL_HEIGHT = 20;
|
|
21
|
+
export const WEEK_ROW_HEIGHT = 74;
|
|
22
|
+
const EMPTY_FILLS = Object.freeze({});
|
|
23
|
+
export const buildWeeks = (fromDate, toDate, firstDayOfWeek) => {
|
|
24
|
+
if (fromDate == null || toDate == null || fromDate > toDate)
|
|
25
|
+
return [];
|
|
26
|
+
const lastDay = fromDateString(toDate);
|
|
27
|
+
const cursor = startOfWeek(fromDateString(fromDate), firstDayOfWeek);
|
|
28
|
+
const weeks = [];
|
|
29
|
+
while (cursor <= lastDay) {
|
|
30
|
+
const days = [];
|
|
31
|
+
for (let index = 0; index < 7; index++) {
|
|
32
|
+
const day = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate() + index);
|
|
33
|
+
const dateString = toDateString(day);
|
|
34
|
+
days.push({
|
|
35
|
+
dateString,
|
|
36
|
+
dayNumber: day.getDate(),
|
|
37
|
+
isWeekEnd: isWeekEnd(day),
|
|
38
|
+
isOutOfPeriod: dateString < fromDate || dateString > toDate,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
weeks.push({ key: days[0].dateString, days });
|
|
42
|
+
cursor.setDate(cursor.getDate() + 7);
|
|
43
|
+
}
|
|
44
|
+
return weeks;
|
|
45
|
+
};
|
|
46
|
+
export const getWeekDates = (dateString, firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK) => {
|
|
47
|
+
if (dateString == null)
|
|
48
|
+
return [];
|
|
49
|
+
const first = startOfWeek(fromDateString(dateString), firstDayOfWeek);
|
|
50
|
+
return Array.from({ length: 7 }, (_, index) => toDateString(new Date(first.getFullYear(), first.getMonth(), first.getDate() + index)));
|
|
51
|
+
};
|
|
52
|
+
export const weekIndexOf = (weeks, dateString) => {
|
|
53
|
+
if (dateString == null)
|
|
54
|
+
return -1;
|
|
55
|
+
return weeks.findIndex(week => week.days.some(day => day.dateString === dateString));
|
|
56
|
+
};
|
|
57
|
+
export const sliceFillsByWeek = (fillByDate, weeks) => weeks.map(week => {
|
|
58
|
+
let slice;
|
|
59
|
+
week.days.forEach(day => {
|
|
60
|
+
const fill = fillByDate[day.dateString];
|
|
61
|
+
if (fill != null) {
|
|
62
|
+
if (slice == null)
|
|
63
|
+
slice = {};
|
|
64
|
+
slice[day.dateString] = fill;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return slice ?? EMPTY_FILLS;
|
|
68
|
+
});
|
|
69
|
+
export const sameWeekDayIn = (week, dateString, firstDayOfWeek) => {
|
|
70
|
+
if (week == null || dateString == null)
|
|
71
|
+
return undefined;
|
|
72
|
+
const target = week.days[(fromDateString(dateString).getDay() - firstDayOfWeek + 7) % 7];
|
|
73
|
+
if (target != null && !target.isOutOfPeriod)
|
|
74
|
+
return target.dateString;
|
|
75
|
+
const available = week.days.filter(day => !day.isOutOfPeriod);
|
|
76
|
+
if (available.length === 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
const last = available[available.length - 1];
|
|
79
|
+
return target != null && target.dateString > last.dateString
|
|
80
|
+
? last.dateString
|
|
81
|
+
: available[0].dateString;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=week-day.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"week-day.helpers.js","sourceRoot":"","sources":["../../../../src/components/organisms/WeekDayPicker/week-day.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,MAAM,WAAW,GAA4B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAA4B,EAC5B,MAA0B,EAC1B,cAAsB,EACV,EAAE;IACd,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,QAAQ,GAAG,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvE,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,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AO,SAAS,CAAC;IAEzD,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,GAAG,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAE5E,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC;IAEtE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAE9D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE7C,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE7C,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;QAC1D,CAAC,CAAC,IAAI,CAAC,UAAU;QACjB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as ActionCard, Action as ActionCardType, } from './ActionCard/ActionCard';
|
|
2
2
|
export { default as ActionSheet } from './ActionSheet/ActionSheet';
|
|
3
|
+
export * from './AgendaView';
|
|
3
4
|
export { default as AutoCompleteSearch } from './AutoCompleteSearch/AutoCompleteSearch';
|
|
5
|
+
export * from './CalendarRangePicker';
|
|
4
6
|
export { default as CheckboxScrollList } from './CheckboxScrollList/CheckboxScrollList';
|
|
5
7
|
export { default as ChipSelect } from './ChipSelect/ChipSelect';
|
|
6
8
|
export { default as DistributionBar } from './DistributionBar/DistributionBar';
|
|
@@ -9,6 +11,7 @@ export { default as DropdownCardSwitch } from './DropdownCardSwitch/DropdownCard
|
|
|
9
11
|
export { default as DropdownMenuItem } from './DropdownMenuItem/DropdownMenuItem';
|
|
10
12
|
export { default as DurationInput } from './DurationInput/DurationInput';
|
|
11
13
|
export { default as FloatingButton } from './FloatingButton/FloatingButton';
|
|
14
|
+
export * from './GanttView';
|
|
12
15
|
export * from './GridView';
|
|
13
16
|
export { default as GroupByScrollList } from './GroupByScrollList/GroupByScrollList';
|
|
14
17
|
export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
@@ -26,3 +29,4 @@ export { default as SingleSelectScrollList } from './SingleSelectScrollList/Sing
|
|
|
26
29
|
export { default as TagList } from './TagList/TagList';
|
|
27
30
|
export { default as ToggleButton } from './ToggleButton/ToggleButton';
|
|
28
31
|
export { default as ViewAllEditList } from './ViewAllEditList/ViewAllEditList';
|
|
32
|
+
export * from './WeekDayPicker';
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export { default as ActionCard, } from './ActionCard/ActionCard';
|
|
19
19
|
export { default as ActionSheet } from './ActionSheet/ActionSheet';
|
|
20
|
+
export * from './AgendaView';
|
|
20
21
|
export { default as AutoCompleteSearch } from './AutoCompleteSearch/AutoCompleteSearch';
|
|
22
|
+
export * from './CalendarRangePicker';
|
|
21
23
|
export { default as CheckboxScrollList } from './CheckboxScrollList/CheckboxScrollList';
|
|
22
24
|
export { default as ChipSelect } from './ChipSelect/ChipSelect';
|
|
23
25
|
export { default as DistributionBar } from './DistributionBar/DistributionBar';
|
|
@@ -26,6 +28,7 @@ export { default as DropdownCardSwitch } from './DropdownCardSwitch/DropdownCard
|
|
|
26
28
|
export { default as DropdownMenuItem } from './DropdownMenuItem/DropdownMenuItem';
|
|
27
29
|
export { default as DurationInput } from './DurationInput/DurationInput';
|
|
28
30
|
export { default as FloatingButton } from './FloatingButton/FloatingButton';
|
|
31
|
+
export * from './GanttView';
|
|
29
32
|
export * from './GridView';
|
|
30
33
|
export { default as GroupByScrollList } from './GroupByScrollList/GroupByScrollList';
|
|
31
34
|
export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
@@ -43,4 +46,5 @@ export { default as SingleSelectScrollList } from './SingleSelectScrollList/Sing
|
|
|
43
46
|
export { default as TagList } from './TagList/TagList';
|
|
44
47
|
export { default as ToggleButton } from './ToggleButton/ToggleButton';
|
|
45
48
|
export { default as ViewAllEditList } from './ViewAllEditList/ViewAllEditList';
|
|
49
|
+
export * from './WeekDayPicker';
|
|
46
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,OAAO,IAAI,UAAU,GAEtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,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,OAAO,EAAa,UAAU,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,cAAc,iBAAiB,CAAC"}
|
|
@@ -16,24 +16,26 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
-
import {
|
|
19
|
+
import { ScrollView, StyleSheet, View, } from 'react-native';
|
|
20
20
|
import Animated, { useAnimatedStyle, useSharedValue, withSpring, } from 'react-native-reanimated';
|
|
21
|
-
import StaticSafeAreaInsets from 'react-native-static-safe-area-insets';
|
|
22
|
-
import { useConfig } from '../../../config/ConfigContext';
|
|
23
21
|
import { useThemeColor } from '../../../theme';
|
|
24
|
-
import { Card } from '../../atoms';
|
|
22
|
+
import { Card, Icon } from '../../atoms';
|
|
25
23
|
import BarItem from './BarItem';
|
|
26
24
|
import ItemTitle from './ItemTitle';
|
|
27
25
|
import { getVisibleItems } from './display.helper';
|
|
28
|
-
const WINDOW_HEIGHT = Dimensions.get('window').height;
|
|
29
26
|
const BottomBar = ({ style, items, updateActiveItem = false, itemSize = 50, manageActiveTitle = true, }) => {
|
|
30
|
-
const { headerHeight } = useConfig();
|
|
31
27
|
const Colors = useThemeColor();
|
|
32
|
-
const [selectedKey, setSelectedKey] = useState();
|
|
33
|
-
const [viewHeight, setViewHeight] = useState(WINDOW_HEIGHT * 0.8);
|
|
34
|
-
const [selectedItemColor, setSelectedItemColor] = useState();
|
|
35
28
|
const itemPositions = useRef({});
|
|
36
29
|
const animatedX = useSharedValue(0);
|
|
30
|
+
const scrollRef = useRef(null);
|
|
31
|
+
const viewportWidthRef = useRef(0);
|
|
32
|
+
const contentWidthRef = useRef(0);
|
|
33
|
+
const offsetRef = useRef(0);
|
|
34
|
+
const didInitialScrollRef = useRef(false);
|
|
35
|
+
const [selectedKey, setSelectedKey] = useState();
|
|
36
|
+
const [selectedItemColor, setSelectedItemColor] = useState();
|
|
37
|
+
const [showLeftIndicator, setShowLeftIndicator] = useState(false);
|
|
38
|
+
const [showRightIndicator, setShowRightIndicator] = useState(false);
|
|
37
39
|
const onItemLayout = useCallback((event, key) => {
|
|
38
40
|
itemPositions.current[key] = event.nativeEvent.layout.x;
|
|
39
41
|
if (key === selectedKey) {
|
|
@@ -54,6 +56,28 @@ const BottomBar = ({ style, items, updateActiveItem = false, itemSize = 50, mana
|
|
|
54
56
|
transform: [{ translateX: animatedX.value }],
|
|
55
57
|
};
|
|
56
58
|
});
|
|
59
|
+
const recomputeIndicators = useCallback(() => {
|
|
60
|
+
const maxX = contentWidthRef.current - viewportWidthRef.current;
|
|
61
|
+
setShowLeftIndicator(offsetRef.current > 1);
|
|
62
|
+
setShowRightIndicator(maxX > 1 && offsetRef.current < maxX - 1);
|
|
63
|
+
}, []);
|
|
64
|
+
const handleScroll = useCallback((event) => {
|
|
65
|
+
offsetRef.current = event.nativeEvent.contentOffset.x;
|
|
66
|
+
recomputeIndicators();
|
|
67
|
+
}, [recomputeIndicators]);
|
|
68
|
+
const scrollToKey = useCallback((key, animated = true) => {
|
|
69
|
+
const x = key != null ? itemPositions.current[key] : null;
|
|
70
|
+
if (x == null ||
|
|
71
|
+
scrollRef.current == null ||
|
|
72
|
+
viewportWidthRef.current === 0) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const target = Math.max(0, x - (viewportWidthRef.current - itemSize) / 2);
|
|
76
|
+
scrollRef.current.scrollTo({ x: target, animated });
|
|
77
|
+
}, [itemSize]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
scrollToKey(selectedKey);
|
|
80
|
+
}, [selectedKey, scrollToKey]);
|
|
57
81
|
const visibleItems = useMemo(() => getVisibleItems(items), [items]);
|
|
58
82
|
const handleItemPress = useCallback((item) => {
|
|
59
83
|
if (typeof item.onPress === 'function') {
|
|
@@ -65,8 +89,9 @@ const BottomBar = ({ style, items, updateActiveItem = false, itemSize = 50, mana
|
|
|
65
89
|
}
|
|
66
90
|
}, [setSelectedKey, setSelectedItemColor]);
|
|
67
91
|
const renderItem = useCallback((item) => {
|
|
68
|
-
|
|
69
|
-
|
|
92
|
+
const { key, ...itemProps } = item;
|
|
93
|
+
return (<View key={key} onLayout={event => onItemLayout(event, key)} testID={`bar-item-${item.testID}`}>
|
|
94
|
+
<BarItem {...itemProps} title={manageActiveTitle ? undefined : item.title} size={itemSize} onPress={() => handleItemPress(item)} isSelected={selectedKey === item.key && !('onPress' in item)}/>
|
|
70
95
|
</View>);
|
|
71
96
|
}, [manageActiveTitle, itemSize, selectedKey, onItemLayout, handleItemPress]);
|
|
72
97
|
useEffect(() => {
|
|
@@ -85,20 +110,25 @@ const BottomBar = ({ style, items, updateActiveItem = false, itemSize = 50, mana
|
|
|
85
110
|
}, [updateActiveItem, visibleItems]);
|
|
86
111
|
const activeView = useMemo(() => visibleItems.find(_item => _item.key === selectedKey), [selectedKey, visibleItems]);
|
|
87
112
|
return (<View style={styles.container}>
|
|
88
|
-
<View style={
|
|
113
|
+
<View style={styles.viewContainer} testID="bottomBarViewComtainer">
|
|
89
114
|
{activeView?.viewComponent}
|
|
90
115
|
</View>
|
|
91
|
-
<View testID="bottomBarComtainer"
|
|
92
|
-
const { height: barHeight } = event.nativeEvent.layout;
|
|
93
|
-
setViewHeight(WINDOW_HEIGHT -
|
|
94
|
-
StaticSafeAreaInsets.safeAreaInsetsTop -
|
|
95
|
-
headerHeight -
|
|
96
|
-
barHeight);
|
|
97
|
-
}}>
|
|
116
|
+
<View testID="bottomBarComtainer" style={styles.barContainer}>
|
|
98
117
|
<Card style={[styles.bottomContainer, style]}>
|
|
99
|
-
<View style={styles.
|
|
100
|
-
{
|
|
101
|
-
|
|
118
|
+
<View style={styles.scrollWrapper}>
|
|
119
|
+
<ScrollView ref={scrollRef} horizontal showsHorizontalScrollIndicator={false} scrollEventThrottle={16} onScroll={handleScroll} onLayout={event => {
|
|
120
|
+
viewportWidthRef.current = event.nativeEvent.layout.width;
|
|
121
|
+
recomputeIndicators();
|
|
122
|
+
}} onContentSizeChange={width => {
|
|
123
|
+
contentWidthRef.current = width;
|
|
124
|
+
recomputeIndicators();
|
|
125
|
+
if (!didInitialScrollRef.current) {
|
|
126
|
+
didInitialScrollRef.current = true;
|
|
127
|
+
scrollToKey(selectedKey, false);
|
|
128
|
+
}
|
|
129
|
+
}} contentContainerStyle={styles.itemsContainer}>
|
|
130
|
+
{visibleItems.map(renderItem)}
|
|
131
|
+
<Animated.View style={[
|
|
102
132
|
styles.animatedBar,
|
|
103
133
|
animatedStyle,
|
|
104
134
|
{
|
|
@@ -107,6 +137,13 @@ const BottomBar = ({ style, items, updateActiveItem = false, itemSize = 50, mana
|
|
|
107
137
|
: Colors.primaryColor?.background,
|
|
108
138
|
},
|
|
109
139
|
]}/>
|
|
140
|
+
</ScrollView>
|
|
141
|
+
{showLeftIndicator && (<View pointerEvents="none" style={[styles.chevron, styles.chevronLeft]}>
|
|
142
|
+
<Icon name="chevron-left" size={16}/>
|
|
143
|
+
</View>)}
|
|
144
|
+
{showRightIndicator && (<View pointerEvents="none" style={[styles.chevron, styles.chevronRight]}>
|
|
145
|
+
<Icon name="chevron-right" size={16}/>
|
|
146
|
+
</View>)}
|
|
110
147
|
</View>
|
|
111
148
|
<ItemTitle title={manageActiveTitle ? activeView?.title : undefined} style={styles.title}/>
|
|
112
149
|
</Card>
|
|
@@ -117,6 +154,12 @@ const styles = StyleSheet.create({
|
|
|
117
154
|
container: {
|
|
118
155
|
flex: 1,
|
|
119
156
|
},
|
|
157
|
+
viewContainer: {
|
|
158
|
+
flex: 1,
|
|
159
|
+
},
|
|
160
|
+
barContainer: {
|
|
161
|
+
flexShrink: 0,
|
|
162
|
+
},
|
|
120
163
|
bottomContainer: {
|
|
121
164
|
paddingHorizontal: 20,
|
|
122
165
|
paddingRight: 20,
|
|
@@ -126,11 +169,27 @@ const styles = StyleSheet.create({
|
|
|
126
169
|
alignSelf: 'center',
|
|
127
170
|
marginBottom: 10,
|
|
128
171
|
},
|
|
172
|
+
scrollWrapper: {
|
|
173
|
+
position: 'relative',
|
|
174
|
+
},
|
|
129
175
|
itemsContainer: {
|
|
176
|
+
flexGrow: 1,
|
|
130
177
|
flexDirection: 'row',
|
|
131
178
|
justifyContent: 'space-between',
|
|
132
179
|
alignItems: 'flex-end',
|
|
133
180
|
},
|
|
181
|
+
chevron: {
|
|
182
|
+
position: 'absolute',
|
|
183
|
+
top: 0,
|
|
184
|
+
bottom: 0,
|
|
185
|
+
justifyContent: 'center',
|
|
186
|
+
},
|
|
187
|
+
chevronLeft: {
|
|
188
|
+
left: -8,
|
|
189
|
+
},
|
|
190
|
+
chevronRight: {
|
|
191
|
+
right: -8,
|
|
192
|
+
},
|
|
134
193
|
animatedBar: {
|
|
135
194
|
position: 'absolute',
|
|
136
195
|
height: 2,
|