Skip to content

Commit 0edd981

Browse files
committed
Updated deps
1 parent 9ad91b6 commit 0edd981

File tree

12 files changed

+1350
-966
lines changed

12 files changed

+1350
-966
lines changed

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"parser": "typescript",
33
"singleQuote": true,
44
"printWidth": 100,
5-
"semi": false
5+
"semi": false,
6+
"arrowParens": "avoid"
67
}

example/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class App extends Component<TAppProps, TAppState> {
1919
state = {
2020
disableFirstRow: false,
2121
reversed: false,
22-
showSelectableGroup: true
22+
showSelectableGroup: true,
2323
}
2424

2525
countersRef = createRef<Counters>()
@@ -38,7 +38,7 @@ class App extends Component<TAppProps, TAppState> {
3838

3939
toggleSelectableGroup = () => {
4040
this.setState(state => ({
41-
showSelectableGroup: !state.showSelectableGroup
41+
showSelectableGroup: !state.showSelectableGroup,
4242
}))
4343
}
4444

example/src/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Card = createSelectable<TAlbumProps>((props: TSelectableItemProps &
1717
'item',
1818
DISABLED_CARD_YEARS.includes(year) && 'not-selectable',
1919
isSelecting && 'selecting',
20-
isSelected && 'selected'
20+
isSelected && 'selected',
2121
]
2222
.filter(Boolean)
2323
.join(' ')

example/src/Counters.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { Component } from 'react'
33
export class Counters extends Component {
44
state = {
55
selectedItems: [],
6-
selectingItems: []
6+
selectingItems: [],
77
}
88

99
handleSelecting = selectingItems => {
@@ -15,7 +15,7 @@ export class Counters extends Component {
1515
handleSelectionFinish = selectedItems => {
1616
this.setState({
1717
selectedItems,
18-
selectingItems: []
18+
selectingItems: [],
1919
})
2020

2121
console.log(`Finished selection ${selectedItems.length}`)

example/src/sample-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const players = [
2929
'Gary Payton',
3030
'Ray Allen',
3131
'Dwight Howard',
32-
'Chris Paul'
32+
'Chris Paul',
3333
]
3434

3535
export type TAlbumItem = {
@@ -39,5 +39,5 @@ export type TAlbumItem = {
3939

4040
export const items = Array.from({ length: 500 }).map((_, index) => ({
4141
year: index + 1,
42-
player: players[index % players.length]
42+
player: players[index % players.length],
4343
}))

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"transpile": "tsc",
1515
"build:prod": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
1616
"prepublishOnly": "yarn lint && yarn clean && yarn build:prod && yarn transpile",
17-
"prettier": "prettier --write src/**/*.{js,ts,tsx} example/src/**/*.{js,ts,tsx} .js",
17+
"prettier": "prettier --write src/**/*.{ts,tsx} example/src/**/*.{ts,tsx}",
1818
"lint:basic": "tsc --pretty --noEmit && eslint --fix --format codeframe",
1919
"lint": "yarn lint:basic '{example/,}src/**/*.{ts,tsx}'",
2020
"format": "yarn prettier && yarn lint",
@@ -70,35 +70,35 @@
7070
},
7171
"devDependencies": {
7272
"@babel/cli": "^7.8.4",
73-
"@babel/core": "^7.8.4",
73+
"@babel/core": "^7.9.0",
7474
"@babel/plugin-proposal-class-properties": "^7.8.3",
75-
"@babel/preset-env": "^7.8.4",
76-
"@babel/preset-react": "^7.8.3",
77-
"@babel/preset-typescript": "^7.8.3",
78-
"@types/react": "^16.9.22",
79-
"@types/react-dom": "^16.9.5",
80-
"@typescript-eslint/eslint-plugin": "^2.17.0",
81-
"@typescript-eslint/parser": "^2.17.0",
82-
"babel-loader": "^8.0.6",
83-
"cross-env": "^7.0.0",
75+
"@babel/preset-env": "^7.9.5",
76+
"@babel/preset-react": "^7.9.4",
77+
"@babel/preset-typescript": "^7.9.0",
78+
"@types/react": "^16.9.6",
79+
"@types/react-dom": "^16.9.6",
80+
"@typescript-eslint/eslint-plugin": "^2.27.0",
81+
"@typescript-eslint/parser": "^2.27.0",
82+
"babel-loader": "^8.1.0",
83+
"cross-env": "^7.0.2",
8484
"eslint": "6.8.0",
85-
"eslint-config-airbnb": "18.0.1",
86-
"eslint-config-prettier": "^6.5.0",
87-
"eslint-plugin-import": "^2.18.2",
85+
"eslint-config-airbnb": "18.1.0",
86+
"eslint-config-prettier": "^6.10.1",
87+
"eslint-plugin-import": "^2.20.2",
8888
"eslint-plugin-jsx-a11y": "^6.2.3",
8989
"eslint-plugin-prettier": "^3.1.1",
90-
"eslint-plugin-react": "^7.18.0",
91-
"eslint-plugin-react-hooks": "^2.2.0",
92-
"husky": "^4.2.3",
93-
"lint-staged": "^10.0.7",
94-
"prettier": "^1.18.2",
95-
"react": "^16.8.6",
96-
"react-dom": "^16.8.6",
97-
"release-it": "^12.6.1",
90+
"eslint-plugin-react": "^7.19.0",
91+
"eslint-plugin-react-hooks": "^3.0.0",
92+
"husky": "^4.2.5",
93+
"lint-staged": "^10.1.3",
94+
"prettier": "^2.0.4",
95+
"react": "^16.13.1",
96+
"react-dom": "^16.13.1",
97+
"release-it": "^13.5.2",
9898
"rimraf": "^3.0.2",
99-
"typescript": "^3.8.2",
100-
"webpack": "^4.41.6",
101-
"webpack-bundle-analyzer": "^3.3.2",
99+
"typescript": "^3.8.3",
100+
"webpack": "^4.42.1",
101+
"webpack-bundle-analyzer": "^3.6.1",
102102
"webpack-cli": "^3.3.11",
103103
"webpack-dev-server": "^3.10.3"
104104
}

src/CreateSelectable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export const createSelectable = <T extends any>(
1313
static contextType = SelectableGroupContext
1414

1515
static defaultProps = {
16-
isSelected: false
16+
isSelected: false,
1717
}
1818

1919
state = {
2020
isSelected: this.props.isSelected,
21-
isSelecting: false
21+
isSelecting: false,
2222
}
2323

2424
node: HTMLElement | null = null

src/SelectableGroup.context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export const SelectableGroupContext = React.createContext<TSelectableGroupContex
99
unregister(_: TSelectableItem) {},
1010
selectAll: noop,
1111
clearSelection: noop,
12-
getScrolledContainer: () => null
13-
}
12+
getScrolledContainer: () => null,
13+
},
1414
})

src/SelectableGroup.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
noop,
1010
Maybe,
1111
TComputedBounds,
12-
getDocumentScroll
12+
getDocumentScroll,
1313
} from './utils'
1414
import { TSelectableItem } from './Selectable.types'
1515
import { SelectableGroupContext } from './SelectableGroup.context'
@@ -109,7 +109,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
109109
allowCtrlClick: false,
110110
allowMetaClick: false,
111111
allowShiftClick: false,
112-
selectOnClick: true
112+
selectOnClick: true,
113113
}
114114

115115
state = { selectionMode: false }
@@ -131,7 +131,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
131131
mouseDownData: TMouseDownData = {
132132
selectboxY: 0,
133133
selectboxX: 0,
134-
target: null
134+
target: null,
135135
}
136136

137137
registry = new Set<TSelectableItem>()
@@ -160,12 +160,12 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
160160

161161
containerScroll = {
162162
scrollTop: 0,
163-
scrollLeft: 0
163+
scrollLeft: 0,
164164
}
165165

166166
documentScroll = {
167167
scrollTop: 0,
168-
scrollLeft: 0
168+
scrollLeft: 0,
169169
}
170170

171171
componentDidMount() {
@@ -213,7 +213,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
213213

214214
this.containerScroll = {
215215
scrollTop,
216-
scrollLeft
216+
scrollLeft,
217217
}
218218
}
219219

@@ -222,14 +222,14 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
222222

223223
this.documentScroll = {
224224
scrollTop: documentScrollTop,
225-
scrollLeft: documentScrollLeft
225+
scrollLeft: documentScrollLeft,
226226
}
227227
}
228228

229229
get containerDocumentScroll() {
230230
return {
231231
scrollTop: this.containerScroll.scrollTop + this.documentScroll.scrollTop,
232-
scrollLeft: this.containerScroll.scrollLeft + this.documentScroll.scrollLeft
232+
scrollLeft: this.containerScroll.scrollLeft + this.documentScroll.scrollLeft,
233233
}
234234
}
235235

@@ -278,7 +278,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
278278
toggleSelectionMode() {
279279
const {
280280
selectedItems,
281-
state: { selectionMode }
281+
state: { selectionMode },
282282
} = this
283283

284284
if (selectedItems.size && !selectionMode) {
@@ -362,7 +362,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
362362
x: selectboxX,
363363
y: selectboxY,
364364
width: Math.abs(pointX - mouseDownData.selectboxX),
365-
height: Math.abs(pointY - mouseDownData.selectboxY)
365+
height: Math.abs(pointY - mouseDownData.selectboxY),
366366
}
367367

368368
this.setSelectboxState!(selectboxState)
@@ -373,7 +373,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
373373
width: selectboxState.width,
374374
height: selectboxState.height,
375375
offsetWidth: selectboxState.width || 1,
376-
offsetHeight: selectboxState.height || 1
376+
offsetHeight: selectboxState.height || 1,
377377
}
378378

379379
this.selectItems(selectboxBounds)
@@ -391,7 +391,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
391391
tolerance: tolerance!,
392392
mixedDeselect: mixedDeselect!,
393393
enableDeselect: enableDeselect!,
394-
isFromClick: options && options.isFromClick
394+
isFromClick: options && options.isFromClick,
395395
})
396396
}
397397
}
@@ -510,7 +510,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
510510
allowAltClick: this.props.allowAltClick,
511511
allowCtrlClick: this.props.allowCtrlClick,
512512
allowMetaClick: this.props.allowMetaClick,
513-
allowShiftClick: this.props.allowShiftClick
513+
allowShiftClick: this.props.allowShiftClick,
514514
})
515515
if (this.mouseDownStarted || this.props.disabled || isNotLeftButtonClick) {
516516
return
@@ -540,15 +540,15 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
540540
width: 0,
541541
height: 0,
542542
offsetHeight: bounds.offsetHeight,
543-
offsetWidth: bounds.offsetWidth
543+
offsetWidth: bounds.offsetWidth,
544544
},
545545
{
546546
top: evt.pageY,
547547
left: evt.pageX,
548548
width: 0,
549549
height: 0,
550550
offsetWidth: 0,
551-
offsetHeight: 0
551+
offsetHeight: 0,
552552
}
553553
)
554554

