@cloudbase/weda-ui 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.
@@ -254,7 +254,12 @@ ${rawTemplate}
254
254
  {{/with}}
255
255
 
256
256
  [attributes]
257
+ {{#if (helper_utils 'isEqual' $self.attributes.datasource.extra.methodName 'wedaGetRecordsV2')}}
258
+ ':queryCondition'='null'
259
+ supportManyRelated=true
260
+ {{else}}
257
261
  ':queryCondition'='[]'
262
+ {{/if}}
258
263
  `;
259
264
  const properties = Type.Object({
260
265
  record: Type.Object({}, {
@@ -733,7 +733,12 @@ ${rawTemplate}
733
733
  {{/with}}
734
734
 
735
735
  [attributes]
736
+ {{#if (helper_utils 'isEqual' $self.attributes.datasource.extra.methodName 'wedaGetRecordsV2')}}
737
+ ':queryCondition'='null'
738
+ supportManyRelated=true
739
+ {{else}}
736
740
  ':queryCondition'='[]'
741
+ {{/if}}
737
742
  `;
738
743
  const properties = Type.Object({
739
744
  records: Type.Array(Type.Object({}, {
@@ -17,11 +17,16 @@ export default React.forwardRef(function DataView(props, ref) {
17
17
  }, []);
18
18
  const refresh = useCallback(() => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.refresh) === null || _b === void 0 ? void 0 : _b.call(_a); }, [listViewRef.current]);
19
19
  const deleteOne = useCallback((params) => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.deleteOne) === null || _b === void 0 ? void 0 : _b.call(_a, params); }, [listViewRef.current]);
20
- useSetWidgetApi(() => ({
21
- record,
22
- refresh,
23
- deleteOne,
24
- dataSourceVersion: props.supportManyRelated ? 'v2' : 'v1',
25
- }), [record, refresh, deleteOne, props.supportManyRelated], ref);
20
+ useSetWidgetApi(() => {
21
+ var _a, _b;
22
+ return ({
23
+ record,
24
+ refresh,
25
+ deleteOne,
26
+ dataSourceVersion: ((_b = (_a = props === null || props === void 0 ? void 0 : props.datasource) === null || _a === void 0 ? void 0 : _a.extra) === null || _b === void 0 ? void 0 : _b.methodName) === 'wedaGetRecordsV2'
27
+ ? 'v2'
28
+ : 'v1',
29
+ });
30
+ }, [record, refresh, deleteOne], ref);
26
31
  return (_jsx(ListView, { ...props, ref: listViewRef, isRecords: false, orderBy: undefined, orderType: undefined, template: "none", pageSize: 1, pagination: "none", beforeDataChange: beforeDataChange, refType: "dataView", dataSourceData: [].concat(props.dataSourceData) }));
27
32
  });
@@ -57,13 +57,16 @@ export default React.forwardRef(function ListView(props, ref) {
57
57
  const isH5 = platform === 'h5';
58
58
  const isSetStatus = dataSourceType !== 'expression' ? rawIsSetStatus : false;
59
59
  const isSetLoading = dataSourceType !== 'expression' ? rawIsSetLoading : true;
60
- const modelParams = getModelParams(props); // 包括 where 和 order
61
60
  const connectorParams = getParseValue(rawConnectorParams);
62
61
  const dataSourceData = getParseValue(rawDataSourceData);
63
62
  const methodName = getStringValue(dataSourceType === 'data-model'
64
63
  ? ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords'
65
64
  : connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name);
66
65
  const isV2protocol = methodName === 'wedaGetRecordsV2';
66
+ const modelParams = getModelParams({
67
+ ...props,
68
+ supportManyRelated: isV2protocol,
69
+ }); // 包括 where 和 order
67
70
  const dataSourceName = getStringValue(dataSourceType === 'data-model'
68
71
  ? datasource === null || datasource === void 0 ? void 0 : datasource.name
69
72
  : (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name);
@@ -9,6 +9,6 @@ const rules = [{ format: 'mobile', message: '手机校验失败' }];
9
9
  export const WdInputPhone = forwardRef(function WdInputPhone(props, ref) {
10
10
  const { classPrefix } = useConfig();
11
11
  const wrapCls = `${classPrefix}-form-input-number-wrap `;
12
- const pattern = /^[()\d\s+-ext]{0,20}$/;
12
+ const pattern = /^[()\d\s+\-ext]{0,20}$/;
13
13
  return (_jsx(WdInput, { ...props, inputPattern: pattern, maxLength: 20, wrapClassName: wrapCls, classRoot: "input-phone", rules: rules, ref: ref }));
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",