@ray-js/lamp-circle-picker 1.0.0 → 1.0.1-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/README.md +1 -13
- package/lib/component/index.js +0 -1
- package/lib/component/props.d.ts +0 -6
- package/lib/component/props.js +0 -1
- package/lib/component/rjs/index.js +7 -2
- package/lib/component/rjs/index.tyml +9 -7
- package/lib/component/rjs/index.tyss +3 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -2
- package/lib/props.d.ts +0 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,12 +18,6 @@ $ yarn add @ray-js/components-ty-lamp
|
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
20
|
interface IProps {
|
|
21
|
-
/**
|
|
22
|
-
* @description.zh 色盘id 唯一标识
|
|
23
|
-
* @description.en Color wheel id unique identification
|
|
24
|
-
* @default
|
|
25
|
-
*/
|
|
26
|
-
canvasId: string;
|
|
27
21
|
/**
|
|
28
22
|
* @description.zh 默认数值
|
|
29
23
|
* @description.en default value
|
|
@@ -76,7 +70,6 @@ interface IProps {
|
|
|
76
70
|
```
|
|
77
71
|
|
|
78
72
|
```tsx
|
|
79
|
-
// 用法
|
|
80
73
|
import { LampCirclePicker } from '@ray-js/components-ty-lamp';
|
|
81
74
|
|
|
82
75
|
export default () => {
|
|
@@ -88,12 +81,7 @@ export default () => {
|
|
|
88
81
|
setTemperature(v);
|
|
89
82
|
};
|
|
90
83
|
return (
|
|
91
|
-
<LampCirclePicker
|
|
92
|
-
canvasId="whiteRing"
|
|
93
|
-
temperature={temperature}
|
|
94
|
-
onTouchMove={handleMove}
|
|
95
|
-
onTouchEnd={handleEnd}
|
|
96
|
-
/>
|
|
84
|
+
<LampCirclePicker temperature={temperature} onTouchMove={handleMove} onTouchEnd={handleEnd} />
|
|
97
85
|
);
|
|
98
86
|
};
|
|
99
87
|
```
|
package/lib/component/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import RectColorPicker from './rjs';
|
|
4
4
|
export default function RectColor(props) {
|
|
5
5
|
return /*#__PURE__*/React.createElement(RectColorPicker, {
|
|
6
|
-
canvasId: props.canvasId,
|
|
7
6
|
radius: props.radius,
|
|
8
7
|
innerRingRadius: props.innerRingRadius,
|
|
9
8
|
value: props.value,
|
package/lib/component/props.d.ts
CHANGED
package/lib/component/props.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import "core-js/modules/es.number.constructor.js";
|
|
2
|
+
import "core-js/modules/es.array.concat.js";
|
|
3
|
+
import "core-js/modules/es.array.slice.js";
|
|
2
4
|
import "core-js/modules/es.json.stringify.js";
|
|
3
5
|
import Render from './indexRjs.rjs';
|
|
4
6
|
import { getSystemInfo } from '@ray-js/api';
|
|
@@ -10,7 +12,6 @@ var ETipRectPosition = {
|
|
|
10
12
|
// eslint-disable-next-line no-undef
|
|
11
13
|
Component({
|
|
12
14
|
properties: {
|
|
13
|
-
canvasId: String,
|
|
14
15
|
containerStyle: String,
|
|
15
16
|
radius: {
|
|
16
17
|
type: Number,
|
|
@@ -37,10 +38,14 @@ Component({
|
|
|
37
38
|
isTouch: false,
|
|
38
39
|
touchType: '',
|
|
39
40
|
colorText: '',
|
|
40
|
-
tipRectPosition: ETipRectPosition.LEFT
|
|
41
|
+
tipRectPosition: ETipRectPosition.LEFT,
|
|
42
|
+
canvasId: "canvasId_".concat(String(+new Date()).slice(-3), "_").concat(String(Math.random()).slice(-3))
|
|
41
43
|
},
|
|
42
44
|
observers: {
|
|
43
45
|
'value.**': function value(v) {
|
|
46
|
+
if (this.touchType === 'move') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
44
49
|
if (Math.abs(this.lastValue / 10 - v / 10) > 1 || this.lastValue === 0 && v === 0) {
|
|
45
50
|
this._updatePosByRgb(v);
|
|
46
51
|
this.lastValue = v;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
<view style="{{ containerStyle }}">
|
|
1
|
+
<view class="container" style="{{ containerStyle }}">
|
|
2
2
|
<canvas
|
|
3
3
|
class="canvasWrapper"
|
|
4
4
|
type="2d"
|
|
5
5
|
canvas-id="{{ canvasId }}"
|
|
6
|
+
disable-scroll="true"
|
|
6
7
|
style="width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;"
|
|
7
8
|
>
|
|
8
|
-
<canvas
|
|
9
|
-
class="canvasThumbWrapper"
|
|
10
|
-
type="2d"
|
|
11
|
-
canvas-id="{{ canvasId }}_thumb"
|
|
12
|
-
style="width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;"
|
|
13
|
-
></canvas>
|
|
14
9
|
</canvas>
|
|
10
|
+
<canvas
|
|
11
|
+
class="canvasThumbWrapper"
|
|
12
|
+
type="2d"
|
|
13
|
+
canvas-id="{{ canvasId }}_thumb"
|
|
14
|
+
disable-scroll="true"
|
|
15
|
+
style="position: absolute; top: 0; left: 0; width: {{ radius * 2 }}px; height: {{ radius * 2 }}px;"
|
|
16
|
+
></canvas>
|
|
15
17
|
</view>
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -10,7 +10,6 @@ var ring = res.ring;
|
|
|
10
10
|
var WhiteRing = function (props) {
|
|
11
11
|
var temperature = props.temperature,
|
|
12
12
|
radius = props.radius,
|
|
13
|
-
canvasId = props.canvasId,
|
|
14
13
|
innerRingRadius = props.innerRingRadius,
|
|
15
14
|
isShowColorTip = props.isShowColorTip,
|
|
16
15
|
onTouchStart = props.onTouchStart,
|
|
@@ -19,7 +18,6 @@ var WhiteRing = function (props) {
|
|
|
19
18
|
return /*#__PURE__*/React.createElement(View, {
|
|
20
19
|
className: clsx(styled.container, styled.flexCenter)
|
|
21
20
|
}, /*#__PURE__*/React.createElement(AnnulusPickerColor, {
|
|
22
|
-
canvasId: canvasId,
|
|
23
21
|
value: temperature,
|
|
24
22
|
radius: radius,
|
|
25
23
|
innerRingRadius: innerRingRadius,
|
package/lib/props.d.ts
CHANGED