plain-design 1.0.0-beta.12 → 1.0.0-beta.120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (718) hide show
  1. package/dist/plain-design.commonjs.min.js +3 -3
  2. package/dist/plain-design.min.css +63 -48
  3. package/dist/plain-design.min.js +3 -3
  4. package/dist/report.html +5 -5
  5. package/package.json +50 -48
  6. package/src/packages/build.ts +2 -10
  7. package/src/packages/components/$address/createAddressService.tsx +27 -3
  8. package/src/packages/components/$configuration/index.tsx +2 -2
  9. package/src/packages/components/$file/index.tsx +2 -2
  10. package/src/packages/components/$loading/index.tsx +3 -0
  11. package/src/packages/components/$message/image.service.utils.tsx +3 -3
  12. package/src/packages/components/$object/createObjectService.tsx +43 -29
  13. package/src/packages/components/$object/object.conver.ts +1 -1
  14. package/src/packages/components/$object/object.service.utils.ts +8 -4
  15. package/src/packages/components/$ov/createOvService.ts +2 -2
  16. package/src/packages/components/$previewer/ImagePreviewerFixedContainer.tsx +108 -0
  17. package/src/packages/components/$previewer/image-previewer-fixed-container.scss +18 -0
  18. package/src/packages/components/$previewer/index.tsx +52 -0
  19. package/src/packages/components/$search/SearchFooter.tsx +32 -0
  20. package/src/packages/components/$search/SearchList.tsx +207 -0
  21. package/src/packages/components/$search/SearchServicePanel.tsx +233 -0
  22. package/src/packages/components/$search/createSearchService.tsx +43 -0
  23. package/src/packages/components/$search/index.tsx +6 -0
  24. package/src/packages/components/$search/search-service.scss +221 -0
  25. package/src/packages/components/$search/search.utils.tsx +112 -0
  26. package/src/packages/components/$upload/createUploadService.tsx +1 -1
  27. package/src/packages/components/$upload/upload.utils.ts +7 -6
  28. package/src/packages/components/Address/index.tsx +2 -2
  29. package/src/packages/components/AddressCascade/address-cascade.utils.ts +1 -1
  30. package/src/packages/components/AddressCascade/createAddressCascade.hooks.ts +1 -1
  31. package/src/packages/components/AddressCascade/createAddressCascade.multiple.tsx +6 -6
  32. package/src/packages/components/AddressCascade/createAddressCascade.single.tsx +7 -7
  33. package/src/packages/components/AddressCascade/index.tsx +3 -1
  34. package/src/packages/components/Alert/alert.scss +7 -4
  35. package/src/packages/components/Alert/index.tsx +5 -5
  36. package/src/packages/components/Application/index.tsx +7 -4
  37. package/src/packages/components/Application/service/createApplicationService.tsx +2 -2
  38. package/src/packages/components/Application/service/createApplicationServiceComponent.tsx +1 -1
  39. package/src/packages/components/Application/service/createApplicationServiceManager.tsx +7 -4
  40. package/src/packages/components/Application/service/useApplicationService.tsx +5 -3
  41. package/src/packages/components/Application/theme/theme.ts +50 -28
  42. package/src/packages/components/Application/utils/application.utils.ts +5 -10
  43. package/src/packages/components/Application/utils/createServiceReadyObserver.ts +1 -1
  44. package/src/packages/components/ArrowStep/index.tsx +1 -1
  45. package/src/packages/components/ArrowStepGroup/arrow-step.scss +17 -4
  46. package/src/packages/components/ArrowStepGroup/index.tsx +2 -2
  47. package/src/packages/components/AutoLoadingObserver/index.tsx +173 -0
  48. package/src/packages/components/AutoTable/AutoTable.tsx +2 -2
  49. package/src/packages/components/AutoTable/auto-table.scss +62 -20
  50. package/src/packages/components/AutoTable/filter/useTableOption.filter.form.tsx +8 -9
  51. package/src/packages/components/AutoTable/filter/useTableOption.filter.search.tsx +7 -7
  52. package/src/packages/components/AutoTable/filter/useTableOption.filter.state.ts +2 -2
  53. package/src/packages/components/AutoTable/setting/useTableOption.setting.all.fitler.tsx +5 -5
  54. package/src/packages/components/AutoTable/setting/useTableOption.setting.cache.tsx +19 -19
  55. package/src/packages/components/AutoTable/setting/useTableOption.setting.config.tsx +13 -13
  56. package/src/packages/components/AutoTable/setting/useTableOption.setting.export.tsx +23 -23
  57. package/src/packages/components/AutoTable/setting/useTableOption.setting.import.tsx +4 -4
  58. package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.filter.tsx +14 -14
  59. package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.sort.tsx +8 -8
  60. package/src/packages/components/AutoTable/setting/useTableOption.setting.tsx +3 -3
  61. package/src/packages/components/AutoTable/setting/useTableOption.setting.utils.ts +2 -2
  62. package/src/packages/components/AutoTable/use/useTableOption.buttons.tsx +31 -19
  63. package/src/packages/components/AutoTable/use/useTableOption.cache.ts +3 -3
  64. package/src/packages/components/AutoTable/use/useTableOption.check.tsx +4 -4
  65. package/src/packages/components/AutoTable/use/useTableOption.column.popper.tsx +13 -12
  66. package/src/packages/components/AutoTable/use/useTableOption.confirm.tsx +5 -5
  67. package/src/packages/components/AutoTable/use/useTableOption.fill.tsx +8 -7
  68. package/src/packages/components/AutoTable/use/useTableOption.hooks.tsx +11 -3
  69. package/src/packages/components/AutoTable/use/useTableOption.loading.tsx +12 -6
  70. package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +23 -21
  71. package/src/packages/components/AutoTable/use/useTableOption.pagination.tsx +10 -5
  72. package/src/packages/components/AutoTable/use/useTableOption.parent.tsx +2 -2
  73. package/src/packages/components/AutoTable/use/useTableOption.permission.tsx +1 -1
  74. package/src/packages/components/AutoTable/use/useTableOption.sort.ts +9 -9
  75. package/src/packages/components/AutoTable/use/useTableOption.state.tsx +2 -1
  76. package/src/packages/components/AutoTable/use/useTableOption.table.tsx +11 -4
  77. package/src/packages/components/AutoTable/use/useTableOption.tips.tsx +2 -2
  78. package/src/packages/components/AutoTable/use/useTableOptionKeyboard.tsx +7 -3
  79. package/src/packages/components/AutoTable/utils/AutoModule.ts +1 -1
  80. package/src/packages/components/AutoTable/utils/AutoTable.utils.ts +1 -1
  81. package/src/packages/components/AutoTable/utils/TableOption.space.tsx +7 -3
  82. package/src/packages/components/AutoTable/utils/TableOption.url.ts +1 -1
  83. package/src/packages/components/AutoTable/utils/TableOption.utils.tsx +4 -4
  84. package/src/packages/components/AutoWidthInput/index.tsx +2 -2
  85. package/src/packages/components/Badge/badge.scss +5 -1
  86. package/src/packages/components/Badge/index.tsx +1 -1
  87. package/src/packages/components/Box/box.scss +6 -0
  88. package/src/packages/components/Box/index.tsx +30 -0
  89. package/src/packages/components/Button/button.scss +41 -9
  90. package/src/packages/components/Button/index.tsx +71 -13
  91. package/src/packages/components/ButtonGroup/button-group.scss +2 -2
  92. package/src/packages/components/ButtonGroup/index.tsx +3 -3
  93. package/src/packages/components/Card/card.scss +1 -1
  94. package/src/packages/components/Card/index.tsx +2 -2
  95. package/src/packages/components/Carousel/carousel.scss +391 -0
  96. package/src/packages/components/Carousel/index.tsx +569 -22
  97. package/src/packages/components/CarouselItem/index.tsx +77 -0
  98. package/src/packages/components/Cascade/CascadeKeys.tsx +158 -0
  99. package/src/packages/components/Cascade/cascade.scss +2 -2
  100. package/src/packages/components/Cascade/cascade.utils.ts +1 -1
  101. package/src/packages/components/Cascade/createCascadeHooks.ts +1 -1
  102. package/src/packages/components/Cascade/createCascadePopper.tsx +5 -4
  103. package/src/packages/components/Cascade/createCascadeUtils.ts +2 -2
  104. package/src/packages/components/Cascade/createMultipleCascadeRender.tsx +5 -6
  105. package/src/packages/components/Cascade/createSingleCascadeRender.tsx +7 -8
  106. package/src/packages/components/Cascade/index.tsx +3 -3
  107. package/src/packages/components/CascadeKeys/index.tsx +5 -0
  108. package/src/packages/components/CascadePanel/cascade-panel.utils.ts +3 -3
  109. package/src/packages/components/CascadePanel/flat/CascadeFlatPanelNode.tsx +1 -1
  110. package/src/packages/components/CascadePanel/flat/cascade-flat-panel.scss +22 -34
  111. package/src/packages/components/CascadePanel/flat/createCascadeFlatRender.tsx +15 -10
  112. package/src/packages/components/CascadePanel/index.tsx +22 -4
  113. package/src/packages/components/CascadePanel/list/CascadeListPanelItem.tsx +4 -4
  114. package/src/packages/components/CascadePanel/list/CascadeListPanelNode.tsx +1 -1
  115. package/src/packages/components/CascadePanel/list/createCascadeListRender.tsx +6 -2
  116. package/src/packages/components/Checkbox/checkbox.scss +4 -0
  117. package/src/packages/components/Checkbox/index.tsx +5 -5
  118. package/src/packages/components/CheckboxGroup/index.tsx +3 -3
  119. package/src/packages/components/CheckboxInner/checkbox-inner.scss +2 -1
  120. package/src/packages/components/CheckboxInner/index.tsx +1 -1
  121. package/src/packages/components/Collapse/index.tsx +2 -2
  122. package/src/packages/components/CollapseGroup/index.tsx +1 -1
  123. package/src/packages/components/CollapseTransition/index.tsx +5 -5
  124. package/src/packages/components/ColorPicker/ColorPanel.tsx +1 -1
  125. package/src/packages/components/ColorPicker/color-picker.scss +6 -0
  126. package/src/packages/components/ColorPicker/index.tsx +2 -2
  127. package/src/packages/components/ColorPicker/sub/ColorAlphaSlider.tsx +1 -1
  128. package/src/packages/components/ColorPicker/sub/ColorHueSlider.tsx +1 -1
  129. package/src/packages/components/ColorPicker/sub/ColorSlider.tsx +5 -5
  130. package/src/packages/components/ColorPicker/sub/ColorSvPanel.tsx +4 -4
  131. package/src/packages/components/ColorPicker/useColorPanelEditor.tsx +1 -1
  132. package/src/packages/components/ColorPicker/useColorPanelHistory.tsx +1 -1
  133. package/src/packages/components/ColorPicker/utils/color-picker.utils.tsx +1 -1
  134. package/src/packages/components/ConfirmPopup/confirm-popup.scss +16 -0
  135. package/src/packages/components/ConfirmPopup/index.tsx +72 -0
  136. package/src/packages/components/Corner/corner.scss +14 -0
  137. package/src/packages/components/Corner/index.tsx +80 -0
  138. package/src/packages/components/DatePicker/createDateRender.multiple.tsx +8 -7
  139. package/src/packages/components/DatePicker/createDateRender.single.tsx +9 -7
  140. package/src/packages/components/DatePicker/createRangeDateRender.range.tsx +36 -28
  141. package/src/packages/components/DatePicker/createRangeDateRender.separate.tsx +14 -6
  142. package/src/packages/components/DatePicker/date.scss +2 -2
  143. package/src/packages/components/DatePicker/date.utils.tsx +6 -5
  144. package/src/packages/components/DatePicker/index.tsx +5 -3
  145. package/src/packages/components/DatePicker/panel/DatePanel.tsx +1 -1
  146. package/src/packages/components/DatePicker/panel/DatePanelDate.tsx +9 -9
  147. package/src/packages/components/DatePicker/panel/DatePanelMonth.tsx +13 -13
  148. package/src/packages/components/DatePicker/panel/DatePanelQuarter.tsx +1 -1
  149. package/src/packages/components/DatePicker/panel/DatePanelRange.tsx +1 -1
  150. package/src/packages/components/DatePicker/panel/DatePanelWeek.tsx +1 -1
  151. package/src/packages/components/DatePicker/panel/DatePanelYear.tsx +1 -1
  152. package/src/packages/components/DatePicker/panel/useDatePanel.tsx +2 -2
  153. package/src/packages/components/DatePicker/panel/useDateWeek.tsx +2 -2
  154. package/src/packages/components/DatePicker/useRangeDateRender.tsx +9 -8
  155. package/src/packages/components/Dialog/dialog.scss +7 -4
  156. package/src/packages/components/Dialog/index.tsx +21 -31
  157. package/src/packages/components/Dialog/useDialogMovable.tsx +1 -1
  158. package/src/packages/components/Dialog/utils/dialog.utils.ts +1 -1
  159. package/src/packages/components/Dropdown/dropdown.public.scss +10 -0
  160. package/src/packages/components/Dropdown/dropdown.utils.tsx +5 -4
  161. package/src/packages/components/Dropdown/index.tsx +6 -6
  162. package/src/packages/components/DropdownGroup/index.tsx +1 -1
  163. package/src/packages/components/DropdownOption/index.tsx +4 -4
  164. package/src/packages/components/DropdownSeparator/index.tsx +8 -0
  165. package/src/packages/components/Empty/index.tsx +2 -2
  166. package/src/packages/components/FilterFormMultiple/filter-form-multiple.scss +10 -1
  167. package/src/packages/components/FilterFormMultiple/index.tsx +36 -15
  168. package/src/packages/components/FilterFormSingle/index.tsx +12 -7
  169. package/src/packages/components/FilterService/filter/filter.city.tsx +5 -5
  170. package/src/packages/components/FilterService/filter/filter.date.tsx +4 -4
  171. package/src/packages/components/FilterService/filter/filter.datetime.tsx +2 -2
  172. package/src/packages/components/FilterService/filter/filter.district.tsx +5 -5
  173. package/src/packages/components/FilterService/filter/filter.number.tsx +1 -1
  174. package/src/packages/components/FilterService/filter/filter.province.tsx +5 -5
  175. package/src/packages/components/FilterService/filter/filter.select.tsx +5 -5
  176. package/src/packages/components/FilterService/filter/filter.text.tsx +4 -4
  177. package/src/packages/components/FilterService/filter/fitler.object.tsx +5 -5
  178. package/src/packages/components/FilterService/index.tsx +9 -9
  179. package/src/packages/components/FilterService/utils/filter.service.utils.ts +3 -3
  180. package/src/packages/components/FilterService/utils/mergeQueryParam.ts +3 -3
  181. package/src/packages/components/Form/form.scss +85 -2
  182. package/src/packages/components/Form/index.tsx +11 -2
  183. package/src/packages/components/Form/layout/useFormLayout.tsx +92 -27
  184. package/src/packages/components/Form/types/any.tsx +7 -7
  185. package/src/packages/components/Form/types/array.tsx +8 -8
  186. package/src/packages/components/Form/types/date.tsx +7 -7
  187. package/src/packages/components/Form/types/email.tsx +1 -1
  188. package/src/packages/components/Form/types/idcard.tsx +1 -1
  189. package/src/packages/components/Form/types/number.tsx +8 -8
  190. package/src/packages/components/Form/types/phone.tsx +1 -1
  191. package/src/packages/components/Form/types/qq.tsx +1 -1
  192. package/src/packages/components/Form/types/string.tsx +8 -8
  193. package/src/packages/components/Form/validate/createValidation.tsx +8 -4
  194. package/src/packages/components/Form/validate/useFormItemValidation.tsx +25 -27
  195. package/src/packages/components/Form/validate/useFormValidation.tsx +22 -17
  196. package/src/packages/components/Form/validate/validate.utils.tsx +8 -5
  197. package/src/packages/components/FormItem/FormItemValidateMessage.tsx +16 -0
  198. package/src/packages/components/FormItem/createFormEditor.tsx +2 -2
  199. package/src/packages/components/FormItem/index.tsx +31 -18
  200. package/src/packages/components/Formatter/index.tsx +1 -1
  201. package/src/packages/components/Grid/GridCol.tsx +5 -4
  202. package/src/packages/components/Grid/GridRow.tsx +44 -8
  203. package/src/packages/components/Grid/grid.scss +2 -2
  204. package/src/packages/components/Icon/icon.registry.tsx +2 -2
  205. package/src/packages/components/Icon/index.tsx +3 -3
  206. package/src/packages/components/Illustration/index.tsx +1 -1
  207. package/src/packages/components/Image/image.scss +5 -4
  208. package/src/packages/components/Image/index.tsx +19 -17
  209. package/src/packages/components/ImagePreviewer/ImagePreviewer.tsx +574 -0
  210. package/src/packages/components/ImagePreviewer/ImagePreviewerButtonBar.tsx +140 -0
  211. package/src/packages/components/ImagePreviewer/ImagePreviewerCarouselImage.tsx +54 -0
  212. package/src/packages/components/ImagePreviewer/ImagePreviewerGallery.tsx +202 -0
  213. package/src/packages/components/ImagePreviewer/PreviewerLoading.tsx +26 -0
  214. package/src/packages/components/ImagePreviewer/image-previewer.scss +244 -0
  215. package/src/packages/components/ImagePreviewer/image-previewer.utils.tsx +136 -0
  216. package/src/packages/components/ImagePreviewer/index.tsx +5 -0
  217. package/src/packages/components/ImagePreviewer/previewer-loading.scss +52 -0
  218. package/src/packages/components/ImageUploader/index.tsx +38 -20
  219. package/src/packages/components/Input/index.scss +60 -14
  220. package/src/packages/components/Input/index.tsx +23 -7
  221. package/src/packages/components/Input/input.utils.ts +4 -3
  222. package/src/packages/components/Input/useMultipleInput.tsx +27 -101
  223. package/src/packages/components/Input/useSingleInput.tsx +17 -15
  224. package/src/packages/components/Input/useSuggestionInput.tsx +7 -8
  225. package/src/packages/components/Input/useTextareaInput.tsx +29 -26
  226. package/src/packages/components/Input/uses/useInputEnterHandler.tsx +16 -12
  227. package/src/packages/components/Input/uses/useInputHooks.tsx +12 -12
  228. package/src/packages/components/Input/uses/useInputMaxLength.tsx +1 -1
  229. package/src/packages/components/Input/uses/useInputSuffixIcon.tsx +14 -10
  230. package/src/packages/components/InputGroup/index.tsx +1 -1
  231. package/src/packages/components/InputNumber/NumberResize.tsx +17 -4
  232. package/src/packages/components/InputNumber/index.tsx +2 -2
  233. package/src/packages/components/InputNumber/input-number.utils.tsx +8 -6
  234. package/src/packages/components/InputNumber/number.scss +20 -2
  235. package/src/packages/components/InputNumber/number.utils.ts +1 -1
  236. package/src/packages/components/InputNumber/useInputNumber.multiple.tsx +2 -2
  237. package/src/packages/components/InputNumber/useInputNumber.public.tsx +37 -17
  238. package/src/packages/components/InputNumber/useInputNumber.single.tsx +2 -2
  239. package/src/packages/components/Layout/index.tsx +4 -2
  240. package/src/packages/components/Layout/layout.scss +4 -0
  241. package/src/packages/components/Layout/layout.utils.ts +1 -1
  242. package/src/packages/components/LayoutSection/index.tsx +2 -2
  243. package/src/packages/components/LayoutSection/useLayoutSectionResizer.tsx +2 -2
  244. package/src/packages/components/List/index.tsx +1 -1
  245. package/src/packages/components/Loading/index.tsx +2 -2
  246. package/src/packages/components/Loading/loading.scss +2 -0
  247. package/src/packages/components/LoadingMask/index.tsx +3 -3
  248. package/src/packages/components/NumberRange/index.tsx +2 -2
  249. package/src/packages/components/Object/createObjectHooks.tsx +1 -1
  250. package/src/packages/components/Object/createObjectRender.multiple.tsx +11 -11
  251. package/src/packages/components/Object/createObjectRender.single.tsx +19 -15
  252. package/src/packages/components/Object/index.tsx +3 -3
  253. package/src/packages/components/Object/object.scss +15 -2
  254. package/src/packages/components/Object/object.utils.ts +5 -3
  255. package/src/packages/components/Ov/index.tsx +1 -1
  256. package/src/packages/components/Ov/ov.utils.ts +1 -1
  257. package/src/packages/components/Ov/usePublicOv.tsx +1 -1
  258. package/src/packages/components/PageCard/index.tsx +48 -0
  259. package/src/packages/components/PageCard/page-card.scss +124 -0
  260. package/src/packages/components/PageCardContent/index.tsx +44 -0
  261. package/src/packages/components/PageCardTitle/index.tsx +51 -0
  262. package/src/packages/components/PageRenderList/index.tsx +22 -0
  263. package/src/packages/components/PageThemeUtils/deepmerge.ts +21 -0
  264. package/src/packages/components/PageThemeUtils/index.tsx +186 -51
  265. package/src/packages/components/Pagination/index.tsx +10 -10
  266. package/src/packages/components/Pagination/pagination.scss +4 -3
  267. package/src/packages/components/Paragraph/index.tsx +46 -0
  268. package/src/packages/components/Paragraph/paragraph.scss +12 -0
  269. package/src/packages/components/ParagraphItem/index.tsx +21 -0
  270. package/src/packages/components/PlcImage/index.tsx +9 -3
  271. package/src/packages/components/PlcObject/index.tsx +2 -2
  272. package/src/packages/components/PlcOv/index.tsx +15 -5
  273. package/src/packages/components/Popup/PopupProvider.tsx +1 -2
  274. package/src/packages/components/Popup/index.tsx +14 -4
  275. package/src/packages/components/ProgressBar/index.tsx +1 -1
  276. package/src/packages/components/ProgressBar/progress-bar.scss +1 -1
  277. package/src/packages/components/ProgressBar/progress.utils.ts +2 -2
  278. package/src/packages/components/ProgressCircle/index.tsx +2 -2
  279. package/src/packages/components/ProgressMini/index.tsx +2 -2
  280. package/src/packages/components/Radio/index.tsx +4 -4
  281. package/src/packages/components/RadioGroup/index.tsx +1 -1
  282. package/src/packages/components/RadioInner/index.tsx +1 -1
  283. package/src/packages/components/Rate/index.tsx +3 -3
  284. package/src/packages/components/Reference/ReferenceProvider.tsx +1 -1
  285. package/src/packages/components/Reference/index.tsx +1 -1
  286. package/src/packages/components/RollingNumber/index.tsx +66 -0
  287. package/src/packages/components/Scroll/HorizontalScrollbar.tsx +4 -4
  288. package/src/packages/components/Scroll/VerticalScrollbar.tsx +4 -4
  289. package/src/packages/components/Scroll/index.tsx +51 -13
  290. package/src/packages/components/Scroll/scroll.scss +4 -2
  291. package/src/packages/components/Scroll/useAutoScroll.ts +1 -1
  292. package/src/packages/components/Segment/index.tsx +1 -1
  293. package/src/packages/components/SegmentGroup/index.tsx +1 -1
  294. package/src/packages/components/Select/SelectPanel.tsx +5 -2
  295. package/src/packages/components/Select/createMultipleSelectRender.tsx +16 -12
  296. package/src/packages/components/Select/createPublicSelectRender.tsx +15 -11
  297. package/src/packages/components/Select/createSelectOptionDecoder.tsx +1 -1
  298. package/src/packages/components/Select/createSingleSelectRender.tsx +13 -9
  299. package/src/packages/components/Select/decodeSelectRenderNode.tsx +2 -2
  300. package/src/packages/components/Select/index.tsx +1 -1
  301. package/src/packages/components/Select/select.utils.tsx +3 -3
  302. package/src/packages/components/SelectDisplay/index.tsx +3 -3
  303. package/src/packages/components/SelectGroup/index.tsx +37 -0
  304. package/src/packages/components/SelectOption/index.tsx +2 -2
  305. package/src/packages/components/Slider/index.tsx +3 -3
  306. package/src/packages/components/Slider/slider.scss +1 -1
  307. package/src/packages/components/Slider/slider.utils.tsx +1 -1
  308. package/src/packages/components/Slider/useSlider.range.tsx +13 -10
  309. package/src/packages/components/Slider/useSlider.single.tsx +8 -9
  310. package/src/packages/components/Slider/useSliderDotDragier.tsx +4 -4
  311. package/src/packages/components/SortList/index.tsx +191 -0
  312. package/src/packages/components/SortList/sort-list.scss +11 -0
  313. package/src/packages/components/Space/index.tsx +36 -0
  314. package/src/packages/components/Space/space.scss +39 -0
  315. package/src/packages/components/StackCard/index.tsx +416 -0
  316. package/src/packages/components/StackCard/stack-card.scss +40 -0
  317. package/src/packages/components/StackCardItem/index.tsx +24 -0
  318. package/src/packages/components/Step/index.tsx +1 -1
  319. package/src/packages/components/StepGroup/index.tsx +1 -1
  320. package/src/packages/components/StepGroup/step-group.scss +3 -3
  321. package/src/packages/components/Tab/index.tsx +1 -1
  322. package/src/packages/components/TabGroup/TabsHeader.tsx +1 -1
  323. package/src/packages/components/TabGroup/TabsInner.tsx +5 -3
  324. package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontal.tsx +3 -3
  325. package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalCard.tsx +1 -1
  326. package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalShadow.tsx +1 -1
  327. package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalText.tsx +2 -2
  328. package/src/packages/components/TabGroup/header/vertical/TabsHeaderVertical.tsx +1 -1
  329. package/src/packages/components/TabGroup/index.tsx +2 -2
  330. package/src/packages/components/TabGroup/tabs.scss +23 -0
  331. package/src/packages/components/TabGroup/tabs.utils.tsx +1 -1
  332. package/src/packages/components/Table/editor/PlcAddress.tsx +8 -8
  333. package/src/packages/components/Table/editor/PlcAddressItem.tsx +1 -1
  334. package/src/packages/components/Table/editor/PlcCheckbox.tsx +1 -1
  335. package/src/packages/components/Table/editor/PlcColorPicker.tsx +1 -1
  336. package/src/packages/components/Table/editor/PlcDate.tsx +1 -1
  337. package/src/packages/components/Table/editor/PlcDate.utils.tsx +2 -2
  338. package/src/packages/components/Table/editor/PlcDateRange.tsx +1 -1
  339. package/src/packages/components/Table/editor/PlcInput.tsx +1 -1
  340. package/src/packages/components/Table/editor/PlcNumber.tsx +1 -1
  341. package/src/packages/components/Table/editor/PlcRate.tsx +1 -1
  342. package/src/packages/components/Table/editor/PlcSelect.tsx +1 -1
  343. package/src/packages/components/Table/editor/PlcTextarea.tsx +1 -1
  344. package/src/packages/components/Table/editor/PlcTime.tsx +1 -1
  345. package/src/packages/components/Table/editor/PlcTime.utils.ts +2 -2
  346. package/src/packages/components/Table/editor/PlcTimeRange.tsx +1 -1
  347. package/src/packages/components/Table/editor/PlcToggle.tsx +1 -1
  348. package/src/packages/components/Table/plc/group/PlcGroup.tsx +1 -1
  349. package/src/packages/components/Table/plc/plc/Plc.tsx +1 -1
  350. package/src/packages/components/Table/plc/process/copyPlcList.ts +1 -1
  351. package/src/packages/components/Table/plc/process/processPlcFixed.ts +1 -1
  352. package/src/packages/components/Table/plc/process/processPlcSort.ts +1 -1
  353. package/src/packages/components/Table/plc/use/useBasePlc.tsx +3 -3
  354. package/src/packages/components/Table/plc/use/useBasePlcGroup.tsx +1 -1
  355. package/src/packages/components/Table/plc/use/usePlc.tsx +1 -1
  356. package/src/packages/components/Table/plc/use/usePlcPropsState.tsx +2 -2
  357. package/src/packages/components/Table/plc/useTablePlc.tsx +6 -4
  358. package/src/packages/components/Table/plc/utils/plc.render.ts +1 -1
  359. package/src/packages/components/Table/plc/utils/plc.scope-slots.ts +1 -1
  360. package/src/packages/components/Table/plc/utils/plc.utils.ts +6 -6
  361. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.hooks.tsx +3 -3
  362. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.multiple.tsx +11 -12
  363. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.single.tsx +4 -5
  364. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.tsx +2 -2
  365. package/src/packages/components/Table/standard/PlcCheck/PlcCheck.utils.ts +3 -3
  366. package/src/packages/components/Table/standard/PlcDraggier/PlcDraggier.tsx +2 -2
  367. package/src/packages/components/Table/standard/PlcExclusion.tsx +2 -2
  368. package/src/packages/components/Table/standard/PlcExpand.tsx +22 -24
  369. package/src/packages/components/Table/standard/PlcIndex.tsx +2 -2
  370. package/src/packages/components/Table/standard/PlcOperation/OuterOperation.tsx +7 -6
  371. package/src/packages/components/Table/standard/PlcOperation/PlcOperation.tsx +11 -11
  372. package/src/packages/components/Table/standard/PlcOperation/PlcOperation.utils.tsx +6 -4
  373. package/src/packages/components/Table/standard/PlcOperation/outer-operation.scss +5 -3
  374. package/src/packages/components/Table/standard/PlcOperation/useOperationPermission.ts +1 -1
  375. package/src/packages/components/Table/standard/PlcTree/PlcTree.autoWidth.tsx +1 -1
  376. package/src/packages/components/Table/standard/PlcTree/PlcTree.renderNode.tsx +9 -6
  377. package/src/packages/components/Table/standard/PlcTree/PlcTree.tsx +4 -4
  378. package/src/packages/components/Table/standard/PlcTree/PlcTree.utils.ts +2 -2
  379. package/src/packages/components/Table/standard/PlcTree/PlcTreeHeader.tsx +3 -3
  380. package/src/packages/components/Table/standard/PlcTree/RenderPlcTreeNode.tsx +8 -6
  381. package/src/packages/components/Table/table/Table.tsx +15 -7
  382. package/src/packages/components/Table/table/body/cell.tsx +19 -14
  383. package/src/packages/components/Table/table/body/row.tsx +2 -2
  384. package/src/packages/components/Table/table/body/useCellValue.tsx +12 -8
  385. package/src/packages/components/Table/table/head/head-cell.tsx +2 -2
  386. package/src/packages/components/Table/table/head/useHeadCellResize.ts +4 -4
  387. package/src/packages/components/Table/table/node/useTableNode.tsx +2 -2
  388. package/src/packages/components/Table/table/table.scss +20 -16
  389. package/src/packages/components/Table/table/use/useFixedShadow.ts +2 -2
  390. package/src/packages/components/Table/table/use/useTableDraggier.col.tsx +6 -6
  391. package/src/packages/components/Table/table/use/useTableDraggier.row.tsx +26 -14
  392. package/src/packages/components/Table/table/use/useTableDraggier.tsx +3 -3
  393. package/src/packages/components/Table/table/use/useTableFormEditor.tsx +10 -8
  394. package/src/packages/components/Table/table/use/useTableLoading.tsx +2 -2
  395. package/src/packages/components/Table/table/use/useTableMethods.tsx +2 -2
  396. package/src/packages/components/Table/table/use/useTableModifyEditor.tsx +12 -12
  397. package/src/packages/components/Table/table/use/useTableScroll.tsx +1 -1
  398. package/src/packages/components/Table/table/utils/createTableHooks.ts +6 -4
  399. package/src/packages/components/Table/table/utils/table.utils.ts +9 -3
  400. package/src/packages/components/Tag/index.tsx +1 -1
  401. package/src/packages/components/ThemeColor/index.tsx +22 -0
  402. package/src/packages/components/ThemeColor/theme-color.scss +36 -0
  403. package/src/packages/components/ThemeColorSelector/index.tsx +53 -0
  404. package/src/packages/components/ThemeDarkSelector/index.tsx +37 -0
  405. package/src/packages/components/ThemeEditor/index.tsx +199 -0
  406. package/src/packages/components/ThemeEditor/theme-editor.scss +106 -0
  407. package/src/packages/components/ThemeLocaleSelector/index.tsx +41 -0
  408. package/src/packages/components/ThemeShapeSelector/index.tsx +55 -0
  409. package/src/packages/components/ThemeSizeSelector/index.tsx +50 -0
  410. package/src/packages/components/TimePicker/createRangeTimeRender.tsx +14 -6
  411. package/src/packages/components/TimePicker/createSeparateRangeTimeRender.tsx +14 -6
  412. package/src/packages/components/TimePicker/createSingleTimeRender.tsx +8 -8
  413. package/src/packages/components/TimePicker/index.tsx +2 -2
  414. package/src/packages/components/TimePicker/panel/TimeBaseColumn.tsx +4 -4
  415. package/src/packages/components/TimePicker/panel/TimeBasePanel.tsx +1 -1
  416. package/src/packages/components/TimePicker/panel/TimePanel.tsx +2 -2
  417. package/src/packages/components/TimePicker/panel/TimeRangePanel.tsx +1 -1
  418. package/src/packages/components/TimePicker/panel/time-panel.utils.ts +1 -1
  419. package/src/packages/components/TimePicker/time.utils.ts +3 -2
  420. package/src/packages/components/TimePicker/useRangeTimeRender.tsx +10 -9
  421. package/src/packages/components/TimePicker/useTimeHooks.ts +1 -1
  422. package/src/packages/components/Toggle/index.tsx +10 -6
  423. package/src/packages/components/Toggle/toggle.scss +102 -98
  424. package/src/packages/components/Tooltip/index.tsx +2 -2
  425. package/src/packages/components/Transition/index.tsx +2 -1
  426. package/src/packages/components/Tree/RenderTreeNode.tsx +10 -5
  427. package/src/packages/components/Tree/index.tsx +6 -5
  428. package/src/packages/components/Tree/tree.scss +8 -1
  429. package/src/packages/components/TreeCore/TreeCore.type.tsx +1 -1
  430. package/src/packages/components/TreeCore/createTreeCore.tsx +3 -3
  431. package/src/packages/components/TreeCore/createTreeDraggier.tsx +69 -59
  432. package/src/packages/components/TreeCore/createTreeHooks.ts +1 -1
  433. package/src/packages/components/TreeCore/createTreeMethods.tsx +3 -2
  434. package/src/packages/components/TreeCore/createTreeNode.tsx +9 -5
  435. package/src/packages/components/TreeCore/createTreeProps.ts +3 -3
  436. package/src/packages/components/TreeCore/createTreeUtils.ts +2 -2
  437. package/src/packages/components/TreeNodeWithMenu/index.tsx +44 -6
  438. package/src/packages/components/TreeNodeWithMenu/tree-node-with-menu.scss +1 -0
  439. package/src/packages/components/TreeNodeWithMenu/treeNodeWithMenu.utils.ts +12 -0
  440. package/src/packages/components/Triangle/index.tsx +2 -2
  441. package/src/packages/components/Upload/index.tsx +18 -18
  442. package/src/packages/components/VirtualList/createVirtualDraggier.ts +375 -0
  443. package/src/packages/components/VirtualList/index.tsx +56 -10
  444. package/src/packages/components/VirtualList/useVirtualList.tsx +241 -117
  445. package/src/packages/components/VirtualList/virtual-list.scss +41 -18
  446. package/src/packages/components/VirtualTable/index.tsx +31 -18
  447. package/src/packages/components/VirtualTable/virtual-table.scss +2 -3
  448. package/src/packages/components/createAutoScrollManager/index.tsx +41 -0
  449. package/src/packages/components/createHttp/index.tsx +4 -1
  450. package/src/packages/components/createPlainAddressService/index.tsx +14 -8
  451. package/src/packages/components/createRequestInterceptor/index.ts +139 -0
  452. package/src/packages/components/createScrollDraggier/index.ts +341 -0
  453. package/src/packages/components/createScrollUtils/index.tsx +1 -1
  454. package/src/packages/components/createTransitionHandler/index.ts +46 -0
  455. package/src/packages/components/createVirtualDraggier/index.ts +5 -0
  456. package/src/packages/components/createWebDraggier/index.ts +5 -0
  457. package/src/packages/components/loadFile/index.ts +20 -0
  458. package/src/packages/components/useAutoScrollUtils/index.tsx +4 -4
  459. package/src/packages/components/useDialog/DialogService.tsx +29 -17
  460. package/src/packages/components/useDialog/dialog.service.utils.tsx +5 -5
  461. package/src/packages/components/useDialog/index.tsx +4 -4
  462. package/src/packages/components/useImage/ImageService.tsx +39 -16
  463. package/src/packages/components/useLoading/LoadingService.tsx +106 -0
  464. package/src/packages/components/useLoading/index.tsx +31 -0
  465. package/src/packages/components/useLoading/loading.service.scss +25 -0
  466. package/src/packages/components/useLoading/loading.service.utils.tsx +13 -0
  467. package/src/packages/components/useMessage/Message.tsx +9 -3
  468. package/src/packages/components/useMessage/MessageContainer.tsx +1 -1
  469. package/src/packages/components/useMessage/MessageManager.tsx +1 -1
  470. package/src/packages/components/useMessage/index.tsx +1 -1
  471. package/src/packages/components/useMessage/message.scss +7 -3
  472. package/src/packages/components/useMessage/message.service.utils.tsx +4 -4
  473. package/src/packages/components/useNotice/Notice.tsx +4 -2
  474. package/src/packages/components/useNotice/NoticeContainer.tsx +1 -1
  475. package/src/packages/components/useNotice/NoticeManager.tsx +1 -1
  476. package/src/packages/components/useNotice/index.tsx +2 -2
  477. package/src/packages/components/useNotice/noitice.service.utils.tsx +4 -4
  478. package/src/packages/components/useNotice/notice.scss +3 -3
  479. package/src/packages/components/usePageRender/index.tsx +3 -0
  480. package/src/packages/components/usePageRenderContext/index.tsx +8 -0
  481. package/src/packages/components/usePopup/PopupItem.tsx +64 -36
  482. package/src/packages/components/usePopup/popup-item.scss +34 -3
  483. package/src/packages/components/usePopup/refresh/MaxMinTopLeft.ts +38 -0
  484. package/src/packages/components/usePopup/refresh/calcPosition.ts +7 -4
  485. package/src/packages/components/usePopup/refresh/refreshArrow.ts +1 -1
  486. package/src/packages/components/usePopup/refresh/refreshPopup.ts +3 -1
  487. package/src/packages/components/usePopup/trigger/useManagerTrigger.clickOutside.tsx +4 -4
  488. package/src/packages/components/usePopup/trigger/usePopupTrigger.tsx +2 -2
  489. package/src/packages/components/usePopup/trigger/useReferenceTrigger.tsx +52 -46
  490. package/src/packages/components/usePopup/usePopup.tsx +24 -8
  491. package/src/packages/components/usePopup/usePopupManager.tsx +4 -3
  492. package/src/packages/components/usePopup/utils/createPopupManagerHooks.tsx +1 -1
  493. package/src/packages/components/usePopup/utils/ids2map.ts +1 -1
  494. package/src/packages/components/usePopup/utils/popup.utils.ts +10 -6
  495. package/src/packages/components/usePopupEditor/index.tsx +6 -9
  496. package/src/packages/components/usePopupEditor/popup-editor.utils.ts +1 -1
  497. package/src/packages/components/useTooltip/index.tsx +19 -9
  498. package/src/packages/directives/ClickWave/index.tsx +2 -2
  499. package/src/packages/directives/ResizeDetector/index.tsx +12 -5
  500. package/src/packages/entry.tsx +100 -5
  501. package/src/packages/i18n/i18n.utils.ts +235 -111
  502. package/src/packages/i18n/index.ts +4 -3
  503. package/src/packages/i18n/lang/en-us.ts +257 -185
  504. package/src/packages/i18n/lang/zh-cn.ts +72 -0
  505. package/src/packages/styles/application/application.public.scss +7 -0
  506. package/src/packages/styles/global.import.scss +17 -1
  507. package/src/packages/uses/createInputPopperAttrs.ts +1 -1
  508. package/src/packages/uses/useCollapseStyles.tsx +56 -0
  509. package/src/packages/uses/useDragHorizontalScroll.ts +81 -0
  510. package/src/packages/uses/useEdit.ts +12 -4
  511. package/src/packages/uses/useFocusHandler.ts +26 -13
  512. package/src/packages/uses/useFunctionWrapper.ts +3 -1
  513. package/src/packages/uses/useMultipleModel.tsx +6 -4
  514. package/src/packages/uses/useRenderReference.tsx +1 -1
  515. package/src/packages/uses/useStyle.tsx +21 -7
  516. package/src/packages/utils/ClientZoom.ts +1 -1
  517. package/src/packages/utils/ComponentUtils.ts +10 -0
  518. package/src/packages/utils/FixInput.ts +1 -1
  519. package/src/packages/utils/InnerTransition.ts +2 -2
  520. package/src/packages/utils/LoadingText.ts +1 -1
  521. package/src/packages/utils/OpenController.ts +1 -1
  522. package/src/packages/utils/buildCycleIndexList.ts +31 -0
  523. package/src/packages/utils/constant.tsx +1 -1
  524. package/src/packages/utils/createDraggier.ts +256 -0
  525. package/src/packages/utils/createFlagManager.ts +1 -1
  526. package/src/packages/utils/createListUtils.ts +38 -0
  527. package/src/packages/utils/findReactElement.tsx +3 -3
  528. package/src/packages/utils/getDeviceInfo.ts +45 -45
  529. package/src/packages/utils/getRowEl.ts +2 -2
  530. package/src/packages/utils/incrementalMerge.ts +1 -1
  531. package/src/packages/utils/inheritSlots.ts +30 -0
  532. package/src/packages/utils/installAllIcons.ts +1 -1
  533. package/src/packages/utils/installAllLazyIcons.ts +1 -1
  534. package/src/packages/utils/isObjectCommonMatch.ts +1 -1
  535. package/src/packages/utils/onParentElementsScroll.tsx +2 -2
  536. package/src/packages/utils/plainDate.ts +7 -3
  537. package/src/packages/utils/renderInputModeTextRangeValue.tsx +25 -0
  538. package/src/packages/utils/useMove.tsx +3 -3
  539. package/src/packages/utils/watchEffectAutoClear.ts +19 -7
  540. package/src/packages/components/CarouselGroup/carousel.scss +0 -143
  541. package/src/packages/components/CarouselGroup/index.tsx +0 -274
  542. package/src/packages/components/KeyboardService/index.ts +0 -214
  543. package/src/packages/components/createProvider/index.ts +0 -5
  544. package/src/packages/utils/createProvider.tsx +0 -35
  545. package/src/packages/utils/doNothing.ts +0 -3
  546. package/src/packages/utils/findParentElement.ts +0 -12
  547. package/src/packages/utils/formatServiceOptions.ts +0 -7
  548. package/src/packages/utils/getElement.ts +0 -17
  549. package/src/packages/utils/getElementParents.ts +0 -9
  550. package/src/packages/utils/getScrollParent.ts +0 -11
  551. package/src/packages/utils/iterate.ts +0 -53
  552. package/src/packages/utils/omit.ts +0 -6
  553. package/src/packages/utils/pick.ts +0 -11
  554. package/src/packages/utils/runOnce.tsx +0 -14
  555. package/src/pages/data/address.json +0 -39317
  556. package/src/pages/data/data-1.json +0 -754
  557. package/src/pages/data/data-2.json +0 -3006
  558. package/src/pages/data/data-200.json +0 -5206
  559. package/src/pages/data/data-2000.json +0 -51954
  560. package/src/pages/data/data-50.json +0 -2075
  561. package/src/pages/data/data.json +0 -30002
  562. package/src/pages/data/demo.json +0 -1702
  563. package/src/pages/data/mock.database.js +0 -43
  564. package/src/pages/data/mock.js +0 -141
  565. package/src/pages/data/tree.data.json +0 -87
  566. package/src/pages/env/config/local.js +0 -3
  567. package/src/pages/env/config/prod.js +0 -3
  568. package/src/pages/env/config/undefined.js +0 -1
  569. package/src/pages/env/env.d.ts +0 -4
  570. package/src/pages/env/index.ts +0 -1
  571. package/src/pages/history/createHistory.ts +0 -94
  572. package/src/pages/history/history.utils.ts +0 -64
  573. package/src/pages/index/App.tsx +0 -17
  574. package/src/pages/index/Demo/DemoLine.tsx +0 -23
  575. package/src/pages/index/Demo/DemoRow.scss +0 -128
  576. package/src/pages/index/Demo/DemoRow.tsx +0 -71
  577. package/src/pages/index/Demo/DemoRow.utils.ts +0 -23
  578. package/src/pages/index/Demo/DemoRowController.tsx +0 -45
  579. package/src/pages/index/Demo/index.ts +0 -8
  580. package/src/pages/index/app.scss +0 -197
  581. package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +0 -51
  582. package/src/pages/index/components/AutoTable/AutoHeightFixedRow.tsx +0 -50
  583. package/src/pages/index/components/AutoTable/AutoTableBasicUsage.tsx +0 -75
  584. package/src/pages/index/components/AutoTable/AutoTableCascade.tsx +0 -99
  585. package/src/pages/index/components/AutoTable/AutoTableDefaultSearch.tsx +0 -73
  586. package/src/pages/index/components/AutoTable/AutoTableFiles.tsx +0 -26
  587. package/src/pages/index/components/AutoTable/AutoTableFill.tsx +0 -51
  588. package/src/pages/index/components/AutoTable/AutoTableGroupUsage.tsx +0 -71
  589. package/src/pages/index/components/AutoTable/AutoTableObjectPicker.tsx +0 -181
  590. package/src/pages/index/components/AutoTable/AutoTableOvList.tsx +0 -80
  591. package/src/pages/index/components/AutoTable/AutoTableProductList.tsx +0 -98
  592. package/src/pages/index/components/AutoTable/AutoTableRowFormatter.tsx +0 -58
  593. package/src/pages/index/components/AutoTable/FixedHeightAutoRow.tsx +0 -50
  594. package/src/pages/index/components/AutoTable/FixedHeightFixedRow.tsx +0 -49
  595. package/src/pages/index/components/bus/DemoAddress.tsx +0 -181
  596. package/src/pages/index/components/bus/DemoAddressCascade.tsx +0 -132
  597. package/src/pages/index/components/bus/DemoFilter.tsx +0 -184
  598. package/src/pages/index/components/columns/DemoPlcAddress.tsx +0 -161
  599. package/src/pages/index/components/columns/DemoPlcDate.tsx +0 -363
  600. package/src/pages/index/components/columns/DemoPlcSelect.tsx +0 -505
  601. package/src/pages/index/components/columns/DemoPlcTime.tsx +0 -293
  602. package/src/pages/index/components/columns/DemoTableColumns.tsx +0 -88
  603. package/src/pages/index/components/form/DemoFormBasic.tsx +0 -516
  604. package/src/pages/index/components/form/DemoFormBlur.tsx +0 -204
  605. package/src/pages/index/components/form/DemoFormDynamicFields.tsx +0 -54
  606. package/src/pages/index/components/form/DemoFormEditControl.tsx +0 -164
  607. package/src/pages/index/components/form/DemoFormElement.tsx +0 -207
  608. package/src/pages/index/components/form/DemoFormLayout.scss +0 -7
  609. package/src/pages/index/components/form/DemoFormLayout.tsx +0 -311
  610. package/src/pages/index/components/form/DemoFormSimplify.tsx +0 -587
  611. package/src/pages/index/components/form/DemoFormSize.tsx +0 -274
  612. package/src/pages/index/components/form/DemoFormVertical.tsx +0 -280
  613. package/src/pages/index/components/normal/DemoAlert.tsx +0 -66
  614. package/src/pages/index/components/normal/DemoBadge.tsx +0 -53
  615. package/src/pages/index/components/normal/DemoButton.tsx +0 -300
  616. package/src/pages/index/components/normal/DemoCard.tsx +0 -176
  617. package/src/pages/index/components/normal/DemoCarousel.tsx +0 -125
  618. package/src/pages/index/components/normal/DemoCascade.tsx +0 -880
  619. package/src/pages/index/components/normal/DemoCheckbox.scss +0 -24
  620. package/src/pages/index/components/normal/DemoCheckbox.tsx +0 -294
  621. package/src/pages/index/components/normal/DemoCollapse.tsx +0 -104
  622. package/src/pages/index/components/normal/DemoColor.scss +0 -20
  623. package/src/pages/index/components/normal/DemoColor.tsx +0 -82
  624. package/src/pages/index/components/normal/DemoColorPicker.tsx +0 -163
  625. package/src/pages/index/components/normal/DemoDate.tsx +0 -443
  626. package/src/pages/index/components/normal/DemoDialog.tsx +0 -507
  627. package/src/pages/index/components/normal/DemoDropdown.tsx +0 -463
  628. package/src/pages/index/components/normal/DemoGrid.scss +0 -26
  629. package/src/pages/index/components/normal/DemoGrid.tsx +0 -181
  630. package/src/pages/index/components/normal/DemoIcon.tsx +0 -39
  631. package/src/pages/index/components/normal/DemoImage.tsx +0 -122
  632. package/src/pages/index/components/normal/DemoInput.scss +0 -0
  633. package/src/pages/index/components/normal/DemoInput.tsx +0 -790
  634. package/src/pages/index/components/normal/DemoKeepAlive.tsx +0 -505
  635. package/src/pages/index/components/normal/DemoLayout.tsx +0 -144
  636. package/src/pages/index/components/normal/DemoList.scss +0 -15
  637. package/src/pages/index/components/normal/DemoList.tsx +0 -82
  638. package/src/pages/index/components/normal/DemoLoading.tsx +0 -86
  639. package/src/pages/index/components/normal/DemoNumber.tsx +0 -266
  640. package/src/pages/index/components/normal/DemoPagination.tsx +0 -164
  641. package/src/pages/index/components/normal/DemoPopup.tsx +0 -695
  642. package/src/pages/index/components/normal/DemoProgress.tsx +0 -133
  643. package/src/pages/index/components/normal/DemoRadio.scss +0 -16
  644. package/src/pages/index/components/normal/DemoRadio.tsx +0 -188
  645. package/src/pages/index/components/normal/DemoRate.tsx +0 -77
  646. package/src/pages/index/components/normal/DemoScroll.scss +0 -22
  647. package/src/pages/index/components/normal/DemoScroll.tsx +0 -300
  648. package/src/pages/index/components/normal/DemoSegment.tsx +0 -71
  649. package/src/pages/index/components/normal/DemoSelect.tsx +0 -819
  650. package/src/pages/index/components/normal/DemoSlider.tsx +0 -128
  651. package/src/pages/index/components/normal/DemoStep.scss +0 -18
  652. package/src/pages/index/components/normal/DemoStep.tsx +0 -291
  653. package/src/pages/index/components/normal/DemoTab.tsx +0 -338
  654. package/src/pages/index/components/normal/DemoTag.tsx +0 -100
  655. package/src/pages/index/components/normal/DemoTime.tsx +0 -403
  656. package/src/pages/index/components/normal/DemoToggle.tsx +0 -56
  657. package/src/pages/index/components/normal/DemoTooltip.tsx +0 -120
  658. package/src/pages/index/components/normal/DemoTree.tsx +0 -1168
  659. package/src/pages/index/components/normal/DemoUpload.tsx +0 -484
  660. package/src/pages/index/components/normal/DemoVirtualList.tsx +0 -378
  661. package/src/pages/index/components/service/DemoDialogService.tsx +0 -248
  662. package/src/pages/index/components/service/DemoFileService.tsx +0 -110
  663. package/src/pages/index/components/service/DemoMessageService.tsx +0 -100
  664. package/src/pages/index/components/service/DemoNoticeService.tsx +0 -99
  665. package/src/pages/index/components/service/DemoPopupService.tsx +0 -325
  666. package/src/pages/index/components/table/DemoPlcOperation.tsx +0 -307
  667. package/src/pages/index/components/table/DemoTableBasic.tsx +0 -220
  668. package/src/pages/index/components/table/DemoTableCheck.tsx +0 -78
  669. package/src/pages/index/components/table/DemoTableClassAndStyle.scss +0 -18
  670. package/src/pages/index/components/table/DemoTableClassAndStyle.tsx +0 -112
  671. package/src/pages/index/components/table/DemoTableColDraggable.tsx +0 -80
  672. package/src/pages/index/components/table/DemoTableEdit.tsx +0 -136
  673. package/src/pages/index/components/table/DemoTableExpand.tsx +0 -181
  674. package/src/pages/index/components/table/DemoTableFixed.tsx +0 -131
  675. package/src/pages/index/components/table/DemoTableFormatter.tsx +0 -66
  676. package/src/pages/index/components/table/DemoTableOverflowTooltip.tsx +0 -67
  677. package/src/pages/index/components/table/DemoTableRowDraggable.tsx +0 -106
  678. package/src/pages/index/components/table/DemoTableSlots.tsx +0 -153
  679. package/src/pages/index/components/table/DemoTableSpan.tsx +0 -167
  680. package/src/pages/index/components/table/DemoTableTree.tsx +0 -976
  681. package/src/pages/index/components/table/DemoVirtualTable.tsx +0 -274
  682. package/src/pages/index/components/test/DemoI18n.tsx +0 -27
  683. package/src/pages/index/components/test/DemoI18n2.jsx +0 -11
  684. package/src/pages/index/home/AppContent.tsx +0 -69
  685. package/src/pages/index/home/AppHead.tsx +0 -105
  686. package/src/pages/index/home/AppHome.tsx +0 -16
  687. package/src/pages/index/home/AppMenu.tsx +0 -38
  688. package/src/pages/index/home/menus.tsx +0 -218
  689. package/src/pages/index/home/plain-design.png +0 -0
  690. package/src/pages/index/main.tsx +0 -23
  691. package/src/pages/index/nav/$nav.ts +0 -41
  692. package/src/pages/index/pages.d.ts +0 -6
  693. package/src/pages/libs/iconfont-fontcls/demo.css +0 -539
  694. package/src/pages/libs/iconfont-fontcls/demo_index.html +0 -303
  695. package/src/pages/libs/iconfont-fontcls/iconfont.css +0 -35
  696. package/src/pages/libs/iconfont-fontcls/iconfont.js +0 -1
  697. package/src/pages/libs/iconfont-fontcls/iconfont.json +0 -44
  698. package/src/pages/libs/iconfont-fontcls/iconfont.ttf +0 -0
  699. package/src/pages/libs/iconfont-fontcls/iconfont.woff +0 -0
  700. package/src/pages/libs/iconfont-fontcls/iconfont.woff2 +0 -0
  701. package/src/pages/libs/iconfont-symbol/demo.css +0 -539
  702. package/src/pages/libs/iconfont-symbol/demo_index.html +0 -303
  703. package/src/pages/libs/iconfont-symbol/iconfont.css +0 -35
  704. package/src/pages/libs/iconfont-symbol/iconfont.js +0 -1
  705. package/src/pages/libs/iconfont-symbol/iconfont.json +0 -44
  706. package/src/pages/libs/iconfont-symbol/iconfont.ttf +0 -0
  707. package/src/pages/libs/iconfont-symbol/iconfont.woff +0 -0
  708. package/src/pages/libs/iconfont-symbol/iconfont.woff2 +0 -0
  709. package/src/pages/libs/install.iconfont-fontcls.tsx +0 -11
  710. package/src/pages/libs/install.iconfont-symbol.scss +0 -7
  711. package/src/pages/libs/install.iconfont-symbol.tsx +0 -14
  712. package/src/pages/module/address.ts +0 -27
  713. package/src/pages/module/http.ts +0 -24
  714. package/src/pages/module/index.ts +0 -19
  715. package/src/pages/module/object.ts +0 -5
  716. package/src/pages/module/ov.tsx +0 -13
  717. package/src/pages/module/upload.ts +0 -9
  718. package/src/pages/module/useTableOption.ts +0 -28
