plain-design 1.0.0-beta.1 → 1.0.0-beta.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (542) hide show
  1. package/dist/plain-design.commonjs.min.js +11 -2
  2. package/dist/plain-design.min.css +67 -46
  3. package/dist/plain-design.min.js +11 -2
  4. package/dist/report.html +5 -5
  5. package/package.json +52 -50
  6. package/src/packages/build.ts +2 -10
  7. package/src/packages/components/$address/createAddressService.tsx +20 -1
  8. package/src/packages/components/$file/index.tsx +1 -1
  9. package/src/packages/components/$loading/index.tsx +3 -0
  10. package/src/packages/components/$message/image.service.utils.tsx +2 -2
  11. package/src/packages/components/$object/createObjectService.tsx +38 -24
  12. package/src/packages/components/$object/object.service.utils.ts +7 -3
  13. package/src/packages/components/$previewer/ImagePreviewerFixedContainer.tsx +108 -0
  14. package/src/packages/components/$previewer/image-previewer-fixed-container.scss +18 -0
  15. package/src/packages/components/$previewer/index.tsx +52 -0
  16. package/src/packages/components/$search/SearchFooter.tsx +32 -0
  17. package/src/packages/components/$search/SearchList.tsx +207 -0
  18. package/src/packages/components/$search/SearchServicePanel.tsx +233 -0
  19. package/src/packages/components/$search/createSearchService.tsx +43 -0
  20. package/src/packages/components/$search/index.tsx +6 -0
  21. package/src/packages/components/$search/search-service.scss +220 -0
  22. package/src/packages/components/$search/search.utils.tsx +112 -0
  23. package/src/packages/components/$upload/createUploadService.tsx +1 -1
  24. package/src/packages/components/AddressCascade/createAddressCascade.multiple.tsx +1 -0
  25. package/src/packages/components/AddressCascade/createAddressCascade.single.tsx +1 -0
  26. package/src/packages/components/AddressCascade/index.tsx +2 -0
  27. package/src/packages/components/Alert/alert.scss +7 -4
  28. package/src/packages/components/Alert/index.tsx +4 -4
  29. package/src/packages/components/Application/index.tsx +6 -3
  30. package/src/packages/components/Application/service/createApplicationServiceManager.tsx +5 -2
  31. package/src/packages/components/Application/service/useApplicationService.tsx +2 -0
  32. package/src/packages/components/Application/theme/theme.ts +51 -29
  33. package/src/packages/components/Application/utils/application.utils.ts +2 -6
  34. package/src/packages/components/ArrowStepGroup/arrow-step.scss +17 -4
  35. package/src/packages/components/AutoLoadingObserver/index.tsx +173 -0
  36. package/src/packages/components/AutoTable/AutoTable.tsx +1 -1
  37. package/src/packages/components/AutoTable/auto-table.scss +62 -20
  38. package/src/packages/components/AutoTable/filter/useTableOption.filter.form.tsx +6 -7
  39. package/src/packages/components/AutoTable/filter/useTableOption.filter.search.tsx +5 -5
  40. package/src/packages/components/AutoTable/setting/useTableOption.setting.all.fitler.tsx +4 -4
  41. package/src/packages/components/AutoTable/setting/useTableOption.setting.cache.tsx +16 -16
  42. package/src/packages/components/AutoTable/setting/useTableOption.setting.config.tsx +11 -11
  43. package/src/packages/components/AutoTable/setting/useTableOption.setting.export.tsx +20 -20
  44. package/src/packages/components/AutoTable/setting/useTableOption.setting.import.tsx +1 -1
  45. package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.filter.tsx +11 -11
  46. package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.sort.tsx +7 -7
  47. package/src/packages/components/AutoTable/setting/useTableOption.setting.tsx +2 -2
  48. package/src/packages/components/AutoTable/use/useTableOption.buttons.tsx +30 -18
  49. package/src/packages/components/AutoTable/use/useTableOption.cache.ts +1 -1
  50. package/src/packages/components/AutoTable/use/useTableOption.check.tsx +1 -1
  51. package/src/packages/components/AutoTable/use/useTableOption.column.popper.tsx +10 -9
  52. package/src/packages/components/AutoTable/use/useTableOption.confirm.tsx +3 -3
  53. package/src/packages/components/AutoTable/use/useTableOption.fill.tsx +2 -1
  54. package/src/packages/components/AutoTable/use/useTableOption.hooks.tsx +9 -1
  55. package/src/packages/components/AutoTable/use/useTableOption.loading.tsx +9 -3
  56. package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +19 -17
  57. package/src/packages/components/AutoTable/use/useTableOption.pagination.tsx +8 -3
  58. package/src/packages/components/AutoTable/use/useTableOption.sort.ts +5 -5
  59. package/src/packages/components/AutoTable/use/useTableOption.state.tsx +1 -0
  60. package/src/packages/components/AutoTable/use/useTableOption.table.tsx +10 -3
  61. package/src/packages/components/AutoTable/use/useTableOption.tips.tsx +1 -1
  62. package/src/packages/components/AutoTable/utils/TableOption.space.tsx +4 -0
  63. package/src/packages/components/AutoTable/utils/TableOption.utils.tsx +1 -1
  64. package/src/packages/components/Badge/badge.scss +1 -1
  65. package/src/packages/components/Box/box.scss +6 -0
  66. package/src/packages/components/Box/index.tsx +30 -0
  67. package/src/packages/components/Button/button.scss +41 -9
  68. package/src/packages/components/Button/index.tsx +69 -11
  69. package/src/packages/components/ButtonGroup/button-group.scss +2 -2
  70. package/src/packages/components/ButtonGroup/index.tsx +1 -1
  71. package/src/packages/components/Card/card.scss +1 -1
  72. package/src/packages/components/Carousel/carousel.scss +391 -0
  73. package/src/packages/components/Carousel/index.tsx +569 -22
  74. package/src/packages/components/CarouselItem/index.tsx +77 -0
  75. package/src/packages/components/Cascade/cascade.scss +2 -2
  76. package/src/packages/components/Cascade/createMultipleCascadeRender.tsx +1 -1
  77. package/src/packages/components/Cascade/createSingleCascadeRender.tsx +2 -2
  78. package/src/packages/components/Cascade/index.tsx +1 -1
  79. package/src/packages/components/CascadePanel/flat/cascade-flat-panel.scss +22 -34
  80. package/src/packages/components/CascadePanel/flat/createCascadeFlatRender.tsx +1 -1
  81. package/src/packages/components/CascadePanel/list/CascadeListPanelItem.tsx +3 -3
  82. package/src/packages/components/Checkbox/checkbox.scss +4 -0
  83. package/src/packages/components/Checkbox/index.tsx +1 -1
  84. package/src/packages/components/CheckboxGroup/index.tsx +2 -2
  85. package/src/packages/components/CheckboxInner/checkbox-inner.scss +2 -1
  86. package/src/packages/components/ColorPicker/color-picker.scss +6 -0
  87. package/src/packages/components/ColorPicker/sub/ColorSlider.tsx +8 -5
  88. package/src/packages/components/ColorPicker/sub/ColorSvPanel.tsx +7 -4
  89. package/src/packages/components/ConfirmPopup/confirm-popup.scss +16 -0
  90. package/src/packages/components/ConfirmPopup/index.tsx +72 -0
  91. package/src/packages/components/Corner/corner.scss +14 -0
  92. package/src/packages/components/Corner/index.tsx +80 -0
  93. package/src/packages/components/DatePicker/createDateRender.multiple.tsx +1 -0
  94. package/src/packages/components/DatePicker/createDateRender.single.tsx +1 -0
  95. package/src/packages/components/DatePicker/createRangeDateRender.range.tsx +33 -25
  96. package/src/packages/components/DatePicker/createRangeDateRender.separate.tsx +11 -3
  97. package/src/packages/components/DatePicker/date.scss +2 -2
  98. package/src/packages/components/DatePicker/date.utils.tsx +4 -3
  99. package/src/packages/components/DatePicker/index.tsx +2 -2
  100. package/src/packages/components/DatePicker/panel/DatePanelDate.tsx +7 -7
  101. package/src/packages/components/DatePicker/panel/DatePanelMonth.tsx +12 -12
  102. package/src/packages/components/DatePicker/useRangeDateRender.tsx +1 -0
  103. package/src/packages/components/Dialog/dialog.scss +7 -4
  104. package/src/packages/components/Dialog/index.tsx +17 -26
  105. package/src/packages/components/Dialog/useDialogMovable.tsx +7 -4
  106. package/src/packages/components/Dialog/utils/dialog.mouse.ts +4 -2
  107. package/src/packages/components/Dropdown/dropdown.public.scss +10 -0
  108. package/src/packages/components/Dropdown/dropdown.utils.tsx +3 -1
  109. package/src/packages/components/Dropdown/index.tsx +2 -2
  110. package/src/packages/components/DropdownOption/index.tsx +3 -3
  111. package/src/packages/components/DropdownSeparator/index.tsx +8 -0
  112. package/src/packages/components/Empty/index.tsx +1 -1
  113. package/src/packages/components/FilterFormMultiple/filter-form-multiple.scss +10 -1
  114. package/src/packages/components/FilterFormMultiple/index.tsx +34 -13
  115. package/src/packages/components/FilterFormSingle/index.tsx +9 -4
  116. package/src/packages/components/FilterService/filter/filter.city.tsx +4 -4
  117. package/src/packages/components/FilterService/filter/filter.date.tsx +4 -4
  118. package/src/packages/components/FilterService/filter/filter.datetime.tsx +2 -2
  119. package/src/packages/components/FilterService/filter/filter.district.tsx +4 -4
  120. package/src/packages/components/FilterService/filter/filter.number.tsx +1 -1
  121. package/src/packages/components/FilterService/filter/filter.province.tsx +4 -4
  122. package/src/packages/components/FilterService/filter/filter.select.tsx +3 -3
  123. package/src/packages/components/FilterService/filter/filter.text.tsx +4 -4
  124. package/src/packages/components/FilterService/filter/fitler.object.tsx +4 -4
  125. package/src/packages/components/FilterService/index.tsx +7 -7
  126. package/src/packages/components/FilterService/utils/filter.service.utils.ts +1 -1
  127. package/src/packages/components/Form/form.scss +85 -2
  128. package/src/packages/components/Form/index.tsx +10 -1
  129. package/src/packages/components/Form/layout/useFormLayout.tsx +88 -23
  130. package/src/packages/components/Form/types/any.tsx +6 -6
  131. package/src/packages/components/Form/types/array.tsx +7 -7
  132. package/src/packages/components/Form/types/date.tsx +6 -6
  133. package/src/packages/components/Form/types/email.tsx +1 -1
  134. package/src/packages/components/Form/types/idcard.tsx +1 -1
  135. package/src/packages/components/Form/types/number.tsx +7 -7
  136. package/src/packages/components/Form/types/phone.tsx +1 -1
  137. package/src/packages/components/Form/types/qq.tsx +1 -1
  138. package/src/packages/components/Form/types/string.tsx +7 -7
  139. package/src/packages/components/Form/validate/createValidation.tsx +6 -2
  140. package/src/packages/components/Form/validate/useFormValidation.tsx +21 -16
  141. package/src/packages/components/Form/validate/validate.utils.tsx +4 -1
  142. package/src/packages/components/FormItem/FormItemValidateMessage.tsx +16 -0
  143. package/src/packages/components/FormItem/index.tsx +31 -18
  144. package/src/packages/components/Formatter/index.tsx +1 -1
  145. package/src/packages/components/Grid/GridCol.tsx +4 -3
  146. package/src/packages/components/Grid/GridRow.tsx +42 -6
  147. package/src/packages/components/Grid/grid.scss +2 -2
  148. package/src/packages/components/Image/image.scss +5 -4
  149. package/src/packages/components/Image/index.tsx +15 -14
  150. package/src/packages/components/ImagePreviewer/ImagePreviewer.tsx +574 -0
  151. package/src/packages/components/ImagePreviewer/ImagePreviewerButtonBar.tsx +140 -0
  152. package/src/packages/components/ImagePreviewer/ImagePreviewerCarouselImage.tsx +54 -0
  153. package/src/packages/components/ImagePreviewer/ImagePreviewerGallery.tsx +202 -0
  154. package/src/packages/components/ImagePreviewer/PreviewerLoading.tsx +26 -0
  155. package/src/packages/components/ImagePreviewer/image-previewer.scss +244 -0
  156. package/src/packages/components/ImagePreviewer/image-previewer.utils.tsx +136 -0
  157. package/src/packages/components/ImagePreviewer/index.tsx +5 -0
  158. package/src/packages/components/ImagePreviewer/previewer-loading.scss +52 -0
  159. package/src/packages/components/ImageUploader/index.tsx +10 -8
  160. package/src/packages/components/Input/index.scss +47 -13
  161. package/src/packages/components/Input/index.tsx +22 -6
  162. package/src/packages/components/Input/input.utils.ts +3 -2
  163. package/src/packages/components/Input/useMultipleInput.tsx +17 -89
  164. package/src/packages/components/Input/useSingleInput.tsx +15 -13
  165. package/src/packages/components/Input/useTextareaInput.tsx +30 -22
  166. package/src/packages/components/Input/uses/useInputEnterHandler.tsx +1 -1
  167. package/src/packages/components/Input/uses/useInputHooks.tsx +11 -11
  168. package/src/packages/components/Input/uses/useInputSuffixIcon.tsx +12 -8
  169. package/src/packages/components/InputNumber/NumberResize.tsx +20 -3
  170. package/src/packages/components/InputNumber/index.tsx +1 -1
  171. package/src/packages/components/InputNumber/input-number.utils.tsx +7 -5
  172. package/src/packages/components/InputNumber/number.scss +17 -2
  173. package/src/packages/components/InputNumber/useInputNumber.public.tsx +25 -6
  174. package/src/packages/components/Layout/index.tsx +31 -0
  175. package/src/packages/components/Layout/layout.scss +227 -0
  176. package/src/packages/components/Layout/layout.utils.ts +3 -0
  177. package/src/packages/components/LayoutSection/index.tsx +67 -0
  178. package/src/packages/components/LayoutSection/useLayoutSectionResizer.tsx +184 -0
  179. package/src/packages/components/Loading/loading.scss +2 -0
  180. package/src/packages/components/LoadingMask/index.tsx +1 -1
  181. package/src/packages/components/Object/createObjectRender.multiple.tsx +1 -1
  182. package/src/packages/components/Object/createObjectRender.single.tsx +7 -3
  183. package/src/packages/components/Object/object.scss +15 -2
  184. package/src/packages/components/Object/object.utils.ts +3 -1
  185. package/src/packages/components/PageCard/index.tsx +48 -0
  186. package/src/packages/components/PageCard/page-card.scss +124 -0
  187. package/src/packages/components/PageCardContent/index.tsx +44 -0
  188. package/src/packages/components/PageCardTitle/index.tsx +51 -0
  189. package/src/packages/components/PageRenderList/index.tsx +22 -0
  190. package/src/packages/components/PageThemeUtils/deepmerge.ts +21 -0
  191. package/src/packages/components/PageThemeUtils/index.tsx +262 -0
  192. package/src/packages/components/Pagination/index.tsx +7 -7
  193. package/src/packages/components/Pagination/pagination.scss +4 -3
  194. package/src/packages/components/Paragraph/index.tsx +46 -0
  195. package/src/packages/components/Paragraph/paragraph.scss +12 -0
  196. package/src/packages/components/ParagraphItem/index.tsx +21 -0
  197. package/src/packages/components/PlcImage/index.tsx +8 -2
  198. package/src/packages/components/PlcObject/index.tsx +1 -1
  199. package/src/packages/components/PlcOv/index.tsx +14 -4
  200. package/src/packages/components/Popup/index.tsx +32 -10
  201. package/src/packages/components/ProgressBar/progress-bar.scss +1 -1
  202. package/src/packages/components/Rate/index.tsx +3 -1
  203. package/src/packages/components/RollingNumber/index.tsx +66 -0
  204. package/src/packages/components/Scroll/HorizontalScrollbar.tsx +7 -3
  205. package/src/packages/components/Scroll/VerticalScrollbar.tsx +7 -3
  206. package/src/packages/components/Scroll/index.tsx +47 -9
  207. package/src/packages/components/Scroll/scroll.scss +4 -2
  208. package/src/packages/components/Select/SelectPanel.tsx +4 -1
  209. package/src/packages/components/Select/createMultipleSelectRender.tsx +4 -4
  210. package/src/packages/components/Select/createPublicSelectRender.tsx +1 -1
  211. package/src/packages/components/Select/select.utils.tsx +1 -1
  212. package/src/packages/components/SelectDisplay/index.tsx +1 -1
  213. package/src/packages/components/SelectGroup/index.tsx +37 -0
  214. package/src/packages/components/Slider/index.tsx +1 -1
  215. package/src/packages/components/Slider/slider.scss +1 -1
  216. package/src/packages/components/Slider/useSliderDotDragier.tsx +7 -4
  217. package/src/packages/components/SortList/index.tsx +191 -0
  218. package/src/packages/components/SortList/sort-list.scss +11 -0
  219. package/src/packages/components/Space/index.tsx +36 -0
  220. package/src/packages/components/Space/space.scss +39 -0
  221. package/src/packages/components/StackCard/index.tsx +416 -0
  222. package/src/packages/components/StackCard/stack-card.scss +40 -0
  223. package/src/packages/components/StackCardItem/index.tsx +24 -0
  224. package/src/packages/components/StepGroup/step-group.scss +9 -9
  225. package/src/packages/components/TabGroup/TabsInner.tsx +5 -3
  226. package/src/packages/components/TabGroup/header/horizontal/tabs-header-horizontal.scss +0 -1
  227. package/src/packages/components/TabGroup/index.tsx +5 -1
  228. package/src/packages/components/TabGroup/tabs.scss +26 -0
  229. package/src/packages/components/Table/editor/PlcAddress.tsx +7 -7
  230. package/src/packages/components/Table/editor/PlcDate.utils.tsx +1 -1
  231. package/src/packages/components/Table/editor/PlcTime.utils.ts +1 -1
  232. package/src/packages/components/Table/plc/use/useBasePlc.tsx +1 -1
  233. package/src/packages/components/Table/plc/useTablePlc.tsx +1 -1
  234. package/src/packages/components/Table/plc/utils/plc.utils.ts +1 -1
  235. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.multiple.tsx +4 -4
  236. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.tsx +1 -1
  237. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.utils.ts +1 -1
  238. package/src/packages/components/Table/standard/PlcExpand.tsx +20 -22
  239. package/src/packages/components/Table/standard/PlcIndex.tsx +1 -1
  240. package/src/packages/components/Table/standard/PlcOperation/OuterOperation.tsx +5 -4
  241. package/src/packages/components/Table/standard/PlcOperation/PlcOperation.tsx +7 -7
  242. package/src/packages/components/Table/standard/PlcOperation/PlcOperation.utils.tsx +2 -0
  243. package/src/packages/components/Table/standard/PlcOperation/outer-operation.scss +5 -3
  244. package/src/packages/components/Table/standard/PlcTree/PlcTree.renderNode.tsx +7 -4
  245. package/src/packages/components/Table/standard/PlcTree/PlcTree.tsx +1 -1
  246. package/src/packages/components/Table/standard/PlcTree/PlcTree.utils.ts +1 -1
  247. package/src/packages/components/Table/standard/PlcTree/RenderPlcTreeNode.tsx +2 -1
  248. package/src/packages/components/Table/table/Table.tsx +11 -3
  249. package/src/packages/components/Table/table/body/cell.tsx +17 -12
  250. package/src/packages/components/Table/table/body/row.tsx +1 -1
  251. package/src/packages/components/Table/table/body/useCellValue.tsx +10 -6
  252. package/src/packages/components/Table/table/head/useHeadCellResize.ts +8 -3
  253. package/src/packages/components/Table/table/table.scss +20 -16
  254. package/src/packages/components/Table/table/use/useTableDraggier.col.tsx +10 -5
  255. package/src/packages/components/Table/table/use/useTableDraggier.row.tsx +31 -14
  256. package/src/packages/components/Table/table/use/useTableDraggier.tsx +1 -1
  257. package/src/packages/components/Table/table/use/useTableFormEditor.tsx +6 -4
  258. package/src/packages/components/Table/table/use/useTableModifyEditor.tsx +8 -8
  259. package/src/packages/components/Table/table/utils/createTableHooks.ts +4 -2
  260. package/src/packages/components/Table/table/utils/table.utils.ts +7 -1
  261. package/src/packages/components/ThemeColor/index.tsx +22 -0
  262. package/src/packages/components/ThemeColor/theme-color.scss +36 -0
  263. package/src/packages/components/ThemeColorSelector/index.tsx +53 -0
  264. package/src/packages/components/ThemeDarkSelector/index.tsx +38 -0
  265. package/src/packages/components/ThemeDarkSelector/theme-dark-selector.scss +5 -0
  266. package/src/packages/components/ThemeEditor/index.tsx +199 -0
  267. package/src/packages/components/ThemeEditor/theme-editor.scss +106 -0
  268. package/src/packages/components/ThemeLocaleSelector/index.tsx +42 -0
  269. package/src/packages/components/ThemeLocaleSelector/theme-locale-selector.scss +5 -0
  270. package/src/packages/components/ThemePrimaryColors/index.ts +5 -0
  271. package/src/packages/components/ThemeShapeSelector/index.tsx +56 -0
  272. package/src/packages/components/ThemeShapeSelector/theme-shape-selector.scss +5 -0
  273. package/src/packages/components/ThemeSizeSelector/index.tsx +51 -0
  274. package/src/packages/components/ThemeSizeSelector/theme-size-selector.scss +5 -0
  275. package/src/packages/components/TimePicker/createRangeTimeRender.tsx +11 -3
  276. package/src/packages/components/TimePicker/createSeparateRangeTimeRender.tsx +11 -3
  277. package/src/packages/components/TimePicker/createSingleTimeRender.tsx +1 -0
  278. package/src/packages/components/TimePicker/index.tsx +1 -1
  279. package/src/packages/components/TimePicker/time.utils.ts +2 -1
  280. package/src/packages/components/TimePicker/useRangeTimeRender.tsx +1 -0
  281. package/src/packages/components/Toggle/index.tsx +6 -2
  282. package/src/packages/components/Toggle/toggle.scss +102 -98
  283. package/src/packages/components/Transition/index.tsx +2 -1
  284. package/src/packages/components/Tree/RenderTreeNode.tsx +9 -4
  285. package/src/packages/components/Tree/index.tsx +4 -3
  286. package/src/packages/components/Tree/tree.scss +42 -9
  287. package/src/packages/components/TreeCore/TreeCore.type.tsx +2 -0
  288. package/src/packages/components/TreeCore/createTreeCore.tsx +5 -1
  289. package/src/packages/components/TreeCore/createTreeDraggier.tsx +71 -57
  290. package/src/packages/components/TreeCore/createTreeMethods.tsx +1 -0
  291. package/src/packages/components/TreeCore/createTreeProps.ts +2 -1
  292. package/src/packages/components/TreeCore/createTreeUtils.ts +1 -1
  293. package/src/packages/components/TreeNodeWithMenu/index.tsx +91 -0
  294. package/src/packages/components/TreeNodeWithMenu/tree-node-with-menu.scss +39 -0
  295. package/src/packages/components/TreeNodeWithMenu/treeNodeWithMenu.utils.ts +12 -0
  296. package/src/packages/components/Upload/index.tsx +12 -12
  297. package/src/packages/components/VirtualList/createVirtualDraggier.ts +375 -0
  298. package/src/packages/components/VirtualList/index.tsx +56 -10
  299. package/src/packages/components/VirtualList/useVirtualList.tsx +239 -115
  300. package/src/packages/components/VirtualList/virtual-list.scss +41 -18
  301. package/src/packages/components/VirtualTable/index.tsx +29 -16
  302. package/src/packages/components/VirtualTable/virtual-table.scss +2 -3
  303. package/src/packages/components/createAutoScrollManager/index.tsx +41 -0
  304. package/src/packages/components/createHttp/index.tsx +4 -1
  305. package/src/packages/components/createPlainAddressService/index.tsx +12 -6
  306. package/src/packages/components/createProvider/index.ts +5 -0
  307. package/src/packages/components/createRequestInterceptor/index.ts +139 -0
  308. package/src/packages/components/createScrollDraggier/index.ts +341 -0
  309. package/src/packages/components/createTransitionHandler/index.ts +46 -0
  310. package/src/packages/components/createVirtualDraggier/index.ts +5 -0
  311. package/src/packages/components/createWebDraggier/index.ts +5 -0
  312. package/src/packages/components/loadFile/index.ts +20 -0
  313. package/src/packages/components/nextPopupId/index.ts +5 -0
  314. package/src/packages/components/useAutoScrollUtils/index.tsx +1 -1
  315. package/src/packages/components/useDialog/DialogService.tsx +22 -10
  316. package/src/packages/components/useDialog/index.tsx +2 -2
  317. package/src/packages/components/useImage/ImageService.tsx +42 -16
  318. package/src/packages/components/useLoading/LoadingService.tsx +106 -0
  319. package/src/packages/components/useLoading/index.tsx +31 -0
  320. package/src/packages/components/useLoading/loading.service.scss +25 -0
  321. package/src/packages/components/useLoading/loading.service.utils.tsx +13 -0
  322. package/src/packages/components/useMessage/Message.tsx +9 -3
  323. package/src/packages/components/useMessage/index.tsx +1 -1
  324. package/src/packages/components/useMessage/message.scss +7 -3
  325. package/src/packages/components/useNotice/Notice.tsx +4 -2
  326. package/src/packages/components/useNotice/index.tsx +2 -2
  327. package/src/packages/components/useNotice/notice.scss +3 -3
  328. package/src/packages/components/usePageRender/index.tsx +3 -0
  329. package/src/packages/components/usePageRenderContext/index.tsx +8 -0
  330. package/src/packages/components/usePopup/PopupItem.tsx +60 -28
  331. package/src/packages/components/usePopup/popup-item.scss +34 -3
  332. package/src/packages/components/usePopup/refresh/MaxMinTopLeft.ts +38 -0
  333. package/src/packages/components/usePopup/refresh/calcPosition.ts +7 -4
  334. package/src/packages/components/usePopup/refresh/refreshPopup.ts +3 -1
  335. package/src/packages/components/usePopup/trigger/useManagerTrigger.clickOutside.tsx +2 -2
  336. package/src/packages/components/usePopup/usePopup.tsx +23 -7
  337. package/src/packages/components/usePopup/usePopupManager.tsx +2 -1
  338. package/src/packages/components/usePopup/utils/popup.utils.ts +7 -2
  339. package/src/packages/components/usePopupManager/index.ts +5 -0
  340. package/src/packages/components/usePopupTrigger/index.tsx +5 -0
  341. package/src/packages/components/useReferenceTrigger/index.tsx +5 -0
  342. package/src/packages/components/useTooltip/index.tsx +16 -3
  343. package/src/packages/components/useWatchAutoClear/index.ts +5 -0
  344. package/src/packages/directives/ResizeDetector/index.tsx +10 -3
  345. package/src/packages/entry.tsx +122 -1
  346. package/src/packages/i18n/i18n.utils.ts +235 -111
  347. package/src/packages/i18n/index.ts +4 -3
  348. package/src/packages/i18n/lang/en-us.ts +257 -185
  349. package/src/packages/i18n/lang/zh-cn.ts +72 -0
  350. package/src/packages/styles/global.import.scss +17 -1
  351. package/src/packages/uses/useCollapseStyles.tsx +56 -0
  352. package/src/packages/uses/useDragHorizontalScroll.ts +82 -0
  353. package/src/packages/uses/useEdit.ts +5 -1
  354. package/src/packages/uses/useStyle.tsx +20 -6
  355. package/src/packages/utils/ClientZoom.ts +24 -2
  356. package/src/packages/utils/ComponentUtils.ts +10 -0
  357. package/src/packages/utils/buildCycleIndexList.ts +31 -0
  358. package/src/packages/utils/createDraggier.ts +256 -0
  359. package/src/packages/utils/createListUtils.ts +38 -0
  360. package/src/packages/utils/findReactElement.tsx +2 -2
  361. package/src/packages/utils/getDeviceInfo.ts +44 -44
  362. package/src/packages/utils/inheritSlots.ts +28 -0
  363. package/src/packages/utils/onParentElementsScroll.tsx +1 -1
  364. package/src/packages/utils/plainDate.ts +6 -2
  365. package/src/packages/utils/renderInputModeTextRangeValue.tsx +25 -0
  366. package/src/packages/utils/useMove.tsx +10 -4
  367. package/src/packages/utils/watchEffectAutoClear.ts +19 -7
  368. package/src/packages/components/CarouselGroup/carousel.scss +0 -143
  369. package/src/packages/components/CarouselGroup/index.tsx +0 -274
  370. package/src/packages/utils/doNothing.ts +0 -3
  371. package/src/packages/utils/findParentElement.ts +0 -12
  372. package/src/packages/utils/formatServiceOptions.ts +0 -7
  373. package/src/packages/utils/getElement.ts +0 -17
  374. package/src/packages/utils/getElementParents.ts +0 -9
  375. package/src/packages/utils/getScrollParent.ts +0 -11
  376. package/src/packages/utils/iterate.ts +0 -53
  377. package/src/packages/utils/omit.ts +0 -6
  378. package/src/packages/utils/pick.ts +0 -11
  379. package/src/packages/utils/runOnce.tsx +0 -14
  380. package/src/pages/data/address.json +0 -39317
  381. package/src/pages/data/data-1.json +0 -754
  382. package/src/pages/data/data-2.json +0 -3006
  383. package/src/pages/data/data-200.json +0 -5206
  384. package/src/pages/data/data-2000.json +0 -51954
  385. package/src/pages/data/data-50.json +0 -2075
  386. package/src/pages/data/data.json +0 -30002
  387. package/src/pages/data/demo.json +0 -1702
  388. package/src/pages/data/mock.database.js +0 -43
  389. package/src/pages/data/mock.js +0 -141
  390. package/src/pages/data/tree.data.json +0 -87
  391. package/src/pages/env/config/local.js +0 -3
  392. package/src/pages/env/config/prod.js +0 -3
  393. package/src/pages/env/config/undefined.js +0 -1
  394. package/src/pages/env/env.d.ts +0 -4
  395. package/src/pages/env/index.ts +0 -1
  396. package/src/pages/history/createHistory.ts +0 -94
  397. package/src/pages/history/history.utils.ts +0 -64
  398. package/src/pages/index/App.tsx +0 -16
  399. package/src/pages/index/Demo/DemoLine.tsx +0 -23
  400. package/src/pages/index/Demo/DemoRow.scss +0 -128
  401. package/src/pages/index/Demo/DemoRow.tsx +0 -71
  402. package/src/pages/index/Demo/DemoRow.utils.ts +0 -23
  403. package/src/pages/index/Demo/DemoRowController.tsx +0 -45
  404. package/src/pages/index/Demo/index.ts +0 -8
  405. package/src/pages/index/PageThemeUtils.tsx +0 -125
  406. package/src/pages/index/app.scss +0 -192
  407. package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +0 -51
  408. package/src/pages/index/components/AutoTable/AutoHeightFixedRow.tsx +0 -50
  409. package/src/pages/index/components/AutoTable/AutoTableBasicUsage.tsx +0 -75
  410. package/src/pages/index/components/AutoTable/AutoTableCascade.tsx +0 -99
  411. package/src/pages/index/components/AutoTable/AutoTableDefaultSearch.tsx +0 -73
  412. package/src/pages/index/components/AutoTable/AutoTableFiles.tsx +0 -26
  413. package/src/pages/index/components/AutoTable/AutoTableFill.tsx +0 -51
  414. package/src/pages/index/components/AutoTable/AutoTableGroupUsage.tsx +0 -71
  415. package/src/pages/index/components/AutoTable/AutoTableObjectPicker.tsx +0 -181
  416. package/src/pages/index/components/AutoTable/AutoTableOvList.tsx +0 -80
  417. package/src/pages/index/components/AutoTable/AutoTableProductList.tsx +0 -98
  418. package/src/pages/index/components/AutoTable/AutoTableRowFormatter.tsx +0 -58
  419. package/src/pages/index/components/AutoTable/FixedHeightAutoRow.tsx +0 -50
  420. package/src/pages/index/components/AutoTable/FixedHeightFixedRow.tsx +0 -49
  421. package/src/pages/index/components/bus/DemoAddress.tsx +0 -181
  422. package/src/pages/index/components/bus/DemoAddressCascade.tsx +0 -132
  423. package/src/pages/index/components/bus/DemoFilter.tsx +0 -184
  424. package/src/pages/index/components/columns/DemoPlcAddress.tsx +0 -161
  425. package/src/pages/index/components/columns/DemoPlcDate.tsx +0 -363
  426. package/src/pages/index/components/columns/DemoPlcSelect.tsx +0 -505
  427. package/src/pages/index/components/columns/DemoPlcTime.tsx +0 -293
  428. package/src/pages/index/components/columns/DemoTableColumns.tsx +0 -88
  429. package/src/pages/index/components/form/DemoFormBasic.tsx +0 -516
  430. package/src/pages/index/components/form/DemoFormBlur.tsx +0 -204
  431. package/src/pages/index/components/form/DemoFormDynamicFields.tsx +0 -54
  432. package/src/pages/index/components/form/DemoFormEditControl.tsx +0 -164
  433. package/src/pages/index/components/form/DemoFormElement.tsx +0 -207
  434. package/src/pages/index/components/form/DemoFormLayout.scss +0 -7
  435. package/src/pages/index/components/form/DemoFormLayout.tsx +0 -311
  436. package/src/pages/index/components/form/DemoFormSimplify.tsx +0 -587
  437. package/src/pages/index/components/form/DemoFormSize.tsx +0 -274
  438. package/src/pages/index/components/form/DemoFormVertical.tsx +0 -280
  439. package/src/pages/index/components/normal/DemoAlert.tsx +0 -66
  440. package/src/pages/index/components/normal/DemoBadge.tsx +0 -53
  441. package/src/pages/index/components/normal/DemoButton.tsx +0 -300
  442. package/src/pages/index/components/normal/DemoCard.tsx +0 -176
  443. package/src/pages/index/components/normal/DemoCarousel.tsx +0 -125
  444. package/src/pages/index/components/normal/DemoCascade.tsx +0 -880
  445. package/src/pages/index/components/normal/DemoCheckbox.scss +0 -24
  446. package/src/pages/index/components/normal/DemoCheckbox.tsx +0 -294
  447. package/src/pages/index/components/normal/DemoCollapse.tsx +0 -104
  448. package/src/pages/index/components/normal/DemoColor.scss +0 -20
  449. package/src/pages/index/components/normal/DemoColor.tsx +0 -82
  450. package/src/pages/index/components/normal/DemoColorPicker.tsx +0 -163
  451. package/src/pages/index/components/normal/DemoDate.tsx +0 -443
  452. package/src/pages/index/components/normal/DemoDialog.tsx +0 -507
  453. package/src/pages/index/components/normal/DemoDropdown.tsx +0 -463
  454. package/src/pages/index/components/normal/DemoGrid.scss +0 -26
  455. package/src/pages/index/components/normal/DemoGrid.tsx +0 -181
  456. package/src/pages/index/components/normal/DemoIcon.tsx +0 -39
  457. package/src/pages/index/components/normal/DemoImage.tsx +0 -122
  458. package/src/pages/index/components/normal/DemoInput.scss +0 -0
  459. package/src/pages/index/components/normal/DemoInput.tsx +0 -790
  460. package/src/pages/index/components/normal/DemoKeepAlive.tsx +0 -505
  461. package/src/pages/index/components/normal/DemoList.scss +0 -15
  462. package/src/pages/index/components/normal/DemoList.tsx +0 -82
  463. package/src/pages/index/components/normal/DemoLoading.tsx +0 -83
  464. package/src/pages/index/components/normal/DemoNumber.tsx +0 -266
  465. package/src/pages/index/components/normal/DemoPagination.tsx +0 -164
  466. package/src/pages/index/components/normal/DemoPopup.tsx +0 -695
  467. package/src/pages/index/components/normal/DemoProgress.tsx +0 -133
  468. package/src/pages/index/components/normal/DemoRadio.scss +0 -16
  469. package/src/pages/index/components/normal/DemoRadio.tsx +0 -188
  470. package/src/pages/index/components/normal/DemoRate.tsx +0 -77
  471. package/src/pages/index/components/normal/DemoScroll.scss +0 -22
  472. package/src/pages/index/components/normal/DemoScroll.tsx +0 -300
  473. package/src/pages/index/components/normal/DemoSegment.tsx +0 -71
  474. package/src/pages/index/components/normal/DemoSelect.tsx +0 -819
  475. package/src/pages/index/components/normal/DemoSlider.tsx +0 -128
  476. package/src/pages/index/components/normal/DemoStep.scss +0 -18
  477. package/src/pages/index/components/normal/DemoStep.tsx +0 -291
  478. package/src/pages/index/components/normal/DemoTab.tsx +0 -338
  479. package/src/pages/index/components/normal/DemoTag.tsx +0 -100
  480. package/src/pages/index/components/normal/DemoTime.tsx +0 -403
  481. package/src/pages/index/components/normal/DemoToggle.tsx +0 -56
  482. package/src/pages/index/components/normal/DemoTooltip.tsx +0 -120
  483. package/src/pages/index/components/normal/DemoTree.tsx +0 -1099
  484. package/src/pages/index/components/normal/DemoUpload.tsx +0 -484
  485. package/src/pages/index/components/normal/DemoVirtualList.tsx +0 -378
  486. package/src/pages/index/components/service/DemoDialogService.tsx +0 -248
  487. package/src/pages/index/components/service/DemoFileService.tsx +0 -110
  488. package/src/pages/index/components/service/DemoMessageService.tsx +0 -100
  489. package/src/pages/index/components/service/DemoNoticeService.tsx +0 -99
  490. package/src/pages/index/components/service/DemoPopupService.tsx +0 -322
  491. package/src/pages/index/components/table/DemoPlcOperation.tsx +0 -307
  492. package/src/pages/index/components/table/DemoTableBasic.tsx +0 -220
  493. package/src/pages/index/components/table/DemoTableCheck.tsx +0 -78
  494. package/src/pages/index/components/table/DemoTableClassAndStyle.scss +0 -18
  495. package/src/pages/index/components/table/DemoTableClassAndStyle.tsx +0 -112
  496. package/src/pages/index/components/table/DemoTableColDraggable.tsx +0 -80
  497. package/src/pages/index/components/table/DemoTableEdit.tsx +0 -136
  498. package/src/pages/index/components/table/DemoTableExpand.tsx +0 -181
  499. package/src/pages/index/components/table/DemoTableFixed.tsx +0 -131
  500. package/src/pages/index/components/table/DemoTableFormatter.tsx +0 -66
  501. package/src/pages/index/components/table/DemoTableOverflowTooltip.tsx +0 -67
  502. package/src/pages/index/components/table/DemoTableRowDraggable.tsx +0 -106
  503. package/src/pages/index/components/table/DemoTableSlots.tsx +0 -153
  504. package/src/pages/index/components/table/DemoTableSpan.tsx +0 -167
  505. package/src/pages/index/components/table/DemoTableTree.tsx +0 -976
  506. package/src/pages/index/components/table/DemoVirtualTable.tsx +0 -274
  507. package/src/pages/index/components/test/DemoI18n.tsx +0 -27
  508. package/src/pages/index/components/test/DemoI18n2.jsx +0 -11
  509. package/src/pages/index/home/AppContent.tsx +0 -69
  510. package/src/pages/index/home/AppHead.tsx +0 -105
  511. package/src/pages/index/home/AppHome.tsx +0 -16
  512. package/src/pages/index/home/AppMenu.tsx +0 -38
  513. package/src/pages/index/home/menus.tsx +0 -217
  514. package/src/pages/index/main.tsx +0 -27
  515. package/src/pages/index/nav/$nav.ts +0 -41
  516. package/src/pages/index/pages.d.ts +0 -6
  517. package/src/pages/libs/iconfont-fontcls/demo.css +0 -539
  518. package/src/pages/libs/iconfont-fontcls/demo_index.html +0 -303
  519. package/src/pages/libs/iconfont-fontcls/iconfont.css +0 -35
  520. package/src/pages/libs/iconfont-fontcls/iconfont.js +0 -1
  521. package/src/pages/libs/iconfont-fontcls/iconfont.json +0 -44
  522. package/src/pages/libs/iconfont-fontcls/iconfont.ttf +0 -0
  523. package/src/pages/libs/iconfont-fontcls/iconfont.woff +0 -0
  524. package/src/pages/libs/iconfont-fontcls/iconfont.woff2 +0 -0
  525. package/src/pages/libs/iconfont-symbol/demo.css +0 -539
  526. package/src/pages/libs/iconfont-symbol/demo_index.html +0 -303
  527. package/src/pages/libs/iconfont-symbol/iconfont.css +0 -35
  528. package/src/pages/libs/iconfont-symbol/iconfont.js +0 -1
  529. package/src/pages/libs/iconfont-symbol/iconfont.json +0 -44
  530. package/src/pages/libs/iconfont-symbol/iconfont.ttf +0 -0
  531. package/src/pages/libs/iconfont-symbol/iconfont.woff +0 -0
  532. package/src/pages/libs/iconfont-symbol/iconfont.woff2 +0 -0
  533. package/src/pages/libs/install.iconfont-fontcls.tsx +0 -11
  534. package/src/pages/libs/install.iconfont-symbol.scss +0 -7
  535. package/src/pages/libs/install.iconfont-symbol.tsx +0 -14
  536. package/src/pages/module/address.ts +0 -27
  537. package/src/pages/module/http.ts +0 -24
  538. package/src/pages/module/index.ts +0 -19
  539. package/src/pages/module/object.ts +0 -5
  540. package/src/pages/module/ov.tsx +0 -13
  541. package/src/pages/module/upload.ts +0 -9
  542. package/src/pages/module/useTableOption.ts +0 -28
