@cloudbase/weda-ui 3.15.1 → 3.15.3

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.
@@ -1,4 +1,4 @@
1
- declare function MapView({ APIKEY, drag, zoom, latlng, }: {
1
+ declare function MapView({ APIKEY, drag, zoom, latlng }: {
2
2
  APIKEY?: string;
3
3
  drag?: boolean;
4
4
  zoom?: boolean;
@@ -11,7 +11,7 @@ const defaultLatLng = {
11
11
  lat: null,
12
12
  lng: null,
13
13
  };
14
- export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng = defaultLatLng, }) {
14
+ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng = defaultLatLng }) {
15
15
  const mapRef = useRef();
16
16
  const markerRef = useRef();
17
17
  const mapDom = useRef();
@@ -81,7 +81,8 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
81
81
  function loadScript() {
82
82
  // 移除之前的
83
83
  if (document.getElementById('tmap-script')) {
84
- document.body.removeChild(document.getElementById('tmap-script'));
84
+ const scriptDom = document.getElementById('tmap-script');
85
+ scriptDom.parentNode.removeChild(scriptDom);
85
86
  }
86
87
  const script = document.createElement('script');
87
88
  script.type = 'text/javascript';
@@ -1,4 +1,4 @@
1
- export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsChange, dataSourceStatus, }: {
1
+ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsChange, dataSourceStatus }: {
2
2
  apiKey: any;
3
3
  locationType: any;
4
4
  eventsChange: any;
@@ -5,13 +5,12 @@ const { useEffect, useState, useRef } = React;
5
5
  // 改造:detailedAddress 和 type 非必须
6
6
  export const checkCustomLocation = (params) => {
7
7
  var _a, _b;
8
- if (!(params === null || params === void 0 ? void 0 : params.address) ||
9
- (((_a = params === null || params === void 0 ? void 0 : params.geopoint) === null || _a === void 0 ? void 0 : _a.type) && ((_b = params === null || params === void 0 ? void 0 : params.geopoint) === null || _b === void 0 ? void 0 : _b.type) !== 'Point')) {
8
+ if (!(params === null || params === void 0 ? void 0 : params.address) || (((_a = params === null || params === void 0 ? void 0 : params.geopoint) === null || _a === void 0 ? void 0 : _a.type) && ((_b = params === null || params === void 0 ? void 0 : params.geopoint) === null || _b === void 0 ? void 0 : _b.type) !== 'Point')) {
10
9
  return false;
11
10
  }
12
11
  return true;
13
12
  };
14
- export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsChange, dataSourceStatus, }) {
13
+ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsChange, dataSourceStatus }) {
15
14
  const [location, setLocation] = useState({
16
15
  poiname: '',
17
16
  detailedAddress: '',
@@ -25,14 +24,13 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
25
24
  const currentLocations = useRef();
26
25
  const customLocation = useRef();
27
26
  useEffect(() => {
28
- if (!dataSourceStatus ||
29
- !APIKEY ||
30
- new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(APIKEY))
27
+ if (!dataSourceStatus || !APIKEY || new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(APIKEY))
31
28
  return;
32
29
  function loadScript() {
33
30
  // 移除之前的
34
31
  if (document.getElementById('form-location-plug')) {
35
- document.body.removeChild(document.getElementById('form-location-plug'));
32
+ const scriptDom = document.getElementById('form-location-plug');
33
+ scriptDom.parentNode.removeChild(scriptDom);
36
34
  }
37
35
  const script = document.createElement('script');
38
36
  script.type = 'text/javascript';
@@ -65,9 +63,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
65
63
  currentLocations.current = null;
66
64
  setApiKeyStatus({
67
65
  status: false,
68
- message: error.code === 1
69
- ? '请打开定位权限'
70
- : error.message || '定位失败',
66
+ message: error.code === 1 ? '请打开定位权限' : error.message || '定位失败',
71
67
  });
72
68
  setCurrentLocStatus(false);
73
69
  });
@@ -97,14 +97,13 @@ export default function LocationH5(props) {
97
97
  }, [value]);
98
98
  // 获取定位信息
99
99
  useEffect(() => {
100
- if (!dataSourceStatus.status ||
101
- !APIKEY ||
102
- new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(APIKEY))
100
+ if (!dataSourceStatus.status || !APIKEY || new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(APIKEY))
103
101
  return;
104
102
  function loadScript() {
105
103
  // 移除之前的
106
104
  if (document.getElementById('form-location-plug')) {
107
- document.body.removeChild(document.getElementById('form-location-plug'));
105
+ const scriptDom = document.getElementById('form-location-plug');
106
+ scriptDom.parentNode.removeChild(scriptDom);
108
107
  }
109
108
  const script = document.createElement('script');
110
109
  script.type = 'text/javascript';
@@ -149,9 +148,7 @@ export default function LocationH5(props) {
149
148
  currentLocations.current = null;
150
149
  setApiKeyStatus({
151
150
  status: false,
152
- message: error.code === 1
153
- ? '请打开定位权限'
154
- : error.message || '定位失败',
151
+ message: error.code === 1 ? '请打开定位权限' : error.message || '定位失败',
155
152
  });
156
153
  setCurrentLocStatus(false);
157
154
  });
@@ -296,9 +293,7 @@ export default function LocationH5(props) {
296
293
  'form-location-addr-vertical': layout === 'vertical',
297
294
  [`${classPrefix}-form-read-color`]: readOnly,
298
295
  'form-location-addr--disabled': disabled,
299
- }), children: [_jsx("div", { className: "form-location-con__icon" }), _jsxs("div", { className: "form-location-con__text", children: [location.poiname && (_jsx(WdText, { text: location.poiname, className: "form-location-addr-title wd-location__info" })), showLngLat && (_jsx("div", { className: "form-location-addr-lat", children: location.latlng
300
- ? `${location.latlng.lat}N,${location.latlng.lng}E`
301
- : '' }))] })] }))] })] }), getIsShowMap() && (_jsx("div", { className: "form-map-container", style: { height: '200px' }, children: _jsx(MapView, { APIKEY: APIKEY, drag: drag, zoom: zoom, latlng: location.latlng }) })), _jsx(SelectModal, { isSelectMapVisible: isSelectMapVisible, setIsSelectMapVisible: setIsSelectMapVisible, location: location, currentLocations: currentLocations.current, setLocation: setLocation, chooseLocation: onChangeLocation, APIKEY: APIKEY, locationRange: locationRange, customRange: customRange })] }));
296
+ }), children: [_jsx("div", { className: "form-location-con__icon" }), _jsxs("div", { className: "form-location-con__text", children: [location.poiname && (_jsx(WdText, { text: location.poiname, className: "form-location-addr-title wd-location__info" })), showLngLat && (_jsx("div", { className: "form-location-addr-lat", children: location.latlng ? `${location.latlng.lat}N,${location.latlng.lng}E` : '' }))] })] }))] })] }), getIsShowMap() && (_jsx("div", { className: "form-map-container", style: { height: '200px' }, children: _jsx(MapView, { APIKEY: APIKEY, drag: drag, zoom: zoom, latlng: location.latlng }) })), _jsx(SelectModal, { isSelectMapVisible: isSelectMapVisible, setIsSelectMapVisible: setIsSelectMapVisible, location: location, currentLocations: currentLocations.current, setLocation: setLocation, chooseLocation: onChangeLocation, APIKEY: APIKEY, locationRange: locationRange, customRange: customRange })] }));
302
297
  return renderDecorator(LocationEl, decorator)({
303
298
  id,
304
299
  className: cls,
@@ -122,7 +122,7 @@ export const FilterFieldsPanel = forwardRef(function Comp(props, ref) {
122
122
  case 'exclude':
123
123
  searchValues.push({
124
124
  key: i.name,
125
- val: `^((?!${(_a = i.value) === null || _a === void 0 ? void 0 : _a.trim()}).)*$`,
125
+ val: `^((?!${i.filterType === 'string' ? (_a = i.value) === null || _a === void 0 ? void 0 : _a.trim() : i.value}).)*$`,
126
126
  rel: 'regex',
127
127
  });
128
128
  break;
@@ -132,7 +132,7 @@ export const FilterFieldsPanel = forwardRef(function Comp(props, ref) {
132
132
  default: {
133
133
  const searchItem = {
134
134
  key: i.name,
135
- val: (_c = i.value) === null || _c === void 0 ? void 0 : _c.trim(),
135
+ val: i.filterType === 'string' ? (_c = i.value) === null || _c === void 0 ? void 0 : _c.trim() : i.value,
136
136
  rel: i.fieldCalculation.value,
137
137
  };
138
138
  if (i.filterType === 'number') {
@@ -548,7 +548,7 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
548
548
  onSelectChange([], {}, true);
549
549
  },
550
550
  // 当前页数据
551
- records: isExpression && !enableTotal
551
+ records: isExpression && !enableTotal && enablePagination
552
552
  ? getCurrentPageData(dataRef.current.tableRecords, query.pageNo, query.pageSize)
553
553
  : dataRef.current.tableRecords,
554
554
  // 当前总数
@@ -7,15 +7,11 @@
7
7
  display: none;
8
8
  }
9
9
 
10
- .wd-form-item.wd-h5-upload-file-root
11
- .weui-upload-file
12
- .weda-upload-file-mobile {
10
+ .wd-form-item.wd-h5-upload-file-root .weui-upload-file .weda-upload-file-mobile {
13
11
  width: auto;
14
12
  }
15
13
 
16
- .wd-form-item.wd-h5-upload-file-root
17
- .weui-upload-file
18
- .weda-upload-file-mobile__hd {
14
+ .wd-form-item.wd-h5-upload-file-root .weui-upload-file .weda-upload-file-mobile__hd {
19
15
  padding: 0;
20
16
  }
21
17
 
@@ -27,10 +23,7 @@
27
23
  margin: 8px 0;
28
24
  }
29
25
 
30
- .wd-form-item.wd-h5-upload-file-root
31
- .weui-upload-file
32
- .weda-upload-file-mobile
33
- .weda-upload-file-mobile__item {
26
+ .wd-form-item.wd-h5-upload-file-root .weui-upload-file .weda-upload-file-mobile .weda-upload-file-mobile__item {
34
27
  padding: 0;
35
28
  }
36
29
 
@@ -47,9 +40,7 @@
47
40
  }
48
41
 
49
42
  /* pc */
50
- .wd-form-item.wd-pc-upload-file-root
51
- ._weda-fn-upload-result
52
- ._weda-fn-upload-result__item {
43
+ .wd-form-item.wd-pc-upload-file-root ._weda-fn-upload-result ._weda-fn-upload-result__item {
53
44
  margin-top: 0;
54
45
  margin-bottom: 8px;
55
46
  }
@@ -57,9 +48,7 @@
57
48
  width: 100%;
58
49
  }
59
50
 
60
- .wd-form-item.wd-pc-upload-file-root
61
- .weda-upload-file-pc__readOnly
62
- .weda-upload-file-pc__input-box {
51
+ .wd-form-item.wd-pc-upload-file-root .weda-upload-file-pc__readOnly .weda-upload-file-pc__input-box {
63
52
  display: none;
64
53
  }
65
54
 
@@ -69,20 +58,12 @@
69
58
  margin-top: 0;
70
59
  }
71
60
 
72
- .wd-form-item.wd-pc-upload-file-root
73
- > .wd-form-item-wrap
74
- > .wd-form-item-wrap__control {
61
+ .wd-form-item.wd-pc-upload-file-root > .wd-form-item-wrap > .wd-form-item-wrap__control {
75
62
  overflow-x: hidden;
76
63
  }
77
64
 
78
- .wd-form-item.wd-pc-upload-file-root
79
- .weda-upload-file-pc
80
- .weda-upload-file-pc--item
81
- .weda-upload-file-pc--item-label,
82
- .wd-form-item.wd-pc-upload-file-root
83
- .weda-upload-file-pc
84
- .weda-upload-file-pc--item
85
- .weda-upload-file-pc--item-value {
65
+ .wd-form-item.wd-pc-upload-file-root .weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-label,
66
+ .wd-form-item.wd-pc-upload-file-root .weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-value {
86
67
  padding: 10px 4px;
87
68
  text-align: center;
88
69
  width: 80px;
@@ -97,11 +78,7 @@
97
78
  margin-right: 4px;
98
79
  }
99
80
 
100
- .wd-form-item.wd-pc-upload-file-root
101
- .weda-upload-file-pc
102
- .weda-upload-file-pc--item
103
- .weda-upload-file-pc--item-title {
81
+ .wd-form-item.wd-pc-upload-file-root .weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-title {
104
82
  flex-grow: 2;
105
- width: 100%;
106
83
  max-width: calc(100% - 240px);
107
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.15.1",
3
+ "version": "3.15.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",