@cwellt_software/cwellt-reactjs-lib 1.3.3 → 1.3.6
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/index.cjs.js +230 -108
- package/dist/index.css +2 -2
- package/dist/index.d.ts +16 -3
- package/dist/index.es.js +230 -108
- package/dist/src/common/functions/useSingleAndDoubleClicks.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts +2 -0
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/IndicatorRow.d.ts +18 -0
- package/dist/src/components/custom/scheduler-new/presentation/components/row/IndicatorRow.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +2 -0
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/logic/filterVisibleEvents.d.ts.map +1 -1
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts +2 -0
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -1
- package/dist/src/components/display/text/message/CwMessage.d.ts +3 -2
- package/dist/src/components/display/text/message/CwMessage.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 +4 -3
- package/readme.md +1 -4
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ interface CwMessageProps {
|
|
|
108
108
|
messageType?: CwMessageType;
|
|
109
109
|
duration?: number;
|
|
110
110
|
onClose?: () => void;
|
|
111
|
+
onClick?: () => void;
|
|
111
112
|
}
|
|
112
113
|
declare const CwMessage: FC<CwMessageProps>;
|
|
113
114
|
/**
|
|
@@ -147,7 +148,7 @@ declare class CwMessageManager {
|
|
|
147
148
|
root: any;
|
|
148
149
|
static getInstance(): CwMessageManager;
|
|
149
150
|
private init;
|
|
150
|
-
showMessage(message: string, type?: CwMessageType, duration?: number): void;
|
|
151
|
+
showMessage(message: string, type?: CwMessageType, duration?: number, onClick?: () => void): void;
|
|
151
152
|
private closeMessage;
|
|
152
153
|
}
|
|
153
154
|
/**
|
|
@@ -166,7 +167,7 @@ declare class CwMessageManager {
|
|
|
166
167
|
*
|
|
167
168
|
* @note For inline messages within components, use `CwNote` or `useCwMessage` hook instead
|
|
168
169
|
*/
|
|
169
|
-
declare function CwDisplayMessage(message: string, type?: CwMessageType, duration?: number): void;
|
|
170
|
+
declare function CwDisplayMessage(message: string, type?: CwMessageType, duration?: number, onClick?: () => void): void;
|
|
170
171
|
|
|
171
172
|
interface CwNoteProps {
|
|
172
173
|
/** Message content (used when no children provided) */
|
|
@@ -2944,6 +2945,15 @@ interface RowHeaderProps<T extends RowHeaderDm> {
|
|
|
2944
2945
|
}
|
|
2945
2946
|
declare const DefaultRowHeader: FC<RowHeaderProps<RowHeaderDm>>;
|
|
2946
2947
|
|
|
2948
|
+
interface IndicatorRowDm {
|
|
2949
|
+
id: string;
|
|
2950
|
+
rowId: string;
|
|
2951
|
+
start: Date;
|
|
2952
|
+
end: Date;
|
|
2953
|
+
color: string;
|
|
2954
|
+
tooltip?: ReactNode;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2947
2957
|
interface SchedulerState {
|
|
2948
2958
|
selectedDate: Date;
|
|
2949
2959
|
isUtc: boolean;
|
|
@@ -2965,6 +2975,7 @@ interface SchedulerProps<T extends RowHeaderDm, P extends SchedulerEventDm> {
|
|
|
2965
2975
|
EventComp: React__default.ComponentType<SchedulerEventState<P>>;
|
|
2966
2976
|
events: P[];
|
|
2967
2977
|
backgroundEvents: BackgroundEventDm[];
|
|
2978
|
+
indicatorRows?: IndicatorRowDm[];
|
|
2968
2979
|
rows: T[];
|
|
2969
2980
|
contextMenuItems: MenuOption[];
|
|
2970
2981
|
orderCategories?: OrderCategory<T>[];
|
|
@@ -2981,6 +2992,7 @@ declare const Scheduler: <T extends RowHeaderDm, P extends SchedulerEventDm>(pro
|
|
|
2981
2992
|
interface SchedulerRowProps<T extends RowHeaderDm, P extends SchedulerEventDm> {
|
|
2982
2993
|
events: P[];
|
|
2983
2994
|
backgroundEvents: BackgroundEventDm[];
|
|
2995
|
+
indicatorRows: IndicatorRowDm[];
|
|
2984
2996
|
rowHeader: RowHeaderProps<T>;
|
|
2985
2997
|
contextMenuItems?: MenuOption[];
|
|
2986
2998
|
EventComp: ComponentType<SchedulerEventState<P>>;
|
|
@@ -3028,6 +3040,7 @@ interface SuperSchedulerProps {
|
|
|
3028
3040
|
rows: PinRowHeaderProps[];
|
|
3029
3041
|
events: SchedulerEventDm[];
|
|
3030
3042
|
backgroundEvents: BackgroundEventDm[];
|
|
3043
|
+
indicatorRows?: IndicatorRowDm[];
|
|
3031
3044
|
contextMenuItems: MenuOption[];
|
|
3032
3045
|
pinnedOrderCategory?: OrderCategory<PinRowHeaderProps>[];
|
|
3033
3046
|
unPinnedOrderCategory?: OrderCategory<PinRowHeaderProps>[];
|
|
@@ -3159,4 +3172,4 @@ declare class OnClickContextMenu implements UiEvent {
|
|
|
3159
3172
|
}
|
|
3160
3173
|
|
|
3161
3174
|
export { CblDragAndDrop$1 as CblDragAndDrop, CwAccordionContainer, CwAlign, CwAnchoredMenu, CwBtnDelete, CwBtnEdit, CwBtnSave, CwButton, CwCard, CwCardList, CwCheck, CwCheckbox, CwCheckboxGroup, CwChip, CwColorPicker, CwConfirmationPopup, CwContextMenu, CwDatePicker, CwDateRangePicker, CwDateTimePicker, CwDateTimePickerCompact, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdownFilter, CwExpandable, CwFileUpload, CwFileUploadMultiple, CwFindAirport, CwFindCrewmember, CwGenericTooltip, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwImageGallery, CwImageZoom, CwInput, CwInputColor, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwKeyValueList, CwLabel, CwLoading, CwLoadingSmall, CwMasterDetail, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalHover, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwNote, CwOption, CwPopoverButton, CwReportModal, CwScheduler, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSortableList, CwSortableTable, CwSuperScheduler, CwTable, CwTableGrouped, CwTableServerSide, CwTabs, CwTextArea, CwTime, CwTimePicker, CwToggle, CwTooltipManager, CwTooltipNew, CwTreeView, CwWeekdaySelector, DefaultRowHeader, OnClearPinned, OnClickContextMenu, OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDoubleClickRowEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnEndClickHeaderEvent, OnLeftDragStart, OnMultiClickEvent, OnPinRow, OnRangeClickEvent, OnRightClickEvent, OnRightClickRow, OnRightDragStart, OnStartClickHeaderEvent, OnUnpinRow, PinRowHeader, Resource, Scheduler, SchedulerEvent, SuperScheduler, UiEvent, Weekdays, cblEvent, eventIsVisible, filterVisibleEvents, getDefaultDivisions, getEventSizes, itemsToMultiFilterTags, useCwMessage, useSortableList, useSortableTable };
|
|
3162
|
-
export type { BackgroundEventDm, CardChip, ChipColorScheme, ChipVariant, Column$1 as Column, ConfirmationPopupProps, CwAlignProps, CwCardListProps, CwCardProps, CwChipProps, CwDialogProps, CwExpandableProps, CwImageAreaMethods, CwImageAreaProps, CwInputDatePickerProps, CwInputDateProps, CwInputDateTextProps, CwInputDatetimeProps, CwInputImageProps, CwInputNumberProps, CwInputPhoneProps, CwInputTextProps, CwInputTimeProps, CwKeyValueListProps, CwLabelProps, CwMasterDetailItem, CwMasterDetailProps, CwMessageProps, CwModalHoverProps, CwMultiFilterProps, CwMultiFilterTagProps, CwNoteProps, CwPopoverButtonProps, CwReportModalFunctionalProps, CwSelectListProps, CwSortableListProps, CwSortableTableProps, CwTableGroupedData, CwTableGroupedData_Group, CwTableGroupedData_Row, CwTableGroupedProps, CwTextAreaProps, CwTreeNode, DataItem, DateRangeValue, ICwMultiFilterTag, ImageItem, MenuOption, OnEvent, PinRowHeaderProps, RowHeaderDm, RowHeaderProps, SchedulerEventDm, SchedulerEventState, SchedulerRowProps, SchedulerState, ServerSideTableState, SortableColumn, SortableTableDragState, SuperSchedulerProps, Tab, UseSortableTableReturn, Weekday, ZoomImageItem, cblEventCompProps, resourceCompProps2 };
|
|
3175
|
+
export type { BackgroundEventDm, CardChip, ChipColorScheme, ChipVariant, Column$1 as Column, ConfirmationPopupProps, CwAlignProps, CwCardListProps, CwCardProps, CwChipProps, CwDialogProps, CwExpandableProps, CwImageAreaMethods, CwImageAreaProps, CwInputDatePickerProps, CwInputDateProps, CwInputDateTextProps, CwInputDatetimeProps, CwInputImageProps, CwInputNumberProps, CwInputPhoneProps, CwInputTextProps, CwInputTimeProps, CwKeyValueListProps, CwLabelProps, CwMasterDetailItem, CwMasterDetailProps, CwMessageProps, CwModalHoverProps, CwMultiFilterProps, CwMultiFilterTagProps, CwNoteProps, CwPopoverButtonProps, CwReportModalFunctionalProps, CwSelectListProps, CwSortableListProps, CwSortableTableProps, CwTableGroupedData, CwTableGroupedData_Group, CwTableGroupedData_Row, CwTableGroupedProps, CwTextAreaProps, CwTreeNode, DataItem, DateRangeValue, ICwMultiFilterTag, ImageItem, IndicatorRowDm, MenuOption, OnEvent, PinRowHeaderProps, RowHeaderDm, RowHeaderProps, SchedulerEventDm, SchedulerEventState, SchedulerRowProps, SchedulerState, ServerSideTableState, SortableColumn, SortableTableDragState, SuperSchedulerProps, Tab, UseSortableTableReturn, Weekday, ZoomImageItem, cblEventCompProps, resourceCompProps2 };
|
package/dist/index.es.js
CHANGED
|
@@ -253,7 +253,7 @@ const CwMessage = props => {
|
|
|
253
253
|
}, props.duration ?? CW_DEFAULT_MESSAGE_DURATION);
|
|
254
254
|
return () => clearTimeout(timer);
|
|
255
255
|
}, [props]);
|
|
256
|
-
return (jsxs("div", { className: "cw-message", "data-message-type": Object.keys(CwMessageType).find(key => CwMessageType[key] === props.messageType), children: [props.messageType && jsx(CwIcon, { iconId: props.messageType.toString(), size: "large" }), props.message] }));
|
|
256
|
+
return (jsxs("div", { className: "cw-message", "data-message-type": Object.keys(CwMessageType).find(key => CwMessageType[key] === props.messageType), onClick: props.onClick, style: props.onClick ? { cursor: "pointer" } : undefined, children: [props.messageType && jsx(CwIcon, { iconId: props.messageType.toString(), size: "large" }), props.message] }));
|
|
257
257
|
};
|
|
258
258
|
/**
|
|
259
259
|
* Hook for displaying inline messages within specific components.
|
|
@@ -316,11 +316,11 @@ class CwMessageManager {
|
|
|
316
316
|
document.body.prepend(this.messageWrapper);
|
|
317
317
|
this.root = createRoot(this.messageWrapper); // Create a root at the messageWrapper
|
|
318
318
|
}
|
|
319
|
-
showMessage(message, type, duration) {
|
|
319
|
+
showMessage(message, type, duration, onClick) {
|
|
320
320
|
const msg = document.createElement("div");
|
|
321
321
|
this.messageWrapper?.prepend(msg);
|
|
322
322
|
const msgRoot = createRoot(msg); // Create a root for the new message
|
|
323
|
-
msgRoot.render(jsx(CwMessage, { message: message, messageType: type, duration: duration, onClose: () => this.closeMessage(msgRoot) }));
|
|
323
|
+
msgRoot.render(jsx(CwMessage, { message: message, messageType: type, duration: duration, onClick: onClick, onClose: () => this.closeMessage(msgRoot) }));
|
|
324
324
|
}
|
|
325
325
|
closeMessage(msgRoot) {
|
|
326
326
|
msgRoot.unmount(); // Unmount the message root
|
|
@@ -342,8 +342,8 @@ class CwMessageManager {
|
|
|
342
342
|
*
|
|
343
343
|
* @note For inline messages within components, use `CwNote` or `useCwMessage` hook instead
|
|
344
344
|
*/
|
|
345
|
-
function CwDisplayMessage(message, type, duration) {
|
|
346
|
-
CwMessageManager.getInstance().showMessage(message, type, duration);
|
|
345
|
+
function CwDisplayMessage(message, type, duration, onClick) {
|
|
346
|
+
CwMessageManager.getInstance().showMessage(message, type, duration, onClick);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/**
|
|
@@ -8020,30 +8020,90 @@ const BackgroundEvent = ({ value, heightRem }) => {
|
|
|
8020
8020
|
}, children: value.icons }) : null, jsx("span", { className: styles$2["scheduler-event-text"], children: value.name })] }) }) }) }) })) : null;
|
|
8021
8021
|
};
|
|
8022
8022
|
|
|
8023
|
+
const eventIsVisible = (startDate, endDate, selectedDate, visibleDays) => {
|
|
8024
|
+
const schedulerEndDate = new Date(selectedDate.getTime() + visibleDays * 24 * 60 * 60 * 1000);
|
|
8025
|
+
const isBefore = selectedDate > startDate && selectedDate > endDate;
|
|
8026
|
+
const isAfter = schedulerEndDate < startDate && schedulerEndDate < endDate;
|
|
8027
|
+
return !isBefore && !isAfter;
|
|
8028
|
+
};
|
|
8029
|
+
|
|
8030
|
+
const hoursBetween = (date1, date2) => {
|
|
8031
|
+
const oneHourInMillis = 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
|
|
8032
|
+
const timeDiff = date2.getTime() - date1.getTime();
|
|
8033
|
+
return timeDiff / oneHourInMillis;
|
|
8034
|
+
};
|
|
8035
|
+
const getEventSizes = (schedulerDate, totalDays, startDate, endDate) => {
|
|
8036
|
+
if (!eventIsVisible(startDate, endDate, schedulerDate, totalDays)) {
|
|
8037
|
+
return {
|
|
8038
|
+
left: 0,
|
|
8039
|
+
width: 0,
|
|
8040
|
+
};
|
|
8041
|
+
}
|
|
8042
|
+
const totalHours = totalDays * 24;
|
|
8043
|
+
// const dateString = schedulerDate.toISOString().split('T')[0];
|
|
8044
|
+
//const schedulerDateAtZero = new Date(dateString)
|
|
8045
|
+
let startHours = hoursBetween(schedulerDate, startDate);
|
|
8046
|
+
let durationHours = hoursBetween(startDate, endDate);
|
|
8047
|
+
const startOutOfScheduler = startHours < 0;
|
|
8048
|
+
if (startOutOfScheduler) {
|
|
8049
|
+
durationHours += startHours;
|
|
8050
|
+
startHours = 0;
|
|
8051
|
+
}
|
|
8052
|
+
const left = (startHours / totalHours) * 100;
|
|
8053
|
+
// Minimum width equivalent to 15 minutes so zero/near-zero duration events stay visible
|
|
8054
|
+
const MIN_WIDTH_HOURS = 0.25;
|
|
8055
|
+
const minWidth = (MIN_WIDTH_HOURS * 100) / totalHours;
|
|
8056
|
+
const width = Math.max((durationHours * 100) / totalHours, minWidth);
|
|
8057
|
+
return {
|
|
8058
|
+
left,
|
|
8059
|
+
width,
|
|
8060
|
+
};
|
|
8061
|
+
};
|
|
8062
|
+
|
|
8063
|
+
const INDICATOR_HEIGHT_REM = 0.25;
|
|
8064
|
+
const IndicatorRow = ({ indicators, selectedDate, visibleDays }) => {
|
|
8065
|
+
return (jsx("div", { style: {
|
|
8066
|
+
position: "relative",
|
|
8067
|
+
height: `${INDICATOR_HEIGHT_REM}rem`,
|
|
8068
|
+
pointerEvents: "none",
|
|
8069
|
+
}, "data-name": "indicator-row", children: indicators.map((indicator) => {
|
|
8070
|
+
const { left, width } = getEventSizes(selectedDate, visibleDays, indicator.start, indicator.end);
|
|
8071
|
+
if (width <= 0)
|
|
8072
|
+
return null;
|
|
8073
|
+
const bar = (jsx("div", { style: {
|
|
8074
|
+
position: "absolute",
|
|
8075
|
+
left: `${left}%`,
|
|
8076
|
+
width: `${width}%`,
|
|
8077
|
+
height: `${INDICATOR_HEIGHT_REM}rem`,
|
|
8078
|
+
backgroundColor: indicator.color,
|
|
8079
|
+
borderRadius: "1px",
|
|
8080
|
+
pointerEvents: "auto",
|
|
8081
|
+
} }, indicator.id));
|
|
8082
|
+
if (indicator.tooltip) {
|
|
8083
|
+
return (jsx(CwTooltipNew, { content: indicator.tooltip, position: "bottom", dissapearsWhenHover: true, showDelay: 200, children: bar }, indicator.id));
|
|
8084
|
+
}
|
|
8085
|
+
return bar;
|
|
8086
|
+
}) }));
|
|
8087
|
+
};
|
|
8088
|
+
|
|
8089
|
+
// Fires onClick on the first click of a sequence (detail === 1) and
|
|
8090
|
+
// onDoubleClick on the native dblclick event. Subsequent clicks of a
|
|
8091
|
+
// double-click sequence (detail > 1) are suppressed so the same logical
|
|
8092
|
+
// interaction does not fire onClick twice. Selection therefore appears
|
|
8093
|
+
// within one paint frame instead of being delayed by an artificial timer.
|
|
8023
8094
|
function useSingleAndDoubleClicks(onClick, onDoubleClick) {
|
|
8024
|
-
const timer = useRef(null);
|
|
8025
|
-
const cancelPendingClick = useCallback(() => {
|
|
8026
|
-
if (timer.current) {
|
|
8027
|
-
clearTimeout(timer.current);
|
|
8028
|
-
timer.current = null;
|
|
8029
|
-
}
|
|
8030
|
-
}, [timer]);
|
|
8031
8095
|
const handleClick = useCallback((e) => {
|
|
8032
|
-
// We only cache the most recent click event, so cancel any pending clicks
|
|
8033
8096
|
e.stopPropagation();
|
|
8034
8097
|
e.preventDefault();
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
}, 500);
|
|
8040
|
-
}, [timer, cancelPendingClick, onClick]);
|
|
8098
|
+
if (e.detail > 1)
|
|
8099
|
+
return;
|
|
8100
|
+
onClick(e);
|
|
8101
|
+
}, [onClick]);
|
|
8041
8102
|
const handleDoubleClick = useCallback((e) => {
|
|
8042
8103
|
e.stopPropagation();
|
|
8043
8104
|
e.preventDefault();
|
|
8044
|
-
cancelPendingClick();
|
|
8045
8105
|
onDoubleClick(e);
|
|
8046
|
-
}, [
|
|
8106
|
+
}, [onDoubleClick]);
|
|
8047
8107
|
return { handleClick, handleDoubleClick };
|
|
8048
8108
|
}
|
|
8049
8109
|
|
|
@@ -8217,7 +8277,7 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
|
8217
8277
|
|
|
8218
8278
|
const SchedulerRow = memo((props) => {
|
|
8219
8279
|
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
8220
|
-
const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
|
|
8280
|
+
const { events, backgroundEvents, indicatorRows, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
|
|
8221
8281
|
const internalRows = separateEventsToInnerRows(events);
|
|
8222
8282
|
const schedulerDivRef = useRef(null);
|
|
8223
8283
|
const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
|
|
@@ -8274,7 +8334,7 @@ const SchedulerRow = memo((props) => {
|
|
|
8274
8334
|
height: props.rowHeightInRem + "rem",
|
|
8275
8335
|
pointerEvents: "none"
|
|
8276
8336
|
}, children: internalRow.map((event) => (jsx(EventComp, { value: event, heightRem: props.rowHeightInRem, onEvent: onEvent }, event.id))) }, index));
|
|
8277
|
-
}), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) })] }));
|
|
8337
|
+
}), indicatorRows.length > 0 && (jsx(IndicatorRow, { indicators: indicatorRows, selectedDate: selectedDate, visibleDays: visibleDays })), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) })] }));
|
|
8278
8338
|
}, (prevProps, nextProps) => {
|
|
8279
8339
|
// This memo is necessary to prevent re-render all the rows when a user makes drag and drop
|
|
8280
8340
|
const getEventKey = (event) => {
|
|
@@ -8300,17 +8360,15 @@ const SchedulerRow = memo((props) => {
|
|
|
8300
8360
|
return false;
|
|
8301
8361
|
}
|
|
8302
8362
|
}
|
|
8363
|
+
if (prevProps.indicatorRows.length !== nextProps.indicatorRows.length) {
|
|
8364
|
+
return false;
|
|
8365
|
+
}
|
|
8303
8366
|
// If we got here, the events are the same
|
|
8304
8367
|
return true;
|
|
8305
8368
|
});
|
|
8306
8369
|
|
|
8307
8370
|
const filterVisibleEvents = (events, selectedDate, visibleDays) => {
|
|
8308
|
-
const
|
|
8309
|
-
year: selectedDate.getFullYear(),
|
|
8310
|
-
month: selectedDate.getMonth() + 1,
|
|
8311
|
-
day: selectedDate.getDate(),
|
|
8312
|
-
}).add({ days: visibleDays });
|
|
8313
|
-
const lastDayOfScheduler = new Date(schedulerEnd.year, schedulerEnd.month - 1, schedulerEnd.day);
|
|
8371
|
+
const lastDayOfScheduler = new Date(selectedDate.getTime() + visibleDays * 24 * 60 * 60 * 1000);
|
|
8314
8372
|
return events.filter((event) => event.endDate > selectedDate && event.startDate < lastDayOfScheduler);
|
|
8315
8373
|
};
|
|
8316
8374
|
|
|
@@ -8490,51 +8548,6 @@ const getWeeksByDays = (visibleDays, selectedDate) => {
|
|
|
8490
8548
|
return weeks;
|
|
8491
8549
|
};
|
|
8492
8550
|
|
|
8493
|
-
const eventIsVisible = (startDate, endDate, selectedDate, visibleDays) => {
|
|
8494
|
-
const schedulerEnd = Temporal.PlainDate.from({
|
|
8495
|
-
year: selectedDate.getFullYear(),
|
|
8496
|
-
month: selectedDate.getMonth() + 1,
|
|
8497
|
-
day: selectedDate.getDate(),
|
|
8498
|
-
}).add({ days: visibleDays });
|
|
8499
|
-
const schedulerEndDate = new Date(schedulerEnd.year, schedulerEnd.month - 1, schedulerEnd.day);
|
|
8500
|
-
const isBefore = selectedDate > startDate && selectedDate > endDate;
|
|
8501
|
-
const isAfter = schedulerEndDate < startDate && schedulerEndDate < endDate;
|
|
8502
|
-
return !isBefore && !isAfter;
|
|
8503
|
-
};
|
|
8504
|
-
|
|
8505
|
-
const hoursBetween = (date1, date2) => {
|
|
8506
|
-
const oneHourInMillis = 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
|
|
8507
|
-
const timeDiff = date2.getTime() - date1.getTime();
|
|
8508
|
-
return timeDiff / oneHourInMillis;
|
|
8509
|
-
};
|
|
8510
|
-
const getEventSizes = (schedulerDate, totalDays, startDate, endDate) => {
|
|
8511
|
-
if (!eventIsVisible(startDate, endDate, schedulerDate, totalDays)) {
|
|
8512
|
-
return {
|
|
8513
|
-
left: 0,
|
|
8514
|
-
width: 0,
|
|
8515
|
-
};
|
|
8516
|
-
}
|
|
8517
|
-
const totalHours = totalDays * 24;
|
|
8518
|
-
// const dateString = schedulerDate.toISOString().split('T')[0];
|
|
8519
|
-
//const schedulerDateAtZero = new Date(dateString)
|
|
8520
|
-
let startHours = hoursBetween(schedulerDate, startDate);
|
|
8521
|
-
let durationHours = hoursBetween(startDate, endDate);
|
|
8522
|
-
const startOutOfScheduler = startHours < 0;
|
|
8523
|
-
if (startOutOfScheduler) {
|
|
8524
|
-
durationHours += startHours;
|
|
8525
|
-
startHours = 0;
|
|
8526
|
-
}
|
|
8527
|
-
const left = (startHours / totalHours) * 100;
|
|
8528
|
-
// Minimum width equivalent to 15 minutes so zero/near-zero duration events stay visible
|
|
8529
|
-
const MIN_WIDTH_HOURS = 0.25;
|
|
8530
|
-
const minWidth = (MIN_WIDTH_HOURS * 100) / totalHours;
|
|
8531
|
-
const width = Math.max((durationHours * 100) / totalHours, minWidth);
|
|
8532
|
-
return {
|
|
8533
|
-
left,
|
|
8534
|
-
width,
|
|
8535
|
-
};
|
|
8536
|
-
};
|
|
8537
|
-
|
|
8538
8551
|
function getLinesByDivisions(headerDivision, _) {
|
|
8539
8552
|
const lines = headerDivision.flatMap((division) => division.bottom.map((_, i) => ({ isDayBoundary: i === 0 })));
|
|
8540
8553
|
const left = 100 / lines.length;
|
|
@@ -8590,8 +8603,65 @@ const getNow = (isUtc) => {
|
|
|
8590
8603
|
};
|
|
8591
8604
|
const milliSecondsInSecond = 1000;
|
|
8592
8605
|
const refreshMilliSeconds = 45 * milliSecondsInSecond;
|
|
8606
|
+
const EMPTY_EVENTS = [];
|
|
8607
|
+
const EMPTY_BG_EVENTS = [];
|
|
8608
|
+
const EMPTY_INDICATORS = [];
|
|
8609
|
+
// Memoised row body. Receives flat props (the per-row buckets are looked up
|
|
8610
|
+
// by the outer Row wrapper). As long as those bucket arrays keep their
|
|
8611
|
+
// reference (see `groupByRowIdStable`) and the rest of the render-context
|
|
8612
|
+
// values are stable, this row will skip re-rendering on selection clicks
|
|
8613
|
+
// that don't affect it.
|
|
8614
|
+
const RowContent = React__default.memo(function RowContent(props) {
|
|
8615
|
+
const header = {
|
|
8616
|
+
value: props.row,
|
|
8617
|
+
width: props.rowHeaderWidth,
|
|
8618
|
+
onEvent: props.onEvent,
|
|
8619
|
+
};
|
|
8620
|
+
return (jsx("div", { style: {
|
|
8621
|
+
...props.style,
|
|
8622
|
+
backgroundColor: props.rowColor
|
|
8623
|
+
}, children: jsx(SchedulerRow, { events: props.events, backgroundEvents: props.backgroundEvents, indicatorRows: props.indicatorRows, rowHeader: header, EventComp: props.EventComp, BackgroundEventComp: props.BackgroundEventComp, RowTitleComp: props.RowTitleComp, weekendLines: props.weekendLines, divisionLines: props.divisionLines, timeLinePercentage: props.timeLinePercentage, rowHeightInRem: props.rowHeightRem, onEvent: props.onEvent, contextMenuItems: props.contextMenuItems, visibleDays: props.visibleDays, selectedDate: props.selectedDate }) }, props.row.rowId));
|
|
8624
|
+
});
|
|
8625
|
+
// Outer (unmemoised) row: looks up per-row buckets from the shared `data`
|
|
8626
|
+
// object and forwards them as flat props to `RowContent`. Because the
|
|
8627
|
+
// referenced arrays are reused when their contents are unchanged
|
|
8628
|
+
// (see `groupByRowIdStable`), `RowContent.memo` will skip the work.
|
|
8629
|
+
const Row = ({ index, style, data }) => {
|
|
8630
|
+
const row = data.rows[index];
|
|
8631
|
+
const rowColor = data.groupRowColors
|
|
8632
|
+
? Math.floor(index / 2) % 2 === 0 ? data.evenColor : data.oddColor
|
|
8633
|
+
: index % 2 === 0 ? data.evenColor : data.oddColor;
|
|
8634
|
+
return (jsx(RowContent, { style: style, row: row, rowColor: rowColor, events: data.eventsByRow.get(row.rowId) ?? EMPTY_EVENTS, backgroundEvents: data.backgroundEventsByRow.get(row.rowId) ?? EMPTY_BG_EVENTS, indicatorRows: data.indicatorRowsByRow.get(row.rowId) ?? EMPTY_INDICATORS, EventComp: data.EventComp, BackgroundEventComp: data.BackgroundEventComp, RowTitleComp: data.RowTitleComp, rowHeaderWidth: data.rowHeaderWidth, rowHeightRem: data.rowHeightRem, weekendLines: data.weekendLines, divisionLines: data.divisionLines, timeLinePercentage: data.timeLinePercentage, selectedDate: data.selectedDate, visibleDays: data.visibleDays, contextMenuItems: data.contextMenuItems, onEvent: data.onEvent }));
|
|
8635
|
+
};
|
|
8636
|
+
// Bucket items by rowId, but reuse previous bucket arrays whenever a row's
|
|
8637
|
+
// contents have not changed. Keeping bucket references stable is essential
|
|
8638
|
+
// for `RowContent.memo` to skip work when only one row's events change
|
|
8639
|
+
// (e.g. on selection clicks).
|
|
8640
|
+
const groupByRowIdStable = (items, prev) => {
|
|
8641
|
+
const next = new Map();
|
|
8642
|
+
for (const item of items) {
|
|
8643
|
+
const bucket = next.get(item.rowId);
|
|
8644
|
+
if (bucket) {
|
|
8645
|
+
bucket.push(item);
|
|
8646
|
+
}
|
|
8647
|
+
else {
|
|
8648
|
+
next.set(item.rowId, [item]);
|
|
8649
|
+
}
|
|
8650
|
+
}
|
|
8651
|
+
if (!prev)
|
|
8652
|
+
return next;
|
|
8653
|
+
for (const [rowId, bucket] of next) {
|
|
8654
|
+
const prevBucket = prev.get(rowId);
|
|
8655
|
+
if (prevBucket
|
|
8656
|
+
&& prevBucket.length === bucket.length
|
|
8657
|
+
&& prevBucket.every((v, i) => v === bucket[i])) {
|
|
8658
|
+
next.set(rowId, prevBucket);
|
|
8659
|
+
}
|
|
8660
|
+
}
|
|
8661
|
+
return next;
|
|
8662
|
+
};
|
|
8593
8663
|
const Scheduler = (props) => {
|
|
8594
|
-
const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, rowHeightRem = 1.75, } = props;
|
|
8664
|
+
const { header: headerContent, id, events: eventsState, backgroundEvents, indicatorRows: allIndicatorRows = [], contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, rowHeightRem = 1.75, } = props;
|
|
8595
8665
|
const BackgroundEventComp = props.BackgroundEventComp ?? BackgroundEvent;
|
|
8596
8666
|
const rows = useOrderCategory === false
|
|
8597
8667
|
? props.rows
|
|
@@ -8599,21 +8669,49 @@ const Scheduler = (props) => {
|
|
|
8599
8669
|
const instanceRef = useRef(null);
|
|
8600
8670
|
// const rowHeaderWidth = "180px";
|
|
8601
8671
|
const { selectedDate, visibleDays, isUtc, isHeaderVisible, visibleRows: stateVisibleRows } = props.state;
|
|
8602
|
-
const events = filterVisibleEvents(eventsState, selectedDate, visibleDays);
|
|
8672
|
+
const events = useMemo(() => filterVisibleEvents(eventsState, selectedDate, visibleDays), [eventsState, selectedDate, visibleDays]);
|
|
8603
8673
|
useEffect(() => {
|
|
8604
8674
|
instanceRef.current?.resetAfterIndex(0);
|
|
8605
|
-
}, [orderCategories, props.rows.length, events]);
|
|
8606
|
-
|
|
8607
|
-
|
|
8675
|
+
}, [orderCategories, props.rows.length, events, allIndicatorRows]);
|
|
8676
|
+
// Bucket events / backgroundEvents / indicatorRows by rowId once per render
|
|
8677
|
+
// instead of running events.filter() per row inside the row renderer.
|
|
8678
|
+
// Reuse previous bucket arrays when their contents are unchanged so the
|
|
8679
|
+
// memoised RowContent below can skip work (essential for selection clicks
|
|
8680
|
+
// to be cheap).
|
|
8681
|
+
const eventsByRowRef = useRef();
|
|
8682
|
+
const backgroundEventsByRowRef = useRef();
|
|
8683
|
+
const indicatorRowsByRowRef = useRef();
|
|
8684
|
+
const eventsByRow = useMemo(() => {
|
|
8685
|
+
const next = groupByRowIdStable(events, eventsByRowRef.current);
|
|
8686
|
+
eventsByRowRef.current = next;
|
|
8687
|
+
return next;
|
|
8688
|
+
}, [events]);
|
|
8689
|
+
const backgroundEventsByRow = useMemo(() => {
|
|
8690
|
+
const next = groupByRowIdStable(backgroundEvents, backgroundEventsByRowRef.current);
|
|
8691
|
+
backgroundEventsByRowRef.current = next;
|
|
8692
|
+
return next;
|
|
8693
|
+
}, [backgroundEvents]);
|
|
8694
|
+
const indicatorRowsByRow = useMemo(() => {
|
|
8695
|
+
const next = groupByRowIdStable(allIndicatorRows, indicatorRowsByRowRef.current);
|
|
8696
|
+
indicatorRowsByRowRef.current = next;
|
|
8697
|
+
return next;
|
|
8698
|
+
}, [allIndicatorRows]);
|
|
8699
|
+
const totalHeightRem = rows.reduce((acc, row) => {
|
|
8700
|
+
const filteredEvents = eventsByRow.get(row.rowId) ?? [];
|
|
8608
8701
|
const innerRows = separateEventsToInnerRows(filteredEvents);
|
|
8609
|
-
|
|
8702
|
+
const eventHeight = Math.max(innerRows.length, 1) * rowHeightRem;
|
|
8703
|
+
const hasIndicators = indicatorRowsByRow.has(row.rowId);
|
|
8704
|
+
return acc + eventHeight + (hasIndicators ? INDICATOR_HEIGHT_REM : 0);
|
|
8610
8705
|
}, 0);
|
|
8611
|
-
const
|
|
8706
|
+
const schedulerContentHeight = stateVisibleRows != null
|
|
8707
|
+
? Math.min(totalHeightRem, stateVisibleRows * rowHeightRem)
|
|
8708
|
+
: Math.max(totalHeightRem, rowHeightRem);
|
|
8612
8709
|
const totalHours = visibleDays * 24;
|
|
8613
8710
|
const [timeLinePercentage, setTimeLinePercentage] = useState(0);
|
|
8711
|
+
const divisions = useMemo(() => getDefaultDivisions(visibleDays, selectedDate), [visibleDays, selectedDate]);
|
|
8614
8712
|
const header = {
|
|
8615
8713
|
content: headerContent,
|
|
8616
|
-
divisions
|
|
8714
|
+
divisions,
|
|
8617
8715
|
visibleDays: visibleDays,
|
|
8618
8716
|
width: rowHeaderWidth,
|
|
8619
8717
|
selectedDate,
|
|
@@ -8623,9 +8721,8 @@ const Scheduler = (props) => {
|
|
|
8623
8721
|
};
|
|
8624
8722
|
const evenColor = "var(--cw-color-surface-container-low)";
|
|
8625
8723
|
const oddColor = "var(--cw-color-surface-container)";
|
|
8626
|
-
const
|
|
8627
|
-
const
|
|
8628
|
-
const divisionLines = getLinesByDivisions(header.divisions);
|
|
8724
|
+
const weekendsLines = useMemo(() => getWeekendLinesByDatesVisible(selectedDate, visibleDays), [selectedDate, visibleDays]);
|
|
8725
|
+
const divisionLines = useMemo(() => getLinesByDivisions(divisions), [divisions, visibleDays]);
|
|
8629
8726
|
// Timeline percentage calculation
|
|
8630
8727
|
useEffect(() => {
|
|
8631
8728
|
const updateTimeLinePercentage = () => {
|
|
@@ -8636,30 +8733,55 @@ const Scheduler = (props) => {
|
|
|
8636
8733
|
const interval = setInterval(updateTimeLinePercentage, refreshMilliSeconds);
|
|
8637
8734
|
return () => clearInterval(interval);
|
|
8638
8735
|
}, [selectedDate, isUtc, totalHours]);
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8736
|
+
const itemData = useMemo(() => ({
|
|
8737
|
+
rows,
|
|
8738
|
+
eventsByRow,
|
|
8739
|
+
backgroundEventsByRow,
|
|
8740
|
+
indicatorRowsByRow,
|
|
8741
|
+
EventComp: EventComp,
|
|
8742
|
+
BackgroundEventComp,
|
|
8743
|
+
RowTitleComp: RowTitleComp,
|
|
8744
|
+
rowHeaderWidth,
|
|
8745
|
+
rowHeightRem,
|
|
8746
|
+
weekendLines: weekendsLines,
|
|
8747
|
+
divisionLines,
|
|
8748
|
+
timeLinePercentage,
|
|
8749
|
+
selectedDate,
|
|
8750
|
+
visibleDays,
|
|
8751
|
+
contextMenuItems,
|
|
8752
|
+
onEvent,
|
|
8753
|
+
groupRowColors,
|
|
8754
|
+
evenColor,
|
|
8755
|
+
oddColor,
|
|
8756
|
+
}), [
|
|
8757
|
+
rows,
|
|
8758
|
+
eventsByRow,
|
|
8759
|
+
backgroundEventsByRow,
|
|
8760
|
+
indicatorRowsByRow,
|
|
8761
|
+
EventComp,
|
|
8762
|
+
BackgroundEventComp,
|
|
8763
|
+
RowTitleComp,
|
|
8764
|
+
rowHeaderWidth,
|
|
8765
|
+
rowHeightRem,
|
|
8766
|
+
weekendsLines,
|
|
8767
|
+
divisionLines,
|
|
8768
|
+
timeLinePercentage,
|
|
8769
|
+
selectedDate,
|
|
8770
|
+
visibleDays,
|
|
8771
|
+
contextMenuItems,
|
|
8772
|
+
onEvent,
|
|
8773
|
+
groupRowColors,
|
|
8774
|
+
]);
|
|
8655
8775
|
const getItemSize = useCallback((index) => {
|
|
8656
8776
|
const row = rows[index];
|
|
8657
|
-
const filteredEvents =
|
|
8777
|
+
const filteredEvents = eventsByRow.get(row.rowId) ?? [];
|
|
8658
8778
|
const innerRows = separateEventsToInnerRows(filteredEvents);
|
|
8659
8779
|
const rowsNumber = innerRows.length > 0 ? innerRows.length : 1;
|
|
8660
8780
|
const pixelsInRem = 16;
|
|
8661
|
-
|
|
8662
|
-
|
|
8781
|
+
const hasIndicators = indicatorRowsByRow.has(row.rowId);
|
|
8782
|
+
const indicatorPixels = hasIndicators ? INDICATOR_HEIGHT_REM * pixelsInRem : 0;
|
|
8783
|
+
return rowsNumber * rowHeightRem * pixelsInRem + indicatorPixels;
|
|
8784
|
+
}, [rows, eventsByRow, indicatorRowsByRow, rowHeightRem]);
|
|
8663
8785
|
// Render
|
|
8664
8786
|
return (jsxs("div", { id: id, style: {
|
|
8665
8787
|
position: "relative",
|
|
@@ -8670,7 +8792,7 @@ const Scheduler = (props) => {
|
|
|
8670
8792
|
position: "sticky",
|
|
8671
8793
|
top: 0,
|
|
8672
8794
|
zIndex: 1,
|
|
8673
|
-
}, children: jsx(SchedulerHeader, { ...header }) })), jsx(VariableSizeList, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: styles$2["hide-scrollbar"], children: Row })] }));
|
|
8795
|
+
}, children: jsx(SchedulerHeader, { ...header }) })), jsx(VariableSizeList, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, itemData: itemData, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: styles$2["hide-scrollbar"], children: Row })] }));
|
|
8674
8796
|
};
|
|
8675
8797
|
|
|
8676
8798
|
class UiEvent {
|
|
@@ -9033,13 +9155,13 @@ const PinRowHeader = ({ value, width, onEvent }) => {
|
|
|
9033
9155
|
jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }, value.rowId);
|
|
9034
9156
|
};
|
|
9035
9157
|
|
|
9036
|
-
const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, contextMenuItems, onEvent, rowHeightRem = 1.75 }) => {
|
|
9158
|
+
const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, indicatorRows = [], contextMenuItems, onEvent, rowHeightRem = 1.75 }) => {
|
|
9037
9159
|
const pinnedRows = rows.filter((it) => it.isPinned);
|
|
9038
9160
|
const notPinnedRows = rows.filter((it) => !it.isPinned);
|
|
9039
9161
|
const isFirstVisible = pinnedRows.length > 0;
|
|
9040
|
-
return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategories: pinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader, rowHeightRem: rowHeightRem }), jsx("div", { children: jsx(CwButton, { onClick: () => {
|
|
9162
|
+
return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: pinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader, rowHeightRem: rowHeightRem }), jsx("div", { children: jsx(CwButton, { onClick: () => {
|
|
9041
9163
|
onEvent(new OnClearPinned());
|
|
9042
|
-
}, children: "Clear pinned" }) })] })), jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader, rowHeightRem: rowHeightRem })] }));
|
|
9164
|
+
}, children: "Clear pinned" }) })] })), jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader, rowHeightRem: rowHeightRem })] }));
|
|
9043
9165
|
};
|
|
9044
9166
|
|
|
9045
9167
|
const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder = "Search airport…", required = false, cblConfig, className = "", value, disabled = false, displayMode, initialDisplayText, labelProps, alignProps, width }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSingleAndDoubleClicks.d.ts","sourceRoot":"","sources":["../../../../src/common/functions/useSingleAndDoubleClicks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSingleAndDoubleClicks.d.ts","sourceRoot":"","sources":["../../../../src/common/functions/useSingleAndDoubleClicks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,UAAU,EAAC,MAAM,OAAO,CAAC;AAOnD,iBAAS,wBAAwB,CAChC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,EACvE,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI;qBAEzC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,UAAU,CAAC;2BAO3C,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,UAAU,CAAC;EAO3F;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { SchedulerHeaderContent } from "./components/header/SchedulerHeaderState
|
|
|
5
5
|
import { BackgroundEventDm } from "./components/row/BackgroundEvent";
|
|
6
6
|
import { RowHeaderDm, RowHeaderProps } from "./components/row/DefaultRowHeader";
|
|
7
7
|
import { SchedulerEventDm, SchedulerEventState } from "./components/row/Event";
|
|
8
|
+
import { type IndicatorRowDm } from "./components/row/IndicatorRow";
|
|
8
9
|
import type { SchedulerState } from "./state/ui/SchedulerState";
|
|
9
10
|
export type OrderCategory<T> = keyof T & string;
|
|
10
11
|
interface SchedulerProps<T extends RowHeaderDm, P extends SchedulerEventDm> {
|
|
@@ -14,6 +15,7 @@ interface SchedulerProps<T extends RowHeaderDm, P extends SchedulerEventDm> {
|
|
|
14
15
|
EventComp: React.ComponentType<SchedulerEventState<P>>;
|
|
15
16
|
events: P[];
|
|
16
17
|
backgroundEvents: BackgroundEventDm[];
|
|
18
|
+
indicatorRows?: IndicatorRowDm[];
|
|
17
19
|
rows: T[];
|
|
18
20
|
contextMenuItems: MenuOption[];
|
|
19
21
|
orderCategories?: OrderCategory<T>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewScheduler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/custom/scheduler-new/presentation/NewScheduler.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NewScheduler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/custom/scheduler-new/presentation/NewScheduler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,6CAA6C,CAAC;AACzE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oDAAoD,CAAC;AAEnF,OAAO,EAAC,sBAAsB,EAAuB,MAAM,0CAA0C,CAAC;AACtG,OAAO,EAAkB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAC,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAuB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AASxF,OAAO,KAAK,EAAY,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAGzE,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhD,UAAU,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,gBAAgB;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,cAAc,EAAE,CAAC;IACjC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAClF,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAoKD,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,gBAAgB,EAAE,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,4CA2MvG,CAAC"}
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/IndicatorRow.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, ReactNode } from "react";
|
|
2
|
+
export interface IndicatorRowDm {
|
|
3
|
+
id: string;
|
|
4
|
+
rowId: string;
|
|
5
|
+
start: Date;
|
|
6
|
+
end: Date;
|
|
7
|
+
color: string;
|
|
8
|
+
tooltip?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const INDICATOR_HEIGHT_REM = 0.25;
|
|
11
|
+
interface IndicatorRowProps {
|
|
12
|
+
indicators: IndicatorRowDm[];
|
|
13
|
+
selectedDate: Date;
|
|
14
|
+
visibleDays: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const IndicatorRow: FC<IndicatorRowProps>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=IndicatorRow.d.ts.map
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/IndicatorRow.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorRow.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/custom/scheduler-new/presentation/components/row/IndicatorRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,UAAU,iBAAiB;IAC1B,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,YAAY,EAAE,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+C9C,CAAC"}
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ import { LineState } from "../../state/ui/SchedulerState";
|
|
|
5
5
|
import { BackgroundEventDm } from "./BackgroundEvent";
|
|
6
6
|
import { RowHeaderDm, type RowHeaderProps } from "./DefaultRowHeader";
|
|
7
7
|
import { SchedulerEventDm, SchedulerEventState } from "./Event";
|
|
8
|
+
import { type IndicatorRowDm } from "./IndicatorRow";
|
|
8
9
|
export interface SchedulerRowProps<T extends RowHeaderDm, P extends SchedulerEventDm> {
|
|
9
10
|
events: P[];
|
|
10
11
|
backgroundEvents: BackgroundEventDm[];
|
|
12
|
+
indicatorRows: IndicatorRowDm[];
|
|
11
13
|
rowHeader: RowHeaderProps<T>;
|
|
12
14
|
contextMenuItems?: MenuOption[];
|
|
13
15
|
EventComp: ComponentType<SchedulerEventState<P>>;
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchedulerRow.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAQ,YAAY,EAAmB,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,mDAAmD,CAAC;AAE1E,OAAO,EAAiB,KAAK,UAAU,EAAC,MAAM,0DAA0D,CAAC;AAYzG,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AAIxD,OAAO,EAAkB,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAmB,WAAW,EAAE,KAAK,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAiB,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SchedulerRow.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAQ,YAAY,EAAmB,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,mDAAmD,CAAC;AAE1E,OAAO,EAAiB,KAAK,UAAU,EAAC,MAAM,0DAA0D,CAAC;AAYzG,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AAIxD,OAAO,EAAkB,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAmB,WAAW,EAAE,KAAK,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAiB,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAe,KAAK,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAGjE,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,gBAAgB;IACnF,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IACtC,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC7B,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;IAChC,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3E,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAoMpB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,gBAAgB,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,KACrF,YAAY,CAAC;AAEf,eAAO,MAAM,mBAAmB,+CA6E/B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventIsVisible.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/custom/scheduler-new/presentation/logic/eventIsVisible.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,WAAW,IAAI,EAAE,SAAS,IAAI,EAAE,cAAc,IAAI,EAAE,aAAa,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"eventIsVisible.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/custom/scheduler-new/presentation/logic/eventIsVisible.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,WAAW,IAAI,EAAE,SAAS,IAAI,EAAE,cAAc,IAAI,EAAE,aAAa,MAAM,KAAG,OAKxG,CAAC"}
|
package/dist/src/components/custom/scheduler-new/presentation/logic/filterVisibleEvents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterVisibleEvents.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/custom/scheduler-new/presentation/logic/filterVisibleEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,gBAAgB,EAC7D,QAAQ,CAAC,EAAE,EACX,cAAc,IAAI,EAClB,aAAa,MAAM,KACjB,CAAC,
|
|
1
|
+
{"version":3,"file":"filterVisibleEvents.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/custom/scheduler-new/presentation/logic/filterVisibleEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,gBAAgB,EAC7D,QAAQ,CAAC,EAAE,EACX,cAAc,IAAI,EAClB,aAAa,MAAM,KACjB,CAAC,EAMH,CAAC"}
|