@cloudbase/weda-ui-mp 3.14.1 → 3.14.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.
@@ -62,7 +62,7 @@ Component({
62
62
  : GUTTER_VALUE.find((item) => item.gutterValue === gutterY)?.styleValue || 0;
63
63
  const actalClassName = classNames({
64
64
  'wd-grid': true,
65
- 'wd-grid--avoid-scrollbar': avoidScrollbar,
65
+ 'wd-grid--gap': avoidScrollbar,
66
66
  [`wd-grid-gx-${gutterXValue}`]: !isNil(gutterXValue),
67
67
  // 产品要求guterX 同时间决定row一个换行的间距和 row之间的间距
68
68
  [`wd-grid-gy-${gutterYValue}`]: !isNil(gutterYValue),
@@ -48,8 +48,7 @@ Component({
48
48
  try {
49
49
  return (
50
50
  '<pre><code class="hljs">' +
51
- hljs.highlight(str, { language: lang, ignoreIllegals: true })
52
- .value +
51
+ hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
53
52
  '</code></pre>'
54
53
  );
55
54
  } catch (__) {}
@@ -69,8 +68,7 @@ Component({
69
68
  this.setReadonlyAttributes({
70
69
  value: this.properties.value,
71
70
  markdownInstance: this.data.mdInstance,
72
- updateMarkdownInstance: ({ markdownInstance }) =>
73
- this.setData({ mdInstance: markdownInstance }),
71
+ updateMarkdownInstance: ({ markdownInstance }) => this.setData({ mdInstance: markdownInstance }),
74
72
  });
75
73
  },
76
74
  },
@@ -78,7 +76,6 @@ Component({
78
76
  value: function () {
79
77
  const { mdInstance } = this.data;
80
78
  if (!mdInstance) return;
81
- console.log(this.data.value);
82
79
  this.setData({
83
80
  __html: mdInstance.render(this.data.value),
84
81
  });
@@ -2,10 +2,7 @@ import { commonCompBehavior } from '../../utils/common-behavior';
2
2
  import formFieldBehavior from '../form-field-behavior/form-field-behavior';
3
3
  import { WD_PREFIX } from '../../utils/constant';
4
4
  import itemBehavior from '../form-field-behavior/item-behavior';
5
- import {
6
- calculateNextValue,
7
- calculatePercentByValueAndBoundary,
8
- } from '../../utils/range';
5
+ import { calculateNextValue, calculatePercentByValueAndBoundary } from '../../utils/range';
9
6
 
10
7
  Component({
11
8
  options: {
@@ -34,13 +31,20 @@ Component({
34
31
  data: {
35
32
  classPrefix: WD_PREFIX,
36
33
  percent: 0,
34
+ active: true,
37
35
  },
38
36
  methods: {
39
37
  onTap: function (e) {
38
+ if (!this.data.active) {
39
+ return;
40
+ }
40
41
  const mouseX = e.detail.x;
41
42
  this._triggerChangeWithMouseX(mouseX);
42
43
  },
43
44
  onTouchStart: function (e) {
45
+ if (!this.data.active) {
46
+ return;
47
+ }
44
48
  const mouseX = e.touches[0]?.clientX;
45
49
  if (typeof mouseX !== 'number') {
46
50
  return;
@@ -48,6 +52,9 @@ Component({
48
52
  this._triggerChangeWithMouseX(mouseX);
49
53
  },
50
54
  onTouchMove: function (e) {
55
+ if (!this.data.active) {
56
+ return;
57
+ }
51
58
  const mouseX = e.touches[0]?.clientX;
52
59
  if (typeof mouseX !== 'number') {
53
60
  return;
@@ -55,19 +62,7 @@ Component({
55
62
  this._triggerChangeWithMouseX(mouseX);
56
63
  },
57
64
  updateWidgetAPI: function () {
58
- const {
59
- name,
60
- value,
61
- label,
62
- required,
63
- visible,
64
- disabled,
65
- readOnly,
66
- showPercent,
67
- min,
68
- max,
69
- step,
70
- } = this.data;
65
+ const { name, value, label, required, visible, disabled, readOnly, showPercent, min, max, step } = this.data;
71
66
  this.setReadonlyAttributes?.({
72
67
  name,
73
68
  value,
@@ -126,9 +121,13 @@ Component({
126
121
  'value, min, max': function () {
127
122
  this._computePercent();
128
123
  },
129
- 'name, value, label, required, visible, disabled, readOnly, showPercent, min, max, step':
130
- function () {
131
- this.updateWidgetAPI();
132
- },
124
+ 'name, value, label, required, visible, disabled, readOnly, showPercent, min, max, step': function () {
125
+ this.updateWidgetAPI();
126
+ },
127
+ 'disabled,readOnly': function (disabled, readOnly) {
128
+ this.setData({
129
+ active: !(readOnly || disabled),
130
+ });
131
+ },
133
132
  },
134
133
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.14.1",
6
+ "version": "3.14.2",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"