@@ -0,0 +1,66 @@
1
+ import {delay, designComponent, onBeforeUnmount, onMounted, reactive, watch} from "plain-design-composition";
2
+ import {createEffects} from "plain-utils/utils/createEffects";
3
+
4
+ export const RollingNumber = designComponent({
5
+ name: 'rolling-number',
6
+ props: {
7
+ val: { type: Number }
8
+ },
9
+ setup({ props }) {
10
+
11
+ const state = reactive({ val: 0 });
12
+
13
+ const utils = {
14
+ update: (space = 1) => {
15
+ // console.log('update');
16
+ space = Math.abs(space);
17
+ const val = state.val;
18
+ if (props.val == null) {
19
+ state.val = 0;
20
+ return;
21
+ }
22
+ if (val == props.val) {
23
+ return;
24
+ }
25
+ if (val > props.val) {
26
+ state.val = Math.max(val - space, props.val);
27
+ delay(20).then(() => utils.update(space));
28
+ } else {
29
+ state.val = Math.min(val + space, props.val);
30
+ delay(20).then(() => utils.update(space));
31
+ }
32
+ },
33
+ format: (num: number) => {
34
+ const [prepend, append] = String(num).split('.');
35
+ const list = String(prepend).split('').reverse();
36
+ const lastIndex = list.length - 1;
37
+ return list.reduce((prev, item, index) => {
38
+ return (lastIndex != index && (index + 1) % 3 == 0 ? ',' : '') + item + prev;
39
+ }, '') + (!append ? '' : `.${append}`);
40
+ },
41
+ };
42
+
43
+ const { effects } = createEffects();
44
+
45
+ onMounted(() => {
46
+ effects.push(
47
+ watch(() => props.val, () => {
48
+ const curVal = state.val || 0;
49
+ const newVal = props.val == null ? 0 : props.val;
50
+ const space = Math.ceil((newVal - curVal) / 50);
51
+ utils.update(space);
52
+ }, { immediate: true })
53
+ );
54
+ });
55
+
56
+ onBeforeUnmount(effects.clear);
57
+
58
+ return () => (
59
+ props.val != null && (
60
+ <span>{utils.format(state.val)}</span>
61
+ )
62
+ );
63
+ },
64
+ });
65
+
66
+ export default RollingNumber;
@@ -5,6 +5,7 @@ import {enableUserSelect} from "plain-utils/dom/enableUserSelect";
5
5
  import {Scroll} from "./index";
