plain-design 1.0.0-beta.4 → 1.0.0-beta.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (316) hide show
  1. package/dist/plain-design.commonjs.min.js +3 -3
  2. package/dist/plain-design.min.css +37 -29
  3. package/dist/plain-design.min.js +3 -3
  4. package/dist/report.html +5 -5
  5. package/package.json +9 -8
  6. package/src/packages/build.ts +2 -10
  7. package/src/packages/components/$object/createObjectService.tsx +31 -20
  8. package/src/packages/components/$object/object.service.utils.ts +7 -3
  9. package/src/packages/components/$previewer/ImagePreviewerFixedContainer.tsx +108 -0
  10. package/src/packages/components/$previewer/image-previewer-fixed-container.scss +18 -0
  11. package/src/packages/components/$previewer/index.tsx +52 -0
  12. package/src/packages/components/Alert/alert.scss +3 -3
  13. package/src/packages/components/Application/service/useApplicationService.tsx +2 -0
  14. package/src/packages/components/Application/theme/theme.ts +3 -3
  15. package/src/packages/components/ArrowStepGroup/arrow-step.scss +4 -4
  16. package/src/packages/components/AutoTable/filter/useTableOption.filter.form.tsx +1 -0
  17. package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +2 -0
  18. package/src/packages/components/AutoTable/use/useTableOption.state.tsx +1 -0
  19. package/src/packages/components/AutoTable/use/useTableOption.table.tsx +3 -3
  20. package/src/packages/components/AutoTable/utils/TableOption.space.tsx +4 -0
  21. package/src/packages/components/Badge/badge.scss +1 -1
  22. package/src/packages/components/Button/button.scss +2 -2
  23. package/src/packages/components/Card/card.scss +1 -1
  24. package/src/packages/components/Carousel/carousel.scss +391 -0
  25. package/src/packages/components/Carousel/index.tsx +569 -22
  26. package/src/packages/components/CarouselItem/index.tsx +77 -0
  27. package/src/packages/components/CascadePanel/list/CascadeListPanelItem.tsx +3 -3
  28. package/src/packages/components/CheckboxInner/checkbox-inner.scss +1 -1
  29. package/src/packages/components/ColorPicker/sub/ColorSlider.tsx +8 -5
  30. package/src/packages/components/ColorPicker/sub/ColorSvPanel.tsx +7 -4
  31. package/src/packages/components/DatePicker/date.scss +1 -1
  32. package/src/packages/components/Dialog/dialog.scss +1 -1
  33. package/src/packages/components/Dialog/index.tsx +4 -3
  34. package/src/packages/components/Dialog/useDialogMovable.tsx +7 -4
  35. package/src/packages/components/Dialog/utils/dialog.mouse.ts +4 -2
  36. package/src/packages/components/Dropdown/dropdown.public.scss +10 -0
  37. package/src/packages/components/Dropdown/dropdown.utils.tsx +3 -1
  38. package/src/packages/components/Dropdown/index.tsx +2 -2
  39. package/src/packages/components/DropdownOption/index.tsx +3 -3
  40. package/src/packages/components/DropdownSeparator/index.tsx +8 -0
  41. package/src/packages/components/FilterFormMultiple/index.tsx +31 -10
  42. package/src/packages/components/Image/image.scss +3 -3
  43. package/src/packages/components/ImagePreviewer/ImagePreviewer.tsx +574 -0
  44. package/src/packages/components/ImagePreviewer/ImagePreviewerButtonBar.tsx +140 -0
  45. package/src/packages/components/ImagePreviewer/ImagePreviewerCarouselImage.tsx +54 -0
  46. package/src/packages/components/ImagePreviewer/ImagePreviewerGallery.tsx +202 -0
  47. package/src/packages/components/ImagePreviewer/PreviewerLoading.tsx +26 -0
  48. package/src/packages/components/ImagePreviewer/image-previewer.scss +244 -0
  49. package/src/packages/components/ImagePreviewer/image-previewer.utils.tsx +135 -0
  50. package/src/packages/components/ImagePreviewer/index.tsx +5 -0
  51. package/src/packages/components/ImagePreviewer/previewer-loading.scss +52 -0
  52. package/src/packages/components/Input/index.scss +2 -2
  53. package/src/packages/components/Input/useMultipleInput.tsx +2 -76
  54. package/src/packages/components/Input/useTextareaInput.tsx +10 -5
  55. package/src/packages/components/Input/uses/useInputHooks.tsx +11 -11
  56. package/src/packages/components/InputNumber/NumberResize.tsx +20 -3
  57. package/src/packages/components/InputNumber/input-number.utils.tsx +7 -5
  58. package/src/packages/components/InputNumber/number.scss +10 -1
  59. package/src/packages/components/InputNumber/useInputNumber.public.tsx +25 -6
  60. package/src/packages/components/Layout/index.tsx +31 -0
  61. package/src/packages/components/Layout/layout.scss +227 -0
  62. package/src/packages/components/Layout/layout.utils.ts +3 -0
  63. package/src/packages/components/LayoutSection/index.tsx +67 -0
  64. package/src/packages/components/LayoutSection/useLayoutSectionResizer.tsx +184 -0
  65. package/src/packages/components/LoadingMask/index.tsx +1 -1
  66. package/src/packages/components/PageThemeUtils/index.tsx +54 -14
  67. package/src/packages/components/Pagination/pagination.scss +2 -2
  68. package/src/packages/components/PlcOv/index.tsx +14 -4
  69. package/src/packages/components/Popup/index.tsx +24 -10
  70. package/src/packages/components/ProgressBar/progress-bar.scss +1 -1
  71. package/src/packages/components/Rate/index.tsx +3 -1
  72. package/src/packages/components/Scroll/HorizontalScrollbar.tsx +7 -3
  73. package/src/packages/components/Scroll/VerticalScrollbar.tsx +7 -3
  74. package/src/packages/components/Scroll/index.tsx +6 -6
  75. package/src/packages/components/Select/createPublicSelectRender.tsx +1 -1
  76. package/src/packages/components/Slider/slider.scss +1 -1
  77. package/src/packages/components/Slider/useSliderDotDragier.tsx +7 -4
  78. package/src/packages/components/SortList/index.tsx +191 -0
  79. package/src/packages/components/SortList/sort-list.scss +11 -0
  80. package/src/packages/components/StackCard/index.tsx +416 -0
  81. package/src/packages/components/StackCard/stack-card.scss +40 -0
  82. package/src/packages/components/StackCardItem/index.tsx +24 -0
  83. package/src/packages/components/StepGroup/step-group.scss +9 -9
  84. package/src/packages/components/TabGroup/TabsInner.tsx +5 -3
  85. package/src/packages/components/TabGroup/header/horizontal/tabs-header-horizontal.scss +0 -1
  86. package/src/packages/components/TabGroup/index.tsx +5 -1
  87. package/src/packages/components/TabGroup/tabs.scss +3 -0
  88. package/src/packages/components/Table/standard/PlcExpand.tsx +12 -20
  89. package/src/packages/components/Table/standard/PlcOperation/PlcOperation.tsx +1 -1
  90. package/src/packages/components/Table/standard/PlcOperation/outer-operation.scss +2 -0
  91. package/src/packages/components/Table/standard/PlcTree/RenderPlcTreeNode.tsx +2 -1
  92. package/src/packages/components/Table/table/Table.tsx +10 -3
  93. package/src/packages/components/Table/table/body/row.tsx +1 -1
  94. package/src/packages/components/Table/table/body/useCellValue.tsx +10 -6
  95. package/src/packages/components/Table/table/head/useHeadCellResize.ts +8 -3
  96. package/src/packages/components/Table/table/table.scss +2 -1
  97. package/src/packages/components/Table/table/use/useTableDraggier.col.tsx +10 -5
  98. package/src/packages/components/Table/table/use/useTableDraggier.row.tsx +12 -7
  99. package/src/packages/components/Table/table/use/useTableFormEditor.tsx +1 -1
  100. package/src/packages/components/Table/table/use/useTableModifyEditor.tsx +1 -1
  101. package/src/packages/components/Table/table/utils/createTableHooks.ts +4 -2
  102. package/src/packages/components/Table/table/utils/table.utils.ts +6 -1
  103. package/src/packages/components/ThemeEditor/index.tsx +173 -0
  104. package/src/packages/components/ThemeEditor/theme-editor.scss +105 -0
  105. package/src/packages/components/ThemePrimaryColors/index.ts +5 -0
  106. package/src/packages/components/Tree/RenderTreeNode.tsx +8 -3
  107. package/src/packages/components/Tree/index.tsx +4 -3
  108. package/src/packages/components/Tree/tree.scss +42 -9
  109. package/src/packages/components/TreeCore/TreeCore.type.tsx +2 -0
  110. package/src/packages/components/TreeCore/createTreeCore.tsx +5 -1
  111. package/src/packages/components/TreeCore/createTreeDraggier.tsx +70 -56
  112. package/src/packages/components/TreeCore/createTreeMethods.tsx +1 -0
  113. package/src/packages/components/TreeCore/createTreeProps.ts +2 -1
  114. package/src/packages/components/TreeNodeWithMenu/index.tsx +91 -0
  115. package/src/packages/components/TreeNodeWithMenu/tree-node-with-menu.scss +39 -0
  116. package/src/packages/components/TreeNodeWithMenu/treeNodeWithMenu.utils.ts +12 -0
  117. package/src/packages/components/VirtualList/index.tsx +15 -6
  118. package/src/packages/components/VirtualList/useVirtualList.tsx +182 -107
  119. package/src/packages/components/VirtualList/virtual-list.scss +31 -17
  120. package/src/packages/components/VirtualTable/index.tsx +7 -7
  121. package/src/packages/components/VirtualTable/virtual-table.scss +1 -2
  122. package/src/packages/components/createProvider/index.ts +5 -0
  123. package/src/packages/components/nextPopupId/index.ts +5 -0
  124. package/src/packages/components/useDialog/DialogService.tsx +13 -1
  125. package/src/packages/components/useDialog/index.tsx +1 -1
  126. package/src/packages/components/useImage/ImageService.tsx +7 -4
  127. package/src/packages/components/useMessage/Message.tsx +5 -1
  128. package/src/packages/components/useMessage/message.scss +5 -1
  129. package/src/packages/components/useNotice/notice.scss +2 -2
  130. package/src/packages/components/usePopup/PopupItem.tsx +45 -26
  131. package/src/packages/components/usePopup/popup-item.scss +5 -1
  132. package/src/packages/components/usePopup/usePopupManager.tsx +2 -1
  133. package/src/packages/components/usePopup/utils/popup.utils.ts +2 -1
  134. package/src/packages/components/usePopupManager/index.ts +5 -0
  135. package/src/packages/components/usePopupTrigger/index.tsx +5 -0
  136. package/src/packages/components/useReferenceTrigger/index.tsx +5 -0
  137. package/src/packages/components/useTooltip/index.tsx +2 -0
  138. package/src/packages/components/useWatchAutoClear/index.ts +5 -0
  139. package/src/packages/entry.tsx +48 -2
  140. package/src/packages/i18n/lang/en-us.ts +36 -0
  141. package/src/packages/i18n/lang/zh-cn.ts +36 -0
  142. package/src/packages/uses/useDragHorizontalScroll.ts +82 -0
  143. package/src/packages/uses/useEdit.ts +5 -1
  144. package/src/packages/uses/useStyle.tsx +10 -2
  145. package/src/packages/utils/ClientZoom.ts +24 -2
  146. package/src/packages/utils/ComponentUtils.ts +10 -0
  147. package/src/packages/utils/buildCycleIndexList.ts +31 -0
  148. package/src/packages/utils/getDeviceInfo.ts +44 -44
  149. package/src/packages/utils/getRectAutoFormat.ts +9 -0
  150. package/src/packages/utils/inheritSlots.ts +28 -0
  151. package/src/packages/utils/notNull.ts +9 -0
  152. package/src/packages/utils/useMove.tsx +10 -4
  153. package/src/packages/components/CarouselGroup/carousel.scss +0 -143
  154. package/src/packages/components/CarouselGroup/index.tsx +0 -274
  155. package/src/pages/data/address.json +0 -39317
  156. package/src/pages/data/data-1.json +0 -754
  157. package/src/pages/data/data-2.json +0 -3006
  158. package/src/pages/data/data-200.json +0 -5206
  159. package/src/pages/data/data-2000.json +0 -51954
  160. package/src/pages/data/data-50.json +0 -2075
  161. package/src/pages/data/data.json +0 -30002
  162. package/src/pages/data/demo.json +0 -1702
  163. package/src/pages/data/mock.database.js +0 -43
  164. package/src/pages/data/mock.js +0 -141
  165. package/src/pages/data/tree.data.json +0 -87
  166. package/src/pages/env/config/local.js +0 -3
  167. package/src/pages/env/config/prod.js +0 -3
  168. package/src/pages/env/config/undefined.js +0 -1
  169. package/src/pages/env/env.d.ts +0 -4
  170. package/src/pages/env/index.ts +0 -1
  171. package/src/pages/history/createHistory.ts +0 -94
  172. package/src/pages/history/history.utils.ts +0 -64
  173. package/src/pages/index/App.tsx +0 -17
  174. package/src/pages/index/Demo/DemoLine.tsx +0 -23
  175. package/src/pages/index/Demo/DemoRow.scss +0 -128
  176. package/src/pages/index/Demo/DemoRow.tsx +0 -71
  177. package/src/pages/index/Demo/DemoRow.utils.ts +0 -23
  178. package/src/pages/index/Demo/DemoRowController.tsx +0 -45
  179. package/src/pages/index/Demo/index.ts +0 -8
  180. package/src/pages/index/app.scss +0 -192
  181. package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +0 -51
  182. package/src/pages/index/components/AutoTable/AutoHeightFixedRow.tsx +0 -50
  183. package/src/pages/index/components/AutoTable/AutoTableBasicUsage.tsx +0 -75
  184. package/src/pages/index/components/AutoTable/AutoTableCascade.tsx +0 -99
  185. package/src/pages/index/components/AutoTable/AutoTableDefaultSearch.tsx +0 -73
  186. package/src/pages/index/components/AutoTable/AutoTableFiles.tsx +0 -26
  187. package/src/pages/index/components/AutoTable/AutoTableFill.tsx +0 -51
  188. package/src/pages/index/components/AutoTable/AutoTableGroupUsage.tsx +0 -71
  189. package/src/pages/index/components/AutoTable/AutoTableObjectPicker.tsx +0 -181
  190. package/src/pages/index/components/AutoTable/AutoTableOvList.tsx +0 -80
  191. package/src/pages/index/components/AutoTable/AutoTableProductList.tsx +0 -98
  192. package/src/pages/index/components/AutoTable/AutoTableRowFormatter.tsx +0 -58
  193. package/src/pages/index/components/AutoTable/FixedHeightAutoRow.tsx +0 -50
  194. package/src/pages/index/components/AutoTable/FixedHeightFixedRow.tsx +0 -49
  195. package/src/pages/index/components/bus/DemoAddress.tsx +0 -181
  196. package/src/pages/index/components/bus/DemoAddressCascade.tsx +0 -132
  197. package/src/pages/index/components/bus/DemoFilter.tsx +0 -184
  198. package/src/pages/index/components/columns/DemoPlcAddress.tsx +0 -161
  199. package/src/pages/index/components/columns/DemoPlcDate.tsx +0 -363
  200. package/src/pages/index/components/columns/DemoPlcSelect.tsx +0 -505
  201. package/src/pages/index/components/columns/DemoPlcTime.tsx +0 -293
  202. package/src/pages/index/components/columns/DemoTableColumns.tsx +0 -88
  203. package/src/pages/index/components/form/DemoFormBasic.tsx +0 -516
  204. package/src/pages/index/components/form/DemoFormBlur.tsx +0 -204
  205. package/src/pages/index/components/form/DemoFormDynamicFields.tsx +0 -54
  206. package/src/pages/index/components/form/DemoFormEditControl.tsx +0 -164
  207. package/src/pages/index/components/form/DemoFormElement.tsx +0 -207
  208. package/src/pages/index/components/form/DemoFormLayout.scss +0 -7
  209. package/src/pages/index/components/form/DemoFormLayout.tsx +0 -311
  210. package/src/pages/index/components/form/DemoFormSimplify.tsx +0 -587
  211. package/src/pages/index/components/form/DemoFormSize.tsx +0 -274
  212. package/src/pages/index/components/form/DemoFormVertical.tsx +0 -280
  213. package/src/pages/index/components/normal/DemoAlert.tsx +0 -66
  214. package/src/pages/index/components/normal/DemoBadge.tsx +0 -53
  215. package/src/pages/index/components/normal/DemoButton.tsx +0 -300
  216. package/src/pages/index/components/normal/DemoCard.tsx +0 -176
  217. package/src/pages/index/components/normal/DemoCarousel.tsx +0 -125
  218. package/src/pages/index/components/normal/DemoCascade.tsx +0 -880
  219. package/src/pages/index/components/normal/DemoCheckbox.scss +0 -24
  220. package/src/pages/index/components/normal/DemoCheckbox.tsx +0 -294
  221. package/src/pages/index/components/normal/DemoCollapse.tsx +0 -104
  222. package/src/pages/index/components/normal/DemoColor.scss +0 -20
  223. package/src/pages/index/components/normal/DemoColor.tsx +0 -82
  224. package/src/pages/index/components/normal/DemoColorPicker.tsx +0 -163
  225. package/src/pages/index/components/normal/DemoDate.tsx +0 -443
  226. package/src/pages/index/components/normal/DemoDialog.tsx +0 -507
  227. package/src/pages/index/components/normal/DemoDropdown.tsx +0 -463
  228. package/src/pages/index/components/normal/DemoGrid.scss +0 -26
  229. package/src/pages/index/components/normal/DemoGrid.tsx +0 -181
  230. package/src/pages/index/components/normal/DemoIcon.tsx +0 -39
  231. package/src/pages/index/components/normal/DemoImage.tsx +0 -122
  232. package/src/pages/index/components/normal/DemoInput.scss +0 -0
  233. package/src/pages/index/components/normal/DemoInput.tsx +0 -790
  234. package/src/pages/index/components/normal/DemoKeepAlive.tsx +0 -505
  235. package/src/pages/index/components/normal/DemoList.scss +0 -15
  236. package/src/pages/index/components/normal/DemoList.tsx +0 -82
  237. package/src/pages/index/components/normal/DemoLoading.tsx +0 -83
  238. package/src/pages/index/components/normal/DemoNumber.tsx +0 -266
  239. package/src/pages/index/components/normal/DemoPagination.tsx +0 -164
  240. package/src/pages/index/components/normal/DemoPopup.tsx +0 -695
  241. package/src/pages/index/components/normal/DemoProgress.tsx +0 -133
  242. package/src/pages/index/components/normal/DemoRadio.scss +0 -16
  243. package/src/pages/index/components/normal/DemoRadio.tsx +0 -188
  244. package/src/pages/index/components/normal/DemoRate.tsx +0 -77
  245. package/src/pages/index/components/normal/DemoScroll.scss +0 -22
  246. package/src/pages/index/components/normal/DemoScroll.tsx +0 -300
  247. package/src/pages/index/components/normal/DemoSegment.tsx +0 -71
  248. package/src/pages/index/components/normal/DemoSelect.tsx +0 -819
  249. package/src/pages/index/components/normal/DemoSlider.tsx +0 -128
  250. package/src/pages/index/components/normal/DemoStep.scss +0 -18
  251. package/src/pages/index/components/normal/DemoStep.tsx +0 -291
  252. package/src/pages/index/components/normal/DemoTab.tsx +0 -338
  253. package/src/pages/index/components/normal/DemoTag.tsx +0 -100
  254. package/src/pages/index/components/normal/DemoTime.tsx +0 -403
  255. package/src/pages/index/components/normal/DemoToggle.tsx +0 -56
  256. package/src/pages/index/components/normal/DemoTooltip.tsx +0 -120
  257. package/src/pages/index/components/normal/DemoTree.tsx +0 -1099
  258. package/src/pages/index/components/normal/DemoUpload.tsx +0 -484
  259. package/src/pages/index/components/normal/DemoVirtualList.tsx +0 -378
  260. package/src/pages/index/components/service/DemoDialogService.tsx +0 -248
  261. package/src/pages/index/components/service/DemoFileService.tsx +0 -110
  262. package/src/pages/index/components/service/DemoMessageService.tsx +0 -100
  263. package/src/pages/index/components/service/DemoNoticeService.tsx +0 -99
  264. package/src/pages/index/components/service/DemoPopupService.tsx +0 -322
  265. package/src/pages/index/components/table/DemoPlcOperation.tsx +0 -307
  266. package/src/pages/index/components/table/DemoTableBasic.tsx +0 -220
  267. package/src/pages/index/components/table/DemoTableCheck.tsx +0 -78
  268. package/src/pages/index/components/table/DemoTableClassAndStyle.scss +0 -18
  269. package/src/pages/index/components/table/DemoTableClassAndStyle.tsx +0 -112
  270. package/src/pages/index/components/table/DemoTableColDraggable.tsx +0 -80
  271. package/src/pages/index/components/table/DemoTableEdit.tsx +0 -136
  272. package/src/pages/index/components/table/DemoTableExpand.tsx +0 -181
  273. package/src/pages/index/components/table/DemoTableFixed.tsx +0 -131
  274. package/src/pages/index/components/table/DemoTableFormatter.tsx +0 -66
  275. package/src/pages/index/components/table/DemoTableOverflowTooltip.tsx +0 -67
  276. package/src/pages/index/components/table/DemoTableRowDraggable.tsx +0 -106
  277. package/src/pages/index/components/table/DemoTableSlots.tsx +0 -153
  278. package/src/pages/index/components/table/DemoTableSpan.tsx +0 -167
  279. package/src/pages/index/components/table/DemoTableTree.tsx +0 -976
  280. package/src/pages/index/components/table/DemoVirtualTable.tsx +0 -274
  281. package/src/pages/index/components/test/DemoI18n.tsx +0 -27
  282. package/src/pages/index/components/test/DemoI18n2.jsx +0 -11
  283. package/src/pages/index/home/AppContent.tsx +0 -69
  284. package/src/pages/index/home/AppHead.tsx +0 -104
  285. package/src/pages/index/home/AppHome.tsx +0 -16
  286. package/src/pages/index/home/AppMenu.tsx +0 -38
  287. package/src/pages/index/home/menus.tsx +0 -217
  288. package/src/pages/index/main.tsx +0 -23
  289. package/src/pages/index/nav/$nav.ts +0 -41
  290. package/src/pages/index/pages.d.ts +0 -6
  291. package/src/pages/libs/iconfont-fontcls/demo.css +0 -539
  292. package/src/pages/libs/iconfont-fontcls/demo_index.html +0 -303
  293. package/src/pages/libs/iconfont-fontcls/iconfont.css +0 -35
  294. package/src/pages/libs/iconfont-fontcls/iconfont.js +0 -1
  295. package/src/pages/libs/iconfont-fontcls/iconfont.json +0 -44
  296. package/src/pages/libs/iconfont-fontcls/iconfont.ttf +0 -0
  297. package/src/pages/libs/iconfont-fontcls/iconfont.woff +0 -0
  298. package/src/pages/libs/iconfont-fontcls/iconfont.woff2 +0 -0
  299. package/src/pages/libs/iconfont-symbol/demo.css +0 -539
  300. package/src/pages/libs/iconfont-symbol/demo_index.html +0 -303
  301. package/src/pages/libs/iconfont-symbol/iconfont.css +0 -35
  302. package/src/pages/libs/iconfont-symbol/iconfont.js +0 -1
  303. package/src/pages/libs/iconfont-symbol/iconfont.json +0 -44
  304. package/src/pages/libs/iconfont-symbol/iconfont.ttf +0 -0
  305. package/src/pages/libs/iconfont-symbol/iconfont.woff +0 -0
  306. package/src/pages/libs/iconfont-symbol/iconfont.woff2 +0 -0
  307. package/src/pages/libs/install.iconfont-fontcls.tsx +0 -11
  308. package/src/pages/libs/install.iconfont-symbol.scss +0 -7
  309. package/src/pages/libs/install.iconfont-symbol.tsx +0 -14
  310. package/src/pages/module/address.ts +0 -27
  311. package/src/pages/module/http.ts +0 -24
  312. package/src/pages/module/index.ts +0 -19
  313. package/src/pages/module/object.ts +0 -5
  314. package/src/pages/module/ov.tsx +0 -13
  315. package/src/pages/module/upload.ts +0 -9
  316. package/src/pages/module/useTableOption.ts +0 -28
