@ray-js/lamp-circle-picker 1.0.13 → 1.0.14-beta.1
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/example/src/demoRjs/index.tyml +1 -1
- package/example/src/pages/index.tsx +8 -1
- package/lib/component/index.module.less +1 -1
- package/lib/component/rjs/index.tyml +4 -4
- package/lib/component/rjs/index.tyss +7 -7
- package/lib/demoRjs/index.tyml +1 -1
- package/lib/demoRjs/index.tyss +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +10 -9
- package/lib/{index.module.less → index.less} +8 -8
- package/lib/props.d.ts +7 -0
- package/package.json +1 -1
|
@@ -44,7 +44,14 @@ export default function Home() {
|
|
|
44
44
|
return (
|
|
45
45
|
<View className={styles.view}>
|
|
46
46
|
<DemoBlock title="基础用法">
|
|
47
|
-
<LampCirclePicker
|
|
47
|
+
<LampCirclePicker
|
|
48
|
+
innerCircleStyle={{
|
|
49
|
+
backgroundColor: '#999',
|
|
50
|
+
}}
|
|
51
|
+
value={temperature}
|
|
52
|
+
useEventChannel
|
|
53
|
+
onTouchEnd={handleEnd}
|
|
54
|
+
/>
|
|
48
55
|
</DemoBlock>
|
|
49
56
|
|
|
50
57
|
<DemoBlock title="HideThumb">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<view class="container" style="{{ containerStyle }}">
|
|
1
|
+
<view class="lamp-temp-circle-picker-container" style="{{ containerStyle }}">
|
|
2
2
|
<canvas
|
|
3
|
-
class="canvasWrapper"
|
|
3
|
+
class="lamp-temp-circle-picker-canvasWrapper"
|
|
4
4
|
type="2d"
|
|
5
5
|
canvas-id="{{ canvasId }}"
|
|
6
6
|
disable-scroll="true"
|
|
7
7
|
style="width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;"
|
|
8
8
|
/>
|
|
9
|
-
<view class="canvasPowerOffMask" style="position: absolute; top: 0; left: 0; width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;" ty:if="{{ maskVisible }}" />
|
|
9
|
+
<view class="lamp-temp-circle-picker-canvasPowerOffMask" style="position: absolute; top: 0; left: 0; width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;" ty:if="{{ maskVisible }}" />
|
|
10
10
|
<canvas
|
|
11
|
-
class="canvasThumbWrapper"
|
|
11
|
+
class="lamp-temp-circle-picker-canvasThumbWrapper"
|
|
12
12
|
type="2d"
|
|
13
13
|
canvas-id="{{ canvasId }}_thumb"
|
|
14
14
|
disable-scroll="true"
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
.container {
|
|
1
|
+
.lamp-temp-circle-picker-container {
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.canvasWrapper {
|
|
5
|
+
.lamp-temp-circle-picker-canvasWrapper {
|
|
6
6
|
position: relative;
|
|
7
7
|
}
|
|
8
|
-
.canvasThumbWrapper {
|
|
8
|
+
.lamp-temp-circle-picker-canvasThumbWrapper {
|
|
9
9
|
z-index: 11;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.canvasPowerOffMask {
|
|
12
|
+
.lamp-temp-circle-picker-canvasPowerOffMask {
|
|
13
13
|
background-color: rgba(0, 0, 0, 0.5);
|
|
14
14
|
transition: opacity 0.3s ease;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.thumb {
|
|
17
|
+
.lamp-temp-circle-picker-thumb {
|
|
18
18
|
position: absolute;
|
|
19
19
|
width: 44rpx;
|
|
20
20
|
height: 44rpx;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.16);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.colorTipWrapper {
|
|
27
|
+
.lamp-temp-circle-picker-colorTipWrapper {
|
|
28
28
|
position: absolute;
|
|
29
29
|
top: 12rpx;
|
|
30
30
|
left: 12rpx;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
z-index: 999;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.colorTip {
|
|
45
|
+
.lamp-temp-circle-picker-colorTip {
|
|
46
46
|
color: #fff;
|
|
47
47
|
font-size: 20rpx;
|
|
48
48
|
}
|
package/lib/demoRjs/index.tyml
CHANGED
package/lib/demoRjs/index.tyss
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { View, Text } from '@ray-js/components';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Strings from './i18n';
|
|
7
7
|
import AnnulusPickerColor from './component';
|
|
8
|
-
import
|
|
8
|
+
import './index.less';
|
|
9
9
|
const LampCirclePicker = props => {
|
|
10
10
|
const {
|
|
11
11
|
value,
|
|
@@ -29,6 +29,7 @@ const LampCirclePicker = props => {
|
|
|
29
29
|
width: 5,
|
|
30
30
|
color: '#eee'
|
|
31
31
|
},
|
|
32
|
+
innerCircleStyle = {},
|
|
32
33
|
style,
|
|
33
34
|
onTouchStart,
|
|
34
35
|
onTouchMove,
|
|
@@ -50,26 +51,26 @@ const LampCirclePicker = props => {
|
|
|
50
51
|
});
|
|
51
52
|
}, [colorList]);
|
|
52
53
|
return /*#__PURE__*/React.createElement(View, {
|
|
53
|
-
className: clsx(
|
|
54
|
+
className: clsx('lamp-temp-circle-picker-container', 'lamp-temp-circle-picker-flexCenter'),
|
|
54
55
|
style: style
|
|
55
56
|
}, showInnerCircle && /*#__PURE__*/React.createElement(View, {
|
|
56
|
-
className: clsx(
|
|
57
|
+
className: clsx('lamp-temp-circle-picker-innerBox', 'lamp-temp-circle-picker-flexCenter')
|
|
57
58
|
}, /*#__PURE__*/React.createElement(View, {
|
|
58
|
-
className:
|
|
59
|
-
style: {
|
|
59
|
+
className: "lamp-temp-circle-picker-ringIcon",
|
|
60
|
+
style: _objectSpread({
|
|
60
61
|
width: innerImgRadius,
|
|
61
62
|
height: innerImgRadius,
|
|
62
63
|
borderRadius: innerImgRadius,
|
|
63
64
|
border: `${borderWidth}px solid ${borderColor}`,
|
|
64
65
|
backgroundColor: innerCircleColor || 'transparent'
|
|
65
|
-
}
|
|
66
|
+
}, innerCircleStyle)
|
|
66
67
|
}), /*#__PURE__*/React.createElement(View, {
|
|
67
|
-
className: clsx(
|
|
68
|
+
className: clsx('lamp-temp-circle-picker-textBox', 'lamp-temp-circle-picker-flexCenter')
|
|
68
69
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
69
|
-
className:
|
|
70
|
+
className: "lamp-temp-circle-picker-title",
|
|
70
71
|
style: titleStyle
|
|
71
72
|
}, Math.trunc(_value / 10), "%"), /*#__PURE__*/React.createElement(Text, {
|
|
72
|
-
className:
|
|
73
|
+
className: "lamp-temp-circle-picker-desc",
|
|
73
74
|
style: descStyle
|
|
74
75
|
}, descText !== null && descText !== void 0 ? descText : Strings.getLang('temperature')))), /*#__PURE__*/React.createElement(AnnulusPickerColor, {
|
|
75
76
|
canvasId: canvasId,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
.container {
|
|
1
|
+
.lamp-temp-circle-picker-container {
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
|
-
.innerBox {
|
|
4
|
+
.lamp-temp-circle-picker-innerBox {
|
|
5
5
|
width: 276rpx;
|
|
6
6
|
position: absolute;
|
|
7
7
|
|
|
8
|
-
.ringIcon {
|
|
8
|
+
.lamp-temp-circle-picker-ringIcon {
|
|
9
9
|
position: absolute;
|
|
10
10
|
width: 276rpx;
|
|
11
11
|
height: 276rpx;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.textBox {
|
|
14
|
+
.lamp-temp-circle-picker-textBox {
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
z-index: 100;
|
|
17
17
|
|
|
18
|
-
.title {
|
|
18
|
+
.lamp-temp-circle-picker-title {
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
font-size: 28px;
|
|
21
21
|
line-height: 39px;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
color: #FFFFFF;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.desc {
|
|
26
|
+
.lamp-temp-circle-picker-desc {
|
|
27
27
|
font-weight: 500;
|
|
28
28
|
font-size: 13px;
|
|
29
29
|
line-height: 18px;
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.flexCenter {
|
|
37
|
+
.lamp-temp-circle-picker-flexCenter {
|
|
38
38
|
display: flex;
|
|
39
39
|
flex: 1;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
}
|
|
42
|
+
}
|
package/lib/props.d.ts
CHANGED
|
@@ -122,6 +122,13 @@ export interface IProps {
|
|
|
122
122
|
color: string;
|
|
123
123
|
width: number;
|
|
124
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* @description.en innerCircleStyle
|
|
127
|
+
* @description.zh 内部圆环样式
|
|
128
|
+
* @default null
|
|
129
|
+
* @version 1.0.14
|
|
130
|
+
*/
|
|
131
|
+
innerCircleStyle?: React.CSSProperties;
|
|
125
132
|
/**
|
|
126
133
|
* @description.en touchCircleStrokeStyle
|
|
127
134
|
* @description.zh 触摸圆环描边颜色与 ctx.shadowColor 值相同
|