|
| 1 | +import { |
| 2 | + isValidColor, |
| 3 | + NameConfig, |
| 4 | + NameConfigHidden, |
| 5 | + BoolControl, |
| 6 | + UICompBuilder, |
| 7 | + withDefault, |
| 8 | + withExposingConfigs, |
| 9 | + NumberControl, |
| 10 | + StringControl, |
| 11 | + hiddenPropertyView, |
| 12 | + ChangeEventHandlerControl, |
| 13 | + Section, |
| 14 | + sectionNames, |
| 15 | + dropdownControl, |
| 16 | + styleControl, |
| 17 | + ThemeContext, |
| 18 | + CalendarStyle, |
| 19 | + DateParser, |
| 20 | + CustomModal, |
| 21 | + jsonValueExposingStateControl, |
| 22 | + CalendarDeleteIcon, |
| 23 | + Tooltip, |
| 24 | +} from "lowcoder-sdk"; |
| 25 | +import { trans, getCalendarLocale } from "../../i18n/comps"; |
| 26 | +import { |
| 27 | + DefaultWithFreeViewOptions, |
| 28 | + DefaultWithPremiumViewOptions, |
| 29 | + FirstDayOptions, |
| 30 | +} from "./calendarConstants"; |
| 31 | + |
| 32 | +import AgoraRTC, { |
| 33 | + type ICameraVideoTrack, |
| 34 | + type IMicrophoneAudioTrack, |
| 35 | + type IAgoraRTCClient, |
| 36 | + type IAgoraRTCRemoteUser, |
| 37 | + type UID, |
| 38 | + type ILocalVideoTrack, |
| 39 | +} from "agora-rtc-sdk-ng"; |
| 40 | +import type { RtmChannel, RtmClient } from "agora-rtm-sdk"; |
| 41 | + |
| 42 | +const childrenMap = { |
| 43 | + |
| 44 | +}; |
| 45 | + |
| 46 | +let CalendarBasicComp = (function () { |
| 47 | + return new UICompBuilder(childrenMap, (props) => { |
| 48 | + |
| 49 | + }) |
| 50 | + .setPropertyViewFn((children) => { |
| 51 | + let licence = children.licenceKey.getView(); |
| 52 | + return ( |
| 53 | + <> |
| 54 | + <Section name={sectionNames.basic}> |
| 55 | + {children.events.propertyView({})} |
| 56 | + </Section> |
| 57 | + <Section name={sectionNames.interaction}> |
| 58 | + {children.licenceKey.propertyView({ |
| 59 | + label: trans("calendar.licence"), |
| 60 | + })} |
| 61 | + {children.onEvent.getPropertyView()} |
| 62 | + </Section> |
| 63 | + <Section name={sectionNames.advanced}> |
| 64 | + {children.editable.propertyView({ |
| 65 | + label: trans("calendar.editable"), |
| 66 | + })} |
| 67 | + {children.defaultDate.propertyView({ |
| 68 | + label: trans("calendar.defaultDate"), |
| 69 | + tooltip: trans("calendar.defaultDateTooltip"), |
| 70 | + })} |
| 71 | + {licence == "" |
| 72 | + ? children.defaultFreeView.propertyView({ |
| 73 | + label: trans("calendar.defaultView"), |
| 74 | + tooltip: trans("calendar.defaultViewTooltip"), |
| 75 | + }) |
| 76 | + : children.defaultPremiumView.propertyView({ |
| 77 | + label: trans("calendar.defaultView"), |
| 78 | + tooltip: trans("calendar.defaultViewTooltip"), |
| 79 | + })} |
| 80 | + {children.firstDay.propertyView({ |
| 81 | + label: trans("calendar.startWeek"), |
| 82 | + })} |
| 83 | + {children.showEventTime.propertyView({ |
| 84 | + label: trans("calendar.showEventTime"), |
| 85 | + tooltip: trans("calendar.showEventTimeTooltip"), |
| 86 | + })} |
| 87 | + {children.showWeekends.propertyView({ |
| 88 | + label: trans("calendar.showWeekends"), |
| 89 | + })} |
| 90 | + {children.showAllDay.propertyView({ |
| 91 | + label: trans("calendar.showAllDay"), |
| 92 | + tooltip: trans("calendar.showAllDayTooltip"), |
| 93 | + })} |
| 94 | + {children.dayMaxEvents.propertyView({ |
| 95 | + label: trans("calendar.dayMaxEvents"), |
| 96 | + tooltip: trans("calendar.dayMaxEventsTooltip"), |
| 97 | + })} |
| 98 | + {children.eventMaxStack.propertyView({ |
| 99 | + label: trans("calendar.eventMaxStack"), |
| 100 | + tooltip: trans("calendar.eventMaxStackTooltip"), |
| 101 | + })} |
| 102 | + </Section> |
| 103 | + <Section name={sectionNames.layout}> |
| 104 | + {hiddenPropertyView(children)} |
| 105 | + </Section> |
| 106 | + <Section name={sectionNames.style}> |
| 107 | + {children.style.getPropertyView()} |
| 108 | + </Section> |
| 109 | + </> |
| 110 | + ); |
| 111 | + }) |
| 112 | + .build(); |
| 113 | +})(); |
| 114 | + |
| 115 | +CalendarBasicComp = class extends CalendarBasicComp { |
| 116 | + override autoHeight(): boolean { |
| 117 | + return false; |
| 118 | + } |
| 119 | +}; |
| 120 | + |
| 121 | +export const CalendarComp = withExposingConfigs(CalendarBasicComp, [ |
| 122 | + new NameConfig("events", trans("calendar.events")), |
| 123 | + NameConfigHidden, |
| 124 | +]); |
0 commit comments