Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-time-input-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-time-input-polyfill - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

docs/asset-manifest.json

1

index.js

@@ -327,2 +327,3 @@ import React from 'react'

handleKeyDown(e) {
this.props.onKeyDown && this.props.onKeyDown(e)
if (!this.state.usePolyfill) return null

@@ -329,0 +330,0 @@ const key = e.key

2

package.json
{
"name": "react-time-input-polyfill",
"version": "1.0.0",
"version": "1.0.1",
"description": "A pre-built, plug-and-play, fully accessible React component that will produce an `input[type='time']` element with a built in polyfill for IE and Safari support.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,54 +7,2 @@ import React, { useState } from 'react'

// import React, { useState } from 'react'
// import TimeInputPolyfill from 'react-time-input-polyfill'
const TimeInputExample = ({ label, currentValue, onInputChange }) => {
return (
<label>
<span>{label}</span>
<TimeInput
// set the value through props
value={currentValue}
// onChange will run every time the value is updated
onChange={({ value, element }) => {
console.log({
// The current value in 24 hour time format
value,
// The <input> HTML element
element,
})
// Export the new value to the parent component
onInputChange(value)
}}
/>
</label>
)
}
//////////////////////////////////////
const ExampleForm = () => {
// Use state to keep track of the value
const [inputValue, setInputValue] = useState('20:30') // default to 8:30 PM
const onSubmit = e => {
e.preventDefault()
}
return (
<form onSubmit={onSubmit}>
<TimeInputExample
label="Label text"
// Use the state value to set the time
currentValue={inputValue}
// Use the set state function to update the time when it changes
onInputChange={newValue => setInputValue(newValue)}
/>
<button type="submit">Submit</button>
</form>
)
}
const ExampleBlock = ({ label, Input, codeString }) => {

@@ -114,9 +62,19 @@ const [value, setValue] = useState('20:30')

<p>Code examples are simplified guides, not exact code replicas.</p>
<SyntaxHighlighter
style={dark}
className="code centered"
language="text"
showLineNumbers={false}
>
npm install react-time-input-polyfill
</SyntaxHighlighter>
<p>
Code examples are simplified guides,{' '}
<strong>not exact code replicas</strong>.
<a href="https://github.com/Dan503/react-time-input-polyfill#react-time-input-polyfill">
Visit me on GitHub
</a>
</p>
<ExampleForm></ExampleForm>
<ExampleBlock

@@ -123,0 +81,0 @@ label="Non-forced polyfill"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc