@ray-js/lamp-circle-picker 1.0.2-beta-1 → 1.0.2

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/README.md CHANGED
@@ -23,7 +23,7 @@ $ yarn add @ray-js/components-ty-lamp
23
23
  ```tsx
24
24
  interface IProps {
25
25
  /**
26
- * @description.zh 默认数值
26
+ * @description.zh 默认数值 色温值
27
27
  * @description.en default value
28
28
  * @default
29
29
  */
@@ -40,18 +40,6 @@ interface IProps {
40
40
  * @default 140
41
41
  */
42
42
  radius?: number;
43
- /**
44
- * @description.zh 是否展示色圈
45
- * @description.en Whether to show color circle
46
- * @default true
47
- */
48
- isShowThumb?: boolean;
49
- /**
50
- * @description.zh 是否当前颜色文案
51
- * @description.en Whether the current color text
52
- * @default false
53
- */
54
- isShowColorTip?: boolean;
55
43
  /**
56
44
  * @description.zh 手指按下时的回调函数
57
45
  * @description.en Finger press when the callback function
@@ -84,8 +72,6 @@ export default () => {
84
72
  const handleEnd = (v: number) => {
85
73
  setTemperature(v);
86
74
  };
87
- return (
88
- <LampCirclePicker temperature={temperature} onTouchMove={handleMove} onTouchEnd={handleEnd} />
89
- );
75
+ return <LampCirclePicker value={temperature} onTouchMove={handleMove} onTouchEnd={handleEnd} />;
90
76
  };
91
77
  ```