6
6
  import {delay} from "plain-utils/utils/delay";
7
7
  import Tooltip from "../Tooltip";
8
+ import {ClientZoom} from "../ClientZoom";
8
9
 
9
10
  export const HorizontalScrollbar = designComponent({
10
11
  props: {
@@ -41,15 +42,17 @@ export const HorizontalScrollbar = designComponent({
41
42
  state.scrollLeft = (e.target as HTMLElement).scrollLeft;
42
43
  },
43
44
  onMousedown: (e: iMouseEvent) => {
45
+ const { clientX } = ClientZoom.getClientPosition(e);
44
46
  scroll.freezeState.isDragging = true;
45
47
  dragState.left = left.value;
46
- dragState.clientX = e.clientX;
48
+ dragState.clientX = clientX;
47
49
  document.addEventListener('mousemove', handler.onMousemove);
48
50
  document.addEventListener('mouseup', handler.onMouseup);
49
51
  disabledUserSelect();
50
52
  },
51
53
  onMousemove: (e: MouseEvent) => {
52
- let deltaX = e.clientX - dragState.clientX;
54
+ const { clientX } = ClientZoom.getClientPosition(e);
55
+ let deltaX = clientX - dragState.clientX;
53
56
  const left = dragState.left + deltaX;
54
57
  let scrollLeft = left * (scroll.state.contentWidth - scroll.state.hostWidth) / (scroll.state.hostWidth - width.value);
55
58
  scrollLeft = Math.max(0, Math.min(scrollLeft, scroll.state.contentWidth - scroll.state.hostWidth));
@@ -66,7 +69,8 @@ export const HorizontalScrollbar = designComponent({
66
69
  enableUserSelect();
67
70
 
68
71
  if (scroll.props.scrollAfterDragEnd) {
69
- let deltaX = e.clientX - dragState.clientX;
72
+ const { clientX } = ClientZoom.getClientPosition(e);
73
+ let deltaX = clientX - dragState.clientX;
70
74
  const left = dragState.left + deltaX;
71
75
  scroll.refs.wrapper!.scrollLeft = left * (scroll.state.contentWidth - scroll.state.hostWidth) / (scroll.state.hostWidth - width.value);
72
76
  }
@@ -5,6 +5,7 @@ import {enableUserSelect} from "plain-utils/dom/enableUserSelect";
5
5
  import {Scroll} from "./index";
6
6
  import {delay} from "plain-utils/utils/delay";
7
7
  import Tooltip from "../Tooltip";
8
+ import {ClientZoom} from "../ClientZoom";
8
9
 
9
10
  export const VerticalScrollbar = designComponent({
10
11
  props: {
@@ -46,15 +47,17 @@ export const VerticalScrollbar = designComponent({
46
47
  state.scrollTop = (e.target as HTMLElement).scrollTop;
47
48
  },
48
49
  onMousedown: (e: iMouseEvent) => {
50
+ const { clientY } = ClientZoom.getClientPosition(e);
49
51
  scroll.freezeState.isDragging = true;
50
52
  dragState.top = top.value;
51
- dragState.clientY = e.clientY;
53
+ dragState.clientY = clientY;
52
54
  document.addEventListener('mousemove', handler.onMousemove);
53
55
  document.addEventListener('mouseup', handler.onMouseup);
54
56
  disabledUserSelect();
55
57
  },
56
58
  onMousemove: (e: MouseEvent) => {
57
- let deltaY = e.clientY - dragState.clientY;
59
+ const { clientY } = ClientZoom.getClientPosition(e);
60
+ let deltaY = clientY - dragState.clientY;
58
61
  let top = dragState.top + deltaY;
59
62
  let scrollTop = top * (scroll.state.contentHeight - scroll.state.hostHeight) / (scroll.state.hostHeight - height.value);
60
63
  scrollTop = Math.max(0, Math.min(scrollTop, scroll.state.contentHeight - scroll.state.hostHeight));
@@ -72,7 +75,8 @@ export const VerticalScrollbar = designComponent({
72
75
  enableUserSelect();
73
76
 
74
77
  if (scroll.props.scrollAfterDragEnd) {
75
- let deltaY = e.clientY - dragState.clientY;
78
+ const { clientY } = ClientZoom.getClientPosition(e);
79
+ let deltaY = clientY - dragState.clientY;
76
80
  let top = dragState.top + deltaY;
77
81
  scroll.refs.wrapper!.scrollTop = top * (scroll.state.contentHeight - scroll.state.hostHeight) / (scroll.state.hostHeight - height.value);
78
82
  }
@@ -8,6 +8,7 @@ import {VerticalScrollbar} from "./VerticalScrollbar";
8
8
  import {HorizontalScrollbar} from "./HorizontalScrollbar";
9
9
  import {ResizeDetectFuncParam, useResizeDetector} from "../../directives/ResizeDetector";
10
10
  import {createScrollUtils} from "../createScrollUtils";
11
+ import {getRectAutoFormat} from "plain-utils/dom/getRectAutoFormat";
11
12
 
12
13
  export enum PLAIN_SCROLL_VERTICAL_POSITION {
13
14
  top = 'top',
@@ -34,9 +35,13 @@ export const Scroll = designComponent({
34
35
  autoScrollSpeed: { type: Number, default: 400 }, // 自动滚动的时候的速度,每秒钟滚动的距离
35
36
  scrollAfterDragEnd: { type: Boolean, }, // 是否拖拽结束后才刷新滚动位置
36
37
  disableListTransition: { type: Boolean, }, // 是否股弄懂的时候禁用list的队列动画
37
- disableTransitionWhenScroll: { type: Boolean }, // 是否在滚动的时候禁用内部所有元素的transition动画
38
+ disableTransitionWhenScroll: { type: Boolean }, // 是否在滚动的时候禁用内部所有元素的transition动画
38
39
  horizontalScrollbarTooltip: { type: String }, // 横向滚动条tooltip显示文本
39
40
  verticalScrollbarTooltip: { type: String }, // 纵向滚动条tooltip显示文本
41
+ mutationSubtree: { type: Boolean, default: true }, // 监听整个子树的节点变化
42
+ mutationChildList: { type: Boolean, default: true }, // 监听整个子树的节点新增与删除
43
+ mutationAttributes: { type: Boolean, default: false }, // 监听整个子树节点的属性变化
44
+
40
45
  },
41
46
  emits: {
42
47
  onScroll: (e: Event) => true,
@@ -78,9 +83,9 @@ export const Scroll = designComponent({
78
83
  set isDragging(val: boolean) {
79
84
  this._isDragging = val;
80
85
  if (val) {
81
- refs.host!.setAttribute('is-dragging', '');
86
+ refs.host?.setAttribute('is-dragging', '');
82
87
  } else {
83
- refs.host!.removeAttribute('is-dragging');
88
+ refs.host?.removeAttribute('is-dragging');
84
89
  }
85
90
  },
86
91
  };
@@ -209,15 +214,48 @@ export const Scroll = designComponent({
209
214
  autoScrollLeft() {scrollUtils.autoScrollLeft();},
210
215
  autoScrollRight() {scrollUtils.autoScrollRight();},
211
216
  stopAutoScroll() {scrollUtils.stopAutoScroll();},
217
+ showElement: (elementSelector: string | HTMLElement): boolean => {
218
+ if (!refs.host || !refs.content) {return false;}
219
+ const selectElement = typeof elementSelector === "string" ? refs.content?.querySelector(elementSelector) : elementSelector;
220
+
221
+ if (selectElement == null) {return false;}
222
+ const selectElementRect = getRectAutoFormat(selectElement as any);
223
+ const contentElementRect = getRectAutoFormat(refs.content);
224
+ const hostElementRect = getRectAutoFormat(refs.host);
225
+
226
+ /*vertical*/
227
+ if (selectElementRect.bottom >= hostElementRect.bottom) {
228
+ /*在下面*/
229
+ const offsetTop = selectElementRect.top - contentElementRect.top;
230
+ methods.scrollTop(offsetTop - (hostElementRect.height - selectElementRect.height));
231
+ } else if (selectElementRect.top <= hostElementRect.top) {
232
+ /*在上面*/
233
+ const offsetTop = selectElementRect.top - contentElementRect.top;
234
+ methods.scrollTop(offsetTop);
235
+ }
236
+
237
+ /*horizontal*/
238
+ if (selectElementRect.right >= hostElementRect.right) {
239
+ /*在右边*/
240
+ const offsetLeft = selectElementRect.left - contentElementRect.left;
241
+ methods.scrollLeft(offsetLeft - (hostElementRect.width - selectElementRect.width));
242
+ } else if (selectElementRect.left <= hostElementRect.left) {
243
+ /*在左边*/
244
+ const offsetLeft = selectElementRect.left - contentElementRect.left;
245
+ methods.scrollLeft(offsetLeft);
246
+ }
247
+
248
+ return true;
249
+ },
212
250
  /**
213
251
  * 禁用list的队列动画,300ms后恢复正常
214
252
  * @author 韦胜健
215
253
  * @date 2020/12/15 10:16
216
254
  */
217
255
  disableListTransition: (() => {
218
- const disabledQueueAnimation = debounce(() => refs.host!.removeAttribute('virtual-scrolling'), 300, true);
256
+ const disabledQueueAnimation = debounce(() => refs.host?.removeAttribute('virtual-scrolling'), 300, true);
219
257
  return () => {
220
- refs.host!.setAttribute('virtual-scrolling', '');
258
+ refs.host?.setAttribute('virtual-scrolling', '');
221
259
  disabledQueueAnimation();
222
260
  };
223
261
  })(),
@@ -227,9 +265,9 @@ export const Scroll = designComponent({
227
265
  * @date 2022.10.28 21:34
228
266
  */
229
267
  disableInnerTransition: (() => {
230
- const disabledQueueAnimation = debounce(() => refs.host!.removeAttribute('disable-all-transition'), 300, true);
268
+ const disabledQueueAnimation = debounce(() => refs.host?.removeAttribute('disable-all-transition'), 300, true);
231
269
  return () => {
232
- refs.host!.setAttribute('disable-all-transition', '');
270
+ refs.host?.setAttribute('disable-all-transition', '');
233
271
  disabledQueueAnimation();
234
272
  };
235
273
  })()
@@ -320,8 +358,8 @@ export const Scroll = designComponent({
320
358
 
321
359
  watch(() => props.refreshState, methods.refresh);
322
360
 
323
- useResizeDetector({ elGetter: () => refs.host, onResize: handler.hostResize });
324
- useResizeDetector({ elGetter: () => refs.content, onResize: handler.contentResize });
361
+ useResizeDetector({ elGetter: () => refs.host, onResize: handler.hostResize, mutateOption: { childList: props.mutationChildList, subtree: props.mutationSubtree, attributes: props.mutationAttributes } });
362
+ useResizeDetector({ elGetter: () => refs.content, onResize: handler.contentResize, mutateOption: { childList: props.mutationChildList, subtree: props.mutationSubtree, attributes: props.mutationAttributes }, });
325
363
 
326
364
  return {
327
365
  refer: {
@@ -110,8 +110,10 @@
110
110
  }
111
111
  }
112
112
  &[disable-all-transition] {
113
- *, *:before, *:after {
114
- transition: none !important;
113
+ *:not([data-force-transition=true]) {
114
+ &, &:before, &:after {
115
+ transition: none !important;
116
+ }
115
117
  }
116
118
  }
117
119
 
@@ -5,6 +5,7 @@ import {Loading} from "../Loading";
5
5
  import Empty from "../Empty";
6
6
  import {ApplicationConfigurationProvider} from "../Application/utils/application.utils";
7
7
  import i18n from "../i18n";
8
+ import {useSearchText} from "../SelectGroup";
8
9
 
9
10
  export const SelectPanel = designComponent({
10
11
  name: 'select-panel',
@@ -27,6 +28,8 @@ export const SelectPanel = designComponent({
27
28
 
28
29
  const applicationConfiguration = ApplicationConfigurationProvider.inject();
29
30
 
31
+ useSearchText.provide(() => props.searchText);
32
+
30
33
  const handler = {
31
34
  onClickOption: (selectOptionProps: any, e: MouseEvent,) => {emit.onSelect(selectOptionProps, e);},
32
35
  onEnterOption: emit.onEnterOption,
@@ -43,7 +46,7 @@ export const SelectPanel = designComponent({
43
46
  content = slots.loadingContent(
44
47
  <div className="select-panel-loading">
45
48
  <Loading type="delta"/>
46
- <span>{i18n('base.loading').d('加载中')}</span>
49
+ <span>{i18n.$it('base.loading').d('加载中')}</span>
47
50
  </div>
48
51
  );
49
52
  } else if (props.dataLength === 0) {
@@ -83,11 +83,11 @@ export function createMultipleSelectRender(params: iSelectCompositionParams) {
83
83
  <>
84
84
  {editComputed.value.editable && (
85
85
  <div className="select-panel-header">
86
- {/*<Button onClick={handler.handleCheckAll} size="mini">{i18n('base.select.all').d('全选')}</Button>
87
- <Button onClick={handler.handleUncheckALl} size="mini">{i18n('base.clear').d('清空')}</Button>
88
- <Button onClick={handler.handleCheckReverse} size="mini">{i18n('base.select.reverse').d('反选')}</Button>*/}
86
+ {/*<Button onClick={handler.handleCheckAll} size="mini">{i18n.$it('base.select.all').d('全选')}</Button>
87
+ <Button onClick={handler.handleUncheckALl} size="mini">{i18n.$it('base.clear').d('清空')}</Button>
88
+ <Button onClick={handler.handleCheckReverse} size="mini">{i18n.$it('base.select.reverse').d('反选')}</Button>*/}
89
89
  <Checkbox checkStatus={checkStatus} customReadonly label={
90
- checkStatus !== CheckboxStatus.check ? i18n('base.select.all').d('全选') : i18n('base.clear').d('清空')
90
+ checkStatus !== CheckboxStatus.check ? i18n.$it('base.select.all').d('全选') : i18n.$it('base.clear').d('清空')
91
91
  } onClick={() => {
92
92
  checkStatus !== CheckboxStatus.check ? handler.handleCheckAll() : handler.handleUncheckALl();
93
93
  }}/>
@@ -236,7 +236,7 @@ export function createPublicSelectRender(
236
236
  const { virtualRowSize } = props;
237
237
  return virtualRowSize == null ? SelectDefaultVirtualRowSize[styleComputed.value.size] : virtualRowSize;
238
238
  })()}>
239
- {{ default: ({ item, index }: { item: iSelectOptionProps, index: number }) => <SelectOption {...item} index={index} key={index}/> }}
239
+ {{ default: ({ item, index, vIndex }: { item: iSelectOptionProps, index: number, vIndex: number }) => <SelectOption {...item} index={index} key={vIndex}/> }}
240
240
  </VirtualList>
241
241
  </div>) : (
242
242
  matchOptionPropsList.map((i, index) => (<SelectOption {...i} index={index}/>))
@@ -151,7 +151,7 @@ export const SelectUtils = {
151
151
  if (!!props.isMatchSearch) {
152
152
  return props.isMatchSearch(searchText, optionProps);
153
153
  }
154
- return !!optionProps.label && optionProps.label.indexOf(searchText) > -1;
154
+ return !!optionProps.label && optionProps.label.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
155
155
  },
156
156
  };
157
157
 
@@ -1,6 +1,6 @@
1
1
  import {designComponent} from "plain-design-composition";
2
2
  import {createSelectOptionDecoder} from "../Select/createSelectOptionDecoder";
3
- import {pick} from "../../utils/pick";
3
+ import {pick} from "plain-utils/object/pick";
4
4
  import {EditProps} from "../../uses/useEdit";
5
5
  import {useMultipleModel} from "../../uses/useMultipleModel";
6
6
  import {toArray} from "plain-utils/utils/toArray";
@@ -0,0 +1,37 @@
1
+ import {designComponent, inject, provide} from "plain-design-composition";
2
+ import DropdownGroup from "../DropdownGroup";
3
+
4
+ export const SelectGroup = designComponent({
5
+ name: 'select-group',
6
+ props: {
7
+ title: { type: String },
8
+ },
9
+ slots: ['default'],
10
+ setup({ props, slots }) {
11
+
12
+ const searchText = useSearchText.inject();
13
+
14
+ return () => {
15
+ return (
16
+ /*有搜索关键词的时候不显示分组标题*/
17
+ !searchText?.()?.length && (
18
+ <DropdownGroup>
19
+ {slots.default(props.title)}
20
+ </DropdownGroup>
21
+ )
22
+ );
23
+ };
24
+ },
25
+ });
26
+
27
+ export const useSearchText = (() => {
28
+ const PROVIDE_NAME = '@@SEARCH_TEXT_PROVIDER';
29
+ return {
30
+ provide: (getSearchText: () => string | null | undefined) => {
31
+ provide(PROVIDE_NAME, getSearchText);
32
+ },
33
+ inject: () => {
34
+ return inject(PROVIDE_NAME) as (() => string | null | undefined) | undefined | null;
35
+ },
36
+ };
37
+ })();
@@ -7,7 +7,7 @@ import {createSliderHooks, createSliderUtils, iSliderPublicParams, SliderEmitsOp
7
7
  import {useWatchAutoClear} from "../../utils/watchEffectAutoClear";
8
8
  import {useSliderRange} from "./useSlider.range";
9
9
  import {useSliderSingle} from "./useSlider.single";
10
- import {doNothing} from "../../utils/doNothing";
10
+ import {doNothing} from "plain-utils/utils/doNothing";
11
11
 
12
12
  export const Slider = designComponent({
13
13
  name: 'slider',
@@ -47,7 +47,7 @@
47
47
  transition: all 300ms ease;
48
48
  opacity: 0;
49
49
  background-color: rgba(black, 0.8);
50
- color: white;
50
+ color: #ffffff;
51
51
  padding: 3px 6px;
52
52
  line-height: initial;
53
53
  position: absolute;
@@ -3,6 +3,7 @@ import {disabledUserSelect} from "plain-utils/dom/disabledUserSelect";
3
3
  import {enableUserSelect} from "plain-utils/dom/enableUserSelect";
4
4
  import {iMouseEvent, reactive} from "plain-design-composition";
5
5
  import {iSliderHooks} from "./slider.utils";
6
+ import {ClientZoom} from "../ClientZoom";
6
7
 
7
8
  export function useSliderDotDraggier<InitialState>(
8
9
  hooks: iSliderHooks,
@@ -24,10 +25,11 @@ export function useSliderDotDraggier<InitialState>(
24
25
 
25
26
  const handler = {
26
27
  onMousedown: (e: iMouseEvent) => {
28
+ const { clientX, clientY } = ClientZoom.getClientPosition(e);
27
29
  staticState = {
28
30
  start: {
29
- x: e.clientX,
30
- y: e.clientY,
31
+ x: clientX,
32
+ y: clientY,
31
33
  },
32
34
  state: getInitialState(),
33
35
  };
@@ -46,8 +48,9 @@ export function useSliderDotDraggier<InitialState>(
46
48
  },
47
49
  onMousemove: (e: MouseEvent) => {
48
50
  if (!staticState) {return;}
49
- const durX = e.clientX - staticState.start.x;
50
- const durY = e.clientY - staticState.start.y;
51
+ const { clientX, clientY } = ClientZoom.getClientPosition(e);
52
+ const durX = clientX - staticState.start.x;
53
+ const durY = clientY - staticState.start.y;
51
54
  handleDraggier({
52
55
  durX,
53
56
  durY,
@@ -0,0 +1,191 @@
1
+ import {computed, CSSProperties, designComponent, getComponentCls, iHTMLDivElement, iMouseEvent, PropType, reactive, useClasses, useModel, useRefs} from "plain-design-composition";
2
+ import './sort-list.scss';
3
+ import {createEffects} from "plain-utils/utils/createEffects";
4
+ import {addWindowListener} from "plain-utils/dom/addWindowListener";
5
+ import {getRectAutoFormat} from "plain-utils/dom/getRectAutoFormat";
6
+ import {iElementRect} from "../../utils/getRowEl";
7
+
8
+ export const SortList = designComponent({
9
+ name: 'sort-list',
10
+ props: {
11
+ modelValue: { type: Array as PropType<any[]> },
12
+ col: { type: Number, default: 1 },
13
+ space: { type: Number, default: 0 },
14
+ },
15
+ emits: {
16
+ onUpdateModelValue: (val: any[]) => true,
17
+ onDragStart: (data: { item: any, index: number, e: iMouseEvent }) => true,
18
+ },
19
+ scopeSlots: {
20
+ default: (data: { item: any, index: number }) => true,
21
+ },
22
+ setup({ props, scopeSlots, event: { emit } }) {
23
+
24
+ const { refs, onRef } = useRefs({ el: iHTMLDivElement });
25
+
26
+ const model = useModel(() => props.modelValue || [], emit.onUpdateModelValue);
27
+
28
+ const isHorizontal = computed(() => props.col > 1);
29
+
30
+ const classes = useClasses(() => [
31
+ getComponentCls('sort-list'),
32
+ ]);
33
+
34
+ const draggier = (() => {
35
+
36
+ const draggierState = reactive({
37
+ isDragging: false,
38
+ });
39
+
40
+ const mousedown = (e: iMouseEvent, item: any, index: number) => {
41
+ emit.onDragStart({ item, index, e });
42
+
43
+ const { effects: draggierEffects } = createEffects();
44
+ const staticState = {
45
+ start: {
46
+ x: e.clientX,
47
+ y: e.clientY,
48
+ left: 0,
49
+ top: 0,
50
+ },
51
+ siblingRects: (() => {
52
+ const sortItemElements = Array.from(refs.el!.querySelectorAll('.sort-item')) as HTMLElement[];
53
+ return sortItemElements.map((el, index) => {
54
+ return {
55
+ index,
56
+ rects: getRectAutoFormat(el)
57
+ };
58
+ });
59
+ })(),
60
+ dropData: null as null | {
61
+ itemRect: { index: number, rects: Omit<iElementRect, 'right' | 'bottom'> },
62
+ pos: 'prev' | 'next'
63
+ }
64
+ };
65
+ const sourceElement = (e.currentTarget as HTMLElement);
66
+ const sourceRect = getRectAutoFormat(sourceElement);
67
+ staticState.start.left = sourceRect.left;
68
+ staticState.start.top = sourceRect.top;
69
+ let shadowElement: HTMLElement | null = null;
70
+ let indicator: HTMLDivElement | null = null;
71
+ const indicatorSize = 2;
72
+
73
+ draggierEffects.push(addWindowListener('mouseup', draggierEffects.clear));
74
+ draggierEffects.push(addWindowListener('mousemove', (e) => {
75
+ const durX = e.clientX - staticState.start.x;
76
+ const durY = e.clientY - staticState.start.y;
77
+
78
+ if (!draggierState.isDragging) {
79
+ if (Math.abs(durX) > 5 || Math.abs(durY) > 5) {
80
+ draggierState.isDragging = true;
81
+ draggierEffects.push(() => {draggierState.isDragging = false;});
82
+
83
+ shadowElement = sourceElement.cloneNode(true) as HTMLElement;
84
+ shadowElement.style.boxSizing = 'border-box';
85
+ shadowElement.style.position = 'fixed';
86
+ shadowElement.style.top = sourceRect.top + 'px';
87
+ shadowElement.style.left = sourceRect.left + 'px';
88
+ shadowElement.style.height = sourceRect.height + 'px';
89
+ shadowElement.style.width = sourceRect.width + 'px';
90
+ shadowElement.style.opacity = '0.5';
91
+ shadowElement.style.zIndex = '2';
92
+ refs.el!.appendChild(shadowElement);
93
+ draggierEffects.push(() => {refs.el!.removeChild(shadowElement!);});
94
+
95
+ sourceElement.style.opacity = "0";
96
+ draggierEffects.push(() => sourceElement.style.opacity = "");
97
+
98
+ indicator = document.createElement('div') as HTMLDivElement;
99
+ indicator.style.position = 'fixed';
100
+ indicator.style.zIndex = '3';
101
+ refs.el!.appendChild(indicator);
102
+ draggierEffects.push(() => {refs.el!.removeChild(indicator!);});
103
+
104
+ draggierEffects.push(() => {
105
+ if (!staticState.dropData) {return;}
106
+ if (staticState.dropData.itemRect.index === index) {return;}
107
+ let currentIndex = index;
108
+ let targetIndex = staticState.dropData.itemRect.index + (staticState.dropData.pos === 'prev' ? 0 : 1);
109
+ const newData = [...model.value];
110
+ const removeData = newData.splice(currentIndex, 1);
111
+ newData.splice(targetIndex > currentIndex ? targetIndex - 1 : targetIndex, 0, ...removeData);
112
+ model.value = newData;
113
+ });
114
+ }
115
+ }
116
+ if (!draggierState.isDragging || !shadowElement || !indicator) {
117
+ return;
118
+ }
119
+
120
+ shadowElement.style.top = `${Math.ceil(staticState.start.top + durY)}px`;
121
+ shadowElement.style.left = `${Math.ceil(staticState.start.left + durX)}px`;
122
+
123
+ const matchItemRect = staticState.siblingRects.find(i => {
124
+ return e.clientY > i.rects.top && e.clientY < i.rects.top + i.rects.height && e.clientX > i.rects.left && e.clientX < i.rects.left + i.rects.width;
125
+ });
126
+ if (!matchItemRect) {
127
+ staticState.dropData = null;
128
+ indicator.style.display = 'none';
129
+ } else {
130
+ staticState.dropData = {
131
+ itemRect: matchItemRect,
132
+ pos: (() => {
133
+ if (isHorizontal.value) {
134
+ return e.clientX > matchItemRect.rects.left + matchItemRect.rects.width / 2 ? 'next' : 'prev';
135
+ } else {
136
+ return e.clientY > matchItemRect.rects.top + matchItemRect.rects.height / 2 ? 'next' : 'prev';
137
+ }
138
+ })()
139
+ };
140
+ indicator.style.display = 'block';
141
+ indicator.style.backgroundColor = 'black';
142
+ if (isHorizontal.value) {
143
+ indicator.style.top = matchItemRect.rects.top + 'px';
144
+ indicator.style.height = matchItemRect.rects.height + 'px';
145
+ indicator.style.left = matchItemRect.rects.left + (staticState.dropData.pos === 'prev' ? (-indicatorSize / 2 - props.space / 2) : (matchItemRect.rects.width + props.space / 2 - indicatorSize / 2)) + 'px';
146
+ indicator.style.width = indicatorSize + 'px';
147
+ } else {
148
+ indicator.style.left = matchItemRect.rects.left + 'px';
149
+ indicator.style.width = matchItemRect.rects.width + 'px';
150
+ indicator.style.top = matchItemRect.rects.top + (staticState.dropData.pos === 'prev' ? (-indicatorSize / 2 - props.space / 2) : (matchItemRect.rects.height + props.space / 2 - indicatorSize / 2)) + 'px';
151
+ indicator.style.height = indicatorSize + 'px';
152
+ }
153
+ }
154
+ }));
155
+ };
156
+
157
+ return { mousedown };
158
+ })();
159
+
160
+ return () => (
161
+ <div
162
+ className={classes.value}
163
+ data-direction={isHorizontal.value ? 'horizontal' : 'vertical'}
164
+ ref={onRef.el}
165
+ >
166
+ {model.value.map((item, index) => {
167
+ const styles = {} as CSSProperties;
168
+ if (props.col !== 1) {
169
+ styles.width = `calc((100% - ${(props.col - 1) * props.space}px) / ${props.col})`;
170
+ if ((index + 1) % props.col !== 0) {
171
+ styles.marginRight = props.space + 'px';
172
+ }
173
+ } else {
174
+ styles.width = '100%';
175
+ }
176
+ styles.marginBottom = props.space + 'px';
177
+ return (
178
+ <div
179
+ className="sort-item"
180
+ style={styles}
181
+ key={index}
182
+ onMouseDown={e => draggier.mousedown(e, item, index)}
183
+ >
184
+ {scopeSlots.default({ item, index }, null)}
185
+ </div>
186
+ );
187
+ })}
188
+ </div>
189
+ );
190
+ },
191
+ });
@@ -0,0 +1,11 @@
1
+ @include comp(sort-list) {
2
+ user-select: none;
3
+ &[data-direction=horizontal] {
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ }
7
+ &[data-direction=vertical] {
8
+ display: flex;
9
+ flex-direction: column;
10
+ }
11
+ }