@@ -563,7 +563,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
563563
this.mouseDownData = {
564564
target: evt.target as HTMLElement,
565565
selectboxY: evt.clientY - this.scrollBounds!.top + this.containerScroll.scrollTop,
566-
selectboxX: evt.clientX - this.scrollBounds!.left + this.containerScroll.scrollLeft
566+
selectboxX: evt.clientX - this.scrollBounds!.left + this.containerScroll.scrollLeft,
567567
}
568568

569569
evt.preventDefault()
@@ -616,7 +616,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
616616
x: 0,
617617
y: 0,
618618
width: 0,
619-
height: 0
619+
height: 0,
620620
})
621621
this.props.onSelectionFinish!([...this.selectedItems])
622622
}
@@ -654,7 +654,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
654654

655655
// eslint-disable-next-line react/sort-comp
656656
defaultContainerStyle: CSSProperties = {
657-
position: 'relative'
657+
position: 'relative',
658658
}
659659

660660
contextValue = {
@@ -663,8 +663,8 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
663663
unregister: this.unregisterSelectable,
664664
selectAll: this.selectAll,
665665
clearSelection: this.clearSelection,
666-
getScrolledContainer: () => this.scrollContainer
667-
}
666+
getScrolledContainer: () => this.scrollContainer,
667+
},
668668
}
669669

