@cloudbase/weda-ui 1.0.21 → 2.0.9

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.
Files changed (170) hide show
  1. package/package.json +6 -4
  2. package/src/configs/components/button.json +0 -2
  3. package/src/configs/components/calendar.json +5 -2
  4. package/src/configs/components/carousel.json +18 -9
  5. package/src/configs/components/chart/bar.json +12 -6
  6. package/src/configs/components/chart/line.json +8 -4
  7. package/src/configs/components/chart/pie.json +8 -4
  8. package/src/configs/components/dataView.json +11 -6
  9. package/src/configs/components/form/radio.json +27 -0
  10. package/src/configs/components/form/select.json +2 -2
  11. package/src/configs/components/graphicCard.json +6 -2
  12. package/src/configs/components/image.json +12 -6
  13. package/src/configs/components/link.json +6 -3
  14. package/src/configs/components/listView.json +21 -11
  15. package/src/configs/components/lottery.json +153 -0
  16. package/src/configs/components/navLayout.json +12 -6
  17. package/src/configs/components/richtextview.json +2 -1
  18. package/src/configs/components/scrollVeiw.json +24 -12
  19. package/src/configs/components/swiper.json +18 -9
  20. package/src/configs/components/tabs.json +4 -2
  21. package/src/configs/components/text.json +10 -5
  22. package/src/configs/index.js +2 -0
  23. package/src/docs/common/format.tsx +112 -0
  24. package/src/docs/common/tableView.css +164 -0
  25. package/src/docs/common/tableView.tsx +273 -0
  26. package/src/docs/compsdocs/chart/Bar.mdx +159 -0
  27. package/src/docs/compsdocs/chart/Line.mdx +100 -0
  28. package/src/docs/compsdocs/chart/Pie.mdx +83 -0
  29. package/src/docs/compsdocs/chart/_category_.json +1 -0
  30. package/src/docs/compsdocs/chart/statisticsCard.mdx +51 -0
  31. package/src/docs/compsdocs/database/DataView.mdx +33 -0
  32. package/src/docs/compsdocs/database/ListView.mdx +33 -0
  33. package/src/docs/compsdocs/database/_category_.json +1 -0
  34. package/src/docs/compsdocs/form/Form.mdx +35 -0
  35. package/src/docs/compsdocs/form/FormCheckbox.mdx +35 -0
  36. package/src/docs/compsdocs/form/FormDate.mdx +30 -0
  37. package/src/docs/compsdocs/form/FormEmail.mdx +30 -0
  38. package/src/docs/compsdocs/form/FormImageUploader.mdx +31 -0
  39. package/src/docs/compsdocs/form/FormInput.mdx +30 -0
  40. package/src/docs/compsdocs/form/FormLocation.mdx +64 -0
  41. package/src/docs/compsdocs/form/FormPhone.mdx +30 -0
  42. package/src/docs/compsdocs/form/FormRadio.mdx +35 -0
  43. package/src/docs/compsdocs/form/FormRegion.mdx +30 -0
  44. package/src/docs/compsdocs/form/FormSelect.mdx +36 -0
  45. package/src/docs/compsdocs/form/FormSwitch.mdx +30 -0
  46. package/src/docs/compsdocs/form/FormTextarea.mdx +30 -0
  47. package/src/docs/compsdocs/form/FormTime.mdx +30 -0
  48. package/src/docs/compsdocs/form/FormUploadFile.mdx +30 -0
  49. package/src/docs/compsdocs/form/FormUrl.mdx +30 -0
  50. package/src/docs/compsdocs/form/_category_.json +1 -0
  51. package/src/docs/compsdocs/grid/Card.mdx +32 -0
  52. package/src/docs/compsdocs/grid/Container.mdx +42 -0
  53. package/src/docs/compsdocs/grid/Footer.mdx +31 -0
  54. package/src/docs/compsdocs/grid/GridLayout.mdx +32 -0
  55. package/src/docs/compsdocs/grid/Header.mdx +31 -0
  56. package/src/docs/compsdocs/grid/Layout.mdx +25 -0
  57. package/src/docs/compsdocs/grid/List.mdx +31 -0
  58. package/src/docs/compsdocs/grid/ScrollView.mdx +37 -0
  59. package/src/docs/compsdocs/grid/Swiper.mdx +58 -0
  60. package/src/docs/compsdocs/grid/_category_.json +1 -0
  61. package/src/docs/compsdocs/media/Icon.mdx +31 -0
  62. package/src/docs/compsdocs/media/Image.mdx +55 -0
  63. package/src/docs/compsdocs/media/_category_.json +1 -0
  64. package/src/docs/compsdocs/model/ModelCreate.mdx +20 -0
  65. package/src/docs/compsdocs/model/ModelDetail.mdx +20 -0
  66. package/src/docs/compsdocs/model/ModelTable.mdx +24 -0
  67. package/src/docs/compsdocs/model/ModelUpdate.mdx +21 -0
  68. package/src/docs/compsdocs/model/PageLayout.mdx +21 -0
  69. package/src/docs/compsdocs/model/_category_.json +1 -0
  70. package/src/docs/compsdocs/navmenu/Classification.mdx +38 -0
  71. package/src/docs/compsdocs/navmenu/NavBar.mdx +43 -0
  72. package/src/docs/compsdocs/navmenu/NavLayout.mdx +30 -0
  73. package/src/docs/compsdocs/navmenu/TabBar.mdx +43 -0
  74. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +29 -0
  75. package/src/docs/compsdocs/navmenu/_category_.json +1 -0
  76. package/src/docs/compsdocs/senior/Lottery.mdx +48 -0
  77. package/src/docs/compsdocs/senior/Modal.mdx +58 -0
  78. package/src/docs/compsdocs/senior/SlotMachine.mdx +52 -0
  79. package/src/docs/compsdocs/senior/_category_.json +1 -0
  80. package/src/docs/compsdocs/show/Calendar.mdx +29 -0
  81. package/src/docs/compsdocs/show/Divider.mdx +31 -0
  82. package/src/docs/compsdocs/show/GraphicCard.mdx +30 -0
  83. package/src/docs/compsdocs/show/Item.mdx +32 -0
  84. package/src/docs/compsdocs/show/ItemList.mdx +47 -0
  85. package/src/docs/compsdocs/show/Media.mdx +25 -0
  86. package/src/docs/compsdocs/show/StatusTip.mdx +25 -0
  87. package/src/docs/compsdocs/show/Swiper.mdx +33 -0
  88. package/src/docs/compsdocs/show/Tabs.mdx +38 -0
  89. package/src/docs/compsdocs/show/_category_.json +1 -0
  90. package/src/docs/compsdocs/show/button.mdx +25 -0
  91. package/src/docs/compsdocs/text/Link.mdx +43 -0
  92. package/src/docs/compsdocs/text/RichTextView.mdx +36 -0
  93. package/src/docs/compsdocs/text/Text.mdx +31 -0
  94. package/src/docs/compsdocs/text/Title.mdx +32 -0
  95. package/src/docs/compsdocs/text/_category_.json +1 -0
  96. package/src/docs/compsdocs/wxOpen/Phone.mdx +60 -0
  97. package/src/docs/compsdocs/wxOpen/Share.mdx +46 -0
  98. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +60 -0
  99. package/src/docs/compsdocs/wxOpen/_category_.json +4 -0
  100. package/src/index.js +2 -0
  101. package/src/mp/components/button/index.js +18 -2
  102. package/src/mp/components/button/index.wxml +7 -4
  103. package/src/mp/components/form/form/index.wxml +1 -2
  104. package/src/mp/components/form/formcell/index.wxml +1 -1
  105. package/src/mp/components/form/formcell/index.wxss +17 -0
  106. package/src/mp/components/form/input/index.wxss +15 -0
  107. package/src/mp/components/form/location/index.wxss +4 -6
  108. package/src/mp/components/form/select/index.js +13 -23
  109. package/src/mp/components/form/select/index.wxss +4 -0
  110. package/src/mp/components/form/select/region/index.js +6 -3
  111. package/src/mp/components/form/textarea/index.js +1 -1
  112. package/src/mp/components/form/textarea/index.wxss +4 -0
  113. package/src/mp/components/form/uploader/index.json +3 -2
  114. package/src/mp/components/form/uploader/index.wxml +11 -7
  115. package/src/mp/components/form/uploader/index.wxss +20 -2
  116. package/src/mp/components/form/uploader/weui-uploader.js +209 -0
  117. package/src/mp/components/form/uploader/weui-uploader.json +7 -0
  118. package/src/mp/components/form/uploader/weui-uploader.wxml +45 -0
  119. package/src/mp/components/form/uploader/weui-uploader.wxss +1 -0
  120. package/src/mp/components/form/uploaderFile/index.wxss +4 -4
  121. package/src/mp/components/image/index.wxss +3 -2
  122. package/src/mp/components/listView/index.js +5 -16
  123. package/src/mp/components/lottery/index.js +270 -0
  124. package/src/mp/components/lottery/index.json +4 -0
  125. package/src/mp/components/lottery/index.wxml +43 -0
  126. package/src/mp/components/lottery/index.wxss +317 -0
  127. package/src/mp/components/wxOpenApi/phone/index.js +1 -1
  128. package/src/mp/index.json +4 -3
  129. package/src/mp/style/weda-ui.wxss +14 -0
  130. package/src/mp/utils/constant.js +15 -0
  131. package/src/mp/utils/lodash.js +2 -0
  132. package/src/web/components/button/index.tsx +7 -7
  133. package/src/web/components/calendar/index.jsx +1 -1
  134. package/src/web/components/carousel/index.tsx +8 -8
  135. package/src/web/components/chart/common/config/line.js +1 -1
  136. package/src/web/components/form/checkbox/index.tsx +6 -0
  137. package/src/web/components/form/form/index.css +5 -1
  138. package/src/web/components/form/form/index.tsx +3 -1
  139. package/src/web/components/form/formcell/index.css +22 -1
  140. package/src/web/components/form/formcell/index.tsx +11 -6
  141. package/src/web/components/form/input/index.css +7 -12
  142. package/src/web/components/form/location/components/LocationH5/index.css +4 -7
  143. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +1 -1
  144. package/src/web/components/form/radio/index.tsx +6 -0
  145. package/src/web/components/form/select/h5.tsx +5 -24
  146. package/src/web/components/form/select/index.css +11 -0
  147. package/src/web/components/form/select/index.tsx +4 -17
  148. package/src/web/components/form/textarea/index.css +4 -0
  149. package/src/web/components/form/textarea/index.tsx +2 -2
  150. package/src/web/components/form/tips/index.css +4 -0
  151. package/src/web/components/form/tips/index.tsx +4 -3
  152. package/src/web/components/form/uploader/index.css +26 -2
  153. package/src/web/components/form/uploader/uploader.h5.tsx +81 -56
  154. package/src/web/components/form/uploaderFile/index.css +2 -4
  155. package/src/web/components/image/index.css +5 -5
  156. package/src/web/components/image/index.tsx +6 -7
  157. package/src/web/components/index.js +1 -0
  158. package/src/web/components/link/index.tsx +2 -2
  159. package/src/web/components/listView/index.tsx +6 -19
  160. package/src/web/components/lottery/index.css +327 -0
  161. package/src/web/components/lottery/index.tsx +567 -0
  162. package/src/web/components/lottery/lotteryUtil.ts +130 -0
  163. package/src/web/components/navLayout/index.tsx +2 -2
  164. package/src/web/components/navigationBar/index.tsx +0 -1
  165. package/src/web/components/picker/timePicker.tsx +2 -2
  166. package/src/web/components/slot/index.tsx +1 -1
  167. package/src/web/components/text/index.tsx +6 -6
  168. package/src/web/utils/{constant.js → constant.ts} +17 -2
  169. package/src/web/utils/lodash.ts +2 -0
  170. package/src/web/weda-ui.css +5 -1
