@mantine/schedule 9.7.1 → 9.7.3
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/cjs/components/DayView/DayView.cjs +45 -29
- package/cjs/components/DayView/DayView.cjs.map +1 -1
- package/cjs/components/DayView/DayView.module.cjs.map +1 -1
- package/cjs/components/MobileMonthView/MobileMonthView.cjs +60 -23
- package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
- package/cjs/components/MobileMonthView/MobileMonthView.module.cjs.map +1 -1
- package/cjs/components/MobileMonthView/get-mobile-month-view-weeks.cjs +32 -0
- package/cjs/components/MobileMonthView/get-mobile-month-view-weeks.cjs.map +1 -0
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +15 -7
- package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
- package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs +11 -6
- package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs.map +1 -1
- package/cjs/components/ResourcesMonthView/ResourcesMonthView.module.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +15 -7
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
- package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs +11 -6
- package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs.map +1 -1
- package/cjs/components/Schedule/Schedule.cjs +2 -0
- package/cjs/components/Schedule/Schedule.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.cjs +29 -19
- package/cjs/components/WeekView/WeekView.cjs.map +1 -1
- package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
- package/cjs/components/WeekView/WeekViewDay.cjs +13 -7
- package/cjs/components/WeekView/WeekViewDay.cjs.map +1 -1
- package/cjs/components/YearView/YearView.cjs +1 -1
- package/cjs/components/YearView/YearView.cjs.map +1 -1
- package/cjs/components/YearView/YearViewMonth.cjs +1 -1
- package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
- package/cjs/index.cjs +10 -0
- package/cjs/utils/add-minutes-to-time/add-minutes-to-time.cjs +17 -0
- package/cjs/utils/add-minutes-to-time/add-minutes-to-time.cjs.map +1 -0
- package/cjs/utils/clamp-slot-label-interval/clamp-slot-label-interval.cjs +22 -0
- package/cjs/utils/clamp-slot-label-interval/clamp-slot-label-interval.cjs.map +1 -0
- package/cjs/utils/get-business-hours-mod/get-business-hours-mod.cjs +74 -17
- package/cjs/utils/get-business-hours-mod/get-business-hours-mod.cjs.map +1 -1
- package/cjs/utils/get-day-time-intervals/get-day-time-intervals.cjs +7 -2
- package/cjs/utils/get-day-time-intervals/get-day-time-intervals.cjs.map +1 -1
- package/cjs/utils/get-slot-label-groups/get-slot-label-groups.cjs +26 -0
- package/cjs/utils/get-slot-label-groups/get-slot-label-groups.cjs.map +1 -0
- package/cjs/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.cjs +1 -1
- package/cjs/utils/get-visible-week-days/get-visible-week-days.cjs.map +1 -0
- package/esm/components/DayView/DayView.mjs +46 -30
- package/esm/components/DayView/DayView.mjs.map +1 -1
- package/esm/components/DayView/DayView.module.mjs.map +1 -1
- package/esm/components/MobileMonthView/MobileMonthView.mjs +60 -23
- package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
- package/esm/components/MobileMonthView/MobileMonthView.module.mjs.map +1 -1
- package/esm/components/MobileMonthView/get-mobile-month-view-weeks.mjs +30 -0
- package/esm/components/MobileMonthView/get-mobile-month-view-weeks.mjs.map +1 -0
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs +16 -8
- package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
- package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs +12 -7
- package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs.map +1 -1
- package/esm/components/ResourcesMonthView/ResourcesMonthView.module.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +16 -8
- package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
- package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs +12 -7
- package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs.map +1 -1
- package/esm/components/Schedule/Schedule.mjs +2 -0
- package/esm/components/Schedule/Schedule.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.mjs +30 -20
- package/esm/components/WeekView/WeekView.mjs.map +1 -1
- package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
- package/esm/components/WeekView/WeekViewDay.mjs +14 -8
- package/esm/components/WeekView/WeekViewDay.mjs.map +1 -1
- package/esm/components/YearView/YearView.mjs +1 -1
- package/esm/components/YearView/YearView.mjs.map +1 -1
- package/esm/components/YearView/YearViewMonth.mjs +1 -1
- package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
- package/esm/index.mjs +6 -2
- package/esm/utils/add-minutes-to-time/add-minutes-to-time.mjs +17 -0
- package/esm/utils/add-minutes-to-time/add-minutes-to-time.mjs.map +1 -0
- package/esm/utils/clamp-slot-label-interval/clamp-slot-label-interval.mjs +22 -0
- package/esm/utils/clamp-slot-label-interval/clamp-slot-label-interval.mjs.map +1 -0
- package/esm/utils/get-business-hours-mod/get-business-hours-mod.mjs +74 -18
- package/esm/utils/get-business-hours-mod/get-business-hours-mod.mjs.map +1 -1
- package/esm/utils/get-day-time-intervals/get-day-time-intervals.mjs +7 -2
- package/esm/utils/get-day-time-intervals/get-day-time-intervals.mjs.map +1 -1
- package/esm/utils/get-slot-label-groups/get-slot-label-groups.mjs +26 -0
- package/esm/utils/get-slot-label-groups/get-slot-label-groups.mjs.map +1 -0
- package/esm/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.mjs +1 -1
- package/esm/utils/get-visible-week-days/get-visible-week-days.mjs.map +1 -0
- package/lib/components/DayView/DayView.d.ts +3 -1
- package/lib/components/MobileMonthView/MobileMonthView.d.ts +2 -0
- package/lib/components/MobileMonthView/get-mobile-month-view-weeks.d.ts +11 -0
- package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +1 -1
- package/lib/components/ResourcesDayView/ResourcesDayViewColumn.d.ts +2 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +1 -1
- package/lib/components/ResourcesWeekView/ResourcesWeekViewRow.d.ts +2 -1
- package/lib/components/Schedule/Schedule.d.ts +1 -1
- package/lib/components/WeekView/WeekView.d.ts +3 -1
- package/lib/utils/add-minutes-to-time/add-minutes-to-time.d.ts +1 -0
- package/lib/utils/clamp-slot-label-interval/clamp-slot-label-interval.d.ts +9 -0
- package/lib/utils/get-business-hours-mod/get-business-hours-mod.d.ts +24 -5
- package/lib/utils/get-day-time-intervals/get-day-time-intervals.d.ts +5 -1
- package/lib/utils/get-slot-label-groups/get-slot-label-groups.d.ts +15 -0
- package/lib/utils/index.d.ts +7 -2
- package/package.json +4 -4
- package/styles.css +178 -9
- package/styles.layer.css +178 -9
- package/cjs/components/YearView/get-visible-week-days.cjs.map +0 -1
- package/esm/components/YearView/get-visible-week-days.mjs.map +0 -1
- /package/lib/{components/YearView → utils/get-visible-week-days}/get-visible-week-days.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesWeekView.module.cjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n\n /* The resized edge repeatedly crosses the pointer, so hover feedback would flicker */\n &:where([data-resizing]) {\n @mixin hover {\n background-color: var(--bg-event-bg);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n & .resourcesWeekViewResizeHandle {\n background-color: var(--bg-event-color);\n\n &:where([data-edge='start']) {\n left: 0;\n }\n\n &:where([data-edge='end']) {\n right: 0;\n }\n }\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n\n &:where([data-invalid]) {\n border-color: var(--mantine-color-error);\n background-color: transparent;\n opacity: 0.4;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ResourcesWeekView.module.cjs","names":[],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekView.module.css"],"sourcesContent":[".resourcesWeekView {\n --_business-hours-direction: to right;\n --resources-week-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-week-view-resource-label-width: 120px;\n --resources-week-view-slot-width: 60px;\n --resources-week-view-row-height: 64px;\n --resources-week-view-group-label-width: 80px;\n --resources-week-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-week-view-border-color: var(--mantine-color-gray-3);\n --resources-week-view-business-hours-bg: var(--mantine-color-white);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-week-view-border-color: var(--mantine-color-dark-4);\n --resources-week-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-week-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n\n @mixin rtl {\n --_business-hours-direction: to left;\n }\n}\n\n.resourcesWeekViewRoot {\n border: 1px solid var(--resources-week-view-border-color);\n border-radius: var(--resources-week-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesWeekViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesWeekViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesWeekViewHeaderRows {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 14;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-week-view-border-color);\n margin-bottom: -1px;\n}\n\n.resourcesWeekViewCorner {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n position: sticky;\n left: 0;\n z-index: 6;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesWeekViewHeaderContent {\n display: flex;\n flex-direction: column;\n}\n\n.resourcesWeekViewDayLabelsRow {\n display: flex;\n border-bottom: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewDayLabel {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n cursor: default;\n height: 32px;\n text-transform: capitalize;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-weekend]) {\n color: var(--mantine-color-red-6);\n }\n\n &:where([data-today]) {\n color: var(--mantine-primary-color-contrast);\n background-color: var(--mantine-primary-color-filled);\n font-weight: var(--mantine-font-weight-bold);\n }\n}\n\n.resourcesWeekViewTimeLabelsRow {\n display: flex;\n}\n\n.resourcesWeekViewTimeLabel {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-xs);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-partial-business-hours]) {\n background-image: linear-gradient(\n var(--_business-hours-direction),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-to),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-to)\n );\n }\n}\n\n.resourcesWeekViewRow {\n display: flex;\n border-top: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewResourceLabel {\n flex: 0 0 var(--resources-week-view-resource-label-width);\n min-width: var(--resources-week-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 4;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-week-view-group-label-width);\n }\n}\n\n.resourcesWeekViewGroupColumn {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-week-view-row-height) + 1px);\n }\n}\n\n.resourcesWeekViewGroupColumnEmpty {\n flex: 0 0 var(--resources-week-view-group-label-width);\n min-width: var(--resources-week-view-group-label-width);\n min-height: var(--resources-week-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n}\n\n.resourcesWeekViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-week-view-row-height);\n}\n\n.resourcesWeekViewRowSlot {\n flex: 0 0 var(--resources-week-view-slot-width);\n min-width: var(--resources-week-view-slot-width);\n max-width: var(--resources-week-view-slot-width);\n min-height: var(--resources-week-view-row-height);\n border-inline-end: 1px solid var(--resources-week-view-border-color);\n cursor: pointer;\n position: relative;\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n @mixin hover {\n background-image: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-week-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-week-view-non-business-hours-bg);\n }\n\n &:where([data-partial-business-hours]) {\n background-image: linear-gradient(\n var(--_business-hours-direction),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-from),\n var(--resources-week-view-business-hours-bg) var(--business-hours-to),\n var(--resources-week-view-non-business-hours-bg) var(--business-hours-to)\n );\n }\n\n &:where([data-drop-target]) {\n background-image: none;\n\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-image: none;\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-week-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n\n /* The resized edge repeatedly crosses the pointer, so hover feedback would flicker */\n &:where([data-resizing]) {\n @mixin hover {\n background-color: var(--bg-event-bg);\n }\n }\n}\n\n.resourcesWeekViewAllDayEvent {\n position: absolute;\n height: var(--resources-week-view-all-day-height);\n z-index: 2;\n}\n\n.resourcesWeekViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesWeekViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-event-interaction]) .resourcesWeekViewRowSlot {\n pointer-events: none;\n}\n\n/* The resizing background event is the one that set `data-event-interaction`, so it must\n keep capturing pointer events. */\n.resourcesWeekView:where([data-event-interaction], [data-slot-dragging])\n .resourcesWeekViewBackgroundEvent:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n pointer-events: none;\n opacity: 0;\n }\n}\n\n.resourcesWeekViewBackgroundEvent {\n & .resourcesWeekViewResizeHandle {\n background-color: var(--bg-event-color);\n\n &:where([data-edge='start']) {\n left: 0;\n }\n\n &:where([data-edge='end']) {\n right: 0;\n }\n }\n\n &:hover .resourcesWeekViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesWeekViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesWeekViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesWeekView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesWeekViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesWeekViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-week-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 62px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesWeekViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesWeekViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesWeekViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n top: 0;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesWeekViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-week-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n\n &:where([data-invalid]) {\n border-color: var(--mantine-color-error);\n background-color: transparent;\n opacity: 0.4;\n }\n}\n"],"mappings":""}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_labels = require("../../labels.cjs");
|
|
3
|
+
const require_clamp_interval_minutes = require("../../utils/clamp-interval-minutes/clamp-interval-minutes.cjs");
|
|
3
4
|
const require_get_business_hours_mod = require("../../utils/get-business-hours-mod/get-business-hours-mod.cjs");
|
|
5
|
+
const require_add_minutes_to_time = require("../../utils/add-minutes-to-time/add-minutes-to-time.cjs");
|
|
4
6
|
let _mantine_core = require("@mantine/core");
|
|
5
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
8
|
//#region packages/@mantine/schedule/src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx
|
|
7
|
-
function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, getStyles, children, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onRowSlotsDragOver, onRowSlotsDragLeave, onRowSlotsDrop, onSlotClick, dropTargetSlotIndex, mode, slotsRef, firstSlotIndex, onSlotKeyDown, withDragSlotSelect, onSlotPointerDown, isSlotDragSelected, rowSlotsContainerRef, renderResourceLabel, renderGroupLabel, scrolledX, groupInfo, allDayCount }) {
|
|
9
|
+
function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, intervalMinutes, getStyles, children, labels, highlightBusinessHours, businessHours, withEventsDragAndDrop, onRowSlotsDragOver, onRowSlotsDragLeave, onRowSlotsDrop, onSlotClick, dropTargetSlotIndex, mode, slotsRef, firstSlotIndex, onSlotKeyDown, withDragSlotSelect, onSlotPointerDown, isSlotDragSelected, rowSlotsContainerRef, renderResourceLabel, renderGroupLabel, scrolledX, groupInfo, allDayCount }) {
|
|
8
10
|
const slotGroup = String(resource.id);
|
|
9
11
|
const items = weekdays.flatMap((day, dayIndex) => slots.map((slot, slotIndex) => {
|
|
10
12
|
const flatIndex = dayIndex * slots.length + slotIndex;
|
|
11
13
|
const isDropTarget = dropTargetSlotIndex === flatIndex;
|
|
12
14
|
const isFirstSlot = firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;
|
|
13
15
|
const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;
|
|
16
|
+
const businessHoursState = require_get_business_hours_mod.getBusinessHoursState({
|
|
17
|
+
time: slot.startTime,
|
|
18
|
+
endTime: require_add_minutes_to_time.addMinutesToTime(slot.startTime, require_clamp_interval_minutes.clampIntervalMinutes(intervalMinutes)),
|
|
19
|
+
businessHours,
|
|
20
|
+
highlightBusinessHours
|
|
21
|
+
});
|
|
14
22
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.UnstyledButton, {
|
|
15
23
|
ref: (node) => {
|
|
16
24
|
if (!slotsRef?.current) return;
|
|
@@ -25,15 +33,12 @@ function ResourcesWeekViewRow({ resource, resourceIndex, weekdays, slots, getSty
|
|
|
25
33
|
...getStyles("resourcesWeekViewRowSlot"),
|
|
26
34
|
mod: {
|
|
27
35
|
"hour-start": slot.isHourStart,
|
|
28
|
-
...
|
|
29
|
-
time: slot.startTime,
|
|
30
|
-
businessHours,
|
|
31
|
-
highlightBusinessHours
|
|
32
|
-
}),
|
|
36
|
+
...businessHoursState.mod,
|
|
33
37
|
"drop-target": isDropTarget,
|
|
34
38
|
"drag-selected": isDragSelected,
|
|
35
39
|
static: mode === "static"
|
|
36
40
|
},
|
|
41
|
+
__vars: businessHoursState.vars,
|
|
37
42
|
"aria-label": `${require_labels.getLabel("resourceSlot", labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`,
|
|
38
43
|
tabIndex: mode === "static" ? -1 : isFirstSlot ? 0 : -1,
|
|
39
44
|
"data-drag-slot-index": withDragSlotSelect && mode !== "static" ? flatIndex : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesWeekViewRow.cjs","names":["UnstyledButton","getBusinessHoursMod","getLabel","Box"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n getBusinessHoursMod,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView';\n\nexport interface ResourcesWeekViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n weekdays: string[];\n slots: DayTimeInterval[];\n getStyles: GetStylesApi<ResourcesWeekViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n day: string,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesWeekViewRow({\n resource,\n resourceIndex,\n weekdays,\n slots,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesWeekViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = weekdays.flatMap((day, dayIndex) =>\n slots.map((slot, slotIndex) => {\n const flatIndex = dayIndex * slots.length + slotIndex;\n const isDropTarget = dropTargetSlotIndex === flatIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;\n const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;\n\n return (\n <UnstyledButton\n key={`${day}-${slot.startTime}`}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[flatIndex] = node;\n } else {\n delete row[flatIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesWeekViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, flatIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, flatIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, day, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n })\n );\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesWeekViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box\n {...getStyles('resourcesWeekViewGroupColumnEmpty')}\n mod={{ 'scrolled-x': scrolledX }}\n />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesWeekViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesWeekViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesWeekViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${allDayCount} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceIndex)\n : undefined\n }\n >\n {children}\n {items}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;AA+DA,SAAgB,qBAAqB,EACnC,UACA,eACA,UACA,OACA,WACA,UACA,QACA,wBACA,eACA,uBACA,oBACA,qBACA,gBACA,aACA,qBACA,MACA,UACA,gBACA,eACA,oBACA,mBACA,oBACA,sBACA,qBACA,kBACA,WACA,WACA,eAC4B;CAC5B,MAAM,YAAY,OAAO,SAAS,EAAE;CAEpC,MAAM,QAAQ,SAAS,SAAS,KAAK,aACnC,MAAM,KAAK,MAAM,cAAc;EAC7B,MAAM,YAAY,WAAW,MAAM,SAAS;EAC5C,MAAM,eAAe,wBAAwB;EAC7C,MAAM,cACJ,gBAAgB,kBAAkB,iBAAiB,gBAAgB,cAAc;EACnF,MAAM,iBAAiB,qBAAqB,WAAW,SAAS,KAAK;EAErE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,gBAAD;GAEE,MAAM,SAAS;IACb,IAAI,CAAC,UAAU,SACb;IAEF,IAAI,CAAC,SAAS,QAAQ,gBACpB,SAAS,QAAQ,iBAAiB,CAAC;IAErC,MAAM,MAAM,SAAS,QAAQ;IAC7B,IAAI,MACF,IAAI,aAAa;SACZ;KACL,OAAO,IAAI;KACX,OAAO,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,MAAM,MAC9C,IAAI,UAAU;IAElB;GACF;GACA,GAAI,UAAU,0BAA0B;GACxC,KAAK;IACH,c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AD;EACE,GAAI,UAAU,mCAAmC;EACjD,KAAK,EAAE,cAAc,UAAU;CAChC,CAAA,IAED;CAEN,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;EAAK,GAAI,UAAU,sBAAsB;EAAzC,UAAA;GACG;GACD,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;IACE,GAAI,UAAU,gCAAgC;IAC9C,KAAK;KAAE,cAAc;KAAW,cAAc,cAAc,KAAA;IAAU;IAErE,UAAA,sBAAsB,oBAAoB,QAAQ,IAAI,SAAS;GAC7D,CAAA;GACL,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;IACE,KAAK;IACL,GAAI,UAAU,6BAA6B,EACzC,OAAO,cACH,EACE,WAAW,mDAAmD,YAAY,8DAC5E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;IAlBR,UAAA,CAqBG,UACA,KACE;;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"ResourcesWeekViewRow.cjs","names":["getBusinessHoursState","addMinutesToTime","clampIntervalMinutes","UnstyledButton","getLabel","Box"],"sources":["../../../src/components/ResourcesWeekView/ResourcesWeekViewRow.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n addMinutesToTime,\n clampIntervalMinutes,\n getBusinessHoursState,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesWeekViewFactory } from './ResourcesWeekView';\n\nexport interface ResourcesWeekViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n weekdays: string[];\n slots: DayTimeInterval[];\n intervalMinutes: number;\n getStyles: GetStylesApi<ResourcesWeekViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n day: string,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesWeekViewRow({\n resource,\n resourceIndex,\n weekdays,\n slots,\n intervalMinutes,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesWeekViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = weekdays.flatMap((day, dayIndex) =>\n slots.map((slot, slotIndex) => {\n const flatIndex = dayIndex * slots.length + slotIndex;\n const isDropTarget = dropTargetSlotIndex === flatIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === flatIndex;\n const isDragSelected = isSlotDragSelected?.(flatIndex, slotGroup) || false;\n\n const businessHoursState = getBusinessHoursState({\n time: slot.startTime,\n endTime: addMinutesToTime(slot.startTime, clampIntervalMinutes(intervalMinutes)),\n businessHours,\n highlightBusinessHours,\n });\n\n return (\n <UnstyledButton\n key={`${day}-${slot.startTime}`}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[flatIndex] = node;\n } else {\n delete row[flatIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesWeekViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...businessHoursState.mod,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n __vars={businessHoursState.vars}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${day} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? flatIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, flatIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, flatIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, day, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n })\n );\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesWeekViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-week-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box\n {...getStyles('resourcesWeekViewGroupColumnEmpty')}\n mod={{ 'scrolled-x': scrolledX }}\n />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesWeekViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesWeekViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesWeekViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-week-view-row-height), calc(${allDayCount} * (var(--resources-week-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceI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GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;IACE,GAAI,UAAU,gCAAgC;IAC9C,KAAK;KAAE,cAAc;KAAW,cAAc,cAAc,KAAA;IAAU;IAErE,UAAA,sBAAsB,oBAAoB,QAAQ,IAAI,SAAS;GAC7D,CAAA;GACL,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;IACE,KAAK;IACL,GAAI,UAAU,6BAA6B,EACzC,OAAO,cACH,EACE,WAAW,mDAAmD,YAAY,8DAC5E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;IAlBR,UAAA,CAqBG,UACA,KACE;;EACF;;AAET"}
|
|
@@ -131,6 +131,8 @@ const Schedule = (0, _mantine_core.factory)((_props) => {
|
|
|
131
131
|
recurrenceExpansionLimit,
|
|
132
132
|
onYearClick: () => handleViewChange("year"),
|
|
133
133
|
onEventClick,
|
|
134
|
+
weekendDays: monthViewProps?.weekendDays,
|
|
135
|
+
withWeekendDays: monthViewProps?.withWeekendDays,
|
|
134
136
|
...mobileMonthViewProps
|
|
135
137
|
});
|
|
136
138
|
case "year": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_YearView.YearView, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schedule.cjs","names":["factory","useProps","useStyles","useUncontrolled","DayView","WeekView","MonthView","YearView","MobileMonthView","Box","classes"],"sources":["../../../src/components/Schedule/Schedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleCanResizeEventToData,\n ScheduleEventData,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport { DayView, DayViewProps, DayViewStylesNames } from '../DayView/DayView';\nimport {\n MobileMonthView,\n MobileMonthViewProps,\n MobileMonthViewStylesNames,\n} from '../MobileMonthView/MobileMonthView';\nimport { MonthView, MonthViewProps, MonthViewStylesNames } from '../MonthView/MonthView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport { WeekView, WeekViewProps, WeekViewStylesNames } from '../WeekView/WeekView';\nimport { YearView, YearViewProps, YearViewStylesNames } from '../YearView/YearView';\nimport classes from './Schedule.module.css';\n\nexport type ScheduleStylesNames =\n | 'root'\n | 'desktopView'\n | 'mobileView'\n | DayViewStylesNames\n | WeekViewStylesNames\n | MonthViewStylesNames\n | YearViewStylesNames\n | MobileMonthViewStylesNames;\n\nexport type ScheduleLayout = 'default' | 'responsive';\n\ntype ScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onAllDaySlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'onMonthClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'withAgenda'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'canDropEvent'\n | 'canDropExternalEvent'\n | 'canResizeEventTo'\n | 'preventEventOverlap'\n | 'onEventPlacementRejected'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ScheduleViewProps<T> = Partial<Omit<T, ScheduleCommonProps>>;\n\nexport interface ScheduleProps\n extends BoxProps, StylesApiProps<ScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ScheduleViewLevel;\n\n /** Default view level (uncontrolled) */\n defaultView?: ScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting (overrides `DatesProvider`) */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked in DayView/WeekView */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked in DayView/WeekView */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when a day is clicked in MonthView and YearView */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Called when event is clicked in any view */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Interaction mode:\n * - `'default'` allows all interactions\n * - `'static'` disables event interactions\n * @default 'default' */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */\n canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;\n\n /** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop or resize is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day`, `week` and `month` views only – `YearView` and the `MobileMonthView` used by `layout=\"responsive\"` on small screens do not render background events at all. Combined with `withEventResize`, timed background events in `day` and `week` views can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Layout mode:\n * - `'default'` uses same views on all screen sizes\n * - `'responsive'` switches to YearView/MobileMonthView on small screens\n * @default 'default' */\n layout?: ScheduleLayout;\n\n /** Props specific to DayView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n dayViewProps?: ScheduleViewProps<DayViewProps>;\n\n /** Props specific to WeekView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n weekViewProps?: ScheduleViewProps<WeekViewProps>;\n\n /** Props specific to MonthView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n monthViewProps?: ScheduleViewProps<MonthViewProps>;\n\n /** Props specific to YearView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n yearViewProps?: ScheduleViewProps<YearViewProps>;\n\n /** Props specific to MobileMonthView (used in responsive layout) */\n mobileMonthViewProps?: ScheduleViewProps<MobileMonthViewProps>;\n\n /** If set, displays an Agenda button in the header of DayView, WeekView and MonthView @default false */\n withAgenda?: boolean;\n}\n\nexport type ScheduleFactory = Factory<{\n props: ScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ScheduleProps> = {\n defaultView: 'week',\n mode: 'default',\n layout: 'default',\n};\n\nexport const Schedule = factory<ScheduleFactory>((_props) => {\n const props = useProps('Schedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n canDropEvent,\n canDropExternalEvent,\n canResizeEventTo,\n preventEventOverlap,\n onEventPlacementRejected,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n layout,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n yearViewProps,\n mobileMonthViewProps,\n withAgenda,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ScheduleFactory>({\n name: __staticSelector || 'Schedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n _setView(newView);\n onViewChange?.(newView);\n };\n\n const handleMonthClick = (monthDate: DateStringValue) => {\n handleDateChange(monthDate);\n handleViewChange('month');\n };\n\n const commonProps = {\n date: _date,\n onDateChange: handleDateChange,\n view: _view,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize: mode === 'static' ? false : withEventResize,\n onEventResize,\n canResizeEvent,\n recurrenceExpansionLimit,\n mode,\n withAgenda,\n };\n\n const dropValidationProps = {\n canDropEvent,\n canDropExternalEvent,\n preventEventOverlap,\n onEventPlacementRejected,\n };\n\n const placementValidationProps = { ...dropValidationProps, canResizeEventTo };\n\n const desktopContent = (() => {\n switch (_view) {\n case 'day':\n return (\n <DayView\n {...commonProps}\n {...placementValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <WeekView\n {...commonProps}\n {...placementValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <MonthView\n {...commonProps}\n {...dropValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...monthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n const mobileContent = (() => {\n switch (_view) {\n case 'day':\n case 'week':\n case 'month':\n return (\n <MobileMonthView\n date={_date}\n onDateChange={handleDateChange}\n events={events}\n locale={locale}\n radius={radius}\n labels={labels}\n mode={mode}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n onYearClick={() => handleViewChange('year')}\n onEventClick={onEventClick}\n {...mobileMonthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n if (layout === 'responsive') {\n return (\n <Box {...getStyles('root')} mod={[{ layout }, mod]} {...others}>\n <Box {...getStyles('desktopView')}>{desktopContent}</Box>\n <Box {...getStyles('mobileView')}>{mobileContent}</Box>\n </Box>\n );\n }\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {desktopContent}\n </Box>\n );\n});\n\nSchedule.displayName = '@mantine/schedule/Schedule';\nSchedule.classes = classes;\n\nexport namespace Schedule {\n export type Props = ScheduleProps;\n export type StylesNames = ScheduleStylesNames;\n export type Factory = ScheduleFactory;\n export type Layout = ScheduleLayout;\n}\n"],"mappings":";;;;;;;;;;;AAiPA,MAAM,eAAuC;CAC3C,aAAa;CACb,MAAM;CACN,Q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K,CAAC,EAAE,OAAO,GAAG,GAAG;EAAG,GAAI;EAAxD,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;GAAK,GAAI,UAAU,aAAa;GAAI,UAAA;EAAoB,CAAA,GACxD,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;GAAK,GAAI,UAAU,YAAY;GAAI,UAAA;EAAmB,CAAA,CACnD;;CAIT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc;AACvB,SAAS,UAAUC,wBAAAA"}
|
|
1
|
+
{"version":3,"file":"Schedule.cjs","names":["factory","useProps","useStyles","useUncontrolled","DayView","WeekView","MonthView","YearView","MobileMonthView","Box","classes"],"sources":["../../../src/components/Schedule/Schedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n PreventEventOverlap,\n ScheduleCanDropEventData,\n ScheduleCanDropExternalEventData,\n ScheduleCanResizeEventToData,\n ScheduleEventData,\n ScheduleEventPlacementRejectedData,\n ScheduleMode,\n ScheduleViewLevel,\n} from '../../types';\nimport { DayView, DayViewProps, DayViewStylesNames } from '../DayView/DayView';\nimport {\n MobileMonthView,\n MobileMonthViewProps,\n MobileMonthViewStylesNames,\n} from '../MobileMonthView/MobileMonthView';\nimport { MonthView, MonthViewProps, MonthViewStylesNames } from '../MonthView/MonthView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport { WeekView, WeekViewProps, WeekViewStylesNames } from '../WeekView/WeekView';\nimport { YearView, YearViewProps, YearViewStylesNames } from '../YearView/YearView';\nimport classes from './Schedule.module.css';\n\nexport type ScheduleStylesNames =\n | 'root'\n | 'desktopView'\n | 'mobileView'\n | DayViewStylesNames\n | WeekViewStylesNames\n | MonthViewStylesNames\n | YearViewStylesNames\n | MobileMonthViewStylesNames;\n\nexport type ScheduleLayout = 'default' | 'responsive';\n\ntype ScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onAllDaySlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'onMonthClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'withAgenda'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'canDropEvent'\n | 'canDropExternalEvent'\n | 'canResizeEventTo'\n | 'preventEventOverlap'\n | 'onEventPlacementRejected'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ScheduleViewProps<T> = Partial<Omit<T, ScheduleCommonProps>>;\n\nexport interface ScheduleProps\n extends BoxProps, StylesApiProps<ScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ScheduleViewLevel;\n\n /** Default view level (uncontrolled) */\n defaultView?: ScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting (overrides `DatesProvider`) */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked in DayView/WeekView */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n }) => void;\n\n /** Called when all-day slot is clicked in DayView/WeekView */\n onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Called when a day is clicked in MonthView and YearView */\n onDayClick?: (date: DateStringValue, event: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void;\n\n /** Called when event is clicked in any view */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** Interaction mode:\n * - `'default'` allows all interactions\n * - `'static'` disables event interactions\n * @default 'default' */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */\n onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void;\n\n /** If true, events can be resized by dragging their edges @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called while an event is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. */\n canDropEvent?: (data: ScheduleCanDropEventData) => boolean;\n\n /** Called while an external item is dragged over a target to compute live feedback and again before the drop is committed, return `false` to reject the drop. Must be pure and cheap. Only `dataTransfer.types` can be read while the drag is in progress. */\n canDropExternalEvent?: (data: ScheduleCanDropExternalEventData) => boolean;\n\n /** Called on every pointer move while an event is resized to compute live feedback and again before the resize is committed, return `false` to reject the new size. Must be pure and cheap. */\n canResizeEventTo?: (data: ScheduleCanResizeEventToData) => boolean;\n\n /** If set, drops and resizes that would make the event overlap another event are rejected. Pass a function to decide per pair of events: return `true` to forbid the overlap. The function runs while dragging and resizing to compute live feedback, it must be pure and cheap. @default false */\n preventEventOverlap?: PreventEventOverlap;\n\n /** Called when a drop or resize is rejected */\n onEventPlacementRejected?: (data: ScheduleEventPlacementRejectedData) => void;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day`, `week` and `month` views only – `YearView` and the `MobileMonthView` used by `layout=\"responsive\"` on small screens do not render background events at all. Combined with `withEventResize`, timed background events in `day` and `week` views can also be resized by dragging their edges. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances per recurring series @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Layout mode:\n * - `'default'` uses same views on all screen sizes\n * - `'responsive'` switches to YearView/MobileMonthView on small screens\n * @default 'default' */\n layout?: ScheduleLayout;\n\n /** Props specific to DayView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n dayViewProps?: ScheduleViewProps<DayViewProps>;\n\n /** Props specific to WeekView (includes `startTime`, `endTime`, `intervalMinutes`, etc.) */\n weekViewProps?: ScheduleViewProps<WeekViewProps>;\n\n /** Props specific to MonthView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n monthViewProps?: ScheduleViewProps<MonthViewProps>;\n\n /** Props specific to YearView (includes `firstDayOfWeek`, `weekendDays`, etc.) */\n yearViewProps?: ScheduleViewProps<YearViewProps>;\n\n /** Props specific to MobileMonthView (used in responsive layout). `weekendDays` and `withWeekendDays` default to the values set in `monthViewProps`. */\n mobileMonthViewProps?: ScheduleViewProps<MobileMonthViewProps>;\n\n /** If set, displays an Agenda button in the header of DayView, WeekView and MonthView @default false */\n withAgenda?: boolean;\n}\n\nexport type ScheduleFactory = Factory<{\n props: ScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ScheduleProps> = {\n defaultView: 'week',\n mode: 'default',\n layout: 'default',\n};\n\nexport const Schedule = factory<ScheduleFactory>((_props) => {\n const props = useProps('Schedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n canDropEvent,\n canDropExternalEvent,\n canResizeEventTo,\n preventEventOverlap,\n onEventPlacementRejected,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n layout,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n yearViewProps,\n mobileMonthViewProps,\n withAgenda,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ScheduleFactory>({\n name: __staticSelector || 'Schedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n _setView(newView);\n onViewChange?.(newView);\n };\n\n const handleMonthClick = (monthDate: DateStringValue) => {\n handleDateChange(monthDate);\n handleViewChange('month');\n };\n\n const commonProps = {\n date: _date,\n onDateChange: handleDateChange,\n view: _view,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onAllDaySlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize: mode === 'static' ? false : withEventResize,\n onEventResize,\n canResizeEvent,\n recurrenceExpansionLimit,\n mode,\n withAgenda,\n };\n\n const dropValidationProps = {\n canDropEvent,\n canDropExternalEvent,\n preventEventOverlap,\n onEventPlacementRejected,\n };\n\n const placementValidationProps = { ...dropValidationProps, canResizeEventTo };\n\n const desktopContent = (() => {\n switch (_view) {\n case 'day':\n return (\n <DayView\n {...commonProps}\n {...placementValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <WeekView\n {...commonProps}\n {...placementValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <MonthView\n {...commonProps}\n {...dropValidationProps}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...monthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n const mobileContent = (() => {\n switch (_view) {\n case 'day':\n case 'week':\n case 'month':\n return (\n <MobileMonthView\n date={_date}\n onDateChange={handleDateChange}\n events={events}\n locale={locale}\n radius={radius}\n labels={labels}\n mode={mode}\n recurrenceExpansionLimit={recurrenceExpansionLimit}\n onYearClick={() => handleViewChange('year')}\n onEventClick={onEventClick}\n weekendDays={monthViewProps?.weekendDays}\n withWeekendDays={monthViewProps?.withWeekendDays}\n {...mobileMonthViewProps}\n />\n );\n case 'year':\n return <YearView {...commonProps} onMonthClick={handleMonthClick} {...yearViewProps} />;\n default:\n return null;\n }\n })();\n\n if (layout === 'responsive') {\n return (\n <Box {...getStyles('root')} mod={[{ layout }, mod]} {...others}>\n <Box {...getStyles('desktopView')}>{desktopContent}</Box>\n <Box {...getStyles('mobileView')}>{mobileContent}</Box>\n </Box>\n );\n }\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {desktopContent}\n </Box>\n );\n});\n\nSchedule.displayName = '@mantine/schedule/Schedule';\nSchedule.classes = classes;\n\nexport namespace Schedule {\n export type Props = ScheduleProps;\n export type StylesNames = ScheduleStylesNames;\n export type Factory = ScheduleFactory;\n export type Layout = ScheduleLayout;\n}\n"],"mappings":";;;;;;;;;;;AAiPA,MAAM,eAAuC;CAC3C,aAAa;CACb,MAAM;CACN,QAAQ;AACV;AAEA,MAAa,YAAA,GAAWA,cAAAA,QAAAA,EAA0B,WAAW;CAC3D,MAAM,SAAA,GAAQC,cAAAA,SAAAA,CAAS,YAAY,cAAc,MAAM;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,mBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,cACA,sBACA,kBACA,qBACA,0BACA,iCACA,0BACA,MACA,QACA,cACA,eACA,gBACA,eACA,sBACA,YACA,kBACA,KACA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GAAI;EACvC,UAAA;CACE,CAAA;AAET,CAAC;AAED,SAAS,cAAc;AACvB,SAAS,UAAUC,wBAAAA"}
|
|
@@ -3,11 +3,13 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
|
3
3
|
const require_labels = require("../../labels.cjs");
|
|
4
4
|
const require_format_date = require("../../utils/format-date/format-date.cjs");
|
|
5
5
|
const require_get_week_number = require("../../utils/get-week-number/get-week-number.cjs");
|
|
6
|
+
const require_clamp_interval_minutes = require("../../utils/clamp-interval-minutes/clamp-interval-minutes.cjs");
|
|
6
7
|
const require_get_day_time_intervals = require("../../utils/get-day-time-intervals/get-day-time-intervals.cjs");
|
|
7
8
|
const require_to_date_string = require("../../utils/to-date-string/to-date-string.cjs");
|
|
8
9
|
const require_get_week_days = require("../../utils/get-week-days/get-week-days.cjs");
|
|
9
10
|
const require_next_week = require("../../utils/next-week/next-week.cjs");
|
|
10
11
|
const require_previous_week = require("../../utils/previous-week/previous-week.cjs");
|
|
12
|
+
const require_get_slot_label_groups = require("../../utils/get-slot-label-groups/get-slot-label-groups.cjs");
|
|
11
13
|
const require_is_all_day_event = require("../../utils/is-all-day-event/is-all-day-event.cjs");
|
|
12
14
|
const require_get_day_position = require("../../utils/get-day-position/get-day-position.cjs");
|
|
13
15
|
const require_get_time_axis_event_style = require("../../utils/get-time-axis-event-style/get-time-axis-event-style.cjs");
|
|
@@ -44,6 +46,7 @@ const defaultProps = {
|
|
|
44
46
|
startTime: "00:00:00",
|
|
45
47
|
endTime: "23:59:59",
|
|
46
48
|
slotLabelFormat: "HH:mm",
|
|
49
|
+
slotLabelInterval: 60,
|
|
47
50
|
intervalMinutes: 60,
|
|
48
51
|
withSubHourGridLines: true,
|
|
49
52
|
weekdayFormat: "ddd",
|
|
@@ -65,11 +68,13 @@ const defaultProps = {
|
|
|
65
68
|
const varsResolver = (0, _mantine_core.createVarsResolver)((_theme, { radius, allDaySlotHeight, slotHeight }) => ({ weekView: {
|
|
66
69
|
"--week-view-radius": radius !== void 0 ? (0, _mantine_core.getRadius)(radius) : void 0,
|
|
67
70
|
"--week-view-all-day-slots-height": (0, _mantine_core.rem)(allDaySlotHeight),
|
|
68
|
-
"--week-view-slot-height": (0, _mantine_core.rem)(slotHeight)
|
|
71
|
+
"--week-view-slot-height": (0, _mantine_core.rem)(slotHeight),
|
|
72
|
+
"--week-view-business-hours-bg": void 0,
|
|
73
|
+
"--week-view-non-business-hours-bg": void 0
|
|
69
74
|
} }));
|
|
70
75
|
const WeekView = (0, _mantine_core.factory)((_props) => {
|
|
71
76
|
const props = (0, _mantine_core.useProps)("WeekView", defaultProps, _props);
|
|
72
|
-
const { classNames, className, style, styles, unstyled, attributes, vars, startTime, endTime, date, onDateChange, intervalMinutes, withSubHourGridLines, slotLabelFormat, withWeekendDays, eventOverlapMode, eventOverlapRaiseDelay, weekendDays, firstDayOfWeek, weekdayFormat, radius, highlightToday, withCurrentTimeIndicator, forceCurrentTimeIndicator, getCurrentTime, scrollAreaProps, locale, withWeekNumber, withCurrentTimeBubble, withAllDaySlots, __staticSelector, withHeader, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, weekLabelFormat, events, allDaySlotHeight, slotHeight, labels, highlightBusinessHours, businessHours, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, renderWeekLabel, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, canDropEvent, canDropExternalEvent, canResizeEventTo, preventEventOverlap, onEventPlacementRejected, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
|
|
77
|
+
const { classNames, className, style, styles, unstyled, attributes, vars, startTime, endTime, date, onDateChange, intervalMinutes, withSubHourGridLines, slotLabelFormat, slotLabelInterval, withWeekendDays, eventOverlapMode, eventOverlapRaiseDelay, weekendDays, firstDayOfWeek, weekdayFormat, radius, highlightToday, withCurrentTimeIndicator, forceCurrentTimeIndicator, getCurrentTime, scrollAreaProps, locale, withWeekNumber, withCurrentTimeBubble, withAllDaySlots, __staticSelector, withHeader, onViewChange, previousControlProps, nextControlProps, todayControlProps, viewSelectProps, weekLabelFormat, events, allDaySlotHeight, slotHeight, labels, highlightBusinessHours, businessHours, renderEventBody, renderEvent, withEventsDragAndDrop, onEventDrop, canDragEvent, eventDragInterval, onEventDragStart, onEventDragEnd, onTimeSlotClick, onAllDaySlotClick, onEventClick, withInteractiveBackgroundEvents, withDragSlotSelect, onSlotDragEnd, mode, startScrollTime, renderWeekLabel, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, canDropEvent, canDropExternalEvent, canResizeEventTo, preventEventOverlap, onEventPlacementRejected, eventResizeInterval, recurrenceExpansionLimit, getTimeSlotProps, withAgenda, ...others } = props;
|
|
73
78
|
const [agendaOpen, setAgendaOpen] = (0, react.useState)(false);
|
|
74
79
|
const getStyles = (0, _mantine_core.useStyles)({
|
|
75
80
|
name: __staticSelector,
|
|
@@ -102,7 +107,8 @@ const WeekView = (0, _mantine_core.factory)((_props) => {
|
|
|
102
107
|
const slots = require_get_day_time_intervals.getDayTimeIntervals({
|
|
103
108
|
startTime,
|
|
104
109
|
endTime,
|
|
105
|
-
intervalMinutes
|
|
110
|
+
intervalMinutes,
|
|
111
|
+
labelIntervalMinutes: slotLabelInterval
|
|
106
112
|
});
|
|
107
113
|
const weekdays = require_get_week_days.getWeekDays({
|
|
108
114
|
week: date,
|
|
@@ -273,28 +279,32 @@ const WeekView = (0, _mantine_core.factory)((_props) => {
|
|
|
273
279
|
withWeekendDays,
|
|
274
280
|
eventOverlapMode
|
|
275
281
|
});
|
|
276
|
-
const timeValues = slots.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const label = require_format_date.formatDate({
|
|
280
|
-
date: intervalTime,
|
|
282
|
+
const timeValues = require_get_slot_label_groups.getSlotLabelGroups(slots).map((group) => {
|
|
283
|
+
const label = group.isLabelStart ? require_format_date.formatDate({
|
|
284
|
+
date: (0, dayjs.default)(`${(0, dayjs.default)(date).format("YYYY-MM-DD")} ${group.startTime}`),
|
|
281
285
|
locale: ctx.getLocale(locale),
|
|
282
286
|
format: slotLabelFormat
|
|
287
|
+
}) : null;
|
|
288
|
+
const labelBusinessHours = require_get_business_hours_mod.getBusinessHoursState({
|
|
289
|
+
time: group.startTime,
|
|
290
|
+
endTime: group.endTime,
|
|
291
|
+
businessHours,
|
|
292
|
+
highlightBusinessHours
|
|
283
293
|
});
|
|
284
|
-
|
|
294
|
+
return /* @__PURE__ */ (0, react.createElement)(_mantine_core.Box, {
|
|
285
295
|
...getStyles("weekViewSlotLabel"),
|
|
286
|
-
key:
|
|
296
|
+
key: group.startTime,
|
|
287
297
|
mod: {
|
|
288
|
-
"hour-start":
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
298
|
+
"hour-start": group.isHourStart,
|
|
299
|
+
"sub-hour": !group.isHourStart,
|
|
300
|
+
...labelBusinessHours.mod
|
|
301
|
+
},
|
|
302
|
+
__vars: {
|
|
303
|
+
...labelBusinessHours.vars,
|
|
304
|
+
"--slot-label-size": `${group.slotsCount * require_clamp_interval_minutes.clampIntervalMinutes(intervalMinutes) / 60}`
|
|
294
305
|
}
|
|
295
|
-
}, label)
|
|
296
|
-
|
|
297
|
-
}, []);
|
|
306
|
+
}, label);
|
|
307
|
+
});
|
|
298
308
|
const slotsRef = (0, react.useRef)([]);
|
|
299
309
|
const allDaySlotsRef = (0, react.useRef)([]);
|
|
300
310
|
const weekdaysRef = (0, react.useRef)([]);
|