670670
handleClick(evt: any, top: number, left: number) {
@@ -689,7 +689,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
689689
width: 0,
690690
height: 0,
691691
offsetWidth: 0,
692-
offsetHeight: 0
692+
offsetHeight: 0,
693693
},
694694
{ isFromClick: true }
695695
)
@@ -714,7 +714,7 @@ export class SelectableGroup extends Component<TSelectableGroupProps> {
714714
selectionModeClass,
715715
fixedPosition,
716716
selectboxClassName,
717-
children
717+
children,
718718
} = this.props
719719

720720
return (

src/Selectbox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const initialState: TSelectboxState = {
1919
y: 0,
2020
x: 0,
2121
width: 0,
22-
height: 0
22+
height: 0,
2323
}
2424

2525
export function Selectbox(props: TSelectboxProps) {
@@ -39,12 +39,12 @@ export function Selectbox(props: TSelectboxProps) {
3939
position: fixedPosition ? 'fixed' : 'absolute',
4040
cursor: 'default',
4141
willChange: 'transform',
42-
transform: 'translateZ(0)'
42+
transform: 'translateZ(0)',
4343
}
4444

4545
return <div className={className} style={boxStyle} />
4646
}
4747

4848
Selectbox.defaultProps = {
49-
className: 'selectable-selectbox'
49+
className: 'selectable-selectbox',
5050
}

0 commit comments

Comments
 (0)