@zgfe/business-lib 1.2.48-plat.10 → 1.2.48-plat.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.
@@ -1,14 +1,15 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
+ import { platItemProp } from './types';
2
3
  import './styles/index.less';
3
- export interface platItemProp {
4
- key: number;
5
- value: string;
6
- icon?: ReactNode;
7
- }
8
4
  declare const BizPlatformSelector: React.FC<{
9
5
  onChange: (val: {
10
6
  key: number;
11
7
  value: string;
12
8
  }) => void;
9
+ defaultValue: {
10
+ key: number;
11
+ value: string;
12
+ };
13
+ valueOption?: platItemProp[];
13
14
  }>;
14
15
  export default BizPlatformSelector;
@@ -1,61 +1,20 @@
1
1
  import React from 'react';
2
- import { IconFont, BizSelect } from '@zgfe/business-lib';
2
+ import { BizSelect } from '@zgfe/business-lib';
3
+ import { platformOption } from './util';
3
4
  import './styles/index.less';
4
5
  var BizPlatformSelector = function BizPlatformSelector(props) {
5
6
  var classPrefix = 'biz-platform-selector';
6
- var platformOption = [{
7
- key: -1,
8
- value: '全部平台'
9
- }, {
10
- key: 1,
11
- value: 'Android',
12
- icon: /*#__PURE__*/React.createElement(IconFont, {
13
- type: "android1",
14
- size: 16
15
- })
16
- }, {
17
- key: 2,
18
- value: 'IOS',
19
- icon: /*#__PURE__*/React.createElement(IconFont, {
20
- type: "ios1",
21
- size: 16
22
- })
23
- }, {
24
- key: 3,
25
- value: 'JS',
26
- icon: /*#__PURE__*/React.createElement(IconFont, {
27
- type: "a-js2",
28
- size: 16
29
- })
30
- }, {
31
- key: 4,
32
- value: '微信小程序',
33
- icon: /*#__PURE__*/React.createElement(IconFont, {
34
- type: "weixinxiaochengxu",
35
- size: 16
36
- })
37
- }, {
38
- key: 5,
39
- value: '服务端',
40
- icon: /*#__PURE__*/React.createElement(IconFont, {
41
- type: "fuwuqi",
42
- size: 16
43
- })
44
- }, {
45
- key: 0,
46
- value: '其他'
47
- }];
48
7
  return /*#__PURE__*/React.createElement("div", {
49
8
  className: classPrefix
50
9
  }, /*#__PURE__*/React.createElement(BizSelect, {
51
10
  className: "".concat(classPrefix, "-select"),
52
- options: platformOption,
11
+ options: props.valueOption && props.valueOption.length ? props.valueOption : platformOption,
53
12
  overlayWidth: 134,
54
13
  keyField: "key",
55
14
  labelField: "value",
56
- defaultValue: {
15
+ defaultValue: props.defaultValue ? props.defaultValue : {
57
16
  value: '全部平台',
58
- key: -1
17
+ key: 0
59
18
  },
60
19
  onChange: function onChange(val) {
61
20
  props.onChange(val);
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export interface platItemProp {
3
+ key: number;
4
+ value: string;
5
+ icon?: ReactNode;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { platItemProp } from './types';
2
+ export declare const platformOption: platItemProp[];
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { IconFont } from '@zgfe/business-lib';
3
+ export var platformOption = [{
4
+ key: 0,
5
+ value: '全部平台'
6
+ }, {
7
+ key: 1,
8
+ value: 'Android',
9
+ icon: /*#__PURE__*/React.createElement(IconFont, {
10
+ type: "android1",
11
+ size: 16
12
+ })
13
+ }, {
14
+ key: 2,
15
+ value: 'IOS',
16
+ icon: /*#__PURE__*/React.createElement(IconFont, {
17
+ type: "ios1",
18
+ size: 16
19
+ })
20
+ }, {
21
+ key: 3,
22
+ value: 'JS',
23
+ icon: /*#__PURE__*/React.createElement(IconFont, {
24
+ type: "a-js2",
25
+ size: 16
26
+ })
27
+ }, {
28
+ key: 4,
29
+ value: '微信小程序',
30
+ icon: /*#__PURE__*/React.createElement(IconFont, {
31
+ type: "weixinxiaochengxu",
32
+ size: 16
33
+ })
34
+ }, {
35
+ key: 5,
36
+ value: '服务端',
37
+ icon: /*#__PURE__*/React.createElement(IconFont, {
38
+ type: "fuwuqi",
39
+ size: 16
40
+ })
41
+ }, {
42
+ key: -1,
43
+ value: '其他'
44
+ }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.48-plat.10",
3
+ "version": "1.2.48-plat.12",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "9eb12ea12533922d504954aca060e35aeecc72e6",
58
+ "gitHead": "e22fa6964d551e2b01e3f4fad21478195d379929",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }