add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

6
node_modules/rc-picker/es/hooks/useLocale.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import type { Locale, SharedTimeProps } from '../interface';
export declare function fillTimeFormat(showHour: boolean, showMinute: boolean, showSecond: boolean, showMillisecond: boolean, showMeridiem: boolean): string;
/**
* Fill locale format as start up
*/
export default function useLocale<DateType extends object>(locale: Locale, showProps: Pick<SharedTimeProps<DateType>, 'showHour' | 'showMinute' | 'showSecond' | 'showMillisecond' | 'use12Hours'>): Locale;

77
node_modules/rc-picker/es/hooks/useLocale.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import React from 'react';
export function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {
var timeFormat = '';
// Base HH:mm:ss
var cells = [];
if (showHour) {
cells.push(showMeridiem ? 'hh' : 'HH');
}
if (showMinute) {
cells.push('mm');
}
if (showSecond) {
cells.push('ss');
}
timeFormat = cells.join(':');
// Millisecond
if (showMillisecond) {
timeFormat += '.SSS';
}
// Meridiem
if (showMeridiem) {
timeFormat += ' A';
}
return timeFormat;
}
/**
* Used for `useFilledProps` since it already in the React.useMemo
*/
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
// Not fill `monthFormat` since `locale.shortMonths` handle this
// Not fill `cellMeridiemFormat` since AM & PM by default
var fieldDateTimeFormat = locale.fieldDateTimeFormat,
fieldDateFormat = locale.fieldDateFormat,
fieldTimeFormat = locale.fieldTimeFormat,
fieldMonthFormat = locale.fieldMonthFormat,
fieldYearFormat = locale.fieldYearFormat,
fieldWeekFormat = locale.fieldWeekFormat,
fieldQuarterFormat = locale.fieldQuarterFormat,
yearFormat = locale.yearFormat,
cellYearFormat = locale.cellYearFormat,
cellQuarterFormat = locale.cellQuarterFormat,
dayFormat = locale.dayFormat,
cellDateFormat = locale.cellDateFormat;
var timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
return _objectSpread(_objectSpread({}, locale), {}, {
fieldDateTimeFormat: fieldDateTimeFormat || "YYYY-MM-DD ".concat(timeFormat),
fieldDateFormat: fieldDateFormat || 'YYYY-MM-DD',
fieldTimeFormat: fieldTimeFormat || timeFormat,
fieldMonthFormat: fieldMonthFormat || 'YYYY-MM',
fieldYearFormat: fieldYearFormat || 'YYYY',
fieldWeekFormat: fieldWeekFormat || 'gggg-wo',
fieldQuarterFormat: fieldQuarterFormat || 'YYYY-[Q]Q',
yearFormat: yearFormat || 'YYYY',
cellYearFormat: cellYearFormat || 'YYYY',
cellQuarterFormat: cellQuarterFormat || '[Q]Q',
cellDateFormat: cellDateFormat || dayFormat || 'D'
});
}
/**
* Fill locale format as start up
*/
export default function useLocale(locale, showProps) {
var showHour = showProps.showHour,
showMinute = showProps.showMinute,
showSecond = showProps.showSecond,
showMillisecond = showProps.showMillisecond,
use12Hours = showProps.use12Hours;
return React.useMemo(function () {
return fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours);
}, [locale, showHour, showMinute, showSecond, showMillisecond, use12Hours]);
}

6
node_modules/rc-picker/es/hooks/useSyncState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Sync value with state.
* This should only used for internal which not affect outside calculation.
* Since it's not safe for suspense.
*/
export default function useSyncState<T>(defaultValue: T, controlledValue?: T): [getter: (useControlledValueFirst?: boolean) => T, setter: (nextValue: T) => void, value: T];

22
node_modules/rc-picker/es/hooks/useSyncState.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
/**
* Sync value with state.
* This should only used for internal which not affect outside calculation.
* Since it's not safe for suspense.
*/
export default function useSyncState(defaultValue, controlledValue) {
var valueRef = React.useRef(defaultValue);
var _React$useState = React.useState({}),
_React$useState2 = _slicedToArray(_React$useState, 2),
forceUpdate = _React$useState2[1];
var getter = function getter(useControlledValueFirst) {
return useControlledValueFirst && controlledValue !== undefined ? controlledValue : valueRef.current;
};
var setter = function setter(nextValue) {
valueRef.current = nextValue;
forceUpdate({});
};
return [getter, setter, getter(true)];
}