@@ -3,31 +3,12 @@ import weui from '../../../utils/weui';
3
3
  import classNames from '../../../utils/classnames';
4
4
  import isObjectEqual from '../../../utils/isObjectEqual';
5
5
  import { regionPicker,getRegionTree,getAreaCode } from './region/index';
6
- import { PropsType } from './index';
7
- import { defaultProps } from './index';
6
+ import { PropsType , defaultProps , moment } from './index';
8
7
  import { timePicker, yearPicker, monthPicker } from './time';
9
- import { moment } from './index';
10
8
  import { callDataSource, callWedaApi } from '../../../utils/tcb';
11
9
  import destr from 'destr';
12
-
13
-
14
-
15
-
16
- const REL_DICT = {
17
- equal: 'eq', // 等于
18
- unequal: 'neq', // 不等于
19
- include: 'search', // 包含
20
- exclude: '_exclude', // 不包含
21
- begin_with: '_begin_with', // 开头是
22
- greater: 'gt', // 大于
23
- greater_or_equal: 'gte', // 大于等于
24
- bigger_or_equal: 'gte', //大于等于
25
- less: 'lt', // 小于
26
- less_or_equal: 'lte', // 小于等于
27
- in: 'in', // 多选值
28
- not_in: 'nin', // 不在多选值
29
- };
30
-
10
+ import { REL_DICT } from '../../../utils/constant';
11
+ import { isNil } from '../../../utils/lodash';
31
12
 
