plain-design 1.0.0-beta.33 → 1.0.0-beta.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/dist/plain-design.commonjs.min.js +18 -18
  2. package/dist/plain-design.min.css +1 -1
  3. package/dist/plain-design.min.js +18 -18
  4. package/dist/report.html +38 -38
  5. package/package.json +3 -2
  6. package/src/packages/components/Dropdown/dropdown.public.scss +10 -0
  7. package/src/packages/components/Dropdown/dropdown.utils.tsx +3 -1
  8. package/src/packages/components/Dropdown/index.tsx +2 -2
  9. package/src/packages/components/DropdownSeparator/index.tsx +8 -0
  10. package/src/packages/entry.tsx +1 -0
  11. package/src/pages/data/address.json +0 -39317
  12. package/src/pages/data/data-1.json +0 -754
  13. package/src/pages/data/data-2.json +0 -3006
  14. package/src/pages/data/data-200.json +0 -5206
  15. package/src/pages/data/data-2000.json +0 -51954
  16. package/src/pages/data/data-50.json +0 -2075
  17. package/src/pages/data/data.json +0 -30002
  18. package/src/pages/data/demo.json +0 -1702
  19. package/src/pages/data/mock.database.js +0 -43
  20. package/src/pages/data/mock.js +0 -141
  21. package/src/pages/data/tree.data.json +0 -87
  22. package/src/pages/env/config/local.js +0 -3
  23. package/src/pages/env/config/prod.js +0 -3
  24. package/src/pages/env/config/undefined.js +0 -1
  25. package/src/pages/env/env.d.ts +0 -4
  26. package/src/pages/env/index.ts +0 -1
  27. package/src/pages/history/createHistory.ts +0 -94
  28. package/src/pages/history/history.utils.ts +0 -64
  29. package/src/pages/index/App.tsx +0 -17
  30. package/src/pages/index/Demo/DemoLine.tsx +0 -23
  31. package/src/pages/index/Demo/DemoRow.scss +0 -131
  32. package/src/pages/index/Demo/DemoRow.tsx +0 -71
  33. package/src/pages/index/Demo/DemoRow.utils.ts +0 -23
  34. package/src/pages/index/Demo/DemoRowController.tsx +0 -45
  35. package/src/pages/index/Demo/index.ts +0 -8
  36. package/src/pages/index/app.scss +0 -197
  37. package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +0 -56
  38. package/src/pages/index/components/AutoTable/AutoHeightFixedRow.tsx +0 -50
  39. package/src/pages/index/components/AutoTable/AutoTableBasicUsage.tsx +0 -75
  40. package/src/pages/index/components/AutoTable/AutoTableCascade.tsx +0 -99
  41. package/src/pages/index/components/AutoTable/AutoTableDefaultSearch.tsx +0 -73
  42. package/src/pages/index/components/AutoTable/AutoTableFiles.tsx +0 -26
  43. package/src/pages/index/components/AutoTable/AutoTableFill.tsx +0 -51
  44. package/src/pages/index/components/AutoTable/AutoTableGroupUsage.tsx +0 -71
  45. package/src/pages/index/components/AutoTable/AutoTableObjectPicker.tsx +0 -181
  46. package/src/pages/index/components/AutoTable/AutoTableOvList.tsx +0 -80
  47. package/src/pages/index/components/AutoTable/AutoTableProductList.tsx +0 -98
  48. package/src/pages/index/components/AutoTable/AutoTableRowFormatter.tsx +0 -58
  49. package/src/pages/index/components/AutoTable/FixedHeightAutoRow.tsx +0 -50
  50. package/src/pages/index/components/AutoTable/FixedHeightFixedRow.tsx +0 -49
  51. package/src/pages/index/components/bus/DemoAddress.tsx +0 -181
  52. package/src/pages/index/components/bus/DemoAddressCascade.tsx +0 -132
  53. package/src/pages/index/components/bus/DemoFilter.tsx +0 -184
  54. package/src/pages/index/components/columns/DemoPlcAddress.tsx +0 -161
  55. package/src/pages/index/components/columns/DemoPlcDate.tsx +0 -363
  56. package/src/pages/index/components/columns/DemoPlcSelect.tsx +0 -505
  57. package/src/pages/index/components/columns/DemoPlcTime.tsx +0 -293
  58. package/src/pages/index/components/columns/DemoTableColumns.tsx +0 -88
  59. package/src/pages/index/components/form/DemoFormBasic.tsx +0 -516
  60. package/src/pages/index/components/form/DemoFormBlur.tsx +0 -204
  61. package/src/pages/index/components/form/DemoFormDynamicFields.tsx +0 -54
  62. package/src/pages/index/components/form/DemoFormEditControl.tsx +0 -164
  63. package/src/pages/index/components/form/DemoFormElement.tsx +0 -207
  64. package/src/pages/index/components/form/DemoFormLayout.scss +0 -7
  65. package/src/pages/index/components/form/DemoFormLayout.tsx +0 -311
  66. package/src/pages/index/components/form/DemoFormSimplify.tsx +0 -587
  67. package/src/pages/index/components/form/DemoFormSize.tsx +0 -274
  68. package/src/pages/index/components/form/DemoFormVertical.tsx +0 -280
  69. package/src/pages/index/components/normal/DemoAlert.tsx +0 -66
  70. package/src/pages/index/components/normal/DemoBadge.tsx +0 -53
  71. package/src/pages/index/components/normal/DemoButton.tsx +0 -300
  72. package/src/pages/index/components/normal/DemoCard.tsx +0 -176
  73. package/src/pages/index/components/normal/DemoCarousel.tsx +0 -230
  74. package/src/pages/index/components/normal/DemoCascade.tsx +0 -880
  75. package/src/pages/index/components/normal/DemoCheckbox.scss +0 -24
  76. package/src/pages/index/components/normal/DemoCheckbox.tsx +0 -294
  77. package/src/pages/index/components/normal/DemoCollapse.tsx +0 -104
  78. package/src/pages/index/components/normal/DemoColor.scss +0 -20
  79. package/src/pages/index/components/normal/DemoColor.tsx +0 -82
  80. package/src/pages/index/components/normal/DemoColorPicker.tsx +0 -163
  81. package/src/pages/index/components/normal/DemoDate.tsx +0 -443
  82. package/src/pages/index/components/normal/DemoDialog.tsx +0 -507
  83. package/src/pages/index/components/normal/DemoDropdown.tsx +0 -463
  84. package/src/pages/index/components/normal/DemoGrid.scss +0 -26
  85. package/src/pages/index/components/normal/DemoGrid.tsx +0 -181
  86. package/src/pages/index/components/normal/DemoIcon.tsx +0 -39
  87. package/src/pages/index/components/normal/DemoImage.tsx +0 -122
  88. package/src/pages/index/components/normal/DemoInput.scss +0 -0
  89. package/src/pages/index/components/normal/DemoInput.tsx +0 -790
  90. package/src/pages/index/components/normal/DemoKeepAlive.tsx +0 -505
  91. package/src/pages/index/components/normal/DemoLayout.tsx +0 -144
  92. package/src/pages/index/components/normal/DemoList.scss +0 -15
  93. package/src/pages/index/components/normal/DemoList.tsx +0 -82
  94. package/src/pages/index/components/normal/DemoLoading.tsx +0 -86
  95. package/src/pages/index/components/normal/DemoNumber.tsx +0 -269
  96. package/src/pages/index/components/normal/DemoPagination.tsx +0 -164
  97. package/src/pages/index/components/normal/DemoPopup.tsx +0 -695
  98. package/src/pages/index/components/normal/DemoProgress.tsx +0 -133
  99. package/src/pages/index/components/normal/DemoRadio.scss +0 -16
  100. package/src/pages/index/components/normal/DemoRadio.tsx +0 -188
  101. package/src/pages/index/components/normal/DemoRate.tsx +0 -77
  102. package/src/pages/index/components/normal/DemoScroll.scss +0 -22
  103. package/src/pages/index/components/normal/DemoScroll.tsx +0 -300
  104. package/src/pages/index/components/normal/DemoSegment.tsx +0 -71
  105. package/src/pages/index/components/normal/DemoSelect.tsx +0 -819
  106. package/src/pages/index/components/normal/DemoSlider.tsx +0 -128
  107. package/src/pages/index/components/normal/DemoSortList.tsx +0 -70
  108. package/src/pages/index/components/normal/DemoStackCard.tsx +0 -356
  109. package/src/pages/index/components/normal/DemoStep.scss +0 -18
  110. package/src/pages/index/components/normal/DemoStep.tsx +0 -291
  111. package/src/pages/index/components/normal/DemoTab.tsx +0 -338
  112. package/src/pages/index/components/normal/DemoTag.tsx +0 -100
  113. package/src/pages/index/components/normal/DemoTime.tsx +0 -403
  114. package/src/pages/index/components/normal/DemoToggle.tsx +0 -56
  115. package/src/pages/index/components/normal/DemoTooltip.tsx +0 -120
  116. package/src/pages/index/components/normal/DemoTree.tsx +0 -1183
  117. package/src/pages/index/components/normal/DemoUpload.tsx +0 -484
  118. package/src/pages/index/components/normal/DemoVirtualList.tsx +0 -464
  119. package/src/pages/index/components/service/DemoDialogService.tsx +0 -249
  120. package/src/pages/index/components/service/DemoFileService.tsx +0 -110
  121. package/src/pages/index/components/service/DemoImagePreviewer.tsx +0 -185
  122. package/src/pages/index/components/service/DemoMessageService.tsx +0 -100
  123. package/src/pages/index/components/service/DemoNoticeService.tsx +0 -99
  124. package/src/pages/index/components/service/DemoPopupService.tsx +0 -325
  125. package/src/pages/index/components/table/DemoPlcOperation.tsx +0 -307
  126. package/src/pages/index/components/table/DemoTableBasic.tsx +0 -220
  127. package/src/pages/index/components/table/DemoTableCheck.tsx +0 -78
  128. package/src/pages/index/components/table/DemoTableClassAndStyle.scss +0 -18
  129. package/src/pages/index/components/table/DemoTableClassAndStyle.tsx +0 -112
  130. package/src/pages/index/components/table/DemoTableColDraggable.tsx +0 -80
  131. package/src/pages/index/components/table/DemoTableEdit.tsx +0 -136
  132. package/src/pages/index/components/table/DemoTableExpand.tsx +0 -203
  133. package/src/pages/index/components/table/DemoTableFixed.tsx +0 -131
  134. package/src/pages/index/components/table/DemoTableFormatter.tsx +0 -66
  135. package/src/pages/index/components/table/DemoTableOverflowTooltip.tsx +0 -67
  136. package/src/pages/index/components/table/DemoTableRowDraggable.tsx +0 -106
  137. package/src/pages/index/components/table/DemoTableSlots.tsx +0 -153
  138. package/src/pages/index/components/table/DemoTableSpan.tsx +0 -167
  139. package/src/pages/index/components/table/DemoTableTree.tsx +0 -976
  140. package/src/pages/index/components/table/DemoVirtualTable.tsx +0 -274
  141. package/src/pages/index/components/test/DemoI18n.tsx +0 -27
  142. package/src/pages/index/components/test/DemoI18n2.jsx +0 -11
  143. package/src/pages/index/home/AppContent.tsx +0 -69
  144. package/src/pages/index/home/AppHead.tsx +0 -18
  145. package/src/pages/index/home/AppHome.tsx +0 -31
  146. package/src/pages/index/home/AppMenu.tsx +0 -38
  147. package/src/pages/index/home/menus.tsx +0 -220
  148. package/src/pages/index/home/plain-design.png +0 -0
  149. package/src/pages/index/main.tsx +0 -23
  150. package/src/pages/index/nav/$nav.ts +0 -41
  151. package/src/pages/index/pages.d.ts +0 -6
  152. package/src/pages/libs/iconfont-fontcls/demo.css +0 -539
  153. package/src/pages/libs/iconfont-fontcls/demo_index.html +0 -303
  154. package/src/pages/libs/iconfont-fontcls/iconfont.css +0 -35
  155. package/src/pages/libs/iconfont-fontcls/iconfont.js +0 -1
  156. package/src/pages/libs/iconfont-fontcls/iconfont.json +0 -44
  157. package/src/pages/libs/iconfont-fontcls/iconfont.ttf +0 -0
  158. package/src/pages/libs/iconfont-fontcls/iconfont.woff +0 -0
  159. package/src/pages/libs/iconfont-fontcls/iconfont.woff2 +0 -0
  160. package/src/pages/libs/iconfont-symbol/demo.css +0 -539
  161. package/src/pages/libs/iconfont-symbol/demo_index.html +0 -303
  162. package/src/pages/libs/iconfont-symbol/iconfont.css +0 -35
  163. package/src/pages/libs/iconfont-symbol/iconfont.js +0 -1
  164. package/src/pages/libs/iconfont-symbol/iconfont.json +0 -44
  165. package/src/pages/libs/iconfont-symbol/iconfont.ttf +0 -0
  166. package/src/pages/libs/iconfont-symbol/iconfont.woff +0 -0
  167. package/src/pages/libs/iconfont-symbol/iconfont.woff2 +0 -0
  168. package/src/pages/libs/install.iconfont-fontcls.tsx +0 -11
  169. package/src/pages/libs/install.iconfont-symbol.scss +0 -7
  170. package/src/pages/libs/install.iconfont-symbol.tsx +0 -14
  171. package/src/pages/module/address.ts +0 -27
  172. package/src/pages/module/http.ts +0 -24
  173. package/src/pages/module/index.ts +0 -19
  174. package/src/pages/module/object.ts +0 -5
  175. package/src/pages/module/ov.tsx +0 -13
  176. package/src/pages/module/upload.ts +0 -9
  177. package/src/pages/module/useTableOption.ts +0 -28
