@ray-js/ray-ipc-half-horizontal-drag 0.0.4-beta-2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +7 -9
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -3,7 +3,6 @@ import "core-js/modules/esnext.iterator.map.js";
3
3
  import React from 'react';
4
4
  import { View } from '@ray-js/ray';
5
5
  import clsx from 'clsx';
6
- import { v4 as uuidv4 } from 'uuid';
7
6
  import styles from './index.module.less';
8
7
  const NILL = () => null;
9
8
  const HalfHorizontalDrag = props => {
@@ -42,10 +41,9 @@ const HalfHorizontalDrag = props => {
42
41
  }, tag)));
43
42
  }
44
43
  if (data.length === 2) {
45
- const key = uuidv4();
46
44
  return /*#__PURE__*/React.createElement(View, {
47
45
  className: clsx(styles.content, styles.towContent, className)
48
- }, data.map(item => {
46
+ }, data.map((item, idx) => {
49
47
  const {
50
48
  title,
51
49
  tag,
@@ -54,7 +52,7 @@ const HalfHorizontalDrag = props => {
54
52
  onClick = NILL
55
53
  } = item;
56
54
  return /*#__PURE__*/React.createElement(View, {
57
- key: key // eslint-disable-line
55
+ key: idx // eslint-disable-line
58
56
  ,
59
57
  style: _objectSpread(_objectSpread({}, item.style), {}, {
60
58
  backgroundImage: item.backgroundImage ? `url(${item.backgroundImage})` : undefined,
@@ -73,10 +71,9 @@ const HalfHorizontalDrag = props => {
73
71
  }));
74
72
  }
75
73
  if (data.length >= 3) {
76
- const key = uuidv4();
77
74
  return /*#__PURE__*/React.createElement(View, {
78
75
  className: clsx(styles.content, styles.moreContent, className)
79
- }, data.map(item => {
76
+ }, data.map((item, idx) => {
80
77
  const {
81
78
  title,
82
79
  tag,
@@ -84,9 +81,10 @@ const HalfHorizontalDrag = props => {
84
81
  tagClassName,
85
82
  onClick = NILL
86
83
  } = item;
87
- return /*#__PURE__*/React.createElement(View, {
88
- key: key // eslint-disable-line
89
- ,
84
+ return /*#__PURE__*/React.createElement(View
85
+ // eslint-disable-next-line react/no-array-index-key
86
+ , {
87
+ key: idx,
90
88
  style: _objectSpread(_objectSpread({}, item.style), {}, {
91
89
  backgroundImage: item.backgroundImage ? `url(${item.backgroundImage})` : undefined,
92
90
  background: item.background || undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-half-horizontal-drag",
3
- "version": "0.0.4-beta-2",
3
+ "version": "0.0.4",
4
4
  "description": "水平方向可拖动,显示出下一个组件的小部分内容",
5
5
  "main": "lib/index",
6
6
  "files": [