@axelor/aos-mobile-ui 9.1.11 → 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.
- 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 +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,CAAC;IAE/B,MAAM,WAAW,GAAG,WAAW,CAC7B,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EACzB,CAA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AC;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"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAgB9D,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,UAAU,GACM,EAAE,EAAE;IACpB,MAAM,SAAS,GAAG,WAAW,CAC3B,CAAC,GAAgB,EAAE,EAAE,CAAC,CACpB,CAAC,OAAO,CACN,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAC3B,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CACzB,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CACzB,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CACpE,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,eAAe,CAAC,CAC5C,UAAU,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,CAClD,SAAS,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAC5C,aAAa,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,aAAa,CAAC,CAC9D,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAClD,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CACtD,OAAO,CAAC,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.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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,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,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 {
|
|
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 {
|
|
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 ((
|
|
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
|
|
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 && (<
|
|
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={
|
|
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: '
|
|
103
|
+
alignItems: 'stretch',
|
|
104
|
+
flexGrow: 1,
|
|
102
105
|
},
|
|
103
106
|
clearButton: {
|
|
104
|
-
marginRight:
|
|
105
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"ChipSelect.js","sourceRoot":"","sources":["../../../../src/components/organisms/ChipSelect/ChipSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvE,OAAO,EAAoB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAC,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAE/C,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,WAAW,GAAG,CAAC,CAA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
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}
|
|
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;
|
|
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;AAE9C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAkB7C,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,CAAC,MAAM,CAC9C,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAC9B,CAAC;QAEF,IAAI,uBAAuB,GAAG,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,uBAAuB,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,uBAAuB,CAAC;IACjC,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IAEpC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAClD,0BAA0B,EAAE,CAC7B,CAAC;IAEF,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c,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CACjD,QAAQ,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CACvB,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CACzB;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"}
|
|
@@ -10,7 +10,8 @@ interface DropdownMenuItemProps {
|
|
|
10
10
|
hideIf?: boolean;
|
|
11
11
|
disableIf?: boolean;
|
|
12
12
|
customComponent?: ReactElement<any>;
|
|
13
|
-
onPress: (
|
|
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
|
|
19
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
20
20
|
import { useThemeColor } from '../../../theme';
|
|
21
|
-
import {
|
|
22
|
-
import { Badge } from '../../molecules';
|
|
23
|
-
const BADGE_SIZE =
|
|
24
|
-
const DropdownMenuItem = ({ style, styleText, numberOfLines
|
|
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
|
|
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: -
|
|
59
|
-
right: -
|
|
61
|
+
top: -6,
|
|
62
|
+
right: -6,
|
|
60
63
|
zIndex: 10,
|
|
64
|
+
paddingVertical: 0,
|
|
65
|
+
paddingHorizontal: 0,
|
|
61
66
|
},
|
|
62
|
-
badgeText: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|