# @beisen-platform/ux-standard-search

> # 1 介绍

Latest version **1.0.25** (published 2019-11-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-platform/ux-standard-search
pnpm add @beisen-platform/ux-standard-search
yarn add @beisen-platform/ux-standard-search
bun add @beisen-platform/ux-standard-search
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.25 |
| Published | 2019-11-26 |
| First published | 2019-11-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 78.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-platform/ux-standard-search
- Repository: http://gitlab.beisencorp.com/ux-share-platform/ux-standard-search
- npm.io page: https://npm.io/package/@beisen-platform/ux-standard-search

## Dependencies (12)

- [uuid](https://npm.io/package/uuid.md) 3.3.2
- [validate.js](https://npm.io/package/validate.js.md) ^0.13.1
- [@beisen/helper](https://npm.io/package/@beisen/helper.md) ^1.0.7
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [@beisen-phoenix/button](https://npm.io/package/@beisen-phoenix/button.md) 3.3.0
- [@beisen-phoenix/drawer](https://npm.io/package/@beisen-phoenix/drawer.md) 3.3.0
- [@beisen-phoenix/tooltip](https://npm.io/package/@beisen-phoenix/tooltip.md) 3.3.0
- [@beisen/es6-promise-debounce](https://npm.io/package/@beisen/es6-promise-debounce.md) ^0.0.4
- [@beisen-platform/platform-fields](https://npm.io/package/@beisen-platform/platform-fields.md) git+ssh://git@gitlab.beisencorp.com:ux-share-platform/ux-platform-fields.git#shared-phoenix
- [@beisen-platform/platform-lookupv2](https://npm.io/package/@beisen-platform/platform-lookupv2.md) git+ssh://git@gitlab.beisencorp.com:ux-share-platform/ux-platform-lookupV2.git#shared-phoenix
- [@beisen-platform/platform-index-view](https://npm.io/package/@beisen-platform/platform-index-view.md) 1.2.99-rc.69
- [@beisen-platform/platform-runtime-helpers](https://npm.io/package/@beisen-platform/platform-runtime-helpers.md) ~1.1.0

## Recent versions

- 1.0.25 (latest) — 2019-11-26
- 1.0.24 — 2019-11-26
- 1.0.23 — 2019-11-26
- 1.0.22 — 2019-11-25
- 1.0.21 — 2019-11-23
- 1.0.20 — 2019-11-22
- 1.0.19 — 2019-11-22
- 1.0.18 — 2019-11-22
- 1.0.17 — 2019-11-20
- 1.0.16 — 2019-11-18
- 1.0.15 — 2019-11-13
- 1.0.14 — 2019-11-12
- 1.0.13 — 2019-11-11
- 1.0.12 — 2019-11-11
- 1.0.11 — 2019-11-08
- … 10 more at https://npm.io/package/@beisen-platform/ux-standard-search/versions

## README

# SearchForm

# 1 介绍

该组件用于筛选，内置了元数据解析功能

# 2 API

## 2.1 props 列表

**注意！元数据是以解构方式传递的**

| name                        | type     | default | description                                             |
| --------------------------- | -------- | ------- | :------------------------------------------------------ |
| biz_data                    | object   | none    | 搜索结果的默认值，只在初始化时生效                      |
| isInPopUp                   | boolean  | false   | 是否被放在弹层中，筛选弹层的 z-index 会自动增加         |
| containerZIndex             | number   | none    | 外部容器的层级，若有值，筛选弹层的 z-index 会以此为基础 |
| extendedFieldMapByFieldName | Function | none    | 根据字段名扩展组件                                      |
| onSearch                    | Function | none    | 搜索结果改变后的回调                                    |

## 2.2 元数据

```javascript
const metadata = {
  cmp_id: 'feabf9d6-ca5c-4201-8e6e-f1cc1bad88db',
  cmp_name: 'BeisenCloudDemo_sousousou',
  cmp_type: 'SearchForm',
  version: '20181219142750122',
  form_parts: null,
  common_fields: null,
  cmp_data: {},
  sub_cmps: []
};

return <SearchForm {...metadata} />;
```

### 2.3 onSearch

```javascript
const handleSearch = (searchData, isSearch, customview_biz_data) => {
  // searchData是搜索结果
  // isSearch这里写死为true
  // customview_biz_data是回传了this.props.customview_biz_data
  // ......
};

return <SearchForm onSearch={handleSearch} />;
```

### 2.4 extendedFieldMapByFieldName

```javascript
const extendedFieldMapByFieldName = {
  // field_name: 字段元数据中cmp_data.field_name
  [field_name]: (props, OriginFieldComponent) => {
    // OriginFieldComponent是当前字段对应的默认组件
    // 可以根据自己的需求，自定义数据和组件
    return <MyCustomComponent {...myCustomProps} >;
  }
};

return <SearchForm extendedFieldMapByFieldName={extendedFieldMapByFieldName} />;
```

---
_Source: https://npm.io/package/@beisen-platform/ux-standard-search · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
