schummar-table 1.0.1 → 1.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme-BxEsZbTm.cjs","names":["differenceInCalendarMonths","addDays","isBefore","startOfDay","isToday","useState","useRef","className","defaultDate","isIncludedType","maxValues","tabNext","useId","useState","useMemo","Fragment","useId","useState","useMemo","Fragment","createContext","useMemo","Temporal","useContext","Fragment","useState","serializeStyles","createCache","useEmotionCache","useMemo","useEmotionTheme","css","css","css","cloneElement","createContext","useContext","TableSettingsContext","useMemo","mergeThemes"],"sources":["../src/theme/defaultTheme/defaultColors.ts","../src/misc/defaults.ts","../src/theme/useCssVariables.ts","../src/vendor/dayzed/utils.ts","../src/vendor/dayzed/dayzed.ts","../src/hooks/useLatestRef.ts","../src/misc/debounce.ts","../src/components/dateInput.tsx","../src/components/text.tsx","../src/components/timeInput.tsx","../src/components/datePicker.tsx","../src/components/spinnner.tsx","../src/theme/defaultTheme/badge.tsx","../src/theme/defaultTheme/button.tsx","../src/misc/helpers.ts","../src/theme/emotion.ts","../src/theme/defaultTheme/checkbox.tsx","../src/theme/defaultTheme/iconButton.tsx","../src/theme/defaultTheme/textField.tsx","../src/theme/defaultTheme/defaultComponents.ts","../src/theme/defaultTheme/defaultIcons.tsx","../src/theme/defaultTheme/defaultTexts.tsx","../src/theme/defaultTheme/index.tsx","../src/hooks/useTheme.ts"],"sourcesContent":["import type { TableTheme } from '../../types';\n\nexport const defaultColors: TableTheme['colors'] = {\n primary: { main: '#1976d2', light: '#42a5f5', contrastText: '#fff' },\n secondary: { main: '#9c27b0', light: '#ba68c8', contrastText: '#fff' },\n blocked: { main: '#f44336', light: '#f26257', contrastText: '#fff' },\n background: '#ffffff',\n text: 'inherit',\n border: '#777',\n borderLight: '#eee',\n};\n","export function defaults<T extends object>(first: T, ...more: Partial<T>[]): T {\n return more.reduce<T>((acc, source) => {\n const copy = { ...acc };\n\n for (const [key, value] of Object.entries(source)) {\n copy[key as keyof T] ??= value as any;\n }\n\n return copy;\n }, first);\n}\n","import { useTheme } from '../hooks/useTheme';\n\nexport function useCssVariables() {\n return useTheme(({ spacing, colors }) => {\n return {\n '--spacing': spacing,\n '--primaryMain': colors.primary.main,\n '--primaryLight': colors.primary.light,\n '--primaryContrastText': colors.primary.contrastText,\n '--secondaryMain': colors.secondary.main,\n '--secondaryLight': colors.secondary.light,\n '--secondaryContrastText': colors.secondary.contrastText,\n '--blockedMain': colors.blocked.main,\n '--blockedLight': colors.blocked.light,\n '--blockedContrastText': colors.blocked.contrastText,\n '--table-background-color': colors.background,\n '--table-text-color': colors.text,\n '--table-border-color': colors.border,\n '--table-border-light-color': colors.borderLight,\n };\n });\n}\n","import { addDays, isBefore, isToday, startOfDay, differenceInCalendarMonths } from 'date-fns';\nimport { SyntheticEvent } from 'react';\n\nexport type DayzedDateObject = {\n date: Date;\n nextMonth: boolean;\n prevMonth: boolean;\n selectable: boolean;\n selected: boolean;\n today: boolean;\n};\n\nexport type DayzedCalendar = {\n firstDayOfMonth: Date;\n lastDayOfMonth: Date;\n month: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;\n weeks: Array<Array<DayzedDateObject | ''>>;\n year: number;\n};\n\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls\n * `event.preventDefault()`. Not sure this is the best\n * way to do this, but it seems legit...\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\nexport function composeEventHandlers(\n ...fns: (((event: SyntheticEvent, ...args: any[]) => any) | undefined)[]\n) {\n return (event: SyntheticEvent, ...args: any[]) =>\n fns.some((fn) => {\n if (fn) {\n fn(event, ...args);\n }\n return event.defaultPrevented;\n });\n}\n\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\nexport function requiredProp(fnName: string, propName: string): never {\n throw new Error(`The property \"${propName}\" is required in \"${fnName}\"`);\n}\n\n/**\n * Takes a calendars array and figures out the number of months to subtract\n * based on the current offset and the minDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Number} param.offset The num of months to be subtracted\n * @param {Date} param.minDate The earliest date we are allow to subtract back to\n * @returns {Number} The number of months to subtract\n */\nexport function subtractMonth({\n calendars,\n offset,\n minDate,\n}: {\n calendars: DayzedCalendar[];\n offset: number;\n minDate?: Date;\n}) {\n if (offset > 1 && minDate) {\n const { firstDayOfMonth } = calendars[0]!;\n const diffInMonths = differenceInCalendarMonths(firstDayOfMonth, minDate);\n if (diffInMonths < offset) {\n offset = diffInMonths;\n }\n }\n return offset;\n}\n\n/**\n * Takes a calendars array and figures out the number of months to add\n * based on the current offset and the maxDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Number} param.offset The num of months to be added\n * @param {Date} param.maxDate The furthest date we are allow to add forward to\n * @returns {Number} The number of months to add\n */\nexport function addMonth({\n calendars,\n offset,\n maxDate,\n}: {\n calendars: DayzedCalendar[];\n offset: number;\n maxDate?: Date;\n}) {\n if (offset > 1 && maxDate) {\n const { lastDayOfMonth } = calendars[calendars.length - 1]!;\n const diffInMonths = differenceInCalendarMonths(maxDate, lastDayOfMonth);\n if (diffInMonths < offset) {\n offset = diffInMonths;\n }\n }\n return offset;\n}\n\n/**\n * Takes a calendars array and figures out if the back button should be\n * disabled based on the minDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Date} param.minDate The earliest date available\n * @returns {Boolean} Whether the back button should be disabled.\n */\nexport function isBackDisabled({\n calendars,\n minDate,\n}: {\n calendars: DayzedCalendar[];\n minDate?: Date;\n}) {\n if (!minDate) {\n return false;\n }\n const { firstDayOfMonth } = calendars[0]!;\n const firstDayOfMonthMinusOne = addDays(firstDayOfMonth, -1);\n if (isBefore(firstDayOfMonthMinusOne, minDate)) {\n return true;\n }\n return false;\n}\n\n/**\n * Takes a calendars array and figures out if the forward button should be\n * disabled based on the maxDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Date} param.maxDate The furthest date available\n * @returns {Boolean} Whether the forward button should be disabled.\n */\nexport function isForwardDisabled({\n calendars,\n maxDate,\n}: {\n calendars: DayzedCalendar[];\n maxDate?: Date;\n}) {\n if (!maxDate) {\n return false;\n }\n const { lastDayOfMonth } = calendars[calendars.length - 1]!;\n const lastDayOfMonthPlusOne = addDays(lastDayOfMonth, 1);\n if (isBefore(maxDate, lastDayOfMonthPlusOne)) {\n return true;\n }\n return false;\n}\n\n/**\n * Figures out the months data needed based off the number of monthsToDisplay\n * and other options provided.\n * @param {Object} param The param object\n * @param {Date} param.date The date to start the calendar at\n * @param {Array.<Date>} param.selected An array of dates currently selected\n * @param {Number} param.monthsToDisplay The number of months to return in the calendar view\n * @param {Number} param.offset The number of months to offset based off the param.date given\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Object>} An array of objects with month data\n */\nexport function getCalendars({\n date,\n selected,\n monthsToDisplay,\n offset,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n date: Date;\n selected: Date[];\n monthsToDisplay: number;\n offset: number;\n minDate?: Date;\n maxDate?: Date;\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}): DayzedCalendar[] {\n const months: DayzedCalendar[] = [];\n const startDate = getStartDate(date, minDate, maxDate);\n for (let i = 0; i < monthsToDisplay; i++) {\n const calendarDates = getMonths({\n month: startDate.getMonth() + i + offset,\n year: startDate.getFullYear(),\n selectedDates: selected,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n });\n months.push(calendarDates);\n }\n return months;\n}\n\n/**\n * Figures out the actual start date based on\n * the min and max dates available.\n * @param {Date} date The we want to start the calendar at\n * @param {Date} minDate The earliest date available to start at\n * @param {Date} maxDate The latest date available to start at\n * @returns {Date} The actual start date\n */\nfunction getStartDate(date: Date, minDate?: Date, maxDate?: Date): Date {\n let startDate = startOfDay(date);\n if (minDate) {\n const minDateNormalized = startOfDay(minDate);\n if (isBefore(startDate, minDateNormalized)) {\n startDate = minDateNormalized;\n }\n }\n if (maxDate) {\n const maxDateNormalized = startOfDay(maxDate);\n if (isBefore(maxDateNormalized, startDate)) {\n startDate = maxDateNormalized;\n }\n }\n return startDate;\n}\n\n/**\n * Figures what week/day data to return for the given month\n * and year. Adds flags to day data if found in the given selectedDates,\n * if is selectable inside the given min and max dates, or is today.\n * @param {Object} param The param object\n * @param {Number} param.month The month to grab data for\n * @param {Number} param.year The year to grab data for\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Object} The data for the selected month/year\n */\nfunction getMonths({\n month,\n year,\n selectedDates,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n month: number;\n year: number;\n selectedDates: Date[];\n minDate?: Date;\n maxDate?: Date;\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}): DayzedCalendar {\n // Get the normalized month and year, along with days in the month.\n const daysMonthYear = getNumDaysMonthYear(month, year);\n const daysInMonth = daysMonthYear.daysInMonth;\n month = daysMonthYear.month;\n year = daysMonthYear.year;\n\n // Fill out the dates for the month.\n const dates: ('' | DayzedDateObject)[] = [];\n for (let day = 1; day <= daysInMonth; day++) {\n const date = new Date(year, month, day);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: isToday(date),\n prevMonth: false,\n nextMonth: false,\n };\n dates.push(dateObj);\n }\n\n const firstDayOfMonth = new Date(year, month, 1);\n const lastDayOfMonth = new Date(year, month, daysInMonth);\n\n const frontWeekBuffer = fillFrontWeek({\n firstDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n });\n\n const backWeekBuffer = fillBackWeek({\n lastDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n });\n\n dates.unshift(...frontWeekBuffer);\n dates.push(...backWeekBuffer);\n\n // Get the filled out weeks for the\n // given dates.\n const weeks = getWeeks(dates);\n // return the calendar data.\n return {\n firstDayOfMonth,\n lastDayOfMonth,\n month: month as DayzedCalendar['month'],\n year,\n weeks,\n };\n}\n\n/**\n * Fill front week with either empty buffer or dates from previous month,\n * depending on showOutsideDays flag\n * @param {Object} param The param object\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Date} param.firstDayOfMonth First day of the month\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Date>} Buffer to fill front week\n */\nfunction fillFrontWeek({\n firstDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n firstDayOfMonth: Date;\n minDate?: Date;\n maxDate?: Date;\n selectedDates: Date[];\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}) {\n const dates: ('' | DayzedDateObject)[] = [];\n let firstDay = (firstDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;\n\n if (showOutsideDays) {\n const lastDayOfPrevMonth = addDays(firstDayOfMonth, -1);\n const prevDate = lastDayOfPrevMonth.getDate();\n const prevDateMonth = lastDayOfPrevMonth.getMonth();\n const prevDateYear = lastDayOfPrevMonth.getFullYear();\n\n // Fill out front week for days from\n // preceding month with dates from previous month.\n let counter = 0;\n while (counter < firstDay) {\n const date = new Date(prevDateYear, prevDateMonth, prevDate - counter);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: false,\n prevMonth: true,\n nextMonth: false,\n };\n dates.unshift(dateObj);\n counter++;\n }\n } else {\n // Fill out front week for days from\n // preceding month with buffer.\n while (firstDay > 0) {\n dates.unshift('');\n firstDay--;\n }\n }\n\n return dates;\n}\n\n/**\n * Fill back weeks with either empty buffer or dates from next month,\n * depending on showOutsideDays flag\n * @param {Object} param The param object\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Date} param.lastDayOfMonth Last day of the month\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Date>} Buffer to fill back week\n */\nfunction fillBackWeek({\n lastDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n lastDayOfMonth: Date;\n minDate?: Date;\n maxDate?: Date;\n selectedDates: Date[];\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}) {\n const dates: ('' | DayzedDateObject)[] = [];\n let lastDay = (lastDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;\n\n if (showOutsideDays) {\n const firstDayOfNextMonth = addDays(lastDayOfMonth, 1);\n const nextDateMonth = firstDayOfNextMonth.getMonth();\n const nextDateYear = firstDayOfNextMonth.getFullYear();\n\n // Fill out back week for days from\n // following month with dates from next month.\n let counter = 0;\n while (counter < 6 - lastDay) {\n const date = new Date(nextDateYear, nextDateMonth, 1 + counter);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: false,\n prevMonth: false,\n nextMonth: true,\n };\n dates.push(dateObj);\n counter++;\n }\n } else {\n // Fill out back week for days from\n // following month with buffer.\n while (lastDay < 6) {\n dates.push('');\n lastDay++;\n }\n }\n\n return dates;\n}\n\n/**\n * Normalizes month (could be overflow) and year pairs and returns the\n * normalized month and year along with the number of days in the month.\n * @param {Number} month The month to normalize\n * @param {Number} year The year to normalize\n * @returns {Object} The normalized month and year along with the number of days in the month\n */\nfunction getNumDaysMonthYear(month: number, year: number) {\n // If a parameter you specify is outside of the expected range for Month or Day,\n // JS Date attempts to update the date information in the Date object accordingly!\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate\n\n // Let Date handle the overflow of the month,\n // which should return the normalized month and year.\n const normalizedMonthYear = new Date(year, month, 1);\n month = normalizedMonthYear.getMonth();\n year = normalizedMonthYear.getFullYear();\n // Overflow the date to the next month, then subtract the difference\n // to get the number of days in the previous month.\n // This will also account for leap years!\n const daysInMonth = 32 - new Date(year, month, 32).getDate();\n return { daysInMonth, month, year };\n}\n\n/**\n * Takes an array of dates, and turns them into a multi dimensional\n * array with 7 entries for each week.\n * @param {Array.<Object>} dates An array of dates\n * @returns {Array} The weeks as a multi dimensional array\n */\nfunction getWeeks(dates: ('' | DayzedDateObject)[]) {\n const weeksLength = Math.ceil(dates.length / 7);\n const weeks: ('' | DayzedDateObject)[][] = [];\n for (let i = 0; i < weeksLength; i++) {\n weeks[i] = [];\n for (let x = 0; x < 7; x++) {\n weeks[i]!.push(dates[i * 7 + x]!);\n }\n }\n return weeks;\n}\n\n/**\n * Normalizes dates to the beginning of the day,\n * then checks to see if the day given is found\n * in the selectedDates.\n * @param {Array.<Date>} selectedDates An array of dates currently selected\n * @param {Date} date The date to search with against selectedDates\n * @returns {Boolean} Whether day is found in selectedDates\n */\nfunction isSelected(selectedDates: Date[], date: Date): boolean {\n selectedDates = Array.isArray(selectedDates) ? selectedDates : [selectedDates];\n return selectedDates.some((selectedDate) => {\n if (\n selectedDate instanceof Date &&\n startOfDay(selectedDate).getTime() === startOfDay(date).getTime()\n ) {\n return true;\n }\n return false;\n });\n}\n\n/**\n * Checks to see if the date given is\n * between the min and max dates.\n * @param {Date} minDate The earliest date available\n * @param {Date} maxDate The furthest date available\n * @param {Date} date The date to compare with\n * @returns {Boolean} Whether the date is between min and max date\n */\nfunction isSelectable(minDate: Date | undefined, maxDate: Date | undefined, date: Date): boolean {\n if ((minDate && isBefore(date, minDate)) || (maxDate && isBefore(maxDate, date))) {\n return false;\n }\n return true;\n}\n","import { HTMLProps, SyntheticEvent, useState } from 'react';\n\nimport {\n composeEventHandlers,\n requiredProp,\n subtractMonth,\n addMonth,\n isBackDisabled,\n isForwardDisabled,\n getCalendars,\n type DayzedDateObject,\n type DayzedCalendar,\n} from './utils';\n\nfunction isOffsetControlled(propOffset: number | undefined) {\n return propOffset !== undefined;\n}\n\nfunction getOffset(prop: number | undefined, state: number) {\n return isOffsetControlled(prop) ? prop : state;\n}\n\nfunction getDateProps(\n onDateSelected: ((date: DayzedDateObject, event: SyntheticEvent) => void) | undefined,\n {\n onClick,\n dateObj = requiredProp('getDateProps', 'dateObj'),\n ...rest\n }: Partial<GetDatePropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, (event) => {\n onDateSelected?.(dateObj, event);\n }),\n disabled: !dateObj.selectable,\n 'aria-label': dateObj.date.toDateString(),\n 'aria-pressed': dateObj.selected,\n role: 'button',\n ...rest,\n };\n}\n\nfunction getBackProps(\n {\n minDate,\n offsetMonth,\n handleOffsetChanged,\n }: {\n minDate?: Date;\n offsetMonth: number;\n handleOffsetChanged: (offset: number) => void;\n },\n {\n onClick,\n offset = 1,\n calendars = requiredProp('getBackProps', 'calendars'),\n ...rest\n }: Partial<GetBackForwardPropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, () => {\n handleOffsetChanged(offsetMonth - subtractMonth({ calendars, offset, minDate }));\n }),\n disabled: isBackDisabled({ calendars, minDate }),\n 'aria-label': `Go back ${offset} month${offset === 1 ? '' : 's'}`,\n ...rest,\n };\n}\n\nfunction getForwardProps(\n {\n maxDate,\n offsetMonth,\n handleOffsetChanged,\n }: {\n maxDate?: Date;\n offsetMonth: number;\n handleOffsetChanged: (offset: number) => void;\n },\n {\n onClick,\n offset = 1,\n calendars = requiredProp('getForwardProps', 'calendars'),\n ...rest\n }: Partial<GetBackForwardPropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, () => {\n handleOffsetChanged(offsetMonth + addMonth({ calendars, offset, maxDate }));\n }),\n disabled: isForwardDisabled({ calendars, maxDate }),\n 'aria-label': `Go forward ${offset} month${offset === 1 ? '' : 's'}`,\n ...rest,\n };\n}\n\nexport function useDayzed({\n date = new Date(),\n maxDate,\n minDate,\n monthsToDisplay = 1,\n firstDayOfWeek = 0,\n showOutsideDays = false,\n offset,\n onDateSelected,\n onOffsetChanged = () => {},\n selected,\n}: {\n date?: Date;\n maxDate?: Date;\n minDate?: Date;\n monthsToDisplay?: number;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n showOutsideDays?: boolean;\n selected?: Date | Date[];\n offset?: number;\n onOffsetChanged?(offset: number): void;\n onDateSelected(selectedDate: DayzedDateObject, event: SyntheticEvent): void;\n}): RenderProps {\n const [stateOffset, setStateOffset] = useState(0);\n const offsetMonth = getOffset(offset, stateOffset);\n\n function handleOffsetChanged(newOffset: number) {\n if (!isOffsetControlled(offset)) {\n setStateOffset(newOffset);\n }\n onOffsetChanged(newOffset);\n }\n\n const calendars = getCalendars({\n date,\n selected: Array.isArray(selected) ? selected : selected ? [selected] : [],\n monthsToDisplay,\n minDate,\n maxDate,\n offset: offsetMonth,\n firstDayOfWeek,\n showOutsideDays,\n });\n return {\n calendars,\n getDateProps: getDateProps.bind(null, onDateSelected),\n getBackProps: getBackProps.bind(null, {\n minDate,\n offsetMonth,\n handleOffsetChanged,\n }),\n getForwardProps: getForwardProps.bind(null, {\n maxDate,\n offsetMonth,\n handleOffsetChanged,\n }),\n };\n}\n\ninterface GetBackForwardPropsOptions extends HTMLProps<HTMLButtonElement> {\n calendars: DayzedCalendar[];\n offset?: number;\n}\n\ninterface GetDatePropsOptions extends HTMLProps<HTMLButtonElement> {\n dateObj: DayzedDateObject;\n}\n\ninterface RenderProps {\n calendars: DayzedCalendar[];\n getBackProps: (data: GetBackForwardPropsOptions) => Record<string, any>;\n getForwardProps: (data: GetBackForwardPropsOptions) => Record<string, any>;\n getDateProps: (data: GetDatePropsOptions) => Record<string, any>;\n}\n\nexport type { DayzedDateObject } from './utils';\n","import { useEffect, useRef } from 'react';\n\nexport default function useLatestRef<T>(value: T) {\n const latestValue = useRef(value);\n\n useEffect(() => {\n latestValue.current = value;\n }, [value]);\n\n return latestValue;\n}\n","export function debounce<Args extends any[]>(\n function_: (...args: Args) => void,\n ms: number,\n): { (...args: Args): void; flush(): void; cancel(): void } {\n let lastArgs: Args | undefined;\n let timeout: ReturnType<typeof setTimeout> | undefined;\n\n function run() {\n const args = lastArgs;\n\n lastArgs = undefined;\n timeout = undefined;\n\n function_(...(args as Args));\n }\n\n return Object.assign(\n function (...args: Args) {\n lastArgs = args;\n\n if (timeout) {\n clearTimeout(timeout);\n }\n\n timeout = setTimeout(run, ms);\n },\n {\n flush() {\n if (timeout) {\n clearTimeout(timeout);\n run();\n }\n },\n\n cancel() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n lastArgs = undefined;\n }\n },\n },\n );\n}\n","import { Fragment, useId, useMemo, useState } from 'react';\nimport useLatestRef from '../hooks/useLatestRef';\nimport { debounce } from '../misc/debounce';\n\nexport interface DateInputProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n locale?: string;\n}\n\ntype Part = 'day' | 'month' | 'year';\n\nconst className = 'schummar-table-date-input';\nconst defaultDate = new Date(1970, 0, 1);\n\nconst isIncludedType = (type: Intl.DateTimeFormatPartTypes): type is Part =>\n type === 'day' || type === 'month' || type === 'year';\n\nconst maxValues = {\n day: 31,\n month: 12,\n year: 9999,\n};\n\nconst tabNext = (event: Element, id: string) => {\n const all = Array.from(document.querySelectorAll(`.${className}-${id}`));\n const index = all.indexOf(event);\n const next = all[index + 1];\n\n if (next instanceof HTMLElement) {\n next.focus();\n }\n};\n\nfunction buildDate(value: Partial<Record<Part, string>>, baseDate = new Date()): Date {\n const date = new Date(baseDate);\n\n if (value.year) {\n date.setFullYear(Number(value.year));\n }\n\n if (value.month) {\n date.setMonth(Number(value.month) - 1);\n }\n\n if (value.day) {\n date.setDate(Number(value.day));\n }\n\n return date;\n}\n\nexport function DateInput({ value, onChange, locale }: DateInputProps) {\n const id = useId();\n const [localValue, setLocalValue] = useState<Partial<Record<Part, string>>>();\n const latestValue = useLatestRef(value);\n\n const commit = useMemo(\n () =>\n debounce(\n (\n localValue: Partial<Record<Part, string>> = {},\n value: Date | null,\n onChange: (date: Date | null) => void,\n ) => {\n if (value !== latestValue.current) {\n // Value has been changed from outside, don't override it.\n return;\n }\n\n const date = buildDate(localValue, value ?? undefined);\n setLocalValue(undefined);\n onChange(isNaN(date.getTime()) ? null : date);\n },\n 100,\n ),\n [],\n );\n\n const format = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n }),\n [locale],\n );\n\n let parts;\n try {\n parts = format.formatToParts(value ?? defaultDate);\n } catch {\n parts = format.formatToParts(defaultDate);\n }\n\n const isEmpty = !value;\n\n return (\n <div\n css={{\n display: 'flex',\n alignItems: 'baseline',\n }}\n >\n {parts.map(({ type, value: partValue }, index) => (\n <Fragment key={index}>\n {isIncludedType(type) ? (\n <input\n className={`${className}-${id}`}\n css={{\n boxSizing: 'content-box',\n overflow: 'visible',\n border: 'none',\n borderBottom: '2px solid transparent',\n outline: 'none',\n fontSize: 'inherit',\n backgroundColor: 'inherit',\n color: 'inherit',\n\n '::placeholder': {\n color: 'inherit',\n opacity: 0.5,\n },\n\n '&:focus': {\n borderBottom: '2px solid var(--primaryMain)',\n },\n }}\n style={{\n width: `${String(maxValues[type]).length}ch`,\n }}\n placeholder={''.padEnd(String(maxValues[type]).length, '0')}\n value={localValue?.[type] ?? (isEmpty ? '' : partValue)}\n onChange={(event) => {\n const input = event.target.value;\n if (!/^\\d*$/.test(input)) return;\n\n const newValue = { ...localValue, [type]: input };\n\n if (Number(input) > maxValues[type]) {\n newValue[type] = String(maxValues[type]);\n }\n\n setLocalValue(newValue);\n\n if (input.length >= String(maxValues[type]).length) {\n setTimeout(() => tabNext(event.target, id));\n }\n }}\n onFocus={(event) => {\n commit.cancel();\n event.target.select();\n }}\n onBlur={() => {\n commit(localValue, value, onChange);\n }}\n />\n ) : type === 'literal' ? (\n <span>{partValue}</span>\n ) : null}\n </Fragment>\n ))}\n </div>\n );\n}\n","import { useTheme } from '../hooks/useTheme';\nimport type { TableTheme } from '../types';\n\nexport interface TextProps {\n id: keyof TableTheme['text'];\n}\n\nexport function Text({ id }: TextProps) {\n const text = useTheme((t) => t.text[id]);\n\n return <>{text}</>;\n}\n","import { Fragment, useId, useMemo, useState } from 'react';\nimport { debounce } from '../misc/debounce';\nimport useLatestRef from '../hooks/useLatestRef';\n\nexport interface TimeInputProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n locale?: string;\n showSeconds?: boolean;\n}\n\ntype Part = 'hour' | 'minute' | 'second';\n\nconst className = 'schummar-table-time-input';\nconst defaultDate = new Date(1970, 0, 1);\n\nconst isIncludedType = (type: Intl.DateTimeFormatPartTypes): type is Part =>\n type === 'hour' || type === 'minute' || type === 'second';\n\nconst maxValues = {\n hour: 23,\n minute: 59,\n second: 59,\n};\n\nconst tabNext = (event: Element, id: string) => {\n const all = Array.from(document.querySelectorAll(`.${className}-${id}`));\n const index = all.indexOf(event);\n const next = all[index + 1];\n\n if (next instanceof HTMLElement) {\n next.focus();\n }\n};\n\nfunction buildTime(value: Partial<Record<Part, string>>, baseDate = new Date()): Date {\n const date = new Date(baseDate);\n\n if (value.hour) {\n date.setHours(Number(value.hour));\n }\n\n if (value.minute) {\n date.setMinutes(Number(value.minute));\n }\n\n if (value.second) {\n date.setSeconds(Number(value.second));\n }\n\n return date;\n}\n\nexport function TimeInput({ value, onChange, locale, showSeconds = true }: TimeInputProps) {\n const id = useId();\n const [localValue, setLocalValue] = useState<Partial<Record<Part, string>>>();\n const latestValue = useLatestRef(value);\n\n const commit = useMemo(\n () =>\n debounce(\n (\n localValue: Partial<Record<Part, string>> = {},\n value: Date | null,\n onChange: (date: Date | null) => void,\n ) => {\n if (value !== latestValue.current) {\n // Value has been changed from outside, don't override it.\n return;\n }\n\n const date = buildTime(localValue, value ?? undefined);\n setLocalValue(undefined);\n onChange(isNaN(date.getTime()) ? null : date);\n },\n 100,\n ),\n [],\n );\n\n const format = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n second: showSeconds ? '2-digit' : undefined,\n }),\n [locale],\n );\n\n let parts;\n try {\n parts = format.formatToParts(value ?? defaultDate);\n } catch {\n parts = format.formatToParts(defaultDate);\n }\n\n const isEmpty = !value;\n\n return (\n <div\n css={{\n display: 'flex',\n alignItems: 'baseline',\n }}\n >\n {parts.map(({ type, value: partValue }, index) => (\n <Fragment key={index}>\n {isIncludedType(type) ? (\n <input\n className={`${className}-${id}`}\n css={{\n boxSizing: 'content-box',\n overflow: 'visible',\n border: 'none',\n borderBottom: '2px solid transparent',\n outline: 'none',\n fontSize: 'inherit',\n backgroundColor: 'inherit',\n color: 'inherit',\n\n '::placeholder': {\n color: 'inherit',\n opacity: 0.5,\n },\n\n '&:focus': {\n borderBottom: '2px solid var(--primaryMain)',\n },\n }}\n style={{\n width: `${String(maxValues[type]).length}ch`,\n }}\n placeholder={''.padEnd(String(maxValues[type]).length, '0')}\n value={localValue?.[type] ?? (isEmpty ? '' : partValue)}\n onChange={(event) => {\n const input = event.target.value;\n if (!/^\\d*$/.test(input)) return;\n\n const newValue = { ...localValue, [type]: input };\n\n if (Number(input) > maxValues[type]) {\n newValue[type] = String(maxValues[type]);\n }\n\n setLocalValue(newValue);\n\n if (input.length >= String(maxValues[type]).length) {\n setTimeout(() => tabNext(event.target, id));\n }\n }}\n onFocus={(event) => {\n commit.cancel();\n event.target.select();\n }}\n onBlur={() => {\n commit(localValue, value, onChange);\n }}\n />\n ) : type === 'literal' ? (\n <span>{partValue}</span>\n ) : null}\n </Fragment>\n ))}\n </div>\n );\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport {\n Fragment,\n ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Temporal } from 'temporal-polyfill';\nimport { useTheme } from '../hooks/useTheme';\nimport { defaults } from '../misc/defaults';\nimport { useCssVariables } from '../theme/useCssVariables';\nimport { useDayzed, type DayzedDateObject } from '../vendor/dayzed/dayzed';\nimport { DateInput } from './dateInput';\nimport { Text } from './text';\nimport { TimeInput } from './timeInput';\n\nexport type DateRange = { min: Date; max: Date };\n\nexport type DatePickerQuickOption =\n | 'today'\n | 'thisWeek'\n | 'thisMonth'\n | 'thisYear'\n | 'lastSevenDays'\n | 'lastThirtyDays'\n | { label: ReactNode; value: Date | DateRange | (() => Date | DateRange) }\n | ((onChange: (value: Date | DateRange | null) => void) => ReactNode);\n\nexport type DatePickerChangeSource = 'input' | 'calendarWeek' | 'calendar' | 'quickOption';\n\nexport type DatePickerProps = {\n /** Currently selected day or range of days. */\n value: Date | DateRange | null;\n /** Callback for when the day (range) changes. */\n onChange: (value: Date | DateRange | null, source: DatePickerChangeSource) => void;\n /** Currently visible date. */\n dateInView?: Date;\n /** Callback for when the currently visible date changes. */\n onDateInViewChange?: (value: Date) => void;\n /** If enabled, ranges can be selected. */\n rangeSelect?: boolean;\n /** Which locale to use to render the calendar. */\n locale?: string;\n /** Which day of the week should be in the first column. (0=Sunday, 1=Monday, ...)\n * @default 1\n */\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Which month to show initially */\n defaultDateInView?: Date;\n /** Show buttons to quickly select suggested dates or date ranges */\n quickOptions?: DatePickerQuickOption[];\n noReset?: boolean;\n /** Minimum selectable date */\n /** Date ranges that are visually marked as blocked */\n blockedRanges?: DateRange[];\n minDate?: Date;\n /** Maximum selectable date */\n maxDate?: Date;\n /** Whether to show the calendar week in the first column */\n showCalendarWeek?: boolean;\n /** Whether to show and allow editing of time */\n showTime?: boolean | { showSeconds?: boolean };\n};\n\nconst DatePickerContext = createContext<Partial<Omit<DatePickerProps, 'value' | 'onChange'>>>({});\n\nexport function DatePickerProvider({\n children,\n ...props\n}: Partial<Omit<DatePickerProps, 'value' | 'onChange'>> & { children?: ReactNode }) {\n const value = useMemo(() => props, [JSON.stringify(props)]);\n\n return <DatePickerContext.Provider value={value}>{children}</DatePickerContext.Provider>;\n}\n\nconst weekDays = [0, 1, 2, 3, 4, 5, 6] as const;\n\n/** Rounds a date down to the start of the day. */\nexport const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\n\n/** Rounds a date up to the end of the day. */\nexport const endOfDay = (d: Date) =>\n new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1, 0, 0, 0, -1);\n\nexport const lastDays = (days: number): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(min.getDate() - days + 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(now),\n };\n};\n\nexport const today = () => lastDays(1);\n\nexport const thisWeek = (delta = 0, firstDayOfWeek = 1): DateRange => {\n const now = new Date();\n const min = new Date(now);\n\n let diff = min.getDay() - firstDayOfWeek;\n if (diff < 0) {\n diff += 7;\n }\n min.setDate(min.getDate() - diff + delta * 7);\n\n const max = new Date(min);\n max.setDate(max.getDate() + 6);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const thisMonth = (delta = 0): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(1);\n min.setMonth(min.getMonth() + delta);\n const max = new Date(min);\n max.setMonth(max.getMonth() + 1);\n max.setDate(max.getDate() - 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const thisYear = (delta = 0): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(1);\n min.setMonth(0);\n min.setFullYear(min.getFullYear() + delta);\n const max = new Date(min);\n max.setFullYear(max.getFullYear() + 1);\n max.setDate(max.getDate() - 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const getCalendarWeek = (date: Date): number => {\n // ISO 8601: Week 1 is the week with the first Thursday of the year.\n // https://en.wikipedia.org/wiki/ISO_week_date\n\n const tz = Temporal.Now.timeZoneId();\n return (\n Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(tz).weekOfYear ?? 0\n );\n};\n\nexport const commonQuickOptions = {\n today: { label: <Text id=\"today\" />, value: today },\n thisWeek: { label: <Text id=\"thisWeek\" />, value: (props) => thisWeek(0, props.firstDayOfWeek) },\n thisMonth: { label: <Text id=\"thisMonth\" />, value: () => thisMonth() },\n thisYear: { label: <Text id=\"thisYear\" />, value: () => thisYear() },\n lastSevenDays: { label: <Text id=\"lastSevenDays\" />, value: () => lastDays(7) },\n lastThirtyDays: { label: <Text id=\"lastThirtyDays\" />, value: () => lastDays(30) },\n} satisfies Record<\n DatePickerQuickOption & string,\n { label: ReactNode; value: Date | DateRange | ((props: DatePickerProps) => Date | DateRange) }\n>;\n\n/** Returns whether two dates and/or date ranges intersect. Intersection is considered per day. */\nexport function dateIntersect(\n a: Date | DateRange | null | undefined,\n b: Date | DateRange | null | undefined,\n) {\n if (a instanceof Date) {\n a = { min: a, max: a };\n }\n if (b instanceof Date) {\n b = { min: b, max: b };\n }\n\n if (!a?.min || !a.max || !b?.min || !b.max) {\n return false;\n }\n\n return !(endOfDay(a.max) < startOfDay(b.min) || startOfDay(a.min) > endOfDay(b.max));\n}\n\nexport function dateClamp(date: Date, min?: Date, max?: Date) {\n if (min && date < min) {\n return min;\n }\n\n if (max && date > max) {\n return max;\n }\n\n return date;\n}\n\nfunction getValueForComparison(value?: Date | DateRange | null) {\n if (!value) {\n return value;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n return `${value.min?.getTime()}-${value.max?.getTime()}`;\n}\n\n/** Renders the theme's date picker, with `DatePickerProvider` defaults and min/max clamping applied. */\nexport function DatePicker(props: DatePickerProps) {\n const context = useContext(DatePickerContext);\n const Component = useTheme((t) => t.components.DatePicker);\n\n const resolved = defaults<DatePickerProps>(props, context, {\n firstDayOfWeek: 1,\n quickOptions: ['today', 'thisWeek'],\n });\n const { minDate, maxDate } = resolved;\n\n function onChange(value: Date | DateRange | null, source: DatePickerChangeSource) {\n if (value instanceof Date) {\n value = dateClamp(value, minDate, maxDate);\n } else if (value) {\n value = {\n min: dateClamp(value.min, minDate, maxDate),\n max: dateClamp(value.max, minDate, maxDate),\n };\n }\n\n props.onChange(value, source);\n }\n\n return <Component {...resolved} onChange={onChange} />;\n}\n\n/** The quick option buttons (plus reset) below the calendar, for use in theme date pickers. */\nexport function DatePickerQuickOptions({\n onSelect,\n ...props\n}: DatePickerProps & {\n /** Called before the value is changed, e.g. to discard a half-selected range. */\n onSelect?: () => void;\n}) {\n const Button = useTheme((t) => t.components.Button);\n const { quickOptions = [], noReset, onChange } = props;\n\n const options = [\n ...quickOptions,\n ...(noReset ? [] : [{ label: <Text id=\"reset\" />, value: null }]),\n ].map((option, index) => {\n if (option instanceof Function) {\n return (\n <Fragment key={index}>\n {option((value) => {\n onSelect?.();\n onChange(value, 'quickOption');\n })}\n </Fragment>\n );\n }\n\n const { label, value } = typeof option === 'string' ? commonQuickOptions[option] : option;\n\n return (\n <Button\n key={index}\n variant=\"text\"\n type=\"button\"\n css={{\n color: 'inherit',\n }}\n onClick={() => {\n onSelect?.();\n onChange(value instanceof Function ? value(props) : value, 'quickOption');\n }}\n >\n {label}\n </Button>\n );\n });\n\n return (\n <div\n css={{\n marginTop: 'var(--spacing)',\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'center',\n }}\n >\n {options}\n </div>\n );\n}\n\nexport function DefaultDatePicker(props: DatePickerProps) {\n const {\n value,\n onChange,\n rangeSelect,\n locale,\n firstDayOfWeek = 1,\n defaultDateInView,\n minDate,\n maxDate,\n showCalendarWeek,\n blockedRanges = [],\n showTime,\n } = props;\n\n const IconButton = useTheme((t) => t.components.IconButton);\n const ChevronRight = useTheme((t) => t.icons.ChevronRight);\n const cssVariables = useCssVariables();\n function getDayCssStyles({\n disabled,\n prevMonth,\n nextMonth,\n today,\n blocked,\n selected,\n preSelected,\n }: {\n disabled?: boolean;\n prevMonth?: boolean;\n nextMonth?: boolean;\n today?: boolean;\n blocked?: boolean;\n selected?: boolean;\n preSelected?: boolean;\n }): Interpolation<Theme> {\n return [\n {\n padding: 10,\n border: 'none',\n background: 'transparent',\n cursor: disabled ? undefined : 'pointer',\n font: 'inherit',\n color: 'inherit',\n },\n (prevMonth || nextMonth) && {\n color: 'var(--date-picker-disemphasized, #bdbdbd)',\n },\n today && {\n outline: '1px solid var(--secondaryMain)',\n },\n blocked && {\n background: 'var(--blockedMain)',\n color: 'var(--blockedContrastText)',\n },\n selected && {\n background: 'var(--primaryMain)',\n color: 'var(--primaryContrastText)',\n },\n blocked &&\n selected && {\n position: 'relative',\n '::before': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n background: 'var(--blockedMain)',\n clipPath: 'polygon(0 0, 0 50%, 50% 0)',\n },\n },\n preSelected && {\n background: 'var(--primaryLight)',\n color: 'var(--primaryContrastText)',\n },\n ];\n }\n\n const mountTime = useMemo(() => new Date(), []);\n const [dirty, setDirty] = useState<Partial<DateRange>>();\n const [hovered, setHovered] = useState<DateRange>();\n const [dateInViewLocal, setDateInViewLocal] = useState<Date>(defaultDateInView ?? mountTime);\n const dateInView = props.dateInView ?? dateInViewLocal;\n\n function setDateInView(date: Date) {\n setDateInViewLocal(date);\n props.onDateInViewChange?.(date);\n }\n\n const min = dirty ? dirty.min : value instanceof Date ? value : value?.min;\n const max = dirty ? dirty.max : value instanceof Date ? value : value?.max;\n\n const { calendars, getBackProps, getForwardProps, getDateProps } = useDayzed({\n onDateSelected: () => undefined,\n firstDayOfWeek,\n showOutsideDays: true,\n date: dateInView,\n onOffsetChanged: (offset) =>\n setDateInView(new Date(dateInView.getFullYear(), dateInView.getMonth() + offset)),\n offset: 0,\n minDate,\n maxDate,\n });\n const now = useMemo(() => startOfDay(new Date()), []);\n\n const formatWeekday = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { weekday: 'short' });\n return (weekDay: number) =>\n format(new Date(Date.UTC(2021, 7, ((weekDay + firstDayOfWeek) % 7) + 1)));\n }, [locale, firstDayOfWeek]);\n\n useEffect(\n () =>\n setDateInView(\n value === null\n ? (defaultDateInView ?? mountTime)\n : value instanceof Date\n ? value\n : value.max,\n ),\n [getValueForComparison(value), getValueForComparison(defaultDateInView), mountTime],\n );\n\n useEffect(() => {\n if (!rangeSelect) {\n setDirty(undefined);\n }\n }, [rangeSelect]);\n\n function set(source: DatePickerChangeSource, min?: Date, max?: Date, edit?: 'min' | 'max') {\n if (!rangeSelect) {\n onChange(min ?? null, source);\n return;\n }\n\n if (min && max && min > max) {\n if (edit === 'min') {\n max = min;\n } else if (edit === 'max') {\n min = max;\n } else {\n [min, max] = [max, min];\n }\n }\n\n if (!min === !max) {\n setDirty(undefined);\n onChange(min && max ? { min, max: endOfDay(max) } : null, source);\n } else {\n setDirty({ min, max });\n }\n }\n\n const formatMonth = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { month: 'long' });\n return (month: number) => format(new Date(2021, month));\n }, [locale]);\n\n const formatYear = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { year: 'numeric' });\n return (year: number) => format(new Date(year, 0, 1));\n }, [locale]);\n\n return (\n <div\n css={[\n cssVariables,\n {\n color: 'var(--table-text-color)',\n },\n ]}\n >\n <div\n css={{\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 'calc(var(--spacing) * 4)',\n\n '& > div': {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n },\n }}\n >\n <div>\n <DateInput\n value={min ?? null}\n onChange={(newMin) => set('input', newMin ?? undefined, max, 'min')}\n locale={locale}\n />\n\n {showTime && (\n <TimeInput\n value={min ?? null}\n onChange={(newMin) => set('input', newMin ?? undefined, max, 'min')}\n locale={locale}\n showSeconds={typeof showTime === 'boolean' ? true : showTime.showSeconds}\n />\n )}\n </div>\n\n {rangeSelect && (\n <>\n {' - '}\n\n <div>\n <DateInput\n value={max ?? null}\n onChange={(newMax) => set('input', min, newMax ?? undefined, 'max')}\n locale={locale}\n />\n\n {showTime && (\n <TimeInput\n value={max ?? null}\n onChange={(newMax) => set('input', min, newMax ?? undefined, 'max')}\n locale={locale}\n showSeconds={typeof showTime === 'boolean' ? true : showTime.showSeconds}\n />\n )}\n </div>\n </>\n )}\n </div>\n\n {calendars.map(({ month, year, weeks }) => (\n <div key={`${month}${year}`} css={{ display: 'grid' }}>\n <div\n css={{\n margin: 'calc(var(--spacing) * 4) 0',\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <IconButton type=\"button\" {...getBackProps({ calendars })}>\n <ChevronRight css={{ transform: 'rotate3d(0, 0, 1, 180deg)' }} />\n </IconButton>\n\n <div css={{ display: 'flex' }}>\n {formatMonth(month)} {formatYear(year)}\n </div>\n\n <IconButton type=\"button\" {...getForwardProps({ calendars })}>\n <ChevronRight />\n </IconButton>\n </div>\n\n <div\n css={{\n justifySelf: 'center',\n display: 'grid',\n gridTemplateColumns: 'repeat(8, max-content)',\n }}\n >\n {showCalendarWeek ? (\n <div\n css={{\n justifySelf: 'center',\n padding: 10,\n borderRight:\n '1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))',\n }}\n >\n <Text id=\"calendarWeek\" />\n </div>\n ) : (\n <div />\n )}\n\n {weekDays.map((_v, weekDay) => (\n <div\n key={weekDay}\n css={{\n justifySelf: 'center',\n padding: 10,\n }}\n >\n {formatWeekday(weekDay)}\n </div>\n ))}\n\n {weeks.map((week, index) => {\n const weekStart = week[0] as DayzedDateObject;\n const weekEnd = week[6] as DayzedDateObject;\n const weekDisabled =\n !rangeSelect ||\n (minDate && weekEnd.date < minDate) ||\n (maxDate && weekStart.date > maxDate);\n\n return (\n <Fragment key={index}>\n {showCalendarWeek ? (\n <button\n type=\"button\"\n css={{\n padding: 10,\n border: 'none',\n background: 'transparent',\n cursor: weekDisabled ? undefined : 'pointer',\n font: 'inherit',\n borderRight:\n '1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))',\n color: 'inherit',\n }}\n onClick={() => {\n if (weekDisabled) {\n return;\n }\n\n const min = minDate && weekStart.date < minDate ? minDate : weekStart.date;\n const max = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;\n set('calendarWeek', min, max);\n }}\n onPointerOver={() =>\n !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date })\n }\n onPointerOut={() => !weekDisabled && setHovered(undefined)}\n >\n {getCalendarWeek(weekEnd.date)}\n </button>\n ) : (\n <div />\n )}\n\n {week.map((dateObject, dayIndex) => {\n if (!dateObject) {\n return <div key={dayIndex} />;\n }\n\n const { prevMonth, nextMonth, date } = dateObject;\n const today = startOfDay(date).getTime() === now.getTime();\n const disabled = (minDate && date < minDate) || (maxDate && date > maxDate);\n\n const selected =\n date.getTime() === min?.getTime() ||\n (min && max && dateIntersect(date, { min, max }));\n const preSelected =\n !selected &&\n !disabled &&\n (dateIntersect(date, hovered) ||\n (min &&\n !max &&\n hovered &&\n dateIntersect(\n date,\n min <= hovered.min\n ? { min, max: hovered.min }\n : { min: hovered.max, max: min },\n )));\n const blocked = blockedRanges.some((range) => dateIntersect(date, range));\n\n return (\n <button\n type=\"button\"\n key={`${index}-${dayIndex}`}\n css={getDayCssStyles({\n disabled,\n prevMonth,\n nextMonth,\n today,\n blocked,\n selected,\n preSelected,\n })}\n {...getDateProps({ dateObj: dateObject })}\n onClick={() => {\n if (dirty) {\n if (min) set('calendar', min, date);\n else set('calendar', date, max);\n } else {\n set('calendar', date);\n }\n }}\n onPointerOver={() => setHovered({ min: date, max: date })}\n onPointerOut={() => setHovered(undefined)}\n disabled={disabled}\n >\n {date.getDate()}\n </button>\n );\n })}\n </Fragment>\n );\n })}\n </div>\n </div>\n ))}\n\n <DatePickerQuickOptions {...props} onSelect={() => setDirty(undefined)} />\n </div>\n );\n}\n","import { css } from '@emotion/react';\n\nexport function Spinner({ className }: { className?: string }) {\n return (\n <div\n className={className}\n css={css`\n display: inline-block;\n position: relative;\n width: 1em;\n height: 1em;\n\n div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 0.8em;\n height: 0.8em;\n margin: 0.1em;\n border: 0.1em solid #fff;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: currentColor transparent transparent transparent;\n }\n div:nth-of-type(1) {\n animation-delay: -0.45s;\n }\n div:nth-of-type(2) {\n animation-delay: -0.3s;\n }\n div:nth-of-type(3) {\n animation-delay: -0.15s;\n }\n @keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n `}\n >\n <div />\n <div />\n <div />\n </div>\n );\n}\n","import type { TableTheme } from '../../types';\n\nexport const Badge: TableTheme['components']['Badge'] = ({ badgeContent, children }) => {\n return (\n <span\n css={{\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n verticalAlign: 'middle',\n }}\n >\n {children}\n\n <span\n css={[\n {\n top: 0,\n right: 0,\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n height: 20,\n display: 'flex',\n padding: '0 6px',\n zIndex: 1,\n position: 'absolute',\n flexWrap: 'wrap',\n minWidth: 20,\n transition: 'transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',\n alignItems: 'center',\n lineHeight: 1,\n alignContent: 'center',\n borderRadius: 10,\n justifyContent: 'center',\n fontSize: '0.8em',\n },\n !badgeContent && {\n transform: 'scale(0) translate(50%, -50%)',\n transition: 'transform 195ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',\n },\n ]}\n >\n {badgeContent}\n </span>\n </span>\n );\n};\n","import type { TableTheme } from '../../types';\n\nexport const Button: TableTheme['components']['Button'] = ({\n startIcon,\n children,\n variant = 'text',\n ...props\n}) => {\n return (\n <button\n css={[\n {\n padding: `var(--spacing) calc(var(--spacing) * 2)`,\n display: 'inline-flex',\n alignItems: 'center',\n transition: 'background-color 150ms',\n border: 'none',\n cursor: 'pointer',\n background: 'transparent',\n borderRadius: 4,\n\n '&:active:not(:disabled)': {\n transform: 'scale3d(0.95, 0.95, 1)',\n },\n },\n variant === 'text' && {\n '&:hover': {\n background: 'rgba(0, 0, 0, 0.1)',\n },\n },\n variant === 'outlined' && {\n border: '1px solid var(--table-button-border, var(--table-border, #777777))',\n\n '&:disabled': {\n borderColor: 'var(--table-button-border-disabled, #eeeeee)',\n },\n },\n variant === 'contained' && {\n color: 'var(--primaryContrastText)',\n backgroundColor: 'var(--primaryMain)',\n boxShadow:\n '0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%)',\n\n '&:hover': {\n filter: 'brightness(0.9)',\n },\n\n '&:disabled': {\n filter: 'grayscale()',\n opacity: 0.5,\n },\n },\n ]}\n {...props}\n >\n {startIcon && <span css={{ marginRight: `calc(var(--spacing) * 2)` }}>{startIcon}</span>}\n <span>{children}</span>\n </button>\n );\n};\n","import type { Id, SingleOrMultiple, TableItem } from '../types';\n\nexport const flatMap = <T, S>(array: Iterable<T>, flatMap: (t: T) => S[]): S[] => {\n return [...array].flatMap(flatMap);\n};\n\nexport const orderBy = <T>(\n array: T[],\n selectors: ((t: T) => any)[] = [],\n direction: ('desc' | 'asc')[] = [],\n locale?: (string | undefined)[],\n options?: (Intl.CollatorOptions | undefined)[],\n): T[] => {\n if (selectors.length === 0) selectors = [(t) => t];\n\n return [...array].sort((a, b) => {\n for (let i = 0; i < selectors.length; i++) {\n const _a = selectors[i]?.(a);\n const _b = selectors[i]?.(b);\n const _direction = direction[i] === 'desc' ? -1 : 1;\n const _locale = locale?.[i];\n const _options = options?.[i];\n\n if (typeof _a === 'string' && typeof _b === 'string') {\n const result = _a.localeCompare(_b, _locale, _options);\n if (result !== 0) return result * _direction;\n continue;\n }\n\n if (_a > _b) return _direction;\n if (_a < _b) return -_direction;\n }\n return 0;\n });\n};\n\nexport const uniq = <T>(array: T[]): T[] => {\n const set = new Set<T>();\n for (const t of array) set.add(t);\n return Array.from(set);\n};\n\nexport const intersect = <T>(a: Iterable<T>, b: { has(t: T): boolean }): Set<T> => {\n const result = new Set<T>();\n for (const x of a) if (b.has(x)) result.add(x);\n return result;\n};\n\nexport const getAncestors = <T>(\n activeItemsById: Map<Id, TableItem<T>>,\n ...items: TableItem<T>[]\n): Set<Id> => {\n const result = new Set<Id>();\n\n const find = ({ parentId }: TableItem<T>): void => {\n const parent =\n parentId !== undefined && parentId !== null ? activeItemsById.get(parentId) : undefined;\n if (parent && !result.has(parent.id)) {\n result.add(parent.id);\n find(parent);\n }\n };\n items.forEach(find);\n return result;\n};\n\nexport const getDescendants = <T>(...items: TableItem<T>[]): Set<Id> => {\n const result = new Set<Id>();\n\n const find = (item: TableItem<T>): void => {\n for (const child of item.children) {\n if (!result.has(child.id)) {\n result.add(child.id);\n find(child);\n }\n }\n };\n items.forEach(find);\n return result;\n};\n\nexport const identity = (x: unknown): any => x;\n\nexport const asString = (x: unknown): string => {\n if (Array.isArray(x)) return x.map(asString).join(', ');\n if (x === null || x === undefined) return '';\n if (x instanceof Object) return JSON.stringify(x);\n return String(x as string | number | bigint | boolean | symbol);\n};\n\nexport const asStringOrArray = (x: unknown): string | string[] => {\n if (Array.isArray(x)) return x.map(asString);\n return asString(x);\n};\n\nexport const asNumber = (x: unknown): number | null => {\n const n = Number(x);\n return Number.isNaN(n) ? null : n;\n};\n\nexport const asNumberOrArray = (x: unknown): number | null | (number | null)[] => {\n if (Array.isArray(x)) return x.map(asNumber);\n return asNumber(x);\n};\n\nexport const defaultEquals = (a: unknown, b: unknown): boolean => a === b;\n\nexport const subStringMatch = (a: string, b: string): boolean =>\n a.toLowerCase().includes(b.toLowerCase());\n\nexport const castArray = <T>(a: T | T[]) => (Array.isArray(a) ? a : [a]);\n\nexport const cx = (\n ...classNames: (string | false | undefined | null | Record<string, boolean>)[]\n) =>\n classNames\n .flatMap((entry) => {\n if (!entry) return [];\n if (typeof entry === 'string') return [entry];\n return Object.entries(entry)\n .filter(([, predicate]) => predicate)\n .map(([className]) => className);\n })\n .join(' ');\n\ntype Falsy = false | 0 | '' | null | undefined;\nexport function isTruthy<T>(x: T): x is Exclude<T, Falsy> {\n return !!x;\n}\n\n/** The single values of a `SingleOrMultiple` value. */\nexport function toSingles<T>(value: SingleOrMultiple<T>): readonly T[] {\n if (Array.isArray(value)) return value;\n if (value instanceof Set) return [...value];\n return [value as T];\n}\n","import createCache, { type EmotionCache } from '@emotion/cache';\n// Aliased to a `use…` name: React Compiler only treats functions named like that as hooks, and\n// would otherwise call it on the first render only.\nimport {\n __unsafe_useEmotionCache as useEmotionCache,\n useTheme as useEmotionTheme,\n} from '@emotion/react';\nimport { serializeStyles, type Interpolation, type SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\nimport { useMemo } from 'react';\n\nexport type ClassNameOf = (...styles: Interpolation<any>[]) => string;\n\nconst isServer = typeof document === 'undefined';\n\nconst isSerialized = (x: object): x is SerializedStyles =>\n typeof (x as SerializedStyles).name === 'string' &&\n typeof (x as SerializedStyles).styles === 'string';\n\n/**\n * Turns emotion styles into a class name without re-serializing them on every call: serialized styles\n * are keyed by their hash, objects and functions by identity. Styles are inserted on the client only.\n */\nfunction createClassNameOf(cache: EmotionCache, theme: object | undefined): ClassNameOf {\n const classNames = new Map<string, string>();\n const ids = new WeakMap<object, number>();\n let nextId = 0;\n\n const keyOf = (style: Interpolation<any>): string => {\n if (style === null || style === undefined || typeof style === 'boolean') return '';\n if (typeof style !== 'object' && typeof style !== 'function') {\n return `${typeof style}:${String(style)}`;\n }\n if (typeof style === 'object' && isSerialized(style)) return `s:${style.name}`;\n let id = ids.get(style);\n if (id === undefined) ids.set(style, (id = nextId++));\n return `o:${id}`;\n };\n\n return (...styles) => {\n const key = JSON.stringify(styles.map(keyOf));\n let className = classNames.get(key);\n if (className === undefined) {\n // The theme is what the css prop passes to function interpolations.\n const serialized = serializeStyles(styles, cache.registered, theme);\n if (!isServer) insertStyles(cache, serialized, false);\n className = serialized.styles ? `${cache.key}-${serialized.name}` : '';\n // Function styles returning fresh objects would grow this forever.\n if (classNames.size > 5000) classNames.clear();\n classNames.set(key, className);\n }\n return className;\n };\n}\n\n// Without a CacheProvider, @emotion/react uses a cache keyed `css` in the browser and none on the\n// server; these mirror it so server and client produce the same class names.\nlet standaloneAppCache: EmotionCache | undefined;\nconst getStandaloneAppCache = () => (standaloneAppCache ??= createCache({ key: 'css' }));\n\nconst libraryClassNameOf = new WeakMap<EmotionCache, ClassNameOf>();\n\n/**\n * For the library's own styles. They go into a separate cache that is prepended to the document, so\n * user styles of equal specificity (emotion or plain CSS) always override them. It inherits the app\n * cache's nonce and container.\n */\nexport function useLibraryClassName(): ClassNameOf {\n const appCache = useEmotionCache() ?? getStandaloneAppCache();\n\n return useMemo(() => {\n let classNameOf = libraryClassNameOf.get(appCache);\n if (!classNameOf) {\n // A prepended sheet takes the top spot when it creates its first tag. If the app cache is\n // prepended too (MUI's recommended setup) and hasn't created one yet, it would later land above\n // ours and lose to the library styles, so make it create its tag first.\n if (!isServer && appCache.sheet.tags.length === 0) {\n insertStyles(appCache, serializeStyles(['--schummar-table: 1;']), false);\n }\n\n classNameOf = createClassNameOf(\n createCache({\n key: `${appCache.key}-st`,\n prepend: true,\n nonce: appCache.nonce,\n container: appCache.sheet.container,\n }),\n undefined,\n );\n libraryClassNameOf.set(appCache, classNameOf);\n }\n return classNameOf;\n }, [appCache]);\n}\n\nconst userClassNameOf = new WeakMap<EmotionCache, WeakMap<object, ClassNameOf>>();\n\n/**\n * For user supplied styles, and for library styles that must beat a theme component's own styles:\n * the app's emotion cache, with its theme for function interpolations.\n */\nexport function useUserClassName(): ClassNameOf {\n const appCache = useEmotionCache() ?? getStandaloneAppCache();\n const theme = useEmotionTheme();\n\n return useMemo(() => {\n let byTheme = userClassNameOf.get(appCache);\n if (!byTheme) userClassNameOf.set(appCache, (byTheme = new WeakMap()));\n\n let classNameOf = byTheme.get(theme);\n if (!classNameOf) byTheme.set(theme, (classNameOf = createClassNameOf(appCache, theme)));\n return classNameOf;\n }, [appCache, theme]);\n}\n","import { css } from '@emotion/react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst labelCss = css({\n padding: 'calc(var(--spacing) * 1.8)',\n display: 'flex',\n color: 'currentcolor',\n userSelect: 'none',\n\n '& input': {\n appearance: 'none',\n margin: 0,\n },\n});\n\nconst disabledCss = css({ color: 'rgba(0, 0, 0, 0.26)' });\n\nconst iconCss = css({ fontSize: '1.25rem', width: '1em', height: '1em', fill: 'currentColor' });\n\nconst checkedIconCss = css({ fill: 'var(--primaryMain)' });\n\nexport const Checkbox: TableTheme['components']['Checkbox'] = ({ className, ...props }) => {\n const libraryClass = useLibraryClassName();\n\n return (\n <label\n className={cx(libraryClass(labelCss), props.disabled && libraryClass(disabledCss), className)}\n >\n <input type=\"checkbox\" {...props} />\n\n {props.checked ? (\n <svg\n className={libraryClass(iconCss, checkedIconCss)}\n focusable=\"false\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path d=\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"></path>\n </svg>\n ) : (\n <svg\n className={libraryClass(iconCss)}\n focusable=\"false\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path d=\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\"></path>\n </svg>\n )}\n </label>\n );\n};\n","import { css } from '@emotion/react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst iconButtonCss = css({\n padding: 'var(--spacing)',\n borderRadius: '50%',\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n transition: 'background-color 150ms',\n border: 'none',\n cursor: 'pointer',\n color: 'inherit',\n background: 'transparent',\n\n '&:hover': {\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n },\n\n '&:active': {\n transformColor: 'scale3d(0.95, 0.95, 1)',\n },\n});\n\nexport const IconButton: TableTheme['components']['IconButton'] = ({ className, ...props }) => {\n const libraryClass = useLibraryClassName();\n return <button className={cx(libraryClass(iconButtonCss), className)} {...props} />;\n};\n","import type { TableTheme } from '../../types';\n\nexport const TextField: TableTheme['components']['TextField'] = ({\n startIcon,\n endIcon,\n className,\n inputRef,\n onBlur,\n ...props\n}) => {\n return (\n <div\n className={className}\n css={[\n {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n border: '1px solid var(--table-textfield-border, var(--table-border, #777777))',\n borderRadius: 4,\n\n '&:focus-within': {\n border: '2px solid var(--primaryMain)',\n margin: -1,\n },\n },\n ]}\n >\n {startIcon}\n\n <input\n ref={inputRef}\n {...props}\n value={props.value ?? ''}\n onBlur={onBlur}\n css={{\n minWidth: 0,\n width: '100%',\n flex: 1,\n border: 'none',\n outline: 'none',\n borderRadius: 4,\n padding: 'calc(var(--spacing) * 2)',\n paddingLeft: startIcon ? 0 : undefined,\n paddingRight: endIcon ? 0 : undefined,\n transition: 'outline 500ms',\n }}\n />\n\n {endIcon}\n </div>\n );\n};\n","import { DefaultDatePicker } from '../../components/datePicker';\nimport { Spinner } from '../../components/spinnner';\nimport type { TableTheme } from '../../types';\nimport { Badge } from './badge';\nimport { Button } from './button';\nimport { Checkbox } from './checkbox';\nimport { IconButton } from './iconButton';\nimport { Popover } from './popover';\nimport { TextField } from './textField';\n\nexport const defaultComponents: TableTheme['components'] = {\n IconButton,\n Checkbox,\n Popover,\n Button,\n Badge,\n TextField,\n Spinner,\n DatePicker: DefaultDatePicker,\n};\n","import { css } from '@emotion/react';\nimport type { HTMLProps, ReactElement } from 'react';\nimport { cloneElement } from 'react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst IconDefaultStyle = css({\n width: '1.5em',\n height: '1.5em',\n color: 'inherit',\n});\n\nfunction Icon(svg: ReactElement<HTMLProps<Element>>) {\n return function IconComponent(props: HTMLProps<Element>) {\n const libraryClass = useLibraryClassName();\n return cloneElement(svg, {\n ...props,\n className: cx(libraryClass(IconDefaultStyle), props.className),\n });\n };\n}\n\nconst Settings = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z\" />\n </svg>,\n);\n\nconst Export = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n enableBackground=\"new 0 0 24 24\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <g>\n <rect fill=\"none\" height=\"24\" width=\"24\" />\n </g>\n <g>\n <path d=\"M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z\" />\n </g>\n </svg>,\n);\n\nconst Clipboard = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z\" />\n </svg>,\n);\n\nconst ChevronRight = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\" />\n </svg>,\n);\n\nconst Search = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </svg>,\n);\n\nconst Clear = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\" />\n </svg>,\n);\n\nconst ArrowDropDown = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M7 10l5 5 5-5H7z\" />\n </svg>,\n);\n\nconst FilterList = Icon(\n <svg viewBox=\"0 0 24 24\">\n <path\n fill=\"currentColor\"\n d=\"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z\"\n />\n </svg>,\n);\n\nconst ArrowUpward = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </svg>,\n);\n\nexport const defaultIcons: TableTheme['icons'] = {\n Settings,\n Export,\n Clipboard,\n ChevronRight,\n Search,\n Clear,\n ArrowDropDown,\n FilterList,\n ArrowUpward,\n};\n","import type { TableTheme } from '../../types';\n\nexport const defaultTexts: TableTheme['text'] = {\n selectColumns: 'Select visible columns',\n showAllColumns: 'Show all',\n hideAllColumns: 'Hide all',\n noResults: 'No results',\n exportTitle: 'Export',\n exportCopy: 'To clipboard',\n exportDownload: 'Download',\n today: 'Today',\n thisWeek: 'This week',\n thisMonth: 'This month',\n thisYear: 'This year',\n lastSevenDays: 'Last 7 days',\n lastThirtyDays: 'Last 30 days',\n clearFilters: 'Clear all filters',\n reset: 'Reset',\n loading: 'Loading',\n deselectAll: 'Deselect all',\n resetAll: 'Reset table state',\n rangeMin: 'Min',\n rangeMax: 'Max',\n calendarWeek: 'Wk',\n hiddenColumnFilters: 'Filters of hidden columns',\n};\n","import type { TableTheme } from '../../types';\nimport { defaultColors } from './defaultColors';\nimport { defaultComponents } from './defaultComponents';\nimport { defaultIcons } from './defaultIcons';\nimport { defaultTexts } from './defaultTexts';\n\nexport const defaultTableTheme: TableTheme = {\n text: defaultTexts,\n components: defaultComponents,\n icons: defaultIcons,\n colors: defaultColors,\n spacing: '5px',\n};\n","import { createContext, useContext, useMemo } from 'react';\nimport { TableSettingsContext } from '../misc/tableSettings';\nimport { defaultTableTheme } from '../theme/defaultTheme';\nimport { mergeThemes } from '../theme/tableTheme';\nimport type { InternalColumn, PartialTableTheme, TableTheme } from '../types';\n\nexport const ThemeContext = createContext<TableTheme<any> | null>(null);\n\n/** default < TableSettingsProvider < table props, merged once per change instead of per consumer. */\nexport function useTableTheme<T>(props: PartialTableTheme<T>): TableTheme<T> {\n const { theme: contextTheme } = useContext(TableSettingsContext);\n const { text, classes, styles, components, icons, colors, spacing } = props;\n\n return useMemo(\n () =>\n mergeThemes<T>(defaultTableTheme as TableTheme<T>, contextTheme as PartialTableTheme<T>, {\n text,\n classes,\n styles,\n components,\n icons,\n colors,\n spacing,\n }) as TableTheme<T>,\n [contextTheme, text, classes, styles, components, icons, colors, spacing],\n );\n}\n\nexport function useTheme<T, S>(selector: (theme: TableTheme<T>) => S): S {\n const tableTheme = useContext(ThemeContext);\n const { theme: contextTheme } = useContext(TableSettingsContext);\n const fallback = useMemo(\n () =>\n tableTheme\n ? undefined\n : (mergeThemes(defaultTableTheme, contextTheme) as TableTheme<unknown>),\n [tableTheme, contextTheme],\n );\n\n return selector((tableTheme ?? fallback) as TableTheme<T>);\n}\n\n/** The theme with a column's own classes and styles layered on top. */\nexport function columnTheme<T>(\n theme: TableTheme<T>,\n column: Pick<InternalColumn<T, unknown>, 'classes' | 'styles'> | undefined,\n): TableTheme<T> {\n if (!column?.classes && !column?.styles) return theme;\n return {\n ...theme,\n classes: { ...theme.classes, ...column.classes },\n styles: { ...theme.styles, ...column.styles },\n };\n}\n"],"mappings":";;;;;;;;;;;;AAEA,MAAa,gBAAsC;CACjD,SAAS;EAAE,MAAM;EAAW,OAAO;EAAW,cAAc;CAAO;CACnE,WAAW;EAAE,MAAM;EAAW,OAAO;EAAW,cAAc;CAAO;CACrE,SAAS;EAAE,MAAM;EAAW,OAAO;EAAW,cAAc;CAAO;CACnE,YAAY;CACZ,MAAM;CACN,QAAQ;CACR,aAAa;AACf;;;ACVA,SAAgB,SAA2B,OAAU,GAAG,MAAuB;CAC7E,OAAO,KAAK,QAAW,KAAK,WAAW;EACrC,MAAM,OAAO,EAAE,GAAG,IAAI;EAEtB,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAC9C,KAAK,SAAoB;EAG3B,OAAO;CACT,GAAG,KAAK;AACV;;;ACRA,SAAgB,kBAAkB;CAChC,OAAO,UAAU,EAAE,SAAS,aAAa;EACvC,OAAO;GACL,aAAa;GACb,iBAAiB,OAAO,QAAQ;GAChC,kBAAkB,OAAO,QAAQ;GACjC,yBAAyB,OAAO,QAAQ;GACxC,mBAAmB,OAAO,UAAU;GACpC,oBAAoB,OAAO,UAAU;GACrC,2BAA2B,OAAO,UAAU;GAC5C,iBAAiB,OAAO,QAAQ;GAChC,kBAAkB,OAAO,QAAQ;GACjC,yBAAyB,OAAO,QAAQ;GACxC,4BAA4B,OAAO;GACnC,sBAAsB,OAAO;GAC7B,wBAAwB,OAAO;GAC/B,8BAA8B,OAAO;EACvC;CACF,CAAC;AACH;;;;;;;;;;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ACNA,MAAa,gBAAA,GAAeC,MAAAA,cAAAA,CAAsC,IAAI;;AAGtE,SAAgB,cAAiB,OAA4C;CAC3E,MAAM,EAAE,OAAO,kBAAA,GAAiBC,MAAAA,WAAAA,CAAWC,mBAAAA,oBAAoB;CAC/D,MAAM,EAAE,MAAM,SAAS,QAAQ,YAAY,OAAO,QAAQ,YAAY;CAEtE,QAAA,GAAOC,MAAAA,QAAAA,OAEHC,mBAAAA,YAAe,mBAAoC,cAAsC;EACvF;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,GACH;EAAC;EAAc;EAAM;EAAS;EAAQ;EAAY;EAAO;EAAQ;CAAO,CAC1E;AACF;AAEA,SAAgB,SAAe,UAA0C;CACvE,MAAM,cAAA,GAAaH,MAAAA,WAAAA,CAAW,YAAY;CAC1C,MAAM,EAAE,OAAO,kBAAA,GAAiBA,MAAAA,WAAAA,CAAWC,mBAAAA,oBAAoB;CAC/D,MAAM,YAAA,GAAWC,MAAAA,QAAAA,OAEb,aACI,KAAA,IACCC,mBAAAA,YAAY,mBAAmB,YAAY,GAClD,CAAC,YAAY,YAAY,CAC3B;CAEA,OAAO,SAAU,cAAc,QAA0B;AAC3D;;AAGA,SAAgB,YACd,OACA,QACe;CACf,IAAI,CAAC,QAAQ,WAAW,CAAC,QAAQ,QAAQ,OAAO;CAChD,OAAO;EACL,GAAG;EACH,SAAS;GAAE,GAAG,MAAM;GAAS,GAAG,OAAO;EAAQ;EAC/C,QAAQ;GAAE,GAAG,MAAM;GAAQ,GAAG,OAAO;EAAO;CAC9C;AACF"}
1
+ {"version":3,"file":"useTheme-BrKiZfIC.cjs","names":["differenceInCalendarMonths","addDays","isBefore","startOfDay","isToday","useState","useRef","className","defaultDate","isIncludedType","maxValues","tabNext","useId","useState","useMemo","Fragment","useId","useState","useMemo","Fragment","createContext","useMemo","Temporal","useContext","Fragment","useState","serializeStyles","createCache","useEmotionCache","useMemo","useEmotionTheme","css","css","css","cloneElement","createContext","useContext","TableSettingsContext","useMemo","mergeThemes"],"sources":["../src/theme/defaultTheme/defaultColors.ts","../src/misc/defaults.ts","../src/theme/useCssVariables.ts","../src/vendor/dayzed/utils.ts","../src/vendor/dayzed/dayzed.ts","../src/hooks/useLatestRef.ts","../src/misc/debounce.ts","../src/components/dateInput.tsx","../src/components/text.tsx","../src/components/timeInput.tsx","../src/components/datePicker.tsx","../src/components/spinnner.tsx","../src/theme/defaultTheme/badge.tsx","../src/theme/defaultTheme/button.tsx","../src/misc/helpers.ts","../src/theme/emotion.ts","../src/theme/defaultTheme/checkbox.tsx","../src/theme/defaultTheme/iconButton.tsx","../src/theme/defaultTheme/textField.tsx","../src/theme/defaultTheme/defaultComponents.ts","../src/theme/defaultTheme/defaultIcons.tsx","../src/theme/defaultTheme/defaultTexts.tsx","../src/theme/defaultTheme/index.tsx","../src/hooks/useTheme.ts"],"sourcesContent":["import type { TableTheme } from '../../types';\n\nexport const defaultColors: TableTheme['colors'] = {\n primary: { main: '#1976d2', light: '#42a5f5', contrastText: '#fff' },\n secondary: { main: '#9c27b0', light: '#ba68c8', contrastText: '#fff' },\n blocked: { main: '#f44336', light: '#f26257', contrastText: '#fff' },\n background: '#ffffff',\n text: 'inherit',\n border: '#777',\n borderLight: '#eee',\n};\n","export function defaults<T extends object>(first: T, ...more: Partial<T>[]): T {\n return more.reduce<T>((acc, source) => {\n const copy = { ...acc };\n\n for (const [key, value] of Object.entries(source)) {\n copy[key as keyof T] ??= value as any;\n }\n\n return copy;\n }, first);\n}\n","import { useTheme } from '../hooks/useTheme';\n\nexport function useCssVariables() {\n return useTheme(({ spacing, colors }) => {\n return {\n '--spacing': spacing,\n '--primaryMain': colors.primary.main,\n '--primaryLight': colors.primary.light,\n '--primaryContrastText': colors.primary.contrastText,\n '--secondaryMain': colors.secondary.main,\n '--secondaryLight': colors.secondary.light,\n '--secondaryContrastText': colors.secondary.contrastText,\n '--blockedMain': colors.blocked.main,\n '--blockedLight': colors.blocked.light,\n '--blockedContrastText': colors.blocked.contrastText,\n '--table-background-color': colors.background,\n '--table-text-color': colors.text,\n '--table-border-color': colors.border,\n '--table-border-light-color': colors.borderLight,\n };\n });\n}\n","import { addDays, isBefore, isToday, startOfDay, differenceInCalendarMonths } from 'date-fns';\nimport { SyntheticEvent } from 'react';\n\nexport type DayzedDateObject = {\n date: Date;\n nextMonth: boolean;\n prevMonth: boolean;\n selectable: boolean;\n selected: boolean;\n today: boolean;\n};\n\nexport type DayzedCalendar = {\n firstDayOfMonth: Date;\n lastDayOfMonth: Date;\n month: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;\n weeks: Array<Array<DayzedDateObject | ''>>;\n year: number;\n};\n\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls\n * `event.preventDefault()`. Not sure this is the best\n * way to do this, but it seems legit...\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\nexport function composeEventHandlers(\n ...fns: (((event: SyntheticEvent, ...args: any[]) => any) | undefined)[]\n) {\n return (event: SyntheticEvent, ...args: any[]) =>\n fns.some((fn) => {\n if (fn) {\n fn(event, ...args);\n }\n return event.defaultPrevented;\n });\n}\n\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\nexport function requiredProp(fnName: string, propName: string): never {\n throw new Error(`The property \"${propName}\" is required in \"${fnName}\"`);\n}\n\n/**\n * Takes a calendars array and figures out the number of months to subtract\n * based on the current offset and the minDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Number} param.offset The num of months to be subtracted\n * @param {Date} param.minDate The earliest date we are allow to subtract back to\n * @returns {Number} The number of months to subtract\n */\nexport function subtractMonth({\n calendars,\n offset,\n minDate,\n}: {\n calendars: DayzedCalendar[];\n offset: number;\n minDate?: Date;\n}) {\n if (offset > 1 && minDate) {\n const { firstDayOfMonth } = calendars[0]!;\n const diffInMonths = differenceInCalendarMonths(firstDayOfMonth, minDate);\n if (diffInMonths < offset) {\n offset = diffInMonths;\n }\n }\n return offset;\n}\n\n/**\n * Takes a calendars array and figures out the number of months to add\n * based on the current offset and the maxDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Number} param.offset The num of months to be added\n * @param {Date} param.maxDate The furthest date we are allow to add forward to\n * @returns {Number} The number of months to add\n */\nexport function addMonth({\n calendars,\n offset,\n maxDate,\n}: {\n calendars: DayzedCalendar[];\n offset: number;\n maxDate?: Date;\n}) {\n if (offset > 1 && maxDate) {\n const { lastDayOfMonth } = calendars[calendars.length - 1]!;\n const diffInMonths = differenceInCalendarMonths(maxDate, lastDayOfMonth);\n if (diffInMonths < offset) {\n offset = diffInMonths;\n }\n }\n return offset;\n}\n\n/**\n * Takes a calendars array and figures out if the back button should be\n * disabled based on the minDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Date} param.minDate The earliest date available\n * @returns {Boolean} Whether the back button should be disabled.\n */\nexport function isBackDisabled({\n calendars,\n minDate,\n}: {\n calendars: DayzedCalendar[];\n minDate?: Date;\n}) {\n if (!minDate) {\n return false;\n }\n const { firstDayOfMonth } = calendars[0]!;\n const firstDayOfMonthMinusOne = addDays(firstDayOfMonth, -1);\n if (isBefore(firstDayOfMonthMinusOne, minDate)) {\n return true;\n }\n return false;\n}\n\n/**\n * Takes a calendars array and figures out if the forward button should be\n * disabled based on the maxDate allowed.\n * @param {Object} param The param object\n * @param {Array} param.calendars The calendars array created by the getCalendars function\n * @param {Date} param.maxDate The furthest date available\n * @returns {Boolean} Whether the forward button should be disabled.\n */\nexport function isForwardDisabled({\n calendars,\n maxDate,\n}: {\n calendars: DayzedCalendar[];\n maxDate?: Date;\n}) {\n if (!maxDate) {\n return false;\n }\n const { lastDayOfMonth } = calendars[calendars.length - 1]!;\n const lastDayOfMonthPlusOne = addDays(lastDayOfMonth, 1);\n if (isBefore(maxDate, lastDayOfMonthPlusOne)) {\n return true;\n }\n return false;\n}\n\n/**\n * Figures out the months data needed based off the number of monthsToDisplay\n * and other options provided.\n * @param {Object} param The param object\n * @param {Date} param.date The date to start the calendar at\n * @param {Array.<Date>} param.selected An array of dates currently selected\n * @param {Number} param.monthsToDisplay The number of months to return in the calendar view\n * @param {Number} param.offset The number of months to offset based off the param.date given\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Object>} An array of objects with month data\n */\nexport function getCalendars({\n date,\n selected,\n monthsToDisplay,\n offset,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n date: Date;\n selected: Date[];\n monthsToDisplay: number;\n offset: number;\n minDate?: Date;\n maxDate?: Date;\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}): DayzedCalendar[] {\n const months: DayzedCalendar[] = [];\n const startDate = getStartDate(date, minDate, maxDate);\n for (let i = 0; i < monthsToDisplay; i++) {\n const calendarDates = getMonths({\n month: startDate.getMonth() + i + offset,\n year: startDate.getFullYear(),\n selectedDates: selected,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n });\n months.push(calendarDates);\n }\n return months;\n}\n\n/**\n * Figures out the actual start date based on\n * the min and max dates available.\n * @param {Date} date The we want to start the calendar at\n * @param {Date} minDate The earliest date available to start at\n * @param {Date} maxDate The latest date available to start at\n * @returns {Date} The actual start date\n */\nfunction getStartDate(date: Date, minDate?: Date, maxDate?: Date): Date {\n let startDate = startOfDay(date);\n if (minDate) {\n const minDateNormalized = startOfDay(minDate);\n if (isBefore(startDate, minDateNormalized)) {\n startDate = minDateNormalized;\n }\n }\n if (maxDate) {\n const maxDateNormalized = startOfDay(maxDate);\n if (isBefore(maxDateNormalized, startDate)) {\n startDate = maxDateNormalized;\n }\n }\n return startDate;\n}\n\n/**\n * Figures what week/day data to return for the given month\n * and year. Adds flags to day data if found in the given selectedDates,\n * if is selectable inside the given min and max dates, or is today.\n * @param {Object} param The param object\n * @param {Number} param.month The month to grab data for\n * @param {Number} param.year The year to grab data for\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Object} The data for the selected month/year\n */\nfunction getMonths({\n month,\n year,\n selectedDates,\n minDate,\n maxDate,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n month: number;\n year: number;\n selectedDates: Date[];\n minDate?: Date;\n maxDate?: Date;\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}): DayzedCalendar {\n // Get the normalized month and year, along with days in the month.\n const daysMonthYear = getNumDaysMonthYear(month, year);\n const daysInMonth = daysMonthYear.daysInMonth;\n month = daysMonthYear.month;\n year = daysMonthYear.year;\n\n // Fill out the dates for the month.\n const dates: ('' | DayzedDateObject)[] = [];\n for (let day = 1; day <= daysInMonth; day++) {\n const date = new Date(year, month, day);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: isToday(date),\n prevMonth: false,\n nextMonth: false,\n };\n dates.push(dateObj);\n }\n\n const firstDayOfMonth = new Date(year, month, 1);\n const lastDayOfMonth = new Date(year, month, daysInMonth);\n\n const frontWeekBuffer = fillFrontWeek({\n firstDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n });\n\n const backWeekBuffer = fillBackWeek({\n lastDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n });\n\n dates.unshift(...frontWeekBuffer);\n dates.push(...backWeekBuffer);\n\n // Get the filled out weeks for the\n // given dates.\n const weeks = getWeeks(dates);\n // return the calendar data.\n return {\n firstDayOfMonth,\n lastDayOfMonth,\n month: month as DayzedCalendar['month'],\n year,\n weeks,\n };\n}\n\n/**\n * Fill front week with either empty buffer or dates from previous month,\n * depending on showOutsideDays flag\n * @param {Object} param The param object\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Date} param.firstDayOfMonth First day of the month\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Date>} Buffer to fill front week\n */\nfunction fillFrontWeek({\n firstDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n firstDayOfMonth: Date;\n minDate?: Date;\n maxDate?: Date;\n selectedDates: Date[];\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}) {\n const dates: ('' | DayzedDateObject)[] = [];\n let firstDay = (firstDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;\n\n if (showOutsideDays) {\n const lastDayOfPrevMonth = addDays(firstDayOfMonth, -1);\n const prevDate = lastDayOfPrevMonth.getDate();\n const prevDateMonth = lastDayOfPrevMonth.getMonth();\n const prevDateYear = lastDayOfPrevMonth.getFullYear();\n\n // Fill out front week for days from\n // preceding month with dates from previous month.\n let counter = 0;\n while (counter < firstDay) {\n const date = new Date(prevDateYear, prevDateMonth, prevDate - counter);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: false,\n prevMonth: true,\n nextMonth: false,\n };\n dates.unshift(dateObj);\n counter++;\n }\n } else {\n // Fill out front week for days from\n // preceding month with buffer.\n while (firstDay > 0) {\n dates.unshift('');\n firstDay--;\n }\n }\n\n return dates;\n}\n\n/**\n * Fill back weeks with either empty buffer or dates from next month,\n * depending on showOutsideDays flag\n * @param {Object} param The param object\n * @param {Array.<Date>} param.selectedDates An array of dates currently selected\n * @param {Date} param.minDate The earliest date available\n * @param {Date} param.maxDate The furthest date available\n * @param {Date} param.lastDayOfMonth Last day of the month\n * @param {Number} param.firstDayOfWeek First day of week, 0-6 (Sunday to Saturday)\n * @param {Bool} param.showOutsideDays Flag to fill front and back weeks with dates from adjacent months\n * @returns {Array.<Date>} Buffer to fill back week\n */\nfunction fillBackWeek({\n lastDayOfMonth,\n minDate,\n maxDate,\n selectedDates,\n firstDayOfWeek,\n showOutsideDays,\n}: {\n lastDayOfMonth: Date;\n minDate?: Date;\n maxDate?: Date;\n selectedDates: Date[];\n firstDayOfWeek: number;\n showOutsideDays: boolean;\n}) {\n const dates: ('' | DayzedDateObject)[] = [];\n let lastDay = (lastDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;\n\n if (showOutsideDays) {\n const firstDayOfNextMonth = addDays(lastDayOfMonth, 1);\n const nextDateMonth = firstDayOfNextMonth.getMonth();\n const nextDateYear = firstDayOfNextMonth.getFullYear();\n\n // Fill out back week for days from\n // following month with dates from next month.\n let counter = 0;\n while (counter < 6 - lastDay) {\n const date = new Date(nextDateYear, nextDateMonth, 1 + counter);\n const dateObj = {\n date,\n selected: isSelected(selectedDates, date),\n selectable: isSelectable(minDate, maxDate, date),\n today: false,\n prevMonth: false,\n nextMonth: true,\n };\n dates.push(dateObj);\n counter++;\n }\n } else {\n // Fill out back week for days from\n // following month with buffer.\n while (lastDay < 6) {\n dates.push('');\n lastDay++;\n }\n }\n\n return dates;\n}\n\n/**\n * Normalizes month (could be overflow) and year pairs and returns the\n * normalized month and year along with the number of days in the month.\n * @param {Number} month The month to normalize\n * @param {Number} year The year to normalize\n * @returns {Object} The normalized month and year along with the number of days in the month\n */\nfunction getNumDaysMonthYear(month: number, year: number) {\n // If a parameter you specify is outside of the expected range for Month or Day,\n // JS Date attempts to update the date information in the Date object accordingly!\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate\n\n // Let Date handle the overflow of the month,\n // which should return the normalized month and year.\n const normalizedMonthYear = new Date(year, month, 1);\n month = normalizedMonthYear.getMonth();\n year = normalizedMonthYear.getFullYear();\n // Overflow the date to the next month, then subtract the difference\n // to get the number of days in the previous month.\n // This will also account for leap years!\n const daysInMonth = 32 - new Date(year, month, 32).getDate();\n return { daysInMonth, month, year };\n}\n\n/**\n * Takes an array of dates, and turns them into a multi dimensional\n * array with 7 entries for each week.\n * @param {Array.<Object>} dates An array of dates\n * @returns {Array} The weeks as a multi dimensional array\n */\nfunction getWeeks(dates: ('' | DayzedDateObject)[]) {\n const weeksLength = Math.ceil(dates.length / 7);\n const weeks: ('' | DayzedDateObject)[][] = [];\n for (let i = 0; i < weeksLength; i++) {\n weeks[i] = [];\n for (let x = 0; x < 7; x++) {\n weeks[i]!.push(dates[i * 7 + x]!);\n }\n }\n return weeks;\n}\n\n/**\n * Normalizes dates to the beginning of the day,\n * then checks to see if the day given is found\n * in the selectedDates.\n * @param {Array.<Date>} selectedDates An array of dates currently selected\n * @param {Date} date The date to search with against selectedDates\n * @returns {Boolean} Whether day is found in selectedDates\n */\nfunction isSelected(selectedDates: Date[], date: Date): boolean {\n selectedDates = Array.isArray(selectedDates) ? selectedDates : [selectedDates];\n return selectedDates.some((selectedDate) => {\n if (\n selectedDate instanceof Date &&\n startOfDay(selectedDate).getTime() === startOfDay(date).getTime()\n ) {\n return true;\n }\n return false;\n });\n}\n\n/**\n * Checks to see if the date given is\n * between the min and max dates.\n * @param {Date} minDate The earliest date available\n * @param {Date} maxDate The furthest date available\n * @param {Date} date The date to compare with\n * @returns {Boolean} Whether the date is between min and max date\n */\nfunction isSelectable(minDate: Date | undefined, maxDate: Date | undefined, date: Date): boolean {\n if ((minDate && isBefore(date, minDate)) || (maxDate && isBefore(maxDate, date))) {\n return false;\n }\n return true;\n}\n","import { HTMLProps, SyntheticEvent, useState } from 'react';\n\nimport {\n composeEventHandlers,\n requiredProp,\n subtractMonth,\n addMonth,\n isBackDisabled,\n isForwardDisabled,\n getCalendars,\n type DayzedDateObject,\n type DayzedCalendar,\n} from './utils';\n\nfunction isOffsetControlled(propOffset: number | undefined) {\n return propOffset !== undefined;\n}\n\nfunction getOffset(prop: number | undefined, state: number) {\n return isOffsetControlled(prop) ? prop : state;\n}\n\nfunction getDateProps(\n onDateSelected: ((date: DayzedDateObject, event: SyntheticEvent) => void) | undefined,\n {\n onClick,\n dateObj = requiredProp('getDateProps', 'dateObj'),\n ...rest\n }: Partial<GetDatePropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, (event) => {\n onDateSelected?.(dateObj, event);\n }),\n disabled: !dateObj.selectable,\n 'aria-label': dateObj.date.toDateString(),\n 'aria-pressed': dateObj.selected,\n role: 'button',\n ...rest,\n };\n}\n\nfunction getBackProps(\n {\n minDate,\n offsetMonth,\n handleOffsetChanged,\n }: {\n minDate?: Date;\n offsetMonth: number;\n handleOffsetChanged: (offset: number) => void;\n },\n {\n onClick,\n offset = 1,\n calendars = requiredProp('getBackProps', 'calendars'),\n ...rest\n }: Partial<GetBackForwardPropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, () => {\n handleOffsetChanged(offsetMonth - subtractMonth({ calendars, offset, minDate }));\n }),\n disabled: isBackDisabled({ calendars, minDate }),\n 'aria-label': `Go back ${offset} month${offset === 1 ? '' : 's'}`,\n ...rest,\n };\n}\n\nfunction getForwardProps(\n {\n maxDate,\n offsetMonth,\n handleOffsetChanged,\n }: {\n maxDate?: Date;\n offsetMonth: number;\n handleOffsetChanged: (offset: number) => void;\n },\n {\n onClick,\n offset = 1,\n calendars = requiredProp('getForwardProps', 'calendars'),\n ...rest\n }: Partial<GetBackForwardPropsOptions> = {},\n) {\n return {\n onClick: composeEventHandlers(onClick as any, () => {\n handleOffsetChanged(offsetMonth + addMonth({ calendars, offset, maxDate }));\n }),\n disabled: isForwardDisabled({ calendars, maxDate }),\n 'aria-label': `Go forward ${offset} month${offset === 1 ? '' : 's'}`,\n ...rest,\n };\n}\n\nexport function useDayzed({\n date = new Date(),\n maxDate,\n minDate,\n monthsToDisplay = 1,\n firstDayOfWeek = 0,\n showOutsideDays = false,\n offset,\n onDateSelected,\n onOffsetChanged = () => {},\n selected,\n}: {\n date?: Date;\n maxDate?: Date;\n minDate?: Date;\n monthsToDisplay?: number;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n showOutsideDays?: boolean;\n selected?: Date | Date[];\n offset?: number;\n onOffsetChanged?(offset: number): void;\n onDateSelected(selectedDate: DayzedDateObject, event: SyntheticEvent): void;\n}): RenderProps {\n const [stateOffset, setStateOffset] = useState(0);\n const offsetMonth = getOffset(offset, stateOffset);\n\n function handleOffsetChanged(newOffset: number) {\n if (!isOffsetControlled(offset)) {\n setStateOffset(newOffset);\n }\n onOffsetChanged(newOffset);\n }\n\n const calendars = getCalendars({\n date,\n selected: Array.isArray(selected) ? selected : selected ? [selected] : [],\n monthsToDisplay,\n minDate,\n maxDate,\n offset: offsetMonth,\n firstDayOfWeek,\n showOutsideDays,\n });\n return {\n calendars,\n getDateProps: getDateProps.bind(null, onDateSelected),\n getBackProps: getBackProps.bind(null, {\n minDate,\n offsetMonth,\n handleOffsetChanged,\n }),\n getForwardProps: getForwardProps.bind(null, {\n maxDate,\n offsetMonth,\n handleOffsetChanged,\n }),\n };\n}\n\ninterface GetBackForwardPropsOptions extends HTMLProps<HTMLButtonElement> {\n calendars: DayzedCalendar[];\n offset?: number;\n}\n\ninterface GetDatePropsOptions extends HTMLProps<HTMLButtonElement> {\n dateObj: DayzedDateObject;\n}\n\ninterface RenderProps {\n calendars: DayzedCalendar[];\n getBackProps: (data: GetBackForwardPropsOptions) => Record<string, any>;\n getForwardProps: (data: GetBackForwardPropsOptions) => Record<string, any>;\n getDateProps: (data: GetDatePropsOptions) => Record<string, any>;\n}\n\nexport type { DayzedDateObject } from './utils';\n","import { useEffect, useRef } from 'react';\n\nexport default function useLatestRef<T>(value: T) {\n const latestValue = useRef(value);\n\n useEffect(() => {\n latestValue.current = value;\n }, [value]);\n\n return latestValue;\n}\n","export function debounce<Args extends any[]>(\n function_: (...args: Args) => void,\n ms: number,\n): { (...args: Args): void; flush(): void; cancel(): void } {\n let lastArgs: Args | undefined;\n let timeout: ReturnType<typeof setTimeout> | undefined;\n\n function run() {\n const args = lastArgs;\n\n lastArgs = undefined;\n timeout = undefined;\n\n function_(...(args as Args));\n }\n\n return Object.assign(\n function (...args: Args) {\n lastArgs = args;\n\n if (timeout) {\n clearTimeout(timeout);\n }\n\n timeout = setTimeout(run, ms);\n },\n {\n flush() {\n if (timeout) {\n clearTimeout(timeout);\n run();\n }\n },\n\n cancel() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n lastArgs = undefined;\n }\n },\n },\n );\n}\n","import { Fragment, useId, useMemo, useState } from 'react';\nimport useLatestRef from '../hooks/useLatestRef';\nimport { debounce } from '../misc/debounce';\n\nexport interface DateInputProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n locale?: string;\n}\n\ntype Part = 'day' | 'month' | 'year';\n\nconst className = 'schummar-table-date-input';\nconst defaultDate = new Date(1970, 0, 1);\n\nconst isIncludedType = (type: Intl.DateTimeFormatPartTypes): type is Part =>\n type === 'day' || type === 'month' || type === 'year';\n\nconst maxValues = {\n day: 31,\n month: 12,\n year: 9999,\n};\n\nconst tabNext = (event: Element, id: string) => {\n const all = Array.from(document.querySelectorAll(`.${className}-${id}`));\n const index = all.indexOf(event);\n const next = all[index + 1];\n\n if (next instanceof HTMLElement) {\n next.focus();\n }\n};\n\nfunction buildDate(value: Partial<Record<Part, string>>, baseDate = new Date()): Date {\n const date = new Date(baseDate);\n\n if (value.year) {\n date.setFullYear(Number(value.year));\n }\n\n if (value.month) {\n date.setMonth(Number(value.month) - 1);\n }\n\n if (value.day) {\n date.setDate(Number(value.day));\n }\n\n return date;\n}\n\nexport function DateInput({ value, onChange, locale }: DateInputProps) {\n const id = useId();\n const [localValue, setLocalValue] = useState<Partial<Record<Part, string>>>();\n const latestValue = useLatestRef(value);\n\n const commit = useMemo(\n () =>\n debounce(\n (\n localValue: Partial<Record<Part, string>> = {},\n value: Date | null,\n onChange: (date: Date | null) => void,\n ) => {\n if (value !== latestValue.current) {\n // Value has been changed from outside, don't override it.\n return;\n }\n\n const date = buildDate(localValue, value ?? undefined);\n setLocalValue(undefined);\n onChange(isNaN(date.getTime()) ? null : date);\n },\n 100,\n ),\n [],\n );\n\n const format = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n }),\n [locale],\n );\n\n let parts;\n try {\n parts = format.formatToParts(value ?? defaultDate);\n } catch {\n parts = format.formatToParts(defaultDate);\n }\n\n const isEmpty = !value;\n\n return (\n <div\n css={{\n display: 'flex',\n alignItems: 'baseline',\n }}\n >\n {parts.map(({ type, value: partValue }, index) => (\n <Fragment key={index}>\n {isIncludedType(type) ? (\n <input\n className={`${className}-${id}`}\n css={{\n boxSizing: 'content-box',\n overflow: 'visible',\n border: 'none',\n borderBottom: '2px solid transparent',\n outline: 'none',\n fontSize: 'inherit',\n backgroundColor: 'inherit',\n color: 'inherit',\n\n '::placeholder': {\n color: 'inherit',\n opacity: 0.5,\n },\n\n '&:focus': {\n borderBottom: '2px solid var(--primaryMain)',\n },\n }}\n style={{\n width: `${String(maxValues[type]).length}ch`,\n }}\n placeholder={''.padEnd(String(maxValues[type]).length, '0')}\n value={localValue?.[type] ?? (isEmpty ? '' : partValue)}\n onChange={(event) => {\n const input = event.target.value;\n if (!/^\\d*$/.test(input)) return;\n\n const newValue = { ...localValue, [type]: input };\n\n if (Number(input) > maxValues[type]) {\n newValue[type] = String(maxValues[type]);\n }\n\n setLocalValue(newValue);\n\n if (input.length >= String(maxValues[type]).length) {\n setTimeout(() => tabNext(event.target, id));\n }\n }}\n onFocus={(event) => {\n commit.cancel();\n event.target.select();\n }}\n onBlur={() => {\n commit(localValue, value, onChange);\n }}\n />\n ) : type === 'literal' ? (\n <span>{partValue}</span>\n ) : null}\n </Fragment>\n ))}\n </div>\n );\n}\n","import { useTheme } from '../hooks/useTheme';\nimport type { TableTheme } from '../types';\n\nexport interface TextProps {\n id: keyof TableTheme['text'];\n}\n\nexport function Text({ id }: TextProps) {\n const text = useTheme((t) => t.text[id]);\n\n return <>{text}</>;\n}\n","import { Fragment, useId, useMemo, useState } from 'react';\nimport { debounce } from '../misc/debounce';\nimport useLatestRef from '../hooks/useLatestRef';\n\nexport interface TimeInputProps {\n value: Date | null;\n onChange: (date: Date | null) => void;\n locale?: string;\n showSeconds?: boolean;\n}\n\ntype Part = 'hour' | 'minute' | 'second';\n\nconst className = 'schummar-table-time-input';\nconst defaultDate = new Date(1970, 0, 1);\n\nconst isIncludedType = (type: Intl.DateTimeFormatPartTypes): type is Part =>\n type === 'hour' || type === 'minute' || type === 'second';\n\nconst maxValues = {\n hour: 23,\n minute: 59,\n second: 59,\n};\n\nconst tabNext = (event: Element, id: string) => {\n const all = Array.from(document.querySelectorAll(`.${className}-${id}`));\n const index = all.indexOf(event);\n const next = all[index + 1];\n\n if (next instanceof HTMLElement) {\n next.focus();\n }\n};\n\nfunction buildTime(value: Partial<Record<Part, string>>, baseDate = new Date()): Date {\n const date = new Date(baseDate);\n\n if (value.hour) {\n date.setHours(Number(value.hour));\n }\n\n if (value.minute) {\n date.setMinutes(Number(value.minute));\n }\n\n if (value.second) {\n date.setSeconds(Number(value.second));\n }\n\n return date;\n}\n\nexport function TimeInput({ value, onChange, locale, showSeconds = true }: TimeInputProps) {\n const id = useId();\n const [localValue, setLocalValue] = useState<Partial<Record<Part, string>>>();\n const latestValue = useLatestRef(value);\n\n const commit = useMemo(\n () =>\n debounce(\n (\n localValue: Partial<Record<Part, string>> = {},\n value: Date | null,\n onChange: (date: Date | null) => void,\n ) => {\n if (value !== latestValue.current) {\n // Value has been changed from outside, don't override it.\n return;\n }\n\n const date = buildTime(localValue, value ?? undefined);\n setLocalValue(undefined);\n onChange(isNaN(date.getTime()) ? null : date);\n },\n 100,\n ),\n [],\n );\n\n const format = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n second: showSeconds ? '2-digit' : undefined,\n }),\n [locale],\n );\n\n let parts;\n try {\n parts = format.formatToParts(value ?? defaultDate);\n } catch {\n parts = format.formatToParts(defaultDate);\n }\n\n const isEmpty = !value;\n\n return (\n <div\n css={{\n display: 'flex',\n alignItems: 'baseline',\n }}\n >\n {parts.map(({ type, value: partValue }, index) => (\n <Fragment key={index}>\n {isIncludedType(type) ? (\n <input\n className={`${className}-${id}`}\n css={{\n boxSizing: 'content-box',\n overflow: 'visible',\n border: 'none',\n borderBottom: '2px solid transparent',\n outline: 'none',\n fontSize: 'inherit',\n backgroundColor: 'inherit',\n color: 'inherit',\n\n '::placeholder': {\n color: 'inherit',\n opacity: 0.5,\n },\n\n '&:focus': {\n borderBottom: '2px solid var(--primaryMain)',\n },\n }}\n style={{\n width: `${String(maxValues[type]).length}ch`,\n }}\n placeholder={''.padEnd(String(maxValues[type]).length, '0')}\n value={localValue?.[type] ?? (isEmpty ? '' : partValue)}\n onChange={(event) => {\n const input = event.target.value;\n if (!/^\\d*$/.test(input)) return;\n\n const newValue = { ...localValue, [type]: input };\n\n if (Number(input) > maxValues[type]) {\n newValue[type] = String(maxValues[type]);\n }\n\n setLocalValue(newValue);\n\n if (input.length >= String(maxValues[type]).length) {\n setTimeout(() => tabNext(event.target, id));\n }\n }}\n onFocus={(event) => {\n commit.cancel();\n event.target.select();\n }}\n onBlur={() => {\n commit(localValue, value, onChange);\n }}\n />\n ) : type === 'literal' ? (\n <span>{partValue}</span>\n ) : null}\n </Fragment>\n ))}\n </div>\n );\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport {\n Fragment,\n ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Temporal } from 'temporal-polyfill';\nimport { useTheme } from '../hooks/useTheme';\nimport { defaults } from '../misc/defaults';\nimport { useCssVariables } from '../theme/useCssVariables';\nimport { useDayzed, type DayzedDateObject } from '../vendor/dayzed/dayzed';\nimport { DateInput } from './dateInput';\nimport { Text } from './text';\nimport { TimeInput } from './timeInput';\n\nexport type DateRange = { min: Date; max: Date };\n\nexport type DatePickerQuickOption =\n | 'today'\n | 'thisWeek'\n | 'thisMonth'\n | 'thisYear'\n | 'lastSevenDays'\n | 'lastThirtyDays'\n | { label: ReactNode; value: Date | DateRange | (() => Date | DateRange) }\n | ((onChange: (value: Date | DateRange | null) => void) => ReactNode);\n\nexport type DatePickerChangeSource = 'input' | 'calendarWeek' | 'calendar' | 'quickOption';\n\nexport type DatePickerProps = {\n /** Currently selected day or range of days. */\n value: Date | DateRange | null;\n /** Callback for when the day (range) changes. */\n onChange: (value: Date | DateRange | null, source: DatePickerChangeSource) => void;\n /** Currently visible date. */\n dateInView?: Date;\n /** Callback for when the currently visible date changes. */\n onDateInViewChange?: (value: Date) => void;\n /** If enabled, ranges can be selected. */\n rangeSelect?: boolean;\n /** Which locale to use to render the calendar. */\n locale?: string;\n /** Which day of the week should be in the first column. (0=Sunday, 1=Monday, ...)\n * @default 1\n */\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Which month to show initially */\n defaultDateInView?: Date;\n /** Show buttons to quickly select suggested dates or date ranges */\n quickOptions?: DatePickerQuickOption[];\n noReset?: boolean;\n /** Minimum selectable date */\n /** Date ranges that are visually marked as blocked */\n blockedRanges?: DateRange[];\n minDate?: Date;\n /** Maximum selectable date */\n maxDate?: Date;\n /** Whether to show the calendar week in the first column */\n showCalendarWeek?: boolean;\n /** Whether to show and allow editing of time */\n showTime?: boolean | { showSeconds?: boolean };\n};\n\nconst DatePickerContext = createContext<Partial<Omit<DatePickerProps, 'value' | 'onChange'>>>({});\n\nexport function DatePickerProvider({\n children,\n ...props\n}: Partial<Omit<DatePickerProps, 'value' | 'onChange'>> & { children?: ReactNode }) {\n const value = useMemo(() => props, [JSON.stringify(props)]);\n\n return <DatePickerContext.Provider value={value}>{children}</DatePickerContext.Provider>;\n}\n\nconst weekDays = [0, 1, 2, 3, 4, 5, 6] as const;\n\n/** Rounds a date down to the start of the day. */\nexport const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\n\n/** Rounds a date up to the end of the day. */\nexport const endOfDay = (d: Date) =>\n new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1, 0, 0, 0, -1);\n\nexport const lastDays = (days: number): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(min.getDate() - days + 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(now),\n };\n};\n\nexport const today = () => lastDays(1);\n\nexport const thisWeek = (delta = 0, firstDayOfWeek = 1): DateRange => {\n const now = new Date();\n const min = new Date(now);\n\n let diff = min.getDay() - firstDayOfWeek;\n if (diff < 0) {\n diff += 7;\n }\n min.setDate(min.getDate() - diff + delta * 7);\n\n const max = new Date(min);\n max.setDate(max.getDate() + 6);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const thisMonth = (delta = 0): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(1);\n min.setMonth(min.getMonth() + delta);\n const max = new Date(min);\n max.setMonth(max.getMonth() + 1);\n max.setDate(max.getDate() - 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const thisYear = (delta = 0): DateRange => {\n const now = new Date();\n const min = new Date(now);\n min.setDate(1);\n min.setMonth(0);\n min.setFullYear(min.getFullYear() + delta);\n const max = new Date(min);\n max.setFullYear(max.getFullYear() + 1);\n max.setDate(max.getDate() - 1);\n\n return {\n min: startOfDay(min),\n max: endOfDay(max),\n };\n};\n\nexport const getCalendarWeek = (date: Date): number => {\n // ISO 8601: Week 1 is the week with the first Thursday of the year.\n // https://en.wikipedia.org/wiki/ISO_week_date\n\n const tz = Temporal.Now.timeZoneId();\n return (\n Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(tz).weekOfYear ?? 0\n );\n};\n\nexport const commonQuickOptions = {\n today: { label: <Text id=\"today\" />, value: today },\n thisWeek: { label: <Text id=\"thisWeek\" />, value: (props) => thisWeek(0, props.firstDayOfWeek) },\n thisMonth: { label: <Text id=\"thisMonth\" />, value: () => thisMonth() },\n thisYear: { label: <Text id=\"thisYear\" />, value: () => thisYear() },\n lastSevenDays: { label: <Text id=\"lastSevenDays\" />, value: () => lastDays(7) },\n lastThirtyDays: { label: <Text id=\"lastThirtyDays\" />, value: () => lastDays(30) },\n} satisfies Record<\n DatePickerQuickOption & string,\n { label: ReactNode; value: Date | DateRange | ((props: DatePickerProps) => Date | DateRange) }\n>;\n\n/** Returns whether two dates and/or date ranges intersect. Intersection is considered per day. */\nexport function dateIntersect(\n a: Date | DateRange | null | undefined,\n b: Date | DateRange | null | undefined,\n) {\n if (a instanceof Date) {\n a = { min: a, max: a };\n }\n if (b instanceof Date) {\n b = { min: b, max: b };\n }\n\n if (!a?.min || !a.max || !b?.min || !b.max) {\n return false;\n }\n\n return !(endOfDay(a.max) < startOfDay(b.min) || startOfDay(a.min) > endOfDay(b.max));\n}\n\nexport function dateClamp(date: Date, min?: Date, max?: Date) {\n if (min && date < min) {\n return min;\n }\n\n if (max && date > max) {\n return max;\n }\n\n return date;\n}\n\nfunction getValueForComparison(value?: Date | DateRange | null) {\n if (!value) {\n return value;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n return `${value.min?.getTime()}-${value.max?.getTime()}`;\n}\n\n/** Renders the theme's date picker, with `DatePickerProvider` defaults and min/max clamping applied. */\nexport function DatePicker(props: DatePickerProps) {\n const context = useContext(DatePickerContext);\n const Component = useTheme((t) => t.components.DatePicker);\n\n const resolved = defaults<DatePickerProps>(props, context, {\n firstDayOfWeek: 1,\n quickOptions: ['today', 'thisWeek'],\n });\n const { minDate, maxDate } = resolved;\n\n function onChange(value: Date | DateRange | null, source: DatePickerChangeSource) {\n if (value instanceof Date) {\n value = dateClamp(value, minDate, maxDate);\n } else if (value) {\n value = {\n min: dateClamp(value.min, minDate, maxDate),\n max: dateClamp(value.max, minDate, maxDate),\n };\n }\n\n props.onChange(value, source);\n }\n\n return <Component {...resolved} onChange={onChange} />;\n}\n\n/** The quick option buttons (plus reset) below the calendar, for use in theme date pickers. */\nexport function DatePickerQuickOptions({\n onSelect,\n ...props\n}: DatePickerProps & {\n /** Called before the value is changed, e.g. to discard a half-selected range. */\n onSelect?: () => void;\n}) {\n const Button = useTheme((t) => t.components.Button);\n const { quickOptions = [], noReset, onChange } = props;\n\n const options = [\n ...quickOptions,\n ...(noReset ? [] : [{ label: <Text id=\"reset\" />, value: null }]),\n ].map((option, index) => {\n if (option instanceof Function) {\n return (\n <Fragment key={index}>\n {option((value) => {\n onSelect?.();\n onChange(value, 'quickOption');\n })}\n </Fragment>\n );\n }\n\n const { label, value } = typeof option === 'string' ? commonQuickOptions[option] : option;\n\n return (\n <Button\n key={index}\n variant=\"text\"\n type=\"button\"\n css={{\n color: 'inherit',\n }}\n onClick={() => {\n onSelect?.();\n onChange(value instanceof Function ? value(props) : value, 'quickOption');\n }}\n >\n {label}\n </Button>\n );\n });\n\n return (\n <div\n css={{\n marginTop: 'var(--spacing)',\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'center',\n }}\n >\n {options}\n </div>\n );\n}\n\nexport function DefaultDatePicker(props: DatePickerProps) {\n const {\n value,\n onChange,\n rangeSelect,\n locale,\n firstDayOfWeek = 1,\n defaultDateInView,\n minDate,\n maxDate,\n showCalendarWeek,\n blockedRanges = [],\n showTime,\n } = props;\n\n const IconButton = useTheme((t) => t.components.IconButton);\n const ChevronRight = useTheme((t) => t.icons.ChevronRight);\n const cssVariables = useCssVariables();\n function getDayCssStyles({\n disabled,\n prevMonth,\n nextMonth,\n today,\n blocked,\n selected,\n preSelected,\n }: {\n disabled?: boolean;\n prevMonth?: boolean;\n nextMonth?: boolean;\n today?: boolean;\n blocked?: boolean;\n selected?: boolean;\n preSelected?: boolean;\n }): Interpolation<Theme> {\n return [\n {\n padding: 10,\n border: 'none',\n background: 'transparent',\n cursor: disabled ? undefined : 'pointer',\n font: 'inherit',\n color: 'inherit',\n },\n (prevMonth || nextMonth) && {\n color: 'var(--date-picker-disemphasized, #bdbdbd)',\n },\n today && {\n outline: '1px solid var(--secondaryMain)',\n },\n blocked && {\n background: 'var(--blockedMain)',\n color: 'var(--blockedContrastText)',\n },\n selected && {\n background: 'var(--primaryMain)',\n color: 'var(--primaryContrastText)',\n },\n blocked &&\n selected && {\n position: 'relative',\n '::before': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n background: 'var(--blockedMain)',\n clipPath: 'polygon(0 0, 0 50%, 50% 0)',\n },\n },\n preSelected && {\n background: 'var(--primaryLight)',\n color: 'var(--primaryContrastText)',\n },\n ];\n }\n\n const mountTime = useMemo(() => new Date(), []);\n const [dirty, setDirty] = useState<Partial<DateRange>>();\n const [hovered, setHovered] = useState<DateRange>();\n const [dateInViewLocal, setDateInViewLocal] = useState<Date>(defaultDateInView ?? mountTime);\n const dateInView = props.dateInView ?? dateInViewLocal;\n\n function setDateInView(date: Date) {\n setDateInViewLocal(date);\n props.onDateInViewChange?.(date);\n }\n\n const min = dirty ? dirty.min : value instanceof Date ? value : value?.min;\n const max = dirty ? dirty.max : value instanceof Date ? value : value?.max;\n\n const { calendars, getBackProps, getForwardProps, getDateProps } = useDayzed({\n onDateSelected: () => undefined,\n firstDayOfWeek,\n showOutsideDays: true,\n date: dateInView,\n onOffsetChanged: (offset) =>\n setDateInView(new Date(dateInView.getFullYear(), dateInView.getMonth() + offset)),\n offset: 0,\n minDate,\n maxDate,\n });\n const now = useMemo(() => startOfDay(new Date()), []);\n\n const formatWeekday = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { weekday: 'short' });\n return (weekDay: number) =>\n format(new Date(Date.UTC(2021, 7, ((weekDay + firstDayOfWeek) % 7) + 1)));\n }, [locale, firstDayOfWeek]);\n\n useEffect(\n () =>\n setDateInView(\n value === null\n ? (defaultDateInView ?? mountTime)\n : value instanceof Date\n ? value\n : value.max,\n ),\n [getValueForComparison(value), getValueForComparison(defaultDateInView), mountTime],\n );\n\n useEffect(() => {\n if (!rangeSelect) {\n setDirty(undefined);\n }\n }, [rangeSelect]);\n\n function set(source: DatePickerChangeSource, min?: Date, max?: Date, edit?: 'min' | 'max') {\n if (!rangeSelect) {\n onChange(min ?? null, source);\n return;\n }\n\n if (min && max && min > max) {\n if (edit === 'min') {\n max = min;\n } else if (edit === 'max') {\n min = max;\n } else {\n [min, max] = [max, min];\n }\n }\n\n if (!min === !max) {\n setDirty(undefined);\n onChange(min && max ? { min, max: endOfDay(max) } : null, source);\n } else {\n setDirty({ min, max });\n }\n }\n\n const formatMonth = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { month: 'long' });\n return (month: number) => format(new Date(2021, month));\n }, [locale]);\n\n const formatYear = useMemo(() => {\n const { format } = new Intl.DateTimeFormat(locale, { year: 'numeric' });\n return (year: number) => format(new Date(year, 0, 1));\n }, [locale]);\n\n return (\n <div\n css={[\n cssVariables,\n {\n color: 'var(--table-text-color)',\n },\n ]}\n >\n <div\n css={{\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 'calc(var(--spacing) * 4)',\n\n '& > div': {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n },\n }}\n >\n <div>\n <DateInput\n value={min ?? null}\n onChange={(newMin) => set('input', newMin ?? undefined, max, 'min')}\n locale={locale}\n />\n\n {showTime && (\n <TimeInput\n value={min ?? null}\n onChange={(newMin) => set('input', newMin ?? undefined, max, 'min')}\n locale={locale}\n showSeconds={typeof showTime === 'boolean' ? true : showTime.showSeconds}\n />\n )}\n </div>\n\n {rangeSelect && (\n <>\n {' - '}\n\n <div>\n <DateInput\n value={max ?? null}\n onChange={(newMax) => set('input', min, newMax ?? undefined, 'max')}\n locale={locale}\n />\n\n {showTime && (\n <TimeInput\n value={max ?? null}\n onChange={(newMax) => set('input', min, newMax ?? undefined, 'max')}\n locale={locale}\n showSeconds={typeof showTime === 'boolean' ? true : showTime.showSeconds}\n />\n )}\n </div>\n </>\n )}\n </div>\n\n {calendars.map(({ month, year, weeks }) => (\n <div key={`${month}${year}`} css={{ display: 'grid' }}>\n <div\n css={{\n margin: 'calc(var(--spacing) * 4) 0',\n display: 'grid',\n gridAutoFlow: 'column',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <IconButton type=\"button\" {...getBackProps({ calendars })}>\n <ChevronRight css={{ transform: 'rotate3d(0, 0, 1, 180deg)' }} />\n </IconButton>\n\n <div css={{ display: 'flex' }}>\n {formatMonth(month)} {formatYear(year)}\n </div>\n\n <IconButton type=\"button\" {...getForwardProps({ calendars })}>\n <ChevronRight />\n </IconButton>\n </div>\n\n <div\n css={{\n justifySelf: 'center',\n display: 'grid',\n gridTemplateColumns: 'repeat(8, max-content)',\n }}\n >\n {showCalendarWeek ? (\n <div\n css={{\n justifySelf: 'center',\n padding: 10,\n borderRight:\n '1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))',\n }}\n >\n <Text id=\"calendarWeek\" />\n </div>\n ) : (\n <div />\n )}\n\n {weekDays.map((_v, weekDay) => (\n <div\n key={weekDay}\n css={{\n justifySelf: 'center',\n padding: 10,\n }}\n >\n {formatWeekday(weekDay)}\n </div>\n ))}\n\n {weeks.map((week, index) => {\n const weekStart = week[0] as DayzedDateObject;\n const weekEnd = week[6] as DayzedDateObject;\n const weekDisabled =\n !rangeSelect ||\n (minDate && weekEnd.date < minDate) ||\n (maxDate && weekStart.date > maxDate);\n\n return (\n <Fragment key={index}>\n {showCalendarWeek ? (\n <button\n type=\"button\"\n css={{\n padding: 10,\n border: 'none',\n background: 'transparent',\n cursor: weekDisabled ? undefined : 'pointer',\n font: 'inherit',\n borderRight:\n '1px solid var(--date-picker-separator, var(--table-border, #bdbdbd))',\n color: 'inherit',\n }}\n onClick={() => {\n if (weekDisabled) {\n return;\n }\n\n const min = minDate && weekStart.date < minDate ? minDate : weekStart.date;\n const max = maxDate && weekEnd.date > maxDate ? maxDate : weekEnd.date;\n set('calendarWeek', min, max);\n }}\n onPointerOver={() =>\n !weekDisabled && setHovered({ min: weekStart.date, max: weekEnd.date })\n }\n onPointerOut={() => !weekDisabled && setHovered(undefined)}\n >\n {getCalendarWeek(weekEnd.date)}\n </button>\n ) : (\n <div />\n )}\n\n {week.map((dateObject, dayIndex) => {\n if (!dateObject) {\n return <div key={dayIndex} />;\n }\n\n const { prevMonth, nextMonth, date } = dateObject;\n const today = startOfDay(date).getTime() === now.getTime();\n const disabled = (minDate && date < minDate) || (maxDate && date > maxDate);\n\n const selected =\n date.getTime() === min?.getTime() ||\n (min && max && dateIntersect(date, { min, max }));\n const preSelected =\n !selected &&\n !disabled &&\n (dateIntersect(date, hovered) ||\n (min &&\n !max &&\n hovered &&\n dateIntersect(\n date,\n min <= hovered.min\n ? { min, max: hovered.min }\n : { min: hovered.max, max: min },\n )));\n const blocked = blockedRanges.some((range) => dateIntersect(date, range));\n\n return (\n <button\n type=\"button\"\n key={`${index}-${dayIndex}`}\n css={getDayCssStyles({\n disabled,\n prevMonth,\n nextMonth,\n today,\n blocked,\n selected,\n preSelected,\n })}\n {...getDateProps({ dateObj: dateObject })}\n onClick={() => {\n if (dirty) {\n if (min) set('calendar', min, date);\n else set('calendar', date, max);\n } else {\n set('calendar', date);\n }\n }}\n onPointerOver={() => setHovered({ min: date, max: date })}\n onPointerOut={() => setHovered(undefined)}\n disabled={disabled}\n >\n {date.getDate()}\n </button>\n );\n })}\n </Fragment>\n );\n })}\n </div>\n </div>\n ))}\n\n <DatePickerQuickOptions {...props} onSelect={() => setDirty(undefined)} />\n </div>\n );\n}\n","import { css } from '@emotion/react';\n\nexport function Spinner({ className }: { className?: string }) {\n return (\n <div\n className={className}\n css={css`\n display: inline-block;\n position: relative;\n width: 1em;\n height: 1em;\n\n div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 0.8em;\n height: 0.8em;\n margin: 0.1em;\n border: 0.1em solid #fff;\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: currentColor transparent transparent transparent;\n }\n div:nth-of-type(1) {\n animation-delay: -0.45s;\n }\n div:nth-of-type(2) {\n animation-delay: -0.3s;\n }\n div:nth-of-type(3) {\n animation-delay: -0.15s;\n }\n @keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n `}\n >\n <div />\n <div />\n <div />\n </div>\n );\n}\n","import type { TableTheme } from '../../types';\n\nexport const Badge: TableTheme['components']['Badge'] = ({ badgeContent, children }) => {\n return (\n <span\n css={{\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n verticalAlign: 'middle',\n }}\n >\n {children}\n\n <span\n css={[\n {\n top: 0,\n right: 0,\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n height: 20,\n display: 'flex',\n padding: '0 6px',\n zIndex: 1,\n position: 'absolute',\n flexWrap: 'wrap',\n minWidth: 20,\n transition: 'transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',\n alignItems: 'center',\n lineHeight: 1,\n alignContent: 'center',\n borderRadius: 10,\n justifyContent: 'center',\n fontSize: '0.8em',\n },\n !badgeContent && {\n transform: 'scale(0) translate(50%, -50%)',\n transition: 'transform 195ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',\n },\n ]}\n >\n {badgeContent}\n </span>\n </span>\n );\n};\n","import type { TableTheme } from '../../types';\n\nexport const Button: TableTheme['components']['Button'] = ({\n startIcon,\n children,\n variant = 'text',\n ...props\n}) => {\n return (\n <button\n css={[\n {\n padding: `var(--spacing) calc(var(--spacing) * 2)`,\n display: 'inline-flex',\n alignItems: 'center',\n transition: 'background-color 150ms',\n border: 'none',\n cursor: 'pointer',\n background: 'transparent',\n borderRadius: 4,\n\n '&:active:not(:disabled)': {\n transform: 'scale3d(0.95, 0.95, 1)',\n },\n },\n variant === 'text' && {\n '&:hover': {\n background: 'rgba(0, 0, 0, 0.1)',\n },\n },\n variant === 'outlined' && {\n border: '1px solid var(--table-button-border, var(--table-border, #777777))',\n\n '&:disabled': {\n borderColor: 'var(--table-button-border-disabled, #eeeeee)',\n },\n },\n variant === 'contained' && {\n color: 'var(--primaryContrastText)',\n backgroundColor: 'var(--primaryMain)',\n boxShadow:\n '0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%)',\n\n '&:hover': {\n filter: 'brightness(0.9)',\n },\n\n '&:disabled': {\n filter: 'grayscale()',\n opacity: 0.5,\n },\n },\n ]}\n {...props}\n >\n {startIcon && <span css={{ marginRight: `calc(var(--spacing) * 2)` }}>{startIcon}</span>}\n <span>{children}</span>\n </button>\n );\n};\n","import type { Id, SingleOrMultiple, TableItem } from '../types';\n\nexport const flatMap = <T, S>(array: Iterable<T>, flatMap: (t: T) => S[]): S[] => {\n return [...array].flatMap(flatMap);\n};\n\nexport const orderBy = <T>(\n array: T[],\n selectors: ((t: T) => any)[] = [],\n direction: ('desc' | 'asc')[] = [],\n locale?: (string | undefined)[],\n options?: (Intl.CollatorOptions | undefined)[],\n): T[] => {\n if (selectors.length === 0) selectors = [(t) => t];\n\n return [...array].sort((a, b) => {\n for (let i = 0; i < selectors.length; i++) {\n const _a = selectors[i]?.(a);\n const _b = selectors[i]?.(b);\n const _direction = direction[i] === 'desc' ? -1 : 1;\n const _locale = locale?.[i];\n const _options = options?.[i];\n\n if (typeof _a === 'string' && typeof _b === 'string') {\n const result = _a.localeCompare(_b, _locale, _options);\n if (result !== 0) return result * _direction;\n continue;\n }\n\n if (_a > _b) return _direction;\n if (_a < _b) return -_direction;\n }\n return 0;\n });\n};\n\nexport const uniq = <T>(array: T[]): T[] => {\n const set = new Set<T>();\n for (const t of array) set.add(t);\n return Array.from(set);\n};\n\nexport const intersect = <T>(a: Iterable<T>, b: { has(t: T): boolean }): Set<T> => {\n const result = new Set<T>();\n for (const x of a) if (b.has(x)) result.add(x);\n return result;\n};\n\nexport const getAncestors = <T>(\n activeItemsById: Map<Id, TableItem<T>>,\n ...items: TableItem<T>[]\n): Set<Id> => {\n const result = new Set<Id>();\n\n const find = ({ parentId }: TableItem<T>): void => {\n const parent =\n parentId !== undefined && parentId !== null ? activeItemsById.get(parentId) : undefined;\n if (parent && !result.has(parent.id)) {\n result.add(parent.id);\n find(parent);\n }\n };\n items.forEach(find);\n return result;\n};\n\nexport const getDescendants = <T>(...items: TableItem<T>[]): Set<Id> => {\n const result = new Set<Id>();\n\n const find = (item: TableItem<T>): void => {\n for (const child of item.children) {\n if (!result.has(child.id)) {\n result.add(child.id);\n find(child);\n }\n }\n };\n items.forEach(find);\n return result;\n};\n\nexport const identity = (x: unknown): any => x;\n\nexport const asString = (x: unknown): string => {\n if (Array.isArray(x)) return x.map(asString).join(', ');\n if (x === null || x === undefined) return '';\n if (x instanceof Object) return JSON.stringify(x);\n return String(x as string | number | bigint | boolean | symbol);\n};\n\nexport const asStringOrArray = (x: unknown): string | string[] => {\n if (Array.isArray(x)) return x.map(asString);\n return asString(x);\n};\n\nexport const asNumber = (x: unknown): number | null => {\n const n = Number(x);\n return Number.isNaN(n) ? null : n;\n};\n\nexport const asNumberOrArray = (x: unknown): number | null | (number | null)[] => {\n if (Array.isArray(x)) return x.map(asNumber);\n return asNumber(x);\n};\n\nexport const defaultEquals = (a: unknown, b: unknown): boolean => a === b;\n\nexport const subStringMatch = (a: string, b: string): boolean =>\n a.toLowerCase().includes(b.toLowerCase());\n\nexport const castArray = <T>(a: T | T[]) => (Array.isArray(a) ? a : [a]);\n\nexport const cx = (\n ...classNames: (string | false | undefined | null | Record<string, boolean>)[]\n) =>\n classNames\n .flatMap((entry) => {\n if (!entry) return [];\n if (typeof entry === 'string') return [entry];\n return Object.entries(entry)\n .filter(([, predicate]) => predicate)\n .map(([className]) => className);\n })\n .join(' ');\n\ntype Falsy = false | 0 | '' | null | undefined;\nexport function isTruthy<T>(x: T): x is Exclude<T, Falsy> {\n return !!x;\n}\n\n/** The single values of a `SingleOrMultiple` value. */\nexport function toSingles<T>(value: SingleOrMultiple<T>): readonly T[] {\n if (Array.isArray(value)) return value;\n if (value instanceof Set) return [...value];\n return [value as T];\n}\n","import createCache, { type EmotionCache } from '@emotion/cache';\n// Aliased to a `use…` name: React Compiler only treats functions named like that as hooks, and\n// would otherwise call it on the first render only.\nimport {\n __unsafe_useEmotionCache as useEmotionCache,\n useTheme as useEmotionTheme,\n} from '@emotion/react';\nimport { serializeStyles, type Interpolation, type SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\nimport { useMemo } from 'react';\n\nexport type ClassNameOf = (...styles: Interpolation<any>[]) => string;\n\nconst isServer = typeof document === 'undefined';\n\nconst isSerialized = (x: object): x is SerializedStyles =>\n typeof (x as SerializedStyles).name === 'string' &&\n typeof (x as SerializedStyles).styles === 'string';\n\n/**\n * Turns emotion styles into a class name without re-serializing them on every call: serialized styles\n * are keyed by their hash, objects and functions by identity. Styles are inserted on the client only.\n */\nfunction createClassNameOf(cache: EmotionCache, theme: object | undefined): ClassNameOf {\n const classNames = new Map<string, string>();\n const ids = new WeakMap<object, number>();\n let nextId = 0;\n\n const keyOf = (style: Interpolation<any>): string => {\n if (style === null || style === undefined || typeof style === 'boolean') return '';\n if (typeof style !== 'object' && typeof style !== 'function') {\n return `${typeof style}:${String(style)}`;\n }\n if (typeof style === 'object' && isSerialized(style)) return `s:${style.name}`;\n let id = ids.get(style);\n if (id === undefined) ids.set(style, (id = nextId++));\n return `o:${id}`;\n };\n\n return (...styles) => {\n const key = JSON.stringify(styles.map(keyOf));\n let className = classNames.get(key);\n if (className === undefined) {\n // The theme is what the css prop passes to function interpolations.\n const serialized = serializeStyles(styles, cache.registered, theme);\n if (!isServer) insertStyles(cache, serialized, false);\n className = serialized.styles ? `${cache.key}-${serialized.name}` : '';\n // Function styles returning fresh objects would grow this forever.\n if (classNames.size > 5000) classNames.clear();\n classNames.set(key, className);\n }\n return className;\n };\n}\n\n// Without a CacheProvider, @emotion/react uses a cache keyed `css` in the browser and none on the\n// server; these mirror it so server and client produce the same class names.\nlet standaloneAppCache: EmotionCache | undefined;\nconst getStandaloneAppCache = () => (standaloneAppCache ??= createCache({ key: 'css' }));\n\nconst libraryClassNameOf = new WeakMap<EmotionCache, ClassNameOf>();\n\n/**\n * For the library's own styles. They go into a separate cache that is prepended to the document, so\n * user styles of equal specificity (emotion or plain CSS) always override them. It inherits the app\n * cache's nonce and container.\n */\nexport function useLibraryClassName(): ClassNameOf {\n const appCache = useEmotionCache() ?? getStandaloneAppCache();\n\n return useMemo(() => {\n let classNameOf = libraryClassNameOf.get(appCache);\n if (!classNameOf) {\n // A prepended sheet takes the top spot when it creates its first tag. If the app cache is\n // prepended too (MUI's recommended setup) and hasn't created one yet, it would later land above\n // ours and lose to the library styles, so make it create its tag first.\n if (!isServer && appCache.sheet.tags.length === 0) {\n insertStyles(appCache, serializeStyles(['--schummar-table: 1;']), false);\n }\n\n classNameOf = createClassNameOf(\n createCache({\n key: `${appCache.key}-st`,\n prepend: true,\n nonce: appCache.nonce,\n container: appCache.sheet.container,\n }),\n undefined,\n );\n libraryClassNameOf.set(appCache, classNameOf);\n }\n return classNameOf;\n }, [appCache]);\n}\n\nconst userClassNameOf = new WeakMap<EmotionCache, WeakMap<object, ClassNameOf>>();\n\n/**\n * For user supplied styles, and for library styles that must beat a theme component's own styles:\n * the app's emotion cache, with its theme for function interpolations.\n */\nexport function useUserClassName(): ClassNameOf {\n const appCache = useEmotionCache() ?? getStandaloneAppCache();\n const theme = useEmotionTheme();\n\n return useMemo(() => {\n let byTheme = userClassNameOf.get(appCache);\n if (!byTheme) userClassNameOf.set(appCache, (byTheme = new WeakMap()));\n\n let classNameOf = byTheme.get(theme);\n if (!classNameOf) byTheme.set(theme, (classNameOf = createClassNameOf(appCache, theme)));\n return classNameOf;\n }, [appCache, theme]);\n}\n","import { css } from '@emotion/react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst labelCss = css({\n padding: 'calc(var(--spacing) * 1.8)',\n display: 'flex',\n color: 'currentcolor',\n userSelect: 'none',\n\n '& input': {\n appearance: 'none',\n margin: 0,\n },\n});\n\nconst disabledCss = css({ color: 'rgba(0, 0, 0, 0.26)' });\n\nconst iconCss = css({ fontSize: '1.25rem', width: '1em', height: '1em', fill: 'currentColor' });\n\nconst checkedIconCss = css({ fill: 'var(--primaryMain)' });\n\nexport const Checkbox: TableTheme['components']['Checkbox'] = ({ className, ...props }) => {\n const libraryClass = useLibraryClassName();\n\n return (\n <label\n className={cx(libraryClass(labelCss), props.disabled && libraryClass(disabledCss), className)}\n >\n <input type=\"checkbox\" {...props} />\n\n {props.checked ? (\n <svg\n className={libraryClass(iconCss, checkedIconCss)}\n focusable=\"false\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path d=\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"></path>\n </svg>\n ) : (\n <svg\n className={libraryClass(iconCss)}\n focusable=\"false\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path d=\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\"></path>\n </svg>\n )}\n </label>\n );\n};\n","import { css } from '@emotion/react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst iconButtonCss = css({\n padding: 'var(--spacing)',\n borderRadius: '50%',\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n transition: 'background-color 150ms',\n border: 'none',\n cursor: 'pointer',\n color: 'inherit',\n background: 'transparent',\n\n '&:hover': {\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n },\n\n '&:active': {\n transformColor: 'scale3d(0.95, 0.95, 1)',\n },\n});\n\nexport const IconButton: TableTheme['components']['IconButton'] = ({ className, ...props }) => {\n const libraryClass = useLibraryClassName();\n return <button className={cx(libraryClass(iconButtonCss), className)} {...props} />;\n};\n","import type { TableTheme } from '../../types';\n\nexport const TextField: TableTheme['components']['TextField'] = ({\n startIcon,\n endIcon,\n className,\n inputRef,\n onBlur,\n ...props\n}) => {\n return (\n <div\n className={className}\n css={[\n {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n border: '1px solid var(--table-textfield-border, var(--table-border, #777777))',\n borderRadius: 4,\n\n '&:focus-within': {\n border: '2px solid var(--primaryMain)',\n margin: -1,\n },\n },\n ]}\n >\n {startIcon}\n\n <input\n ref={inputRef}\n {...props}\n value={props.value ?? ''}\n onBlur={onBlur}\n css={{\n minWidth: 0,\n width: '100%',\n flex: 1,\n border: 'none',\n outline: 'none',\n borderRadius: 4,\n padding: 'calc(var(--spacing) * 2)',\n paddingLeft: startIcon ? 0 : undefined,\n paddingRight: endIcon ? 0 : undefined,\n transition: 'outline 500ms',\n }}\n />\n\n {endIcon}\n </div>\n );\n};\n","import { DefaultDatePicker } from '../../components/datePicker';\nimport { Spinner } from '../../components/spinnner';\nimport type { TableTheme } from '../../types';\nimport { Badge } from './badge';\nimport { Button } from './button';\nimport { Checkbox } from './checkbox';\nimport { IconButton } from './iconButton';\nimport { Popover } from './popover';\nimport { TextField } from './textField';\n\nexport const defaultComponents: TableTheme['components'] = {\n IconButton,\n Checkbox,\n Popover,\n Button,\n Badge,\n TextField,\n Spinner,\n DatePicker: DefaultDatePicker,\n};\n","import { css } from '@emotion/react';\nimport type { HTMLProps, ReactElement } from 'react';\nimport { cloneElement } from 'react';\nimport { cx } from '../../misc/helpers';\nimport type { TableTheme } from '../../types';\nimport { useLibraryClassName } from '../emotion';\n\nconst IconDefaultStyle = css({\n width: '1.5em',\n height: '1.5em',\n color: 'inherit',\n});\n\nfunction Icon(svg: ReactElement<HTMLProps<Element>>) {\n return function IconComponent(props: HTMLProps<Element>) {\n const libraryClass = useLibraryClassName();\n return cloneElement(svg, {\n ...props,\n className: cx(libraryClass(IconDefaultStyle), props.className),\n });\n };\n}\n\nconst Settings = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z\" />\n </svg>,\n);\n\nconst Export = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n enableBackground=\"new 0 0 24 24\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <g>\n <rect fill=\"none\" height=\"24\" width=\"24\" />\n </g>\n <g>\n <path d=\"M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z\" />\n </g>\n </svg>,\n);\n\nconst Clipboard = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z\" />\n </svg>,\n);\n\nconst ChevronRight = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\" />\n </svg>,\n);\n\nconst Search = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </svg>,\n);\n\nconst Clear = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\" />\n </svg>,\n);\n\nconst ArrowDropDown = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M7 10l5 5 5-5H7z\" />\n </svg>,\n);\n\nconst FilterList = Icon(\n <svg viewBox=\"0 0 24 24\">\n <path\n fill=\"currentColor\"\n d=\"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z\"\n />\n </svg>,\n);\n\nconst ArrowUpward = Icon(\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"currentColor\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </svg>,\n);\n\nexport const defaultIcons: TableTheme['icons'] = {\n Settings,\n Export,\n Clipboard,\n ChevronRight,\n Search,\n Clear,\n ArrowDropDown,\n FilterList,\n ArrowUpward,\n};\n","import type { TableTheme } from '../../types';\n\nexport const defaultTexts: TableTheme['text'] = {\n selectColumns: 'Select visible columns',\n showAllColumns: 'Show all',\n hideAllColumns: 'Hide all',\n noResults: 'No results',\n exportTitle: 'Export',\n exportCopy: 'To clipboard',\n exportDownload: 'Download',\n today: 'Today',\n thisWeek: 'This week',\n thisMonth: 'This month',\n thisYear: 'This year',\n lastSevenDays: 'Last 7 days',\n lastThirtyDays: 'Last 30 days',\n clearFilters: 'Clear all filters',\n reset: 'Reset',\n loading: 'Loading',\n deselectAll: 'Deselect all',\n resetAll: 'Reset table state',\n rangeMin: 'Min',\n rangeMax: 'Max',\n calendarWeek: 'Wk',\n hiddenColumnFilters: 'Filters of hidden columns',\n};\n","import type { TableTheme } from '../../types';\nimport { defaultColors } from './defaultColors';\nimport { defaultComponents } from './defaultComponents';\nimport { defaultIcons } from './defaultIcons';\nimport { defaultTexts } from './defaultTexts';\n\nexport const defaultTableTheme: TableTheme = {\n text: defaultTexts,\n components: defaultComponents,\n icons: defaultIcons,\n colors: defaultColors,\n spacing: '5px',\n};\n","import { createContext, useContext, useMemo } from 'react';\nimport { TableSettingsContext } from '../misc/tableSettings';\nimport { defaultTableTheme } from '../theme/defaultTheme';\nimport { mergeThemes } from '../theme/tableTheme';\nimport type { InternalColumn, PartialTableTheme, TableTheme } from '../types';\n\nexport const ThemeContext = createContext<TableTheme<any> | null>(null);\n\n/** default < TableSettingsProvider < table props, merged once per change instead of per consumer. */\nexport function useTableTheme<T>(props: PartialTableTheme<T>): TableTheme<T> {\n const { theme: contextTheme } = useContext(TableSettingsContext);\n const { text, classes, styles, components, icons, colors, spacing } = props;\n\n return useMemo(\n () =>\n mergeThemes<T>(defaultTableTheme as TableTheme<T>, contextTheme as PartialTableTheme<T>, {\n text,\n classes,\n styles,\n components,\n icons,\n colors,\n spacing,\n }) as TableTheme<T>,\n [contextTheme, text, classes, styles, components, icons, colors, spacing],\n );\n}\n\nexport function useTheme<T, S>(selector: (theme: TableTheme<T>) => S): S {\n const tableTheme = useContext(ThemeContext);\n const { theme: contextTheme } = useContext(TableSettingsContext);\n const fallback = useMemo(\n () =>\n tableTheme\n ? undefined\n : (mergeThemes(defaultTableTheme, contextTheme) as TableTheme<unknown>),\n [tableTheme, contextTheme],\n );\n\n return selector((tableTheme ?? fallback) as TableTheme<T>);\n}\n\n/** The theme with a column's own classes and styles layered on top. */\nexport function columnTheme<T>(\n theme: TableTheme<T>,\n column: Pick<InternalColumn<T, unknown>, 'classes' | 'styles'> | undefined,\n): TableTheme<T> {\n if (!column?.classes && !column?.styles) return theme;\n return {\n ...theme,\n classes: { ...theme.classes, ...column.classes },\n styles: { ...theme.styles, ...column.styles },\n };\n}\n"],"mappings":";;;;;;;;;;;;AAEA,MAAa,gBAAsC;CACjD,SAAS;EAAE,MAAM;EAAW,OAA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;EAAY;EAAO;EAAQ;CAAO,CAC1E;AACF;AAEA,SAAgB,SAAe,UAA0C;CACvE,MAAM,cAAA,GAAaH,MAAAA,WAAAA,CAAW,YAAY;CAC1C,MAAM,EAAE,OAAO,kBAAA,GAAiBA,MAAAA,WAAAA,CAAWC,mBAAAA,oBAAoB;CAC/D,MAAM,YAAA,GAAWC,MAAAA,QAAAA,OAEb,aACI,KAAA,IACCC,mBAAAA,YAAY,mBAAmB,YAAY,GAClD,CAAC,YAAY,YAAY,CAC3B;CAEA,OAAO,SAAU,cAAc,QAA0B;AAC3D;;AAGA,SAAgB,YACd,OACA,QACe;CACf,IAAI,CAAC,QAAQ,WAAW,CAAC,QAAQ,QAAQ,OAAO;CAChD,OAAO;EACL,GAAG;EACH,SAAS;GAAE,GAAG,MAAM;GAAS,GAAG,OAAO;EAAQ;EAC/C,QAAQ;GAAE,GAAG,MAAM;GAAQ,GAAG,OAAO;EAAO;CAC9C;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schummar-table",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A fast, fully typed React table with sorting, filtering, selection, trees, virtualization, persistence and exports.",
5
5
  "keywords": [
6
6
  "react",