From f0570f7eab7b9c0ba03ff24ba5078517b4e4f96a Mon Sep 17 00:00:00 2001 From: Gabriel rocha Date: Mon, 25 Nov 2024 16:50:58 -0300 Subject: [PATCH 1/2] adjust calendar open this icon --- src/components/DatePicker/DatePicker.stories.tsx | 1 + src/components/DatePicker/index.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/DatePicker/DatePicker.stories.tsx b/src/components/DatePicker/DatePicker.stories.tsx index 16d44dc..8e83a30 100644 --- a/src/components/DatePicker/DatePicker.stories.tsx +++ b/src/components/DatePicker/DatePicker.stories.tsx @@ -26,6 +26,7 @@ const meta: Meta = { minDate: { control: { type: 'boolean' } }, maxDate: { control: { type: 'boolean' } }, inputVariant: { type: 'string' }, + disabledInput: { control: { type: 'boolean' } }, }, args: { onChange: onChange, diff --git a/src/components/DatePicker/index.tsx b/src/components/DatePicker/index.tsx index 59062ff..eb8d4fb 100644 --- a/src/components/DatePicker/index.tsx +++ b/src/components/DatePicker/index.tsx @@ -16,6 +16,7 @@ interface Props extends DatePickerProps { workDays?: boolean; holidays?: string[]; inputVariant?: 'default' | 'outlined'; + disabledInput?: boolean; } const DatePickerComponent: React.FC = ({ @@ -30,6 +31,7 @@ const DatePickerComponent: React.FC = ({ name, id, inputVariant = 'outlined', + disabledInput = false, }) => { const datePickerRef = useRef(); return ( @@ -43,8 +45,9 @@ const DatePickerComponent: React.FC = ({ id={id} value={value} onClick={openCalendar} - onChange={(e) => onChange(e)} + onChange={(e) => (disabledInput ? value : onChange(e))} iconRight="ChevronDownIcon" + onClickIconRight={openCalendar} variant={inputVariant} /> ); From b2a002e9cb0557d8b894d1a48d6163286e286996 Mon Sep 17 00:00:00 2001 From: Gabriel rocha Date: Tue, 26 Nov 2024 17:17:53 -0300 Subject: [PATCH 2/2] alter version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7aa0277..df91cce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@platformbuilders/fluid-react", - "version": "1.2.12", + "version": "1.2.13", "private": false, "description": "Builders React for Fluid Design System", "keywords": [