From 2958ab7320be2ba66e297ac9eb30339315e5eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=93=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D1=86=D0=BA=D0=B8=D0=B9?= Date: Tue, 25 Aug 2026 11:33:01 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20min/max=20=D0=B2=20TextInput=20(=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=B8=D0=B0=D0=BF=D0=B0=D0=B7=D0=BE=D0=BD=D0=B0=20=D0=B4=D0=B0?= =?UTF-8?q?=D1=82=20=D0=B2=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5)=20(0.9.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/TextInput/TextInput.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 25a23de..778141a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tnsu/ui-kit", - "version": "0.8.0", + "version": "0.9.0", "description": "TNSU shared UI components for SPFx web parts", "author": "Timur Gorodetskiy", "license": "ISC", diff --git a/src/TextInput/TextInput.tsx b/src/TextInput/TextInput.tsx index 7efeeab..a8b307c 100644 --- a/src/TextInput/TextInput.tsx +++ b/src/TextInput/TextInput.tsx @@ -12,6 +12,13 @@ interface ITextInputProps { placeholder?: string; /** Только чтение (режим согласующего). */ readOnly?: boolean; + /** + * Границы значения — для type='date' YYYY-MM-DD (native min/max), для + * type='number' числовая граница. Браузер сам блокирует недоступные даты в + * календаре при type='date'. + */ + min?: string | number; + max?: string | number; } /** Однострочный ввод. type='number'|'date' — для числовых полей и дат. */ @@ -21,7 +28,9 @@ export const TextInput: React.FC = ({ value, onChange, placeholder, - readOnly + readOnly, + min, + max }) => { const contextReadOnly = useFormReadOnly(); const effectiveReadOnly = readOnly ?? contextReadOnly; @@ -33,6 +42,8 @@ export const TextInput: React.FC = ({ value={value} placeholder={placeholder} readOnly={effectiveReadOnly} + min={min} + max={max} onChange={(e) => onChange(e.target.value)} /> );