@@ -1,7 +1,7 @@
1
- import {computed, designComponent, getComponentCls, iMouseEvent, PropType, reactive, useClasses, useRefs, useStyles, watch} from 'plain-design-composition';
1
+ import {computed, designComponent, getComponentCls, iMouseEvent, PropType, reactive, useClasses, useRefs, useStyles, watch} from '@peryl/react-compose';
2
2
  import './image.scss';
3
- import {unit} from "plain-utils/string/unit";
4
- import {createEnum} from "plain-utils/utils/createEnum";
3
+ import {unit} from "@peryl/utils/unit";
4
+ import {createEnum} from "@peryl/utils/createEnum";
5
5
  import {Icon} from "../Icon";
6
6
  import {$image} from "../$image";
7
7
  import {LoadingMask} from "../LoadingMask";
@@ -30,6 +30,14 @@ export const ImagePropsOptions = {
30
30
  alt: { type: String }, // 图片描述
31
31
  fit: { type: String as PropType<typeof eImageFit.TYPE>, default: eImageFit.cover },// 图片 object-fit 属性
32
32
  position: { type: String, default: 'top center' }, // 图片 object-position 属性
33
+ maxHeight: { type: [String, Number] }, // 最大高度
34
+ minHeight: { type: [String, Number] }, // 最小高度
35
+ maxWidth: { type: [String, Number] }, // 最大宽度
36
+ minWidth: { type: [String, Number] }, // 最小宽度
37
+ width: { type: [String, Number] }, // 图片宽度
38
+ height: { type: [String, Number] }, // 图片高度
39
+ hideTips: { type: Boolean }, // 隐藏提示文本
40
+ urlPrefix: { type: String }, // 图片地址前缀
33
41
  };
