react-component / motion
Showing 1 of 1 files from the diff.

@@ -1,6 +1,7 @@
Loading
1 1
/* eslint react/prop-types: 0 */
2 2
import * as React from 'react';
3 -
import OriginCSSMotion, { CSSMotionProps } from './CSSMotion';
3 +
import OriginCSSMotion from './CSSMotion';
4 +
import type { CSSMotionProps } from './CSSMotion';
4 5
import { supportTransition } from './util/motion';
5 6
import {
6 7
  STATUS_ADD,
@@ -9,8 +10,8 @@
Loading
9 10
  STATUS_REMOVED,
10 11
  diffKeys,
11 12
  parseKeys,
12 -
  KeyObject,
13 13
} from './util/diff';
14 +
import type { KeyObject } from './util/diff';
14 15
15 16
const MOTION_PROP_NAMES = [
16 17
  'eventProps',
@@ -36,7 +37,8 @@
Loading
36 37
];
37 38
38 39
export interface CSSMotionListProps
39 -
  extends Omit<CSSMotionProps, 'onVisibleChanged'> {
40 +
  extends Omit<CSSMotionProps, 'onVisibleChanged'>,
41 +
    Omit<React.HTMLAttributes<any>, 'children'> {
40 42
  keys: (React.Key | { key: React.Key; [name: string]: any })[];
41 43
  component?: string | React.ComponentType | false;
42 44
@@ -77,7 +79,7 @@
Loading
77 79
      const mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
78 80
79 81
      return {
80 -
        keyEntities: mixedKeyEntities.filter((entity) => {
82 +
        keyEntities: mixedKeyEntities.filter(entity => {
81 83
          const prevEntity = keyEntities.find(({ key }) => entity.key === key);
82 84
83 85
          // Remove if already mark as removed
@@ -95,7 +97,7 @@
Loading
95 97
96 98
    removeKey = (removeKey: React.Key) => {
97 99
      this.setState(({ keyEntities }) => ({
98 -
        keyEntities: keyEntities.map((entity) => {
100 +
        keyEntities: keyEntities.map(entity => {
99 101
          if (entity.key !== removeKey) return entity;
100 102
          return {
101 103
            ...entity,
@@ -117,7 +119,7 @@
Loading
117 119
      const Component = component || React.Fragment;
118 120
119 121
      const motionProps: CSSMotionProps = {};
120 -
      MOTION_PROP_NAMES.forEach((prop) => {
122 +
      MOTION_PROP_NAMES.forEach(prop => {
121 123
        motionProps[prop] = restProps[prop];
122 124
        delete restProps[prop];
123 125
      });
@@ -133,7 +135,7 @@
Loading
133 135
                key={eventProps.key}
134 136
                visible={visible}
135 137
                eventProps={eventProps}
136 -
                onVisibleChanged={(changedVisible) => {
138 +
                onVisibleChanged={changedVisible => {
137 139
                  onVisibleChanged?.(changedVisible, { key: eventProps.key });
138 140
139 141
                  if (!changedVisible) {
Files Coverage
src 98.63%
Project Totals (12 files) 98.63%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading