feat: init
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
chuan
2025-11-11 01:56:44 +08:00
commit bba4bb40c8
4638 changed files with 447437 additions and 0 deletions

View File

@@ -0,0 +1 @@
export * from "./root";

View File

@@ -0,0 +1,24 @@
import type { FC } from "react";
import { useTranslation } from "@plane/i18n";
type TEstimateNumberInputProps = {
value?: number;
handleEstimateInputValue: (value: string) => void;
};
export const EstimateNumberInput: FC<TEstimateNumberInputProps> = (props) => {
const { value, handleEstimateInputValue } = props;
// i18n
const { t } = useTranslation();
return (
<input
value={value}
onChange={(e) => handleEstimateInputValue(e.target.value)}
className="border-none focus:ring-0 focus:border-0 focus:outline-none px-2 py-2 w-full bg-transparent text-sm"
placeholder={t("project_settings.estimates.create.enter_estimate_point")}
autoFocus
type="number"
/>
);
};

View File

@@ -0,0 +1,40 @@
import type { FC } from "react";
// plane imports
import type { TEstimateSystemKeys } from "@plane/types";
import { EEstimateSystem } from "@plane/types";
// plane web imports
import { EstimateTimeInput } from "@/plane-web/components/estimates/inputs";
// local imports
import { EstimateNumberInput } from "./number-input";
import { EstimateTextInput } from "./text-input";
type TEstimateInputRootProps = {
estimateType: TEstimateSystemKeys;
handleEstimateInputValue: (value: string) => void;
value?: string;
};
export const EstimateInputRoot: FC<TEstimateInputRootProps> = (props) => {
const { estimateType, handleEstimateInputValue, value } = props;
switch (estimateType) {
case EEstimateSystem.POINTS:
return (
<EstimateNumberInput
value={value ? parseInt(value) : undefined}
handleEstimateInputValue={handleEstimateInputValue}
/>
);
case EEstimateSystem.CATEGORIES:
return <EstimateTextInput value={value} handleEstimateInputValue={handleEstimateInputValue} />;
case EEstimateSystem.TIME:
return (
<EstimateTimeInput
value={value ? parseInt(value) : undefined}
handleEstimateInputValue={handleEstimateInputValue}
/>
);
default:
return null;
}
};

View File

@@ -0,0 +1,24 @@
import type { FC } from "react";
import { useTranslation } from "@plane/i18n";
type TEstimateTextInputProps = {
value?: string;
handleEstimateInputValue: (value: string) => void;
};
export const EstimateTextInput: FC<TEstimateTextInputProps> = (props) => {
const { value, handleEstimateInputValue } = props;
// i18n
const { t } = useTranslation();
return (
<input
value={value}
onChange={(e) => handleEstimateInputValue(e.target.value)}
className="border-none focus:ring-0 focus:border-0 focus:outline-none px-3 py-2 w-full bg-transparent text-sm"
placeholder={t("project_settings.estimates.create.enter_estimate_point")}
autoFocus
type="text"
/>
);
};