feat: 自定义版本功能更新
Build and Release / Build (push) Has been cancelled

- 新增家庭共享订阅管理
- 新增用户邀请统计
- 新增签名和订阅模式设置表单
- 更新 API 服务层和国际化文件
- UI 组件优化(enhanced-input、pro-table)
This commit is contained in:
2026-03-19 01:56:13 -07:00
parent 31803a1d24
commit 6b92979c7c
82 changed files with 3266 additions and 739 deletions
+12 -22
View File
@@ -30,7 +30,8 @@ export function EnhancedInput<T = string>({
...props
}: EnhancedInputProps<T>) {
const getProcessedValue = (inputValue: unknown) => {
if (inputValue === "" || inputValue === 0 || inputValue === "0") return "";
if (inputValue === "" || inputValue === undefined || inputValue === null)
return "";
const newValue = String(inputValue ?? "");
return formatInput ? formatInput(inputValue as T) : newValue;
};
@@ -69,13 +70,6 @@ export function EnhancedInput<T = string>({
let inputValue = e.target.value;
if (props.type === "number") {
if (inputValue === "0") {
setValue("");
setInternalValue(0);
onValueChange?.(processValue(0));
return;
}
if (
/^-?\d*\.?\d*$/.test(inputValue) ||
inputValue === "-" ||
@@ -99,7 +93,7 @@ export function EnhancedInput<T = string>({
} else {
setInternalValue(inputValue);
}
setValue(inputValue === "0" ? "" : inputValue);
setValue(inputValue);
}
} else {
setValue(inputValue);
@@ -111,19 +105,15 @@ export function EnhancedInput<T = string>({
};
const handleBlur = () => {
if (props.type === "number" && value) {
if (value === "-" || value === ".") {
setValue("");
setInternalValue("");
onValueBlur?.("" as T);
return;
}
if (value === "0") {
setValue("");
onValueBlur?.(processValue(0));
return;
}
if (
props.type === "number" &&
value !== "" &&
(value === "-" || value === ".")
) {
setValue("");
setInternalValue("");
onValueBlur?.("" as T);
return;
}
const outputValue = processValue(value);
@@ -3,6 +3,7 @@
import type { Table } from "@tanstack/react-table";
import { Input } from "@workspace/ui/components/input";
import { Combobox } from "@workspace/ui/composed/combobox";
import { useEffect, useState } from "react";
export interface IParams {
key: string;
@@ -81,15 +82,52 @@ export function ColumnFilter<TData>({
);
}
return (
<Input
className="min-w-32"
<DebouncedInput
externalValue={filters[param.key] || ""}
key={param.key}
onChange={(event) => updateFilter(param.key, event.target.value)}
onSearch={(value) => updateFilter(param.key, value)}
placeholder={param.placeholder || "Search..."}
value={filters[param.key] || ""}
/>
);
})}
</div>
);
}
function DebouncedInput({
externalValue,
onSearch,
placeholder,
}: {
externalValue: string;
onSearch: (value: string) => void;
placeholder: string;
}) {
const [localValue, setLocalValue] = useState(externalValue);
// Sync from external (e.g. reset)
useEffect(() => {
setLocalValue(externalValue);
}, [externalValue]);
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setLocalValue(e.target.value);
};
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === "Enter") {
e.preventDefault();
onSearch(localValue);
}
};
return (
<Input
className="min-w-32"
onChange={handleChange}
onKeyDown={handleKeyDown}
placeholder={placeholder}
value={localValue}
/>
);
}
@@ -123,7 +123,7 @@ export function ProTable<
const [rowCount, setRowCount] = useState<number>(0);
const [pagination, setPagination] = useState({
pageIndex: 0,
pageSize: 10,
pageSize: 200,
});
const loading = useRef(false);