32
13
  export default function Select({
33
14
  // 系统属性
@@ -322,7 +303,7 @@ export default function Select({
322
303
  },
323
304
  });
324
305
  };
325
- const isNull = (val) => [undefined, null].includes(val);
306
+
326
307
  const getWhereList = (where) => {
327
308
  let result = [];
328
309
  Array.isArray(where) &&
@@ -338,7 +319,7 @@ export default function Select({
338
319
  rel = 'regex';
339
320
  val = `^((?!${val}).)*$`;
340
321
  }
341
- if (item2?.logic !== 'or' && item2?.key && rel && !isNull(val)) {
322
+ if (item2?.logic !== 'or' && item2?.key && rel && !isNil(val)) {
342
323
  result.push({ key: item2.key, rel, val });
343
324
  }
344
325
  });
@@ -1,3 +1,14 @@
1
+ .weda-ui .weui-cell.weui-check__label {
2
+ padding: 16px;
3
+ }
4
+
5
+ .weda-ui .weui-flex__item .weui-cell.weui-check__label {
6
+ padding-left: 0;
7
+ }
8
+
9
+
10
+
11
+
1
12
  .year-picker__overlay {
2
13
  width: 300px;
3
14
  }
@@ -13,26 +13,13 @@ import {
13
13
  import isObjectEqual from '../../../utils/isObjectEqual';
14
14
  import { getRegionTree,getAreaCode } from './region';
15
15
  import { renderDecorator } from '../renderDecorator';
16
- import { CommonFormPropsType } from '../types';
16
+ import type { CommonFormPropsType } from '../types';
17
17
  import YearPicker from './year';
18
18
  import { callDataSource, callWedaApi } from '../../../utils/tcb';
19
19
  import destr from 'destr';
20
+ import { REL_DICT } from '../../../utils/constant';
21
+ import { isNil } from '../../../utils/lodash';
20
22
 
21
- const REL_DICT = {
22
- equal: 'eq', // 等于
23
- unequal: 'neq', // 不等于
24
- include: 'search', // 包含
25
- exclude: '_exclude', // 不包含
26
- begin_with: '_begin_with', // 开头是
27
- greater: 'gt', // 大于
28
- greater_or_equal: 'gte', // 大于等于
29
- bigger_or_equal: 'gte', //大于等于
30
- less: 'lt', // 小于
31
- less_or_equal: 'lte', // 小于等于
32
- in: 'in', // 多选值
33
- not_in: 'nin', // 不在多选值
34
- };
35
- const isNull = (val) => [undefined, null].includes(val);
36
23
  const getWhereList = (where) => {
37
24
  let result = [];
38
25
  Array.isArray(where) &&
@@ -48,7 +35,7 @@ const getWhereList = (where) => {
48
35
  rel = 'regex';
49
36
  val = `^((?!${val}).)*$`;
50
37
  }
51
- if (item2?.logic !== 'or' && item2?.key && rel && !isNull(val)) {
38
+ if (item2?.logic !== 'or' && item2?.key && rel && !isNil(val)) {
52
39
  result.push({ key: item2.key, rel, val });
53
40
  }
54
41
  });
@@ -1,3 +1,7 @@
1
1
  .weda-textarea textarea {
2
2
  height: 8.6rem;
3
3
  }
4
+
5
+ .weda-ui .weda-textarea .weui-cell_form {
6
+ padding: 16px;
7
+ }
@@ -45,7 +45,7 @@ export default function Textarea({
45
45
  // 两次默认值不同时, 需要刷新value
46
46
  const [value, setValue] = useSyncValue(defaultValue);
47
47
  const counter = React.useMemo(() => (value?.length || 0), [value]);
48
-
48
+
49
49
  const onChange = function (e) {
50
50
  const text = typeof e === 'string' ? e : e.target.value;
51
51
  setValue(text);
@@ -111,4 +111,4 @@ export interface PropsType extends CommonFormPropsType {
111
111
  focus?: boolean;
112
112
  counterVisible?: boolean;
113
113
  size?: 's' | 'm' | 'l' | 'full';
114
- }
114
+ }
@@ -0,0 +1,4 @@
1
+ .weda-form .weui-cells__tips_warn {
2
+ color: #fa5151;
3
+ color: var(--weui-RED);
4
+ }
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
 
3
3
  import classNames from '../../../utils/classnames';
4
4
  import { CommonPropsType } from '../../../types';
5
+ import './index.css';
5
6
 
6
7
  export default function Tips({
7
8
  // 系统属性
@@ -10,7 +11,7 @@ export default function Tips({
10
11
  tips = '表单提示',
11
12
  type = 'normal',
12
13
  id,
13
- style
14
+ style,
14
15
  }: PropsType) {
15
16
  const cls = classNames({
16
17
  'weda-ui': true,
@@ -21,7 +22,7 @@ export default function Tips({
21
22
  });
22
23
 
23
24
  return (
24
- <div className={cls} id={id} style={style} >
25
+ <div className={cls} id={id} style={style}>
25
26
  {tips}
26
27
  </div>
27
28
  );
@@ -30,4 +31,4 @@ export default function Tips({
30
31
  export interface PropsType extends CommonPropsType {
31
32
  tips?: string;
32
33
  type?: 'warn' | 'normal';
33
- }
34
+ }
@@ -79,6 +79,30 @@
79
79
  display: flex;
80
80
  justify-content: space-between;
81
81
  }
82
- .weui-uploader.horizontal .weui-uploader__bd {
83
- padding-left: 2.28571rem;
82
+
83
+ .weui-uploader.horizontal .weda-formcells__label {
84
+ width: 130px;
85
+ }
86
+
87
+ .weda-ui .weui-uploader__hd {
88
+ display: block;
89
+ }
90
+
91
+ .weui-uploader__label {
92
+ display: flex;
93
+ flex: 1;
94
+ }
95
+ .weui-uploader.vertical .weui-uploader__title {
96
+ flex: unset;
97
+ }
98
+
99
+ .weda-ui .weui-uploader.horizontal .weui-uploader__bd {
100
+ padding: 16px 0;
101
+ }
102
+ .weda-ui .weui-uploader.vertical .weui-uploader__bd {
103
+ padding: 16px;
104
+ }
105
+
106
+ .weui-uploader__hd.vertical {
107
+ padding-bottom: 0;
84
108
  }
@@ -130,65 +130,55 @@ export function ImageUploaderH5({
130
130
  }, [fileIdList, single, maxUploadCount]);
131
131
  return (
132
132
  <div className={cls} id={id} style={style}>
133
- <div className="weui-cell">
134
- <div className="weui-cell__bd">
135
- <div className={classNames('weui-uploader', layout)}>
136
- <div className={classNames('weui-uploader__hd', layout)}>
137
- {requiredFlag && (
138
- <label className="weda-formcells__flag">*</label>
139
- )}
140
- <p className="weui-uploader__title">{title}</p>
141
- <div className="weui-uploader__info">
142
- <span id="uploadCount">{fileIdList.length}</span>
143
- {`/${finalMaxImgCount}`}
144
- </div>
145
- </div>
146
- <div className="weui-uploader__bd">
147
- <ul className="weui-uploader__files" id="uploaderFiles">
148
- {(fileIdList ?? []).map((f) => (
149
- <SingleImage key={f} src={f} deleteBySrc={deleteFile} />
150
- ))}
151
- {uploading && (
152
- <li className="weui-uploader__file weui-uploader__file_status">
153
- <div className="weui-uploader__file-content">
154
- {progress}%
155
- </div>
156
- </li>
157
- )}
158
- </ul>
159
- {showAdd && (
160
- <div className="weui-uploader__input-box">
161
- <input
162
- id="uploaderInput"
163
- className="weui-uploader__input"
164
- type="file"
165
- accept={accepts.join(',')}
166
- multiple
167
- onChange={(e) => {
168
- const files = [...e.target.files];
169
- if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
170
- weui.alert('请上传不超过10M的图片');
171
- return false;
172
- }
133
+ <div className={classNames('weui-uploader', layout)}>
134
+ <div className={classNames('weui-uploader__hd', layout)}>
135
+ <UploaderLabel layout={layout} title={title} currentCount={fileIdList.length} maxCount={finalMaxImgCount} requiredFlag={requiredFlag} />
136
+ </div>
173
137
 
174
- if (files.length > finalMaxImgCount) {
175
- // 防止一下子选择过多文件
176
- weui.alert(
177
- `最多只能上传${finalMaxImgCount}张图片,请重新选择`
178
- );
179
- return false;
180
- }
181
- if (fileIdList.length + files.length > finalMaxImgCount) {
182
- weui.alert(`最多只能上传${finalMaxImgCount}张图片`);
183
- return false;
184
- }
185
- files.forEach((f) => uploadToTcb(f));
186
- }}
187
- />
138
+ <div className="weui-uploader__bd">
139
+ <ul className="weui-uploader__files" id="uploaderFiles">
140
+ {(fileIdList ?? []).map((f) => (
141
+ <SingleImage key={f} src={f} deleteBySrc={deleteFile} />
142
+ ))}
143
+ {uploading && (
144
+ <li className="weui-uploader__file weui-uploader__file_status">
145
+ <div className="weui-uploader__file-content">
146
+ {progress}%
188
147
  </div>
189
- )}
148
+ </li>
149
+ )}
150
+ </ul>
151
+ {showAdd && (
152
+ <div className="weui-uploader__input-box">
153
+ <input
154
+ id="uploaderInput"
155
+ className="weui-uploader__input"
156
+ type="file"
157
+ accept={accepts.join(',')}
158
+ multiple
159
+ onChange={(e) => {
160
+ const files = [...e.target.files];
161
+ if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
162
+ weui.alert('请上传不超过10M的图片');
163
+ return false;
164
+ }
165
+
166
+ if (files.length > finalMaxImgCount) {
167
+ // 防止一下子选择过多文件
168
+ weui.alert(
169
+ `最多只能上传${finalMaxImgCount}张图片,请重新选择`
170
+ );
171
+ return false;
172
+ }
173
+ if (fileIdList.length + files.length > finalMaxImgCount) {
174
+ weui.alert(`最多只能上传${finalMaxImgCount}张图片`);
175
+ return false;
176
+ }
177
+ files.forEach((f) => uploadToTcb(f));
178
+ }}
179
+ />
190
180
  </div>
191
- </div>
181
+ )}
192
182
  </div>
193
183
  </div>
194
184
  </div>
@@ -260,3 +250,38 @@ export interface H5UploaderProps extends CommonFormPropsType {
260
250
  single?: boolean; // 单张上传还是多张上传,对应 onChange 参数为字符串还是字符串数组,value 在处理过程统一转为字符串数组;
261
251
  onChange?: (v: any) => void;
262
252
  }
253
+
254
+ const UploaderLabel = ({layout, title, currentCount, maxCount, requiredFlag}) => {
255
+ if(layout === 'horizontal') {
256
+ return (
257
+ <React.Fragment>
258
+ <div className='weda-formcells__label weui-cell'>
259
+ <div>
260
+ <p className="weui-uploader__title">{title}</p>
261
+ <div className="weui-uploader__info">
262
+ <span id="uploadCount">{currentCount}</span>
263
+ {`/${maxCount}`}
264
+ </div>
265
+ </div>
266
+ {requiredFlag && (
267
+ <label className="weda-formcells__flag">*</label>
268
+ )}
269
+ </div>
270
+ </React.Fragment>
271
+ )
272
+ }
273
+ return (
274
+ <div className='weda-formcells__label weui-cell'>
275
+ <div className='weui-uploader__label'>
276
+ <p className="weui-uploader__title">{title}</p>
277
+ {requiredFlag && (
278
+ <label className="weda-formcells__flag">*</label>
279
+ )}
280
+ </div>
281
+ <div className="weui-uploader__info">
282
+ <span id="uploadCount">{currentCount}</span>
283
+ {`/${maxCount}`}
284
+ </div>
285
+ </div>
286
+ )
287
+ }
@@ -76,9 +76,6 @@
76
76
  display: flex;
77
77
  justify-content: space-between;
78
78
  }
79
- .weui-uploader.horizontal .weui-uploader__bd {
80
- padding-left: 2.28571rem;
81
- }
82
79
 
83
80
  /* ----上传文件---- pc */
84
81
  .weda-upload-file-pc .weda-upload-file-pc__file-item {
@@ -230,7 +227,8 @@
230
227
 
231
228
  .weda-upload-file-mobile .weda-upload-file-mobile__hd {
232
229
  width: 100%;
233
- padding: 24px 20px 8px 20px;
230
+ padding: 16px;
231
+ padding-left: 0;
234
232
  display: flex;
235
233
  background-color: #fff;
236
234
  }
@@ -35,11 +35,11 @@
35
35
  color: white;
36
36
  }
37
37
 
38
- .weda-image.weda-image-error {
39
- position: relative;
40
- display: inline-block;
38
+ .weda-image.weda-image-error,
39
+ .weda-image:not([src]) {
40
+ position: relative !important;
41
+ display: inline-block !important;
41
42
  }
42
-
43
43
  .weda-image:not([src]):before,
44
44
  .weda-image-error::before {
45
45
  content: '';
@@ -49,4 +49,4 @@
49
49
  top: 0;
50
50
  width: 100%;
51
51
  height: 100%;
52
- }
52
+ }
@@ -23,12 +23,12 @@ export default function Image({
23
23
  events = {},
24
24
  style = {},
25
25
  // 组件属性
26
- src = defaultSrc,
27
- alt = '[图片]',
28
- mode = 'scaleToFill',
29
- lazyLoad = false,
30
- imgPreview = false,
31
- maskClosable = true,
26
+ src,
27
+ alt,
28
+ mode,
29
+ lazyLoad,
30
+ imgPreview,
31
+ maskClosable,
32
32
  fit,
33
33
  }: PropsType) {
34
34
  const [isError, setIsError] = useState(false);
@@ -102,4 +102,3 @@ function getObjectFitByWxImageMode(mode: TMode): React.CSSProperties['objectFit'
102
102
  const item = array.find((item) => item.mode === mode);
103
103
  return item?.h5;
104
104
  }
105
-
@@ -86,6 +86,7 @@ export { default as Phone } from './phone';
86
86
  export { default as PhoneCode } from './phoneCode';
87
87
  export { default as Share } from './share';
88
88
 
89
+ export { default as Lottery } from './lottery';
89
90
  // open
90
91
  // import Auth from './auth';
91
92
 
@@ -23,14 +23,14 @@ export interface PropsType extends CommonPropsType {
23
23
  // 所有绝对地址直接交由浏览器,新开窗口交由浏览器
24
24
  // 当前窗口相对地址交给平台
25
25
  export default function Link({
26
- content = '这是一个链接',
26
+ content,
27
27
  url = '',
28
28
  events = {},
29
29
  style,
30
30
  className,
31
31
  contentSlot,
32
32
  params = [], // TODO 格式定义,
33
- isOpenInNewWindow = false,
33
+ isOpenInNewWindow,
34
34
  }: PropsType) {
35
35
  url = url.trim();
36
36
  const cls = classNames({
@@ -11,24 +11,11 @@ import { isInIde } from '../../utils/platform';
11
11
  import classNames from '../../utils/classnames';
12
12
  import isequal from 'lodash.isequal';
13
13
  import './index.css';
14
+ import { REL_DICT } from '../../utils/constant';
15
+ import { isNil } from '../../utils/lodash';
14
16
 
15
- const REL_DICT = {
16
- equal: 'eq', // 等于
17
- unequal: 'neq', // 不等于
18
- include: 'search', // 包含
19
- exclude: '_exclude', // 不包含
20
- begin_with: '_begin_with', // 开头是
21
- greater: 'gt', // 大于
22
- greater_or_equal: 'gte', // 大于等于
23
- bigger_or_equal: 'gte', //大于等于
24
- less: 'lt', // 小于
25
- less_or_equal: 'lte', // 小于等于
26
- in: 'in', // 多选值
27
- not_in: 'nin', // 不在多选值
28
- };
29
17
  const ORDERTYPE = ['asc', 'desc'];
30
18
  const BLOCK_NAME = 'weda-list-view';
31
- const isNull = (val) => [undefined, null].includes(val);
32
19
  const getIdeMockData = (length = 3) => Array.from({ length }).map((d) => ({}));
33
20
  const getWhereList = (where) => {
34
21
  let result = [];
@@ -45,7 +32,7 @@ const getWhereList = (where) => {
45
32
  rel = 'regex';
46
33
  val = `^((?!${val}).)*$`;
47
34
  }
48
- if (item2?.logic !== 'or' && item2?.key && rel && !isNull(val)) {
35
+ if (item2?.logic !== 'or' && item2?.key && rel && !isNil(val)) {
49
36
  result.push({ key: item2.key, rel, val });
50
37
  }
51
38
  });
@@ -63,9 +50,9 @@ export default function ListView(props: IListView) {
63
50
  orderBy,
64
51
  orderType,
65
52
  where,
66
- template = 'simpleList',
53
+ template,
67
54
  pageSize = 5,
68
- pagination = 'loadMoreButton',
55
+ pagination,
69
56
  events,
70
57
  className,
71
58
  children,
@@ -185,7 +172,7 @@ export default function ListView(props: IListView) {
185
172
  const { orderBy, orderType, pageNo, pageSize, where } = params || {};
186
173
  const tcbParams = {};
187
174
  // tcb分页参数
188
- if (!isNull(pageNo) && !isNull(pageSize)) {
175
+ if (!isNil(pageNo) && !isNil(pageSize)) {
189
176
  tcbParams['pageNo'] = pageNo;
190
177
  tcbParams['pageSize'] = pageSize;
191
178
  }