@cwellt_software/cwellt-reactjs-lib 1.1.7 → 1.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/dist/common/classes/CwSelectList.d.ts +8 -0
- package/dist/common/classes/CwSelectList.d.ts.map +1 -0
- package/dist/common/classes/CwSelectListItems.d.ts +9 -0
- package/dist/common/classes/CwSelectListItems.d.ts.map +1 -0
- package/dist/common/functions/collections.d.ts +15 -0
- package/dist/common/functions/collections.d.ts.map +1 -0
- package/dist/common/functions/colorManipulation.d.ts +6 -0
- package/dist/common/functions/colorManipulation.d.ts.map +1 -0
- package/dist/common/functions/dsl/UiEventDSL.d.ts +9 -0
- package/dist/common/functions/dsl/UiEventDSL.d.ts.map +1 -0
- package/dist/common/functions/useSingleAndDoubleClicks.d.ts +7 -0
- package/dist/common/functions/useSingleAndDoubleClicks.d.ts.map +1 -0
- package/dist/common/interfaces/CwSelectListProps.d.ts +9 -0
- package/dist/common/interfaces/CwSelectListProps.d.ts.map +1 -0
- package/dist/components/control/action/button/CwButton.d.ts +26 -0
- package/dist/components/control/action/button/CwButton.d.ts.map +1 -0
- package/dist/components/control/action/buttons/CwButtons.d.ts +59 -0
- package/dist/components/control/action/buttons/CwButtons.d.ts.map +1 -0
- package/dist/components/control/action/contextmenu/CwContextMenu.d.ts +23 -0
- package/dist/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -0
- package/dist/components/control/action/contextual-menu/CwContextualMenu.d.ts +29 -0
- package/dist/components/control/action/contextual-menu/CwContextualMenu.d.ts.map +1 -0
- package/dist/components/control/action/search/CwSearch.d.ts +16 -0
- package/dist/components/control/action/search/CwSearch.d.ts.map +1 -0
- package/dist/components/control/choice/checkbox/CwCheckbox.d.ts +17 -0
- package/dist/components/control/choice/checkbox/CwCheckbox.d.ts.map +1 -0
- package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts +24 -0
- package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +1 -0
- package/dist/components/control/choice/dropdown/CwDropdown.d.ts +19 -0
- package/dist/components/control/choice/dropdown/CwDropdown.d.ts.map +1 -0
- package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts +17 -0
- package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +1 -0
- package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts +28 -0
- package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +1 -0
- package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts +21 -0
- package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +1 -0
- package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts +158 -0
- package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -0
- package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +33 -0
- package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +1 -0
- package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts +16 -0
- package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts.map +1 -0
- package/dist/components/control/choice/multiselect/CwMultiselect.d.ts +13 -0
- package/dist/components/control/choice/multiselect/CwMultiselect.d.ts.map +1 -0
- package/dist/components/control/choice/multiselect/CwOptionList.d.ts +15 -0
- package/dist/components/control/choice/multiselect/CwOptionList.d.ts.map +1 -0
- package/dist/components/control/choice/option/CwOption.d.ts +17 -0
- package/dist/components/control/choice/option/CwOption.d.ts.map +1 -0
- package/dist/components/control/choice/select/CwSelect.d.ts +48 -0
- package/dist/components/control/choice/select/CwSelect.d.ts.map +1 -0
- package/dist/components/control/choice/toggle/CwToggle.d.ts +28 -0
- package/dist/components/control/choice/toggle/CwToggle.d.ts.map +1 -0
- package/dist/components/control/input/any/CwInput.d.ts +17 -0
- package/dist/components/control/input/any/CwInput.d.ts.map +1 -0
- package/dist/components/control/input/date/CwInputDate.d.ts +40 -0
- package/dist/components/control/input/date/CwInputDate.d.ts.map +1 -0
- package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts +7 -0
- package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts.map +1 -0
- package/dist/components/control/input/date-text/CwInputDateText.d.ts +38 -0
- package/dist/components/control/input/date-text/CwInputDateText.d.ts.map +1 -0
- package/dist/components/control/input/datetime/CwInputDatetime.d.ts +40 -0
- package/dist/components/control/input/datetime/CwInputDatetime.d.ts.map +1 -0
- package/dist/components/control/input/digit/CwDigit.d.ts +40 -0
- package/dist/components/control/input/digit/CwDigit.d.ts.map +1 -0
- package/dist/components/control/input/file/CwFileUpload.d.ts +18 -0
- package/dist/components/control/input/file/CwFileUpload.d.ts.map +1 -0
- package/dist/components/control/input/file/CwFileUploadMultiple.d.ts +15 -0
- package/dist/components/control/input/file/CwFileUploadMultiple.d.ts.map +1 -0
- package/dist/components/control/input/image/CwInputImage.d.ts +7 -0
- package/dist/components/control/input/image/CwInputImage.d.ts.map +1 -0
- package/dist/components/control/input/image-area/CwImageArea.d.ts +53 -0
- package/dist/components/control/input/image-area/CwImageArea.d.ts.map +1 -0
- package/dist/components/control/input/number/CwInputNumber.d.ts +20 -0
- package/dist/components/control/input/number/CwInputNumber.d.ts.map +1 -0
- package/dist/components/control/input/phone/CwInputPhone.d.ts +36 -0
- package/dist/components/control/input/phone/CwInputPhone.d.ts.map +1 -0
- package/dist/components/control/input/text/CwInputText.d.ts +40 -0
- package/dist/components/control/input/text/CwInputText.d.ts.map +1 -0
- package/dist/components/control/input/text-area/CwTextArea.d.ts +24 -0
- package/dist/components/control/input/text-area/CwTextArea.d.ts.map +1 -0
- package/dist/components/control/input/time/CwTime.d.ts +40 -0
- package/dist/components/control/input/time/CwTime.d.ts.map +1 -0
- package/dist/components/control/input/weekday/CwWeekdaySelector.d.ts +53 -0
- package/dist/components/control/input/weekday/CwWeekdaySelector.d.ts.map +1 -0
- package/dist/components/custom/find-airport/CwFindAirportComp.d.ts +35 -0
- package/dist/components/custom/find-airport/CwFindAirportComp.d.ts.map +1 -0
- package/dist/components/custom/scheduler/CwSchedulerComp.d.ts +19 -0
- package/dist/components/custom/scheduler/CwSchedulerComp.d.ts.map +1 -0
- package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts +86 -0
- package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/EventRender.d.ts +10 -0
- package/dist/components/custom/scheduler/components/EventRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/ResourceListRender.d.ts +20 -0
- package/dist/components/custom/scheduler/components/ResourceListRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/ResourceRender.d.ts +14 -0
- package/dist/components/custom/scheduler/components/ResourceRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts +11 -0
- package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts +11 -0
- package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts +13 -0
- package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts +11 -0
- package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts +14 -0
- package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts +23 -0
- package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts +8 -0
- package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts +12 -0
- package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts +12 -0
- package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts +10 -0
- package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts.map +1 -0
- package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts +12 -0
- package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts +7 -0
- package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts +10 -0
- package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +7 -0
- package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts +8 -0
- package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts +3 -0
- package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts +3 -0
- package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts +13 -0
- package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts +17 -0
- package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts +3 -0
- package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/state_handle/doubleClickOnResource.d.ts +4 -0
- package/dist/components/custom/scheduler/logic/state_handle/doubleClickOnResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/state_handle/onDragOver.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/state_handle/onDragOver.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/state_handle/onDropEventToResource.d.ts +5 -0
- package/dist/components/custom/scheduler/logic/state_handle/onDropEventToResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts +3 -0
- package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts +4 -0
- package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts +2 -0
- package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts.map +1 -0
- package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts +3 -0
- package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts +11 -0
- package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts +43 -0
- package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/Resource.d.ts +14 -0
- package/dist/components/custom/scheduler/state/Resource.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/State.d.ts +19 -0
- package/dist/components/custom/scheduler/state/State.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/cblEvent.d.ts +18 -0
- package/dist/components/custom/scheduler/state/cblEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts +7 -0
- package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts.map +1 -0
- package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts +6 -0
- package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/NewScheduler.d.ts +29 -0
- package/dist/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.d.ts +80 -0
- package/dist/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts +27 -0
- package/dist/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts +19 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts +10 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.d.ts +5 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts +17 -0
- package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts +8 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts +17 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/Event.d.ts +34 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/EventSideDrag.d.ts +8 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/EventSideDrag.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +27 -0
- package/dist/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts +10 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts +15 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.d.ts +11 -0
- package/dist/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/helpers.d.ts +19 -0
- package/dist/components/custom/scheduler-new/presentation/helpers.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/WeekendCalc.d.ts +4 -0
- package/dist/components/custom/scheduler-new/presentation/logic/WeekendCalc.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/dateFromPercentage.d.ts +2 -0
- package/dist/components/custom/scheduler-new/presentation/logic/dateFromPercentage.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts +2 -0
- package/dist/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts +6 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts +3 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getEventSizes.d.ts +6 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getEventSizes.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.d.ts +4 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts +2 -0
- package/dist/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts +3 -0
- package/dist/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts +4 -0
- package/dist/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts +12 -0
- package/dist/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts.map +1 -0
- package/dist/components/custom/scheduler-new/presentation/state/ui/WeekRange.d.ts +5 -0
- package/dist/components/custom/scheduler-new/presentation/state/ui/WeekRange.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts +24 -0
- package/dist/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts +86 -0
- package/dist/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/EventRender.d.ts +10 -0
- package/dist/components/custom/scheduler-temporal/components/EventRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/ResourceListRender.d.ts +20 -0
- package/dist/components/custom/scheduler-temporal/components/ResourceListRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/ResourceRender.d.ts +14 -0
- package/dist/components/custom/scheduler-temporal/components/ResourceRender.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts +11 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts +11 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts +13 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts +11 -0
- package/dist/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts +14 -0
- package/dist/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts +23 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts +8 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts +12 -0
- package/dist/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts +12 -0
- package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts +10 -0
- package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts +12 -0
- package/dist/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts +7 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts +10 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +7 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts +8 -0
- package/dist/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +15 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts +3 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts +3 -0
- package/dist/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts +13 -0
- package/dist/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +17 -0
- package/dist/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +3 -0
- package/dist/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts +4 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts +5 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts +4 -0
- package/dist/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +3 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts +6 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts +2 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts +3 -0
- package/dist/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts +11 -0
- package/dist/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts +43 -0
- package/dist/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/Resource.d.ts +14 -0
- package/dist/components/custom/scheduler-temporal/state/Resource.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/State.d.ts +25 -0
- package/dist/components/custom/scheduler-temporal/state/State.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/cblEvent.d.ts +18 -0
- package/dist/components/custom/scheduler-temporal/state/cblEvent.d.ts.map +1 -0
- package/dist/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts +7 -0
- package/dist/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts.map +1 -0
- package/dist/components/custom/super-scheduler/PinRowHeader.d.ts +15 -0
- package/dist/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -0
- package/dist/components/custom/super-scheduler/SuperScheduler.d.ts +25 -0
- package/dist/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -0
- package/dist/components/custom/super-scheduler/SuperSchedulerEvents.d.ts +13 -0
- package/dist/components/custom/super-scheduler/SuperSchedulerEvents.d.ts.map +1 -0
- package/dist/components/custom/super-scheduler/SuperSchedulerPresenter.d.ts +9 -0
- package/dist/components/custom/super-scheduler/SuperSchedulerPresenter.d.ts.map +1 -0
- package/dist/components/display/data/accordion/CwAccordionContainer.d.ts +14 -0
- package/dist/components/display/data/accordion/CwAccordionContainer.d.ts.map +1 -0
- package/dist/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +15 -0
- package/dist/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -0
- package/dist/components/display/data/table/CwTable.d.ts +102 -0
- package/dist/components/display/data/table/CwTable.d.ts.map +1 -0
- package/dist/components/display/graphics/icon/CwIcon.d.ts +15 -0
- package/dist/components/display/graphics/icon/CwIcon.d.ts.map +1 -0
- package/dist/components/display/graphics/loading/CwLoading.d.ts +42 -0
- package/dist/components/display/graphics/loading/CwLoading.d.ts.map +1 -0
- package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts +18 -0
- package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +1 -0
- package/dist/components/display/text/heading/CwHeadingMain.d.ts +3 -0
- package/dist/components/display/text/heading/CwHeadingMain.d.ts.map +1 -0
- package/dist/components/display/text/heading/CwHeadingSecond.d.ts +3 -0
- package/dist/components/display/text/heading/CwHeadingSecond.d.ts.map +1 -0
- package/dist/components/display/text/label/CwLabel.d.ts +28 -0
- package/dist/components/display/text/label/CwLabel.d.ts.map +1 -0
- package/dist/components/display/text/message/CwMessage.d.ts +31 -0
- package/dist/components/display/text/message/CwMessage.d.ts.map +1 -0
- package/dist/components/display/text/tag/CwChip.d.ts +36 -0
- package/dist/components/display/text/tag/CwChip.d.ts.map +1 -0
- package/dist/components/display/text/tag/CwTag.d.ts +16 -0
- package/dist/components/display/text/tag/CwTag.d.ts.map +1 -0
- package/dist/components/display/text/tooltip/CwTooltip.d.ts +8 -0
- package/dist/components/display/text/tooltip/CwTooltip.d.ts.map +1 -0
- package/dist/components/layout/align/CwAlign.d.ts +54 -0
- package/dist/components/layout/align/CwAlign.d.ts.map +1 -0
- package/dist/components/layout/card/CwCard.d.ts +61 -0
- package/dist/components/layout/card/CwCard.d.ts.map +1 -0
- package/dist/components/layout/card/CwCardList.d.ts +32 -0
- package/dist/components/layout/card/CwCardList.d.ts.map +1 -0
- package/dist/components/layout/dialog/CwDialog.d.ts +28 -0
- package/dist/components/layout/dialog/CwDialog.d.ts.map +1 -0
- package/dist/components/layout/dialog/CwDialogManager.d.ts +11 -0
- package/dist/components/layout/dialog/CwDialogManager.d.ts.map +1 -0
- package/dist/components/layout/list/details/CwExpandable.d.ts +23 -0
- package/dist/components/layout/list/details/CwExpandable.d.ts.map +1 -0
- package/dist/components/layout/list/key-value/CwKeyValueList.d.ts +33 -0
- package/dist/components/layout/list/key-value/CwKeyValueList.d.ts.map +1 -0
- package/dist/components/layout/modal/CwModalReportFunctional.d.ts +15 -0
- package/dist/components/layout/modal/CwModalReportFunctional.d.ts.map +1 -0
- package/dist/components/layout/modal/hover/CwModalHover.d.ts +19 -0
- package/dist/components/layout/modal/hover/CwModalHover.d.ts.map +1 -0
- package/dist/components/layout/modal/legacy/cw_modal.d.ts +22 -0
- package/dist/components/layout/modal/legacy/cw_modal.d.ts.map +1 -0
- package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts +16 -0
- package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +1 -0
- package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts +21 -0
- package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +1 -0
- package/dist/components/layout/modal/legacy/cw_modal_report.d.ts +32 -0
- package/dist/components/layout/modal/legacy/cw_modal_report.d.ts.map +1 -0
- package/dist/{src/components/layout/table/grouped/CwTableGrouped.js → components/layout/table/grouped/CwTableGrouped.d.ts} +23 -13
- package/dist/components/layout/table/grouped/CwTableGrouped.d.ts.map +1 -0
- package/dist/components/layout/tabs/CwTabs.d.ts +46 -0
- package/dist/components/layout/tabs/CwTabs.d.ts.map +1 -0
- package/dist/content/icons/new-cw-icons/NewCwIcons.html +13 -3
- package/dist/content/icons/new-cw-icons/NewCwIcons.json +10 -1
- package/dist/content/icons/new-cw-icons/css/new-cw-icons.css +39 -2
- package/dist/content/icons/new-cw-icons/fonts/NewCwIcons.woff +0 -0
- package/dist/index.cjs.js +891 -1373
- package/dist/index.css +1 -7
- package/dist/index.d.ts +4 -236
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +893 -1327
- package/dist/src/components/control/action/button/CwButton.d.ts +5 -2
- package/dist/src/components/control/action/button/CwButton.d.ts.map +1 -1
- package/dist/src/components/control/action/buttons/CwButtons.d.ts +24 -54
- package/dist/src/components/control/action/buttons/CwButtons.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts +80 -0
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts.map +1 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts +0 -11
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/search/CwSearch.d.ts +6 -2
- package/dist/src/components/control/action/search/CwSearch.d.ts.map +1 -1
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts +1 -5
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -1
- package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +2 -2
- package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +1 -1
- package/dist/src/components/control/choice/toggle/CwToggle.d.ts.map +1 -1
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts +1 -0
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts +5 -3
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.d.ts +3 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.d.ts +2 -2
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/dateRangePresets.d.ts.map +1 -1
- package/dist/src/components/control/input/text/CwInputText.d.ts.map +1 -1
- package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts +4 -1
- package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler/components/ResourceListRender.d.ts +1 -1
- package/dist/src/components/custom/scheduler/components/ResourceListRender.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts +3 -4
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts +2 -2
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +2 -2
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts +1 -0
- package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts.map +1 -1
- package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts +2 -2
- package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -1
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts +2 -2
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -1
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +1 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/table/CwTable.d.ts +25 -20
- package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
- package/dist/src/components/display/graphics/icon/CwIcon.d.ts.map +1 -1
- package/dist/src/components/display/graphics/icon/svg-icons.d.ts +6 -0
- package/dist/src/components/display/graphics/icon/svg-icons.d.ts.map +1 -0
- package/dist/src/components/display/text/label/CwLabel.d.ts +1 -4
- package/dist/src/components/display/text/label/CwLabel.d.ts.map +1 -1
- package/dist/src/components/display/text/tag/CwChip.d.ts.map +1 -1
- package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
- package/dist/src/components/layout/modal/CwModalReportFunctional.d.ts.map +1 -1
- package/dist/src/components/layout/modal/legacy/cw_modal.d.ts +4 -0
- package/dist/src/components/layout/modal/legacy/cw_modal.d.ts.map +1 -1
- package/dist/src/components/layout/tabs/CwTabs.d.ts +2 -0
- package/dist/src/components/layout/tabs/CwTabs.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -11
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +7 -12
- package/dist/playground/main.d.ts +0 -4
- package/dist/playground/main.d.ts.map +0 -1
- package/dist/src/common/classes/CwSelectList.js +0 -12
- package/dist/src/common/classes/CwSelectListItems.js +0 -14
- package/dist/src/common/functions/collections.js +0 -18
- package/dist/src/common/functions/colorManipulation.js +0 -76
- package/dist/src/common/functions/dsl/UiEventDSL.js +0 -20
- package/dist/src/common/functions/useSingleAndDoubleClicks.js +0 -28
- package/dist/src/common/interfaces/CwSelectListProps.js +0 -1
- package/dist/src/components/control/action/button/CwButton.js +0 -13
- package/dist/src/components/control/action/buttons/CwButtons.js +0 -188
- package/dist/src/components/control/action/contextmenu/CwContextMenu.js +0 -43
- package/dist/src/components/control/action/contextual-menu/CwContextualMenu.js +0 -55
- package/dist/src/components/control/action/search/CwSearch.js +0 -67
- package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.js +0 -11
- package/dist/src/components/control/choice/checkbox/CwCheckbox.js +0 -15
- package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.js +0 -99
- package/dist/src/components/control/choice/dropdown/CwDropdown.js +0 -27
- package/dist/src/components/control/choice/dropdown/CwDropdownContainer.js +0 -30
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.js +0 -10
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.js +0 -298
- package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.js +0 -17
- package/dist/src/components/control/choice/multiselect/CwHeadFilter.js +0 -80
- package/dist/src/components/control/choice/multiselect/CwMultiselect.js +0 -393
- package/dist/src/components/control/choice/multiselect/CwOptionList.js +0 -36
- package/dist/src/components/control/choice/option/CwOption.js +0 -16
- package/dist/src/components/control/choice/select/CwSelect.js +0 -36
- package/dist/src/components/control/choice/toggle/CwToggle.js +0 -9
- package/dist/src/components/control/input/any/CwInput.js +0 -16
- package/dist/src/components/control/input/color/CwColorPicker.js +0 -210
- package/dist/src/components/control/input/color/CwInputColor.js +0 -142
- package/dist/src/components/control/input/date/CwInputDate.js +0 -29
- package/dist/src/components/control/input/date-picker/CwInputDatePicker.js +0 -109
- package/dist/src/components/control/input/date-text/CwInputDateText.js +0 -90
- package/dist/src/components/control/input/datetime/CwInputDatetime.js +0 -29
- package/dist/src/components/control/input/digit/CwDigit.js +0 -28
- package/dist/src/components/control/input/file/CwFileUpload.js +0 -52
- package/dist/src/components/control/input/file/CwFileUploadMultiple.js +0 -148
- package/dist/src/components/control/input/image/CwInputImage.js +0 -52
- package/dist/src/components/control/input/image-area/CwImageArea.js +0 -113
- package/dist/src/components/control/input/number/CwInputNumber.js +0 -11
- package/dist/src/components/control/input/phone/CwInputPhone.js +0 -24
- package/dist/src/components/control/input/text/CwInputText.js +0 -31
- package/dist/src/components/control/input/text-area/CwTextArea.js +0 -9
- package/dist/src/components/control/input/time/CwTime.js +0 -29
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.js +0 -143
- package/dist/src/components/custom/find-airport/CwFindAirportComp.js +0 -240
- package/dist/src/components/custom/scheduler/CwSchedulerComp.js +0 -211
- package/dist/src/components/custom/scheduler/CwSuperSchedulerComp.js +0 -269
- package/dist/src/components/custom/scheduler/components/EventRender.js +0 -142
- package/dist/src/components/custom/scheduler/components/ResourceListRender.js +0 -12
- package/dist/src/components/custom/scheduler/components/ResourceRender.js +0 -26
- package/dist/src/components/custom/scheduler/components/day_headers/DayHeader.js +0 -13
- package/dist/src/components/custom/scheduler/components/day_headers/MonthHeader.js +0 -12
- package/dist/src/components/custom/scheduler/components/day_headers/MyDaysHeader.js +0 -62
- package/dist/src/components/custom/scheduler/components/day_headers/WeekHeader.js +0 -13
- package/dist/src/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.js +0 -24
- package/dist/src/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.js +0 -17
- package/dist/src/components/custom/scheduler/components/scheduler_header/SchedulerHeader.js +0 -26
- package/dist/src/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
- package/dist/src/components/custom/scheduler/components/time_headers/TimeHeader.js +0 -31
- package/dist/src/components/custom/scheduler/components/time_headers/TimeHeaderRow.js +0 -16
- package/dist/src/components/custom/scheduler/components/time_line/TimeLine.js +0 -12
- package/dist/src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.js +0 -5
- package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDates.js +0 -15
- package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
- package/dist/src/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.js +0 -43
- package/dist/src/components/custom/scheduler/logic/dates/getMonthHeaderData.js +0 -35
- package/dist/src/components/custom/scheduler/logic/dates/getUtcToday.js +0 -6
- package/dist/src/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
- package/dist/src/components/custom/scheduler/logic/dates/listOfDatesToWeeks.js +0 -55
- package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisionType.js +0 -13
- package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisions.js +0 -16
- package/dist/src/components/custom/scheduler/logic/filtering/filterEvents.js +0 -33
- package/dist/src/components/custom/scheduler/logic/filtering/filterResources.js +0 -14
- package/dist/src/components/custom/scheduler/logic/filtering/hasSameProperties.js +0 -10
- package/dist/src/components/custom/scheduler/logic/onDrop/OnDrop.js +0 -45
- package/dist/src/components/custom/scheduler/logic/pixels/getHeightLineScheduler.js +0 -14
- package/dist/src/components/custom/scheduler/logic/pixels/getPixelsForEvent.js +0 -32
- package/dist/src/components/custom/scheduler/logic/pixels/heightScheduler.js +0 -14
- package/dist/src/components/custom/scheduler/logic/pixels/heightSchedulerPinned.js +0 -9
- package/dist/src/components/custom/scheduler/logic/state_handle/doubleClickOnResource.js +0 -5
- package/dist/src/components/custom/scheduler/logic/state_handle/handleResourceChange.js +0 -11
- package/dist/src/components/custom/scheduler/logic/state_handle/onDragOver.js +0 -9
- package/dist/src/components/custom/scheduler/logic/state_handle/onDropEventToResource.js +0 -3
- package/dist/src/components/custom/scheduler/logic/strings/compareStrings.js +0 -7
- package/dist/src/components/custom/scheduler/logic/strings/getGUID.js +0 -7
- package/dist/src/components/custom/scheduler/logic/ui/checkIfSlotAvailable.js +0 -8
- package/dist/src/components/custom/scheduler/logic/ui/getEventsOfResource.js +0 -45
- package/dist/src/components/custom/scheduler/logic/ui/getTimeHeaders.js +0 -35
- package/dist/src/components/custom/scheduler/logic/ui/isAllowedToMove.js +0 -19
- package/dist/src/components/custom/scheduler/logic/ui/updateResourceVisibility.js +0 -15
- package/dist/src/components/custom/scheduler/state/CblDragAndDrop.js +0 -18
- package/dist/src/components/custom/scheduler/state/CwSchedulerProps.js +0 -1
- package/dist/src/components/custom/scheduler/state/Resource.js +0 -18
- package/dist/src/components/custom/scheduler/state/State.js +0 -1
- package/dist/src/components/custom/scheduler/state/cblEvent.js +0 -28
- package/dist/src/components/custom/scheduler/state/cblEventCompProps.js +0 -1
- package/dist/src/components/custom/scheduler/state/resourceCompProps2.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.js +0 -123
- package/dist/src/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.js +0 -118
- package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.js +0 -166
- package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.js +0 -26
- package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.js +0 -86
- package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.js +0 -60
- package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.js +0 -24
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.js +0 -150
- package/dist/src/components/custom/scheduler-new/presentation/components/row/EventSideDrag.js +0 -11
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.js +0 -176
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.js +0 -39
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/helpers.js +0 -43
- package/dist/src/components/custom/scheduler-new/presentation/logic/WeekendCalc.js +0 -24
- package/dist/src/components/custom/scheduler-new/presentation/logic/dateFromPercentage.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.js +0 -113
- package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.js +0 -21
- package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizes.js +0 -30
- package/dist/src/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.js +0 -13
- package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.js +0 -32
- package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.js +0 -12
- package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/state/ui/WeekRange.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.js +0 -267
- package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.js +0 -269
- package/dist/src/components/custom/scheduler-temporal/components/EventRender.js +0 -142
- package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.js +0 -26
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.js +0 -62
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.js +0 -22
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.js +0 -17
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.js +0 -26
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.js +0 -31
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.js +0 -16
- package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.js +0 -15
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.js +0 -43
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.js +0 -35
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.js +0 -6
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
- package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.js +0 -55
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.js +0 -16
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.js +0 -10
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.js +0 -34
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.js +0 -10
- package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.js +0 -36
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.js +0 -32
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.js +0 -178
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.js +0 -11
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.js +0 -3
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.js +0 -3
- package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.js +0 -7
- package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.js +0 -7
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.js +0 -92
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.js +0 -242
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.js +0 -35
- package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.js +0 -19
- package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.js +0 -241
- package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.js +0 -15
- package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.js +0 -18
- package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/Resource.js +0 -18
- package/dist/src/components/custom/scheduler-temporal/state/State.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/cblEvent.js +0 -28
- package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.js +0 -1
- package/dist/src/components/custom/super-scheduler/PinRowHeader.js +0 -53
- package/dist/src/components/custom/super-scheduler/SuperScheduler.js +0 -23
- package/dist/src/components/custom/super-scheduler/SuperSchedulerEvents.js +0 -15
- package/dist/src/components/custom/super-scheduler/SuperSchedulerPresenter.js +0 -45
- package/dist/src/components/display/data/accordion/CwAccordionContainer.js +0 -20
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.js +0 -138
- package/dist/src/components/display/data/table/CwTable.js +0 -203
- package/dist/src/components/display/graphics/icon/CwIcon.js +0 -23
- package/dist/src/components/display/graphics/loading/CwLoading.js +0 -27
- package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.js +0 -20
- package/dist/src/components/display/text/heading/CwHeadingMain.js +0 -5
- package/dist/src/components/display/text/heading/CwHeadingSecond.js +0 -5
- package/dist/src/components/display/text/label/CwLabel.js +0 -13
- package/dist/src/components/display/text/message/CwMessage.js +0 -75
- package/dist/src/components/display/text/note/CwNote.js +0 -78
- package/dist/src/components/display/text/tag/CwChip.js +0 -57
- package/dist/src/components/display/text/tag/CwTag.js +0 -21
- package/dist/src/components/display/text/tooltip/CwTooltip.js +0 -4
- package/dist/src/components/layout/align/CwAlign.js +0 -54
- package/dist/src/components/layout/card/CwCard.js +0 -55
- package/dist/src/components/layout/card/CwCardList.js +0 -38
- package/dist/src/components/layout/dialog/CwDialog.js +0 -255
- package/dist/src/components/layout/dialog/CwDialogManager.js +0 -44
- package/dist/src/components/layout/list/details/CwExpandable.js +0 -28
- package/dist/src/components/layout/list/key-value/CwKeyValueList.js +0 -23
- package/dist/src/components/layout/list/sortable/CwSortableList.js +0 -73
- package/dist/src/components/layout/list/sortable/useSortableList.js +0 -53
- package/dist/src/components/layout/modal/CwModalReportFunctional.js +0 -23
- package/dist/src/components/layout/modal/hover/CwModalHover.js +0 -61
- package/dist/src/components/layout/modal/legacy/cw_modal.js +0 -44
- package/dist/src/components/layout/modal/legacy/cw_modal_confirm.js +0 -39
- package/dist/src/components/layout/modal/legacy/cw_modal_iframe.js +0 -44
- package/dist/src/components/layout/modal/legacy/cw_modal_report.js +0 -26
- package/dist/src/components/layout/tabs/CwTabs.js +0 -53
- package/dist/src/dev/index.d.ts +0 -5
- package/dist/src/dev/index.d.ts.map +0 -1
- package/dist/src/dev/palette.d.ts +0 -3
- package/dist/src/dev/palette.d.ts.map +0 -1
- package/dist/src/dev/previews.d.ts +0 -3
- package/dist/src/dev/previews.d.ts.map +0 -1
- package/dist/src/dev/useInitial.d.ts +0 -3
- package/dist/src/dev/useInitial.d.ts.map +0 -1
- package/dist/src/index.js +0 -187
- package/dist/test/components/custom/new-scheduler/presentation/logic/getDefaultDivisions.test.js +0 -48
- package/dist/test/components/custom/new-scheduler/presentation/logic/hoursBetween.test.js +0 -15
- package/dist/test/components/custom/new-scheduler/presentation/logic/monthDivisions.test.js +0 -42
- package/dist/test/components/custom/new-scheduler/presentation/logic/weekendCalc.test.js +0 -30
- package/dist/test/components/custom/scheduler/addMinutesToDateFromPx.test.js +0 -43
- package/dist/test/components/custom/scheduler/checkIfSlotAvailable.test.js +0 -30
- package/dist/test/components/custom/scheduler/daysBetweenTwoDates.test.js +0 -61
- package/dist/test/components/custom/scheduler/daysBetweenTwoDatesWithoutCeilForEvent.test.js +0 -27
- package/dist/test/components/custom/scheduler/getGUID.test.js +0 -30
- package/dist/test/components/custom/scheduler/getPixelsForEvent.test.js +0 -38
- package/dist/test/components/custom/scheduler/getTimeHeaders.test.js +0 -35
- package/dist/test/components/custom/scheduler/hasSameProperties.test.js +0 -51
- package/dist/test/components/custom/scheduler/isAllowedToMove.test.js +0 -28
- package/dist/test/components/custom/scheduler/listOfDatesToWeeks.test.js +0 -72
- package/dist/test/jest.setup.js +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useEffect, useState, useCallback, useRef, useMemo, forwardRef, useLayoutEffect, useImperativeHandle, createElement, memo, Fragment as Fragment$1, Component } from 'react';
|
|
3
|
+
import React__default, { cloneElement, useEffect, useState, useCallback, useRef, useMemo, forwardRef, useLayoutEffect, useImperativeHandle, createElement, memo, Fragment as Fragment$1, Component } from 'react';
|
|
4
4
|
import { createRoot } from 'react-dom/client';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
|
-
import { Tooltip,
|
|
6
|
+
import { Tooltip, Dropdown, Menu } from 'antd';
|
|
7
7
|
import Draggable from 'react-draggable';
|
|
8
8
|
import moment from 'moment';
|
|
9
9
|
import { format } from 'date-fns';
|
|
10
10
|
import { enGB } from 'date-fns/locale';
|
|
11
11
|
import { DayPicker, useNavigation } from 'react-day-picker';
|
|
12
12
|
import 'react-day-picker/dist/style.css';
|
|
13
|
-
import
|
|
13
|
+
import { cloneDeep } from 'lodash-es';
|
|
14
14
|
import { VariableSizeList } from 'react-window';
|
|
15
15
|
|
|
16
16
|
class CwSelectList {
|
|
@@ -51,70 +51,16 @@ function CwHeadingSecond(props) {
|
|
|
51
51
|
return (jsx("div", { className: "cw-heading", children: jsx("h3", { className: "cwHeading_desc", ...headingProps, children: children }) }));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* General purpose aligner flex container, useful for column or row view.
|
|
56
|
-
* @remarks
|
|
57
|
-
* ```txt
|
|
58
|
-
* flexDirection="row" (default):
|
|
59
|
-
*
|
|
60
|
-
* <Row A> | - item 1 - item 2 - item 3 |
|
|
61
|
-
* <Row B> | - item 1 - item 2 - item 3 |
|
|
62
|
-
*
|
|
63
|
-
* flexDirection="column":
|
|
64
|
-
*
|
|
65
|
-
* <Col A> <Col B>
|
|
66
|
-
* | - item 1 | - item 1 |
|
|
67
|
-
* | - item 2 | - item 2 |
|
|
68
|
-
* | - item 3 | - item 3 |
|
|
69
|
-
*
|
|
70
|
-
* ```
|
|
71
|
-
* @example
|
|
72
|
-
* <CwAlign flexDirection="column">
|
|
73
|
-
* <div>
|
|
74
|
-
* <h2>ColumnA</h2>
|
|
75
|
-
* </div>
|
|
76
|
-
* <div>
|
|
77
|
-
* <h2>ColumnB</h2>
|
|
78
|
-
* </div>
|
|
79
|
-
* </CwAlign>
|
|
80
|
-
*/
|
|
81
|
-
function CwAlign(props) {
|
|
82
|
-
const { alignContent, alignItems, alignSelf, bottom, display, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, cssHeight, justifyContent, left, margin, order, padding, position, right, top, cssWidth, gap, ...divProps } = props;
|
|
83
|
-
return (jsx("div", { className: "cw-align", ...divProps, style: {
|
|
84
|
-
alignContent: alignContent,
|
|
85
|
-
alignItems: alignItems,
|
|
86
|
-
alignSelf: alignSelf,
|
|
87
|
-
bottom: bottom,
|
|
88
|
-
display: display ?? "flex",
|
|
89
|
-
flexBasis: flexBasis,
|
|
90
|
-
flexDirection: flexDirection,
|
|
91
|
-
flexGrow: flexGrow,
|
|
92
|
-
flexShrink: flexShrink,
|
|
93
|
-
flexWrap: flexWrap,
|
|
94
|
-
height: cssHeight,
|
|
95
|
-
justifyContent: justifyContent,
|
|
96
|
-
left: left,
|
|
97
|
-
margin: margin,
|
|
98
|
-
order: order,
|
|
99
|
-
padding: padding,
|
|
100
|
-
position: position,
|
|
101
|
-
right: right,
|
|
102
|
-
top: top,
|
|
103
|
-
width: cssWidth,
|
|
104
|
-
gap: gap
|
|
105
|
-
}, children: props.children }));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
54
|
/**
|
|
109
55
|
* Label for form controls.
|
|
110
56
|
* @example
|
|
111
57
|
* ```tsx
|
|
112
|
-
* <
|
|
58
|
+
* <CwLabel justify="right" >Username:</CwLabel>
|
|
113
59
|
* ```
|
|
114
60
|
*/
|
|
115
61
|
function CwLabel(props) {
|
|
116
|
-
const { justify, text, labelHeight, labelWidth,
|
|
117
|
-
return (jsx("
|
|
62
|
+
const { justify, text, labelHeight, labelWidth, margin, ...labelProps } = props;
|
|
63
|
+
return (jsx("label", { className: "cw-label", style: { textAlign: justify, width: labelWidth, height: labelHeight, margin: margin ?? "1px 0 0 0" }, ...labelProps, children: labelProps.children ?? text }));
|
|
118
64
|
}
|
|
119
65
|
|
|
120
66
|
function CwTooltip(CwelltTooltipProps) {
|
|
@@ -198,6 +144,11 @@ function getContrastColor(color) {
|
|
|
198
144
|
return `hsl(${hsl.h}, ${contrastS}%, ${contrastL}%)`;
|
|
199
145
|
}
|
|
200
146
|
|
|
147
|
+
const SVG_ICONS = {
|
|
148
|
+
'sortable-asc': (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 128 128", fill: "currentColor", children: [jsx("path", { d: "M93.1675 73.1739C94.5691 74.5758 94.7323 76.7924 93.5515 78.3846L93.1675 78.8326L63.6741 108.326L34.1755 78.8326C32.6908 77.3518 32.6014 74.9761 33.9708 73.3881C35.3401 71.8001 37.7033 71.5391 39.3861 72.7899L39.8341 73.1739L63.6741 97.0137L87.5088 73.1739C88.9104 71.7726 91.1274 71.6092 92.7194 72.7899L93.1674 73.1739H93.1675Z", opacity: "0.3" }), jsx("path", { d: "M34.1714 55.1518C32.7697 53.7499 32.6066 51.5333 33.7874 49.9411L34.1714 49.4931L63.6647 20L93.1634 49.4931C94.6481 50.9739 94.7375 53.3496 93.3681 54.9376C91.9987 56.5256 89.6356 56.7866 87.9527 55.5358L87.5047 55.1517L63.6647 31.312L39.8301 55.1518C38.4285 56.5531 36.2115 56.7165 34.6195 55.5358L34.1715 55.1518L34.1714 55.1518Z", opacity: "1" })] })),
|
|
149
|
+
'sortable-desc': (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 128 128", fill: "currentColor", children: [jsx("path", { d: "M93.1675 73.1739C94.5691 74.5758 94.7323 76.7924 93.5515 78.3846L93.1675 78.8326L63.6741 108.326L34.1755 78.8326C32.6908 77.3518 32.6014 74.9761 33.9708 73.3881C35.3401 71.8001 37.7033 71.5391 39.3861 72.7899L39.8341 73.1739L63.6741 97.0137L87.5088 73.1739C88.9104 71.7726 91.1274 71.6092 92.7194 72.7899L93.1674 73.1739H93.1675Z", opacity: "1" }), jsx("path", { d: "M34.1714 55.1518C32.7697 53.7499 32.6066 51.5333 33.7874 49.9411L34.1714 49.4931L63.6647 20L93.1634 49.4931C94.6481 50.9739 94.7375 53.3496 93.3681 54.9376C91.9987 56.5256 89.6356 56.7866 87.9527 55.5358L87.5047 55.1517L63.6647 31.312L39.8301 55.1518C38.4285 56.5531 36.2115 56.7165 34.6195 55.5358L34.1715 55.1518L34.1714 55.1518Z", opacity: "0.3" })] })),
|
|
150
|
+
};
|
|
151
|
+
|
|
201
152
|
/**
|
|
202
153
|
* Icon component that supports both FontAwesome 4 and cwellt icon font
|
|
203
154
|
* @example
|
|
@@ -213,6 +164,12 @@ function CwIcon(props) {
|
|
|
213
164
|
size && `cw-font-size-${size}`
|
|
214
165
|
].filter(Boolean).join(' ');
|
|
215
166
|
};
|
|
167
|
+
// Check if it's a special SVG icon
|
|
168
|
+
if (iconId in SVG_ICONS) {
|
|
169
|
+
const svgElement = SVG_ICONS[iconId];
|
|
170
|
+
const className = getClassName('cw-icon-svg');
|
|
171
|
+
return cloneElement(svgElement, { className });
|
|
172
|
+
}
|
|
216
173
|
// Return appropriate icon based on source
|
|
217
174
|
if (source === 'fontawesome') {
|
|
218
175
|
return jsx("span", { ...iconProps, className: getClassName(`fa fa-${iconId}`) });
|
|
@@ -239,25 +196,15 @@ const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', cl
|
|
|
239
196
|
// Calculate styles based on colorScheme, customColor and variant
|
|
240
197
|
const chipStyle = React__default.useMemo(() => {
|
|
241
198
|
if (customColor) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
// For soft/solid, customColor is used for background and we calculate contrast
|
|
252
|
-
return {
|
|
253
|
-
backgroundColor: customColor,
|
|
254
|
-
color: getContrastColor(customColor),
|
|
255
|
-
...style
|
|
256
|
-
};
|
|
257
|
-
}
|
|
199
|
+
// Simply set the CSS custom properties, CSS handles the rest
|
|
200
|
+
return {
|
|
201
|
+
'--chip-accent': customColor,
|
|
202
|
+
'--chip-text': getContrastColor(customColor),
|
|
203
|
+
...style
|
|
204
|
+
};
|
|
258
205
|
}
|
|
259
206
|
return style;
|
|
260
|
-
}, [
|
|
207
|
+
}, [customColor, style]);
|
|
261
208
|
// Handle click on close icon
|
|
262
209
|
const handleClose = (e) => {
|
|
263
210
|
e.stopPropagation();
|
|
@@ -271,29 +218,9 @@ const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', cl
|
|
|
271
218
|
className,
|
|
272
219
|
closable ? 'cw-chip-closable' : '',
|
|
273
220
|
].filter(Boolean).join(' ');
|
|
274
|
-
return (jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsx(CwIcon, { iconId: icon }), label, closable && (jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
|
|
221
|
+
return (jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsx(CwIcon, { iconId: icon }), jsx("span", { children: label }), closable && (jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
|
|
275
222
|
};
|
|
276
223
|
|
|
277
|
-
function CwTag(tagProps) {
|
|
278
|
-
const hideTag = (event_clickTag) => {
|
|
279
|
-
const tag = event_clickTag.currentTarget.parentElement;
|
|
280
|
-
tag?.classList.add("tag-hidden");
|
|
281
|
-
};
|
|
282
|
-
const onClickClosableCustomTag = (event_clickClosableT) => {
|
|
283
|
-
hideTag(event_clickClosableT);
|
|
284
|
-
if (tagProps.onClickClosableTag != undefined) {
|
|
285
|
-
tagProps.onClickClosableTag(event_clickClosableT);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
const onClickCustomTag = (event_clickTag) => {
|
|
289
|
-
// click option interface
|
|
290
|
-
if (tagProps.onClickTag !== undefined) {
|
|
291
|
-
tagProps.onClickTag(event_clickTag);
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
return (jsxs("div", { className: "cw-tag", style: tagProps.styleTag, onClick: event_clickTag => onClickCustomTag(event_clickTag), id: tagProps.idTag, ref: tagProps.ref, children: [jsx("strong", { style: tagProps.styleTag_description, children: tagProps.children }), tagProps.closableTag && (jsx(CwIcon, { iconId: "close", onClick: event_clickClosableT => onClickClosableCustomTag(event_clickClosableT) }))] }));
|
|
295
|
-
}
|
|
296
|
-
|
|
297
224
|
const CW_DEFAULT_MESSAGE_DURATION = 2000;
|
|
298
225
|
var CwMessageType;
|
|
299
226
|
(function (CwMessageType) {
|
|
@@ -692,7 +619,7 @@ function CwLoadingSmall(CwelltLoadingAppointements) {
|
|
|
692
619
|
jsx("div", {})) }));
|
|
693
620
|
}
|
|
694
621
|
|
|
695
|
-
var styles$k = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si"};
|
|
622
|
+
var styles$k = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si","cw-generic-tooltip":"cw-generic-tooltip-module_cw-generic-tooltip__Ij76M"};
|
|
696
623
|
|
|
697
624
|
// Constants moved outside to prevent recreation
|
|
698
625
|
const margin = 16;
|
|
@@ -797,7 +724,7 @@ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipC
|
|
|
797
724
|
return tooltipState;
|
|
798
725
|
};
|
|
799
726
|
// Main component with optimizations
|
|
800
|
-
const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, hide = false, overlayStyle = {}, showDelay = 0, }) => {
|
|
727
|
+
const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, hide = false, overlayStyle = {}, showDelay = 0, displayInline = false, }) => {
|
|
801
728
|
const [isVisible, setIsVisible] = useState(false);
|
|
802
729
|
const containerRef = useRef(null);
|
|
803
730
|
const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
|
|
@@ -808,7 +735,7 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
|
|
|
808
735
|
const tooltipContent = useMemo(() => {
|
|
809
736
|
if (hide || !isVisible || !content)
|
|
810
737
|
return null;
|
|
811
|
-
return createPortal(jsx("div", { className: styles$k["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
|
|
738
|
+
return createPortal(jsx("div", { className: styles$k["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, "data-inline": displayInline, style: {
|
|
812
739
|
position: 'fixed',
|
|
813
740
|
top: `${tooltipPosition.top}px`,
|
|
814
741
|
left: `${tooltipPosition.left}px`,
|
|
@@ -823,10 +750,14 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
|
|
|
823
750
|
clearTooltipTimeout();
|
|
824
751
|
setIsVisible(false);
|
|
825
752
|
}, [clearTooltipTimeout]);
|
|
826
|
-
return (jsxs("div", { ref: containerRef, className: styles$k["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
|
|
753
|
+
return (jsxs("div", { ref: containerRef, className: styles$k["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, children: [tooltipContent, children] }));
|
|
827
754
|
};
|
|
828
755
|
|
|
829
756
|
// Reference for draggable modal
|
|
757
|
+
/**
|
|
758
|
+
* **Note:** For new development, we recommend using {@link CwDialog} instead. CwModal remains supported for existing code.
|
|
759
|
+
* @see {@link CwDialog}
|
|
760
|
+
*/
|
|
830
761
|
function CwModal(custModalProps) {
|
|
831
762
|
const draggableRef = useRef(null);
|
|
832
763
|
// Hooks [ modal draggable ]
|
|
@@ -860,7 +791,7 @@ function CwModal(custModalProps) {
|
|
|
860
791
|
};
|
|
861
792
|
return (jsx("div", { children: custModalProps.modalState && (jsxs("div", { className: custModalProps.classNameModalOverlay + " cwelltModalOverlay", children: [jsx("div", { className: "cwelltModalOverlayBg", onClick: custModalProps.onCloseModal }), jsx(Draggable, { disabled: isModalDisabled, axis: "both", nodeRef: draggableRef, children: jsxs("div", { className: custModalProps.classNameModal + " cwelltContainerModal", ref: draggableRef, style: widthModalDef !== "40em" ? modalStyle.widthCustomStyle : modalStyle.widthDefStyle, children: [jsxs("div", { className: "cwelltModalHeader", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx("div", { className: "cwelltModalTitle", children: custModalProps.titleModal }), jsx("button", { className: "cwelltBtnCloseModal", onClick: custModalProps.onCloseModal, children: jsx("span", { className: "cwelltCloseIcon" }) })] }), jsx("div", { className: "cwelltModalBody", children: jsx("div", { className: "cwelltContainerModalBody", style: { position: "relative" }, children: custModalProps.children }) }), isHide === false ? (
|
|
862
793
|
// [ false : show modal ]
|
|
863
|
-
jsxs("div", { className: "cwelltModalFooter", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx(Tooltip, { placement: "bottom", title: "Save", color: "#368ee0", children: jsx("div", { className: "cwellt_flex cwellt_justify_center
|
|
794
|
+
jsxs("div", { className: "cwelltModalFooter", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx(Tooltip, { placement: "bottom", title: "Save", color: "#368ee0", children: jsx("div", { className: "cwellt_flex cwellt_justify_center ", style: { width: "2em" }, children: jsx("button", { className: "cw-button-icon cwi-save", onClick: custModalProps.onSaveModal, form: custModalProps.formSaveModal, hidden: custModalProps.HideBtnModal, type: custModalProps.HtmlSubmitModal }) }) }), isShowcustButton === true ? (jsx(Tooltip, { placement: "bottom", title: custModalProps.custButtonTitle, color: custModalProps.custColorButtonTooltip, children: jsx("div", { className: "cwellt_flex cwellt_justify_center", style: { width: "2em" }, children: jsx("button", { className: "cw-button-icon " +
|
|
864
795
|
custModalProps.custButtonClassName, onClick: custModalProps.custButtonClick }) }) })) : (jsx("div", {}))] })) : (
|
|
865
796
|
// true [ do not show the modal ]
|
|
866
797
|
jsx("div", { style: { display: "none" } }))] }) })] })) }));
|
|
@@ -938,80 +869,19 @@ function CwConfirmationPopup(props) {
|
|
|
938
869
|
}, children: [jsx("p", { className: styles$j.message, children: message }), jsxs("div", { className: styles$j.buttons, children: [jsx("button", { className: `${styles$j.button} ${styles$j.confirmButton}`, onClick: onConfirm, children: confirmText }), jsx("button", { className: `${styles$j.button} ${styles$j.cancelButton}`, onClick: onCancel, children: cancelText })] })] }) }))] }));
|
|
939
870
|
}
|
|
940
871
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
// Default size of modal
|
|
948
|
-
const widthModalDef = custModalProps.widthModalConfirm !== null && custModalProps.widthModalConfirm !== undefined
|
|
949
|
-
? custModalProps.widthModalConfirm
|
|
950
|
-
: "17em";
|
|
951
|
-
const modalStyle = {
|
|
952
|
-
// width default
|
|
953
|
-
widthDefStyle: {
|
|
954
|
-
width: "17em"
|
|
955
|
-
},
|
|
956
|
-
// width customizable
|
|
957
|
-
widthCustomStyle: {
|
|
958
|
-
width: custModalProps.widthModalConfirm
|
|
959
|
-
}
|
|
960
|
-
};
|
|
961
|
-
// Hooks [ modal draggable ]
|
|
962
|
-
const [ismodalDisabled, setModalDisabled] = useState(true);
|
|
963
|
-
// [ onMouseOver ]
|
|
964
|
-
const cwelltOnMouseOverModal = () => {
|
|
965
|
-
setModalDisabled(false);
|
|
966
|
-
};
|
|
967
|
-
// [ OnMouseOut ]
|
|
968
|
-
const cwelltOnMouseOutModal = () => {
|
|
969
|
-
setModalDisabled(true);
|
|
970
|
-
// finding parent element
|
|
971
|
-
};
|
|
972
|
-
return (jsx("div", { children: custModalProps.modalStateConfirm && (jsx("div", { className: classNameOverlay !== undefined ? custModalProps.classNameModalOverlay + " cwelltModalOverlay" : "", children: jsx(Draggable, { disabled: ismodalDisabled, children: jsxs("div", { className: " cwelltContainerModal", ref: draggableRef, style: widthModalDef !== "17em" ? modalStyle.widthCustomStyle : modalStyle.widthDefStyle, children: [jsxs("div", { className: "cwelltModalHeader", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx("div", { className: "cwelltModalTitle", children: custModalProps.headerTextConfirm }), jsx("button", { className: "cwelltBtnCloseModal", onClick: custModalProps.onCloseModalConfirm, children: jsx("span", { className: "cwelltCloseIcon" }) })] }), jsx("div", { className: "cwelltModalBody", children: jsxs("div", { className: "cwelltContainerModalBody", children: [jsx("div", { className: "cwellt_content_r_df_align", children: jsx("label", { className: "cwellt_modalConfirmDesc", children: custModalProps.descriptionModalConfirm }) }), jsx("div", { style: { display: "none" }, children: custModalProps.children })] }) }), jsx("div", { className: "cwelltModalFooter", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: jsx(Tooltip, { placement: "bottom", title: custModalProps.confirmText, color: "#368ee0", children: jsx("div", { className: "cwellt_flex cwellt_justify_center", style: { width: "2em" }, children: jsx("button", { className: "btnModalFooterAction cwellt_btn_act cwellt_btn_act_df cwellt_btn_Nbg " +
|
|
973
|
-
custModalProps.confirmClassName, onClick: custModalProps.onClickActionModalConfirm }) }) }) })] }) }) })) }));
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
class CwModalIframe extends React.Component {
|
|
977
|
-
constructor(Props) {
|
|
978
|
-
super(Props);
|
|
979
|
-
this.state = {
|
|
980
|
-
disabled: true
|
|
981
|
-
};
|
|
872
|
+
function CwButton({ text, variant = 'solid', color = 'primary', className = '', icon = "", title, tooltipPosition = "bottom", children, ...buttonProps }) {
|
|
873
|
+
// Build CSS classes based on variant and props
|
|
874
|
+
let buttonClass = `cw-button-${variant}`;
|
|
875
|
+
// Add icon class only for icon variant without children
|
|
876
|
+
if (variant === 'icon' && icon && !children) {
|
|
877
|
+
buttonClass += ` cwi-${icon}`;
|
|
982
878
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
handleCancel = () => {
|
|
986
|
-
this.props.SET_IFRAME_VISIBLE(false);
|
|
987
|
-
};
|
|
988
|
-
render() {
|
|
989
|
-
const { disabled } = this.state;
|
|
990
|
-
return (jsx(Modal
|
|
991
|
-
// title={this.props.title}
|
|
992
|
-
, {
|
|
993
|
-
// title={this.props.title}
|
|
994
|
-
title: jsx("div", { style: {
|
|
995
|
-
width: "100%",
|
|
996
|
-
cursor: "move"
|
|
997
|
-
}, onMouseOver: () => {
|
|
998
|
-
if (this.state.disabled) {
|
|
999
|
-
this.setState({
|
|
1000
|
-
disabled: false
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
}, onMouseOut: () => {
|
|
1004
|
-
this.setState({
|
|
1005
|
-
disabled: true
|
|
1006
|
-
});
|
|
1007
|
-
}, children: this.props.title }), visible: this.props.visible, width: this.props.width, footer: null, bodyStyle: {
|
|
1008
|
-
padding: 0,
|
|
1009
|
-
width: this.props.width + "px",
|
|
1010
|
-
height: this.props.height + "px"
|
|
1011
|
-
}, onCancel: () => {
|
|
1012
|
-
this.handleCancel();
|
|
1013
|
-
}, destroyOnClose: true, modalRender: modal => (jsx(Draggable, { disabled: disabled, children: jsxs("div", { ref: this.draggableRef, children: [" ", modal] }) })), children: jsx("div", { className: "videoWrapper", children: jsx("iframe", { id: "iframeAspx", title: this.props.title, src: this.props.cblConfig + "/SSO/SSORedirect?url=" + encodeURIComponent(this.props.url) }) }) }));
|
|
879
|
+
if (className) {
|
|
880
|
+
buttonClass += ` ${className}`;
|
|
1014
881
|
}
|
|
882
|
+
const tooltipContent = title || (variant === 'icon' && text ? text : undefined);
|
|
883
|
+
const buttonElement = (jsx("button", { type: "button", className: buttonClass, ...buttonProps, "data-color": color, "aria-label": tooltipContent, children: variant === 'icon' ? null : (children ?? (jsxs(Fragment, { children: [icon && jsx(CwIcon, { iconId: icon }), text && jsx("strong", { children: text })] }))) }));
|
|
884
|
+
return tooltipContent ? (jsx(CwGenericTooltip, { content: tooltipContent, position: tooltipPosition, displayInline: true, children: buttonElement })) : (buttonElement);
|
|
1015
885
|
}
|
|
1016
886
|
|
|
1017
887
|
var styles$i = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8"};
|
|
@@ -1055,6 +925,8 @@ const convertFromPx = (px, unit) => {
|
|
|
1055
925
|
const CwDialog = props => {
|
|
1056
926
|
const { customFooter, customHeader, headline, width, height, dialogSize, scrim, onSave, onClose, hideFooter, children, open, autoReposition = false, ...domProps } = props;
|
|
1057
927
|
const dialogRef = useRef(null);
|
|
928
|
+
const [isPressingScrim, setIsPressingScrim] = useState(false);
|
|
929
|
+
const pressTimerRef = useRef(0);
|
|
1058
930
|
const initialSetup = useMemo(() => {
|
|
1059
931
|
// Default width and height with units
|
|
1060
932
|
const defaultWidth = 800;
|
|
@@ -1225,14 +1097,34 @@ const CwDialog = props => {
|
|
|
1225
1097
|
e.stopPropagation();
|
|
1226
1098
|
setResizeDirection(direction);
|
|
1227
1099
|
}, []);
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1100
|
+
// Click on scrim
|
|
1101
|
+
const handleScrimMouseDown = useCallback((e) => {
|
|
1102
|
+
if (e.target !== e.currentTarget)
|
|
1103
|
+
return;
|
|
1104
|
+
setIsPressingScrim(true);
|
|
1105
|
+
pressTimerRef.current = window.setTimeout(() => {
|
|
1106
|
+
if (onClose) {
|
|
1107
|
+
onClose();
|
|
1108
|
+
}
|
|
1109
|
+
}, 500);
|
|
1232
1110
|
}, [onClose]);
|
|
1111
|
+
const handleScrimMouseUpOrLeave = useCallback(() => {
|
|
1112
|
+
if (pressTimerRef.current) {
|
|
1113
|
+
window.clearTimeout(pressTimerRef.current);
|
|
1114
|
+
}
|
|
1115
|
+
setIsPressingScrim(false);
|
|
1116
|
+
}, []);
|
|
1117
|
+
useEffect(() => {
|
|
1118
|
+
if (!open) {
|
|
1119
|
+
setIsPressingScrim(false);
|
|
1120
|
+
if (pressTimerRef.current) {
|
|
1121
|
+
window.clearTimeout(pressTimerRef.current);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}, [open]);
|
|
1233
1125
|
const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$i["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
|
|
1234
1126
|
const content = useMemo(() => (jsx("section", { children: children })), [children]);
|
|
1235
|
-
const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx(
|
|
1127
|
+
const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: onSave, tooltipPosition: "top" })) })), [customFooter, onSave]);
|
|
1236
1128
|
const resizeHandles = useMemo(() => size.autoHeight
|
|
1237
1129
|
? [
|
|
1238
1130
|
// Only horizontal handles if autoHeight is true
|
|
@@ -1259,7 +1151,7 @@ const CwDialog = props => {
|
|
|
1259
1151
|
: `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
|
|
1260
1152
|
return { displayWidth, displayHeight };
|
|
1261
1153
|
}, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
|
|
1262
|
-
const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$i["cw-dialog-main"],
|
|
1154
|
+
const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$i["cw-dialog-main"], onMouseDown: handleScrimMouseDown, onMouseUp: handleScrimMouseUpOrLeave, onMouseLeave: handleScrimMouseUpOrLeave, "data-pressing": isPressingScrim, children: jsxs("dialog", { ...domProps, ref: dialogRef, style: {
|
|
1263
1155
|
left: `${position.x}px`,
|
|
1264
1156
|
top: `${position.y}px`,
|
|
1265
1157
|
width: displayDimensions.displayWidth,
|
|
@@ -1286,7 +1178,7 @@ const CwModalReportFunctional = (props) => {
|
|
|
1286
1178
|
return (jsxs("div", { children: ["Please add a(n) ", props.reportName, " report in ", props.moduleSettings, " Settings"] }));
|
|
1287
1179
|
}
|
|
1288
1180
|
};
|
|
1289
|
-
return (jsx("div", { id: "
|
|
1181
|
+
return (jsx("div", { id: "modal-report-content", children: isModal ? (jsx(CwDialog, { open: props.visible, width: props.width, height: props.height, headline: props.title, onClose: props.onCloseModal, hideFooter: true, className: "modal-report-content", children: renderContentModal() })) : (jsx("div", { children: renderContentNotModal() })) }));
|
|
1290
1182
|
};
|
|
1291
1183
|
|
|
1292
1184
|
class CwReportModal extends React.Component {
|
|
@@ -1306,10 +1198,10 @@ class CwReportModal extends React.Component {
|
|
|
1306
1198
|
};
|
|
1307
1199
|
}
|
|
1308
1200
|
render() {
|
|
1309
|
-
return (jsx("div", { id: "
|
|
1201
|
+
return (jsx("div", { id: "modal-report-content", children: this.state.isModal === true ? (jsxs(CwDialog, { open: this.props.visible, width: this.props.width, height: this.props.height, headline: this.props.title, onClose: () => {
|
|
1310
1202
|
this.formRef?.current?.resetFields();
|
|
1311
1203
|
this.props.SET_MODAL_REPORT_VISIBLE(false);
|
|
1312
|
-
}, hideFooter: true, children: [this.props.name !== "Empty.pdf" && (jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", style: { width: "100%", height: "100%", display: "block" } }) })), this.props.name === "Empty.pdf" && (jsx("div", { children: jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "800px" })), this.props.name === "Empty.pdf" && (jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
|
|
1204
|
+
}, hideFooter: true, className: "modal-report-content", children: [this.props.name !== "Empty.pdf" && (jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", style: { width: "100%", height: "100%", display: "block" } }) })), this.props.name === "Empty.pdf" && (jsx("div", { children: jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "800px" })), this.props.name === "Empty.pdf" && (jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
|
|
1313
1205
|
}
|
|
1314
1206
|
}
|
|
1315
1207
|
|
|
@@ -1410,17 +1302,58 @@ class CwDialogManager {
|
|
|
1410
1302
|
}
|
|
1411
1303
|
}
|
|
1412
1304
|
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1305
|
+
/**
|
|
1306
|
+
* General purpose aligner flex container, useful for column or row view.
|
|
1307
|
+
* @remarks
|
|
1308
|
+
* ```txt
|
|
1309
|
+
* flexDirection="row" (default):
|
|
1310
|
+
*
|
|
1311
|
+
* <Row A> | - item 1 - item 2 - item 3 |
|
|
1312
|
+
* <Row B> | - item 1 - item 2 - item 3 |
|
|
1313
|
+
*
|
|
1314
|
+
* flexDirection="column":
|
|
1315
|
+
*
|
|
1316
|
+
* <Col A> <Col B>
|
|
1317
|
+
* | - item 1 | - item 1 |
|
|
1318
|
+
* | - item 2 | - item 2 |
|
|
1319
|
+
* | - item 3 | - item 3 |
|
|
1320
|
+
*
|
|
1321
|
+
* ```
|
|
1322
|
+
* @example
|
|
1323
|
+
* <CwAlign flexDirection="column">
|
|
1324
|
+
* <div>
|
|
1325
|
+
* <h2>ColumnA</h2>
|
|
1326
|
+
* </div>
|
|
1327
|
+
* <div>
|
|
1328
|
+
* <h2>ColumnB</h2>
|
|
1329
|
+
* </div>
|
|
1330
|
+
* </CwAlign>
|
|
1331
|
+
*/
|
|
1332
|
+
function CwAlign(props) {
|
|
1333
|
+
const { alignContent, alignItems, alignSelf, bottom, display, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, cssHeight, justifyContent, left, margin, order, padding, position, right, top, cssWidth, gap, ...divProps } = props;
|
|
1334
|
+
return (jsx("div", { className: "cw-align", ...divProps, style: {
|
|
1335
|
+
alignContent: alignContent,
|
|
1336
|
+
alignItems: alignItems,
|
|
1337
|
+
alignSelf: alignSelf,
|
|
1338
|
+
bottom: bottom,
|
|
1339
|
+
display: display ?? "flex",
|
|
1340
|
+
flexBasis: flexBasis,
|
|
1341
|
+
flexDirection: flexDirection,
|
|
1342
|
+
flexGrow: flexGrow,
|
|
1343
|
+
flexShrink: flexShrink,
|
|
1344
|
+
flexWrap: flexWrap,
|
|
1345
|
+
height: cssHeight,
|
|
1346
|
+
justifyContent: justifyContent,
|
|
1347
|
+
left: left,
|
|
1348
|
+
margin: margin,
|
|
1349
|
+
order: order,
|
|
1350
|
+
padding: padding,
|
|
1351
|
+
position: position,
|
|
1352
|
+
right: right,
|
|
1353
|
+
top: top,
|
|
1354
|
+
width: cssWidth,
|
|
1355
|
+
gap: gap
|
|
1356
|
+
}, children: props.children }));
|
|
1424
1357
|
}
|
|
1425
1358
|
|
|
1426
1359
|
var styles$h = {"card":"cw-card-module_card__HJUT0","clickable":"cw-card-module_clickable__Y-V3X","disabled":"cw-card-module_disabled__0wHh1","loading":"cw-card-module_loading__-fzlx","content":"cw-card-module_content__ma9qy","headerContent":"cw-card-module_headerContent__x4Jfl","footerTags":"cw-card-module_footerTags__80sSW","loadingOverlay":"cw-card-module_loadingOverlay__8-zVV"};
|
|
@@ -1541,23 +1474,23 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1541
1474
|
* @example
|
|
1542
1475
|
* const columns: Column<User>[] = [
|
|
1543
1476
|
* {
|
|
1544
|
-
* title:
|
|
1545
|
-
* dataIndex:
|
|
1546
|
-
* key:
|
|
1477
|
+
* title: "Name",
|
|
1478
|
+
* dataIndex: "name",
|
|
1479
|
+
* key: "name",
|
|
1547
1480
|
* sortable: true, // Column is sortable
|
|
1548
1481
|
* width: 100 // You can define the width of the column
|
|
1549
1482
|
* },
|
|
1550
1483
|
* {
|
|
1551
|
-
* title:
|
|
1552
|
-
* dataIndex:
|
|
1553
|
-
* key:
|
|
1484
|
+
* title: "Age",
|
|
1485
|
+
* dataIndex: "age",
|
|
1486
|
+
* key: "age",
|
|
1554
1487
|
* sortable: true,
|
|
1555
1488
|
* render: (item) => <span>{item.age} years</span> // Custom rendering
|
|
1556
1489
|
* },
|
|
1557
1490
|
* {
|
|
1558
|
-
* title:
|
|
1559
|
-
* dataIndex:
|
|
1560
|
-
* key:
|
|
1491
|
+
* title: "Address",
|
|
1492
|
+
* dataIndex: "address",
|
|
1493
|
+
* key: "address",
|
|
1561
1494
|
* render: (item) => (
|
|
1562
1495
|
* <a href={`https://maps.google.com/?q=${encodeURIComponent(item.address)}`} target="_blank" rel="noreferrer">
|
|
1563
1496
|
* {item.address}
|
|
@@ -1567,12 +1500,12 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1567
1500
|
* ];
|
|
1568
1501
|
*
|
|
1569
1502
|
* const data:User[] = [
|
|
1570
|
-
* { key:
|
|
1571
|
-
* { key:
|
|
1572
|
-
* { key:
|
|
1573
|
-
* { key:
|
|
1574
|
-
* { key:
|
|
1575
|
-
* { key:
|
|
1503
|
+
* { key: "1", name: "Mike", age: 32, address: "10 Downing Street" },
|
|
1504
|
+
* { key: "2", name: "John", age: 42, address: "11 Downing Street" },
|
|
1505
|
+
* { key: "3", name: "Andres", age: 33, address: "12 Downing Street" },
|
|
1506
|
+
* { key: "4", name: "Gabriel", age: 22, address: "13 Downing Street" },
|
|
1507
|
+
* { key: "5", name: "Sergio", age: 47, address: "14 Downing Street" },
|
|
1508
|
+
* { key: "6", name: "Zacarias", age: 61, address: "15 Downing Street" }
|
|
1576
1509
|
* ];
|
|
1577
1510
|
*
|
|
1578
1511
|
* const generateExpandedContent = (record) => (
|
|
@@ -1587,8 +1520,8 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1587
1520
|
* pagination={true}
|
|
1588
1521
|
* pageSizeOptions={[3, 5, 10]} // Optional, defaults to [5, 10, 20, 50]
|
|
1589
1522
|
* expandedRowRender={generateExpandedContent}
|
|
1590
|
-
* onExpand={(item) => console.log(
|
|
1591
|
-
* rowKey="key" // Optional, defaults to
|
|
1523
|
+
* onExpand={(item) => console.log("Expanded:", item)}
|
|
1524
|
+
* rowKey="key" // Optional, defaults to "key"
|
|
1592
1525
|
* textNoData="No data available" // Optional message when no data
|
|
1593
1526
|
* loading={false} // Optional, shows loading indicator
|
|
1594
1527
|
* scrollHeight={300} // Optional scroll height, defaults to 300
|
|
@@ -1597,12 +1530,12 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1597
1530
|
* className="my-table" // Optional table class
|
|
1598
1531
|
* classNameRow="my-table-row" // Optional class for each row
|
|
1599
1532
|
* id="custom-table-id" // Optional ID for the container
|
|
1600
|
-
* style={{ border:
|
|
1533
|
+
* style={{ border: "1px solid #ccc" }} // Optional inline styles
|
|
1601
1534
|
* />
|
|
1602
1535
|
*
|
|
1603
1536
|
* @returns React component
|
|
1604
1537
|
*/
|
|
1605
|
-
function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, }) {
|
|
1538
|
+
function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection }) {
|
|
1606
1539
|
const [currentPage, setCurrentPage] = useState(1);
|
|
1607
1540
|
const [expandedRowKey, setExpandedRowKey] = useState(null);
|
|
1608
1541
|
const [sortConfig, setSortConfig] = useState({
|
|
@@ -1615,6 +1548,13 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1615
1548
|
acc[col.key] = col.width;
|
|
1616
1549
|
return acc;
|
|
1617
1550
|
}, {}));
|
|
1551
|
+
const [selectedKeys, setSelectedKeys] = useState(new Set(rowSelection?.selectedRowKeys || []));
|
|
1552
|
+
useEffect(() => {
|
|
1553
|
+
setCurrentPage(1);
|
|
1554
|
+
}, [data]);
|
|
1555
|
+
useEffect(() => {
|
|
1556
|
+
setSelectedKeys(new Set(rowSelection?.selectedRowKeys || []));
|
|
1557
|
+
}, [rowSelection?.selectedRowKeys]);
|
|
1618
1558
|
const handleItemsPerPageChange = useCallback((e) => {
|
|
1619
1559
|
setLocalItemsPerPage(parseInt(e.target.value, 10));
|
|
1620
1560
|
setCurrentPage(1);
|
|
@@ -1649,9 +1589,9 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1649
1589
|
if (bVal == null)
|
|
1650
1590
|
return -1;
|
|
1651
1591
|
// Handle strings (case-insensitive)
|
|
1652
|
-
if (typeof aVal ===
|
|
1592
|
+
if (typeof aVal === "string" && typeof bVal === "string") {
|
|
1653
1593
|
const comparison = aVal.localeCompare(bVal, undefined, {
|
|
1654
|
-
sensitivity:
|
|
1594
|
+
sensitivity: "base",
|
|
1655
1595
|
numeric: true
|
|
1656
1596
|
});
|
|
1657
1597
|
return comparison * (sortConfig.direction === "asc" ? 1 : -1);
|
|
@@ -1662,6 +1602,41 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1662
1602
|
}
|
|
1663
1603
|
return dataCopy;
|
|
1664
1604
|
}, [data, sortConfig]);
|
|
1605
|
+
const handleRowClick = useCallback((item, e) => {
|
|
1606
|
+
// Prevent selection if the expand button is clicked
|
|
1607
|
+
if (e.target.closest(".cw-table-col-expand")) {
|
|
1608
|
+
return;
|
|
1609
|
+
}
|
|
1610
|
+
const itemKey = item[rowKey];
|
|
1611
|
+
setSelectedKeys(prev => {
|
|
1612
|
+
const newSet = new Set(prev);
|
|
1613
|
+
if (rowSelection?.type === "single") {
|
|
1614
|
+
// Single mode: only one row selected
|
|
1615
|
+
if (newSet.has(itemKey)) {
|
|
1616
|
+
newSet.clear(); // Deselect if already selected
|
|
1617
|
+
}
|
|
1618
|
+
else {
|
|
1619
|
+
newSet.clear();
|
|
1620
|
+
newSet.add(itemKey);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
else {
|
|
1624
|
+
// Multiple mode: several rows
|
|
1625
|
+
if (newSet.has(itemKey)) {
|
|
1626
|
+
newSet.delete(itemKey);
|
|
1627
|
+
}
|
|
1628
|
+
else {
|
|
1629
|
+
newSet.add(itemKey);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
const selectedRows = sortedData.filter(item => newSet.has(item[rowKey]));
|
|
1633
|
+
// Run after render to avoid "Cannot update a component while rendering another component"
|
|
1634
|
+
setTimeout(() => {
|
|
1635
|
+
rowSelection?.onChange?.(Array.from(newSet), selectedRows);
|
|
1636
|
+
}, 0);
|
|
1637
|
+
return newSet;
|
|
1638
|
+
});
|
|
1639
|
+
}, [rowSelection, rowKey, sortedData]);
|
|
1665
1640
|
const paginatedData = useMemo(() => {
|
|
1666
1641
|
if (!sortedData)
|
|
1667
1642
|
return [];
|
|
@@ -1703,7 +1678,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1703
1678
|
}, [stickyHeader, scrollHeight]);
|
|
1704
1679
|
const getColSpan = () => columns.length + (expandedRowRender ? 1 : 0);
|
|
1705
1680
|
const hasClassNameRow = (item) => {
|
|
1706
|
-
return typeof item ===
|
|
1681
|
+
return typeof item === "object" && item !== null && "classNameRow" in item;
|
|
1707
1682
|
};
|
|
1708
1683
|
const renderTableBody = () => {
|
|
1709
1684
|
if (loading) {
|
|
@@ -1716,7 +1691,15 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1716
1691
|
const itemKey = item[rowKey];
|
|
1717
1692
|
if (!itemKey)
|
|
1718
1693
|
console.warn("Missing row key for item", item);
|
|
1719
|
-
|
|
1694
|
+
const isSelected = selectedKeys.has(itemKey);
|
|
1695
|
+
const dynamicClassName = typeof classNameRow === "function"
|
|
1696
|
+
? classNameRow(item)
|
|
1697
|
+
: classNameRow ?? "";
|
|
1698
|
+
return (jsxs(React__default.Fragment, { children: [jsxs("tr", { className: `${dynamicClassName} ${hasClassNameRow(item) ? item.classNameRow : ""} ${isSelected ? "cw-table-row-selected" : ""}`, onClick: (e) => rowSelection && handleRowClick(item, e), style: {
|
|
1699
|
+
cursor: rowSelection ? "pointer" : "default",
|
|
1700
|
+
backgroundColor: isSelected ? "var(--cw-color-info-container)" : undefined,
|
|
1701
|
+
transition: "background-color 0.2s ease",
|
|
1702
|
+
}, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
|
|
1720
1703
|
? "cwi-chevron-down"
|
|
1721
1704
|
: "cwi-chevron-right"}` }) })), columns.map(col => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex]) : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
|
|
1722
1705
|
});
|
|
@@ -1733,9 +1716,11 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1733
1716
|
minWidth: 50,
|
|
1734
1717
|
maxWidth: columnWidths[col.key] ?? col.width
|
|
1735
1718
|
}),
|
|
1736
|
-
}, children: [jsxs("div", {
|
|
1737
|
-
? "
|
|
1738
|
-
:
|
|
1719
|
+
}, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsx("span", { children: col.title }), col.sortable && col.dataIndex && (jsx(CwIcon, { size: "large", iconId: sortConfig.key !== col.dataIndex
|
|
1720
|
+
? "sortable"
|
|
1721
|
+
: sortConfig.direction === "asc"
|
|
1722
|
+
? "sortable-asc"
|
|
1723
|
+
: "sortable-desc" }))] }), jsx("span", { onMouseDown: (e) => startResize(e, col.key), className: "th-column-resizer" })] }, col.key)))] }) }), jsx("tbody", { children: renderTableBody() })] }) }), pagination && totalPages > 1 && (jsxs("footer", { className: "cw-table-pagination", children: [jsx("button", { onClick: () => handlePageChange(1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left-double", title: "First" }), jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left", title: "Previous" }), jsx("input", { type: "text", inputMode: "numeric", value: currentPage, onChange: (e) => {
|
|
1739
1724
|
const value = parseInt(e.target.value, 10);
|
|
1740
1725
|
if (!isNaN(value))
|
|
1741
1726
|
handlePageChange(value);
|
|
@@ -1747,7 +1732,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
1747
1732
|
}, min: 1, max: totalPages }), jsxs("span", { children: ["of ", totalPages] }), jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right", title: "Next" }), jsx("button", { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right-double", title: "Last" }), jsx("select", { value: localItemsPerPage, onChange: handleItemsPerPageChange, children: pageSizeOptions.map(size => (jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
|
|
1748
1733
|
}
|
|
1749
1734
|
|
|
1750
|
-
var styles$e = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
|
|
1735
|
+
var styles$e = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","badge":"cw-tabs-module_badge__AmVxW","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
|
|
1751
1736
|
|
|
1752
1737
|
const TabIcon = ({ icon }) => {
|
|
1753
1738
|
if (!icon)
|
|
@@ -1797,7 +1782,7 @@ function CwTabs(CwTabsProps) {
|
|
|
1797
1782
|
const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
|
|
1798
1783
|
? { minWidth: CwTabsProps.tabsListWidth }
|
|
1799
1784
|
: undefined;
|
|
1800
|
-
return (jsxs("div", { id: CwTabsProps.id, className: styles$e['cw-tabs'], style: CwTabsProps.style, "data-tabs-position": position, children: [jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsx(TabIcon, { icon: tab.icon }), tab.title] }, tab.key))) }), jsx("div", { className: styles$e['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
|
|
1785
|
+
return (jsxs("div", { id: CwTabsProps.id, className: styles$e['cw-tabs'], style: CwTabsProps.style, "data-tabs-position": position, children: [jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsx(TabIcon, { icon: tab.icon }), tab.title, tab.badge !== undefined && (jsx("span", { className: styles$e['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsx("div", { className: styles$e['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
|
|
1801
1786
|
}
|
|
1802
1787
|
|
|
1803
1788
|
/**
|
|
@@ -2098,6 +2083,10 @@ var styles$c = {"fileUploadContainer":"cw-file-upload-multiple-module_fileUpload
|
|
|
2098
2083
|
function CwFileUploadMultiple(fileUploadProps) {
|
|
2099
2084
|
const fileInputRef = useRef(null);
|
|
2100
2085
|
const [selectedFiles, setSelectedFiles] = useState([]);
|
|
2086
|
+
const [existingFile, setExistingFile] = useState(fileUploadProps.initialFileName);
|
|
2087
|
+
React__default.useEffect(() => {
|
|
2088
|
+
setExistingFile(fileUploadProps.initialFileName);
|
|
2089
|
+
}, [fileUploadProps.initialFileName]);
|
|
2101
2090
|
const getFileExtension = (filename) => {
|
|
2102
2091
|
return filename.split('.').pop()?.toUpperCase() || '';
|
|
2103
2092
|
};
|
|
@@ -2202,6 +2191,10 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
2202
2191
|
}
|
|
2203
2192
|
}
|
|
2204
2193
|
};
|
|
2194
|
+
const handleFileSelectInternal = (event) => {
|
|
2195
|
+
setExistingFile(undefined);
|
|
2196
|
+
handleFileSelect(event);
|
|
2197
|
+
};
|
|
2205
2198
|
const removeFile = (indexToRemove) => {
|
|
2206
2199
|
const newFiles = selectedFiles.filter((_, index) => index !== indexToRemove);
|
|
2207
2200
|
setSelectedFiles(newFiles);
|
|
@@ -2228,6 +2221,7 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
2228
2221
|
event.stopPropagation();
|
|
2229
2222
|
const files = event.dataTransfer.files;
|
|
2230
2223
|
if (files && files.length > 0) {
|
|
2224
|
+
setExistingFile(undefined);
|
|
2231
2225
|
const updatedFiles = processFiles(files, selectedFiles);
|
|
2232
2226
|
if (updatedFiles.length > selectedFiles.length || !fileUploadProps.multiple) {
|
|
2233
2227
|
setSelectedFiles(updatedFiles);
|
|
@@ -2235,7 +2229,12 @@ function CwFileUploadMultiple(fileUploadProps) {
|
|
|
2235
2229
|
}
|
|
2236
2230
|
}
|
|
2237
2231
|
};
|
|
2238
|
-
return (jsxs("div", { className: `${styles$c.fileUploadContainer} ${fileUploadProps.className}`, children: [jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange:
|
|
2232
|
+
return (jsxs("div", { className: `${styles$c.fileUploadContainer} ${fileUploadProps.className}`, children: [jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange: handleFileSelectInternal, disabled: fileUploadProps.disabled, "aria-label": "files", className: styles$c.hiddenInput }), selectedFiles.length === 0 && !existingFile ? (jsxs("div", { className: `${styles$c.uploadArea} ${fileUploadProps.disabled ? styles$c.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [jsx(CwIcon, { iconId: "upload" }), jsx("p", { className: `${styles$c.uploadTitle}`, children: fileUploadProps.disabled ? 'Upload disabled' : 'Click to upload or drag and drop' }), jsxs("p", { className: `${styles$c.uploadSubtitle}`, children: [fileUploadProps.accept ? `Accepted files: ${fileUploadProps.accept}` : 'All file types accepted', !fileUploadProps.multiple && ' (Single file only)'] })] })) : selectedFiles.length === 0 && existingFile ? (jsxs("div", { className: styles$c.filesContainer, children: [jsxs("div", { className: styles$c.fileItem, children: [jsxs("div", { className: styles$c.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$c.fileExtension, children: getFileExtension(existingFile) })] }), jsx("div", { className: styles$c.fileInfo, children: jsx("p", { className: styles$c.fileName, children: existingFile }) }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => {
|
|
2233
|
+
setExistingFile(undefined);
|
|
2234
|
+
if (fileUploadProps.onSelect) {
|
|
2235
|
+
fileUploadProps.onSelect(null);
|
|
2236
|
+
}
|
|
2237
|
+
}, disabled: fileUploadProps.disabled, className: styles$c.smallButton })] }), jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled })] })) : (jsxs("div", { className: styles$c.filesContainer, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsxs("small", { className: styles$c.filesCount, children: [selectedFiles.length, " file", selectedFiles.length !== 1 ? 's' : '', " selected"] }), jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: "Clear all" })] }), selectedFiles.map((file, index) => (jsxs("div", { className: styles$c.fileItem, children: [jsxs("div", { className: styles$c.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$c.fileExtension, children: getFileExtension(file.name) })] }), jsxs("div", { className: styles$c.fileInfo, children: [jsx("p", { className: styles$c.fileName, children: file.name }), jsxs("p", { className: styles$c.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles$c.smallButton })] }, index))), fileUploadProps.multiple && (jsx(CwButton, { text: "Add More Files", icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
|
|
2239
2238
|
}
|
|
2240
2239
|
|
|
2241
2240
|
function CwInput(CwInputProps) {
|
|
@@ -2651,7 +2650,7 @@ function CwInputText(props) {
|
|
|
2651
2650
|
const containerClassName = className
|
|
2652
2651
|
? `cw-input-text ${className}`
|
|
2653
2652
|
: "cw-input-text";
|
|
2654
|
-
return (jsx("div", { className: containerClassName, children: jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
|
|
2653
|
+
return (jsx("div", { className: containerClassName, children: jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-input-button", children: [jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }) }));
|
|
2655
2654
|
}
|
|
2656
2655
|
|
|
2657
2656
|
/**
|
|
@@ -3276,9 +3275,9 @@ function CwCheckbox(CwCheckboxProps) {
|
|
|
3276
3275
|
}
|
|
3277
3276
|
|
|
3278
3277
|
function CwToggle(props) {
|
|
3279
|
-
const { labelProps, labelText, iconProps, alignment = "row", className, ...inputProps } = props;
|
|
3278
|
+
const { labelProps, labelText, iconProps, alignment = "row", className, style, ...inputProps } = props;
|
|
3280
3279
|
const displayText = labelText || labelProps?.text;
|
|
3281
|
-
return (jsx("div", { className: `cw-toggle${className ? ` ${className}` : ''}`, children: jsxs("label", { className: "cw-toggle-label", "data-direction": alignment, children: [displayText && (jsxs("span", { className: "cw-icon-text", children: [iconProps && jsx(CwIcon, { ...iconProps }), displayText] })), jsx("input", {
|
|
3280
|
+
return (jsx("div", { className: `cw-toggle ${className ? ` ${className}` : ''}`, style: style, children: jsxs("label", { className: "cw-toggle-label", "data-direction": alignment, children: [displayText && (jsxs("span", { className: "cw-icon-text", children: [iconProps && jsx(CwIcon, { ...iconProps }), displayText] })), jsx("input", {
|
|
3282
3281
|
//data-color={color}
|
|
3283
3282
|
type: "checkbox", ...inputProps })] }) }));
|
|
3284
3283
|
}
|
|
@@ -3324,64 +3323,10 @@ function CwOption(props) {
|
|
|
3324
3323
|
* </CwSelect>
|
|
3325
3324
|
*/
|
|
3326
3325
|
function CwSelect(props) {
|
|
3327
|
-
const { alignProps, labelProps, buttonProps, iconProps, placeholder, children, ...selectProps } = props;
|
|
3326
|
+
const { alignProps, labelProps, buttonProps, iconProps, placeholder, children, style, ...selectProps } = props;
|
|
3328
3327
|
const flexDirection = alignProps?.flexDirection;
|
|
3329
3328
|
const dataDirection = flexDirection ? { 'data-direction': flexDirection } : {};
|
|
3330
|
-
return (jsx("div", { className: "cw-select", ...dataDirection, children: jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("select", { ...selectProps, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
|
|
3331
|
-
}
|
|
3332
|
-
|
|
3333
|
-
function CwDropdown(optionsProps) {
|
|
3334
|
-
const [selectedOption, setSelectedOption] = useState(optionsProps.defaultSelected || "");
|
|
3335
|
-
useEffect(() => {
|
|
3336
|
-
if (optionsProps.defaultSelected !== undefined && optionsProps.defaultSelected !== selectedOption) {
|
|
3337
|
-
setSelectedOption(optionsProps.defaultSelected);
|
|
3338
|
-
if (optionsProps.handleChange) {
|
|
3339
|
-
optionsProps.handleChange(optionsProps.defaultSelected);
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
}, [optionsProps.defaultSelected, selectedOption, optionsProps.handleChange]);
|
|
3343
|
-
const handleOptionSelect = (event) => {
|
|
3344
|
-
const selectedValue = event.target.value;
|
|
3345
|
-
setSelectedOption(selectedValue);
|
|
3346
|
-
if (optionsProps.handleChange) {
|
|
3347
|
-
optionsProps.handleChange(selectedValue);
|
|
3348
|
-
}
|
|
3349
|
-
};
|
|
3350
|
-
return (jsxs("div", { className: optionsProps.labelPosition === "inline"
|
|
3351
|
-
? "cwellt_flex cwellt_flex_row cwellt_align_items_center cwDropDownComp" + " " + optionsProps.className
|
|
3352
|
-
: optionsProps.labelPosition === "column"
|
|
3353
|
-
? "cwellt_flex cwellt_flex_column cwellt_align-items_baseline cwDropDownComp" + " " + optionsProps.className
|
|
3354
|
-
: "cwellt_flex cwellt_flex_row cwellt_align_items_center cwDropDownComp" + " " + optionsProps.className, style: optionsProps.style, id: optionsProps.id, children: [jsx("label", { className: optionsProps.disabled === true
|
|
3355
|
-
? "cw_label_text cw_label_text_disabled" + " " + optionsProps.labelClassName
|
|
3356
|
-
: "cw_label_text" + " " + optionsProps.labelClassName, children: optionsProps.labelName }), jsx("select", { value: selectedOption, onChange: handleOptionSelect, className: "cw_select", style: optionsProps.styleSelect, disabled: optionsProps.disabled || optionsProps.selectList.length === 0, children: optionsProps.selectList.length === 0 ? (jsx("option", { value: "", className: "cw_option", disabled: true, children: "No data" })) : (jsxs(Fragment, { children: [jsx("option", { value: "", className: "cw_option", children: optionsProps.placeholder }), optionsProps.selectList.map(option => (jsx("option", { value: option.id, className: "cw_option", style: optionsProps.styleOption, children: option.description }, option.id)))] })) })] }));
|
|
3357
|
-
}
|
|
3358
|
-
|
|
3359
|
-
function CwDropdownContainer(dropDownContainerProps) {
|
|
3360
|
-
// #region
|
|
3361
|
-
// - Ref dropDownContainer
|
|
3362
|
-
const dropDownContainer_ref = React.createRef();
|
|
3363
|
-
// - Ref list container
|
|
3364
|
-
const dropDown_listContainer = React.createRef();
|
|
3365
|
-
// #endregion
|
|
3366
|
-
// #region Functions
|
|
3367
|
-
const onKeyPressDropDownContainer = (event_keyDown) => {
|
|
3368
|
-
dropDownContainerProps.onKeyDownDropDownContainer(event_keyDown);
|
|
3369
|
-
};
|
|
3370
|
-
const onMouseLeaveDropDownContainer = (event_onMouseLeave) => {
|
|
3371
|
-
if (typeof dropDownContainerProps.onMouseLeaveDropDownContainer === "function") {
|
|
3372
|
-
dropDownContainerProps.onMouseLeaveDropDownContainer(event_onMouseLeave);
|
|
3373
|
-
}
|
|
3374
|
-
};
|
|
3375
|
-
// #endregion
|
|
3376
|
-
// #region UseEffect
|
|
3377
|
-
useEffect(() => {
|
|
3378
|
-
window.addEventListener("keydown", onKeyPressDropDownContainer);
|
|
3379
|
-
return () => {
|
|
3380
|
-
window.removeEventListener("keydown", onKeyPressDropDownContainer);
|
|
3381
|
-
};
|
|
3382
|
-
}, []);
|
|
3383
|
-
// #endregion
|
|
3384
|
-
return (jsx("div", { className: `cw-dropdown-container ${dropDownContainerProps.className || ''}`, onKeyDown: onKeyPressDropDownContainer, onMouseLeave: onMouseLeaveDropDownContainer, tabIndex: 0, hidden: !dropDownContainerProps.dropDownState, children: jsx("div", { className: "cw-dropdown-list", id: dropDownContainerProps.idDropDownContainer, ref: dropDownContainer_ref, children: jsx("div", { ref: dropDown_listContainer, children: dropDownContainerProps.children }) }) }));
|
|
3329
|
+
return (jsx("div", { className: "cw-select", ...dataDirection, style: style, children: jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("select", { ...selectProps, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
|
|
3385
3330
|
}
|
|
3386
3331
|
|
|
3387
3332
|
function CwDropdownFilter(props) {
|
|
@@ -3394,103 +3339,6 @@ function CwDropdownFilter(props) {
|
|
|
3394
3339
|
return (jsxs("div", { id: props.IdContent, className: containerClassName, children: [props.children, isVisible && (jsx("nav", { className: "cw-dropdown-menu", style: inlineStyles, onMouseLeave: props.onMouseLeave, id: props.idDropDownFilter, role: "menu", children: jsx("ul", { role: "none", children: props.DataSourceDropDownItem?.map((item) => (jsx("li", { id: item.IdDropDown_filter, role: "menuitem", children: item.dropDownFilter_desc }, item.IdDropDown_filter))) }) }))] }));
|
|
3395
3340
|
}
|
|
3396
3341
|
|
|
3397
|
-
const { Option, OptGroup } = Select;
|
|
3398
|
-
class MultiSelect extends React.Component {
|
|
3399
|
-
constructor(Props) {
|
|
3400
|
-
super(Props);
|
|
3401
|
-
this.state = {
|
|
3402
|
-
selected: null,
|
|
3403
|
-
isVisibleDropDown: false,
|
|
3404
|
-
activeClassName: ""
|
|
3405
|
-
};
|
|
3406
|
-
}
|
|
3407
|
-
componentDidMount() {
|
|
3408
|
-
this.setState({
|
|
3409
|
-
selected: this.props.selectedItems?.map((s) => ({
|
|
3410
|
-
type: s.type,
|
|
3411
|
-
id: s.id,
|
|
3412
|
-
despription: s.despription,
|
|
3413
|
-
color: s.color
|
|
3414
|
-
}))
|
|
3415
|
-
});
|
|
3416
|
-
this.onClickSelect = this.onClickSelect.bind(this);
|
|
3417
|
-
}
|
|
3418
|
-
onClickSelect = () => {
|
|
3419
|
-
this.setState({
|
|
3420
|
-
isVisibleDropDown: !this.state.isVisibleDropDown
|
|
3421
|
-
});
|
|
3422
|
-
this.setState({
|
|
3423
|
-
activeClassName: "cwelltSelectDropDown_active"
|
|
3424
|
-
});
|
|
3425
|
-
};
|
|
3426
|
-
handleOnDropDownVisibleChange = () => {
|
|
3427
|
-
const dropDown_content = document.getElementsByClassName("cwelltSelectDropDown");
|
|
3428
|
-
for (let i = 0; i <= dropDown_content.length; i++) {
|
|
3429
|
-
dropDown_content[i]?.addEventListener("mouseleave", () => {
|
|
3430
|
-
this.setState({
|
|
3431
|
-
isVisibleDropDown: false
|
|
3432
|
-
});
|
|
3433
|
-
});
|
|
3434
|
-
}
|
|
3435
|
-
};
|
|
3436
|
-
onKeyUpSelect = (e_KeyUp_select) => {
|
|
3437
|
-
if (e_KeyUp_select.key === "Enter" || e_KeyUp_select.key === "Escape") {
|
|
3438
|
-
this.setState({
|
|
3439
|
-
isVisibleDropDown: false
|
|
3440
|
-
});
|
|
3441
|
-
}
|
|
3442
|
-
else {
|
|
3443
|
-
this.setState({
|
|
3444
|
-
isVisibleDropDown: true
|
|
3445
|
-
});
|
|
3446
|
-
}
|
|
3447
|
-
};
|
|
3448
|
-
// mouseHover dropDown active
|
|
3449
|
-
onMouseHoverDropDownActive = () => {
|
|
3450
|
-
const dropDown_active = document.getElementsByClassName("cwelltSelectDropDown_active");
|
|
3451
|
-
const itemArray = () => {
|
|
3452
|
-
Array.from(dropDown_active).forEach(index => {
|
|
3453
|
-
const dropDown = index;
|
|
3454
|
-
dropDown.addEventListener("mouseover", () => { });
|
|
3455
|
-
});
|
|
3456
|
-
return true;
|
|
3457
|
-
};
|
|
3458
|
-
if (dropDown_active.length > 0 && itemArray()) {
|
|
3459
|
-
return true;
|
|
3460
|
-
}
|
|
3461
|
-
else {
|
|
3462
|
-
return false;
|
|
3463
|
-
}
|
|
3464
|
-
};
|
|
3465
|
-
// clicl cwelltDropDown
|
|
3466
|
-
onMouseLeaveMultiSelect = (event_mouseLeave) => {
|
|
3467
|
-
const post = event_mouseLeave.currentTarget.getBoundingClientRect();
|
|
3468
|
-
const posCursorY = event_mouseLeave.clientY;
|
|
3469
|
-
if (posCursorY > post.bottom && this.state.isVisibleDropDown === true) {
|
|
3470
|
-
this.setState({
|
|
3471
|
-
isVisibleDropDown: true
|
|
3472
|
-
});
|
|
3473
|
-
}
|
|
3474
|
-
else {
|
|
3475
|
-
this.setState({
|
|
3476
|
-
isVisibleDropDown: false
|
|
3477
|
-
});
|
|
3478
|
-
}
|
|
3479
|
-
};
|
|
3480
|
-
render() {
|
|
3481
|
-
return (jsx("div", { style: {
|
|
3482
|
-
display: "flex",
|
|
3483
|
-
flexDirection: "row",
|
|
3484
|
-
alignItems: "flexStart",
|
|
3485
|
-
width: "100%"
|
|
3486
|
-
}, id: "contentMultiSelect", onMouseLeave: e => this.onMouseLeaveMultiSelect(e), children: jsx("div", { style: { flex: 1 }, children: jsx(Select, { autoClearSearchValue: true, mode: "multiple", allowClear: true, style: { width: "100%" }, onChange: this.props.handleChange, optionFilterProp: "description", virtual: true, showArrow: true, size: "middle", className: this.props.selectedItems?.length === 0
|
|
3487
|
-
? "cwelltMultiSelect cwelltSelect cwelltSelectSimple cwelltMultiSelect_searchIcon"
|
|
3488
|
-
: "cwelltMultiSelect cwelltSelect cwelltSelectSimple", placeholder: "Search or filter...", dropdownClassName: this.state.isVisibleDropDown
|
|
3489
|
-
? " cwelltSelectDropDown cwelltSelectDropDown_active"
|
|
3490
|
-
: "cwelltSelectDropDown", value: this.props.selectedItems?.map(s => s.type + "_" + s.id), onClick: () => this.onClickSelect(), open: this.state.isVisibleDropDown, onDropdownVisibleChange: () => this.handleOnDropDownVisibleChange(), onKeyUp: e_KeyUp_select => this.onKeyUpSelect(e_KeyUp_select), children: this.props.selectLists.map((slArray, i) => (jsx(OptGroup, { label: slArray.length > 0 ? slArray[0]?.type : "", children: slArray.map(sl => (jsx(Option, { value: sl.type + "_" + sl.id, type: sl.type, description: sl.description, val: sl.id, children: jsx(Tag, { color: sl.color, children: sl.description }) }, sl.type + "_" + sl.id))) }, "_" + i))) }) }) }));
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
|
|
3494
3342
|
function itemsToMultiFilterTags(items, nameKey, valueKey, category, primaryColor, onPrimaryColor) {
|
|
3495
3343
|
const result = new Set();
|
|
3496
3344
|
items.forEach((item, index) => {
|
|
@@ -3506,519 +3354,20 @@ function itemsToMultiFilterTags(items, nameKey, valueKey, category, primaryColor
|
|
|
3506
3354
|
return result;
|
|
3507
3355
|
}
|
|
3508
3356
|
|
|
3509
|
-
function CwHeadFilter(cwelltFilterTabMultiSelectProps) {
|
|
3510
|
-
// - Reference div content input search
|
|
3511
|
-
const headContent_ref = React.createRef();
|
|
3512
|
-
const optionList = document.getElementsByClassName("cw-multiselect-option-list");
|
|
3513
|
-
const refContent = useRef(null);
|
|
3514
|
-
// - Hooks show clear button
|
|
3515
|
-
const [_isShowClearButton, setShowClearButton] = useState(false);
|
|
3516
|
-
// - Hooks value of input search
|
|
3517
|
-
const [inputValue, setInputValue] = useState("");
|
|
3518
|
-
// Ref [ input ] ( cwellt_headFilterTab )
|
|
3519
|
-
const headInputFitlerTab_ref = useRef(null);
|
|
3520
|
-
const headFilter_content_tags_ref = useRef(null);
|
|
3521
|
-
// cwellt_headFilterTab [ onclick ( show dropDown and enable input .focus() )]
|
|
3522
|
-
const onClickHeaderFilterTab = () => {
|
|
3523
|
-
// Show and hide dropDownContainer - onShowDropDown [ interface ]
|
|
3524
|
-
cwelltFilterTabMultiSelectProps.onShowDropDown();
|
|
3525
|
-
// Click on dropDown enable input - [ ref : headFitlerTab_ref ] and evaluating not null
|
|
3526
|
-
if (headInputFitlerTab_ref.current) {
|
|
3527
|
-
headInputFitlerTab_ref.current.focus();
|
|
3528
|
-
}
|
|
3529
|
-
};
|
|
3530
|
-
// - on change input search
|
|
3531
|
-
const onChangeInputSearch = (event_onChangeInput) => {
|
|
3532
|
-
// let searchInput_length = event_onChangeInput.currentTarget.value.length;
|
|
3533
|
-
// if (searchInput_length > 0) {
|
|
3534
|
-
// setShowClearButton(true);
|
|
3535
|
-
// } else {
|
|
3536
|
-
// setShowClearButton(false);
|
|
3537
|
-
// }
|
|
3538
|
-
setInputValue(event_onChangeInput.currentTarget.value);
|
|
3539
|
-
// - onChangeSearch
|
|
3540
|
-
cwelltFilterTabMultiSelectProps.onChangeSearch(event_onChangeInput);
|
|
3541
|
-
};
|
|
3542
|
-
// - clear input value
|
|
3543
|
-
const onClearInputValue = (e) => {
|
|
3544
|
-
setInputValue("");
|
|
3545
|
-
setShowClearButton(false);
|
|
3546
|
-
// onClearValue
|
|
3547
|
-
cwelltFilterTabMultiSelectProps.onClearValue(e);
|
|
3548
|
-
};
|
|
3549
|
-
// - onKeyPress
|
|
3550
|
-
const onKeyPressInput = (event_keyPress) => {
|
|
3551
|
-
if (typeof cwelltFilterTabMultiSelectProps.onKeypressInput === "function") {
|
|
3552
|
-
cwelltFilterTabMultiSelectProps.onKeypressInput(event_keyPress);
|
|
3553
|
-
// clear input field
|
|
3554
|
-
if (event_keyPress.key === "Enter") {
|
|
3555
|
-
setInputValue("");
|
|
3556
|
-
}
|
|
3557
|
-
}
|
|
3558
|
-
};
|
|
3559
|
-
const handleBlur = (event) => {
|
|
3560
|
-
if (typeof cwelltFilterTabMultiSelectProps.onBlur === "function") {
|
|
3561
|
-
cwelltFilterTabMultiSelectProps.onBlur(event);
|
|
3562
|
-
}
|
|
3563
|
-
};
|
|
3564
|
-
const clickOptionList = () => {
|
|
3565
|
-
if (optionList.length > 0) {
|
|
3566
|
-
Array.from(optionList).forEach(index => {
|
|
3567
|
-
const optionListItem = index;
|
|
3568
|
-
optionListItem.addEventListener("click", () => {
|
|
3569
|
-
setInputValue("");
|
|
3570
|
-
});
|
|
3571
|
-
});
|
|
3572
|
-
}
|
|
3573
|
-
};
|
|
3574
|
-
//#region useEffect
|
|
3575
|
-
useEffect(() => {
|
|
3576
|
-
window.addEventListener("keypress", onKeyPressInput);
|
|
3577
|
-
clickOptionList();
|
|
3578
|
-
return () => {
|
|
3579
|
-
window.removeEventListener("keypress", onKeyPressInput);
|
|
3580
|
-
};
|
|
3581
|
-
});
|
|
3582
|
-
//#endregion
|
|
3583
|
-
return (jsxs("div", { className: cwelltFilterTabMultiSelectProps.className + " cw-headfilter", style: cwelltFilterTabMultiSelectProps.style, id: cwelltFilterTabMultiSelectProps.Id, onMouseLeave: cwelltFilterTabMultiSelectProps.onMouseLeave, ref: refContent, children: [jsxs("div", { className: "cw-headfilter-wrapper", onClick: () => onClickHeaderFilterTab(), children: [jsx(CwIcon, { iconId: "search", size: "large" }), jsxs("div", { className: "cw-headfilter-content", children: [jsx("div", { className: "cw-flex-row cw-gap-small cw-align-left-center cw-flex-wrap", ref: headFilter_content_tags_ref, children: cwelltFilterTabMultiSelectProps.tagValueContent }), jsx("div", { className: "headFilter_search_content", ref: headContent_ref, children: jsx("input", { id: "headFilter_inputSearch", value: inputValue, onKeyPress: event_keyPress => onKeyPressInput(event_keyPress), onBlur: handleBlur, type: "search", onChange: event_onChangeInput => onChangeInputSearch(event_onChangeInput), placeholder: cwelltFilterTabMultiSelectProps.placeholder_desc, ref: headInputFitlerTab_ref }) })] }), jsx(CwIcon, { iconId: "close-circle", onClick: (e) => onClearInputValue(e) })] }), cwelltFilterTabMultiSelectProps.children] }));
|
|
3584
|
-
}
|
|
3585
|
-
|
|
3586
|
-
function CwOptionList(optionListProps) {
|
|
3587
|
-
//#region References
|
|
3588
|
-
// - Ref : optionList
|
|
3589
|
-
const optionListSelected_ref = React.createRef();
|
|
3590
|
-
const optionListSelected_input_ref = React.createRef();
|
|
3591
|
-
//#endregion
|
|
3592
|
-
//#region Hooks
|
|
3593
|
-
// - Hooks : selected optionList
|
|
3594
|
-
// const [isSelectedOptionList, setIsSelectedOptionList] = useState(optionListProps.isSelected || false);
|
|
3595
|
-
//#endregion
|
|
3596
|
-
//#region Functions
|
|
3597
|
-
const onClickSelectOptionList = (event_click) => {
|
|
3598
|
-
// - click of custom component
|
|
3599
|
-
// onSelectedOptionList();
|
|
3600
|
-
// - click of property interface
|
|
3601
|
-
optionListProps.onClick(event_click);
|
|
3602
|
-
};
|
|
3603
|
-
const onKeyPressOptionList = (event_onKeyPress) => {
|
|
3604
|
-
if (typeof optionListProps.onKeyPress === "function") {
|
|
3605
|
-
optionListProps.onKeyPress(event_onKeyPress);
|
|
3606
|
-
}
|
|
3607
|
-
};
|
|
3608
|
-
//#endregion
|
|
3609
|
-
//#region Useffect
|
|
3610
|
-
useEffect(() => {
|
|
3611
|
-
window.addEventListener("keypress", onKeyPressOptionList);
|
|
3612
|
-
return () => {
|
|
3613
|
-
window.removeEventListener("keypress", onKeyPressOptionList);
|
|
3614
|
-
};
|
|
3615
|
-
}, []);
|
|
3616
|
-
//#endregion
|
|
3617
|
-
return (jsxs("div", { className: `cw-multiselect-option-list${optionListProps.isSelected ? ' option-active' : ''}`, onClick: event_click => onClickSelectOptionList(event_click), id: optionListProps.idOptionList, ref: optionListSelected_ref, "aria-value-text": optionListProps.value, onKeyPress: event_onKeyPress => onKeyPressOptionList(event_onKeyPress), style: optionListProps.style, children: [jsx("label", { htmlFor: optionListProps.idOptionList, children: optionListProps.children }), jsx("input", { type: "checkbox", value: optionListProps.value, ref: optionListSelected_input_ref, id: optionListProps.idOptionList, onClick: optionListProps.onChangeOptionList })] }));
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
|
-
//#endregion
|
|
3621
|
-
function CwMultiselect(CwelltCustomFilterTabProps) {
|
|
3622
|
-
//#region Reference
|
|
3623
|
-
const refOptionListContent = useRef(null);
|
|
3624
|
-
const containerRef = useRef(null);
|
|
3625
|
-
//#endregion
|
|
3626
|
-
//#region Hooks
|
|
3627
|
-
const [isShowDropDownfiltered, setShowDropDownfiltered] = useState(false);
|
|
3628
|
-
// const [tagValue, setTagValue] = useState<{
|
|
3629
|
-
// tagDesc: string;
|
|
3630
|
-
// bgContent: string;
|
|
3631
|
-
// bgTag: string;
|
|
3632
|
-
// color: string;
|
|
3633
|
-
// }[]>([]);
|
|
3634
|
-
// Hook active label filter item tab [ All ]
|
|
3635
|
-
const [isActive_filter_item_all, setActive_filter_item_all] = useState(true);
|
|
3636
|
-
// Hook active laberl fitler item tab [ e.g.: Duty ]
|
|
3637
|
-
const [isActive_filter_item, setActive_filter_item] = useState(null);
|
|
3638
|
-
// Hook isSelected option list
|
|
3639
|
-
//const [isSelected_optionList, setSelected_optionList] = useState<{ [key: string]: boolean }>({});
|
|
3640
|
-
//#endregion
|
|
3641
|
-
//#region Functions
|
|
3642
|
-
//#region CwelltFilterTabMultiSelect [ properties functions ]
|
|
3643
|
-
//#region onClearValue
|
|
3644
|
-
const clearValue = (e_clear) => {
|
|
3645
|
-
// List items to remove class and be visible
|
|
3646
|
-
// Item searched
|
|
3647
|
-
const itemSearched = document.getElementsByClassName("item-search");
|
|
3648
|
-
// Item hidden
|
|
3649
|
-
const itemHidden = document.getElementsByClassName("hidden-item");
|
|
3650
|
-
// Item searcched
|
|
3651
|
-
if (itemSearched.length > 0) {
|
|
3652
|
-
for (let i = 0; i <= itemSearched.length; i++) {
|
|
3653
|
-
itemSearched[i]?.classList.remove("item-search");
|
|
3654
|
-
}
|
|
3655
|
-
}
|
|
3656
|
-
// Item hidden
|
|
3657
|
-
if (itemHidden.length > 0) {
|
|
3658
|
-
for (let i = 0; i <= itemHidden.length; i++) {
|
|
3659
|
-
itemHidden[i]?.classList.remove("hidden-item");
|
|
3660
|
-
}
|
|
3661
|
-
}
|
|
3662
|
-
// optionList [ disbaled active className according their text ]
|
|
3663
|
-
const parent = e_clear.currentTarget.parentElement.parentElement;
|
|
3664
|
-
const optionActive = parent.getElementsByClassName("option-active");
|
|
3665
|
-
const valueIds = [];
|
|
3666
|
-
const resultList = [];
|
|
3667
|
-
if (optionActive.length > 0) {
|
|
3668
|
-
CwelltCustomFilterTabProps.onclickHandleChange(valueIds, resultList);
|
|
3669
|
-
Array.from(optionActive).forEach(index => {
|
|
3670
|
-
const optionActive_array = index;
|
|
3671
|
-
optionActive_array.classList.remove("option-active");
|
|
3672
|
-
});
|
|
3673
|
-
}
|
|
3674
|
-
};
|
|
3675
|
-
//#endregion
|
|
3676
|
-
//#region onChangeSearch
|
|
3677
|
-
const onChangeSearch = (e_onchange) => {
|
|
3678
|
-
const filterText_lowerCase = e_onchange.currentTarget.value.toLowerCase();
|
|
3679
|
-
// Tags for filtering
|
|
3680
|
-
const listTag = document.getElementsByClassName("cw-multiselect-option-list");
|
|
3681
|
-
for (let i = 0; i <= listTag.length; i++) {
|
|
3682
|
-
if (listTag[i] !== undefined) {
|
|
3683
|
-
const textTagValue = listTag[i].textContent;
|
|
3684
|
-
// Writting
|
|
3685
|
-
if (textTagValue?.toLowerCase().includes(filterText_lowerCase)) {
|
|
3686
|
-
listTag[i].classList.add("item-search");
|
|
3687
|
-
}
|
|
3688
|
-
else {
|
|
3689
|
-
listTag[i].classList.add("hidden-item");
|
|
3690
|
-
}
|
|
3691
|
-
// remove written
|
|
3692
|
-
if (!textTagValue?.toLowerCase().includes(filterText_lowerCase)) {
|
|
3693
|
-
listTag[i].classList.remove("item-search");
|
|
3694
|
-
}
|
|
3695
|
-
else {
|
|
3696
|
-
listTag[i].classList.remove("hidden-item");
|
|
3697
|
-
}
|
|
3698
|
-
if (filterText_lowerCase === "") {
|
|
3699
|
-
listTag[i].classList.remove("item-search");
|
|
3700
|
-
}
|
|
3701
|
-
}
|
|
3702
|
-
}
|
|
3703
|
-
// Length of string > 0 show dropDownContainerComp
|
|
3704
|
-
if (e_onchange.currentTarget.value.length > 0) {
|
|
3705
|
-
setShowDropDownfiltered(true);
|
|
3706
|
-
}
|
|
3707
|
-
};
|
|
3708
|
-
//#endregion
|
|
3709
|
-
//#region onKeyPressInput
|
|
3710
|
-
const onKeyPressSearch = (event_onKeypress) => {
|
|
3711
|
-
//#region Variables
|
|
3712
|
-
const keyPressed = event_onKeypress.key;
|
|
3713
|
-
const optionSearched = document.getElementsByClassName("item-search");
|
|
3714
|
-
//#endregion
|
|
3715
|
-
// first item selected or same text
|
|
3716
|
-
const optionArray = Array.from(optionSearched);
|
|
3717
|
-
if (optionArray.length > 0 && keyPressed === "Enter" && event_onKeypress.currentTarget.value !== "") {
|
|
3718
|
-
const firstElement_optionList = optionArray[0];
|
|
3719
|
-
const textContent = firstElement_optionList.textContent;
|
|
3720
|
-
const elementList = CwelltCustomFilterTabProps.selectListsItems?.find(e => e.find(el => el.description === textContent));
|
|
3721
|
-
const element = elementList?.find(el => el.description === textContent);
|
|
3722
|
-
if (element !== undefined) {
|
|
3723
|
-
const exist = CwelltCustomFilterTabProps.selectedListsItems?.some(s => s.description === textContent);
|
|
3724
|
-
if (exist === false) {
|
|
3725
|
-
handleClickTag(element);
|
|
3726
|
-
}
|
|
3727
|
-
}
|
|
3728
|
-
const optionList_item_hidden = document.getElementsByClassName("hidden-item");
|
|
3729
|
-
if (optionList_item_hidden.length > 0) {
|
|
3730
|
-
Array.from(optionList_item_hidden).forEach(index => {
|
|
3731
|
-
const optionList_hidden_array = index;
|
|
3732
|
-
if (optionList_hidden_array.classList.contains("hidden-item")) {
|
|
3733
|
-
optionList_hidden_array.classList.remove("hidden-item");
|
|
3734
|
-
}
|
|
3735
|
-
});
|
|
3736
|
-
}
|
|
3737
|
-
}
|
|
3738
|
-
};
|
|
3739
|
-
//#endregion
|
|
3740
|
-
//#region ShowDropDownFilter
|
|
3741
|
-
const showDropDownfiltered = () => {
|
|
3742
|
-
setShowDropDownfiltered(!isShowDropDownfiltered);
|
|
3743
|
-
};
|
|
3744
|
-
//#endregion
|
|
3745
|
-
class SelectListTest {
|
|
3746
|
-
description;
|
|
3747
|
-
key;
|
|
3748
|
-
type;
|
|
3749
|
-
typeName;
|
|
3750
|
-
val;
|
|
3751
|
-
value;
|
|
3752
|
-
active;
|
|
3753
|
-
}
|
|
3754
|
-
const handleClickTag = (e) => {
|
|
3755
|
-
const preList = CwelltCustomFilterTabProps.selectedListsItems || [];
|
|
3756
|
-
const valueIds = [];
|
|
3757
|
-
const resultList = preList?.map(s => {
|
|
3758
|
-
const item = new SelectListTest();
|
|
3759
|
-
item.description = s.description;
|
|
3760
|
-
item.key = s.type + "_" + s.id;
|
|
3761
|
-
item.type = s.type;
|
|
3762
|
-
item.val = s.id;
|
|
3763
|
-
item.value = item.key;
|
|
3764
|
-
item.active = s.active ?? false;
|
|
3765
|
-
valueIds.push(item.key);
|
|
3766
|
-
return item;
|
|
3767
|
-
});
|
|
3768
|
-
const a = new SelectListTest();
|
|
3769
|
-
a.description = e.description;
|
|
3770
|
-
a.key = e.type + "_" + e.id;
|
|
3771
|
-
a.type = e.type;
|
|
3772
|
-
a.val = e.id;
|
|
3773
|
-
a.value = a.key;
|
|
3774
|
-
a.active = e.active;
|
|
3775
|
-
const exist = resultList?.some(item => item.key === a.key);
|
|
3776
|
-
if (exist) {
|
|
3777
|
-
a.active = false;
|
|
3778
|
-
const list = resultList?.filter(item => item.key !== a.key);
|
|
3779
|
-
const values = valueIds.filter(v => v !== a.key);
|
|
3780
|
-
CwelltCustomFilterTabProps.onclickHandleChange(values, list);
|
|
3781
|
-
}
|
|
3782
|
-
else {
|
|
3783
|
-
a.active = true;
|
|
3784
|
-
resultList?.push(a);
|
|
3785
|
-
valueIds.push(a.key);
|
|
3786
|
-
CwelltCustomFilterTabProps.onclickHandleChange(valueIds, resultList);
|
|
3787
|
-
}
|
|
3788
|
-
// // Selected item option list
|
|
3789
|
-
// setSelected_optionList((prevSelectedStates) => ({
|
|
3790
|
-
// ...prevSelectedStates,
|
|
3791
|
-
// [a.key]: !prevSelectedStates[a.key],
|
|
3792
|
-
// }));
|
|
3793
|
-
// clear filter by text after clicked in option list
|
|
3794
|
-
const optionList_item_hidden = document.getElementsByClassName("hidden-item");
|
|
3795
|
-
if (optionList_item_hidden.length > 0) {
|
|
3796
|
-
Array.from(optionList_item_hidden).forEach(index => {
|
|
3797
|
-
const optionList_hidden_array = index;
|
|
3798
|
-
if (optionList_hidden_array.classList.contains("hidden-item")) {
|
|
3799
|
-
optionList_hidden_array.classList.remove("hidden-item");
|
|
3800
|
-
}
|
|
3801
|
-
});
|
|
3802
|
-
}
|
|
3803
|
-
// Check click from option list has custom tag header of custom filter tab
|
|
3804
|
-
const tagActive = document.getElementsByClassName("multiselect-active-tag");
|
|
3805
|
-
const optionList = document.getElementsByClassName("cw-multiselect-option-list");
|
|
3806
|
-
if (tagActive.length > 0 && optionList.length > 0) {
|
|
3807
|
-
Array.from(tagActive).forEach(_index => {
|
|
3808
|
-
Array.from(optionList).forEach(index => {
|
|
3809
|
-
const optionList_array = index;
|
|
3810
|
-
const optionId = optionList_array.getAttribute('data-id');
|
|
3811
|
-
if (optionId === (e.type + "_" + e.id)) {
|
|
3812
|
-
optionList_array.classList.remove("option-active");
|
|
3813
|
-
}
|
|
3814
|
-
});
|
|
3815
|
-
});
|
|
3816
|
-
}
|
|
3817
|
-
const optionList_desc = document.getElementsByClassName("option-active");
|
|
3818
|
-
if (optionList_desc.length > 0) {
|
|
3819
|
-
Array.from(optionList_desc).forEach(index => {
|
|
3820
|
-
const optionList_desc_array = index;
|
|
3821
|
-
if (optionList_desc_array.innerText === a.description) {
|
|
3822
|
-
optionList_desc_array.classList.remove("option-active");
|
|
3823
|
-
}
|
|
3824
|
-
});
|
|
3825
|
-
}
|
|
3826
|
-
// Click to hide dropDownContainer
|
|
3827
|
-
setShowDropDownfiltered(false);
|
|
3828
|
-
};
|
|
3829
|
-
// [ click custom tag ]
|
|
3830
|
-
const closeTagHandle = (e) => {
|
|
3831
|
-
const preList = CwelltCustomFilterTabProps.selectedListsItems;
|
|
3832
|
-
const valueIds = [];
|
|
3833
|
-
const resultList = preList?.map(s => {
|
|
3834
|
-
const item = new SelectListTest();
|
|
3835
|
-
item.description = s.description;
|
|
3836
|
-
item.key = s.type + "_" + s.id;
|
|
3837
|
-
item.type = s.type;
|
|
3838
|
-
item.val = s.id;
|
|
3839
|
-
item.value = item.key;
|
|
3840
|
-
valueIds.push(item.key);
|
|
3841
|
-
return item;
|
|
3842
|
-
});
|
|
3843
|
-
const a = new SelectListTest();
|
|
3844
|
-
a.description = e.description;
|
|
3845
|
-
a.key = e.type + "_" + e.id;
|
|
3846
|
-
a.type = e.type;
|
|
3847
|
-
a.val = e.id;
|
|
3848
|
-
a.value = a.key;
|
|
3849
|
-
const resultListFilter = resultList?.filter(item => item.key !== a.key);
|
|
3850
|
-
const valueIdsFilter = valueIds.filter(item => item !== a.key);
|
|
3851
|
-
CwelltCustomFilterTabProps.onclickHandleChange(valueIdsFilter, resultListFilter);
|
|
3852
|
-
// // Selected item option list - remove active option list
|
|
3853
|
-
// setSelected_optionList((prevSelectedStates) => ({
|
|
3854
|
-
// ...prevSelectedStates,
|
|
3855
|
-
// [a.key]: false[a.key],
|
|
3856
|
-
// }));
|
|
3857
|
-
const optionList_active = document.getElementsByClassName("option-active");
|
|
3858
|
-
if (optionList_active.length > 0) {
|
|
3859
|
-
Array.from(optionList_active).forEach(index => {
|
|
3860
|
-
const optionList_active_array = index;
|
|
3861
|
-
const optionId = optionList_active_array.getAttribute('data-id');
|
|
3862
|
-
if (optionId === (e.type + "_" + e.id)) {
|
|
3863
|
-
optionList_active_array.classList.remove("option-active");
|
|
3864
|
-
}
|
|
3865
|
-
});
|
|
3866
|
-
}
|
|
3867
|
-
};
|
|
3868
|
-
//#endregion
|
|
3869
|
-
//#region DropDownContainer [ properties functions ]
|
|
3870
|
-
//#region onKeyDownDropDownContainer [ press ESC dropDownContainer dissapear - ArrowUp && ArrowDown ]
|
|
3871
|
-
const onKeyDownDropDownContent = (event_onKeyDown) => {
|
|
3872
|
-
const items = document.querySelectorAll(".cw-multiselect-option-list");
|
|
3873
|
-
let optionIndex = Array.from(items).findIndex(item => item.classList.contains("keyboard-focus"));
|
|
3874
|
-
if (event_onKeyDown.key === "Escape") {
|
|
3875
|
-
// DropDown disappear
|
|
3876
|
-
setShowDropDownfiltered(false);
|
|
3877
|
-
}
|
|
3878
|
-
// KeyDown
|
|
3879
|
-
if (event_onKeyDown.key === "ArrowDown") {
|
|
3880
|
-
event_onKeyDown.preventDefault();
|
|
3881
|
-
removeHighlight();
|
|
3882
|
-
optionIndex = getNextIndex(optionIndex, items.length);
|
|
3883
|
-
highlightOption(optionIndex);
|
|
3884
|
-
}
|
|
3885
|
-
// KeyUp
|
|
3886
|
-
if (event_onKeyDown.key === "ArrowUp") {
|
|
3887
|
-
event_onKeyDown.preventDefault();
|
|
3888
|
-
removeHighlight();
|
|
3889
|
-
optionIndex = getPreviousIndex(optionIndex, items.length);
|
|
3890
|
-
highlightOption(optionIndex);
|
|
3891
|
-
}
|
|
3892
|
-
};
|
|
3893
|
-
const removeHighlight = () => {
|
|
3894
|
-
const highlightedItem = document.querySelector(".keyboard-focus");
|
|
3895
|
-
if (highlightedItem) {
|
|
3896
|
-
highlightedItem.classList.remove("keyboard-focus");
|
|
3897
|
-
}
|
|
3898
|
-
};
|
|
3899
|
-
const getNextIndex = (currentIndex, length) => {
|
|
3900
|
-
return (currentIndex + 1) % length;
|
|
3901
|
-
};
|
|
3902
|
-
const getPreviousIndex = (currentIndex, length) => {
|
|
3903
|
-
return (currentIndex - 1 + length) % length;
|
|
3904
|
-
};
|
|
3905
|
-
const highlightOption = (index) => {
|
|
3906
|
-
const items = document.querySelectorAll(".cw-multiselect-option-list");
|
|
3907
|
-
const item = items[index];
|
|
3908
|
-
item.classList.add("keyboard-focus");
|
|
3909
|
-
};
|
|
3910
|
-
//#endregion
|
|
3911
|
-
//#region onMouseLeave
|
|
3912
|
-
const handleInputBlur = () => {
|
|
3913
|
-
setTimeout(() => {
|
|
3914
|
-
if (!containerRef.current?.contains(document.activeElement)) {
|
|
3915
|
-
setShowDropDownfiltered(false);
|
|
3916
|
-
}
|
|
3917
|
-
}, 150);
|
|
3918
|
-
};
|
|
3919
|
-
useEffect(() => {
|
|
3920
|
-
const handleClickOutside = (event) => {
|
|
3921
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
3922
|
-
setShowDropDownfiltered(false);
|
|
3923
|
-
}
|
|
3924
|
-
};
|
|
3925
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
3926
|
-
return () => {
|
|
3927
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
3928
|
-
};
|
|
3929
|
-
}, []);
|
|
3930
|
-
//#endregion
|
|
3931
|
-
// Click filter item button
|
|
3932
|
-
const clickFilter_item = (id) => {
|
|
3933
|
-
// content items - looking for className by it - corresponded by their current group
|
|
3934
|
-
const contentItems = document.getElementsByClassName(id);
|
|
3935
|
-
const contentAll = document.getElementsByClassName("multiselect-tag-group");
|
|
3936
|
-
if (contentAll.length > 0) {
|
|
3937
|
-
Array.from(contentAll).forEach(index => {
|
|
3938
|
-
const contentAll_array = index;
|
|
3939
|
-
contentAll_array.classList.add("hidden-group");
|
|
3940
|
-
});
|
|
3941
|
-
}
|
|
3942
|
-
if (contentItems.length > 0) {
|
|
3943
|
-
Array.from(contentItems).forEach(index => {
|
|
3944
|
-
const contentItems_array = index;
|
|
3945
|
-
contentItems_array.classList.remove("hidden-group");
|
|
3946
|
-
});
|
|
3947
|
-
}
|
|
3948
|
-
// Adding custom className acitive
|
|
3949
|
-
setActive_filter_item(id);
|
|
3950
|
-
// Remove active className [ label tab : ( ALL ) ]
|
|
3951
|
-
setActive_filter_item_all(false);
|
|
3952
|
-
};
|
|
3953
|
-
const showAllItem = () => {
|
|
3954
|
-
//let currentBtn = e.currentTarget;
|
|
3955
|
-
const contentAll = document.getElementsByClassName("multiselect-tag-group");
|
|
3956
|
-
if (contentAll.length > 0) {
|
|
3957
|
-
Array.from(contentAll).forEach(index => {
|
|
3958
|
-
const contentAll_array = index;
|
|
3959
|
-
contentAll_array.classList.remove("hidden-group");
|
|
3960
|
-
// active className - all
|
|
3961
|
-
setActive_filter_item_all(true);
|
|
3962
|
-
setActive_filter_item("");
|
|
3963
|
-
});
|
|
3964
|
-
}
|
|
3965
|
-
};
|
|
3966
|
-
//#endregion
|
|
3967
|
-
useEffect(() => {
|
|
3968
|
-
if (CwelltCustomFilterTabProps.selectedListsItems) {
|
|
3969
|
-
const allOptions = document.getElementsByClassName("cw-multiselect-option-list");
|
|
3970
|
-
Array.from(allOptions).forEach(option => {
|
|
3971
|
-
option.classList.remove("option-active");
|
|
3972
|
-
});
|
|
3973
|
-
CwelltCustomFilterTabProps.selectedListsItems.forEach(selectedItem => {
|
|
3974
|
-
Array.from(allOptions).forEach(option => {
|
|
3975
|
-
const optionElement = option;
|
|
3976
|
-
if (optionElement.innerText === selectedItem.description) {
|
|
3977
|
-
optionElement.classList.add("option-active");
|
|
3978
|
-
}
|
|
3979
|
-
});
|
|
3980
|
-
});
|
|
3981
|
-
}
|
|
3982
|
-
}, [CwelltCustomFilterTabProps.selectedListsItems]);
|
|
3983
|
-
return (jsx("div", { ref: containerRef, children: jsx(CwHeadFilter, { Id: CwelltCustomFilterTabProps.id, onChangeSearch: (e_onchange) => onChangeSearch(e_onchange), onClearValue: (e_clear) => clearValue(e_clear), onKeypressInput: onKeyPressSearch, onShowDropDown: showDropDownfiltered, placeholder_desc: CwelltCustomFilterTabProps.placeholder, style: CwelltCustomFilterTabProps.style, onBlur: handleInputBlur,
|
|
3984
|
-
// onMouseLeave={onMouseLeave_dropDownContainer}
|
|
3985
|
-
className: CwelltCustomFilterTabProps.selectedListsItems?.length === 0
|
|
3986
|
-
? "cw-filter-tab-multi-select-show-icon"
|
|
3987
|
-
: "cw-filter-tab-multi-select-hidden-icon", tagValueContent: jsx("div", { className: "cw-flex-row cw-gap-small", children: CwelltCustomFilterTabProps.selectedListsItems?.map((s, index) => {
|
|
3988
|
-
return s.type !== undefined ? (jsx(CwTag, { styleTag: {
|
|
3989
|
-
background: s.color,
|
|
3990
|
-
color: getContrastColor(s.color),
|
|
3991
|
-
}, idTag: s.type + "_" + s.id, closableTag: true, onClickClosableTag: () => closeTagHandle(s), "data-id": s.type + "_" + s.id, className: "multiselect-active-tag", children: s.description }, index)) : (jsx("div", {}));
|
|
3992
|
-
}) }), children: jsx(CwDropdownContainer, { dropDownState: isShowDropDownfiltered, idDropDownContainer: CwelltCustomFilterTabProps.idDropDownContainer, onKeyDownDropDownContainer: (event_onKeyDown) => onKeyDownDropDownContent(event_onKeyDown), children: jsxs("div", { className: "cw-multiselect-dropdown", children: [jsxs("header", { children: [jsx("label", { "data-active": isActive_filter_item_all, onClick: showAllItem, children: "ALL" }), CwelltCustomFilterTabProps.selectListsItems?.map((slArray, i) => (jsx("label", { "data-active": isActive_filter_item === 'content_' + i,
|
|
3993
|
-
// todo : giving parameter by id to search by their corresponding group it list options and className content with their id in this case key ( i ) by .map function
|
|
3994
|
-
onClick: () => clickFilter_item("content_" + i), id: "content_" + i, children: slArray.length > 0 && slArray[0].typeName !== undefined
|
|
3995
|
-
? slArray[0].typeName
|
|
3996
|
-
: slArray.length > 0
|
|
3997
|
-
? slArray[0].type
|
|
3998
|
-
: "" }, i)))] }), jsx("div", { className: "cw-multiselect-tags-container", children: CwelltCustomFilterTabProps.selectListsItems?.map((slArray, i) => (jsx("div", { id: "content_" + i, className: `multiselect-tag-group content_${i}`, ref: refOptionListContent, children: slArray.map(sl => {
|
|
3999
|
-
const isSelected = CwelltCustomFilterTabProps.selectedListsItems?.some(selected => selected.type === sl.type && selected.id === sl.id) || false;
|
|
4000
|
-
return (jsx(CwOptionList, { idOptionList: sl.type + "_" + sl.id, value: sl.type + "_" + sl.id, title: sl.description, onClick: () => handleClickTag(sl), isSelected: sl.active, "data-id": sl.type + "_" + sl.id, children: jsx(CwTag, { styleTag: {
|
|
4001
|
-
background: sl.color,
|
|
4002
|
-
color: getContrastColor(sl.color),
|
|
4003
|
-
}, closableTag: isSelected, children: sl.description }) }, sl.type + "_" + sl.id));
|
|
4004
|
-
}) }, "group" + i))) })] }) }) }) }));
|
|
4005
|
-
}
|
|
4006
|
-
|
|
4007
3357
|
var styles$8 = {"cw-multifilter-tag":"cw-multi-filter-tag-module_cw-multifilter-tag__Epda-"};
|
|
4008
3358
|
|
|
4009
3359
|
const CwMultiFilterTag = props => {
|
|
4010
|
-
const { ID, Name, Value, Category, Removable, PrimaryColor,
|
|
4011
|
-
const
|
|
4012
|
-
const
|
|
4013
|
-
return (
|
|
4014
|
-
color: TextColor,
|
|
4015
|
-
backgroundColor: BackgroundColor,
|
|
4016
|
-
opacity: Selected && !Removable ? "0.5" : "1",
|
|
4017
|
-
outlineColor: TextColor
|
|
4018
|
-
}, onClick: () => {
|
|
3360
|
+
const { ID, Name, Value, Category, Removable, PrimaryColor, Selectable, Selected } = props;
|
|
3361
|
+
const backgroundColor = `rgb(${PrimaryColor.r},${PrimaryColor.g},${PrimaryColor.b})`;
|
|
3362
|
+
const isOutlineMode = Selected && !Removable;
|
|
3363
|
+
return (jsx("li", { className: styles$8["cw-multifilter-tag"], id: ID, "data-value": Value, "data-category": Category, "data-selected": !!Selected, title: Name, onClick: () => {
|
|
4019
3364
|
if (Selectable)
|
|
4020
|
-
OnSelect?.(props);
|
|
4021
|
-
}, children:
|
|
3365
|
+
props.OnSelect?.(props);
|
|
3366
|
+
}, children: jsx(CwChip, { label: Name, colorScheme: "custom", customColor: backgroundColor, variant: isOutlineMode ? "outline" : "soft", closable: Removable, onClose: () => props.OnRemove?.(props),
|
|
3367
|
+
// This style ensures the chip color is accessible over white background
|
|
3368
|
+
style: isOutlineMode ? {
|
|
3369
|
+
'--chip-accent': `hsl(from ${backgroundColor} h s 40)`
|
|
3370
|
+
} : undefined }) }));
|
|
4022
3371
|
};
|
|
4023
3372
|
|
|
4024
3373
|
var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-multi-filter-catalog-container__S3nsq","cw-multi-filter":"cw-multi-filter-module_cw-multi-filter__zipBK","cw-multi-filter-search":"cw-multi-filter-module_cw-multi-filter-search__eyHr0"};
|
|
@@ -4036,7 +3385,7 @@ var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
|
|
|
4036
3385
|
* - `Category`: Group the filter belongs to
|
|
4037
3386
|
* - `ID`: Unique identifier for the filter
|
|
4038
3387
|
* - `PrimaryColor`: Background color of the tag
|
|
4039
|
-
* - `OnPrimaryColor`: Text color of the tag
|
|
3388
|
+
* - `OnPrimaryColor`: (Optional, deprecated) Text color of the tag - contrast is now calculated automatically
|
|
4040
3389
|
*
|
|
4041
3390
|
* ```
|
|
4042
3391
|
* ╭───────────────────────────────────────────────────────────────╮
|
|
@@ -4078,7 +3427,6 @@ var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
|
|
|
4078
3427
|
* Value: "admin",
|
|
4079
3428
|
* Category: "Roles",
|
|
4080
3429
|
* ID: "Roles_admin",
|
|
4081
|
-
* OnPrimaryColor: hexToRGB("#2050a8"),
|
|
4082
3430
|
* PrimaryColor: hexToRGB("#cedcff")
|
|
4083
3431
|
* },
|
|
4084
3432
|
* {
|
|
@@ -4086,7 +3434,6 @@ var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
|
|
|
4086
3434
|
* Value: "user",
|
|
4087
3435
|
* Category: "Roles",
|
|
4088
3436
|
* ID: "Roles_user",
|
|
4089
|
-
* OnPrimaryColor: hexToRGB("#2050a8"),
|
|
4090
3437
|
* PrimaryColor: hexToRGB("#cedcff")
|
|
4091
3438
|
* },
|
|
4092
3439
|
* {
|
|
@@ -4094,7 +3441,6 @@ var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
|
|
|
4094
3441
|
* Value: "IT",
|
|
4095
3442
|
* Category: "Departments",
|
|
4096
3443
|
* ID: "Departments_IT",
|
|
4097
|
-
* OnPrimaryColor: hexToRGB("#a82037"),
|
|
4098
3444
|
* PrimaryColor: hexToRGB("#ffceda")
|
|
4099
3445
|
* },
|
|
4100
3446
|
* {
|
|
@@ -4102,7 +3448,6 @@ var styles$7 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
|
|
|
4102
3448
|
* Value: "HR",
|
|
4103
3449
|
* Category: "Departments",
|
|
4104
3450
|
* ID: "Departments_HR",
|
|
4105
|
-
* OnPrimaryColor: hexToRGB("#a82037"),
|
|
4106
3451
|
* PrimaryColor: hexToRGB("#ffceda")
|
|
4107
3452
|
* }
|
|
4108
3453
|
* ]);
|
|
@@ -4206,9 +3551,10 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style
|
|
|
4206
3551
|
const getColor = (category) => {
|
|
4207
3552
|
const test = categoriesMappedToTags().get(category)?.values().next().value;
|
|
4208
3553
|
if (test !== undefined) {
|
|
3554
|
+
const primaryColor = rgbAString(test.PrimaryColor.r, test.PrimaryColor.g, test.PrimaryColor.b);
|
|
4209
3555
|
return {
|
|
4210
|
-
onPrimary:
|
|
4211
|
-
primary:
|
|
3556
|
+
onPrimary: getContrastColor(primaryColor),
|
|
3557
|
+
primary: primaryColor,
|
|
4212
3558
|
};
|
|
4213
3559
|
}
|
|
4214
3560
|
else {
|
|
@@ -4428,50 +3774,54 @@ function CwSearchInput(optionsProps) {
|
|
|
4428
3774
|
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
4429
3775
|
const [_selectedOption, setSelectedOption] = useState(null);
|
|
4430
3776
|
const [showDropdown, setShowDropdown] = useState(false);
|
|
3777
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
3778
|
+
// Extract props
|
|
3779
|
+
const { labelProps, iconProps, alignProps, selectList, handleChange, placeholder = "Search…", disabled, renderOption, style, id, className, defaultValue, ...otherProps } = optionsProps;
|
|
3780
|
+
// Get direction for data attribute
|
|
3781
|
+
const direction = alignProps?.flexDirection || "row";
|
|
4431
3782
|
// Make default value selection when loading the component
|
|
4432
3783
|
useEffect(() => {
|
|
4433
|
-
if (
|
|
4434
|
-
|
|
3784
|
+
if (defaultValue && selectList && selectList.length > 0) {
|
|
3785
|
+
setIsLoading(true);
|
|
3786
|
+
const defaultOption = selectList.find(option => option.id === defaultValue?.toString());
|
|
4435
3787
|
if (defaultOption) {
|
|
4436
3788
|
setSearchText(defaultOption.description);
|
|
4437
3789
|
setSelectedOption(defaultOption);
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
optionsProps.handleChange(defaultOption.id);
|
|
3790
|
+
if (handleChange) {
|
|
3791
|
+
handleChange(defaultOption.id);
|
|
4441
3792
|
}
|
|
4442
3793
|
}
|
|
3794
|
+
setIsLoading(false);
|
|
4443
3795
|
}
|
|
4444
|
-
}, [
|
|
3796
|
+
}, [defaultValue, selectList]);
|
|
4445
3797
|
const handleInputChange = (event) => {
|
|
4446
3798
|
const text = event.target.value;
|
|
4447
3799
|
setSearchText(text);
|
|
4448
3800
|
setShowDropdown(true);
|
|
4449
3801
|
if (text === "") {
|
|
4450
|
-
setFilteredOptions(
|
|
3802
|
+
setFilteredOptions(selectList);
|
|
4451
3803
|
setSelectedOption(null);
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
optionsProps.handleChange("");
|
|
3804
|
+
if (handleChange) {
|
|
3805
|
+
handleChange("");
|
|
4455
3806
|
}
|
|
4456
3807
|
}
|
|
4457
3808
|
else {
|
|
4458
|
-
|
|
4459
|
-
const filtered =
|
|
4460
|
-
// Search all properties of the object
|
|
3809
|
+
setIsLoading(true);
|
|
3810
|
+
const filtered = selectList.filter((option) => {
|
|
4461
3811
|
return Object.keys(option).some(key => {
|
|
4462
3812
|
const value = option[key];
|
|
4463
|
-
// Verify that the value is a string or number and contains the search text
|
|
4464
3813
|
return (typeof value === 'string' || typeof value === 'number') &&
|
|
4465
3814
|
String(value).toLowerCase().includes(text.toLowerCase());
|
|
4466
3815
|
});
|
|
4467
3816
|
});
|
|
4468
3817
|
setFilteredOptions(filtered);
|
|
3818
|
+
setIsLoading(false);
|
|
4469
3819
|
}
|
|
4470
3820
|
};
|
|
4471
3821
|
const handleInputFocus = () => {
|
|
4472
3822
|
setShowDropdown(true);
|
|
4473
3823
|
if (searchText === "") {
|
|
4474
|
-
setFilteredOptions(
|
|
3824
|
+
setFilteredOptions(selectList);
|
|
4475
3825
|
}
|
|
4476
3826
|
};
|
|
4477
3827
|
const handleInputBlur = () => {
|
|
@@ -4482,27 +3832,172 @@ function CwSearchInput(optionsProps) {
|
|
|
4482
3832
|
const handleOptionSelect = (option) => {
|
|
4483
3833
|
setSearchText(option.description);
|
|
4484
3834
|
setSelectedOption(option);
|
|
4485
|
-
if (
|
|
4486
|
-
|
|
3835
|
+
if (handleChange) {
|
|
3836
|
+
handleChange(option.id);
|
|
3837
|
+
}
|
|
3838
|
+
setFilteredOptions([]);
|
|
3839
|
+
};
|
|
3840
|
+
const handleClearClick = () => {
|
|
3841
|
+
setSearchText("");
|
|
3842
|
+
setFilteredOptions([]);
|
|
3843
|
+
setSelectedOption(null);
|
|
3844
|
+
if (handleChange) {
|
|
3845
|
+
handleChange("");
|
|
3846
|
+
}
|
|
3847
|
+
};
|
|
3848
|
+
return (jsxs("div", { className: `cw-search-input ${className || ""}`, style: style, id: id, ...otherProps, "data-direction": direction, children: [jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-search-input-wrapper", children: [jsx("input", { type: "text", value: searchText, onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, placeholder: placeholder, className: "cw-input-search", disabled: disabled }), isLoading && (jsx("div", { className: "cw-search-input-loading", children: jsx(CwIcon, { iconId: "spinner" }) })), jsx("div", { className: "cw-search-input-icons", children: searchText && !disabled && !isLoading ? (jsx(CwButton, { type: "button", onClick: handleClearClick, "aria-label": "Clear search", variant: "icon", icon: "close", color: "neutral" })) : (iconProps ? jsx(CwIcon, { ...iconProps }) : jsx(CwIcon, { iconId: "search" })) })] })] }), showDropdown && filteredOptions.length > 0 && (jsx("div", { className: "cw-input-search-dropdown", children: jsx("ul", { children: filteredOptions.map((option) => (jsx("li", { onClick: () => handleOptionSelect(option), onMouseDown: (e) => e.preventDefault(), children: renderOption ? renderOption(option) : option.description }, option.id))) }) }))] }));
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
var styles$5 = {"menu":"cw-context-menu-module_menu__tXmun","item":"cw-context-menu-module_item__-ko8L","arrow":"cw-context-menu-module_arrow__LHZmQ"};
|
|
3852
|
+
|
|
3853
|
+
const ARROW_SIZE = 8;
|
|
3854
|
+
const SAFETY_MARGIN = 8;
|
|
3855
|
+
const VIEWPORT_PADDING = 10;
|
|
3856
|
+
const CwAnchoredMenu = ({ children, options, onSelect, placement = 'bottom', open: controlledOpen, onOpenChange, onContextMenu: onContextMenuCallback }) => {
|
|
3857
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
3858
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
3859
|
+
const menuRef = useRef(null);
|
|
3860
|
+
const triggerRef = useRef(null);
|
|
3861
|
+
const arrowRef = useRef(null);
|
|
3862
|
+
const isControlled = controlledOpen !== undefined;
|
|
3863
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
3864
|
+
const setIsOpen = (value) => {
|
|
3865
|
+
isControlled ? onOpenChange?.(value) : setInternalOpen(value);
|
|
3866
|
+
};
|
|
3867
|
+
const normalizedOptions = options.map(opt => typeof opt === 'string' ? { key: opt, label: opt } : opt);
|
|
3868
|
+
const getActualTriggerElement = () => {
|
|
3869
|
+
let element = triggerRef.current;
|
|
3870
|
+
if (element.offsetHeight === 0 && element.children.length > 0) {
|
|
3871
|
+
element = element.children[0];
|
|
3872
|
+
}
|
|
3873
|
+
return element;
|
|
3874
|
+
};
|
|
3875
|
+
const calculateInitialPosition = (event, rect) => {
|
|
3876
|
+
const totalOffset = ARROW_SIZE + SAFETY_MARGIN;
|
|
3877
|
+
switch (placement) {
|
|
3878
|
+
case 'bottom':
|
|
3879
|
+
return { x: event.clientX, y: rect.bottom + totalOffset };
|
|
3880
|
+
case 'top':
|
|
3881
|
+
return { x: event.clientX, y: rect.top - totalOffset };
|
|
3882
|
+
case 'right':
|
|
3883
|
+
return { x: rect.right + totalOffset, y: event.clientY };
|
|
3884
|
+
case 'left':
|
|
3885
|
+
return { x: rect.left - totalOffset, y: event.clientY };
|
|
3886
|
+
}
|
|
3887
|
+
};
|
|
3888
|
+
const shouldFlipVertical = (currentPlacement, rect, menuHeight) => {
|
|
3889
|
+
const totalOffset = ARROW_SIZE + SAFETY_MARGIN;
|
|
3890
|
+
if (currentPlacement === 'bottom') {
|
|
3891
|
+
const spaceBelow = window.innerHeight - rect.bottom - totalOffset;
|
|
3892
|
+
const spaceAbove = rect.top - totalOffset;
|
|
3893
|
+
return spaceBelow < menuHeight && spaceAbove > spaceBelow ? 'top' : 'bottom';
|
|
3894
|
+
}
|
|
3895
|
+
else {
|
|
3896
|
+
const spaceAbove = rect.top - totalOffset;
|
|
3897
|
+
const spaceBelow = window.innerHeight - rect.bottom - totalOffset;
|
|
3898
|
+
return spaceAbove < menuHeight && spaceBelow > spaceAbove ? 'bottom' : 'top';
|
|
3899
|
+
}
|
|
3900
|
+
};
|
|
3901
|
+
const shouldFlipHorizontal = (currentPlacement, rect, menuWidth) => {
|
|
3902
|
+
const totalOffset = ARROW_SIZE + SAFETY_MARGIN;
|
|
3903
|
+
if (currentPlacement === 'right') {
|
|
3904
|
+
const spaceRight = window.innerWidth - rect.right - totalOffset;
|
|
3905
|
+
const spaceLeft = rect.left - totalOffset;
|
|
3906
|
+
return spaceRight < menuWidth && spaceLeft > spaceRight ? 'left' : 'right';
|
|
3907
|
+
}
|
|
3908
|
+
else {
|
|
3909
|
+
const spaceLeft = rect.left - totalOffset;
|
|
3910
|
+
const spaceRight = window.innerWidth - rect.right - totalOffset;
|
|
3911
|
+
return spaceLeft < menuWidth && spaceRight > spaceLeft ? 'right' : 'left';
|
|
4487
3912
|
}
|
|
4488
|
-
// Remove the filtered options when selecting one
|
|
4489
|
-
setFilteredOptions([]);
|
|
4490
3913
|
};
|
|
4491
|
-
const
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
3914
|
+
const handleContextMenu = (event) => {
|
|
3915
|
+
event.preventDefault();
|
|
3916
|
+
event.stopPropagation();
|
|
3917
|
+
onContextMenuCallback?.(event);
|
|
3918
|
+
setIsOpen(true);
|
|
3919
|
+
const actualElement = getActualTriggerElement();
|
|
3920
|
+
const rect = actualElement.getBoundingClientRect();
|
|
3921
|
+
const pos = calculateInitialPosition(event, rect);
|
|
3922
|
+
setPosition(pos);
|
|
4495
3923
|
};
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
3924
|
+
const handleOptionClick = (option) => {
|
|
3925
|
+
if (option.disabled)
|
|
3926
|
+
return;
|
|
3927
|
+
onSelect(option.key);
|
|
3928
|
+
setIsOpen(false);
|
|
3929
|
+
};
|
|
3930
|
+
// Calculate position before the browser paints the element
|
|
3931
|
+
useLayoutEffect(() => {
|
|
3932
|
+
if (!isOpen || !menuRef.current || !triggerRef.current)
|
|
3933
|
+
return;
|
|
3934
|
+
const actualElement = getActualTriggerElement();
|
|
3935
|
+
const rect = actualElement.getBoundingClientRect();
|
|
3936
|
+
const menuRect = menuRef.current.getBoundingClientRect();
|
|
3937
|
+
let { x, y } = position;
|
|
3938
|
+
let finalPlacement = placement;
|
|
3939
|
+
const totalOffset = ARROW_SIZE + SAFETY_MARGIN;
|
|
3940
|
+
// Calculate position based on placement and check for flips
|
|
3941
|
+
if (placement === 'bottom' || placement === 'top') {
|
|
3942
|
+
x = x - (menuRect.width / 2); // Center on click
|
|
3943
|
+
finalPlacement = shouldFlipVertical(placement, rect, menuRect.height);
|
|
3944
|
+
if (finalPlacement === 'top') {
|
|
3945
|
+
y = rect.top - totalOffset - menuRect.height;
|
|
3946
|
+
}
|
|
3947
|
+
else {
|
|
3948
|
+
y = rect.bottom + totalOffset;
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3951
|
+
else { // left or right
|
|
3952
|
+
y = y - (menuRect.height / 2); // Center on click
|
|
3953
|
+
finalPlacement = shouldFlipHorizontal(placement, rect, menuRect.width);
|
|
3954
|
+
if (finalPlacement === 'left') {
|
|
3955
|
+
x = rect.left - totalOffset - menuRect.width;
|
|
3956
|
+
}
|
|
3957
|
+
else {
|
|
3958
|
+
x = rect.right + totalOffset;
|
|
3959
|
+
}
|
|
3960
|
+
}
|
|
3961
|
+
// Keep in viewport (fallback)
|
|
3962
|
+
x = Math.max(VIEWPORT_PADDING, Math.min(x, window.innerWidth - menuRect.width - VIEWPORT_PADDING));
|
|
3963
|
+
y = Math.max(VIEWPORT_PADDING, Math.min(y, window.innerHeight - menuRect.height - VIEWPORT_PADDING));
|
|
3964
|
+
// Position arrow
|
|
3965
|
+
if (arrowRef.current) {
|
|
3966
|
+
arrowRef.current.setAttribute('data-placement', finalPlacement);
|
|
3967
|
+
}
|
|
3968
|
+
if (x !== position.x || y !== position.y) {
|
|
3969
|
+
setPosition({ x, y });
|
|
3970
|
+
}
|
|
3971
|
+
}, [isOpen]);
|
|
3972
|
+
// Close handlers
|
|
3973
|
+
useEffect(() => {
|
|
3974
|
+
if (!isOpen)
|
|
3975
|
+
return;
|
|
3976
|
+
const handleOutsideClick = (event) => {
|
|
3977
|
+
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
3978
|
+
setIsOpen(false);
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
const handleEscape = (event) => {
|
|
3982
|
+
if (event.key === "Escape")
|
|
3983
|
+
setIsOpen(false);
|
|
3984
|
+
};
|
|
3985
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
3986
|
+
document.addEventListener("keydown", handleEscape);
|
|
3987
|
+
return () => {
|
|
3988
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
3989
|
+
document.removeEventListener("keydown", handleEscape);
|
|
3990
|
+
};
|
|
3991
|
+
}, [isOpen]);
|
|
3992
|
+
return (jsxs(Fragment, { children: [jsx("div", { ref: triggerRef, onContextMenu: handleContextMenu, style: { display: "contents" }, children: children }), isOpen && normalizedOptions.length > 0 && createPortal(jsxs("div", { ref: menuRef, className: styles$5["menu"], style: {
|
|
3993
|
+
top: `${position.y}px`,
|
|
3994
|
+
left: `${position.x}px`,
|
|
3995
|
+
}, "data-has-arrow": "true", children: [jsx("div", { ref: arrowRef, className: styles$5["arrow"], "data-placement": placement }), normalizedOptions.map(option => (jsxs("div", { onClick: (e) => {
|
|
3996
|
+
e.stopPropagation();
|
|
3997
|
+
e.preventDefault();
|
|
3998
|
+
handleOptionClick(option);
|
|
3999
|
+
}, className: `${styles$5["item"]} ${option.disabled ? styles$5["disabled"] : ""}`, "data-disabled": option.disabled, children: [option.icon && jsx("span", { className: styles$5["icon"], children: option.icon }), option.label] }, option.key)))] }), document.body)] }));
|
|
4000
|
+
};
|
|
4506
4001
|
|
|
4507
4002
|
/**
|
|
4508
4003
|
* A context menu that is rendered when the user clicks on a button.
|
|
@@ -4515,276 +4010,91 @@ var styles$5 = {"context-menu":"cw-context-menu-module_context-menu__dbxnO","con
|
|
|
4515
4010
|
* <div>Right-click me!</div>
|
|
4516
4011
|
* </ContextMenu>
|
|
4517
4012
|
*/
|
|
4518
|
-
const
|
|
4013
|
+
const DEFAULT_OFFSET = { x: 4, y: 4 };
|
|
4014
|
+
const CwContextMenu = ({ children, options, offset = DEFAULT_OFFSET, onSelect }) => {
|
|
4519
4015
|
const [isOpen, setIsOpen] = useState(false);
|
|
4520
4016
|
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
4521
4017
|
const menuRef = useRef(null);
|
|
4522
4018
|
const handleContextMenu = (event) => {
|
|
4523
4019
|
event.preventDefault();
|
|
4524
4020
|
setIsOpen(true);
|
|
4525
|
-
|
|
4021
|
+
const x = event.clientX + offset.x;
|
|
4022
|
+
const y = event.clientY + offset.y;
|
|
4023
|
+
setPosition({ x, y });
|
|
4526
4024
|
};
|
|
4527
4025
|
const handleOptionClick = (option) => {
|
|
4528
4026
|
onSelect(option);
|
|
4529
4027
|
setIsOpen(false);
|
|
4530
4028
|
};
|
|
4029
|
+
// Position handler for when is too close to window edges
|
|
4030
|
+
useEffect(() => {
|
|
4031
|
+
if (isOpen && menuRef.current) {
|
|
4032
|
+
const rect = menuRef.current.getBoundingClientRect();
|
|
4033
|
+
const padding = 16;
|
|
4034
|
+
let { x, y } = position;
|
|
4035
|
+
if (rect.right > window.innerWidth) {
|
|
4036
|
+
x = window.innerWidth - rect.width - padding;
|
|
4037
|
+
}
|
|
4038
|
+
if (rect.bottom > window.innerHeight) {
|
|
4039
|
+
y = window.innerHeight - rect.height - padding;
|
|
4040
|
+
}
|
|
4041
|
+
if (x < padding) {
|
|
4042
|
+
x = padding;
|
|
4043
|
+
}
|
|
4044
|
+
if (y < padding) {
|
|
4045
|
+
y = padding;
|
|
4046
|
+
}
|
|
4047
|
+
if (x !== position.x || y !== position.y) {
|
|
4048
|
+
setPosition({ x, y });
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
}, [isOpen, position.x, position.y]);
|
|
4531
4052
|
useEffect(() => {
|
|
4532
4053
|
const handleOutsideClick = (event) => {
|
|
4533
4054
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
4534
4055
|
setIsOpen(false);
|
|
4535
4056
|
}
|
|
4536
4057
|
};
|
|
4537
|
-
|
|
4058
|
+
const handleEscape = (event) => {
|
|
4059
|
+
if (event.key === "Escape") {
|
|
4060
|
+
setIsOpen(false);
|
|
4061
|
+
}
|
|
4062
|
+
};
|
|
4063
|
+
if (isOpen) {
|
|
4064
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
4065
|
+
document.addEventListener("keydown", handleEscape);
|
|
4066
|
+
}
|
|
4538
4067
|
return () => {
|
|
4539
4068
|
document.removeEventListener("mousedown", handleOutsideClick);
|
|
4069
|
+
document.removeEventListener("keydown", handleEscape);
|
|
4540
4070
|
};
|
|
4541
|
-
}, []);
|
|
4542
|
-
return (jsxs("div", { onContextMenu: handleContextMenu, children:
|
|
4543
|
-
top: position.y
|
|
4544
|
-
left: position.x
|
|
4545
|
-
}, children: options.map(option => (jsx("div", { onClick: () => handleOptionClick(option), className: styles$5["
|
|
4071
|
+
}, [isOpen]);
|
|
4072
|
+
return (jsxs(Fragment, { children: [jsx("div", { onContextMenu: handleContextMenu, children: children }), isOpen && createPortal(jsx("div", { ref: menuRef, className: styles$5["menu"], style: {
|
|
4073
|
+
top: `${position.y}px`,
|
|
4074
|
+
left: `${position.x}px`,
|
|
4075
|
+
}, children: options.map(option => (jsx("div", { onClick: () => handleOptionClick(option), className: styles$5["item"], children: option }, option))) }), document.body)] }));
|
|
4546
4076
|
};
|
|
4547
4077
|
|
|
4548
|
-
function CwDataItem(cwBoxItemsProps) {
|
|
4549
|
-
return (jsx("div", { id: cwBoxItemsProps.id, className: "cwelltBoxItems", style: cwBoxItemsProps.style, children: jsx("span", { className: "cwelltBoxItemsText cwelltFont1em_required", style: cwBoxItemsProps.styleDataItem, children: cwBoxItemsProps.children }) }));
|
|
4550
|
-
}
|
|
4551
|
-
function CwContextualMenu(CwelltRightClickProps) {
|
|
4552
|
-
//#region Hooks
|
|
4553
|
-
const [isVisibleContextMenu, setVisibleContextMenu] = useState(false);
|
|
4554
|
-
const [resetClassName, setResetClassName] = useState("");
|
|
4555
|
-
const [positionRightClick, setpositionRightClick] = useState({ x: 0, y: 0 });
|
|
4556
|
-
//#endregion
|
|
4557
|
-
//#region Functions
|
|
4558
|
-
const onShowContextMenu = (e) => {
|
|
4559
|
-
e.preventDefault();
|
|
4560
|
-
setVisibleContextMenu(true);
|
|
4561
|
-
const newPosition = {
|
|
4562
|
-
x: e.clientX - e.currentTarget.getBoundingClientRect().left,
|
|
4563
|
-
y: e.clientY - e.currentTarget.getBoundingClientRect().top
|
|
4564
|
-
};
|
|
4565
|
-
setpositionRightClick(newPosition);
|
|
4566
|
-
toggleClassName();
|
|
4567
|
-
};
|
|
4568
|
-
const toggleClassName = () => {
|
|
4569
|
-
setTimeout(() => {
|
|
4570
|
-
setResetClassName("cwellt_fade_out");
|
|
4571
|
-
});
|
|
4572
|
-
setTimeout(() => {
|
|
4573
|
-
setResetClassName("cwellt_fade_in");
|
|
4574
|
-
}, 500);
|
|
4575
|
-
};
|
|
4576
|
-
const onMouseLeaveContextMenuContainer = () => {
|
|
4577
|
-
setVisibleContextMenu(false);
|
|
4578
|
-
};
|
|
4579
|
-
const onClickContextMenuContainer = () => {
|
|
4580
|
-
setVisibleContextMenu(false);
|
|
4581
|
-
CwelltRightClickProps.onClick;
|
|
4582
|
-
};
|
|
4583
|
-
const onKeyUpContextMenu = (e) => {
|
|
4584
|
-
if (e.key === "Escape") {
|
|
4585
|
-
// context menu dissapear
|
|
4586
|
-
setVisibleContextMenu(false);
|
|
4587
|
-
}
|
|
4588
|
-
if (e.key === "Enter") {
|
|
4589
|
-
// context menu dissapear
|
|
4590
|
-
setVisibleContextMenu(false);
|
|
4591
|
-
}
|
|
4592
|
-
};
|
|
4593
|
-
//#endregion
|
|
4594
|
-
return (jsxs("div", { className: "cwelltContextMenu_container", onContextMenu: onShowContextMenu, onMouseLeave: onMouseLeaveContextMenuContainer, onClick: onClickContextMenuContainer, style: { position: "relative" }, onKeyUp: e => onKeyUpContextMenu(e), tabIndex: 0, children: [CwelltRightClickProps.children, jsx("div", { id: "contextMenu", className: isVisibleContextMenu ? "cwelltContextMenu " + resetClassName : "cwelltContextMenuHide " + resetClassName, style: {
|
|
4595
|
-
top: positionRightClick.y,
|
|
4596
|
-
left: positionRightClick.x
|
|
4597
|
-
}, children: CwelltRightClickProps.dataSourceContextMenu?.map(indexDataItem => {
|
|
4598
|
-
return (jsx(CwDataItem, { id: indexDataItem.idDataItem, style: indexDataItem.style, styleDataItem: indexDataItem.styleDataItem, children: indexDataItem.dataItemContent }));
|
|
4599
|
-
}) })] }));
|
|
4600
|
-
}
|
|
4601
|
-
|
|
4602
|
-
// Buttons components
|
|
4603
4078
|
/**
|
|
4604
|
-
*
|
|
4605
|
-
* @
|
|
4606
|
-
* @classes cw_btnFloatingButtonActive
|
|
4607
|
-
* @dependencies #CwScheduler #CwSchedulerActive #cwelltContentDuty #cwelltContentDutyActive
|
|
4079
|
+
* Save button wrapper
|
|
4080
|
+
* @deprecated Use <CwButton variant="icon" icon="save" onClick={...} /> instead
|
|
4608
4081
|
*/
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
const cwShowElement = () => {
|
|
4612
|
-
// Content of List Duties
|
|
4613
|
-
const cwContentDuty = document.getElementById("cwelltContentDuty");
|
|
4614
|
-
cwContentDuty?.classList.toggle("cwelltContentDutyActive");
|
|
4615
|
-
// Floating button
|
|
4616
|
-
const cw_btnFloatingButton = document.getElementById("cw_btnFloatingButton");
|
|
4617
|
-
cw_btnFloatingButton?.classList.toggle("cw_btnFloatingButtonActive");
|
|
4618
|
-
// #CwScheduler [ scheduler container]
|
|
4619
|
-
const cwScheduler = document.getElementById("CwelltScheduler");
|
|
4620
|
-
cwScheduler?.classList.toggle("CwelltSchedulerActive");
|
|
4621
|
-
};
|
|
4622
|
-
return jsx("button", { className: "cw_btnFloatingButton", onClick: cwShowElement, id: "cw_btnFloatingButton" });
|
|
4623
|
-
}
|
|
4624
|
-
// Primary button => CwButtonDef
|
|
4625
|
-
// CwButtonDef
|
|
4626
|
-
function CwButtonDef({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }) {
|
|
4627
|
-
return (jsx("button", { className: "cw-button cw_btn_primary", onClick: cw_btnOnclick, disabled: cw_btn_disabled, children: cw_btn_desc }));
|
|
4628
|
-
}
|
|
4629
|
-
// Cw add button
|
|
4630
|
-
function CwBtnAdd({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4631
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-plus", disabled: cw_btn_disabled });
|
|
4632
|
-
}
|
|
4633
|
-
// Cw Save button
|
|
4634
|
-
function CwBtnSave({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4635
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-save", disabled: cw_btn_disabled });
|
|
4636
|
-
}
|
|
4637
|
-
// Cw edit button
|
|
4638
|
-
function CwBtnEdit({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4639
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-edit", disabled: cw_btn_disabled });
|
|
4640
|
-
}
|
|
4641
|
-
// Cw search button
|
|
4642
|
-
function CwBtnSearch({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4643
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-search", disabled: cw_btn_disabled });
|
|
4644
|
-
}
|
|
4645
|
-
// Cw download button
|
|
4646
|
-
function CwBtnDownload({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4647
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-download", disabled: cw_btn_disabled });
|
|
4648
|
-
}
|
|
4649
|
-
// Cw view button
|
|
4650
|
-
function CwBtnView({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4651
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-eye-show", disabled: cw_btn_disabled });
|
|
4652
|
-
}
|
|
4653
|
-
// Cw Print button
|
|
4654
|
-
function CwBtnPrint({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4655
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-print", disabled: cw_btn_disabled });
|
|
4656
|
-
}
|
|
4657
|
-
// Cw cancel button
|
|
4658
|
-
function CwBtnCancel({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4659
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-cancel", disabled: cw_btn_disabled, "data-color": "danger" });
|
|
4660
|
-
}
|
|
4661
|
-
// Cw Delete button
|
|
4662
|
-
function CwBtnDelete({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4663
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-delete", disabled: cw_btn_disabled, "data-color": "danger" });
|
|
4664
|
-
}
|
|
4665
|
-
// CwRefresh
|
|
4666
|
-
function CwBtnRefresh({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4667
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-refresh", disabled: cw_btn_disabled });
|
|
4668
|
-
}
|
|
4669
|
-
// Cw hide
|
|
4670
|
-
function CwBtnHide({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4671
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-eye-hide", disabled: cw_btn_disabled });
|
|
4672
|
-
}
|
|
4673
|
-
// Cw Select
|
|
4674
|
-
function CwBtnSelect({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4675
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btn_select", disabled: cw_btn_disabled });
|
|
4676
|
-
}
|
|
4677
|
-
// Cw Share
|
|
4678
|
-
function CwBtnShare({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4679
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-share", disabled: cw_btn_disabled });
|
|
4680
|
-
}
|
|
4681
|
-
// Cw Files
|
|
4682
|
-
function CwBtnFiles({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4683
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btn_files", disabled: cw_btn_disabled });
|
|
4684
|
-
}
|
|
4685
|
-
// Cw Airport
|
|
4686
|
-
function CwBtnAirport({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4687
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btn_airport", disabled: cw_btn_disabled });
|
|
4082
|
+
function CwBtnSave({ cw_btnOnclick, cw_btn_disabled, onClick, disabled, ...rest }) {
|
|
4083
|
+
return (jsx(CwButton, { ...rest, variant: "icon", icon: "save", onClick: onClick ?? cw_btnOnclick, disabled: disabled ?? cw_btn_disabled }));
|
|
4688
4084
|
}
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-directory", disabled: cw_btn_disabled });
|
|
4696
|
-
}
|
|
4697
|
-
// AddFolder
|
|
4698
|
-
function CwBtnAddFolder({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4699
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-add", disabled: cw_btn_disabled });
|
|
4700
|
-
}
|
|
4701
|
-
// EditFolder
|
|
4702
|
-
function CwBtnEditFolder({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4703
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-edit", disabled: cw_btn_disabled });
|
|
4704
|
-
}
|
|
4705
|
-
// UploadFiles
|
|
4706
|
-
function CwBtnUploadFiles({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4707
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-upload", disabled: cw_btn_disabled });
|
|
4708
|
-
}
|
|
4709
|
-
// GoBackSection [ Emanual ]
|
|
4710
|
-
function CwBtnGoBackFolder({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4711
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cwBtnGoBackFolder", disabled: cw_btn_disabled });
|
|
4712
|
-
}
|
|
4713
|
-
// BookMark [ Emanual ]
|
|
4714
|
-
function CwBtnBookMark({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4715
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-star", disabled: cw_btn_disabled });
|
|
4716
|
-
}
|
|
4717
|
-
// Publish
|
|
4718
|
-
function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4719
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnPublish", disabled: cw_btn_disabled });
|
|
4720
|
-
}
|
|
4721
|
-
// Approve
|
|
4722
|
-
function CwBtnApprove({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4723
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnApprove", disabled: cw_btn_disabled });
|
|
4724
|
-
}
|
|
4725
|
-
// Bulk duty
|
|
4726
|
-
function CwBtnBulkDuty({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4727
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnBulkDuty", disabled: cw_btn_disabled });
|
|
4728
|
-
}
|
|
4729
|
-
// DropDownButtonCrewControl
|
|
4730
|
-
function CwBtnDropDownMenu({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4731
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnDropDownMenu", disabled: cw_btn_disabled });
|
|
4732
|
-
}
|
|
4733
|
-
// DropDownButtonCrewControl
|
|
4734
|
-
function CwBtnAlert({ cw_btnOnclick, cw_btn_disabled, cw_name }) {
|
|
4735
|
-
return (jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-alert", disabled: cw_btn_disabled, id: cw_name }));
|
|
4736
|
-
}
|
|
4737
|
-
// BtnNavFirstItemView
|
|
4738
|
-
function CwBtnNavFirstItemView({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4739
|
-
return (jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnNavFirstItemView", disabled: cw_btn_disabled }));
|
|
4740
|
-
}
|
|
4741
|
-
// BtnNavLastItemView
|
|
4742
|
-
function CwBtnNavLastItemView({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4743
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnNavLastItemView", disabled: cw_btn_disabled });
|
|
4744
|
-
}
|
|
4745
|
-
// BtnNavbreviewItem
|
|
4746
|
-
function CwBtnNavPreviewItem({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4747
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnNavPreviewItem", disabled: cw_btn_disabled });
|
|
4748
|
-
}
|
|
4749
|
-
// BtnNavNextDay
|
|
4750
|
-
function CwBtnNavNextDay({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4751
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnNavNextDay", disabled: cw_btn_disabled });
|
|
4752
|
-
}
|
|
4753
|
-
// BtnNavNextDay
|
|
4754
|
-
function CwBtnStatistic({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4755
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-file-report", disabled: cw_btn_disabled });
|
|
4756
|
-
}
|
|
4757
|
-
// BtnNavNextDay
|
|
4758
|
-
function CwBtnCrewPlanning({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4759
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-calendar-view", disabled: cw_btn_disabled });
|
|
4760
|
-
}
|
|
4761
|
-
// BtnReleasePeriod
|
|
4762
|
-
function CwBtnReleasePeriod({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4763
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnReleasePeriod", disabled: cw_btn_disabled });
|
|
4764
|
-
}
|
|
4765
|
-
// BtnReleasePeriod
|
|
4766
|
-
function CwBtnGeneratePairing({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4767
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-plane-pairing", disabled: cw_btn_disabled });
|
|
4768
|
-
}
|
|
4769
|
-
// BtnImportRequests
|
|
4770
|
-
function CwBtnImportRequests({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4771
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnImportRequests", disabled: cw_btn_disabled });
|
|
4772
|
-
}
|
|
4773
|
-
// BtnPairing
|
|
4774
|
-
function CwBtnPairing({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4775
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-calendar-plane", disabled: cw_btn_disabled });
|
|
4776
|
-
}
|
|
4777
|
-
// BtnVacations
|
|
4778
|
-
function CwBtnVacations({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4779
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-luggage", disabled: cw_btn_disabled });
|
|
4780
|
-
}
|
|
4781
|
-
// BtnMVT
|
|
4782
|
-
function CwBtnMVT({ cw_btnOnclick, cw_btn_disabled }) {
|
|
4783
|
-
return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-plane-movement", disabled: cw_btn_disabled });
|
|
4085
|
+
/**
|
|
4086
|
+
* Edit button wrapper
|
|
4087
|
+
* @deprecated Use <CwButton variant="icon" icon="edit" onClick={...} /> instead
|
|
4088
|
+
*/
|
|
4089
|
+
function CwBtnEdit({ cw_btnOnclick, cw_btn_disabled, onClick, disabled, ...rest }) {
|
|
4090
|
+
return (jsx(CwButton, { ...rest, variant: "icon", icon: "edit", onClick: onClick ?? cw_btnOnclick, disabled: disabled ?? cw_btn_disabled }));
|
|
4784
4091
|
}
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4092
|
+
/**
|
|
4093
|
+
* Delete button wrapper
|
|
4094
|
+
* @deprecated Use <CwButton variant="icon" icon="delete" color="danger" onClick={...} /> instead
|
|
4095
|
+
*/
|
|
4096
|
+
function CwBtnDelete({ cw_btnOnclick, cw_btn_disabled, onClick, disabled, ...rest }) {
|
|
4097
|
+
return (jsx(CwButton, { ...rest, variant: "icon", icon: "delete", color: "danger", onClick: onClick ?? cw_btnOnclick, disabled: disabled ?? cw_btn_disabled }));
|
|
4788
4098
|
}
|
|
4789
4099
|
|
|
4790
4100
|
var styles$4 = {"pickerWrapper":"cw-pickers-base-module_pickerWrapper__Fb9Zo","pickerIcons":"cw-pickers-base-module_pickerIcons__dyd2-","pickerPopup":"cw-pickers-base-module_pickerPopup__dkxJo","title":"cw-pickers-base-module_title__cE7qI"};
|
|
@@ -4793,12 +4103,12 @@ function CustomCaption$2({ displayMonth }) {
|
|
|
4793
4103
|
const { goToMonth, nextMonth, previousMonth } = useNavigation();
|
|
4794
4104
|
return (jsxs("header", { children: [jsx(CwButton, { type: "button", variant: "icon", icon: "chevron-left", onClick: () => previousMonth && goToMonth(previousMonth), disabled: !previousMonth, "aria-label": "Previous month" }), jsx("div", { className: styles$4.title, children: format(displayMonth, "MMMM yyyy", { locale: enGB }) }), jsx(CwButton, { type: "button", variant: "icon", icon: "chevron-right", onClick: () => nextMonth && goToMonth(nextMonth), disabled: !nextMonth, "aria-label": "Next month" })] }));
|
|
4795
4105
|
}
|
|
4796
|
-
function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabledMatcher, labelProps, alignProps, placeholder = "Select a date", displayFormat = "dd.MM.yyyy", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showTodayButton = false, }) {
|
|
4106
|
+
function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabledMatcher, defaultMonth, labelProps, alignProps, placeholder = "Select a date", displayFormat = "dd.MM.yyyy", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showTodayButton = false, }) {
|
|
4797
4107
|
const [isOpen, setIsOpen] = useState(false);
|
|
4798
4108
|
const [inputValue, setInputValue] = useState("");
|
|
4799
4109
|
const containerRef = useRef(null);
|
|
4800
4110
|
const inputRef = useRef(null);
|
|
4801
|
-
const prevValueRef = useRef(
|
|
4111
|
+
const prevValueRef = useRef(undefined);
|
|
4802
4112
|
// Parse date from string based on format
|
|
4803
4113
|
const parseDate = useCallback((dateString, formatStr) => {
|
|
4804
4114
|
try {
|
|
@@ -4869,11 +4179,12 @@ function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabl
|
|
|
4869
4179
|
}, [parseDate, displayFormat, minDate, maxDate, onChange, normalizeDateForComparison]);
|
|
4870
4180
|
// Sync input value with prop value - only when changed externally
|
|
4871
4181
|
useEffect(() => {
|
|
4872
|
-
const
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4182
|
+
const currentTime = value?.getTime();
|
|
4183
|
+
const prevTime = prevValueRef.current?.getTime();
|
|
4184
|
+
if (currentTime !== prevTime) {
|
|
4185
|
+
prevValueRef.current = value;
|
|
4186
|
+
if (value) {
|
|
4187
|
+
setInputValue(format(value, displayFormat, { locale: enGB }));
|
|
4877
4188
|
}
|
|
4878
4189
|
else {
|
|
4879
4190
|
setInputValue("");
|
|
@@ -4974,7 +4285,7 @@ function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabl
|
|
|
4974
4285
|
...(maxDate ? [{ after: maxDate }] : []),
|
|
4975
4286
|
...(disabledMatcher ? [disabledMatcher] : []),
|
|
4976
4287
|
], [disabledDates, minDate, maxDate, disabledMatcher]);
|
|
4977
|
-
return (jsx("div", { ref: containerRef, className: `cw-datepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear date" })) : (jsx(CwIcon, { iconId: "calendar" })) }), isOpen && (jsxs("div", { className: styles$4.pickerPopup, "data-position": popupPosition, children: [jsx(DayPicker, { mode: "single", selected: value || undefined, defaultMonth: value || undefined, onSelect: handleDaySelect, disabled: disabledDays, locale: enGB, numberOfMonths: numberOfMonths, formatters: formatters, components: {
|
|
4288
|
+
return (jsx("div", { ref: containerRef, className: `cw-datepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear date" })) : (jsx(CwIcon, { iconId: "calendar" })) }), isOpen && (jsxs("div", { className: styles$4.pickerPopup, "data-position": popupPosition, children: [jsx(DayPicker, { mode: "single", selected: value || undefined, defaultMonth: defaultMonth || value || undefined, onSelect: handleDaySelect, disabled: disabledDays, locale: enGB, numberOfMonths: numberOfMonths, formatters: formatters, components: {
|
|
4978
4289
|
Caption: (props) => (jsx(CustomCaption$2, { ...props })),
|
|
4979
4290
|
}, modifiers: {
|
|
4980
4291
|
today: new Date(),
|
|
@@ -4987,6 +4298,54 @@ var rangeStyles = {"rangeWrapper":"cw-range-picker-module_rangeWrapper__1nIVs","
|
|
|
4987
4298
|
|
|
4988
4299
|
const PRESET_LIBRARY = {
|
|
4989
4300
|
// === PAST DAYS ===
|
|
4301
|
+
today: {
|
|
4302
|
+
key: 'today',
|
|
4303
|
+
label: 'Today',
|
|
4304
|
+
getValue: () => {
|
|
4305
|
+
const from = new Date();
|
|
4306
|
+
from.setHours(0, 0, 0, 0);
|
|
4307
|
+
const to = new Date();
|
|
4308
|
+
to.setHours(23, 59, 59, 999);
|
|
4309
|
+
return { from, to };
|
|
4310
|
+
}
|
|
4311
|
+
},
|
|
4312
|
+
yesterday: {
|
|
4313
|
+
key: 'yesterday',
|
|
4314
|
+
label: 'Yesterday',
|
|
4315
|
+
getValue: () => {
|
|
4316
|
+
const from = new Date();
|
|
4317
|
+
from.setDate(from.getDate() - 1);
|
|
4318
|
+
from.setHours(0, 0, 0, 0);
|
|
4319
|
+
const to = new Date();
|
|
4320
|
+
to.setDate(to.getDate() - 1);
|
|
4321
|
+
to.setHours(23, 59, 59, 999);
|
|
4322
|
+
return { from, to };
|
|
4323
|
+
}
|
|
4324
|
+
},
|
|
4325
|
+
past2Days: {
|
|
4326
|
+
key: 'past2Days',
|
|
4327
|
+
label: 'Past 2 Days',
|
|
4328
|
+
getValue: () => {
|
|
4329
|
+
const today = new Date();
|
|
4330
|
+
today.setHours(23, 59, 59, 999);
|
|
4331
|
+
const twoDaysAgo = new Date();
|
|
4332
|
+
twoDaysAgo.setDate(today.getDate() - 2);
|
|
4333
|
+
twoDaysAgo.setHours(0, 0, 0, 0);
|
|
4334
|
+
return { from: twoDaysAgo, to: today };
|
|
4335
|
+
}
|
|
4336
|
+
},
|
|
4337
|
+
past3Days: {
|
|
4338
|
+
key: 'past3Days',
|
|
4339
|
+
label: 'Past 3 Days',
|
|
4340
|
+
getValue: () => {
|
|
4341
|
+
const today = new Date();
|
|
4342
|
+
today.setHours(23, 59, 59, 999);
|
|
4343
|
+
const threeDaysAgo = new Date();
|
|
4344
|
+
threeDaysAgo.setDate(today.getDate() - 3);
|
|
4345
|
+
threeDaysAgo.setHours(0, 0, 0, 0);
|
|
4346
|
+
return { from: threeDaysAgo, to: today };
|
|
4347
|
+
}
|
|
4348
|
+
},
|
|
4990
4349
|
past7Days: {
|
|
4991
4350
|
key: 'past7Days',
|
|
4992
4351
|
label: 'Past 7 days',
|
|
@@ -5210,7 +4569,7 @@ function CustomCaption$1({ displayMonth }) {
|
|
|
5210
4569
|
const { goToMonth, nextMonth, previousMonth } = useNavigation();
|
|
5211
4570
|
return (jsxs("header", { children: [jsx(CwButton, { type: "button", variant: "icon", icon: "chevron-left", onClick: () => previousMonth && goToMonth(previousMonth), disabled: !previousMonth, "aria-label": "Previous month" }), jsx("div", { className: styles$4.title, children: format(displayMonth, "MMMM yyyy", { locale: enGB }) }), jsx(CwButton, { type: "button", variant: "icon", icon: "chevron-right", onClick: () => nextMonth && goToMonth(nextMonth), disabled: !nextMonth, "aria-label": "Next month" })] }));
|
|
5212
4571
|
}
|
|
5213
|
-
function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, disabledMatcher, maxRangeDays, labelProps, alignProps, placeholderFrom = "From date", placeholderTo = "To date", displayFormat = "dd.MM.yyyy", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 2, showPresets = false, presetKeys, customPresets, }) {
|
|
4572
|
+
function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, disabledMatcher, maxRangeDays, defaultMonth, labelProps, alignProps, placeholderFrom = "From date", placeholderTo = "To date", displayFormat = "dd.MM.yyyy", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 2, showPresets = false, presetKeys, customPresets, }) {
|
|
5214
4573
|
const [isOpen, setIsOpen] = useState(false);
|
|
5215
4574
|
const [inputFromValue, setInputFromValue] = useState("");
|
|
5216
4575
|
const [inputToValue, setInputToValue] = useState("");
|
|
@@ -5218,7 +4577,7 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5218
4577
|
const containerRef = useRef(null);
|
|
5219
4578
|
const inputFromRef = useRef(null);
|
|
5220
4579
|
const inputToRef = useRef(null);
|
|
5221
|
-
const prevValueRef = useRef(
|
|
4580
|
+
const prevValueRef = useRef(undefined);
|
|
5222
4581
|
// Calculate presets to render
|
|
5223
4582
|
const presetsToRender = useMemo(() => {
|
|
5224
4583
|
let presets = [];
|
|
@@ -5301,17 +4660,26 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5301
4660
|
}, [maxRangeDays]);
|
|
5302
4661
|
// Sync input values with prop value
|
|
5303
4662
|
useEffect(() => {
|
|
5304
|
-
const
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
4663
|
+
const currentFromTime = value?.from?.getTime();
|
|
4664
|
+
const currentToTime = value?.to?.getTime();
|
|
4665
|
+
const prevFromTime = prevValueRef.current?.fromTime;
|
|
4666
|
+
const prevToTime = prevValueRef.current?.toTime;
|
|
4667
|
+
// Only update if times have actually changed
|
|
4668
|
+
if (currentFromTime !== prevFromTime || currentToTime !== prevToTime) {
|
|
4669
|
+
prevValueRef.current = {
|
|
4670
|
+
fromTime: currentFromTime,
|
|
4671
|
+
toTime: currentToTime
|
|
4672
|
+
};
|
|
4673
|
+
// Update "from" input
|
|
4674
|
+
if (value?.from) {
|
|
4675
|
+
setInputFromValue(format(value.from, displayFormat, { locale: enGB }));
|
|
5309
4676
|
}
|
|
5310
4677
|
else {
|
|
5311
4678
|
setInputFromValue("");
|
|
5312
4679
|
}
|
|
5313
|
-
|
|
5314
|
-
|
|
4680
|
+
// Update "to" input
|
|
4681
|
+
if (value?.to) {
|
|
4682
|
+
setInputToValue(format(value.to, displayFormat, { locale: enGB }));
|
|
5315
4683
|
}
|
|
5316
4684
|
else {
|
|
5317
4685
|
setInputToValue("");
|
|
@@ -5333,26 +4701,60 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5333
4701
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
5334
4702
|
};
|
|
5335
4703
|
}, [isOpen]);
|
|
5336
|
-
const handleRangeSelect = useCallback((range
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
4704
|
+
const handleRangeSelect = useCallback((range, // El rango sugerido por react-day-picker
|
|
4705
|
+
selectedDay) => {
|
|
4706
|
+
let newRange;
|
|
4707
|
+
if (focusedInput === 'from') {
|
|
4708
|
+
newRange = { from: selectedDay, to: value?.to };
|
|
4709
|
+
if (newRange.to && selectedDay > newRange.to) {
|
|
4710
|
+
newRange.to = undefined;
|
|
4711
|
+
setFocusedInput('to');
|
|
4712
|
+
}
|
|
4713
|
+
else if (newRange.to) {
|
|
4714
|
+
setIsOpen(false);
|
|
4715
|
+
setFocusedInput(undefined);
|
|
4716
|
+
}
|
|
4717
|
+
else {
|
|
4718
|
+
setFocusedInput('to');
|
|
4719
|
+
}
|
|
5340
4720
|
}
|
|
5341
|
-
|
|
5342
|
-
from:
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
4721
|
+
else if (focusedInput === 'to') {
|
|
4722
|
+
newRange = { from: value?.from, to: selectedDay };
|
|
4723
|
+
if (newRange.from && selectedDay < newRange.from) {
|
|
4724
|
+
newRange.from = undefined;
|
|
4725
|
+
setFocusedInput('from');
|
|
4726
|
+
}
|
|
4727
|
+
else if (newRange.from) {
|
|
4728
|
+
setIsOpen(false);
|
|
4729
|
+
setFocusedInput(undefined);
|
|
4730
|
+
}
|
|
4731
|
+
else {
|
|
4732
|
+
setFocusedInput('from');
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
else {
|
|
4736
|
+
if (!range) {
|
|
4737
|
+
onChange(undefined);
|
|
4738
|
+
return;
|
|
4739
|
+
}
|
|
4740
|
+
newRange = { from: range.from, to: range.to };
|
|
4741
|
+
if (range.from && range.to) {
|
|
4742
|
+
setIsOpen(false);
|
|
4743
|
+
setFocusedInput(undefined);
|
|
4744
|
+
}
|
|
4745
|
+
else if (range.from) {
|
|
4746
|
+
setFocusedInput('to');
|
|
4747
|
+
}
|
|
4748
|
+
else {
|
|
4749
|
+
setFocusedInput('from');
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
// Validate range before sending
|
|
5346
4753
|
if (newRange.from && newRange.to && !validateRange(newRange.from, newRange.to)) {
|
|
5347
|
-
return;
|
|
4754
|
+
return;
|
|
5348
4755
|
}
|
|
5349
4756
|
onChange(newRange);
|
|
5350
|
-
|
|
5351
|
-
if (range.from && range.to) {
|
|
5352
|
-
setIsOpen(false);
|
|
5353
|
-
setFocusedInput(undefined);
|
|
5354
|
-
}
|
|
5355
|
-
}, [onChange, validateRange]);
|
|
4757
|
+
}, [onChange, validateRange, value, focusedInput]);
|
|
5356
4758
|
const handleClearFrom = useCallback((e) => {
|
|
5357
4759
|
e.stopPropagation();
|
|
5358
4760
|
onChange({ from: undefined, to: value?.to });
|
|
@@ -5474,7 +4876,9 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5474
4876
|
}
|
|
5475
4877
|
}, []);
|
|
5476
4878
|
// Handle preset click
|
|
5477
|
-
const handlePresetClick = useCallback((preset) => {
|
|
4879
|
+
const handlePresetClick = useCallback((preset, e) => {
|
|
4880
|
+
e.preventDefault();
|
|
4881
|
+
e.stopPropagation();
|
|
5478
4882
|
onChange(preset.getValue());
|
|
5479
4883
|
setIsOpen(false);
|
|
5480
4884
|
}, [onChange]);
|
|
@@ -5492,10 +4896,24 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5492
4896
|
...(disabledMatcher ? [disabledMatcher] : []),
|
|
5493
4897
|
];
|
|
5494
4898
|
// If maxRangeDays is set and we have a "from" date, disable dates beyond the range
|
|
5495
|
-
if (maxRangeDays
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
4899
|
+
if (maxRangeDays) {
|
|
4900
|
+
if (value?.from) {
|
|
4901
|
+
const maxAllowedDate = new Date(value.from);
|
|
4902
|
+
maxAllowedDate.setDate(maxAllowedDate.getDate() + maxRangeDays);
|
|
4903
|
+
if (focusedInput !== 'from') {
|
|
4904
|
+
baseDisabled.push({ after: maxAllowedDate });
|
|
4905
|
+
}
|
|
4906
|
+
if (focusedInput === 'to' && !value?.to) {
|
|
4907
|
+
const minAllowedDate = new Date(value.from);
|
|
4908
|
+
minAllowedDate.setDate(minAllowedDate.getDate() - maxRangeDays);
|
|
4909
|
+
baseDisabled.push({ before: minAllowedDate });
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4912
|
+
if (value?.to && !value?.from && focusedInput === 'from') {
|
|
4913
|
+
const minAllowedDate = new Date(value.to);
|
|
4914
|
+
minAllowedDate.setDate(minAllowedDate.getDate() - maxRangeDays);
|
|
4915
|
+
baseDisabled.push({ before: minAllowedDate });
|
|
4916
|
+
}
|
|
5499
4917
|
}
|
|
5500
4918
|
return baseDisabled;
|
|
5501
4919
|
}, [disabledDates, minDate, maxDate, disabledMatcher, maxRangeDays, value]);
|
|
@@ -5508,7 +4926,7 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
|
|
|
5508
4926
|
}
|
|
5509
4927
|
return undefined;
|
|
5510
4928
|
}, [value]);
|
|
5511
|
-
return (jsx("div", { ref: containerRef, className: `cw-rangepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: rangeStyles.rangeWrapper, children: [jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputFromRef, type: "text", value: inputFromValue, placeholder: placeholderFrom, onChange: handleInputFromChange, onBlur: () => handleInputBlur('from'), onClick: handleInputFromClick, onKeyDown: (e) => handleInputKeyDown(e, 'from'), disabled: disabled, required: required, "data-focused": focusedInput === 'from' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.from && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearFrom, tabIndex: -1, "aria-label": "Clear from date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), jsx(CwIcon, { iconId: "arrow-right", size: "medium" }), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputToRef, type: "text", value: inputToValue, placeholder: placeholderTo, onChange: handleInputToChange, onBlur: () => handleInputBlur('to'), onClick: handleInputToClick, onKeyDown: (e) => handleInputKeyDown(e, 'to'), disabled: disabled, required: required, "data-focused": focusedInput === 'to' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.to && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearTo, tabIndex: -1, "aria-label": "Clear to date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), isOpen && (jsxs("div", { className: `${styles$4.pickerPopup} ${rangeStyles.rangePopup}`, "data-position": popupPosition, children: [showPresets && presetsToRender.length > 0 && (jsx("div", { className: rangeStyles.presetList, children: presetsToRender.map((preset) => (jsx("button", { type: "button", onClick: () => handlePresetClick(preset), children: preset.label }, preset.key))) })), jsx(DayPicker, { mode: "range", selected: selectedRange, onSelect: handleRangeSelect, disabled: disabledDays, locale: enGB, numberOfMonths: numberOfMonths, formatters: formatters, components: {
|
|
4929
|
+
return (jsx("div", { ref: containerRef, className: `cw-rangepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: rangeStyles.rangeWrapper, children: [jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputFromRef, type: "text", value: inputFromValue, placeholder: placeholderFrom, onChange: handleInputFromChange, onBlur: () => handleInputBlur('from'), onClick: handleInputFromClick, onKeyDown: (e) => handleInputKeyDown(e, 'from'), disabled: disabled, required: required, "data-focused": focusedInput === 'from' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.from && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearFrom, tabIndex: -1, "aria-label": "Clear from date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), jsx(CwIcon, { iconId: "arrow-right", size: "medium" }), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputToRef, type: "text", value: inputToValue, placeholder: placeholderTo, onChange: handleInputToChange, onBlur: () => handleInputBlur('to'), onClick: handleInputToClick, onKeyDown: (e) => handleInputKeyDown(e, 'to'), disabled: disabled, required: required, "data-focused": focusedInput === 'to' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.to && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearTo, tabIndex: -1, "aria-label": "Clear to date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), isOpen && (jsxs("div", { className: `${styles$4.pickerPopup} ${rangeStyles.rangePopup}`, "data-position": popupPosition, children: [showPresets && presetsToRender.length > 0 && (jsx("div", { className: rangeStyles.presetList, children: presetsToRender.map((preset) => (jsx("button", { type: "button", onClick: (e) => handlePresetClick(preset, e), children: preset.label }, preset.key))) })), jsx(DayPicker, { mode: "range", selected: selectedRange, onSelect: handleRangeSelect, disabled: disabledDays, locale: enGB, numberOfMonths: numberOfMonths, defaultMonth: defaultMonth || value?.from || undefined, formatters: formatters, components: {
|
|
5512
4930
|
Caption: (props) => jsx(CustomCaption$1, { ...props }),
|
|
5513
4931
|
}, modifiers: {
|
|
5514
4932
|
today: new Date(),
|
|
@@ -5686,10 +5104,52 @@ function CwTimePicker({ value, onChange, interval = 15, minTime, maxTime, labelP
|
|
|
5686
5104
|
}
|
|
5687
5105
|
|
|
5688
5106
|
function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledDates, disabledMatcher, timeInterval = 15, minTime, maxTime, labelProps, alignProps, datePlaceholder = "dd.MM.yyyy", timePlaceholder = "HH:mm", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showNowButton = false, }) {
|
|
5107
|
+
// ========================================
|
|
5108
|
+
// PROPS NORMALIZATION
|
|
5109
|
+
// ========================================
|
|
5110
|
+
/**
|
|
5111
|
+
* Normalize datetime prop to valid Date object
|
|
5112
|
+
* @returns Valid Date object or undefined if invalid
|
|
5113
|
+
*/
|
|
5114
|
+
const normalizeDateTime = useCallback((dateTime, propName) => {
|
|
5115
|
+
if (!dateTime)
|
|
5116
|
+
return undefined;
|
|
5117
|
+
try {
|
|
5118
|
+
// Convert to Date object if not already
|
|
5119
|
+
const date = dateTime instanceof Date
|
|
5120
|
+
? dateTime
|
|
5121
|
+
: new Date(dateTime);
|
|
5122
|
+
// Validate the Date object is valid
|
|
5123
|
+
if (isNaN(date.getTime())) {
|
|
5124
|
+
console.warn(`[CwDateTimePicker] Invalid ${propName} provided:`, dateTime);
|
|
5125
|
+
return undefined;
|
|
5126
|
+
}
|
|
5127
|
+
return date;
|
|
5128
|
+
}
|
|
5129
|
+
catch (error) {
|
|
5130
|
+
console.warn(`[CwDateTimePicker] Error parsing ${propName}:`, dateTime, error);
|
|
5131
|
+
return undefined;
|
|
5132
|
+
}
|
|
5133
|
+
}, []);
|
|
5134
|
+
// Normalize min/max datetime props using the helper
|
|
5135
|
+
const normalizedMinDateTime = useMemo(() => normalizeDateTime(minDateTime, 'minDateTime'), [minDateTime, normalizeDateTime]);
|
|
5136
|
+
const normalizedMaxDateTime = useMemo(() => normalizeDateTime(maxDateTime, 'maxDateTime'), [maxDateTime, normalizeDateTime]);
|
|
5137
|
+
// ========================================
|
|
5138
|
+
// INTERNAL STATE
|
|
5139
|
+
// ========================================
|
|
5689
5140
|
const [selectedDate, setSelectedDate] = useState(value);
|
|
5690
5141
|
const [selectedTime, setSelectedTime] = useState(value ? `${value.getHours().toString().padStart(2, "0")}:${value.getMinutes().toString().padStart(2, "0")}` : undefined);
|
|
5691
|
-
|
|
5692
|
-
|
|
5142
|
+
// Track previous value to detect external changes
|
|
5143
|
+
const prevValueRef = useRef(undefined);
|
|
5144
|
+
// ========================================
|
|
5145
|
+
// COMBINATION AND VALIDATION LOGIC
|
|
5146
|
+
// ========================================
|
|
5147
|
+
/**
|
|
5148
|
+
* Combine date and time into a single Date object
|
|
5149
|
+
* Validates the combined datetime against min/max constraints
|
|
5150
|
+
*
|
|
5151
|
+
* @returns Combined Date object or undefined if invalid
|
|
5152
|
+
*/
|
|
5693
5153
|
const combineDateTime = useCallback((date, time) => {
|
|
5694
5154
|
if (!date)
|
|
5695
5155
|
return undefined;
|
|
@@ -5697,21 +5157,85 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
|
|
|
5697
5157
|
if (!time) {
|
|
5698
5158
|
const combined = new Date(date);
|
|
5699
5159
|
combined.setHours(0, 0, 0, 0);
|
|
5160
|
+
// Validate against min/max datetime
|
|
5161
|
+
if (normalizedMinDateTime && combined < normalizedMinDateTime)
|
|
5162
|
+
return undefined;
|
|
5163
|
+
if (normalizedMaxDateTime && combined > normalizedMaxDateTime)
|
|
5164
|
+
return undefined;
|
|
5700
5165
|
return combined;
|
|
5701
5166
|
}
|
|
5167
|
+
// Parse time and combine with date
|
|
5702
5168
|
const [hours, minutes] = time.split(':').map(Number);
|
|
5703
5169
|
const combined = new Date(date);
|
|
5704
5170
|
combined.setHours(hours, minutes, 0, 0);
|
|
5171
|
+
// Validate against min/max datetime
|
|
5172
|
+
if (normalizedMinDateTime && combined < normalizedMinDateTime)
|
|
5173
|
+
return undefined;
|
|
5174
|
+
if (normalizedMaxDateTime && combined > normalizedMaxDateTime)
|
|
5175
|
+
return undefined;
|
|
5705
5176
|
return combined;
|
|
5706
|
-
}, []);
|
|
5707
|
-
|
|
5177
|
+
}, [normalizedMinDateTime, normalizedMaxDateTime]);
|
|
5178
|
+
/**
|
|
5179
|
+
* Calculate dynamic time restrictions based on selected date
|
|
5180
|
+
*
|
|
5181
|
+
* If the selected date matches the min/max date boundary, restrict times accordingly.
|
|
5182
|
+
* Allows users to manually type any valid time, not just interval-aligned times.
|
|
5183
|
+
* The timeInterval prop only affects the dropdown options, not manual input validation.
|
|
5184
|
+
*
|
|
5185
|
+
* @param selectedDate - Currently selected date
|
|
5186
|
+
* @returns Object with minTime and maxTime strings in "HH:mm" format
|
|
5187
|
+
*/
|
|
5188
|
+
const calculateTimeRestrictions = useCallback((selectedDate) => {
|
|
5189
|
+
if (!selectedDate)
|
|
5190
|
+
return { minTime, maxTime };
|
|
5191
|
+
// Normalize selected date to date-only (ignore time component)
|
|
5192
|
+
const selectedDateOnly = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate());
|
|
5193
|
+
let calculatedMinTime = minTime;
|
|
5194
|
+
let calculatedMaxTime = maxTime;
|
|
5195
|
+
// If selected date matches minDateTime date, restrict minimum time
|
|
5196
|
+
if (normalizedMinDateTime) {
|
|
5197
|
+
const minDateOnly = new Date(normalizedMinDateTime.getFullYear(), normalizedMinDateTime.getMonth(), normalizedMinDateTime.getDate());
|
|
5198
|
+
if (selectedDateOnly.getTime() === minDateOnly.getTime()) {
|
|
5199
|
+
const hours = normalizedMinDateTime.getHours().toString().padStart(2, "0");
|
|
5200
|
+
const minutes = normalizedMinDateTime.getMinutes().toString().padStart(2, "0");
|
|
5201
|
+
calculatedMinTime = `${hours}:${minutes}`;
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
5204
|
+
// If selected date matches maxDateTime date, restrict maximum time
|
|
5205
|
+
if (normalizedMaxDateTime) {
|
|
5206
|
+
const maxDateOnly = new Date(normalizedMaxDateTime.getFullYear(), normalizedMaxDateTime.getMonth(), normalizedMaxDateTime.getDate());
|
|
5207
|
+
if (selectedDateOnly.getTime() === maxDateOnly.getTime()) {
|
|
5208
|
+
const hours = normalizedMaxDateTime.getHours().toString().padStart(2, "0");
|
|
5209
|
+
const minutes = normalizedMaxDateTime.getMinutes().toString().padStart(2, "0");
|
|
5210
|
+
calculatedMaxTime = `${hours}:${minutes}`;
|
|
5211
|
+
}
|
|
5212
|
+
}
|
|
5213
|
+
return {
|
|
5214
|
+
minTime: calculatedMinTime,
|
|
5215
|
+
maxTime: calculatedMaxTime
|
|
5216
|
+
};
|
|
5217
|
+
}, [normalizedMinDateTime, normalizedMaxDateTime, minTime, maxTime]);
|
|
5218
|
+
// Calculate current time restrictions based on selected date
|
|
5219
|
+
// Recalculates whenever selectedDate or the calculation function changes
|
|
5220
|
+
const timeRestrictions = useMemo(() => calculateTimeRestrictions(selectedDate), [selectedDate, calculateTimeRestrictions]);
|
|
5221
|
+
// ========================================
|
|
5222
|
+
// SYNC WITH EXTERNAL VALUE PROP
|
|
5223
|
+
// ========================================
|
|
5224
|
+
/**
|
|
5225
|
+
* Sync internal state with prop value - only when changed externally
|
|
5226
|
+
* Uses prevValueRef to detect if the change came from outside
|
|
5227
|
+
* (e.g., parent component updated the value programmatically)
|
|
5228
|
+
* vs. internal changes (user interaction)
|
|
5229
|
+
*/
|
|
5708
5230
|
useEffect(() => {
|
|
5709
|
-
const
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5231
|
+
const currentTime = value?.getTime();
|
|
5232
|
+
const prevTime = prevValueRef.current?.getTime();
|
|
5233
|
+
// Only update if value actually changed
|
|
5234
|
+
if (currentTime !== prevTime) {
|
|
5235
|
+
prevValueRef.current = value;
|
|
5236
|
+
if (value) {
|
|
5237
|
+
setSelectedDate(value);
|
|
5238
|
+
setSelectedTime(`${value.getHours().toString().padStart(2, "0")}:${value.getMinutes().toString().padStart(2, "0")}`);
|
|
5715
5239
|
}
|
|
5716
5240
|
else {
|
|
5717
5241
|
setSelectedDate(undefined);
|
|
@@ -5719,29 +5243,81 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
|
|
|
5719
5243
|
}
|
|
5720
5244
|
}
|
|
5721
5245
|
}, [value]);
|
|
5246
|
+
// ========================================
|
|
5247
|
+
// EVENT HANDLERS
|
|
5248
|
+
// ========================================
|
|
5249
|
+
/**
|
|
5250
|
+
* Handle date selection change
|
|
5251
|
+
*
|
|
5252
|
+
* When date changes, validates if the currently selected time is still valid.
|
|
5253
|
+
* If time becomes invalid (e.g., user switched from Mar 14 to Mar 15 with maxTime=16:27,
|
|
5254
|
+
* and had 18:00 selected), it resets the time to undefined.
|
|
5255
|
+
*/
|
|
5722
5256
|
const handleDateChange = useCallback((date) => {
|
|
5723
5257
|
setSelectedDate(date);
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5258
|
+
if (date && selectedTime) {
|
|
5259
|
+
const combined = combineDateTime(date, selectedTime);
|
|
5260
|
+
if (!combined) {
|
|
5261
|
+
// Time is no longer valid for this date
|
|
5262
|
+
// Auto-set to first valid time (minTime)
|
|
5263
|
+
const restrictions = calculateTimeRestrictions(date);
|
|
5264
|
+
const newTime = restrictions.minTime || undefined;
|
|
5265
|
+
setSelectedTime(newTime);
|
|
5266
|
+
onChange(combineDateTime(date, newTime));
|
|
5267
|
+
return;
|
|
5268
|
+
}
|
|
5269
|
+
onChange(combined);
|
|
5270
|
+
}
|
|
5271
|
+
else if (date) {
|
|
5272
|
+
// Just date selected, no time yet
|
|
5273
|
+
// Auto-set to minTime if available for better UX
|
|
5274
|
+
const restrictions = calculateTimeRestrictions(date);
|
|
5275
|
+
if (restrictions.minTime) {
|
|
5276
|
+
setSelectedTime(restrictions.minTime);
|
|
5277
|
+
onChange(combineDateTime(date, restrictions.minTime));
|
|
5278
|
+
}
|
|
5279
|
+
else {
|
|
5280
|
+
onChange(undefined);
|
|
5281
|
+
}
|
|
5282
|
+
}
|
|
5283
|
+
else {
|
|
5284
|
+
onChange(undefined);
|
|
5285
|
+
}
|
|
5286
|
+
}, [selectedTime, combineDateTime, onChange, calculateTimeRestrictions]);
|
|
5287
|
+
/**
|
|
5288
|
+
* Handle time selection change
|
|
5289
|
+
*
|
|
5290
|
+
* Combines the new time with the selected date and validates.
|
|
5291
|
+
* Only calls onChange if the combination is valid.
|
|
5292
|
+
*/
|
|
5727
5293
|
const handleTimeChange = useCallback((time) => {
|
|
5728
5294
|
setSelectedTime(time);
|
|
5729
5295
|
const combined = combineDateTime(selectedDate, time);
|
|
5730
|
-
|
|
5296
|
+
// Only update if the combination is valid
|
|
5297
|
+
if (combined !== undefined || !time) {
|
|
5298
|
+
onChange(combined);
|
|
5299
|
+
}
|
|
5731
5300
|
}, [selectedDate, combineDateTime, onChange]);
|
|
5301
|
+
/**
|
|
5302
|
+
* Handle "Now" button click
|
|
5303
|
+
* Sets the datetime to the current moment, if it's within the allowed min/max datetime range.
|
|
5304
|
+
*/
|
|
5732
5305
|
const handleNowClick = useCallback(() => {
|
|
5733
5306
|
const now = new Date();
|
|
5734
5307
|
// Check if now is within allowed range
|
|
5735
|
-
const isNowValid = (!
|
|
5736
|
-
(!
|
|
5308
|
+
const isNowValid = (!normalizedMinDateTime || now >= normalizedMinDateTime) &&
|
|
5309
|
+
(!normalizedMaxDateTime || now <= normalizedMaxDateTime);
|
|
5737
5310
|
if (isNowValid) {
|
|
5738
5311
|
onChange(now);
|
|
5739
5312
|
}
|
|
5740
|
-
}, [
|
|
5741
|
-
// Extract min/max date from
|
|
5742
|
-
const minDate =
|
|
5743
|
-
const maxDate =
|
|
5744
|
-
|
|
5313
|
+
}, [normalizedMinDateTime, normalizedMaxDateTime, onChange]);
|
|
5314
|
+
// Extract min/max date from normalized datetime for DatePicker
|
|
5315
|
+
const minDate = normalizedMinDateTime;
|
|
5316
|
+
const maxDate = normalizedMaxDateTime;
|
|
5317
|
+
// ========================================
|
|
5318
|
+
// RENDER
|
|
5319
|
+
// ========================================
|
|
5320
|
+
return (jsx("div", { className: `cw-datetimepicker cw-datetimepicker-separate ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-flex-row cw-align-left-center cw-gap-small", children: [jsx(CwDatePicker, { value: selectedDate, onChange: handleDateChange, minDate: minDate, maxDate: maxDate, disabledDates: disabledDates, disabledMatcher: disabledMatcher, placeholder: datePlaceholder, disabled: disabled, required: required, showClear: showClear, numberOfMonths: numberOfMonths, popupPosition: popupPosition }), jsx(CwTimePicker, { value: selectedTime, onChange: handleTimeChange, interval: timeInterval, minTime: timeRestrictions.minTime, maxTime: timeRestrictions.maxTime, placeholder: timePlaceholder, disabled: disabled, required: required, showClear: showClear, popupPosition: popupPosition }), showNowButton && (jsx(CwButton, { type: "button", variant: "outline", onClick: handleNowClick, disabled: disabled, title: "Set to current date and time", text: "Now" }))] })] }) }));
|
|
5745
5321
|
}
|
|
5746
5322
|
|
|
5747
5323
|
var compactStyles = {"compactPopup":"cw-datetime-compact-module_compactPopup__GiuNY","calendarWrapper":"cw-datetime-compact-module_calendarWrapper__P4Nlq","timeWrapper":"cw-datetime-compact-module_timeWrapper__uMe-A","compactTimeList":"cw-datetime-compact-module_compactTimeList__MzSQT"};
|
|
@@ -7046,8 +6622,8 @@ class CwScheduler2 extends Component {
|
|
|
7046
6622
|
this.handleResize();
|
|
7047
6623
|
}
|
|
7048
6624
|
if (dateChange) {
|
|
7049
|
-
const events =
|
|
7050
|
-
const resources =
|
|
6625
|
+
const events = cloneDeep(this.props.events);
|
|
6626
|
+
const resources = cloneDeep(this.props.resources);
|
|
7051
6627
|
this.initOutside(events, resources, _nextProps, _nextProps.startDate, _nextProps.endDate);
|
|
7052
6628
|
if (this.state.showConsoleLogs) {
|
|
7053
6629
|
console.log("Schedule - componentWillReceiveProps - print on schedule, end: ", moment(new Date()).toString());
|
|
@@ -7170,6 +6746,12 @@ const PinButton = ({ canBePinned, resource, onCrewPinning }) => {
|
|
|
7170
6746
|
return jsx("button", { className: "cw-button-icon cw-icon-pin", ...buttonProps });
|
|
7171
6747
|
};
|
|
7172
6748
|
|
|
6749
|
+
const addMinutesToDateFromPx = (originalDate, leftPx, minutesPerPx) => {
|
|
6750
|
+
const minutes = leftPx / minutesPerPx;
|
|
6751
|
+
const datePlusMinutes = new Date(originalDate.getTime() + minutes * 60000);
|
|
6752
|
+
return datePlusMinutes;
|
|
6753
|
+
};
|
|
6754
|
+
|
|
7173
6755
|
const doubleClickOnResource = (props, resource) => {
|
|
7174
6756
|
if (props.scheduler_handleDblClickOnResourceInScheduler) {
|
|
7175
6757
|
props.scheduler_handleDblClickOnResourceInScheduler(resource);
|
|
@@ -7336,12 +6918,6 @@ const EventRender = ({ event, schedulerProps }) => {
|
|
|
7336
6918
|
return render;
|
|
7337
6919
|
};
|
|
7338
6920
|
|
|
7339
|
-
const addMinutesToDateFromPx = (originalDate, leftPx, minutesPerPx) => {
|
|
7340
|
-
const minutes = leftPx / minutesPerPx;
|
|
7341
|
-
const datePlusMinutes = new Date(originalDate.getTime() + minutes * 60000);
|
|
7342
|
-
return datePlusMinutes;
|
|
7343
|
-
};
|
|
7344
|
-
|
|
7345
6921
|
const onDropEventToResource = (props, cblDragNDrop, resource) => {
|
|
7346
6922
|
props.scheduler_handleOnDropCblEventsOnResource.call(props.parent, cblDragNDrop, resource);
|
|
7347
6923
|
};
|
|
@@ -7441,12 +7017,25 @@ const ResourceRender = memo(({ res, schedulerProps, contentArea, state }) => {
|
|
|
7441
7017
|
}, className: "cwellt_divRow_schContent", children: res.events.map((evnt) => (jsx(EventRender, { event: evnt, schedulerProps: schedulerProps }, evnt.id))) }, res.id));
|
|
7442
7018
|
}, arePropsEqual);
|
|
7443
7019
|
|
|
7444
|
-
const ResourceListRender = ({ resources, schedulerProps, state, contentArea,
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7020
|
+
const ResourceListRender = ({ resources, schedulerProps, state, contentArea,
|
|
7021
|
+
// onClickContextMenu,
|
|
7022
|
+
crewAssignmentSchedulerContextMenu, }) => {
|
|
7023
|
+
return (jsx(Fragment$1, { children: resources.map((r, _i) => (jsx(CwAnchoredMenu, { placement: "bottom", onContextMenu: (e) => {
|
|
7024
|
+
// Dirty temporal solution to remove ANT design, this can be killed when this scheduler is deprecated
|
|
7025
|
+
const leftPos = e.currentTarget.getBoundingClientRect().left -
|
|
7026
|
+
(contentArea?.getBoundingClientRect()?.left ?? 0) -
|
|
7027
|
+
window.scrollX;
|
|
7028
|
+
const calculatedDatetime = addMinutesToDateFromPx(schedulerProps.startDate, leftPos, state.minutePx);
|
|
7029
|
+
r.__contextMenuDatetime = calculatedDatetime;
|
|
7030
|
+
}, options: crewAssignmentSchedulerContextMenu?.map(m => ({
|
|
7031
|
+
key: m.key,
|
|
7032
|
+
label: (jsxs(Fragment, { children: [jsx("span", { className: m.icon, style: { color: m.color } }), jsx("span", { children: m.text })] }))
|
|
7033
|
+
})) ?? [], onSelect: (key) => {
|
|
7034
|
+
const datetime = r.__contextMenuDatetime ?? new Date();
|
|
7035
|
+
if (schedulerProps.scheduler_handleOnClickContextMenuResource) {
|
|
7036
|
+
schedulerProps.scheduler_handleOnClickContextMenuResource(datetime, r, key, schedulerProps.id);
|
|
7037
|
+
}
|
|
7038
|
+
}, children: jsx("span", { onDoubleClick: () => doubleClickOnResource(schedulerProps, r), id: schedulerProps.id + "_" + r.id, children: jsx(ResourceRender, { res: r, schedulerProps: schedulerProps, contentArea: contentArea, state: state, isInViewport: r.isInViewport }, r.id) }) }, r.id))) }));
|
|
7450
7039
|
};
|
|
7451
7040
|
|
|
7452
7041
|
const TimeLine$1 = ({ id, toolTipTitle, marginLeft, color = "rgba(255,0,0,.6)", pixels = 2, height = "100%", zIndex = 1, }) => {
|
|
@@ -8201,6 +7790,13 @@ function getPercentageFromMouseEvent(event) {
|
|
|
8201
7790
|
const clickPercentage = x / totalWidth;
|
|
8202
7791
|
return clickPercentage;
|
|
8203
7792
|
}
|
|
7793
|
+
function getPercentageFromElement(clientX, element) {
|
|
7794
|
+
const rect = element.getBoundingClientRect();
|
|
7795
|
+
const x = clientX - rect.left;
|
|
7796
|
+
const totalWidth = rect.width;
|
|
7797
|
+
const clickPercentage = x / totalWidth;
|
|
7798
|
+
return clickPercentage;
|
|
7799
|
+
}
|
|
8204
7800
|
|
|
8205
7801
|
class OnClickEvent {
|
|
8206
7802
|
id;
|
|
@@ -8437,15 +8033,13 @@ const BackgroundEvent = ({ value, heightRem }) => {
|
|
|
8437
8033
|
|
|
8438
8034
|
var styles$1 = {"scheduler-row-header":"scheduler-row-module_scheduler-row-header__S-iv4"};
|
|
8439
8035
|
|
|
8440
|
-
var styles = {"super-scheduler-row-header":"super-scheduler-module_super-scheduler-row-header__TTs4e","indicators":"super-scheduler-module_indicators__f4lIT","scheduler-crewmember-functions":"super-scheduler-module_scheduler-crewmember-functions__BS2hs"};
|
|
8441
|
-
|
|
8442
8036
|
const DefaultRowHeader = ({ value, width, onEvent }) => {
|
|
8443
8037
|
return (jsxs("div", { style: {
|
|
8444
8038
|
width: width,
|
|
8445
8039
|
// background: color,
|
|
8446
8040
|
}, onClick: (_) => {
|
|
8447
8041
|
onEvent(new OnClickRowHeader(value.rowId));
|
|
8448
|
-
}, className: styles$1["scheduler-row-header"], children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 && jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }));
|
|
8042
|
+
}, className: styles$1["scheduler-row-header"], children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 && jsxs("span", { className: styles$1["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }));
|
|
8449
8043
|
};
|
|
8450
8044
|
|
|
8451
8045
|
function useSingleAndDoubleClicks(onClick, onDoubleClick) {
|
|
@@ -8490,7 +8084,7 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
|
8490
8084
|
const [isOnDrag, setIsOnDrag] = useState(false);
|
|
8491
8085
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
8492
8086
|
// Calculate colors of the event
|
|
8493
|
-
const backColor = getHSLColor(value.color, value.alpha ??
|
|
8087
|
+
const backColor = getHSLColor(value.color, value.alpha ?? 1);
|
|
8494
8088
|
const textColor = getContrastColor(value.color);
|
|
8495
8089
|
const eventTransparent = value.alpha ? value.alpha < 0.7 : false;
|
|
8496
8090
|
const canClick = value.isDraggable || value.isClickable === true;
|
|
@@ -8518,18 +8112,12 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
|
8518
8112
|
e.preventDefault();
|
|
8519
8113
|
onEvent(new OnDoubleClickEvent(value.id));
|
|
8520
8114
|
});
|
|
8521
|
-
return (jsx(
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
e.domEvent.preventDefault();
|
|
8528
|
-
e.domEvent.stopPropagation();
|
|
8529
|
-
onEvent(new OnClickContextMenu(value.id, e.key));
|
|
8530
|
-
},
|
|
8531
|
-
onMouseLeave: () => setIsContextMenuOpen(false),
|
|
8532
|
-
}, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: jsx("div", { style: {
|
|
8115
|
+
return (jsx(CwAnchoredMenu, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, onContextMenu: (e) => {
|
|
8116
|
+
e.stopPropagation();
|
|
8117
|
+
// onEvent(new OnRightClickEvent(value.id));
|
|
8118
|
+
}, placement: "bottom", options: value.contextMenuItems ?? [], onSelect: (key) => {
|
|
8119
|
+
onEvent(new OnClickContextMenu(value.id, key));
|
|
8120
|
+
}, children: jsx("div", { style: {
|
|
8533
8121
|
top: "2px",
|
|
8534
8122
|
left: `${value.left}%`,
|
|
8535
8123
|
width: `${value.width}%`,
|
|
@@ -8549,10 +8137,6 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
|
8549
8137
|
}, onDragEnd: (_) => {
|
|
8550
8138
|
if (value.isDraggable)
|
|
8551
8139
|
setIsOnDrag(false);
|
|
8552
|
-
}, onContextMenu: (e) => {
|
|
8553
|
-
e.stopPropagation();
|
|
8554
|
-
e.preventDefault();
|
|
8555
|
-
onEvent(new OnRightClickEvent(value.id));
|
|
8556
8140
|
}, children: jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", hide: isOnDrag, dissapearsWhenHover: true, showDelay: 200, children: jsxs("div", { style: {
|
|
8557
8141
|
border: value.selected ? "2px solid black" : "none",
|
|
8558
8142
|
backgroundColor: backColor,
|
|
@@ -8595,7 +8179,7 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
|
8595
8179
|
backgroundColor: value.primaryTimeMarkerColor,
|
|
8596
8180
|
} })), value.secondaryTimeMarkerColor && (jsx("div", { className: styles$2["time-marker"], style: {
|
|
8597
8181
|
backgroundColor: value.secondaryTimeMarkerColor,
|
|
8598
|
-
} }))] }) }) }, value.id) }
|
|
8182
|
+
} }))] }) }) }, value.id) }));
|
|
8599
8183
|
};
|
|
8600
8184
|
|
|
8601
8185
|
const eventsCollide = (event1, event2) => {
|
|
@@ -8639,18 +8223,11 @@ const WeekEndLine = ({ left, top = "0px", height, widthPercentage }) => {
|
|
|
8639
8223
|
return (jsx(TimeLine, { color: "rgba(0,0,0,0.05)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
|
|
8640
8224
|
};
|
|
8641
8225
|
|
|
8642
|
-
const onClickMenuItem$1 = (e, event) => {
|
|
8643
|
-
e.domEvent.nativeEvent.preventDefault();
|
|
8644
|
-
e.domEvent.nativeEvent.stopPropagation();
|
|
8645
|
-
e.domEvent.nativeEvent.stopImmediatePropagation();
|
|
8646
|
-
e.domEvent.preventDefault();
|
|
8647
|
-
e.domEvent.stopPropagation();
|
|
8648
|
-
event();
|
|
8649
|
-
};
|
|
8650
8226
|
const SchedulerRow = memo((props) => {
|
|
8651
8227
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
8652
8228
|
const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
|
|
8653
8229
|
const internalRows = separateEventsToInnerRows(events);
|
|
8230
|
+
const schedulerDivRef = useRef(null);
|
|
8654
8231
|
const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
|
|
8655
8232
|
e.stopPropagation();
|
|
8656
8233
|
e.preventDefault();
|
|
@@ -8663,15 +8240,17 @@ const SchedulerRow = memo((props) => {
|
|
|
8663
8240
|
return (jsxs("div", { style: {
|
|
8664
8241
|
display: "flex",
|
|
8665
8242
|
minHeight: props.rowHeightInRem + "rem",
|
|
8666
|
-
}, children: [jsx(RowTitleComp, { ...rowHeader }), jsx(
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8243
|
+
}, "data-name": "scheduler-row", children: [jsx(RowTitleComp, { ...rowHeader }), jsx(CwAnchoredMenu, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottom", options: contextMenuItems ?? [], onSelect: (key) => {
|
|
8244
|
+
onEvent(new OnClickContextMenu(rowHeader.value.rowId, key));
|
|
8245
|
+
}, onContextMenu: (e) => {
|
|
8246
|
+
// e.preventDefault();
|
|
8247
|
+
e.stopPropagation();
|
|
8248
|
+
if (!schedulerDivRef.current)
|
|
8249
|
+
return;
|
|
8250
|
+
const percentage = getPercentageFromElement(e.clientX, schedulerDivRef.current);
|
|
8251
|
+
const date = dateFromPercentage(selectedDate, visibleDays, percentage);
|
|
8252
|
+
onEvent(new OnRightClickRow(rowHeader.value.rowId, date));
|
|
8253
|
+
}, children: jsxs("div", { ref: schedulerDivRef, style: {
|
|
8675
8254
|
flex: 1,
|
|
8676
8255
|
display: "flex",
|
|
8677
8256
|
flexDirection: "column",
|
|
@@ -8680,8 +8259,6 @@ const SchedulerRow = memo((props) => {
|
|
|
8680
8259
|
e.preventDefault();
|
|
8681
8260
|
const percentage = getPercentageFromMouseEvent(e);
|
|
8682
8261
|
const date = dateFromPercentage(selectedDate, visibleDays, percentage);
|
|
8683
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
|
|
8684
|
-
// change for navigator.userAgentData.platform when acepted in all browsers
|
|
8685
8262
|
const isMac = navigator.platform.toUpperCase().includes("MAC");
|
|
8686
8263
|
const isCtrlOrAltPressed = isMac ? e.altKey : e.ctrlKey;
|
|
8687
8264
|
if (isCtrlOrAltPressed) {
|
|
@@ -8692,13 +8269,7 @@ const SchedulerRow = memo((props) => {
|
|
|
8692
8269
|
}
|
|
8693
8270
|
}, onDragOver: (e) => {
|
|
8694
8271
|
e.preventDefault();
|
|
8695
|
-
}, onClick: handleClick, onDoubleClick: handleDoubleClick,
|
|
8696
|
-
e.preventDefault();
|
|
8697
|
-
e.stopPropagation();
|
|
8698
|
-
const percentage = getPercentageFromMouseEvent(e);
|
|
8699
|
-
const date = dateFromPercentage(selectedDate, visibleDays, percentage);
|
|
8700
|
-
onEvent(new OnRightClickRow(rowHeader.value.rowId, date));
|
|
8701
|
-
}, children: [weekendLines.map((weekend) => (jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }, weekend.left))), divisionLines.map((division) => (jsx(DivisionLine, { height: "100%", left: division.left }, division.left))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (jsx("div", { style: {
|
|
8272
|
+
}, onClick: handleClick, onDoubleClick: handleDoubleClick, children: [weekendLines.map((weekend) => (jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }, weekend.left))), divisionLines.map((division) => (jsx(DivisionLine, { height: "100%", left: division.left }, division.left))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (jsx("div", { style: {
|
|
8702
8273
|
height: "100%",
|
|
8703
8274
|
position: internalRows.length > 0 ? "absolute" : "relative",
|
|
8704
8275
|
width: "100%",
|
|
@@ -8711,7 +8282,7 @@ const SchedulerRow = memo((props) => {
|
|
|
8711
8282
|
height: props.rowHeightInRem + "rem",
|
|
8712
8283
|
pointerEvents: "none"
|
|
8713
8284
|
}, children: internalRow.map((event) => (jsx(EventComp, { value: event, heightRem: props.rowHeightInRem, onEvent: onEvent }, event.id))) }, index));
|
|
8714
|
-
}), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) }
|
|
8285
|
+
}), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) })] }));
|
|
8715
8286
|
}, (prevProps, nextProps) => {
|
|
8716
8287
|
// This memo is necessary to prevent re-render all the rows when a user makes drag and drop
|
|
8717
8288
|
const getEventKey = (event) => {
|
|
@@ -8971,6 +8542,8 @@ const getNow = (isUtc) => {
|
|
|
8971
8542
|
return now;
|
|
8972
8543
|
};
|
|
8973
8544
|
const rowsHeight = 1.75; // rem
|
|
8545
|
+
const milliSecondsInSecond = 1000;
|
|
8546
|
+
const refreshMilliSeconds = 45 * milliSecondsInSecond;
|
|
8974
8547
|
const Scheduler = (props) => {
|
|
8975
8548
|
const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, } = props;
|
|
8976
8549
|
const BackgroundEventComp = props.BackgroundEventComp ?? BackgroundEvent;
|
|
@@ -9014,7 +8587,7 @@ const Scheduler = (props) => {
|
|
|
9014
8587
|
setTimeLinePercentage(percentage);
|
|
9015
8588
|
};
|
|
9016
8589
|
updateTimeLinePercentage();
|
|
9017
|
-
const interval = setInterval(updateTimeLinePercentage,
|
|
8590
|
+
const interval = setInterval(updateTimeLinePercentage, refreshMilliSeconds);
|
|
9018
8591
|
return () => clearInterval(interval);
|
|
9019
8592
|
}, [selectedDate, isUtc, totalHours]);
|
|
9020
8593
|
// Memoized Row Component
|
|
@@ -9382,6 +8955,8 @@ class Resource {
|
|
|
9382
8955
|
}
|
|
9383
8956
|
}
|
|
9384
8957
|
|
|
8958
|
+
var styles = {"super-scheduler-row-header":"super-scheduler-module_super-scheduler-row-header__TTs4e","indicators":"super-scheduler-module_indicators__f4lIT","scheduler-crewmember-functions":"super-scheduler-module_scheduler-crewmember-functions__BS2hs"};
|
|
8959
|
+
|
|
9385
8960
|
class OnPinRow {
|
|
9386
8961
|
id;
|
|
9387
8962
|
constructor(id) {
|
|
@@ -9398,37 +8973,23 @@ class OnClearPinned {
|
|
|
9398
8973
|
constructor() { }
|
|
9399
8974
|
}
|
|
9400
8975
|
|
|
9401
|
-
const onClickMenuItem = (e, event) => {
|
|
9402
|
-
e.domEvent.nativeEvent.preventDefault();
|
|
9403
|
-
e.domEvent.nativeEvent.stopPropagation();
|
|
9404
|
-
e.domEvent.nativeEvent.stopImmediatePropagation();
|
|
9405
|
-
e.domEvent.preventDefault();
|
|
9406
|
-
e.domEvent.stopPropagation();
|
|
9407
|
-
event();
|
|
9408
|
-
};
|
|
9409
8976
|
const PinRowHeader = ({ value, width, onEvent }) => {
|
|
9410
8977
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
9411
8978
|
const { highlightColor, isLoading } = value;
|
|
9412
|
-
return (jsx(
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
})
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
display: "flex",
|
|
9427
|
-
flexDirection: "column",
|
|
9428
|
-
justifyContent: "center",
|
|
9429
|
-
alignItems: "flex-start",
|
|
9430
|
-
}, children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 &&
|
|
9431
|
-
jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }) }, value.rowId));
|
|
8979
|
+
return (jsx(CwAnchoredMenu, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "right", options: value.contextMenuItems ?? [], onSelect: (key) => {
|
|
8980
|
+
onEvent(new OnClickContextMenu(value.rowId, key));
|
|
8981
|
+
}, children: jsx(CwGenericTooltip, { content: value.tooltip, position: "right", dissapearsWhenHover: true, overlayStyle: value.overlayTooltipStyle, children: jsxs("div", { style: {
|
|
8982
|
+
width: width,
|
|
8983
|
+
background: highlightColor,
|
|
8984
|
+
}, className: styles["super-scheduler-row-header"], children: [jsx("button", { className: "cw-button-icon cwi-pin", "data-pinned": value.isPinned, onClick: (_) => {
|
|
8985
|
+
onEvent(value.isPinned ? new OnUnpinRow(value.rowId) : new OnPinRow(value.rowId));
|
|
8986
|
+
} }), jsx("div", { className: styles["indicators"], children: value.indicators ?? undefined }), jsxs("div", { style: {
|
|
8987
|
+
display: "flex",
|
|
8988
|
+
flexDirection: "column",
|
|
8989
|
+
justifyContent: "center",
|
|
8990
|
+
alignItems: "flex-start",
|
|
8991
|
+
}, children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 &&
|
|
8992
|
+
jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }, value.rowId));
|
|
9432
8993
|
};
|
|
9433
8994
|
|
|
9434
8995
|
const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, contextMenuItems, onEvent }) => {
|
|
@@ -9440,7 +9001,7 @@ const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory,
|
|
|
9440
9001
|
}, children: "Clear pinned" }) })] })), jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader })] }));
|
|
9441
9002
|
};
|
|
9442
9003
|
|
|
9443
|
-
const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder = "Search airport…", required = false, cblConfig, className = "", value, disabled = false, displayMode, width }) => {
|
|
9004
|
+
const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder = "Search airport…", required = false, cblConfig, className = "", value, disabled = false, displayMode, labelProps, alignProps, width }) => {
|
|
9444
9005
|
// State
|
|
9445
9006
|
const [inputValue, setInputValue] = useState("");
|
|
9446
9007
|
const [options, setOptions] = useState([]);
|
|
@@ -9673,7 +9234,12 @@ const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder
|
|
|
9673
9234
|
handleChange(0); // or -1, depending on API expectations
|
|
9674
9235
|
inputRef.current?.focus();
|
|
9675
9236
|
};
|
|
9676
|
-
|
|
9237
|
+
// Get direction for data attribute
|
|
9238
|
+
const direction = alignProps?.flexDirection || "row";
|
|
9239
|
+
return (jsxs("div", { className: `cw-search-input ${className}`, style: {
|
|
9240
|
+
...(width ? { width } : {}),
|
|
9241
|
+
...(labelProps?.labelWidth ? { '--label-width': labelProps.labelWidth } : {})
|
|
9242
|
+
}, "data-direction": direction, children: [jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-search-input-wrapper", children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, onKeyDown: handleKeyDown, onFocus: handleInputFocus, placeholder: isInitialLoading ? "Loading…" : placeHolder, disabled: disabled, required: required, autoComplete: "off", "aria-expanded": showDropdown, "aria-haspopup": "listbox", role: "combobox", title: tooltipText }), (isLoading || isInitialLoading) && (jsx("div", { className: "cw-search-input-loading", children: jsx(CwIcon, { iconId: "spinner" }) })), jsx("div", { className: "cw-search-input-icons", children: inputValue && !disabled && !isInitialLoading ? (jsx(CwButton, { type: "button", onClick: handleClear, "aria-label": "Clear selected airport", variant: "icon", icon: "close", color: "neutral" })) : (jsx(CwIcon, { iconId: "control-tower" })) })] })] }), showDropdown && options.length > 0 && (jsx("div", { ref: dropdownRef, className: "cw-input-search-dropdown", role: "listbox", children: jsx("ul", { children: options.map((option, index) => (jsx("li", { className: index === highlightedIndex ? "highlighted" : "", onClick: () => handleOptionSelect(option.value), onMouseDown: (e) => e.preventDefault(), role: "option", "aria-selected": index === highlightedIndex, children: option.text }, option.value))) }) }))] }));
|
|
9677
9243
|
};
|
|
9678
9244
|
|
|
9679
|
-
export { CblDragAndDrop, CwAccordionContainer, CwAlign,
|
|
9245
|
+
export { CblDragAndDrop, CwAccordionContainer, CwAlign, CwAnchoredMenu, CwBtnDelete, CwBtnEdit, CwBtnSave, CwButton, CwCard, CwCardList, CwCheckbox, CwChip, CwColorPicker, CwConfirmationPopup, CwContextMenu, CwDatePicker, CwDateRangePicker, CwDateTimePicker, CwDateTimePickerCompact, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdownFilter, CwExpandable, CwFileUpload, CwFileUploadMultiple, CwFindAirport, CwGenericTooltip, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwImageGallery, CwImageZoom, CwInput, CwInputColor, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwKeyValueList, CwLabel, CwLoading, CwLoadingSmall, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalHover, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwNote, CwOption, CwReportModal, CwScheduler, CwScheduler2, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSortableList, CwSuperScheduler, CwTable, CwTableGrouped, CwTabs, CwTextArea, CwTime, CwTimePicker, CwToggle, CwTooltip, CwTreeView, CwWeekdaySelector, DefaultRowHeader, OnClearPinned, OnClickContextMenu, OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDoubleClickRowEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnEndClickHeaderEvent, OnLeftDragStart, OnMultiClickEvent, OnPinRow, OnRangeClickEvent, OnRightClickEvent, OnRightClickRow, OnRightDragStart, OnStartClickHeaderEvent, OnUnpinRow, PinRowHeader, Resource, Scheduler, SchedulerEvent, SuperScheduler, UiEvent, Weekdays, cblEvent, eventIsVisible, getDefaultDivisions, getEventSizes, itemsToMultiFilterTags, useCwMessage, useSortableList };
|