@gmfe/react 2.14.10 → 2.14.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmfe/react",
3
- "version": "2.14.10",
3
+ "version": "2.14.12",
4
4
  "description": "",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gmfe#readme",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@gm-common/tool": "^1.0.0",
30
- "@gmfe/locales": "^2.14.10",
30
+ "@gmfe/locales": "^2.14.12",
31
31
  "big.js": "^5.2.2",
32
32
  "classnames": "^2.2.5",
33
33
  "lodash": "^4.17.14",
@@ -35,5 +35,5 @@
35
35
  "prop-types": "^15.7.2",
36
36
  "react-window": "^1.8.5"
37
37
  },
38
- "gitHead": "272dcd805329a1d462d0e906abc9318c2d399e0d"
38
+ "gitHead": "f0cc44ca71cce503e337bed84cc2dbabd71dcf8a"
39
39
  }
@@ -433,8 +433,15 @@ class Base extends React.Component {
433
433
 
434
434
  function renderListFilterDefault(data, query) {
435
435
  const result = []
436
+ const keywords = query.toLowerCase()
437
+ // TODO 加个queryText,用于基于多个搜索结果的情况下,因为是公共组件,所以多加个字段
436
438
  _.each(data, v => {
437
- const arr = _.filter(v.children, item => item.text.includes(query))
439
+ const arr = _.filter(
440
+ v?.children || [],
441
+ item =>
442
+ item?.text?.toLowerCase()?.includes(keywords) ||
443
+ item?.queryText?.toLowerCase()?.includes(keywords)
444
+ )
438
445
  if (arr.length) {
439
446
  result.push({
440
447
  ...v,
@@ -0,0 +1,21 @@
1
+ import 'react-photo-view/dist/react-photo-view.css'
2
+ import { PhotoProvider, PhotoView } from 'react-photo-view'
3
+ import PropTypes from 'prop-types'
4
+ import React from 'react'
5
+
6
+ export default function PicturePreview({ images, className }) {
7
+ return (
8
+ <PhotoProvider>
9
+ {(images || []).map((item, index) => (
10
+ <PhotoView key={index} src={item}>
11
+ <img src={item} alt='' className={className} />
12
+ </PhotoView>
13
+ ))}
14
+ </PhotoProvider>
15
+ )
16
+ }
17
+
18
+ PicturePreview.propTypes = {
19
+ images: PropTypes.array,
20
+ className: PropTypes.string
21
+ }
package/src/index.js CHANGED
@@ -102,6 +102,7 @@ import Steps from './component/steps'
102
102
  import Selection from './component/selection'
103
103
  import TreeV2 from './component/tree_v2'
104
104
  import RecommendInput from './component/recommend_input'
105
+ import PicturePreview from './component/picture_preview'
105
106
 
106
107
  Object.assign(Sheet, {
107
108
  SheetColumn,
@@ -231,5 +232,6 @@ export {
231
232
  Steps,
232
233
  Selection,
233
234
  TreeV2,
234
- RecommendInput
235
+ RecommendInput,
236
+ PicturePreview
235
237
  }