Skip to content

Commit

Permalink
Upgrade dom-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Sep 4, 2019
1 parent e8debc2 commit eb9ecbe
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"@babel/runtime": "^7.4.5",
"@restart/hooks": "^0.3.12",
"dom-helpers": "^3.4.0",
"dom-helpers": "^5.0.1",
"popper.js": "^1.15.0",
"prop-types": "^15.7.2",
"uncontrollable": "^7.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import matches from 'dom-helpers/query/matches';
import qsa from 'dom-helpers/query/querySelectorAll';
import matches from 'dom-helpers/matches';
import qsa from 'dom-helpers/querySelectorAll';
import React, { useCallback, useRef, useEffect, useMemo } from 'react';
import PropTypes from 'prop-types';
import { useUncontrolled } from 'uncontrollable';
Expand Down
6 changes: 3 additions & 3 deletions src/Modal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable react/prop-types */

import activeElement from 'dom-helpers/activeElement';
import contains from 'dom-helpers/query/contains';
import canUseDom from 'dom-helpers/util/inDOM';
import listen from 'dom-helpers/events/listen';
import contains from 'dom-helpers/contains';
import canUseDom from 'dom-helpers/canUseDom';
import listen from 'dom-helpers/listen';
import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';
Expand Down
11 changes: 6 additions & 5 deletions src/ModalManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import classes from 'dom-helpers/class';
import css from 'dom-helpers/style';
import getScrollbarSize from 'dom-helpers/util/scrollbarSize';
import addClass from 'dom-helpers/addClass';
import removeClass from 'dom-helpers/removeClass';
import css from 'dom-helpers/css';
import getScrollbarSize from 'dom-helpers/scrollbarSize';

import isOverflowing from './utils/isOverflowing';
import {
Expand Down Expand Up @@ -109,7 +110,7 @@ class ModalManager {
this.setContainerStyle(data, container);
}

data.classes.forEach(classes.addClass.bind(null, container));
data.classes.forEach(addClass.bind(null, container));

this.containers.push(container);
this.data.push(data);
Expand All @@ -135,7 +136,7 @@ class ModalManager {
// if that was the last modal in a container,
// clean up the container
if (data.modals.length === 0) {
data.classes.forEach(classes.removeClass.bind(null, container));
data.classes.forEach(removeClass.bind(null, container));

if (this.handleContainerOverflow) {
this.removeContainerStyle(data, container);
Expand Down
4 changes: 2 additions & 2 deletions src/useRootClose.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import contains from 'dom-helpers/query/contains';
import listen from 'dom-helpers/events/listen';
import contains from 'dom-helpers/contains';
import listen from 'dom-helpers/listen';
import { useCallback, useEffect, useRef } from 'react';

import useEventCallback from '@restart/hooks/useEventCallback';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/isOverflowing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isWindow from 'dom-helpers/query/isWindow';
import isWindow from 'dom-helpers/isWindow';
import ownerDocument from 'dom-helpers/ownerDocument';

function isBody(node) {
Expand Down
4 changes: 2 additions & 2 deletions test/ModalManagerSpec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import css from 'dom-helpers/style';
import getScrollbarSize from 'dom-helpers/util/scrollbarSize';
import css from 'dom-helpers/css';
import getScrollbarSize from 'dom-helpers/scrollbarSize';

import ModalContainer from '../src/Modal';
import ModalManager from '../src/ModalManager';
Expand Down
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3076,7 +3076,7 @@ csso@^3.5.1:
dependencies:
css-tree "1.0.0-alpha.29"

csstype@^2.5.7:
csstype@^2.5.7, csstype@^2.6.6:
version "2.6.6"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41"
integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg==
Expand Down Expand Up @@ -3374,6 +3374,14 @@ dom-helpers@^3.4.0:
dependencies:
"@babel/runtime" "^7.1.2"

dom-helpers@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.0.1.tgz#f419eec93625c0b56e5d7f7aa326238e26a81aee"
integrity sha512-+FoTEtqaob4YbwCFawRcvRvMeHe6ggNLRnHyh8EpTkcZHErX9PLZFBjT6kRHzzZNiRUDXbIHslJg7li45TM5Cw==
dependencies:
"@babel/runtime" "^7.5.5"
csstype "^2.6.6"

dom-iterator@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/dom-iterator/-/dom-iterator-1.0.0.tgz#9c09899846ec41c2d257adc4d6015e4759ef05ad"
Expand Down

0 comments on commit eb9ecbe

Please sign in to comment.