@@ -0,0 +1,227 @@
1
+ $resize-width: 12px;
2
+
3
+ @include comp(layout) {
4
+ display: flex;
5
+ align-items: stretch;
6
+ justify-content: space-between;
7
+
8
+ &.layout-vertical {
9
+ flex-direction: column;
10
+ }
11
+
12
+ & > .#{componentName(layout-section)} {
13
+ &.layout-section-position-center {
14
+ flex: 1;
15
+ position: relative;
16
+ z-index: 1;
17
+ }
18
+
19
+ &.layout-section-position-top, &.layout-section-position-bottom, &.layout-section-position-left, &.layout-section-position-right {
20
+ position: relative;
21
+ flex-shrink: 0;
22
+ flex-grow: 0;
23
+ z-index: 2;
24
+
25
+ & > .layout-section-inner {
26
+ overflow: hidden;
27
+ }
28
+
29
+ &.layout-section-fixed {
30
+ & > .layout-section-inner {
31
+ position: absolute;
32
+ top: 0;
33
+ left: 0;
34
+ right: 0;
35
+ bottom: 0;
36
+ }
37
+ }
38
+
39
+
40
+ & > .layout-section-separator {
41
+ user-select: none;
42
+ }
43
+
44
+ & > .layout-section-collapse-btn {
45
+ opacity: 0;
46
+ transition: all ease 0.3s;
47
+ cursor: pointer;
48
+ }
49
+
50
+ &:hover {
51
+ & > .layout-section-collapse-btn {
52
+ opacity: 1;
53
+ }
54
+ }
55
+ }
56
+
57
+ /*---------------------------------------horizontal-------------------------------------------*/
58
+
59
+ &.layout-section-position-left, &.layout-section-position-right {
60
+
61
+ & > .layout-section-separator {
62
+ cursor: col-resize;
63
+ }
64
+
65
+ &.layout-section-collapse {
66
+ width: 0 !important;
67
+
68
+ & > .layout-section-collapse-btn {
69
+ opacity: 1;
70
+ }
71
+
72
+ &.layout-section-position-left {
73
+ & > .layout-section-collapse-btn {
74
+ border-top-left-radius: 0;
75
+ border-bottom-left-radius: 0;
76
+ right: -$resize-width;
77
+ }
78
+ }
79
+
80
+ &.layout-section-position-right {
81
+ & > .layout-section-collapse-btn {
82
+ border-top-right-radius: 0;
83
+ border-bottom-right-radius: 0;
84
+ left: -$resize-width;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ &.layout-section-position-left {
91
+ & > .layout-section-separator {
92
+ position: absolute;
93
+ right: 0;
94
+ width: 4px;
95
+ top: 0;
96
+ bottom: 0;
97
+ border-right: solid 1px plv(border-color);
98
+ }
99
+
100
+ & > .layout-section-collapse-btn {
101
+ position: absolute;
102
+ right: calc(#{$resize-width} / 2 * -1);
103
+ top: calc(50% - #{$resize-width} * 3 / 2);
104
+ font-size: $resize-width;
105
+ height: calc(#{$resize-width} * 3);
106
+ width: $resize-width;
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ background-color: plv(background-color);
111
+ border-radius: 100px;
112
+ box-shadow: 0 2px 5px plv(secondary-4);
113
+ }
114
+ }
115
+
116
+ &.layout-section-position-right {
117
+ & > .layout-section-separator {
118
+ position: absolute;
119
+ left: 0;
120
+ width: 4px;
121
+ top: 0;
122
+ bottom: 0;
123
+ border-left: solid 1px plv(border-color);
124
+ }
125
+
126
+ & > .layout-section-collapse-btn {
127
+ position: absolute;
128
+ left: calc(#{$resize-width} / 2 * -1);
129
+ top: calc(50% - #{$resize-width} * 3 / 2);
130
+ font-size: $resize-width;
131
+ height: calc(#{$resize-width} * 3);
132
+ width: $resize-width;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ background-color: plv(background-color);
137
+ border-radius: 100px;
138
+ box-shadow: 0 2px 5px plv(secondary-4);
139
+ }
140
+ }
141
+
142
+ /*---------------------------------------vertical-------------------------------------------*/
143
+
144
+ &.layout-section-position-top, &.layout-section-position-bottom {
145
+
146
+ & > .layout-section-separator {
147
+ cursor: row-resize;
148
+ }
149
+
150
+ &.layout-section-collapse {
151
+ height: 0 !important;
152
+
153
+ & > .layout-section-collapse-btn {
154
+ opacity: 1;
155
+ }
156
+
157
+ &.layout-section-position-top {
158
+ & > .layout-section-collapse-btn {
159
+ border-top-left-radius: 0;
160
+ border-top-right-radius: 0;
161
+ bottom: -$resize-width;
162
+ }
163
+ }
164
+
165
+ &.layout-section-position-bottom {
166
+ & > .layout-section-collapse-btn {
167
+ border-bottom-left-radius: 0;
168
+ border-bottom-right-radius: 0;
169
+ top: -$resize-width;
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ &.layout-section-position-top {
176
+ & > .layout-section-separator {
177
+ position: absolute;
178
+ bottom: 0;
179
+ height: 4px;
180
+ left: 0;
181
+ right: 0;
182
+ border-bottom: solid 1px plv(border-color);
183
+ }
184
+
185
+ & > .layout-section-collapse-btn {
186
+ position: absolute;
187
+ bottom: calc(#{$resize-width} / 2 * -1);
188
+ left: calc(50% - #{$resize-width} * 3 / 2);
189
+ font-size: $resize-width;
190
+ width: calc(#{$resize-width} * 3);
191
+ height: $resize-width;
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ background-color: plv(background-color);
196
+ border-radius: 100px;
197
+ box-shadow: 0 2px 5px plv(secondary-4);
198
+ }
199
+ }
200
+
201
+ &.layout-section-position-bottom {
202
+ & > .layout-section-separator {
203
+ position: absolute;
204
+ top: 0;
205
+ height: 4px;
206
+ left: 0;
207
+ right: 0;
208
+ border-top: solid 1px plv(border-color);
209
+ }
210
+
211
+ & > .layout-section-collapse-btn {
212
+ position: absolute;
213
+ top: calc(#{$resize-width} / 2 * -1);
214
+ left: calc(50% - #{$resize-width} * 3 / 2);
215
+ font-size: $resize-width;
216
+ width: calc(#{$resize-width} * 3);
217
+ height: $resize-width;
218
+ display: flex;
219
+ align-items: center;
220
+ justify-content: center;
221
+ background-color: plv(background-color);
222
+ border-radius: 100px;
223
+ box-shadow: 0 2px 5px plv(secondary-4);
224
+ }
225
+ }
226
+ }
227
+ }
@@ -0,0 +1,3 @@
1
+ import {createEnum} from "plain-utils/utils/createEnum";
2
+
3
+ export const eLayoutSectionPosition = createEnum(['top', 'left', 'right', 'bottom', 'center'] as const);
@@ -0,0 +1,67 @@
1
+ import {designComponent, getComponentCls, iHTMLDivElement, onMounted, PropType, useClassCache, useModel, useRefs, useStyleCache} from "plain-design-composition";
2
+ import {unit} from "plain-utils/string/unit";
3
+ import Layout from "../Layout";
4
+ import {eLayoutSectionPosition} from "../Layout/layout.utils";
5
+ import {useLayoutSectionResizer} from "./useLayoutSectionResizer";
6
+
7
+ export const LayoutSection = designComponent({
8
+ name: 'layout-section',
9
+ props: {
10
+ position: { type: String as PropType<typeof eLayoutSectionPosition.TYPE>, default: eLayoutSectionPosition.center },
11
+ modelValue: { type: Number },
12
+ collapse: { type: Boolean }
13
+ },
14
+ emits: {
15
+ onUpdateModelValue: (val?: number) => true,
16
+ onUpdateCollapse: (val?: boolean) => true,
17
+ },
18
+ slots: ['default'],
19
+ setup({ props, slots, event }) {
20
+
21
+ const layout = Layout.use.inject();
22
+
23
+ const { refs, onRef } = useRefs({ el: iHTMLDivElement });
24
+
25
+ const model = useModel(() => props.modelValue, event.emit.onUpdateModelValue);
26
+
27
+ const collapseModel = useModel(() => props.collapse, event.emit.onUpdateCollapse);
28
+
29
+ const classes = useClassCache(() => [
30
+ getComponentCls('layout-section'),
31
+ `layout-section-position-${props.position}`,
32
+ {
33
+ 'layout-section-fixed': !!model.value,
34
+ 'layout-section-collapse': collapseModel.value,
35
+ }
36
+ ]);
37
+
38
+ const styles = useStyleCache(style => {
39
+ if (!!model.value) {
40
+ if (layout.props.vertical) {
41
+ style.height = unit(model.value);
42
+ } else {
43
+ style.width = unit(model.value);
44
+ }
45
+ }
46
+ });
47
+
48
+ const resizer = useLayoutSectionResizer({ props, model, collapseModel });
49
+
50
+ onMounted(() => {
51
+ if (!props.modelValue && props.position !== eLayoutSectionPosition.center) {
52
+ model.value = (layout.props.vertical ? refs.el!.offsetHeight : refs.el!.offsetWidth) + 1;
53
+ }
54
+ });
55
+
56
+ return () => (
57
+ <div className={classes.value} ref={onRef.el} style={styles.value}>
58
+ <div className="layout-section-inner">
59
+ {slots.default()}
60
+ </div>
61
+ {resizer.render()}
62
+ </div>
63
+ );
64
+ },
65
+ });
66
+
67
+ export default LayoutSection;
@@ -0,0 +1,184 @@
1
+ import Icon from "../Icon";
2
+ import {eLayoutSectionPosition} from "../Layout/layout.utils";
3
+ import {cacheComputed, computed, getComponentCls, iHTMLDivElement, iMouseEvent, useRefs} from "plain-design-composition";
4
+ import {createEffects} from "plain-utils/utils/createEffects";
5
+ import {ClientZoom} from "../../utils/ClientZoom";
6
+
7
+ export function useLayoutSectionResizer(
8
+ {
9
+ model,
10
+ collapseModel,
11
+ props
12
+ }: {
13
+ model: { value?: number },
14
+ collapseModel: { value?: boolean },
15
+ props: { position: typeof eLayoutSectionPosition.TYPE }
16
+ }
17
+ ) {
18
+
19
+ const { refs, onRef } = useRefs({ sep: iHTMLDivElement });
20
+
21
+ const isVertical = computed(() => props.position === eLayoutSectionPosition.top || props.position === eLayoutSectionPosition.bottom);
22
+
23
+ const icon = cacheComputed(() => {
24
+ switch (props.position) {
25
+ case "center":
26
+ return null;
27
+ case "left":
28
+ return collapseModel.value ? 'pi-caret-right' : 'pi-caret-left';
29
+ case "right":
30
+ return collapseModel.value ? 'pi-caret-left' : 'pi-caret-right';
31
+ case "top":
32
+ return collapseModel.value ? 'pi-caret-down' : 'pi-caret-up';
33
+ case "bottom":
34
+ return collapseModel.value ? 'pi-caret-up' : 'pi-caret-down';
35
+ }
36
+ return null;
37
+ });
38
+
39
+ const draggier = computed(() => {
40
+ return isVertical.value ? (() => {
41
+ const { effects } = createEffects();
42
+
43
+ let staticState = null as null | {
44
+ startY: number,
45
+ moveY: number,
46
+ startValue: number,
47
+ shadowEl: HTMLDivElement,
48
+ };
49
+
50
+ const onMousedown = (e: iMouseEvent) => {
51
+
52
+ const { clientY } = ClientZoom.getClientPosition(e);
53
+
54
+ const shadowEl = (() => {
55
+ const rect = refs.sep!.getBoundingClientRect();
56
+ const el = document.createElement('div');
57
+ el.style.height = '1px';
58
+ el.style.position = 'fixed';
59
+ el.style.left = `${rect.left}px`;
60
+ el.style.top = `${clientY}px`;
61
+ el.style.width = `${rect.width}px`;
62
+ el.style.zIndex = "10";
63
+ el.style.backgroundColor = `var(--${getComponentCls('primary-6')})`;
64
+ document.body.appendChild(el);
65
+ effects.push(() => {
66
+ document.body.removeChild(el);
67
+ });
68
+ return el;
69
+ })();
70
+
71
+ staticState = {
72
+ startY: clientY,
73
+ moveY: clientY,
74
+ startValue: model.value!,
75
+ shadowEl,
76
+ };
77
+
78
+ window.addEventListener('mousemove', onMousemove);
79
+ window.addEventListener('mouseup', effects.clear);
80
+ effects.push(() => {
81
+ if (!staticState) {return;}
82
+ let durY = staticState!.moveY - staticState!.startY;
83
+ if (props.position === eLayoutSectionPosition.bottom) {
84
+ durY = -durY;
85
+ }
86
+ model.value = staticState.startValue + durY;
87
+ staticState = null;
88
+ window.removeEventListener('mousemove', onMousemove);
89
+ window.removeEventListener('mouseup', effects.clear);
90
+ });
91
+ };
92
+
93
+ const onMousemove = (e: MouseEvent) => {
94
+ if (!staticState) {return;}
95
+ const { clientY } = ClientZoom.getClientPosition(e);
96
+ staticState.moveY = clientY;
97
+ staticState.shadowEl.style.top = `${clientY}px`;
98
+ };
99
+
100
+ return {
101
+ onMousedown
102
+ };
103
+ })() : (() => {
104
+ const { effects } = createEffects();
105
+
106
+ let staticState = null as null | {
107
+ startX: number,
108
+ moveX: number,
109
+ startValue: number,
110
+ shadowEl: HTMLDivElement,
111
+ };
112
+
113
+ const onMousedown = (e: iMouseEvent) => {
114
+
115
+ const { clientX } = ClientZoom.getClientPosition(e);
116
+
117
+ const shadowEl = (() => {
118
+ const rect = refs.sep!.getBoundingClientRect();
119
+ const el = document.createElement('div');
120
+ el.style.width = '1px';
121
+ el.style.position = 'fixed';
122
+ el.style.top = `${rect.top}px`;
123
+ el.style.left = `${clientX}px`;
124
+ el.style.height = `${rect.height}px`;
125
+ el.style.zIndex = "10";
126
+ el.style.backgroundColor = `var(--${getComponentCls('primary-6')})`;
127
+ document.body.appendChild(el);
128
+ effects.push(() => {
129
+ document.body.removeChild(el);
130
+ });
131
+ return el;
132
+ })();
133
+
134
+ staticState = {
135
+ startX: clientX,
136
+ moveX: clientX,
137
+ startValue: model.value!,
138
+ shadowEl,
139
+ };
140
+
141
+ window.addEventListener('mousemove', onMousemove);
142
+ window.addEventListener('mouseup', effects.clear);
143
+ effects.push(() => {
144
+ if (!staticState) {return;}
145
+ let durX = staticState!.moveX - staticState!.startX;
146
+ if (props.position === eLayoutSectionPosition.right) {
147
+ durX = -durX;
148
+ }
149
+ model.value = staticState.startValue + durX;
150
+ staticState = null;
151
+ window.removeEventListener('mousemove', onMousemove);
152
+ window.removeEventListener('mouseup', effects.clear);
153
+ });
154
+ };
155
+
156
+ const onMousemove = (e: MouseEvent) => {
157
+ if (!staticState) {return;}
158
+ const { clientX } = ClientZoom.getClientPosition(e);
159
+ staticState.moveX = clientX;
160
+ staticState.shadowEl.style.left = `${clientX}px`;
161
+ };
162
+
163
+ return {
164
+ onMousedown
165
+ };
166
+ })();
167
+ });
168
+
169
+ const toggleCollapse = () => collapseModel.value = !collapseModel.value;
170
+
171
+ const render = () => {
172
+ return (
173
+ !icon.value ? null :
174
+ <>
175
+ {!collapseModel.value && <div className="layout-section-separator" onMouseDown={draggier.value.onMousedown} ref={onRef.sep}/>}
176
+ <div className="layout-section-collapse-btn" onClick={toggleCollapse}>
177
+ <Icon icon={icon.value}/>
178
+ </div>
179
+ </>
180
+ );
181
+ };
182
+
183
+ return { render };
184
+ }
@@ -53,7 +53,7 @@ export const LoadingMask = designComponent({
53
53
  if (props.fixedPosition) {
54
54
  return;
55
55
  }
56
- await delay();
56
+ await delay(23);
57
57
  const el = refs.el;
58
58
  if (el) {
59
59
  let parentNode = el.parentNode as HTMLElement;
@@ -24,26 +24,62 @@ export const PageThemeUtils = (() => {
24
24
 
25
25
  const configuration = computed((): DeepPartial<iApplicationConfiguration> => {
26
26
  const config: DeepPartial<iApplicationConfiguration> = {};
27
- if (!config.theme) {
28
- config.theme = {};
27
+ if (!config.theme) {config.theme = {};}
28
+ if (!config.theme.base) {config.theme.base = {};}
29
+ if (!config.theme.vars) {config.theme.vars = {};}
30
+
31
+ let { dark, primaryKey, size, shape, inputMode, zoom } = state;
32
+
33
+ config.theme.dark = !!dark;
34
+
35
+ if (!!primaryKey) {
36
+ if (dark && primaryKey === 'dark') {
37
+ primaryKey = 'white';
38
+ } else if (!dark && primaryKey === 'light') {
39
+ primaryKey = 'dark';
40
+ }
29
41
  }
30
- if (!config.theme.base) {
31
- config.theme.base = {};
42
+
43
+ config.theme.base.primary = !primaryKey ? undefined : ThemePrimaryColors[primaryKey]?.primary;
44
+
45
+ if (primaryKey === 'dark') {
46
+ Object.assign(config.theme.vars!, {
47
+ 'primary-light-1': '#f2f3f5',
48
+ 'primary-1': '#f2f3f5',
49
+ 'primary-light-2': '#e1e2e7',
50
+ 'primary-2': '#e1e2e7',
51
+ 'primary-light-3': '#c9cdd4',
52
+ 'primary-3': '#c9cdd4',
53
+ 'primary-light-4': '#a9aeb8',
54
+ 'primary-4': '#a9aeb8',
55
+ 'primary-light-5': '#86909c',
56
+ 'primary-5': '#86909c',
57
+ 'primary-light-6': '#0c0e10',
58
+ 'primary-6': '#0b0b0b',
59
+ 'primary-light-7': '#464f5e',
60
+ 'primary-7': '#464f5e',
61
+ 'primary-light-8': '#272e3b',
62
+ 'primary-8': '#272e3b',
63
+ 'primary-light-9': '#1d2129',
64
+ 'primary-9': '#111318',
65
+ 'primary-light-10': '#0c0e10',
66
+ 'primary-10': '#0b0b0b',
67
+ });
32
68
  }
33
- config.theme.dark = !!state.dark;
34
- config.theme.base.primary = !state.primaryKey ? undefined : ThemePrimaryColors[state.primaryKey]?.primary;
69
+
70
+
35
71
  if (!config.default) {
36
72
  config.default = {};
37
73
  }
38
- if (!!state.size) {
39
- config.default.size = state.size;
74
+ if (!!size) {
75
+ config.default.size = size;
40
76
  }
41
- if (!!state.shape) {
42
- config.default.shape = state.shape;
77
+ if (!!shape) {
78
+ config.default.shape = shape;
43
79
  if (!config.theme.vars) {
44
80
  config.theme.vars = {};
45
81
  }
46
- if (state.shape === 'square') {
82
+ if (shape === 'square') {
47
83
  Object.assign(config.theme.vars, {
48
84
  'box-size-mini-border-radius': '2px',
49
85
  'box-size-small-border-radius': '2px',
@@ -51,7 +87,7 @@ export const PageThemeUtils = (() => {
51
87
  'box-size-large-border-radius': '4px',
52
88
  });
53
89
  }
54
- if (state.shape === 'none') {
90
+ if (shape === 'none') {
55
91
  Object.assign(config.theme.vars, {
56
92
  'box-size-mini-border-radius': '0',
57
93
  'box-size-small-border-radius': '0',
@@ -60,8 +96,8 @@ export const PageThemeUtils = (() => {
60
96
  });
61
97
  }
62
98
  }
63
- if (!!state.inputMode) {
64
- config.default.inputMode = state.inputMode;
99
+ if (!!inputMode) {
100
+ config.default.inputMode = inputMode;
65
101
  }
66
102
  return config;
67
103
  });
@@ -122,4 +158,8 @@ export const ThemePrimaryColors: Record<string, { label: string, primary: string
122
158
  geek: { label: '极客蓝', primary: '#2f54eb', },
123
159
  purple: { label: '酱紫', primary: '#722ed1', },
124
160
  magenta: { label: '洋红', primary: '#eb2f96', },
161
+ light: { label: '极昼', primary: '#ffffff', },
162
+ dark: { label: '黑夜', primary: '#000000', },
125
163
  };
164
+
165
+ export default PageThemeUtils;
@@ -47,7 +47,7 @@
47
47
  &:active, &.pagination-pager-button-active {
48
48
  background-color: plv(primary-6);
49
49
  border-color: plv(primary-6);
50
- color: white;
50
+ color: plv(pbfc);
51
51
  }
52
52
  }
53
53
 
@@ -118,7 +118,7 @@
118
118
  &.pagination-pager-button-active {
119
119
  background-color: plv(gray-light-6);
120
120
  border-color: plv(gray-light-6);
121
- color: white;
121
+ color: plv(pbfc);
122
122
  }
123
123
  }
124
124
  }
@@ -3,17 +3,27 @@ import {OvPropsOption} from "../Ov/ov.utils";
3
3
  import {usePublicOv} from "../Ov/usePublicOv";
4
4
  import {PlcSelect} from "../Table/editor/PlcSelect";
5
5
  import {SelectOption} from "../SelectOption";
6
+ import {PlcScopeSlotsOptions} from "../Table/plc/utils/plc.scope-slots";
7
+ import {inheritSlots} from "../../utils/inheritSlots";
6
8
 
7
9
  export const PlcOv = designComponent({
8
10
  name: 'plc-ov',
9
11
  inheritPropsType: PlcSelect,
10
12
  props: OvPropsOption,
11
- setup({ props }) {
13
+ scopeSlots: PlcScopeSlotsOptions,
14
+ slots: ['default'],
15
+ setup({ props, slots, scopeSlots }) {
12
16
  const { state } = usePublicOv({ props });
13
17
  return () => (
14
- <PlcSelect>
15
- {state.ovMetas.map(meta => (<SelectOption label={meta.name} val={meta.code} key={meta.code}/>))}
16
- </PlcSelect>
18
+ <PlcSelect
19
+ v-slots={inheritSlots({
20
+ slots,
21
+ scopeSlots,
22
+ defaultSlots: {
23
+ default: () => state.ovMetas.map(meta => (<SelectOption label={meta.name} val={meta.code} key={meta.code}/>))
24
+ }
25
+ })}
26
+ />
17
27
  );
18
28
  },
19
29
  });