@cloudbase/weda-ui 0.2.6 → 0.2.10

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 (158) hide show
  1. package/package.json +3 -4
  2. package/src/configs/components/container.json +2 -1
  3. package/src/configs/components/form/input.json +6 -0
  4. package/src/configs/components/form/richText.json +2 -1
  5. package/src/configs/components/form/uploader.json +4 -5
  6. package/src/configs/components/image.json +2 -1
  7. package/src/configs/components/link.json +2 -1
  8. package/src/configs/components/richtextview.json +2 -1
  9. package/src/configs/components/scrollVeiw.json +2 -1
  10. package/src/configs/components/swiper.json +2 -1
  11. package/src/configs/components/tabs.json +31 -86
  12. package/src/configs/components/text.json +2 -1
  13. package/src/configs/index.js +4 -7
  14. package/src/mp/components/form/input/index.js +5 -1
  15. package/src/mp/components/form/input/index.wxml +2 -1
  16. package/src/mp/components/form/select/index.js +2 -2
  17. package/src/mp/components/form/textarea/index.wxml +1 -0
  18. package/src/mp/components/form/uploader/index.js +48 -14
  19. package/src/mp/components/form/uploader/index.wxml +9 -2
  20. package/src/mp/components/image/index.js +57 -8
  21. package/src/mp/components/image/index.json +4 -1
  22. package/src/mp/components/image/index.wxml +4 -2
  23. package/src/mp/components/image/index.wxss +14 -0
  24. package/src/mp/components/richText/index.wxml +1 -1
  25. package/src/mp/components/tabs/index.js +14 -1
  26. package/src/mp/utils/deepEqual.js +42 -0
  27. package/src/web/components/form/enumSelect/MultipleSelect.jsx +94 -0
  28. package/src/web/components/form/enumSelect/NormalSelect.jsx +105 -0
  29. package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
  30. package/src/web/components/form/enumSelect/hooks/index.js +49 -0
  31. package/src/web/components/form/enumSelect/index.jsx +9 -0
  32. package/src/web/components/form/enumSelect/props/defaultProps.js +39 -0
  33. package/src/web/components/form/enumSelect/props/propsTypes.js +50 -0
  34. package/src/web/components/form/input/index.jsx +14 -10
  35. package/src/web/components/form/radio/index.jsx +1 -1
  36. package/src/web/components/form/select/h5.jsx +1 -1
  37. package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
  38. package/src/web/components/form/select/region/index.js +3 -3
  39. package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
  40. package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
  41. package/src/web/components/form/switch/index.jsx +1 -0
  42. package/src/web/components/form/uploader/index.css +15 -0
  43. package/src/web/components/form/uploader/index.jsx +2 -2
  44. package/src/web/components/form/uploader/uploader.h5.jsx +237 -0
  45. package/src/web/components/form/uploader/{uploaderPc.jsx → uploader.pc.jsx} +69 -59
  46. package/src/web/components/image/image.jsx +79 -5
  47. package/src/web/components/image/index.css +17 -0
  48. package/src/web/components/image/index.jsx +1 -0
  49. package/src/web/components/index.js +1 -1
  50. package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +754 -0
  51. package/src/web/components/modal/index.jsx +3 -2
  52. package/src/web/components/richTextView/index.css +0 -10
  53. package/src/web/components/richTextView/index.jsx +1 -12
  54. package/src/web/components/tabs/index.jsx +3 -3
  55. package/src/web/components/tabs/{tabsH5.jsx → tabs.h5.jsx} +9 -47
  56. package/src/web/components/tabs/{tabsPc.jsx → tabs.pc.jsx} +13 -47
  57. package/src/web/components/uploaderView/index.jsx +1 -1
  58. package/src/web/utils/tcb.js +8 -0
  59. package/CHANGELOG.md +0 -240
  60. package/src/.DS_Store +0 -0
  61. package/src/configs/components/markdown.json +0 -17
  62. package/src/mp/.gitignore +0 -10
  63. package/src/mp/components/markdown/index.js +0 -27
  64. package/src/mp/components/markdown/index.json +0 -6
  65. package/src/mp/components/markdown/index.wxml +0 -1
  66. package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
  67. package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
  68. package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
  69. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
  70. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
  71. package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
  72. package/src/mp/components/markdown/towxml/config.js +0 -285
  73. package/src/mp/components/markdown/towxml/decode.js +0 -26
  74. package/src/mp/components/markdown/towxml/decode.json +0 -12
  75. package/src/mp/components/markdown/towxml/decode.wxml +0 -1
  76. package/src/mp/components/markdown/towxml/decode.wxss +0 -0
  77. package/src/mp/components/markdown/towxml/img/img.js +0 -98
  78. package/src/mp/components/markdown/towxml/img/img.json +0 -3
  79. package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
  80. package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
  81. package/src/mp/components/markdown/towxml/index.js +0 -19
  82. package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
  83. package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
  84. package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
  85. package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
  86. package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
  87. package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
  88. package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
  89. package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
  90. package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
  91. package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
  92. package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
  93. package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
  94. package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
  95. package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
  96. package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
  97. package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
  98. package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
  99. package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
  100. package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
  101. package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
  102. package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
  103. package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
  104. package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
  105. package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
  106. package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
  107. package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
  108. package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
  109. package/src/mp/components/markdown/towxml/parse/index.js +0 -106
  110. package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
  111. package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
  112. package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
  113. package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
  114. package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
  115. package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
  116. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
  117. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
  118. package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
  119. package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
  120. package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
  121. package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
  122. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
  123. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
  124. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
  125. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
  126. package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
  127. package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
  128. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
  129. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
  130. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
  131. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
  132. package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
  133. package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
  134. package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
  135. package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
  136. package/src/mp/components/markdown/towxml/table/table.js +0 -11
  137. package/src/mp/components/markdown/towxml/table/table.json +0 -6
  138. package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
  139. package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
  140. package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
  141. package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
  142. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
  143. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
  144. package/src/mp/components/markdown/towxml/towxml.js +0 -17
  145. package/src/mp/components/markdown/towxml/towxml.json +0 -6
  146. package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
  147. package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
  148. package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
  149. package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
  150. package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
  151. package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
  152. package/src/web/.DS_Store +0 -0
  153. package/src/web/components/form/uploader/uploaderH5.jsx +0 -208
  154. package/src/web/components/markdown/index.jsx +0 -40
  155. package/src/web/wedatheme/.git +0 -1
  156. package/src/web/wedatheme/.gitignore +0 -5
  157. package/src/web/wedatheme/.npmrc +0 -1
  158. package/src/web/wedatheme/package-lock.json +0 -14335