18
node_modules/rc-picker/es/hooks/useTimeConfig.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import type { InternalMode, Locale, SharedPickerProps, SharedTimeProps } from '../interface';
export interface ComponentProps<DateType extends object> {
picker?: InternalMode;
showTime?: boolean | Partial<SharedTimeProps<DateType>>;
locale: Locale;
format?: SharedPickerProps['format'];
}
/**
* Get `showHour`, `showMinute`, `showSecond` or other from the props.
* This is pure function, will not get `showXXX` from the `format` prop.
*/
export declare function getTimeProps<DateType extends object>(componentProps: ComponentProps<DateType>): [
showTimeProps: SharedTimeProps<DateType>,
showTimePropsForLocale: SharedTimeProps<DateType>,
showTimeFormat: string,
propFormat: string
];
export declare function fillShowTimeConfig<DateType extends object>(picker: InternalMode, showTimeFormat: string, propFormat: string, timeConfig: SharedTimeProps<DateType>, locale: Locale): SharedTimeProps<DateType>;

157
node_modules/rc-picker/es/hooks/useTimeConfig.js generated vendored Normal file
View File

@@ -0,0 +1,157 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import { getRowFormat, pickProps, toArray } from "../utils/miscUtil";
import { fillTimeFormat } from "./useLocale";
function checkShow(format, keywords, show) {
return show !== null && show !== void 0 ? show : keywords.some(function (keyword) {
return format.includes(keyword);
});
}
var showTimeKeys = [
// 'format',
'showNow', 'showHour', 'showMinute', 'showSecond', 'showMillisecond', 'use12Hours', 'hourStep', 'minuteStep', 'secondStep', 'millisecondStep', 'hideDisabledOptions', 'defaultValue', 'disabledHours', 'disabledMinutes', 'disabledSeconds', 'disabledMilliseconds', 'disabledTime', 'changeOnScroll', 'defaultOpenValue'];
/**
* Get SharedTimeProps from props.
*/
function pickTimeProps(props) {
var timeProps = pickProps(props, showTimeKeys);
var format = props.format,
picker = props.picker;
var propFormat = null;
if (format) {
propFormat = format;
if (Array.isArray(propFormat)) {
propFormat = propFormat[0];
}
propFormat = _typeof(propFormat) === 'object' ? propFormat.format : propFormat;
}
if (picker === 'time') {
timeProps.format = propFormat;
}
return [timeProps, propFormat];
}
function isStringFormat(format) {
return format && typeof format === 'string';
}
/** Check if all the showXXX is `undefined` */
function existShowConfig(showHour, showMinute, showSecond, showMillisecond) {
return [showHour, showMinute, showSecond, showMillisecond].some(function (show) {
return show !== undefined;
});
}
/** Fill the showXXX if needed */
function fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond) {
var parsedShowHour = showHour;
var parsedShowMinute = showMinute;
var parsedShowSecond = showSecond;
if (!hasShowConfig && !parsedShowHour && !parsedShowMinute && !parsedShowSecond && !showMillisecond) {
parsedShowHour = true;
parsedShowMinute = true;
parsedShowSecond = true;
} else if (hasShowConfig) {
var _parsedShowHour, _parsedShowMinute, _parsedShowSecond;
var existFalse = [parsedShowHour, parsedShowMinute, parsedShowSecond].some(function (show) {
return show === false;
});
var existTrue = [parsedShowHour, parsedShowMinute, parsedShowSecond].some(function (show) {
return show === true;
});
var defaultShow = existFalse ? true : !existTrue;
parsedShowHour = (_parsedShowHour = parsedShowHour) !== null && _parsedShowHour !== void 0 ? _parsedShowHour : defaultShow;
parsedShowMinute = (_parsedShowMinute = parsedShowMinute) !== null && _parsedShowMinute !== void 0 ? _parsedShowMinute : defaultShow;
parsedShowSecond = (_parsedShowSecond = parsedShowSecond) !== null && _parsedShowSecond !== void 0 ? _parsedShowSecond : defaultShow;
}
return [parsedShowHour, parsedShowMinute, parsedShowSecond, showMillisecond];
}
/**
* Get `showHour`, `showMinute`, `showSecond` or other from the props.
* This is pure function, will not get `showXXX` from the `format` prop.
*/
export function getTimeProps(componentProps) {
var showTime = componentProps.showTime;
var _pickTimeProps = pickTimeProps(componentProps),
_pickTimeProps2 = _slicedToArray(_pickTimeProps, 2),
pickedProps = _pickTimeProps2[0],
propFormat = _pickTimeProps2[1];
var showTimeConfig = showTime && _typeof(showTime) === 'object' ? showTime : {};
var timeConfig = _objectSpread(_objectSpread({
defaultOpenValue: showTimeConfig.defaultOpenValue || showTimeConfig.defaultValue
}, pickedProps), showTimeConfig);
var showMillisecond = timeConfig.showMillisecond;
var showHour = timeConfig.showHour,
showMinute = timeConfig.showMinute,
showSecond = timeConfig.showSecond;
var hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
var _fillShowConfig = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond);
var _fillShowConfig2 = _slicedToArray(_fillShowConfig, 3);
showHour = _fillShowConfig2[0];
showMinute = _fillShowConfig2[1];
showSecond = _fillShowConfig2[2];
return [timeConfig, _objectSpread(_objectSpread({}, timeConfig), {}, {
showHour: showHour,
showMinute: showMinute,
showSecond: showSecond,
showMillisecond: showMillisecond
}), timeConfig.format, propFormat];
}
export function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, locale) {
var isTimePicker = picker === 'time';
if (picker === 'datetime' || isTimePicker) {
var pickedProps = timeConfig;
// ====================== BaseFormat ======================
var defaultLocaleFormat = getRowFormat(picker, locale, null);
var baselineFormat = defaultLocaleFormat;
var formatList = [showTimeFormat, propFormat];
for (var i = 0; i < formatList.length; i += 1) {
var format = toArray(formatList[i])[0];
if (isStringFormat(format)) {
baselineFormat = format;
break;
}
}
// ========================= Show =========================
var showHour = pickedProps.showHour,
showMinute = pickedProps.showMinute,
showSecond = pickedProps.showSecond,
showMillisecond = pickedProps.showMillisecond;
var use12Hours = pickedProps.use12Hours;
var showMeridiem = checkShow(baselineFormat, ['a', 'A', 'LT', 'LLL', 'LTS'], use12Hours);
var hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
// Fill with format, if needed
if (!hasShowConfig) {
showHour = checkShow(baselineFormat, ['H', 'h', 'k', 'LT', 'LLL']);
showMinute = checkShow(baselineFormat, ['m', 'LT', 'LLL']);
showSecond = checkShow(baselineFormat, ['s', 'LTS']);
showMillisecond = checkShow(baselineFormat, ['SSS']);
}
// Fallback if all can not see
// ======================== Format ========================
var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond);
var _fillShowConfig4 = _slicedToArray(_fillShowConfig3, 3);
showHour = _fillShowConfig4[0];
showMinute = _fillShowConfig4[1];
showSecond = _fillShowConfig4[2];
var timeFormat = showTimeFormat || fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem);
// ======================== Props =========================
return _objectSpread(_objectSpread({}, pickedProps), {}, {
// Format
format: timeFormat,
// Show Config
showHour: showHour,
showMinute: showMinute,
showSecond: showSecond,
showMillisecond: showMillisecond,
use12Hours: showMeridiem
});
}
return null;
}

