@cloudbase/weda-ui-mp 3.9.1 → 3.9.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.
@@ -26,7 +26,7 @@ Component({
26
26
  value: [],
27
27
  },
28
28
  queryCondition: {
29
- type: Array,
29
+ type: null,
30
30
  value: [],
31
31
  },
32
32
  bindConnectMetadata: {
@@ -105,7 +105,10 @@ Component({
105
105
  record: this.data._oldData,
106
106
  refresh,
107
107
  deleteOne,
108
- dataSourceVersion: this.properties.supportManyRelated ? 'v2' : 'v1',
108
+ dataSourceVersion:
109
+ this.properties.datasource?.extra?.methodName === 'wedaGetRecordsV2'
110
+ ? 'v2'
111
+ : 'v1',
109
112
  });
110
113
  },
111
114
  },
@@ -509,10 +509,7 @@ Component({
509
509
  },
510
510
  },
511
511
  observers: {
512
- apiKey: function () {
513
- this.getInitialization();
514
- },
515
- location: function () {
512
+ 'apiKey,location': function () {
516
513
  this.getInitialization();
517
514
  },
518
515
  },
@@ -449,15 +449,13 @@ Component({
449
449
  });
450
450
  },
451
451
  mapChooseOnConfirm(event) {
452
+ this.setData({ isMapChooseVisible: false });
452
453
  const value = event.detail;
453
454
  this.changeLocation({
454
455
  ...value,
455
456
  poiname: value.address,
456
457
  detailedAddress: value.detailedAddress,
457
458
  });
458
- this.setData({
459
- isMapChooseVisible: false,
460
- });
461
459
  },
462
460
  handleError: function (e) {
463
461
  this.triggerEvent('error', e.detail);
@@ -24,6 +24,6 @@
24
24
  <view style="padding-left: 16px; padding-right: 16px; margin-top: 16px; padding-bottom: 16px" wx:if="{{showMap&&isAddrShow}}">
25
25
  <map id="map" longitude="{{location.longitude}}" latitude="{{location.latitude}}" markers="{{markers}}" scale="16" enable-zoom="{{zoom}}" enable-scroll="{{drag}}" style="width: 100%; height: 200px"></map>
26
26
  </view>
27
- <mapChoose id="{{id}}" isVisible="{{isMapChooseVisible}}" bindonClose="mapChooseOnClose" bindonConfirm="mapChooseOnConfirm" location="{{location}}" apiKey="{{isApikeyStatus.apiKey}}" circleRadius="{{locationRange}}" customRange="{{customRange}}" currentLocations="{{currentLocations}}" bind:error="handleError" />
27
+ <mapChoose id="{{id}}" wx:if="{{isMapChooseVisible}}" isVisible="{{isMapChooseVisible}}" bindonClose="mapChooseOnClose" bindonConfirm="mapChooseOnConfirm" location="{{location}}" apiKey="{{isApikeyStatus.apiKey}}" circleRadius="{{locationRange}}" customRange="{{customRange}}" currentLocations="{{currentLocations}}" bind:error="handleError" />
28
28
  </view>
29
29
  </formcell>
@@ -68,7 +68,7 @@ Component({
68
68
  value: [],
69
69
  },
70
70
  queryCondition: {
71
- type: Array,
71
+ type: null,
72
72
  value: [],
73
73
  },
74
74
  pageSize: {
@@ -266,7 +266,10 @@ Component({
266
266
  ? extra?.methodName
267
267
  : 'wedaGetRecords';
268
268
  eventDataSource = datasource;
269
- const modelParams = await getModelParams(this.properties);
269
+ const modelParams = await getModelParams({
270
+ ...this.properties,
271
+ supportManyRelated: methodName === 'wedaGetRecordsV2',
272
+ });
270
273
  tcbParams = { ...tcbParams, ...modelParams };
271
274
  } else {
272
275
  dataSourceName = bindConnectMetadata?.datasource?.name;
@@ -613,7 +616,7 @@ Component({
613
616
  },
614
617
  updateWidgetAPI() {
615
618
  const { records, listTotal, pageNo, errorObj } = this.data;
616
- let { pageSize, supportManyRelated } = this.properties;
619
+ let { pageSize, datasource } = this.properties;
617
620
  this.setReadonlyAttributes &&
618
621
  this.setReadonlyAttributes({
619
622
  records,
@@ -623,7 +626,8 @@ Component({
623
626
  refresh: this.methodRefresh.bind(this),
624
627
  deleteOne: this.methodDeleteOne.bind(this),
625
628
  error: errorObj,
626
- dataSourceVersion: supportManyRelated ? 'v2' : 'v1',
629
+ dataSourceVersion:
630
+ datasource?.extra?.methodName === 'wedaGetRecordsV2' ? 'v2' : 'v1',
627
631
  });
628
632
  },
629
633
  },
@@ -28,6 +28,9 @@ Component({
28
28
  type: Boolean,
29
29
  value: true,
30
30
  },
31
+ inputPattern: {
32
+ type: null,
33
+ },
31
34
  },
32
35
  data: {
33
36
  root: '',
@@ -76,9 +79,14 @@ Component({
76
79
  this.setData({ isFocus: false });
77
80
  },
78
81
  handleChange: function (e) {
79
- const currentInputValue = e.detail.value;
82
+ const text = e.detail.value;
83
+ const reg = new RegExp(this.properties.inputPattern);
84
+ if (this.properties.inputPattern && !reg.test(text)) {
85
+ this.setData({ currentInputValue: this.data.currentInputValue });
86
+ return;
87
+ }
80
88
  const detail = this.convertDetail(e);
81
- this.setData({ currentInputValue });
89
+ this.setData({ currentInputValue: text });
82
90
  this.changeForm(detail);
83
91
  this.triggerEvent('change', detail);
84
92
  },
@@ -23,6 +23,9 @@ Component({
23
23
  ],
24
24
  },
25
25
  },
26
+ data: {
27
+ pattern: '^[()\\d\\s+\\-ext]{0,20}$',
28
+ },
26
29
  methods: {
27
30
  convertValueToString(val) {
28
31
  // 数据源认string
@@ -19,6 +19,7 @@
19
19
  after="{{after}}"
20
20
  isUnionValue="{{isUnionValue}}"
21
21
  prefixType="{{prefixType}}"
22
+ inputPattern="{{pattern}}"
22
23
  prefixIcon="{{prefixIcon}}"
23
24
  prefixSrc="{{prefixSrc}}"
24
25
  suffixType="{{suffixType}}"
@@ -26,13 +27,12 @@
26
27
  suffixSrc="{{suffixSrc}}"
27
28
  extra="{{extra}}"
28
29
  password="{{false}}"
29
- type="number"
30
30
  counterVisible="{{counterVisible}}"
31
31
  focus="{{focus}}"
32
32
  borderedH5="{{borderedH5}}"
33
33
  borderedPc="{{borderedPc}}"
34
34
  isNickNameType="{{false}}"
35
- maxLength="11"
35
+ maxLength="20"
36
36
  rules="{{rules}}"
37
37
  status="{{status}}"
38
38
  required="{{required}}"
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.9.1",
6
+ "version": "3.9.2",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"