@@ -11,6 +11,7 @@ export default function WeDaModal(_props) {
11
11
  customContent,
12
12
  isDefaultButton,
13
13
  emit,
14
+ events,
14
15
  ...props
15
16
  } = _props;
16
17
 
@@ -19,7 +20,7 @@ export default function WeDaModal(_props) {
19
20
  className={classNames('weda-ui', 'lcap-modal', 'container', className)}
20
21
  visible={visible}
21
22
  onClose={() => {
22
- emit('close');
23
+ emit('close', {});
23
24
  }}
24
25
  {...props}
25
26
  >
@@ -29,7 +30,7 @@ export default function WeDaModal(_props) {
29
30
  <Button
30
31
  type="primary"
31
32
  onClick={() => {
32
- emit('confirm');
33
+ emit('confirm', {});
33
34
  // events.confirm();
34
35
  }}
35
36
  >
@@ -1,13 +1,3 @@
1
- .weda-RichTextView {
2
- width: 100%;
3
- }
4
-
5
- @media (min-width: 1024px) {
6
- .weda-RichTextView {
7
- height: 100px;
8
- }
9
- }
10
-
11
1
  .weda-RichTextView blockquote {
12
2
  margin: 0 0 10px;
13
3
  padding: 15px 20px;
@@ -86,15 +86,4 @@ RichTextView.propTypes = {
86
86
  */
87
87
  style: PropTypes.object,
88
88
  id: PropTypes.string
89
- };
90
-
91
- /**
92
- * 默认属性
93
- */
94
- RichTextView.defaultProps = {
95
- value: '',
96
- style: {
97
- width: '100%',
98
- height: '100%',
99
- },
100
- };
89
+ };
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { usePlatform } from '../../utils/platform';
3
- import TabsH5 from './tabsH5';
4
- import TabsPc from './tabsPc';
3
+ import TabsH5 from './tabs.h5';
4
+ import TabsPc from './tabs.pc';
5
5
 
6
6
  export default function Tabs(props) {
7
7
  const platform = usePlatform();
8
8
 
9
9
  return platform === 'h5' ? <TabsH5 {...props} /> : <TabsPc {...props} />;
10
- }
10
+ }
@@ -1,58 +1,19 @@
1
- import React, { useState, useMemo } from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
 
4
4
  import './index.css';
5
5
  import classNames from '../../utils/classnames';
6
+ import { useSyncValue } from '../../utils/useSyncValue';
6
7
 
7
8
  export default function TabsH5({
8
9
  tabs,
10
+ selectedIndex,
9
11
  events,
10
12
  className,
11
- panel1,
12
- panel2,
13
- panel3,
14
- panel4,
15
- panel5,
16
- panel6,
17
- panel7,
18
- panel8,
19
- panel9,
20
- panel10,
21
- panel11,
22
- panel12,
23
- panel13,
24
- panel14,
25
- panel15,
26
- panel16,
27
- panel17,
28
- panel18,
29
- panel19,
30
- panel20,
31
- style
13
+ style,
14
+ ...restProps
32
15
  }) {
33
- const cachePanel = {
34
- panel1,
35
- panel2,
36
- panel3,
37
- panel4,
38
- panel5,
39
- panel6,
40
- panel7,
41
- panel8,
42
- panel9,
43
- panel10,
44
- panel11,
45
- panel12,
46
- panel13,
47
- panel14,
48
- panel15,
49
- panel16,
50
- panel17,
51
- panel18,
52
- panel19,
53
- panel20
54
- };
55
- const [currentIndex, setCurrentIndex] = useState(0);
16
+ const [currentIndex, setCurrentIndex] = useSyncValue(selectedIndex);
56
17
  const stickyStyle = useMemo(() => {
57
18
  const length = tabs.length;
58
19
  return {
@@ -81,7 +42,7 @@ export default function TabsH5({
81
42
  key={name || index}
82
43
  onClick={(event) => {
83
44
  setCurrentIndex(index);
84
- events && events.change(tabs[index], { event });
45
+ events && events.change({id: index, label: title}, { event });
85
46
  }}
86
47
  >
87
48
  {title}
@@ -98,7 +59,7 @@ export default function TabsH5({
98
59
  <div className={classNames({
99
60
  'weda-tabs__panel': true,
100
61
  })}>
101
- {cachePanel[`panel${currentIndex + 1}`]}
62
+ {restProps[`panel${currentIndex + 1}`]}
102
63
  </div>
103
64
  </div>
104
65
  );
@@ -109,6 +70,7 @@ TabsH5.propTypes = {
109
70
  tabs: PropTypes.array,
110
71
  className: PropTypes.string,
111
72
  style: PropTypes.object,
73
+ selectedIndex: PropTypes.number,
112
74
  events: PropTypes.objectOf(PropTypes.func),
113
75
  panel1: PropTypes.node,
114
76
  panel2: PropTypes.node,
@@ -2,73 +2,38 @@ import * as React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import { Tabs as TeaTabs, TabPanel, ConfigProvider } from 'tea-component';
4
4
  import classNames from '../../utils/classnames';
5
+ import { useSyncValue } from '../../utils/useSyncValue';
5
6
 
6
7
 
7
8
  export default function TabsPc({
8
9
  tabs,
10
+ selectedIndex,
9
11
  events,
10
12
  className,
11
- panel1,
12
- panel2,
13
- panel3,
14
- panel4,
15
- panel5,
16
- panel6,
17
- panel7,
18
- panel8,
19
- panel9,
20
- panel10,
21
- panel11,
22
- panel12,
23
- panel13,
24
- panel14,
25
- panel15,
26
- panel16,
27
- panel17,
28
- panel18,
29
- panel19,
30
- panel20,
31
- style
13
+ style,
14
+ ...restProps
32
15
  }) {
33
16
 
34
- const cachePanel = {
35
- panel1,
36
- panel2,
37
- panel3,
38
- panel4,
39
- panel5,
40
- panel6,
41
- panel7,
42
- panel8,
43
- panel9,
44
- panel10,
45
- panel11,
46
- panel12,
47
- panel13,
48
- panel14,
49
- panel15,
50
- panel16,
51
- panel17,
52
- panel18,
53
- panel19,
54
- panel20
55
- };
56
-
17
+ const [activeIndex, setActiveIndex] = useSyncValue(selectedIndex);
57
18
  const _tabs = Array.isArray(tabs) && tabs.length && tabs.map((item, index) => {
58
19
  return {
59
- id: item.name ?? index,
20
+ id: index,
60
21
  label: item.title
61
22
  };
62
23
  });
63
24
 
64
25
 
65
26
 
27
+ // React.useEffect(() => {
28
+ // console.log('render');
29
+ // });
66
30
  const onActive = (e) => {
31
+ setActiveIndex(e.id);
67
32
  events && events.change(e);
68
33
  };
69
34
  return (
70
35
  <ConfigProvider classPrefix="wedatea2td">
71
- <TeaTabs style={style} tabs={_tabs} onActive={onActive} className={classNames(
36
+ <TeaTabs style={style} tabs={_tabs} activeId={activeIndex} onActive={onActive} className={classNames(
72
37
  "weda-tabs_pc",
73
38
  {
74
39
  [className]: className
@@ -81,7 +46,7 @@ export default function TabsPc({
81
46
  id={item.id}
82
47
  label={item.label}
83
48
  >
84
- {cachePanel[`panel${index + 1}`]}
49
+ {restProps[`panel${index + 1}`]}
85
50
  </TabPanel>
86
51
  )
87
52
  )}
@@ -93,6 +58,7 @@ export default function TabsPc({
93
58
  TabsPc.propTypes = {
94
59
  tabs: PropTypes.array,
95
60
  className: PropTypes.string,
61
+ selectedIndex: PropTypes.number,
96
62
  style: PropTypes.object,
97
63
  events: PropTypes.objectOf(PropTypes.func),
98
64
  panel1: PropTypes.node,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
- import { TcbImage } from '../form/uploader/uploaderPc';
3
+ import { TcbImage } from '../form/uploader/uploader.pc';
4
4
  import classNames from '../../utils/classnames';
5
5
  import './index.css';
6
6
 
@@ -35,3 +35,11 @@ export async function getTempFileURL(data) {
35
35
  return await window?.app?.cloud?.getTempFileURL(data);
36
36
  }
37
37
  }
38
+
39
+ export async function getDescribeGeneralOptionsDetailList(params) {
40
+ // @ts-ignore
41
+ const callWedaApi = window?.app?.cloud?.callWedaApi;
42
+ if (callWedaApi) {
43
+ return await callWedaApi(params);
44
+ }
45
+ }
package/CHANGELOG.md DELETED
@@ -1,240 +0,0 @@
1
- > 为了更好的区分组件类型,仅在更新日志中进行如下约定:低码组件使用大驼峰命名,源码组件使用小驼峰命名。
2
-
3
- ## [1.2] - 2021-08-24
4
-
5
- ### Changed
6
-
7
- - swiper 轮播
8
-
9
- - 添加示例图片
10
-
11
- ## [1.1] - 2021-08-09
12
-
13
- ### Added
14
-
15
- - text 文本
16
-
17
- - 新增事件 `tap`
18
-
19
- - modal 模态弹窗
20
-
21
- - 新增组件 `modal`, web 使用 tea 样式用于 PC 样式响应式。
22
-
23
- - showModal 显示弹窗
24
-
25
- - 新增动作 `showModal`,用于平台方法的 PC 大屏响应式版本,小程序对齐 wx.showModal api。
26
-
27
- - FormTextarea 表单多行输入
28
-
29
- - 新增组件 `FormTextarea`, 用以替代被移除的 `Textarea` 组件
30
-
31
- - link 链接
32
-
33
- - 新增组件 `link`,可通过插槽来配置自定义内容
34
-
35
- ### Changed
36
-
37
- - button 按钮
38
-
39
- - 添加响应式样式,屏幕宽度大于 **1024px** 时显示为方角
40
-
41
- - swiper 轮播
42
-
43
- - 添加响应式样式,屏幕宽度大于 1024px 时显示为方角
44
-
45
- - FormRadio 表单单选
46
-
47
- - 修复多个单选组件并存导致的选中问题
48
-
49
- - FormCheckbox 表单复选
50
-
51
- - 修复多个复选组件并存导致的选中问题
52
-
53
- - 所有组件:
54
- - 表单组件的默认背景色,统一配置为透明
55
- - 组件最外层容器统一添加 `weda-ui` 类名,组件库级别重置样式及公共样式都限制在 `weda-ui` 类名下,防止污染
56
- - 规范了组件事件的触发方式
57
-
58
- ## [1.0] - 2021-06-10
59
-
60
- ### Added
61
-
62
- - text 文本:
63
-
64
- - 新增属性 `maxLines` 最大显示行数
65
-
66
- - FormRegion 表单区域选择:
67
-
68
- - 新增组件 `FormRegion`, 用以替代被移除的 `RegionPicker` 组件
69
-
70
- ### Removed
71
-
72
- - swiper 轮播:
73
-
74
- - 移除属性 `displayMultipleItems`, `nextMargin`, `previousMargin`, `updated`
75
- - 移除 `transition` 和 `animationfinished` 事件
76
-
77
- - text 文本:
78
-
79
- - 移除属性 `decode` 是否解码
80
- - 移除 `tap` 事件
81
-
82
- - image 图片:
83
-
84
- - 移除属性 `webp` 能否解析 webp 格式
85
-
86
- - button 按钮:
87
-
88
- - 移除属性 `plain` 镂空
89
- - 移除属性 `openType` 微信开放能力的 `获取用户信息` 选项
90
-
91
- - FormInput 表单输入:
92
-
93
- - 移除属性 `requiredFlag` 是否需要必填星号
94
- - 移除属性 `underline` 是否需要底部下划线
95
-
96
- - FormRadio 表单单选:
97
-
98
- - 移除属性 `validateTrigger` 字段触发校验类型
99
- - 移除属性 `validateStatus` 校验状态
100
- - 移除属性 `requiredFlag` 是否需要必填星号
101
- - 移除属性 `underline` 是否需要底部下划线
102
-
103
- - FormCheckbox 表单复选:
104
-
105
- - 移除属性 `validateTrigger` 字段触发校验类型
106
- - 移除属性 `validateStatus` 校验状态
107
- - 移除属性 `requiredFlag` 是否需要必填星号
108
- - 移除属性 `underline` 是否需要底部下划线
109
-
110
- - FormSwitch 表单开关:
111
-
112
- - 移除属性 `type` 显示类型
113
- - 移除属性 `checkedIcon` 选中图标
114
- - 移除属性 `uncheckedIcon` 非选中图标
115
- - 移除属性 `requiredFlag` 是否需要必填星号
116
- - 移除属性 `underline` 是否需要底部下划线
117
-
118
- - FormDate 表单日期:
119
-
120
- - 移除属性 `suffixType` 操作尾部样式类型
121
- - 移除属性 `suffixText` 操作尾部文案
122
- - 移除属性 `requiredFlag` 是否需要必填星号
123
- - 移除属性 `underline` 是否需要底部下划线
124
-
125
- - FormTime 表单时间:
126
-
127
- - 移除属性 `suffixType` 操作尾部样式类型
128
- - 移除属性 `suffixText` 操作尾部文案
129
- - 移除属性 `requiredFlag` 是否需要必填星号
130
- - 移除属性 `underline` 是否需要底部下划线
131
-
132
- - FormSelect 表单选择:
133
-
134
- - 移除属性 `suffixType` 操作尾部样式类型
135
- - 移除属性 `suffixText` 操作尾部文案
136
- - 移除属性 `validateTrigger` 字段触发校验类型
137
- - 移除属性 `validateStatus` 校验状态
138
- - 移除属性 `rules` 校验规则
139
- - 移除属性 `requiredFlag` 是否需要必填星号
140
- - 移除属性 `underline` 是否需要底部下划线
141
-
142
- - FormPhone 表单手机号码:
143
-
144
- - 移除属性 `maxLength` 最大输入长度
145
- - 移除属性 `rules` 校验规则
146
- - 移除属性 `requiredFlag` 是否需要必填星号
147
- - 移除属性 `underline` 是否需要底部下划线
148
-
149
- - FormEmail 表单邮件地址:
150
-
151
- - 移除属性 `rules` 校验规则
152
- - 移除属性 `requiredFlag` 是否需要必填星号
153
- - 移除属性 `underline` 是否需要底部下划线
154
-
155
- - FormUrl 表单邮件地址:
156
-
157
- - 移除属性 `rules` 校验规则
158
- - 移除属性 `requiredFlag` 是否需要必填星号
159
- - 移除属性 `underline` 是否需要底部下划线
160
-
161
- - FormItem 表单元素:
162
-
163
- - 移除组件
164
-
165
- - FormCell 表单表格:
166
-
167
- - 移除组件
168
-
169
- - RegionPicker 地域选择:
170
-
171
- - 移除组件
172
-
173
- - Textarea 多行输入:
174
-
175
- - 移除组件, 待优化后重新上架
176
-
177
- ### Changed
178
-
179
- - image 图片:
180
-
181
- - 默认大小由 320\*240 rpx 调整为 240\*240 rpx
182
-
183
- - text 文本:
184
-
185
- - 跟随小程序定义,`selectabble` 变更为 `userSelect`
186
- - 样式调整:默认布局模式从 `inline` 编程 `block`
187
-
188
- - button 按钮:
189
-
190
- - 样式调整:从默认宽度 `100%` 调整为默认 `184px`
191
-
192
- - Form 表单容器:
193
-
194
- - 样式优化
195
-
196
- - FormInput 表单输入:
197
-
198
- - 样式优化
199
-
200
- - FormRadio 表单单选:
201
-
202
- - 属性 `name` 表单字段名称,默认值由 `thisIsRadioKey` 改为 `formRadio`
203
- - 样式优化
204
-
205
- - FormCheckbox 表单复选:
206
-
207
- - 属性 `name` 表单字段名称,默认值由 `thisIsCheckboxKey` 改为 `formCheckbox`
208
- - 样式优化
209
-
210
- - FormSwitch 表单开关:
211
-
212
- - 属性 `name` 表单字段名称,默认值由 `thisIsSelectKey` 改为 `formSwitch`
213
- - 样式优化
214
-
215
- - FormDate 表单日期:
216
-
217
- - 属性 `name` 表单字段名称,默认值由 `thisIsDateKey` 改为 `formDate`
218
- - 样式优化
219
-
220
- - FormTime 表单时间:
221
-
222
- - 属性 `name` 表单字段名称,默认值由 `thisIsTimeKey` 改为 `formTime`
223
- - 样式优化
224
-
225
- - FormSelect 表单选择:
226
-
227
- - 属性 `name` 表单字段名称,默认值由 `thisIsSelectKey` 改为 `formSelect`
228
- - 样式优化
229
-
230
- - FormPhone 表单手机号码:
231
-
232
- - 样式优化
233
-
234
- - FormEmail 表单邮件地址:
235
-
236
- - 样式优化
237
-
238
- - FormUrl 表单邮件地址:
239
-
240
- - 样式优化
package/src/.DS_Store DELETED
Binary file
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json",
3
- "data": {
4
- "properties": {
5
- "source": {
6
- "title": "markdown 内容",
7
- "type": "textarea",
8
- "default": "> 这是 `markdown` 文本"
9
- }
10
- }
11
- },
12
- "meta": {
13
- "title": "Markdown",
14
- "description": "markdown 预览",
15
- "category": "展示"
16
- }
17
- }
package/src/mp/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.yarn/*
2
- !/.yarn/patches
3
- !/.yarn/plugins
4
- !/.yarn/releases
5
- !/.yarn/sdks
6
-
7
- # Swap the comments on the following lines if you don't wish to use zero-installs
8
- # Documentation here: https://yarnpkg.com/features/zero-installs
9
- !/.yarn/cache
10
- #/.pnp.*
@@ -1,27 +0,0 @@
1
- const towxml = require('./towxml/index');
2
-
3
- Component({
4
- options: {
5
- virtualHost: true,
6
- },
7
- data: {
8
- nodes: {},
9
- },
10
- properties: {
11
- source: {
12
- type: String,
13
- value: '> 这是 `markdown` 文本',
14
- },
15
- },
16
- methods: {
17
- updateNodes() {
18
- const nodes = towxml(this.properties.source, 'markdown', {});
19
- this.setData({ nodes });
20
- },
21
- },
22
- observers: {
23
- source() {
24
- this.updateNodes();
25
- },
26
- },
27
- });
@@ -1,6 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "towxml": "./towxml/towxml"
5
- }
6
- }
@@ -1 +0,0 @@
1
- <towxml className="weda-ui" nodes="{{nodes}}"></towxml>
@@ -1,99 +0,0 @@
1
- const fillIn = (val) => `${val < 10 ? '0' : ''}${val}`;
2
- const formatTime = (_time) => {
3
- const time = Math.round(_time);
4
- const second = Math.round(time % 60);
5
- const minute = Math.floor((time / 60) % 60);
6
- const hour = Math.floor(time / 60 / 60);
7
- return `${fillIn(hour)}:${fillIn(minute)}:${fillIn(second)}`;
8
- };
9
-
10
- class Audio {
11
- constructor(obj) {
12
- const _ts = this;
13
- const option = (_ts.option = obj.attr);
14
-
15
- (_ts.loop = option.loop === 'true'), (_ts.autoplay = option.autoplay === 'true');
16
- _ts.create();
17
- _ts.index = 0;
18
- }
19
- create() {
20
- const _ts = this;
21
- const { option } = _ts;
22
- const audio = (_ts.audio = wx.createInnerAudioContext());
23
- audio.src = option.src;
24
-
25
- // 说明可以播放了
26
- audio.onCanplay(() => {
27
- if (_ts.autoplay && !_ts.index) {
28
- _ts.play();
29
- }
30
- if (!_ts.autoplay && !_ts.index) {
31
- _ts.eventCanplay();
32
- }
33
- });
34
-
35
- // 更新时间
36
- audio.onTimeUpdate(() => {
37
- // _ts.status = 'update';
38
- _ts.duration = audio.duration;
39
- _ts.currentTime = audio.currentTime;
40
-
41
- // 定义播放结束
42
- if (_ts.duration - _ts.currentTime < 0.5) {
43
- _ts.index++;
44
- if (_ts.loop) {
45
- audio.stop();
46
- } else {
47
- _ts.stop();
48
- }
49
- audio.seek(0);
50
- }
51
- _ts.eventTimeUpdate(formatTime(_ts.duration), formatTime(_ts.currentTime));
52
- });
53
-
54
- //
55
- audio.onSeeked(() => {
56
- if (_ts.loop) {
57
- _ts.play();
58
- }
59
- });
60
- }
61
- // 播放
62
- play() {
63
- const _ts = this;
64
- _ts.status = 'play';
65
- _ts.audio.play();
66
- _ts.eventPlay();
67
- }
68
- // 暂停
69
- pause() {
70
- const _ts = this;
71
- _ts.status = 'pause';
72
- _ts.audio.pause();
73
- _ts.eventPause();
74
- }
75
- // 停止
76
- stop() {
77
- const _ts = this;
78
- _ts.status = 'stop';
79
- _ts.audio.stop();
80
- _ts.eventStop();
81
- }
82
- // 销毁
83
- destroy() {
84
- const _ts = this;
85
- _ts.stop();
86
- _ts.audio.destroy();
87
- }
88
- eventCanplay() {}
89
- eventTimeUpdate() {}
90
- eventEnded() {}
91
- eventError() {}
92
- eventPause() {}
93
- eventPlay() {}
94
- eventSeeked() {}
95
- eventSeeking() {}
96
- eventStop() {}
97
- eventWaiting() {}
98
- }
99
- module.exports = Audio;