@cwellt_software/cwellt-reactjs-lib 1.2.14 → 1.2.16
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/deprecated/components/MultiSelect_deprecated_.d.ts +24 -0
- package/dist/deprecated/components/MultiSelect_deprecated_.d.ts.map +1 -0
- package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts +17 -0
- package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts +17 -0
- package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwMultiselect.d.ts +13 -0
- package/dist/deprecated/components/multiselect/CwMultiselect.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwOptionList.d.ts +14 -0
- package/dist/deprecated/components/multiselect/CwOptionList.d.ts.map +1 -0
- package/dist/deprecated/components/tag/CwTag.d.ts +15 -0
- package/dist/deprecated/components/tag/CwTag.d.ts.map +1 -0
- package/dist/index.cjs.js +116 -65
- package/dist/index.css +1 -1
- package/dist/index.d.ts +35 -2
- package/dist/index.es.js +116 -66
- package/dist/src/components/control/action/button/CwPopoverButton.d.ts +33 -0
- package/dist/src/components/control/action/button/CwPopoverButton.d.ts.map +1 -0
- package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts +19 -0
- package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts.map +1 -0
- package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts +21 -0
- package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts +35 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts +47 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +1 -12
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +1 -11
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- 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/new-dates/example.d.ts +0 -2
- package/dist/src/components/control/input/new-dates/example.d.ts.map +0 -1
- 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/table/grouped/CwTableGrouped.js +0 -70
- package/dist/src/components/layout/tabs/CwTabs.js +0 -53
- 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
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useMemo, useState } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* A reusable and customizable table component.
|
|
5
|
-
*
|
|
6
|
-
* @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const columns: Column<User>[] = [
|
|
10
|
-
* {
|
|
11
|
-
* title: 'Name',
|
|
12
|
-
* dataIndex: 'name',
|
|
13
|
-
* key: 'name',
|
|
14
|
-
* sortable: true, // Column is sortable
|
|
15
|
-
* width: 100 // You can define the width of the column
|
|
16
|
-
* },
|
|
17
|
-
* {
|
|
18
|
-
* title: 'Age',
|
|
19
|
-
* dataIndex: 'age',
|
|
20
|
-
* key: 'age',
|
|
21
|
-
* sortable: true,
|
|
22
|
-
* render: (item) => <span>{item.age} years</span> // Custom rendering
|
|
23
|
-
* },
|
|
24
|
-
* {
|
|
25
|
-
* title: 'Address',
|
|
26
|
-
* dataIndex: 'address',
|
|
27
|
-
* key: 'address',
|
|
28
|
-
* render: (item) => (
|
|
29
|
-
* <a href={`https://maps.google.com/?q=${encodeURIComponent(item.address)}`} target="_blank" rel="noreferrer">
|
|
30
|
-
* {item.address}
|
|
31
|
-
* </a>
|
|
32
|
-
* ) // Link rendering
|
|
33
|
-
* }
|
|
34
|
-
* ];
|
|
35
|
-
*
|
|
36
|
-
* const data:User[] = [
|
|
37
|
-
* { key: '1', name: 'Mike', age: 32, address: '10 Downing Street' },
|
|
38
|
-
* { key: '2', name: 'John', age: 42, address: '11 Downing Street' },
|
|
39
|
-
* { key: '3', name: 'Andres', age: 33, address: '12 Downing Street' },
|
|
40
|
-
* { key: '4', name: 'Gabriel', age: 22, address: '13 Downing Street' },
|
|
41
|
-
* { key: '5', name: 'Sergio', age: 47, address: '14 Downing Street' },
|
|
42
|
-
* { key: '6', name: 'Zacarias', age: 61, address: '15 Downing Street' }
|
|
43
|
-
* ];
|
|
44
|
-
*
|
|
45
|
-
* const generateExpandedContent = (record) => (
|
|
46
|
-
* <div>
|
|
47
|
-
* Custom expanded content for {record.name}
|
|
48
|
-
* </div>
|
|
49
|
-
* );
|
|
50
|
-
*
|
|
51
|
-
* <CwTable<User>
|
|
52
|
-
* columns={columns}
|
|
53
|
-
* data={data}
|
|
54
|
-
* pagination={true}
|
|
55
|
-
* pageSizeOptions={[3, 5, 10]} // Optional, defaults to [5, 10, 20, 50]
|
|
56
|
-
* expandedRowRender={generateExpandedContent}
|
|
57
|
-
* onExpand={(item) => console.log('Expanded:', item)}
|
|
58
|
-
* rowKey="key" // Optional, defaults to 'key'
|
|
59
|
-
* textNoData="No data available" // Optional message when no data
|
|
60
|
-
* loading={false} // Optional, shows loading indicator
|
|
61
|
-
* scrollHeight={300} // Optional scroll height, defaults to 300
|
|
62
|
-
* stickyHeader={true} // Optional, makes header sticky on scroll
|
|
63
|
-
* classNameContainer="my-table-wrapper" // Optional wrapper class
|
|
64
|
-
* className="my-table" // Optional table class
|
|
65
|
-
* classNameRow="my-table-row" // Optional class for each row
|
|
66
|
-
* id="custom-table-id" // Optional ID for the container
|
|
67
|
-
* style={{ border: '1px solid #ccc' }} // Optional inline styles
|
|
68
|
-
* />
|
|
69
|
-
*
|
|
70
|
-
* @returns React component
|
|
71
|
-
*/
|
|
72
|
-
export 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, }) {
|
|
73
|
-
const [currentPage, setCurrentPage] = useState(1);
|
|
74
|
-
const [expandedRowKey, setExpandedRowKey] = useState(null);
|
|
75
|
-
const [sortConfig, setSortConfig] = useState({
|
|
76
|
-
key: null,
|
|
77
|
-
direction: "asc"
|
|
78
|
-
});
|
|
79
|
-
const [localItemsPerPage, setLocalItemsPerPage] = useState(pageSizeOptions[0]);
|
|
80
|
-
const [columnWidths, setColumnWidths] = useState(() => columns.reduce((acc, col) => {
|
|
81
|
-
if (col.width)
|
|
82
|
-
acc[col.key] = col.width;
|
|
83
|
-
return acc;
|
|
84
|
-
}, {}));
|
|
85
|
-
const handleItemsPerPageChange = useCallback((e) => {
|
|
86
|
-
setLocalItemsPerPage(parseInt(e.target.value, 10));
|
|
87
|
-
setCurrentPage(1);
|
|
88
|
-
}, []);
|
|
89
|
-
const handleRowExpand = useCallback((item) => {
|
|
90
|
-
const itemKey = item[rowKey];
|
|
91
|
-
setExpandedRowKey((prev) => (prev === itemKey ? null : itemKey));
|
|
92
|
-
onExpand?.(item);
|
|
93
|
-
}, [rowKey, onExpand]);
|
|
94
|
-
const handleSort = useCallback((columnKey) => {
|
|
95
|
-
setSortConfig(prev => {
|
|
96
|
-
if (prev.key !== columnKey)
|
|
97
|
-
return { key: columnKey, direction: "asc" };
|
|
98
|
-
if (prev.direction === "asc")
|
|
99
|
-
return { key: columnKey, direction: "desc" };
|
|
100
|
-
return { key: null, direction: "asc" };
|
|
101
|
-
});
|
|
102
|
-
}, []);
|
|
103
|
-
const sortedData = useMemo(() => {
|
|
104
|
-
if (!data || data.length === 0)
|
|
105
|
-
return [];
|
|
106
|
-
const dataCopy = [...data];
|
|
107
|
-
if (sortConfig.key) {
|
|
108
|
-
dataCopy.sort((a, b) => {
|
|
109
|
-
const aVal = a[sortConfig.key];
|
|
110
|
-
const bVal = b[sortConfig.key];
|
|
111
|
-
return (aVal < bVal ? -1 : aVal > bVal ? 1 : 0) * (sortConfig.direction === "asc" ? 1 : -1);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
return dataCopy;
|
|
115
|
-
}, [data, sortConfig]);
|
|
116
|
-
const paginatedData = useMemo(() => {
|
|
117
|
-
if (!sortedData)
|
|
118
|
-
return [];
|
|
119
|
-
if (!pagination)
|
|
120
|
-
return sortedData;
|
|
121
|
-
const start = (currentPage - 1) * localItemsPerPage;
|
|
122
|
-
return sortedData.slice(start, start + localItemsPerPage);
|
|
123
|
-
}, [sortedData, currentPage, localItemsPerPage, pagination]);
|
|
124
|
-
const totalPages = useMemo(() => {
|
|
125
|
-
return pagination ? Math.ceil(sortedData.length / localItemsPerPage) : 1;
|
|
126
|
-
}, [sortedData, localItemsPerPage, pagination]);
|
|
127
|
-
const handlePageChange = (page) => {
|
|
128
|
-
if (page >= 1 && page <= totalPages)
|
|
129
|
-
setCurrentPage(page);
|
|
130
|
-
};
|
|
131
|
-
const startResize = (e, key) => {
|
|
132
|
-
e.preventDefault();
|
|
133
|
-
const startX = e.clientX;
|
|
134
|
-
const startWidth = e.target.parentElement?.offsetWidth || 0;
|
|
135
|
-
const onMouseMove = (moveEvent) => {
|
|
136
|
-
const newWidth = Math.max(startWidth + moveEvent.clientX - startX, 50); // mínimo 50px
|
|
137
|
-
setColumnWidths(prev => ({ ...prev, [key]: newWidth }));
|
|
138
|
-
};
|
|
139
|
-
const onMouseUp = () => {
|
|
140
|
-
window.removeEventListener("mousemove", onMouseMove);
|
|
141
|
-
window.removeEventListener("mouseup", onMouseUp);
|
|
142
|
-
};
|
|
143
|
-
window.addEventListener("mousemove", onMouseMove);
|
|
144
|
-
window.addEventListener("mouseup", onMouseUp);
|
|
145
|
-
};
|
|
146
|
-
const scrollContainerStyle = useMemo(() => {
|
|
147
|
-
if (stickyHeader || scrollHeight) {
|
|
148
|
-
return {
|
|
149
|
-
maxHeight: scrollHeight ?? 300,
|
|
150
|
-
overflowY: "auto"
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {}; // sin altura ni scroll
|
|
154
|
-
}, [stickyHeader, scrollHeight]);
|
|
155
|
-
const getColSpan = () => columns.length + (expandedRowRender ? 1 : 0);
|
|
156
|
-
const hasClassNameRow = (item) => {
|
|
157
|
-
return typeof item === 'object' && item !== null && 'classNameRow' in item;
|
|
158
|
-
};
|
|
159
|
-
const renderTableBody = () => {
|
|
160
|
-
if (loading) {
|
|
161
|
-
return (_jsx("tr", { children: _jsx("td", { colSpan: getColSpan(), children: _jsx("div", { children: "Loading data..." }) }) }));
|
|
162
|
-
}
|
|
163
|
-
if (!paginatedData || paginatedData.length === 0) {
|
|
164
|
-
return (_jsx("tr", { children: _jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
|
|
165
|
-
}
|
|
166
|
-
return paginatedData.map(item => {
|
|
167
|
-
const itemKey = item[rowKey];
|
|
168
|
-
if (!itemKey)
|
|
169
|
-
console.warn("Missing row key for item", item);
|
|
170
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("tr", { className: `${classNameRow ?? ""} ${hasClassNameRow(item) ? item.classNameRow : ""}`, 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
|
|
171
|
-
? "cwi-chevron-down"
|
|
172
|
-
: "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)));
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
return (_jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [_jsx("div", { style: scrollContainerStyle, children: _jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [_jsx("thead", { style: stickyHeader
|
|
176
|
-
? { position: "sticky", top: 0, background: "white", zIndex: 2 }
|
|
177
|
-
: undefined, children: _jsxs("tr", { children: [expandedRowRender && _jsx("th", {}), columns.map(col => (_jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
|
|
178
|
-
? sortConfig.direction
|
|
179
|
-
: ""}`.trim(), style: {
|
|
180
|
-
cursor: col.sortable ? "pointer" : "default",
|
|
181
|
-
userSelect: "none",
|
|
182
|
-
width: columnWidths[col.key] ?? col.width,
|
|
183
|
-
...((col.width || columnWidths[col.key]) && {
|
|
184
|
-
minWidth: 50,
|
|
185
|
-
maxWidth: columnWidths[col.key] ?? col.width
|
|
186
|
-
}),
|
|
187
|
-
}, children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [_jsx("span", { children: col.title }), col.sortable && col.dataIndex && (_jsx("span", { style: { fontSize: "12px", marginLeft: "6px" }, children: sortConfig.key !== col.dataIndex ? "↕" : sortConfig.direction === "asc"
|
|
188
|
-
? "↑"
|
|
189
|
-
: "↓" }))] }), _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: "number", value: currentPage, onChange: (e) => {
|
|
190
|
-
const value = parseInt(e.target.value, 10);
|
|
191
|
-
if (!isNaN(value))
|
|
192
|
-
handlePageChange(value);
|
|
193
|
-
}, onBlur: (e) => {
|
|
194
|
-
const value = parseInt(e.target.value, 10);
|
|
195
|
-
if (isNaN(value) || value < 1 || value > totalPages) {
|
|
196
|
-
handlePageChange(1);
|
|
197
|
-
}
|
|
198
|
-
}, min: 1, max: totalPages, style: {
|
|
199
|
-
width: "4rem",
|
|
200
|
-
textAlign: "center",
|
|
201
|
-
marginRight: "0.5rem"
|
|
202
|
-
} }), "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, style: { marginLeft: "1rem" }, children: pageSizeOptions.map(size => (_jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
|
|
203
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Icon component that supports both FontAwesome 4 and cwellt icon font
|
|
4
|
-
* @example
|
|
5
|
-
* <CwIcon iconId="house" /> // Uses cwellt icon font
|
|
6
|
-
* <CwIcon iconId="house" source="fontawesome" /> // Uses FontAwesome
|
|
7
|
-
*/
|
|
8
|
-
export function CwIcon(props) {
|
|
9
|
-
const { iconId, source = 'cwellt', color, size, ...iconProps } = props;
|
|
10
|
-
const getClassName = (baseClass) => {
|
|
11
|
-
return [
|
|
12
|
-
baseClass,
|
|
13
|
-
color && `cw-color-${color}`,
|
|
14
|
-
size && `cw-font-size-${size}`
|
|
15
|
-
].filter(Boolean).join(' ');
|
|
16
|
-
};
|
|
17
|
-
// Return appropriate icon based on source
|
|
18
|
-
if (source === 'fontawesome') {
|
|
19
|
-
return _jsx("span", { ...iconProps, className: getClassName(`fa fa-${iconId}`) });
|
|
20
|
-
}
|
|
21
|
-
// Use custom icon font
|
|
22
|
-
return _jsx("span", { ...iconProps, className: getClassName(`cwi-icons cwi-${iconId}`) });
|
|
23
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './cw-loading.css';
|
|
3
|
-
/**
|
|
4
|
-
* CwLoading
|
|
5
|
-
*
|
|
6
|
-
* A versatile loading component that shows a spinner with optional text
|
|
7
|
-
* and disables the wrapped content while in loading state.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* // Basic usage
|
|
11
|
-
* <CwLoading isLoading={isSubmitting}>
|
|
12
|
-
* <form>...</form>
|
|
13
|
-
* </CwLoading>
|
|
14
|
-
*
|
|
15
|
-
* // With custom text and size
|
|
16
|
-
* <CwLoading
|
|
17
|
-
* isLoading={isLoading}
|
|
18
|
-
* text="Please wait..."
|
|
19
|
-
* size="large"
|
|
20
|
-
* >
|
|
21
|
-
* <UserProfile />
|
|
22
|
-
* </CwLoading>
|
|
23
|
-
*/
|
|
24
|
-
export function CwLoading({ isLoading = false, text = '', size = 'regular', iconPosition = 'outside', iconName = 'cwi-plane-solid', animation = 'spin', children }) {
|
|
25
|
-
const iconClasses = `cwi-icons ${iconName || ''}`;
|
|
26
|
-
return (_jsxs("div", { "aria-busy": isLoading, className: isLoading ? 'cw-loading-container' : '', "data-children": !!children, children: [isLoading && (_jsxs("div", { className: "cw-loading-content", "data-size": size, "data-animation": animation, children: [_jsx("div", { className: "cw-loading", "data-icon-position": iconPosition, children: _jsx("span", { className: iconClasses }) }), text && (_jsx("p", { children: text }))] })), _jsx("div", { className: isLoading ? 'cw-loading-disabled-content' : '', children: children })] }));
|
|
27
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated since may 2025. Use <CwLoading size="small"> instead.
|
|
4
|
-
*
|
|
5
|
-
* This component will be removed in a future release.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* // Instead of:
|
|
9
|
-
* <CwLoadingSmall />
|
|
10
|
-
*
|
|
11
|
-
* // Use:
|
|
12
|
-
* <CwLoading size="small" />
|
|
13
|
-
*/
|
|
14
|
-
export function CwLoadingSmall(CwelltLoadingAppointements) {
|
|
15
|
-
return (_jsx("div", { children: CwelltLoadingAppointements.isLoading === true ? (
|
|
16
|
-
// * Show loading appointment
|
|
17
|
-
_jsx("div", { className: "cw-loading-container", children: _jsx("div", { className: "cw-loading" }) })) : (
|
|
18
|
-
// Show empty div
|
|
19
|
-
_jsx("div", {})) }));
|
|
20
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function CwHeadingMain(props) {
|
|
3
|
-
const { children, ...headingProps } = props;
|
|
4
|
-
return (_jsx("div", { className: "cw-heading", children: _jsx("h2", { className: "cwHeading_desc", ...headingProps, children: children }) }));
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export function CwHeadingSecond(props) {
|
|
3
|
-
const { children, ...headingProps } = props;
|
|
4
|
-
return (_jsx("div", { className: "cw-heading", children: _jsx("h3", { className: "cwHeading_desc", ...headingProps, children: children }) }));
|
|
5
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CwAlign } from "../../../../components/layout/align/CwAlign";
|
|
3
|
-
/**
|
|
4
|
-
* Label for form controls.
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* <CwLabelForm justify="right" >Username:</CwLabelForm>
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
export function CwLabel(props) {
|
|
11
|
-
const { justify, text, labelHeight, labelWidth, alignProps, margin, ...labelProps } = props;
|
|
12
|
-
return (_jsx("span", { className: "cw-label", children: _jsx(CwAlign, { ...alignProps, children: _jsx("label", { style: { textAlign: justify, width: labelWidth, height: labelHeight, margin: margin ?? "1px 0 0 0" }, ...labelProps, children: labelProps.children ?? text }) }) }));
|
|
13
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { createRoot } from "react-dom/client"; // Import createRoot
|
|
4
|
-
import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
|
|
5
|
-
import { CwAlign } from "../../../../components/layout/align/CwAlign";
|
|
6
|
-
export const CW_DEFAULT_MESSAGE_DURATION = 2000;
|
|
7
|
-
export var CwMessageType;
|
|
8
|
-
(function (CwMessageType) {
|
|
9
|
-
CwMessageType["ERROR"] = "close-circle";
|
|
10
|
-
CwMessageType["WARN"] = "warning";
|
|
11
|
-
CwMessageType["INFO"] = "info-bubble";
|
|
12
|
-
CwMessageType["SUCCESS"] = "check-circle";
|
|
13
|
-
})(CwMessageType || (CwMessageType = {}));
|
|
14
|
-
export const CwMessage = props => {
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const timer = setTimeout(() => {
|
|
17
|
-
props.onClose?.();
|
|
18
|
-
}, props.duration ?? CW_DEFAULT_MESSAGE_DURATION);
|
|
19
|
-
return () => clearTimeout(timer);
|
|
20
|
-
}, [props]);
|
|
21
|
-
return (_jsx("div", { className: "cw-message", "data-message-type": Object.keys(CwMessageType).find(key => CwMessageType[key] === props.messageType), children: _jsxs(CwAlign, { justifyContent: "center", alignItems: "center", children: [props.messageType && _jsx(CwIcon, { iconId: props.messageType.toString() }), props.message] }) }));
|
|
22
|
-
};
|
|
23
|
-
export const useCwMessage = () => {
|
|
24
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
25
|
-
const [message, setMessage] = useState("");
|
|
26
|
-
const [duration, setDuration] = useState();
|
|
27
|
-
const [type, setType] = useState();
|
|
28
|
-
const showMessage = (props) => {
|
|
29
|
-
setMessage(props.message);
|
|
30
|
-
setDuration(props.duration);
|
|
31
|
-
setType(props.messageType);
|
|
32
|
-
setIsVisible(true);
|
|
33
|
-
};
|
|
34
|
-
const closeMessage = () => {
|
|
35
|
-
setIsVisible(false);
|
|
36
|
-
};
|
|
37
|
-
const RenderMessage = isVisible ? (_jsx(CwMessage, { message: message, duration: duration, messageType: type, onClose: closeMessage })) : null;
|
|
38
|
-
return { showMessage, RenderMessage };
|
|
39
|
-
};
|
|
40
|
-
export class CwMessageManager {
|
|
41
|
-
static instance;
|
|
42
|
-
messageContainer = null;
|
|
43
|
-
root;
|
|
44
|
-
constructor() {
|
|
45
|
-
this.init();
|
|
46
|
-
}
|
|
47
|
-
static getInstance() {
|
|
48
|
-
if (!CwMessageManager.instance) {
|
|
49
|
-
CwMessageManager.instance = new CwMessageManager();
|
|
50
|
-
}
|
|
51
|
-
return CwMessageManager.instance;
|
|
52
|
-
}
|
|
53
|
-
init() {
|
|
54
|
-
this.messageContainer = document.createElement("div");
|
|
55
|
-
this.messageContainer.style.setProperty("position", "fixed");
|
|
56
|
-
this.messageContainer.style.setProperty("pointer-events", "none");
|
|
57
|
-
this.messageContainer.style.setProperty("width", "100%");
|
|
58
|
-
this.messageContainer.style.setProperty("top", "0");
|
|
59
|
-
this.messageContainer.style.setProperty("z-index", "999999");
|
|
60
|
-
document.body.prepend(this.messageContainer);
|
|
61
|
-
this.root = createRoot(this.messageContainer); // Create a root at the messageContainer
|
|
62
|
-
}
|
|
63
|
-
showMessage(message, type, duration) {
|
|
64
|
-
const msg = document.createElement("div");
|
|
65
|
-
this.messageContainer?.prepend(msg);
|
|
66
|
-
const msgRoot = createRoot(msg); // Create a root for the new message
|
|
67
|
-
msgRoot.render(_jsx(CwMessage, { message: message, messageType: type, duration: duration, onClose: () => this.closeMessage(msgRoot) }));
|
|
68
|
-
}
|
|
69
|
-
closeMessage(msgRoot) {
|
|
70
|
-
msgRoot.unmount(); // Unmount the message root
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export function CwDisplayMessage(message, type, duration) {
|
|
74
|
-
CwMessageManager.getInstance().showMessage(message, type, duration);
|
|
75
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { getContrastColor } from '../../../../common/functions/colorManipulation';
|
|
4
|
-
import { CwIcon } from '../../graphics/icon/CwIcon';
|
|
5
|
-
import './cw-note.css';
|
|
6
|
-
/**
|
|
7
|
-
* CwNote - Inline note component for instructions and contextual content
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* <CwNote content="Use the search box to filter results" color="neutral" icon="search" />
|
|
11
|
-
* <CwNote
|
|
12
|
-
* content="Failed to load data"
|
|
13
|
-
* variant="solid"
|
|
14
|
-
* color="danger"
|
|
15
|
-
* icon="warning"
|
|
16
|
-
* onDismiss={() => console.log('dismissed')}
|
|
17
|
-
* />
|
|
18
|
-
* <CwNote variant="outline" color="success" icon="check">
|
|
19
|
-
* <p>Step 1: Configure your project settings</p>
|
|
20
|
-
* <p>Step 2: Validate configuration before proceeding</p>
|
|
21
|
-
* </CwNote>
|
|
22
|
-
* <CwNote className="custom-class" icon="lightbulb">
|
|
23
|
-
* <strong>Important information here</strong>
|
|
24
|
-
* </CwNote>
|
|
25
|
-
*/
|
|
26
|
-
export const CwNote = ({ content, variant = 'soft', color = 'primary', customColor, fontSize = 'regular', icon, dismissible = false, autoCloseSeconds, className = '', style = {}, children, }) => {
|
|
27
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
28
|
-
// Auto-close functionality
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (autoCloseSeconds && autoCloseSeconds > 0) {
|
|
31
|
-
const timer = setTimeout(() => {
|
|
32
|
-
setIsVisible(false);
|
|
33
|
-
}, autoCloseSeconds * 1000);
|
|
34
|
-
return () => clearTimeout(timer);
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}, [autoCloseSeconds]);
|
|
38
|
-
// Handle manual dismiss
|
|
39
|
-
const handleDismiss = (e) => {
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
setIsVisible(false);
|
|
42
|
-
};
|
|
43
|
-
// Calculate styles for custom color
|
|
44
|
-
const messageStyle = React.useMemo(() => {
|
|
45
|
-
if (customColor) {
|
|
46
|
-
if (variant === 'outline') {
|
|
47
|
-
// For outline, customColor is used for border and text
|
|
48
|
-
return {
|
|
49
|
-
color: customColor,
|
|
50
|
-
borderColor: customColor,
|
|
51
|
-
...style
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// For soft/solid, customColor is used for background and we calculate contrast
|
|
56
|
-
return {
|
|
57
|
-
backgroundColor: customColor,
|
|
58
|
-
color: getContrastColor(customColor),
|
|
59
|
-
...style
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return style;
|
|
64
|
-
}, [customColor, variant, style]);
|
|
65
|
-
// Build CSS classes
|
|
66
|
-
let noteClass = `cw-note cw-note-${fontSize}`;
|
|
67
|
-
if (dismissible) {
|
|
68
|
-
noteClass += ' cw-note-dismissible';
|
|
69
|
-
}
|
|
70
|
-
if (className) {
|
|
71
|
-
noteClass += ` ${className}`;
|
|
72
|
-
}
|
|
73
|
-
// Don't render if not visible
|
|
74
|
-
if (!isVisible) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
return (_jsxs("div", { className: noteClass, "data-color": customColor ? undefined : color, "data-variant": variant, style: messageStyle, children: [icon && _jsx(CwIcon, { iconId: icon }), _jsx("div", { className: "cw-note-content", children: children ?? content }), dismissible && (_jsx("button", { className: "cw-note-dismiss-button", onClick: handleDismiss, "aria-label": "Dismiss note", type: "button", children: _jsx(CwIcon, { iconId: "close" }) }))] }));
|
|
78
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { getContrastColor } from '../../../../common/functions/colorManipulation';
|
|
4
|
-
import { CwIcon } from '../../graphics/icon/CwIcon';
|
|
5
|
-
import './cw-chip.css';
|
|
6
|
-
/**
|
|
7
|
-
* CwChip - A simple chip/tag component for displaying labels or categories
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* <CwChip label="Active" colorScheme="success" />
|
|
11
|
-
* <CwChip label="High Priority" colorScheme="danger" variant="solid" />
|
|
12
|
-
* <CwChip label="Custom" colorScheme="custom" customColor="#8a2be2" />
|
|
13
|
-
* <CwChip label="Outlined" colorScheme="info" variant="outline" />
|
|
14
|
-
* <CwChip label="Removable" closable onClose={() => console.log('closed')} />
|
|
15
|
-
**/
|
|
16
|
-
export const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', className = '', closable = false, onClose, icon, style = {}, }) => {
|
|
17
|
-
// Basic validation
|
|
18
|
-
if (closable && !onClose) {
|
|
19
|
-
console.warn('CwChip: onClose prop is required when closable is true');
|
|
20
|
-
}
|
|
21
|
-
// Calculate styles based on colorScheme, customColor and variant
|
|
22
|
-
const chipStyle = React.useMemo(() => {
|
|
23
|
-
if (customColor) {
|
|
24
|
-
if (variant === 'outline') {
|
|
25
|
-
// For outline, customColor is used for border and text
|
|
26
|
-
return {
|
|
27
|
-
color: customColor,
|
|
28
|
-
borderColor: customColor,
|
|
29
|
-
...style
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
// For soft/solid, customColor is used for background and we calculate contrast
|
|
34
|
-
return {
|
|
35
|
-
backgroundColor: customColor,
|
|
36
|
-
color: getContrastColor(customColor),
|
|
37
|
-
...style
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return style;
|
|
42
|
-
}, [colorScheme, customColor, variant, style]);
|
|
43
|
-
// Handle click on close icon
|
|
44
|
-
const handleClose = (e) => {
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
if (onClose) {
|
|
47
|
-
onClose();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
// CSS classes
|
|
51
|
-
const chipClassNames = [
|
|
52
|
-
'cw-chip',
|
|
53
|
-
className,
|
|
54
|
-
closable ? 'cw-chip-closable' : '',
|
|
55
|
-
].filter(Boolean).join(' ');
|
|
56
|
-
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" }) }))] }));
|
|
57
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CwIcon } from "../../graphics/icon/CwIcon";
|
|
3
|
-
export function CwTag(tagProps) {
|
|
4
|
-
const hideTag = (event_clickTag) => {
|
|
5
|
-
const tag = event_clickTag.currentTarget.parentElement;
|
|
6
|
-
tag?.classList.add("tag-hidden");
|
|
7
|
-
};
|
|
8
|
-
const onClickClosableCustomTag = (event_clickClosableT) => {
|
|
9
|
-
hideTag(event_clickClosableT);
|
|
10
|
-
if (tagProps.onClickClosableTag != undefined) {
|
|
11
|
-
tagProps.onClickClosableTag(event_clickClosableT);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const onClickCustomTag = (event_clickTag) => {
|
|
15
|
-
// click option interface
|
|
16
|
-
if (tagProps.onClickTag !== undefined) {
|
|
17
|
-
tagProps.onClickTag(event_clickTag);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
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) }))] }));
|
|
21
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function CwTooltip(CwelltTooltipProps) {
|
|
3
|
-
return (_jsxs("div", { className: "cwelltTooltip", children: [_jsx("div", { className: "cwelltTooltipTitle", style: CwelltTooltipProps.tooltipTitleStyle, children: _jsx("span", { children: CwelltTooltipProps.tooltipTitle }) }), CwelltTooltipProps.children] }));
|
|
4
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* General purpose aligner flex container, useful for column or row view.
|
|
4
|
-
* @remarks
|
|
5
|
-
* ```txt
|
|
6
|
-
* flexDirection="row" (default):
|
|
7
|
-
*
|
|
8
|
-
* <Row A> | - item 1 - item 2 - item 3 |
|
|
9
|
-
* <Row B> | - item 1 - item 2 - item 3 |
|
|
10
|
-
*
|
|
11
|
-
* flexDirection="column":
|
|
12
|
-
*
|
|
13
|
-
* <Col A> <Col B>
|
|
14
|
-
* | - item 1 | - item 1 |
|
|
15
|
-
* | - item 2 | - item 2 |
|
|
16
|
-
* | - item 3 | - item 3 |
|
|
17
|
-
*
|
|
18
|
-
* ```
|
|
19
|
-
* @example
|
|
20
|
-
* <CwAlign flexDirection="column">
|
|
21
|
-
* <div>
|
|
22
|
-
* <h2>ColumnA</h2>
|
|
23
|
-
* </div>
|
|
24
|
-
* <div>
|
|
25
|
-
* <h2>ColumnB</h2>
|
|
26
|
-
* </div>
|
|
27
|
-
* </CwAlign>
|
|
28
|
-
*/
|
|
29
|
-
export function CwAlign(props) {
|
|
30
|
-
const { alignContent, alignItems, alignSelf, bottom, display, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, cssHeight, justifyContent, left, margin, order, padding, position, right, top, cssWidth, gap, ...divProps } = props;
|
|
31
|
-
return (_jsx("div", { className: "cw-align", ...divProps, style: {
|
|
32
|
-
alignContent: alignContent,
|
|
33
|
-
alignItems: alignItems,
|
|
34
|
-
alignSelf: alignSelf,
|
|
35
|
-
bottom: bottom,
|
|
36
|
-
display: display ?? "flex",
|
|
37
|
-
flexBasis: flexBasis,
|
|
38
|
-
flexDirection: flexDirection,
|
|
39
|
-
flexGrow: flexGrow,
|
|
40
|
-
flexShrink: flexShrink,
|
|
41
|
-
flexWrap: flexWrap,
|
|
42
|
-
height: cssHeight,
|
|
43
|
-
justifyContent: justifyContent,
|
|
44
|
-
left: left,
|
|
45
|
-
margin: margin,
|
|
46
|
-
order: order,
|
|
47
|
-
padding: padding,
|
|
48
|
-
position: position,
|
|
49
|
-
right: right,
|
|
50
|
-
top: top,
|
|
51
|
-
width: cssWidth,
|
|
52
|
-
gap: gap
|
|
53
|
-
}, children: props.children }));
|
|
54
|
-
}
|