12
node_modules/rc-picker/es/hooks/useTimeInfo.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import * as React from 'react';
import type { GenerateConfig } from '../generate';
import type { SharedTimeProps } from '../interface';
export type Unit<ValueType = number | string> = {
label: React.ReactText;
value: ValueType;
disabled?: boolean;
};
/**
* Parse time props to get util info
*/
export default function useTimeInfo<DateType extends object = any>(generateConfig: GenerateConfig<DateType>, props?: SharedTimeProps<DateType>, date?: DateType): readonly [(nextTime: DateType, certainDate?: DateType) => DateType, Unit<number>[], (nextHour: number) => Unit<number>[], (nextHour: number, nextMinute: number) => Unit<number>[], (nextHour: number, nextMinute: number, nextSecond: number) => Unit<number>[]];

154
node_modules/rc-picker/es/hooks/useTimeInfo.js generated vendored Normal file
View File

@@ -0,0 +1,154 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import { warning } from 'rc-util';
import * as React from 'react';
import { findValidateTime } from "../PickerPanel/TimePanel/TimePanelBody/util";
import { leftPad } from "../utils/miscUtil";
function emptyDisabled() {
return [];
}
function generateUnits(start, end) {
var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var hideDisabledOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var disabledUnits = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
var pad = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 2;
var units = [];
var integerStep = step >= 1 ? step | 0 : 1;
for (var i = start; i <= end; i += integerStep) {
var disabled = disabledUnits.includes(i);
if (!disabled || !hideDisabledOptions) {
units.push({
label: leftPad(i, pad),
value: i,
disabled: disabled
});
}
}
return units;
}
/**
* Parse time props to get util info
*/
export default function useTimeInfo(generateConfig) {
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var date = arguments.length > 2 ? arguments[2] : undefined;
var _ref = props || {},
use12Hours = _ref.use12Hours,
_ref$hourStep = _ref.hourStep,
hourStep = _ref$hourStep === void 0 ? 1 : _ref$hourStep,
_ref$minuteStep = _ref.minuteStep,
minuteStep = _ref$minuteStep === void 0 ? 1 : _ref$minuteStep,
_ref$secondStep = _ref.secondStep,
secondStep = _ref$secondStep === void 0 ? 1 : _ref$secondStep,
_ref$millisecondStep = _ref.millisecondStep,
millisecondStep = _ref$millisecondStep === void 0 ? 100 : _ref$millisecondStep,
hideDisabledOptions = _ref.hideDisabledOptions,
disabledTime = _ref.disabledTime,
disabledHours = _ref.disabledHours,
disabledMinutes = _ref.disabledMinutes,
disabledSeconds = _ref.disabledSeconds;
var mergedDate = React.useMemo(function () {
return date || generateConfig.getNow();
}, [date, generateConfig]);
// ======================== Warnings ========================
if (process.env.NODE_ENV !== 'production') {
var isHourStepValid = 24 % hourStep === 0;
var isMinuteStepValid = 60 % minuteStep === 0;
var isSecondStepValid = 60 % secondStep === 0;
warning(isHourStepValid, "`hourStep` ".concat(hourStep, " is invalid. It should be a factor of 24."));
warning(isMinuteStepValid, "`minuteStep` ".concat(minuteStep, " is invalid. It should be a factor of 60."));
warning(isSecondStepValid, "`secondStep` ".concat(secondStep, " is invalid. It should be a factor of 60."));
}
// ======================== Disabled ========================
var getDisabledTimes = React.useCallback(function (targetDate) {
var disabledConfig = (disabledTime === null || disabledTime === void 0 ? void 0 : disabledTime(targetDate)) || {};
return [disabledConfig.disabledHours || disabledHours || emptyDisabled, disabledConfig.disabledMinutes || disabledMinutes || emptyDisabled, disabledConfig.disabledSeconds || disabledSeconds || emptyDisabled, disabledConfig.disabledMilliseconds || emptyDisabled];
}, [disabledTime, disabledHours, disabledMinutes, disabledSeconds]);
var _React$useMemo = React.useMemo(function () {
return getDisabledTimes(mergedDate);
}, [mergedDate, getDisabledTimes]),
_React$useMemo2 = _slicedToArray(_React$useMemo, 4),
mergedDisabledHours = _React$useMemo2[0],
mergedDisabledMinutes = _React$useMemo2[1],
mergedDisabledSeconds = _React$useMemo2[2],
mergedDisabledMilliseconds = _React$useMemo2[3];
// ========================= Column =========================
var getAllUnits = React.useCallback(function (getDisabledHours, getDisabledMinutes, getDisabledSeconds, getDisabledMilliseconds) {
var hours = generateUnits(0, 23, hourStep, hideDisabledOptions, getDisabledHours());
// Hours
var rowHourUnits = use12Hours ? hours.map(function (unit) {
return _objectSpread(_objectSpread({}, unit), {}, {
label: leftPad(unit.value % 12 || 12, 2)
});
}) : hours;
// Minutes
var getMinuteUnits = function getMinuteUnits(nextHour) {
return generateUnits(0, 59, minuteStep, hideDisabledOptions, getDisabledMinutes(nextHour));
};
// Seconds
var getSecondUnits = function getSecondUnits(nextHour, nextMinute) {
return generateUnits(0, 59, secondStep, hideDisabledOptions, getDisabledSeconds(nextHour, nextMinute));
};
// Milliseconds
var getMillisecondUnits = function getMillisecondUnits(nextHour, nextMinute, nextSecond) {
return generateUnits(0, 999, millisecondStep, hideDisabledOptions, getDisabledMilliseconds(nextHour, nextMinute, nextSecond), 3);
};
return [rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits];
}, [hideDisabledOptions, hourStep, use12Hours, millisecondStep, minuteStep, secondStep]);
var _React$useMemo3 = React.useMemo(function () {
return getAllUnits(mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds);
}, [getAllUnits, mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds]),
_React$useMemo4 = _slicedToArray(_React$useMemo3, 4),
rowHourUnits = _React$useMemo4[0],
getMinuteUnits = _React$useMemo4[1],
getSecondUnits = _React$useMemo4[2],
getMillisecondUnits = _React$useMemo4[3];
// ======================== Validate ========================
/**
* Get validate time with `disabledTime`, `certainDate` to specific the date need to check
*/
var getValidTime = function getValidTime(nextTime, certainDate) {
var getCheckHourUnits = function getCheckHourUnits() {
return rowHourUnits;
};
var getCheckMinuteUnits = getMinuteUnits;
var getCheckSecondUnits = getSecondUnits;
var getCheckMillisecondUnits = getMillisecondUnits;
if (certainDate) {
var _getDisabledTimes = getDisabledTimes(certainDate),
_getDisabledTimes2 = _slicedToArray(_getDisabledTimes, 4),
targetDisabledHours = _getDisabledTimes2[0],
targetDisabledMinutes = _getDisabledTimes2[1],
targetDisabledSeconds = _getDisabledTimes2[2],
targetDisabledMilliseconds = _getDisabledTimes2[3];
var _getAllUnits = getAllUnits(targetDisabledHours, targetDisabledMinutes, targetDisabledSeconds, targetDisabledMilliseconds),
_getAllUnits2 = _slicedToArray(_getAllUnits, 4),
targetRowHourUnits = _getAllUnits2[0],
targetGetMinuteUnits = _getAllUnits2[1],
targetGetSecondUnits = _getAllUnits2[2],
targetGetMillisecondUnits = _getAllUnits2[3];
getCheckHourUnits = function getCheckHourUnits() {
return targetRowHourUnits;
};
getCheckMinuteUnits = targetGetMinuteUnits;
getCheckSecondUnits = targetGetSecondUnits;
getCheckMillisecondUnits = targetGetMillisecondUnits;
}
var validateDate = findValidateTime(nextTime, getCheckHourUnits, getCheckMinuteUnits, getCheckSecondUnits, getCheckMillisecondUnits, generateConfig);
return validateDate;
};
return [
// getValidTime
getValidTime,
// Units
rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits];
}

8
node_modules/rc-picker/es/hooks/useToggleDates.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type { GenerateConfig } from '../generate';
import type { InternalMode, Locale } from '../interface';
/**
* Toggles the presence of a value in an array.
* If the value exists in the array, removed it.
* Else add it.
*/
export default function useToggleDates<DateType>(generateConfig: GenerateConfig<DateType>, locale: Locale, panelMode: InternalMode): (list: DateType[], target: DateType) => DateType[];

21
node_modules/rc-picker/es/hooks/useToggleDates.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import { isSame } from "../utils/dateUtil";
/**
* Toggles the presence of a value in an array.
* If the value exists in the array, removed it.
* Else add it.
*/
export default function useToggleDates(generateConfig, locale, panelMode) {
function toggleDates(list, target) {
var index = list.findIndex(function (date) {
return isSame(generateConfig, locale, date, target, panelMode);
});
if (index === -1) {
return [].concat(_toConsumableArray(list), [target]);
}
var sliceList = _toConsumableArray(list);
sliceList.splice(index, 1);
return sliceList;
}
return toggleDates;
}