@cwellt_software/cwellt-reactjs-lib 1.5.0 → 1.5.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/content/fonts/roboto-mono/LICENSE +93 -0
- package/dist/content/fonts/roboto-mono/RobotoMono.css +43 -0
- package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-wght-italic.woff2 +0 -0
- package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-wght-normal.woff2 +0 -0
- 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 +182 -33
- package/dist/index.css +1 -1
- package/dist/index.d.ts +99 -9
- package/dist/index.es.js +181 -34
- package/dist/playground/main.d.ts +4 -0
- package/dist/playground/main.d.ts.map +1 -0
- 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/action/contextual-menu/CwContextualMenu.d.ts +29 -0
- package/dist/src/components/control/action/contextual-menu/CwContextualMenu.d.ts.map +1 -0
- package/dist/src/components/control/action/search/CwAsyncSearch.d.ts +102 -0
- package/dist/src/components/control/action/search/CwAsyncSearch.d.ts.map +1 -0
- package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts +19 -0
- package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.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/deprecated/MultiSelect_deprecated_.d.ts +24 -0
- package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts +19 -0
- package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownContainer.d.ts +17 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownNavigation.d.ts +21 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +1 -0
- package/dist/src/components/control/choice/multiselect/CwHeadFilter.d.ts +17 -0
- package/dist/src/components/control/choice/multiselect/CwHeadFilter.d.ts.map +1 -0
- package/dist/src/components/control/choice/multiselect/CwMultiselect.d.ts +13 -0
- package/dist/src/components/control/choice/multiselect/CwMultiselect.d.ts.map +1 -0
- package/dist/src/components/control/choice/multiselect/CwOptionList.d.ts +14 -0
- package/dist/src/components/control/choice/multiselect/CwOptionList.d.ts.map +1 -0
- package/dist/src/components/control/choice/nav-menu/CwNavMenu.d.ts.map +1 -1
- 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/CwSchedulerComp2.d.ts +24 -0
- package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts +86 -0
- package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/EventRender.d.ts +10 -0
- package/dist/src/components/custom/scheduler-temporal/components/EventRender.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.d.ts +20 -0
- package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.d.ts +14 -0
- package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts +11 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts +11 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts +13 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts +11 -0
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts +14 -0
- package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts +23 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts +8 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts +12 -0
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts +12 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts +10 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts +12 -0
- package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts +7 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts +10 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +7 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts +8 -0
- package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +4 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts +13 -0
- package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +7 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts +4 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.d.ts +6 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.d.ts +5 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts +5 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts +4 -0
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts +6 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.d.ts +4 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts +2 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.d.ts +4 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.d.ts +3 -0
- package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts +11 -0
- package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts +43 -0
- package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/Resource.d.ts +14 -0
- package/dist/src/components/custom/scheduler-temporal/state/Resource.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/State.d.ts +25 -0
- package/dist/src/components/custom/scheduler-temporal/state/State.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/cblEvent.d.ts +18 -0
- package/dist/src/components/custom/scheduler-temporal/state/cblEvent.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts +7 -0
- package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.d.ts +6 -0
- package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.d.ts.map +1 -0
- package/dist/src/components/display/data/table/CwTable.d.ts +4 -1
- package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.d.ts +4 -1
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.d.ts.map +1 -1
- package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts +4 -2
- package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts.map +1 -1
- package/dist/src/components/display/graphics/progress/CwProgress.d.ts +36 -0
- package/dist/src/components/display/graphics/progress/CwProgress.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.d.ts +31 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeletonCard.d.ts +21 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeletonCard.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/normalizeSkeletonCount.d.ts +8 -0
- package/dist/src/components/display/graphics/skeleton/normalizeSkeletonCount.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/skeletonCellWidth.d.ts +8 -0
- package/dist/src/components/display/graphics/skeleton/skeletonCellWidth.d.ts.map +1 -0
- package/dist/src/components/display/text/tag/CwTag.d.ts +15 -0
- package/dist/src/components/display/text/tag/CwTag.d.ts.map +1 -0
- package/dist/src/components/display/text/tooltip/CwTooltip.d.ts +11 -0
- package/dist/src/components/display/text/tooltip/CwTooltip.d.ts.map +1 -0
- package/dist/src/components/layout/card/CwCard.d.ts +3 -1
- package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
- package/dist/src/components/layout/card/CwCardList.d.ts +4 -2
- package/dist/src/components/layout/card/CwCardList.d.ts.map +1 -1
- package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts +4 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts.map +1 -1
- package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts +4 -0
- package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts.map +1 -1
- package/dist/src/components/layout/modal/legacy/cw_modal_confirm.d.ts +16 -0
- package/dist/src/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +1 -0
- package/dist/src/components/layout/modal/legacy/cw_modal_iframe.d.ts +21 -0
- package/dist/src/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +1 -0
- package/dist/src/components/layout/tabs/CwTabs.d.ts +7 -0
- package/dist/src/components/layout/tabs/CwTabs.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/playground/PlaygroundApp.d.ts.map +1 -1
- package/dist/src/playground/pages/ProgressPage.d.ts +3 -0
- package/dist/src/playground/pages/ProgressPage.d.ts.map +1 -0
- package/dist/src/playground/pages/SkeletonPage.d.ts +3 -0
- package/dist/src/playground/pages/SkeletonPage.d.ts.map +1 -0
- package/dist/test/components/control/choice/nav-menu/CwNavMenu.test.d.ts +2 -0
- package/dist/test/components/control/choice/nav-menu/CwNavMenu.test.d.ts.map +1 -0
- package/dist/test/components/display/data/table/CwTable.test.d.ts +2 -0
- package/dist/test/components/display/data/table/CwTable.test.d.ts.map +1 -0
- package/dist/test/components/display/data/table-serverside/CwTableServerSide.test.d.ts +2 -0
- package/dist/test/components/display/data/table-serverside/CwTableServerSide.test.d.ts.map +1 -0
- package/dist/test/components/display/data/table_sortable/CwSortableTable.test.d.ts +2 -0
- package/dist/test/components/display/data/table_sortable/CwSortableTable.test.d.ts.map +1 -0
- package/dist/test/components/display/graphics/progress/CwProgress.test.d.ts +2 -0
- package/dist/test/components/display/graphics/progress/CwProgress.test.d.ts.map +1 -0
- package/dist/test/components/display/graphics/skeleton/CwSkeleton.test.d.ts +2 -0
- package/dist/test/components/display/graphics/skeleton/CwSkeleton.test.d.ts.map +1 -0
- package/dist/test/components/display/graphics/skeleton/CwSkeletonCard.test.d.ts +2 -0
- package/dist/test/components/display/graphics/skeleton/CwSkeletonCard.test.d.ts.map +1 -0
- package/dist/test/components/display/graphics/skeleton/normalizeSkeletonCount.test.d.ts +2 -0
- package/dist/test/components/display/graphics/skeleton/normalizeSkeletonCount.test.d.ts.map +1 -0
- package/dist/test/components/display/graphics/skeleton/skeletonCellWidth.test.d.ts +2 -0
- package/dist/test/components/display/graphics/skeleton/skeletonCellWidth.test.d.ts.map +1 -0
- package/dist/test/components/layout/card/CwCard.test.d.ts +2 -0
- package/dist/test/components/layout/card/CwCard.test.d.ts.map +1 -0
- package/dist/test/components/layout/card/CwCardList.test.d.ts +2 -0
- package/dist/test/components/layout/card/CwCardList.test.d.ts.map +1 -0
- package/dist/test/components/layout/list/key-value/CwKeyValueList.test.d.ts +2 -0
- package/dist/test/components/layout/list/key-value/CwKeyValueList.test.d.ts.map +1 -0
- package/dist/test/components/layout/master-detail/CwMasterDetail.test.d.ts +2 -0
- package/dist/test/components/layout/master-detail/CwMasterDetail.test.d.ts.map +1 -0
- package/dist/test/jest.setup.d.ts +2 -0
- package/dist/test/jest.setup.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -181,7 +181,7 @@ function getContrastColor(color) {
|
|
|
181
181
|
return `hsl(${hsl.h}, ${contrastS}%, ${targetL}%)`;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
var styles$
|
|
184
|
+
var styles$x = {"cw-tooltip-content":"cw-tooltip-module__cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module__cw-tooltip__1KYig"};
|
|
185
185
|
|
|
186
186
|
// Constants
|
|
187
187
|
const margin$1 = 16;
|
|
@@ -471,7 +471,7 @@ const CwTooltipManager = () => {
|
|
|
471
471
|
if (!state.isVisible || !state.content) {
|
|
472
472
|
return null;
|
|
473
473
|
}
|
|
474
|
-
return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$
|
|
474
|
+
return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$x["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, "data-inline": state.displayInline, style: {
|
|
475
475
|
top: `${tooltipPosition.top}px`,
|
|
476
476
|
left: `${tooltipPosition.left}px`,
|
|
477
477
|
opacity: (isPositioned && !isMeasuring) ? 1 : 0,
|
|
@@ -552,7 +552,7 @@ const CwTooltipNew = ({ children, content = null, position = "right", dissapears
|
|
|
552
552
|
React.useEffect(() => {
|
|
553
553
|
ensureTooltipManager();
|
|
554
554
|
}, []);
|
|
555
|
-
return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$
|
|
555
|
+
return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$x["cw-tooltip"], children: children }));
|
|
556
556
|
};
|
|
557
557
|
|
|
558
558
|
const SVG_ICONS = {
|
|
@@ -1011,6 +1011,95 @@ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPositio
|
|
|
1011
1011
|
return (jsxRuntime.jsxs("div", { "aria-busy": isLoading, className: "cw-loading-container", "data-children": !!children, children: [overlay, jsxRuntime.jsx("div", { className: "cw-loading-disabled-content", children: children })] }));
|
|
1012
1012
|
}
|
|
1013
1013
|
|
|
1014
|
+
var styles$w = {"skeleton":"cw-skeleton-module__skeleton__Jvx2x","group":"cw-skeleton-module__group__Cm8AU"};
|
|
1015
|
+
|
|
1016
|
+
/*
|
|
1017
|
+
* Internal helper for skeleton allocations (CwSkeleton, tables, cards).
|
|
1018
|
+
* Not exported from the library barrel - not a public API.
|
|
1019
|
+
*/
|
|
1020
|
+
/** Upper bound so a pathological count cannot allocate an unbounded number of nodes. */
|
|
1021
|
+
const MAX_SKELETON_COUNT = 100;
|
|
1022
|
+
/**
|
|
1023
|
+
* Normalizes a skeleton count to a finite, floored, non-negative integer capped at
|
|
1024
|
+
* MAX_SKELETON_COUNT. Falls back to `fallback` for undefined, NaN, non-finite or
|
|
1025
|
+
* non-positive input, so valid inputs keep the public default behaviour and only
|
|
1026
|
+
* pathological ones are bounded.
|
|
1027
|
+
*/
|
|
1028
|
+
function normalizeSkeletonCount(value, fallback) {
|
|
1029
|
+
if (value === undefined || !Number.isFinite(value) || value < 1) {
|
|
1030
|
+
return fallback;
|
|
1031
|
+
}
|
|
1032
|
+
return Math.min(Math.floor(value), MAX_SKELETON_COUNT);
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* CwSkeleton - a shimmering placeholder that reserves the shape of content while it loads.
|
|
1037
|
+
*
|
|
1038
|
+
* Renders inline <span> elements so it can sit inside text-level contexts. Sizing flows
|
|
1039
|
+
* through component-scoped custom properties; only the props the caller provides are set
|
|
1040
|
+
* inline, so the CSS defaults per variant (and the 60% last-line rule) stay in charge.
|
|
1041
|
+
*
|
|
1042
|
+
* @example
|
|
1043
|
+
* <CwSkeleton count={3} />
|
|
1044
|
+
* <CwSkeleton variant="circle" />
|
|
1045
|
+
* <CwSkeleton variant="rect" height="10rem" />
|
|
1046
|
+
*/
|
|
1047
|
+
function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap }) {
|
|
1048
|
+
// Only forward the custom properties the caller actually set; CSS declares the defaults.
|
|
1049
|
+
const style = {
|
|
1050
|
+
...(width !== undefined && { '--skeleton-width': width }),
|
|
1051
|
+
...(height !== undefined && { '--skeleton-height': height }),
|
|
1052
|
+
...(radius !== undefined && { '--skeleton-radius': radius })
|
|
1053
|
+
};
|
|
1054
|
+
// The un-hashed cw-skeleton / cw-skeleton-group classes carry no styles in the
|
|
1055
|
+
// library - they are stable public hooks for exceptional external overrides.
|
|
1056
|
+
const skeletonClassName = ['cw-skeleton', styles$w.skeleton].filter(Boolean).join(' ');
|
|
1057
|
+
const groupClassName = ['cw-skeleton-group', styles$w.group].filter(Boolean).join(' ');
|
|
1058
|
+
const lineCount = normalizeSkeletonCount(count, 1);
|
|
1059
|
+
if (lineCount <= 1) {
|
|
1060
|
+
return (jsxRuntime.jsx("span", { className: skeletonClassName, "data-variant": variant, "aria-hidden": "true", style: style }));
|
|
1061
|
+
}
|
|
1062
|
+
const skeletonElements = Array.from({ length: lineCount }, (_, index) => (jsxRuntime.jsx("span", { className: skeletonClassName, "data-variant": variant, style: style }, index)));
|
|
1063
|
+
const groupStyle = {
|
|
1064
|
+
...(gap !== undefined && { '--skeleton-gap': gap })
|
|
1065
|
+
};
|
|
1066
|
+
return (jsxRuntime.jsx("span", { className: groupClassName, "aria-hidden": "true", style: groupStyle, children: skeletonElements }));
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
var styles$v = {"progress":"cw-progress-module__progress__d-g2-","value":"cw-progress-module__value__Q-DrH","header":"cw-progress-module__header__mv5ct","label":"cw-progress-module__label__jwOWp","track":"cw-progress-module__track__572-3","fill":"cw-progress-module__fill__fX1UA"};
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* CwProgress - a determinate or indeterminate progress bar.
|
|
1073
|
+
*
|
|
1074
|
+
* Use it for measurable operations (imports, uploads, batch jobs). For short
|
|
1075
|
+
* unmeasurable waits use CwLoading; for initial layout loads use CwSkeleton.
|
|
1076
|
+
*
|
|
1077
|
+
* @example
|
|
1078
|
+
* <CwProgress value={62} label="Import" color="success" />
|
|
1079
|
+
* <CwProgress indeterminate label="Uploading" />
|
|
1080
|
+
*/
|
|
1081
|
+
function CwProgress({ value, indeterminate = false, label, rightLabel, size = 'regular', layout = 'row', color = 'primary', monoValue = false, prominent = false }) {
|
|
1082
|
+
const labelId = React.useId();
|
|
1083
|
+
// Determinate: a missing or non-finite value is treated as 0 (never NaN), then
|
|
1084
|
+
// clamped to [0,100] for aria-valuenow and the fill width. Indeterminate has no value.
|
|
1085
|
+
const clamped = indeterminate
|
|
1086
|
+
? undefined
|
|
1087
|
+
: Math.min(Math.max(Number.isFinite(value) ? value : 0, 0), 100);
|
|
1088
|
+
const percent = clamped !== undefined ? Math.round(clamped) : undefined;
|
|
1089
|
+
const showValue = rightLabel !== undefined || (!indeterminate && percent !== undefined);
|
|
1090
|
+
const valueText = rightLabel ?? (percent !== undefined ? `${percent}%` : '');
|
|
1091
|
+
// The un-hashed cw-progress class carries no styles in the library - a stable
|
|
1092
|
+
// public hook for exceptional external overrides only.
|
|
1093
|
+
const rootClassName = ['cw-progress', styles$v.progress].filter(Boolean).join(' ');
|
|
1094
|
+
const labelSpan = label ? jsxRuntime.jsx("span", { className: styles$v.label, id: labelId, children: label }) : null;
|
|
1095
|
+
const valueLabel = showValue ? (jsxRuntime.jsx("span", { className: styles$v.value, "data-mono": monoValue || undefined, children: valueText })) : null;
|
|
1096
|
+
return (jsxRuntime.jsxs("div", { className: rootClassName, "data-layout": layout, "data-size": size, "data-color": color, "data-prominent": prominent || undefined, "data-indeterminate": indeterminate || undefined, children: [layout === 'column' && (labelSpan || valueLabel) && (jsxRuntime.jsxs("header", { className: styles$v.header, children: [labelSpan, valueLabel] })), layout === 'row' && labelSpan, jsxRuntime.jsx("div", { className: styles$v.track, role: "progressbar", ...(label && { 'aria-labelledby': labelId }), ...(!indeterminate && percent !== undefined && {
|
|
1097
|
+
'aria-valuenow': percent,
|
|
1098
|
+
'aria-valuemin': 0,
|
|
1099
|
+
'aria-valuemax': 100
|
|
1100
|
+
}), children: jsxRuntime.jsx("div", { className: styles$v.fill, style: !indeterminate && clamped !== undefined ? { width: `${clamped}%` } : undefined }) }), layout === 'row' && valueLabel] }));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1014
1103
|
var styles$u = {"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"};
|
|
1015
1104
|
|
|
1016
1105
|
// Constants moved outside to prevent recreation
|
|
@@ -1749,7 +1838,7 @@ function CwAlign(props) {
|
|
|
1749
1838
|
}, children: props.children }));
|
|
1750
1839
|
}
|
|
1751
1840
|
|
|
1752
|
-
var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module__clickable__Y-V3X","disabled":"cw-card-module__disabled__0wHh1","
|
|
1841
|
+
var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module__clickable__Y-V3X","disabled":"cw-card-module__disabled__0wHh1","content":"cw-card-module__content__ma9qy","headerContent":"cw-card-module__headerContent__x4Jfl","footerTags":"cw-card-module__footerTags__80sSW"};
|
|
1753
1842
|
|
|
1754
1843
|
/**
|
|
1755
1844
|
* CwCard - A simple card component for displaying content in a contained format
|
|
@@ -1769,7 +1858,7 @@ var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module
|
|
|
1769
1858
|
* <p>This is the main content of the card.</p>
|
|
1770
1859
|
* </CwCard>
|
|
1771
1860
|
**/
|
|
1772
|
-
const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, disabled = false, style, chips = [], variant = "border", direction = "column", layout, }) => {
|
|
1861
|
+
const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, skeletonLines = 3, disabled = false, style, chips = [], variant = "border", direction = "column", layout, }) => {
|
|
1773
1862
|
const resolvedDirection = layout?.direction ?? direction;
|
|
1774
1863
|
const resolvedAlign = layout?.align ?? (alignment === 'left' ? 'start' : 'center');
|
|
1775
1864
|
// Construct class names using CSS modules
|
|
@@ -1779,7 +1868,6 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1779
1868
|
className,
|
|
1780
1869
|
clickable ? styles$r.clickable : '',
|
|
1781
1870
|
disabled ? styles$r.disabled : '',
|
|
1782
|
-
isLoading ? styles$r.loading : '',
|
|
1783
1871
|
].filter(Boolean).join(' ');
|
|
1784
1872
|
// Handle click event when card is clickable
|
|
1785
1873
|
const handleClick = () => {
|
|
@@ -1795,16 +1883,17 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1795
1883
|
const hasChips = chips.length > 0;
|
|
1796
1884
|
// Determine if footer should be rendered
|
|
1797
1885
|
const hasFooter = hasChips || footer || (hasActions && resolvedDirection === "row");
|
|
1798
|
-
// Actions component to reuse
|
|
1799
|
-
|
|
1800
|
-
|
|
1886
|
+
// Actions component to reuse. While loading, each provided action renders a circular
|
|
1887
|
+
// ghost sized to the CwButton icon footprint (2rem) - no interactive buttons.
|
|
1888
|
+
const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsx("div", { className: styles$r.actions, children: isLoading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onEdit && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onDelete && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions ?? null, onEdit && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) })) : null;
|
|
1889
|
+
return (jsxRuntime.jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && !isLoading && {
|
|
1801
1890
|
role: 'button',
|
|
1802
1891
|
tabIndex: 0,
|
|
1803
1892
|
onClick: handleClick,
|
|
1804
|
-
}), "data-variant": variant, "data-direction": resolvedDirection, children: [hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] })), jsxRuntime.jsx("div", { className: styles$r.content, children: children }), hasFooter && (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$r.footerTags, children: chips.map((chip, index) => (jsxRuntime.jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$r.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsxRuntime.jsx("div", { className: styles$r.footerContent, children: footer }))] })), resolvedDirection === "row" && ActionsComponent
|
|
1893
|
+
}), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxRuntime.jsxs("header", { children: [jsxRuntime.jsx("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: jsxRuntime.jsx(CwSkeleton, { width: "8rem", height: "1.5em" }) }), resolvedDirection === "column" && ActionsComponent] })) : (hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] }))), jsxRuntime.jsx("div", { className: styles$r.content, children: isLoading ? jsxRuntime.jsx(CwSkeleton, { count: normalizeSkeletonCount(skeletonLines, 3) }) : children }), hasFooter && (isLoading ? (jsxRuntime.jsx("footer", { children: jsxRuntime.jsx("div", { className: styles$r.footerTags, children: jsxRuntime.jsx(CwSkeleton, { variant: "rect", width: "4rem", height: "1.5em", radius: "1rem" }) }) })) : (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$r.footerTags, children: chips.map((chip, index) => (jsxRuntime.jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$r.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsxRuntime.jsx("div", { className: styles$r.footerContent, children: footer }))] }))), resolvedDirection === "row" && ActionsComponent] }));
|
|
1805
1894
|
};
|
|
1806
1895
|
|
|
1807
|
-
var styles$q = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","
|
|
1896
|
+
var styles$q = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","emptyState":"cw-card-list-module__emptyState__RlqiS"};
|
|
1808
1897
|
|
|
1809
1898
|
/**
|
|
1810
1899
|
* Option to display in the CwSelect
|
|
@@ -1862,7 +1951,7 @@ function CwSelect(props) {
|
|
|
1862
1951
|
: selectProps.onChange, children: [placeholder && jsxRuntime.jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
|
|
1863
1952
|
}
|
|
1864
1953
|
|
|
1865
|
-
function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, emptyState, sortOptions = [], defaultSortKey, keyExtractor, ...htmlProps }) {
|
|
1954
|
+
function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, skeletonCards = 6, emptyState, sortOptions = [], defaultSortKey, keyExtractor, ...htmlProps }) {
|
|
1866
1955
|
const [currentPage, setCurrentPage] = React.useState(1);
|
|
1867
1956
|
const [sortKey, setSortKey] = React.useState(defaultSortKey || sortOptions[0]?.key || '');
|
|
1868
1957
|
const [sortDirection, setSortDirection] = React.useState('asc');
|
|
@@ -1899,7 +1988,7 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
|
|
|
1899
1988
|
icon: sortDirection === 'asc' ? 'arrow-up' : 'arrow-down',
|
|
1900
1989
|
onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'),
|
|
1901
1990
|
title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}`,
|
|
1902
|
-
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: styles$q.
|
|
1991
|
+
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: `${styles$q.cardContainer}`, "data-layout": layout, style: gridStyle, "aria-busy": true, children: Array.from({ length: normalizeSkeletonCount(skeletonCards, 6) }, (_, index) => (jsxRuntime.jsx(CwCard, { isLoading: true, children: null }, `skeleton_${index}`))) })) : sortedItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$q.emptyState, children: emptyState || jsxRuntime.jsx("p", { children: "No items to display" }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `${styles$q.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsxRuntime.jsx(React.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxRuntime.jsxs("div", { className: styles$q.pagination, children: [jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxRuntime.jsxs("span", { className: styles$q.pageInfo, children: [currentPage, " / ", totalPages] }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
|
|
1903
1992
|
}
|
|
1904
1993
|
|
|
1905
1994
|
var styles$p = {"cw-accordion":"cw-accordion-module__cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module__cw-accordion-body__xlI8b"};
|
|
@@ -1922,6 +2011,21 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1922
2011
|
return (jsxRuntime.jsxs("div", { className: styles$p["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxRuntime.jsxs("header", { onClick: () => showAccordionBody(), children: [jsxRuntime.jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsxRuntime.jsx("button", { className: "cw-button-icon" })] }), jsxRuntime.jsx("div", { className: styles$p["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
|
|
1923
2012
|
}
|
|
1924
2013
|
|
|
2014
|
+
/*
|
|
2015
|
+
* Internal helper for table loading ghosts (CwTable, CwSortableTable).
|
|
2016
|
+
* Not exported from the library barrel - not a public API.
|
|
2017
|
+
*/
|
|
2018
|
+
const SKELETON_CELL_WIDTHS = ['85%', '60%', '95%', '70%', '80%', '65%'];
|
|
2019
|
+
/**
|
|
2020
|
+
* Deterministic width for a table ghost cell so skeleton rows look like real,
|
|
2021
|
+
* unevenly sized content. Derived purely from indices - stable across re-renders
|
|
2022
|
+
* (no reshuffling) - and offset by the column count so the pattern does not
|
|
2023
|
+
* repeat identically per row or per column.
|
|
2024
|
+
*/
|
|
2025
|
+
function getSkeletonCellWidth(rowIndex, columnIndex, columnCount) {
|
|
2026
|
+
return SKELETON_CELL_WIDTHS[(rowIndex * columnCount + columnIndex) % SKELETON_CELL_WIDTHS.length];
|
|
2027
|
+
}
|
|
2028
|
+
|
|
1925
2029
|
/**
|
|
1926
2030
|
* A reusable and customizable table component.
|
|
1927
2031
|
*
|
|
@@ -1991,7 +2095,7 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
|
|
|
1991
2095
|
*
|
|
1992
2096
|
* @returns React component
|
|
1993
2097
|
*/
|
|
1994
|
-
function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, pageLabel = "page", rowSelection }) {
|
|
2098
|
+
function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, skeletonRows = 5, scrollHeight, stickyHeader = false, pageLabel = "page", rowSelection }) {
|
|
1995
2099
|
const [currentPage, setCurrentPage] = React.useState(1);
|
|
1996
2100
|
const [expandedRowKey, setExpandedRowKey] = React.useState(null);
|
|
1997
2101
|
const [sortConfig, setSortConfig] = React.useState({
|
|
@@ -2129,7 +2233,9 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2129
2233
|
};
|
|
2130
2234
|
const renderTableBody = () => {
|
|
2131
2235
|
if (loading) {
|
|
2132
|
-
|
|
2236
|
+
// Ghost rows: rendered outside the data/selection/expand code paths, so they
|
|
2237
|
+
// cannot trigger row click, selection or expansion.
|
|
2238
|
+
return Array.from({ length: normalizeSkeletonCount(skeletonRows, 5) }, (_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, `skeleton_${rowIndex}`)));
|
|
2133
2239
|
}
|
|
2134
2240
|
if (!paginatedData || paginatedData.length === 0) {
|
|
2135
2241
|
return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
|
|
@@ -2151,7 +2257,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2151
2257
|
: "cwi-chevron-right"}` }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex] ?? "") : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
|
|
2152
2258
|
});
|
|
2153
2259
|
};
|
|
2154
|
-
return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
|
|
2260
|
+
return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
|
|
2155
2261
|
? sortConfig.direction
|
|
2156
2262
|
: ""}`.trim(), style: {
|
|
2157
2263
|
cursor: col.sortable ? "pointer" : "default",
|
|
@@ -2177,7 +2283,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
|
|
|
2177
2283
|
}, min: 1, max: totalPages }), jsxRuntime.jsx("span", { children: "/" }), jsxRuntime.jsx("span", { children: totalPages }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
|
|
2178
2284
|
}
|
|
2179
2285
|
|
|
2180
|
-
var styles$o = {"dropIndicator":"cw-sortable-table-module__dropIndicator__ov-Jz","dragging":"cw-sortable-table-module__dragging__MrLrz","
|
|
2286
|
+
var styles$o = {"dropIndicator":"cw-sortable-table-module__dropIndicator__ov-Jz","dragging":"cw-sortable-table-module__dragging__MrLrz","saveBar":"cw-sortable-table-module__saveBar__3OdoZ cw-flex-row cw-align-center-center cw-gap-small"};
|
|
2181
2287
|
|
|
2182
2288
|
/**
|
|
2183
2289
|
* Hook that provides state management for CwSortableTable.
|
|
@@ -2242,7 +2348,12 @@ function useSortableTable(initialItems) {
|
|
|
2242
2348
|
// ─── Drop indicator row ───────────────────────────────────────────────────────
|
|
2243
2349
|
const DropIndicatorRow = ({ colSpan }) => (jsxRuntime.jsx("tr", { className: styles$o.dropIndicator, "aria-hidden": true, children: jsxRuntime.jsx("td", { colSpan: colSpan, children: jsxRuntime.jsx("div", {}) }) }));
|
|
2244
2350
|
// ─── Loading skeleton ─────────────────────────────────────────────────────────
|
|
2245
|
-
|
|
2351
|
+
// Plain td cells (no local class): the ghost cells get the same global cw-table
|
|
2352
|
+
// padding as real body cells, so row heights match the loaded rows exactly.
|
|
2353
|
+
// One cell per real column, so column classNames/widths apply to the ghost too.
|
|
2354
|
+
function LoadingRows({ columns, showHandle, skeletonRows }) {
|
|
2355
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: skeletonRows }).map((_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", style: col.width ? { width: col.width } : undefined, children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, rowIndex))) }));
|
|
2356
|
+
}
|
|
2246
2357
|
// ─── Component ────────────────────────────────────────────────────────────────
|
|
2247
2358
|
/**
|
|
2248
2359
|
* CwSortableTable
|
|
@@ -2259,7 +2370,7 @@ const LoadingRows = ({ colSpan }) => (jsxRuntime.jsx(jsxRuntime.Fragment, { chil
|
|
|
2259
2370
|
* - Reorder is calculated in onDragEnd using lastValidDropIndex
|
|
2260
2371
|
* - draggedItem is tracked in state, not via dataTransfer
|
|
2261
2372
|
*/
|
|
2262
|
-
function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = false, textNoData = "No data available", className, tableClassName, maxHeight, showHandle = true, style, saveLabel = "Save order", discardLabel = "Discard", }) {
|
|
2373
|
+
function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = false, skeletonRows = 5, textNoData = "No data available", className, tableClassName, maxHeight, showHandle = true, style, saveLabel = "Save order", discardLabel = "Discard", }) {
|
|
2263
2374
|
const { items, hasChanges, handleReorder, handleSave, handleDiscard, } = useSortableTable(data);
|
|
2264
2375
|
// Drag state lives in the component, same as CwSortableList
|
|
2265
2376
|
const [draggedItem, setDraggedItem] = React.useState(null);
|
|
@@ -2278,11 +2389,15 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2278
2389
|
setLastValidDropIndex(null);
|
|
2279
2390
|
};
|
|
2280
2391
|
const handleDragStart = (e, item) => {
|
|
2392
|
+
if (loading)
|
|
2393
|
+
return;
|
|
2281
2394
|
setDraggedItem(item);
|
|
2282
2395
|
setLastValidDropIndex(null);
|
|
2283
2396
|
e.dataTransfer.effectAllowed = "move";
|
|
2284
2397
|
};
|
|
2285
2398
|
const handleDragOver = (e, index) => {
|
|
2399
|
+
if (loading)
|
|
2400
|
+
return;
|
|
2286
2401
|
e.preventDefault();
|
|
2287
2402
|
if (!draggedItem)
|
|
2288
2403
|
return;
|
|
@@ -2295,6 +2410,11 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2295
2410
|
}
|
|
2296
2411
|
};
|
|
2297
2412
|
const handleDragEnd = () => {
|
|
2413
|
+
// Never persist a reorder computed against stale/ghost data while loading.
|
|
2414
|
+
if (loading) {
|
|
2415
|
+
cleanupDragState();
|
|
2416
|
+
return;
|
|
2417
|
+
}
|
|
2298
2418
|
if (draggedItem && lastValidDropIndex !== null) {
|
|
2299
2419
|
const dragIndex = items.findIndex(item => item[rowKey] === draggedItem[rowKey]);
|
|
2300
2420
|
if (dragIndex !== lastValidDropIndex && dragIndex !== lastValidDropIndex - 1) {
|
|
@@ -2321,7 +2441,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2321
2441
|
};
|
|
2322
2442
|
const renderBody = () => {
|
|
2323
2443
|
if (loading) {
|
|
2324
|
-
return jsxRuntime.jsx(LoadingRows, {
|
|
2444
|
+
return jsxRuntime.jsx(LoadingRows, { columns: columns, showHandle: showHandle, skeletonRows: normalizeSkeletonCount(skeletonRows, 5) });
|
|
2325
2445
|
}
|
|
2326
2446
|
if (!items || items.length === 0) {
|
|
2327
2447
|
return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: totalCols, className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
|
|
@@ -2333,7 +2453,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2333
2453
|
});
|
|
2334
2454
|
};
|
|
2335
2455
|
// ── Render ──────────────────────────────────────────────────────────────
|
|
2336
|
-
return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), hasChanges && (jsxRuntime.jsxs("footer", { className: styles$o.saveBar, children: [jsxRuntime.jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsxRuntime.jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
|
|
2456
|
+
return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxRuntime.jsxs("footer", { className: styles$o.saveBar, children: [jsxRuntime.jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsxRuntime.jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
|
|
2337
2457
|
}
|
|
2338
2458
|
|
|
2339
2459
|
/**
|
|
@@ -2389,7 +2509,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
|
|
|
2389
2509
|
*
|
|
2390
2510
|
* @returns React component
|
|
2391
2511
|
*/
|
|
2392
|
-
function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], pageLabel = "page", expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
|
|
2512
|
+
function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], pageLabel = "page", expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, skeletonRows = 5, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
|
|
2393
2513
|
const [internalState, setInternalState] = React.useState({
|
|
2394
2514
|
page: 1,
|
|
2395
2515
|
pageSize: pageSizeOptions[0],
|
|
@@ -2490,7 +2610,9 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2490
2610
|
};
|
|
2491
2611
|
const renderTableBody = () => {
|
|
2492
2612
|
if (loading) {
|
|
2493
|
-
|
|
2613
|
+
// Ghost rows: rendered outside the data/selection/expand code paths, so they
|
|
2614
|
+
// cannot trigger row click, selection or expansion.
|
|
2615
|
+
return Array.from({ length: normalizeSkeletonCount(skeletonRows, 5) }, (_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, `skeleton_${rowIndex}`)));
|
|
2494
2616
|
}
|
|
2495
2617
|
if (!data || data.length === 0) {
|
|
2496
2618
|
return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
|
|
@@ -2508,7 +2630,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
|
|
|
2508
2630
|
}, children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map((col) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex] ?? "") : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
|
|
2509
2631
|
});
|
|
2510
2632
|
};
|
|
2511
|
-
return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map((col) => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${state.sortKey === col.dataIndex ? state.sortDirection : ""}`.trim(), style: {
|
|
2633
|
+
return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map((col) => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${state.sortKey === col.dataIndex ? state.sortDirection : ""}`.trim(), style: {
|
|
2512
2634
|
cursor: col.sortable ? "pointer" : "default",
|
|
2513
2635
|
userSelect: "none",
|
|
2514
2636
|
width: columnWidths[col.key] ?? col.width,
|
|
@@ -2582,7 +2704,7 @@ function CwTabs(CwTabsProps) {
|
|
|
2582
2704
|
const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
|
|
2583
2705
|
? { minWidth: CwTabsProps.tabsListWidth }
|
|
2584
2706
|
: undefined;
|
|
2585
|
-
return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$n['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", style: CwTabsProps.style, "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, "data-tab-key": tab.key, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (jsxRuntime.jsx("span", { className: styles$n['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$n['cw-tabs-content'], "data-active-tab-key": activeTab ?? undefined, children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
|
|
2707
|
+
return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$n['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", style: CwTabsProps.style, "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, "data-tab-key": tab.key, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (jsxRuntime.jsx("span", { className: styles$n['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$n['cw-tabs-content'], "data-active-tab-key": activeTab ?? undefined, style: CwTabsProps.contentHeight ? { '--tabs-height': CwTabsProps.contentHeight } : undefined, children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
|
|
2586
2708
|
}
|
|
2587
2709
|
|
|
2588
2710
|
/**
|
|
@@ -2609,9 +2731,17 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
|
|
|
2609
2731
|
return (jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, className: "cw-expandable", children: [jsxRuntime.jsx("summary", { children: briefing }), children && jsxRuntime.jsx("section", { children: children })] }));
|
|
2610
2732
|
};
|
|
2611
2733
|
|
|
2612
|
-
var styles$m = {"cw-master-detail":"cw-master-detail-module__cw-master-detail__O8-FA","resizer":"cw-master-detail-module__resizer__hvGhL","detail":"cw-master-detail-module__detail__BG4Dm","detail-empty":"cw-master-detail-module__detail-empty__KFScK"};
|
|
2734
|
+
var styles$m = {"cw-master-detail":"cw-master-detail-module__cw-master-detail__O8-FA","resizer":"cw-master-detail-module__resizer__hvGhL","detail":"cw-master-detail-module__detail__BG4Dm","skeletonRow":"cw-master-detail-module__skeletonRow__6BUgt","detailSkeleton":"cw-master-detail-module__detailSkeleton__GcDS4","detail-empty":"cw-master-detail-module__detail-empty__KFScK"};
|
|
2613
2735
|
|
|
2614
|
-
|
|
2736
|
+
/*
|
|
2737
|
+
* Fixed rem widths for the ghosts: the master rows and detail panel size their
|
|
2738
|
+
* content freely, so a percentage-width skeleton would resolve to 100% of ~0 and
|
|
2739
|
+
* collapse to nothing. Fixed widths render regardless of layout. Cycled so rows do
|
|
2740
|
+
* not all look identical.
|
|
2741
|
+
*/
|
|
2742
|
+
const MASTER_TITLE_WIDTHS = ['9rem', '11rem', '8rem', '10rem'];
|
|
2743
|
+
const MASTER_SUBTITLE_WIDTH = '5rem';
|
|
2744
|
+
const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, detailContent, emptyDetail, searchPlaceholder = 'Search...', onSearch, masterHeader, masterFooter, masterWidth: initialWidth = 320, minMasterWidth = 240, maxMasterWidth = 500, resizable = true, showSearch = true, loading = false, skeletonRows = 5, }) => {
|
|
2615
2745
|
const [masterWidth, setMasterWidth] = React.useState(initialWidth);
|
|
2616
2746
|
const [isResizing, setIsResizing] = React.useState(false);
|
|
2617
2747
|
const containerRef = React.useRef(null);
|
|
@@ -2646,11 +2776,21 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
|
|
|
2646
2776
|
};
|
|
2647
2777
|
}, [isResizing, minMasterWidth, maxMasterWidth]);
|
|
2648
2778
|
const rootClassName = [styles$m['cw-master-detail'], className].filter(Boolean).join(' ');
|
|
2649
|
-
return (jsxRuntime.jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, children: [jsxRuntime.jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsxRuntime.jsx("search", { children: jsxRuntime.jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsxRuntime.jsx("header", { children: masterHeader })), jsxRuntime.jsx("ul", { children:
|
|
2779
|
+
return (jsxRuntime.jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsxRuntime.jsx("search", { children: jsxRuntime.jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsxRuntime.jsx("header", { children: masterHeader })), jsxRuntime.jsx("ul", { children: loading
|
|
2780
|
+
? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("li", { "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxRuntime.jsxs("div", { className: styles$m.skeletonRow, children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_TITLE_WIDTHS[rowIndex % MASTER_TITLE_WIDTHS.length] }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_SUBTITLE_WIDTH })] })] }, `skeleton_${rowIndex}`)))
|
|
2781
|
+
: items.map((item) => (jsxRuntime.jsx("li", { "data-master-key": item.key, "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsxRuntime.jsx("footer", { children: masterFooter }))] }), resizable && (jsxRuntime.jsx("div", { className: styles$m.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsxRuntime.jsx("section", { className: styles$m.detail, children: loading ? (jsxRuntime.jsxs("div", { className: styles$m.detailSkeleton, "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "14rem", height: "1.5em" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "22rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "18rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "20rem" })] })) : selectedKey && detailContent
|
|
2650
2782
|
? detailContent
|
|
2651
2783
|
: (jsxRuntime.jsx("div", { className: styles$m['detail-empty'], children: emptyDetail ?? 'Select an item to view details' })) })] }));
|
|
2652
2784
|
};
|
|
2653
2785
|
|
|
2786
|
+
/*
|
|
2787
|
+
* Fixed rem widths (not percentages): dt and dd size to their content in the list
|
|
2788
|
+
* item, so a percentage-width skeleton would resolve to 100% of ~0 and collapse to
|
|
2789
|
+
* nothing. Fixed widths are visible in both row (dt beside dd) and column (dt above
|
|
2790
|
+
* dd) item layouts. Cycled by row so keys and values do not all look identical.
|
|
2791
|
+
*/
|
|
2792
|
+
const SKELETON_KEY_WIDTHS = ["5rem", "6.5rem", "4.5rem", "6rem"];
|
|
2793
|
+
const SKELETON_VALUE_WIDTHS = ["8rem", "6rem", "9rem", "7rem"];
|
|
2654
2794
|
/**
|
|
2655
2795
|
* A component for displaying key-value pairs in a definition list format
|
|
2656
2796
|
* Used for read-only display of structured data
|
|
@@ -2664,13 +2804,20 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
|
|
|
2664
2804
|
* emptyValue="N/A"
|
|
2665
2805
|
* />
|
|
2666
2806
|
*/
|
|
2667
|
-
const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row", groupLayout, itemLayout, ...htmlProps }) => {
|
|
2807
|
+
const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row", loading = false, skeletonRows = 4, groupLayout, itemLayout, ...htmlProps }) => {
|
|
2668
2808
|
const itemDirection = itemLayout?.direction ?? direction;
|
|
2669
|
-
|
|
2809
|
+
const renderItems = () => {
|
|
2810
|
+
if (loading) {
|
|
2811
|
+
// The whole list comes from one data load, so both key and value ghost.
|
|
2812
|
+
return Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${itemDirection}`, "data-align": itemLayout?.align, "data-justify": itemLayout?.justify, "data-gap": itemLayout?.gap, "aria-hidden": "true", children: [jsxRuntime.jsx("dt", { children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: SKELETON_KEY_WIDTHS[rowIndex % SKELETON_KEY_WIDTHS.length] }) }), jsxRuntime.jsx("dd", { children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: SKELETON_VALUE_WIDTHS[rowIndex % SKELETON_VALUE_WIDTHS.length] }) })] }, `skeleton_${rowIndex}`)));
|
|
2813
|
+
}
|
|
2814
|
+
return items.map(item => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${itemDirection}`, "data-align": itemLayout?.align, "data-justify": itemLayout?.justify, "data-gap": itemLayout?.gap, children: [jsxRuntime.jsx("dt", { children: item.label }), jsxRuntime.jsx("dd", { children: item.value !== undefined && item.value !== null && item.value !== ""
|
|
2670
2815
|
? (React.isValidElement(item.value)
|
|
2671
2816
|
? item.value
|
|
2672
2817
|
: `${item.value}${item.suffix ? ` ${item.suffix}` : ''}`)
|
|
2673
|
-
: emptyValue })] }, item.key)))
|
|
2818
|
+
: emptyValue })] }, item.key)));
|
|
2819
|
+
};
|
|
2820
|
+
return (jsxRuntime.jsx("dl", { className: `cw-keyvalue-list ${className}`, "data-direction": groupLayout?.direction, "data-align": groupLayout?.align, "data-justify": groupLayout?.justify, "data-gap": groupLayout?.gap, "aria-busy": loading || undefined, ...htmlProps, children: renderItems() }));
|
|
2674
2821
|
};
|
|
2675
2822
|
|
|
2676
2823
|
var styles$l = {"sortableList":"cw-sortable-list-module__sortableList__PyLO-","sortableItem":"cw-sortable-list-module__sortableItem__FAnn2","readOnly":"cw-sortable-list-module__readOnly__r7GcH","dragging":"cw-sortable-list-module__dragging__MD715","moved":"cw-sortable-list-module__moved__sE6-N","expandedContent":"cw-sortable-list-module__expandedContent__Kocna","sortableHandle":"cw-sortable-list-module__sortableHandle__HvYBK","sortableContent":"cw-sortable-list-module__sortableContent__C6JhR","sortableTitle":"cw-sortable-list-module__sortableTitle__EgWXr","sortableExtraContent":"cw-sortable-list-module__sortableExtraContent__s4LSv","sortableActions":"cw-sortable-list-module__sortableActions__gwQOU","dropIndicator":"cw-sortable-list-module__dropIndicator__MNSF-","emptyMessage":"cw-sortable-list-module__emptyMessage__gMpaL"};
|
|
@@ -5135,8 +5282,8 @@ function CwNavMenu({ items, loading = false, isActive, renderLink = defaultRende
|
|
|
5135
5282
|
}
|
|
5136
5283
|
return (jsxRuntime.jsx("li", { "data-active": isActive?.(item) ? "true" : undefined, children: renderLink(item, jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [item.icon && jsxRuntime.jsx(CwIcon, { iconId: item.icon, size: "medium" }), item.label, isFavorite?.(item) && jsxRuntime.jsx(CwIcon, { iconId: "star", size: "small", className: styles$8.favoriteStar })] })) }, item.id));
|
|
5137
5284
|
};
|
|
5138
|
-
return (jsxRuntime.jsxs("nav", { ...navProps, className: [styles$8.menu, className].filter(Boolean).join(" "), children: [favoritesSlot && (jsxRuntime.jsxs("details", { open: true, ...favoritesProps, className: [styles$8.favorites, favoritesProps?.className].filter(Boolean).join(" "), children: [jsxRuntime.jsxs("summary", { children: [jsxRuntime.jsx(CwIcon, { iconId: "star", size: "medium" }), favoritesLabel] }), jsxRuntime.jsx("div", { className: styles$8.favoritesContent, children: favoritesSlot })] })), beforeTreeSlot, jsxRuntime.jsx("ul", { children: loading
|
|
5139
|
-
? Array.from({ length: SKELETON_ROW_COUNT }, (_unused, index) => (jsxRuntime.jsx("li", { className: styles$8.skeleton }, index)))
|
|
5285
|
+
return (jsxRuntime.jsxs("nav", { ...navProps, className: [styles$8.menu, className].filter(Boolean).join(" "), "aria-busy": loading || undefined, children: [favoritesSlot && (jsxRuntime.jsxs("details", { open: true, ...favoritesProps, className: [styles$8.favorites, favoritesProps?.className].filter(Boolean).join(" "), children: [jsxRuntime.jsxs("summary", { children: [jsxRuntime.jsx(CwIcon, { iconId: "star", size: "medium" }), favoritesLabel] }), jsxRuntime.jsx("div", { className: styles$8.favoritesContent, children: favoritesSlot })] })), beforeTreeSlot, jsxRuntime.jsx("ul", { children: loading
|
|
5286
|
+
? Array.from({ length: SKELETON_ROW_COUNT }, (_unused, index) => (jsxRuntime.jsx("li", { className: styles$8.skeleton, children: jsxRuntime.jsx(CwSkeleton, { height: "var(--cw-size-small)", radius: "var(--cw-border-radius-small)" }) }, index)))
|
|
5140
5287
|
: visibleItems.map(item => renderItem(item, 1)) }), showEmptyMessage && jsxRuntime.jsx("p", { className: styles$8.emptyMessage, children: emptyMessage })] }));
|
|
5141
5288
|
}
|
|
5142
5289
|
|
|
@@ -11528,6 +11675,7 @@ exports.CwNavMenu = CwNavMenu;
|
|
|
11528
11675
|
exports.CwNote = CwNote;
|
|
11529
11676
|
exports.CwOption = CwOption;
|
|
11530
11677
|
exports.CwPopoverButton = CwPopoverButton;
|
|
11678
|
+
exports.CwProgress = CwProgress;
|
|
11531
11679
|
exports.CwRadioGroup = CwRadioGroup;
|
|
11532
11680
|
exports.CwReportModal = CwReportModal;
|
|
11533
11681
|
exports.CwScheduler = CwScheduler;
|
|
@@ -11536,6 +11684,7 @@ exports.CwSearchInput = CwSearchInput;
|
|
|
11536
11684
|
exports.CwSelect = CwSelect;
|
|
11537
11685
|
exports.CwSelectList = CwSelectList;
|
|
11538
11686
|
exports.CwSelectListItems = CwSelectListItems;
|
|
11687
|
+
exports.CwSkeleton = CwSkeleton;
|
|
11539
11688
|
exports.CwSortableList = CwSortableList;
|
|
11540
11689
|
exports.CwSortableTable = CwSortableTable;
|
|
11541
11690
|
exports.CwSuperScheduler = CwSuperScheduler;
|