Skip to content

Commit ed5596c

Browse files
committed
scrollBar toggle in calendar
1 parent 8a56c37 commit ed5596c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ let childrenMap: any = {
9696
currentFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
9797
currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"),
9898
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
99+
showVerticalScrollbar: withDefault(BoolControl, false),
99100
};
100101
// this should ensure backwards compatibility with older versions of the SDK
101102
if (DragEventHandlerControl) {
@@ -134,6 +135,7 @@ let CalendarBasicComp = (function () {
134135
currentPremiumView?: string;
135136
animationStyle?:any;
136137
modalStyle?:any
138+
showVerticalScrollbar?:boolean
137139

138140
}, dispatch: any) => {
139141

@@ -261,6 +263,7 @@ let CalendarBasicComp = (function () {
261263
licenseKey,
262264
resourceName,
263265
modalStyle,
266+
showVerticalScrollbar
264267
} = props;
265268

266269
function renderEventContent(eventInfo: EventContentArg) {
@@ -626,6 +629,7 @@ let CalendarBasicComp = (function () {
626629
$editable={editable}
627630
$style={style}
628631
$theme={theme?.theme}
632+
$showVerticalScrollbar={showVerticalScrollbar}
629633
onDoubleClick={handleDbClick}
630634
$left={left}
631635
key={initialDate ? currentView + initialDate : currentView}
@@ -756,6 +760,7 @@ let CalendarBasicComp = (function () {
756760
animationStyle: { getPropertyView: () => any; };
757761
modalStyle: { getPropertyView: () => any; };
758762
licenseKey: { getView: () => any; propertyView: (arg0: { label: string; }) => any; };
763+
showVerticalScrollbar: { propertyView: (arg0: { label: string; }) => any; };
759764
}) => {
760765

761766
const license = children.licenseKey.getView();
@@ -796,6 +801,7 @@ let CalendarBasicComp = (function () {
796801
? children.currentFreeView.propertyView({ label: trans("calendar.defaultView"), tooltip: trans("calendar.defaultViewTooltip"), })
797802
: children.currentPremiumView.propertyView({ label: trans("calendar.defaultView"), tooltip: trans("calendar.defaultViewTooltip"), })}
798803
{children.firstDay.propertyView({ label: trans("calendar.startWeek"), })}
804+
{children.showVerticalScrollbar.propertyView({ label: trans("calendar.showVerticalScrollbar")})}
799805
</Section>
800806
<Section name={sectionNames.style}>
801807
{children.style.getPropertyView()}

client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const Wrapper = styled.div<{
3232
$style?: CalendarStyleType;
3333
$theme?: ThemeDetail;
3434
$left?: number;
35+
$showVerticalScrollbar?:boolean;
3536
}>`
3637
position: relative;
3738
height: 100%;
@@ -359,6 +360,9 @@ export const Wrapper = styled.div<{
359360
.fc .fc-scrollgrid table {
360361
width: 100% !important;
361362
}
363+
.fc-scroller.fc-scroller-liquid-absolute::-webkit-scrollbar {
364+
display:${(props) => (props.$showVerticalScrollbar ? 'block' : 'none')};
365+
}
362366
363367
// event
364368
.fc-timegrid-event .fc-event-main {

client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ export const en = {
341341
animationType:"Type",
342342
animationDelay:"Delay",
343343
animationDuration:"Duration",
344-
animationIterationCount:"IterationCount"
344+
animationIterationCount:"IterationCount",
345+
showVerticalScrollbar:"Show Vertical ScrollBar"
345346
},
346347
};
347348

0 commit comments

Comments
 (0)