@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 +2 -16
- package/lib/component/index.js +0 -1
- package/lib/component/props.d.ts +0 -12
- package/lib/component/props.js +2 -3
- package/lib/component/rjs/index.js +0 -4
- package/lib/index.d.ts +2 -3
- package/lib/index.js +11 -7
- package/lib/props.d.ts +0 -12
- package/package.json +1 -1
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
|
```
|
package/lib/component/index.js
CHANGED
|
@@ -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);
|
package/lib/component/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/lib/component/props.js
CHANGED
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
|
-
|
|
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
|
|
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:
|
|
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(
|
|
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
|