New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-autowhatever

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-autowhatever - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

22

demo/src/components/App/components/Example0/Example0.js

@@ -24,20 +24,2 @@ import theme from '../theme.less';

const items = [{
text: 'Apple'
}, {
text: 'Banana'
}, {
text: 'Cherry'
}, {
text: 'Grapefruit'
}, {
text: 'Lemon'
}];
function renderItem(item) {
return (
<span>{item.text}</span>
);
}
class Example extends Component {

@@ -56,5 +38,3 @@ static propTypes = {

<Autowhatever id={exampleId}
isOpen={false}
items={items}
renderItem={renderItem}
items={[]}
inputProps={inputProps}

@@ -61,0 +41,0 @@ theme={theme} />

@@ -55,3 +55,2 @@ import theme from '../theme.less';

<Autowhatever id={exampleId}
isOpen={true}
items={items}

@@ -58,0 +57,0 @@ renderItem={renderItem}

@@ -55,3 +55,2 @@ import theme from '../theme.less';

<Autowhatever id={exampleId}
isOpen={true}
items={items}

@@ -58,0 +57,0 @@ renderItem={renderItem}

@@ -77,3 +77,2 @@ import theme from '../theme.less';

isMultiSection={true}
isOpen={true}
items={items}

@@ -80,0 +79,0 @@ shouldRenderSection={shouldRenderSection}

@@ -77,3 +77,2 @@ import theme from '../theme.less';

isMultiSection={true}
isOpen={true}
items={items}

@@ -80,0 +79,0 @@ shouldRenderSection={shouldRenderSection}

8

dist/Autowhatever.js

@@ -133,3 +133,2 @@ 'use strict';

var isMultiSection = _props4.isMultiSection;
var isOpen = _props4.isOpen;
var items = _props4.items;

@@ -139,2 +138,3 @@ var focusedSectionIndex = _props4.focusedSectionIndex;

var isOpen = items.length > 0;
var ariaActivedescendant = this.getItemId(focusedSectionIndex, focusedItemIndex);

@@ -166,5 +166,4 @@ var theme = (0, _reactThemeable2['default'])(this.props.theme);

isMultiSection: _react.PropTypes.bool, // Indicates whether a multi section list of items should be rendered.
isOpen: _react.PropTypes.bool.isRequired, // Indicates whether `items` should be rendered, or not.
items: _react.PropTypes.array.isRequired, // Array of items or sections to render.
renderItem: _react.PropTypes.func.isRequired, // This function renders a single item.
renderItem: _react.PropTypes.func, // This function renders a single item.
shouldRenderSection: _react.PropTypes.func, // This function gets a section and returns whether it should be rendered, or not.

@@ -187,2 +186,5 @@ renderSectionTitle: _react.PropTypes.func, // This function gets a section and renders its title.

},
renderItem: function renderItem() {
throw new Error('`renderItem` must be provided');
},
renderSectionTitle: function renderSectionTitle() {

@@ -189,0 +191,0 @@ throw new Error('`renderSectionTitle` must be provided');

{
"name": "react-autowhatever",
"version": "0.1.2",
"version": "0.2.0",
"description": "Accessible rendering layer for Autosuggest and Autocomplete components",

@@ -5,0 +5,0 @@ "main": "dist/Autowhatever.js",

@@ -8,5 +8,4 @@ import React, { Component, PropTypes } from 'react';

isMultiSection: PropTypes.bool, // Indicates whether a multi section list of items should be rendered.
isOpen: PropTypes.bool.isRequired, // Indicates whether `items` should be rendered, or not.
items: PropTypes.array.isRequired, // Array of items or sections to render.
renderItem: PropTypes.func.isRequired, // This function renders a single item.
renderItem: PropTypes.func, // This function renders a single item.
shouldRenderSection: PropTypes.func, // This function gets a section and returns whether it should be rendered, or not.

@@ -25,2 +24,5 @@ renderSectionTitle: PropTypes.func, // This function gets a section and renders its title.

shouldRenderSection: () => true,
renderItem: () => {
throw new Error('`renderItem` must be provided');
},
renderSectionTitle: () => {

@@ -121,4 +123,4 @@ throw new Error('`renderSectionTitle` must be provided');

render() {
const { id, isMultiSection, isOpen, items,
focusedSectionIndex, focusedItemIndex } = this.props;
const { id, isMultiSection, items, focusedSectionIndex, focusedItemIndex } = this.props;
const isOpen = (items.length > 0);
const ariaActivedescendant = this.getItemId(focusedSectionIndex, focusedItemIndex);

@@ -125,0 +127,0 @@ const theme = themeable(this.props.theme);

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