@monolith-forensics/monolith-ui 1.8.1-dev.2 → 1.8.1-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Calendar/Calendar.d.ts +4 -1
- package/dist/Calendar/Calendar.js +126 -50
- package/dist/Calendar/CalendarStyles.d.ts +3 -2
- package/dist/Calendar/CalendarStyles.js +62 -23
- package/dist/Calendar/calendarHelpers.d.ts +1 -1
- package/dist/CheckBox/CheckBox.js +35 -4
- package/dist/DropDownMenu/DropDownMenu.js +25 -15
- package/dist/DropDownMenu/components/MenuComponent.js +6 -1
- package/dist/DropDownMenu/components/MenuItem.js +6 -0
- package/dist/DropDownMenu/components/MenuItemList.d.ts +2 -0
- package/dist/DropDownMenu/components/MenuItemList.js +94 -13
- package/dist/DropDownMenu/components/StyledContent.js +1 -2
- package/dist/DropDownMenu/types.d.ts +1 -0
- package/dist/FileViewer/viewers/ImageViewer.js +75 -18
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +1 -0
- package/dist/QueryFilter/QueryFilter.constants.d.ts +134 -0
- package/dist/QueryFilter/QueryFilter.constants.js +39 -0
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +3 -303
- package/dist/QueryFilter/QueryFilter.lib.d.ts +14 -0
- package/dist/QueryFilter/QueryFilter.lib.js +84 -0
- package/dist/QueryFilter/QueryFilter.styled.d.ts +89 -0
- package/dist/QueryFilter/QueryFilter.styled.js +184 -0
- package/dist/QueryFilter/{types.d.ts → QueryFilter.types.d.ts} +11 -2
- package/dist/QueryFilter/components/MultiSelectEditor.d.ts +7 -0
- package/dist/QueryFilter/components/MultiSelectEditor.js +44 -0
- package/dist/QueryFilter/components/RuleChip.d.ts +8 -0
- package/dist/QueryFilter/components/RuleChip.js +37 -0
- package/dist/QueryFilter/components/Rules.d.ts +11 -0
- package/dist/QueryFilter/components/Rules.js +41 -0
- package/dist/QueryFilter/components/UnavailableRuleChip.d.ts +5 -0
- package/dist/QueryFilter/components/UnavailableRuleChip.js +7 -0
- package/dist/QueryFilter/components/ValueEditor.d.ts +7 -0
- package/dist/QueryFilter/components/ValueEditor.js +45 -0
- package/dist/QueryFilter/components/ValueSelector.d.ts +7 -0
- package/dist/QueryFilter/components/ValueSelector.js +34 -0
- package/dist/QueryFilter/components/index.d.ts +6 -0
- package/dist/QueryFilter/components/index.js +6 -0
- package/dist/QueryFilter/index.d.ts +3 -2
- package/dist/QueryFilter/index.js +3 -2
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +23 -19
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +5 -15
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.d.ts +3 -0
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +241 -0
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +15 -0
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +115 -51
- package/dist/RichTextEditor/Plugins/index.d.ts +1 -0
- package/dist/RichTextEditor/Plugins/index.js +1 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/dist/RichTextEditor/RichTextEditor.js +309 -35
- package/dist/RichTextEditor/Toolbar/Toolbar.js +14 -2
- package/dist/SuperDatePicker/SuperDatePicker.constants.d.ts +24 -0
- package/dist/SuperDatePicker/SuperDatePicker.constants.js +30 -0
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +3 -0
- package/dist/SuperDatePicker/SuperDatePicker.js +31 -0
- package/dist/SuperDatePicker/SuperDatePicker.lib.d.ts +17 -0
- package/dist/SuperDatePicker/SuperDatePicker.lib.js +206 -0
- package/dist/SuperDatePicker/SuperDatePicker.styled.d.ts +60 -0
- package/dist/SuperDatePicker/SuperDatePicker.styled.js +256 -0
- package/dist/SuperDatePicker/SuperDatePicker.types.d.ts +48 -0
- package/dist/SuperDatePicker/SuperDatePicker.types.js +1 -0
- package/dist/SuperDatePicker/components/CommonPresetGroups.d.ts +7 -0
- package/dist/SuperDatePicker/components/CommonPresetGroups.js +6 -0
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.d.ts +10 -0
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.js +9 -0
- package/dist/SuperDatePicker/components/EndpointDateInput.d.ts +16 -0
- package/dist/SuperDatePicker/components/EndpointDateInput.js +26 -0
- package/dist/SuperDatePicker/components/EndpointPopover.d.ts +18 -0
- package/dist/SuperDatePicker/components/EndpointPopover.js +11 -0
- package/dist/SuperDatePicker/components/QuickRangeDropdown.d.ts +14 -0
- package/dist/SuperDatePicker/components/QuickRangeDropdown.js +19 -0
- package/dist/SuperDatePicker/components/QuickRangePopover.d.ts +18 -0
- package/dist/SuperDatePicker/components/QuickRangePopover.js +12 -0
- package/dist/SuperDatePicker/components/index.d.ts +6 -0
- package/dist/SuperDatePicker/components/index.js +6 -0
- package/dist/SuperDatePicker/index.d.ts +3 -0
- package/dist/SuperDatePicker/index.js +3 -0
- package/dist/SuperDatePicker/useSuperDatePicker.d.ts +32 -0
- package/dist/SuperDatePicker/useSuperDatePicker.js +125 -0
- package/dist/Table/ColumnResizer.d.ts +6 -9
- package/dist/Table/ColumnResizer.js +30 -10
- package/dist/Table/TableComponents.js +14 -10
- package/dist/Table/TableHeader.js +31 -16
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +91 -4
- package/dist/Table/TableRow.js +19 -12
- package/dist/Table/Utils/index.d.ts +0 -1
- package/dist/Table/Utils/index.js +0 -1
- package/dist/Table/types.d.ts +6 -19
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/theme/variants.js +2 -0
- package/package.json +22 -18
- package/dist/QueryFilter/DefaultOperators.d.ts +0 -76
- package/dist/QueryFilter/DefaultOperators.js +0 -21
- package/dist/Table/Utils/resizeHandler.d.ts +0 -3
- package/dist/Table/Utils/resizeHandler.js +0 -84
- /package/dist/QueryFilter/{types.js → QueryFilter.types.js} +0 -0
|
@@ -9,9 +9,12 @@ interface CalendarProps {
|
|
|
9
9
|
clearable?: boolean;
|
|
10
10
|
min?: Date;
|
|
11
11
|
max?: Date;
|
|
12
|
+
timeIntervalMinutes?: number;
|
|
13
|
+
minuteStep?: number;
|
|
14
|
+
timeZoneLabel?: string;
|
|
12
15
|
}
|
|
13
16
|
declare const Calendar: {
|
|
14
|
-
({ defaultValue, value, onChange, hourFormat, includeTime, clearable, min, max, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
({ defaultValue, value, onChange, hourFormat, includeTime, clearable, min, max, timeIntervalMinutes, minuteStep, timeZoneLabel, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
15
18
|
displayName: string;
|
|
16
19
|
};
|
|
17
20
|
export default Calendar;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Fragment, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
4
|
-
import { CalendarContainer, CalendarHeader, CalendarHeaderControls, CalendarHeaderSelect, CalendarNavButton, CalendarGrid, CalendarMonth, CalendarDay, CalendarDate, HighlightedCalendarDate, TodayCalendarDate, TimeContainer, MainContainer, TimePickerContainer,
|
|
4
|
+
import { CalendarContainer, CalendarHeader, CalendarHeaderControls, CalendarHeaderSelect, CalendarNavButton, CalendarGrid, CalendarMonth, CalendarDay, CalendarDate, HighlightedCalendarDate, TodayCalendarDate, TimeContainer, MainContainer, TimePickerContainer, TimeHeader, TimeHeaderValue, TimeItem, TimeItemActive, TimeSelectList, TimeZoneBadge, NoValueButton, } from "./CalendarStyles";
|
|
5
5
|
import { DropDownMenu } from "../DropDownMenu";
|
|
6
|
-
import calendar, { createLocalDate, isDate, isSameDay, isSameMonth, getDateISO, getMonthDays, getNextMonth, getPreviousMonth, WEEK_DAYS, CALENDAR_MONTHS,
|
|
6
|
+
import calendar, { createLocalDate, isDate, isSameDay, isSameMonth, getDateISO, getMonthDays, getNextMonth, getPreviousMonth, WEEK_DAYS, CALENDAR_MONTHS, } from "./calendarHelpers";
|
|
7
7
|
import moment from "moment";
|
|
8
8
|
const checkValidRange = (value, min, max) => {
|
|
9
9
|
if (min && moment(value).startOf("day").isBefore(moment(min).startOf("day")))
|
|
@@ -25,8 +25,10 @@ const MONTH_OPTIONS = Object.keys(CALENDAR_MONTHS).map((monthName, index) => ({
|
|
|
25
25
|
label: monthName,
|
|
26
26
|
value: index + 1,
|
|
27
27
|
}));
|
|
28
|
-
const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hourFormat = "24", includeTime = true, clearable = true, min, max, }) => {
|
|
28
|
+
const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hourFormat = "24", includeTime = true, clearable = true, min, max, timeIntervalMinutes, minuteStep = 1, timeZoneLabel = "Local", }) => {
|
|
29
29
|
const isControlled = useRef(value !== undefined);
|
|
30
|
+
const activeTimeRef = useRef(null);
|
|
31
|
+
const hasScrolledInitialTimeIntoView = useRef(false);
|
|
30
32
|
const [valueState, setValueState] = useState(defaultValue);
|
|
31
33
|
const _value = isControlled.current
|
|
32
34
|
? value
|
|
@@ -38,6 +40,36 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
38
40
|
let pressureTimer;
|
|
39
41
|
let pressureTimeout;
|
|
40
42
|
let dayTimeout;
|
|
43
|
+
const normalizedTimeInterval = Math.max(1, Math.min(1440, timeIntervalMinutes || minuteStep || 1));
|
|
44
|
+
const selectedMinutesOfDay = calendarState.hours * 60 + calendarState.minutes;
|
|
45
|
+
const timeOptions = useMemo(() => {
|
|
46
|
+
const steppedTimes = Array.from({ length: Math.ceil(1440 / normalizedTimeInterval) }, (_, index) => index * normalizedTimeInterval).filter((minutesOfDay) => minutesOfDay < 1440);
|
|
47
|
+
if (!steppedTimes.includes(selectedMinutesOfDay)) {
|
|
48
|
+
steppedTimes.push(selectedMinutesOfDay);
|
|
49
|
+
}
|
|
50
|
+
return steppedTimes
|
|
51
|
+
.sort((a, b) => a - b)
|
|
52
|
+
.map((minutesOfDay) => {
|
|
53
|
+
const hours = Math.floor(minutesOfDay / 60);
|
|
54
|
+
const minutes = minutesOfDay % 60;
|
|
55
|
+
return {
|
|
56
|
+
value: minutesOfDay,
|
|
57
|
+
hours,
|
|
58
|
+
minutes,
|
|
59
|
+
label: `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}, [normalizedTimeInterval, selectedMinutesOfDay]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
var _a;
|
|
65
|
+
if (!includeTime || hasScrolledInitialTimeIntoView.current)
|
|
66
|
+
return;
|
|
67
|
+
(_a = activeTimeRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
68
|
+
block: "center",
|
|
69
|
+
inline: "nearest",
|
|
70
|
+
});
|
|
71
|
+
hasScrolledInitialTimeIntoView.current = true;
|
|
72
|
+
}, [includeTime]);
|
|
41
73
|
const syncCalendarState = (date) => {
|
|
42
74
|
setCalendarState({
|
|
43
75
|
month: +date.getMonth() + 1,
|
|
@@ -110,13 +142,15 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
110
142
|
const { month, year } = calendarState;
|
|
111
143
|
const monthName = Object.keys(CALENDAR_MONTHS)[Math.max(0, Math.min(month - 1, 11))];
|
|
112
144
|
const yearOptions = getYearOptions();
|
|
113
|
-
|
|
114
|
-
|
|
145
|
+
const selectedMonthOption = MONTH_OPTIONS.find((option) => option.value === month);
|
|
146
|
+
const selectedYearOption = yearOptions.find((option) => option.value === year);
|
|
147
|
+
return (_jsxs(CalendarHeader, { children: [_jsx(CalendarNavButton, { type: "button", onClick: handlePrevious, onMouseUp: clearPressureTimer, "aria-label": "Go to previous month", title: "Previous month. Hold Shift to jump by year.", children: _jsx(ChevronLeftIcon, { "aria-hidden": "true" }) }), _jsxs(CalendarHeaderControls, { children: [_jsx(CalendarHeaderSelect, { children: _jsx(DropDownMenu, { data: MONTH_OPTIONS, value: selectedMonthOption ? [selectedMonthOption] : [], variant: "outlined", size: "xs", arrow: true, onItemSelect: (item) => commitMonthOrYearSelection(Number(item.value), year, "month"), dropDownProps: {
|
|
148
|
+
style: { maxHeight: 260, width: 125 },
|
|
115
149
|
}, buttonProps: {
|
|
116
150
|
title: "Select month",
|
|
117
151
|
size: "xxs",
|
|
118
152
|
style: { minWidth: 95 },
|
|
119
|
-
}, children: _jsx(CalendarMonth, { children: monthName }) }) }), _jsx(CalendarHeaderSelect, { children: _jsx(DropDownMenu, { data: yearOptions, variant: "outlined", size: "xs", arrow: true, searchable: true, onItemSelect: (item) => commitMonthOrYearSelection(month, Number(item.value), "year"), dropDownProps: {
|
|
153
|
+
}, children: _jsx(CalendarMonth, { children: monthName }) }) }), _jsx(CalendarHeaderSelect, { children: _jsx(DropDownMenu, { data: yearOptions, value: selectedYearOption ? [selectedYearOption] : [], variant: "outlined", size: "xs", arrow: true, searchable: true, onItemSelect: (item) => commitMonthOrYearSelection(month, Number(item.value), "year"), dropDownProps: {
|
|
120
154
|
style: { width: 120, maxHeight: 260 },
|
|
121
155
|
}, buttonProps: {
|
|
122
156
|
title: "Select year",
|
|
@@ -151,6 +185,10 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
151
185
|
const inMonth = month && year && isSameMonth(_date, createLocalDate(year, month, 1));
|
|
152
186
|
const isDisabled = !checkValidRange(getDateISO(_date), min || null, max || null);
|
|
153
187
|
const ariaCurrent = isToday ? "date" : undefined;
|
|
188
|
+
const handleDisabledAction = (evt) => {
|
|
189
|
+
evt.preventDefault();
|
|
190
|
+
evt.stopPropagation();
|
|
191
|
+
};
|
|
154
192
|
// The click handler
|
|
155
193
|
const props = {
|
|
156
194
|
"data-disabled": isDisabled,
|
|
@@ -160,8 +198,10 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
160
198
|
"aria-pressed": Boolean(isCurrent),
|
|
161
199
|
index,
|
|
162
200
|
key: getDateISO(_date),
|
|
163
|
-
onClick: gotoDate(_date),
|
|
164
|
-
onKeyDown:
|
|
201
|
+
onClick: isDisabled ? handleDisabledAction : gotoDate(_date),
|
|
202
|
+
onKeyDown: isDisabled
|
|
203
|
+
? handleDisabledAction
|
|
204
|
+
: handleActionKeyDown(() => gotoDate(_date)(undefined)),
|
|
165
205
|
role: "button",
|
|
166
206
|
tabIndex: isDisabled ? -1 : 0,
|
|
167
207
|
title: _date.toDateString(),
|
|
@@ -170,49 +210,85 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
170
210
|
// Conditionally render a styled date component
|
|
171
211
|
return isCurrent ? (_jsx(HighlightedCalendarDate, Object.assign({}, props, { children: _date.getDate() }))) : isToday ? (_jsx(TodayCalendarDate, Object.assign({}, props, { children: _date.getDate() }))) : (_jsx(CalendarDate, Object.assign({}, props, { children: _date.getDate() })));
|
|
172
212
|
};
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
.toDate();
|
|
185
|
-
commitDate(newTime, "time");
|
|
186
|
-
}, onKeyDown: handleActionKeyDown(() => {
|
|
187
|
-
const newTime = moment(getWorkingDate())
|
|
188
|
-
.hours(hour.value)
|
|
189
|
-
.minutes(calendarState.minutes)
|
|
190
|
-
.toDate();
|
|
191
|
-
commitDate(newTime, "time");
|
|
192
|
-
}), children: hour.label }, hour.value));
|
|
193
|
-
});
|
|
213
|
+
const isTimeOptionDisabled = (hours, minutes) => {
|
|
214
|
+
const candidate = moment(getWorkingDate())
|
|
215
|
+
.hours(hours)
|
|
216
|
+
.minutes(minutes)
|
|
217
|
+
.seconds(0)
|
|
218
|
+
.milliseconds(0);
|
|
219
|
+
if (min && candidate.isBefore(moment(min)))
|
|
220
|
+
return true;
|
|
221
|
+
if (max && candidate.isAfter(moment(max)))
|
|
222
|
+
return true;
|
|
223
|
+
return false;
|
|
194
224
|
};
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
commitDate(newTime, "time");
|
|
213
|
-
}), children: minute.label }, minute.value));
|
|
225
|
+
const renderTimeOptions = () => {
|
|
226
|
+
return timeOptions.map((timeOption, index) => {
|
|
227
|
+
const isActive = timeOption.value === selectedMinutesOfDay;
|
|
228
|
+
const isDisabled = isTimeOptionDisabled(timeOption.hours, timeOption.minutes);
|
|
229
|
+
const TimeComponent = isActive ? TimeItemActive : TimeItem;
|
|
230
|
+
const commitTime = () => {
|
|
231
|
+
if (isDisabled)
|
|
232
|
+
return;
|
|
233
|
+
const newTime = moment(getWorkingDate())
|
|
234
|
+
.hours(timeOption.hours)
|
|
235
|
+
.minutes(timeOption.minutes)
|
|
236
|
+
.seconds(0)
|
|
237
|
+
.milliseconds(0)
|
|
238
|
+
.toDate();
|
|
239
|
+
commitDate(newTime, "time");
|
|
240
|
+
};
|
|
241
|
+
return (_jsx(TimeComponent, { ref: isActive ? activeTimeRef : undefined, role: "button", tabIndex: isDisabled ? -1 : 0, "data-disabled": isDisabled, "aria-disabled": isDisabled, "aria-label": `Select ${timeOption.label}`, "aria-pressed": isActive, onClick: commitTime, onKeyDown: handleTimeKeyDown(index, commitTime), children: timeOption.label }, timeOption.value));
|
|
214
242
|
});
|
|
215
243
|
};
|
|
244
|
+
const handleTimeKeyDown = (index, selectCurrent) => (evt) => {
|
|
245
|
+
const findEnabledIndex = (nextIndex, direction) => {
|
|
246
|
+
let boundedIndex = Math.max(0, Math.min(timeOptions.length - 1, nextIndex));
|
|
247
|
+
while (boundedIndex >= 0 &&
|
|
248
|
+
boundedIndex < timeOptions.length &&
|
|
249
|
+
isTimeOptionDisabled(timeOptions[boundedIndex].hours, timeOptions[boundedIndex].minutes)) {
|
|
250
|
+
boundedIndex += direction;
|
|
251
|
+
}
|
|
252
|
+
if (boundedIndex < 0 || boundedIndex >= timeOptions.length) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
return boundedIndex;
|
|
256
|
+
};
|
|
257
|
+
const commitOption = (nextIndex, direction) => {
|
|
258
|
+
const enabledIndex = findEnabledIndex(nextIndex, direction);
|
|
259
|
+
if (enabledIndex === null)
|
|
260
|
+
return;
|
|
261
|
+
const nextOption = timeOptions[enabledIndex];
|
|
262
|
+
const newTime = moment(getWorkingDate())
|
|
263
|
+
.hours(nextOption.hours)
|
|
264
|
+
.minutes(nextOption.minutes)
|
|
265
|
+
.seconds(0)
|
|
266
|
+
.milliseconds(0)
|
|
267
|
+
.toDate();
|
|
268
|
+
commitDate(newTime, "time");
|
|
269
|
+
};
|
|
270
|
+
if (evt.key === "Enter" || evt.key === " ") {
|
|
271
|
+
evt.preventDefault();
|
|
272
|
+
selectCurrent();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (evt.key === "ArrowDown") {
|
|
276
|
+
evt.preventDefault();
|
|
277
|
+
commitOption(index + 1, 1);
|
|
278
|
+
}
|
|
279
|
+
if (evt.key === "ArrowUp") {
|
|
280
|
+
evt.preventDefault();
|
|
281
|
+
commitOption(index - 1, -1);
|
|
282
|
+
}
|
|
283
|
+
if (evt.key === "Home") {
|
|
284
|
+
evt.preventDefault();
|
|
285
|
+
commitOption(0, 1);
|
|
286
|
+
}
|
|
287
|
+
if (evt.key === "End") {
|
|
288
|
+
evt.preventDefault();
|
|
289
|
+
commitOption(timeOptions.length - 1, -1);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
216
292
|
// new 2
|
|
217
293
|
const gotoDate = (date) => (evt) => {
|
|
218
294
|
evt && evt.preventDefault();
|
|
@@ -303,7 +379,7 @@ const Calendar = ({ defaultValue = new Date(), value, onChange = () => { }, hour
|
|
|
303
379
|
// const clearDayTimeout = () => {
|
|
304
380
|
// dayTimeout && clearTimeout(dayTimeout);
|
|
305
381
|
// };
|
|
306
|
-
return (_jsxs(MainContainer, { children: [_jsxs(CalendarContainer, { children: [renderMonthAndYear(), _jsxs(CalendarGrid, { role: "grid", "aria-label": `Calendar view for ${Object.keys(CALENDAR_MONTHS)[calendarState.month - 1]} ${calendarState.year}`, children: [_jsx(Fragment, { children: Object.keys(WEEK_DAYS).map(renderDayLabel) }), _jsx(Fragment, { children: getCalendarDates().map(renderCalendarDate) })] }), clearable && (_jsx("div", { style: { textAlign: "center", marginTop: 3 }, children: _jsx(NoValueButton, { type: "button", onClick: () => commitDate(null, "clear"), "aria-label": "Clear selected date", children: "Clear Date" }) }))] }), includeTime && (_jsxs(TimeContainer, { children: [
|
|
382
|
+
return (_jsxs(MainContainer, { children: [_jsxs(CalendarContainer, { children: [renderMonthAndYear(), _jsxs(CalendarGrid, { role: "grid", "aria-label": `Calendar view for ${Object.keys(CALENDAR_MONTHS)[calendarState.month - 1]} ${calendarState.year}`, children: [_jsx(Fragment, { children: Object.keys(WEEK_DAYS).map(renderDayLabel) }), _jsx(Fragment, { children: getCalendarDates().map(renderCalendarDate) })] }), clearable && (_jsx("div", { style: { textAlign: "center", marginTop: 3 }, children: _jsx(NoValueButton, { type: "button", onClick: () => commitDate(null, "clear"), "aria-label": "Clear selected date", children: "Clear Date" }) }))] }), includeTime && (_jsxs(TimeContainer, { children: [_jsxs(TimeHeader, { children: [_jsx(TimeHeaderValue, { children: `${String(calendarState.hours).padStart(2, "0")}:${String(calendarState.minutes).padStart(2, "0")}` }), timeZoneLabel && _jsx(TimeZoneBadge, { children: timeZoneLabel })] }), _jsx(TimePickerContainer, { children: _jsx(TimeSelectList, { children: renderTimeOptions() }) })] }))] }));
|
|
307
383
|
};
|
|
308
384
|
Calendar.displayName = "Calendar";
|
|
309
385
|
export default Calendar;
|
|
@@ -21,8 +21,9 @@ export declare const TodayCalendarDate: import("styled-components/dist/types").I
|
|
|
21
21
|
export declare const TimeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
22
22
|
export declare const TimePickerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
23
|
export declare const TimeHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
24
|
+
export declare const TimeHeaderValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
25
|
+
export declare const TimeZoneBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
26
|
+
export declare const TimeSelectList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
27
|
export declare const TimeItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
27
28
|
export declare const TimeItemActive: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
28
29
|
export declare const NoValueButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
@@ -48,7 +48,9 @@ export const CalendarNavButton = styled.button `
|
|
|
48
48
|
`;
|
|
49
49
|
export const CalendarGrid = styled.div `
|
|
50
50
|
display: grid;
|
|
51
|
-
grid-template: repeat(7, auto) / repeat(7,
|
|
51
|
+
grid-template: repeat(7, auto) / repeat(7, 32px);
|
|
52
|
+
gap: 3px;
|
|
53
|
+
justify-content: center;
|
|
52
54
|
justify-items: center;
|
|
53
55
|
`;
|
|
54
56
|
export const CalendarMonth = styled.div `
|
|
@@ -114,11 +116,18 @@ export const CalendarDate = styled(CalendarCell) `
|
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
&[data-disabled="true"] {
|
|
117
|
-
|
|
118
|
-
color: ${({ theme }) => theme.palette.text.
|
|
119
|
-
|
|
120
|
-
opacity: 0.
|
|
121
|
-
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
121
|
+
|
|
122
|
+
opacity: 0.62;
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
text-decoration: line-through;
|
|
125
|
+
text-decoration-thickness: 1px;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
background: transparent;
|
|
129
|
+
opacity: 0.62;
|
|
130
|
+
}
|
|
122
131
|
}
|
|
123
132
|
`;
|
|
124
133
|
export const HighlightedCalendarDate = styled(CalendarDate) `
|
|
@@ -163,49 +172,67 @@ export const TodayCalendarDate = styled(HighlightedCalendarDate) `
|
|
|
163
172
|
}
|
|
164
173
|
`;
|
|
165
174
|
export const TimeContainer = styled.div `
|
|
175
|
+
position: relative;
|
|
176
|
+
flex: 0 0 132px;
|
|
166
177
|
font-size: 12px;
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
178
|
+
width: 132px;
|
|
179
|
+
height: auto;
|
|
180
|
+
box-sizing: border-box;
|
|
169
181
|
border: 1px solid ${(props) => props.theme.palette.divider};
|
|
170
|
-
border-left: none;
|
|
171
182
|
border-radius: 4px;
|
|
183
|
+
background: ${(props) => props.theme.palette.input.background};
|
|
172
184
|
overflow: hidden;
|
|
173
185
|
`;
|
|
174
186
|
export const TimePickerContainer = styled.div `
|
|
175
187
|
display: flex;
|
|
176
|
-
height:
|
|
188
|
+
height: 238px;
|
|
177
189
|
`;
|
|
178
190
|
export const TimeHeader = styled.div `
|
|
179
|
-
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
font-weight: 600;
|
|
180
193
|
font-size: 12px;
|
|
181
194
|
color: ${(props) => props.theme.palette.text.primary};
|
|
182
195
|
border-bottom: 1px solid ${(props) => props.theme.palette.divider};
|
|
183
196
|
text-align: center;
|
|
184
|
-
padding: 5px;
|
|
185
|
-
line-height:
|
|
197
|
+
padding: 6px 5px;
|
|
198
|
+
line-height: 1.25;
|
|
186
199
|
height: 40px;
|
|
187
200
|
user-select: none;
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
gap: 6px;
|
|
188
205
|
`;
|
|
189
|
-
export const
|
|
190
|
-
|
|
191
|
-
width: 50%;
|
|
192
|
-
height: 250px;
|
|
193
|
-
overflow-y: auto;
|
|
206
|
+
export const TimeHeaderValue = styled.span `
|
|
207
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
194
208
|
`;
|
|
195
|
-
export const
|
|
196
|
-
|
|
197
|
-
|
|
209
|
+
export const TimeZoneBadge = styled.span `
|
|
210
|
+
padding: 2px 5px;
|
|
211
|
+
border-radius: 4px;
|
|
212
|
+
background: ${(props) => props.theme.palette.action.hover};
|
|
213
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
214
|
+
font-size: 10px;
|
|
215
|
+
font-weight: 700;
|
|
216
|
+
line-height: 1;
|
|
217
|
+
text-transform: uppercase;
|
|
218
|
+
`;
|
|
219
|
+
export const TimeSelectList = styled.div `
|
|
220
|
+
flex: 1 1 auto;
|
|
221
|
+
min-height: 0;
|
|
222
|
+
width: 100%;
|
|
198
223
|
overflow-y: auto;
|
|
199
224
|
`;
|
|
200
225
|
export const TimeItem = styled.div `
|
|
201
226
|
font-weight: 500;
|
|
202
|
-
font-size:
|
|
227
|
+
font-size: 11px;
|
|
203
228
|
color: ${(props) => props.theme.palette.text.primary};
|
|
204
229
|
text-align: center;
|
|
205
|
-
padding: 5px;
|
|
230
|
+
padding: 6px 5px;
|
|
206
231
|
user-select: none;
|
|
207
232
|
cursor: pointer;
|
|
208
233
|
transition: all 0.2s ease-out;
|
|
234
|
+
border-radius: 4px;
|
|
235
|
+
margin: 1px 4px;
|
|
209
236
|
:hover {
|
|
210
237
|
background: ${(props) => props.theme.palette.action.hover};
|
|
211
238
|
}
|
|
@@ -214,10 +241,22 @@ export const TimeItem = styled.div `
|
|
|
214
241
|
outline: 2px solid ${(props) => props.theme.palette.primary.main};
|
|
215
242
|
outline-offset: -2px;
|
|
216
243
|
}
|
|
244
|
+
|
|
245
|
+
&[data-disabled="true"] {
|
|
246
|
+
cursor: not-allowed;
|
|
247
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
248
|
+
opacity: 0.62;
|
|
249
|
+
text-decoration: line-through;
|
|
250
|
+
|
|
251
|
+
&:hover {
|
|
252
|
+
background: transparent;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
217
255
|
`;
|
|
218
256
|
export const TimeItemActive = styled(TimeItem) `
|
|
219
257
|
background: ${(props) => props.theme.palette.primary.main};
|
|
220
258
|
color: white;
|
|
259
|
+
font-weight: 700;
|
|
221
260
|
&:hover {
|
|
222
261
|
background: ${(props) => props.theme.palette.primary.main};
|
|
223
262
|
}
|
|
@@ -39,7 +39,7 @@ export declare const CALENDAR_MONTHS: {
|
|
|
39
39
|
export declare const CALENDAR_WEEKS = 6;
|
|
40
40
|
export declare const zeroPad: (value: number, length: number) => string;
|
|
41
41
|
export declare const createLocalDate: (year: number, month: number, day: number) => Date;
|
|
42
|
-
export declare const getMonthDays: (month?: number, year?: number) => 28 |
|
|
42
|
+
export declare const getMonthDays: (month?: number, year?: number) => 28 | 30 | 29 | 31;
|
|
43
43
|
export declare const getMonthFirstDay: (month?: number, year?: number) => number;
|
|
44
44
|
export declare const isDate: (date: Date) => boolean;
|
|
45
45
|
export declare const isSameMonth: (date: Date, basedate?: Date) => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
-
import { FaCheckSquare, FaRegSquare, FaRegMinusSquare } from "react-icons/fa";
|
|
5
4
|
import { getControlSizeTokens } from "../core";
|
|
6
5
|
const CheckBox = styled(({ className, defaultValue = false, value, partialCheck = false, onChange = () => { }, }) => {
|
|
7
6
|
const [checkedState, setCheckedState] = useState(defaultValue);
|
|
@@ -15,15 +14,47 @@ const CheckBox = styled(({ className, defaultValue = false, value, partialCheck
|
|
|
15
14
|
setCheckedState(value);
|
|
16
15
|
}, [value]);
|
|
17
16
|
const _checked = value === undefined ? checkedState : value;
|
|
18
|
-
return (_jsx("div", { className: className, onClick: handleChange, children: partialCheck === true ? (_jsx(
|
|
17
|
+
return (_jsx("div", { className: className, onClick: handleChange, children: partialCheck === true ? (_jsx("span", { className: "checkbox partial" })) : _checked === true ? (_jsx("span", { className: "checkbox checked" })) : (_jsx("span", { className: "checkbox unchecked" })) }));
|
|
19
18
|
}) `
|
|
20
19
|
display: flex;
|
|
21
20
|
align-items: center;
|
|
22
21
|
cursor: pointer;
|
|
23
22
|
|
|
24
23
|
.checkbox {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
width: ${({ size }) => `${getControlSizeTokens(size).checkboxIconSize}px`};
|
|
30
|
+
height: ${({ size }) => `${getControlSizeTokens(size).checkboxIconSize}px`};
|
|
31
|
+
border: 1px solid ${(props) => props.theme.palette.primary.main};
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.checked,
|
|
36
|
+
.partial {
|
|
37
|
+
background-color: ${(props) => props.theme.palette.primary.main};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.checked::after {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: 50%;
|
|
44
|
+
top: 45%;
|
|
45
|
+
width: 32%;
|
|
46
|
+
height: 56%;
|
|
47
|
+
border: solid #fff;
|
|
48
|
+
border-width: 0 2px 2px 0;
|
|
49
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
50
|
+
transform-origin: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.partial::after {
|
|
54
|
+
content: "";
|
|
55
|
+
width: 60%;
|
|
56
|
+
height: 2px;
|
|
57
|
+
background-color: #fff;
|
|
27
58
|
}
|
|
28
59
|
`;
|
|
29
60
|
export default CheckBox;
|
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Menu, MenuItemList, StyledInnerItemContainer } from "./components";
|
|
4
|
-
export const DropDownMenu = ({ data, children, defaultValue, variant, arrow, size, searchable, grouped, onAddNew, loading, onScroll, onScrollToTop, onScrollToBottom, onSearch, manualSearch, multiselect, renderOption, dynamicOptionHeight, onItemSelect, onChange, buttonProps, TooltipContent, dropDownProps, query, disabled, }) => {
|
|
4
|
+
export const DropDownMenu = ({ data, children, defaultValue, value, variant, arrow, size, searchable, grouped, onAddNew, loading, onScroll, onScrollToTop, onScrollToBottom, onSearch, manualSearch, multiselect, enableSelectAll, renderOption, dynamicOptionHeight, onItemSelect, onChange, buttonProps, TooltipContent, dropDownProps, query, disabled, }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const isObjectArray = (_a = Object.keys((data === null || data === void 0 ? void 0 : data[0]) || {})) === null || _a === void 0 ? void 0 : _a.includes("label");
|
|
7
|
-
const [
|
|
7
|
+
const [internalSelected, setInternalSelected] = useState(defaultValue || []);
|
|
8
|
+
const isControlled = value !== undefined;
|
|
9
|
+
const selected = isControlled ? value || [] : internalSelected;
|
|
10
|
+
const updateSelected = (newSelected, diff) => {
|
|
11
|
+
if (!isControlled) {
|
|
12
|
+
setInternalSelected(newSelected);
|
|
13
|
+
}
|
|
14
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newSelected, diff);
|
|
15
|
+
};
|
|
16
|
+
const isSameItem = (a, b) => isObjectArray ? (a === null || a === void 0 ? void 0 : a.value) === (b === null || b === void 0 ? void 0 : b.value) : a === b;
|
|
8
17
|
const handleAddItem = (item) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
if (!multiselect) {
|
|
19
|
+
updateSelected([item], [item]);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const nextSelected = selected.some((selectedItem) => isSameItem(selectedItem, item))
|
|
23
|
+
? selected
|
|
24
|
+
: [...selected, item];
|
|
25
|
+
updateSelected(nextSelected, [item]);
|
|
15
26
|
};
|
|
16
27
|
const handleRemoveItem = (item) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
28
|
+
const newSelected = selected.filter((i) => !isSameItem(i, item));
|
|
29
|
+
updateSelected(newSelected, [item]);
|
|
30
|
+
};
|
|
31
|
+
const handleSetSelected = (newSelected, diff) => {
|
|
32
|
+
updateSelected(newSelected, diff);
|
|
23
33
|
};
|
|
24
34
|
const handleMenuClose = () => { };
|
|
25
35
|
const handleScrollToBottom = (e) => {
|
|
26
36
|
onScrollToBottom === null || onScrollToBottom === void 0 ? void 0 : onScrollToBottom(e);
|
|
27
37
|
};
|
|
28
|
-
return (_jsx(Menu, { label: children, disabled: disabled, arrow: arrow, buttonSize: size, variant: variant, multiselect: multiselect, buttonProps: buttonProps, onMenuClose: handleMenuClose, dropDownProps: dropDownProps, children: _jsxs(StyledInnerItemContainer, { children: [loading && _jsx("div", { children: "Loading..." }), !loading && (_jsx(MenuItemList, { menuItems: data, searchable: searchable, grouped: grouped, onAddNew: onAddNew, onSearch: onSearch, manualSearch: manualSearch, dynamicOptionHeight: dynamicOptionHeight, selected: selected, TooltipContent: TooltipContent, multiselect: multiselect, size: size, handleAddItem: handleAddItem, handleRemoveItem: handleRemoveItem, onItemSelect: onItemSelect, renderOption: renderOption, onScroll: onScroll, onScrollToTop: onScrollToTop, onScrollToBottom: handleScrollToBottom, query: query }))] }) }));
|
|
38
|
+
return (_jsx(Menu, { label: children, disabled: disabled, arrow: arrow, buttonSize: size, variant: variant, multiselect: multiselect, buttonProps: buttonProps, onMenuClose: handleMenuClose, dropDownProps: dropDownProps, children: _jsxs(StyledInnerItemContainer, { children: [loading && _jsx("div", { children: "Loading..." }), !loading && (_jsx(MenuItemList, { menuItems: data, searchable: searchable, grouped: grouped, onAddNew: onAddNew, onSearch: onSearch, manualSearch: manualSearch, dynamicOptionHeight: dynamicOptionHeight, selected: selected, TooltipContent: TooltipContent, multiselect: multiselect, enableSelectAll: enableSelectAll, size: size, handleAddItem: handleAddItem, handleRemoveItem: handleRemoveItem, handleSetSelected: handleSetSelected, onItemSelect: onItemSelect, renderOption: renderOption, onScroll: onScroll, onScrollToTop: onScrollToTop, onScrollToBottom: handleScrollToBottom, query: query }))] }) }));
|
|
29
39
|
};
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
14
|
-
import { autoUpdate, flip, FloatingFocusManager, FloatingList, FloatingNode, FloatingPortal, offset, safePolygon, shift, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTypeahead, } from "@floating-ui/react";
|
|
14
|
+
import { autoUpdate, flip, FloatingFocusManager, FloatingList, FloatingNode, FloatingPortal, offset, safePolygon, shift, size as floatingSize, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTypeahead, } from "@floating-ui/react";
|
|
15
15
|
import { ChevronDownIcon, ChevronRightIcon } from "lucide-react";
|
|
16
16
|
import { getControlSizeTokens } from "../../core";
|
|
17
17
|
import { MenuContext } from "./MenuContext";
|
|
@@ -43,6 +43,11 @@ export const MenuComponent = forwardRef((_a, forwardedRef) => {
|
|
|
43
43
|
}),
|
|
44
44
|
flip(),
|
|
45
45
|
shift(),
|
|
46
|
+
floatingSize({
|
|
47
|
+
apply({ rects, elements }) {
|
|
48
|
+
elements.floating.style.setProperty("--mfui-dropdown-reference-width", `${rects.reference.width}px`);
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
46
51
|
],
|
|
47
52
|
whileElementsMounted: autoUpdate,
|
|
48
53
|
});
|
|
@@ -76,6 +76,12 @@ export const MenuItem = styled(forwardRef((_a, forwardedRef) => {
|
|
|
76
76
|
pointer-events: "none";
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
&[data-selected="true"] {
|
|
80
|
+
background-color: ${(props) => props.theme.palette.primary.main}20;
|
|
81
|
+
color: ${(props) => props.theme.palette.primary.main};
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
&:hover {
|
|
80
86
|
background-color: ${(props) => props.theme.palette.action.hover};
|
|
81
87
|
color: ${(props) => props.theme.palette.text.primary};
|
|
@@ -11,11 +11,13 @@ export declare const MenuItemList: React.FC<{
|
|
|
11
11
|
selected?: DropDownItem[];
|
|
12
12
|
TooltipContent?: ComponentType<any>;
|
|
13
13
|
multiselect?: boolean;
|
|
14
|
+
enableSelectAll?: boolean;
|
|
14
15
|
grouped?: boolean;
|
|
15
16
|
onAddNew?: (value: string) => void;
|
|
16
17
|
size?: Size;
|
|
17
18
|
handleAddItem: (item: DropDownItem) => void;
|
|
18
19
|
handleRemoveItem: (item: DropDownItem) => void;
|
|
20
|
+
handleSetSelected: (selected: DropDownItem[], diff: DropDownItem[]) => void;
|
|
19
21
|
onItemSelect?: (item: DropDownItem) => void;
|
|
20
22
|
renderOption?: (item: DropDownItem) => React.ReactNode;
|
|
21
23
|
onScroll?: (e: Event) => void;
|