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

5
node_modules/rc-input-number/es/hooks/useCursor.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
/**
* Keep input cursor in the correct position if possible.
* Is this necessary since we have `formatter` which may mass the content?
*/
export default function useCursor(input: HTMLInputElement, focused: boolean): [() => void, () => void];

63
node_modules/rc-input-number/es/hooks/useCursor.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import { useRef } from 'react';
import warning from "rc-util/es/warning";
/**
* Keep input cursor in the correct position if possible.
* Is this necessary since we have `formatter` which may mass the content?
*/
export default function useCursor(input, focused) {
var selectionRef = useRef(null);
function recordCursor() {
// Record position
try {
var start = input.selectionStart,
end = input.selectionEnd,
value = input.value;
var beforeTxt = value.substring(0, start);
var afterTxt = value.substring(end);
selectionRef.current = {
start: start,
end: end,
value: value,
beforeTxt: beforeTxt,
afterTxt: afterTxt
};
} catch (e) {
// Fix error in Chrome:
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
// http://stackoverflow.com/q/21177489/3040605
}
}
/**
* Restore logic:
* 1. back string same
* 2. start string same
*/
function restoreCursor() {
if (input && selectionRef.current && focused) {
try {
var value = input.value;
var _selectionRef$current = selectionRef.current,
beforeTxt = _selectionRef$current.beforeTxt,
afterTxt = _selectionRef$current.afterTxt,
start = _selectionRef$current.start;
var startPos = value.length;
if (value.startsWith(beforeTxt)) {
startPos = beforeTxt.length;
} else if (value.endsWith(afterTxt)) {
startPos = value.length - selectionRef.current.afterTxt.length;
} else {
var beforeLastChar = beforeTxt[start - 1];
var newIndex = value.indexOf(beforeLastChar, start - 1);
if (newIndex !== -1) {
startPos = newIndex + 1;
}
}
input.setSelectionRange(startPos, startPos);
} catch (e) {
warning(false, "Something warning of cursor restore. Please fire issue about this: ".concat(e.message));
}
}
}
return [recordCursor, restoreCursor];
}

5
node_modules/rc-input-number/es/hooks/useFrame.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
/**
* Always trigger latest once when call multiple time
*/
declare const _default: () => (callback: () => void) => void;
export default _default;

21
node_modules/rc-input-number/es/hooks/useFrame.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import { useRef, useEffect } from 'react';
import raf from "rc-util/es/raf";
/**
* Always trigger latest once when call multiple time
*/
export default (function () {
var idRef = useRef(0);
var cleanUp = function cleanUp() {
raf.cancel(idRef.current);
};
useEffect(function () {
return cleanUp;
}, []);
return function (callback) {
cleanUp();
idRef.current = raf(function () {
callback();
});
};
});