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,274 +0,0 @@
1
- import {designPage, reactive} from "plain-design-composition";
2
- import SourceData from '../../../data/data-2.json';
3
- import {DemoRow} from "../../Demo/DemoRow";
4
- import {Form, FormItem, Plc, Table, Toggle, VirtualTable} from "../../../../packages";
5
-
6
- export const demo1 = designPage(() => {
7
-
8
- const state = reactive({
9
- state: {
10
- hasSummaryData: true,
11
- disabled: false,
12
- } as any
13
- }).state;
14
-
15
- const DATA = SourceData.slice(0, SourceData.length - 2);
16
- const summaryData = SourceData.slice(SourceData.length - 2);
17
-
18
- const headData = [
19
- [
20
- { title: '编号', field: 'id' },
21
- { title: '颜色', field: 'color' },
22
- { title: '名称', field: 'name' },
23
- { title: '日期', field: 'date' },
24
- { title: '评分', field: 'star' },
25
- { title: '尺寸', field: 'size' },
26
- { title: '地址', field: 'addr' },
27
- { title: '链接', field: 'url' },
28
- { title: '域名', field: 'domain' },
29
- { title: '协议', field: 'protocol' },
30
- { title: '邮箱', field: 'email' },
31
- { title: 'IP', field: 'ip' },
32
- { title: '开关', field: 'flag' },
33
- ]
34
- ];
35
-
36
- return () => (
37
- <>
38
- <DemoRow title="设置">
39
- <Form>
40
- <FormItem label={'禁用虚拟滚动'}>
41
- <Toggle v-model={state.disabled}/>
42
- </FormItem>
43
- <FormItem label={'合计行'}>
44
- <Toggle v-model={state.hasSummaryData}/>
45
- </FormItem>
46
- </Form>
47
- </DemoRow>
48
- <DemoRow title={'基本用法'}>
49
- <div style={{
50
- overflow: 'hidden',
51
- height: '410px',
52
- }}>
53
- <VirtualTable
54
- height={412}
55
- data={DATA}
56
- summaryData={state.hasSummaryData ? summaryData : undefined}
57
- headData={headData}
58
- size={40}
59
- headSize={40}
60
- width={3000}
61
- disabled={state.disabled}
62
- v-slots={{
63
- head: () => (
64
- headData.map((headRows, index) => (
65
- <tr style={{ height: '40px', borderBottom: 'solid 1px #ececec', }} key={index}>
66
- {headRows.map(col => (
67
- <td key={col.field}>{col.title}</td>
68
- ))}
69
- </tr>
70
- ))
71
- ),
72
- default: ({ item, vid, vIndex }) => (
73
- <tr key={vIndex} data-vid={vid} style={{ height: '40px', borderBottom: 'solid 1px #ececec', backgroundColor: "item.color" }}>
74
- {Object.keys(DATA[0] as any).map((key: string) => (
75
- <td key={key}>{(item as any)[key]}</td>
76
- ))}
77
- </tr>
78
- ),
79
- }}
80
- />
81
- </div>
82
-
83
- <div style={{
84
- overflow: 'hidden',
85
- height: '410px',
86
- marginTop: '100px'
87
- }}>
88
- <VirtualTable
89
- height={412}
90
- data={DATA.slice(0, 200)}
91
- summaryData={state.hasSummaryData ? summaryData : undefined}
92
- headData={headData}
93
- size={40}
94
- headSize={40}
95
- width={3000}
96
- disabled={true}
97
- v-slots={{
98
- head: () => (
99
- headData.map((headRows, index) => (
100
- <tr style={{ height: '40px', borderBottom: 'solid 1px #ececec', }} key={index}>
101
- {headRows.map(col => (
102
- <td key={col.field}>{col.title}</td>
103
- ))}
104
- </tr>
105
- ))
106
- ),
107
- default: ({ item, vIndex, vid }) => (
108
- <tr key={vIndex} data-vid={vid} style={{ height: '40px', borderBottom: 'solid 1px #ececec', backgroundColor: "item.color" }}>
109
- {Object.keys(DATA[0] as any).map((key: string) => (
110
- <td key={key}>{(item as any)[key]}</td>
111
- ))}
112
- </tr>
113
- ),
114
- }}
115
- />
116
- </div>
117
- </DemoRow>
118
- </>
119
- );
120
- });
121
-
122
- export const demo2 = designPage(() => {
123
-
124
- const state = reactive({
125
- virtualRowFlag: true,
126
- });
127
-
128
- const DATA = SourceData.slice(0, SourceData.length - 2);
129
- const summaryData = SourceData.slice(SourceData.length - 2);
130
-
131
- return () => (
132
- <DemoRow title="行虚拟滚动">
133
- <Form>
134
- <FormItem label="开启行虚拟滚动"><Toggle v-model={state.virtualRowFlag}/></FormItem>
135
- </Form>
136
- <Table
137
- data={DATA}
138
- summaryData={summaryData}
139
- virtual={state.virtualRowFlag}
140
- showRows={10}
141
- >
142
- <Plc title={'编号'} field={'id'}/>
143
- <Plc title={'颜色'} field={'color'}/>
144
- <Plc title={'名称'} field={'name'}/>
145
- <Plc title={'日期'} field={'date'}/>
146
- <Plc title={'评分'} field={'star'}/>
147
- <Plc title={'尺寸'} field={'size'}/>
148
- <Plc title={'地址'} field={'addr'}/>
149
- <Plc title={'URL'} field={'url'}/>
150
- <Plc title={'域名'} field={'domain'}/>
151
- <Plc title={'协议'} field={'protocol'}/>
152
- <Plc title={'邮箱'} field={'email'}/>
153
- <Plc title={'IP'} field={'ip'}/>
154
- <Plc title={'标识'} field={'flag'}/>
155
- <Plc title={'开始时间'} field={'dateStart'}/>
156
- <Plc title={'结束时间'} field={'dateEnd'}/>
157
- </Table>
158
- </DemoRow>
159
- );
160
- });
161
-
162
-
163
- export const demo3 = designPage(() => {
164
-
165
- const state = reactive({
166
- virtualRowFlag: true,
167
- virtualColFlag: true,
168
- });
169
-
170
- const DATA = SourceData.slice(0, SourceData.length - 2);
171
- const summaryData = SourceData.slice(SourceData.length - 2);
172
-
173
- return () => (
174
- <DemoRow title="行列虚拟滚动">
175
- <Form>
176
- <FormItem label="开启行虚拟滚动"><Toggle v-model={state.virtualRowFlag}/></FormItem>
177
- <FormItem label="开启列虚拟滚动"><Toggle v-model={state.virtualColFlag}/></FormItem>
178
- </Form>
179
- <Table
180
- data={DATA}
181
- summaryData={summaryData}
182
- virtual={state.virtualRowFlag}
183
- virtualColumn={state.virtualColFlag}
184
- showRows={10}
185
- >
186
- <Plc title={'编号'} field={'id'}/>
187
- <Plc title={'颜色'} field={'color'}/>
188
- <Plc title={'名称'} field={'name'}/>
189
- <Plc title={'日期'} field={'date'}/>
190
- <Plc title={'评分'} field={'star'}/>
191
- <Plc title={'尺寸'} field={'size'}/>
192
- <Plc title={'地址'} field={'addr'}/>
193
- <Plc title={'URL'} field={'url'}/>
194
- <Plc title={'域名'} field={'domain'}/>
195
- <Plc title={'协议'} field={'protocol'}/>
196
- <Plc title={'邮箱'} field={'email'}/>
197
- <Plc title={'IP'} field={'ip'}/>
198
- <Plc title={'标识'} field={'flag'}/>
199
- <Plc title={'开始时间'} field={'dateStart'}/>
200
- <Plc title={'结束时间'} field={'dateEnd'}/>
201
- <Plc title={'编号'} field={'id'}/>
202
- <Plc title={'颜色'} field={'color'}/>
203
- <Plc title={'名称'} field={'name'}/>
204
- <Plc title={'日期'} field={'date'}/>
205
- <Plc title={'评分'} field={'star'}/>
206
- <Plc title={'尺寸'} field={'size'}/>
207
- <Plc title={'地址'} field={'addr'}/>
208
- <Plc title={'URL'} field={'url'}/>
209
- <Plc title={'域名'} field={'domain'}/>
210
- <Plc title={'协议'} field={'protocol'}/>
211
- <Plc title={'邮箱'} field={'email'}/>
212
- <Plc title={'IP'} field={'ip'}/>
213
- <Plc title={'标识'} field={'flag'}/>
214
- <Plc title={'开始时间'} field={'dateStart'}/>
215
- <Plc title={'结束时间'} field={'dateEnd'}/>
216
- <Plc title={'编号'} field={'id'}/>
217
- <Plc title={'颜色'} field={'color'}/>
218
- <Plc title={'名称'} field={'name'}/>
219
- <Plc title={'日期'} field={'date'}/>
220
- <Plc title={'评分'} field={'star'}/>
221
- <Plc title={'尺寸'} field={'size'}/>
222
- <Plc title={'地址'} field={'addr'}/>
223
- <Plc title={'URL'} field={'url'}/>
224
- <Plc title={'域名'} field={'domain'}/>
225
- <Plc title={'协议'} field={'protocol'}/>
226
- <Plc title={'邮箱'} field={'email'}/>
227
- <Plc title={'IP'} field={'ip'}/>
228
- <Plc title={'标识'} field={'flag'}/>
229
- <Plc title={'开始时间'} field={'dateStart'}/>
230
- <Plc title={'结束时间'} field={'dateEnd'}/>
231
- </Table>
232
- </DemoRow>
233
- );
234
- });
235
-
236
- export const demo4 = designPage(() => {
237
-
238
- const state = reactive({
239
- virtualRowFlag: true,
240
- });
241
-
242
- const DATA = SourceData.slice(0, 2);
243
- const summaryData = SourceData.slice(SourceData.length - 2);
244
-
245
- return () => (
246
- <DemoRow title="数据不够时有个最小高度">
247
- <Form>
248
- <FormItem label="开启行虚拟滚动"><Toggle v-model={state.virtualRowFlag}/></FormItem>
249
- </Form>
250
- <Table
251
- data={DATA}
252
- summaryData={summaryData}
253
- virtual={state.virtualRowFlag}
254
- showRows={10}
255
- >
256
- <Plc title={'编号'} field={'id'}/>
257
- <Plc title={'颜色'} field={'color'}/>
258
- <Plc title={'名称'} field={'name'}/>
259
- <Plc title={'日期'} field={'date'}/>
260
- <Plc title={'评分'} field={'star'}/>
261
- <Plc title={'尺寸'} field={'size'}/>
262
- <Plc title={'地址'} field={'addr'}/>
263
- <Plc title={'URL'} field={'url'}/>
264
- <Plc title={'域名'} field={'domain'}/>
265
- <Plc title={'协议'} field={'protocol'}/>
266
- <Plc title={'邮箱'} field={'email'}/>
267
- <Plc title={'IP'} field={'ip'}/>
268
- <Plc title={'标识'} field={'flag'}/>
269
- <Plc title={'开始时间'} field={'dateStart'}/>
270
- <Plc title={'结束时间'} field={'dateEnd'}/>
271
- </Table>
272
- </DemoRow>
273
- );
274
- });
@@ -1,27 +0,0 @@
1
- import {designPage} from "plain-design-composition";
2
- import {Button, i18n} from "../../../../packages";
3
- // @ts-ignore
4
- import {DemoI18n2} from './DemoI18n2';
5
- import {ZhCnLocale} from "../../../../packages/i18n/lang/zh-cn";
6
- import {EnUsLocale} from "../../../../packages/i18n/lang/en-us";
7
-
8
- export const demo1 = designPage(() => {
9
-
10
- const locales = [{ name: '中文', data: ZhCnLocale }, { name: 'English', data: EnUsLocale }];
11
-
12
- return () => (
13
- <div>
14
- <div>
15
- {locales.map((locale) => (
16
- <Button key={locale.name} label={locale.name} onClick={() => i18n.setLocale(locale.data)}/>
17
- ))}
18
- </div>
19
- <div>
20
- {i18n("base.select.reverse").d()}
21
- </div>
22
- <div>
23
- <DemoI18n2/>
24
- </div>
25
- </div>
26
- );
27
- });
@@ -1,11 +0,0 @@
1
- import {designPage} from "plain-design-composition";
2
- import {i18n} from "@/packages";
3
- import React from "react";
4
-
5
- export const DemoI18n2 = designPage(() => {
6
- return () => (
7
- <div>
8
- {i18n('base.confirm.select.data').d('description默认文本')}
9
- </div>
10
- );
11
- });
@@ -1,69 +0,0 @@
1
- import {designPage, Fragment, nextTick, onMounted, reactive, RendererNode, watch} from "plain-design-composition";
2
- import {$nav} from "../nav/$nav";
3
- import {Illustration} from "../../../packages";
4
- import {Menu, MenuGroups} from "./menus";
5
-
6
- export const AppContent = designPage(() => {
7
-
8
- const isReady = (() => {
9
- const flag = reactive({ value: false });
10
- onMounted(() => {
11
- setTimeout(() => flag.value = true, 1000);
12
- });
13
- return flag;
14
- })();
15
-
16
- const state = reactive({
17
- current: null as null | { render: () => RendererNode, name: string, title?: string, menu: Menu }
18
- });
19
-
20
- watch(() => $nav.state.route, async route => {
21
- const { path } = route;
22
- const menu = MenuGroups.map(i => i.children).flat(1).find(i => i.page === path);
23
- if (!menu) {
24
- state.current = null;
25
- nextTick().then(() => $nav.setScrollTop(0));
26
- return;
27
- }
28
- try {
29
- const Module = await import('../components' + menu.page);
30
- state.current = {
31
- menu,
32
- render: () => <>
33
- {Object.values(Module).map((Component, index) => (
34
- <Fragment key={index}>
35
- {/*@ts-ignore*/}
36
- <Component/>
37
- </Fragment>
38
- ))}
39
- </>,
40
- name: menu.name,
41
- title: menu.title,
42
- };
43
- nextTick().then(() => $nav.setScrollTop(0));
44
- } catch (e) {
45
- state.current = null;
46
- nextTick().then(() => $nav.setScrollTop(0));
47
- }
48
- }, { immediate: true });
49
-
50
- return () => (
51
- <div className="app-content">
52
- {!state.current ? (
53
- !!isReady.value && <div style={{ display: 'flex', alignItems: 'center', flexDirection: 'column' }}>
54
- <Illustration style={{ width: '33.33%' }} code="404"/>
55
- <span className="app-empty-text" style={{ fontWeight: 500, fontSize: '40px', fontFamily: 'fantasy', position: 'relative', top: '-60px' }}>404</span>
56
- </div>
57
- ) : (
58
- <>
59
- {!state.current.menu.noHeader && (
60
- <div style={{ fontSize: '30px', fontWeight: 500, color: 'var(--app-title-color)', marginBottom: '40px' }}>
61
- {state.current.name} {state.current.title}
62
- </div>
63
- )}
64
- {state.current.render()}
65
- </>
66
- )}
67
- </div>
68
- );
69
- });
@@ -1,18 +0,0 @@
1
- import {designPage} from "plain-design-composition";
2
- import {PlainLogo} from 'plain-icons/src/packages/component/logo/react';
3
- import logoImage from './plain-design.png';
4
- import {ThemeEditor} from "../../../packages/components/ThemeEditor";
5
-
6
- export const AppHead = designPage(() => {
7
- return () => (
8
- <div className="app-head">
9
- <div className="app-head-logo">
10
- <PlainLogo style={{ fontSize: '28px', marginRight: '0.4em' }}/>
11
- <img src={logoImage}/>
12
- </div>
13
- <div className="app-head-operation">
14
- <ThemeEditor/>
15
- </div>
16
- </div>
17
- );
18
- });
@@ -1,31 +0,0 @@
1
- import {designPage, onBeforeUnmount, reactive} from "plain-design-composition";
2
- import {AppMenu} from "./AppMenu";
3
- import {AppHead} from "./AppHead";
4
- import {AppContent} from "./AppContent";
5
- import {clearDeviceInfo, eDeviceType, getDeviceInfo} from "../../../packages/utils/getDeviceInfo";
6
- import {addWindowListener} from "plain-utils/dom/addWindowListener";
7
- import {delay} from "plain-utils/utils/delay";
8
-
9
- export const AppHome = designPage(() => {
10
-
11
- const state = reactive({
12
- deviceType: getDeviceInfo().deviceType
13
- });
14
-
15
- onBeforeUnmount(
16
- addWindowListener('resize', async () => {
17
- clearDeviceInfo();
18
- state.deviceType = getDeviceInfo().deviceType;
19
- })
20
- );
21
-
22
- return () => (
23
- <div className="app-home">
24
- <AppHead/>
25
- <div className="app-body" style={{ paddingLeft: state.deviceType !== eDeviceType.desktop ? '0' : undefined }}>
26
- {state.deviceType === eDeviceType.desktop && <AppMenu/>}
27
- <AppContent/>
28
- </div>
29
- </div>
30
- );
31
- });
@@ -1,38 +0,0 @@
1
- import {designPage, onMounted, useRefs} from "plain-design-composition";
2
- import {MenuGroups} from "./menus";
3
- import {$nav} from "../nav/$nav";
4
- import {Icon, Scroll} from "../../../packages";
5
-
6
- export const AppMenu = designPage(() => {
7
-
8
- const { refs, onRef } = useRefs({ scroll: Scroll });
9
-
10
- onMounted(async () => {
11
- const activeEl = refs.scroll?.refs.content?.querySelector('[data-active=true]') as HTMLElement;
12
- !!activeEl && refs.scroll?.methods.scrollTop(activeEl.offsetTop - 100);
13
- });
14
-
15
- return () => (
16
- <div className="app-menu">
17
- <Scroll ref={onRef.scroll}>
18
- {MenuGroups.map((group, groupIndex) => (
19
- <div className="app-menu-group" key={groupIndex}>
20
- <div className="app-menu-group-name">{group.name}</div>
21
- {group.children.map((child, childIndex) => (
22
- <div className="app-menu-item" data-active={String(child.page === $nav.state.route.path)} key={childIndex} onClick={() => {
23
- $nav.history.push(child.page);
24
- }}>
25
- <div>
26
- <span>{child.name}</span>
27
- <span>{child.title}</span>
28
- </div>
29
- {!!child.complete && <Icon icon="pi-check"/>}
30
- </div>
31
- ))}
32
- </div>
33
- ))}
34
- <div style={{ height: '200px' }}/>
35
- </Scroll>
36
- </div>
37
- );
38
- });