@@ -6,7 +6,6 @@ export default function RectColor(props) {
6
6
  radius: props.radius,
7
7
  innerRingRadius: props.innerRingRadius,
8
8
  value: props.value,
9
- isShowColorTip: props.isShowColorTip,
10
9
  bindstart: function onTouchStart(e) {
11
10
  var detail = e.detail;
12
11
  var temp = Math.floor(detail);
@@ -17,18 +17,6 @@ export interface IProps {
17
17
  * @default 140
18
18
  */
19
19
  radius?: number;
20
- /**
21
- * @description.zh 是否展示色圈
22
- * @description.en Whether to show color circle
23
- * @default true
24
- */
25
- isShowThumb?: boolean;
26
- /**
27
- * @description.zh 是否当前颜色文案
28
- * @description.en Whether the current color text
29
- * @default false
30
- */
31
- isShowColorTip?: boolean;
32
20
  /**
33
21
  * @description.zh 手指按下时的回调函数
34
22
  * @description.en Finger press when the callback function
@@ -3,11 +3,10 @@ var nilFn = function () {
3
3
  return null;
4
4
  };
5
5
  export var defaultProps = {
6
+ value: 0,
6
7
  innerRingRadius: 80,
7
8
  radius: 140,
8
- isShowThumb: true,
9
9
  onTouchStart: nilFn,
10
10
  onTouchMove: nilFn,
11
- onTouchEnd: nilFn,
12
- value: 0
11
+ onTouchEnd: nilFn
13
12
  };
@@ -25,10 +25,6 @@ Component({
25
25
  type: Number,
26
26
  value: 0
27
27
  },
28
- isShowColorTip: {
29
- type: Boolean,
30
- value: true
31
- },
32
28
  onTouchStart: Function,
33
29
  onTouchMove: Function,
34
30
  onTouchEnd: Function
package/lib/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  interface IProps {
3
- isShowColorTip?: boolean;
4
3
  radius?: number;
5
4
  innerRingRadius?: number;
6
- temperature: number;
5
+ value: number;
6
+ temperature?: number;
7
7
  onTouchStart?: (v: number) => void;
8
8
  onTouchMove?: (v: number) => void;
9
9
  onTouchEnd?: (v: number) => void;
@@ -13,7 +13,6 @@ declare const WhiteRing: {
13
13
  defaultProps: {
14
14
  radius: number;
15
15
  innerRingRadius: number;
16
- isShowColorTip: boolean;
17
16
  onTouchStart: () => null;
18
17
  onTouchMove: () => null;
19
18
  onTouchEnd: () => null;
package/lib/index.js CHANGED
@@ -8,20 +8,21 @@ import AnnulusPickerColor from './component';
8
8
  import styled from './index.module.less';
9
9
  var ring = res.ring;
10
10
  var WhiteRing = function (props) {
11
- var temperature = props.temperature,
11
+ var value = props.value,
12
+ temperature = props.temperature,
12
13
  radius = props.radius,
13
14
  innerRingRadius = props.innerRingRadius,
14
- isShowColorTip = props.isShowColorTip,
15
15
  onTouchStart = props.onTouchStart,
16
16
  onTouchMove = props.onTouchMove,
17
17
  onTouchEnd = props.onTouchEnd;
18
+ var innerImgRadius = innerRingRadius * 4 * 0.8;
19
+ var _value = value !== null && value !== void 0 ? value : temperature;
18
20
  return /*#__PURE__*/React.createElement(View, {
19
21
  className: clsx(styled.container, styled.flexCenter)
20
22
  }, /*#__PURE__*/React.createElement(AnnulusPickerColor, {
21
- value: temperature,
23
+ value: _value,
22
24
  radius: radius,
23
25
  innerRingRadius: innerRingRadius,
24
- isShowColorTip: isShowColorTip,
25
26
  onTouchStart: onTouchStart,
26
27
  onTouchMove: onTouchMove,
27
28
  onTouchEnd: onTouchEnd
@@ -29,12 +30,16 @@ var WhiteRing = function (props) {
29
30
  className: clsx(styled.innerBox, styled.flexCenter)
30
31
  }, /*#__PURE__*/React.createElement(Image, {
31
32
  src: ring,
32
- className: styled.ringIcon
33
+ className: styled.ringIcon,
34
+ style: {
35
+ width: innerImgRadius,
36
+ height: innerImgRadius
37
+ }
33
38
  }), /*#__PURE__*/React.createElement(View, {
34
39
  className: clsx(styled.textBox, styled.flexCenter)
35
40
  }, /*#__PURE__*/React.createElement(Text, {
36
41
  className: styled.title
37
- }, Math.trunc(temperature / 10), "%"), /*#__PURE__*/React.createElement(Text, {
42
+ }, Math.trunc(_value / 10), "%"), /*#__PURE__*/React.createElement(Text, {
38
43
  className: styled.desc
39
44
  }, Strings.getLang('temperature')))));
40
45
  };
@@ -44,7 +49,6 @@ var nilFn = function () {
44
49
  WhiteRing.defaultProps = {
45
50
  radius: 140,
46
51
  innerRingRadius: 80,
47
- isShowColorTip: true,
48
52
  onTouchStart: nilFn,
49
53
  onTouchMove: nilFn,
50
54
  onTouchEnd: nilFn
package/lib/props.d.ts CHANGED
@@ -17,18 +17,6 @@ export interface IProps {
17
17
  * @default 140
18
18
  */
19
19
  radius?: number;
20
- /**
21
- * @description.zh 是否展示色圈
22
- * @description.en Whether to show color circle
23
- * @default true
24
- */
25
- isShowThumb?: boolean;
26
- /**
27
- * @description.zh 是否当前颜色文案
28
- * @description.en Whether the current color text
29
- * @default false
30
- */
31
- isShowColorTip?: boolean;
32
20
  /**
33
21
  * @description.zh 手指按下时的回调函数
34
22
  * @description.en Finger press when the callback function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lamp-circle-picker",
3
- "version": "1.0.2-beta-1",
3
+ "version": "1.0.2",
4
4
  "description": "照明缺角色环",
5
5
  "main": "lib/index",
6
6
  "files": [