mirror of
https://github.com/fergalmoran/turnstone.git
synced 2025-12-27 12:18:03 +00:00
Remove nanoid dependency
Replace × with \u00d7
This commit is contained in:
5
package-lock.json
generated
5
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "turnstone",
|
"name": "turnstone",
|
||||||
"version": "0.3.0",
|
"version": "0.4.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "turnstone",
|
"name": "turnstone",
|
||||||
"version": "0.3.0",
|
"version": "0.4.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"first-of-type": "^1.0.0",
|
"first-of-type": "^1.0.0",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
"eslint-plugin-react": "^7.28.0",
|
"eslint-plugin-react": "^7.28.0",
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
"msw": "^0.36.8",
|
"msw": "^0.36.8",
|
||||||
"nanoid": "^3.3.1",
|
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
"eslint-plugin-react": "^7.28.0",
|
"eslint-plugin-react": "^7.28.0",
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
"msw": "^0.36.8",
|
"msw": "^0.36.8",
|
||||||
"nanoid": "^3.3.1",
|
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ const App = () => {
|
|||||||
data={fruits}
|
data={fruits}
|
||||||
dataSearchType={'startswith'}
|
dataSearchType={'startswith'}
|
||||||
debounceWait={0}
|
debounceWait={0}
|
||||||
id={'autocomplete'}
|
|
||||||
itemGroupsAreImmutable={true}
|
itemGroupsAreImmutable={true}
|
||||||
maxItems={10}
|
maxItems={10}
|
||||||
name={'search'}
|
name={'search'}
|
||||||
|
|||||||
@@ -2,20 +2,21 @@
|
|||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { nanoid } from 'nanoid'
|
|
||||||
import { StateContextProvider } from './context/state'
|
import { StateContextProvider } from './context/state'
|
||||||
import isUndefined from './utils/isUndefined'
|
import isUndefined from './utils/isUndefined'
|
||||||
import Container from './components/container'
|
import Container from './components/container'
|
||||||
|
|
||||||
|
const randomId = () => `turnstone-${(0|Math.random()*6.04e7).toString(36)}`
|
||||||
|
|
||||||
// Set prop defaults before passing them on to components
|
// Set prop defaults before passing them on to components
|
||||||
const propDefaults = {
|
const propDefaults = {
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
clearButton: false,
|
clearButton: false,
|
||||||
clearButtonAriaLabel: 'Clear contents',
|
clearButtonAriaLabel: 'Clear contents',
|
||||||
clearButtonText: '×',
|
clearButtonText: '\u00d7',
|
||||||
debounceWait: 250,
|
debounceWait: 250,
|
||||||
defaultItemGroupsAreImmutable: true,
|
defaultItemGroupsAreImmutable: true,
|
||||||
id: nanoid(),
|
id: randomId(),
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
itemGroupsAreImmutable: true,
|
itemGroupsAreImmutable: true,
|
||||||
maxItems: 10,
|
maxItems: 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user