34
42
 
35
43
  /**
@@ -56,16 +64,9 @@ export const Image = designComponent({
56
64
  formatImagePath,
57
65
  },
58
66
  props: {
59
- src: { type: String as PropType<string | null> }, // 图片地址
60
- status: { type: String as PropType<typeof eImageStatus.TYPE> }, // 当前转股固态,fill, container, cover, none, scale-down
61
- previewOnClick: { type: Boolean, default: true }, // 是否点击的时候放大预览图片
62
- maxHeight: { type: [String, Number] }, // 最大高度
63
- minHeight: { type: [String, Number] }, // 最小高度
64
- maxWidth: { type: [String, Number] }, // 最大宽度
65
- minWidth: { type: [String, Number] }, // 最小宽度
66
- width: { type: [String, Number] }, // 图片宽度
67
- height: { type: [String, Number] }, // 图片高度
68
- urlPrefix: { type: String }, // 图片地址前缀
67
+ src: { type: String as PropType<string | null> }, // 图片地址
68
+ status: { type: String as PropType<typeof eImageStatus.TYPE> }, // 当前状态
69
+ previewOnClick: { type: Boolean, default: true }, // 是否点击的时候放大预览图片
69
70
  ...ImagePropsOptions,
70
71
  },
71
72
  emits: {
@@ -99,6 +100,7 @@ export const Image = designComponent({
99
100
  emit.onSuccess(state.src!);
100
101
  };
101
102
  image.onerror = (e) => {
103
+ console.error(`load image error: ${image.src}`, e, props.urlPrefix);
102
104
  state.status = eImageStatus.error;
103
105
  emit.onError(e);
104
106
  };
@@ -125,9 +127,9 @@ export const Image = designComponent({
125
127
  });
126
128
 
127
129
  const tip = {
128
- [eImageStatus.empty]: i18n('image.noPicture').d('无图片'),
129
- [eImageStatus.pending]: i18n('base.loading').d('加载中'),
130
- [eImageStatus.error]: i18n('base.loadFailed').d('加载失败'),
130
+ [eImageStatus.empty]: i18n.$it('image.noPicture').d('无图片'),
131
+ [eImageStatus.pending]: i18n.$it('base.loading').d('加载中'),
132
+ [eImageStatus.error]: i18n.$it('base.loadFailed').d('加载失败'),
131
133
  };
132
134
 
133
135
  const handler = {
@@ -148,7 +150,7 @@ export const Image = designComponent({
148
150
  return (
149
151
  <div className={classes.value} style={styles.value} onClick={handler.onClick} ref={onRef.el}>
150
152
  <Icon icon={status.value === eImageStatus.error ? 'pi-image-close' : 'pi-image'}/>
151
- <span>{tip[status.value]}</span>
153
+ {!props.hideTips && <span>{tip[status.value]}</span>}
152
154
  {status.value === eImageStatus.pending && (<LoadingMask modelValue={true} maskColor="rgba(255,255,255,0.15)"/>)}
153
155
  </div>
154
156
  );
@@ -0,0 +1,574 @@
1
+ import {computed, designComponent, iHTMLDivElement, onBeforeUnmount, onMounted, PropType, reactive, useClasses, useRefs, useStyles, watch} from "@peryl/react-compose";
2
+ import {getCenterRect, iImagePreviewerOption, ImagePreviewerHooks} from "./image-previewer.utils";
3
+ import {createEffects} from "@peryl/utils/createEffects";
4
+ import {getRectAutoFormat} from "@peryl/utils/getRectAutoFormat";
5
+ import {addElementListener} from "@peryl/utils/addElementListener";
6
+ import {delay} from "@peryl/utils/delay";
7
+ import Carousel from "../Carousel";
8
+ import CarouselItem from "../CarouselItem";
9
+ import {ImagePreviewerGallery} from "./ImagePreviewerGallery";
10
+ import {ImagePreviewerCarouselImage} from "./ImagePreviewerCarouselImage";
11
+ import './image-previewer.scss';
12
+ import {ImagePreviewerButtonBar} from "./ImagePreviewerButtonBar";
13
+ import {addWindowListener} from "@peryl/utils/addWindowListener";
14
+ import $previewer from "../$previewer";
15
+ import {buildCycleIndexList} from "../../utils/buildCycleIndexList";
16
+ import {getDeviceInfo} from "../../utils/getDeviceInfo";
17
+
18
+ export const ImagePreviewer = designComponent({
19
+ name: 'image-preview-component',
20
+ props: {
21
+ option: { type: Object as PropType<iImagePreviewerOption>, required: true },
22
+ closable: { type: Boolean }
23
+ },
24
+ inheritPropsType: iHTMLDivElement,
25
+ setup({ props }) {
26
+
27
+ const { effects: setupEffects } = createEffects();
28
+
29
+ const { refs, onRef } = useRefs({ el: iHTMLDivElement, carousel: Carousel });
30
+
31
+ const state = reactive({
32
+ /*当前显示的图片索引*/
33
+ current: props.option.current || 0,
34
+ /*shadowImageElement显示隐藏有过度时间,这里等过度时间结束再做显示隐藏*/
35
+ show: false,
36
+ aspectRatio: null as null | number,
37
+ closing: false,
38
+ /*标记图片的thumb url已经加载完毕*/
39
+ readyMap: {} as Record<string, boolean | undefined>
40
+ });
41
+
42
+ const classes = useClasses(() => [
43
+ 'image-previewer-component',
44
+ {
45
+ 'image-previewer-component-waiting': !state.show
46
+ }
47
+ ]);
48
+
49
+ const galleryStyles = useStyles(style => {
50
+ style.height = `${props.option.galleryHeight}px`;
51
+ });
52
+
53
+ const maskStyles = useStyles(style => {
54
+ style.backgroundColor = props.option.maskColor || 'rgba(0,0,0,0.9)';
55
+ });
56
+
57
+ const methods = {
58
+ /**
59
+ * 关闭预览
60
+ * @author 韦胜健
61
+ * @date 2024/1/5 11:24
62
+ */
63
+ close: async () => {
64
+ if (state.closing) {return;}
65
+ state.closing = true;
66
+
67
+ const currentImgElement = refs.carousel!.refs.el!.querySelector('img[data-active=true]') as undefined | HTMLImageElement;
68
+ /*当前渲染的图片如果不存在,虽然不可能,这里直接关闭previewer*/
69
+ if (!currentImgElement) {
70
+ $previewer.close(props.option.id);
71
+ return;
72
+ }
73
+
74
+ /*当前正在显示的图片元素,关闭时让这个元素显示一个缩小动画*/
75
+ const currentUrl = props.option.urls[state.current!].url;
76
+ const sourceImgElement = props.option.imageElement?.getAttribute('src') === currentUrl ? props.option.imageElement : (Array.from(document.querySelectorAll('img')) as HTMLImageElement[]).find(i => i.getAttribute('src') === currentUrl && i !== currentImgElement && !i.hasAttribute('data-ignore'));
77
+
78
+ const currentRect = getCenterRect({ imageElement: currentImgElement, containerElement: refs.carousel!.refs.el! });
79
+
80
+ /*页面上原始的图片元素如果存在,则让当前显示的图片元素缩放并且移动到这个原始位置在关闭,否则移动到屏幕正中间在关闭*/
81
+ const sourceRect = !!sourceImgElement ? getRectAutoFormat(sourceImgElement) : (() => {
82
+ const { clientHeight, clientWidth } = document.documentElement;
83
+ const width = 10;
84
+ const height = 10;
85
+ const top = Number(((clientHeight - height) / 2).toFixed(2));
86
+ const left = Number(((clientWidth - width) / 2).toFixed(2));
87
+ return { top, left, width, height };
88
+ })();
89
+
90
+ currentImgElement.style.transition = 'all ease 300ms';
91
+ const newScale = Number(((sourceRect.width / currentRect.width)).toFixed(2));
92
+ const newLeft = Math.ceil(sourceRect.left - (currentRect.left + (currentRect.width * (1 - newScale) / 2)));
93
+ const newTop = Math.ceil(sourceRect.top - (currentRect.top + (currentRect.height * (1 - newScale) / 2)));
94
+ // console.log({ sourceRect, currentRect, newTop, newLeft });
95
+ state.show = false;
96
+ const clearListener = addElementListener(currentImgElement, 'transitionend', () => {
97
+ clearListener();
98
+ if (!!props.option?.imageElement) {
99
+ props.option.imageElement.style.opacity = '';
100
+ }
101
+ $previewer.close(props.option.id);
102
+ });
103
+ await delay(0);
104
+ currentImgElement.style.transform = `translate3d(${newLeft}px,${newTop}px,0) scale(${newScale}) rotate(0)`;
105
+ },
106
+ /**
107
+ * 切换到上一张
108
+ * @author 韦胜健
109
+ * @date 2024/1/8 17:35
110
+ */
111
+ prev: () => {
112
+ let current = state.current - 1;
113
+ if (current < 0) {
114
+ current = props.option.urls.length - 1;
115
+ }
116
+ state.current = current;
117
+ },
118
+ /**
119
+ * 切换到下一张
120
+ * @author 韦胜健
121
+ * @date 2024/1/8 17:35
122
+ */
123
+ next: () => {
124
+ let current = state.current + 1;
125
+ if (current > props.option.urls.length - 1) {
126
+ current = 0;
127
+ }
128
+ state.current = current;
129
+ },
130
+ };
131
+
132
+ const handler = {
133
+ onDoubleClickImage: () => {
134
+ props.closable && methods.close();
135
+ },
136
+ };
137
+
138
+ watch(() => state.current, () => {
139
+ transformHandler.transformMethods.reset();
140
+ if (!!props.option.imageElement) {
141
+ if (props.option.imageElement.style.opacity != props.option.oldSourceImageOpacity) {
142
+ props.option.imageElement.style.opacity = props.option.oldSourceImageOpacity || "";
143
+ }
144
+ }
145
+ });
146
+
147
+ const transformHandler = (() => {
148
+ const transformState = reactive({
149
+ transformData: {
150
+ /*当前缩放的比例*/
151
+ scale: 1,
152
+ /*当前横向移动距离*/
153
+ left: 0,
154
+ /*当前纵向移动距离*/
155
+ top: 0,
156
+ /*当前旋转角度*/
157
+ rotate: 0,
158
+ },
159
+ /*保存开始缩放时当前image的初始大小*/
160
+ currentImageRect: { top: 0, left: 0, height: 0, width: 0 },
161
+ /*是否处于移动端缩小准备退出的状态*/
162
+ mobileClosing: false,
163
+ /*双指缩放状态*/
164
+ mobileScaling: null as null | {
165
+ startScale: number,/*双指拖拽开始时已经缩放的大小*/
166
+ msg?: any,/*调试信息*/
167
+ },
168
+ previousTouchstartTimestamp: 0,
169
+ });
170
+
171
+ const handler = {
172
+ /**
173
+ * 使用鼠标滚轮的时候设置缩放比例
174
+ * @author 韦胜健
175
+ * @date 2024/1/5 14:20
176
+ */
177
+ onWheel: (e: WheelEvent) => {
178
+ if (props.option.disableZoomOnWheel) {
179
+ return;
180
+ }
181
+ e.stopPropagation();
182
+ e.preventDefault();
183
+ transformMethods.setScale(Number((transformState.transformData.scale - e.deltaY / 100 * 0.05).toFixed(2)));
184
+ },
185
+ /**
186
+ * 拖拽的时候处理移动或者缩放
187
+ * @author 韦胜健
188
+ * @date 2024/1/5 14:21
189
+ */
190
+ touchstart: (e: TouchEvent | MouseEvent) => {
191
+
192
+ if ('touches' in e && e.touches.length == 1 && getDeviceInfo().deviceType === 'mobile') {
193
+ const currentTouchstartTimestamp = Date.now();
194
+ if (!!transformState.previousTouchstartTimestamp) {
195
+ if (currentTouchstartTimestamp - transformState.previousTouchstartTimestamp < 200) {
196
+ /*100ms内点击了两次,自动关闭*/
197
+ props.closable && methods.close();
198
+ return;
199
+ }
200
+ }
201
+ transformState.previousTouchstartTimestamp = currentTouchstartTimestamp;
202
+ }
203
+
204
+ /*标记当前是缩放还是移动*/
205
+ let handleType = 'move' as 'scale' | 'move';
206
+
207
+ /*拖拽副作用*/
208
+ const { effects: touchEffects } = createEffects();
209
+
210
+ /**
211
+ * 单指和双指会同时触发touchstart,这里除了双指缩放之外的其他情况要自动停止并且清理掉自身的副作用
212
+ * @author 韦胜健
213
+ * @date 2024/1/9 21:42
214
+ */
215
+ const autoClearIfDoubleTouching = (e: MouseEvent | TouchEvent) => {
216
+ if ('touches' in e && e.touches.length === 2) {
217
+ touchEffects.clear();
218
+ return true;
219
+ }
220
+ return false;
221
+ };
222
+
223
+ if ('touches' in e && e.touches.length > 1) {
224
+ /*如果是双指拖动,则为缩放,否则都是移动*/
225
+ handleType = 'scale';
226
+ }
227
+
228
+ if (handleType === 'move') {
229
+ /*只有缩放/旋转的情况下才能拖拽移动,否则拖拽时右Carousel处理横向切换图片*/
230
+ if (isTransforming.value) {
231
+ /*---------------------------------------(单指/鼠标)拖拽移动-------------------------------------------*/
232
+
233
+ /*拖拽初始状态*/
234
+ let touchState = {
235
+ startX: 'touches' in e ? e.touches[0].clientX : e.clientX,
236
+ startY: 'touches' in e ? e.touches[0].clientY : e.clientY,
237
+ startTop: transformState.transformData.top,
238
+ startLeft: transformState.transformData.left,
239
+ };
240
+ /*处理移动*/
241
+ const touchmove = (e: MouseEvent | TouchEvent) => {
242
+ if (autoClearIfDoubleTouching(e)) {return;}
243
+ e.preventDefault();
244
+ e.stopPropagation();
245
+ const moveX = 'touches' in e ? e.touches[0].clientX : e.clientX;
246
+ const moveY = 'touches' in e ? e.touches[0].clientY : e.clientY;
247
+ transformState.transformData.top = Number((touchState.startTop + (moveY - touchState.startY)).toFixed(2));
248
+ transformState.transformData.left = Number((touchState.startLeft + (moveX - touchState.startX)).toFixed(2));
249
+ };
250
+ touchEffects.push(addWindowListener('touchmove', touchmove, { passive: false }));
251
+ touchEffects.push(addWindowListener('touchend', touchEffects.clear, { passive: false }));
252
+ touchEffects.push(addWindowListener('mousemove', touchmove, { passive: false }));
253
+ touchEffects.push(addWindowListener('mouseup', touchEffects.clear, { passive: false }));
254
+ } else {
255
+ if (getDeviceInfo().deviceType === 'mobile' && 'touches' in e && e.touches.length === 1) {
256
+
257
+ /*---------------------------------------单指拖拽关闭-------------------------------------------*/
258
+ if (props.closable) {
259
+ /*移动端的情况下,如果纵向移动超过一定距离,则一边移动一边缩小,缩小到一定程度关闭预览*/
260
+ let imageElement = (e.currentTarget as HTMLDivElement).querySelector('img') as HTMLImageElement;
261
+ let mobileTouchState = {
262
+ startX: e.touches[0].clientX,
263
+ startY: e.touches[0].clientY,
264
+ touching: null as null | { scale: number },
265
+ };
266
+ const touchmove = (e: TouchEvent) => {
267
+ if (autoClearIfDoubleTouching(e)) {return;}
268
+ e.stopPropagation();
269
+ e.preventDefault();
270
+ let durX = e.touches[0].clientX - mobileTouchState.startX;
271
+ let durY = e.touches[0].clientY - mobileTouchState.startY;
272
+ if (!mobileTouchState.touching) {
273
+ if (durY > durX && durY > 10) {
274
+ transformState.mobileClosing = true;
275
+ mobileTouchState.touching = { scale: 1 };
276
+ /*拖拽结束时的处理动作*/
277
+ touchEffects.push(async () => {
278
+ transformState.mobileClosing = false;
279
+
280
+ if (mobileTouchState.touching!.scale < 0.9) {
281
+ /*取消缩放,改为实际设置大小,是的关闭动画合理*/
282
+ methods.close();
283
+ } else {
284
+ /*取消缩放,还原原来的状态*/
285
+ imageElement.style.transition = "all ease 300ms";
286
+ imageElement.style.transform = "translate3d(0,0,0) scale(1)";
287
+ delay(300).then(() => {
288
+ imageElement.style.transition = "";
289
+ imageElement.style.transform = "";
290
+ });
291
+ }
292
+
293
+ mobileTouchState.touching = null;
294
+ });
295
+ }
296
+ }
297
+ if (!mobileTouchState.touching) {
298
+ return;
299
+ }
300
+ if (durY < 0) {durY = 0;}
301
+ if (durY === 0) {
302
+ /*移动距离为0,不做缩放移动*/
303
+ imageElement.style.transform = '';
304
+ } else {
305
+ /*按照移动距离进行缩放移动*/
306
+ const height = Math.ceil(document.body.clientHeight / 3);
307
+ const scale = Number((1 - durY / height).toFixed(2));
308
+ mobileTouchState.touching.scale = scale;
309
+ imageElement.style.transform = `translate3d(0,${durY}px,0) scale(${scale})`;
310
+ }
311
+ };
312
+ touchEffects.push(addWindowListener('touchmove', touchmove, { passive: false }));
313
+ touchEffects.push(addWindowListener('touchend', touchEffects.clear, { passive: false }));
314
+ }
315
+ }
316
+ }
317
+
318
+ } else {
319
+ /*---------------------------------------双指拖拽缩放-------------------------------------------*/
320
+
321
+ if (!('touches' in e)) {return;}
322
+ const startTouchesDistance = Math.floor(Math.sqrt(Math.pow((e.touches[1].clientX - e.touches[0].clientX), 2) + Math.pow((e.touches[1].clientY - e.touches[0].clientY), 2)));
323
+
324
+ transformState.mobileScaling = { startScale: transformState.transformData.scale };
325
+
326
+ const touchmove = (e: TouchEvent) => {
327
+ e.stopPropagation();
328
+ e.preventDefault();
329
+
330
+ const moveTouchesDistance = Math.floor(Math.sqrt(Math.pow((e.touches[1].clientX - e.touches[0].clientX), 2) + Math.pow((e.touches[1].clientY - e.touches[0].clientY), 2)));
331
+ const durationDistance = Math.floor(moveTouchesDistance - startTouchesDistance);
332
+ const durScale = Number((durationDistance / 300).toFixed(2));
333
+ let newScale = Number((durScale + transformState.mobileScaling!.startScale).toFixed(2));
334
+ if (newScale < 1) {
335
+ newScale = 1;
336
+ }
337
+ transformMethods.setScale(newScale);
338
+ transformState.mobileScaling!.msg = `newScale:${newScale}`;
339
+ };
340
+
341
+ touchEffects.push(() => {
342
+ transformState.mobileScaling = null;
343
+ });
344
+
345
+ touchEffects.push(addWindowListener('touchmove', touchmove, { passive: false, }));
346
+ touchEffects.push(addWindowListener('touchend', touchEffects.clear, { passive: false }));
347
+ }
348
+ },
349
+ };
350
+
351
+ const transformStyles = useStyles(style => {
352
+ let left = transformState.transformData.left;
353
+ let top = transformState.transformData.top;
354
+
355
+ if (transformState.transformData.scale != 1) {
356
+
357
+ /**
358
+ * 限制位置不能超过边界
359
+ * @author 韦胜健
360
+ * @date 2024/1/5 15:47
361
+ */
362
+
363
+ let { clientHeight, clientWidth } = refs.carousel!.refs.el!;
364
+
365
+ const currentWidth = Number((transformState.currentImageRect.width * transformState.transformData.scale).toFixed(0));
366
+ const currentHeight = Number((transformState.currentImageRect.height * transformState.transformData.scale).toFixed(0));
367
+
368
+ if (currentWidth > clientWidth) {
369
+ const overWidth = Number(((currentWidth - clientWidth) / 2).toFixed(2));
370
+ if (left < -overWidth) {
371
+ left = -overWidth;
372
+ }
373
+ if (left > overWidth) {
374
+ left = overWidth;
375
+ }
376
+ } else {
377
+ left = 0;
378
+ }
379
+
380
+ if (currentHeight > clientHeight) {
381
+ const overHeight = Number(((currentHeight - clientHeight) / 2).toFixed(2));
382
+ if (top < -overHeight) {
383
+ top = -overHeight;
384
+ }
385
+ if (top > overHeight) {
386
+ top = overHeight;
387
+ }
388
+ } else {
389
+ top = 0;
390
+ }
391
+ }
392
+
393
+ style.transform = `translate3d(${left}px,${top}px,0) scale(${transformState.transformData.scale}) rotate(${transformState.transformData.rotate}deg)`;
394
+ });
395
+
396
+ const isTransforming = computed(() => !!transformState.mobileClosing || !!transformState.mobileScaling || transformState.transformData.scale != 1 || transformState.transformData.top != 0 || transformState.transformData.left != 0 || transformState.transformData.rotate != 0);
397
+
398
+ const transformMethods = {
399
+ zoomIn: () => {
400
+ transformMethods.setScale(Number((transformState.transformData.scale + 0.25).toFixed(1)));
401
+ },
402
+ zoomOut: () => {
403
+ transformMethods.setScale(Number((transformState.transformData.scale - 0.25).toFixed(1)));
404
+ },
405
+ anticlockwise: () => {
406
+ transformState.transformData.rotate = Number((transformState.transformData.rotate - 45).toFixed(1));
407
+ },
408
+ clockwise: () => {
409
+ transformState.transformData.rotate = Number((transformState.transformData.rotate + 45).toFixed(1));
410
+ },
411
+ /**
412
+ * 设置缩放比例,当比例小于1时设置为1,并且重置所有变化
413
+ * @author 韦胜健
414
+ * @date 2024/1/5 14:20
415
+ */
416
+ setScale: (val: number) => {
417
+ if (val < 1) {
418
+ val = 1;
419
+ }
420
+ if (val == transformState.transformData.scale) {
421
+ return;
422
+ }
423
+ if (transformState.transformData.scale === 1) {
424
+ /*保存图片初始的大小尺寸*/
425
+ transformState.currentImageRect = getRectAutoFormat(refs.el?.querySelector('img[data-active=true]') as HTMLImageElement);
426
+ }
427
+ if (val === 1) {
428
+ transformMethods.reset();
429
+ } else {
430
+ transformState.transformData.scale = val;
431
+ }
432
+ },
433
+ /**
434
+ * 重置所有变化
435
+ * @author 韦胜健
436
+ * @date 2024/1/5 14:20
437
+ */
438
+ reset: () => {
439
+ transformState.transformData = {
440
+ scale: 1,
441
+ left: 0,
442
+ top: 0,
443
+ rotate: 0,
444
+ };
445
+ },
446
+ };
447
+
448
+ return { transformState, handler, isTransforming, transformStyles, transformMethods };
449
+ })();
450
+
451
+ const carouselOptimizer = (() => {
452
+
453
+ /*原始索引映射到环列表,在环列表中距离当前显示的索引的距离*/
454
+ const index2distance = computed(() => {
455
+ return buildCycleIndexList({ length: props.option.urls.length, current: state.current }).index2distance;
456
+ });
457
+
458
+ const isShow = (sourceIndex: number) => Math.abs(index2distance.value[sourceIndex]) < 2;
459
+
460
+ return {
461
+ isShow
462
+ };
463
+ })();
464
+
465
+ const keyboardHandler = (() => {
466
+ let isHovering = false;
467
+ const onMousemove = () => isHovering = true;
468
+ const onMouseleave = () => isHovering = false;
469
+ const initialize = () => {
470
+ if (!props.option.globalKeyboardEvent) {
471
+ setupEffects.push(addElementListener(refs.el!, 'mousemove', onMousemove));
472
+ setupEffects.push(addElementListener(refs.el!, 'mouseleave', onMouseleave));
473
+ }
474
+ setupEffects.push(
475
+ addWindowListener('keydown', e => {
476
+ if (!props.option.globalKeyboardEvent) {
477
+ if (!isHovering) {return;}
478
+ }
479
+ if (e.keyCode === 27) {
480
+ if (props.option.button == false || (typeof props.option.button === "object" && props.option.button.close == false)) {
481
+ return;
482
+ }
483
+ methods.close();
484
+ } else if (e.keyCode === 37) {
485
+ methods.prev();
486
+ } else if (e.keyCode === 39) {
487
+ methods.next();
488
+ }
489
+ })
490
+ );
491
+ };
492
+ return {
493
+ initialize,
494
+ };
495
+ })();
496
+
497
+ onMounted(async () => {
498
+ state.aspectRatio = refs.el!.offsetWidth / refs.el!.offsetHeight;
499
+ await delay(23);
500
+ state.show = true;
501
+ setupEffects.push(addElementListener(refs.el!, 'wheel', transformHandler.handler.onWheel));
502
+ keyboardHandler.initialize();
503
+ });
504
+
505
+ onBeforeUnmount(setupEffects.clear);
506
+
507
+ return () => (
508
+ <div className={classes.value} ref={onRef.el} onDoubleClick={handler.onDoubleClickImage}>
509
+ {state.aspectRatio != null && <>
510
+ {!!props.option.mask && <div className="image-previewer-component-mask" style={maskStyles.value}/>}
511
+ <Carousel
512
+ ref={onRef.carousel}
513
+ autoPlay={0}
514
+ v-model={state.current}
515
+ height={props.option.autoHeight ? undefined : `calc(100% - ${props.option.galleryHeight}px)`}
516
+ style={{ paddingBottom: `${props.option.separatorHeight}px` }}
517
+ disableSwiper={transformHandler.isTransforming.value}
518
+ largeSwitchButton
519
+ switchButton={props.option.swipeButton == false ? false : undefined}
520
+ nextSwitchButtonTip="下一张(右按键)"
521
+ prevSwitchButtonTip="上一张(左按键)"
522
+ >
523
+ {props.option.urls.map((item, index) => (
524
+ <CarouselItem
525
+ key={index}
526
+ val={index}
527
+ onMousedownInner={index === state.current ? transformHandler.handler.touchstart : undefined}
528
+ onTouchstartInner={index === state.current ? transformHandler.handler.touchstart : undefined}
529
+ loading={state.readyMap[item.url] !== true}
530
+ >
531
+ {carouselOptimizer.isShow(index) && (
532
+ <ImagePreviewerCarouselImage
533
+ direction={props.option.autoHeight ? 'horizontal' : undefined}
534
+ clientRatio={state.aspectRatio!}
535
+ data-active={String(index === state.current)}
536
+ src={item.url}
537
+ style={index === state.current && transformHandler.isTransforming.value ? transformHandler.transformStyles.value : undefined}
538
+ onReady={() => {
539
+ state.readyMap = {
540
+ ...state.readyMap,
541
+ [item.url]: true,
542
+ };
543
+ index === state.current && ImagePreviewerHooks.onImagePreviewerReady.exec({ option: props.option });
544
+ }}
545
+ />
546
+ )}
547
+ </CarouselItem>
548
+ ))}
549
+ </Carousel>
550
+ {props.option.gallery != false && (
551
+ <ImagePreviewerGallery
552
+ option={props.option}
553
+ v-model={state.current}
554
+ style={galleryStyles.value}
555
+ />
556
+ )}
557
+ {props.option.button !== false && (
558
+ <ImagePreviewerButtonBar
559
+ button={props.option.button}
560
+
561
+ onZoomIn={transformHandler.transformMethods.zoomIn}
562
+ onZoomOut={transformHandler.transformMethods.zoomOut}
563
+ onAnticlockwise={transformHandler.transformMethods.anticlockwise}
564
+ onClockwise={transformHandler.transformMethods.clockwise}
565
+ onReset={transformHandler.transformMethods.reset}
566
+ onClose={methods.close}
567
+ />
568
+ )}
569
+ </>}
570
+ {/*<div style={{ position: 'fixed', top: '0', left: '0', width: '100%' }}>{JSON.stringify(transformHandler.transformState.mobileScaling)}</div>*/}
571
+ </div>
572
+ );
573
+ },
574
+ });