From a6fa3c8b4a5d41b285a013f8a06e621a98e5ec5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Osvald?= Date: Mon, 15 Sep 2025 17:41:10 +0200 Subject: [PATCH] 15: code cleanup --- demo/index.html | 5 ++++- demo/index.jsx | 11 ++--------- src/smart-time-input.tsx | 12 ------------ 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/demo/index.html b/demo/index.html index 535a887..bd9f78f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,5 +1,6 @@ + Smart Time Input @@ -34,9 +35,11 @@ +

Smart Time Input

- + + \ No newline at end of file diff --git a/demo/index.jsx b/demo/index.jsx index 2a1d3fb..6a90d13 100644 --- a/demo/index.jsx +++ b/demo/index.jsx @@ -3,22 +3,15 @@ import React from 'react' import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -// import { SmartTimeInput } from './../src/smart-time-input.tsx' import { SmartTimeInput } from './../dist/smart-time-input.js' const InputWrapper = (props) => { - console.log("hello: " + props.helpText); - // const onTimeChangeHandler = (val) => { - // if (val.length === 5) { - // } - // } return ( ); @@ -27,8 +20,8 @@ const InputWrapper = (props) => { function App() { return (
- - + +
); diff --git a/src/smart-time-input.tsx b/src/smart-time-input.tsx index bb3c609..e1bc1d7 100644 --- a/src/smart-time-input.tsx +++ b/src/smart-time-input.tsx @@ -2,26 +2,18 @@ import React, { useState } from 'react' import { is24hTime, addColonToTime, completeTime } from './utils'; interface SmartTimeInputProps extends React.PropsWithChildren { - id?: string; initTime?: string; - disabled?: boolean; - placeholder?: string; className?: string; divClassName?: string; - name?: string; ref?: React.Ref; onFocusHandler?: (e: React.FocusEvent) => void; onTimeChange?: (val: string) => void; onBlurHandlerSuper?: (e: React.FocusEvent) => void; } const SmartTimeInput: React.FC = ({ - id, initTime, - disabled, - placeholder, className, divClassName, - name, ref, onFocusHandler, onTimeChange, @@ -57,12 +49,8 @@ const SmartTimeInput: React.FC = ({ return (
handleTimeChange(e.target.value)} onBlur={(e) => autoExtendTime(e)}