@tuya-miniapp/smart-ui 2.3.3-beta-5 → 2.3.3-beta-6

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.
@@ -95,6 +95,20 @@ SmartComponent({
95
95
  });
96
96
  },
97
97
  });
98
+ const sizeVal = this.parseSize();
99
+ const params = {
100
+ canvasWidth: +sizeVal,
101
+ canvasHeight: +sizeVal,
102
+ width: +sizeVal,
103
+ height: +sizeVal,
104
+ lineWidth: this.data.trackWidth,
105
+ trackColor: this.data.trackColor,
106
+ fillColor: this.data.fillColor,
107
+ fillColorStops: this.data.fillColorStops,
108
+ maskColor: this.data.maskColor,
109
+ dpr: this.data.dpr,
110
+ };
111
+ this.setData(params);
98
112
  },
99
113
  renderAll(canvas, ctx, progress, ops = {
100
114
  lineCap: 'round',
@@ -245,28 +259,14 @@ SmartComponent({
245
259
  render(val, canvasId) {
246
260
  // @ts-ignore
247
261
  const context = ty.createCanvasContext(canvasId);
248
- const sizeVal = this.parseSize();
249
- const params = {
250
- canvasWidth: +sizeVal,
251
- canvasHeight: +sizeVal,
252
- width: +sizeVal,
253
- height: +sizeVal,
254
- lineWidth: this.data.trackWidth,
255
- trackColor: this.data.trackColor,
256
- fillColor: this.data.fillColor,
257
- fillColorStops: this.data.fillColorStops,
258
- maskColor: this.data.maskColor,
259
- dpr: this.data.dpr,
260
- };
261
- this.setData(params);
262
262
  if (this.data.mode === 'basic') {
263
- this.renderAll(params, context, val / 100, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
263
+ this.renderAll(this.data, context, val / 100, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
264
264
  }
265
265
  if (this.data.mode === 'angle') {
266
- this.renderHalf(params, context, val / 200, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
266
+ this.renderHalf(this.data, context, val / 200, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
267
267
  }
268
268
  if (this.data.mode === 'angle2') {
269
- this.renderHalf2(params, context, val / 150, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
269
+ this.renderHalf2(this.data, context, val / 150, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
270
270
  }
271
271
  },
272
272
  },
@@ -5,5 +5,5 @@
5
5
  width="{{ canvasWidth * dpr }}"
6
6
  height="{{ canvasHeight * dpr }}"
7
7
  canvas-id="{{canvasId}}"
8
- style="width: {{width}}px; height:{{height}}px;"
8
+ style="width: {{width}}px; height:{{height}}px; {{customStyle}}"
9
9
  ></canvas>
@@ -99,6 +99,20 @@ var idListRef = {
99
99
  });
100
100
  },
101
101
  });
102
+ var sizeVal = this.parseSize();
103
+ var params = {
104
+ canvasWidth: +sizeVal,
105
+ canvasHeight: +sizeVal,
106
+ width: +sizeVal,
107
+ height: +sizeVal,
108
+ lineWidth: this.data.trackWidth,
109
+ trackColor: this.data.trackColor,
110
+ fillColor: this.data.fillColor,
111
+ fillColorStops: this.data.fillColorStops,
112
+ maskColor: this.data.maskColor,
113
+ dpr: this.data.dpr,
114
+ };
115
+ this.setData(params);
102
116
  },
103
117
  renderAll: function (canvas, ctx, progress, ops) {
104
118
  if (ops === void 0) { ops = {
@@ -252,28 +266,14 @@ var idListRef = {
252
266
  render: function (val, canvasId) {
253
267
  // @ts-ignore
254
268
  var context = ty.createCanvasContext(canvasId);
255
- var sizeVal = this.parseSize();
256
- var params = {
257
- canvasWidth: +sizeVal,
258
- canvasHeight: +sizeVal,
259
- width: +sizeVal,
260
- height: +sizeVal,
261
- lineWidth: this.data.trackWidth,
262
- trackColor: this.data.trackColor,
263
- fillColor: this.data.fillColor,
264
- fillColorStops: this.data.fillColorStops,
265
- maskColor: this.data.maskColor,
266
- dpr: this.data.dpr,
267
- };
268
- this.setData(params);
269
269
  if (this.data.mode === 'basic') {
270
- this.renderAll(params, context, val / 100, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
270
+ this.renderAll(this.data, context, val / 100, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
271
271
  }
272
272
  if (this.data.mode === 'angle') {
273
- this.renderHalf(params, context, val / 200, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
273
+ this.renderHalf(this.data, context, val / 200, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
274
274
  }
275
275
  if (this.data.mode === 'angle2') {
276
- this.renderHalf2(params, context, val / 150, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
276
+ this.renderHalf2(this.data, context, val / 150, this.data.round ? { lineCap: 'round' } : { lineCap: '' });
277
277
  }
278
278
  },
279
279
  },
@@ -5,5 +5,5 @@
5
5
  width="{{ canvasWidth * dpr }}"
6
6
  height="{{ canvasHeight * dpr }}"
7
7
  canvas-id="{{canvasId}}"
8
- style="width: {{width}}px; height:{{height}}px;"
8
+ style="width: {{width}}px; height:{{height}}px; {{customStyle}}"
9
9
  ></canvas>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.3.3-beta-5",
3
+ "version": "2.3.3-beta-6",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",