@@ -1,505 +0,0 @@
1
- import {computed, designPage, reactive} from "plain-design-composition";
2
- import {DemoRow} from "../../Demo/DemoRow";
3
- import {$message, Button, ButtonGroup, CarouselItem, Carousel, Checkbox, CheckboxGroup, Collapse, CollapseGroup, Input, KeepAlive, Segment, SegmentGroup, Tag} from "../../../../packages";
4
- import React, {useState} from "react";
5
- import {iKeepAliveMeta} from "../../../../packages/components/KeepAlive/utils/keepalive.utils";
6
- import {delay} from "plain-utils/utils/delay";
7
-
8
- export const demo1 = designPage(() => {
9
-
10
- const DemoInput = () => {
11
- const [text, setText] = useState("hello world");
12
- return <Input modelValue={text} onChange={setText}/>;
13
- };
14
-
15
- const publicItemStyles = {
16
- color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '28px'
17
- };
18
- const DemoCarousel = () => {
19
- return (
20
- <Carousel autoPlay={0}>
21
- <CarouselItem style={{ backgroundColor: '#8A2BE2', ...publicItemStyles }}>panel1</CarouselItem>
22
- <CarouselItem style={{ backgroundColor: '#409EFF', ...publicItemStyles }}>panel2</CarouselItem>
23
- <CarouselItem style={{ backgroundColor: '#F38585', ...publicItemStyles }}>panel3</CarouselItem>
24
- <CarouselItem style={{ backgroundColor: '#455a64', ...publicItemStyles }}>panel4</CarouselItem>
25
- </Carousel>
26
- );
27
- };
28
-
29
- const DemoCollapse = () => {
30
- return (
31
- <CollapseGroup>
32
- <Collapse title={'专家方向'}>
33
- <p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
34
- <p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
35
- <p>走专家路线可能是大多数技术人的选择;</p>
36
- </Collapse>
37
- <Collapse title={'管理方向'}>
38
- <p>另一个职业方向就是技术管理;</p>
39
- <p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
40
- <p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
41
- <p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
42
- </Collapse>
43
- <Collapse title={'产品&业务方向'}>
44
- <p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
45
- <p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
46
- <p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
47
- </Collapse>
48
- </CollapseGroup>
49
- );
50
- };
51
-
52
-
53
- const types = ['input', 'carousel', 'collapse'] as const;
54
-
55
- const state = reactive({ type: types[0] });
56
-
57
- return () => (
58
- <DemoRow title="基本用法">
59
-
60
- <SegmentGroup v-model={state.type}>
61
- {types.map(i => (
62
- <Segment label={i} key={i} val={i}/>
63
- ))}
64
- </SegmentGroup>
65
-
66
- <div style={{ marginTop: '16px' }}>
67
- <KeepAlive>
68
- {{
69
- input: () => (<DemoInput/>),
70
- carousel: () => (<DemoCarousel/>),
71
- collapse: () => (<DemoCollapse/>),
72
- }[state.type]()}
73
- </KeepAlive>
74
- </div>
75
- </DemoRow>
76
- );
77
- });
78
-
79
- export const demo2 = designPage(() => {
80
-
81
- const types = ['input', 'textarea', 'multiInput', 'text', 'multiText'] as const;
82
-
83
- const state = reactive({
84
- type: types[0]
85
- });
86
-
87
- const multiInputValue = ['王五', '赵六'];
88
-
89
- return () => (
90
- <DemoRow title="渲染纯文本">
91
-
92
- <SegmentGroup v-model={state.type}>
93
- {types.map(i => (
94
- <Segment label={i} key={i} val={i}/>
95
- ))}
96
- </SegmentGroup>
97
-
98
- <div style={{ marginTop: '16px' }}>
99
- <KeepAlive>
100
- {{
101
- input: () => (
102
- <Input key="input" modelValue="张三"/>
103
- ),
104
- textarea: () => (
105
- <Input textarea key="textarea" modelValue="李四"/>
106
- ),
107
- multiInput: () => (
108
- <Input multiple key="multiInput" modelValue={multiInputValue}/>
109
- ),
110
- text: () => (
111
- "hello world text"
112
- ),
113
- multiText: () => (
114
- <React.Fragment key="multiText">
115
- <span>hello</span>
116
- <span>world</span>
117
- <span>multiple text</span>
118
- </React.Fragment>
119
- ),
120
- }[state.type]()}
121
- </KeepAlive>
122
- </div>
123
- </DemoRow>
124
- );
125
- });
126
-
127
- export const demo3 = designPage(() => {
128
-
129
- const DemoInput: React.FC<{ prefix: string }> = (props) => {
130
- const [text, setText] = useState("hello world");
131
- return <Input modelValue={text} onChange={setText} prefix={<span>{props.prefix}</span>}/>;
132
- };
133
-
134
- const publicItemStyles = {
135
- color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '28px'
136
- };
137
- const DemoCarousel: React.FC<{ coverText: string }> = (props) => {
138
- return (
139
- <Carousel autoPlay={0} cover={
140
- <div style={{ textAlign: 'center', color: 'white', padding: '16px' }}>
141
- {props.coverText}
142
- </div>
143
- }>
144
- <CarouselItem style={{ backgroundColor: '#8A2BE2', ...publicItemStyles }}>panel1</CarouselItem>
145
- <CarouselItem style={{ backgroundColor: '#409EFF', ...publicItemStyles }}>panel2</CarouselItem>
146
- <CarouselItem style={{ backgroundColor: '#F38585', ...publicItemStyles }}>panel3</CarouselItem>
147
- <CarouselItem style={{ backgroundColor: '#455a64', ...publicItemStyles }}>panel4</CarouselItem>
148
- </Carousel>
149
- );
150
- };
151
-
152
- const DemoCollapse = () => {
153
- return (
154
- <CollapseGroup>
155
- <Collapse title={'专家方向'}>
156
- <p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
157
- <p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
158
- <p>走专家路线可能是大多数技术人的选择;</p>
159
- </Collapse>
160
- <Collapse title={'管理方向'}>
161
- <p>另一个职业方向就是技术管理;</p>
162
- <p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
163
- <p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
164
- <p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
165
- </Collapse>
166
- <Collapse title={'产品&业务方向'}>
167
- <p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
168
- <p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
169
- <p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
170
- </Collapse>
171
- </CollapseGroup>
172
- );
173
- };
174
-
175
-
176
- const types = ['input', 'carousel', 'collapse'] as const;
177
-
178
- const state = reactive({
179
- type: types[0],
180
- publicText: '支付方式'
181
- });
182
-
183
- return () => (
184
- <DemoRow title="变化属性">
185
-
186
- <Input v-model={state.publicText}/>
187
-
188
- <SegmentGroup v-model={state.type} style={{ marginTop: '16px' }}>
189
- {types.map(i => (
190
- <Segment label={i} key={i} val={i}/>
191
- ))}
192
- </SegmentGroup>
193
-
194
- <div style={{ marginTop: '16px' }}>
195
- <KeepAlive>
196
- {{
197
- input: () => (<DemoInput prefix={state.publicText}/>),
198
- carousel: () => (<DemoCarousel coverText={state.publicText}/>),
199
- collapse: () => (<DemoCollapse/>),
200
- }[state.type]()}
201
- </KeepAlive>
202
- </div>
203
- </DemoRow>
204
- );
205
- });
206
-
207
- export const demo4 = designPage(() => {
208
-
209
- const types = ['input', 'textarea', 'multiInput', 'text', 'multiText'] as const;
210
-
211
- const state = reactive({
212
- type: types[0]
213
- });
214
-
215
- const multiInputValue = ['王五', '赵六'];
216
-
217
- return () => (
218
- <DemoRow title="组件有多个节点">
219
-
220
- <SegmentGroup v-model={state.type}>
221
- {types.map(i => (
222
- <Segment label={i} key={i} val={i}/>
223
- ))}
224
- </SegmentGroup>
225
-
226
- <div style={{ marginTop: '16px' }}>
227
- <KeepAlive>
228
- {{
229
- input: () => (
230
- <React.Fragment key="input">
231
- <Input modelValue="张三1"/>
232
- <Input modelValue="张三2"/>
233
- </React.Fragment>
234
- ),
235
- textarea: () => (
236
- <React.Fragment key="textarea">
237
- <Input textarea modelValue="李四1"/>
238
- <Input textarea modelValue="李四2"/>
239
- </React.Fragment>
240
- ),
241
- multiInput: () => (
242
- <React.Fragment key="multiInput">
243
- <Input multiple modelValue={multiInputValue}/>
244
- <Input multiple modelValue={multiInputValue}/>
245
- </React.Fragment>
246
- ),
247
- text: () => (
248
- "hello world text"
249
- ),
250
- multiText: () => (
251
- <>
252
- <span>hello</span>
253
- <span>world</span>
254
- <span>multiple text</span>
255
- </>
256
- ),
257
- }[state.type]()}
258
- </KeepAlive>
259
- </div>
260
- </DemoRow>
261
- );
262
- });
263
-
264
- export const demo5 = designPage(() => {
265
-
266
- const DemoInput: React.FC<{ prefix: string }> = (props) => {
267
- const [text, setText] = useState("hello world");
268
- return <Input modelValue={text} onChange={setText} prefix={<span>{props.prefix}</span>}/>;
269
- };
270
-
271
- const publicItemStyles = {
272
- color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '28px'
273
- };
274
- const DemoCarousel: React.FC<{ coverText: string }> = (props) => {
275
- return (
276
- <Carousel autoPlay={0} cover={
277
- <div style={{ textAlign: 'center', color: 'white', padding: '16px' }}>
278
- {props.coverText}
279
- </div>
280
- }>
281
- <CarouselItem style={{ backgroundColor: '#8A2BE2', ...publicItemStyles }}>panel1</CarouselItem>
282
- <CarouselItem style={{ backgroundColor: '#409EFF', ...publicItemStyles }}>panel2</CarouselItem>
283
- <CarouselItem style={{ backgroundColor: '#F38585', ...publicItemStyles }}>panel3</CarouselItem>
284
- <CarouselItem style={{ backgroundColor: '#455a64', ...publicItemStyles }}>panel4</CarouselItem>
285
- </Carousel>
286
- );
287
- };
288
-
289
- const DemoCollapse = () => {
290
- return (
291
- <CollapseGroup>
292
- <Collapse title={'专家方向'}>
293
- <p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
294
- <p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
295
- <p>走专家路线可能是大多数技术人的选择;</p>
296
- </Collapse>
297
- <Collapse title={'管理方向'}>
298
- <p>另一个职业方向就是技术管理;</p>
299
- <p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
300
- <p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
301
- <p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
302
- </Collapse>
303
- <Collapse title={'产品&业务方向'}>
304
- <p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
305
- <p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
306
- <p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
307
- </Collapse>
308
- </CollapseGroup>
309
- );
310
- };
311
-
312
- const componentNames = ['input', 'carousel', 'collapse'] as const;
313
-
314
- const state = reactive({
315
- publicText: '支付方式',
316
- components: {
317
- input: {
318
- count: 0,
319
- key: () => `input_${state.components.input.count}`,
320
- render: () => (<DemoInput key={state.components.input.key()} prefix={state.publicText}/>),
321
- },
322
- carousel: {
323
- count: 0,
324
- key: () => `carousel_${state.components.carousel.count}`,
325
- render: () => (<DemoCarousel key={state.components.carousel.key()} coverText={state.publicText}/>),
326
- },
327
- collapse: {
328
- count: 0,
329
- key: () => `collapse_${state.components.collapse.count}`,
330
- render: () => (<DemoCollapse key={state.components.collapse.key()}/>),
331
- }
332
- },
333
- showComponent: componentNames[0],
334
- cacheComponents: [...componentNames],
335
- cacheKeys: computed((): string[] => {
336
- return state.cacheComponents.map((i) => state.components[i].key());
337
- }),
338
- isCache: (meta: iKeepAliveMeta): boolean => !!state.cacheKeys.find((i) => i === meta.key),
339
- });
340
-
341
- const handleCacheChange = () => {
342
- /*令KeepAlive render*/
343
- state.isCache = (meta: iKeepAliveMeta) => !!state.cacheKeys.find(i => i === meta.key);
344
- };
345
-
346
- const handleRefresh = (componentName: typeof componentNames[number]) => {
347
- state.components[componentName].count++;
348
- };
349
-
350
- return () => (
351
- <DemoRow title="部分内容不缓存,部分内容缓存,缓存的内容手动控制重新渲染">
352
-
353
- <Input v-model={state.publicText}/>
354
-
355
- <div>
356
- <SegmentGroup v-model={state.showComponent} style={{ marginTop: '16px' }}>
357
- {componentNames.map(i => (
358
- <Segment label={i} key={i} val={i}/>
359
- ))}
360
- </SegmentGroup>
361
-
362
- <div style={{ marginTop: '16px', marginLeft: '8px', display: 'inline-block' }}>
363
- <CheckboxGroup v-model={state.cacheComponents} onChange={handleCacheChange}>
364
- <ButtonGroup status="secondary">
365
- {componentNames.map(i => (
366
- <Button key={i}>
367
- <Checkbox status="primary" val={i} label={`缓存${i}`}/>
368
- </Button>
369
- ))}
370
- </ButtonGroup>
371
- </CheckboxGroup>
372
- </div>
373
-
374
- <div style={{ marginTop: '16px', marginLeft: '8px', display: 'inline-block' }}>
375
- <ButtonGroup status="secondary">
376
- {componentNames.map(i => (
377
- <Button key={i} onClick={() => handleRefresh(i)}>刷新{i}</Button>
378
- ))}
379
- </ButtonGroup>
380
- </div>
381
- </div>
382
-
383
- <div style={{ marginTop: '16px' }}>
384
- <KeepAlive
385
- isCache={state.isCache}
386
- >
387
- {state.components[state.showComponent].render()}
388
- </KeepAlive>
389
- </div>
390
- </DemoRow>
391
- );
392
- });
393
-
394
-
395
- export const demo6 = designPage(() => {
396
-
397
- const DemoInput: React.FC<{ prefix: string }> = (props) => {
398
- const [text, setText] = useState("hello world");
399
- return <Input modelValue={text} onChange={setText} prefix={<span>{props.prefix}</span>}/>;
400
- };
401
-
402
- const publicItemStyles = {
403
- color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '28px'
404
- };
405
- const DemoCarousel: React.FC<{ coverText: string }> = (props) => {
406
- return (
407
- <Carousel autoPlay={0} cover={
408
- <div style={{ textAlign: 'center', color: 'white', padding: '16px' }}>
409
- {props.coverText}
410
- </div>
411
- }>
412
- <CarouselItem style={{ backgroundColor: '#8A2BE2', ...publicItemStyles }}>panel1</CarouselItem>
413
- <CarouselItem style={{ backgroundColor: '#409EFF', ...publicItemStyles }}>panel2</CarouselItem>
414
- <CarouselItem style={{ backgroundColor: '#F38585', ...publicItemStyles }}>panel3</CarouselItem>
415
- <CarouselItem style={{ backgroundColor: '#455a64', ...publicItemStyles }}>panel4</CarouselItem>
416
- </Carousel>
417
- );
418
- };
419
-
420
- const DemoCollapse = () => {
421
- return (
422
- <CollapseGroup>
423
- <Collapse title={'专家方向'}>
424
- <p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
425
- <p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
426
- <p>走专家路线可能是大多数技术人的选择;</p>
427
- </Collapse>
428
- <Collapse title={'管理方向'}>
429
- <p>另一个职业方向就是技术管理;</p>
430
- <p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
431
- <p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
432
- <p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
433
- </Collapse>
434
- <Collapse title={'产品&业务方向'}>
435
- <p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
436
- <p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
437
- <p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
438
- </Collapse>
439
- </CollapseGroup>
440
- );
441
- };
442
-
443
- const types = ['input', 'carousel', 'collapse'] as const;
444
-
445
- const state = reactive({
446
- type: types[0],
447
- publicText: '支付方式',
448
- initList: [] as string[],
449
- destroyList: [] as string[],
450
-
451
- isCache: (meta: iKeepAliveMeta) => true as boolean,
452
- });
453
-
454
- const onInit = (meta: iKeepAliveMeta) => state.initList.push(meta.key);
455
-
456
- const clearCache = (key: string) => {
457
- if (key === state.type) {
458
- $message('不要销毁正在显示的内容');
459
- return;
460
- }
461
- state.destroyList.push(key);
462
- /*修改isCache,触发KeepAlive更新渲染*/
463
- state.isCache = (meta: iKeepAliveMeta) => state.destroyList.indexOf(meta.key) === -1;
464
-
465
- delay().then(() => {
466
- /*渲染完毕之后KeepAlive已经销毁掉对应的key,此时重置destroyList,并且将initList中已经缓存的key移除,下次这个key重新初始化的时候再添加*/
467
- state.destroyList = state.destroyList.filter(i => i !== key);
468
- state.initList = state.initList.filter(i => i !== key);
469
- });
470
- };
471
-
472
- return () => (
473
- <DemoRow title="动态控制缓存以及销毁">
474
-
475
- <Input v-model={state.publicText}/>
476
-
477
- <div>
478
- <SegmentGroup v-model={state.type} style={{ marginTop: '16px' }}>
479
- {types.map(i => (
480
- <Segment label={i} key={i} val={i}/>
481
- ))}
482
- </SegmentGroup>
483
-
484
- <div style={{ marginTop: '16px', display: 'inline-block' }}>
485
- {state.initList.map(i => (<Tag key={i} label={`销毁${i}`} closeable onClose={() => clearCache(i)}/>))}
486
- </div>
487
- </div>
488
-
489
- <div style={{ marginTop: '16px' }}>
490
- <KeepAlive
491
- onInit={onInit}
492
- isCache={state.isCache}
493
- onBeforeUnmount={() => {state.initList = [];}}
494
- >
495
- {{
496
- input: () => (<DemoInput key="input" prefix={state.publicText}/>),
497
- carousel: () => (<DemoCarousel key="carousel" coverText={state.publicText}/>),
498
- collapse: () => (<DemoCollapse key="collapse"/>),
499
- }[state.type]()}
500
- </KeepAlive>
501
- </div>
502
- </DemoRow>
503
- );
504
- });
505
-
@@ -1,144 +0,0 @@
1
- import {designPage} from "plain-design-composition";
2
- import {DemoRow} from "../../Demo/DemoRow";
3
- import {Layout, LayoutSection} from "../../../../packages";
4
-
5
- export const demo1 = designPage(() => {
6
- return () => (
7
- <DemoRow title="基本用法">
8
- <Layout>
9
- <LayoutSection position="left">
10
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
11
- <div>左侧调节区域</div>
12
- <div>(初始化时自动宽度)</div>
13
- </div>
14
- </LayoutSection>
15
- <LayoutSection>
16
- <div style={{ height: '200px', padding: '16px', backgroundColor: 'var(--custom-gray-1)' }}>
17
- 主内容区域
18
- </div>
19
- </LayoutSection>
20
- <LayoutSection position="right" modelValue={80}>
21
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
22
- <div>右侧调节区域</div>
23
- <div>(初始化固定80px)</div>
24
- </div>
25
- </LayoutSection>
26
- </Layout>
27
- </DemoRow>
28
- );
29
- });
30
-
31
-
32
- export const demo2 = designPage(() => {
33
- return () => (
34
- <DemoRow title="纵向">
35
- <Layout vertical style={{ height: '500px' }}>
36
- <LayoutSection position="top">
37
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
38
- <div>上方调节区域</div>
39
- <div>(初始化时自动高度)</div>
40
- </div>
41
- </LayoutSection>
42
- <LayoutSection>
43
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-1)' }}>
44
- 主内容区域
45
- </div>
46
- </LayoutSection>
47
- <LayoutSection position="bottom" modelValue={80}>
48
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
49
- <div>下方调节区域</div>
50
- <div>(初始化固定80px)</div>
51
- </div>
52
- </LayoutSection>
53
- </Layout>
54
- </DemoRow>
55
- );
56
- });
57
-
58
-
59
- export const demo3 = designPage(() => {
60
- return () => (
61
- <DemoRow title="嵌套布局">
62
- <Layout vertical style={{ height: '500px' }}>
63
- <LayoutSection position="top">
64
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
65
- <div>上方调节区域</div>
66
- <div>(初始化时自动高度)</div>
67
- </div>
68
- </LayoutSection>
69
- <LayoutSection>
70
- <div style={{ position: 'absolute', inset: '0' }}>
71
- <Layout style={{ height: '100%' }}>
72
- <LayoutSection position="left">
73
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
74
- <div>左侧调节区域</div>
75
- <div>(初始化时自动宽度)</div>
76
- </div>
77
- </LayoutSection>
78
- <LayoutSection>
79
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-1)' }}>
80
- 主内容区域
81
- </div>
82
- </LayoutSection>
83
- <LayoutSection position="right" modelValue={80}>
84
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
85
- <div>右侧调节区域</div>
86
- <div>(初始化固定80px)</div>
87
- </div>
88
- </LayoutSection>
89
- </Layout>
90
- </div>
91
- </LayoutSection>
92
- <LayoutSection position="bottom" modelValue={80}>
93
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
94
- <div>下方调节区域</div>
95
- <div>(初始化固定80px)</div>
96
- </div>
97
- </LayoutSection>
98
- </Layout>
99
- </DemoRow>
100
- );
101
- });
102
-
103
-
104
- export const demo4 = designPage(() => {
105
- return () => (
106
- <DemoRow title="嵌套布局2">
107
- <Layout>
108
- <LayoutSection position="left">
109
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
110
- <div>左侧调节区域</div>
111
- <div>(初始化时自动宽度)</div>
112
- </div>
113
- </LayoutSection>
114
- <LayoutSection>
115
- <Layout vertical style={{ height: '500px' }}>
116
- <LayoutSection position="top">
117
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
118
- <div>上方调节区域</div>
119
- <div>(初始化时自动高度)</div>
120
- </div>
121
- </LayoutSection>
122
- <LayoutSection>
123
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-1)' }}>
124
- 主内容区域
125
- </div>
126
- </LayoutSection>
127
- <LayoutSection position="bottom" modelValue={80}>
128
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
129
- <div>下方调节区域</div>
130
- <div>(初始化固定80px)</div>
131
- </div>
132
- </LayoutSection>
133
- </Layout>
134
- </LayoutSection>
135
- <LayoutSection position="right" modelValue={80}>
136
- <div style={{ padding: '16px', backgroundColor: 'var(--custom-gray-2)', height: '100%' }}>
137
- <div>右侧调节区域</div>
138
- <div>(初始化固定80px)</div>
139
- </div>
140
- </LayoutSection>
141
- </Layout>
142
- </DemoRow>
143
- );
144
- });
@@ -1,15 +0,0 @@
1
- .demo-list {
2
- .test-item {
3
- position: relative;
4
- height: 120px;
5
- width: 200px;
6
- margin-bottom: 12px;
7
- margin-right: 12px;
8
- border-radius: plv(border-radius);
9
- border: solid 1px plv(border-color);
10
- padding: 12px;
11
- color: plv(text-1);
12
- background-color: plv(background-lite);
13
- display: inline-block !important;
14
- }
15
- }